1 /* Generated by Cython 0.29.12 */
2 
3 /* BEGIN: Cython Metadata
4 {
5     "distutils": {
6         "depends": [
7             "yt/utilities/lib/tsearch.h"
8         ],
9         "include_dirs": [
10             "yt/utilities/lib/"
11         ],
12         "libraries": [
13             "m"
14         ],
15         "name": "yt.frontends.ramses.io_utils",
16         "sources": [
17             "yt/frontends/ramses/io_utils.pyx"
18         ]
19     },
20     "module_name": "yt.frontends.ramses.io_utils"
21 }
22 END: Cython Metadata */
23 
24 #define PY_SSIZE_T_CLEAN
25 #include "Python.h"
26 #ifndef Py_PYTHON_H
27     #error Python headers needed to compile C extensions, please install development version of Python.
28 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
29     #error Cython requires Python 2.6+ or Python 3.3+.
30 #else
31 #define CYTHON_ABI "0_29_12"
32 #define CYTHON_HEX_VERSION 0x001D0CF0
33 #define CYTHON_FUTURE_DIVISION 0
34 #include <stddef.h>
35 #ifndef offsetof
36   #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
37 #endif
38 #if !defined(WIN32) && !defined(MS_WINDOWS)
39   #ifndef __stdcall
40     #define __stdcall
41   #endif
42   #ifndef __cdecl
43     #define __cdecl
44   #endif
45   #ifndef __fastcall
46     #define __fastcall
47   #endif
48 #endif
49 #ifndef DL_IMPORT
50   #define DL_IMPORT(t) t
51 #endif
52 #ifndef DL_EXPORT
53   #define DL_EXPORT(t) t
54 #endif
55 #define __PYX_COMMA ,
56 #ifndef HAVE_LONG_LONG
57   #if PY_VERSION_HEX >= 0x02070000
58     #define HAVE_LONG_LONG
59   #endif
60 #endif
61 #ifndef PY_LONG_LONG
62   #define PY_LONG_LONG LONG_LONG
63 #endif
64 #ifndef Py_HUGE_VAL
65   #define Py_HUGE_VAL HUGE_VAL
66 #endif
67 #ifdef PYPY_VERSION
68   #define CYTHON_COMPILING_IN_PYPY 1
69   #define CYTHON_COMPILING_IN_PYSTON 0
70   #define CYTHON_COMPILING_IN_CPYTHON 0
71   #undef CYTHON_USE_TYPE_SLOTS
72   #define CYTHON_USE_TYPE_SLOTS 0
73   #undef CYTHON_USE_PYTYPE_LOOKUP
74   #define CYTHON_USE_PYTYPE_LOOKUP 0
75   #if PY_VERSION_HEX < 0x03050000
76     #undef CYTHON_USE_ASYNC_SLOTS
77     #define CYTHON_USE_ASYNC_SLOTS 0
78   #elif !defined(CYTHON_USE_ASYNC_SLOTS)
79     #define CYTHON_USE_ASYNC_SLOTS 1
80   #endif
81   #undef CYTHON_USE_PYLIST_INTERNALS
82   #define CYTHON_USE_PYLIST_INTERNALS 0
83   #undef CYTHON_USE_UNICODE_INTERNALS
84   #define CYTHON_USE_UNICODE_INTERNALS 0
85   #undef CYTHON_USE_UNICODE_WRITER
86   #define CYTHON_USE_UNICODE_WRITER 0
87   #undef CYTHON_USE_PYLONG_INTERNALS
88   #define CYTHON_USE_PYLONG_INTERNALS 0
89   #undef CYTHON_AVOID_BORROWED_REFS
90   #define CYTHON_AVOID_BORROWED_REFS 1
91   #undef CYTHON_ASSUME_SAFE_MACROS
92   #define CYTHON_ASSUME_SAFE_MACROS 0
93   #undef CYTHON_UNPACK_METHODS
94   #define CYTHON_UNPACK_METHODS 0
95   #undef CYTHON_FAST_THREAD_STATE
96   #define CYTHON_FAST_THREAD_STATE 0
97   #undef CYTHON_FAST_PYCALL
98   #define CYTHON_FAST_PYCALL 0
99   #undef CYTHON_PEP489_MULTI_PHASE_INIT
100   #define CYTHON_PEP489_MULTI_PHASE_INIT 0
101   #undef CYTHON_USE_TP_FINALIZE
102   #define CYTHON_USE_TP_FINALIZE 0
103   #undef CYTHON_USE_DICT_VERSIONS
104   #define CYTHON_USE_DICT_VERSIONS 0
105   #undef CYTHON_USE_EXC_INFO_STACK
106   #define CYTHON_USE_EXC_INFO_STACK 0
107 #elif defined(PYSTON_VERSION)
108   #define CYTHON_COMPILING_IN_PYPY 0
109   #define CYTHON_COMPILING_IN_PYSTON 1
110   #define CYTHON_COMPILING_IN_CPYTHON 0
111   #ifndef CYTHON_USE_TYPE_SLOTS
112     #define CYTHON_USE_TYPE_SLOTS 1
113   #endif
114   #undef CYTHON_USE_PYTYPE_LOOKUP
115   #define CYTHON_USE_PYTYPE_LOOKUP 0
116   #undef CYTHON_USE_ASYNC_SLOTS
117   #define CYTHON_USE_ASYNC_SLOTS 0
118   #undef CYTHON_USE_PYLIST_INTERNALS
119   #define CYTHON_USE_PYLIST_INTERNALS 0
120   #ifndef CYTHON_USE_UNICODE_INTERNALS
121     #define CYTHON_USE_UNICODE_INTERNALS 1
122   #endif
123   #undef CYTHON_USE_UNICODE_WRITER
124   #define CYTHON_USE_UNICODE_WRITER 0
125   #undef CYTHON_USE_PYLONG_INTERNALS
126   #define CYTHON_USE_PYLONG_INTERNALS 0
127   #ifndef CYTHON_AVOID_BORROWED_REFS
128     #define CYTHON_AVOID_BORROWED_REFS 0
129   #endif
130   #ifndef CYTHON_ASSUME_SAFE_MACROS
131     #define CYTHON_ASSUME_SAFE_MACROS 1
132   #endif
133   #ifndef CYTHON_UNPACK_METHODS
134     #define CYTHON_UNPACK_METHODS 1
135   #endif
136   #undef CYTHON_FAST_THREAD_STATE
137   #define CYTHON_FAST_THREAD_STATE 0
138   #undef CYTHON_FAST_PYCALL
139   #define CYTHON_FAST_PYCALL 0
140   #undef CYTHON_PEP489_MULTI_PHASE_INIT
141   #define CYTHON_PEP489_MULTI_PHASE_INIT 0
142   #undef CYTHON_USE_TP_FINALIZE
143   #define CYTHON_USE_TP_FINALIZE 0
144   #undef CYTHON_USE_DICT_VERSIONS
145   #define CYTHON_USE_DICT_VERSIONS 0
146   #undef CYTHON_USE_EXC_INFO_STACK
147   #define CYTHON_USE_EXC_INFO_STACK 0
148 #else
149   #define CYTHON_COMPILING_IN_PYPY 0
150   #define CYTHON_COMPILING_IN_PYSTON 0
151   #define CYTHON_COMPILING_IN_CPYTHON 1
152   #ifndef CYTHON_USE_TYPE_SLOTS
153     #define CYTHON_USE_TYPE_SLOTS 1
154   #endif
155   #if PY_VERSION_HEX < 0x02070000
156     #undef CYTHON_USE_PYTYPE_LOOKUP
157     #define CYTHON_USE_PYTYPE_LOOKUP 0
158   #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
159     #define CYTHON_USE_PYTYPE_LOOKUP 1
160   #endif
161   #if PY_MAJOR_VERSION < 3
162     #undef CYTHON_USE_ASYNC_SLOTS
163     #define CYTHON_USE_ASYNC_SLOTS 0
164   #elif !defined(CYTHON_USE_ASYNC_SLOTS)
165     #define CYTHON_USE_ASYNC_SLOTS 1
166   #endif
167   #if PY_VERSION_HEX < 0x02070000
168     #undef CYTHON_USE_PYLONG_INTERNALS
169     #define CYTHON_USE_PYLONG_INTERNALS 0
170   #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
171     #define CYTHON_USE_PYLONG_INTERNALS 1
172   #endif
173   #ifndef CYTHON_USE_PYLIST_INTERNALS
174     #define CYTHON_USE_PYLIST_INTERNALS 1
175   #endif
176   #ifndef CYTHON_USE_UNICODE_INTERNALS
177     #define CYTHON_USE_UNICODE_INTERNALS 1
178   #endif
179   #if PY_VERSION_HEX < 0x030300F0
180     #undef CYTHON_USE_UNICODE_WRITER
181     #define CYTHON_USE_UNICODE_WRITER 0
182   #elif !defined(CYTHON_USE_UNICODE_WRITER)
183     #define CYTHON_USE_UNICODE_WRITER 1
184   #endif
185   #ifndef CYTHON_AVOID_BORROWED_REFS
186     #define CYTHON_AVOID_BORROWED_REFS 0
187   #endif
188   #ifndef CYTHON_ASSUME_SAFE_MACROS
189     #define CYTHON_ASSUME_SAFE_MACROS 1
190   #endif
191   #ifndef CYTHON_UNPACK_METHODS
192     #define CYTHON_UNPACK_METHODS 1
193   #endif
194   #ifndef CYTHON_FAST_THREAD_STATE
195     #define CYTHON_FAST_THREAD_STATE 1
196   #endif
197   #ifndef CYTHON_FAST_PYCALL
198     #define CYTHON_FAST_PYCALL 1
199   #endif
200   #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
201     #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
202   #endif
203   #ifndef CYTHON_USE_TP_FINALIZE
204     #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
205   #endif
206   #ifndef CYTHON_USE_DICT_VERSIONS
207     #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
208   #endif
209   #ifndef CYTHON_USE_EXC_INFO_STACK
210     #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
211   #endif
212 #endif
213 #if !defined(CYTHON_FAST_PYCCALL)
214 #define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
215 #endif
216 #if CYTHON_USE_PYLONG_INTERNALS
217   #include "longintrepr.h"
218   #undef SHIFT
219   #undef BASE
220   #undef MASK
221   #ifdef SIZEOF_VOID_P
222     enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
223   #endif
224 #endif
225 #ifndef __has_attribute
226   #define __has_attribute(x) 0
227 #endif
228 #ifndef __has_cpp_attribute
229   #define __has_cpp_attribute(x) 0
230 #endif
231 #ifndef CYTHON_RESTRICT
232   #if defined(__GNUC__)
233     #define CYTHON_RESTRICT __restrict__
234   #elif defined(_MSC_VER) && _MSC_VER >= 1400
235     #define CYTHON_RESTRICT __restrict
236   #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
237     #define CYTHON_RESTRICT restrict
238   #else
239     #define CYTHON_RESTRICT
240   #endif
241 #endif
242 #ifndef CYTHON_UNUSED
243 # if defined(__GNUC__)
244 #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
245 #     define CYTHON_UNUSED __attribute__ ((__unused__))
246 #   else
247 #     define CYTHON_UNUSED
248 #   endif
249 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
250 #   define CYTHON_UNUSED __attribute__ ((__unused__))
251 # else
252 #   define CYTHON_UNUSED
253 # endif
254 #endif
255 #ifndef CYTHON_MAYBE_UNUSED_VAR
256 #  if defined(__cplusplus)
CYTHON_MAYBE_UNUSED_VAR(const T &)257      template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
258 #  else
259 #    define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
260 #  endif
261 #endif
262 #ifndef CYTHON_NCP_UNUSED
263 # if CYTHON_COMPILING_IN_CPYTHON
264 #  define CYTHON_NCP_UNUSED
265 # else
266 #  define CYTHON_NCP_UNUSED CYTHON_UNUSED
267 # endif
268 #endif
269 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
270 #ifdef _MSC_VER
271     #ifndef _MSC_STDINT_H_
272         #if _MSC_VER < 1300
273            typedef unsigned char     uint8_t;
274            typedef unsigned int      uint32_t;
275         #else
276            typedef unsigned __int8   uint8_t;
277            typedef unsigned __int32  uint32_t;
278         #endif
279     #endif
280 #else
281    #include <stdint.h>
282 #endif
283 #ifndef CYTHON_FALLTHROUGH
284   #if defined(__cplusplus) && __cplusplus >= 201103L
285     #if __has_cpp_attribute(fallthrough)
286       #define CYTHON_FALLTHROUGH [[fallthrough]]
287     #elif __has_cpp_attribute(clang::fallthrough)
288       #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
289     #elif __has_cpp_attribute(gnu::fallthrough)
290       #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
291     #endif
292   #endif
293   #ifndef CYTHON_FALLTHROUGH
294     #if __has_attribute(fallthrough)
295       #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
296     #else
297       #define CYTHON_FALLTHROUGH
298     #endif
299   #endif
300   #if defined(__clang__ ) && defined(__apple_build_version__)
301     #if __apple_build_version__ < 7000000
302       #undef  CYTHON_FALLTHROUGH
303       #define CYTHON_FALLTHROUGH
304     #endif
305   #endif
306 #endif
307 
308 #ifndef CYTHON_INLINE
309   #if defined(__clang__)
310     #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
311   #elif defined(__GNUC__)
312     #define CYTHON_INLINE __inline__
313   #elif defined(_MSC_VER)
314     #define CYTHON_INLINE __inline
315   #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
316     #define CYTHON_INLINE inline
317   #else
318     #define CYTHON_INLINE
319   #endif
320 #endif
321 
322 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
323   #define Py_OptimizeFlag 0
324 #endif
325 #define __PYX_BUILD_PY_SSIZE_T "n"
326 #define CYTHON_FORMAT_SSIZE_T "z"
327 #if PY_MAJOR_VERSION < 3
328   #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
329   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
330           PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
331   #define __Pyx_DefaultClassType PyClass_Type
332 #else
333   #define __Pyx_BUILTIN_MODULE_NAME "builtins"
334 #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
335   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
336           PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
337 #else
338   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
339           PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
340 #endif
341   #define __Pyx_DefaultClassType PyType_Type
342 #endif
343 #ifndef Py_TPFLAGS_CHECKTYPES
344   #define Py_TPFLAGS_CHECKTYPES 0
345 #endif
346 #ifndef Py_TPFLAGS_HAVE_INDEX
347   #define Py_TPFLAGS_HAVE_INDEX 0
348 #endif
349 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
350   #define Py_TPFLAGS_HAVE_NEWBUFFER 0
351 #endif
352 #ifndef Py_TPFLAGS_HAVE_FINALIZE
353   #define Py_TPFLAGS_HAVE_FINALIZE 0
354 #endif
355 #ifndef METH_STACKLESS
356   #define METH_STACKLESS 0
357 #endif
358 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
359   #ifndef METH_FASTCALL
360      #define METH_FASTCALL 0x80
361   #endif
362   typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
363   typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
364                                                           Py_ssize_t nargs, PyObject *kwnames);
365 #else
366   #define __Pyx_PyCFunctionFast _PyCFunctionFast
367   #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
368 #endif
369 #if CYTHON_FAST_PYCCALL
370 #define __Pyx_PyFastCFunction_Check(func)\
371     ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
372 #else
373 #define __Pyx_PyFastCFunction_Check(func) 0
374 #endif
375 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
376   #define PyObject_Malloc(s)   PyMem_Malloc(s)
377   #define PyObject_Free(p)     PyMem_Free(p)
378   #define PyObject_Realloc(p)  PyMem_Realloc(p)
379 #endif
380 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
381   #define PyMem_RawMalloc(n)           PyMem_Malloc(n)
382   #define PyMem_RawRealloc(p, n)       PyMem_Realloc(p, n)
383   #define PyMem_RawFree(p)             PyMem_Free(p)
384 #endif
385 #if CYTHON_COMPILING_IN_PYSTON
386   #define __Pyx_PyCode_HasFreeVars(co)  PyCode_HasFreeVars(co)
387   #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
388 #else
389   #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
390   #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
391 #endif
392 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
393   #define __Pyx_PyThreadState_Current PyThreadState_GET()
394 #elif PY_VERSION_HEX >= 0x03060000
395   #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
396 #elif PY_VERSION_HEX >= 0x03000000
397   #define __Pyx_PyThreadState_Current PyThreadState_GET()
398 #else
399   #define __Pyx_PyThreadState_Current _PyThreadState_Current
400 #endif
401 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
402 #include "pythread.h"
403 #define Py_tss_NEEDS_INIT 0
404 typedef int Py_tss_t;
PyThread_tss_create(Py_tss_t * key)405 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
406   *key = PyThread_create_key();
407   return 0;
408 }
PyThread_tss_alloc(void)409 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
410   Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
411   *key = Py_tss_NEEDS_INIT;
412   return key;
413 }
PyThread_tss_free(Py_tss_t * key)414 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
415   PyObject_Free(key);
416 }
PyThread_tss_is_created(Py_tss_t * key)417 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
418   return *key != Py_tss_NEEDS_INIT;
419 }
PyThread_tss_delete(Py_tss_t * key)420 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
421   PyThread_delete_key(*key);
422   *key = Py_tss_NEEDS_INIT;
423 }
PyThread_tss_set(Py_tss_t * key,void * value)424 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
425   return PyThread_set_key_value(*key, value);
426 }
PyThread_tss_get(Py_tss_t * key)427 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
428   return PyThread_get_key_value(*key);
429 }
430 #endif
431 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
432 #define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
433 #else
434 #define __Pyx_PyDict_NewPresized(n)  PyDict_New()
435 #endif
436 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
437   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
438   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
439 #else
440   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
441   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
442 #endif
443 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
444 #define __Pyx_PyDict_GetItemStr(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
445 #else
446 #define __Pyx_PyDict_GetItemStr(dict, name)  PyDict_GetItem(dict, name)
447 #endif
448 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
449   #define CYTHON_PEP393_ENABLED 1
450   #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
451                                               0 : _PyUnicode_Ready((PyObject *)(op)))
452   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
453   #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
454   #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
455   #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
456   #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
457   #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
458   #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, ch)
459   #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
460 #else
461   #define CYTHON_PEP393_ENABLED 0
462   #define PyUnicode_1BYTE_KIND  1
463   #define PyUnicode_2BYTE_KIND  2
464   #define PyUnicode_4BYTE_KIND  4
465   #define __Pyx_PyUnicode_READY(op)       (0)
466   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
467   #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
468   #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
469   #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
470   #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
471   #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
472   #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
473   #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_SIZE(u))
474 #endif
475 #if CYTHON_COMPILING_IN_PYPY
476   #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
477   #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
478 #else
479   #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
480   #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
481       PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
482 #endif
483 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
484   #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
485 #endif
486 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
487   #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
488 #endif
489 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
490   #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
491 #endif
492 #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))
493 #define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
494 #if PY_MAJOR_VERSION >= 3
495   #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
496 #else
497   #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
498 #endif
499 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
500   #define PyObject_ASCII(o)            PyObject_Repr(o)
501 #endif
502 #if PY_MAJOR_VERSION >= 3
503   #define PyBaseString_Type            PyUnicode_Type
504   #define PyStringObject               PyUnicodeObject
505   #define PyString_Type                PyUnicode_Type
506   #define PyString_Check               PyUnicode_Check
507   #define PyString_CheckExact          PyUnicode_CheckExact
508   #define PyObject_Unicode             PyObject_Str
509 #endif
510 #if PY_MAJOR_VERSION >= 3
511   #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
512   #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
513 #else
514   #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
515   #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
516 #endif
517 #ifndef PySet_CheckExact
518   #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
519 #endif
520 #if CYTHON_ASSUME_SAFE_MACROS
521   #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
522 #else
523   #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
524 #endif
525 #if PY_MAJOR_VERSION >= 3
526   #define PyIntObject                  PyLongObject
527   #define PyInt_Type                   PyLong_Type
528   #define PyInt_Check(op)              PyLong_Check(op)
529   #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
530   #define PyInt_FromString             PyLong_FromString
531   #define PyInt_FromUnicode            PyLong_FromUnicode
532   #define PyInt_FromLong               PyLong_FromLong
533   #define PyInt_FromSize_t             PyLong_FromSize_t
534   #define PyInt_FromSsize_t            PyLong_FromSsize_t
535   #define PyInt_AsLong                 PyLong_AsLong
536   #define PyInt_AS_LONG                PyLong_AS_LONG
537   #define PyInt_AsSsize_t              PyLong_AsSsize_t
538   #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
539   #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
540   #define PyNumber_Int                 PyNumber_Long
541 #endif
542 #if PY_MAJOR_VERSION >= 3
543   #define PyBoolObject                 PyLongObject
544 #endif
545 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
546   #ifndef PyUnicode_InternFromString
547     #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
548   #endif
549 #endif
550 #if PY_VERSION_HEX < 0x030200A4
551   typedef long Py_hash_t;
552   #define __Pyx_PyInt_FromHash_t PyInt_FromLong
553   #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
554 #else
555   #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
556   #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
557 #endif
558 #if PY_MAJOR_VERSION >= 3
559   #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
560 #else
561   #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
562 #endif
563 #if CYTHON_USE_ASYNC_SLOTS
564   #if PY_VERSION_HEX >= 0x030500B1
565     #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
566     #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
567   #else
568     #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
569   #endif
570 #else
571   #define __Pyx_PyType_AsAsync(obj) NULL
572 #endif
573 #ifndef __Pyx_PyAsyncMethodsStruct
574     typedef struct {
575         unaryfunc am_await;
576         unaryfunc am_aiter;
577         unaryfunc am_anext;
578     } __Pyx_PyAsyncMethodsStruct;
579 #endif
580 
581 #if defined(WIN32) || defined(MS_WINDOWS)
582   #define _USE_MATH_DEFINES
583 #endif
584 #include <math.h>
585 #ifdef NAN
586 #define __PYX_NAN() ((float) NAN)
587 #else
__PYX_NAN()588 static CYTHON_INLINE float __PYX_NAN() {
589   float value;
590   memset(&value, 0xFF, sizeof(value));
591   return value;
592 }
593 #endif
594 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
595 #define __Pyx_truncl trunc
596 #else
597 #define __Pyx_truncl truncl
598 #endif
599 
600 
601 #define __PYX_ERR(f_index, lineno, Ln_error) \
602 { \
603   __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
604 }
605 
606 #ifndef __PYX_EXTERN_C
607   #ifdef __cplusplus
608     #define __PYX_EXTERN_C extern "C"
609   #else
610     #define __PYX_EXTERN_C extern
611   #endif
612 #endif
613 
614 #define __PYX_HAVE__yt__frontends__ramses__io_utils
615 #define __PYX_HAVE_API__yt__frontends__ramses__io_utils
616 /* Early includes */
617 #include <string.h>
618 #include <stdio.h>
619 #include "numpy/arrayobject.h"
620 #include "numpy/ufuncobject.h"
621 #include <float.h>
622 #include <math.h>
623 #include <stdlib.h>
624 #include "tsearch.h"
625 #include "pythread.h"
626 #include "pystate.h"
627 #ifdef _OPENMP
628 #include <omp.h>
629 #endif /* _OPENMP */
630 
631 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
632 #define CYTHON_WITHOUT_ASSERTIONS
633 #endif
634 
635 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
636                 const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
637 
638 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
639 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
640 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
641 #define __PYX_DEFAULT_STRING_ENCODING ""
642 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
643 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
644 #define __Pyx_uchar_cast(c) ((unsigned char)c)
645 #define __Pyx_long_cast(x) ((long)x)
646 #define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
647     (sizeof(type) < sizeof(Py_ssize_t))  ||\
648     (sizeof(type) > sizeof(Py_ssize_t) &&\
649           likely(v < (type)PY_SSIZE_T_MAX ||\
650                  v == (type)PY_SSIZE_T_MAX)  &&\
651           (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
652                                 v == (type)PY_SSIZE_T_MIN)))  ||\
653     (sizeof(type) == sizeof(Py_ssize_t) &&\
654           (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
655                                v == (type)PY_SSIZE_T_MAX)))  )
__Pyx_is_valid_index(Py_ssize_t i,Py_ssize_t limit)656 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
657     return (size_t) i < (size_t) limit;
658 }
659 #if defined (__cplusplus) && __cplusplus >= 201103L
660     #include <cstdlib>
661     #define __Pyx_sst_abs(value) std::abs(value)
662 #elif SIZEOF_INT >= SIZEOF_SIZE_T
663     #define __Pyx_sst_abs(value) abs(value)
664 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
665     #define __Pyx_sst_abs(value) labs(value)
666 #elif defined (_MSC_VER)
667     #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
668 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
669     #define __Pyx_sst_abs(value) llabs(value)
670 #elif defined (__GNUC__)
671     #define __Pyx_sst_abs(value) __builtin_llabs(value)
672 #else
673     #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
674 #endif
675 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
676 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
677 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
678 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
679 #define __Pyx_PyBytes_FromString        PyBytes_FromString
680 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
681 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
682 #if PY_MAJOR_VERSION < 3
683     #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
684     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
685 #else
686     #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
687     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
688 #endif
689 #define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AS_STRING(s))
690 #define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AS_STRING(s))
691 #define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AS_STRING(s))
692 #define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AS_STRING(s))
693 #define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AS_STRING(s))
694 #define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AS_STRING(s))
695 #define __Pyx_PyObject_AsWritableString(s)    ((char*) __Pyx_PyObject_AsString(s))
696 #define __Pyx_PyObject_AsWritableSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
697 #define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
698 #define __Pyx_PyObject_AsSString(s)    ((const signed char*) __Pyx_PyObject_AsString(s))
699 #define __Pyx_PyObject_AsUString(s)    ((const unsigned char*) __Pyx_PyObject_AsString(s))
700 #define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
701 #define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
702 #define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
703 #define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
704 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
__Pyx_Py_UNICODE_strlen(const Py_UNICODE * u)705 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
706     const Py_UNICODE *u_end = u;
707     while (*u_end++) ;
708     return (size_t)(u_end - u - 1);
709 }
710 #define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
711 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
712 #define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
713 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
714 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
715 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
716 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
717 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
718 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
719 #define __Pyx_PySequence_Tuple(obj)\
720     (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
721 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
722 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
723 #if CYTHON_ASSUME_SAFE_MACROS
724 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
725 #else
726 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
727 #endif
728 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
729 #if PY_MAJOR_VERSION >= 3
730 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
731 #else
732 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
733 #endif
734 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
735 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
736 static int __Pyx_sys_getdefaultencoding_not_ascii;
__Pyx_init_sys_getdefaultencoding_params(void)737 static int __Pyx_init_sys_getdefaultencoding_params(void) {
738     PyObject* sys;
739     PyObject* default_encoding = NULL;
740     PyObject* ascii_chars_u = NULL;
741     PyObject* ascii_chars_b = NULL;
742     const char* default_encoding_c;
743     sys = PyImport_ImportModule("sys");
744     if (!sys) goto bad;
745     default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
746     Py_DECREF(sys);
747     if (!default_encoding) goto bad;
748     default_encoding_c = PyBytes_AsString(default_encoding);
749     if (!default_encoding_c) goto bad;
750     if (strcmp(default_encoding_c, "ascii") == 0) {
751         __Pyx_sys_getdefaultencoding_not_ascii = 0;
752     } else {
753         char ascii_chars[128];
754         int c;
755         for (c = 0; c < 128; c++) {
756             ascii_chars[c] = c;
757         }
758         __Pyx_sys_getdefaultencoding_not_ascii = 1;
759         ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
760         if (!ascii_chars_u) goto bad;
761         ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
762         if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
763             PyErr_Format(
764                 PyExc_ValueError,
765                 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
766                 default_encoding_c);
767             goto bad;
768         }
769         Py_DECREF(ascii_chars_u);
770         Py_DECREF(ascii_chars_b);
771     }
772     Py_DECREF(default_encoding);
773     return 0;
774 bad:
775     Py_XDECREF(default_encoding);
776     Py_XDECREF(ascii_chars_u);
777     Py_XDECREF(ascii_chars_b);
778     return -1;
779 }
780 #endif
781 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
782 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
783 #else
784 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
785 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
786 static char* __PYX_DEFAULT_STRING_ENCODING;
__Pyx_init_sys_getdefaultencoding_params(void)787 static int __Pyx_init_sys_getdefaultencoding_params(void) {
788     PyObject* sys;
789     PyObject* default_encoding = NULL;
790     char* default_encoding_c;
791     sys = PyImport_ImportModule("sys");
792     if (!sys) goto bad;
793     default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
794     Py_DECREF(sys);
795     if (!default_encoding) goto bad;
796     default_encoding_c = PyBytes_AsString(default_encoding);
797     if (!default_encoding_c) goto bad;
798     __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
799     if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
800     strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
801     Py_DECREF(default_encoding);
802     return 0;
803 bad:
804     Py_XDECREF(default_encoding);
805     return -1;
806 }
807 #endif
808 #endif
809 
810 
811 /* Test for GCC > 2.95 */
812 #if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
813   #define likely(x)   __builtin_expect(!!(x), 1)
814   #define unlikely(x) __builtin_expect(!!(x), 0)
815 #else /* !__GNUC__ or GCC < 2.95 */
816   #define likely(x)   (x)
817   #define unlikely(x) (x)
818 #endif /* __GNUC__ */
__Pyx_pretend_to_initialize(void * ptr)819 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
820 
821 static PyObject *__pyx_m = NULL;
822 static PyObject *__pyx_d;
823 static PyObject *__pyx_b;
824 static PyObject *__pyx_cython_runtime = NULL;
825 static PyObject *__pyx_empty_tuple;
826 static PyObject *__pyx_empty_bytes;
827 static PyObject *__pyx_empty_unicode;
828 static int __pyx_lineno;
829 static int __pyx_clineno = 0;
830 static const char * __pyx_cfilenm= __FILE__;
831 static const char *__pyx_filename;
832 
833 /* Header.proto */
834 #if !defined(CYTHON_CCOMPLEX)
835   #if defined(__cplusplus)
836     #define CYTHON_CCOMPLEX 1
837   #elif defined(_Complex_I)
838     #define CYTHON_CCOMPLEX 1
839   #else
840     #define CYTHON_CCOMPLEX 0
841   #endif
842 #endif
843 #if CYTHON_CCOMPLEX
844   #ifdef __cplusplus
845     #include <complex>
846   #else
847     #include <complex.h>
848   #endif
849 #endif
850 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
851   #undef _Complex_I
852   #define _Complex_I 1.0fj
853 #endif
854 
855 
856 static const char *__pyx_f[] = {
857   "yt/frontends/ramses/io_utils.pyx",
858   "__init__.pxd",
859   "yt/utilities/lib/fp_utils.pxd",
860   "yt/utilities/lib/geometry_utils.pxd",
861   "stringsource",
862   "type.pxd",
863   "yt/geometry/oct_visitors.pxd",
864   "yt/geometry/selection_routines.pxd",
865   "yt/utilities/lib/allocation_container.pxd",
866   "yt/geometry/oct_container.pxd",
867   "yt/utilities/cython_fortran_utils.pxd",
868 };
869 /* BufferFormatStructs.proto */
870 #define IS_UNSIGNED(type) (((type) -1) > 0)
871 struct __Pyx_StructField_;
872 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
873 typedef struct {
874   const char* name;
875   struct __Pyx_StructField_* fields;
876   size_t size;
877   size_t arraysize[8];
878   int ndim;
879   char typegroup;
880   char is_unsigned;
881   int flags;
882 } __Pyx_TypeInfo;
883 typedef struct __Pyx_StructField_ {
884   __Pyx_TypeInfo* type;
885   const char* name;
886   size_t offset;
887 } __Pyx_StructField;
888 typedef struct {
889   __Pyx_StructField* field;
890   size_t parent_offset;
891 } __Pyx_BufFmt_StackElem;
892 typedef struct {
893   __Pyx_StructField root;
894   __Pyx_BufFmt_StackElem* head;
895   size_t fmt_offset;
896   size_t new_count, enc_count;
897   size_t struct_alignment;
898   int is_complex;
899   char enc_type;
900   char new_packmode;
901   char enc_packmode;
902   char is_valid_array;
903 } __Pyx_BufFmt_Context;
904 
905 /* MemviewSliceStruct.proto */
906 struct __pyx_memoryview_obj;
907 typedef struct {
908   struct __pyx_memoryview_obj *memview;
909   char *data;
910   Py_ssize_t shape[8];
911   Py_ssize_t strides[8];
912   Py_ssize_t suboffsets[8];
913 } __Pyx_memviewslice;
914 #define __Pyx_MemoryView_Len(m)  (m.shape[0])
915 
916 /* Atomics.proto */
917 #include <pythread.h>
918 #ifndef CYTHON_ATOMICS
919     #define CYTHON_ATOMICS 1
920 #endif
921 #define __pyx_atomic_int_type int
922 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
923                     (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
924                     !defined(__i386__)
925     #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
926     #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
927     #ifdef __PYX_DEBUG_ATOMICS
928         #warning "Using GNU atomics"
929     #endif
930 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
931     #include <Windows.h>
932     #undef __pyx_atomic_int_type
933     #define __pyx_atomic_int_type LONG
934     #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
935     #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
936     #ifdef __PYX_DEBUG_ATOMICS
937         #pragma message ("Using MSVC atomics")
938     #endif
939 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
940     #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
941     #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
942     #ifdef __PYX_DEBUG_ATOMICS
943         #warning "Using Intel atomics"
944     #endif
945 #else
946     #undef CYTHON_ATOMICS
947     #define CYTHON_ATOMICS 0
948     #ifdef __PYX_DEBUG_ATOMICS
949         #warning "Not using atomics"
950     #endif
951 #endif
952 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
953 #if CYTHON_ATOMICS
954     #define __pyx_add_acquisition_count(memview)\
955              __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
956     #define __pyx_sub_acquisition_count(memview)\
957             __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
958 #else
959     #define __pyx_add_acquisition_count(memview)\
960             __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
961     #define __pyx_sub_acquisition_count(memview)\
962             __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
963 #endif
964 
965 /* ForceInitThreads.proto */
966 #ifndef __PYX_FORCE_INIT_THREADS
967   #define __PYX_FORCE_INIT_THREADS 0
968 #endif
969 
970 /* NoFastGil.proto */
971 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
972 #define __Pyx_PyGILState_Release PyGILState_Release
973 #define __Pyx_FastGIL_Remember()
974 #define __Pyx_FastGIL_Forget()
975 #define __Pyx_FastGilFuncInit()
976 
977 
978 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":776
979  * # in Cython to enable them only on the right systems.
980  *
981  * ctypedef npy_int8       int8_t             # <<<<<<<<<<<<<<
982  * ctypedef npy_int16      int16_t
983  * ctypedef npy_int32      int32_t
984  */
985 typedef npy_int8 __pyx_t_5numpy_int8_t;
986 
987 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":777
988  *
989  * ctypedef npy_int8       int8_t
990  * ctypedef npy_int16      int16_t             # <<<<<<<<<<<<<<
991  * ctypedef npy_int32      int32_t
992  * ctypedef npy_int64      int64_t
993  */
994 typedef npy_int16 __pyx_t_5numpy_int16_t;
995 
996 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778
997  * ctypedef npy_int8       int8_t
998  * ctypedef npy_int16      int16_t
999  * ctypedef npy_int32      int32_t             # <<<<<<<<<<<<<<
1000  * ctypedef npy_int64      int64_t
1001  * #ctypedef npy_int96      int96_t
1002  */
1003 typedef npy_int32 __pyx_t_5numpy_int32_t;
1004 
1005 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":779
1006  * ctypedef npy_int16      int16_t
1007  * ctypedef npy_int32      int32_t
1008  * ctypedef npy_int64      int64_t             # <<<<<<<<<<<<<<
1009  * #ctypedef npy_int96      int96_t
1010  * #ctypedef npy_int128     int128_t
1011  */
1012 typedef npy_int64 __pyx_t_5numpy_int64_t;
1013 
1014 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":783
1015  * #ctypedef npy_int128     int128_t
1016  *
1017  * ctypedef npy_uint8      uint8_t             # <<<<<<<<<<<<<<
1018  * ctypedef npy_uint16     uint16_t
1019  * ctypedef npy_uint32     uint32_t
1020  */
1021 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1022 
1023 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784
1024  *
1025  * ctypedef npy_uint8      uint8_t
1026  * ctypedef npy_uint16     uint16_t             # <<<<<<<<<<<<<<
1027  * ctypedef npy_uint32     uint32_t
1028  * ctypedef npy_uint64     uint64_t
1029  */
1030 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1031 
1032 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":785
1033  * ctypedef npy_uint8      uint8_t
1034  * ctypedef npy_uint16     uint16_t
1035  * ctypedef npy_uint32     uint32_t             # <<<<<<<<<<<<<<
1036  * ctypedef npy_uint64     uint64_t
1037  * #ctypedef npy_uint96     uint96_t
1038  */
1039 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1040 
1041 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":786
1042  * ctypedef npy_uint16     uint16_t
1043  * ctypedef npy_uint32     uint32_t
1044  * ctypedef npy_uint64     uint64_t             # <<<<<<<<<<<<<<
1045  * #ctypedef npy_uint96     uint96_t
1046  * #ctypedef npy_uint128    uint128_t
1047  */
1048 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1049 
1050 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790
1051  * #ctypedef npy_uint128    uint128_t
1052  *
1053  * ctypedef npy_float32    float32_t             # <<<<<<<<<<<<<<
1054  * ctypedef npy_float64    float64_t
1055  * #ctypedef npy_float80    float80_t
1056  */
1057 typedef npy_float32 __pyx_t_5numpy_float32_t;
1058 
1059 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791
1060  *
1061  * ctypedef npy_float32    float32_t
1062  * ctypedef npy_float64    float64_t             # <<<<<<<<<<<<<<
1063  * #ctypedef npy_float80    float80_t
1064  * #ctypedef npy_float128   float128_t
1065  */
1066 typedef npy_float64 __pyx_t_5numpy_float64_t;
1067 
1068 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":800
1069  * # The int types are mapped a bit surprising --
1070  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1071  * ctypedef npy_long       int_t             # <<<<<<<<<<<<<<
1072  * ctypedef npy_longlong   long_t
1073  * ctypedef npy_longlong   longlong_t
1074  */
1075 typedef npy_long __pyx_t_5numpy_int_t;
1076 
1077 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":801
1078  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1079  * ctypedef npy_long       int_t
1080  * ctypedef npy_longlong   long_t             # <<<<<<<<<<<<<<
1081  * ctypedef npy_longlong   longlong_t
1082  *
1083  */
1084 typedef npy_longlong __pyx_t_5numpy_long_t;
1085 
1086 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":802
1087  * ctypedef npy_long       int_t
1088  * ctypedef npy_longlong   long_t
1089  * ctypedef npy_longlong   longlong_t             # <<<<<<<<<<<<<<
1090  *
1091  * ctypedef npy_ulong      uint_t
1092  */
1093 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1094 
1095 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":804
1096  * ctypedef npy_longlong   longlong_t
1097  *
1098  * ctypedef npy_ulong      uint_t             # <<<<<<<<<<<<<<
1099  * ctypedef npy_ulonglong  ulong_t
1100  * ctypedef npy_ulonglong  ulonglong_t
1101  */
1102 typedef npy_ulong __pyx_t_5numpy_uint_t;
1103 
1104 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805
1105  *
1106  * ctypedef npy_ulong      uint_t
1107  * ctypedef npy_ulonglong  ulong_t             # <<<<<<<<<<<<<<
1108  * ctypedef npy_ulonglong  ulonglong_t
1109  *
1110  */
1111 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1112 
1113 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":806
1114  * ctypedef npy_ulong      uint_t
1115  * ctypedef npy_ulonglong  ulong_t
1116  * ctypedef npy_ulonglong  ulonglong_t             # <<<<<<<<<<<<<<
1117  *
1118  * ctypedef npy_intp       intp_t
1119  */
1120 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1121 
1122 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":808
1123  * ctypedef npy_ulonglong  ulonglong_t
1124  *
1125  * ctypedef npy_intp       intp_t             # <<<<<<<<<<<<<<
1126  * ctypedef npy_uintp      uintp_t
1127  *
1128  */
1129 typedef npy_intp __pyx_t_5numpy_intp_t;
1130 
1131 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809
1132  *
1133  * ctypedef npy_intp       intp_t
1134  * ctypedef npy_uintp      uintp_t             # <<<<<<<<<<<<<<
1135  *
1136  * ctypedef npy_double     float_t
1137  */
1138 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1139 
1140 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":811
1141  * ctypedef npy_uintp      uintp_t
1142  *
1143  * ctypedef npy_double     float_t             # <<<<<<<<<<<<<<
1144  * ctypedef npy_double     double_t
1145  * ctypedef npy_longdouble longdouble_t
1146  */
1147 typedef npy_double __pyx_t_5numpy_float_t;
1148 
1149 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812
1150  *
1151  * ctypedef npy_double     float_t
1152  * ctypedef npy_double     double_t             # <<<<<<<<<<<<<<
1153  * ctypedef npy_longdouble longdouble_t
1154  *
1155  */
1156 typedef npy_double __pyx_t_5numpy_double_t;
1157 
1158 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":813
1159  * ctypedef npy_double     float_t
1160  * ctypedef npy_double     double_t
1161  * ctypedef npy_longdouble longdouble_t             # <<<<<<<<<<<<<<
1162  *
1163  * ctypedef npy_cfloat      cfloat_t
1164  */
1165 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1166 
1167 /* "yt/utilities/cython_fortran_utils.pxd":4
1168  * from libc.stdio cimport FILE
1169  *
1170  * ctypedef np.int32_t INT32_t             # <<<<<<<<<<<<<<
1171  * ctypedef np.int64_t INT64_t
1172  * ctypedef np.float64_t DOUBLE_t
1173  */
1174 typedef __pyx_t_5numpy_int32_t __pyx_t_2yt_9utilities_20cython_fortran_utils_INT32_t;
1175 
1176 /* "yt/utilities/cython_fortran_utils.pxd":5
1177  *
1178  * ctypedef np.int32_t INT32_t
1179  * ctypedef np.int64_t INT64_t             # <<<<<<<<<<<<<<
1180  * ctypedef np.float64_t DOUBLE_t
1181  *
1182  */
1183 typedef __pyx_t_5numpy_int64_t __pyx_t_2yt_9utilities_20cython_fortran_utils_INT64_t;
1184 
1185 /* "yt/utilities/cython_fortran_utils.pxd":6
1186  * ctypedef np.int32_t INT32_t
1187  * ctypedef np.int64_t INT64_t
1188  * ctypedef np.float64_t DOUBLE_t             # <<<<<<<<<<<<<<
1189  *
1190  * cdef class FortranFile:
1191  */
1192 typedef __pyx_t_5numpy_float64_t __pyx_t_2yt_9utilities_20cython_fortran_utils_DOUBLE_t;
1193 
1194 /* "yt/frontends/ramses/io_utils.pyx":13
1195  * from yt.utilities.exceptions import YTIllDefinedAMRData
1196  *
1197  * ctypedef np.int32_t INT32_t             # <<<<<<<<<<<<<<
1198  * ctypedef np.int64_t INT64_t
1199  * ctypedef np.float64_t DOUBLE_t
1200  */
1201 typedef __pyx_t_5numpy_int32_t __pyx_t_2yt_9frontends_6ramses_8io_utils_INT32_t;
1202 
1203 /* "yt/frontends/ramses/io_utils.pyx":14
1204  *
1205  * ctypedef np.int32_t INT32_t
1206  * ctypedef np.int64_t INT64_t             # <<<<<<<<<<<<<<
1207  * ctypedef np.float64_t DOUBLE_t
1208  *
1209  */
1210 typedef __pyx_t_5numpy_int64_t __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t;
1211 
1212 /* "yt/frontends/ramses/io_utils.pyx":15
1213  * ctypedef np.int32_t INT32_t
1214  * ctypedef np.int64_t INT64_t
1215  * ctypedef np.float64_t DOUBLE_t             # <<<<<<<<<<<<<<
1216  *
1217  * @cython.boundscheck(False)
1218  */
1219 typedef __pyx_t_5numpy_float64_t __pyx_t_2yt_9frontends_6ramses_8io_utils_DOUBLE_t;
1220 /* Declarations.proto */
1221 #if CYTHON_CCOMPLEX
1222   #ifdef __cplusplus
1223     typedef ::std::complex< float > __pyx_t_float_complex;
1224   #else
1225     typedef float _Complex __pyx_t_float_complex;
1226   #endif
1227 #else
1228     typedef struct { float real, imag; } __pyx_t_float_complex;
1229 #endif
1230 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1231 
1232 /* Declarations.proto */
1233 #if CYTHON_CCOMPLEX
1234   #ifdef __cplusplus
1235     typedef ::std::complex< double > __pyx_t_double_complex;
1236   #else
1237     typedef double _Complex __pyx_t_double_complex;
1238   #endif
1239 #else
1240     typedef struct { double real, imag; } __pyx_t_double_complex;
1241 #endif
1242 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1243 
1244 
1245 /*--- Type declarations ---*/
1246 struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor;
1247 struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalOcts;
1248 struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalCells;
1249 struct __pyx_obj_2yt_8geometry_12oct_visitors_MarkOcts;
1250 struct __pyx_obj_2yt_8geometry_12oct_visitors_MaskOcts;
1251 struct __pyx_obj_2yt_8geometry_12oct_visitors_IndexOcts;
1252 struct __pyx_obj_2yt_8geometry_12oct_visitors_MaskedIndexOcts;
1253 struct __pyx_obj_2yt_8geometry_12oct_visitors_IndexMaskMapOcts;
1254 struct __pyx_obj_2yt_8geometry_12oct_visitors_ICoordsOcts;
1255 struct __pyx_obj_2yt_8geometry_12oct_visitors_IResOcts;
1256 struct __pyx_obj_2yt_8geometry_12oct_visitors_FCoordsOcts;
1257 struct __pyx_obj_2yt_8geometry_12oct_visitors_FWidthOcts;
1258 struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayI64;
1259 struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayF64;
1260 struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyFileIndArrayI8;
1261 struct __pyx_obj_2yt_8geometry_12oct_visitors_IdentifyOcts;
1262 struct __pyx_obj_2yt_8geometry_12oct_visitors_AssignDomainInd;
1263 struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesO;
1264 struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesR;
1265 struct __pyx_obj_2yt_8geometry_12oct_visitors_CountByDomain;
1266 struct __pyx_obj_2yt_8geometry_12oct_visitors_StoreOctree;
1267 struct __pyx_obj_2yt_8geometry_12oct_visitors_LoadOctree;
1268 struct __pyx_obj_2yt_8geometry_12oct_visitors_MortonIndexOcts;
1269 struct __pyx_obj_2yt_8geometry_12oct_visitors_StoreIndex;
1270 struct __pyx_obj_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor;
1271 struct __pyx_obj_2yt_8geometry_12oct_visitors_NeighbourCellIndexVisitor;
1272 struct __pyx_obj_2yt_8geometry_12oct_visitors_NeighbourCellVisitor;
1273 struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject;
1274 struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector;
1275 struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector;
1276 struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector;
1277 struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool;
1278 struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool;
1279 struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer;
1280 struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer;
1281 struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer;
1282 struct __pyx_obj_2yt_9utilities_20cython_fortran_utils_FortranFile;
1283 struct __pyx_obj_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct__read_amr;
1284 struct __pyx_obj_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct_1_genexpr;
1285 struct __pyx_array_obj;
1286 struct __pyx_MemviewEnum_obj;
1287 struct __pyx_memoryview_obj;
1288 struct __pyx_memoryviewslice_obj;
1289 
1290 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":815
1291  * ctypedef npy_longdouble longdouble_t
1292  *
1293  * ctypedef npy_cfloat      cfloat_t             # <<<<<<<<<<<<<<
1294  * ctypedef npy_cdouble     cdouble_t
1295  * ctypedef npy_clongdouble clongdouble_t
1296  */
1297 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1298 
1299 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":816
1300  *
1301  * ctypedef npy_cfloat      cfloat_t
1302  * ctypedef npy_cdouble     cdouble_t             # <<<<<<<<<<<<<<
1303  * ctypedef npy_clongdouble clongdouble_t
1304  *
1305  */
1306 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1307 
1308 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":817
1309  * ctypedef npy_cfloat      cfloat_t
1310  * ctypedef npy_cdouble     cdouble_t
1311  * ctypedef npy_clongdouble clongdouble_t             # <<<<<<<<<<<<<<
1312  *
1313  * ctypedef npy_cdouble     complex_t
1314  */
1315 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1316 
1317 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":819
1318  * ctypedef npy_clongdouble clongdouble_t
1319  *
1320  * ctypedef npy_cdouble     complex_t             # <<<<<<<<<<<<<<
1321  *
1322  * cdef inline object PyArray_MultiIterNew1(a):
1323  */
1324 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1325 struct __pyx_t_2yt_8geometry_12oct_visitors_Oct;
1326 struct __pyx_t_2yt_8geometry_12oct_visitors_OctInfo;
1327 struct __pyx_t_2yt_8geometry_12oct_visitors_OctPadded;
1328 
1329 /* "oct_visitors.pxd":13
1330  *
1331  *
1332  * cdef struct Oct             # <<<<<<<<<<<<<<
1333  * cdef struct Oct:
1334  *     np.int64_t file_ind     # index with respect to the order in which it was
1335  */
1336 struct __pyx_t_2yt_8geometry_12oct_visitors_Oct {
1337   __pyx_t_5numpy_int64_t file_ind;
1338   __pyx_t_5numpy_int64_t domain_ind;
1339   __pyx_t_5numpy_int64_t domain;
1340   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct **children;
1341 };
1342 
1343 /* "oct_visitors.pxd":21
1344  *     Oct **children          # Up to 8 long
1345  *
1346  * cdef struct OctInfo:             # <<<<<<<<<<<<<<
1347  *     np.float64_t left_edge[3]
1348  *     np.float64_t dds[3]
1349  */
1350 struct __pyx_t_2yt_8geometry_12oct_visitors_OctInfo {
1351   __pyx_t_5numpy_float64_t left_edge[3];
1352   __pyx_t_5numpy_float64_t dds[3];
1353   __pyx_t_5numpy_int64_t ipos[3];
1354   __pyx_t_5numpy_int32_t level;
1355 };
1356 
1357 /* "oct_visitors.pxd":27
1358  *     np.int32_t level
1359  *
1360  * cdef struct OctPadded:             # <<<<<<<<<<<<<<
1361  *     np.int64_t file_ind
1362  *     np.int64_t domain_ind
1363  */
1364 struct __pyx_t_2yt_8geometry_12oct_visitors_OctPadded {
1365   __pyx_t_5numpy_int64_t file_ind;
1366   __pyx_t_5numpy_int64_t domain_ind;
1367   __pyx_t_5numpy_int64_t domain;
1368   __pyx_t_5numpy_int64_t padding;
1369 };
1370 struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode;
1371 struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded;
1372 struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData;
1373 
1374 /* "grid_visitors.pxd":13
1375  *
1376  *
1377  * cdef struct GridTreeNode:             # <<<<<<<<<<<<<<
1378  *     np.int32_t num_children
1379  *     np.int32_t level
1380  */
1381 struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode {
1382   __pyx_t_5numpy_int32_t num_children;
1383   __pyx_t_5numpy_int32_t level;
1384   __pyx_t_5numpy_int64_t index;
1385   __pyx_t_5numpy_float64_t left_edge[3];
1386   __pyx_t_5numpy_float64_t right_edge[3];
1387   struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode **children;
1388   __pyx_t_5numpy_int64_t start_index[3];
1389   __pyx_t_5numpy_int32_t dims[3];
1390   __pyx_t_5numpy_float64_t dds[3];
1391 };
1392 
1393 /* "grid_visitors.pxd":24
1394  *     np.float64_t dds[3]
1395  *
1396  * cdef struct GridTreeNodePadded:             # <<<<<<<<<<<<<<
1397  *     np.int32_t num_children
1398  *     np.int32_t level
1399  */
1400 struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded {
1401   __pyx_t_5numpy_int32_t num_children;
1402   __pyx_t_5numpy_int32_t level;
1403   __pyx_t_5numpy_int64_t index;
1404   __pyx_t_5numpy_float64_t left_edge_x;
1405   __pyx_t_5numpy_float64_t left_edge_y;
1406   __pyx_t_5numpy_float64_t left_edge_z;
1407   __pyx_t_5numpy_float64_t right_edge_x;
1408   __pyx_t_5numpy_float64_t right_edge_y;
1409   __pyx_t_5numpy_float64_t right_edge_z;
1410   __pyx_t_5numpy_int_t children_pointers;
1411   __pyx_t_5numpy_int64_t start_index_x;
1412   __pyx_t_5numpy_int64_t start_index_y;
1413   __pyx_t_5numpy_int64_t start_index_z;
1414   __pyx_t_5numpy_int32_t dims_x;
1415   __pyx_t_5numpy_int32_t dims_y;
1416   __pyx_t_5numpy_int32_t dims_z;
1417   __pyx_t_5numpy_float64_t dds_x;
1418   __pyx_t_5numpy_float64_t dds_y;
1419   __pyx_t_5numpy_float64_t dds_z;
1420 };
1421 
1422 /* "grid_visitors.pxd":45
1423  *     np.float64_t dds_z
1424  *
1425  * cdef struct GridVisitorData:             # <<<<<<<<<<<<<<
1426  *     GridTreeNode *grid
1427  *     np.uint64_t index
1428  */
1429 struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData {
1430   struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode *grid;
1431   __pyx_t_5numpy_uint64_t index;
1432   __pyx_t_5numpy_uint64_t global_index;
1433   __pyx_t_5numpy_int64_t pos[3];
1434   int n_tuples;
1435   int **child_tuples;
1436   void *array;
1437   int ref_factor;
1438 };
1439 
1440 /* "grid_visitors.pxd":61
1441  * cdef np.uint8_t check_child_masked(GridVisitorData *data) nogil
1442  *
1443  * ctypedef void grid_visitor_function(GridVisitorData *data,             # <<<<<<<<<<<<<<
1444  *                                          np.uint8_t selected) nogil
1445  * # This is similar in spirit to the way oct visitor functions work.  However,
1446  */
1447 typedef void __pyx_t_2yt_8geometry_13grid_visitors_grid_visitor_function(struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *, __pyx_t_5numpy_uint8_t);
1448 struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_recursively_visit_octs;
1449 struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_select_grid;
1450 struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_select_grid_edge;
1451 struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_visit_grid_cells;
1452 
1453 /* "selection_routines.pxd":34
1454  *     cdef np.int64_t _hash
1455  *
1456  *     cdef void recursively_visit_octs(self, Oct *root,             # <<<<<<<<<<<<<<
1457  *                         np.float64_t pos[3], np.float64_t dds[3],
1458  *                         int level,
1459  */
1460 struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_recursively_visit_octs {
1461   int __pyx_n;
1462   int visit_covered;
1463 };
1464 
1465 /* "selection_routines.pxd":42
1466  *                               np.float64_t spos[3], np.float64_t sdds[3],
1467  *                               OctVisitor visitor, int i, int j, int k)
1468  *     cdef int select_grid(self, np.float64_t left_edge[3],             # <<<<<<<<<<<<<<
1469  *                                np.float64_t right_edge[3],
1470  *                                np.int32_t level, Oct *o = ?) nogil
1471  */
1472 struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_select_grid {
1473   int __pyx_n;
1474   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *o;
1475 };
1476 
1477 /* "selection_routines.pxd":45
1478  *                                np.float64_t right_edge[3],
1479  *                                np.int32_t level, Oct *o = ?) nogil
1480  *     cdef int select_grid_edge(self, np.float64_t left_edge[3],             # <<<<<<<<<<<<<<
1481  *                                     np.float64_t right_edge[3],
1482  *                                     np.int32_t level, Oct *o = ?) nogil
1483  */
1484 struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_select_grid_edge {
1485   int __pyx_n;
1486   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *o;
1487 };
1488 
1489 /* "selection_routines.pxd":62
1490  *                                 np.ndarray[np.uint8_t, ndim=3] mask,
1491  *                                 int level)
1492  *     cdef void visit_grid_cells(self, GridVisitorData *data,             # <<<<<<<<<<<<<<
1493  *                     grid_visitor_function *func, np.uint8_t *cached_mask = ?)
1494  *
1495  */
1496 struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_visit_grid_cells {
1497   int __pyx_n;
1498   __pyx_t_5numpy_uint8_t *cached_mask;
1499 };
1500 struct __pyx_t_2yt_9utilities_3lib_20allocation_container_AllocationContainer;
1501 struct __pyx_opt_args_2yt_9utilities_3lib_20allocation_container_10ObjectPool_allocate_objs;
1502 
1503 /* "yt/utilities/lib/allocation_container.pxd":13
1504  *
1505  *
1506  * cdef struct AllocationContainer:             # <<<<<<<<<<<<<<
1507  *     np.uint64_t n
1508  *     np.uint64_t n_assigned
1509  */
1510 struct __pyx_t_2yt_9utilities_3lib_20allocation_container_AllocationContainer {
1511   __pyx_t_5numpy_uint64_t n;
1512   __pyx_t_5numpy_uint64_t n_assigned;
1513   __pyx_t_5numpy_uint64_t offset;
1514   __pyx_t_5numpy_int64_t con_id;
1515   void *my_objs;
1516 };
1517 
1518 /* "yt/utilities/lib/allocation_container.pxd":24
1519  *     cdef np.uint64_t n_con
1520  *     cdef AllocationContainer* containers
1521  *     cdef void allocate_objs(self, int n_objs, np.int64_t con_id = ?) except *             # <<<<<<<<<<<<<<
1522  *     cdef void setup_objs(self, void *obj, np.uint64_t count,
1523  *                          np.uint64_t offset, np.int64_t con_id)
1524  */
1525 struct __pyx_opt_args_2yt_9utilities_3lib_20allocation_container_10ObjectPool_allocate_objs {
1526   int __pyx_n;
1527   __pyx_t_5numpy_int64_t con_id;
1528 };
1529 struct __pyx_t_2yt_8geometry_13oct_container_OctKey;
1530 struct __pyx_t_2yt_8geometry_13oct_container_OctList;
1531 struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer;
1532 struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_get;
1533 struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_visit_all_octs;
1534 
1535 /* "yt/geometry/oct_container.pxd":25
1536  * cdef int ORDER_MAX
1537  *
1538  * cdef struct OctKey:             # <<<<<<<<<<<<<<
1539  *     np.int64_t key
1540  *     Oct *node
1541  */
1542 struct __pyx_t_2yt_8geometry_13oct_container_OctKey {
1543   __pyx_t_5numpy_int64_t key;
1544   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *node;
1545   __pyx_t_5numpy_int64_t *indices;
1546   __pyx_t_5numpy_int64_t pcount;
1547 };
1548 
1549 /* "yt/geometry/oct_container.pxd":32
1550  *     np.int64_t pcount
1551  *
1552  * cdef struct OctList             # <<<<<<<<<<<<<<
1553  *
1554  * cdef struct OctList:
1555  */
1556 struct __pyx_t_2yt_8geometry_13oct_container_OctList {
1557   struct __pyx_t_2yt_8geometry_13oct_container_OctList *next;
1558   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *o;
1559 };
1560 
1561 /* "yt/geometry/oct_container.pxd":40
1562  * # NOTE: This object *has* to be the same size as the AllocationContainer
1563  * # object.  There's an assert in the __cinit__ function.
1564  * cdef struct OctAllocationContainer:             # <<<<<<<<<<<<<<
1565  *     np.uint64_t n
1566  *     np.uint64_t n_assigned
1567  */
1568 struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer {
1569   __pyx_t_5numpy_uint64_t n;
1570   __pyx_t_5numpy_uint64_t n_assigned;
1571   __pyx_t_5numpy_uint64_t offset;
1572   __pyx_t_5numpy_int64_t con_id;
1573   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *my_objs;
1574 };
1575 
1576 /* "yt/geometry/oct_container.pxd":66
1577  *     cdef public np.int64_t nocts
1578  *     cdef public int num_domains
1579  *     cdef Oct *get(self, np.float64_t ppos[3], OctInfo *oinfo = ?,             # <<<<<<<<<<<<<<
1580  *                   int max_level = ?) nogil
1581  *     cdef int get_root(self, int ind[3], Oct **o) nogil
1582  */
1583 struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_get {
1584   int __pyx_n;
1585   struct __pyx_t_2yt_8geometry_12oct_visitors_OctInfo *oinfo;
1586   int max_level;
1587 };
1588 
1589 /* "yt/geometry/oct_container.pxd":74
1590  *     # AllocationContainer.offset if such a thing exists.
1591  *     cdef np.int64_t get_domain_offset(self, int domain_id)
1592  *     cdef void visit_all_octs(self,             # <<<<<<<<<<<<<<
1593  *                         selection_routines.SelectorObject selector,
1594  *                         OctVisitor visitor,
1595  */
1596 struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_visit_all_octs {
1597   int __pyx_n;
1598   int vc;
1599   __pyx_t_5numpy_int64_t *indices;
1600 };
1601 struct __pyx_opt_args_2yt_9utilities_20cython_fortran_utils_11FortranFile_skip;
1602 struct __pyx_opt_args_2yt_9utilities_20cython_fortran_utils_11FortranFile_seek;
1603 
1604 /* "yt/utilities/cython_fortran_utils.pxd":12
1605  *     cdef bint _closed
1606  *
1607  *     cpdef INT64_t skip(self, INT64_t n=*) except -1             # <<<<<<<<<<<<<<
1608  *     cdef INT64_t get_size(self, str dtype)
1609  *     cpdef INT32_t read_int(self) except? -1
1610  */
1611 struct __pyx_opt_args_2yt_9utilities_20cython_fortran_utils_11FortranFile_skip {
1612   int __pyx_n;
1613   __pyx_t_2yt_9utilities_20cython_fortran_utils_INT64_t n;
1614 };
1615 
1616 /* "yt/utilities/cython_fortran_utils.pxd":17
1617  *     cpdef np.ndarray read_vector(self, str dtype)
1618  *     cpdef INT64_t tell(self) except -1
1619  *     cpdef INT64_t seek(self, INT64_t pos, INT64_t whence=*) except -1             # <<<<<<<<<<<<<<
1620  *     cpdef void close(self)
1621  */
1622 struct __pyx_opt_args_2yt_9utilities_20cython_fortran_utils_11FortranFile_seek {
1623   int __pyx_n;
1624   __pyx_t_2yt_9utilities_20cython_fortran_utils_INT64_t whence;
1625 };
1626 
1627 /* "oct_visitors.pxd":33
1628  *     np.int64_t padding
1629  *
1630  * cdef class OctVisitor:             # <<<<<<<<<<<<<<
1631  *     cdef np.uint64_t index
1632  *     cdef np.uint64_t last
1633  */
1634 struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor {
1635   PyObject_HEAD
1636   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_vtab;
1637   __pyx_t_5numpy_uint64_t index;
1638   __pyx_t_5numpy_uint64_t last;
1639   __pyx_t_5numpy_int64_t global_index;
1640   __pyx_t_5numpy_int64_t pos[3];
1641   __pyx_t_5numpy_uint8_t ind[3];
1642   int dims;
1643   __pyx_t_5numpy_int32_t domain;
1644   __pyx_t_5numpy_int8_t level;
1645   __pyx_t_5numpy_int8_t oref;
1646   __pyx_t_5numpy_int32_t nz;
1647 };
1648 
1649 
1650 /* "oct_visitors.pxd":59
1651  *         return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0])
1652  *
1653  * cdef class CountTotalOcts(OctVisitor):             # <<<<<<<<<<<<<<
1654  *     pass
1655  *
1656  */
1657 struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalOcts {
1658   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1659 };
1660 
1661 
1662 /* "oct_visitors.pxd":62
1663  *     pass
1664  *
1665  * cdef class CountTotalCells(OctVisitor):             # <<<<<<<<<<<<<<
1666  *     pass
1667  *
1668  */
1669 struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalCells {
1670   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1671 };
1672 
1673 
1674 /* "oct_visitors.pxd":65
1675  *     pass
1676  *
1677  * cdef class MarkOcts(OctVisitor):             # <<<<<<<<<<<<<<
1678  *     # Unused
1679  *     cdef np.uint8_t[:,:,:,:] mark
1680  */
1681 struct __pyx_obj_2yt_8geometry_12oct_visitors_MarkOcts {
1682   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1683   __Pyx_memviewslice mark;
1684 };
1685 
1686 
1687 /* "oct_visitors.pxd":69
1688  *     cdef np.uint8_t[:,:,:,:] mark
1689  *
1690  * cdef class MaskOcts(OctVisitor):             # <<<<<<<<<<<<<<
1691  *     cdef np.uint8_t[:,:,:,:] mask
1692  *
1693  */
1694 struct __pyx_obj_2yt_8geometry_12oct_visitors_MaskOcts {
1695   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1696   __Pyx_memviewslice mask;
1697 };
1698 
1699 
1700 /* "oct_visitors.pxd":72
1701  *     cdef np.uint8_t[:,:,:,:] mask
1702  *
1703  * cdef class IndexOcts(OctVisitor):             # <<<<<<<<<<<<<<
1704  *     cdef np.int64_t[:] oct_index
1705  *
1706  */
1707 struct __pyx_obj_2yt_8geometry_12oct_visitors_IndexOcts {
1708   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1709   __Pyx_memviewslice oct_index;
1710 };
1711 
1712 
1713 /* "oct_visitors.pxd":75
1714  *     cdef np.int64_t[:] oct_index
1715  *
1716  * cdef class MaskedIndexOcts(OctVisitor):             # <<<<<<<<<<<<<<
1717  *     cdef np.int64_t[:] oct_index
1718  *     cdef np.uint8_t[:] oct_mask
1719  */
1720 struct __pyx_obj_2yt_8geometry_12oct_visitors_MaskedIndexOcts {
1721   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1722   __Pyx_memviewslice oct_index;
1723   __Pyx_memviewslice oct_mask;
1724 };
1725 
1726 
1727 /* "oct_visitors.pxd":79
1728  *     cdef np.uint8_t[:] oct_mask
1729  *
1730  * cdef class IndexMaskMapOcts(OctVisitor):             # <<<<<<<<<<<<<<
1731  *     cdef np.int64_t[:] oct_index
1732  *     cdef np.uint8_t[:] oct_mask
1733  */
1734 struct __pyx_obj_2yt_8geometry_12oct_visitors_IndexMaskMapOcts {
1735   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1736   __Pyx_memviewslice oct_index;
1737   __Pyx_memviewslice oct_mask;
1738   __Pyx_memviewslice map_domain_ind;
1739   __pyx_t_5numpy_uint64_t map_index;
1740 };
1741 
1742 
1743 /* "oct_visitors.pxd":85
1744  *     cdef np.uint64_t map_index
1745  *
1746  * cdef class ICoordsOcts(OctVisitor):             # <<<<<<<<<<<<<<
1747  *     cdef np.int64_t[:,:] icoords
1748  *
1749  */
1750 struct __pyx_obj_2yt_8geometry_12oct_visitors_ICoordsOcts {
1751   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1752   __Pyx_memviewslice icoords;
1753 };
1754 
1755 
1756 /* "oct_visitors.pxd":88
1757  *     cdef np.int64_t[:,:] icoords
1758  *
1759  * cdef class IResOcts(OctVisitor):             # <<<<<<<<<<<<<<
1760  *     cdef np.int64_t[:] ires
1761  *
1762  */
1763 struct __pyx_obj_2yt_8geometry_12oct_visitors_IResOcts {
1764   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1765   __Pyx_memviewslice ires;
1766 };
1767 
1768 
1769 /* "oct_visitors.pxd":91
1770  *     cdef np.int64_t[:] ires
1771  *
1772  * cdef class FCoordsOcts(OctVisitor):             # <<<<<<<<<<<<<<
1773  *     cdef np.float64_t[:,:] fcoords
1774  *
1775  */
1776 struct __pyx_obj_2yt_8geometry_12oct_visitors_FCoordsOcts {
1777   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1778   __Pyx_memviewslice fcoords;
1779 };
1780 
1781 
1782 /* "oct_visitors.pxd":94
1783  *     cdef np.float64_t[:,:] fcoords
1784  *
1785  * cdef class FWidthOcts(OctVisitor):             # <<<<<<<<<<<<<<
1786  *     cdef np.float64_t[:,:] fwidth
1787  *
1788  */
1789 struct __pyx_obj_2yt_8geometry_12oct_visitors_FWidthOcts {
1790   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1791   __Pyx_memviewslice fwidth;
1792 };
1793 
1794 
1795 /* "oct_visitors.pxd":97
1796  *     cdef np.float64_t[:,:] fwidth
1797  *
1798  * cdef class CopyArrayI64(OctVisitor):             # <<<<<<<<<<<<<<
1799  *     cdef np.int64_t[:,:,:,:,:,:] source
1800  *     cdef np.int64_t[:,:] dest
1801  */
1802 struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayI64 {
1803   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1804   __Pyx_memviewslice source;
1805   __Pyx_memviewslice dest;
1806 };
1807 
1808 
1809 /* "oct_visitors.pxd":101
1810  *     cdef np.int64_t[:,:] dest
1811  *
1812  * cdef class CopyArrayF64(OctVisitor):             # <<<<<<<<<<<<<<
1813  *     cdef np.float64_t[:,:,:,:,:] source
1814  *     cdef np.float64_t[:,:] dest
1815  */
1816 struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayF64 {
1817   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1818   __Pyx_memviewslice source;
1819   __Pyx_memviewslice dest;
1820 };
1821 
1822 
1823 /* "oct_visitors.pxd":105
1824  *     cdef np.float64_t[:,:] dest
1825  *
1826  * cdef class CopyFileIndArrayI8(OctVisitor):             # <<<<<<<<<<<<<<
1827  *     cdef np.int64_t root
1828  *     cdef np.uint8_t[:] source
1829  */
1830 struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyFileIndArrayI8 {
1831   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1832   __pyx_t_5numpy_int64_t root;
1833   __Pyx_memviewslice source;
1834   __Pyx_memviewslice dest;
1835 };
1836 
1837 
1838 /* "oct_visitors.pxd":110
1839  *     cdef np.uint8_t[:] dest
1840  *
1841  * cdef class IdentifyOcts(OctVisitor):             # <<<<<<<<<<<<<<
1842  *     cdef np.uint8_t[:] domain_mask
1843  *
1844  */
1845 struct __pyx_obj_2yt_8geometry_12oct_visitors_IdentifyOcts {
1846   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1847   __Pyx_memviewslice domain_mask;
1848 };
1849 
1850 
1851 /* "oct_visitors.pxd":113
1852  *     cdef np.uint8_t[:] domain_mask
1853  *
1854  * cdef class AssignDomainInd(OctVisitor):             # <<<<<<<<<<<<<<
1855  *     pass
1856  *
1857  */
1858 struct __pyx_obj_2yt_8geometry_12oct_visitors_AssignDomainInd {
1859   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1860 };
1861 
1862 
1863 /* "oct_visitors.pxd":116
1864  *     pass
1865  *
1866  * cdef class FillFileIndicesO(OctVisitor):             # <<<<<<<<<<<<<<
1867  *     cdef np.uint8_t[:] levels
1868  *     cdef np.int64_t[:] file_inds
1869  */
1870 struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesO {
1871   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1872   __Pyx_memviewslice levels;
1873   __Pyx_memviewslice file_inds;
1874   __Pyx_memviewslice cell_inds;
1875 };
1876 
1877 
1878 /* "oct_visitors.pxd":121
1879  *     cdef np.uint8_t[:] cell_inds
1880  *
1881  * cdef class FillFileIndicesR(OctVisitor):             # <<<<<<<<<<<<<<
1882  *     cdef np.uint8_t[:] levels
1883  *     cdef np.int64_t[:] file_inds
1884  */
1885 struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesR {
1886   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1887   __Pyx_memviewslice levels;
1888   __Pyx_memviewslice file_inds;
1889   __Pyx_memviewslice cell_inds;
1890 };
1891 
1892 
1893 /* "oct_visitors.pxd":126
1894  *     cdef np.uint8_t[:] cell_inds
1895  *
1896  * cdef class CountByDomain(OctVisitor):             # <<<<<<<<<<<<<<
1897  *     cdef np.int64_t[:] domain_counts
1898  *
1899  */
1900 struct __pyx_obj_2yt_8geometry_12oct_visitors_CountByDomain {
1901   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1902   __Pyx_memviewslice domain_counts;
1903 };
1904 
1905 
1906 /* "oct_visitors.pxd":129
1907  *     cdef np.int64_t[:] domain_counts
1908  *
1909  * cdef class StoreOctree(OctVisitor):             # <<<<<<<<<<<<<<
1910  *     cdef np.uint8_t[:] ref_mask
1911  *
1912  */
1913 struct __pyx_obj_2yt_8geometry_12oct_visitors_StoreOctree {
1914   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1915   __Pyx_memviewslice ref_mask;
1916 };
1917 
1918 
1919 /* "oct_visitors.pxd":132
1920  *     cdef np.uint8_t[:] ref_mask
1921  *
1922  * cdef class LoadOctree(OctVisitor):             # <<<<<<<<<<<<<<
1923  *     cdef np.uint8_t[:] ref_mask
1924  *     cdef Oct* octs
1925  */
1926 struct __pyx_obj_2yt_8geometry_12oct_visitors_LoadOctree {
1927   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1928   __Pyx_memviewslice ref_mask;
1929   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *octs;
1930   __pyx_t_5numpy_uint64_t *nocts;
1931   __pyx_t_5numpy_uint64_t *nfinest;
1932 };
1933 
1934 
1935 /* "oct_visitors.pxd":138
1936  *     cdef np.uint64_t *nfinest
1937  *
1938  * cdef class MortonIndexOcts(OctVisitor):             # <<<<<<<<<<<<<<
1939  *     cdef np.uint8_t[:] level_arr
1940  *     cdef np.uint64_t[:] morton_ind
1941  */
1942 struct __pyx_obj_2yt_8geometry_12oct_visitors_MortonIndexOcts {
1943   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1944   __Pyx_memviewslice level_arr;
1945   __Pyx_memviewslice morton_ind;
1946 };
1947 
1948 
1949 /* "oct_visitors.pxd":149
1950  *
1951  *
1952  * cdef class StoreIndex(OctVisitor):             # <<<<<<<<<<<<<<
1953  *     cdef np.int64_t[:,:,:,:] cell_inds
1954  *
1955  */
1956 struct __pyx_obj_2yt_8geometry_12oct_visitors_StoreIndex {
1957   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1958   __Pyx_memviewslice cell_inds;
1959 };
1960 
1961 
1962 /* "oct_visitors.pxd":153
1963  *
1964  * # cimport oct_container
1965  * cdef class BaseNeighbourVisitor(OctVisitor):             # <<<<<<<<<<<<<<
1966  *     cdef int idim      # 0,1,2 for x,y,z
1967  *     cdef int direction # +1 for +x, -1 for -x
1968  */
1969 struct __pyx_obj_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor {
1970   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1971   int idim;
1972   int direction;
1973   __pyx_t_5numpy_uint8_t neigh_ind[3];
1974   int other_oct;
1975   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *neighbour;
1976   struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *octree;
1977   struct __pyx_t_2yt_8geometry_12oct_visitors_OctInfo oi;
1978   int n_ghost_zones;
1979 };
1980 
1981 
1982 /* "oct_visitors.pxd":169
1983  *         return (((self.neigh_ind[2]*d)+self.neigh_ind[1])*d+self.neigh_ind[0])
1984  *
1985  * cdef class NeighbourCellIndexVisitor(BaseNeighbourVisitor):             # <<<<<<<<<<<<<<
1986  *     cdef np.uint8_t[::1] cell_inds
1987  *     cdef np.int64_t[::1] domain_inds
1988  */
1989 struct __pyx_obj_2yt_8geometry_12oct_visitors_NeighbourCellIndexVisitor {
1990   struct __pyx_obj_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor __pyx_base;
1991   __Pyx_memviewslice cell_inds;
1992   __Pyx_memviewslice domain_inds;
1993 };
1994 
1995 
1996 /* "oct_visitors.pxd":173
1997  *     cdef np.int64_t[::1] domain_inds
1998  *
1999  * cdef class NeighbourCellVisitor(BaseNeighbourVisitor):             # <<<<<<<<<<<<<<
2000  *     cdef np.uint8_t[::1] levels
2001  *     cdef np.int64_t[::1] file_inds
2002  */
2003 struct __pyx_obj_2yt_8geometry_12oct_visitors_NeighbourCellVisitor {
2004   struct __pyx_obj_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor __pyx_base;
2005   __Pyx_memviewslice levels;
2006   __Pyx_memviewslice file_inds;
2007   __Pyx_memviewslice cell_inds;
2008   __Pyx_memviewslice domains;
2009 };
2010 
2011 
2012 /* "selection_routines.pxd":24
2013  *
2014  *
2015  * cdef class SelectorObject:             # <<<<<<<<<<<<<<
2016  *     cdef public np.int32_t min_level
2017  *     cdef public np.int32_t max_level
2018  */
2019 struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject {
2020   PyObject_HEAD
2021   struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *__pyx_vtab;
2022   __pyx_t_5numpy_int32_t min_level;
2023   __pyx_t_5numpy_int32_t max_level;
2024   int overlap_cells;
2025   __pyx_t_5numpy_float64_t domain_width[3];
2026   __pyx_t_5numpy_float64_t domain_center[3];
2027   int periodicity[3];
2028   int _hash_initialized;
2029   __pyx_t_5numpy_int64_t _hash;
2030 };
2031 
2032 
2033 /* "selection_routines.pxd":70
2034  *         self, np.float64_t x1, np.float64_t x2, int d) nogil
2035  *
2036  * cdef class AlwaysSelector(SelectorObject):             # <<<<<<<<<<<<<<
2037  *     pass
2038  *
2039  */
2040 struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector {
2041   struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject __pyx_base;
2042 };
2043 
2044 
2045 /* "selection_routines.pxd":73
2046  *     pass
2047  *
2048  * cdef class OctreeSubsetSelector(SelectorObject):             # <<<<<<<<<<<<<<
2049  *     cdef public SelectorObject base_selector
2050  *     cdef public np.int64_t domain_id
2051  */
2052 struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector {
2053   struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject __pyx_base;
2054   struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *base_selector;
2055   __pyx_t_5numpy_int64_t domain_id;
2056 };
2057 
2058 
2059 /* "selection_routines.pxd":77
2060  *     cdef public np.int64_t domain_id
2061  *
2062  * cdef class BooleanSelector(SelectorObject):             # <<<<<<<<<<<<<<
2063  *     cdef public SelectorObject sel1
2064  *     cdef public SelectorObject sel2
2065  */
2066 struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector {
2067   struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject __pyx_base;
2068   struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *sel1;
2069   struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *sel2;
2070 };
2071 
2072 
2073 /* "yt/utilities/lib/allocation_container.pxd":20
2074  *     void *my_objs
2075  *
2076  * cdef class ObjectPool:             # <<<<<<<<<<<<<<
2077  *     cdef public np.uint64_t itemsize
2078  *     cdef np.uint64_t n_con
2079  */
2080 struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool {
2081   PyObject_HEAD
2082   struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_vtab;
2083   __pyx_t_5numpy_uint64_t itemsize;
2084   __pyx_t_5numpy_uint64_t n_con;
2085   struct __pyx_t_2yt_9utilities_3lib_20allocation_container_AllocationContainer *containers;
2086 };
2087 
2088 
2089 /* "yt/geometry/oct_container.pxd":47
2090  *     Oct *my_objs
2091  *
2092  * cdef class OctObjectPool(ObjectPool):             # <<<<<<<<<<<<<<
2093  *     cdef inline OctAllocationContainer *get_cont(self, int i):
2094  *         return <OctAllocationContainer*> (&self.containers[i])
2095  */
2096 struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool {
2097   struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool __pyx_base;
2098 };
2099 
2100 
2101 /* "yt/geometry/oct_container.pxd":55
2102  * cdef void OctList_delete(OctList *list)
2103  *
2104  * cdef class OctreeContainer:             # <<<<<<<<<<<<<<
2105  *     cdef public OctObjectPool domains
2106  *     cdef Oct ****root_mesh
2107  */
2108 struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer {
2109   PyObject_HEAD
2110   struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *__pyx_vtab;
2111   struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *domains;
2112   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct ****root_mesh;
2113   int partial_coverage;
2114   int level_offset;
2115   int nn[3];
2116   __pyx_t_5numpy_uint8_t oref;
2117   __pyx_t_5numpy_float64_t DLE[3];
2118   __pyx_t_5numpy_float64_t DRE[3];
2119   __pyx_t_5numpy_int64_t nocts;
2120   int num_domains;
2121   PyObject *fill_style;
2122 };
2123 
2124 
2125 /* "yt/geometry/oct_container.pxd":85
2126  *     cdef public object fill_style
2127  *
2128  * cdef class SparseOctreeContainer(OctreeContainer):             # <<<<<<<<<<<<<<
2129  *     cdef OctKey *root_nodes
2130  *     cdef void *tree_root
2131  */
2132 struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer {
2133   struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer __pyx_base;
2134   struct __pyx_t_2yt_8geometry_13oct_container_OctKey *root_nodes;
2135   void *tree_root;
2136   int num_root;
2137   int max_root;
2138 };
2139 
2140 
2141 /* "yt/geometry/oct_container.pxd":93
2142  *     cdef np.int64_t ipos_to_key(self, int pos[3]) nogil
2143  *
2144  * cdef class RAMSESOctreeContainer(SparseOctreeContainer):             # <<<<<<<<<<<<<<
2145  *     pass
2146  *
2147  */
2148 struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer {
2149   struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer __pyx_base;
2150 };
2151 
2152 
2153 /* "yt/utilities/cython_fortran_utils.pxd":8
2154  * ctypedef np.float64_t DOUBLE_t
2155  *
2156  * cdef class FortranFile:             # <<<<<<<<<<<<<<
2157  *     cdef FILE* cfile
2158  *     cdef bint _closed
2159  */
2160 struct __pyx_obj_2yt_9utilities_20cython_fortran_utils_FortranFile {
2161   PyObject_HEAD
2162   struct __pyx_vtabstruct_2yt_9utilities_20cython_fortran_utils_FortranFile *__pyx_vtab;
2163   FILE *cfile;
2164   int _closed;
2165 };
2166 
2167 
2168 /* "yt/frontends/ramses/io_utils.pyx":21
2169  * @cython.cdivision(True)
2170  * @cython.nonecheck(False)
2171  * def read_amr(FortranFile f, dict headers,             # <<<<<<<<<<<<<<
2172  *              np.ndarray[np.int64_t, ndim=1] ngridbound, INT64_t min_level,
2173  *              RAMSESOctreeContainer oct_handler):
2174  */
2175 struct __pyx_obj_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct__read_amr {
2176   PyObject_HEAD
2177   PyObject *__pyx_v_headers;
2178 };
2179 
2180 
2181 /* "yt/frontends/ramses/io_utils.pyx":35
2182  *     numbl = headers['numbl']
2183  *     nboundary = headers['nboundary']
2184  *     nx, ny, nz = (((i-1.0)/2.0) for i in headers['nx'])             # <<<<<<<<<<<<<<
2185  *     nlevelmax = headers['nlevelmax']
2186  *     ncpu = headers['ncpu']
2187  */
2188 struct __pyx_obj_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct_1_genexpr {
2189   PyObject_HEAD
2190   struct __pyx_obj_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct__read_amr *__pyx_outer_scope;
2191   PyObject *__pyx_v_i;
2192   PyObject *__pyx_t_0;
2193   Py_ssize_t __pyx_t_1;
2194   PyObject *(*__pyx_t_2)(PyObject *);
2195 };
2196 
2197 
2198 /* "View.MemoryView":105
2199  *
2200  * @cname("__pyx_array")
2201  * cdef class array:             # <<<<<<<<<<<<<<
2202  *
2203  *     cdef:
2204  */
2205 struct __pyx_array_obj {
2206   PyObject_HEAD
2207   struct __pyx_vtabstruct_array *__pyx_vtab;
2208   char *data;
2209   Py_ssize_t len;
2210   char *format;
2211   int ndim;
2212   Py_ssize_t *_shape;
2213   Py_ssize_t *_strides;
2214   Py_ssize_t itemsize;
2215   PyObject *mode;
2216   PyObject *_format;
2217   void (*callback_free_data)(void *);
2218   int free_data;
2219   int dtype_is_object;
2220 };
2221 
2222 
2223 /* "View.MemoryView":279
2224  *
2225  * @cname('__pyx_MemviewEnum')
2226  * cdef class Enum(object):             # <<<<<<<<<<<<<<
2227  *     cdef object name
2228  *     def __init__(self, name):
2229  */
2230 struct __pyx_MemviewEnum_obj {
2231   PyObject_HEAD
2232   PyObject *name;
2233 };
2234 
2235 
2236 /* "View.MemoryView":330
2237  *
2238  * @cname('__pyx_memoryview')
2239  * cdef class memoryview(object):             # <<<<<<<<<<<<<<
2240  *
2241  *     cdef object obj
2242  */
2243 struct __pyx_memoryview_obj {
2244   PyObject_HEAD
2245   struct __pyx_vtabstruct_memoryview *__pyx_vtab;
2246   PyObject *obj;
2247   PyObject *_size;
2248   PyObject *_array_interface;
2249   PyThread_type_lock lock;
2250   __pyx_atomic_int acquisition_count[2];
2251   __pyx_atomic_int *acquisition_count_aligned_p;
2252   Py_buffer view;
2253   int flags;
2254   int dtype_is_object;
2255   __Pyx_TypeInfo *typeinfo;
2256 };
2257 
2258 
2259 /* "View.MemoryView":961
2260  *
2261  * @cname('__pyx_memoryviewslice')
2262  * cdef class _memoryviewslice(memoryview):             # <<<<<<<<<<<<<<
2263  *     "Internal class for passing memoryview slices to Python"
2264  *
2265  */
2266 struct __pyx_memoryviewslice_obj {
2267   struct __pyx_memoryview_obj __pyx_base;
2268   __Pyx_memviewslice from_slice;
2269   PyObject *from_object;
2270   PyObject *(*to_object_func)(char *);
2271   int (*to_dtype_func)(char *, PyObject *);
2272 };
2273 
2274 
2275 
2276 /* "oct_visitors.pxd":33
2277  *     np.int64_t padding
2278  *
2279  * cdef class OctVisitor:             # <<<<<<<<<<<<<<
2280  *     cdef np.uint64_t index
2281  *     cdef np.uint64_t last
2282  */
2283 
2284 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor {
2285   void (*visit)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_uint8_t);
2286   int (*oind)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *);
2287   int (*rind)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *);
2288 };
2289 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor;
2290 static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_oind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *);
2291 static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_rind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *);
2292 
2293 
2294 /* "oct_visitors.pxd":59
2295  *         return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0])
2296  *
2297  * cdef class CountTotalOcts(OctVisitor):             # <<<<<<<<<<<<<<
2298  *     pass
2299  *
2300  */
2301 
2302 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CountTotalOcts {
2303   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2304 };
2305 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CountTotalOcts *__pyx_vtabptr_2yt_8geometry_12oct_visitors_CountTotalOcts;
2306 
2307 
2308 /* "oct_visitors.pxd":62
2309  *     pass
2310  *
2311  * cdef class CountTotalCells(OctVisitor):             # <<<<<<<<<<<<<<
2312  *     pass
2313  *
2314  */
2315 
2316 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CountTotalCells {
2317   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2318 };
2319 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CountTotalCells *__pyx_vtabptr_2yt_8geometry_12oct_visitors_CountTotalCells;
2320 
2321 
2322 /* "oct_visitors.pxd":65
2323  *     pass
2324  *
2325  * cdef class MarkOcts(OctVisitor):             # <<<<<<<<<<<<<<
2326  *     # Unused
2327  *     cdef np.uint8_t[:,:,:,:] mark
2328  */
2329 
2330 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_MarkOcts {
2331   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2332 };
2333 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_MarkOcts *__pyx_vtabptr_2yt_8geometry_12oct_visitors_MarkOcts;
2334 
2335 
2336 /* "oct_visitors.pxd":69
2337  *     cdef np.uint8_t[:,:,:,:] mark
2338  *
2339  * cdef class MaskOcts(OctVisitor):             # <<<<<<<<<<<<<<
2340  *     cdef np.uint8_t[:,:,:,:] mask
2341  *
2342  */
2343 
2344 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_MaskOcts {
2345   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2346 };
2347 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_MaskOcts *__pyx_vtabptr_2yt_8geometry_12oct_visitors_MaskOcts;
2348 
2349 
2350 /* "oct_visitors.pxd":72
2351  *     cdef np.uint8_t[:,:,:,:] mask
2352  *
2353  * cdef class IndexOcts(OctVisitor):             # <<<<<<<<<<<<<<
2354  *     cdef np.int64_t[:] oct_index
2355  *
2356  */
2357 
2358 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_IndexOcts {
2359   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2360 };
2361 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_IndexOcts *__pyx_vtabptr_2yt_8geometry_12oct_visitors_IndexOcts;
2362 
2363 
2364 /* "oct_visitors.pxd":75
2365  *     cdef np.int64_t[:] oct_index
2366  *
2367  * cdef class MaskedIndexOcts(OctVisitor):             # <<<<<<<<<<<<<<
2368  *     cdef np.int64_t[:] oct_index
2369  *     cdef np.uint8_t[:] oct_mask
2370  */
2371 
2372 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_MaskedIndexOcts {
2373   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2374 };
2375 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_MaskedIndexOcts *__pyx_vtabptr_2yt_8geometry_12oct_visitors_MaskedIndexOcts;
2376 
2377 
2378 /* "oct_visitors.pxd":79
2379  *     cdef np.uint8_t[:] oct_mask
2380  *
2381  * cdef class IndexMaskMapOcts(OctVisitor):             # <<<<<<<<<<<<<<
2382  *     cdef np.int64_t[:] oct_index
2383  *     cdef np.uint8_t[:] oct_mask
2384  */
2385 
2386 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_IndexMaskMapOcts {
2387   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2388 };
2389 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_IndexMaskMapOcts *__pyx_vtabptr_2yt_8geometry_12oct_visitors_IndexMaskMapOcts;
2390 
2391 
2392 /* "oct_visitors.pxd":85
2393  *     cdef np.uint64_t map_index
2394  *
2395  * cdef class ICoordsOcts(OctVisitor):             # <<<<<<<<<<<<<<
2396  *     cdef np.int64_t[:,:] icoords
2397  *
2398  */
2399 
2400 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_ICoordsOcts {
2401   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2402 };
2403 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_ICoordsOcts *__pyx_vtabptr_2yt_8geometry_12oct_visitors_ICoordsOcts;
2404 
2405 
2406 /* "oct_visitors.pxd":88
2407  *     cdef np.int64_t[:,:] icoords
2408  *
2409  * cdef class IResOcts(OctVisitor):             # <<<<<<<<<<<<<<
2410  *     cdef np.int64_t[:] ires
2411  *
2412  */
2413 
2414 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_IResOcts {
2415   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2416 };
2417 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_IResOcts *__pyx_vtabptr_2yt_8geometry_12oct_visitors_IResOcts;
2418 
2419 
2420 /* "oct_visitors.pxd":91
2421  *     cdef np.int64_t[:] ires
2422  *
2423  * cdef class FCoordsOcts(OctVisitor):             # <<<<<<<<<<<<<<
2424  *     cdef np.float64_t[:,:] fcoords
2425  *
2426  */
2427 
2428 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_FCoordsOcts {
2429   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2430 };
2431 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_FCoordsOcts *__pyx_vtabptr_2yt_8geometry_12oct_visitors_FCoordsOcts;
2432 
2433 
2434 /* "oct_visitors.pxd":94
2435  *     cdef np.float64_t[:,:] fcoords
2436  *
2437  * cdef class FWidthOcts(OctVisitor):             # <<<<<<<<<<<<<<
2438  *     cdef np.float64_t[:,:] fwidth
2439  *
2440  */
2441 
2442 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_FWidthOcts {
2443   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2444 };
2445 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_FWidthOcts *__pyx_vtabptr_2yt_8geometry_12oct_visitors_FWidthOcts;
2446 
2447 
2448 /* "oct_visitors.pxd":97
2449  *     cdef np.float64_t[:,:] fwidth
2450  *
2451  * cdef class CopyArrayI64(OctVisitor):             # <<<<<<<<<<<<<<
2452  *     cdef np.int64_t[:,:,:,:,:,:] source
2453  *     cdef np.int64_t[:,:] dest
2454  */
2455 
2456 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CopyArrayI64 {
2457   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2458 };
2459 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CopyArrayI64 *__pyx_vtabptr_2yt_8geometry_12oct_visitors_CopyArrayI64;
2460 
2461 
2462 /* "oct_visitors.pxd":101
2463  *     cdef np.int64_t[:,:] dest
2464  *
2465  * cdef class CopyArrayF64(OctVisitor):             # <<<<<<<<<<<<<<
2466  *     cdef np.float64_t[:,:,:,:,:] source
2467  *     cdef np.float64_t[:,:] dest
2468  */
2469 
2470 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CopyArrayF64 {
2471   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2472 };
2473 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CopyArrayF64 *__pyx_vtabptr_2yt_8geometry_12oct_visitors_CopyArrayF64;
2474 
2475 
2476 /* "oct_visitors.pxd":105
2477  *     cdef np.float64_t[:,:] dest
2478  *
2479  * cdef class CopyFileIndArrayI8(OctVisitor):             # <<<<<<<<<<<<<<
2480  *     cdef np.int64_t root
2481  *     cdef np.uint8_t[:] source
2482  */
2483 
2484 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CopyFileIndArrayI8 {
2485   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2486 };
2487 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CopyFileIndArrayI8 *__pyx_vtabptr_2yt_8geometry_12oct_visitors_CopyFileIndArrayI8;
2488 
2489 
2490 /* "oct_visitors.pxd":110
2491  *     cdef np.uint8_t[:] dest
2492  *
2493  * cdef class IdentifyOcts(OctVisitor):             # <<<<<<<<<<<<<<
2494  *     cdef np.uint8_t[:] domain_mask
2495  *
2496  */
2497 
2498 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_IdentifyOcts {
2499   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2500 };
2501 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_IdentifyOcts *__pyx_vtabptr_2yt_8geometry_12oct_visitors_IdentifyOcts;
2502 
2503 
2504 /* "oct_visitors.pxd":113
2505  *     cdef np.uint8_t[:] domain_mask
2506  *
2507  * cdef class AssignDomainInd(OctVisitor):             # <<<<<<<<<<<<<<
2508  *     pass
2509  *
2510  */
2511 
2512 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_AssignDomainInd {
2513   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2514 };
2515 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_AssignDomainInd *__pyx_vtabptr_2yt_8geometry_12oct_visitors_AssignDomainInd;
2516 
2517 
2518 /* "oct_visitors.pxd":116
2519  *     pass
2520  *
2521  * cdef class FillFileIndicesO(OctVisitor):             # <<<<<<<<<<<<<<
2522  *     cdef np.uint8_t[:] levels
2523  *     cdef np.int64_t[:] file_inds
2524  */
2525 
2526 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_FillFileIndicesO {
2527   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2528 };
2529 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_FillFileIndicesO *__pyx_vtabptr_2yt_8geometry_12oct_visitors_FillFileIndicesO;
2530 
2531 
2532 /* "oct_visitors.pxd":121
2533  *     cdef np.uint8_t[:] cell_inds
2534  *
2535  * cdef class FillFileIndicesR(OctVisitor):             # <<<<<<<<<<<<<<
2536  *     cdef np.uint8_t[:] levels
2537  *     cdef np.int64_t[:] file_inds
2538  */
2539 
2540 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_FillFileIndicesR {
2541   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2542 };
2543 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_FillFileIndicesR *__pyx_vtabptr_2yt_8geometry_12oct_visitors_FillFileIndicesR;
2544 
2545 
2546 /* "oct_visitors.pxd":126
2547  *     cdef np.uint8_t[:] cell_inds
2548  *
2549  * cdef class CountByDomain(OctVisitor):             # <<<<<<<<<<<<<<
2550  *     cdef np.int64_t[:] domain_counts
2551  *
2552  */
2553 
2554 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CountByDomain {
2555   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2556 };
2557 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CountByDomain *__pyx_vtabptr_2yt_8geometry_12oct_visitors_CountByDomain;
2558 
2559 
2560 /* "oct_visitors.pxd":129
2561  *     cdef np.int64_t[:] domain_counts
2562  *
2563  * cdef class StoreOctree(OctVisitor):             # <<<<<<<<<<<<<<
2564  *     cdef np.uint8_t[:] ref_mask
2565  *
2566  */
2567 
2568 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_StoreOctree {
2569   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2570 };
2571 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_StoreOctree *__pyx_vtabptr_2yt_8geometry_12oct_visitors_StoreOctree;
2572 
2573 
2574 /* "oct_visitors.pxd":132
2575  *     cdef np.uint8_t[:] ref_mask
2576  *
2577  * cdef class LoadOctree(OctVisitor):             # <<<<<<<<<<<<<<
2578  *     cdef np.uint8_t[:] ref_mask
2579  *     cdef Oct* octs
2580  */
2581 
2582 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_LoadOctree {
2583   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2584 };
2585 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_LoadOctree *__pyx_vtabptr_2yt_8geometry_12oct_visitors_LoadOctree;
2586 
2587 
2588 /* "oct_visitors.pxd":138
2589  *     cdef np.uint64_t *nfinest
2590  *
2591  * cdef class MortonIndexOcts(OctVisitor):             # <<<<<<<<<<<<<<
2592  *     cdef np.uint8_t[:] level_arr
2593  *     cdef np.uint64_t[:] morton_ind
2594  */
2595 
2596 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_MortonIndexOcts {
2597   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2598 };
2599 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_MortonIndexOcts *__pyx_vtabptr_2yt_8geometry_12oct_visitors_MortonIndexOcts;
2600 
2601 
2602 /* "oct_visitors.pxd":149
2603  *
2604  *
2605  * cdef class StoreIndex(OctVisitor):             # <<<<<<<<<<<<<<
2606  *     cdef np.int64_t[:,:,:,:] cell_inds
2607  *
2608  */
2609 
2610 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_StoreIndex {
2611   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2612 };
2613 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_StoreIndex *__pyx_vtabptr_2yt_8geometry_12oct_visitors_StoreIndex;
2614 
2615 
2616 /* "oct_visitors.pxd":153
2617  *
2618  * # cimport oct_container
2619  * cdef class BaseNeighbourVisitor(OctVisitor):             # <<<<<<<<<<<<<<
2620  *     cdef int idim      # 0,1,2 for x,y,z
2621  *     cdef int direction # +1 for +x, -1 for -x
2622  */
2623 
2624 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor {
2625   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2626   void (*set_neighbour_info)(struct __pyx_obj_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, int *);
2627   __pyx_t_5numpy_uint8_t (*neighbour_rind)(struct __pyx_obj_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor *);
2628 };
2629 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor *__pyx_vtabptr_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor;
2630 static CYTHON_INLINE __pyx_t_5numpy_uint8_t __pyx_f_2yt_8geometry_12oct_visitors_20BaseNeighbourVisitor_neighbour_rind(struct __pyx_obj_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor *);
2631 
2632 
2633 /* "oct_visitors.pxd":169
2634  *         return (((self.neigh_ind[2]*d)+self.neigh_ind[1])*d+self.neigh_ind[0])
2635  *
2636  * cdef class NeighbourCellIndexVisitor(BaseNeighbourVisitor):             # <<<<<<<<<<<<<<
2637  *     cdef np.uint8_t[::1] cell_inds
2638  *     cdef np.int64_t[::1] domain_inds
2639  */
2640 
2641 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_NeighbourCellIndexVisitor {
2642   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor __pyx_base;
2643 };
2644 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_NeighbourCellIndexVisitor *__pyx_vtabptr_2yt_8geometry_12oct_visitors_NeighbourCellIndexVisitor;
2645 
2646 
2647 /* "oct_visitors.pxd":173
2648  *     cdef np.int64_t[::1] domain_inds
2649  *
2650  * cdef class NeighbourCellVisitor(BaseNeighbourVisitor):             # <<<<<<<<<<<<<<
2651  *     cdef np.uint8_t[::1] levels
2652  *     cdef np.int64_t[::1] file_inds
2653  */
2654 
2655 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_NeighbourCellVisitor {
2656   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor __pyx_base;
2657 };
2658 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_NeighbourCellVisitor *__pyx_vtabptr_2yt_8geometry_12oct_visitors_NeighbourCellVisitor;
2659 
2660 
2661 /* "selection_routines.pxd":24
2662  *
2663  *
2664  * cdef class SelectorObject:             # <<<<<<<<<<<<<<
2665  *     cdef public np.int32_t min_level
2666  *     cdef public np.int32_t max_level
2667  */
2668 
2669 struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject {
2670   void (*recursively_visit_octs)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, int, struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_recursively_visit_octs *__pyx_optional_args);
2671   void (*visit_oct_cells)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, int, int, int);
2672   int (*select_grid)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_int32_t, struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_select_grid *__pyx_optional_args);
2673   int (*select_grid_edge)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_int32_t, struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_select_grid_edge *__pyx_optional_args);
2674   int (*select_cell)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *);
2675   int (*select_point)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *);
2676   int (*select_sphere)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t);
2677   int (*select_bbox)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *);
2678   int (*select_bbox_edge)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *);
2679   int (*fill_mask_selector)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, int *, PyArrayObject *, PyArrayObject *, int);
2680   void (*visit_grid_cells)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *, __pyx_t_2yt_8geometry_13grid_visitors_grid_visitor_function *, struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_visit_grid_cells *__pyx_optional_args);
2681   __pyx_t_5numpy_float64_t (*periodic_difference)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, int);
2682 };
2683 static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject;
2684 
2685 
2686 /* "selection_routines.pxd":70
2687  *         self, np.float64_t x1, np.float64_t x2, int d) nogil
2688  *
2689  * cdef class AlwaysSelector(SelectorObject):             # <<<<<<<<<<<<<<
2690  *     pass
2691  *
2692  */
2693 
2694 struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_AlwaysSelector {
2695   struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject __pyx_base;
2696 };
2697 static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_AlwaysSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector;
2698 
2699 
2700 /* "selection_routines.pxd":73
2701  *     pass
2702  *
2703  * cdef class OctreeSubsetSelector(SelectorObject):             # <<<<<<<<<<<<<<
2704  *     cdef public SelectorObject base_selector
2705  *     cdef public np.int64_t domain_id
2706  */
2707 
2708 struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_OctreeSubsetSelector {
2709   struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject __pyx_base;
2710 };
2711 static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_OctreeSubsetSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector;
2712 
2713 
2714 /* "selection_routines.pxd":77
2715  *     cdef public np.int64_t domain_id
2716  *
2717  * cdef class BooleanSelector(SelectorObject):             # <<<<<<<<<<<<<<
2718  *     cdef public SelectorObject sel1
2719  *     cdef public SelectorObject sel2
2720  */
2721 
2722 struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanSelector {
2723   struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject __pyx_base;
2724 };
2725 static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanSelector;
2726 
2727 
2728 /* "yt/utilities/lib/allocation_container.pxd":20
2729  *     void *my_objs
2730  *
2731  * cdef class ObjectPool:             # <<<<<<<<<<<<<<
2732  *     cdef public np.uint64_t itemsize
2733  *     cdef np.uint64_t n_con
2734  */
2735 
2736 struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool {
2737   void (*allocate_objs)(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *, int, struct __pyx_opt_args_2yt_9utilities_3lib_20allocation_container_10ObjectPool_allocate_objs *__pyx_optional_args);
2738   void (*setup_objs)(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *, void *, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_int64_t);
2739   void (*teardown_objs)(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool *, void *, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_int64_t);
2740 };
2741 static struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_vtabptr_2yt_9utilities_3lib_20allocation_container_ObjectPool;
2742 
2743 
2744 /* "yt/geometry/oct_container.pxd":47
2745  *     Oct *my_objs
2746  *
2747  * cdef class OctObjectPool(ObjectPool):             # <<<<<<<<<<<<<<
2748  *     cdef inline OctAllocationContainer *get_cont(self, int i):
2749  *         return <OctAllocationContainer*> (&self.containers[i])
2750  */
2751 
2752 struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctObjectPool {
2753   struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool __pyx_base;
2754   struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *(*get_cont)(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *, int);
2755 };
2756 static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctObjectPool *__pyx_vtabptr_2yt_8geometry_13oct_container_OctObjectPool;
2757 static CYTHON_INLINE struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *, int);
2758 
2759 
2760 /* "yt/geometry/oct_container.pxd":55
2761  * cdef void OctList_delete(OctList *list)
2762  *
2763  * cdef class OctreeContainer:             # <<<<<<<<<<<<<<
2764  *     cdef public OctObjectPool domains
2765  *     cdef Oct ****root_mesh
2766  */
2767 
2768 struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer {
2769   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *(*get)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, __pyx_t_5numpy_float64_t *, struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_get *__pyx_optional_args);
2770   int (*get_root)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, int *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct **);
2771   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct **(*neighbors)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, struct __pyx_t_2yt_8geometry_12oct_visitors_OctInfo *, __pyx_t_5numpy_int64_t *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, int *);
2772   __pyx_t_5numpy_int64_t (*get_domain_offset)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, int);
2773   void (*visit_all_octs)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_visit_all_octs *__pyx_optional_args);
2774   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *(*next_root)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, int, int *);
2775   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *(*next_child)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, int, int *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *);
2776   void (*append_domain)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, __pyx_t_5numpy_int64_t);
2777 };
2778 static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *__pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer;
2779 
2780 
2781 /* "yt/geometry/oct_container.pxd":85
2782  *     cdef public object fill_style
2783  *
2784  * cdef class SparseOctreeContainer(OctreeContainer):             # <<<<<<<<<<<<<<
2785  *     cdef OctKey *root_nodes
2786  *     cdef void *tree_root
2787  */
2788 
2789 struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer {
2790   struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer __pyx_base;
2791   void (*key_to_ipos)(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t *);
2792   __pyx_t_5numpy_int64_t (*ipos_to_key)(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *, int *);
2793 };
2794 static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer *__pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer;
2795 
2796 
2797 /* "yt/geometry/oct_container.pxd":93
2798  *     cdef np.int64_t ipos_to_key(self, int pos[3]) nogil
2799  *
2800  * cdef class RAMSESOctreeContainer(SparseOctreeContainer):             # <<<<<<<<<<<<<<
2801  *     pass
2802  *
2803  */
2804 
2805 struct __pyx_vtabstruct_2yt_8geometry_13oct_container_RAMSESOctreeContainer {
2806   struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer __pyx_base;
2807 };
2808 static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_RAMSESOctreeContainer *__pyx_vtabptr_2yt_8geometry_13oct_container_RAMSESOctreeContainer;
2809 
2810 
2811 /* "yt/utilities/cython_fortran_utils.pxd":8
2812  * ctypedef np.float64_t DOUBLE_t
2813  *
2814  * cdef class FortranFile:             # <<<<<<<<<<<<<<
2815  *     cdef FILE* cfile
2816  *     cdef bint _closed
2817  */
2818 
2819 struct __pyx_vtabstruct_2yt_9utilities_20cython_fortran_utils_FortranFile {
2820   __pyx_t_2yt_9utilities_20cython_fortran_utils_INT64_t (*skip)(struct __pyx_obj_2yt_9utilities_20cython_fortran_utils_FortranFile *, int __pyx_skip_dispatch, struct __pyx_opt_args_2yt_9utilities_20cython_fortran_utils_11FortranFile_skip *__pyx_optional_args);
2821   __pyx_t_2yt_9utilities_20cython_fortran_utils_INT64_t (*get_size)(struct __pyx_obj_2yt_9utilities_20cython_fortran_utils_FortranFile *, PyObject *);
2822   __pyx_t_2yt_9utilities_20cython_fortran_utils_INT32_t (*read_int)(struct __pyx_obj_2yt_9utilities_20cython_fortran_utils_FortranFile *, int __pyx_skip_dispatch);
2823   PyArrayObject *(*read_vector)(struct __pyx_obj_2yt_9utilities_20cython_fortran_utils_FortranFile *, PyObject *, int __pyx_skip_dispatch);
2824   __pyx_t_2yt_9utilities_20cython_fortran_utils_INT64_t (*tell)(struct __pyx_obj_2yt_9utilities_20cython_fortran_utils_FortranFile *, int __pyx_skip_dispatch);
2825   __pyx_t_2yt_9utilities_20cython_fortran_utils_INT64_t (*seek)(struct __pyx_obj_2yt_9utilities_20cython_fortran_utils_FortranFile *, __pyx_t_2yt_9utilities_20cython_fortran_utils_INT64_t, int __pyx_skip_dispatch, struct __pyx_opt_args_2yt_9utilities_20cython_fortran_utils_11FortranFile_seek *__pyx_optional_args);
2826   void (*close)(struct __pyx_obj_2yt_9utilities_20cython_fortran_utils_FortranFile *, int __pyx_skip_dispatch);
2827 };
2828 static struct __pyx_vtabstruct_2yt_9utilities_20cython_fortran_utils_FortranFile *__pyx_vtabptr_2yt_9utilities_20cython_fortran_utils_FortranFile;
2829 
2830 
2831 /* "View.MemoryView":105
2832  *
2833  * @cname("__pyx_array")
2834  * cdef class array:             # <<<<<<<<<<<<<<
2835  *
2836  *     cdef:
2837  */
2838 
2839 struct __pyx_vtabstruct_array {
2840   PyObject *(*get_memview)(struct __pyx_array_obj *);
2841 };
2842 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
2843 
2844 
2845 /* "View.MemoryView":330
2846  *
2847  * @cname('__pyx_memoryview')
2848  * cdef class memoryview(object):             # <<<<<<<<<<<<<<
2849  *
2850  *     cdef object obj
2851  */
2852 
2853 struct __pyx_vtabstruct_memoryview {
2854   char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
2855   PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
2856   PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
2857   PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
2858   PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
2859   PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
2860   PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
2861 };
2862 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
2863 
2864 
2865 /* "View.MemoryView":961
2866  *
2867  * @cname('__pyx_memoryviewslice')
2868  * cdef class _memoryviewslice(memoryview):             # <<<<<<<<<<<<<<
2869  *     "Internal class for passing memoryview slices to Python"
2870  *
2871  */
2872 
2873 struct __pyx_vtabstruct__memoryviewslice {
2874   struct __pyx_vtabstruct_memoryview __pyx_base;
2875 };
2876 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
2877 
2878 /* --- Runtime support code (head) --- */
2879 /* Refnanny.proto */
2880 #ifndef CYTHON_REFNANNY
2881   #define CYTHON_REFNANNY 0
2882 #endif
2883 #if CYTHON_REFNANNY
2884   typedef struct {
2885     void (*INCREF)(void*, PyObject*, int);
2886     void (*DECREF)(void*, PyObject*, int);
2887     void (*GOTREF)(void*, PyObject*, int);
2888     void (*GIVEREF)(void*, PyObject*, int);
2889     void* (*SetupContext)(const char*, int, const char*);
2890     void (*FinishContext)(void**);
2891   } __Pyx_RefNannyAPIStruct;
2892   static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
2893   static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
2894   #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
2895 #ifdef WITH_THREAD
2896   #define __Pyx_RefNannySetupContext(name, acquire_gil)\
2897           if (acquire_gil) {\
2898               PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2899               __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
2900               PyGILState_Release(__pyx_gilstate_save);\
2901           } else {\
2902               __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
2903           }
2904 #else
2905   #define __Pyx_RefNannySetupContext(name, acquire_gil)\
2906           __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
2907 #endif
2908   #define __Pyx_RefNannyFinishContext()\
2909           __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
2910   #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
2911   #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
2912   #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
2913   #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
2914   #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
2915   #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
2916   #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
2917   #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
2918 #else
2919   #define __Pyx_RefNannyDeclarations
2920   #define __Pyx_RefNannySetupContext(name, acquire_gil)
2921   #define __Pyx_RefNannyFinishContext()
2922   #define __Pyx_INCREF(r) Py_INCREF(r)
2923   #define __Pyx_DECREF(r) Py_DECREF(r)
2924   #define __Pyx_GOTREF(r)
2925   #define __Pyx_GIVEREF(r)
2926   #define __Pyx_XINCREF(r) Py_XINCREF(r)
2927   #define __Pyx_XDECREF(r) Py_XDECREF(r)
2928   #define __Pyx_XGOTREF(r)
2929   #define __Pyx_XGIVEREF(r)
2930 #endif
2931 #define __Pyx_XDECREF_SET(r, v) do {\
2932         PyObject *tmp = (PyObject *) r;\
2933         r = v; __Pyx_XDECREF(tmp);\
2934     } while (0)
2935 #define __Pyx_DECREF_SET(r, v) do {\
2936         PyObject *tmp = (PyObject *) r;\
2937         r = v; __Pyx_DECREF(tmp);\
2938     } while (0)
2939 #define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
2940 #define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
2941 
2942 /* PyObjectGetAttrStr.proto */
2943 #if CYTHON_USE_TYPE_SLOTS
2944 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
2945 #else
2946 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
2947 #endif
2948 
2949 /* GetBuiltinName.proto */
2950 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
2951 
2952 /* RaiseArgTupleInvalid.proto */
2953 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
2954     Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
2955 
2956 /* RaiseDoubleKeywords.proto */
2957 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
2958 
2959 /* ParseKeywords.proto */
2960 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
2961     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
2962     const char* function_name);
2963 
2964 /* ArgTypeTest.proto */
2965 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
2966     ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
2967         __Pyx__ArgTypeTest(obj, type, name, exact))
2968 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
2969 
2970 /* None.proto */
2971 static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname);
2972 
2973 /* DictGetItem.proto */
2974 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
2975 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
2976 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
2977     (likely(PyDict_CheckExact(obj)) ?\
2978      __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
2979 #else
2980 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
2981 #define __Pyx_PyObject_Dict_GetItem(obj, name)  PyObject_GetItem(obj, name)
2982 #endif
2983 
2984 /* PyFloatBinop.proto */
2985 #if !CYTHON_COMPILING_IN_PYPY
2986 static PyObject* __Pyx_PyFloat_DivideObjC(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check);
2987 #else
2988 #define __Pyx_PyFloat_DivideObjC(op1, op2, floatval, inplace, zerodivision_check)\
2989     ((inplace ? __Pyx_PyNumber_InPlaceDivide(op1, op2) : __Pyx_PyNumber_Divide(op1, op2)))
2990     #endif
2991 
2992 /* PyFloatBinop.proto */
2993 #if !CYTHON_COMPILING_IN_PYPY
2994 static PyObject* __Pyx_PyFloat_SubtractObjC(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check);
2995 #else
2996 #define __Pyx_PyFloat_SubtractObjC(op1, op2, floatval, inplace, zerodivision_check)\
2997     (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2))
2998 #endif
2999 
3000 /* IsLittleEndian.proto */
3001 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
3002 
3003 /* BufferFormatCheck.proto */
3004 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
3005 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
3006                               __Pyx_BufFmt_StackElem* stack,
3007                               __Pyx_TypeInfo* type);
3008 
3009 /* BufferGetAndValidate.proto */
3010 #define __Pyx_GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)\
3011     ((obj == Py_None || obj == NULL) ?\
3012     (__Pyx_ZeroBuffer(buf), 0) :\
3013     __Pyx__GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack))
3014 static int  __Pyx__GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
3015     __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
3016 static void __Pyx_ZeroBuffer(Py_buffer* buf);
3017 static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);
3018 static Py_ssize_t __Pyx_minusones[] = { -1, -1, -1, -1, -1, -1, -1, -1 };
3019 static Py_ssize_t __Pyx_zeros[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
3020 
3021 /* ExtTypeTest.proto */
3022 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
3023 
3024 /* BufferFallbackError.proto */
3025 static void __Pyx_RaiseBufferFallbackError(void);
3026 
3027 /* RaiseTooManyValuesToUnpack.proto */
3028 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
3029 
3030 /* RaiseNeedMoreValuesToUnpack.proto */
3031 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
3032 
3033 /* IterFinish.proto */
3034 static CYTHON_INLINE int __Pyx_IterFinish(void);
3035 
3036 /* UnpackItemEndCheck.proto */
3037 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
3038 
3039 /* PyDictVersioning.proto */
3040 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
3041 #define __PYX_DICT_VERSION_INIT  ((PY_UINT64_T) -1)
3042 #define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
3043 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
3044     (version_var) = __PYX_GET_DICT_VERSION(dict);\
3045     (cache_var) = (value);
3046 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
3047     static PY_UINT64_T __pyx_dict_version = 0;\
3048     static PyObject *__pyx_dict_cached_value = NULL;\
3049     if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
3050         (VAR) = __pyx_dict_cached_value;\
3051     } else {\
3052         (VAR) = __pyx_dict_cached_value = (LOOKUP);\
3053         __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
3054     }\
3055 }
3056 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
3057 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
3058 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
3059 #else
3060 #define __PYX_GET_DICT_VERSION(dict)  (0)
3061 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
3062 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP)  (VAR) = (LOOKUP);
3063 #endif
3064 
3065 /* GetModuleGlobalName.proto */
3066 #if CYTHON_USE_DICT_VERSIONS
3067 #define __Pyx_GetModuleGlobalName(var, name)  {\
3068     static PY_UINT64_T __pyx_dict_version = 0;\
3069     static PyObject *__pyx_dict_cached_value = NULL;\
3070     (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
3071         (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
3072         __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
3073 }
3074 #define __Pyx_GetModuleGlobalNameUncached(var, name)  {\
3075     PY_UINT64_T __pyx_dict_version;\
3076     PyObject *__pyx_dict_cached_value;\
3077     (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
3078 }
3079 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
3080 #else
3081 #define __Pyx_GetModuleGlobalName(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
3082 #define __Pyx_GetModuleGlobalNameUncached(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
3083 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
3084 #endif
3085 
3086 /* PyObjectCall.proto */
3087 #if CYTHON_COMPILING_IN_CPYTHON
3088 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
3089 #else
3090 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
3091 #endif
3092 
3093 #define __Pyx_BufPtrStrided2d(type, buf, i0, s0, i1, s1) (type)((char*)buf + i0 * s0 + i1 * s1)
3094 #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
3095 /* GetItemInt.proto */
3096 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
3097     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
3098     __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
3099     (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
3100                __Pyx_GetItemInt_Generic(o, to_py_func(i))))
3101 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
3102     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
3103     __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
3104     (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
3105 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
3106                                                               int wraparound, int boundscheck);
3107 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
3108     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
3109     __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
3110     (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
3111 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
3112                                                               int wraparound, int boundscheck);
3113 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
3114 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
3115                                                      int is_list, int wraparound, int boundscheck);
3116 
3117 /* ObjectGetItem.proto */
3118 #if CYTHON_USE_TYPE_SLOTS
3119 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
3120 #else
3121 #define __Pyx_PyObject_GetItem(obj, key)  PyObject_GetItem(obj, key)
3122 #endif
3123 
3124 /* PyThreadStateGet.proto */
3125 #if CYTHON_FAST_THREAD_STATE
3126 #define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
3127 #define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
3128 #define __Pyx_PyErr_Occurred()  __pyx_tstate->curexc_type
3129 #else
3130 #define __Pyx_PyThreadState_declare
3131 #define __Pyx_PyThreadState_assign
3132 #define __Pyx_PyErr_Occurred()  PyErr_Occurred()
3133 #endif
3134 
3135 /* PyErrFetchRestore.proto */
3136 #if CYTHON_FAST_THREAD_STATE
3137 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
3138 #define __Pyx_ErrRestoreWithState(type, value, tb)  __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
3139 #define __Pyx_ErrFetchWithState(type, value, tb)    __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
3140 #define __Pyx_ErrRestore(type, value, tb)  __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
3141 #define __Pyx_ErrFetch(type, value, tb)    __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
3142 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
3143 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
3144 #if CYTHON_COMPILING_IN_CPYTHON
3145 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
3146 #else
3147 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
3148 #endif
3149 #else
3150 #define __Pyx_PyErr_Clear() PyErr_Clear()
3151 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
3152 #define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
3153 #define __Pyx_ErrFetchWithState(type, value, tb)  PyErr_Fetch(type, value, tb)
3154 #define __Pyx_ErrRestoreInState(tstate, type, value, tb)  PyErr_Restore(type, value, tb)
3155 #define __Pyx_ErrFetchInState(tstate, type, value, tb)  PyErr_Fetch(type, value, tb)
3156 #define __Pyx_ErrRestore(type, value, tb)  PyErr_Restore(type, value, tb)
3157 #define __Pyx_ErrFetch(type, value, tb)  PyErr_Fetch(type, value, tb)
3158 #endif
3159 
3160 /* PyFunctionFastCall.proto */
3161 #if CYTHON_FAST_PYCALL
3162 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
3163     __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
3164 #if 1 || PY_VERSION_HEX < 0x030600B1
3165 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
3166 #else
3167 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
3168 #endif
3169 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
3170     (sizeof(char [1 - 2*!(cond)]) - 1)
3171 #ifndef Py_MEMBER_SIZE
3172 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
3173 #endif
3174   static size_t __pyx_pyframe_localsplus_offset = 0;
3175   #include "frameobject.h"
3176   #define __Pxy_PyFrame_Initialize_Offsets()\
3177     ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
3178      (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
3179   #define __Pyx_PyFrame_GetLocalsplus(frame)\
3180     (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
3181 #endif
3182 
3183 /* PyCFunctionFastCall.proto */
3184 #if CYTHON_FAST_PYCCALL
3185 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
3186 #else
3187 #define __Pyx_PyCFunction_FastCall(func, args, nargs)  (assert(0), NULL)
3188 #endif
3189 
3190 /* RaiseException.proto */
3191 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
3192 
3193 /* MemviewSliceInit.proto */
3194 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
3195 #define __Pyx_MEMVIEW_DIRECT   1
3196 #define __Pyx_MEMVIEW_PTR      2
3197 #define __Pyx_MEMVIEW_FULL     4
3198 #define __Pyx_MEMVIEW_CONTIG   8
3199 #define __Pyx_MEMVIEW_STRIDED  16
3200 #define __Pyx_MEMVIEW_FOLLOW   32
3201 #define __Pyx_IS_C_CONTIG 1
3202 #define __Pyx_IS_F_CONTIG 2
3203 static int __Pyx_init_memviewslice(
3204                 struct __pyx_memoryview_obj *memview,
3205                 int ndim,
3206                 __Pyx_memviewslice *memviewslice,
3207                 int memview_is_new_reference);
3208 static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
3209     __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
3210 static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
3211     __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
3212 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
3213 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
3214 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
3215 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
3216 static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
3217 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
3218 
3219 /* ListCompAppend.proto */
3220 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
__Pyx_ListComp_Append(PyObject * list,PyObject * x)3221 static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
3222     PyListObject* L = (PyListObject*) list;
3223     Py_ssize_t len = Py_SIZE(list);
3224     if (likely(L->allocated > len)) {
3225         Py_INCREF(x);
3226         PyList_SET_ITEM(list, len, x);
3227         Py_SIZE(list) = len+1;
3228         return 0;
3229     }
3230     return PyList_Append(list, x);
3231 }
3232 #else
3233 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
3234 #endif
3235 
3236 /* PySequenceContains.proto */
__Pyx_PySequence_ContainsTF(PyObject * item,PyObject * seq,int eq)3237 static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
3238     int result = PySequence_Contains(seq, item);
3239     return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
3240 }
3241 
3242 /* PyObjectCallMethO.proto */
3243 #if CYTHON_COMPILING_IN_CPYTHON
3244 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
3245 #endif
3246 
3247 /* PyObjectCallOneArg.proto */
3248 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
3249 
3250 /* RaiseNoneIterError.proto */
3251 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
3252 
3253 /* GetTopmostException.proto */
3254 #if CYTHON_USE_EXC_INFO_STACK
3255 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
3256 #endif
3257 
3258 /* SaveResetException.proto */
3259 #if CYTHON_FAST_THREAD_STATE
3260 #define __Pyx_ExceptionSave(type, value, tb)  __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
3261 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
3262 #define __Pyx_ExceptionReset(type, value, tb)  __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
3263 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
3264 #else
3265 #define __Pyx_ExceptionSave(type, value, tb)   PyErr_GetExcInfo(type, value, tb)
3266 #define __Pyx_ExceptionReset(type, value, tb)  PyErr_SetExcInfo(type, value, tb)
3267 #endif
3268 
3269 /* PyErrExceptionMatches.proto */
3270 #if CYTHON_FAST_THREAD_STATE
3271 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
3272 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
3273 #else
3274 #define __Pyx_PyErr_ExceptionMatches(err)  PyErr_ExceptionMatches(err)
3275 #endif
3276 
3277 /* GetException.proto */
3278 #if CYTHON_FAST_THREAD_STATE
3279 #define __Pyx_GetException(type, value, tb)  __Pyx__GetException(__pyx_tstate, type, value, tb)
3280 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
3281 #else
3282 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
3283 #endif
3284 
3285 /* GetAttr.proto */
3286 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
3287 
3288 /* HasAttr.proto */
3289 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
3290 
3291 /* IncludeStringH.proto */
3292 #include <string.h>
3293 
3294 /* BytesEquals.proto */
3295 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
3296 
3297 /* UnicodeEquals.proto */
3298 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
3299 
3300 /* StrEquals.proto */
3301 #if PY_MAJOR_VERSION >= 3
3302 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
3303 #else
3304 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
3305 #endif
3306 
3307 /* PyObjectCall2Args.proto */
3308 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
3309 
3310 /* BufferIndexError.proto */
3311 static void __Pyx_RaiseBufferIndexError(int axis);
3312 
3313 /* WriteUnraisableException.proto */
3314 static void __Pyx_WriteUnraisable(const char *name, int clineno,
3315                                   int lineno, const char *filename,
3316                                   int full_traceback, int nogil);
3317 
3318 /* None.proto */
3319 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
3320 
3321 /* UnaryNegOverflows.proto */
3322 #define UNARY_NEG_WOULD_OVERFLOW(x)\
3323         (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
3324 
3325 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
3326 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
3327 /* decode_c_string_utf16.proto */
__Pyx_PyUnicode_DecodeUTF16(const char * s,Py_ssize_t size,const char * errors)3328 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
3329     int byteorder = 0;
3330     return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
3331 }
__Pyx_PyUnicode_DecodeUTF16LE(const char * s,Py_ssize_t size,const char * errors)3332 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
3333     int byteorder = -1;
3334     return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
3335 }
__Pyx_PyUnicode_DecodeUTF16BE(const char * s,Py_ssize_t size,const char * errors)3336 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
3337     int byteorder = 1;
3338     return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
3339 }
3340 
3341 /* decode_c_string.proto */
3342 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
3343          const char* cstring, Py_ssize_t start, Py_ssize_t stop,
3344          const char* encoding, const char* errors,
3345          PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
3346 
3347 /* GetAttr3.proto */
3348 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
3349 
3350 /* SwapException.proto */
3351 #if CYTHON_FAST_THREAD_STATE
3352 #define __Pyx_ExceptionSwap(type, value, tb)  __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
3353 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
3354 #else
3355 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
3356 #endif
3357 
3358 /* Import.proto */
3359 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
3360 
3361 /* FastTypeChecks.proto */
3362 #if CYTHON_COMPILING_IN_CPYTHON
3363 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
3364 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
3365 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
3366 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
3367 #else
3368 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
3369 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
3370 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
3371 #endif
3372 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
3373 
3374 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
3375 /* PyIntBinop.proto */
3376 #if !CYTHON_COMPILING_IN_PYPY
3377 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
3378 #else
3379 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
3380     (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
3381 #endif
3382 
3383 /* ListExtend.proto */
__Pyx_PyList_Extend(PyObject * L,PyObject * v)3384 static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
3385 #if CYTHON_COMPILING_IN_CPYTHON
3386     PyObject* none = _PyList_Extend((PyListObject*)L, v);
3387     if (unlikely(!none))
3388         return -1;
3389     Py_DECREF(none);
3390     return 0;
3391 #else
3392     return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
3393 #endif
3394 }
3395 
3396 /* ListAppend.proto */
3397 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
__Pyx_PyList_Append(PyObject * list,PyObject * x)3398 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
3399     PyListObject* L = (PyListObject*) list;
3400     Py_ssize_t len = Py_SIZE(list);
3401     if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
3402         Py_INCREF(x);
3403         PyList_SET_ITEM(list, len, x);
3404         Py_SIZE(list) = len+1;
3405         return 0;
3406     }
3407     return PyList_Append(list, x);
3408 }
3409 #else
3410 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
3411 #endif
3412 
3413 /* None.proto */
3414 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
3415 
3416 /* None.proto */
3417 static CYTHON_INLINE long __Pyx_div_long(long, long);
3418 
3419 /* ImportFrom.proto */
3420 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
3421 
3422 /* PyObject_GenericGetAttrNoDict.proto */
3423 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
3424 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
3425 #else
3426 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
3427 #endif
3428 
3429 /* PyObject_GenericGetAttr.proto */
3430 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
3431 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
3432 #else
3433 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
3434 #endif
3435 
3436 /* SetVTable.proto */
3437 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
3438 
3439 /* SetupReduce.proto */
3440 static int __Pyx_setup_reduce(PyObject* type_obj);
3441 
3442 /* TypeImport.proto */
3443 #ifndef __PYX_HAVE_RT_ImportType_proto
3444 #define __PYX_HAVE_RT_ImportType_proto
3445 enum __Pyx_ImportType_CheckSize {
3446    __Pyx_ImportType_CheckSize_Error = 0,
3447    __Pyx_ImportType_CheckSize_Warn = 1,
3448    __Pyx_ImportType_CheckSize_Ignore = 2
3449 };
3450 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
3451 #endif
3452 
3453 /* GetVTable.proto */
3454 static void* __Pyx_GetVtable(PyObject *dict);
3455 
3456 /* CLineInTraceback.proto */
3457 #ifdef CYTHON_CLINE_IN_TRACEBACK
3458 #define __Pyx_CLineForTraceback(tstate, c_line)  (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
3459 #else
3460 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
3461 #endif
3462 
3463 /* CodeObjectCache.proto */
3464 typedef struct {
3465     PyCodeObject* code_object;
3466     int code_line;
3467 } __Pyx_CodeObjectCacheEntry;
3468 struct __Pyx_CodeObjectCache {
3469     int count;
3470     int max_count;
3471     __Pyx_CodeObjectCacheEntry* entries;
3472 };
3473 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
3474 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
3475 static PyCodeObject *__pyx_find_code_object(int code_line);
3476 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
3477 
3478 /* AddTraceback.proto */
3479 static void __Pyx_AddTraceback(const char *funcname, int c_line,
3480                                int py_line, const char *filename);
3481 
3482 #if PY_MAJOR_VERSION < 3
3483     static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
3484     static void __Pyx_ReleaseBuffer(Py_buffer *view);
3485 #else
3486     #define __Pyx_GetBuffer PyObject_GetBuffer
3487     #define __Pyx_ReleaseBuffer PyBuffer_Release
3488 #endif
3489 
3490 
3491 /* BufferStructDeclare.proto */
3492 typedef struct {
3493   Py_ssize_t shape, strides, suboffsets;
3494 } __Pyx_Buf_DimInfo;
3495 typedef struct {
3496   size_t refcount;
3497   Py_buffer pybuffer;
3498 } __Pyx_Buffer;
3499 typedef struct {
3500   __Pyx_Buffer *rcbuffer;
3501   char *data;
3502   __Pyx_Buf_DimInfo diminfo[8];
3503 } __Pyx_LocalBuf_ND;
3504 
3505 /* MemviewSliceIsContig.proto */
3506 static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
3507 
3508 /* OverlappingSlices.proto */
3509 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
3510                                 __Pyx_memviewslice *slice2,
3511                                 int ndim, size_t itemsize);
3512 
3513 /* Capsule.proto */
3514 static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
3515 
3516 /* None.proto */
3517 static CYTHON_INLINE __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __Pyx_pow___pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t(__pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t, __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t);
3518 
3519 /* CIntToPy.proto */
3520 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value);
3521 
3522 /* CIntToPy.proto */
3523 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value);
3524 
3525 /* CIntToPy.proto */
3526 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
3527 
3528 /* CIntToPy.proto */
3529 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
3530 
3531 /* RealImag.proto */
3532 #if CYTHON_CCOMPLEX
3533   #ifdef __cplusplus
3534     #define __Pyx_CREAL(z) ((z).real())
3535     #define __Pyx_CIMAG(z) ((z).imag())
3536   #else
3537     #define __Pyx_CREAL(z) (__real__(z))
3538     #define __Pyx_CIMAG(z) (__imag__(z))
3539   #endif
3540 #else
3541     #define __Pyx_CREAL(z) ((z).real)
3542     #define __Pyx_CIMAG(z) ((z).imag)
3543 #endif
3544 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
3545         && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
3546     #define __Pyx_SET_CREAL(z,x) ((z).real(x))
3547     #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
3548 #else
3549     #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
3550     #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
3551 #endif
3552 
3553 /* Arithmetic.proto */
3554 #if CYTHON_CCOMPLEX
3555     #define __Pyx_c_eq_float(a, b)   ((a)==(b))
3556     #define __Pyx_c_sum_float(a, b)  ((a)+(b))
3557     #define __Pyx_c_diff_float(a, b) ((a)-(b))
3558     #define __Pyx_c_prod_float(a, b) ((a)*(b))
3559     #define __Pyx_c_quot_float(a, b) ((a)/(b))
3560     #define __Pyx_c_neg_float(a)     (-(a))
3561   #ifdef __cplusplus
3562     #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
3563     #define __Pyx_c_conj_float(z)    (::std::conj(z))
3564     #if 1
3565         #define __Pyx_c_abs_float(z)     (::std::abs(z))
3566         #define __Pyx_c_pow_float(a, b)  (::std::pow(a, b))
3567     #endif
3568   #else
3569     #define __Pyx_c_is_zero_float(z) ((z)==0)
3570     #define __Pyx_c_conj_float(z)    (conjf(z))
3571     #if 1
3572         #define __Pyx_c_abs_float(z)     (cabsf(z))
3573         #define __Pyx_c_pow_float(a, b)  (cpowf(a, b))
3574     #endif
3575  #endif
3576 #else
3577     static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
3578     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
3579     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
3580     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
3581     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
3582     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
3583     static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
3584     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
3585     #if 1
3586         static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
3587         static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
3588     #endif
3589 #endif
3590 
3591 /* Arithmetic.proto */
3592 #if CYTHON_CCOMPLEX
3593     #define __Pyx_c_eq_double(a, b)   ((a)==(b))
3594     #define __Pyx_c_sum_double(a, b)  ((a)+(b))
3595     #define __Pyx_c_diff_double(a, b) ((a)-(b))
3596     #define __Pyx_c_prod_double(a, b) ((a)*(b))
3597     #define __Pyx_c_quot_double(a, b) ((a)/(b))
3598     #define __Pyx_c_neg_double(a)     (-(a))
3599   #ifdef __cplusplus
3600     #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
3601     #define __Pyx_c_conj_double(z)    (::std::conj(z))
3602     #if 1
3603         #define __Pyx_c_abs_double(z)     (::std::abs(z))
3604         #define __Pyx_c_pow_double(a, b)  (::std::pow(a, b))
3605     #endif
3606   #else
3607     #define __Pyx_c_is_zero_double(z) ((z)==0)
3608     #define __Pyx_c_conj_double(z)    (conj(z))
3609     #if 1
3610         #define __Pyx_c_abs_double(z)     (cabs(z))
3611         #define __Pyx_c_pow_double(a, b)  (cpow(a, b))
3612     #endif
3613  #endif
3614 #else
3615     static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
3616     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
3617     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
3618     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
3619     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
3620     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
3621     static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
3622     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
3623     #if 1
3624         static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
3625         static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
3626     #endif
3627 #endif
3628 
3629 /* CIntToPy.proto */
3630 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value);
3631 
3632 /* MemviewSliceCopyTemplate.proto */
3633 static __Pyx_memviewslice
3634 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
3635                                  const char *mode, int ndim,
3636                                  size_t sizeof_dtype, int contig_flag,
3637                                  int dtype_is_object);
3638 
3639 /* CIntFromPy.proto */
3640 static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *);
3641 
3642 /* CIntFromPy.proto */
3643 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
3644 
3645 /* CIntFromPy.proto */
3646 static CYTHON_INLINE npy_uint64 __Pyx_PyInt_As_npy_uint64(PyObject *);
3647 
3648 /* CIntFromPy.proto */
3649 static CYTHON_INLINE npy_uint32 __Pyx_PyInt_As_npy_uint32(PyObject *);
3650 
3651 /* CIntFromPy.proto */
3652 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
3653 
3654 /* CIntFromPy.proto */
3655 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
3656 
3657 /* FetchCommonType.proto */
3658 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
3659 
3660 /* PyObjectGetMethod.proto */
3661 static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
3662 
3663 /* PyObjectCallMethod1.proto */
3664 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
3665 
3666 /* CoroutineBase.proto */
3667 typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyThreadState *, PyObject *);
3668 #if CYTHON_USE_EXC_INFO_STACK
3669 #define __Pyx_ExcInfoStruct  _PyErr_StackItem
3670 #else
3671 typedef struct {
3672     PyObject *exc_type;
3673     PyObject *exc_value;
3674     PyObject *exc_traceback;
3675 } __Pyx_ExcInfoStruct;
3676 #endif
3677 typedef struct {
3678     PyObject_HEAD
3679     __pyx_coroutine_body_t body;
3680     PyObject *closure;
3681     __Pyx_ExcInfoStruct gi_exc_state;
3682     PyObject *gi_weakreflist;
3683     PyObject *classobj;
3684     PyObject *yieldfrom;
3685     PyObject *gi_name;
3686     PyObject *gi_qualname;
3687     PyObject *gi_modulename;
3688     PyObject *gi_code;
3689     int resume_label;
3690     char is_running;
3691 } __pyx_CoroutineObject;
3692 static __pyx_CoroutineObject *__Pyx__Coroutine_New(
3693     PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
3694     PyObject *name, PyObject *qualname, PyObject *module_name);
3695 static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
3696             __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
3697             PyObject *name, PyObject *qualname, PyObject *module_name);
3698 static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self);
3699 static int __Pyx_Coroutine_clear(PyObject *self);
3700 static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value);
3701 static PyObject *__Pyx_Coroutine_Close(PyObject *self);
3702 static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
3703 #if CYTHON_USE_EXC_INFO_STACK
3704 #define __Pyx_Coroutine_SwapException(self)
3705 #define __Pyx_Coroutine_ResetAndClearException(self)  __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state)
3706 #else
3707 #define __Pyx_Coroutine_SwapException(self) {\
3708     __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\
3709     __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\
3710     }
3711 #define __Pyx_Coroutine_ResetAndClearException(self) {\
3712     __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\
3713     (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\
3714     }
3715 #endif
3716 #if CYTHON_FAST_THREAD_STATE
3717 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
3718     __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue)
3719 #else
3720 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
3721     __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue)
3722 #endif
3723 static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue);
3724 static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state);
3725 
3726 /* PatchModuleWithCoroutine.proto */
3727 static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code);
3728 
3729 /* PatchGeneratorABC.proto */
3730 static int __Pyx_patch_abc(void);
3731 
3732 /* Generator.proto */
3733 #define __Pyx_Generator_USED
3734 static PyTypeObject *__pyx_GeneratorType = 0;
3735 #define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType)
3736 #define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\
3737     __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name)
3738 static PyObject *__Pyx_Generator_Next(PyObject *self);
3739 static int __pyx_Generator_init(void);
3740 
3741 /* TypeInfoCompare.proto */
3742 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
3743 
3744 /* MemviewSliceValidateAndInit.proto */
3745 static int __Pyx_ValidateAndInit_memviewslice(
3746                 int *axes_specs,
3747                 int c_or_f_flag,
3748                 int buf_flags,
3749                 int ndim,
3750                 __Pyx_TypeInfo *dtype,
3751                 __Pyx_BufFmt_StackElem stack[],
3752                 __Pyx_memviewslice *memviewslice,
3753                 PyObject *original_obj);
3754 
3755 /* ObjectToMemviewSlice.proto */
3756 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_int64_t(PyObject *, int writable_flag);
3757 
3758 /* CheckBinaryVersion.proto */
3759 static int __Pyx_check_binary_version(void);
3760 
3761 /* VoidPtrImport.proto */
3762 static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig);
3763 
3764 /* FunctionImport.proto */
3765 static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig);
3766 
3767 /* InitStrings.proto */
3768 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
3769 
3770 static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_oind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self); /* proto*/
3771 static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_rind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self); /* proto*/
3772 static CYTHON_INLINE __pyx_t_5numpy_uint8_t __pyx_f_2yt_8geometry_12oct_visitors_20BaseNeighbourVisitor_neighbour_rind(struct __pyx_obj_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor *__pyx_v_self); /* proto*/
3773 static CYTHON_INLINE struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *__pyx_v_self, int __pyx_v_i); /* proto*/
3774 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
3775 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
3776 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
3777 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
3778 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*/
3779 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
3780 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
3781 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
3782 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
3783 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
3784 
3785 /* Module declarations from 'cython.view' */
3786 
3787 /* Module declarations from 'cython' */
3788 
3789 /* Module declarations from 'cpython.buffer' */
3790 
3791 /* Module declarations from 'libc.string' */
3792 
3793 /* Module declarations from 'libc.stdio' */
3794 
3795 /* Module declarations from '__builtin__' */
3796 
3797 /* Module declarations from 'cpython.type' */
3798 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
3799 
3800 /* Module declarations from 'cpython' */
3801 
3802 /* Module declarations from 'cpython.object' */
3803 
3804 /* Module declarations from 'cpython.ref' */
3805 
3806 /* Module declarations from 'cpython.mem' */
3807 
3808 /* Module declarations from 'numpy' */
3809 
3810 /* Module declarations from 'numpy' */
3811 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
3812 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
3813 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
3814 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
3815 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
3816 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
3817 
3818 /* Module declarations from 'yt.geometry.oct_visitors' */
3819 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor = 0;
3820 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalOcts = 0;
3821 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalCells = 0;
3822 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_MarkOcts = 0;
3823 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_MaskOcts = 0;
3824 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_IndexOcts = 0;
3825 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_MaskedIndexOcts = 0;
3826 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_IndexMaskMapOcts = 0;
3827 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_ICoordsOcts = 0;
3828 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_IResOcts = 0;
3829 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_FCoordsOcts = 0;
3830 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_FWidthOcts = 0;
3831 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_CopyArrayI64 = 0;
3832 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_CopyArrayF64 = 0;
3833 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_CopyFileIndArrayI8 = 0;
3834 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_IdentifyOcts = 0;
3835 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_AssignDomainInd = 0;
3836 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_FillFileIndicesO = 0;
3837 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_FillFileIndicesR = 0;
3838 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_CountByDomain = 0;
3839 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_StoreOctree = 0;
3840 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_LoadOctree = 0;
3841 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_MortonIndexOcts = 0;
3842 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_StoreIndex = 0;
3843 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor = 0;
3844 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_NeighbourCellIndexVisitor = 0;
3845 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_NeighbourCellVisitor = 0;
3846 static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_cind(int, int, int); /*proto*/
3847 
3848 /* Module declarations from 'yt.geometry.grid_visitors' */
3849 static __pyx_t_5numpy_uint8_t (*__pyx_f_2yt_8geometry_13grid_visitors_check_child_masked)(struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *); /*proto*/
3850 
3851 /* Module declarations from 'yt.utilities.lib.fp_utils' */
3852 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*/
3853 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*/
3854 static CYTHON_INLINE PyObject *__pyx_f_2yt_9utilities_3lib_8fp_utils__ensure_code(PyObject *); /*proto*/
3855 
3856 /* Module declarations from 'libc.float' */
3857 
3858 /* Module declarations from 'libc.math' */
3859 
3860 /* Module declarations from 'yt.utilities.lib.geometry_utils' */
3861 static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_ifrexp(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_int64_t *); /*proto*/
3862 static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_msdb(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/
3863 static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_xor_msb(__pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t); /*proto*/
3864 static CYTHON_INLINE __pyx_t_5numpy_uint64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_spread_64bits_by2(__pyx_t_5numpy_uint64_t); /*proto*/
3865 static CYTHON_INLINE __pyx_t_5numpy_uint64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_compact_64bits_by2(__pyx_t_5numpy_uint64_t); /*proto*/
3866 static CYTHON_INLINE __pyx_t_5numpy_uint64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_encode_morton_64bit(__pyx_t_5numpy_uint64_t, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_uint64_t); /*proto*/
3867 static CYTHON_INLINE void __pyx_f_2yt_9utilities_3lib_14geometry_utils_decode_morton_64bit(__pyx_t_5numpy_uint64_t, __pyx_t_5numpy_uint64_t *); /*proto*/
3868 
3869 /* Module declarations from 'yt.geometry.selection_routines' */
3870 static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject = 0;
3871 static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector = 0;
3872 static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector = 0;
3873 static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector = 0;
3874 
3875 /* Module declarations from 'libc.stdlib' */
3876 
3877 /* Module declarations from 'yt.utilities.lib.allocation_container' */
3878 static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool = 0;
3879 
3880 /* Module declarations from 'yt.geometry.oct_container' */
3881 static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool = 0;
3882 static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer = 0;
3883 static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer = 0;
3884 static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer = 0;
3885 static int *__pyx_vp_2yt_8geometry_13oct_container_ORDER_MAX = 0;
3886 #define __pyx_v_2yt_8geometry_13oct_container_ORDER_MAX (*__pyx_vp_2yt_8geometry_13oct_container_ORDER_MAX)
3887 
3888 /* Module declarations from 'yt.utilities.cython_fortran_utils' */
3889 static PyTypeObject *__pyx_ptype_2yt_9utilities_20cython_fortran_utils_FortranFile = 0;
3890 
3891 /* Module declarations from 'yt.frontends.ramses.io_utils' */
3892 static PyTypeObject *__pyx_ptype_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct__read_amr = 0;
3893 static PyTypeObject *__pyx_ptype_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct_1_genexpr = 0;
3894 static PyTypeObject *__pyx_array_type = 0;
3895 static PyTypeObject *__pyx_MemviewEnum_type = 0;
3896 static PyTypeObject *__pyx_memoryview_type = 0;
3897 static PyTypeObject *__pyx_memoryviewslice_type = 0;
3898 static PyObject *generic = 0;
3899 static PyObject *strided = 0;
3900 static PyObject *indirect = 0;
3901 static PyObject *contiguous = 0;
3902 static PyObject *indirect_contiguous = 0;
3903 static int __pyx_memoryview_thread_locks_used;
3904 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
3905 static PyObject *__pyx_f_2yt_9frontends_6ramses_8io_utils_read_offset(struct __pyx_obj_2yt_9utilities_20cython_fortran_utils_FortranFile *, __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t, __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t, __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t, PyObject *, int __pyx_skip_dispatch); /*proto*/
3906 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
3907 static void *__pyx_align_pointer(void *, size_t); /*proto*/
3908 static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
3909 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
3910 static PyObject *_unellipsify(PyObject *, int); /*proto*/
3911 static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
3912 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
3913 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*/
3914 static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
3915 static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
3916 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
3917 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
3918 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
3919 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
3920 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
3921 static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
3922 static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
3923 static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
3924 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
3925 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
3926 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
3927 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
3928 static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
3929 static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
3930 static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
3931 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
3932 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
3933 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
3934 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
3935 static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
3936 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
3937 static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
3938 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
3939 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t = { "int64_t", NULL, sizeof(__pyx_t_5numpy_int64_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int64_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int64_t), 0 };
3940 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t = { "int32_t", NULL, sizeof(__pyx_t_5numpy_int32_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int32_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int32_t), 0 };
3941 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 };
3942 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t = { "uint8_t", NULL, sizeof(__pyx_t_5numpy_uint8_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_uint8_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_uint8_t), 0 };
3943 #define __Pyx_MODULE_NAME "yt.frontends.ramses.io_utils"
3944 extern int __pyx_module_is_main_yt__frontends__ramses__io_utils;
3945 int __pyx_module_is_main_yt__frontends__ramses__io_utils = 0;
3946 
3947 /* Implementation of 'yt.frontends.ramses.io_utils' */
3948 static PyObject *__pyx_builtin_range;
3949 static PyObject *__pyx_builtin_ValueError;
3950 static PyObject *__pyx_builtin_RuntimeError;
3951 static PyObject *__pyx_builtin_ImportError;
3952 static PyObject *__pyx_builtin_MemoryError;
3953 static PyObject *__pyx_builtin_enumerate;
3954 static PyObject *__pyx_builtin_TypeError;
3955 static PyObject *__pyx_builtin_Ellipsis;
3956 static PyObject *__pyx_builtin_id;
3957 static PyObject *__pyx_builtin_IndexError;
3958 static const char __pyx_k_F[] = "F";
3959 static const char __pyx_k_O[] = "O";
3960 static const char __pyx_k_c[] = "c";
3961 static const char __pyx_k_d[] = "d";
3962 static const char __pyx_k_f[] = "f";
3963 static const char __pyx_k_i[] = "i";
3964 static const char __pyx_k_n[] = "n";
3965 static const char __pyx_k_id[] = "id";
3966 static const char __pyx_k_nc[] = "nc";
3967 static const char __pyx_k_ng[] = "ng";
3968 static const char __pyx_k_np[] = "np";
3969 static const char __pyx_k_nx[] = "nx";
3970 static const char __pyx_k_ny[] = "ny";
3971 static const char __pyx_k_nz[] = "nz";
3972 static const char __pyx_k_tr[] = "tr";
3973 static const char __pyx_k_add[] = "add";
3974 static const char __pyx_k_new[] = "__new__";
3975 static const char __pyx_k_obj[] = "obj";
3976 static const char __pyx_k_pos[] = "pos";
3977 static const char __pyx_k_tmp[] = "tmp";
3978 static const char __pyx_k_args[] = "args";
3979 static const char __pyx_k_base[] = "base";
3980 static const char __pyx_k_dict[] = "__dict__";
3981 static const char __pyx_k_full[] = "full";
3982 static const char __pyx_k_icpu[] = "icpu";
3983 static const char __pyx_k_main[] = "__main__";
3984 static const char __pyx_k_mask[] = "mask";
3985 static const char __pyx_k_mode[] = "mode";
3986 static const char __pyx_k_name[] = "name";
3987 static const char __pyx_k_ncpu[] = "ncpu";
3988 static const char __pyx_k_ndim[] = "ndim";
3989 static const char __pyx_k_nvar[] = "nvar";
3990 static const char __pyx_k_pack[] = "pack";
3991 static const char __pyx_k_send[] = "send";
3992 static const char __pyx_k_size[] = "size";
3993 static const char __pyx_k_step[] = "step";
3994 static const char __pyx_k_stop[] = "stop";
3995 static const char __pyx_k_test[] = "__test__";
3996 static const char __pyx_k_ASCII[] = "ASCII";
3997 static const char __pyx_k_array[] = "array";
3998 static const char __pyx_k_class[] = "__class__";
3999 static const char __pyx_k_close[] = "close";
4000 static const char __pyx_k_dtype[] = "dtype";
4001 static const char __pyx_k_empty[] = "empty";
4002 static const char __pyx_k_error[] = "error";
4003 static const char __pyx_k_field[] = "field";
4004 static const char __pyx_k_flags[] = "flags";
4005 static const char __pyx_k_int32[] = "int32";
4006 static const char __pyx_k_int64[] = "int64";
4007 static const char __pyx_k_numbl[] = "numbl";
4008 static const char __pyx_k_numpy[] = "numpy";
4009 static const char __pyx_k_order[] = "order";
4010 static const char __pyx_k_range[] = "range";
4011 static const char __pyx_k_shape[] = "shape";
4012 static const char __pyx_k_start[] = "start";
4013 static const char __pyx_k_throw[] = "throw";
4014 static const char __pyx_k_uint8[] = "uint8";
4015 static const char __pyx_k_units[] = "units";
4016 static const char __pyx_k_zeros[] = "zeros";
4017 static const char __pyx_k_domain[] = "domain";
4018 static const char __pyx_k_encode[] = "encode";
4019 static const char __pyx_k_fields[] = "fields";
4020 static const char __pyx_k_format[] = "format";
4021 static const char __pyx_k_ifield[] = "ifield";
4022 static const char __pyx_k_ilevel[] = "ilevel";
4023 static const char __pyx_k_import[] = "__import__";
4024 static const char __pyx_k_levels[] = "levels";
4025 static const char __pyx_k_name_2[] = "__name__";
4026 static const char __pyx_k_offset[] = "offset";
4027 static const char __pyx_k_pickle[] = "pickle";
4028 static const char __pyx_k_reduce[] = "__reduce__";
4029 static const char __pyx_k_struct[] = "struct";
4030 static const char __pyx_k_unpack[] = "unpack";
4031 static const char __pyx_k_update[] = "update";
4032 static const char __pyx_k_domains[] = "domains";
4033 static const char __pyx_k_float64[] = "float64";
4034 static const char __pyx_k_fortran[] = "fortran";
4035 static const char __pyx_k_genexpr[] = "genexpr";
4036 static const char __pyx_k_headers[] = "headers";
4037 static const char __pyx_k_memview[] = "memview";
4038 static const char __pyx_k_nfields[] = "nfields";
4039 static const char __pyx_k_nlevels[] = "nlevels";
4040 static const char __pyx_k_offsets[] = "offsets";
4041 static const char __pyx_k_Ellipsis[] = "Ellipsis";
4042 static const char __pyx_k_getstate[] = "__getstate__";
4043 static const char __pyx_k_itemsize[] = "itemsize";
4044 static const char __pyx_k_pyx_type[] = "__pyx_type";
4045 static const char __pyx_k_read_amr[] = "read_amr";
4046 static const char __pyx_k_setstate[] = "__setstate__";
4047 static const char __pyx_k_skip_len[] = "skip_len";
4048 static const char __pyx_k_TypeError[] = "TypeError";
4049 static const char __pyx_k_cell_inds[] = "cell_inds";
4050 static const char __pyx_k_domain_id[] = "domain_id";
4051 static const char __pyx_k_enumerate[] = "enumerate";
4052 static const char __pyx_k_file_inds[] = "file_inds";
4053 static const char __pyx_k_max_level[] = "max_level";
4054 static const char __pyx_k_min_level[] = "min_level";
4055 static const char __pyx_k_nboundary[] = "nboundary";
4056 static const char __pyx_k_nlevelmax[] = "nlevelmax";
4057 static const char __pyx_k_pyx_state[] = "__pyx_state";
4058 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
4059 static const char __pyx_k_twotondim[] = "twotondim";
4060 static const char __pyx_k_IndexError[] = "IndexError";
4061 static const char __pyx_k_ValueError[] = "ValueError";
4062 static const char __pyx_k_all_fields[] = "all_fields";
4063 static const char __pyx_k_fill_hydro[] = "fill_hydro";
4064 static const char __pyx_k_fill_level[] = "fill_level";
4065 static const char __pyx_k_ngridbound[] = "ngridbound";
4066 static const char __pyx_k_pyx_result[] = "__pyx_result";
4067 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
4068 static const char __pyx_k_ImportError[] = "ImportError";
4069 static const char __pyx_k_MemoryError[] = "MemoryError";
4070 static const char __pyx_k_PickleError[] = "PickleError";
4071 static const char __pyx_k_buffer_size[] = "buffer_size";
4072 static const char __pyx_k_code_length[] = "code_length";
4073 static const char __pyx_k_level_count[] = "level_count";
4074 static const char __pyx_k_oct_handler[] = "oct_handler";
4075 static const char __pyx_k_RuntimeError[] = "RuntimeError";
4076 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
4077 static const char __pyx_k_stringsource[] = "stringsource";
4078 static const char __pyx_k_ncpu_selected[] = "ncpu_selected";
4079 static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
4080 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
4081 static const char __pyx_k_count_boundary[] = "count_boundary";
4082 static const char __pyx_k_cpu_enumerator[] = "cpu_enumerator";
4083 static const char __pyx_k_ncpu_and_bound[] = "ncpu_and_bound";
4084 static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
4085 static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
4086 static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
4087 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
4088 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
4089 static const char __pyx_k_convert_to_units[] = "convert_to_units";
4090 static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
4091 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
4092 static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
4093 static const char __pyx_k_YTIllDefinedAMRData[] = "YTIllDefinedAMRData";
4094 static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
4095 static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
4096 static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
4097 static const char __pyx_k_fill_level_with_domain[] = "fill_level_with_domain";
4098 static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
4099 static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
4100 static const char __pyx_k_read_amr_locals_genexpr[] = "read_amr.<locals>.genexpr";
4101 static const char __pyx_k_yt_utilities_exceptions[] = "yt.utilities.exceptions";
4102 static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
4103 static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
4104 static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
4105 static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
4106 static const char __pyx_k_yt_frontends_ramses_io_utils[] = "yt.frontends.ramses.io_utils";
4107 static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
4108 static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
4109 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
4110 static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
4111 static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
4112 static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
4113 static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
4114 static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
4115 static const char __pyx_k_Cannot_read_offsets_in_file_s_Th[] = "Cannot read offsets in file %s. The level read from data (%s) is not coherent with the expected (%s)";
4116 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
4117 static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
4118 static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] = "Incompatible checksums (%s vs 0xb068931 = (name))";
4119 static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
4120 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
4121 static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
4122 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
4123 static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
4124 static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
4125 static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
4126 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
4127 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
4128 static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
4129 static const char __pyx_k_yt_frontends_ramses_io_utils_pyx[] = "yt/frontends/ramses/io_utils.pyx";
4130 static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
4131 static PyObject *__pyx_n_s_ASCII;
4132 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
4133 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
4134 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
4135 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
4136 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
4137 static PyObject *__pyx_kp_s_Cannot_read_offsets_in_file_s_Th;
4138 static PyObject *__pyx_n_s_Ellipsis;
4139 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
4140 static PyObject *__pyx_n_s_F;
4141 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
4142 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
4143 static PyObject *__pyx_n_s_ImportError;
4144 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0;
4145 static PyObject *__pyx_n_s_IndexError;
4146 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
4147 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
4148 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
4149 static PyObject *__pyx_n_s_MemoryError;
4150 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
4151 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
4152 static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
4153 static PyObject *__pyx_n_b_O;
4154 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
4155 static PyObject *__pyx_n_s_PickleError;
4156 static PyObject *__pyx_n_s_RuntimeError;
4157 static PyObject *__pyx_n_s_TypeError;
4158 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
4159 static PyObject *__pyx_n_s_ValueError;
4160 static PyObject *__pyx_n_s_View_MemoryView;
4161 static PyObject *__pyx_n_s_YTIllDefinedAMRData;
4162 static PyObject *__pyx_n_s_add;
4163 static PyObject *__pyx_n_s_all_fields;
4164 static PyObject *__pyx_n_s_allocate_buffer;
4165 static PyObject *__pyx_n_s_args;
4166 static PyObject *__pyx_n_s_array;
4167 static PyObject *__pyx_n_s_base;
4168 static PyObject *__pyx_n_s_buffer_size;
4169 static PyObject *__pyx_n_s_c;
4170 static PyObject *__pyx_n_u_c;
4171 static PyObject *__pyx_n_s_cell_inds;
4172 static PyObject *__pyx_n_s_class;
4173 static PyObject *__pyx_n_s_cline_in_traceback;
4174 static PyObject *__pyx_n_s_close;
4175 static PyObject *__pyx_n_s_code_length;
4176 static PyObject *__pyx_kp_s_contiguous_and_direct;
4177 static PyObject *__pyx_kp_s_contiguous_and_indirect;
4178 static PyObject *__pyx_n_s_convert_to_units;
4179 static PyObject *__pyx_n_s_count_boundary;
4180 static PyObject *__pyx_n_s_cpu_enumerator;
4181 static PyObject *__pyx_n_s_d;
4182 static PyObject *__pyx_n_s_dict;
4183 static PyObject *__pyx_n_s_domain;
4184 static PyObject *__pyx_n_s_domain_id;
4185 static PyObject *__pyx_n_s_domains;
4186 static PyObject *__pyx_n_s_dtype;
4187 static PyObject *__pyx_n_s_dtype_is_object;
4188 static PyObject *__pyx_n_s_empty;
4189 static PyObject *__pyx_n_s_encode;
4190 static PyObject *__pyx_n_s_enumerate;
4191 static PyObject *__pyx_n_s_error;
4192 static PyObject *__pyx_n_s_f;
4193 static PyObject *__pyx_n_s_field;
4194 static PyObject *__pyx_n_s_fields;
4195 static PyObject *__pyx_n_s_file_inds;
4196 static PyObject *__pyx_n_s_fill_hydro;
4197 static PyObject *__pyx_n_s_fill_level;
4198 static PyObject *__pyx_n_s_fill_level_with_domain;
4199 static PyObject *__pyx_n_s_flags;
4200 static PyObject *__pyx_n_s_float64;
4201 static PyObject *__pyx_n_s_format;
4202 static PyObject *__pyx_n_s_fortran;
4203 static PyObject *__pyx_n_u_fortran;
4204 static PyObject *__pyx_n_s_full;
4205 static PyObject *__pyx_n_s_genexpr;
4206 static PyObject *__pyx_n_s_getstate;
4207 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
4208 static PyObject *__pyx_n_s_headers;
4209 static PyObject *__pyx_n_s_i;
4210 static PyObject *__pyx_n_s_icpu;
4211 static PyObject *__pyx_n_s_id;
4212 static PyObject *__pyx_n_s_ifield;
4213 static PyObject *__pyx_n_s_ilevel;
4214 static PyObject *__pyx_n_s_import;
4215 static PyObject *__pyx_n_s_int32;
4216 static PyObject *__pyx_n_s_int64;
4217 static PyObject *__pyx_n_s_itemsize;
4218 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
4219 static PyObject *__pyx_n_s_level_count;
4220 static PyObject *__pyx_n_s_levels;
4221 static PyObject *__pyx_n_s_main;
4222 static PyObject *__pyx_n_s_mask;
4223 static PyObject *__pyx_n_s_max_level;
4224 static PyObject *__pyx_n_s_memview;
4225 static PyObject *__pyx_n_s_min_level;
4226 static PyObject *__pyx_n_s_mode;
4227 static PyObject *__pyx_n_s_n;
4228 static PyObject *__pyx_n_s_name;
4229 static PyObject *__pyx_n_s_name_2;
4230 static PyObject *__pyx_n_s_nboundary;
4231 static PyObject *__pyx_n_s_nc;
4232 static PyObject *__pyx_n_s_ncpu;
4233 static PyObject *__pyx_n_s_ncpu_and_bound;
4234 static PyObject *__pyx_n_s_ncpu_selected;
4235 static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
4236 static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
4237 static PyObject *__pyx_n_s_ndim;
4238 static PyObject *__pyx_n_s_new;
4239 static PyObject *__pyx_n_s_nfields;
4240 static PyObject *__pyx_n_s_ng;
4241 static PyObject *__pyx_n_s_ngridbound;
4242 static PyObject *__pyx_n_s_nlevelmax;
4243 static PyObject *__pyx_n_s_nlevels;
4244 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
4245 static PyObject *__pyx_n_s_np;
4246 static PyObject *__pyx_n_s_numbl;
4247 static PyObject *__pyx_n_s_numpy;
4248 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
4249 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
4250 static PyObject *__pyx_n_s_nvar;
4251 static PyObject *__pyx_n_s_nx;
4252 static PyObject *__pyx_n_s_ny;
4253 static PyObject *__pyx_n_s_nz;
4254 static PyObject *__pyx_n_s_obj;
4255 static PyObject *__pyx_n_s_oct_handler;
4256 static PyObject *__pyx_n_s_offset;
4257 static PyObject *__pyx_n_s_offsets;
4258 static PyObject *__pyx_n_s_order;
4259 static PyObject *__pyx_n_s_pack;
4260 static PyObject *__pyx_n_s_pickle;
4261 static PyObject *__pyx_n_s_pos;
4262 static PyObject *__pyx_n_s_pyx_PickleError;
4263 static PyObject *__pyx_n_s_pyx_checksum;
4264 static PyObject *__pyx_n_s_pyx_getbuffer;
4265 static PyObject *__pyx_n_s_pyx_result;
4266 static PyObject *__pyx_n_s_pyx_state;
4267 static PyObject *__pyx_n_s_pyx_type;
4268 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
4269 static PyObject *__pyx_n_s_pyx_vtable;
4270 static PyObject *__pyx_n_s_range;
4271 static PyObject *__pyx_n_s_read_amr;
4272 static PyObject *__pyx_n_s_read_amr_locals_genexpr;
4273 static PyObject *__pyx_n_s_reduce;
4274 static PyObject *__pyx_n_s_reduce_cython;
4275 static PyObject *__pyx_n_s_reduce_ex;
4276 static PyObject *__pyx_n_s_send;
4277 static PyObject *__pyx_n_s_setstate;
4278 static PyObject *__pyx_n_s_setstate_cython;
4279 static PyObject *__pyx_n_s_shape;
4280 static PyObject *__pyx_n_s_size;
4281 static PyObject *__pyx_n_s_skip_len;
4282 static PyObject *__pyx_n_s_start;
4283 static PyObject *__pyx_n_s_step;
4284 static PyObject *__pyx_n_s_stop;
4285 static PyObject *__pyx_kp_s_strided_and_direct;
4286 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
4287 static PyObject *__pyx_kp_s_strided_and_indirect;
4288 static PyObject *__pyx_kp_s_stringsource;
4289 static PyObject *__pyx_n_s_struct;
4290 static PyObject *__pyx_n_s_test;
4291 static PyObject *__pyx_n_s_throw;
4292 static PyObject *__pyx_n_s_tmp;
4293 static PyObject *__pyx_n_s_tr;
4294 static PyObject *__pyx_n_s_twotondim;
4295 static PyObject *__pyx_n_s_uint8;
4296 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
4297 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
4298 static PyObject *__pyx_n_s_units;
4299 static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
4300 static PyObject *__pyx_n_s_unpack;
4301 static PyObject *__pyx_n_s_update;
4302 static PyObject *__pyx_n_s_yt_frontends_ramses_io_utils;
4303 static PyObject *__pyx_kp_s_yt_frontends_ramses_io_utils_pyx;
4304 static PyObject *__pyx_n_s_yt_utilities_exceptions;
4305 static PyObject *__pyx_n_s_zeros;
4306 static PyObject *__pyx_pf_2yt_9frontends_6ramses_8io_utils_8read_amr_genexpr(PyObject *__pyx_self); /* proto */
4307 static PyObject *__pyx_pf_2yt_9frontends_6ramses_8io_utils_read_amr(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_2yt_9utilities_20cython_fortran_utils_FortranFile *__pyx_v_f, PyObject *__pyx_v_headers, PyArrayObject *__pyx_v_ngridbound, __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_v_min_level, struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer *__pyx_v_oct_handler); /* proto */
4308 static PyObject *__pyx_pf_2yt_9frontends_6ramses_8io_utils_2read_offset(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_2yt_9utilities_20cython_fortran_utils_FortranFile *__pyx_v_f, __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_v_min_level, __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_v_domain_id, __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_v_nvar, PyObject *__pyx_v_headers); /* proto */
4309 static PyObject *__pyx_pf_2yt_9frontends_6ramses_8io_utils_4fill_hydro(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_2yt_9utilities_20cython_fortran_utils_FortranFile *__pyx_v_f, PyArrayObject *__pyx_v_offsets, PyArrayObject *__pyx_v_level_count, PyObject *__pyx_v_cpu_enumerator, PyArrayObject *__pyx_v_levels, PyArrayObject *__pyx_v_cell_inds, PyArrayObject *__pyx_v_file_inds, __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_v_ndim, PyObject *__pyx_v_all_fields, PyObject *__pyx_v_fields, PyObject *__pyx_v_tr, struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer *__pyx_v_oct_handler, PyArrayObject *__pyx_v_domains); /* proto */
4310 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
4311 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
4312 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 */
4313 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 */
4314 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
4315 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
4316 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
4317 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
4318 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
4319 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 */
4320 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
4321 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 */
4322 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
4323 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
4324 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
4325 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
4326 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 */
4327 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4328 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
4329 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 */
4330 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 */
4331 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4332 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4333 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4334 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4335 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4336 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4337 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4338 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4339 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4340 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4341 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4342 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4343 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4344 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4345 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4346 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4347 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4348 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 */
4349 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
4350 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
4351 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
4352 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 */
4353 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 */
4354 static PyObject *__pyx_tp_new_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct__read_amr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4355 static PyObject *__pyx_tp_new_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct_1_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4356 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4357 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4358 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4359 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4360 static PyObject *__pyx_float_1_0;
4361 static PyObject *__pyx_float_2_0;
4362 static PyObject *__pyx_int_0;
4363 static PyObject *__pyx_int_1;
4364 static PyObject *__pyx_int_2;
4365 static PyObject *__pyx_int_3;
4366 static PyObject *__pyx_int_184977713;
4367 static PyObject *__pyx_int_neg_1;
4368 static PyArrayObject *__pyx_k__4;
4369 static PyObject *__pyx_tuple_;
4370 static PyObject *__pyx_slice__3;
4371 static PyObject *__pyx_tuple__2;
4372 static PyObject *__pyx_tuple__5;
4373 static PyObject *__pyx_tuple__6;
4374 static PyObject *__pyx_tuple__7;
4375 static PyObject *__pyx_tuple__8;
4376 static PyObject *__pyx_tuple__9;
4377 static PyObject *__pyx_tuple__10;
4378 static PyObject *__pyx_tuple__11;
4379 static PyObject *__pyx_tuple__12;
4380 static PyObject *__pyx_tuple__13;
4381 static PyObject *__pyx_tuple__14;
4382 static PyObject *__pyx_tuple__15;
4383 static PyObject *__pyx_tuple__16;
4384 static PyObject *__pyx_tuple__17;
4385 static PyObject *__pyx_tuple__18;
4386 static PyObject *__pyx_tuple__19;
4387 static PyObject *__pyx_tuple__20;
4388 static PyObject *__pyx_tuple__21;
4389 static PyObject *__pyx_tuple__22;
4390 static PyObject *__pyx_tuple__23;
4391 static PyObject *__pyx_tuple__24;
4392 static PyObject *__pyx_tuple__25;
4393 static PyObject *__pyx_tuple__26;
4394 static PyObject *__pyx_tuple__27;
4395 static PyObject *__pyx_tuple__28;
4396 static PyObject *__pyx_tuple__29;
4397 static PyObject *__pyx_tuple__31;
4398 static PyObject *__pyx_tuple__33;
4399 static PyObject *__pyx_tuple__34;
4400 static PyObject *__pyx_tuple__35;
4401 static PyObject *__pyx_tuple__36;
4402 static PyObject *__pyx_tuple__37;
4403 static PyObject *__pyx_tuple__38;
4404 static PyObject *__pyx_codeobj__30;
4405 static PyObject *__pyx_codeobj__32;
4406 static PyObject *__pyx_codeobj__39;
4407 /* Late includes */
4408 
4409 /* "yt/frontends/ramses/io_utils.pyx":21
4410  * @cython.cdivision(True)
4411  * @cython.nonecheck(False)
4412  * def read_amr(FortranFile f, dict headers,             # <<<<<<<<<<<<<<
4413  *              np.ndarray[np.int64_t, ndim=1] ngridbound, INT64_t min_level,
4414  *              RAMSESOctreeContainer oct_handler):
4415  */
4416 
4417 /* Python wrapper */
4418 static PyObject *__pyx_pw_2yt_9frontends_6ramses_8io_utils_1read_amr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4419 static PyMethodDef __pyx_mdef_2yt_9frontends_6ramses_8io_utils_1read_amr = {"read_amr", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2yt_9frontends_6ramses_8io_utils_1read_amr, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_2yt_9frontends_6ramses_8io_utils_1read_amr(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)4420 static PyObject *__pyx_pw_2yt_9frontends_6ramses_8io_utils_1read_amr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4421   struct __pyx_obj_2yt_9utilities_20cython_fortran_utils_FortranFile *__pyx_v_f = 0;
4422   PyObject *__pyx_v_headers = 0;
4423   PyArrayObject *__pyx_v_ngridbound = 0;
4424   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_v_min_level;
4425   struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer *__pyx_v_oct_handler = 0;
4426   PyObject *__pyx_r = 0;
4427   __Pyx_RefNannyDeclarations
4428   __Pyx_RefNannySetupContext("read_amr (wrapper)", 0);
4429   {
4430     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_f,&__pyx_n_s_headers,&__pyx_n_s_ngridbound,&__pyx_n_s_min_level,&__pyx_n_s_oct_handler,0};
4431     PyObject* values[5] = {0,0,0,0,0};
4432     if (unlikely(__pyx_kwds)) {
4433       Py_ssize_t kw_args;
4434       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4435       switch (pos_args) {
4436         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4437         CYTHON_FALLTHROUGH;
4438         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4439         CYTHON_FALLTHROUGH;
4440         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4441         CYTHON_FALLTHROUGH;
4442         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4443         CYTHON_FALLTHROUGH;
4444         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4445         CYTHON_FALLTHROUGH;
4446         case  0: break;
4447         default: goto __pyx_L5_argtuple_error;
4448       }
4449       kw_args = PyDict_Size(__pyx_kwds);
4450       switch (pos_args) {
4451         case  0:
4452         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--;
4453         else goto __pyx_L5_argtuple_error;
4454         CYTHON_FALLTHROUGH;
4455         case  1:
4456         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_headers)) != 0)) kw_args--;
4457         else {
4458           __Pyx_RaiseArgtupleInvalid("read_amr", 1, 5, 5, 1); __PYX_ERR(0, 21, __pyx_L3_error)
4459         }
4460         CYTHON_FALLTHROUGH;
4461         case  2:
4462         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ngridbound)) != 0)) kw_args--;
4463         else {
4464           __Pyx_RaiseArgtupleInvalid("read_amr", 1, 5, 5, 2); __PYX_ERR(0, 21, __pyx_L3_error)
4465         }
4466         CYTHON_FALLTHROUGH;
4467         case  3:
4468         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_min_level)) != 0)) kw_args--;
4469         else {
4470           __Pyx_RaiseArgtupleInvalid("read_amr", 1, 5, 5, 3); __PYX_ERR(0, 21, __pyx_L3_error)
4471         }
4472         CYTHON_FALLTHROUGH;
4473         case  4:
4474         if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_oct_handler)) != 0)) kw_args--;
4475         else {
4476           __Pyx_RaiseArgtupleInvalid("read_amr", 1, 5, 5, 4); __PYX_ERR(0, 21, __pyx_L3_error)
4477         }
4478       }
4479       if (unlikely(kw_args > 0)) {
4480         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_amr") < 0)) __PYX_ERR(0, 21, __pyx_L3_error)
4481       }
4482     } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
4483       goto __pyx_L5_argtuple_error;
4484     } else {
4485       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4486       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4487       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4488       values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4489       values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4490     }
4491     __pyx_v_f = ((struct __pyx_obj_2yt_9utilities_20cython_fortran_utils_FortranFile *)values[0]);
4492     __pyx_v_headers = ((PyObject*)values[1]);
4493     __pyx_v_ngridbound = ((PyArrayObject *)values[2]);
4494     __pyx_v_min_level = __Pyx_PyInt_As_npy_int64(values[3]); if (unlikely((__pyx_v_min_level == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 22, __pyx_L3_error)
4495     __pyx_v_oct_handler = ((struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer *)values[4]);
4496   }
4497   goto __pyx_L4_argument_unpacking_done;
4498   __pyx_L5_argtuple_error:;
4499   __Pyx_RaiseArgtupleInvalid("read_amr", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 21, __pyx_L3_error)
4500   __pyx_L3_error:;
4501   __Pyx_AddTraceback("yt.frontends.ramses.io_utils.read_amr", __pyx_clineno, __pyx_lineno, __pyx_filename);
4502   __Pyx_RefNannyFinishContext();
4503   return NULL;
4504   __pyx_L4_argument_unpacking_done:;
4505   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_2yt_9utilities_20cython_fortran_utils_FortranFile, 1, "f", 0))) __PYX_ERR(0, 21, __pyx_L1_error)
4506   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_headers), (&PyDict_Type), 1, "headers", 1))) __PYX_ERR(0, 21, __pyx_L1_error)
4507   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ngridbound), __pyx_ptype_5numpy_ndarray, 1, "ngridbound", 0))) __PYX_ERR(0, 22, __pyx_L1_error)
4508   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_oct_handler), __pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer, 1, "oct_handler", 0))) __PYX_ERR(0, 23, __pyx_L1_error)
4509   __pyx_r = __pyx_pf_2yt_9frontends_6ramses_8io_utils_read_amr(__pyx_self, __pyx_v_f, __pyx_v_headers, __pyx_v_ngridbound, __pyx_v_min_level, __pyx_v_oct_handler);
4510 
4511   /* function exit code */
4512   goto __pyx_L0;
4513   __pyx_L1_error:;
4514   __pyx_r = NULL;
4515   __pyx_L0:;
4516   __Pyx_RefNannyFinishContext();
4517   return __pyx_r;
4518 }
4519 static PyObject *__pyx_gb_2yt_9frontends_6ramses_8io_utils_8read_amr_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
4520 
4521 /* "yt/frontends/ramses/io_utils.pyx":35
4522  *     numbl = headers['numbl']
4523  *     nboundary = headers['nboundary']
4524  *     nx, ny, nz = (((i-1.0)/2.0) for i in headers['nx'])             # <<<<<<<<<<<<<<
4525  *     nlevelmax = headers['nlevelmax']
4526  *     ncpu = headers['ncpu']
4527  */
4528 
__pyx_pf_2yt_9frontends_6ramses_8io_utils_8read_amr_genexpr(PyObject * __pyx_self)4529 static PyObject *__pyx_pf_2yt_9frontends_6ramses_8io_utils_8read_amr_genexpr(PyObject *__pyx_self) {
4530   struct __pyx_obj_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct_1_genexpr *__pyx_cur_scope;
4531   PyObject *__pyx_r = NULL;
4532   __Pyx_RefNannyDeclarations
4533   __Pyx_RefNannySetupContext("genexpr", 0);
4534   __pyx_cur_scope = (struct __pyx_obj_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct_1_genexpr *)__pyx_tp_new_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct_1_genexpr(__pyx_ptype_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct_1_genexpr, __pyx_empty_tuple, NULL);
4535   if (unlikely(!__pyx_cur_scope)) {
4536     __pyx_cur_scope = ((struct __pyx_obj_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct_1_genexpr *)Py_None);
4537     __Pyx_INCREF(Py_None);
4538     __PYX_ERR(0, 35, __pyx_L1_error)
4539   } else {
4540     __Pyx_GOTREF(__pyx_cur_scope);
4541   }
4542   __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct__read_amr *) __pyx_self;
4543   __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
4544   __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
4545   {
4546     __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_2yt_9frontends_6ramses_8io_utils_8read_amr_2generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_read_amr_locals_genexpr, __pyx_n_s_yt_frontends_ramses_io_utils); if (unlikely(!gen)) __PYX_ERR(0, 35, __pyx_L1_error)
4547     __Pyx_DECREF(__pyx_cur_scope);
4548     __Pyx_RefNannyFinishContext();
4549     return (PyObject *) gen;
4550   }
4551 
4552   /* function exit code */
4553   __pyx_L1_error:;
4554   __Pyx_AddTraceback("yt.frontends.ramses.io_utils.read_amr.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
4555   __pyx_r = NULL;
4556   __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
4557   __Pyx_XGIVEREF(__pyx_r);
4558   __Pyx_RefNannyFinishContext();
4559   return __pyx_r;
4560 }
4561 
__pyx_gb_2yt_9frontends_6ramses_8io_utils_8read_amr_2generator(__pyx_CoroutineObject * __pyx_generator,CYTHON_UNUSED PyThreadState * __pyx_tstate,PyObject * __pyx_sent_value)4562 static PyObject *__pyx_gb_2yt_9frontends_6ramses_8io_utils_8read_amr_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
4563 {
4564   struct __pyx_obj_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct_1_genexpr *)__pyx_generator->closure);
4565   PyObject *__pyx_r = NULL;
4566   PyObject *__pyx_t_1 = NULL;
4567   PyObject *__pyx_t_2 = NULL;
4568   Py_ssize_t __pyx_t_3;
4569   PyObject *(*__pyx_t_4)(PyObject *);
4570   PyObject *__pyx_t_5 = NULL;
4571   __Pyx_RefNannyDeclarations
4572   __Pyx_RefNannySetupContext("genexpr", 0);
4573   switch (__pyx_generator->resume_label) {
4574     case 0: goto __pyx_L3_first_run;
4575     case 1: goto __pyx_L6_resume_from_yield;
4576     default: /* CPython raises the right error here */
4577     __Pyx_RefNannyFinishContext();
4578     return NULL;
4579   }
4580   __pyx_L3_first_run:;
4581   if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 35, __pyx_L1_error)
4582   if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_headers)) { __Pyx_RaiseClosureNameError("headers"); __PYX_ERR(0, 35, __pyx_L1_error) }
4583   if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_headers == Py_None)) {
4584     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
4585     __PYX_ERR(0, 35, __pyx_L1_error)
4586   }
4587   __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_headers, __pyx_n_s_nx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
4588   __Pyx_GOTREF(__pyx_t_1);
4589   if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
4590     __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
4591     __pyx_t_4 = NULL;
4592   } else {
4593     __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error)
4594     __Pyx_GOTREF(__pyx_t_2);
4595     __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 35, __pyx_L1_error)
4596   }
4597   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4598   for (;;) {
4599     if (likely(!__pyx_t_4)) {
4600       if (likely(PyList_CheckExact(__pyx_t_2))) {
4601         if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
4602         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4603         __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 35, __pyx_L1_error)
4604         #else
4605         __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
4606         __Pyx_GOTREF(__pyx_t_1);
4607         #endif
4608       } else {
4609         if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
4610         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4611         __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 35, __pyx_L1_error)
4612         #else
4613         __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
4614         __Pyx_GOTREF(__pyx_t_1);
4615         #endif
4616       }
4617     } else {
4618       __pyx_t_1 = __pyx_t_4(__pyx_t_2);
4619       if (unlikely(!__pyx_t_1)) {
4620         PyObject* exc_type = PyErr_Occurred();
4621         if (exc_type) {
4622           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
4623           else __PYX_ERR(0, 35, __pyx_L1_error)
4624         }
4625         break;
4626       }
4627       __Pyx_GOTREF(__pyx_t_1);
4628     }
4629     __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_i);
4630     __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_i, __pyx_t_1);
4631     __Pyx_GIVEREF(__pyx_t_1);
4632     __pyx_t_1 = 0;
4633     __pyx_t_1 = __Pyx_PyFloat_SubtractObjC(__pyx_cur_scope->__pyx_v_i, __pyx_float_1_0, 1.0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
4634     __Pyx_GOTREF(__pyx_t_1);
4635     __pyx_t_5 = __Pyx_PyFloat_DivideObjC(__pyx_t_1, __pyx_float_2_0, 2.0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 35, __pyx_L1_error)
4636     __Pyx_GOTREF(__pyx_t_5);
4637     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4638     __pyx_r = __pyx_t_5;
4639     __pyx_t_5 = 0;
4640     __Pyx_XGIVEREF(__pyx_t_2);
4641     __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
4642     __pyx_cur_scope->__pyx_t_1 = __pyx_t_3;
4643     __pyx_cur_scope->__pyx_t_2 = __pyx_t_4;
4644     __Pyx_XGIVEREF(__pyx_r);
4645     __Pyx_RefNannyFinishContext();
4646     __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
4647     /* return from generator, yielding value */
4648     __pyx_generator->resume_label = 1;
4649     return __pyx_r;
4650     __pyx_L6_resume_from_yield:;
4651     __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
4652     __pyx_cur_scope->__pyx_t_0 = 0;
4653     __Pyx_XGOTREF(__pyx_t_2);
4654     __pyx_t_3 = __pyx_cur_scope->__pyx_t_1;
4655     __pyx_t_4 = __pyx_cur_scope->__pyx_t_2;
4656     if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 35, __pyx_L1_error)
4657   }
4658   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4659   CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
4660 
4661   /* function exit code */
4662   PyErr_SetNone(PyExc_StopIteration);
4663   goto __pyx_L0;
4664   __pyx_L1_error:;
4665   __Pyx_XDECREF(__pyx_t_1);
4666   __Pyx_XDECREF(__pyx_t_2);
4667   __Pyx_XDECREF(__pyx_t_5);
4668   __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
4669   __pyx_L0:;
4670   __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
4671   #if !CYTHON_USE_EXC_INFO_STACK
4672   __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
4673   #endif
4674   __pyx_generator->resume_label = -1;
4675   __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
4676   __Pyx_RefNannyFinishContext();
4677   return __pyx_r;
4678 }
4679 
4680 /* "yt/frontends/ramses/io_utils.pyx":21
4681  * @cython.cdivision(True)
4682  * @cython.nonecheck(False)
4683  * def read_amr(FortranFile f, dict headers,             # <<<<<<<<<<<<<<
4684  *              np.ndarray[np.int64_t, ndim=1] ngridbound, INT64_t min_level,
4685  *              RAMSESOctreeContainer oct_handler):
4686  */
4687 
__pyx_pf_2yt_9frontends_6ramses_8io_utils_read_amr(CYTHON_UNUSED PyObject * __pyx_self,struct __pyx_obj_2yt_9utilities_20cython_fortran_utils_FortranFile * __pyx_v_f,PyObject * __pyx_v_headers,PyArrayObject * __pyx_v_ngridbound,__pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_v_min_level,struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer * __pyx_v_oct_handler)4688 static PyObject *__pyx_pf_2yt_9frontends_6ramses_8io_utils_read_amr(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_2yt_9utilities_20cython_fortran_utils_FortranFile *__pyx_v_f, PyObject *__pyx_v_headers, PyArrayObject *__pyx_v_ngridbound, __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_v_min_level, struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer *__pyx_v_oct_handler) {
4689   struct __pyx_obj_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct__read_amr *__pyx_cur_scope;
4690   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_v_ncpu;
4691   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_v_nboundary;
4692   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_v_max_level;
4693   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_v_nlevelmax;
4694   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_v_ncpu_and_bound;
4695   __pyx_t_2yt_9frontends_6ramses_8io_utils_DOUBLE_t __pyx_v_nx;
4696   __pyx_t_2yt_9frontends_6ramses_8io_utils_DOUBLE_t __pyx_v_ny;
4697   __pyx_t_2yt_9frontends_6ramses_8io_utils_DOUBLE_t __pyx_v_nz;
4698   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_v_ilevel;
4699   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_v_icpu;
4700   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_v_n;
4701   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_v_ndim;
4702   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_v_skip_len;
4703   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT32_t __pyx_v_ng;
4704   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT32_t __pyx_v_buffer_size;
4705   PyArrayObject *__pyx_v_numbl = 0;
4706   PyArrayObject *__pyx_v_pos = 0;
4707   __Pyx_LocalBuf_ND __pyx_pybuffernd_ngridbound;
4708   __Pyx_Buffer __pyx_pybuffer_ngridbound;
4709   __Pyx_LocalBuf_ND __pyx_pybuffernd_numbl;
4710   __Pyx_Buffer __pyx_pybuffer_numbl;
4711   __Pyx_LocalBuf_ND __pyx_pybuffernd_pos;
4712   __Pyx_Buffer __pyx_pybuffer_pos;
4713   PyObject *__pyx_r = NULL;
4714   __Pyx_RefNannyDeclarations
4715   PyObject *__pyx_t_1 = NULL;
4716   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_t_2;
4717   PyArrayObject *__pyx_t_3 = NULL;
4718   int __pyx_t_4;
4719   PyObject *__pyx_t_5 = NULL;
4720   PyObject *__pyx_t_6 = NULL;
4721   PyObject *__pyx_t_7 = NULL;
4722   PyObject *__pyx_t_8 = NULL;
4723   PyObject *__pyx_t_9 = NULL;
4724   PyObject *__pyx_t_10 = NULL;
4725   PyObject *__pyx_t_11 = NULL;
4726   PyObject *(*__pyx_t_12)(PyObject *);
4727   __pyx_t_2yt_9frontends_6ramses_8io_utils_DOUBLE_t __pyx_t_13;
4728   __pyx_t_2yt_9frontends_6ramses_8io_utils_DOUBLE_t __pyx_t_14;
4729   __pyx_t_2yt_9frontends_6ramses_8io_utils_DOUBLE_t __pyx_t_15;
4730   PyArrayObject *__pyx_t_16 = NULL;
4731   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_t_17;
4732   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_t_18;
4733   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_t_19;
4734   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_t_20;
4735   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_t_21;
4736   int __pyx_t_22;
4737   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_t_23;
4738   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_t_24;
4739   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_t_25;
4740   __pyx_t_2yt_9utilities_20cython_fortran_utils_INT64_t __pyx_t_26;
4741   struct __pyx_opt_args_2yt_9utilities_20cython_fortran_utils_11FortranFile_skip __pyx_t_27;
4742   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_t_28;
4743   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_t_29;
4744   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_t_30;
4745   __Pyx_RefNannySetupContext("read_amr", 0);
4746   __pyx_cur_scope = (struct __pyx_obj_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct__read_amr *)__pyx_tp_new_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct__read_amr(__pyx_ptype_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct__read_amr, __pyx_empty_tuple, NULL);
4747   if (unlikely(!__pyx_cur_scope)) {
4748     __pyx_cur_scope = ((struct __pyx_obj_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct__read_amr *)Py_None);
4749     __Pyx_INCREF(Py_None);
4750     __PYX_ERR(0, 21, __pyx_L1_error)
4751   } else {
4752     __Pyx_GOTREF(__pyx_cur_scope);
4753   }
4754   __pyx_cur_scope->__pyx_v_headers = __pyx_v_headers;
4755   __Pyx_INCREF(__pyx_cur_scope->__pyx_v_headers);
4756   __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_headers);
4757   __pyx_pybuffer_numbl.pybuffer.buf = NULL;
4758   __pyx_pybuffer_numbl.refcount = 0;
4759   __pyx_pybuffernd_numbl.data = NULL;
4760   __pyx_pybuffernd_numbl.rcbuffer = &__pyx_pybuffer_numbl;
4761   __pyx_pybuffer_pos.pybuffer.buf = NULL;
4762   __pyx_pybuffer_pos.refcount = 0;
4763   __pyx_pybuffernd_pos.data = NULL;
4764   __pyx_pybuffernd_pos.rcbuffer = &__pyx_pybuffer_pos;
4765   __pyx_pybuffer_ngridbound.pybuffer.buf = NULL;
4766   __pyx_pybuffer_ngridbound.refcount = 0;
4767   __pyx_pybuffernd_ngridbound.data = NULL;
4768   __pyx_pybuffernd_ngridbound.rcbuffer = &__pyx_pybuffer_ngridbound;
4769   {
4770     __Pyx_BufFmt_StackElem __pyx_stack[1];
4771     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ngridbound.rcbuffer->pybuffer, (PyObject*)__pyx_v_ngridbound, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 21, __pyx_L1_error)
4772   }
4773   __pyx_pybuffernd_ngridbound.diminfo[0].strides = __pyx_pybuffernd_ngridbound.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ngridbound.diminfo[0].shape = __pyx_pybuffernd_ngridbound.rcbuffer->pybuffer.shape[0];
4774 
4775   /* "yt/frontends/ramses/io_utils.pyx":32
4776  *     cdef np.ndarray[np.float64_t, ndim=2] pos
4777  *
4778  *     ndim = headers['ndim']             # <<<<<<<<<<<<<<
4779  *     numbl = headers['numbl']
4780  *     nboundary = headers['nboundary']
4781  */
4782   if (unlikely(__pyx_cur_scope->__pyx_v_headers == Py_None)) {
4783     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
4784     __PYX_ERR(0, 32, __pyx_L1_error)
4785   }
4786   __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_headers, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error)
4787   __Pyx_GOTREF(__pyx_t_1);
4788   __pyx_t_2 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L1_error)
4789   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4790   __pyx_v_ndim = __pyx_t_2;
4791 
4792   /* "yt/frontends/ramses/io_utils.pyx":33
4793  *
4794  *     ndim = headers['ndim']
4795  *     numbl = headers['numbl']             # <<<<<<<<<<<<<<
4796  *     nboundary = headers['nboundary']
4797  *     nx, ny, nz = (((i-1.0)/2.0) for i in headers['nx'])
4798  */
4799   if (unlikely(__pyx_cur_scope->__pyx_v_headers == Py_None)) {
4800     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
4801     __PYX_ERR(0, 33, __pyx_L1_error)
4802   }
4803   __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_headers, __pyx_n_s_numbl); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error)
4804   __Pyx_GOTREF(__pyx_t_1);
4805   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 33, __pyx_L1_error)
4806   __pyx_t_3 = ((PyArrayObject *)__pyx_t_1);
4807   {
4808     __Pyx_BufFmt_StackElem __pyx_stack[1];
4809     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_numbl.rcbuffer->pybuffer);
4810     __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_numbl.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
4811     if (unlikely(__pyx_t_4 < 0)) {
4812       PyErr_Fetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
4813       if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_numbl.rcbuffer->pybuffer, (PyObject*)__pyx_v_numbl, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
4814         Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7);
4815         __Pyx_RaiseBufferFallbackError();
4816       } else {
4817         PyErr_Restore(__pyx_t_5, __pyx_t_6, __pyx_t_7);
4818       }
4819       __pyx_t_5 = __pyx_t_6 = __pyx_t_7 = 0;
4820     }
4821     __pyx_pybuffernd_numbl.diminfo[0].strides = __pyx_pybuffernd_numbl.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_numbl.diminfo[0].shape = __pyx_pybuffernd_numbl.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_numbl.diminfo[1].strides = __pyx_pybuffernd_numbl.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_numbl.diminfo[1].shape = __pyx_pybuffernd_numbl.rcbuffer->pybuffer.shape[1];
4822     if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 33, __pyx_L1_error)
4823   }
4824   __pyx_t_3 = 0;
4825   __pyx_v_numbl = ((PyArrayObject *)__pyx_t_1);
4826   __pyx_t_1 = 0;
4827 
4828   /* "yt/frontends/ramses/io_utils.pyx":34
4829  *     ndim = headers['ndim']
4830  *     numbl = headers['numbl']
4831  *     nboundary = headers['nboundary']             # <<<<<<<<<<<<<<
4832  *     nx, ny, nz = (((i-1.0)/2.0) for i in headers['nx'])
4833  *     nlevelmax = headers['nlevelmax']
4834  */
4835   if (unlikely(__pyx_cur_scope->__pyx_v_headers == Py_None)) {
4836     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
4837     __PYX_ERR(0, 34, __pyx_L1_error)
4838   }
4839   __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_headers, __pyx_n_s_nboundary); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error)
4840   __Pyx_GOTREF(__pyx_t_1);
4841   __pyx_t_2 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 34, __pyx_L1_error)
4842   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4843   __pyx_v_nboundary = __pyx_t_2;
4844 
4845   /* "yt/frontends/ramses/io_utils.pyx":35
4846  *     numbl = headers['numbl']
4847  *     nboundary = headers['nboundary']
4848  *     nx, ny, nz = (((i-1.0)/2.0) for i in headers['nx'])             # <<<<<<<<<<<<<<
4849  *     nlevelmax = headers['nlevelmax']
4850  *     ncpu = headers['ncpu']
4851  */
4852   __pyx_t_1 = __pyx_pf_2yt_9frontends_6ramses_8io_utils_8read_amr_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
4853   __Pyx_GOTREF(__pyx_t_1);
4854   if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
4855     PyObject* sequence = __pyx_t_1;
4856     Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
4857     if (unlikely(size != 3)) {
4858       if (size > 3) __Pyx_RaiseTooManyValuesError(3);
4859       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
4860       __PYX_ERR(0, 35, __pyx_L1_error)
4861     }
4862     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4863     if (likely(PyTuple_CheckExact(sequence))) {
4864       __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0);
4865       __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1);
4866       __pyx_t_10 = PyTuple_GET_ITEM(sequence, 2);
4867     } else {
4868       __pyx_t_8 = PyList_GET_ITEM(sequence, 0);
4869       __pyx_t_9 = PyList_GET_ITEM(sequence, 1);
4870       __pyx_t_10 = PyList_GET_ITEM(sequence, 2);
4871     }
4872     __Pyx_INCREF(__pyx_t_8);
4873     __Pyx_INCREF(__pyx_t_9);
4874     __Pyx_INCREF(__pyx_t_10);
4875     #else
4876     __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 35, __pyx_L1_error)
4877     __Pyx_GOTREF(__pyx_t_8);
4878     __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 35, __pyx_L1_error)
4879     __Pyx_GOTREF(__pyx_t_9);
4880     __pyx_t_10 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 35, __pyx_L1_error)
4881     __Pyx_GOTREF(__pyx_t_10);
4882     #endif
4883     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4884   } else {
4885     Py_ssize_t index = -1;
4886     __pyx_t_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 35, __pyx_L1_error)
4887     __Pyx_GOTREF(__pyx_t_11);
4888     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4889     __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext;
4890     index = 0; __pyx_t_8 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_8)) goto __pyx_L3_unpacking_failed;
4891     __Pyx_GOTREF(__pyx_t_8);
4892     index = 1; __pyx_t_9 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_9)) goto __pyx_L3_unpacking_failed;
4893     __Pyx_GOTREF(__pyx_t_9);
4894     index = 2; __pyx_t_10 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L3_unpacking_failed;
4895     __Pyx_GOTREF(__pyx_t_10);
4896     if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 3) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
4897     __pyx_t_12 = NULL;
4898     __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
4899     goto __pyx_L4_unpacking_done;
4900     __pyx_L3_unpacking_failed:;
4901     __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
4902     __pyx_t_12 = NULL;
4903     if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
4904     __PYX_ERR(0, 35, __pyx_L1_error)
4905     __pyx_L4_unpacking_done:;
4906   }
4907   __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_t_8); if (unlikely((__pyx_t_13 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 35, __pyx_L1_error)
4908   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4909   __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_9); if (unlikely((__pyx_t_14 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 35, __pyx_L1_error)
4910   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4911   __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_t_10); if (unlikely((__pyx_t_15 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 35, __pyx_L1_error)
4912   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4913   __pyx_v_nx = __pyx_t_13;
4914   __pyx_v_ny = __pyx_t_14;
4915   __pyx_v_nz = __pyx_t_15;
4916 
4917   /* "yt/frontends/ramses/io_utils.pyx":36
4918  *     nboundary = headers['nboundary']
4919  *     nx, ny, nz = (((i-1.0)/2.0) for i in headers['nx'])
4920  *     nlevelmax = headers['nlevelmax']             # <<<<<<<<<<<<<<
4921  *     ncpu = headers['ncpu']
4922  *
4923  */
4924   if (unlikely(__pyx_cur_scope->__pyx_v_headers == Py_None)) {
4925     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
4926     __PYX_ERR(0, 36, __pyx_L1_error)
4927   }
4928   __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_headers, __pyx_n_s_nlevelmax); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error)
4929   __Pyx_GOTREF(__pyx_t_1);
4930   __pyx_t_2 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 36, __pyx_L1_error)
4931   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4932   __pyx_v_nlevelmax = __pyx_t_2;
4933 
4934   /* "yt/frontends/ramses/io_utils.pyx":37
4935  *     nx, ny, nz = (((i-1.0)/2.0) for i in headers['nx'])
4936  *     nlevelmax = headers['nlevelmax']
4937  *     ncpu = headers['ncpu']             # <<<<<<<<<<<<<<
4938  *
4939  *     ncpu_and_bound = nboundary + ncpu
4940  */
4941   if (unlikely(__pyx_cur_scope->__pyx_v_headers == Py_None)) {
4942     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
4943     __PYX_ERR(0, 37, __pyx_L1_error)
4944   }
4945   __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_headers, __pyx_n_s_ncpu); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error)
4946   __Pyx_GOTREF(__pyx_t_1);
4947   __pyx_t_2 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 37, __pyx_L1_error)
4948   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4949   __pyx_v_ncpu = __pyx_t_2;
4950 
4951   /* "yt/frontends/ramses/io_utils.pyx":39
4952  *     ncpu = headers['ncpu']
4953  *
4954  *     ncpu_and_bound = nboundary + ncpu             # <<<<<<<<<<<<<<
4955  *
4956  *     pos = np.empty((0, 3), dtype=np.float64)
4957  */
4958   __pyx_v_ncpu_and_bound = (__pyx_v_nboundary + __pyx_v_ncpu);
4959 
4960   /* "yt/frontends/ramses/io_utils.pyx":41
4961  *     ncpu_and_bound = nboundary + ncpu
4962  *
4963  *     pos = np.empty((0, 3), dtype=np.float64)             # <<<<<<<<<<<<<<
4964  *     buffer_size = 0
4965  *     # Compute number of fields to skip. This should be 31 in 3 dimensions
4966  */
4967   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error)
4968   __Pyx_GOTREF(__pyx_t_1);
4969   __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 41, __pyx_L1_error)
4970   __Pyx_GOTREF(__pyx_t_10);
4971   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4972   __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error)
4973   __Pyx_GOTREF(__pyx_t_1);
4974   __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 41, __pyx_L1_error)
4975   __Pyx_GOTREF(__pyx_t_9);
4976   __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_float64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 41, __pyx_L1_error)
4977   __Pyx_GOTREF(__pyx_t_8);
4978   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4979   if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 41, __pyx_L1_error)
4980   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4981   __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__2, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 41, __pyx_L1_error)
4982   __Pyx_GOTREF(__pyx_t_8);
4983   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4984   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4985   if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 41, __pyx_L1_error)
4986   __pyx_t_16 = ((PyArrayObject *)__pyx_t_8);
4987   {
4988     __Pyx_BufFmt_StackElem __pyx_stack[1];
4989     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer);
4990     __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
4991     if (unlikely(__pyx_t_4 < 0)) {
4992       PyErr_Fetch(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5);
4993       if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
4994         Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_5);
4995         __Pyx_RaiseBufferFallbackError();
4996       } else {
4997         PyErr_Restore(__pyx_t_7, __pyx_t_6, __pyx_t_5);
4998       }
4999       __pyx_t_7 = __pyx_t_6 = __pyx_t_5 = 0;
5000     }
5001     __pyx_pybuffernd_pos.diminfo[0].strides = __pyx_pybuffernd_pos.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pos.diminfo[0].shape = __pyx_pybuffernd_pos.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_pos.diminfo[1].strides = __pyx_pybuffernd_pos.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_pos.diminfo[1].shape = __pyx_pybuffernd_pos.rcbuffer->pybuffer.shape[1];
5002     if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 41, __pyx_L1_error)
5003   }
5004   __pyx_t_16 = 0;
5005   __pyx_v_pos = ((PyArrayObject *)__pyx_t_8);
5006   __pyx_t_8 = 0;
5007 
5008   /* "yt/frontends/ramses/io_utils.pyx":42
5009  *
5010  *     pos = np.empty((0, 3), dtype=np.float64)
5011  *     buffer_size = 0             # <<<<<<<<<<<<<<
5012  *     # Compute number of fields to skip. This should be 31 in 3 dimensions
5013  *     skip_len = (1          # father index
5014  */
5015   __pyx_v_buffer_size = 0;
5016 
5017   /* "yt/frontends/ramses/io_utils.pyx":48
5018  *                 + 2**ndim  # son index
5019  *                 + 2**ndim  # cpu map
5020  *                 + 2**ndim  # refinement map             # <<<<<<<<<<<<<<
5021  *     )
5022  *     # Initialize values
5023  */
5024   __pyx_v_skip_len = ((((1 + (2 * __pyx_v_ndim)) + __Pyx_pow___pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t(2, __pyx_v_ndim)) + __Pyx_pow___pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t(2, __pyx_v_ndim)) + __Pyx_pow___pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t(2, __pyx_v_ndim));
5025 
5026   /* "yt/frontends/ramses/io_utils.pyx":51
5027  *     )
5028  *     # Initialize values
5029  *     max_level = 0             # <<<<<<<<<<<<<<
5030  *     for ilevel in range(nlevelmax):
5031  *         for icpu in range(ncpu_and_bound):
5032  */
5033   __pyx_v_max_level = 0;
5034 
5035   /* "yt/frontends/ramses/io_utils.pyx":52
5036  *     # Initialize values
5037  *     max_level = 0
5038  *     for ilevel in range(nlevelmax):             # <<<<<<<<<<<<<<
5039  *         for icpu in range(ncpu_and_bound):
5040  *             if icpu < ncpu:
5041  */
5042   __pyx_t_2 = __pyx_v_nlevelmax;
5043   __pyx_t_17 = __pyx_t_2;
5044   for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) {
5045     __pyx_v_ilevel = __pyx_t_18;
5046 
5047     /* "yt/frontends/ramses/io_utils.pyx":53
5048  *     max_level = 0
5049  *     for ilevel in range(nlevelmax):
5050  *         for icpu in range(ncpu_and_bound):             # <<<<<<<<<<<<<<
5051  *             if icpu < ncpu:
5052  *                 ng = numbl[ilevel, icpu]
5053  */
5054     __pyx_t_19 = __pyx_v_ncpu_and_bound;
5055     __pyx_t_20 = __pyx_t_19;
5056     for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) {
5057       __pyx_v_icpu = __pyx_t_21;
5058 
5059       /* "yt/frontends/ramses/io_utils.pyx":54
5060  *     for ilevel in range(nlevelmax):
5061  *         for icpu in range(ncpu_and_bound):
5062  *             if icpu < ncpu:             # <<<<<<<<<<<<<<
5063  *                 ng = numbl[ilevel, icpu]
5064  *             else:
5065  */
5066       __pyx_t_22 = ((__pyx_v_icpu < __pyx_v_ncpu) != 0);
5067       if (__pyx_t_22) {
5068 
5069         /* "yt/frontends/ramses/io_utils.pyx":55
5070  *         for icpu in range(ncpu_and_bound):
5071  *             if icpu < ncpu:
5072  *                 ng = numbl[ilevel, icpu]             # <<<<<<<<<<<<<<
5073  *             else:
5074  *                 ng = ngridbound[icpu - ncpu + nboundary*ilevel]
5075  */
5076         __pyx_t_23 = __pyx_v_ilevel;
5077         __pyx_t_24 = __pyx_v_icpu;
5078         __pyx_v_ng = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_numbl.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_numbl.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_numbl.diminfo[1].strides));
5079 
5080         /* "yt/frontends/ramses/io_utils.pyx":54
5081  *     for ilevel in range(nlevelmax):
5082  *         for icpu in range(ncpu_and_bound):
5083  *             if icpu < ncpu:             # <<<<<<<<<<<<<<
5084  *                 ng = numbl[ilevel, icpu]
5085  *             else:
5086  */
5087         goto __pyx_L9;
5088       }
5089 
5090       /* "yt/frontends/ramses/io_utils.pyx":57
5091  *                 ng = numbl[ilevel, icpu]
5092  *             else:
5093  *                 ng = ngridbound[icpu - ncpu + nboundary*ilevel]             # <<<<<<<<<<<<<<
5094  *
5095  *             if ng == 0:
5096  */
5097       /*else*/ {
5098         __pyx_t_25 = ((__pyx_v_icpu - __pyx_v_ncpu) + (__pyx_v_nboundary * __pyx_v_ilevel));
5099         __pyx_v_ng = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_ngridbound.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_ngridbound.diminfo[0].strides));
5100       }
5101       __pyx_L9:;
5102 
5103       /* "yt/frontends/ramses/io_utils.pyx":59
5104  *                 ng = ngridbound[icpu - ncpu + nboundary*ilevel]
5105  *
5106  *             if ng == 0:             # <<<<<<<<<<<<<<
5107  *                 continue
5108  *             # Skip grid index, 'next' and 'prev' arrays (they are used
5109  */
5110       __pyx_t_22 = ((__pyx_v_ng == 0) != 0);
5111       if (__pyx_t_22) {
5112 
5113         /* "yt/frontends/ramses/io_utils.pyx":60
5114  *
5115  *             if ng == 0:
5116  *                 continue             # <<<<<<<<<<<<<<
5117  *             # Skip grid index, 'next' and 'prev' arrays (they are used
5118  *             # to build the linked list in RAMSES)
5119  */
5120         goto __pyx_L7_continue;
5121 
5122         /* "yt/frontends/ramses/io_utils.pyx":59
5123  *                 ng = ngridbound[icpu - ncpu + nboundary*ilevel]
5124  *
5125  *             if ng == 0:             # <<<<<<<<<<<<<<
5126  *                 continue
5127  *             # Skip grid index, 'next' and 'prev' arrays (they are used
5128  */
5129       }
5130 
5131       /* "yt/frontends/ramses/io_utils.pyx":63
5132  *             # Skip grid index, 'next' and 'prev' arrays (they are used
5133  *             # to build the linked list in RAMSES)
5134  *             f.skip(3)             # <<<<<<<<<<<<<<
5135  *
5136  *             # Allocate more memory if required
5137  */
5138       __pyx_t_27.__pyx_n = 1;
5139       __pyx_t_27.n = 3;
5140       __pyx_t_26 = ((struct __pyx_vtabstruct_2yt_9utilities_20cython_fortran_utils_FortranFile *)__pyx_v_f->__pyx_vtab)->skip(__pyx_v_f, 0, &__pyx_t_27); if (unlikely(__pyx_t_26 == ((__pyx_t_2yt_9utilities_20cython_fortran_utils_INT64_t)-1LL))) __PYX_ERR(0, 63, __pyx_L1_error)
5141 
5142       /* "yt/frontends/ramses/io_utils.pyx":66
5143  *
5144  *             # Allocate more memory if required
5145  *             if ng > buffer_size:             # <<<<<<<<<<<<<<
5146  *                 pos = np.empty((ng, 3), dtype="d")
5147  *                 buffer_size = ng
5148  */
5149       __pyx_t_22 = ((__pyx_v_ng > __pyx_v_buffer_size) != 0);
5150       if (__pyx_t_22) {
5151 
5152         /* "yt/frontends/ramses/io_utils.pyx":67
5153  *             # Allocate more memory if required
5154  *             if ng > buffer_size:
5155  *                 pos = np.empty((ng, 3), dtype="d")             # <<<<<<<<<<<<<<
5156  *                 buffer_size = ng
5157  *
5158  */
5159         __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 67, __pyx_L1_error)
5160         __Pyx_GOTREF(__pyx_t_8);
5161         __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error)
5162         __Pyx_GOTREF(__pyx_t_1);
5163         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5164         __pyx_t_8 = __Pyx_PyInt_From_npy_int32(__pyx_v_ng); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 67, __pyx_L1_error)
5165         __Pyx_GOTREF(__pyx_t_8);
5166         __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 67, __pyx_L1_error)
5167         __Pyx_GOTREF(__pyx_t_10);
5168         __Pyx_GIVEREF(__pyx_t_8);
5169         PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8);
5170         __Pyx_INCREF(__pyx_int_3);
5171         __Pyx_GIVEREF(__pyx_int_3);
5172         PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_int_3);
5173         __pyx_t_8 = 0;
5174         __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 67, __pyx_L1_error)
5175         __Pyx_GOTREF(__pyx_t_8);
5176         __Pyx_GIVEREF(__pyx_t_10);
5177         PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_10);
5178         __pyx_t_10 = 0;
5179         __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 67, __pyx_L1_error)
5180         __Pyx_GOTREF(__pyx_t_10);
5181         if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, __pyx_n_s_d) < 0) __PYX_ERR(0, 67, __pyx_L1_error)
5182         __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 67, __pyx_L1_error)
5183         __Pyx_GOTREF(__pyx_t_9);
5184         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5185         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5186         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5187         if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 67, __pyx_L1_error)
5188         __pyx_t_16 = ((PyArrayObject *)__pyx_t_9);
5189         {
5190           __Pyx_BufFmt_StackElem __pyx_stack[1];
5191           __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer);
5192           __pyx_t_4 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
5193           if (unlikely(__pyx_t_4 < 0)) {
5194             PyErr_Fetch(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
5195             if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pos.rcbuffer->pybuffer, (PyObject*)__pyx_v_pos, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
5196               Py_XDECREF(__pyx_t_5); Py_XDECREF(__pyx_t_6); Py_XDECREF(__pyx_t_7);
5197               __Pyx_RaiseBufferFallbackError();
5198             } else {
5199               PyErr_Restore(__pyx_t_5, __pyx_t_6, __pyx_t_7);
5200             }
5201             __pyx_t_5 = __pyx_t_6 = __pyx_t_7 = 0;
5202           }
5203           __pyx_pybuffernd_pos.diminfo[0].strides = __pyx_pybuffernd_pos.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pos.diminfo[0].shape = __pyx_pybuffernd_pos.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_pos.diminfo[1].strides = __pyx_pybuffernd_pos.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_pos.diminfo[1].shape = __pyx_pybuffernd_pos.rcbuffer->pybuffer.shape[1];
5204           if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 67, __pyx_L1_error)
5205         }
5206         __pyx_t_16 = 0;
5207         __Pyx_DECREF_SET(__pyx_v_pos, ((PyArrayObject *)__pyx_t_9));
5208         __pyx_t_9 = 0;
5209 
5210         /* "yt/frontends/ramses/io_utils.pyx":68
5211  *             if ng > buffer_size:
5212  *                 pos = np.empty((ng, 3), dtype="d")
5213  *                 buffer_size = ng             # <<<<<<<<<<<<<<
5214  *
5215  *             pos[:ng, 0] = f.read_vector("d") - nx
5216  */
5217         __pyx_v_buffer_size = __pyx_v_ng;
5218 
5219         /* "yt/frontends/ramses/io_utils.pyx":66
5220  *
5221  *             # Allocate more memory if required
5222  *             if ng > buffer_size:             # <<<<<<<<<<<<<<
5223  *                 pos = np.empty((ng, 3), dtype="d")
5224  *                 buffer_size = ng
5225  */
5226       }
5227 
5228       /* "yt/frontends/ramses/io_utils.pyx":70
5229  *                 buffer_size = ng
5230  *
5231  *             pos[:ng, 0] = f.read_vector("d") - nx             # <<<<<<<<<<<<<<
5232  *             pos[:ng, 1] = f.read_vector("d") - ny
5233  *             pos[:ng, 2] = f.read_vector("d") - nz
5234  */
5235       __pyx_t_9 = ((PyObject *)((struct __pyx_vtabstruct_2yt_9utilities_20cython_fortran_utils_FortranFile *)__pyx_v_f->__pyx_vtab)->read_vector(__pyx_v_f, __pyx_n_s_d, 0)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 70, __pyx_L1_error)
5236       __Pyx_GOTREF(__pyx_t_9);
5237       __pyx_t_10 = PyFloat_FromDouble(__pyx_v_nx); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 70, __pyx_L1_error)
5238       __Pyx_GOTREF(__pyx_t_10);
5239       __pyx_t_8 = PyNumber_Subtract(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 70, __pyx_L1_error)
5240       __Pyx_GOTREF(__pyx_t_8);
5241       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5242       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5243       __pyx_t_10 = __Pyx_PyInt_From_npy_int32(__pyx_v_ng); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 70, __pyx_L1_error)
5244       __Pyx_GOTREF(__pyx_t_10);
5245       __pyx_t_9 = PySlice_New(Py_None, __pyx_t_10, Py_None); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 70, __pyx_L1_error)
5246       __Pyx_GOTREF(__pyx_t_9);
5247       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5248       __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 70, __pyx_L1_error)
5249       __Pyx_GOTREF(__pyx_t_10);
5250       __Pyx_GIVEREF(__pyx_t_9);
5251       PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9);
5252       __Pyx_INCREF(__pyx_int_0);
5253       __Pyx_GIVEREF(__pyx_int_0);
5254       PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_int_0);
5255       __pyx_t_9 = 0;
5256       if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_pos), __pyx_t_10, __pyx_t_8) < 0)) __PYX_ERR(0, 70, __pyx_L1_error)
5257       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5258       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5259 
5260       /* "yt/frontends/ramses/io_utils.pyx":71
5261  *
5262  *             pos[:ng, 0] = f.read_vector("d") - nx
5263  *             pos[:ng, 1] = f.read_vector("d") - ny             # <<<<<<<<<<<<<<
5264  *             pos[:ng, 2] = f.read_vector("d") - nz
5265  *
5266  */
5267       __pyx_t_8 = ((PyObject *)((struct __pyx_vtabstruct_2yt_9utilities_20cython_fortran_utils_FortranFile *)__pyx_v_f->__pyx_vtab)->read_vector(__pyx_v_f, __pyx_n_s_d, 0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 71, __pyx_L1_error)
5268       __Pyx_GOTREF(__pyx_t_8);
5269       __pyx_t_10 = PyFloat_FromDouble(__pyx_v_ny); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 71, __pyx_L1_error)
5270       __Pyx_GOTREF(__pyx_t_10);
5271       __pyx_t_9 = PyNumber_Subtract(__pyx_t_8, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 71, __pyx_L1_error)
5272       __Pyx_GOTREF(__pyx_t_9);
5273       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5274       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5275       __pyx_t_10 = __Pyx_PyInt_From_npy_int32(__pyx_v_ng); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 71, __pyx_L1_error)
5276       __Pyx_GOTREF(__pyx_t_10);
5277       __pyx_t_8 = PySlice_New(Py_None, __pyx_t_10, Py_None); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 71, __pyx_L1_error)
5278       __Pyx_GOTREF(__pyx_t_8);
5279       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5280       __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 71, __pyx_L1_error)
5281       __Pyx_GOTREF(__pyx_t_10);
5282       __Pyx_GIVEREF(__pyx_t_8);
5283       PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8);
5284       __Pyx_INCREF(__pyx_int_1);
5285       __Pyx_GIVEREF(__pyx_int_1);
5286       PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_int_1);
5287       __pyx_t_8 = 0;
5288       if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_pos), __pyx_t_10, __pyx_t_9) < 0)) __PYX_ERR(0, 71, __pyx_L1_error)
5289       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5290       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5291 
5292       /* "yt/frontends/ramses/io_utils.pyx":72
5293  *             pos[:ng, 0] = f.read_vector("d") - nx
5294  *             pos[:ng, 1] = f.read_vector("d") - ny
5295  *             pos[:ng, 2] = f.read_vector("d") - nz             # <<<<<<<<<<<<<<
5296  *
5297  *             # Skip father, neighbor, son, cpu map and refinement map
5298  */
5299       __pyx_t_9 = ((PyObject *)((struct __pyx_vtabstruct_2yt_9utilities_20cython_fortran_utils_FortranFile *)__pyx_v_f->__pyx_vtab)->read_vector(__pyx_v_f, __pyx_n_s_d, 0)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 72, __pyx_L1_error)
5300       __Pyx_GOTREF(__pyx_t_9);
5301       __pyx_t_10 = PyFloat_FromDouble(__pyx_v_nz); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 72, __pyx_L1_error)
5302       __Pyx_GOTREF(__pyx_t_10);
5303       __pyx_t_8 = PyNumber_Subtract(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 72, __pyx_L1_error)
5304       __Pyx_GOTREF(__pyx_t_8);
5305       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5306       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5307       __pyx_t_10 = __Pyx_PyInt_From_npy_int32(__pyx_v_ng); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 72, __pyx_L1_error)
5308       __Pyx_GOTREF(__pyx_t_10);
5309       __pyx_t_9 = PySlice_New(Py_None, __pyx_t_10, Py_None); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 72, __pyx_L1_error)
5310       __Pyx_GOTREF(__pyx_t_9);
5311       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5312       __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 72, __pyx_L1_error)
5313       __Pyx_GOTREF(__pyx_t_10);
5314       __Pyx_GIVEREF(__pyx_t_9);
5315       PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9);
5316       __Pyx_INCREF(__pyx_int_2);
5317       __Pyx_GIVEREF(__pyx_int_2);
5318       PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_int_2);
5319       __pyx_t_9 = 0;
5320       if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_pos), __pyx_t_10, __pyx_t_8) < 0)) __PYX_ERR(0, 72, __pyx_L1_error)
5321       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5322       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5323 
5324       /* "yt/frontends/ramses/io_utils.pyx":75
5325  *
5326  *             # Skip father, neighbor, son, cpu map and refinement map
5327  *             f.skip(skip_len)             # <<<<<<<<<<<<<<
5328  *             # Note that we're adding *grids*, not individual cells.
5329  *             if ilevel >= min_level:
5330  */
5331       __pyx_t_27.__pyx_n = 1;
5332       __pyx_t_27.n = __pyx_v_skip_len;
5333       __pyx_t_26 = ((struct __pyx_vtabstruct_2yt_9utilities_20cython_fortran_utils_FortranFile *)__pyx_v_f->__pyx_vtab)->skip(__pyx_v_f, 0, &__pyx_t_27); if (unlikely(__pyx_t_26 == ((__pyx_t_2yt_9utilities_20cython_fortran_utils_INT64_t)-1LL))) __PYX_ERR(0, 75, __pyx_L1_error)
5334 
5335       /* "yt/frontends/ramses/io_utils.pyx":77
5336  *             f.skip(skip_len)
5337  *             # Note that we're adding *grids*, not individual cells.
5338  *             if ilevel >= min_level:             # <<<<<<<<<<<<<<
5339  *                 n = oct_handler.add(icpu + 1, ilevel - min_level, pos[:ng, :],
5340  *                                     count_boundary = 1)
5341  */
5342       __pyx_t_22 = ((__pyx_v_ilevel >= __pyx_v_min_level) != 0);
5343       if (__pyx_t_22) {
5344 
5345         /* "yt/frontends/ramses/io_utils.pyx":78
5346  *             # Note that we're adding *grids*, not individual cells.
5347  *             if ilevel >= min_level:
5348  *                 n = oct_handler.add(icpu + 1, ilevel - min_level, pos[:ng, :],             # <<<<<<<<<<<<<<
5349  *                                     count_boundary = 1)
5350  *                 if n > 0:
5351  */
5352         __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_oct_handler), __pyx_n_s_add); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 78, __pyx_L1_error)
5353         __Pyx_GOTREF(__pyx_t_8);
5354         __pyx_t_10 = __Pyx_PyInt_From_npy_int64((__pyx_v_icpu + 1)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 78, __pyx_L1_error)
5355         __Pyx_GOTREF(__pyx_t_10);
5356         __pyx_t_9 = __Pyx_PyInt_From_npy_int64((__pyx_v_ilevel - __pyx_v_min_level)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 78, __pyx_L1_error)
5357         __Pyx_GOTREF(__pyx_t_9);
5358         __pyx_t_1 = __Pyx_PyInt_From_npy_int32(__pyx_v_ng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error)
5359         __Pyx_GOTREF(__pyx_t_1);
5360         __pyx_t_11 = PySlice_New(Py_None, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 78, __pyx_L1_error)
5361         __Pyx_GOTREF(__pyx_t_11);
5362         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5363         __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error)
5364         __Pyx_GOTREF(__pyx_t_1);
5365         __Pyx_GIVEREF(__pyx_t_11);
5366         PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_11);
5367         __Pyx_INCREF(__pyx_slice__3);
5368         __Pyx_GIVEREF(__pyx_slice__3);
5369         PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_slice__3);
5370         __pyx_t_11 = 0;
5371         __pyx_t_11 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_pos), __pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 78, __pyx_L1_error)
5372         __Pyx_GOTREF(__pyx_t_11);
5373         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5374         __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error)
5375         __Pyx_GOTREF(__pyx_t_1);
5376         __Pyx_GIVEREF(__pyx_t_10);
5377         PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_10);
5378         __Pyx_GIVEREF(__pyx_t_9);
5379         PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_9);
5380         __Pyx_GIVEREF(__pyx_t_11);
5381         PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_11);
5382         __pyx_t_10 = 0;
5383         __pyx_t_9 = 0;
5384         __pyx_t_11 = 0;
5385 
5386         /* "yt/frontends/ramses/io_utils.pyx":79
5387  *             if ilevel >= min_level:
5388  *                 n = oct_handler.add(icpu + 1, ilevel - min_level, pos[:ng, :],
5389  *                                     count_boundary = 1)             # <<<<<<<<<<<<<<
5390  *                 if n > 0:
5391  *                     max_level = max(ilevel - min_level, max_level)
5392  */
5393         __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 79, __pyx_L1_error)
5394         __Pyx_GOTREF(__pyx_t_11);
5395         if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_count_boundary, __pyx_int_1) < 0) __PYX_ERR(0, 79, __pyx_L1_error)
5396 
5397         /* "yt/frontends/ramses/io_utils.pyx":78
5398  *             # Note that we're adding *grids*, not individual cells.
5399  *             if ilevel >= min_level:
5400  *                 n = oct_handler.add(icpu + 1, ilevel - min_level, pos[:ng, :],             # <<<<<<<<<<<<<<
5401  *                                     count_boundary = 1)
5402  *                 if n > 0:
5403  */
5404         __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_1, __pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 78, __pyx_L1_error)
5405         __Pyx_GOTREF(__pyx_t_9);
5406         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5407         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5408         __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5409         __pyx_t_28 = __Pyx_PyInt_As_npy_int64(__pyx_t_9); if (unlikely((__pyx_t_28 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L1_error)
5410         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5411         __pyx_v_n = __pyx_t_28;
5412 
5413         /* "yt/frontends/ramses/io_utils.pyx":80
5414  *                 n = oct_handler.add(icpu + 1, ilevel - min_level, pos[:ng, :],
5415  *                                     count_boundary = 1)
5416  *                 if n > 0:             # <<<<<<<<<<<<<<
5417  *                     max_level = max(ilevel - min_level, max_level)
5418  *
5419  */
5420         __pyx_t_22 = ((__pyx_v_n > 0) != 0);
5421         if (__pyx_t_22) {
5422 
5423           /* "yt/frontends/ramses/io_utils.pyx":81
5424  *                                     count_boundary = 1)
5425  *                 if n > 0:
5426  *                     max_level = max(ilevel - min_level, max_level)             # <<<<<<<<<<<<<<
5427  *
5428  *     return max_level
5429  */
5430           __pyx_t_28 = __pyx_v_max_level;
5431           __pyx_t_29 = (__pyx_v_ilevel - __pyx_v_min_level);
5432           if (((__pyx_t_28 > __pyx_t_29) != 0)) {
5433             __pyx_t_30 = __pyx_t_28;
5434           } else {
5435             __pyx_t_30 = __pyx_t_29;
5436           }
5437           __pyx_v_max_level = __pyx_t_30;
5438 
5439           /* "yt/frontends/ramses/io_utils.pyx":80
5440  *                 n = oct_handler.add(icpu + 1, ilevel - min_level, pos[:ng, :],
5441  *                                     count_boundary = 1)
5442  *                 if n > 0:             # <<<<<<<<<<<<<<
5443  *                     max_level = max(ilevel - min_level, max_level)
5444  *
5445  */
5446         }
5447 
5448         /* "yt/frontends/ramses/io_utils.pyx":77
5449  *             f.skip(skip_len)
5450  *             # Note that we're adding *grids*, not individual cells.
5451  *             if ilevel >= min_level:             # <<<<<<<<<<<<<<
5452  *                 n = oct_handler.add(icpu + 1, ilevel - min_level, pos[:ng, :],
5453  *                                     count_boundary = 1)
5454  */
5455       }
5456       __pyx_L7_continue:;
5457     }
5458   }
5459 
5460   /* "yt/frontends/ramses/io_utils.pyx":83
5461  *                     max_level = max(ilevel - min_level, max_level)
5462  *
5463  *     return max_level             # <<<<<<<<<<<<<<
5464  *
5465  * @cython.boundscheck(False)
5466  */
5467   __Pyx_XDECREF(__pyx_r);
5468   __pyx_t_9 = __Pyx_PyInt_From_npy_int64(__pyx_v_max_level); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 83, __pyx_L1_error)
5469   __Pyx_GOTREF(__pyx_t_9);
5470   __pyx_r = __pyx_t_9;
5471   __pyx_t_9 = 0;
5472   goto __pyx_L0;
5473 
5474   /* "yt/frontends/ramses/io_utils.pyx":21
5475  * @cython.cdivision(True)
5476  * @cython.nonecheck(False)
5477  * def read_amr(FortranFile f, dict headers,             # <<<<<<<<<<<<<<
5478  *              np.ndarray[np.int64_t, ndim=1] ngridbound, INT64_t min_level,
5479  *              RAMSESOctreeContainer oct_handler):
5480  */
5481 
5482   /* function exit code */
5483   __pyx_L1_error:;
5484   __Pyx_XDECREF(__pyx_t_1);
5485   __Pyx_XDECREF(__pyx_t_8);
5486   __Pyx_XDECREF(__pyx_t_9);
5487   __Pyx_XDECREF(__pyx_t_10);
5488   __Pyx_XDECREF(__pyx_t_11);
5489   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
5490     __Pyx_PyThreadState_declare
5491     __Pyx_PyThreadState_assign
5492     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
5493     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ngridbound.rcbuffer->pybuffer);
5494     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_numbl.rcbuffer->pybuffer);
5495     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer);
5496   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
5497   __Pyx_AddTraceback("yt.frontends.ramses.io_utils.read_amr", __pyx_clineno, __pyx_lineno, __pyx_filename);
5498   __pyx_r = NULL;
5499   goto __pyx_L2;
5500   __pyx_L0:;
5501   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ngridbound.rcbuffer->pybuffer);
5502   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_numbl.rcbuffer->pybuffer);
5503   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pos.rcbuffer->pybuffer);
5504   __pyx_L2:;
5505   __Pyx_XDECREF((PyObject *)__pyx_v_numbl);
5506   __Pyx_XDECREF((PyObject *)__pyx_v_pos);
5507   __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
5508   __Pyx_XGIVEREF(__pyx_r);
5509   __Pyx_RefNannyFinishContext();
5510   return __pyx_r;
5511 }
5512 
5513 /* "yt/frontends/ramses/io_utils.pyx":89
5514  * @cython.cdivision(True)
5515  * @cython.nonecheck(False)
5516  * cpdef read_offset(FortranFile f, INT64_t min_level, INT64_t domain_id, INT64_t nvar, dict headers):             # <<<<<<<<<<<<<<
5517  *
5518  *     cdef np.ndarray[np.int64_t, ndim=2] offset, level_count
5519  */
5520 
5521 static PyObject *__pyx_pw_2yt_9frontends_6ramses_8io_utils_3read_offset(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_f_2yt_9frontends_6ramses_8io_utils_read_offset(struct __pyx_obj_2yt_9utilities_20cython_fortran_utils_FortranFile * __pyx_v_f,__pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_v_min_level,CYTHON_UNUSED __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_v_domain_id,__pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_v_nvar,PyObject * __pyx_v_headers,CYTHON_UNUSED int __pyx_skip_dispatch)5522 static PyObject *__pyx_f_2yt_9frontends_6ramses_8io_utils_read_offset(struct __pyx_obj_2yt_9utilities_20cython_fortran_utils_FortranFile *__pyx_v_f, __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_v_min_level, CYTHON_UNUSED __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_v_domain_id, __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_v_nvar, PyObject *__pyx_v_headers, CYTHON_UNUSED int __pyx_skip_dispatch) {
5523   PyArrayObject *__pyx_v_offset = 0;
5524   PyArrayObject *__pyx_v_level_count = 0;
5525   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_v_ndim;
5526   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_v_twotondim;
5527   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_v_nlevelmax;
5528   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_v_n_levels;
5529   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_v_nboundary;
5530   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_v_ncpu;
5531   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_v_ncpu_and_bound;
5532   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_v_ilevel;
5533   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_v_icpu;
5534   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_v_skip_len;
5535   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT32_t __pyx_v_file_ilevel;
5536   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT32_t __pyx_v_file_ncache;
5537   CYTHON_UNUSED PyObject *__pyx_v_numbl = NULL;
5538   __Pyx_memviewslice __pyx_v_level_count_view = { 0, 0, { 0 }, { 0 }, { 0 } };
5539   __Pyx_memviewslice __pyx_v_offset_view = { 0, 0, { 0 }, { 0 }, { 0 } };
5540   __Pyx_LocalBuf_ND __pyx_pybuffernd_level_count;
5541   __Pyx_Buffer __pyx_pybuffer_level_count;
5542   __Pyx_LocalBuf_ND __pyx_pybuffernd_offset;
5543   __Pyx_Buffer __pyx_pybuffer_offset;
5544   PyObject *__pyx_r = NULL;
5545   __Pyx_RefNannyDeclarations
5546   PyObject *__pyx_t_1 = NULL;
5547   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_t_2;
5548   PyObject *__pyx_t_3 = NULL;
5549   PyObject *__pyx_t_4 = NULL;
5550   PyObject *__pyx_t_5 = NULL;
5551   PyObject *__pyx_t_6 = NULL;
5552   PyArrayObject *__pyx_t_7 = NULL;
5553   int __pyx_t_8;
5554   PyObject *__pyx_t_9 = NULL;
5555   PyObject *__pyx_t_10 = NULL;
5556   PyObject *__pyx_t_11 = NULL;
5557   __Pyx_memviewslice __pyx_t_12 = { 0, 0, { 0 }, { 0 }, { 0 } };
5558   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_t_13;
5559   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_t_14;
5560   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_t_15;
5561   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_t_16;
5562   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_t_17;
5563   __pyx_t_2yt_9utilities_20cython_fortran_utils_INT32_t __pyx_t_18;
5564   int __pyx_t_19;
5565   PyObject *__pyx_t_20 = NULL;
5566   PyObject *__pyx_t_21 = NULL;
5567   __pyx_t_2yt_9utilities_20cython_fortran_utils_INT64_t __pyx_t_22;
5568   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_t_23;
5569   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_t_24;
5570   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_t_25;
5571   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_t_26;
5572   struct __pyx_opt_args_2yt_9utilities_20cython_fortran_utils_11FortranFile_skip __pyx_t_27;
5573   __Pyx_RefNannySetupContext("read_offset", 0);
5574   __pyx_pybuffer_offset.pybuffer.buf = NULL;
5575   __pyx_pybuffer_offset.refcount = 0;
5576   __pyx_pybuffernd_offset.data = NULL;
5577   __pyx_pybuffernd_offset.rcbuffer = &__pyx_pybuffer_offset;
5578   __pyx_pybuffer_level_count.pybuffer.buf = NULL;
5579   __pyx_pybuffer_level_count.refcount = 0;
5580   __pyx_pybuffernd_level_count.data = NULL;
5581   __pyx_pybuffernd_level_count.rcbuffer = &__pyx_pybuffer_level_count;
5582 
5583   /* "yt/frontends/ramses/io_utils.pyx":96
5584  *     cdef INT32_t file_ilevel, file_ncache
5585  *
5586  *     numbl = headers['numbl']             # <<<<<<<<<<<<<<
5587  *     ndim = headers['ndim']
5588  *     nboundary = headers['nboundary']
5589  */
5590   if (unlikely(__pyx_v_headers == Py_None)) {
5591     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
5592     __PYX_ERR(0, 96, __pyx_L1_error)
5593   }
5594   __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_headers, __pyx_n_s_numbl); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error)
5595   __Pyx_GOTREF(__pyx_t_1);
5596   __pyx_v_numbl = __pyx_t_1;
5597   __pyx_t_1 = 0;
5598 
5599   /* "yt/frontends/ramses/io_utils.pyx":97
5600  *
5601  *     numbl = headers['numbl']
5602  *     ndim = headers['ndim']             # <<<<<<<<<<<<<<
5603  *     nboundary = headers['nboundary']
5604  *     nlevelmax = headers['nlevelmax']
5605  */
5606   if (unlikely(__pyx_v_headers == Py_None)) {
5607     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
5608     __PYX_ERR(0, 97, __pyx_L1_error)
5609   }
5610   __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_headers, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
5611   __Pyx_GOTREF(__pyx_t_1);
5612   __pyx_t_2 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 97, __pyx_L1_error)
5613   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5614   __pyx_v_ndim = __pyx_t_2;
5615 
5616   /* "yt/frontends/ramses/io_utils.pyx":98
5617  *     numbl = headers['numbl']
5618  *     ndim = headers['ndim']
5619  *     nboundary = headers['nboundary']             # <<<<<<<<<<<<<<
5620  *     nlevelmax = headers['nlevelmax']
5621  *     n_levels = nlevelmax - min_level
5622  */
5623   if (unlikely(__pyx_v_headers == Py_None)) {
5624     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
5625     __PYX_ERR(0, 98, __pyx_L1_error)
5626   }
5627   __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_headers, __pyx_n_s_nboundary); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error)
5628   __Pyx_GOTREF(__pyx_t_1);
5629   __pyx_t_2 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L1_error)
5630   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5631   __pyx_v_nboundary = __pyx_t_2;
5632 
5633   /* "yt/frontends/ramses/io_utils.pyx":99
5634  *     ndim = headers['ndim']
5635  *     nboundary = headers['nboundary']
5636  *     nlevelmax = headers['nlevelmax']             # <<<<<<<<<<<<<<
5637  *     n_levels = nlevelmax - min_level
5638  *     ncpu = headers['ncpu']
5639  */
5640   if (unlikely(__pyx_v_headers == Py_None)) {
5641     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
5642     __PYX_ERR(0, 99, __pyx_L1_error)
5643   }
5644   __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_headers, __pyx_n_s_nlevelmax); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error)
5645   __Pyx_GOTREF(__pyx_t_1);
5646   __pyx_t_2 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 99, __pyx_L1_error)
5647   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5648   __pyx_v_nlevelmax = __pyx_t_2;
5649 
5650   /* "yt/frontends/ramses/io_utils.pyx":100
5651  *     nboundary = headers['nboundary']
5652  *     nlevelmax = headers['nlevelmax']
5653  *     n_levels = nlevelmax - min_level             # <<<<<<<<<<<<<<
5654  *     ncpu = headers['ncpu']
5655  *
5656  */
5657   __pyx_v_n_levels = (__pyx_v_nlevelmax - __pyx_v_min_level);
5658 
5659   /* "yt/frontends/ramses/io_utils.pyx":101
5660  *     nlevelmax = headers['nlevelmax']
5661  *     n_levels = nlevelmax - min_level
5662  *     ncpu = headers['ncpu']             # <<<<<<<<<<<<<<
5663  *
5664  *     ncpu_and_bound = nboundary + ncpu
5665  */
5666   if (unlikely(__pyx_v_headers == Py_None)) {
5667     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
5668     __PYX_ERR(0, 101, __pyx_L1_error)
5669   }
5670   __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_headers, __pyx_n_s_ncpu); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 101, __pyx_L1_error)
5671   __Pyx_GOTREF(__pyx_t_1);
5672   __pyx_t_2 = __Pyx_PyInt_As_npy_int64(__pyx_t_1); if (unlikely((__pyx_t_2 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 101, __pyx_L1_error)
5673   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5674   __pyx_v_ncpu = __pyx_t_2;
5675 
5676   /* "yt/frontends/ramses/io_utils.pyx":103
5677  *     ncpu = headers['ncpu']
5678  *
5679  *     ncpu_and_bound = nboundary + ncpu             # <<<<<<<<<<<<<<
5680  *     twotondim = 2**ndim
5681  *
5682  */
5683   __pyx_v_ncpu_and_bound = (__pyx_v_nboundary + __pyx_v_ncpu);
5684 
5685   /* "yt/frontends/ramses/io_utils.pyx":104
5686  *
5687  *     ncpu_and_bound = nboundary + ncpu
5688  *     twotondim = 2**ndim             # <<<<<<<<<<<<<<
5689  *
5690  *     skip_len = twotondim * nvar
5691  */
5692   __pyx_v_twotondim = __Pyx_pow___pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t(2, __pyx_v_ndim);
5693 
5694   /* "yt/frontends/ramses/io_utils.pyx":106
5695  *     twotondim = 2**ndim
5696  *
5697  *     skip_len = twotondim * nvar             # <<<<<<<<<<<<<<
5698  *
5699  *     # It goes: level, CPU, 8-variable (1 oct)
5700  */
5701   __pyx_v_skip_len = (__pyx_v_twotondim * __pyx_v_nvar);
5702 
5703   /* "yt/frontends/ramses/io_utils.pyx":109
5704  *
5705  *     # It goes: level, CPU, 8-variable (1 oct)
5706  *     offset = np.full((ncpu_and_bound, n_levels), -1, dtype=np.int64)             # <<<<<<<<<<<<<<
5707  *     level_count = np.zeros((ncpu_and_bound, n_levels), dtype=np.int64)
5708  *
5709  */
5710   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error)
5711   __Pyx_GOTREF(__pyx_t_1);
5712   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_full); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 109, __pyx_L1_error)
5713   __Pyx_GOTREF(__pyx_t_3);
5714   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5715   __pyx_t_1 = __Pyx_PyInt_From_npy_int64(__pyx_v_ncpu_and_bound); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error)
5716   __Pyx_GOTREF(__pyx_t_1);
5717   __pyx_t_4 = __Pyx_PyInt_From_npy_int64(__pyx_v_n_levels); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 109, __pyx_L1_error)
5718   __Pyx_GOTREF(__pyx_t_4);
5719   __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 109, __pyx_L1_error)
5720   __Pyx_GOTREF(__pyx_t_5);
5721   __Pyx_GIVEREF(__pyx_t_1);
5722   PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
5723   __Pyx_GIVEREF(__pyx_t_4);
5724   PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
5725   __pyx_t_1 = 0;
5726   __pyx_t_4 = 0;
5727   __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 109, __pyx_L1_error)
5728   __Pyx_GOTREF(__pyx_t_4);
5729   __Pyx_GIVEREF(__pyx_t_5);
5730   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
5731   __Pyx_INCREF(__pyx_int_neg_1);
5732   __Pyx_GIVEREF(__pyx_int_neg_1);
5733   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_neg_1);
5734   __pyx_t_5 = 0;
5735   __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 109, __pyx_L1_error)
5736   __Pyx_GOTREF(__pyx_t_5);
5737   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error)
5738   __Pyx_GOTREF(__pyx_t_1);
5739   __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 109, __pyx_L1_error)
5740   __Pyx_GOTREF(__pyx_t_6);
5741   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5742   if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 109, __pyx_L1_error)
5743   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5744   __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 109, __pyx_L1_error)
5745   __Pyx_GOTREF(__pyx_t_6);
5746   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5747   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5748   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5749   if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 109, __pyx_L1_error)
5750   __pyx_t_7 = ((PyArrayObject *)__pyx_t_6);
5751   {
5752     __Pyx_BufFmt_StackElem __pyx_stack[1];
5753     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_offset.rcbuffer->pybuffer);
5754     __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_offset.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
5755     if (unlikely(__pyx_t_8 < 0)) {
5756       PyErr_Fetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
5757       if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_offset.rcbuffer->pybuffer, (PyObject*)__pyx_v_offset, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
5758         Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11);
5759         __Pyx_RaiseBufferFallbackError();
5760       } else {
5761         PyErr_Restore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
5762       }
5763       __pyx_t_9 = __pyx_t_10 = __pyx_t_11 = 0;
5764     }
5765     __pyx_pybuffernd_offset.diminfo[0].strides = __pyx_pybuffernd_offset.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_offset.diminfo[0].shape = __pyx_pybuffernd_offset.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_offset.diminfo[1].strides = __pyx_pybuffernd_offset.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_offset.diminfo[1].shape = __pyx_pybuffernd_offset.rcbuffer->pybuffer.shape[1];
5766     if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 109, __pyx_L1_error)
5767   }
5768   __pyx_t_7 = 0;
5769   __pyx_v_offset = ((PyArrayObject *)__pyx_t_6);
5770   __pyx_t_6 = 0;
5771 
5772   /* "yt/frontends/ramses/io_utils.pyx":110
5773  *     # It goes: level, CPU, 8-variable (1 oct)
5774  *     offset = np.full((ncpu_and_bound, n_levels), -1, dtype=np.int64)
5775  *     level_count = np.zeros((ncpu_and_bound, n_levels), dtype=np.int64)             # <<<<<<<<<<<<<<
5776  *
5777  *     cdef np.int64_t[:, ::1] level_count_view = level_count
5778  */
5779   __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 110, __pyx_L1_error)
5780   __Pyx_GOTREF(__pyx_t_6);
5781   __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 110, __pyx_L1_error)
5782   __Pyx_GOTREF(__pyx_t_5);
5783   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5784   __pyx_t_6 = __Pyx_PyInt_From_npy_int64(__pyx_v_ncpu_and_bound); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 110, __pyx_L1_error)
5785   __Pyx_GOTREF(__pyx_t_6);
5786   __pyx_t_4 = __Pyx_PyInt_From_npy_int64(__pyx_v_n_levels); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 110, __pyx_L1_error)
5787   __Pyx_GOTREF(__pyx_t_4);
5788   __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 110, __pyx_L1_error)
5789   __Pyx_GOTREF(__pyx_t_3);
5790   __Pyx_GIVEREF(__pyx_t_6);
5791   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
5792   __Pyx_GIVEREF(__pyx_t_4);
5793   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
5794   __pyx_t_6 = 0;
5795   __pyx_t_4 = 0;
5796   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 110, __pyx_L1_error)
5797   __Pyx_GOTREF(__pyx_t_4);
5798   __Pyx_GIVEREF(__pyx_t_3);
5799   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
5800   __pyx_t_3 = 0;
5801   __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 110, __pyx_L1_error)
5802   __Pyx_GOTREF(__pyx_t_3);
5803   __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 110, __pyx_L1_error)
5804   __Pyx_GOTREF(__pyx_t_6);
5805   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error)
5806   __Pyx_GOTREF(__pyx_t_1);
5807   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5808   if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 110, __pyx_L1_error)
5809   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5810   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error)
5811   __Pyx_GOTREF(__pyx_t_1);
5812   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5813   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5814   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5815   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 110, __pyx_L1_error)
5816   __pyx_t_7 = ((PyArrayObject *)__pyx_t_1);
5817   {
5818     __Pyx_BufFmt_StackElem __pyx_stack[1];
5819     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_level_count.rcbuffer->pybuffer);
5820     __pyx_t_8 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_level_count.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
5821     if (unlikely(__pyx_t_8 < 0)) {
5822       PyErr_Fetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
5823       if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_level_count.rcbuffer->pybuffer, (PyObject*)__pyx_v_level_count, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
5824         Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_9);
5825         __Pyx_RaiseBufferFallbackError();
5826       } else {
5827         PyErr_Restore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
5828       }
5829       __pyx_t_11 = __pyx_t_10 = __pyx_t_9 = 0;
5830     }
5831     __pyx_pybuffernd_level_count.diminfo[0].strides = __pyx_pybuffernd_level_count.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_level_count.diminfo[0].shape = __pyx_pybuffernd_level_count.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_level_count.diminfo[1].strides = __pyx_pybuffernd_level_count.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_level_count.diminfo[1].shape = __pyx_pybuffernd_level_count.rcbuffer->pybuffer.shape[1];
5832     if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 110, __pyx_L1_error)
5833   }
5834   __pyx_t_7 = 0;
5835   __pyx_v_level_count = ((PyArrayObject *)__pyx_t_1);
5836   __pyx_t_1 = 0;
5837 
5838   /* "yt/frontends/ramses/io_utils.pyx":112
5839  *     level_count = np.zeros((ncpu_and_bound, n_levels), dtype=np.int64)
5840  *
5841  *     cdef np.int64_t[:, ::1] level_count_view = level_count             # <<<<<<<<<<<<<<
5842  *     cdef np.int64_t[:, ::1] offset_view = offset
5843  *
5844  */
5845   __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_level_count), PyBUF_WRITABLE); if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 112, __pyx_L1_error)
5846   __pyx_v_level_count_view = __pyx_t_12;
5847   __pyx_t_12.memview = NULL;
5848   __pyx_t_12.data = NULL;
5849 
5850   /* "yt/frontends/ramses/io_utils.pyx":113
5851  *
5852  *     cdef np.int64_t[:, ::1] level_count_view = level_count
5853  *     cdef np.int64_t[:, ::1] offset_view = offset             # <<<<<<<<<<<<<<
5854  *
5855  *     for ilevel in range(nlevelmax):
5856  */
5857   __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_int64_t(((PyObject *)__pyx_v_offset), PyBUF_WRITABLE); if (unlikely(!__pyx_t_12.memview)) __PYX_ERR(0, 113, __pyx_L1_error)
5858   __pyx_v_offset_view = __pyx_t_12;
5859   __pyx_t_12.memview = NULL;
5860   __pyx_t_12.data = NULL;
5861 
5862   /* "yt/frontends/ramses/io_utils.pyx":115
5863  *     cdef np.int64_t[:, ::1] offset_view = offset
5864  *
5865  *     for ilevel in range(nlevelmax):             # <<<<<<<<<<<<<<
5866  *         for icpu in range(ncpu_and_bound):
5867  *             file_ilevel = f.read_int()
5868  */
5869   __pyx_t_2 = __pyx_v_nlevelmax;
5870   __pyx_t_13 = __pyx_t_2;
5871   for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
5872     __pyx_v_ilevel = __pyx_t_14;
5873 
5874     /* "yt/frontends/ramses/io_utils.pyx":116
5875  *
5876  *     for ilevel in range(nlevelmax):
5877  *         for icpu in range(ncpu_and_bound):             # <<<<<<<<<<<<<<
5878  *             file_ilevel = f.read_int()
5879  *             file_ncache = f.read_int()
5880  */
5881     __pyx_t_15 = __pyx_v_ncpu_and_bound;
5882     __pyx_t_16 = __pyx_t_15;
5883     for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
5884       __pyx_v_icpu = __pyx_t_17;
5885 
5886       /* "yt/frontends/ramses/io_utils.pyx":117
5887  *     for ilevel in range(nlevelmax):
5888  *         for icpu in range(ncpu_and_bound):
5889  *             file_ilevel = f.read_int()             # <<<<<<<<<<<<<<
5890  *             file_ncache = f.read_int()
5891  *             if file_ncache == 0:
5892  */
5893       __pyx_t_18 = ((struct __pyx_vtabstruct_2yt_9utilities_20cython_fortran_utils_FortranFile *)__pyx_v_f->__pyx_vtab)->read_int(__pyx_v_f, 0); if (unlikely(__pyx_t_18 == ((__pyx_t_2yt_9utilities_20cython_fortran_utils_INT32_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 117, __pyx_L1_error)
5894       __pyx_v_file_ilevel = __pyx_t_18;
5895 
5896       /* "yt/frontends/ramses/io_utils.pyx":118
5897  *         for icpu in range(ncpu_and_bound):
5898  *             file_ilevel = f.read_int()
5899  *             file_ncache = f.read_int()             # <<<<<<<<<<<<<<
5900  *             if file_ncache == 0:
5901  *                 continue
5902  */
5903       __pyx_t_18 = ((struct __pyx_vtabstruct_2yt_9utilities_20cython_fortran_utils_FortranFile *)__pyx_v_f->__pyx_vtab)->read_int(__pyx_v_f, 0); if (unlikely(__pyx_t_18 == ((__pyx_t_2yt_9utilities_20cython_fortran_utils_INT32_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 118, __pyx_L1_error)
5904       __pyx_v_file_ncache = __pyx_t_18;
5905 
5906       /* "yt/frontends/ramses/io_utils.pyx":119
5907  *             file_ilevel = f.read_int()
5908  *             file_ncache = f.read_int()
5909  *             if file_ncache == 0:             # <<<<<<<<<<<<<<
5910  *                 continue
5911  *
5912  */
5913       __pyx_t_19 = ((__pyx_v_file_ncache == 0) != 0);
5914       if (__pyx_t_19) {
5915 
5916         /* "yt/frontends/ramses/io_utils.pyx":120
5917  *             file_ncache = f.read_int()
5918  *             if file_ncache == 0:
5919  *                 continue             # <<<<<<<<<<<<<<
5920  *
5921  *             if file_ilevel != ilevel+1:
5922  */
5923         goto __pyx_L5_continue;
5924 
5925         /* "yt/frontends/ramses/io_utils.pyx":119
5926  *             file_ilevel = f.read_int()
5927  *             file_ncache = f.read_int()
5928  *             if file_ncache == 0:             # <<<<<<<<<<<<<<
5929  *                 continue
5930  *
5931  */
5932       }
5933 
5934       /* "yt/frontends/ramses/io_utils.pyx":122
5935  *                 continue
5936  *
5937  *             if file_ilevel != ilevel+1:             # <<<<<<<<<<<<<<
5938  *                 raise YTIllDefinedAMRData(
5939  *                     'Cannot read offsets in file %s. The level read '
5940  */
5941       __pyx_t_19 = ((__pyx_v_file_ilevel != (__pyx_v_ilevel + 1)) != 0);
5942       if (unlikely(__pyx_t_19)) {
5943 
5944         /* "yt/frontends/ramses/io_utils.pyx":123
5945  *
5946  *             if file_ilevel != ilevel+1:
5947  *                 raise YTIllDefinedAMRData(             # <<<<<<<<<<<<<<
5948  *                     'Cannot read offsets in file %s. The level read '
5949  *                     'from data (%s) is not coherent with the expected (%s)',
5950  */
5951         __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_YTIllDefinedAMRData); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error)
5952         __Pyx_GOTREF(__pyx_t_3);
5953 
5954         /* "yt/frontends/ramses/io_utils.pyx":126
5955  *                     'Cannot read offsets in file %s. The level read '
5956  *                     'from data (%s) is not coherent with the expected (%s)',
5957  *                     f.name, file_ilevel, ilevel)             # <<<<<<<<<<<<<<
5958  *
5959  *             if ilevel >= min_level:
5960  */
5961         __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_f), __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error)
5962         __Pyx_GOTREF(__pyx_t_4);
5963         __pyx_t_5 = __Pyx_PyInt_From_npy_int32(__pyx_v_file_ilevel); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 126, __pyx_L1_error)
5964         __Pyx_GOTREF(__pyx_t_5);
5965         __pyx_t_6 = __Pyx_PyInt_From_npy_int64(__pyx_v_ilevel); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 126, __pyx_L1_error)
5966         __Pyx_GOTREF(__pyx_t_6);
5967         __pyx_t_20 = NULL;
5968         __pyx_t_8 = 0;
5969         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
5970           __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_3);
5971           if (likely(__pyx_t_20)) {
5972             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
5973             __Pyx_INCREF(__pyx_t_20);
5974             __Pyx_INCREF(function);
5975             __Pyx_DECREF_SET(__pyx_t_3, function);
5976             __pyx_t_8 = 1;
5977           }
5978         }
5979         #if CYTHON_FAST_PYCALL
5980         if (PyFunction_Check(__pyx_t_3)) {
5981           PyObject *__pyx_temp[5] = {__pyx_t_20, __pyx_kp_s_Cannot_read_offsets_in_file_s_Th, __pyx_t_4, __pyx_t_5, __pyx_t_6};
5982           __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error)
5983           __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
5984           __Pyx_GOTREF(__pyx_t_1);
5985           __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5986           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5987           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5988         } else
5989         #endif
5990         #if CYTHON_FAST_PYCCALL
5991         if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
5992           PyObject *__pyx_temp[5] = {__pyx_t_20, __pyx_kp_s_Cannot_read_offsets_in_file_s_Th, __pyx_t_4, __pyx_t_5, __pyx_t_6};
5993           __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error)
5994           __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
5995           __Pyx_GOTREF(__pyx_t_1);
5996           __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5997           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5998           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5999         } else
6000         #endif
6001         {
6002           __pyx_t_21 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 123, __pyx_L1_error)
6003           __Pyx_GOTREF(__pyx_t_21);
6004           if (__pyx_t_20) {
6005             __Pyx_GIVEREF(__pyx_t_20); PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_20); __pyx_t_20 = NULL;
6006           }
6007           __Pyx_INCREF(__pyx_kp_s_Cannot_read_offsets_in_file_s_Th);
6008           __Pyx_GIVEREF(__pyx_kp_s_Cannot_read_offsets_in_file_s_Th);
6009           PyTuple_SET_ITEM(__pyx_t_21, 0+__pyx_t_8, __pyx_kp_s_Cannot_read_offsets_in_file_s_Th);
6010           __Pyx_GIVEREF(__pyx_t_4);
6011           PyTuple_SET_ITEM(__pyx_t_21, 1+__pyx_t_8, __pyx_t_4);
6012           __Pyx_GIVEREF(__pyx_t_5);
6013           PyTuple_SET_ITEM(__pyx_t_21, 2+__pyx_t_8, __pyx_t_5);
6014           __Pyx_GIVEREF(__pyx_t_6);
6015           PyTuple_SET_ITEM(__pyx_t_21, 3+__pyx_t_8, __pyx_t_6);
6016           __pyx_t_4 = 0;
6017           __pyx_t_5 = 0;
6018           __pyx_t_6 = 0;
6019           __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_21, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error)
6020           __Pyx_GOTREF(__pyx_t_1);
6021           __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
6022         }
6023         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6024         __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6025         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6026         __PYX_ERR(0, 123, __pyx_L1_error)
6027 
6028         /* "yt/frontends/ramses/io_utils.pyx":122
6029  *                 continue
6030  *
6031  *             if file_ilevel != ilevel+1:             # <<<<<<<<<<<<<<
6032  *                 raise YTIllDefinedAMRData(
6033  *                     'Cannot read offsets in file %s. The level read '
6034  */
6035       }
6036 
6037       /* "yt/frontends/ramses/io_utils.pyx":128
6038  *                     f.name, file_ilevel, ilevel)
6039  *
6040  *             if ilevel >= min_level:             # <<<<<<<<<<<<<<
6041  *                 offset_view[icpu, ilevel - min_level] = f.tell()
6042  *                 level_count_view[icpu, ilevel - min_level] = <INT64_t> file_ncache
6043  */
6044       __pyx_t_19 = ((__pyx_v_ilevel >= __pyx_v_min_level) != 0);
6045       if (__pyx_t_19) {
6046 
6047         /* "yt/frontends/ramses/io_utils.pyx":129
6048  *
6049  *             if ilevel >= min_level:
6050  *                 offset_view[icpu, ilevel - min_level] = f.tell()             # <<<<<<<<<<<<<<
6051  *                 level_count_view[icpu, ilevel - min_level] = <INT64_t> file_ncache
6052  *             f.skip(skip_len)
6053  */
6054         __pyx_t_22 = ((struct __pyx_vtabstruct_2yt_9utilities_20cython_fortran_utils_FortranFile *)__pyx_v_f->__pyx_vtab)->tell(__pyx_v_f, 0); if (unlikely(__pyx_t_22 == ((__pyx_t_2yt_9utilities_20cython_fortran_utils_INT64_t)-1LL))) __PYX_ERR(0, 129, __pyx_L1_error)
6055         __pyx_t_23 = __pyx_v_icpu;
6056         __pyx_t_24 = (__pyx_v_ilevel - __pyx_v_min_level);
6057         *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ ((char *) (((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_offset_view.data + __pyx_t_23 * __pyx_v_offset_view.strides[0]) )) + __pyx_t_24)) )) = __pyx_t_22;
6058 
6059         /* "yt/frontends/ramses/io_utils.pyx":130
6060  *             if ilevel >= min_level:
6061  *                 offset_view[icpu, ilevel - min_level] = f.tell()
6062  *                 level_count_view[icpu, ilevel - min_level] = <INT64_t> file_ncache             # <<<<<<<<<<<<<<
6063  *             f.skip(skip_len)
6064  *
6065  */
6066         __pyx_t_25 = __pyx_v_icpu;
6067         __pyx_t_26 = (__pyx_v_ilevel - __pyx_v_min_level);
6068         *((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ ((char *) (((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_level_count_view.data + __pyx_t_25 * __pyx_v_level_count_view.strides[0]) )) + __pyx_t_26)) )) = ((__pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t)__pyx_v_file_ncache);
6069 
6070         /* "yt/frontends/ramses/io_utils.pyx":128
6071  *                     f.name, file_ilevel, ilevel)
6072  *
6073  *             if ilevel >= min_level:             # <<<<<<<<<<<<<<
6074  *                 offset_view[icpu, ilevel - min_level] = f.tell()
6075  *                 level_count_view[icpu, ilevel - min_level] = <INT64_t> file_ncache
6076  */
6077       }
6078 
6079       /* "yt/frontends/ramses/io_utils.pyx":131
6080  *                 offset_view[icpu, ilevel - min_level] = f.tell()
6081  *                 level_count_view[icpu, ilevel - min_level] = <INT64_t> file_ncache
6082  *             f.skip(skip_len)             # <<<<<<<<<<<<<<
6083  *
6084  *     return offset, level_count
6085  */
6086       __pyx_t_27.__pyx_n = 1;
6087       __pyx_t_27.n = __pyx_v_skip_len;
6088       __pyx_t_22 = ((struct __pyx_vtabstruct_2yt_9utilities_20cython_fortran_utils_FortranFile *)__pyx_v_f->__pyx_vtab)->skip(__pyx_v_f, 0, &__pyx_t_27); if (unlikely(__pyx_t_22 == ((__pyx_t_2yt_9utilities_20cython_fortran_utils_INT64_t)-1LL))) __PYX_ERR(0, 131, __pyx_L1_error)
6089       __pyx_L5_continue:;
6090     }
6091   }
6092 
6093   /* "yt/frontends/ramses/io_utils.pyx":133
6094  *             f.skip(skip_len)
6095  *
6096  *     return offset, level_count             # <<<<<<<<<<<<<<
6097  *
6098  * @cython.boundscheck(False)
6099  */
6100   __Pyx_XDECREF(__pyx_r);
6101   __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 133, __pyx_L1_error)
6102   __Pyx_GOTREF(__pyx_t_1);
6103   __Pyx_INCREF(((PyObject *)__pyx_v_offset));
6104   __Pyx_GIVEREF(((PyObject *)__pyx_v_offset));
6105   PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_offset));
6106   __Pyx_INCREF(((PyObject *)__pyx_v_level_count));
6107   __Pyx_GIVEREF(((PyObject *)__pyx_v_level_count));
6108   PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_level_count));
6109   __pyx_r = __pyx_t_1;
6110   __pyx_t_1 = 0;
6111   goto __pyx_L0;
6112 
6113   /* "yt/frontends/ramses/io_utils.pyx":89
6114  * @cython.cdivision(True)
6115  * @cython.nonecheck(False)
6116  * cpdef read_offset(FortranFile f, INT64_t min_level, INT64_t domain_id, INT64_t nvar, dict headers):             # <<<<<<<<<<<<<<
6117  *
6118  *     cdef np.ndarray[np.int64_t, ndim=2] offset, level_count
6119  */
6120 
6121   /* function exit code */
6122   __pyx_L1_error:;
6123   __Pyx_XDECREF(__pyx_t_1);
6124   __Pyx_XDECREF(__pyx_t_3);
6125   __Pyx_XDECREF(__pyx_t_4);
6126   __Pyx_XDECREF(__pyx_t_5);
6127   __Pyx_XDECREF(__pyx_t_6);
6128   __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);
6129   __Pyx_XDECREF(__pyx_t_20);
6130   __Pyx_XDECREF(__pyx_t_21);
6131   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
6132     __Pyx_PyThreadState_declare
6133     __Pyx_PyThreadState_assign
6134     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
6135     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_level_count.rcbuffer->pybuffer);
6136     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_offset.rcbuffer->pybuffer);
6137   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
6138   __Pyx_AddTraceback("yt.frontends.ramses.io_utils.read_offset", __pyx_clineno, __pyx_lineno, __pyx_filename);
6139   __pyx_r = 0;
6140   goto __pyx_L2;
6141   __pyx_L0:;
6142   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_level_count.rcbuffer->pybuffer);
6143   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_offset.rcbuffer->pybuffer);
6144   __pyx_L2:;
6145   __Pyx_XDECREF((PyObject *)__pyx_v_offset);
6146   __Pyx_XDECREF((PyObject *)__pyx_v_level_count);
6147   __Pyx_XDECREF(__pyx_v_numbl);
6148   __PYX_XDEC_MEMVIEW(&__pyx_v_level_count_view, 1);
6149   __PYX_XDEC_MEMVIEW(&__pyx_v_offset_view, 1);
6150   __Pyx_XGIVEREF(__pyx_r);
6151   __Pyx_RefNannyFinishContext();
6152   return __pyx_r;
6153 }
6154 
6155 /* Python wrapper */
6156 static PyObject *__pyx_pw_2yt_9frontends_6ramses_8io_utils_3read_offset(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2yt_9frontends_6ramses_8io_utils_3read_offset(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)6157 static PyObject *__pyx_pw_2yt_9frontends_6ramses_8io_utils_3read_offset(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6158   struct __pyx_obj_2yt_9utilities_20cython_fortran_utils_FortranFile *__pyx_v_f = 0;
6159   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_v_min_level;
6160   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_v_domain_id;
6161   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_v_nvar;
6162   PyObject *__pyx_v_headers = 0;
6163   PyObject *__pyx_r = 0;
6164   __Pyx_RefNannyDeclarations
6165   __Pyx_RefNannySetupContext("read_offset (wrapper)", 0);
6166   {
6167     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_f,&__pyx_n_s_min_level,&__pyx_n_s_domain_id,&__pyx_n_s_nvar,&__pyx_n_s_headers,0};
6168     PyObject* values[5] = {0,0,0,0,0};
6169     if (unlikely(__pyx_kwds)) {
6170       Py_ssize_t kw_args;
6171       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6172       switch (pos_args) {
6173         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6174         CYTHON_FALLTHROUGH;
6175         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6176         CYTHON_FALLTHROUGH;
6177         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6178         CYTHON_FALLTHROUGH;
6179         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6180         CYTHON_FALLTHROUGH;
6181         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6182         CYTHON_FALLTHROUGH;
6183         case  0: break;
6184         default: goto __pyx_L5_argtuple_error;
6185       }
6186       kw_args = PyDict_Size(__pyx_kwds);
6187       switch (pos_args) {
6188         case  0:
6189         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--;
6190         else goto __pyx_L5_argtuple_error;
6191         CYTHON_FALLTHROUGH;
6192         case  1:
6193         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_min_level)) != 0)) kw_args--;
6194         else {
6195           __Pyx_RaiseArgtupleInvalid("read_offset", 1, 5, 5, 1); __PYX_ERR(0, 89, __pyx_L3_error)
6196         }
6197         CYTHON_FALLTHROUGH;
6198         case  2:
6199         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_domain_id)) != 0)) kw_args--;
6200         else {
6201           __Pyx_RaiseArgtupleInvalid("read_offset", 1, 5, 5, 2); __PYX_ERR(0, 89, __pyx_L3_error)
6202         }
6203         CYTHON_FALLTHROUGH;
6204         case  3:
6205         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nvar)) != 0)) kw_args--;
6206         else {
6207           __Pyx_RaiseArgtupleInvalid("read_offset", 1, 5, 5, 3); __PYX_ERR(0, 89, __pyx_L3_error)
6208         }
6209         CYTHON_FALLTHROUGH;
6210         case  4:
6211         if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_headers)) != 0)) kw_args--;
6212         else {
6213           __Pyx_RaiseArgtupleInvalid("read_offset", 1, 5, 5, 4); __PYX_ERR(0, 89, __pyx_L3_error)
6214         }
6215       }
6216       if (unlikely(kw_args > 0)) {
6217         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_offset") < 0)) __PYX_ERR(0, 89, __pyx_L3_error)
6218       }
6219     } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
6220       goto __pyx_L5_argtuple_error;
6221     } else {
6222       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6223       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6224       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6225       values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6226       values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6227     }
6228     __pyx_v_f = ((struct __pyx_obj_2yt_9utilities_20cython_fortran_utils_FortranFile *)values[0]);
6229     __pyx_v_min_level = __Pyx_PyInt_As_npy_int64(values[1]); if (unlikely((__pyx_v_min_level == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 89, __pyx_L3_error)
6230     __pyx_v_domain_id = __Pyx_PyInt_As_npy_int64(values[2]); if (unlikely((__pyx_v_domain_id == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 89, __pyx_L3_error)
6231     __pyx_v_nvar = __Pyx_PyInt_As_npy_int64(values[3]); if (unlikely((__pyx_v_nvar == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 89, __pyx_L3_error)
6232     __pyx_v_headers = ((PyObject*)values[4]);
6233   }
6234   goto __pyx_L4_argument_unpacking_done;
6235   __pyx_L5_argtuple_error:;
6236   __Pyx_RaiseArgtupleInvalid("read_offset", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 89, __pyx_L3_error)
6237   __pyx_L3_error:;
6238   __Pyx_AddTraceback("yt.frontends.ramses.io_utils.read_offset", __pyx_clineno, __pyx_lineno, __pyx_filename);
6239   __Pyx_RefNannyFinishContext();
6240   return NULL;
6241   __pyx_L4_argument_unpacking_done:;
6242   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_2yt_9utilities_20cython_fortran_utils_FortranFile, 1, "f", 0))) __PYX_ERR(0, 89, __pyx_L1_error)
6243   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_headers), (&PyDict_Type), 1, "headers", 1))) __PYX_ERR(0, 89, __pyx_L1_error)
6244   __pyx_r = __pyx_pf_2yt_9frontends_6ramses_8io_utils_2read_offset(__pyx_self, __pyx_v_f, __pyx_v_min_level, __pyx_v_domain_id, __pyx_v_nvar, __pyx_v_headers);
6245 
6246   /* function exit code */
6247   goto __pyx_L0;
6248   __pyx_L1_error:;
6249   __pyx_r = NULL;
6250   __pyx_L0:;
6251   __Pyx_RefNannyFinishContext();
6252   return __pyx_r;
6253 }
6254 
__pyx_pf_2yt_9frontends_6ramses_8io_utils_2read_offset(CYTHON_UNUSED PyObject * __pyx_self,struct __pyx_obj_2yt_9utilities_20cython_fortran_utils_FortranFile * __pyx_v_f,__pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_v_min_level,__pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_v_domain_id,__pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_v_nvar,PyObject * __pyx_v_headers)6255 static PyObject *__pyx_pf_2yt_9frontends_6ramses_8io_utils_2read_offset(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_2yt_9utilities_20cython_fortran_utils_FortranFile *__pyx_v_f, __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_v_min_level, __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_v_domain_id, __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_v_nvar, PyObject *__pyx_v_headers) {
6256   PyObject *__pyx_r = NULL;
6257   __Pyx_RefNannyDeclarations
6258   PyObject *__pyx_t_1 = NULL;
6259   __Pyx_RefNannySetupContext("read_offset", 0);
6260   __Pyx_XDECREF(__pyx_r);
6261   __pyx_t_1 = __pyx_f_2yt_9frontends_6ramses_8io_utils_read_offset(__pyx_v_f, __pyx_v_min_level, __pyx_v_domain_id, __pyx_v_nvar, __pyx_v_headers, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error)
6262   __Pyx_GOTREF(__pyx_t_1);
6263   __pyx_r = __pyx_t_1;
6264   __pyx_t_1 = 0;
6265   goto __pyx_L0;
6266 
6267   /* function exit code */
6268   __pyx_L1_error:;
6269   __Pyx_XDECREF(__pyx_t_1);
6270   __Pyx_AddTraceback("yt.frontends.ramses.io_utils.read_offset", __pyx_clineno, __pyx_lineno, __pyx_filename);
6271   __pyx_r = NULL;
6272   __pyx_L0:;
6273   __Pyx_XGIVEREF(__pyx_r);
6274   __Pyx_RefNannyFinishContext();
6275   return __pyx_r;
6276 }
6277 
6278 /* "yt/frontends/ramses/io_utils.pyx":139
6279  * @cython.cdivision(True)
6280  * @cython.nonecheck(False)
6281  * def fill_hydro(FortranFile f,             # <<<<<<<<<<<<<<
6282  *                np.ndarray[np.int64_t, ndim=2] offsets,
6283  *                np.ndarray[np.int64_t, ndim=2] level_count,
6284  */
6285 
6286 /* Python wrapper */
6287 static PyObject *__pyx_pw_2yt_9frontends_6ramses_8io_utils_5fill_hydro(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6288 static PyMethodDef __pyx_mdef_2yt_9frontends_6ramses_8io_utils_5fill_hydro = {"fill_hydro", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2yt_9frontends_6ramses_8io_utils_5fill_hydro, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_2yt_9frontends_6ramses_8io_utils_5fill_hydro(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)6289 static PyObject *__pyx_pw_2yt_9frontends_6ramses_8io_utils_5fill_hydro(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6290   struct __pyx_obj_2yt_9utilities_20cython_fortran_utils_FortranFile *__pyx_v_f = 0;
6291   PyArrayObject *__pyx_v_offsets = 0;
6292   PyArrayObject *__pyx_v_level_count = 0;
6293   PyObject *__pyx_v_cpu_enumerator = 0;
6294   PyArrayObject *__pyx_v_levels = 0;
6295   PyArrayObject *__pyx_v_cell_inds = 0;
6296   PyArrayObject *__pyx_v_file_inds = 0;
6297   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_v_ndim;
6298   PyObject *__pyx_v_all_fields = 0;
6299   PyObject *__pyx_v_fields = 0;
6300   PyObject *__pyx_v_tr = 0;
6301   struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer *__pyx_v_oct_handler = 0;
6302   PyArrayObject *__pyx_v_domains = 0;
6303   PyObject *__pyx_r = 0;
6304   __Pyx_RefNannyDeclarations
6305   __Pyx_RefNannySetupContext("fill_hydro (wrapper)", 0);
6306   {
6307     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_f,&__pyx_n_s_offsets,&__pyx_n_s_level_count,&__pyx_n_s_cpu_enumerator,&__pyx_n_s_levels,&__pyx_n_s_cell_inds,&__pyx_n_s_file_inds,&__pyx_n_s_ndim,&__pyx_n_s_all_fields,&__pyx_n_s_fields,&__pyx_n_s_tr,&__pyx_n_s_oct_handler,&__pyx_n_s_domains,0};
6308     PyObject* values[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0};
6309     values[12] = (PyObject *)__pyx_k__4;
6310     if (unlikely(__pyx_kwds)) {
6311       Py_ssize_t kw_args;
6312       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6313       switch (pos_args) {
6314         case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
6315         CYTHON_FALLTHROUGH;
6316         case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
6317         CYTHON_FALLTHROUGH;
6318         case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
6319         CYTHON_FALLTHROUGH;
6320         case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
6321         CYTHON_FALLTHROUGH;
6322         case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
6323         CYTHON_FALLTHROUGH;
6324         case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
6325         CYTHON_FALLTHROUGH;
6326         case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6327         CYTHON_FALLTHROUGH;
6328         case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6329         CYTHON_FALLTHROUGH;
6330         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6331         CYTHON_FALLTHROUGH;
6332         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6333         CYTHON_FALLTHROUGH;
6334         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6335         CYTHON_FALLTHROUGH;
6336         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6337         CYTHON_FALLTHROUGH;
6338         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6339         CYTHON_FALLTHROUGH;
6340         case  0: break;
6341         default: goto __pyx_L5_argtuple_error;
6342       }
6343       kw_args = PyDict_Size(__pyx_kwds);
6344       switch (pos_args) {
6345         case  0:
6346         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--;
6347         else goto __pyx_L5_argtuple_error;
6348         CYTHON_FALLTHROUGH;
6349         case  1:
6350         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_offsets)) != 0)) kw_args--;
6351         else {
6352           __Pyx_RaiseArgtupleInvalid("fill_hydro", 0, 12, 13, 1); __PYX_ERR(0, 139, __pyx_L3_error)
6353         }
6354         CYTHON_FALLTHROUGH;
6355         case  2:
6356         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level_count)) != 0)) kw_args--;
6357         else {
6358           __Pyx_RaiseArgtupleInvalid("fill_hydro", 0, 12, 13, 2); __PYX_ERR(0, 139, __pyx_L3_error)
6359         }
6360         CYTHON_FALLTHROUGH;
6361         case  3:
6362         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cpu_enumerator)) != 0)) kw_args--;
6363         else {
6364           __Pyx_RaiseArgtupleInvalid("fill_hydro", 0, 12, 13, 3); __PYX_ERR(0, 139, __pyx_L3_error)
6365         }
6366         CYTHON_FALLTHROUGH;
6367         case  4:
6368         if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_levels)) != 0)) kw_args--;
6369         else {
6370           __Pyx_RaiseArgtupleInvalid("fill_hydro", 0, 12, 13, 4); __PYX_ERR(0, 139, __pyx_L3_error)
6371         }
6372         CYTHON_FALLTHROUGH;
6373         case  5:
6374         if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cell_inds)) != 0)) kw_args--;
6375         else {
6376           __Pyx_RaiseArgtupleInvalid("fill_hydro", 0, 12, 13, 5); __PYX_ERR(0, 139, __pyx_L3_error)
6377         }
6378         CYTHON_FALLTHROUGH;
6379         case  6:
6380         if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_file_inds)) != 0)) kw_args--;
6381         else {
6382           __Pyx_RaiseArgtupleInvalid("fill_hydro", 0, 12, 13, 6); __PYX_ERR(0, 139, __pyx_L3_error)
6383         }
6384         CYTHON_FALLTHROUGH;
6385         case  7:
6386         if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ndim)) != 0)) kw_args--;
6387         else {
6388           __Pyx_RaiseArgtupleInvalid("fill_hydro", 0, 12, 13, 7); __PYX_ERR(0, 139, __pyx_L3_error)
6389         }
6390         CYTHON_FALLTHROUGH;
6391         case  8:
6392         if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_all_fields)) != 0)) kw_args--;
6393         else {
6394           __Pyx_RaiseArgtupleInvalid("fill_hydro", 0, 12, 13, 8); __PYX_ERR(0, 139, __pyx_L3_error)
6395         }
6396         CYTHON_FALLTHROUGH;
6397         case  9:
6398         if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fields)) != 0)) kw_args--;
6399         else {
6400           __Pyx_RaiseArgtupleInvalid("fill_hydro", 0, 12, 13, 9); __PYX_ERR(0, 139, __pyx_L3_error)
6401         }
6402         CYTHON_FALLTHROUGH;
6403         case 10:
6404         if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tr)) != 0)) kw_args--;
6405         else {
6406           __Pyx_RaiseArgtupleInvalid("fill_hydro", 0, 12, 13, 10); __PYX_ERR(0, 139, __pyx_L3_error)
6407         }
6408         CYTHON_FALLTHROUGH;
6409         case 11:
6410         if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_oct_handler)) != 0)) kw_args--;
6411         else {
6412           __Pyx_RaiseArgtupleInvalid("fill_hydro", 0, 12, 13, 11); __PYX_ERR(0, 139, __pyx_L3_error)
6413         }
6414         CYTHON_FALLTHROUGH;
6415         case 12:
6416         if (kw_args > 0) {
6417           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_domains);
6418           if (value) { values[12] = value; kw_args--; }
6419         }
6420       }
6421       if (unlikely(kw_args > 0)) {
6422         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fill_hydro") < 0)) __PYX_ERR(0, 139, __pyx_L3_error)
6423       }
6424     } else {
6425       switch (PyTuple_GET_SIZE(__pyx_args)) {
6426         case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
6427         CYTHON_FALLTHROUGH;
6428         case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
6429         values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
6430         values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
6431         values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
6432         values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
6433         values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6434         values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6435         values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6436         values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6437         values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6438         values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6439         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6440         break;
6441         default: goto __pyx_L5_argtuple_error;
6442       }
6443     }
6444     __pyx_v_f = ((struct __pyx_obj_2yt_9utilities_20cython_fortran_utils_FortranFile *)values[0]);
6445     __pyx_v_offsets = ((PyArrayObject *)values[1]);
6446     __pyx_v_level_count = ((PyArrayObject *)values[2]);
6447     __pyx_v_cpu_enumerator = ((PyObject*)values[3]);
6448     __pyx_v_levels = ((PyArrayObject *)values[4]);
6449     __pyx_v_cell_inds = ((PyArrayObject *)values[5]);
6450     __pyx_v_file_inds = ((PyArrayObject *)values[6]);
6451     __pyx_v_ndim = __Pyx_PyInt_As_npy_int64(values[7]); if (unlikely((__pyx_v_ndim == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 146, __pyx_L3_error)
6452     __pyx_v_all_fields = ((PyObject*)values[8]);
6453     __pyx_v_fields = ((PyObject*)values[9]);
6454     __pyx_v_tr = ((PyObject*)values[10]);
6455     __pyx_v_oct_handler = ((struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer *)values[11]);
6456     __pyx_v_domains = ((PyArrayObject *)values[12]);
6457   }
6458   goto __pyx_L4_argument_unpacking_done;
6459   __pyx_L5_argtuple_error:;
6460   __Pyx_RaiseArgtupleInvalid("fill_hydro", 0, 12, 13, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 139, __pyx_L3_error)
6461   __pyx_L3_error:;
6462   __Pyx_AddTraceback("yt.frontends.ramses.io_utils.fill_hydro", __pyx_clineno, __pyx_lineno, __pyx_filename);
6463   __Pyx_RefNannyFinishContext();
6464   return NULL;
6465   __pyx_L4_argument_unpacking_done:;
6466   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_2yt_9utilities_20cython_fortran_utils_FortranFile, 1, "f", 0))) __PYX_ERR(0, 139, __pyx_L1_error)
6467   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_offsets), __pyx_ptype_5numpy_ndarray, 1, "offsets", 0))) __PYX_ERR(0, 140, __pyx_L1_error)
6468   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_level_count), __pyx_ptype_5numpy_ndarray, 1, "level_count", 0))) __PYX_ERR(0, 141, __pyx_L1_error)
6469   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cpu_enumerator), (&PyList_Type), 1, "cpu_enumerator", 1))) __PYX_ERR(0, 142, __pyx_L1_error)
6470   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_levels), __pyx_ptype_5numpy_ndarray, 1, "levels", 0))) __PYX_ERR(0, 143, __pyx_L1_error)
6471   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cell_inds), __pyx_ptype_5numpy_ndarray, 1, "cell_inds", 0))) __PYX_ERR(0, 144, __pyx_L1_error)
6472   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_file_inds), __pyx_ptype_5numpy_ndarray, 1, "file_inds", 0))) __PYX_ERR(0, 145, __pyx_L1_error)
6473   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_all_fields), (&PyList_Type), 1, "all_fields", 1))) __PYX_ERR(0, 146, __pyx_L1_error)
6474   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fields), (&PyList_Type), 1, "fields", 1))) __PYX_ERR(0, 146, __pyx_L1_error)
6475   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tr), (&PyDict_Type), 1, "tr", 1))) __PYX_ERR(0, 147, __pyx_L1_error)
6476   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_oct_handler), __pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer, 1, "oct_handler", 0))) __PYX_ERR(0, 148, __pyx_L1_error)
6477   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), __pyx_ptype_5numpy_ndarray, 1, "domains", 0))) __PYX_ERR(0, 149, __pyx_L1_error)
6478   __pyx_r = __pyx_pf_2yt_9frontends_6ramses_8io_utils_4fill_hydro(__pyx_self, __pyx_v_f, __pyx_v_offsets, __pyx_v_level_count, __pyx_v_cpu_enumerator, __pyx_v_levels, __pyx_v_cell_inds, __pyx_v_file_inds, __pyx_v_ndim, __pyx_v_all_fields, __pyx_v_fields, __pyx_v_tr, __pyx_v_oct_handler, __pyx_v_domains);
6479 
6480   /* function exit code */
6481   goto __pyx_L0;
6482   __pyx_L1_error:;
6483   __pyx_r = NULL;
6484   __pyx_L0:;
6485   __Pyx_RefNannyFinishContext();
6486   return __pyx_r;
6487 }
6488 
__pyx_pf_2yt_9frontends_6ramses_8io_utils_4fill_hydro(CYTHON_UNUSED PyObject * __pyx_self,struct __pyx_obj_2yt_9utilities_20cython_fortran_utils_FortranFile * __pyx_v_f,PyArrayObject * __pyx_v_offsets,PyArrayObject * __pyx_v_level_count,PyObject * __pyx_v_cpu_enumerator,PyArrayObject * __pyx_v_levels,PyArrayObject * __pyx_v_cell_inds,PyArrayObject * __pyx_v_file_inds,__pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_v_ndim,PyObject * __pyx_v_all_fields,PyObject * __pyx_v_fields,PyObject * __pyx_v_tr,struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer * __pyx_v_oct_handler,PyArrayObject * __pyx_v_domains)6489 static PyObject *__pyx_pf_2yt_9frontends_6ramses_8io_utils_4fill_hydro(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_2yt_9utilities_20cython_fortran_utils_FortranFile *__pyx_v_f, PyArrayObject *__pyx_v_offsets, PyArrayObject *__pyx_v_level_count, PyObject *__pyx_v_cpu_enumerator, PyArrayObject *__pyx_v_levels, PyArrayObject *__pyx_v_cell_inds, PyArrayObject *__pyx_v_file_inds, __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_v_ndim, PyObject *__pyx_v_all_fields, PyObject *__pyx_v_fields, PyObject *__pyx_v_tr, struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer *__pyx_v_oct_handler, PyArrayObject *__pyx_v_domains) {
6490   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_v_offset;
6491   PyObject *__pyx_v_tmp = 0;
6492   PyObject *__pyx_v_field = 0;
6493   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_v_twotondim;
6494   int __pyx_v_ilevel;
6495   int __pyx_v_icpu;
6496   int __pyx_v_ifield;
6497   int __pyx_v_nfields;
6498   int __pyx_v_nlevels;
6499   int __pyx_v_nc;
6500   int __pyx_v_ncpu_selected;
6501   PyArrayObject *__pyx_v_mask = 0;
6502   CYTHON_UNUSED npy_intp __pyx_v_ncpu;
6503   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_v_i;
6504   __Pyx_LocalBuf_ND __pyx_pybuffernd_cell_inds;
6505   __Pyx_Buffer __pyx_pybuffer_cell_inds;
6506   __Pyx_LocalBuf_ND __pyx_pybuffernd_domains;
6507   __Pyx_Buffer __pyx_pybuffer_domains;
6508   __Pyx_LocalBuf_ND __pyx_pybuffernd_file_inds;
6509   __Pyx_Buffer __pyx_pybuffer_file_inds;
6510   __Pyx_LocalBuf_ND __pyx_pybuffernd_level_count;
6511   __Pyx_Buffer __pyx_pybuffer_level_count;
6512   __Pyx_LocalBuf_ND __pyx_pybuffernd_levels;
6513   __Pyx_Buffer __pyx_pybuffer_levels;
6514   __Pyx_LocalBuf_ND __pyx_pybuffernd_mask;
6515   __Pyx_Buffer __pyx_pybuffer_mask;
6516   __Pyx_LocalBuf_ND __pyx_pybuffernd_offsets;
6517   __Pyx_Buffer __pyx_pybuffer_offsets;
6518   PyObject *__pyx_r = NULL;
6519   __Pyx_RefNannyDeclarations
6520   Py_ssize_t __pyx_t_1;
6521   PyObject *__pyx_t_2 = NULL;
6522   PyObject *__pyx_t_3 = NULL;
6523   PyObject *__pyx_t_4 = NULL;
6524   PyObject *__pyx_t_5 = NULL;
6525   int __pyx_t_6;
6526   PyObject *__pyx_t_7 = NULL;
6527   PyArrayObject *__pyx_t_8 = NULL;
6528   int __pyx_t_9;
6529   PyObject *__pyx_t_10 = NULL;
6530   PyObject *__pyx_t_11 = NULL;
6531   PyObject *__pyx_t_12 = NULL;
6532   int __pyx_t_13;
6533   int __pyx_t_14;
6534   int __pyx_t_15;
6535   Py_ssize_t __pyx_t_16;
6536   Py_ssize_t __pyx_t_17;
6537   Py_ssize_t __pyx_t_18;
6538   Py_ssize_t __pyx_t_19;
6539   __pyx_t_2yt_9utilities_20cython_fortran_utils_INT64_t __pyx_t_20;
6540   Py_ssize_t __pyx_t_21;
6541   PyObject *__pyx_t_22 = NULL;
6542   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_t_23;
6543   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_t_24;
6544   __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __pyx_t_25;
6545   int __pyx_t_26;
6546   int __pyx_t_27;
6547   Py_ssize_t __pyx_t_28;
6548   __Pyx_RefNannySetupContext("fill_hydro", 0);
6549   __pyx_pybuffer_mask.pybuffer.buf = NULL;
6550   __pyx_pybuffer_mask.refcount = 0;
6551   __pyx_pybuffernd_mask.data = NULL;
6552   __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask;
6553   __pyx_pybuffer_offsets.pybuffer.buf = NULL;
6554   __pyx_pybuffer_offsets.refcount = 0;
6555   __pyx_pybuffernd_offsets.data = NULL;
6556   __pyx_pybuffernd_offsets.rcbuffer = &__pyx_pybuffer_offsets;
6557   __pyx_pybuffer_level_count.pybuffer.buf = NULL;
6558   __pyx_pybuffer_level_count.refcount = 0;
6559   __pyx_pybuffernd_level_count.data = NULL;
6560   __pyx_pybuffernd_level_count.rcbuffer = &__pyx_pybuffer_level_count;
6561   __pyx_pybuffer_levels.pybuffer.buf = NULL;
6562   __pyx_pybuffer_levels.refcount = 0;
6563   __pyx_pybuffernd_levels.data = NULL;
6564   __pyx_pybuffernd_levels.rcbuffer = &__pyx_pybuffer_levels;
6565   __pyx_pybuffer_cell_inds.pybuffer.buf = NULL;
6566   __pyx_pybuffer_cell_inds.refcount = 0;
6567   __pyx_pybuffernd_cell_inds.data = NULL;
6568   __pyx_pybuffernd_cell_inds.rcbuffer = &__pyx_pybuffer_cell_inds;
6569   __pyx_pybuffer_file_inds.pybuffer.buf = NULL;
6570   __pyx_pybuffer_file_inds.refcount = 0;
6571   __pyx_pybuffernd_file_inds.data = NULL;
6572   __pyx_pybuffernd_file_inds.rcbuffer = &__pyx_pybuffer_file_inds;
6573   __pyx_pybuffer_domains.pybuffer.buf = NULL;
6574   __pyx_pybuffer_domains.refcount = 0;
6575   __pyx_pybuffernd_domains.data = NULL;
6576   __pyx_pybuffernd_domains.rcbuffer = &__pyx_pybuffer_domains;
6577   {
6578     __Pyx_BufFmt_StackElem __pyx_stack[1];
6579     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_offsets.rcbuffer->pybuffer, (PyObject*)__pyx_v_offsets, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 139, __pyx_L1_error)
6580   }
6581   __pyx_pybuffernd_offsets.diminfo[0].strides = __pyx_pybuffernd_offsets.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_offsets.diminfo[0].shape = __pyx_pybuffernd_offsets.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_offsets.diminfo[1].strides = __pyx_pybuffernd_offsets.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_offsets.diminfo[1].shape = __pyx_pybuffernd_offsets.rcbuffer->pybuffer.shape[1];
6582   {
6583     __Pyx_BufFmt_StackElem __pyx_stack[1];
6584     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_level_count.rcbuffer->pybuffer, (PyObject*)__pyx_v_level_count, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 139, __pyx_L1_error)
6585   }
6586   __pyx_pybuffernd_level_count.diminfo[0].strides = __pyx_pybuffernd_level_count.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_level_count.diminfo[0].shape = __pyx_pybuffernd_level_count.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_level_count.diminfo[1].strides = __pyx_pybuffernd_level_count.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_level_count.diminfo[1].shape = __pyx_pybuffernd_level_count.rcbuffer->pybuffer.shape[1];
6587   {
6588     __Pyx_BufFmt_StackElem __pyx_stack[1];
6589     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_levels.rcbuffer->pybuffer, (PyObject*)__pyx_v_levels, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 139, __pyx_L1_error)
6590   }
6591   __pyx_pybuffernd_levels.diminfo[0].strides = __pyx_pybuffernd_levels.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_levels.diminfo[0].shape = __pyx_pybuffernd_levels.rcbuffer->pybuffer.shape[0];
6592   {
6593     __Pyx_BufFmt_StackElem __pyx_stack[1];
6594     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_cell_inds.rcbuffer->pybuffer, (PyObject*)__pyx_v_cell_inds, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 139, __pyx_L1_error)
6595   }
6596   __pyx_pybuffernd_cell_inds.diminfo[0].strides = __pyx_pybuffernd_cell_inds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_cell_inds.diminfo[0].shape = __pyx_pybuffernd_cell_inds.rcbuffer->pybuffer.shape[0];
6597   {
6598     __Pyx_BufFmt_StackElem __pyx_stack[1];
6599     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_file_inds.rcbuffer->pybuffer, (PyObject*)__pyx_v_file_inds, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 139, __pyx_L1_error)
6600   }
6601   __pyx_pybuffernd_file_inds.diminfo[0].strides = __pyx_pybuffernd_file_inds.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_file_inds.diminfo[0].shape = __pyx_pybuffernd_file_inds.rcbuffer->pybuffer.shape[0];
6602   {
6603     __Pyx_BufFmt_StackElem __pyx_stack[1];
6604     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_domains.rcbuffer->pybuffer, (PyObject*)__pyx_v_domains, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 139, __pyx_L1_error)
6605   }
6606   __pyx_pybuffernd_domains.diminfo[0].strides = __pyx_pybuffernd_domains.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_domains.diminfo[0].shape = __pyx_pybuffernd_domains.rcbuffer->pybuffer.shape[0];
6607 
6608   /* "yt/frontends/ramses/io_utils.pyx":157
6609  *     cdef np.ndarray[np.uint8_t, ndim=1] mask
6610  *
6611  *     twotondim = 2**ndim             # <<<<<<<<<<<<<<
6612  *     nfields = len(all_fields)
6613  *     ncpu = offsets.shape[0]
6614  */
6615   __pyx_v_twotondim = __Pyx_pow___pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t(2, __pyx_v_ndim);
6616 
6617   /* "yt/frontends/ramses/io_utils.pyx":158
6618  *
6619  *     twotondim = 2**ndim
6620  *     nfields = len(all_fields)             # <<<<<<<<<<<<<<
6621  *     ncpu = offsets.shape[0]
6622  *     nlevels = offsets.shape[1]
6623  */
6624   if (unlikely(__pyx_v_all_fields == Py_None)) {
6625     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
6626     __PYX_ERR(0, 158, __pyx_L1_error)
6627   }
6628   __pyx_t_1 = PyList_GET_SIZE(__pyx_v_all_fields); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 158, __pyx_L1_error)
6629   __pyx_v_nfields = __pyx_t_1;
6630 
6631   /* "yt/frontends/ramses/io_utils.pyx":159
6632  *     twotondim = 2**ndim
6633  *     nfields = len(all_fields)
6634  *     ncpu = offsets.shape[0]             # <<<<<<<<<<<<<<
6635  *     nlevels = offsets.shape[1]
6636  *     ncpu_selected = len(cpu_enumerator)
6637  */
6638   __pyx_v_ncpu = (__pyx_v_offsets->dimensions[0]);
6639 
6640   /* "yt/frontends/ramses/io_utils.pyx":160
6641  *     nfields = len(all_fields)
6642  *     ncpu = offsets.shape[0]
6643  *     nlevels = offsets.shape[1]             # <<<<<<<<<<<<<<
6644  *     ncpu_selected = len(cpu_enumerator)
6645  *
6646  */
6647   __pyx_v_nlevels = (__pyx_v_offsets->dimensions[1]);
6648 
6649   /* "yt/frontends/ramses/io_utils.pyx":161
6650  *     ncpu = offsets.shape[0]
6651  *     nlevels = offsets.shape[1]
6652  *     ncpu_selected = len(cpu_enumerator)             # <<<<<<<<<<<<<<
6653  *
6654  *     mask = np.array([(field in fields) for field in all_fields], dtype=np.uint8)
6655  */
6656   if (unlikely(__pyx_v_cpu_enumerator == Py_None)) {
6657     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
6658     __PYX_ERR(0, 161, __pyx_L1_error)
6659   }
6660   __pyx_t_1 = PyList_GET_SIZE(__pyx_v_cpu_enumerator); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 161, __pyx_L1_error)
6661   __pyx_v_ncpu_selected = __pyx_t_1;
6662 
6663   /* "yt/frontends/ramses/io_utils.pyx":163
6664  *     ncpu_selected = len(cpu_enumerator)
6665  *
6666  *     mask = np.array([(field in fields) for field in all_fields], dtype=np.uint8)             # <<<<<<<<<<<<<<
6667  *
6668  *     # Loop over levels
6669  */
6670   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error)
6671   __Pyx_GOTREF(__pyx_t_2);
6672   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error)
6673   __Pyx_GOTREF(__pyx_t_3);
6674   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6675   __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error)
6676   __Pyx_GOTREF(__pyx_t_2);
6677   if (unlikely(__pyx_v_all_fields == Py_None)) {
6678     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
6679     __PYX_ERR(0, 163, __pyx_L1_error)
6680   }
6681   __pyx_t_4 = __pyx_v_all_fields; __Pyx_INCREF(__pyx_t_4); __pyx_t_1 = 0;
6682   for (;;) {
6683     if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_4)) break;
6684     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6685     __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(0, 163, __pyx_L1_error)
6686     #else
6687     __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 163, __pyx_L1_error)
6688     __Pyx_GOTREF(__pyx_t_5);
6689     #endif
6690     if (!(likely(PyString_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(0, 163, __pyx_L1_error)
6691     __Pyx_XDECREF_SET(__pyx_v_field, ((PyObject*)__pyx_t_5));
6692     __pyx_t_5 = 0;
6693     __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_v_field, __pyx_v_fields, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 163, __pyx_L1_error)
6694     __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 163, __pyx_L1_error)
6695     __Pyx_GOTREF(__pyx_t_5);
6696     if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 163, __pyx_L1_error)
6697     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6698   }
6699   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6700   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error)
6701   __Pyx_GOTREF(__pyx_t_4);
6702   __Pyx_GIVEREF(__pyx_t_2);
6703   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
6704   __pyx_t_2 = 0;
6705   __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error)
6706   __Pyx_GOTREF(__pyx_t_2);
6707   __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 163, __pyx_L1_error)
6708   __Pyx_GOTREF(__pyx_t_5);
6709   __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 163, __pyx_L1_error)
6710   __Pyx_GOTREF(__pyx_t_7);
6711   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6712   if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 163, __pyx_L1_error)
6713   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6714   __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 163, __pyx_L1_error)
6715   __Pyx_GOTREF(__pyx_t_7);
6716   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6717   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6718   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6719   if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 163, __pyx_L1_error)
6720   __pyx_t_8 = ((PyArrayObject *)__pyx_t_7);
6721   {
6722     __Pyx_BufFmt_StackElem __pyx_stack[1];
6723     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
6724     __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
6725     if (unlikely(__pyx_t_9 < 0)) {
6726       PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
6727       if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_v_mask, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
6728         Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
6729         __Pyx_RaiseBufferFallbackError();
6730       } else {
6731         PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
6732       }
6733       __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
6734     }
6735     __pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0];
6736     if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 163, __pyx_L1_error)
6737   }
6738   __pyx_t_8 = 0;
6739   __pyx_v_mask = ((PyArrayObject *)__pyx_t_7);
6740   __pyx_t_7 = 0;
6741 
6742   /* "yt/frontends/ramses/io_utils.pyx":166
6743  *
6744  *     # Loop over levels
6745  *     for ilevel in range(nlevels):             # <<<<<<<<<<<<<<
6746  *         # Loop over cpu domains
6747  *         for icpu in cpu_enumerator:
6748  */
6749   __pyx_t_9 = __pyx_v_nlevels;
6750   __pyx_t_13 = __pyx_t_9;
6751   for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
6752     __pyx_v_ilevel = __pyx_t_14;
6753 
6754     /* "yt/frontends/ramses/io_utils.pyx":168
6755  *     for ilevel in range(nlevels):
6756  *         # Loop over cpu domains
6757  *         for icpu in cpu_enumerator:             # <<<<<<<<<<<<<<
6758  *             nc = level_count[icpu, ilevel]
6759  *             if nc == 0:
6760  */
6761     if (unlikely(__pyx_v_cpu_enumerator == Py_None)) {
6762       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
6763       __PYX_ERR(0, 168, __pyx_L1_error)
6764     }
6765     __pyx_t_7 = __pyx_v_cpu_enumerator; __Pyx_INCREF(__pyx_t_7); __pyx_t_1 = 0;
6766     for (;;) {
6767       if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_7)) break;
6768       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6769       __pyx_t_2 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_1); __Pyx_INCREF(__pyx_t_2); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(0, 168, __pyx_L1_error)
6770       #else
6771       __pyx_t_2 = PySequence_ITEM(__pyx_t_7, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L1_error)
6772       __Pyx_GOTREF(__pyx_t_2);
6773       #endif
6774       __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 168, __pyx_L1_error)
6775       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6776       __pyx_v_icpu = __pyx_t_15;
6777 
6778       /* "yt/frontends/ramses/io_utils.pyx":169
6779  *         # Loop over cpu domains
6780  *         for icpu in cpu_enumerator:
6781  *             nc = level_count[icpu, ilevel]             # <<<<<<<<<<<<<<
6782  *             if nc == 0:
6783  *                 continue
6784  */
6785       __pyx_t_16 = __pyx_v_icpu;
6786       __pyx_t_17 = __pyx_v_ilevel;
6787       __pyx_v_nc = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_level_count.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_level_count.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_level_count.diminfo[1].strides));
6788 
6789       /* "yt/frontends/ramses/io_utils.pyx":170
6790  *         for icpu in cpu_enumerator:
6791  *             nc = level_count[icpu, ilevel]
6792  *             if nc == 0:             # <<<<<<<<<<<<<<
6793  *                 continue
6794  *             offset = offsets[icpu, ilevel]
6795  */
6796       __pyx_t_6 = ((__pyx_v_nc == 0) != 0);
6797       if (__pyx_t_6) {
6798 
6799         /* "yt/frontends/ramses/io_utils.pyx":171
6800  *             nc = level_count[icpu, ilevel]
6801  *             if nc == 0:
6802  *                 continue             # <<<<<<<<<<<<<<
6803  *             offset = offsets[icpu, ilevel]
6804  *             if offset == -1:
6805  */
6806         goto __pyx_L7_continue;
6807 
6808         /* "yt/frontends/ramses/io_utils.pyx":170
6809  *         for icpu in cpu_enumerator:
6810  *             nc = level_count[icpu, ilevel]
6811  *             if nc == 0:             # <<<<<<<<<<<<<<
6812  *                 continue
6813  *             offset = offsets[icpu, ilevel]
6814  */
6815       }
6816 
6817       /* "yt/frontends/ramses/io_utils.pyx":172
6818  *             if nc == 0:
6819  *                 continue
6820  *             offset = offsets[icpu, ilevel]             # <<<<<<<<<<<<<<
6821  *             if offset == -1:
6822  *                 continue
6823  */
6824       __pyx_t_18 = __pyx_v_icpu;
6825       __pyx_t_19 = __pyx_v_ilevel;
6826       __pyx_v_offset = (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_offsets.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_offsets.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_offsets.diminfo[1].strides));
6827 
6828       /* "yt/frontends/ramses/io_utils.pyx":173
6829  *                 continue
6830  *             offset = offsets[icpu, ilevel]
6831  *             if offset == -1:             # <<<<<<<<<<<<<<
6832  *                 continue
6833  *             f.seek(offset)
6834  */
6835       __pyx_t_6 = ((__pyx_v_offset == -1LL) != 0);
6836       if (__pyx_t_6) {
6837 
6838         /* "yt/frontends/ramses/io_utils.pyx":174
6839  *             offset = offsets[icpu, ilevel]
6840  *             if offset == -1:
6841  *                 continue             # <<<<<<<<<<<<<<
6842  *             f.seek(offset)
6843  *             tmp = {}
6844  */
6845         goto __pyx_L7_continue;
6846 
6847         /* "yt/frontends/ramses/io_utils.pyx":173
6848  *                 continue
6849  *             offset = offsets[icpu, ilevel]
6850  *             if offset == -1:             # <<<<<<<<<<<<<<
6851  *                 continue
6852  *             f.seek(offset)
6853  */
6854       }
6855 
6856       /* "yt/frontends/ramses/io_utils.pyx":175
6857  *             if offset == -1:
6858  *                 continue
6859  *             f.seek(offset)             # <<<<<<<<<<<<<<
6860  *             tmp = {}
6861  *             # Initalize temporary data container for io
6862  */
6863       __pyx_t_20 = ((struct __pyx_vtabstruct_2yt_9utilities_20cython_fortran_utils_FortranFile *)__pyx_v_f->__pyx_vtab)->seek(__pyx_v_f, __pyx_v_offset, 0, NULL); if (unlikely(__pyx_t_20 == ((__pyx_t_2yt_9utilities_20cython_fortran_utils_INT64_t)-1LL))) __PYX_ERR(0, 175, __pyx_L1_error)
6864 
6865       /* "yt/frontends/ramses/io_utils.pyx":176
6866  *                 continue
6867  *             f.seek(offset)
6868  *             tmp = {}             # <<<<<<<<<<<<<<
6869  *             # Initalize temporary data container for io
6870  *             # note: we use Fortran ordering to reflect the in-file ordering
6871  */
6872       __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 176, __pyx_L1_error)
6873       __Pyx_GOTREF(__pyx_t_2);
6874       __Pyx_XDECREF_SET(__pyx_v_tmp, ((PyObject*)__pyx_t_2));
6875       __pyx_t_2 = 0;
6876 
6877       /* "yt/frontends/ramses/io_utils.pyx":179
6878  *             # Initalize temporary data container for io
6879  *             # note: we use Fortran ordering to reflect the in-file ordering
6880  *             for field in all_fields:             # <<<<<<<<<<<<<<
6881  *                 tmp[field] = np.empty((nc, twotondim), dtype="float64", order='F')
6882  *
6883  */
6884       if (unlikely(__pyx_v_all_fields == Py_None)) {
6885         PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
6886         __PYX_ERR(0, 179, __pyx_L1_error)
6887       }
6888       __pyx_t_2 = __pyx_v_all_fields; __Pyx_INCREF(__pyx_t_2); __pyx_t_21 = 0;
6889       for (;;) {
6890         if (__pyx_t_21 >= PyList_GET_SIZE(__pyx_t_2)) break;
6891         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6892         __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_21); __Pyx_INCREF(__pyx_t_4); __pyx_t_21++; if (unlikely(0 < 0)) __PYX_ERR(0, 179, __pyx_L1_error)
6893         #else
6894         __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_21); __pyx_t_21++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 179, __pyx_L1_error)
6895         __Pyx_GOTREF(__pyx_t_4);
6896         #endif
6897         if (!(likely(PyString_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 179, __pyx_L1_error)
6898         __Pyx_XDECREF_SET(__pyx_v_field, ((PyObject*)__pyx_t_4));
6899         __pyx_t_4 = 0;
6900 
6901         /* "yt/frontends/ramses/io_utils.pyx":180
6902  *             # note: we use Fortran ordering to reflect the in-file ordering
6903  *             for field in all_fields:
6904  *                 tmp[field] = np.empty((nc, twotondim), dtype="float64", order='F')             # <<<<<<<<<<<<<<
6905  *
6906  *             for i in range(twotondim):
6907  */
6908         __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 180, __pyx_L1_error)
6909         __Pyx_GOTREF(__pyx_t_4);
6910         __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L1_error)
6911         __Pyx_GOTREF(__pyx_t_3);
6912         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6913         __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_nc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 180, __pyx_L1_error)
6914         __Pyx_GOTREF(__pyx_t_4);
6915         __pyx_t_5 = __Pyx_PyInt_From_npy_int64(__pyx_v_twotondim); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 180, __pyx_L1_error)
6916         __Pyx_GOTREF(__pyx_t_5);
6917         __pyx_t_22 = PyTuple_New(2); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 180, __pyx_L1_error)
6918         __Pyx_GOTREF(__pyx_t_22);
6919         __Pyx_GIVEREF(__pyx_t_4);
6920         PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_4);
6921         __Pyx_GIVEREF(__pyx_t_5);
6922         PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_t_5);
6923         __pyx_t_4 = 0;
6924         __pyx_t_5 = 0;
6925         __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 180, __pyx_L1_error)
6926         __Pyx_GOTREF(__pyx_t_5);
6927         __Pyx_GIVEREF(__pyx_t_22);
6928         PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_22);
6929         __pyx_t_22 = 0;
6930         __pyx_t_22 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 180, __pyx_L1_error)
6931         __Pyx_GOTREF(__pyx_t_22);
6932         if (PyDict_SetItem(__pyx_t_22, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 180, __pyx_L1_error)
6933         if (PyDict_SetItem(__pyx_t_22, __pyx_n_s_order, __pyx_n_s_F) < 0) __PYX_ERR(0, 180, __pyx_L1_error)
6934         __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_22); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 180, __pyx_L1_error)
6935         __Pyx_GOTREF(__pyx_t_4);
6936         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6937         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6938         __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
6939         if (unlikely(PyDict_SetItem(__pyx_v_tmp, __pyx_v_field, __pyx_t_4) < 0)) __PYX_ERR(0, 180, __pyx_L1_error)
6940         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6941 
6942         /* "yt/frontends/ramses/io_utils.pyx":179
6943  *             # Initalize temporary data container for io
6944  *             # note: we use Fortran ordering to reflect the in-file ordering
6945  *             for field in all_fields:             # <<<<<<<<<<<<<<
6946  *                 tmp[field] = np.empty((nc, twotondim), dtype="float64", order='F')
6947  *
6948  */
6949       }
6950       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6951 
6952       /* "yt/frontends/ramses/io_utils.pyx":182
6953  *                 tmp[field] = np.empty((nc, twotondim), dtype="float64", order='F')
6954  *
6955  *             for i in range(twotondim):             # <<<<<<<<<<<<<<
6956  *                 # Read the selected fields
6957  *                 for ifield in range(nfields):
6958  */
6959       __pyx_t_23 = __pyx_v_twotondim;
6960       __pyx_t_24 = __pyx_t_23;
6961       for (__pyx_t_25 = 0; __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) {
6962         __pyx_v_i = __pyx_t_25;
6963 
6964         /* "yt/frontends/ramses/io_utils.pyx":184
6965  *             for i in range(twotondim):
6966  *                 # Read the selected fields
6967  *                 for ifield in range(nfields):             # <<<<<<<<<<<<<<
6968  *                     if not mask[ifield]:
6969  *                         f.skip()
6970  */
6971         __pyx_t_15 = __pyx_v_nfields;
6972         __pyx_t_26 = __pyx_t_15;
6973         for (__pyx_t_27 = 0; __pyx_t_27 < __pyx_t_26; __pyx_t_27+=1) {
6974           __pyx_v_ifield = __pyx_t_27;
6975 
6976           /* "yt/frontends/ramses/io_utils.pyx":185
6977  *                 # Read the selected fields
6978  *                 for ifield in range(nfields):
6979  *                     if not mask[ifield]:             # <<<<<<<<<<<<<<
6980  *                         f.skip()
6981  *                     else:
6982  */
6983           __pyx_t_28 = __pyx_v_ifield;
6984           __pyx_t_6 = ((!((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_mask.diminfo[0].strides)) != 0)) != 0);
6985           if (__pyx_t_6) {
6986 
6987             /* "yt/frontends/ramses/io_utils.pyx":186
6988  *                 for ifield in range(nfields):
6989  *                     if not mask[ifield]:
6990  *                         f.skip()             # <<<<<<<<<<<<<<
6991  *                     else:
6992  *                         tmp[all_fields[ifield]][:, i] = f.read_vector('d') # i-th cell
6993  */
6994             __pyx_t_20 = ((struct __pyx_vtabstruct_2yt_9utilities_20cython_fortran_utils_FortranFile *)__pyx_v_f->__pyx_vtab)->skip(__pyx_v_f, 0, NULL); if (unlikely(__pyx_t_20 == ((__pyx_t_2yt_9utilities_20cython_fortran_utils_INT64_t)-1LL))) __PYX_ERR(0, 186, __pyx_L1_error)
6995 
6996             /* "yt/frontends/ramses/io_utils.pyx":185
6997  *                 # Read the selected fields
6998  *                 for ifield in range(nfields):
6999  *                     if not mask[ifield]:             # <<<<<<<<<<<<<<
7000  *                         f.skip()
7001  *                     else:
7002  */
7003             goto __pyx_L17;
7004           }
7005 
7006           /* "yt/frontends/ramses/io_utils.pyx":188
7007  *                         f.skip()
7008  *                     else:
7009  *                         tmp[all_fields[ifield]][:, i] = f.read_vector('d') # i-th cell             # <<<<<<<<<<<<<<
7010  *             if ncpu_selected > 1:
7011  *                 oct_handler.fill_level_with_domain(
7012  */
7013           /*else*/ {
7014             __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_2yt_9utilities_20cython_fortran_utils_FortranFile *)__pyx_v_f->__pyx_vtab)->read_vector(__pyx_v_f, __pyx_n_s_d, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error)
7015             __Pyx_GOTREF(__pyx_t_2);
7016             if (unlikely(__pyx_v_all_fields == Py_None)) {
7017               PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
7018               __PYX_ERR(0, 188, __pyx_L1_error)
7019             }
7020             __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_tmp, PyList_GET_ITEM(__pyx_v_all_fields, __pyx_v_ifield)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 188, __pyx_L1_error)
7021             __Pyx_GOTREF(__pyx_t_4);
7022             __pyx_t_22 = __Pyx_PyInt_From_npy_int64(__pyx_v_i); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 188, __pyx_L1_error)
7023             __Pyx_GOTREF(__pyx_t_22);
7024             __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 188, __pyx_L1_error)
7025             __Pyx_GOTREF(__pyx_t_5);
7026             __Pyx_INCREF(__pyx_slice__3);
7027             __Pyx_GIVEREF(__pyx_slice__3);
7028             PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_slice__3);
7029             __Pyx_GIVEREF(__pyx_t_22);
7030             PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_22);
7031             __pyx_t_22 = 0;
7032             if (unlikely(PyObject_SetItem(__pyx_t_4, __pyx_t_5, __pyx_t_2) < 0)) __PYX_ERR(0, 188, __pyx_L1_error)
7033             __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7034             __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7035             __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7036           }
7037           __pyx_L17:;
7038         }
7039       }
7040 
7041       /* "yt/frontends/ramses/io_utils.pyx":189
7042  *                     else:
7043  *                         tmp[all_fields[ifield]][:, i] = f.read_vector('d') # i-th cell
7044  *             if ncpu_selected > 1:             # <<<<<<<<<<<<<<
7045  *                 oct_handler.fill_level_with_domain(
7046  *                     ilevel, levels, cell_inds, file_inds, domains, tr, tmp, domain=icpu+1)
7047  */
7048       __pyx_t_6 = ((__pyx_v_ncpu_selected > 1) != 0);
7049       if (__pyx_t_6) {
7050 
7051         /* "yt/frontends/ramses/io_utils.pyx":190
7052  *                         tmp[all_fields[ifield]][:, i] = f.read_vector('d') # i-th cell
7053  *             if ncpu_selected > 1:
7054  *                 oct_handler.fill_level_with_domain(             # <<<<<<<<<<<<<<
7055  *                     ilevel, levels, cell_inds, file_inds, domains, tr, tmp, domain=icpu+1)
7056  *             else:
7057  */
7058         __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_oct_handler), __pyx_n_s_fill_level_with_domain); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error)
7059         __Pyx_GOTREF(__pyx_t_2);
7060 
7061         /* "yt/frontends/ramses/io_utils.pyx":191
7062  *             if ncpu_selected > 1:
7063  *                 oct_handler.fill_level_with_domain(
7064  *                     ilevel, levels, cell_inds, file_inds, domains, tr, tmp, domain=icpu+1)             # <<<<<<<<<<<<<<
7065  *             else:
7066  *                 oct_handler.fill_level(
7067  */
7068         __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_ilevel); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 191, __pyx_L1_error)
7069         __Pyx_GOTREF(__pyx_t_5);
7070 
7071         /* "yt/frontends/ramses/io_utils.pyx":190
7072  *                         tmp[all_fields[ifield]][:, i] = f.read_vector('d') # i-th cell
7073  *             if ncpu_selected > 1:
7074  *                 oct_handler.fill_level_with_domain(             # <<<<<<<<<<<<<<
7075  *                     ilevel, levels, cell_inds, file_inds, domains, tr, tmp, domain=icpu+1)
7076  *             else:
7077  */
7078         __pyx_t_4 = PyTuple_New(7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 190, __pyx_L1_error)
7079         __Pyx_GOTREF(__pyx_t_4);
7080         __Pyx_GIVEREF(__pyx_t_5);
7081         PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
7082         __Pyx_INCREF(((PyObject *)__pyx_v_levels));
7083         __Pyx_GIVEREF(((PyObject *)__pyx_v_levels));
7084         PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_levels));
7085         __Pyx_INCREF(((PyObject *)__pyx_v_cell_inds));
7086         __Pyx_GIVEREF(((PyObject *)__pyx_v_cell_inds));
7087         PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_v_cell_inds));
7088         __Pyx_INCREF(((PyObject *)__pyx_v_file_inds));
7089         __Pyx_GIVEREF(((PyObject *)__pyx_v_file_inds));
7090         PyTuple_SET_ITEM(__pyx_t_4, 3, ((PyObject *)__pyx_v_file_inds));
7091         __Pyx_INCREF(((PyObject *)__pyx_v_domains));
7092         __Pyx_GIVEREF(((PyObject *)__pyx_v_domains));
7093         PyTuple_SET_ITEM(__pyx_t_4, 4, ((PyObject *)__pyx_v_domains));
7094         __Pyx_INCREF(__pyx_v_tr);
7095         __Pyx_GIVEREF(__pyx_v_tr);
7096         PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_v_tr);
7097         __Pyx_INCREF(__pyx_v_tmp);
7098         __Pyx_GIVEREF(__pyx_v_tmp);
7099         PyTuple_SET_ITEM(__pyx_t_4, 6, __pyx_v_tmp);
7100         __pyx_t_5 = 0;
7101 
7102         /* "yt/frontends/ramses/io_utils.pyx":191
7103  *             if ncpu_selected > 1:
7104  *                 oct_handler.fill_level_with_domain(
7105  *                     ilevel, levels, cell_inds, file_inds, domains, tr, tmp, domain=icpu+1)             # <<<<<<<<<<<<<<
7106  *             else:
7107  *                 oct_handler.fill_level(
7108  */
7109         __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 191, __pyx_L1_error)
7110         __Pyx_GOTREF(__pyx_t_5);
7111         __pyx_t_22 = __Pyx_PyInt_From_long((__pyx_v_icpu + 1)); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 191, __pyx_L1_error)
7112         __Pyx_GOTREF(__pyx_t_22);
7113         if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_domain, __pyx_t_22) < 0) __PYX_ERR(0, 191, __pyx_L1_error)
7114         __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
7115 
7116         /* "yt/frontends/ramses/io_utils.pyx":190
7117  *                         tmp[all_fields[ifield]][:, i] = f.read_vector('d') # i-th cell
7118  *             if ncpu_selected > 1:
7119  *                 oct_handler.fill_level_with_domain(             # <<<<<<<<<<<<<<
7120  *                     ilevel, levels, cell_inds, file_inds, domains, tr, tmp, domain=icpu+1)
7121  *             else:
7122  */
7123         __pyx_t_22 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 190, __pyx_L1_error)
7124         __Pyx_GOTREF(__pyx_t_22);
7125         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7126         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7127         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7128         __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
7129 
7130         /* "yt/frontends/ramses/io_utils.pyx":189
7131  *                     else:
7132  *                         tmp[all_fields[ifield]][:, i] = f.read_vector('d') # i-th cell
7133  *             if ncpu_selected > 1:             # <<<<<<<<<<<<<<
7134  *                 oct_handler.fill_level_with_domain(
7135  *                     ilevel, levels, cell_inds, file_inds, domains, tr, tmp, domain=icpu+1)
7136  */
7137         goto __pyx_L18;
7138       }
7139 
7140       /* "yt/frontends/ramses/io_utils.pyx":193
7141  *                     ilevel, levels, cell_inds, file_inds, domains, tr, tmp, domain=icpu+1)
7142  *             else:
7143  *                 oct_handler.fill_level(             # <<<<<<<<<<<<<<
7144  *                     ilevel, levels, cell_inds, file_inds, tr, tmp)
7145  */
7146       /*else*/ {
7147         __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_oct_handler), __pyx_n_s_fill_level); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 193, __pyx_L1_error)
7148         __Pyx_GOTREF(__pyx_t_5);
7149 
7150         /* "yt/frontends/ramses/io_utils.pyx":194
7151  *             else:
7152  *                 oct_handler.fill_level(
7153  *                     ilevel, levels, cell_inds, file_inds, tr, tmp)             # <<<<<<<<<<<<<<
7154  */
7155         __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_ilevel); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 194, __pyx_L1_error)
7156         __Pyx_GOTREF(__pyx_t_4);
7157         __pyx_t_2 = NULL;
7158         __pyx_t_15 = 0;
7159         if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
7160           __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
7161           if (likely(__pyx_t_2)) {
7162             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
7163             __Pyx_INCREF(__pyx_t_2);
7164             __Pyx_INCREF(function);
7165             __Pyx_DECREF_SET(__pyx_t_5, function);
7166             __pyx_t_15 = 1;
7167           }
7168         }
7169         #if CYTHON_FAST_PYCALL
7170         if (PyFunction_Check(__pyx_t_5)) {
7171           PyObject *__pyx_temp[7] = {__pyx_t_2, __pyx_t_4, ((PyObject *)__pyx_v_levels), ((PyObject *)__pyx_v_cell_inds), ((PyObject *)__pyx_v_file_inds), __pyx_v_tr, __pyx_v_tmp};
7172           __pyx_t_22 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_15, 6+__pyx_t_15); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 193, __pyx_L1_error)
7173           __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7174           __Pyx_GOTREF(__pyx_t_22);
7175           __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7176         } else
7177         #endif
7178         #if CYTHON_FAST_PYCCALL
7179         if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
7180           PyObject *__pyx_temp[7] = {__pyx_t_2, __pyx_t_4, ((PyObject *)__pyx_v_levels), ((PyObject *)__pyx_v_cell_inds), ((PyObject *)__pyx_v_file_inds), __pyx_v_tr, __pyx_v_tmp};
7181           __pyx_t_22 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_15, 6+__pyx_t_15); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 193, __pyx_L1_error)
7182           __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7183           __Pyx_GOTREF(__pyx_t_22);
7184           __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7185         } else
7186         #endif
7187         {
7188           __pyx_t_3 = PyTuple_New(6+__pyx_t_15); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 193, __pyx_L1_error)
7189           __Pyx_GOTREF(__pyx_t_3);
7190           if (__pyx_t_2) {
7191             __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = NULL;
7192           }
7193           __Pyx_GIVEREF(__pyx_t_4);
7194           PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_15, __pyx_t_4);
7195           __Pyx_INCREF(((PyObject *)__pyx_v_levels));
7196           __Pyx_GIVEREF(((PyObject *)__pyx_v_levels));
7197           PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_15, ((PyObject *)__pyx_v_levels));
7198           __Pyx_INCREF(((PyObject *)__pyx_v_cell_inds));
7199           __Pyx_GIVEREF(((PyObject *)__pyx_v_cell_inds));
7200           PyTuple_SET_ITEM(__pyx_t_3, 2+__pyx_t_15, ((PyObject *)__pyx_v_cell_inds));
7201           __Pyx_INCREF(((PyObject *)__pyx_v_file_inds));
7202           __Pyx_GIVEREF(((PyObject *)__pyx_v_file_inds));
7203           PyTuple_SET_ITEM(__pyx_t_3, 3+__pyx_t_15, ((PyObject *)__pyx_v_file_inds));
7204           __Pyx_INCREF(__pyx_v_tr);
7205           __Pyx_GIVEREF(__pyx_v_tr);
7206           PyTuple_SET_ITEM(__pyx_t_3, 4+__pyx_t_15, __pyx_v_tr);
7207           __Pyx_INCREF(__pyx_v_tmp);
7208           __Pyx_GIVEREF(__pyx_v_tmp);
7209           PyTuple_SET_ITEM(__pyx_t_3, 5+__pyx_t_15, __pyx_v_tmp);
7210           __pyx_t_4 = 0;
7211           __pyx_t_22 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 193, __pyx_L1_error)
7212           __Pyx_GOTREF(__pyx_t_22);
7213           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7214         }
7215         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7216         __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
7217       }
7218       __pyx_L18:;
7219 
7220       /* "yt/frontends/ramses/io_utils.pyx":168
7221  *     for ilevel in range(nlevels):
7222  *         # Loop over cpu domains
7223  *         for icpu in cpu_enumerator:             # <<<<<<<<<<<<<<
7224  *             nc = level_count[icpu, ilevel]
7225  *             if nc == 0:
7226  */
7227       __pyx_L7_continue:;
7228     }
7229     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7230   }
7231 
7232   /* "yt/frontends/ramses/io_utils.pyx":139
7233  * @cython.cdivision(True)
7234  * @cython.nonecheck(False)
7235  * def fill_hydro(FortranFile f,             # <<<<<<<<<<<<<<
7236  *                np.ndarray[np.int64_t, ndim=2] offsets,
7237  *                np.ndarray[np.int64_t, ndim=2] level_count,
7238  */
7239 
7240   /* function exit code */
7241   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7242   goto __pyx_L0;
7243   __pyx_L1_error:;
7244   __Pyx_XDECREF(__pyx_t_2);
7245   __Pyx_XDECREF(__pyx_t_3);
7246   __Pyx_XDECREF(__pyx_t_4);
7247   __Pyx_XDECREF(__pyx_t_5);
7248   __Pyx_XDECREF(__pyx_t_7);
7249   __Pyx_XDECREF(__pyx_t_22);
7250   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
7251     __Pyx_PyThreadState_declare
7252     __Pyx_PyThreadState_assign
7253     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
7254     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cell_inds.rcbuffer->pybuffer);
7255     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_domains.rcbuffer->pybuffer);
7256     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_file_inds.rcbuffer->pybuffer);
7257     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_level_count.rcbuffer->pybuffer);
7258     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_levels.rcbuffer->pybuffer);
7259     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
7260     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_offsets.rcbuffer->pybuffer);
7261   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
7262   __Pyx_AddTraceback("yt.frontends.ramses.io_utils.fill_hydro", __pyx_clineno, __pyx_lineno, __pyx_filename);
7263   __pyx_r = NULL;
7264   goto __pyx_L2;
7265   __pyx_L0:;
7266   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_cell_inds.rcbuffer->pybuffer);
7267   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_domains.rcbuffer->pybuffer);
7268   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_file_inds.rcbuffer->pybuffer);
7269   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_level_count.rcbuffer->pybuffer);
7270   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_levels.rcbuffer->pybuffer);
7271   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
7272   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_offsets.rcbuffer->pybuffer);
7273   __pyx_L2:;
7274   __Pyx_XDECREF(__pyx_v_tmp);
7275   __Pyx_XDECREF(__pyx_v_field);
7276   __Pyx_XDECREF((PyObject *)__pyx_v_mask);
7277   __Pyx_XGIVEREF(__pyx_r);
7278   __Pyx_RefNannyFinishContext();
7279   return __pyx_r;
7280 }
7281 
7282 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":258
7283  *         # experimental exception made for __getbuffer__ and __releasebuffer__
7284  *         # -- the details of this may change.
7285  *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
7286  *             # This implementation of getbuffer is geared towards Cython
7287  *             # requirements, and does not yet fulfill the PEP.
7288  */
7289 
7290 /* Python wrapper */
7291 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)7292 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
7293   int __pyx_r;
7294   __Pyx_RefNannyDeclarations
7295   __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
7296   __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
7297 
7298   /* function exit code */
7299   __Pyx_RefNannyFinishContext();
7300   return __pyx_r;
7301 }
7302 
__pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject * __pyx_v_self,Py_buffer * __pyx_v_info,int __pyx_v_flags)7303 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
7304   int __pyx_v_i;
7305   int __pyx_v_ndim;
7306   int __pyx_v_endian_detector;
7307   int __pyx_v_little_endian;
7308   int __pyx_v_t;
7309   char *__pyx_v_f;
7310   PyArray_Descr *__pyx_v_descr = 0;
7311   int __pyx_v_offset;
7312   int __pyx_r;
7313   __Pyx_RefNannyDeclarations
7314   int __pyx_t_1;
7315   int __pyx_t_2;
7316   PyObject *__pyx_t_3 = NULL;
7317   int __pyx_t_4;
7318   int __pyx_t_5;
7319   int __pyx_t_6;
7320   PyArray_Descr *__pyx_t_7;
7321   PyObject *__pyx_t_8 = NULL;
7322   char *__pyx_t_9;
7323   if (__pyx_v_info == NULL) {
7324     PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
7325     return -1;
7326   }
7327   __Pyx_RefNannySetupContext("__getbuffer__", 0);
7328   __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
7329   __Pyx_GIVEREF(__pyx_v_info->obj);
7330 
7331   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":265
7332  *
7333  *             cdef int i, ndim
7334  *             cdef int endian_detector = 1             # <<<<<<<<<<<<<<
7335  *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
7336  *
7337  */
7338   __pyx_v_endian_detector = 1;
7339 
7340   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":266
7341  *             cdef int i, ndim
7342  *             cdef int endian_detector = 1
7343  *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
7344  *
7345  *             ndim = PyArray_NDIM(self)
7346  */
7347   __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
7348 
7349   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":268
7350  *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
7351  *
7352  *             ndim = PyArray_NDIM(self)             # <<<<<<<<<<<<<<
7353  *
7354  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
7355  */
7356   __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
7357 
7358   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270
7359  *             ndim = PyArray_NDIM(self)
7360  *
7361  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
7362  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
7363  *                 raise ValueError(u"ndarray is not C contiguous")
7364  */
7365   __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
7366   if (__pyx_t_2) {
7367   } else {
7368     __pyx_t_1 = __pyx_t_2;
7369     goto __pyx_L4_bool_binop_done;
7370   }
7371 
7372   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":271
7373  *
7374  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
7375  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):             # <<<<<<<<<<<<<<
7376  *                 raise ValueError(u"ndarray is not C contiguous")
7377  *
7378  */
7379   __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_C_CONTIGUOUS) != 0)) != 0);
7380   __pyx_t_1 = __pyx_t_2;
7381   __pyx_L4_bool_binop_done:;
7382 
7383   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270
7384  *             ndim = PyArray_NDIM(self)
7385  *
7386  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
7387  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
7388  *                 raise ValueError(u"ndarray is not C contiguous")
7389  */
7390   if (unlikely(__pyx_t_1)) {
7391 
7392     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272
7393  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
7394  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
7395  *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
7396  *
7397  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
7398  */
7399     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 272, __pyx_L1_error)
7400     __Pyx_GOTREF(__pyx_t_3);
7401     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7402     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7403     __PYX_ERR(1, 272, __pyx_L1_error)
7404 
7405     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270
7406  *             ndim = PyArray_NDIM(self)
7407  *
7408  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
7409  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
7410  *                 raise ValueError(u"ndarray is not C contiguous")
7411  */
7412   }
7413 
7414   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274
7415  *                 raise ValueError(u"ndarray is not C contiguous")
7416  *
7417  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
7418  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
7419  *                 raise ValueError(u"ndarray is not Fortran contiguous")
7420  */
7421   __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
7422   if (__pyx_t_2) {
7423   } else {
7424     __pyx_t_1 = __pyx_t_2;
7425     goto __pyx_L7_bool_binop_done;
7426   }
7427 
7428   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":275
7429  *
7430  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
7431  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):             # <<<<<<<<<<<<<<
7432  *                 raise ValueError(u"ndarray is not Fortran contiguous")
7433  *
7434  */
7435   __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_F_CONTIGUOUS) != 0)) != 0);
7436   __pyx_t_1 = __pyx_t_2;
7437   __pyx_L7_bool_binop_done:;
7438 
7439   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274
7440  *                 raise ValueError(u"ndarray is not C contiguous")
7441  *
7442  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
7443  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
7444  *                 raise ValueError(u"ndarray is not Fortran contiguous")
7445  */
7446   if (unlikely(__pyx_t_1)) {
7447 
7448     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276
7449  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
7450  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
7451  *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
7452  *
7453  *             info.buf = PyArray_DATA(self)
7454  */
7455     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 276, __pyx_L1_error)
7456     __Pyx_GOTREF(__pyx_t_3);
7457     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7458     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7459     __PYX_ERR(1, 276, __pyx_L1_error)
7460 
7461     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274
7462  *                 raise ValueError(u"ndarray is not C contiguous")
7463  *
7464  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
7465  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
7466  *                 raise ValueError(u"ndarray is not Fortran contiguous")
7467  */
7468   }
7469 
7470   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":278
7471  *                 raise ValueError(u"ndarray is not Fortran contiguous")
7472  *
7473  *             info.buf = PyArray_DATA(self)             # <<<<<<<<<<<<<<
7474  *             info.ndim = ndim
7475  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
7476  */
7477   __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
7478 
7479   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":279
7480  *
7481  *             info.buf = PyArray_DATA(self)
7482  *             info.ndim = ndim             # <<<<<<<<<<<<<<
7483  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
7484  *                 # Allocate new buffer for strides and shape info.
7485  */
7486   __pyx_v_info->ndim = __pyx_v_ndim;
7487 
7488   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280
7489  *             info.buf = PyArray_DATA(self)
7490  *             info.ndim = ndim
7491  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
7492  *                 # Allocate new buffer for strides and shape info.
7493  *                 # This is allocated as one block, strides first.
7494  */
7495   __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
7496   if (__pyx_t_1) {
7497 
7498     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":283
7499  *                 # Allocate new buffer for strides and shape info.
7500  *                 # This is allocated as one block, strides first.
7501  *                 info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)             # <<<<<<<<<<<<<<
7502  *                 info.shape = info.strides + ndim
7503  *                 for i in range(ndim):
7504  */
7505     __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim))));
7506 
7507     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":284
7508  *                 # This is allocated as one block, strides first.
7509  *                 info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
7510  *                 info.shape = info.strides + ndim             # <<<<<<<<<<<<<<
7511  *                 for i in range(ndim):
7512  *                     info.strides[i] = PyArray_STRIDES(self)[i]
7513  */
7514     __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
7515 
7516     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":285
7517  *                 info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
7518  *                 info.shape = info.strides + ndim
7519  *                 for i in range(ndim):             # <<<<<<<<<<<<<<
7520  *                     info.strides[i] = PyArray_STRIDES(self)[i]
7521  *                     info.shape[i] = PyArray_DIMS(self)[i]
7522  */
7523     __pyx_t_4 = __pyx_v_ndim;
7524     __pyx_t_5 = __pyx_t_4;
7525     for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
7526       __pyx_v_i = __pyx_t_6;
7527 
7528       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":286
7529  *                 info.shape = info.strides + ndim
7530  *                 for i in range(ndim):
7531  *                     info.strides[i] = PyArray_STRIDES(self)[i]             # <<<<<<<<<<<<<<
7532  *                     info.shape[i] = PyArray_DIMS(self)[i]
7533  *             else:
7534  */
7535       (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
7536 
7537       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":287
7538  *                 for i in range(ndim):
7539  *                     info.strides[i] = PyArray_STRIDES(self)[i]
7540  *                     info.shape[i] = PyArray_DIMS(self)[i]             # <<<<<<<<<<<<<<
7541  *             else:
7542  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
7543  */
7544       (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
7545     }
7546 
7547     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280
7548  *             info.buf = PyArray_DATA(self)
7549  *             info.ndim = ndim
7550  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
7551  *                 # Allocate new buffer for strides and shape info.
7552  *                 # This is allocated as one block, strides first.
7553  */
7554     goto __pyx_L9;
7555   }
7556 
7557   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":289
7558  *                     info.shape[i] = PyArray_DIMS(self)[i]
7559  *             else:
7560  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)             # <<<<<<<<<<<<<<
7561  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
7562  *             info.suboffsets = NULL
7563  */
7564   /*else*/ {
7565     __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
7566 
7567     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":290
7568  *             else:
7569  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
7570  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)             # <<<<<<<<<<<<<<
7571  *             info.suboffsets = NULL
7572  *             info.itemsize = PyArray_ITEMSIZE(self)
7573  */
7574     __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
7575   }
7576   __pyx_L9:;
7577 
7578   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":291
7579  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
7580  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
7581  *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
7582  *             info.itemsize = PyArray_ITEMSIZE(self)
7583  *             info.readonly = not PyArray_ISWRITEABLE(self)
7584  */
7585   __pyx_v_info->suboffsets = NULL;
7586 
7587   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":292
7588  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
7589  *             info.suboffsets = NULL
7590  *             info.itemsize = PyArray_ITEMSIZE(self)             # <<<<<<<<<<<<<<
7591  *             info.readonly = not PyArray_ISWRITEABLE(self)
7592  *
7593  */
7594   __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
7595 
7596   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":293
7597  *             info.suboffsets = NULL
7598  *             info.itemsize = PyArray_ITEMSIZE(self)
7599  *             info.readonly = not PyArray_ISWRITEABLE(self)             # <<<<<<<<<<<<<<
7600  *
7601  *             cdef int t
7602  */
7603   __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
7604 
7605   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":296
7606  *
7607  *             cdef int t
7608  *             cdef char* f = NULL             # <<<<<<<<<<<<<<
7609  *             cdef dtype descr = <dtype>PyArray_DESCR(self)
7610  *             cdef int offset
7611  */
7612   __pyx_v_f = NULL;
7613 
7614   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297
7615  *             cdef int t
7616  *             cdef char* f = NULL
7617  *             cdef dtype descr = <dtype>PyArray_DESCR(self)             # <<<<<<<<<<<<<<
7618  *             cdef int offset
7619  *
7620  */
7621   __pyx_t_7 = PyArray_DESCR(__pyx_v_self);
7622   __pyx_t_3 = ((PyObject *)__pyx_t_7);
7623   __Pyx_INCREF(__pyx_t_3);
7624   __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
7625   __pyx_t_3 = 0;
7626 
7627   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":300
7628  *             cdef int offset
7629  *
7630  *             info.obj = self             # <<<<<<<<<<<<<<
7631  *
7632  *             if not PyDataType_HASFIELDS(descr):
7633  */
7634   __Pyx_INCREF(((PyObject *)__pyx_v_self));
7635   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
7636   __Pyx_GOTREF(__pyx_v_info->obj);
7637   __Pyx_DECREF(__pyx_v_info->obj);
7638   __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
7639 
7640   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":302
7641  *             info.obj = self
7642  *
7643  *             if not PyDataType_HASFIELDS(descr):             # <<<<<<<<<<<<<<
7644  *                 t = descr.type_num
7645  *                 if ((descr.byteorder == c'>' and little_endian) or
7646  */
7647   __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0);
7648   if (__pyx_t_1) {
7649 
7650     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":303
7651  *
7652  *             if not PyDataType_HASFIELDS(descr):
7653  *                 t = descr.type_num             # <<<<<<<<<<<<<<
7654  *                 if ((descr.byteorder == c'>' and little_endian) or
7655  *                     (descr.byteorder == c'<' and not little_endian)):
7656  */
7657     __pyx_t_4 = __pyx_v_descr->type_num;
7658     __pyx_v_t = __pyx_t_4;
7659 
7660     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304
7661  *             if not PyDataType_HASFIELDS(descr):
7662  *                 t = descr.type_num
7663  *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
7664  *                     (descr.byteorder == c'<' and not little_endian)):
7665  *                     raise ValueError(u"Non-native byte order not supported")
7666  */
7667     __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0);
7668     if (!__pyx_t_2) {
7669       goto __pyx_L15_next_or;
7670     } else {
7671     }
7672     __pyx_t_2 = (__pyx_v_little_endian != 0);
7673     if (!__pyx_t_2) {
7674     } else {
7675       __pyx_t_1 = __pyx_t_2;
7676       goto __pyx_L14_bool_binop_done;
7677     }
7678     __pyx_L15_next_or:;
7679 
7680     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":305
7681  *                 t = descr.type_num
7682  *                 if ((descr.byteorder == c'>' and little_endian) or
7683  *                     (descr.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
7684  *                     raise ValueError(u"Non-native byte order not supported")
7685  *                 if   t == NPY_BYTE:        f = "b"
7686  */
7687     __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0);
7688     if (__pyx_t_2) {
7689     } else {
7690       __pyx_t_1 = __pyx_t_2;
7691       goto __pyx_L14_bool_binop_done;
7692     }
7693     __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
7694     __pyx_t_1 = __pyx_t_2;
7695     __pyx_L14_bool_binop_done:;
7696 
7697     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304
7698  *             if not PyDataType_HASFIELDS(descr):
7699  *                 t = descr.type_num
7700  *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
7701  *                     (descr.byteorder == c'<' and not little_endian)):
7702  *                     raise ValueError(u"Non-native byte order not supported")
7703  */
7704     if (unlikely(__pyx_t_1)) {
7705 
7706       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":306
7707  *                 if ((descr.byteorder == c'>' and little_endian) or
7708  *                     (descr.byteorder == c'<' and not little_endian)):
7709  *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
7710  *                 if   t == NPY_BYTE:        f = "b"
7711  *                 elif t == NPY_UBYTE:       f = "B"
7712  */
7713       __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 306, __pyx_L1_error)
7714       __Pyx_GOTREF(__pyx_t_3);
7715       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7716       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7717       __PYX_ERR(1, 306, __pyx_L1_error)
7718 
7719       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304
7720  *             if not PyDataType_HASFIELDS(descr):
7721  *                 t = descr.type_num
7722  *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
7723  *                     (descr.byteorder == c'<' and not little_endian)):
7724  *                     raise ValueError(u"Non-native byte order not supported")
7725  */
7726     }
7727 
7728     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":307
7729  *                     (descr.byteorder == c'<' and not little_endian)):
7730  *                     raise ValueError(u"Non-native byte order not supported")
7731  *                 if   t == NPY_BYTE:        f = "b"             # <<<<<<<<<<<<<<
7732  *                 elif t == NPY_UBYTE:       f = "B"
7733  *                 elif t == NPY_SHORT:       f = "h"
7734  */
7735     switch (__pyx_v_t) {
7736       case NPY_BYTE:
7737       __pyx_v_f = ((char *)"b");
7738       break;
7739       case NPY_UBYTE:
7740 
7741       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":308
7742  *                     raise ValueError(u"Non-native byte order not supported")
7743  *                 if   t == NPY_BYTE:        f = "b"
7744  *                 elif t == NPY_UBYTE:       f = "B"             # <<<<<<<<<<<<<<
7745  *                 elif t == NPY_SHORT:       f = "h"
7746  *                 elif t == NPY_USHORT:      f = "H"
7747  */
7748       __pyx_v_f = ((char *)"B");
7749       break;
7750       case NPY_SHORT:
7751 
7752       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":309
7753  *                 if   t == NPY_BYTE:        f = "b"
7754  *                 elif t == NPY_UBYTE:       f = "B"
7755  *                 elif t == NPY_SHORT:       f = "h"             # <<<<<<<<<<<<<<
7756  *                 elif t == NPY_USHORT:      f = "H"
7757  *                 elif t == NPY_INT:         f = "i"
7758  */
7759       __pyx_v_f = ((char *)"h");
7760       break;
7761       case NPY_USHORT:
7762 
7763       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":310
7764  *                 elif t == NPY_UBYTE:       f = "B"
7765  *                 elif t == NPY_SHORT:       f = "h"
7766  *                 elif t == NPY_USHORT:      f = "H"             # <<<<<<<<<<<<<<
7767  *                 elif t == NPY_INT:         f = "i"
7768  *                 elif t == NPY_UINT:        f = "I"
7769  */
7770       __pyx_v_f = ((char *)"H");
7771       break;
7772       case NPY_INT:
7773 
7774       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":311
7775  *                 elif t == NPY_SHORT:       f = "h"
7776  *                 elif t == NPY_USHORT:      f = "H"
7777  *                 elif t == NPY_INT:         f = "i"             # <<<<<<<<<<<<<<
7778  *                 elif t == NPY_UINT:        f = "I"
7779  *                 elif t == NPY_LONG:        f = "l"
7780  */
7781       __pyx_v_f = ((char *)"i");
7782       break;
7783       case NPY_UINT:
7784 
7785       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":312
7786  *                 elif t == NPY_USHORT:      f = "H"
7787  *                 elif t == NPY_INT:         f = "i"
7788  *                 elif t == NPY_UINT:        f = "I"             # <<<<<<<<<<<<<<
7789  *                 elif t == NPY_LONG:        f = "l"
7790  *                 elif t == NPY_ULONG:       f = "L"
7791  */
7792       __pyx_v_f = ((char *)"I");
7793       break;
7794       case NPY_LONG:
7795 
7796       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":313
7797  *                 elif t == NPY_INT:         f = "i"
7798  *                 elif t == NPY_UINT:        f = "I"
7799  *                 elif t == NPY_LONG:        f = "l"             # <<<<<<<<<<<<<<
7800  *                 elif t == NPY_ULONG:       f = "L"
7801  *                 elif t == NPY_LONGLONG:    f = "q"
7802  */
7803       __pyx_v_f = ((char *)"l");
7804       break;
7805       case NPY_ULONG:
7806 
7807       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":314
7808  *                 elif t == NPY_UINT:        f = "I"
7809  *                 elif t == NPY_LONG:        f = "l"
7810  *                 elif t == NPY_ULONG:       f = "L"             # <<<<<<<<<<<<<<
7811  *                 elif t == NPY_LONGLONG:    f = "q"
7812  *                 elif t == NPY_ULONGLONG:   f = "Q"
7813  */
7814       __pyx_v_f = ((char *)"L");
7815       break;
7816       case NPY_LONGLONG:
7817 
7818       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":315
7819  *                 elif t == NPY_LONG:        f = "l"
7820  *                 elif t == NPY_ULONG:       f = "L"
7821  *                 elif t == NPY_LONGLONG:    f = "q"             # <<<<<<<<<<<<<<
7822  *                 elif t == NPY_ULONGLONG:   f = "Q"
7823  *                 elif t == NPY_FLOAT:       f = "f"
7824  */
7825       __pyx_v_f = ((char *)"q");
7826       break;
7827       case NPY_ULONGLONG:
7828 
7829       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":316
7830  *                 elif t == NPY_ULONG:       f = "L"
7831  *                 elif t == NPY_LONGLONG:    f = "q"
7832  *                 elif t == NPY_ULONGLONG:   f = "Q"             # <<<<<<<<<<<<<<
7833  *                 elif t == NPY_FLOAT:       f = "f"
7834  *                 elif t == NPY_DOUBLE:      f = "d"
7835  */
7836       __pyx_v_f = ((char *)"Q");
7837       break;
7838       case NPY_FLOAT:
7839 
7840       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":317
7841  *                 elif t == NPY_LONGLONG:    f = "q"
7842  *                 elif t == NPY_ULONGLONG:   f = "Q"
7843  *                 elif t == NPY_FLOAT:       f = "f"             # <<<<<<<<<<<<<<
7844  *                 elif t == NPY_DOUBLE:      f = "d"
7845  *                 elif t == NPY_LONGDOUBLE:  f = "g"
7846  */
7847       __pyx_v_f = ((char *)"f");
7848       break;
7849       case NPY_DOUBLE:
7850 
7851       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":318
7852  *                 elif t == NPY_ULONGLONG:   f = "Q"
7853  *                 elif t == NPY_FLOAT:       f = "f"
7854  *                 elif t == NPY_DOUBLE:      f = "d"             # <<<<<<<<<<<<<<
7855  *                 elif t == NPY_LONGDOUBLE:  f = "g"
7856  *                 elif t == NPY_CFLOAT:      f = "Zf"
7857  */
7858       __pyx_v_f = ((char *)"d");
7859       break;
7860       case NPY_LONGDOUBLE:
7861 
7862       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":319
7863  *                 elif t == NPY_FLOAT:       f = "f"
7864  *                 elif t == NPY_DOUBLE:      f = "d"
7865  *                 elif t == NPY_LONGDOUBLE:  f = "g"             # <<<<<<<<<<<<<<
7866  *                 elif t == NPY_CFLOAT:      f = "Zf"
7867  *                 elif t == NPY_CDOUBLE:     f = "Zd"
7868  */
7869       __pyx_v_f = ((char *)"g");
7870       break;
7871       case NPY_CFLOAT:
7872 
7873       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":320
7874  *                 elif t == NPY_DOUBLE:      f = "d"
7875  *                 elif t == NPY_LONGDOUBLE:  f = "g"
7876  *                 elif t == NPY_CFLOAT:      f = "Zf"             # <<<<<<<<<<<<<<
7877  *                 elif t == NPY_CDOUBLE:     f = "Zd"
7878  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
7879  */
7880       __pyx_v_f = ((char *)"Zf");
7881       break;
7882       case NPY_CDOUBLE:
7883 
7884       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":321
7885  *                 elif t == NPY_LONGDOUBLE:  f = "g"
7886  *                 elif t == NPY_CFLOAT:      f = "Zf"
7887  *                 elif t == NPY_CDOUBLE:     f = "Zd"             # <<<<<<<<<<<<<<
7888  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
7889  *                 elif t == NPY_OBJECT:      f = "O"
7890  */
7891       __pyx_v_f = ((char *)"Zd");
7892       break;
7893       case NPY_CLONGDOUBLE:
7894 
7895       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":322
7896  *                 elif t == NPY_CFLOAT:      f = "Zf"
7897  *                 elif t == NPY_CDOUBLE:     f = "Zd"
7898  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"             # <<<<<<<<<<<<<<
7899  *                 elif t == NPY_OBJECT:      f = "O"
7900  *                 else:
7901  */
7902       __pyx_v_f = ((char *)"Zg");
7903       break;
7904       case NPY_OBJECT:
7905 
7906       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":323
7907  *                 elif t == NPY_CDOUBLE:     f = "Zd"
7908  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
7909  *                 elif t == NPY_OBJECT:      f = "O"             # <<<<<<<<<<<<<<
7910  *                 else:
7911  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
7912  */
7913       __pyx_v_f = ((char *)"O");
7914       break;
7915       default:
7916 
7917       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":325
7918  *                 elif t == NPY_OBJECT:      f = "O"
7919  *                 else:
7920  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
7921  *                 info.format = f
7922  *                 return
7923  */
7924       __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 325, __pyx_L1_error)
7925       __Pyx_GOTREF(__pyx_t_3);
7926       __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)
7927       __Pyx_GOTREF(__pyx_t_8);
7928       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7929       __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 325, __pyx_L1_error)
7930       __Pyx_GOTREF(__pyx_t_3);
7931       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7932       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7933       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7934       __PYX_ERR(1, 325, __pyx_L1_error)
7935       break;
7936     }
7937 
7938     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":326
7939  *                 else:
7940  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
7941  *                 info.format = f             # <<<<<<<<<<<<<<
7942  *                 return
7943  *             else:
7944  */
7945     __pyx_v_info->format = __pyx_v_f;
7946 
7947     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":327
7948  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
7949  *                 info.format = f
7950  *                 return             # <<<<<<<<<<<<<<
7951  *             else:
7952  *                 info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
7953  */
7954     __pyx_r = 0;
7955     goto __pyx_L0;
7956 
7957     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":302
7958  *             info.obj = self
7959  *
7960  *             if not PyDataType_HASFIELDS(descr):             # <<<<<<<<<<<<<<
7961  *                 t = descr.type_num
7962  *                 if ((descr.byteorder == c'>' and little_endian) or
7963  */
7964   }
7965 
7966   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":329
7967  *                 return
7968  *             else:
7969  *                 info.format = <char*>PyObject_Malloc(_buffer_format_string_len)             # <<<<<<<<<<<<<<
7970  *                 info.format[0] = c'^' # Native data types, manual alignment
7971  *                 offset = 0
7972  */
7973   /*else*/ {
7974     __pyx_v_info->format = ((char *)PyObject_Malloc(0xFF));
7975 
7976     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":330
7977  *             else:
7978  *                 info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
7979  *                 info.format[0] = c'^' # Native data types, manual alignment             # <<<<<<<<<<<<<<
7980  *                 offset = 0
7981  *                 f = _util_dtypestring(descr, info.format + 1,
7982  */
7983     (__pyx_v_info->format[0]) = '^';
7984 
7985     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":331
7986  *                 info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
7987  *                 info.format[0] = c'^' # Native data types, manual alignment
7988  *                 offset = 0             # <<<<<<<<<<<<<<
7989  *                 f = _util_dtypestring(descr, info.format + 1,
7990  *                                       info.format + _buffer_format_string_len,
7991  */
7992     __pyx_v_offset = 0;
7993 
7994     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":332
7995  *                 info.format[0] = c'^' # Native data types, manual alignment
7996  *                 offset = 0
7997  *                 f = _util_dtypestring(descr, info.format + 1,             # <<<<<<<<<<<<<<
7998  *                                       info.format + _buffer_format_string_len,
7999  *                                       &offset)
8000  */
8001     __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)
8002     __pyx_v_f = __pyx_t_9;
8003 
8004     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":335
8005  *                                       info.format + _buffer_format_string_len,
8006  *                                       &offset)
8007  *                 f[0] = c'\0' # Terminate format string             # <<<<<<<<<<<<<<
8008  *
8009  *         def __releasebuffer__(ndarray self, Py_buffer* info):
8010  */
8011     (__pyx_v_f[0]) = '\x00';
8012   }
8013 
8014   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":258
8015  *         # experimental exception made for __getbuffer__ and __releasebuffer__
8016  *         # -- the details of this may change.
8017  *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
8018  *             # This implementation of getbuffer is geared towards Cython
8019  *             # requirements, and does not yet fulfill the PEP.
8020  */
8021 
8022   /* function exit code */
8023   __pyx_r = 0;
8024   goto __pyx_L0;
8025   __pyx_L1_error:;
8026   __Pyx_XDECREF(__pyx_t_3);
8027   __Pyx_XDECREF(__pyx_t_8);
8028   __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8029   __pyx_r = -1;
8030   if (__pyx_v_info->obj != NULL) {
8031     __Pyx_GOTREF(__pyx_v_info->obj);
8032     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
8033   }
8034   goto __pyx_L2;
8035   __pyx_L0:;
8036   if (__pyx_v_info->obj == Py_None) {
8037     __Pyx_GOTREF(__pyx_v_info->obj);
8038     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
8039   }
8040   __pyx_L2:;
8041   __Pyx_XDECREF((PyObject *)__pyx_v_descr);
8042   __Pyx_RefNannyFinishContext();
8043   return __pyx_r;
8044 }
8045 
8046 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":337
8047  *                 f[0] = c'\0' # Terminate format string
8048  *
8049  *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
8050  *             if PyArray_HASFIELDS(self):
8051  *                 PyObject_Free(info.format)
8052  */
8053 
8054 /* Python wrapper */
8055 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)8056 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
8057   __Pyx_RefNannyDeclarations
8058   __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
8059   __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
8060 
8061   /* function exit code */
8062   __Pyx_RefNannyFinishContext();
8063 }
8064 
__pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject * __pyx_v_self,Py_buffer * __pyx_v_info)8065 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
8066   __Pyx_RefNannyDeclarations
8067   int __pyx_t_1;
8068   __Pyx_RefNannySetupContext("__releasebuffer__", 0);
8069 
8070   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":338
8071  *
8072  *         def __releasebuffer__(ndarray self, Py_buffer* info):
8073  *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
8074  *                 PyObject_Free(info.format)
8075  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
8076  */
8077   __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
8078   if (__pyx_t_1) {
8079 
8080     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":339
8081  *         def __releasebuffer__(ndarray self, Py_buffer* info):
8082  *             if PyArray_HASFIELDS(self):
8083  *                 PyObject_Free(info.format)             # <<<<<<<<<<<<<<
8084  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
8085  *                 PyObject_Free(info.strides)
8086  */
8087     PyObject_Free(__pyx_v_info->format);
8088 
8089     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":338
8090  *
8091  *         def __releasebuffer__(ndarray self, Py_buffer* info):
8092  *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
8093  *                 PyObject_Free(info.format)
8094  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
8095  */
8096   }
8097 
8098   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":340
8099  *             if PyArray_HASFIELDS(self):
8100  *                 PyObject_Free(info.format)
8101  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
8102  *                 PyObject_Free(info.strides)
8103  *                 # info.shape was stored after info.strides in the same block
8104  */
8105   __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
8106   if (__pyx_t_1) {
8107 
8108     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":341
8109  *                 PyObject_Free(info.format)
8110  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
8111  *                 PyObject_Free(info.strides)             # <<<<<<<<<<<<<<
8112  *                 # info.shape was stored after info.strides in the same block
8113  *
8114  */
8115     PyObject_Free(__pyx_v_info->strides);
8116 
8117     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":340
8118  *             if PyArray_HASFIELDS(self):
8119  *                 PyObject_Free(info.format)
8120  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
8121  *                 PyObject_Free(info.strides)
8122  *                 # info.shape was stored after info.strides in the same block
8123  */
8124   }
8125 
8126   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":337
8127  *                 f[0] = c'\0' # Terminate format string
8128  *
8129  *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
8130  *             if PyArray_HASFIELDS(self):
8131  *                 PyObject_Free(info.format)
8132  */
8133 
8134   /* function exit code */
8135   __Pyx_RefNannyFinishContext();
8136 }
8137 
8138 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":821
8139  * ctypedef npy_cdouble     complex_t
8140  *
8141  * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
8142  *     return PyArray_MultiIterNew(1, <void*>a)
8143  *
8144  */
8145 
__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject * __pyx_v_a)8146 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
8147   PyObject *__pyx_r = NULL;
8148   __Pyx_RefNannyDeclarations
8149   PyObject *__pyx_t_1 = NULL;
8150   __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
8151 
8152   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":822
8153  *
8154  * cdef inline object PyArray_MultiIterNew1(a):
8155  *     return PyArray_MultiIterNew(1, <void*>a)             # <<<<<<<<<<<<<<
8156  *
8157  * cdef inline object PyArray_MultiIterNew2(a, b):
8158  */
8159   __Pyx_XDECREF(__pyx_r);
8160   __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 822, __pyx_L1_error)
8161   __Pyx_GOTREF(__pyx_t_1);
8162   __pyx_r = __pyx_t_1;
8163   __pyx_t_1 = 0;
8164   goto __pyx_L0;
8165 
8166   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":821
8167  * ctypedef npy_cdouble     complex_t
8168  *
8169  * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
8170  *     return PyArray_MultiIterNew(1, <void*>a)
8171  *
8172  */
8173 
8174   /* function exit code */
8175   __pyx_L1_error:;
8176   __Pyx_XDECREF(__pyx_t_1);
8177   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
8178   __pyx_r = 0;
8179   __pyx_L0:;
8180   __Pyx_XGIVEREF(__pyx_r);
8181   __Pyx_RefNannyFinishContext();
8182   return __pyx_r;
8183 }
8184 
8185 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824
8186  *     return PyArray_MultiIterNew(1, <void*>a)
8187  *
8188  * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
8189  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
8190  *
8191  */
8192 
__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject * __pyx_v_a,PyObject * __pyx_v_b)8193 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
8194   PyObject *__pyx_r = NULL;
8195   __Pyx_RefNannyDeclarations
8196   PyObject *__pyx_t_1 = NULL;
8197   __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
8198 
8199   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":825
8200  *
8201  * cdef inline object PyArray_MultiIterNew2(a, b):
8202  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)             # <<<<<<<<<<<<<<
8203  *
8204  * cdef inline object PyArray_MultiIterNew3(a, b, c):
8205  */
8206   __Pyx_XDECREF(__pyx_r);
8207   __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)
8208   __Pyx_GOTREF(__pyx_t_1);
8209   __pyx_r = __pyx_t_1;
8210   __pyx_t_1 = 0;
8211   goto __pyx_L0;
8212 
8213   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824
8214  *     return PyArray_MultiIterNew(1, <void*>a)
8215  *
8216  * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
8217  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
8218  *
8219  */
8220 
8221   /* function exit code */
8222   __pyx_L1_error:;
8223   __Pyx_XDECREF(__pyx_t_1);
8224   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
8225   __pyx_r = 0;
8226   __pyx_L0:;
8227   __Pyx_XGIVEREF(__pyx_r);
8228   __Pyx_RefNannyFinishContext();
8229   return __pyx_r;
8230 }
8231 
8232 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827
8233  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
8234  *
8235  * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
8236  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
8237  *
8238  */
8239 
__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject * __pyx_v_a,PyObject * __pyx_v_b,PyObject * __pyx_v_c)8240 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
8241   PyObject *__pyx_r = NULL;
8242   __Pyx_RefNannyDeclarations
8243   PyObject *__pyx_t_1 = NULL;
8244   __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
8245 
8246   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":828
8247  *
8248  * cdef inline object PyArray_MultiIterNew3(a, b, c):
8249  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)             # <<<<<<<<<<<<<<
8250  *
8251  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
8252  */
8253   __Pyx_XDECREF(__pyx_r);
8254   __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)
8255   __Pyx_GOTREF(__pyx_t_1);
8256   __pyx_r = __pyx_t_1;
8257   __pyx_t_1 = 0;
8258   goto __pyx_L0;
8259 
8260   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827
8261  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
8262  *
8263  * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
8264  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
8265  *
8266  */
8267 
8268   /* function exit code */
8269   __pyx_L1_error:;
8270   __Pyx_XDECREF(__pyx_t_1);
8271   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
8272   __pyx_r = 0;
8273   __pyx_L0:;
8274   __Pyx_XGIVEREF(__pyx_r);
8275   __Pyx_RefNannyFinishContext();
8276   return __pyx_r;
8277 }
8278 
8279 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":830
8280  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
8281  *
8282  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
8283  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
8284  *
8285  */
8286 
__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject * __pyx_v_a,PyObject * __pyx_v_b,PyObject * __pyx_v_c,PyObject * __pyx_v_d)8287 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) {
8288   PyObject *__pyx_r = NULL;
8289   __Pyx_RefNannyDeclarations
8290   PyObject *__pyx_t_1 = NULL;
8291   __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
8292 
8293   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831
8294  *
8295  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
8296  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)             # <<<<<<<<<<<<<<
8297  *
8298  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
8299  */
8300   __Pyx_XDECREF(__pyx_r);
8301   __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)
8302   __Pyx_GOTREF(__pyx_t_1);
8303   __pyx_r = __pyx_t_1;
8304   __pyx_t_1 = 0;
8305   goto __pyx_L0;
8306 
8307   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":830
8308  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
8309  *
8310  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
8311  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
8312  *
8313  */
8314 
8315   /* function exit code */
8316   __pyx_L1_error:;
8317   __Pyx_XDECREF(__pyx_t_1);
8318   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
8319   __pyx_r = 0;
8320   __pyx_L0:;
8321   __Pyx_XGIVEREF(__pyx_r);
8322   __Pyx_RefNannyFinishContext();
8323   return __pyx_r;
8324 }
8325 
8326 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833
8327  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
8328  *
8329  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
8330  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
8331  *
8332  */
8333 
__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)8334 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) {
8335   PyObject *__pyx_r = NULL;
8336   __Pyx_RefNannyDeclarations
8337   PyObject *__pyx_t_1 = NULL;
8338   __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
8339 
8340   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834
8341  *
8342  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
8343  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)             # <<<<<<<<<<<<<<
8344  *
8345  * cdef inline tuple PyDataType_SHAPE(dtype d):
8346  */
8347   __Pyx_XDECREF(__pyx_r);
8348   __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)
8349   __Pyx_GOTREF(__pyx_t_1);
8350   __pyx_r = __pyx_t_1;
8351   __pyx_t_1 = 0;
8352   goto __pyx_L0;
8353 
8354   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833
8355  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
8356  *
8357  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
8358  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
8359  *
8360  */
8361 
8362   /* function exit code */
8363   __pyx_L1_error:;
8364   __Pyx_XDECREF(__pyx_t_1);
8365   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
8366   __pyx_r = 0;
8367   __pyx_L0:;
8368   __Pyx_XGIVEREF(__pyx_r);
8369   __Pyx_RefNannyFinishContext();
8370   return __pyx_r;
8371 }
8372 
8373 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":836
8374  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
8375  *
8376  * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
8377  *     if PyDataType_HASSUBARRAY(d):
8378  *         return <tuple>d.subarray.shape
8379  */
8380 
__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr * __pyx_v_d)8381 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
8382   PyObject *__pyx_r = NULL;
8383   __Pyx_RefNannyDeclarations
8384   int __pyx_t_1;
8385   __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
8386 
8387   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837
8388  *
8389  * cdef inline tuple PyDataType_SHAPE(dtype d):
8390  *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
8391  *         return <tuple>d.subarray.shape
8392  *     else:
8393  */
8394   __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
8395   if (__pyx_t_1) {
8396 
8397     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":838
8398  * cdef inline tuple PyDataType_SHAPE(dtype d):
8399  *     if PyDataType_HASSUBARRAY(d):
8400  *         return <tuple>d.subarray.shape             # <<<<<<<<<<<<<<
8401  *     else:
8402  *         return ()
8403  */
8404     __Pyx_XDECREF(__pyx_r);
8405     __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
8406     __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
8407     goto __pyx_L0;
8408 
8409     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837
8410  *
8411  * cdef inline tuple PyDataType_SHAPE(dtype d):
8412  *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
8413  *         return <tuple>d.subarray.shape
8414  *     else:
8415  */
8416   }
8417 
8418   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":840
8419  *         return <tuple>d.subarray.shape
8420  *     else:
8421  *         return ()             # <<<<<<<<<<<<<<
8422  *
8423  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
8424  */
8425   /*else*/ {
8426     __Pyx_XDECREF(__pyx_r);
8427     __Pyx_INCREF(__pyx_empty_tuple);
8428     __pyx_r = __pyx_empty_tuple;
8429     goto __pyx_L0;
8430   }
8431 
8432   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":836
8433  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
8434  *
8435  * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
8436  *     if PyDataType_HASSUBARRAY(d):
8437  *         return <tuple>d.subarray.shape
8438  */
8439 
8440   /* function exit code */
8441   __pyx_L0:;
8442   __Pyx_XGIVEREF(__pyx_r);
8443   __Pyx_RefNannyFinishContext();
8444   return __pyx_r;
8445 }
8446 
8447 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842
8448  *         return ()
8449  *
8450  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
8451  *     # Recursive utility function used in __getbuffer__ to get format
8452  *     # string. The new location in the format string is returned.
8453  */
8454 
__pyx_f_5numpy__util_dtypestring(PyArray_Descr * __pyx_v_descr,char * __pyx_v_f,char * __pyx_v_end,int * __pyx_v_offset)8455 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) {
8456   PyArray_Descr *__pyx_v_child = 0;
8457   int __pyx_v_endian_detector;
8458   int __pyx_v_little_endian;
8459   PyObject *__pyx_v_fields = 0;
8460   PyObject *__pyx_v_childname = NULL;
8461   PyObject *__pyx_v_new_offset = NULL;
8462   PyObject *__pyx_v_t = NULL;
8463   char *__pyx_r;
8464   __Pyx_RefNannyDeclarations
8465   PyObject *__pyx_t_1 = NULL;
8466   Py_ssize_t __pyx_t_2;
8467   PyObject *__pyx_t_3 = NULL;
8468   PyObject *__pyx_t_4 = NULL;
8469   int __pyx_t_5;
8470   int __pyx_t_6;
8471   int __pyx_t_7;
8472   long __pyx_t_8;
8473   char *__pyx_t_9;
8474   __Pyx_RefNannySetupContext("_util_dtypestring", 0);
8475 
8476   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":847
8477  *
8478  *     cdef dtype child
8479  *     cdef int endian_detector = 1             # <<<<<<<<<<<<<<
8480  *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
8481  *     cdef tuple fields
8482  */
8483   __pyx_v_endian_detector = 1;
8484 
8485   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":848
8486  *     cdef dtype child
8487  *     cdef int endian_detector = 1
8488  *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
8489  *     cdef tuple fields
8490  *
8491  */
8492   __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
8493 
8494   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851
8495  *     cdef tuple fields
8496  *
8497  *     for childname in descr.names:             # <<<<<<<<<<<<<<
8498  *         fields = descr.fields[childname]
8499  *         child, new_offset = fields
8500  */
8501   if (unlikely(__pyx_v_descr->names == Py_None)) {
8502     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
8503     __PYX_ERR(1, 851, __pyx_L1_error)
8504   }
8505   __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
8506   for (;;) {
8507     if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
8508     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8509     __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)
8510     #else
8511     __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)
8512     __Pyx_GOTREF(__pyx_t_3);
8513     #endif
8514     __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
8515     __pyx_t_3 = 0;
8516 
8517     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":852
8518  *
8519  *     for childname in descr.names:
8520  *         fields = descr.fields[childname]             # <<<<<<<<<<<<<<
8521  *         child, new_offset = fields
8522  *
8523  */
8524     if (unlikely(__pyx_v_descr->fields == Py_None)) {
8525       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
8526       __PYX_ERR(1, 852, __pyx_L1_error)
8527     }
8528     __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)
8529     __Pyx_GOTREF(__pyx_t_3);
8530     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)
8531     __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
8532     __pyx_t_3 = 0;
8533 
8534     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":853
8535  *     for childname in descr.names:
8536  *         fields = descr.fields[childname]
8537  *         child, new_offset = fields             # <<<<<<<<<<<<<<
8538  *
8539  *         if (end - f) - <int>(new_offset - offset[0]) < 15:
8540  */
8541     if (likely(__pyx_v_fields != Py_None)) {
8542       PyObject* sequence = __pyx_v_fields;
8543       Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
8544       if (unlikely(size != 2)) {
8545         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
8546         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
8547         __PYX_ERR(1, 853, __pyx_L1_error)
8548       }
8549       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8550       __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
8551       __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
8552       __Pyx_INCREF(__pyx_t_3);
8553       __Pyx_INCREF(__pyx_t_4);
8554       #else
8555       __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 853, __pyx_L1_error)
8556       __Pyx_GOTREF(__pyx_t_3);
8557       __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 853, __pyx_L1_error)
8558       __Pyx_GOTREF(__pyx_t_4);
8559       #endif
8560     } else {
8561       __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 853, __pyx_L1_error)
8562     }
8563     if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 853, __pyx_L1_error)
8564     __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
8565     __pyx_t_3 = 0;
8566     __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
8567     __pyx_t_4 = 0;
8568 
8569     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855
8570  *         child, new_offset = fields
8571  *
8572  *         if (end - f) - <int>(new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
8573  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
8574  *
8575  */
8576     __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 855, __pyx_L1_error)
8577     __Pyx_GOTREF(__pyx_t_4);
8578     __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 855, __pyx_L1_error)
8579     __Pyx_GOTREF(__pyx_t_3);
8580     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8581     __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)
8582     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8583     __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
8584     if (unlikely(__pyx_t_6)) {
8585 
8586       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856
8587  *
8588  *         if (end - f) - <int>(new_offset - offset[0]) < 15:
8589  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
8590  *
8591  *         if ((child.byteorder == c'>' and little_endian) or
8592  */
8593       __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 856, __pyx_L1_error)
8594       __Pyx_GOTREF(__pyx_t_3);
8595       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8596       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8597       __PYX_ERR(1, 856, __pyx_L1_error)
8598 
8599       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855
8600  *         child, new_offset = fields
8601  *
8602  *         if (end - f) - <int>(new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
8603  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
8604  *
8605  */
8606     }
8607 
8608     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858
8609  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
8610  *
8611  *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
8612  *             (child.byteorder == c'<' and not little_endian)):
8613  *             raise ValueError(u"Non-native byte order not supported")
8614  */
8615     __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
8616     if (!__pyx_t_7) {
8617       goto __pyx_L8_next_or;
8618     } else {
8619     }
8620     __pyx_t_7 = (__pyx_v_little_endian != 0);
8621     if (!__pyx_t_7) {
8622     } else {
8623       __pyx_t_6 = __pyx_t_7;
8624       goto __pyx_L7_bool_binop_done;
8625     }
8626     __pyx_L8_next_or:;
8627 
8628     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":859
8629  *
8630  *         if ((child.byteorder == c'>' and little_endian) or
8631  *             (child.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
8632  *             raise ValueError(u"Non-native byte order not supported")
8633  *             # One could encode it in the format string and have Cython
8634  */
8635     __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
8636     if (__pyx_t_7) {
8637     } else {
8638       __pyx_t_6 = __pyx_t_7;
8639       goto __pyx_L7_bool_binop_done;
8640     }
8641     __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
8642     __pyx_t_6 = __pyx_t_7;
8643     __pyx_L7_bool_binop_done:;
8644 
8645     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858
8646  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
8647  *
8648  *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
8649  *             (child.byteorder == c'<' and not little_endian)):
8650  *             raise ValueError(u"Non-native byte order not supported")
8651  */
8652     if (unlikely(__pyx_t_6)) {
8653 
8654       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":860
8655  *         if ((child.byteorder == c'>' and little_endian) or
8656  *             (child.byteorder == c'<' and not little_endian)):
8657  *             raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
8658  *             # One could encode it in the format string and have Cython
8659  *             # complain instead, BUT: < and > in format strings also imply
8660  */
8661       __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 860, __pyx_L1_error)
8662       __Pyx_GOTREF(__pyx_t_3);
8663       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8664       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8665       __PYX_ERR(1, 860, __pyx_L1_error)
8666 
8667       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858
8668  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
8669  *
8670  *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
8671  *             (child.byteorder == c'<' and not little_endian)):
8672  *             raise ValueError(u"Non-native byte order not supported")
8673  */
8674     }
8675 
8676     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":870
8677  *
8678  *         # Output padding bytes
8679  *         while offset[0] < new_offset:             # <<<<<<<<<<<<<<
8680  *             f[0] = 120 # "x"; pad byte
8681  *             f += 1
8682  */
8683     while (1) {
8684       __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 870, __pyx_L1_error)
8685       __Pyx_GOTREF(__pyx_t_3);
8686       __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)
8687       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8688       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 870, __pyx_L1_error)
8689       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8690       if (!__pyx_t_6) break;
8691 
8692       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":871
8693  *         # Output padding bytes
8694  *         while offset[0] < new_offset:
8695  *             f[0] = 120 # "x"; pad byte             # <<<<<<<<<<<<<<
8696  *             f += 1
8697  *             offset[0] += 1
8698  */
8699       (__pyx_v_f[0]) = 0x78;
8700 
8701       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":872
8702  *         while offset[0] < new_offset:
8703  *             f[0] = 120 # "x"; pad byte
8704  *             f += 1             # <<<<<<<<<<<<<<
8705  *             offset[0] += 1
8706  *
8707  */
8708       __pyx_v_f = (__pyx_v_f + 1);
8709 
8710       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":873
8711  *             f[0] = 120 # "x"; pad byte
8712  *             f += 1
8713  *             offset[0] += 1             # <<<<<<<<<<<<<<
8714  *
8715  *         offset[0] += child.itemsize
8716  */
8717       __pyx_t_8 = 0;
8718       (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
8719     }
8720 
8721     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":875
8722  *             offset[0] += 1
8723  *
8724  *         offset[0] += child.itemsize             # <<<<<<<<<<<<<<
8725  *
8726  *         if not PyDataType_HASFIELDS(child):
8727  */
8728     __pyx_t_8 = 0;
8729     (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
8730 
8731     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":877
8732  *         offset[0] += child.itemsize
8733  *
8734  *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
8735  *             t = child.type_num
8736  *             if end - f < 5:
8737  */
8738     __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
8739     if (__pyx_t_6) {
8740 
8741       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":878
8742  *
8743  *         if not PyDataType_HASFIELDS(child):
8744  *             t = child.type_num             # <<<<<<<<<<<<<<
8745  *             if end - f < 5:
8746  *                 raise RuntimeError(u"Format string allocated too short.")
8747  */
8748       __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 878, __pyx_L1_error)
8749       __Pyx_GOTREF(__pyx_t_4);
8750       __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
8751       __pyx_t_4 = 0;
8752 
8753       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":879
8754  *         if not PyDataType_HASFIELDS(child):
8755  *             t = child.type_num
8756  *             if end - f < 5:             # <<<<<<<<<<<<<<
8757  *                 raise RuntimeError(u"Format string allocated too short.")
8758  *
8759  */
8760       __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
8761       if (unlikely(__pyx_t_6)) {
8762 
8763         /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":880
8764  *             t = child.type_num
8765  *             if end - f < 5:
8766  *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
8767  *
8768  *             # Until ticket #99 is fixed, use integers to avoid warnings
8769  */
8770         __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 880, __pyx_L1_error)
8771         __Pyx_GOTREF(__pyx_t_4);
8772         __Pyx_Raise(__pyx_t_4, 0, 0, 0);
8773         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8774         __PYX_ERR(1, 880, __pyx_L1_error)
8775 
8776         /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":879
8777  *         if not PyDataType_HASFIELDS(child):
8778  *             t = child.type_num
8779  *             if end - f < 5:             # <<<<<<<<<<<<<<
8780  *                 raise RuntimeError(u"Format string allocated too short.")
8781  *
8782  */
8783       }
8784 
8785       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":883
8786  *
8787  *             # Until ticket #99 is fixed, use integers to avoid warnings
8788  *             if   t == NPY_BYTE:        f[0] =  98 #"b"             # <<<<<<<<<<<<<<
8789  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
8790  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
8791  */
8792       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 883, __pyx_L1_error)
8793       __Pyx_GOTREF(__pyx_t_4);
8794       __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)
8795       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8796       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 883, __pyx_L1_error)
8797       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8798       if (__pyx_t_6) {
8799         (__pyx_v_f[0]) = 98;
8800         goto __pyx_L15;
8801       }
8802 
8803       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":884
8804  *             # Until ticket #99 is fixed, use integers to avoid warnings
8805  *             if   t == NPY_BYTE:        f[0] =  98 #"b"
8806  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"             # <<<<<<<<<<<<<<
8807  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
8808  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
8809  */
8810       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 884, __pyx_L1_error)
8811       __Pyx_GOTREF(__pyx_t_3);
8812       __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)
8813       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8814       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 884, __pyx_L1_error)
8815       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8816       if (__pyx_t_6) {
8817         (__pyx_v_f[0]) = 66;
8818         goto __pyx_L15;
8819       }
8820 
8821       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":885
8822  *             if   t == NPY_BYTE:        f[0] =  98 #"b"
8823  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
8824  *             elif t == NPY_SHORT:       f[0] = 104 #"h"             # <<<<<<<<<<<<<<
8825  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
8826  *             elif t == NPY_INT:         f[0] = 105 #"i"
8827  */
8828       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 885, __pyx_L1_error)
8829       __Pyx_GOTREF(__pyx_t_4);
8830       __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)
8831       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8832       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 885, __pyx_L1_error)
8833       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8834       if (__pyx_t_6) {
8835         (__pyx_v_f[0]) = 0x68;
8836         goto __pyx_L15;
8837       }
8838 
8839       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":886
8840  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
8841  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
8842  *             elif t == NPY_USHORT:      f[0] =  72 #"H"             # <<<<<<<<<<<<<<
8843  *             elif t == NPY_INT:         f[0] = 105 #"i"
8844  *             elif t == NPY_UINT:        f[0] =  73 #"I"
8845  */
8846       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 886, __pyx_L1_error)
8847       __Pyx_GOTREF(__pyx_t_3);
8848       __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)
8849       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8850       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 886, __pyx_L1_error)
8851       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8852       if (__pyx_t_6) {
8853         (__pyx_v_f[0]) = 72;
8854         goto __pyx_L15;
8855       }
8856 
8857       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":887
8858  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
8859  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
8860  *             elif t == NPY_INT:         f[0] = 105 #"i"             # <<<<<<<<<<<<<<
8861  *             elif t == NPY_UINT:        f[0] =  73 #"I"
8862  *             elif t == NPY_LONG:        f[0] = 108 #"l"
8863  */
8864       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 887, __pyx_L1_error)
8865       __Pyx_GOTREF(__pyx_t_4);
8866       __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)
8867       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8868       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 887, __pyx_L1_error)
8869       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8870       if (__pyx_t_6) {
8871         (__pyx_v_f[0]) = 0x69;
8872         goto __pyx_L15;
8873       }
8874 
8875       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":888
8876  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
8877  *             elif t == NPY_INT:         f[0] = 105 #"i"
8878  *             elif t == NPY_UINT:        f[0] =  73 #"I"             # <<<<<<<<<<<<<<
8879  *             elif t == NPY_LONG:        f[0] = 108 #"l"
8880  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
8881  */
8882       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 888, __pyx_L1_error)
8883       __Pyx_GOTREF(__pyx_t_3);
8884       __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)
8885       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8886       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 888, __pyx_L1_error)
8887       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8888       if (__pyx_t_6) {
8889         (__pyx_v_f[0]) = 73;
8890         goto __pyx_L15;
8891       }
8892 
8893       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":889
8894  *             elif t == NPY_INT:         f[0] = 105 #"i"
8895  *             elif t == NPY_UINT:        f[0] =  73 #"I"
8896  *             elif t == NPY_LONG:        f[0] = 108 #"l"             # <<<<<<<<<<<<<<
8897  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
8898  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
8899  */
8900       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 889, __pyx_L1_error)
8901       __Pyx_GOTREF(__pyx_t_4);
8902       __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)
8903       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8904       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 889, __pyx_L1_error)
8905       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8906       if (__pyx_t_6) {
8907         (__pyx_v_f[0]) = 0x6C;
8908         goto __pyx_L15;
8909       }
8910 
8911       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":890
8912  *             elif t == NPY_UINT:        f[0] =  73 #"I"
8913  *             elif t == NPY_LONG:        f[0] = 108 #"l"
8914  *             elif t == NPY_ULONG:       f[0] = 76  #"L"             # <<<<<<<<<<<<<<
8915  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
8916  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
8917  */
8918       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 890, __pyx_L1_error)
8919       __Pyx_GOTREF(__pyx_t_3);
8920       __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)
8921       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8922       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 890, __pyx_L1_error)
8923       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8924       if (__pyx_t_6) {
8925         (__pyx_v_f[0]) = 76;
8926         goto __pyx_L15;
8927       }
8928 
8929       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":891
8930  *             elif t == NPY_LONG:        f[0] = 108 #"l"
8931  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
8932  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"             # <<<<<<<<<<<<<<
8933  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
8934  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
8935  */
8936       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 891, __pyx_L1_error)
8937       __Pyx_GOTREF(__pyx_t_4);
8938       __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)
8939       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8940       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 891, __pyx_L1_error)
8941       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8942       if (__pyx_t_6) {
8943         (__pyx_v_f[0]) = 0x71;
8944         goto __pyx_L15;
8945       }
8946 
8947       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":892
8948  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
8949  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
8950  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"             # <<<<<<<<<<<<<<
8951  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
8952  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
8953  */
8954       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 892, __pyx_L1_error)
8955       __Pyx_GOTREF(__pyx_t_3);
8956       __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)
8957       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8958       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 892, __pyx_L1_error)
8959       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8960       if (__pyx_t_6) {
8961         (__pyx_v_f[0]) = 81;
8962         goto __pyx_L15;
8963       }
8964 
8965       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":893
8966  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
8967  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
8968  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"             # <<<<<<<<<<<<<<
8969  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
8970  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
8971  */
8972       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 893, __pyx_L1_error)
8973       __Pyx_GOTREF(__pyx_t_4);
8974       __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)
8975       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8976       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 893, __pyx_L1_error)
8977       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8978       if (__pyx_t_6) {
8979         (__pyx_v_f[0]) = 0x66;
8980         goto __pyx_L15;
8981       }
8982 
8983       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":894
8984  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
8985  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
8986  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"             # <<<<<<<<<<<<<<
8987  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
8988  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
8989  */
8990       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 894, __pyx_L1_error)
8991       __Pyx_GOTREF(__pyx_t_3);
8992       __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)
8993       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8994       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 894, __pyx_L1_error)
8995       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8996       if (__pyx_t_6) {
8997         (__pyx_v_f[0]) = 0x64;
8998         goto __pyx_L15;
8999       }
9000 
9001       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":895
9002  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
9003  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
9004  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"             # <<<<<<<<<<<<<<
9005  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
9006  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
9007  */
9008       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 895, __pyx_L1_error)
9009       __Pyx_GOTREF(__pyx_t_4);
9010       __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)
9011       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9012       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 895, __pyx_L1_error)
9013       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9014       if (__pyx_t_6) {
9015         (__pyx_v_f[0]) = 0x67;
9016         goto __pyx_L15;
9017       }
9018 
9019       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":896
9020  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
9021  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
9022  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf             # <<<<<<<<<<<<<<
9023  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
9024  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
9025  */
9026       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 896, __pyx_L1_error)
9027       __Pyx_GOTREF(__pyx_t_3);
9028       __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)
9029       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9030       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 896, __pyx_L1_error)
9031       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9032       if (__pyx_t_6) {
9033         (__pyx_v_f[0]) = 90;
9034         (__pyx_v_f[1]) = 0x66;
9035         __pyx_v_f = (__pyx_v_f + 1);
9036         goto __pyx_L15;
9037       }
9038 
9039       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":897
9040  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
9041  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
9042  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd             # <<<<<<<<<<<<<<
9043  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
9044  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
9045  */
9046       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 897, __pyx_L1_error)
9047       __Pyx_GOTREF(__pyx_t_4);
9048       __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)
9049       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9050       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 897, __pyx_L1_error)
9051       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9052       if (__pyx_t_6) {
9053         (__pyx_v_f[0]) = 90;
9054         (__pyx_v_f[1]) = 0x64;
9055         __pyx_v_f = (__pyx_v_f + 1);
9056         goto __pyx_L15;
9057       }
9058 
9059       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":898
9060  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
9061  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
9062  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg             # <<<<<<<<<<<<<<
9063  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
9064  *             else:
9065  */
9066       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 898, __pyx_L1_error)
9067       __Pyx_GOTREF(__pyx_t_3);
9068       __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)
9069       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9070       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 898, __pyx_L1_error)
9071       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9072       if (__pyx_t_6) {
9073         (__pyx_v_f[0]) = 90;
9074         (__pyx_v_f[1]) = 0x67;
9075         __pyx_v_f = (__pyx_v_f + 1);
9076         goto __pyx_L15;
9077       }
9078 
9079       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":899
9080  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
9081  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
9082  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"             # <<<<<<<<<<<<<<
9083  *             else:
9084  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
9085  */
9086       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 899, __pyx_L1_error)
9087       __Pyx_GOTREF(__pyx_t_4);
9088       __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)
9089       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9090       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 899, __pyx_L1_error)
9091       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9092       if (likely(__pyx_t_6)) {
9093         (__pyx_v_f[0]) = 79;
9094         goto __pyx_L15;
9095       }
9096 
9097       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":901
9098  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
9099  *             else:
9100  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
9101  *             f += 1
9102  *         else:
9103  */
9104       /*else*/ {
9105         __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)
9106         __Pyx_GOTREF(__pyx_t_3);
9107         __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 901, __pyx_L1_error)
9108         __Pyx_GOTREF(__pyx_t_4);
9109         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9110         __Pyx_Raise(__pyx_t_4, 0, 0, 0);
9111         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9112         __PYX_ERR(1, 901, __pyx_L1_error)
9113       }
9114       __pyx_L15:;
9115 
9116       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":902
9117  *             else:
9118  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
9119  *             f += 1             # <<<<<<<<<<<<<<
9120  *         else:
9121  *             # Cython ignores struct boundary information ("T{...}"),
9122  */
9123       __pyx_v_f = (__pyx_v_f + 1);
9124 
9125       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":877
9126  *         offset[0] += child.itemsize
9127  *
9128  *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
9129  *             t = child.type_num
9130  *             if end - f < 5:
9131  */
9132       goto __pyx_L13;
9133     }
9134 
9135     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":906
9136  *             # Cython ignores struct boundary information ("T{...}"),
9137  *             # so don't output it
9138  *             f = _util_dtypestring(child, f, end, offset)             # <<<<<<<<<<<<<<
9139  *     return f
9140  *
9141  */
9142     /*else*/ {
9143       __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)
9144       __pyx_v_f = __pyx_t_9;
9145     }
9146     __pyx_L13:;
9147 
9148     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851
9149  *     cdef tuple fields
9150  *
9151  *     for childname in descr.names:             # <<<<<<<<<<<<<<
9152  *         fields = descr.fields[childname]
9153  *         child, new_offset = fields
9154  */
9155   }
9156   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9157 
9158   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":907
9159  *             # so don't output it
9160  *             f = _util_dtypestring(child, f, end, offset)
9161  *     return f             # <<<<<<<<<<<<<<
9162  *
9163  *
9164  */
9165   __pyx_r = __pyx_v_f;
9166   goto __pyx_L0;
9167 
9168   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842
9169  *         return ()
9170  *
9171  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
9172  *     # Recursive utility function used in __getbuffer__ to get format
9173  *     # string. The new location in the format string is returned.
9174  */
9175 
9176   /* function exit code */
9177   __pyx_L1_error:;
9178   __Pyx_XDECREF(__pyx_t_1);
9179   __Pyx_XDECREF(__pyx_t_3);
9180   __Pyx_XDECREF(__pyx_t_4);
9181   __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
9182   __pyx_r = NULL;
9183   __pyx_L0:;
9184   __Pyx_XDECREF((PyObject *)__pyx_v_child);
9185   __Pyx_XDECREF(__pyx_v_fields);
9186   __Pyx_XDECREF(__pyx_v_childname);
9187   __Pyx_XDECREF(__pyx_v_new_offset);
9188   __Pyx_XDECREF(__pyx_v_t);
9189   __Pyx_RefNannyFinishContext();
9190   return __pyx_r;
9191 }
9192 
9193 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1022
9194  *     int _import_umath() except -1
9195  *
9196  * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
9197  *     Py_INCREF(base) # important to do this before stealing the reference below!
9198  *     PyArray_SetBaseObject(arr, base)
9199  */
9200 
__pyx_f_5numpy_set_array_base(PyArrayObject * __pyx_v_arr,PyObject * __pyx_v_base)9201 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
9202   __Pyx_RefNannyDeclarations
9203   __Pyx_RefNannySetupContext("set_array_base", 0);
9204 
9205   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1023
9206  *
9207  * cdef inline void set_array_base(ndarray arr, object base):
9208  *     Py_INCREF(base) # important to do this before stealing the reference below!             # <<<<<<<<<<<<<<
9209  *     PyArray_SetBaseObject(arr, base)
9210  *
9211  */
9212   Py_INCREF(__pyx_v_base);
9213 
9214   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1024
9215  * cdef inline void set_array_base(ndarray arr, object base):
9216  *     Py_INCREF(base) # important to do this before stealing the reference below!
9217  *     PyArray_SetBaseObject(arr, base)             # <<<<<<<<<<<<<<
9218  *
9219  * cdef inline object get_array_base(ndarray arr):
9220  */
9221   (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
9222 
9223   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1022
9224  *     int _import_umath() except -1
9225  *
9226  * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
9227  *     Py_INCREF(base) # important to do this before stealing the reference below!
9228  *     PyArray_SetBaseObject(arr, base)
9229  */
9230 
9231   /* function exit code */
9232   __Pyx_RefNannyFinishContext();
9233 }
9234 
9235 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1026
9236  *     PyArray_SetBaseObject(arr, base)
9237  *
9238  * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
9239  *     base = PyArray_BASE(arr)
9240  *     if base is NULL:
9241  */
9242 
__pyx_f_5numpy_get_array_base(PyArrayObject * __pyx_v_arr)9243 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
9244   PyObject *__pyx_v_base;
9245   PyObject *__pyx_r = NULL;
9246   __Pyx_RefNannyDeclarations
9247   int __pyx_t_1;
9248   __Pyx_RefNannySetupContext("get_array_base", 0);
9249 
9250   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1027
9251  *
9252  * cdef inline object get_array_base(ndarray arr):
9253  *     base = PyArray_BASE(arr)             # <<<<<<<<<<<<<<
9254  *     if base is NULL:
9255  *         return None
9256  */
9257   __pyx_v_base = PyArray_BASE(__pyx_v_arr);
9258 
9259   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1028
9260  * cdef inline object get_array_base(ndarray arr):
9261  *     base = PyArray_BASE(arr)
9262  *     if base is NULL:             # <<<<<<<<<<<<<<
9263  *         return None
9264  *     return <object>base
9265  */
9266   __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
9267   if (__pyx_t_1) {
9268 
9269     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1029
9270  *     base = PyArray_BASE(arr)
9271  *     if base is NULL:
9272  *         return None             # <<<<<<<<<<<<<<
9273  *     return <object>base
9274  *
9275  */
9276     __Pyx_XDECREF(__pyx_r);
9277     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9278     goto __pyx_L0;
9279 
9280     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1028
9281  * cdef inline object get_array_base(ndarray arr):
9282  *     base = PyArray_BASE(arr)
9283  *     if base is NULL:             # <<<<<<<<<<<<<<
9284  *         return None
9285  *     return <object>base
9286  */
9287   }
9288 
9289   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1030
9290  *     if base is NULL:
9291  *         return None
9292  *     return <object>base             # <<<<<<<<<<<<<<
9293  *
9294  * # Versions of the import_* functions which are more suitable for
9295  */
9296   __Pyx_XDECREF(__pyx_r);
9297   __Pyx_INCREF(((PyObject *)__pyx_v_base));
9298   __pyx_r = ((PyObject *)__pyx_v_base);
9299   goto __pyx_L0;
9300 
9301   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1026
9302  *     PyArray_SetBaseObject(arr, base)
9303  *
9304  * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
9305  *     base = PyArray_BASE(arr)
9306  *     if base is NULL:
9307  */
9308 
9309   /* function exit code */
9310   __pyx_L0:;
9311   __Pyx_XGIVEREF(__pyx_r);
9312   __Pyx_RefNannyFinishContext();
9313   return __pyx_r;
9314 }
9315 
9316 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1034
9317  * # Versions of the import_* functions which are more suitable for
9318  * # Cython code.
9319  * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
9320  *     try:
9321  *         _import_array()
9322  */
9323 
__pyx_f_5numpy_import_array(void)9324 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
9325   int __pyx_r;
9326   __Pyx_RefNannyDeclarations
9327   PyObject *__pyx_t_1 = NULL;
9328   PyObject *__pyx_t_2 = NULL;
9329   PyObject *__pyx_t_3 = NULL;
9330   int __pyx_t_4;
9331   PyObject *__pyx_t_5 = NULL;
9332   PyObject *__pyx_t_6 = NULL;
9333   PyObject *__pyx_t_7 = NULL;
9334   PyObject *__pyx_t_8 = NULL;
9335   __Pyx_RefNannySetupContext("import_array", 0);
9336 
9337   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035
9338  * # Cython code.
9339  * cdef inline int import_array() except -1:
9340  *     try:             # <<<<<<<<<<<<<<
9341  *         _import_array()
9342  *     except Exception:
9343  */
9344   {
9345     __Pyx_PyThreadState_declare
9346     __Pyx_PyThreadState_assign
9347     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
9348     __Pyx_XGOTREF(__pyx_t_1);
9349     __Pyx_XGOTREF(__pyx_t_2);
9350     __Pyx_XGOTREF(__pyx_t_3);
9351     /*try:*/ {
9352 
9353       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1036
9354  * cdef inline int import_array() except -1:
9355  *     try:
9356  *         _import_array()             # <<<<<<<<<<<<<<
9357  *     except Exception:
9358  *         raise ImportError("numpy.core.multiarray failed to import")
9359  */
9360       __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1036, __pyx_L3_error)
9361 
9362       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035
9363  * # Cython code.
9364  * cdef inline int import_array() except -1:
9365  *     try:             # <<<<<<<<<<<<<<
9366  *         _import_array()
9367  *     except Exception:
9368  */
9369     }
9370     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
9371     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
9372     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9373     goto __pyx_L8_try_end;
9374     __pyx_L3_error:;
9375 
9376     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1037
9377  *     try:
9378  *         _import_array()
9379  *     except Exception:             # <<<<<<<<<<<<<<
9380  *         raise ImportError("numpy.core.multiarray failed to import")
9381  *
9382  */
9383     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
9384     if (__pyx_t_4) {
9385       __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
9386       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1037, __pyx_L5_except_error)
9387       __Pyx_GOTREF(__pyx_t_5);
9388       __Pyx_GOTREF(__pyx_t_6);
9389       __Pyx_GOTREF(__pyx_t_7);
9390 
9391       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1038
9392  *         _import_array()
9393  *     except Exception:
9394  *         raise ImportError("numpy.core.multiarray failed to import")             # <<<<<<<<<<<<<<
9395  *
9396  * cdef inline int import_umath() except -1:
9397  */
9398       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1038, __pyx_L5_except_error)
9399       __Pyx_GOTREF(__pyx_t_8);
9400       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
9401       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9402       __PYX_ERR(1, 1038, __pyx_L5_except_error)
9403     }
9404     goto __pyx_L5_except_error;
9405     __pyx_L5_except_error:;
9406 
9407     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035
9408  * # Cython code.
9409  * cdef inline int import_array() except -1:
9410  *     try:             # <<<<<<<<<<<<<<
9411  *         _import_array()
9412  *     except Exception:
9413  */
9414     __Pyx_XGIVEREF(__pyx_t_1);
9415     __Pyx_XGIVEREF(__pyx_t_2);
9416     __Pyx_XGIVEREF(__pyx_t_3);
9417     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
9418     goto __pyx_L1_error;
9419     __pyx_L8_try_end:;
9420   }
9421 
9422   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1034
9423  * # Versions of the import_* functions which are more suitable for
9424  * # Cython code.
9425  * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
9426  *     try:
9427  *         _import_array()
9428  */
9429 
9430   /* function exit code */
9431   __pyx_r = 0;
9432   goto __pyx_L0;
9433   __pyx_L1_error:;
9434   __Pyx_XDECREF(__pyx_t_5);
9435   __Pyx_XDECREF(__pyx_t_6);
9436   __Pyx_XDECREF(__pyx_t_7);
9437   __Pyx_XDECREF(__pyx_t_8);
9438   __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
9439   __pyx_r = -1;
9440   __pyx_L0:;
9441   __Pyx_RefNannyFinishContext();
9442   return __pyx_r;
9443 }
9444 
9445 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1040
9446  *         raise ImportError("numpy.core.multiarray failed to import")
9447  *
9448  * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
9449  *     try:
9450  *         _import_umath()
9451  */
9452 
__pyx_f_5numpy_import_umath(void)9453 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
9454   int __pyx_r;
9455   __Pyx_RefNannyDeclarations
9456   PyObject *__pyx_t_1 = NULL;
9457   PyObject *__pyx_t_2 = NULL;
9458   PyObject *__pyx_t_3 = NULL;
9459   int __pyx_t_4;
9460   PyObject *__pyx_t_5 = NULL;
9461   PyObject *__pyx_t_6 = NULL;
9462   PyObject *__pyx_t_7 = NULL;
9463   PyObject *__pyx_t_8 = NULL;
9464   __Pyx_RefNannySetupContext("import_umath", 0);
9465 
9466   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041
9467  *
9468  * cdef inline int import_umath() except -1:
9469  *     try:             # <<<<<<<<<<<<<<
9470  *         _import_umath()
9471  *     except Exception:
9472  */
9473   {
9474     __Pyx_PyThreadState_declare
9475     __Pyx_PyThreadState_assign
9476     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
9477     __Pyx_XGOTREF(__pyx_t_1);
9478     __Pyx_XGOTREF(__pyx_t_2);
9479     __Pyx_XGOTREF(__pyx_t_3);
9480     /*try:*/ {
9481 
9482       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1042
9483  * cdef inline int import_umath() except -1:
9484  *     try:
9485  *         _import_umath()             # <<<<<<<<<<<<<<
9486  *     except Exception:
9487  *         raise ImportError("numpy.core.umath failed to import")
9488  */
9489       __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1042, __pyx_L3_error)
9490 
9491       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041
9492  *
9493  * cdef inline int import_umath() except -1:
9494  *     try:             # <<<<<<<<<<<<<<
9495  *         _import_umath()
9496  *     except Exception:
9497  */
9498     }
9499     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
9500     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
9501     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9502     goto __pyx_L8_try_end;
9503     __pyx_L3_error:;
9504 
9505     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1043
9506  *     try:
9507  *         _import_umath()
9508  *     except Exception:             # <<<<<<<<<<<<<<
9509  *         raise ImportError("numpy.core.umath failed to import")
9510  *
9511  */
9512     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
9513     if (__pyx_t_4) {
9514       __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
9515       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1043, __pyx_L5_except_error)
9516       __Pyx_GOTREF(__pyx_t_5);
9517       __Pyx_GOTREF(__pyx_t_6);
9518       __Pyx_GOTREF(__pyx_t_7);
9519 
9520       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1044
9521  *         _import_umath()
9522  *     except Exception:
9523  *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
9524  *
9525  * cdef inline int import_ufunc() except -1:
9526  */
9527       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1044, __pyx_L5_except_error)
9528       __Pyx_GOTREF(__pyx_t_8);
9529       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
9530       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9531       __PYX_ERR(1, 1044, __pyx_L5_except_error)
9532     }
9533     goto __pyx_L5_except_error;
9534     __pyx_L5_except_error:;
9535 
9536     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041
9537  *
9538  * cdef inline int import_umath() except -1:
9539  *     try:             # <<<<<<<<<<<<<<
9540  *         _import_umath()
9541  *     except Exception:
9542  */
9543     __Pyx_XGIVEREF(__pyx_t_1);
9544     __Pyx_XGIVEREF(__pyx_t_2);
9545     __Pyx_XGIVEREF(__pyx_t_3);
9546     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
9547     goto __pyx_L1_error;
9548     __pyx_L8_try_end:;
9549   }
9550 
9551   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1040
9552  *         raise ImportError("numpy.core.multiarray failed to import")
9553  *
9554  * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
9555  *     try:
9556  *         _import_umath()
9557  */
9558 
9559   /* function exit code */
9560   __pyx_r = 0;
9561   goto __pyx_L0;
9562   __pyx_L1_error:;
9563   __Pyx_XDECREF(__pyx_t_5);
9564   __Pyx_XDECREF(__pyx_t_6);
9565   __Pyx_XDECREF(__pyx_t_7);
9566   __Pyx_XDECREF(__pyx_t_8);
9567   __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
9568   __pyx_r = -1;
9569   __pyx_L0:;
9570   __Pyx_RefNannyFinishContext();
9571   return __pyx_r;
9572 }
9573 
9574 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1046
9575  *         raise ImportError("numpy.core.umath failed to import")
9576  *
9577  * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
9578  *     try:
9579  *         _import_umath()
9580  */
9581 
__pyx_f_5numpy_import_ufunc(void)9582 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
9583   int __pyx_r;
9584   __Pyx_RefNannyDeclarations
9585   PyObject *__pyx_t_1 = NULL;
9586   PyObject *__pyx_t_2 = NULL;
9587   PyObject *__pyx_t_3 = NULL;
9588   int __pyx_t_4;
9589   PyObject *__pyx_t_5 = NULL;
9590   PyObject *__pyx_t_6 = NULL;
9591   PyObject *__pyx_t_7 = NULL;
9592   PyObject *__pyx_t_8 = NULL;
9593   __Pyx_RefNannySetupContext("import_ufunc", 0);
9594 
9595   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047
9596  *
9597  * cdef inline int import_ufunc() except -1:
9598  *     try:             # <<<<<<<<<<<<<<
9599  *         _import_umath()
9600  *     except Exception:
9601  */
9602   {
9603     __Pyx_PyThreadState_declare
9604     __Pyx_PyThreadState_assign
9605     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
9606     __Pyx_XGOTREF(__pyx_t_1);
9607     __Pyx_XGOTREF(__pyx_t_2);
9608     __Pyx_XGOTREF(__pyx_t_3);
9609     /*try:*/ {
9610 
9611       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1048
9612  * cdef inline int import_ufunc() except -1:
9613  *     try:
9614  *         _import_umath()             # <<<<<<<<<<<<<<
9615  *     except Exception:
9616  *         raise ImportError("numpy.core.umath failed to import")
9617  */
9618       __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1048, __pyx_L3_error)
9619 
9620       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047
9621  *
9622  * cdef inline int import_ufunc() except -1:
9623  *     try:             # <<<<<<<<<<<<<<
9624  *         _import_umath()
9625  *     except Exception:
9626  */
9627     }
9628     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
9629     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
9630     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9631     goto __pyx_L8_try_end;
9632     __pyx_L3_error:;
9633 
9634     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1049
9635  *     try:
9636  *         _import_umath()
9637  *     except Exception:             # <<<<<<<<<<<<<<
9638  *         raise ImportError("numpy.core.umath failed to import")
9639  */
9640     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
9641     if (__pyx_t_4) {
9642       __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
9643       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1049, __pyx_L5_except_error)
9644       __Pyx_GOTREF(__pyx_t_5);
9645       __Pyx_GOTREF(__pyx_t_6);
9646       __Pyx_GOTREF(__pyx_t_7);
9647 
9648       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1050
9649  *         _import_umath()
9650  *     except Exception:
9651  *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
9652  */
9653       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1050, __pyx_L5_except_error)
9654       __Pyx_GOTREF(__pyx_t_8);
9655       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
9656       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9657       __PYX_ERR(1, 1050, __pyx_L5_except_error)
9658     }
9659     goto __pyx_L5_except_error;
9660     __pyx_L5_except_error:;
9661 
9662     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047
9663  *
9664  * cdef inline int import_ufunc() except -1:
9665  *     try:             # <<<<<<<<<<<<<<
9666  *         _import_umath()
9667  *     except Exception:
9668  */
9669     __Pyx_XGIVEREF(__pyx_t_1);
9670     __Pyx_XGIVEREF(__pyx_t_2);
9671     __Pyx_XGIVEREF(__pyx_t_3);
9672     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
9673     goto __pyx_L1_error;
9674     __pyx_L8_try_end:;
9675   }
9676 
9677   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1046
9678  *         raise ImportError("numpy.core.umath failed to import")
9679  *
9680  * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
9681  *     try:
9682  *         _import_umath()
9683  */
9684 
9685   /* function exit code */
9686   __pyx_r = 0;
9687   goto __pyx_L0;
9688   __pyx_L1_error:;
9689   __Pyx_XDECREF(__pyx_t_5);
9690   __Pyx_XDECREF(__pyx_t_6);
9691   __Pyx_XDECREF(__pyx_t_7);
9692   __Pyx_XDECREF(__pyx_t_8);
9693   __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
9694   __pyx_r = -1;
9695   __pyx_L0:;
9696   __Pyx_RefNannyFinishContext();
9697   return __pyx_r;
9698 }
9699 
9700 /* "oct_visitors.pxd":51
9701  *     cdef void visit(self, Oct*, np.uint8_t selected)
9702  *
9703  *     cdef inline int oind(self):             # <<<<<<<<<<<<<<
9704  *         cdef int d = (1 << self.oref)
9705  *         return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2])
9706  */
9707 
__pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_oind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor * __pyx_v_self)9708 static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_oind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self) {
9709   int __pyx_v_d;
9710   int __pyx_r;
9711   __Pyx_RefNannyDeclarations
9712   __Pyx_RefNannySetupContext("oind", 0);
9713 
9714   /* "oct_visitors.pxd":52
9715  *
9716  *     cdef inline int oind(self):
9717  *         cdef int d = (1 << self.oref)             # <<<<<<<<<<<<<<
9718  *         return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2])
9719  *
9720  */
9721   __pyx_v_d = (1 << __pyx_v_self->oref);
9722 
9723   /* "oct_visitors.pxd":53
9724  *     cdef inline int oind(self):
9725  *         cdef int d = (1 << self.oref)
9726  *         return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2])             # <<<<<<<<<<<<<<
9727  *
9728  *     cdef inline int rind(self):
9729  */
9730   __pyx_r = (((((__pyx_v_self->ind[0]) * __pyx_v_d) + (__pyx_v_self->ind[1])) * __pyx_v_d) + (__pyx_v_self->ind[2]));
9731   goto __pyx_L0;
9732 
9733   /* "oct_visitors.pxd":51
9734  *     cdef void visit(self, Oct*, np.uint8_t selected)
9735  *
9736  *     cdef inline int oind(self):             # <<<<<<<<<<<<<<
9737  *         cdef int d = (1 << self.oref)
9738  *         return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2])
9739  */
9740 
9741   /* function exit code */
9742   __pyx_L0:;
9743   __Pyx_RefNannyFinishContext();
9744   return __pyx_r;
9745 }
9746 
9747 /* "oct_visitors.pxd":55
9748  *         return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2])
9749  *
9750  *     cdef inline int rind(self):             # <<<<<<<<<<<<<<
9751  *         cdef int d = (1 << self.oref)
9752  *         return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0])
9753  */
9754 
__pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_rind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor * __pyx_v_self)9755 static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_rind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self) {
9756   int __pyx_v_d;
9757   int __pyx_r;
9758   __Pyx_RefNannyDeclarations
9759   __Pyx_RefNannySetupContext("rind", 0);
9760 
9761   /* "oct_visitors.pxd":56
9762  *
9763  *     cdef inline int rind(self):
9764  *         cdef int d = (1 << self.oref)             # <<<<<<<<<<<<<<
9765  *         return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0])
9766  *
9767  */
9768   __pyx_v_d = (1 << __pyx_v_self->oref);
9769 
9770   /* "oct_visitors.pxd":57
9771  *     cdef inline int rind(self):
9772  *         cdef int d = (1 << self.oref)
9773  *         return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0])             # <<<<<<<<<<<<<<
9774  *
9775  * cdef class CountTotalOcts(OctVisitor):
9776  */
9777   __pyx_r = (((((__pyx_v_self->ind[2]) * __pyx_v_d) + (__pyx_v_self->ind[1])) * __pyx_v_d) + (__pyx_v_self->ind[0]));
9778   goto __pyx_L0;
9779 
9780   /* "oct_visitors.pxd":55
9781  *         return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2])
9782  *
9783  *     cdef inline int rind(self):             # <<<<<<<<<<<<<<
9784  *         cdef int d = (1 << self.oref)
9785  *         return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0])
9786  */
9787 
9788   /* function exit code */
9789   __pyx_L0:;
9790   __Pyx_RefNannyFinishContext();
9791   return __pyx_r;
9792 }
9793 
9794 /* "oct_visitors.pxd":142
9795  *     cdef np.uint64_t[:] morton_ind
9796  *
9797  * cdef inline int cind(int i, int j, int k) nogil:             # <<<<<<<<<<<<<<
9798  *     # THIS ONLY WORKS FOR CHILDREN.  It is not general for zones.
9799  *     return (((i*2)+j)*2+k)
9800  */
9801 
__pyx_f_2yt_8geometry_12oct_visitors_cind(int __pyx_v_i,int __pyx_v_j,int __pyx_v_k)9802 static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_cind(int __pyx_v_i, int __pyx_v_j, int __pyx_v_k) {
9803   int __pyx_r;
9804 
9805   /* "oct_visitors.pxd":144
9806  * cdef inline int cind(int i, int j, int k) nogil:
9807  *     # THIS ONLY WORKS FOR CHILDREN.  It is not general for zones.
9808  *     return (((i*2)+j)*2+k)             # <<<<<<<<<<<<<<
9809  *
9810  * from oct_container cimport OctreeContainer
9811  */
9812   __pyx_r = ((((__pyx_v_i * 2) + __pyx_v_j) * 2) + __pyx_v_k);
9813   goto __pyx_L0;
9814 
9815   /* "oct_visitors.pxd":142
9816  *     cdef np.uint64_t[:] morton_ind
9817  *
9818  * cdef inline int cind(int i, int j, int k) nogil:             # <<<<<<<<<<<<<<
9819  *     # THIS ONLY WORKS FOR CHILDREN.  It is not general for zones.
9820  *     return (((i*2)+j)*2+k)
9821  */
9822 
9823   /* function exit code */
9824   __pyx_L0:;
9825   return __pyx_r;
9826 }
9827 
9828 /* "oct_visitors.pxd":165
9829  *     cdef void set_neighbour_info(self, Oct *o, int ishift[3])
9830  *
9831  *     cdef inline np.uint8_t neighbour_rind(self):             # <<<<<<<<<<<<<<
9832  *         cdef int d = (1 << self.oref)
9833  *         return (((self.neigh_ind[2]*d)+self.neigh_ind[1])*d+self.neigh_ind[0])
9834  */
9835 
__pyx_f_2yt_8geometry_12oct_visitors_20BaseNeighbourVisitor_neighbour_rind(struct __pyx_obj_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor * __pyx_v_self)9836 static CYTHON_INLINE __pyx_t_5numpy_uint8_t __pyx_f_2yt_8geometry_12oct_visitors_20BaseNeighbourVisitor_neighbour_rind(struct __pyx_obj_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor *__pyx_v_self) {
9837   int __pyx_v_d;
9838   __pyx_t_5numpy_uint8_t __pyx_r;
9839   __Pyx_RefNannyDeclarations
9840   __Pyx_RefNannySetupContext("neighbour_rind", 0);
9841 
9842   /* "oct_visitors.pxd":166
9843  *
9844  *     cdef inline np.uint8_t neighbour_rind(self):
9845  *         cdef int d = (1 << self.oref)             # <<<<<<<<<<<<<<
9846  *         return (((self.neigh_ind[2]*d)+self.neigh_ind[1])*d+self.neigh_ind[0])
9847  *
9848  */
9849   __pyx_v_d = (1 << __pyx_v_self->__pyx_base.oref);
9850 
9851   /* "oct_visitors.pxd":167
9852  *     cdef inline np.uint8_t neighbour_rind(self):
9853  *         cdef int d = (1 << self.oref)
9854  *         return (((self.neigh_ind[2]*d)+self.neigh_ind[1])*d+self.neigh_ind[0])             # <<<<<<<<<<<<<<
9855  *
9856  * cdef class NeighbourCellIndexVisitor(BaseNeighbourVisitor):
9857  */
9858   __pyx_r = (((((__pyx_v_self->neigh_ind[2]) * __pyx_v_d) + (__pyx_v_self->neigh_ind[1])) * __pyx_v_d) + (__pyx_v_self->neigh_ind[0]));
9859   goto __pyx_L0;
9860 
9861   /* "oct_visitors.pxd":165
9862  *     cdef void set_neighbour_info(self, Oct *o, int ishift[3])
9863  *
9864  *     cdef inline np.uint8_t neighbour_rind(self):             # <<<<<<<<<<<<<<
9865  *         cdef int d = (1 << self.oref)
9866  *         return (((self.neigh_ind[2]*d)+self.neigh_ind[1])*d+self.neigh_ind[0])
9867  */
9868 
9869   /* function exit code */
9870   __pyx_L0:;
9871   __Pyx_RefNannyFinishContext();
9872   return __pyx_r;
9873 }
9874 
9875 /* "yt/utilities/lib/fp_utils.pxd":13
9876  *
9877  *
9878  * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil:             # <<<<<<<<<<<<<<
9879  *     if i0 > i1: return i0
9880  *     return i1
9881  */
9882 
__pyx_f_2yt_9utilities_3lib_8fp_utils_imax(__pyx_t_5numpy_int64_t __pyx_v_i0,__pyx_t_5numpy_int64_t __pyx_v_i1)9883 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) {
9884   __pyx_t_5numpy_int64_t __pyx_r;
9885   int __pyx_t_1;
9886 
9887   /* "yt/utilities/lib/fp_utils.pxd":14
9888  *
9889  * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil:
9890  *     if i0 > i1: return i0             # <<<<<<<<<<<<<<
9891  *     return i1
9892  *
9893  */
9894   __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0);
9895   if (__pyx_t_1) {
9896     __pyx_r = __pyx_v_i0;
9897     goto __pyx_L0;
9898   }
9899 
9900   /* "yt/utilities/lib/fp_utils.pxd":15
9901  * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil:
9902  *     if i0 > i1: return i0
9903  *     return i1             # <<<<<<<<<<<<<<
9904  *
9905  * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil:
9906  */
9907   __pyx_r = __pyx_v_i1;
9908   goto __pyx_L0;
9909 
9910   /* "yt/utilities/lib/fp_utils.pxd":13
9911  *
9912  *
9913  * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil:             # <<<<<<<<<<<<<<
9914  *     if i0 > i1: return i0
9915  *     return i1
9916  */
9917 
9918   /* function exit code */
9919   __pyx_L0:;
9920   return __pyx_r;
9921 }
9922 
9923 /* "yt/utilities/lib/fp_utils.pxd":17
9924  *     return i1
9925  *
9926  * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil:             # <<<<<<<<<<<<<<
9927  *     if f0 > f1: return f0
9928  *     return f1
9929  */
9930 
__pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t __pyx_v_f0,__pyx_t_5numpy_float64_t __pyx_v_f1)9931 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) {
9932   __pyx_t_5numpy_float64_t __pyx_r;
9933   int __pyx_t_1;
9934 
9935   /* "yt/utilities/lib/fp_utils.pxd":18
9936  *
9937  * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil:
9938  *     if f0 > f1: return f0             # <<<<<<<<<<<<<<
9939  *     return f1
9940  *
9941  */
9942   __pyx_t_1 = ((__pyx_v_f0 > __pyx_v_f1) != 0);
9943   if (__pyx_t_1) {
9944     __pyx_r = __pyx_v_f0;
9945     goto __pyx_L0;
9946   }
9947 
9948   /* "yt/utilities/lib/fp_utils.pxd":19
9949  * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil:
9950  *     if f0 > f1: return f0
9951  *     return f1             # <<<<<<<<<<<<<<
9952  *
9953  * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil:
9954  */
9955   __pyx_r = __pyx_v_f1;
9956   goto __pyx_L0;
9957 
9958   /* "yt/utilities/lib/fp_utils.pxd":17
9959  *     return i1
9960  *
9961  * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil:             # <<<<<<<<<<<<<<
9962  *     if f0 > f1: return f0
9963  *     return f1
9964  */
9965 
9966   /* function exit code */
9967   __pyx_L0:;
9968   return __pyx_r;
9969 }
9970 
9971 /* "yt/utilities/lib/fp_utils.pxd":21
9972  *     return f1
9973  *
9974  * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil:             # <<<<<<<<<<<<<<
9975  *     if i0 < i1: return i0
9976  *     return i1
9977  */
9978 
__pyx_f_2yt_9utilities_3lib_8fp_utils_imin(__pyx_t_5numpy_int64_t __pyx_v_i0,__pyx_t_5numpy_int64_t __pyx_v_i1)9979 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) {
9980   __pyx_t_5numpy_int64_t __pyx_r;
9981   int __pyx_t_1;
9982 
9983   /* "yt/utilities/lib/fp_utils.pxd":22
9984  *
9985  * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil:
9986  *     if i0 < i1: return i0             # <<<<<<<<<<<<<<
9987  *     return i1
9988  *
9989  */
9990   __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0);
9991   if (__pyx_t_1) {
9992     __pyx_r = __pyx_v_i0;
9993     goto __pyx_L0;
9994   }
9995 
9996   /* "yt/utilities/lib/fp_utils.pxd":23
9997  * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil:
9998  *     if i0 < i1: return i0
9999  *     return i1             # <<<<<<<<<<<<<<
10000  *
10001  * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil:
10002  */
10003   __pyx_r = __pyx_v_i1;
10004   goto __pyx_L0;
10005 
10006   /* "yt/utilities/lib/fp_utils.pxd":21
10007  *     return f1
10008  *
10009  * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil:             # <<<<<<<<<<<<<<
10010  *     if i0 < i1: return i0
10011  *     return i1
10012  */
10013 
10014   /* function exit code */
10015   __pyx_L0:;
10016   return __pyx_r;
10017 }
10018 
10019 /* "yt/utilities/lib/fp_utils.pxd":25
10020  *     return i1
10021  *
10022  * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil:             # <<<<<<<<<<<<<<
10023  *     if f0 < f1: return f0
10024  *     return f1
10025  */
10026 
__pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t __pyx_v_f0,__pyx_t_5numpy_float64_t __pyx_v_f1)10027 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) {
10028   __pyx_t_5numpy_float64_t __pyx_r;
10029   int __pyx_t_1;
10030 
10031   /* "yt/utilities/lib/fp_utils.pxd":26
10032  *
10033  * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil:
10034  *     if f0 < f1: return f0             # <<<<<<<<<<<<<<
10035  *     return f1
10036  *
10037  */
10038   __pyx_t_1 = ((__pyx_v_f0 < __pyx_v_f1) != 0);
10039   if (__pyx_t_1) {
10040     __pyx_r = __pyx_v_f0;
10041     goto __pyx_L0;
10042   }
10043 
10044   /* "yt/utilities/lib/fp_utils.pxd":27
10045  * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil:
10046  *     if f0 < f1: return f0
10047  *     return f1             # <<<<<<<<<<<<<<
10048  *
10049  * cdef inline np.float64_t fabs(np.float64_t f0) nogil:
10050  */
10051   __pyx_r = __pyx_v_f1;
10052   goto __pyx_L0;
10053 
10054   /* "yt/utilities/lib/fp_utils.pxd":25
10055  *     return i1
10056  *
10057  * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil:             # <<<<<<<<<<<<<<
10058  *     if f0 < f1: return f0
10059  *     return f1
10060  */
10061 
10062   /* function exit code */
10063   __pyx_L0:;
10064   return __pyx_r;
10065 }
10066 
10067 /* "yt/utilities/lib/fp_utils.pxd":29
10068  *     return f1
10069  *
10070  * cdef inline np.float64_t fabs(np.float64_t f0) nogil:             # <<<<<<<<<<<<<<
10071  *     if f0 < 0.0: return -f0
10072  *     return f0
10073  */
10074 
__pyx_f_2yt_9utilities_3lib_8fp_utils_fabs(__pyx_t_5numpy_float64_t __pyx_v_f0)10075 static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fabs(__pyx_t_5numpy_float64_t __pyx_v_f0) {
10076   __pyx_t_5numpy_float64_t __pyx_r;
10077   int __pyx_t_1;
10078 
10079   /* "yt/utilities/lib/fp_utils.pxd":30
10080  *
10081  * cdef inline np.float64_t fabs(np.float64_t f0) nogil:
10082  *     if f0 < 0.0: return -f0             # <<<<<<<<<<<<<<
10083  *     return f0
10084  *
10085  */
10086   __pyx_t_1 = ((__pyx_v_f0 < 0.0) != 0);
10087   if (__pyx_t_1) {
10088     __pyx_r = (-__pyx_v_f0);
10089     goto __pyx_L0;
10090   }
10091 
10092   /* "yt/utilities/lib/fp_utils.pxd":31
10093  * cdef inline np.float64_t fabs(np.float64_t f0) nogil:
10094  *     if f0 < 0.0: return -f0
10095  *     return f0             # <<<<<<<<<<<<<<
10096  *
10097  * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:
10098  */
10099   __pyx_r = __pyx_v_f0;
10100   goto __pyx_L0;
10101 
10102   /* "yt/utilities/lib/fp_utils.pxd":29
10103  *     return f1
10104  *
10105  * cdef inline np.float64_t fabs(np.float64_t f0) nogil:             # <<<<<<<<<<<<<<
10106  *     if f0 < 0.0: return -f0
10107  *     return f0
10108  */
10109 
10110   /* function exit code */
10111   __pyx_L0:;
10112   return __pyx_r;
10113 }
10114 
10115 /* "yt/utilities/lib/fp_utils.pxd":33
10116  *     return f0
10117  *
10118  * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:             # <<<<<<<<<<<<<<
10119  *     if i < a: return a
10120  *     if i > b: return b
10121  */
10122 
__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)10123 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) {
10124   __pyx_t_5numpy_int64_t __pyx_r;
10125   int __pyx_t_1;
10126 
10127   /* "yt/utilities/lib/fp_utils.pxd":34
10128  *
10129  * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:
10130  *     if i < a: return a             # <<<<<<<<<<<<<<
10131  *     if i > b: return b
10132  *     return i
10133  */
10134   __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0);
10135   if (__pyx_t_1) {
10136     __pyx_r = __pyx_v_a;
10137     goto __pyx_L0;
10138   }
10139 
10140   /* "yt/utilities/lib/fp_utils.pxd":35
10141  * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:
10142  *     if i < a: return a
10143  *     if i > b: return b             # <<<<<<<<<<<<<<
10144  *     return i
10145  *
10146  */
10147   __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0);
10148   if (__pyx_t_1) {
10149     __pyx_r = __pyx_v_b;
10150     goto __pyx_L0;
10151   }
10152 
10153   /* "yt/utilities/lib/fp_utils.pxd":36
10154  *     if i < a: return a
10155  *     if i > b: return b
10156  *     return i             # <<<<<<<<<<<<<<
10157  *
10158  * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:
10159  */
10160   __pyx_r = __pyx_v_i;
10161   goto __pyx_L0;
10162 
10163   /* "yt/utilities/lib/fp_utils.pxd":33
10164  *     return f0
10165  *
10166  * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:             # <<<<<<<<<<<<<<
10167  *     if i < a: return a
10168  *     if i > b: return b
10169  */
10170 
10171   /* function exit code */
10172   __pyx_L0:;
10173   return __pyx_r;
10174 }
10175 
10176 /* "yt/utilities/lib/fp_utils.pxd":38
10177  *     return i
10178  *
10179  * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:             # <<<<<<<<<<<<<<
10180  *     if i < a: return a
10181  *     if i > b: return b
10182  */
10183 
__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)10184 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) {
10185   __pyx_t_5numpy_int64_t __pyx_r;
10186   int __pyx_t_1;
10187 
10188   /* "yt/utilities/lib/fp_utils.pxd":39
10189  *
10190  * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:
10191  *     if i < a: return a             # <<<<<<<<<<<<<<
10192  *     if i > b: return b
10193  *     return i
10194  */
10195   __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0);
10196   if (__pyx_t_1) {
10197     __pyx_r = __pyx_v_a;
10198     goto __pyx_L0;
10199   }
10200 
10201   /* "yt/utilities/lib/fp_utils.pxd":40
10202  * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:
10203  *     if i < a: return a
10204  *     if i > b: return b             # <<<<<<<<<<<<<<
10205  *     return i
10206  *
10207  */
10208   __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0);
10209   if (__pyx_t_1) {
10210     __pyx_r = __pyx_v_b;
10211     goto __pyx_L0;
10212   }
10213 
10214   /* "yt/utilities/lib/fp_utils.pxd":41
10215  *     if i < a: return a
10216  *     if i > b: return b
10217  *     return i             # <<<<<<<<<<<<<<
10218  *
10219  * cdef inline np.float64_t fclip(np.float64_t f,
10220  */
10221   __pyx_r = __pyx_v_i;
10222   goto __pyx_L0;
10223 
10224   /* "yt/utilities/lib/fp_utils.pxd":38
10225  *     return i
10226  *
10227  * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:             # <<<<<<<<<<<<<<
10228  *     if i < a: return a
10229  *     if i > b: return b
10230  */
10231 
10232   /* function exit code */
10233   __pyx_L0:;
10234   return __pyx_r;
10235 }
10236 
10237 /* "yt/utilities/lib/fp_utils.pxd":43
10238  *     return i
10239  *
10240  * cdef inline np.float64_t fclip(np.float64_t f,             # <<<<<<<<<<<<<<
10241  *                       np.float64_t a, np.float64_t b) nogil:
10242  *     return fmin(fmax(f, a), b)
10243  */
10244 
__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)10245 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) {
10246   __pyx_t_5numpy_float64_t __pyx_r;
10247 
10248   /* "yt/utilities/lib/fp_utils.pxd":45
10249  * cdef inline np.float64_t fclip(np.float64_t f,
10250  *                       np.float64_t a, np.float64_t b) nogil:
10251  *     return fmin(fmax(f, a), b)             # <<<<<<<<<<<<<<
10252  *
10253  * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil:
10254  */
10255   __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);
10256   goto __pyx_L0;
10257 
10258   /* "yt/utilities/lib/fp_utils.pxd":43
10259  *     return i
10260  *
10261  * cdef inline np.float64_t fclip(np.float64_t f,             # <<<<<<<<<<<<<<
10262  *                       np.float64_t a, np.float64_t b) nogil:
10263  *     return fmin(fmax(f, a), b)
10264  */
10265 
10266   /* function exit code */
10267   __pyx_L0:;
10268   return __pyx_r;
10269 }
10270 
10271 /* "yt/utilities/lib/fp_utils.pxd":47
10272  *     return fmin(fmax(f, a), b)
10273  *
10274  * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil:             # <<<<<<<<<<<<<<
10275  *     if i0 > i1: return i0
10276  *     return i1
10277  */
10278 
__pyx_f_2yt_9utilities_3lib_8fp_utils_i64max(__pyx_t_5numpy_int64_t __pyx_v_i0,__pyx_t_5numpy_int64_t __pyx_v_i1)10279 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) {
10280   __pyx_t_5numpy_int64_t __pyx_r;
10281   int __pyx_t_1;
10282 
10283   /* "yt/utilities/lib/fp_utils.pxd":48
10284  *
10285  * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil:
10286  *     if i0 > i1: return i0             # <<<<<<<<<<<<<<
10287  *     return i1
10288  *
10289  */
10290   __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0);
10291   if (__pyx_t_1) {
10292     __pyx_r = __pyx_v_i0;
10293     goto __pyx_L0;
10294   }
10295 
10296   /* "yt/utilities/lib/fp_utils.pxd":49
10297  * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil:
10298  *     if i0 > i1: return i0
10299  *     return i1             # <<<<<<<<<<<<<<
10300  *
10301  * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil:
10302  */
10303   __pyx_r = __pyx_v_i1;
10304   goto __pyx_L0;
10305 
10306   /* "yt/utilities/lib/fp_utils.pxd":47
10307  *     return fmin(fmax(f, a), b)
10308  *
10309  * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil:             # <<<<<<<<<<<<<<
10310  *     if i0 > i1: return i0
10311  *     return i1
10312  */
10313 
10314   /* function exit code */
10315   __pyx_L0:;
10316   return __pyx_r;
10317 }
10318 
10319 /* "yt/utilities/lib/fp_utils.pxd":51
10320  *     return i1
10321  *
10322  * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil:             # <<<<<<<<<<<<<<
10323  *     if i0 < i1: return i0
10324  *     return i1
10325  */
10326 
__pyx_f_2yt_9utilities_3lib_8fp_utils_i64min(__pyx_t_5numpy_int64_t __pyx_v_i0,__pyx_t_5numpy_int64_t __pyx_v_i1)10327 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) {
10328   __pyx_t_5numpy_int64_t __pyx_r;
10329   int __pyx_t_1;
10330 
10331   /* "yt/utilities/lib/fp_utils.pxd":52
10332  *
10333  * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil:
10334  *     if i0 < i1: return i0             # <<<<<<<<<<<<<<
10335  *     return i1
10336  *
10337  */
10338   __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0);
10339   if (__pyx_t_1) {
10340     __pyx_r = __pyx_v_i0;
10341     goto __pyx_L0;
10342   }
10343 
10344   /* "yt/utilities/lib/fp_utils.pxd":53
10345  * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil:
10346  *     if i0 < i1: return i0
10347  *     return i1             # <<<<<<<<<<<<<<
10348  *
10349  * cdef inline _ensure_code(arr):
10350  */
10351   __pyx_r = __pyx_v_i1;
10352   goto __pyx_L0;
10353 
10354   /* "yt/utilities/lib/fp_utils.pxd":51
10355  *     return i1
10356  *
10357  * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil:             # <<<<<<<<<<<<<<
10358  *     if i0 < i1: return i0
10359  *     return i1
10360  */
10361 
10362   /* function exit code */
10363   __pyx_L0:;
10364   return __pyx_r;
10365 }
10366 
10367 /* "yt/utilities/lib/fp_utils.pxd":55
10368  *     return i1
10369  *
10370  * cdef inline _ensure_code(arr):             # <<<<<<<<<<<<<<
10371  *     if hasattr(arr, "units"):
10372  *         if "code_length" == str(arr.units):
10373  */
10374 
__pyx_f_2yt_9utilities_3lib_8fp_utils__ensure_code(PyObject * __pyx_v_arr)10375 static CYTHON_INLINE PyObject *__pyx_f_2yt_9utilities_3lib_8fp_utils__ensure_code(PyObject *__pyx_v_arr) {
10376   PyObject *__pyx_r = NULL;
10377   __Pyx_RefNannyDeclarations
10378   int __pyx_t_1;
10379   int __pyx_t_2;
10380   PyObject *__pyx_t_3 = NULL;
10381   PyObject *__pyx_t_4 = NULL;
10382   PyObject *__pyx_t_5 = NULL;
10383   __Pyx_RefNannySetupContext("_ensure_code", 0);
10384 
10385   /* "yt/utilities/lib/fp_utils.pxd":56
10386  *
10387  * cdef inline _ensure_code(arr):
10388  *     if hasattr(arr, "units"):             # <<<<<<<<<<<<<<
10389  *         if "code_length" == str(arr.units):
10390  *             return arr
10391  */
10392   __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)
10393   __pyx_t_2 = (__pyx_t_1 != 0);
10394   if (__pyx_t_2) {
10395 
10396     /* "yt/utilities/lib/fp_utils.pxd":57
10397  * cdef inline _ensure_code(arr):
10398  *     if hasattr(arr, "units"):
10399  *         if "code_length" == str(arr.units):             # <<<<<<<<<<<<<<
10400  *             return arr
10401  *         arr.convert_to_units("code_length")
10402  */
10403     __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)
10404     __Pyx_GOTREF(__pyx_t_3);
10405     __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 57, __pyx_L1_error)
10406     __Pyx_GOTREF(__pyx_t_4);
10407     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10408     __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)
10409     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10410     if (__pyx_t_2) {
10411 
10412       /* "yt/utilities/lib/fp_utils.pxd":58
10413  *     if hasattr(arr, "units"):
10414  *         if "code_length" == str(arr.units):
10415  *             return arr             # <<<<<<<<<<<<<<
10416  *         arr.convert_to_units("code_length")
10417  *     return arr
10418  */
10419       __Pyx_XDECREF(__pyx_r);
10420       __Pyx_INCREF(__pyx_v_arr);
10421       __pyx_r = __pyx_v_arr;
10422       goto __pyx_L0;
10423 
10424       /* "yt/utilities/lib/fp_utils.pxd":57
10425  * cdef inline _ensure_code(arr):
10426  *     if hasattr(arr, "units"):
10427  *         if "code_length" == str(arr.units):             # <<<<<<<<<<<<<<
10428  *             return arr
10429  *         arr.convert_to_units("code_length")
10430  */
10431     }
10432 
10433     /* "yt/utilities/lib/fp_utils.pxd":59
10434  *         if "code_length" == str(arr.units):
10435  *             return arr
10436  *         arr.convert_to_units("code_length")             # <<<<<<<<<<<<<<
10437  *     return arr
10438  */
10439     __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)
10440     __Pyx_GOTREF(__pyx_t_3);
10441     __pyx_t_5 = NULL;
10442     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
10443       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
10444       if (likely(__pyx_t_5)) {
10445         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
10446         __Pyx_INCREF(__pyx_t_5);
10447         __Pyx_INCREF(function);
10448         __Pyx_DECREF_SET(__pyx_t_3, function);
10449       }
10450     }
10451     __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);
10452     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10453     if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 59, __pyx_L1_error)
10454     __Pyx_GOTREF(__pyx_t_4);
10455     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10456     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10457 
10458     /* "yt/utilities/lib/fp_utils.pxd":56
10459  *
10460  * cdef inline _ensure_code(arr):
10461  *     if hasattr(arr, "units"):             # <<<<<<<<<<<<<<
10462  *         if "code_length" == str(arr.units):
10463  *             return arr
10464  */
10465   }
10466 
10467   /* "yt/utilities/lib/fp_utils.pxd":60
10468  *             return arr
10469  *         arr.convert_to_units("code_length")
10470  *     return arr             # <<<<<<<<<<<<<<
10471  */
10472   __Pyx_XDECREF(__pyx_r);
10473   __Pyx_INCREF(__pyx_v_arr);
10474   __pyx_r = __pyx_v_arr;
10475   goto __pyx_L0;
10476 
10477   /* "yt/utilities/lib/fp_utils.pxd":55
10478  *     return i1
10479  *
10480  * cdef inline _ensure_code(arr):             # <<<<<<<<<<<<<<
10481  *     if hasattr(arr, "units"):
10482  *         if "code_length" == str(arr.units):
10483  */
10484 
10485   /* function exit code */
10486   __pyx_L1_error:;
10487   __Pyx_XDECREF(__pyx_t_3);
10488   __Pyx_XDECREF(__pyx_t_4);
10489   __Pyx_XDECREF(__pyx_t_5);
10490   __Pyx_AddTraceback("yt.utilities.lib.fp_utils._ensure_code", __pyx_clineno, __pyx_lineno, __pyx_filename);
10491   __pyx_r = 0;
10492   __pyx_L0:;
10493   __Pyx_XGIVEREF(__pyx_r);
10494   __Pyx_RefNannyFinishContext();
10495   return __pyx_r;
10496 }
10497 
10498 /* "yt/utilities/lib/geometry_utils.pxd":24
10499  * @cython.boundscheck(False)
10500  * @cython.wraparound(False)
10501  * cdef inline np.int64_t ifrexp(np.float64_t x, np.int64_t *e):             # <<<<<<<<<<<<<<
10502  *     cdef np.float64_t m
10503  *     cdef int e0 = 0
10504  */
10505 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_ifrexp(__pyx_t_5numpy_float64_t __pyx_v_x,__pyx_t_5numpy_int64_t * __pyx_v_e)10506 static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_ifrexp(__pyx_t_5numpy_float64_t __pyx_v_x, __pyx_t_5numpy_int64_t *__pyx_v_e) {
10507   __pyx_t_5numpy_float64_t __pyx_v_m;
10508   int __pyx_v_e0;
10509   __pyx_t_5numpy_int64_t __pyx_r;
10510   __Pyx_RefNannyDeclarations
10511   __Pyx_RefNannySetupContext("ifrexp", 0);
10512 
10513   /* "yt/utilities/lib/geometry_utils.pxd":26
10514  * cdef inline np.int64_t ifrexp(np.float64_t x, np.int64_t *e):
10515  *     cdef np.float64_t m
10516  *     cdef int e0 = 0             # <<<<<<<<<<<<<<
10517  *     m = frexp(x,&e0)
10518  *     e[0] = <np.int64_t>e0
10519  */
10520   __pyx_v_e0 = 0;
10521 
10522   /* "yt/utilities/lib/geometry_utils.pxd":27
10523  *     cdef np.float64_t m
10524  *     cdef int e0 = 0
10525  *     m = frexp(x,&e0)             # <<<<<<<<<<<<<<
10526  *     e[0] = <np.int64_t>e0
10527  *     return <np.int64_t>ldexp(m,<int>DBL_MANT_DIG)
10528  */
10529   __pyx_v_m = frexp(__pyx_v_x, (&__pyx_v_e0));
10530 
10531   /* "yt/utilities/lib/geometry_utils.pxd":28
10532  *     cdef int e0 = 0
10533  *     m = frexp(x,&e0)
10534  *     e[0] = <np.int64_t>e0             # <<<<<<<<<<<<<<
10535  *     return <np.int64_t>ldexp(m,<int>DBL_MANT_DIG)
10536  *
10537  */
10538   (__pyx_v_e[0]) = ((__pyx_t_5numpy_int64_t)__pyx_v_e0);
10539 
10540   /* "yt/utilities/lib/geometry_utils.pxd":29
10541  *     m = frexp(x,&e0)
10542  *     e[0] = <np.int64_t>e0
10543  *     return <np.int64_t>ldexp(m,<int>DBL_MANT_DIG)             # <<<<<<<<<<<<<<
10544  *
10545  * @cython.cdivision(True)
10546  */
10547   __pyx_r = ((__pyx_t_5numpy_int64_t)ldexp(__pyx_v_m, ((int)DBL_MANT_DIG)));
10548   goto __pyx_L0;
10549 
10550   /* "yt/utilities/lib/geometry_utils.pxd":24
10551  * @cython.boundscheck(False)
10552  * @cython.wraparound(False)
10553  * cdef inline np.int64_t ifrexp(np.float64_t x, np.int64_t *e):             # <<<<<<<<<<<<<<
10554  *     cdef np.float64_t m
10555  *     cdef int e0 = 0
10556  */
10557 
10558   /* function exit code */
10559   __pyx_L0:;
10560   __Pyx_RefNannyFinishContext();
10561   return __pyx_r;
10562 }
10563 
10564 /* "yt/utilities/lib/geometry_utils.pxd":34
10565  * @cython.boundscheck(False)
10566  * @cython.wraparound(False)
10567  * cdef inline np.int64_t msdb(np.int64_t a, np.int64_t b):             # <<<<<<<<<<<<<<
10568  *     """Get the most significant differing bit between a and b."""
10569  *     cdef np.int64_t c, ndx
10570  */
10571 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_msdb(__pyx_t_5numpy_int64_t __pyx_v_a,__pyx_t_5numpy_int64_t __pyx_v_b)10572 static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_msdb(__pyx_t_5numpy_int64_t __pyx_v_a, __pyx_t_5numpy_int64_t __pyx_v_b) {
10573   __pyx_t_5numpy_int64_t __pyx_v_c;
10574   __pyx_t_5numpy_int64_t __pyx_v_ndx;
10575   __pyx_t_5numpy_int64_t __pyx_r;
10576   __Pyx_RefNannyDeclarations
10577   int __pyx_t_1;
10578   __Pyx_RefNannySetupContext("msdb", 0);
10579 
10580   /* "yt/utilities/lib/geometry_utils.pxd":37
10581  *     """Get the most significant differing bit between a and b."""
10582  *     cdef np.int64_t c, ndx
10583  *     c = a ^ b             # <<<<<<<<<<<<<<
10584  *     ndx = 0
10585  *     while (0 < c):
10586  */
10587   __pyx_v_c = (__pyx_v_a ^ __pyx_v_b);
10588 
10589   /* "yt/utilities/lib/geometry_utils.pxd":38
10590  *     cdef np.int64_t c, ndx
10591  *     c = a ^ b
10592  *     ndx = 0             # <<<<<<<<<<<<<<
10593  *     while (0 < c):
10594  *         c = (c >> 1)
10595  */
10596   __pyx_v_ndx = 0;
10597 
10598   /* "yt/utilities/lib/geometry_utils.pxd":39
10599  *     c = a ^ b
10600  *     ndx = 0
10601  *     while (0 < c):             # <<<<<<<<<<<<<<
10602  *         c = (c >> 1)
10603  *         ndx+=1
10604  */
10605   while (1) {
10606     __pyx_t_1 = ((0 < __pyx_v_c) != 0);
10607     if (!__pyx_t_1) break;
10608 
10609     /* "yt/utilities/lib/geometry_utils.pxd":40
10610  *     ndx = 0
10611  *     while (0 < c):
10612  *         c = (c >> 1)             # <<<<<<<<<<<<<<
10613  *         ndx+=1
10614  *     return ndx
10615  */
10616     __pyx_v_c = (__pyx_v_c >> 1);
10617 
10618     /* "yt/utilities/lib/geometry_utils.pxd":41
10619  *     while (0 < c):
10620  *         c = (c >> 1)
10621  *         ndx+=1             # <<<<<<<<<<<<<<
10622  *     return ndx
10623  *
10624  */
10625     __pyx_v_ndx = (__pyx_v_ndx + 1);
10626   }
10627 
10628   /* "yt/utilities/lib/geometry_utils.pxd":42
10629  *         c = (c >> 1)
10630  *         ndx+=1
10631  *     return ndx             # <<<<<<<<<<<<<<
10632  *
10633  * @cython.cdivision(True)
10634  */
10635   __pyx_r = __pyx_v_ndx;
10636   goto __pyx_L0;
10637 
10638   /* "yt/utilities/lib/geometry_utils.pxd":34
10639  * @cython.boundscheck(False)
10640  * @cython.wraparound(False)
10641  * cdef inline np.int64_t msdb(np.int64_t a, np.int64_t b):             # <<<<<<<<<<<<<<
10642  *     """Get the most significant differing bit between a and b."""
10643  *     cdef np.int64_t c, ndx
10644  */
10645 
10646   /* function exit code */
10647   __pyx_L0:;
10648   __Pyx_RefNannyFinishContext();
10649   return __pyx_r;
10650 }
10651 
10652 /* "yt/utilities/lib/geometry_utils.pxd":47
10653  * @cython.boundscheck(False)
10654  * @cython.wraparound(False)
10655  * cdef inline np.int64_t xor_msb(np.float64_t a, np.float64_t b):             # <<<<<<<<<<<<<<
10656  *     """Get the exponent of the highest differing bit between a and b"""
10657  *     # Get mantissa and exponents for each number
10658  */
10659 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_xor_msb(__pyx_t_5numpy_float64_t __pyx_v_a,__pyx_t_5numpy_float64_t __pyx_v_b)10660 static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_xor_msb(__pyx_t_5numpy_float64_t __pyx_v_a, __pyx_t_5numpy_float64_t __pyx_v_b) {
10661   __pyx_t_5numpy_int64_t __pyx_v_a_m;
10662   __pyx_t_5numpy_int64_t __pyx_v_a_e;
10663   __pyx_t_5numpy_int64_t __pyx_v_b_m;
10664   __pyx_t_5numpy_int64_t __pyx_v_b_e;
10665   __pyx_t_5numpy_int64_t __pyx_v_x;
10666   __pyx_t_5numpy_int64_t __pyx_v_y;
10667   __pyx_t_5numpy_int64_t __pyx_v_z;
10668   __pyx_t_5numpy_int64_t __pyx_r;
10669   __Pyx_RefNannyDeclarations
10670   int __pyx_t_1;
10671   __Pyx_RefNannySetupContext("xor_msb", 0);
10672 
10673   /* "yt/utilities/lib/geometry_utils.pxd":51
10674  *     # Get mantissa and exponents for each number
10675  *     cdef np.int64_t a_m, a_e, b_m, b_e, x, y, z
10676  *     b_e = 0             # <<<<<<<<<<<<<<
10677  *     a_e = 0
10678  *     a_m = ifrexp(a,&a_e)
10679  */
10680   __pyx_v_b_e = 0;
10681 
10682   /* "yt/utilities/lib/geometry_utils.pxd":52
10683  *     cdef np.int64_t a_m, a_e, b_m, b_e, x, y, z
10684  *     b_e = 0
10685  *     a_e = 0             # <<<<<<<<<<<<<<
10686  *     a_m = ifrexp(a,&a_e)
10687  *     b_m = ifrexp(b,&b_e)
10688  */
10689   __pyx_v_a_e = 0;
10690 
10691   /* "yt/utilities/lib/geometry_utils.pxd":53
10692  *     b_e = 0
10693  *     a_e = 0
10694  *     a_m = ifrexp(a,&a_e)             # <<<<<<<<<<<<<<
10695  *     b_m = ifrexp(b,&b_e)
10696  *     x = <np.int64_t> ((a_e+1)*DBL_MANT_DIG)
10697  */
10698   __pyx_v_a_m = __pyx_f_2yt_9utilities_3lib_14geometry_utils_ifrexp(__pyx_v_a, (&__pyx_v_a_e));
10699 
10700   /* "yt/utilities/lib/geometry_utils.pxd":54
10701  *     a_e = 0
10702  *     a_m = ifrexp(a,&a_e)
10703  *     b_m = ifrexp(b,&b_e)             # <<<<<<<<<<<<<<
10704  *     x = <np.int64_t> ((a_e+1)*DBL_MANT_DIG)
10705  *     y = <np.int64_t> ((b_e+1)*DBL_MANT_DIG)
10706  */
10707   __pyx_v_b_m = __pyx_f_2yt_9utilities_3lib_14geometry_utils_ifrexp(__pyx_v_b, (&__pyx_v_b_e));
10708 
10709   /* "yt/utilities/lib/geometry_utils.pxd":55
10710  *     a_m = ifrexp(a,&a_e)
10711  *     b_m = ifrexp(b,&b_e)
10712  *     x = <np.int64_t> ((a_e+1)*DBL_MANT_DIG)             # <<<<<<<<<<<<<<
10713  *     y = <np.int64_t> ((b_e+1)*DBL_MANT_DIG)
10714  *     # Compare mantissa if exponents equal
10715  */
10716   __pyx_v_x = ((__pyx_t_5numpy_int64_t)((__pyx_v_a_e + 1) * DBL_MANT_DIG));
10717 
10718   /* "yt/utilities/lib/geometry_utils.pxd":56
10719  *     b_m = ifrexp(b,&b_e)
10720  *     x = <np.int64_t> ((a_e+1)*DBL_MANT_DIG)
10721  *     y = <np.int64_t> ((b_e+1)*DBL_MANT_DIG)             # <<<<<<<<<<<<<<
10722  *     # Compare mantissa if exponents equal
10723  *     if x == y:
10724  */
10725   __pyx_v_y = ((__pyx_t_5numpy_int64_t)((__pyx_v_b_e + 1) * DBL_MANT_DIG));
10726 
10727   /* "yt/utilities/lib/geometry_utils.pxd":58
10728  *     y = <np.int64_t> ((b_e+1)*DBL_MANT_DIG)
10729  *     # Compare mantissa if exponents equal
10730  *     if x == y:             # <<<<<<<<<<<<<<
10731  *         if a_m == b_m: return 0
10732  *         z = msdb(a_m,b_m)
10733  */
10734   __pyx_t_1 = ((__pyx_v_x == __pyx_v_y) != 0);
10735   if (__pyx_t_1) {
10736 
10737     /* "yt/utilities/lib/geometry_utils.pxd":59
10738  *     # Compare mantissa if exponents equal
10739  *     if x == y:
10740  *         if a_m == b_m: return 0             # <<<<<<<<<<<<<<
10741  *         z = msdb(a_m,b_m)
10742  *         #if 1: return z
10743  */
10744     __pyx_t_1 = ((__pyx_v_a_m == __pyx_v_b_m) != 0);
10745     if (__pyx_t_1) {
10746       __pyx_r = 0;
10747       goto __pyx_L0;
10748     }
10749 
10750     /* "yt/utilities/lib/geometry_utils.pxd":60
10751  *     if x == y:
10752  *         if a_m == b_m: return 0
10753  *         z = msdb(a_m,b_m)             # <<<<<<<<<<<<<<
10754  *         #if 1: return z
10755  *         x = x - z
10756  */
10757     __pyx_v_z = __pyx_f_2yt_9utilities_3lib_14geometry_utils_msdb(__pyx_v_a_m, __pyx_v_b_m);
10758 
10759     /* "yt/utilities/lib/geometry_utils.pxd":62
10760  *         z = msdb(a_m,b_m)
10761  *         #if 1: return z
10762  *         x = x - z             # <<<<<<<<<<<<<<
10763  *         return x-1 # required so that xor_msb(0.0,1.0)!=xor_msb(1.0,1.0)
10764  *     # Otherwise return largest exponent
10765  */
10766     __pyx_v_x = (__pyx_v_x - __pyx_v_z);
10767 
10768     /* "yt/utilities/lib/geometry_utils.pxd":63
10769  *         #if 1: return z
10770  *         x = x - z
10771  *         return x-1 # required so that xor_msb(0.0,1.0)!=xor_msb(1.0,1.0)             # <<<<<<<<<<<<<<
10772  *     # Otherwise return largest exponent
10773  *     if y < x:
10774  */
10775     __pyx_r = (__pyx_v_x - 1);
10776     goto __pyx_L0;
10777 
10778     /* "yt/utilities/lib/geometry_utils.pxd":58
10779  *     y = <np.int64_t> ((b_e+1)*DBL_MANT_DIG)
10780  *     # Compare mantissa if exponents equal
10781  *     if x == y:             # <<<<<<<<<<<<<<
10782  *         if a_m == b_m: return 0
10783  *         z = msdb(a_m,b_m)
10784  */
10785   }
10786 
10787   /* "yt/utilities/lib/geometry_utils.pxd":65
10788  *         return x-1 # required so that xor_msb(0.0,1.0)!=xor_msb(1.0,1.0)
10789  *     # Otherwise return largest exponent
10790  *     if y < x:             # <<<<<<<<<<<<<<
10791  *         return x
10792  *     else:
10793  */
10794   __pyx_t_1 = ((__pyx_v_y < __pyx_v_x) != 0);
10795   if (__pyx_t_1) {
10796 
10797     /* "yt/utilities/lib/geometry_utils.pxd":66
10798  *     # Otherwise return largest exponent
10799  *     if y < x:
10800  *         return x             # <<<<<<<<<<<<<<
10801  *     else:
10802  *         return y
10803  */
10804     __pyx_r = __pyx_v_x;
10805     goto __pyx_L0;
10806 
10807     /* "yt/utilities/lib/geometry_utils.pxd":65
10808  *         return x-1 # required so that xor_msb(0.0,1.0)!=xor_msb(1.0,1.0)
10809  *     # Otherwise return largest exponent
10810  *     if y < x:             # <<<<<<<<<<<<<<
10811  *         return x
10812  *     else:
10813  */
10814   }
10815 
10816   /* "yt/utilities/lib/geometry_utils.pxd":68
10817  *         return x
10818  *     else:
10819  *         return y             # <<<<<<<<<<<<<<
10820  *
10821  * @cython.cdivision(True)
10822  */
10823   /*else*/ {
10824     __pyx_r = __pyx_v_y;
10825     goto __pyx_L0;
10826   }
10827 
10828   /* "yt/utilities/lib/geometry_utils.pxd":47
10829  * @cython.boundscheck(False)
10830  * @cython.wraparound(False)
10831  * cdef inline np.int64_t xor_msb(np.float64_t a, np.float64_t b):             # <<<<<<<<<<<<<<
10832  *     """Get the exponent of the highest differing bit between a and b"""
10833  *     # Get mantissa and exponents for each number
10834  */
10835 
10836   /* function exit code */
10837   __pyx_L0:;
10838   __Pyx_RefNannyFinishContext();
10839   return __pyx_r;
10840 }
10841 
10842 /* "yt/utilities/lib/geometry_utils.pxd":73
10843  * @cython.boundscheck(False)
10844  * @cython.wraparound(False)
10845  * cdef inline int compare_floats_morton(np.float64_t p[3], np.float64_t q[3]):             # <<<<<<<<<<<<<<
10846  *     cdef int j, out, dim
10847  *     cdef np.int64_t x, y
10848  */
10849 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_compare_floats_morton(__pyx_t_5numpy_float64_t * __pyx_v_p,__pyx_t_5numpy_float64_t * __pyx_v_q)10850 static CYTHON_INLINE int __pyx_f_2yt_9utilities_3lib_14geometry_utils_compare_floats_morton(__pyx_t_5numpy_float64_t *__pyx_v_p, __pyx_t_5numpy_float64_t *__pyx_v_q) {
10851   int __pyx_v_j;
10852   int __pyx_v_out;
10853   int __pyx_v_dim;
10854   __pyx_t_5numpy_int64_t __pyx_v_x;
10855   __pyx_t_5numpy_int64_t __pyx_v_y;
10856   int __pyx_r;
10857   __Pyx_RefNannyDeclarations
10858   int __pyx_t_1;
10859   int __pyx_t_2;
10860   __Pyx_RefNannySetupContext("compare_floats_morton", 0);
10861 
10862   /* "yt/utilities/lib/geometry_utils.pxd":76
10863  *     cdef int j, out, dim
10864  *     cdef np.int64_t x, y
10865  *     x = -9999999999             # <<<<<<<<<<<<<<
10866  *     y = 0
10867  *     dim = 0
10868  */
10869   __pyx_v_x = -9999999999LL;
10870 
10871   /* "yt/utilities/lib/geometry_utils.pxd":77
10872  *     cdef np.int64_t x, y
10873  *     x = -9999999999
10874  *     y = 0             # <<<<<<<<<<<<<<
10875  *     dim = 0
10876  *     for j in range(3):#[::-1]:
10877  */
10878   __pyx_v_y = 0;
10879 
10880   /* "yt/utilities/lib/geometry_utils.pxd":78
10881  *     x = -9999999999
10882  *     y = 0
10883  *     dim = 0             # <<<<<<<<<<<<<<
10884  *     for j in range(3):#[::-1]:
10885  *         y = xor_msb(p[j],q[j])
10886  */
10887   __pyx_v_dim = 0;
10888 
10889   /* "yt/utilities/lib/geometry_utils.pxd":79
10890  *     y = 0
10891  *     dim = 0
10892  *     for j in range(3):#[::-1]:             # <<<<<<<<<<<<<<
10893  *         y = xor_msb(p[j],q[j])
10894  *         if x < y:
10895  */
10896   for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
10897     __pyx_v_j = __pyx_t_1;
10898 
10899     /* "yt/utilities/lib/geometry_utils.pxd":80
10900  *     dim = 0
10901  *     for j in range(3):#[::-1]:
10902  *         y = xor_msb(p[j],q[j])             # <<<<<<<<<<<<<<
10903  *         if x < y:
10904  *            x = y
10905  */
10906     __pyx_v_y = __pyx_f_2yt_9utilities_3lib_14geometry_utils_xor_msb((__pyx_v_p[__pyx_v_j]), (__pyx_v_q[__pyx_v_j]));
10907 
10908     /* "yt/utilities/lib/geometry_utils.pxd":81
10909  *     for j in range(3):#[::-1]:
10910  *         y = xor_msb(p[j],q[j])
10911  *         if x < y:             # <<<<<<<<<<<<<<
10912  *            x = y
10913  *            dim = j
10914  */
10915     __pyx_t_2 = ((__pyx_v_x < __pyx_v_y) != 0);
10916     if (__pyx_t_2) {
10917 
10918       /* "yt/utilities/lib/geometry_utils.pxd":82
10919  *         y = xor_msb(p[j],q[j])
10920  *         if x < y:
10921  *            x = y             # <<<<<<<<<<<<<<
10922  *            dim = j
10923  *     if p[dim] < q[dim]:
10924  */
10925       __pyx_v_x = __pyx_v_y;
10926 
10927       /* "yt/utilities/lib/geometry_utils.pxd":83
10928  *         if x < y:
10929  *            x = y
10930  *            dim = j             # <<<<<<<<<<<<<<
10931  *     if p[dim] < q[dim]:
10932  *         out = 1
10933  */
10934       __pyx_v_dim = __pyx_v_j;
10935 
10936       /* "yt/utilities/lib/geometry_utils.pxd":81
10937  *     for j in range(3):#[::-1]:
10938  *         y = xor_msb(p[j],q[j])
10939  *         if x < y:             # <<<<<<<<<<<<<<
10940  *            x = y
10941  *            dim = j
10942  */
10943     }
10944   }
10945 
10946   /* "yt/utilities/lib/geometry_utils.pxd":84
10947  *            x = y
10948  *            dim = j
10949  *     if p[dim] < q[dim]:             # <<<<<<<<<<<<<<
10950  *         out = 1
10951  *     else:
10952  */
10953   __pyx_t_2 = (((__pyx_v_p[__pyx_v_dim]) < (__pyx_v_q[__pyx_v_dim])) != 0);
10954   if (__pyx_t_2) {
10955 
10956     /* "yt/utilities/lib/geometry_utils.pxd":85
10957  *            dim = j
10958  *     if p[dim] < q[dim]:
10959  *         out = 1             # <<<<<<<<<<<<<<
10960  *     else:
10961  *         out = 0
10962  */
10963     __pyx_v_out = 1;
10964 
10965     /* "yt/utilities/lib/geometry_utils.pxd":84
10966  *            x = y
10967  *            dim = j
10968  *     if p[dim] < q[dim]:             # <<<<<<<<<<<<<<
10969  *         out = 1
10970  *     else:
10971  */
10972     goto __pyx_L6;
10973   }
10974 
10975   /* "yt/utilities/lib/geometry_utils.pxd":87
10976  *         out = 1
10977  *     else:
10978  *         out = 0             # <<<<<<<<<<<<<<
10979  *     return out
10980  *
10981  */
10982   /*else*/ {
10983     __pyx_v_out = 0;
10984   }
10985   __pyx_L6:;
10986 
10987   /* "yt/utilities/lib/geometry_utils.pxd":88
10988  *     else:
10989  *         out = 0
10990  *     return out             # <<<<<<<<<<<<<<
10991  *
10992  * @cython.cdivision(True)
10993  */
10994   __pyx_r = __pyx_v_out;
10995   goto __pyx_L0;
10996 
10997   /* "yt/utilities/lib/geometry_utils.pxd":73
10998  * @cython.boundscheck(False)
10999  * @cython.wraparound(False)
11000  * cdef inline int compare_floats_morton(np.float64_t p[3], np.float64_t q[3]):             # <<<<<<<<<<<<<<
11001  *     cdef int j, out, dim
11002  *     cdef np.int64_t x, y
11003  */
11004 
11005   /* function exit code */
11006   __pyx_L0:;
11007   __Pyx_RefNannyFinishContext();
11008   return __pyx_r;
11009 }
11010 
11011 /* "yt/utilities/lib/geometry_utils.pxd":93
11012  * @cython.boundscheck(False)
11013  * @cython.wraparound(False)
11014  * cdef inline np.float64_t euclidean_distance(np.float64_t[:] p, np.float64_t[:] q):             # <<<<<<<<<<<<<<
11015  *     cdef int j
11016  *     cdef np.float64_t d
11017  */
11018 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_euclidean_distance(__Pyx_memviewslice __pyx_v_p,__Pyx_memviewslice __pyx_v_q)11019 static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_euclidean_distance(__Pyx_memviewslice __pyx_v_p, __Pyx_memviewslice __pyx_v_q) {
11020   int __pyx_v_j;
11021   __pyx_t_5numpy_float64_t __pyx_v_d;
11022   __pyx_t_5numpy_float64_t __pyx_r;
11023   __Pyx_RefNannyDeclarations
11024   int __pyx_t_1;
11025   Py_ssize_t __pyx_t_2;
11026   int __pyx_t_3;
11027   Py_ssize_t __pyx_t_4;
11028   __Pyx_RefNannySetupContext("euclidean_distance", 0);
11029 
11030   /* "yt/utilities/lib/geometry_utils.pxd":96
11031  *     cdef int j
11032  *     cdef np.float64_t d
11033  *     d = 0.0             # <<<<<<<<<<<<<<
11034  *     for j in range(3):
11035  *         d+=(p[j]-q[j])**2
11036  */
11037   __pyx_v_d = 0.0;
11038 
11039   /* "yt/utilities/lib/geometry_utils.pxd":97
11040  *     cdef np.float64_t d
11041  *     d = 0.0
11042  *     for j in range(3):             # <<<<<<<<<<<<<<
11043  *         d+=(p[j]-q[j])**2
11044  *     return sqrt(d)
11045  */
11046   for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
11047     __pyx_v_j = __pyx_t_1;
11048 
11049     /* "yt/utilities/lib/geometry_utils.pxd":98
11050  *     d = 0.0
11051  *     for j in range(3):
11052  *         d+=(p[j]-q[j])**2             # <<<<<<<<<<<<<<
11053  *     return sqrt(d)
11054  *
11055  */
11056     __pyx_t_2 = __pyx_v_j;
11057     __pyx_t_3 = -1;
11058     if (__pyx_t_2 < 0) {
11059       __pyx_t_2 += __pyx_v_p.shape[0];
11060       if (unlikely(__pyx_t_2 < 0)) __pyx_t_3 = 0;
11061     } else if (unlikely(__pyx_t_2 >= __pyx_v_p.shape[0])) __pyx_t_3 = 0;
11062     if (unlikely(__pyx_t_3 != -1)) {
11063       __Pyx_RaiseBufferIndexError(__pyx_t_3);
11064       __PYX_ERR(3, 98, __pyx_L1_error)
11065     }
11066     __pyx_t_4 = __pyx_v_j;
11067     __pyx_t_3 = -1;
11068     if (__pyx_t_4 < 0) {
11069       __pyx_t_4 += __pyx_v_q.shape[0];
11070       if (unlikely(__pyx_t_4 < 0)) __pyx_t_3 = 0;
11071     } else if (unlikely(__pyx_t_4 >= __pyx_v_q.shape[0])) __pyx_t_3 = 0;
11072     if (unlikely(__pyx_t_3 != -1)) {
11073       __Pyx_RaiseBufferIndexError(__pyx_t_3);
11074       __PYX_ERR(3, 98, __pyx_L1_error)
11075     }
11076     __pyx_v_d = (__pyx_v_d + pow(((*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_p.data + __pyx_t_2 * __pyx_v_p.strides[0]) ))) - (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_q.data + __pyx_t_4 * __pyx_v_q.strides[0]) )))), 2.0));
11077   }
11078 
11079   /* "yt/utilities/lib/geometry_utils.pxd":99
11080  *     for j in range(3):
11081  *         d+=(p[j]-q[j])**2
11082  *     return sqrt(d)             # <<<<<<<<<<<<<<
11083  *
11084  * # Todo: allow radius reported independently in each dimension for rectangular domain
11085  */
11086   __pyx_r = sqrt(__pyx_v_d);
11087   goto __pyx_L0;
11088 
11089   /* "yt/utilities/lib/geometry_utils.pxd":93
11090  * @cython.boundscheck(False)
11091  * @cython.wraparound(False)
11092  * cdef inline np.float64_t euclidean_distance(np.float64_t[:] p, np.float64_t[:] q):             # <<<<<<<<<<<<<<
11093  *     cdef int j
11094  *     cdef np.float64_t d
11095  */
11096 
11097   /* function exit code */
11098   __pyx_L1_error:;
11099   __Pyx_WriteUnraisable("yt.utilities.lib.geometry_utils.euclidean_distance", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
11100   __pyx_r = 0;
11101   __pyx_L0:;
11102   __Pyx_RefNannyFinishContext();
11103   return __pyx_r;
11104 }
11105 
11106 /* "yt/utilities/lib/geometry_utils.pxd":105
11107  * @cython.boundscheck(False)
11108  * @cython.wraparound(False)
11109  * cdef inline np.float64_t smallest_quadtree_box(np.float64_t p[3], np.float64_t q[3], np.int32_t order,             # <<<<<<<<<<<<<<
11110  *                                                np.float64_t DLE[3], np.float64_t DRE[3],
11111  *                                                np.float64_t *cx, np.float64_t *cy, np.float64_t *cz):
11112  */
11113 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_smallest_quadtree_box(__pyx_t_5numpy_float64_t * __pyx_v_p,__pyx_t_5numpy_float64_t * __pyx_v_q,__pyx_t_5numpy_int32_t __pyx_v_order,__pyx_t_5numpy_float64_t * __pyx_v_DLE,__pyx_t_5numpy_float64_t * __pyx_v_DRE,__pyx_t_5numpy_float64_t * __pyx_v_cx,__pyx_t_5numpy_float64_t * __pyx_v_cy,__pyx_t_5numpy_float64_t * __pyx_v_cz)11114 static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_smallest_quadtree_box(__pyx_t_5numpy_float64_t *__pyx_v_p, __pyx_t_5numpy_float64_t *__pyx_v_q, __pyx_t_5numpy_int32_t __pyx_v_order, __pyx_t_5numpy_float64_t *__pyx_v_DLE, __pyx_t_5numpy_float64_t *__pyx_v_DRE, __pyx_t_5numpy_float64_t *__pyx_v_cx, __pyx_t_5numpy_float64_t *__pyx_v_cy, __pyx_t_5numpy_float64_t *__pyx_v_cz) {
11115   int __pyx_v_j;
11116   __pyx_t_5numpy_float64_t __pyx_v_c[3];
11117   __pyx_t_5numpy_uint64_t __pyx_v_pidx[3];
11118   __pyx_t_5numpy_uint64_t __pyx_v_pidx_next[3];
11119   __pyx_t_5numpy_uint64_t __pyx_v_qidx_next[3];
11120   __pyx_t_5numpy_float64_t __pyx_v_dds[3];
11121   __pyx_t_5numpy_float64_t __pyx_v_rad;
11122   int __pyx_v_lvl;
11123   int __pyx_v_done;
11124   __pyx_t_5numpy_float64_t __pyx_r;
11125   __Pyx_RefNannyDeclarations
11126   int __pyx_t_1;
11127   int __pyx_t_2;
11128   __Pyx_RefNannySetupContext("smallest_quadtree_box", 0);
11129 
11130   /* "yt/utilities/lib/geometry_utils.pxd":112
11131  *     cdef np.uint64_t pidx[3]
11132  *     # cdef np.uint64_t qidx[3]
11133  *     for j in range(3):             # <<<<<<<<<<<<<<
11134  *         pidx[j] = 0
11135  *         # qidx[j] = 0
11136  */
11137   for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
11138     __pyx_v_j = __pyx_t_1;
11139 
11140     /* "yt/utilities/lib/geometry_utils.pxd":113
11141  *     # cdef np.uint64_t qidx[3]
11142  *     for j in range(3):
11143  *         pidx[j] = 0             # <<<<<<<<<<<<<<
11144  *         # qidx[j] = 0
11145  *     cdef np.uint64_t pidx_next[3]
11146  */
11147     (__pyx_v_pidx[__pyx_v_j]) = 0;
11148   }
11149 
11150   /* "yt/utilities/lib/geometry_utils.pxd":119
11151  *     cdef np.float64_t dds[3]
11152  *     cdef np.float64_t rad
11153  *     cdef int lvl = 0             # <<<<<<<<<<<<<<
11154  *     cdef int done = 0
11155  *     while not done:
11156  */
11157   __pyx_v_lvl = 0;
11158 
11159   /* "yt/utilities/lib/geometry_utils.pxd":120
11160  *     cdef np.float64_t rad
11161  *     cdef int lvl = 0
11162  *     cdef int done = 0             # <<<<<<<<<<<<<<
11163  *     while not done:
11164  *         if (lvl+1 >= order):
11165  */
11166   __pyx_v_done = 0;
11167 
11168   /* "yt/utilities/lib/geometry_utils.pxd":121
11169  *     cdef int lvl = 0
11170  *     cdef int done = 0
11171  *     while not done:             # <<<<<<<<<<<<<<
11172  *         if (lvl+1 >= order):
11173  *             done = 1
11174  */
11175   while (1) {
11176     __pyx_t_2 = ((!(__pyx_v_done != 0)) != 0);
11177     if (!__pyx_t_2) break;
11178 
11179     /* "yt/utilities/lib/geometry_utils.pxd":122
11180  *     cdef int done = 0
11181  *     while not done:
11182  *         if (lvl+1 >= order):             # <<<<<<<<<<<<<<
11183  *             done = 1
11184  *         for j in range(3):
11185  */
11186     __pyx_t_2 = (((__pyx_v_lvl + 1) >= __pyx_v_order) != 0);
11187     if (__pyx_t_2) {
11188 
11189       /* "yt/utilities/lib/geometry_utils.pxd":123
11190  *     while not done:
11191  *         if (lvl+1 >= order):
11192  *             done = 1             # <<<<<<<<<<<<<<
11193  *         for j in range(3):
11194  *             dds[j] = (DRE[j] - DLE[j])/(1 << (<int> lvl+1))
11195  */
11196       __pyx_v_done = 1;
11197 
11198       /* "yt/utilities/lib/geometry_utils.pxd":122
11199  *     cdef int done = 0
11200  *     while not done:
11201  *         if (lvl+1 >= order):             # <<<<<<<<<<<<<<
11202  *             done = 1
11203  *         for j in range(3):
11204  */
11205     }
11206 
11207     /* "yt/utilities/lib/geometry_utils.pxd":124
11208  *         if (lvl+1 >= order):
11209  *             done = 1
11210  *         for j in range(3):             # <<<<<<<<<<<<<<
11211  *             dds[j] = (DRE[j] - DLE[j])/(1 << (<int> lvl+1))
11212  *             pidx_next[j] = <np.uint64_t>((p[j] - DLE[j])/dds[j])
11213  */
11214     for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
11215       __pyx_v_j = __pyx_t_1;
11216 
11217       /* "yt/utilities/lib/geometry_utils.pxd":125
11218  *             done = 1
11219  *         for j in range(3):
11220  *             dds[j] = (DRE[j] - DLE[j])/(1 << (<int> lvl+1))             # <<<<<<<<<<<<<<
11221  *             pidx_next[j] = <np.uint64_t>((p[j] - DLE[j])/dds[j])
11222  *             qidx_next[j] = <np.uint64_t>((q[j] - DLE[j])/dds[j])
11223  */
11224       (__pyx_v_dds[__pyx_v_j]) = (((__pyx_v_DRE[__pyx_v_j]) - (__pyx_v_DLE[__pyx_v_j])) / (1 << (((int)__pyx_v_lvl) + 1)));
11225 
11226       /* "yt/utilities/lib/geometry_utils.pxd":126
11227  *         for j in range(3):
11228  *             dds[j] = (DRE[j] - DLE[j])/(1 << (<int> lvl+1))
11229  *             pidx_next[j] = <np.uint64_t>((p[j] - DLE[j])/dds[j])             # <<<<<<<<<<<<<<
11230  *             qidx_next[j] = <np.uint64_t>((q[j] - DLE[j])/dds[j])
11231  *         for j in range(3):
11232  */
11233       (__pyx_v_pidx_next[__pyx_v_j]) = ((__pyx_t_5numpy_uint64_t)(((__pyx_v_p[__pyx_v_j]) - (__pyx_v_DLE[__pyx_v_j])) / (__pyx_v_dds[__pyx_v_j])));
11234 
11235       /* "yt/utilities/lib/geometry_utils.pxd":127
11236  *             dds[j] = (DRE[j] - DLE[j])/(1 << (<int> lvl+1))
11237  *             pidx_next[j] = <np.uint64_t>((p[j] - DLE[j])/dds[j])
11238  *             qidx_next[j] = <np.uint64_t>((q[j] - DLE[j])/dds[j])             # <<<<<<<<<<<<<<
11239  *         for j in range(3):
11240  *             if pidx_next[j]!=qidx_next[j]:
11241  */
11242       (__pyx_v_qidx_next[__pyx_v_j]) = ((__pyx_t_5numpy_uint64_t)(((__pyx_v_q[__pyx_v_j]) - (__pyx_v_DLE[__pyx_v_j])) / (__pyx_v_dds[__pyx_v_j])));
11243     }
11244 
11245     /* "yt/utilities/lib/geometry_utils.pxd":128
11246  *             pidx_next[j] = <np.uint64_t>((p[j] - DLE[j])/dds[j])
11247  *             qidx_next[j] = <np.uint64_t>((q[j] - DLE[j])/dds[j])
11248  *         for j in range(3):             # <<<<<<<<<<<<<<
11249  *             if pidx_next[j]!=qidx_next[j]:
11250  *                 done = 1
11251  */
11252     for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
11253       __pyx_v_j = __pyx_t_1;
11254 
11255       /* "yt/utilities/lib/geometry_utils.pxd":129
11256  *             qidx_next[j] = <np.uint64_t>((q[j] - DLE[j])/dds[j])
11257  *         for j in range(3):
11258  *             if pidx_next[j]!=qidx_next[j]:             # <<<<<<<<<<<<<<
11259  *                 done = 1
11260  *                 break
11261  */
11262       __pyx_t_2 = (((__pyx_v_pidx_next[__pyx_v_j]) != (__pyx_v_qidx_next[__pyx_v_j])) != 0);
11263       if (__pyx_t_2) {
11264 
11265         /* "yt/utilities/lib/geometry_utils.pxd":130
11266  *         for j in range(3):
11267  *             if pidx_next[j]!=qidx_next[j]:
11268  *                 done = 1             # <<<<<<<<<<<<<<
11269  *                 break
11270  *         if not done:
11271  */
11272         __pyx_v_done = 1;
11273 
11274         /* "yt/utilities/lib/geometry_utils.pxd":131
11275  *             if pidx_next[j]!=qidx_next[j]:
11276  *                 done = 1
11277  *                 break             # <<<<<<<<<<<<<<
11278  *         if not done:
11279  *             for j in range(3):
11280  */
11281         goto __pyx_L11_break;
11282 
11283         /* "yt/utilities/lib/geometry_utils.pxd":129
11284  *             qidx_next[j] = <np.uint64_t>((q[j] - DLE[j])/dds[j])
11285  *         for j in range(3):
11286  *             if pidx_next[j]!=qidx_next[j]:             # <<<<<<<<<<<<<<
11287  *                 done = 1
11288  *                 break
11289  */
11290       }
11291     }
11292     __pyx_L11_break:;
11293 
11294     /* "yt/utilities/lib/geometry_utils.pxd":132
11295  *                 done = 1
11296  *                 break
11297  *         if not done:             # <<<<<<<<<<<<<<
11298  *             for j in range(3):
11299  *                 pidx[j] = pidx_next[j]
11300  */
11301     __pyx_t_2 = ((!(__pyx_v_done != 0)) != 0);
11302     if (__pyx_t_2) {
11303 
11304       /* "yt/utilities/lib/geometry_utils.pxd":133
11305  *                 break
11306  *         if not done:
11307  *             for j in range(3):             # <<<<<<<<<<<<<<
11308  *                 pidx[j] = pidx_next[j]
11309  *                 # qidx[j] = qidx_next[j]
11310  */
11311       for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
11312         __pyx_v_j = __pyx_t_1;
11313 
11314         /* "yt/utilities/lib/geometry_utils.pxd":134
11315  *         if not done:
11316  *             for j in range(3):
11317  *                 pidx[j] = pidx_next[j]             # <<<<<<<<<<<<<<
11318  *                 # qidx[j] = qidx_next[j]
11319  *             lvl+=1
11320  */
11321         (__pyx_v_pidx[__pyx_v_j]) = (__pyx_v_pidx_next[__pyx_v_j]);
11322       }
11323 
11324       /* "yt/utilities/lib/geometry_utils.pxd":136
11325  *                 pidx[j] = pidx_next[j]
11326  *                 # qidx[j] = qidx_next[j]
11327  *             lvl+=1             # <<<<<<<<<<<<<<
11328  *     rad = 0.0
11329  *     for j in range(3):
11330  */
11331       __pyx_v_lvl = (__pyx_v_lvl + 1);
11332 
11333       /* "yt/utilities/lib/geometry_utils.pxd":132
11334  *                 done = 1
11335  *                 break
11336  *         if not done:             # <<<<<<<<<<<<<<
11337  *             for j in range(3):
11338  *                 pidx[j] = pidx_next[j]
11339  */
11340     }
11341   }
11342 
11343   /* "yt/utilities/lib/geometry_utils.pxd":137
11344  *                 # qidx[j] = qidx_next[j]
11345  *             lvl+=1
11346  *     rad = 0.0             # <<<<<<<<<<<<<<
11347  *     for j in range(3):
11348  *         dds[j] = (DRE[j] - DLE[j])/(1 << lvl)
11349  */
11350   __pyx_v_rad = 0.0;
11351 
11352   /* "yt/utilities/lib/geometry_utils.pxd":138
11353  *             lvl+=1
11354  *     rad = 0.0
11355  *     for j in range(3):             # <<<<<<<<<<<<<<
11356  *         dds[j] = (DRE[j] - DLE[j])/(1 << lvl)
11357  *         c[j] = dds[j]*(<np.float64_t>pidx[j]+0.5)
11358  */
11359   for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
11360     __pyx_v_j = __pyx_t_1;
11361 
11362     /* "yt/utilities/lib/geometry_utils.pxd":139
11363  *     rad = 0.0
11364  *     for j in range(3):
11365  *         dds[j] = (DRE[j] - DLE[j])/(1 << lvl)             # <<<<<<<<<<<<<<
11366  *         c[j] = dds[j]*(<np.float64_t>pidx[j]+0.5)
11367  *         rad+=((dds[j]/2.0)**2)
11368  */
11369     (__pyx_v_dds[__pyx_v_j]) = (((__pyx_v_DRE[__pyx_v_j]) - (__pyx_v_DLE[__pyx_v_j])) / (1 << __pyx_v_lvl));
11370 
11371     /* "yt/utilities/lib/geometry_utils.pxd":140
11372  *     for j in range(3):
11373  *         dds[j] = (DRE[j] - DLE[j])/(1 << lvl)
11374  *         c[j] = dds[j]*(<np.float64_t>pidx[j]+0.5)             # <<<<<<<<<<<<<<
11375  *         rad+=((dds[j]/2.0)**2)
11376  *     cx[0] = c[0]
11377  */
11378     (__pyx_v_c[__pyx_v_j]) = ((__pyx_v_dds[__pyx_v_j]) * (((__pyx_t_5numpy_float64_t)(__pyx_v_pidx[__pyx_v_j])) + 0.5));
11379 
11380     /* "yt/utilities/lib/geometry_utils.pxd":141
11381  *         dds[j] = (DRE[j] - DLE[j])/(1 << lvl)
11382  *         c[j] = dds[j]*(<np.float64_t>pidx[j]+0.5)
11383  *         rad+=((dds[j]/2.0)**2)             # <<<<<<<<<<<<<<
11384  *     cx[0] = c[0]
11385  *     cy[0] = c[1]
11386  */
11387     __pyx_v_rad = (__pyx_v_rad + pow(((__pyx_v_dds[__pyx_v_j]) / 2.0), 2.0));
11388   }
11389 
11390   /* "yt/utilities/lib/geometry_utils.pxd":142
11391  *         c[j] = dds[j]*(<np.float64_t>pidx[j]+0.5)
11392  *         rad+=((dds[j]/2.0)**2)
11393  *     cx[0] = c[0]             # <<<<<<<<<<<<<<
11394  *     cy[0] = c[1]
11395  *     cz[0] = c[2]
11396  */
11397   (__pyx_v_cx[0]) = (__pyx_v_c[0]);
11398 
11399   /* "yt/utilities/lib/geometry_utils.pxd":143
11400  *         rad+=((dds[j]/2.0)**2)
11401  *     cx[0] = c[0]
11402  *     cy[0] = c[1]             # <<<<<<<<<<<<<<
11403  *     cz[0] = c[2]
11404  *     return sqrt(rad)
11405  */
11406   (__pyx_v_cy[0]) = (__pyx_v_c[1]);
11407 
11408   /* "yt/utilities/lib/geometry_utils.pxd":144
11409  *     cx[0] = c[0]
11410  *     cy[0] = c[1]
11411  *     cz[0] = c[2]             # <<<<<<<<<<<<<<
11412  *     return sqrt(rad)
11413  *
11414  */
11415   (__pyx_v_cz[0]) = (__pyx_v_c[2]);
11416 
11417   /* "yt/utilities/lib/geometry_utils.pxd":145
11418  *     cy[0] = c[1]
11419  *     cz[0] = c[2]
11420  *     return sqrt(rad)             # <<<<<<<<<<<<<<
11421  *
11422  * #-----------------------------------------------------------------------------
11423  */
11424   __pyx_r = sqrt(__pyx_v_rad);
11425   goto __pyx_L0;
11426 
11427   /* "yt/utilities/lib/geometry_utils.pxd":105
11428  * @cython.boundscheck(False)
11429  * @cython.wraparound(False)
11430  * cdef inline np.float64_t smallest_quadtree_box(np.float64_t p[3], np.float64_t q[3], np.int32_t order,             # <<<<<<<<<<<<<<
11431  *                                                np.float64_t DLE[3], np.float64_t DRE[3],
11432  *                                                np.float64_t *cx, np.float64_t *cy, np.float64_t *cz):
11433  */
11434 
11435   /* function exit code */
11436   __pyx_L0:;
11437   __Pyx_RefNannyFinishContext();
11438   return __pyx_r;
11439 }
11440 
11441 /* "yt/utilities/lib/geometry_utils.pxd":152
11442  * @cython.boundscheck(False)
11443  * @cython.wraparound(False)
11444  * cdef inline np.uint64_t spread_64bits_by3(np.uint64_t x):             # <<<<<<<<<<<<<<
11445  *     x=(x&(<np.uint64_t>0x00000000001FFFFF))
11446  *     x=(x|(x<<20))*(<np.uint64_t>0x000001FFC00003FF)
11447  */
11448 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_spread_64bits_by3(__pyx_t_5numpy_uint64_t __pyx_v_x)11449 static CYTHON_INLINE __pyx_t_5numpy_uint64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_spread_64bits_by3(__pyx_t_5numpy_uint64_t __pyx_v_x) {
11450   __pyx_t_5numpy_uint64_t __pyx_r;
11451   __Pyx_RefNannyDeclarations
11452   __Pyx_RefNannySetupContext("spread_64bits_by3", 0);
11453 
11454   /* "yt/utilities/lib/geometry_utils.pxd":153
11455  * @cython.wraparound(False)
11456  * cdef inline np.uint64_t spread_64bits_by3(np.uint64_t x):
11457  *     x=(x&(<np.uint64_t>0x00000000001FFFFF))             # <<<<<<<<<<<<<<
11458  *     x=(x|(x<<20))*(<np.uint64_t>0x000001FFC00003FF)
11459  *
11460  */
11461   __pyx_v_x = (__pyx_v_x & ((__pyx_t_5numpy_uint64_t)0x00000000001FFFFF));
11462 
11463   /* "yt/utilities/lib/geometry_utils.pxd":154
11464  * cdef inline np.uint64_t spread_64bits_by3(np.uint64_t x):
11465  *     x=(x&(<np.uint64_t>0x00000000001FFFFF))
11466  *     x=(x|(x<<20))*(<np.uint64_t>0x000001FFC00003FF)             # <<<<<<<<<<<<<<
11467  *
11468  * #-----------------------------------------------------------------------------
11469  */
11470   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x << 20)) * ((__pyx_t_5numpy_uint64_t)0x000001FFC00003FF));
11471 
11472   /* "yt/utilities/lib/geometry_utils.pxd":152
11473  * @cython.boundscheck(False)
11474  * @cython.wraparound(False)
11475  * cdef inline np.uint64_t spread_64bits_by3(np.uint64_t x):             # <<<<<<<<<<<<<<
11476  *     x=(x&(<np.uint64_t>0x00000000001FFFFF))
11477  *     x=(x|(x<<20))*(<np.uint64_t>0x000001FFC00003FF)
11478  */
11479 
11480   /* function exit code */
11481   __pyx_r = 0;
11482   __Pyx_RefNannyFinishContext();
11483   return __pyx_r;
11484 }
11485 
11486 /* "yt/utilities/lib/geometry_utils.pxd":161
11487  * @cython.boundscheck(False)
11488  * @cython.wraparound(False)
11489  * cdef inline np.uint64_t spread_64bits_by2(np.uint64_t x):             # <<<<<<<<<<<<<<
11490  *     # This magic comes from http://stackoverflow.com/questions/1024754/how-to-compute-a-3d-morton-number-interleave-the-bits-of-3-ints
11491  *     # Only reversible up to 2097151
11492  */
11493 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_spread_64bits_by2(__pyx_t_5numpy_uint64_t __pyx_v_x)11494 static CYTHON_INLINE __pyx_t_5numpy_uint64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_spread_64bits_by2(__pyx_t_5numpy_uint64_t __pyx_v_x) {
11495   __pyx_t_5numpy_uint64_t __pyx_r;
11496   __Pyx_RefNannyDeclarations
11497   __Pyx_RefNannySetupContext("spread_64bits_by2", 0);
11498 
11499   /* "yt/utilities/lib/geometry_utils.pxd":166
11500  *     # Select highest 21 bits (Required to be reversible to 21st bit)
11501  *     # x = ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---k jihg fedc ba98 7654 3210
11502  *     x=(x&(<np.uint64_t>0x00000000001FFFFF))             # <<<<<<<<<<<<<<
11503  *     # x = ---- ---- ---- ---- ---- ---k jihg fedc ba-- ---- ---- ---- ---- --98 7654 3210
11504  *     x=(x|(x<<20))&(<np.uint64_t>0x000001FFC00003FF)
11505  */
11506   __pyx_v_x = (__pyx_v_x & ((__pyx_t_5numpy_uint64_t)0x00000000001FFFFF));
11507 
11508   /* "yt/utilities/lib/geometry_utils.pxd":168
11509  *     x=(x&(<np.uint64_t>0x00000000001FFFFF))
11510  *     # x = ---- ---- ---- ---- ---- ---k jihg fedc ba-- ---- ---- ---- ---- --98 7654 3210
11511  *     x=(x|(x<<20))&(<np.uint64_t>0x000001FFC00003FF)             # <<<<<<<<<<<<<<
11512  *     # x = ---- ---- ---- -kji hgf- ---- ---- -edc ba-- ---- ---- 9876 5--- ---- ---4 3210
11513  *     x=(x|(x<<10))&(<np.uint64_t>0x0007E007C00F801F)
11514  */
11515   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x << 20)) & ((__pyx_t_5numpy_uint64_t)0x000001FFC00003FF));
11516 
11517   /* "yt/utilities/lib/geometry_utils.pxd":170
11518  *     x=(x|(x<<20))&(<np.uint64_t>0x000001FFC00003FF)
11519  *     # x = ---- ---- ---- -kji hgf- ---- ---- -edc ba-- ---- ---- 9876 5--- ---- ---4 3210
11520  *     x=(x|(x<<10))&(<np.uint64_t>0x0007E007C00F801F)             # <<<<<<<<<<<<<<
11521  *     # x = ---- ---- -kji h--- -gf- ---- -edc ---- ba-- ---- 987- ---6 5--- ---4 32-- --10
11522  *     x=(x|(x<<4))&(<np.uint64_t>0x00786070C0E181C3)
11523  */
11524   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x << 10)) & ((__pyx_t_5numpy_uint64_t)0x0007E007C00F801F));
11525 
11526   /* "yt/utilities/lib/geometry_utils.pxd":172
11527  *     x=(x|(x<<10))&(<np.uint64_t>0x0007E007C00F801F)
11528  *     # x = ---- ---- -kji h--- -gf- ---- -edc ---- ba-- ---- 987- ---6 5--- ---4 32-- --10
11529  *     x=(x|(x<<4))&(<np.uint64_t>0x00786070C0E181C3)             # <<<<<<<<<<<<<<
11530  *     # x = ---- ---k ji-- h--g --f- ---e d--c --b- -a-- --98 --7- -6-- 5--- -43- -2-- 1--0
11531  *     x=(x|(x<<2))&(<np.uint64_t>0x0199219243248649)
11532  */
11533   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x << 4)) & ((__pyx_t_5numpy_uint64_t)0x00786070C0E181C3));
11534 
11535   /* "yt/utilities/lib/geometry_utils.pxd":174
11536  *     x=(x|(x<<4))&(<np.uint64_t>0x00786070C0E181C3)
11537  *     # x = ---- ---k ji-- h--g --f- ---e d--c --b- -a-- --98 --7- -6-- 5--- -43- -2-- 1--0
11538  *     x=(x|(x<<2))&(<np.uint64_t>0x0199219243248649)             # <<<<<<<<<<<<<<
11539  *     # x = ---- -kj- -i-- h--g --f- -e-- d--c --b- -a-- 9--8 --7- -6-- 5--4 --3- -2-- 1--0
11540  *     x=(x|(x<<2))&(<np.uint64_t>0x0649249249249249)
11541  */
11542   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x << 2)) & ((__pyx_t_5numpy_uint64_t)0x0199219243248649));
11543 
11544   /* "yt/utilities/lib/geometry_utils.pxd":176
11545  *     x=(x|(x<<2))&(<np.uint64_t>0x0199219243248649)
11546  *     # x = ---- -kj- -i-- h--g --f- -e-- d--c --b- -a-- 9--8 --7- -6-- 5--4 --3- -2-- 1--0
11547  *     x=(x|(x<<2))&(<np.uint64_t>0x0649249249249249)             # <<<<<<<<<<<<<<
11548  *     # x = ---k --j- -i-- h--g --f- -e-- d--c --b- -a-- 9--8 --7- -6-- 5--4 --3- -2-- 1--0
11549  *     x=(x|(x<<2))&(<np.uint64_t>0x1249249249249249)
11550  */
11551   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x << 2)) & ((__pyx_t_5numpy_uint64_t)0x0649249249249249));
11552 
11553   /* "yt/utilities/lib/geometry_utils.pxd":178
11554  *     x=(x|(x<<2))&(<np.uint64_t>0x0649249249249249)
11555  *     # x = ---k --j- -i-- h--g --f- -e-- d--c --b- -a-- 9--8 --7- -6-- 5--4 --3- -2-- 1--0
11556  *     x=(x|(x<<2))&(<np.uint64_t>0x1249249249249249)             # <<<<<<<<<<<<<<
11557  *     return x
11558  *
11559  */
11560   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x << 2)) & ((__pyx_t_5numpy_uint64_t)0x1249249249249249));
11561 
11562   /* "yt/utilities/lib/geometry_utils.pxd":179
11563  *     # x = ---k --j- -i-- h--g --f- -e-- d--c --b- -a-- 9--8 --7- -6-- 5--4 --3- -2-- 1--0
11564  *     x=(x|(x<<2))&(<np.uint64_t>0x1249249249249249)
11565  *     return x             # <<<<<<<<<<<<<<
11566  *
11567  * @cython.cdivision(True)
11568  */
11569   __pyx_r = __pyx_v_x;
11570   goto __pyx_L0;
11571 
11572   /* "yt/utilities/lib/geometry_utils.pxd":161
11573  * @cython.boundscheck(False)
11574  * @cython.wraparound(False)
11575  * cdef inline np.uint64_t spread_64bits_by2(np.uint64_t x):             # <<<<<<<<<<<<<<
11576  *     # This magic comes from http://stackoverflow.com/questions/1024754/how-to-compute-a-3d-morton-number-interleave-the-bits-of-3-ints
11577  *     # Only reversible up to 2097151
11578  */
11579 
11580   /* function exit code */
11581   __pyx_L0:;
11582   __Pyx_RefNannyFinishContext();
11583   return __pyx_r;
11584 }
11585 
11586 /* "yt/utilities/lib/geometry_utils.pxd":184
11587  * @cython.boundscheck(False)
11588  * @cython.wraparound(False)
11589  * cdef inline np.uint64_t compact_64bits_by2(np.uint64_t x):             # <<<<<<<<<<<<<<
11590  *     # Reversed magic
11591  *     x=x&(<np.uint64_t>0x1249249249249249)
11592  */
11593 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_compact_64bits_by2(__pyx_t_5numpy_uint64_t __pyx_v_x)11594 static CYTHON_INLINE __pyx_t_5numpy_uint64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_compact_64bits_by2(__pyx_t_5numpy_uint64_t __pyx_v_x) {
11595   __pyx_t_5numpy_uint64_t __pyx_r;
11596   __Pyx_RefNannyDeclarations
11597   __Pyx_RefNannySetupContext("compact_64bits_by2", 0);
11598 
11599   /* "yt/utilities/lib/geometry_utils.pxd":186
11600  * cdef inline np.uint64_t compact_64bits_by2(np.uint64_t x):
11601  *     # Reversed magic
11602  *     x=x&(<np.uint64_t>0x1249249249249249)             # <<<<<<<<<<<<<<
11603  *     x=(x|(x>>2))&(<np.uint64_t>0x0649249249249249)
11604  *     x=(x|(x>>2))&(<np.uint64_t>0x0199219243248649)
11605  */
11606   __pyx_v_x = (__pyx_v_x & ((__pyx_t_5numpy_uint64_t)0x1249249249249249));
11607 
11608   /* "yt/utilities/lib/geometry_utils.pxd":187
11609  *     # Reversed magic
11610  *     x=x&(<np.uint64_t>0x1249249249249249)
11611  *     x=(x|(x>>2))&(<np.uint64_t>0x0649249249249249)             # <<<<<<<<<<<<<<
11612  *     x=(x|(x>>2))&(<np.uint64_t>0x0199219243248649)
11613  *     x=(x|(x>>2))&(<np.uint64_t>0x00786070C0E181C3)
11614  */
11615   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x >> 2)) & ((__pyx_t_5numpy_uint64_t)0x0649249249249249));
11616 
11617   /* "yt/utilities/lib/geometry_utils.pxd":188
11618  *     x=x&(<np.uint64_t>0x1249249249249249)
11619  *     x=(x|(x>>2))&(<np.uint64_t>0x0649249249249249)
11620  *     x=(x|(x>>2))&(<np.uint64_t>0x0199219243248649)             # <<<<<<<<<<<<<<
11621  *     x=(x|(x>>2))&(<np.uint64_t>0x00786070C0E181C3)
11622  *     x=(x|(x>>4))&(<np.uint64_t>0x0007E007C00F801F)
11623  */
11624   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x >> 2)) & ((__pyx_t_5numpy_uint64_t)0x0199219243248649));
11625 
11626   /* "yt/utilities/lib/geometry_utils.pxd":189
11627  *     x=(x|(x>>2))&(<np.uint64_t>0x0649249249249249)
11628  *     x=(x|(x>>2))&(<np.uint64_t>0x0199219243248649)
11629  *     x=(x|(x>>2))&(<np.uint64_t>0x00786070C0E181C3)             # <<<<<<<<<<<<<<
11630  *     x=(x|(x>>4))&(<np.uint64_t>0x0007E007C00F801F)
11631  *     x=(x|(x>>10))&(<np.uint64_t>0x000001FFC00003FF)
11632  */
11633   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x >> 2)) & ((__pyx_t_5numpy_uint64_t)0x00786070C0E181C3));
11634 
11635   /* "yt/utilities/lib/geometry_utils.pxd":190
11636  *     x=(x|(x>>2))&(<np.uint64_t>0x0199219243248649)
11637  *     x=(x|(x>>2))&(<np.uint64_t>0x00786070C0E181C3)
11638  *     x=(x|(x>>4))&(<np.uint64_t>0x0007E007C00F801F)             # <<<<<<<<<<<<<<
11639  *     x=(x|(x>>10))&(<np.uint64_t>0x000001FFC00003FF)
11640  *     x=(x|(x>>20))&(<np.uint64_t>0x00000000001FFFFF)
11641  */
11642   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x >> 4)) & ((__pyx_t_5numpy_uint64_t)0x0007E007C00F801F));
11643 
11644   /* "yt/utilities/lib/geometry_utils.pxd":191
11645  *     x=(x|(x>>2))&(<np.uint64_t>0x00786070C0E181C3)
11646  *     x=(x|(x>>4))&(<np.uint64_t>0x0007E007C00F801F)
11647  *     x=(x|(x>>10))&(<np.uint64_t>0x000001FFC00003FF)             # <<<<<<<<<<<<<<
11648  *     x=(x|(x>>20))&(<np.uint64_t>0x00000000001FFFFF)
11649  *     return x
11650  */
11651   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x >> 10)) & ((__pyx_t_5numpy_uint64_t)0x000001FFC00003FF));
11652 
11653   /* "yt/utilities/lib/geometry_utils.pxd":192
11654  *     x=(x|(x>>4))&(<np.uint64_t>0x0007E007C00F801F)
11655  *     x=(x|(x>>10))&(<np.uint64_t>0x000001FFC00003FF)
11656  *     x=(x|(x>>20))&(<np.uint64_t>0x00000000001FFFFF)             # <<<<<<<<<<<<<<
11657  *     return x
11658  *
11659  */
11660   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x >> 20)) & ((__pyx_t_5numpy_uint64_t)0x00000000001FFFFF));
11661 
11662   /* "yt/utilities/lib/geometry_utils.pxd":193
11663  *     x=(x|(x>>10))&(<np.uint64_t>0x000001FFC00003FF)
11664  *     x=(x|(x>>20))&(<np.uint64_t>0x00000000001FFFFF)
11665  *     return x             # <<<<<<<<<<<<<<
11666  *
11667  * #-----------------------------------------------------------------------------
11668  */
11669   __pyx_r = __pyx_v_x;
11670   goto __pyx_L0;
11671 
11672   /* "yt/utilities/lib/geometry_utils.pxd":184
11673  * @cython.boundscheck(False)
11674  * @cython.wraparound(False)
11675  * cdef inline np.uint64_t compact_64bits_by2(np.uint64_t x):             # <<<<<<<<<<<<<<
11676  *     # Reversed magic
11677  *     x=x&(<np.uint64_t>0x1249249249249249)
11678  */
11679 
11680   /* function exit code */
11681   __pyx_L0:;
11682   __Pyx_RefNannyFinishContext();
11683   return __pyx_r;
11684 }
11685 
11686 /* "yt/utilities/lib/geometry_utils.pxd":200
11687  * @cython.boundscheck(False)
11688  * @cython.wraparound(False)
11689  * cdef inline np.uint32_t spread_32bits_by2(np.uint32_t x):             # <<<<<<<<<<<<<<
11690  *     # Only reversible up to 1023
11691  *     # Select highest 10 bits (Required to be reversible to 10st bit)
11692  */
11693 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_spread_32bits_by2(__pyx_t_5numpy_uint32_t __pyx_v_x)11694 static CYTHON_INLINE __pyx_t_5numpy_uint32_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_spread_32bits_by2(__pyx_t_5numpy_uint32_t __pyx_v_x) {
11695   __pyx_t_5numpy_uint32_t __pyx_r;
11696   __Pyx_RefNannyDeclarations
11697   __Pyx_RefNannySetupContext("spread_32bits_by2", 0);
11698 
11699   /* "yt/utilities/lib/geometry_utils.pxd":204
11700  *     # Select highest 10 bits (Required to be reversible to 10st bit)
11701  *     # x = ---- ---- ---- ---- ---- --98 7654 3210
11702  *     x=(x&(<np.uint32_t>0x000003FF))             # <<<<<<<<<<<<<<
11703  *     # x = ---- --98 ---- ---- ---- ---- 7654 3210
11704  *     x=(x|(x<<16))&(<np.uint32_t>0xFF0000FF)
11705  */
11706   __pyx_v_x = (__pyx_v_x & ((__pyx_t_5numpy_uint32_t)0x000003FF));
11707 
11708   /* "yt/utilities/lib/geometry_utils.pxd":206
11709  *     x=(x&(<np.uint32_t>0x000003FF))
11710  *     # x = ---- --98 ---- ---- ---- ---- 7654 3210
11711  *     x=(x|(x<<16))&(<np.uint32_t>0xFF0000FF)             # <<<<<<<<<<<<<<
11712  *     # x = ---- --98 ---- ---- 7654 ---- ---- 3210
11713  *     x=(x|(x<<8))&(<np.uint32_t>0x0300F00F)
11714  */
11715   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x << 16)) & ((__pyx_t_5numpy_uint32_t)0xFF0000FF));
11716 
11717   /* "yt/utilities/lib/geometry_utils.pxd":208
11718  *     x=(x|(x<<16))&(<np.uint32_t>0xFF0000FF)
11719  *     # x = ---- --98 ---- ---- 7654 ---- ---- 3210
11720  *     x=(x|(x<<8))&(<np.uint32_t>0x0300F00F)             # <<<<<<<<<<<<<<
11721  *     # x = ---- --98 ---- 76-- --54 ---- 32-- --10
11722  *     x=(x|(x<<4))&(<np.uint32_t>0x030C30C3)
11723  */
11724   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x << 8)) & ((__pyx_t_5numpy_uint32_t)0x0300F00F));
11725 
11726   /* "yt/utilities/lib/geometry_utils.pxd":210
11727  *     x=(x|(x<<8))&(<np.uint32_t>0x0300F00F)
11728  *     # x = ---- --98 ---- 76-- --54 ---- 32-- --10
11729  *     x=(x|(x<<4))&(<np.uint32_t>0x030C30C3)             # <<<<<<<<<<<<<<
11730  *     # x = ---- 9--8 --7- -6-- 5--4 --3- -2-- 1--0
11731  *     x=(x|(x<<2))&(<np.uint32_t>0x09249249)
11732  */
11733   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x << 4)) & ((__pyx_t_5numpy_uint32_t)0x030C30C3));
11734 
11735   /* "yt/utilities/lib/geometry_utils.pxd":212
11736  *     x=(x|(x<<4))&(<np.uint32_t>0x030C30C3)
11737  *     # x = ---- 9--8 --7- -6-- 5--4 --3- -2-- 1--0
11738  *     x=(x|(x<<2))&(<np.uint32_t>0x09249249)             # <<<<<<<<<<<<<<
11739  *     return x
11740  *
11741  */
11742   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x << 2)) & ((__pyx_t_5numpy_uint32_t)0x09249249));
11743 
11744   /* "yt/utilities/lib/geometry_utils.pxd":213
11745  *     # x = ---- 9--8 --7- -6-- 5--4 --3- -2-- 1--0
11746  *     x=(x|(x<<2))&(<np.uint32_t>0x09249249)
11747  *     return x             # <<<<<<<<<<<<<<
11748  *
11749  * @cython.cdivision(True)
11750  */
11751   __pyx_r = __pyx_v_x;
11752   goto __pyx_L0;
11753 
11754   /* "yt/utilities/lib/geometry_utils.pxd":200
11755  * @cython.boundscheck(False)
11756  * @cython.wraparound(False)
11757  * cdef inline np.uint32_t spread_32bits_by2(np.uint32_t x):             # <<<<<<<<<<<<<<
11758  *     # Only reversible up to 1023
11759  *     # Select highest 10 bits (Required to be reversible to 10st bit)
11760  */
11761 
11762   /* function exit code */
11763   __pyx_L0:;
11764   __Pyx_RefNannyFinishContext();
11765   return __pyx_r;
11766 }
11767 
11768 /* "yt/utilities/lib/geometry_utils.pxd":218
11769  * @cython.boundscheck(False)
11770  * @cython.wraparound(False)
11771  * cdef inline np.uint32_t compact_32bits_by2(np.uint32_t x):             # <<<<<<<<<<<<<<
11772  *     # Reversed magic
11773  *     x=x&(<np.uint32_t>0x09249249)
11774  */
11775 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_compact_32bits_by2(__pyx_t_5numpy_uint32_t __pyx_v_x)11776 static CYTHON_INLINE __pyx_t_5numpy_uint32_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_compact_32bits_by2(__pyx_t_5numpy_uint32_t __pyx_v_x) {
11777   __pyx_t_5numpy_uint32_t __pyx_r;
11778   __Pyx_RefNannyDeclarations
11779   __Pyx_RefNannySetupContext("compact_32bits_by2", 0);
11780 
11781   /* "yt/utilities/lib/geometry_utils.pxd":220
11782  * cdef inline np.uint32_t compact_32bits_by2(np.uint32_t x):
11783  *     # Reversed magic
11784  *     x=x&(<np.uint32_t>0x09249249)             # <<<<<<<<<<<<<<
11785  *     x=(x|(x>>2))&(<np.uint32_t>0x030C30C3)
11786  *     x=(x|(x>>4))&(<np.uint32_t>0x0300F00F)
11787  */
11788   __pyx_v_x = (__pyx_v_x & ((__pyx_t_5numpy_uint32_t)0x09249249));
11789 
11790   /* "yt/utilities/lib/geometry_utils.pxd":221
11791  *     # Reversed magic
11792  *     x=x&(<np.uint32_t>0x09249249)
11793  *     x=(x|(x>>2))&(<np.uint32_t>0x030C30C3)             # <<<<<<<<<<<<<<
11794  *     x=(x|(x>>4))&(<np.uint32_t>0x0300F00F)
11795  *     x=(x|(x>>8))&(<np.uint32_t>0xFF0000FF)
11796  */
11797   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x >> 2)) & ((__pyx_t_5numpy_uint32_t)0x030C30C3));
11798 
11799   /* "yt/utilities/lib/geometry_utils.pxd":222
11800  *     x=x&(<np.uint32_t>0x09249249)
11801  *     x=(x|(x>>2))&(<np.uint32_t>0x030C30C3)
11802  *     x=(x|(x>>4))&(<np.uint32_t>0x0300F00F)             # <<<<<<<<<<<<<<
11803  *     x=(x|(x>>8))&(<np.uint32_t>0xFF0000FF)
11804  *     x=(x|(x>>16))&(<np.uint32_t>0x000003FF)
11805  */
11806   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x >> 4)) & ((__pyx_t_5numpy_uint32_t)0x0300F00F));
11807 
11808   /* "yt/utilities/lib/geometry_utils.pxd":223
11809  *     x=(x|(x>>2))&(<np.uint32_t>0x030C30C3)
11810  *     x=(x|(x>>4))&(<np.uint32_t>0x0300F00F)
11811  *     x=(x|(x>>8))&(<np.uint32_t>0xFF0000FF)             # <<<<<<<<<<<<<<
11812  *     x=(x|(x>>16))&(<np.uint32_t>0x000003FF)
11813  *     return x
11814  */
11815   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x >> 8)) & ((__pyx_t_5numpy_uint32_t)0xFF0000FF));
11816 
11817   /* "yt/utilities/lib/geometry_utils.pxd":224
11818  *     x=(x|(x>>4))&(<np.uint32_t>0x0300F00F)
11819  *     x=(x|(x>>8))&(<np.uint32_t>0xFF0000FF)
11820  *     x=(x|(x>>16))&(<np.uint32_t>0x000003FF)             # <<<<<<<<<<<<<<
11821  *     return x
11822  *
11823  */
11824   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x >> 16)) & ((__pyx_t_5numpy_uint32_t)0x000003FF));
11825 
11826   /* "yt/utilities/lib/geometry_utils.pxd":225
11827  *     x=(x|(x>>8))&(<np.uint32_t>0xFF0000FF)
11828  *     x=(x|(x>>16))&(<np.uint32_t>0x000003FF)
11829  *     return x             # <<<<<<<<<<<<<<
11830  *
11831  * @cython.cdivision(True)
11832  */
11833   __pyx_r = __pyx_v_x;
11834   goto __pyx_L0;
11835 
11836   /* "yt/utilities/lib/geometry_utils.pxd":218
11837  * @cython.boundscheck(False)
11838  * @cython.wraparound(False)
11839  * cdef inline np.uint32_t compact_32bits_by2(np.uint32_t x):             # <<<<<<<<<<<<<<
11840  *     # Reversed magic
11841  *     x=x&(<np.uint32_t>0x09249249)
11842  */
11843 
11844   /* function exit code */
11845   __pyx_L0:;
11846   __Pyx_RefNannyFinishContext();
11847   return __pyx_r;
11848 }
11849 
11850 /* "yt/utilities/lib/geometry_utils.pxd":230
11851  * @cython.boundscheck(False)
11852  * @cython.wraparound(False)
11853  * cdef inline np.uint64_t masked_merge_64bit(np.uint64_t a, np.uint64_t b, np.uint64_t mask):             # <<<<<<<<<<<<<<
11854  *     # https://graphics.stanford.edu/~seander/bithacks.html#MaskedMerge
11855  *     return a ^ ((a ^ b) & mask)
11856  */
11857 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_masked_merge_64bit(__pyx_t_5numpy_uint64_t __pyx_v_a,__pyx_t_5numpy_uint64_t __pyx_v_b,__pyx_t_5numpy_uint64_t __pyx_v_mask)11858 static CYTHON_INLINE __pyx_t_5numpy_uint64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_masked_merge_64bit(__pyx_t_5numpy_uint64_t __pyx_v_a, __pyx_t_5numpy_uint64_t __pyx_v_b, __pyx_t_5numpy_uint64_t __pyx_v_mask) {
11859   __pyx_t_5numpy_uint64_t __pyx_r;
11860   __Pyx_RefNannyDeclarations
11861   __Pyx_RefNannySetupContext("masked_merge_64bit", 0);
11862 
11863   /* "yt/utilities/lib/geometry_utils.pxd":232
11864  * cdef inline np.uint64_t masked_merge_64bit(np.uint64_t a, np.uint64_t b, np.uint64_t mask):
11865  *     # https://graphics.stanford.edu/~seander/bithacks.html#MaskedMerge
11866  *     return a ^ ((a ^ b) & mask)             # <<<<<<<<<<<<<<
11867  *
11868  * @cython.cdivision(True)
11869  */
11870   __pyx_r = (__pyx_v_a ^ ((__pyx_v_a ^ __pyx_v_b) & __pyx_v_mask));
11871   goto __pyx_L0;
11872 
11873   /* "yt/utilities/lib/geometry_utils.pxd":230
11874  * @cython.boundscheck(False)
11875  * @cython.wraparound(False)
11876  * cdef inline np.uint64_t masked_merge_64bit(np.uint64_t a, np.uint64_t b, np.uint64_t mask):             # <<<<<<<<<<<<<<
11877  *     # https://graphics.stanford.edu/~seander/bithacks.html#MaskedMerge
11878  *     return a ^ ((a ^ b) & mask)
11879  */
11880 
11881   /* function exit code */
11882   __pyx_L0:;
11883   __Pyx_RefNannyFinishContext();
11884   return __pyx_r;
11885 }
11886 
11887 /* "yt/utilities/lib/geometry_utils.pxd":235
11888  *
11889  * @cython.cdivision(True)
11890  * cdef inline np.uint64_t encode_morton_64bit(np.uint64_t x_ind, np.uint64_t y_ind, np.uint64_t z_ind):             # <<<<<<<<<<<<<<
11891  *     cdef np.uint64_t mi
11892  *     mi = 0
11893  */
11894 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_encode_morton_64bit(__pyx_t_5numpy_uint64_t __pyx_v_x_ind,__pyx_t_5numpy_uint64_t __pyx_v_y_ind,__pyx_t_5numpy_uint64_t __pyx_v_z_ind)11895 static CYTHON_INLINE __pyx_t_5numpy_uint64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_encode_morton_64bit(__pyx_t_5numpy_uint64_t __pyx_v_x_ind, __pyx_t_5numpy_uint64_t __pyx_v_y_ind, __pyx_t_5numpy_uint64_t __pyx_v_z_ind) {
11896   __pyx_t_5numpy_uint64_t __pyx_v_mi;
11897   __pyx_t_5numpy_uint64_t __pyx_r;
11898   __Pyx_RefNannyDeclarations
11899   __Pyx_RefNannySetupContext("encode_morton_64bit", 0);
11900 
11901   /* "yt/utilities/lib/geometry_utils.pxd":237
11902  * cdef inline np.uint64_t encode_morton_64bit(np.uint64_t x_ind, np.uint64_t y_ind, np.uint64_t z_ind):
11903  *     cdef np.uint64_t mi
11904  *     mi = 0             # <<<<<<<<<<<<<<
11905  *     mi |= spread_64bits_by2(z_ind)<<ZSHIFT
11906  *     mi |= spread_64bits_by2(y_ind)<<YSHIFT
11907  */
11908   __pyx_v_mi = 0;
11909 
11910   /* "yt/utilities/lib/geometry_utils.pxd":238
11911  *     cdef np.uint64_t mi
11912  *     mi = 0
11913  *     mi |= spread_64bits_by2(z_ind)<<ZSHIFT             # <<<<<<<<<<<<<<
11914  *     mi |= spread_64bits_by2(y_ind)<<YSHIFT
11915  *     mi |= spread_64bits_by2(x_ind)<<XSHIFT
11916  */
11917   __pyx_v_mi = (__pyx_v_mi | (__pyx_f_2yt_9utilities_3lib_14geometry_utils_spread_64bits_by2(__pyx_v_z_ind) << 0));
11918 
11919   /* "yt/utilities/lib/geometry_utils.pxd":239
11920  *     mi = 0
11921  *     mi |= spread_64bits_by2(z_ind)<<ZSHIFT
11922  *     mi |= spread_64bits_by2(y_ind)<<YSHIFT             # <<<<<<<<<<<<<<
11923  *     mi |= spread_64bits_by2(x_ind)<<XSHIFT
11924  *     return mi
11925  */
11926   __pyx_v_mi = (__pyx_v_mi | (__pyx_f_2yt_9utilities_3lib_14geometry_utils_spread_64bits_by2(__pyx_v_y_ind) << 1));
11927 
11928   /* "yt/utilities/lib/geometry_utils.pxd":240
11929  *     mi |= spread_64bits_by2(z_ind)<<ZSHIFT
11930  *     mi |= spread_64bits_by2(y_ind)<<YSHIFT
11931  *     mi |= spread_64bits_by2(x_ind)<<XSHIFT             # <<<<<<<<<<<<<<
11932  *     return mi
11933  *
11934  */
11935   __pyx_v_mi = (__pyx_v_mi | (__pyx_f_2yt_9utilities_3lib_14geometry_utils_spread_64bits_by2(__pyx_v_x_ind) << 2));
11936 
11937   /* "yt/utilities/lib/geometry_utils.pxd":241
11938  *     mi |= spread_64bits_by2(y_ind)<<YSHIFT
11939  *     mi |= spread_64bits_by2(x_ind)<<XSHIFT
11940  *     return mi             # <<<<<<<<<<<<<<
11941  *
11942  * @cython.cdivision(True)
11943  */
11944   __pyx_r = __pyx_v_mi;
11945   goto __pyx_L0;
11946 
11947   /* "yt/utilities/lib/geometry_utils.pxd":235
11948  *
11949  * @cython.cdivision(True)
11950  * cdef inline np.uint64_t encode_morton_64bit(np.uint64_t x_ind, np.uint64_t y_ind, np.uint64_t z_ind):             # <<<<<<<<<<<<<<
11951  *     cdef np.uint64_t mi
11952  *     mi = 0
11953  */
11954 
11955   /* function exit code */
11956   __pyx_L0:;
11957   __Pyx_RefNannyFinishContext();
11958   return __pyx_r;
11959 }
11960 
11961 /* "yt/utilities/lib/geometry_utils.pxd":244
11962  *
11963  * @cython.cdivision(True)
11964  * cdef inline void decode_morton_64bit(np.uint64_t mi, np.uint64_t *p):             # <<<<<<<<<<<<<<
11965  *     p[0] = compact_64bits_by2(mi>>XSHIFT)
11966  *     p[1] = compact_64bits_by2(mi>>YSHIFT)
11967  */
11968 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_decode_morton_64bit(__pyx_t_5numpy_uint64_t __pyx_v_mi,__pyx_t_5numpy_uint64_t * __pyx_v_p)11969 static CYTHON_INLINE void __pyx_f_2yt_9utilities_3lib_14geometry_utils_decode_morton_64bit(__pyx_t_5numpy_uint64_t __pyx_v_mi, __pyx_t_5numpy_uint64_t *__pyx_v_p) {
11970   __Pyx_RefNannyDeclarations
11971   __Pyx_RefNannySetupContext("decode_morton_64bit", 0);
11972 
11973   /* "yt/utilities/lib/geometry_utils.pxd":245
11974  * @cython.cdivision(True)
11975  * cdef inline void decode_morton_64bit(np.uint64_t mi, np.uint64_t *p):
11976  *     p[0] = compact_64bits_by2(mi>>XSHIFT)             # <<<<<<<<<<<<<<
11977  *     p[1] = compact_64bits_by2(mi>>YSHIFT)
11978  *     p[2] = compact_64bits_by2(mi>>ZSHIFT)
11979  */
11980   (__pyx_v_p[0]) = __pyx_f_2yt_9utilities_3lib_14geometry_utils_compact_64bits_by2((__pyx_v_mi >> 2));
11981 
11982   /* "yt/utilities/lib/geometry_utils.pxd":246
11983  * cdef inline void decode_morton_64bit(np.uint64_t mi, np.uint64_t *p):
11984  *     p[0] = compact_64bits_by2(mi>>XSHIFT)
11985  *     p[1] = compact_64bits_by2(mi>>YSHIFT)             # <<<<<<<<<<<<<<
11986  *     p[2] = compact_64bits_by2(mi>>ZSHIFT)
11987  *
11988  */
11989   (__pyx_v_p[1]) = __pyx_f_2yt_9utilities_3lib_14geometry_utils_compact_64bits_by2((__pyx_v_mi >> 1));
11990 
11991   /* "yt/utilities/lib/geometry_utils.pxd":247
11992  *     p[0] = compact_64bits_by2(mi>>XSHIFT)
11993  *     p[1] = compact_64bits_by2(mi>>YSHIFT)
11994  *     p[2] = compact_64bits_by2(mi>>ZSHIFT)             # <<<<<<<<<<<<<<
11995  *
11996  * @cython.cdivision(True)
11997  */
11998   (__pyx_v_p[2]) = __pyx_f_2yt_9utilities_3lib_14geometry_utils_compact_64bits_by2((__pyx_v_mi >> 0));
11999 
12000   /* "yt/utilities/lib/geometry_utils.pxd":244
12001  *
12002  * @cython.cdivision(True)
12003  * cdef inline void decode_morton_64bit(np.uint64_t mi, np.uint64_t *p):             # <<<<<<<<<<<<<<
12004  *     p[0] = compact_64bits_by2(mi>>XSHIFT)
12005  *     p[1] = compact_64bits_by2(mi>>YSHIFT)
12006  */
12007 
12008   /* function exit code */
12009   __Pyx_RefNannyFinishContext();
12010 }
12011 
12012 /* "yt/utilities/lib/geometry_utils.pxd":250
12013  *
12014  * @cython.cdivision(True)
12015  * cdef inline np.uint64_t bounded_morton(np.float64_t x, np.float64_t y, np.float64_t z,             # <<<<<<<<<<<<<<
12016  *                                np.float64_t *DLE, np.float64_t *DRE, np.int32_t order):
12017  *     cdef int i
12018  */
12019 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_bounded_morton(__pyx_t_5numpy_float64_t __pyx_v_x,__pyx_t_5numpy_float64_t __pyx_v_y,__pyx_t_5numpy_float64_t __pyx_v_z,__pyx_t_5numpy_float64_t * __pyx_v_DLE,__pyx_t_5numpy_float64_t * __pyx_v_DRE,__pyx_t_5numpy_int32_t __pyx_v_order)12020 static CYTHON_INLINE __pyx_t_5numpy_uint64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_bounded_morton(__pyx_t_5numpy_float64_t __pyx_v_x, __pyx_t_5numpy_float64_t __pyx_v_y, __pyx_t_5numpy_float64_t __pyx_v_z, __pyx_t_5numpy_float64_t *__pyx_v_DLE, __pyx_t_5numpy_float64_t *__pyx_v_DRE, __pyx_t_5numpy_int32_t __pyx_v_order) {
12021   int __pyx_v_i;
12022   __pyx_t_5numpy_float64_t __pyx_v_dds[3];
12023   __pyx_t_5numpy_uint64_t __pyx_v_x_ind;
12024   __pyx_t_5numpy_uint64_t __pyx_v_y_ind;
12025   __pyx_t_5numpy_uint64_t __pyx_v_z_ind;
12026   __pyx_t_5numpy_uint64_t __pyx_v_mi;
12027   __pyx_t_5numpy_uint64_t __pyx_r;
12028   __Pyx_RefNannyDeclarations
12029   int __pyx_t_1;
12030   __Pyx_RefNannySetupContext("bounded_morton", 0);
12031 
12032   /* "yt/utilities/lib/geometry_utils.pxd":256
12033  *     cdef np.uint64_t x_ind, y_ind, z_ind
12034  *     cdef np.uint64_t mi
12035  *     for i in range(3):             # <<<<<<<<<<<<<<
12036  *         dds[i] = (DRE[i] - DLE[i]) / (1 << order)
12037  *     x_ind = <np.uint64_t> ((x - DLE[0])/dds[0])
12038  */
12039   for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
12040     __pyx_v_i = __pyx_t_1;
12041 
12042     /* "yt/utilities/lib/geometry_utils.pxd":257
12043  *     cdef np.uint64_t mi
12044  *     for i in range(3):
12045  *         dds[i] = (DRE[i] - DLE[i]) / (1 << order)             # <<<<<<<<<<<<<<
12046  *     x_ind = <np.uint64_t> ((x - DLE[0])/dds[0])
12047  *     y_ind = <np.uint64_t> ((y - DLE[1])/dds[1])
12048  */
12049     (__pyx_v_dds[__pyx_v_i]) = (((__pyx_v_DRE[__pyx_v_i]) - (__pyx_v_DLE[__pyx_v_i])) / (1 << __pyx_v_order));
12050   }
12051 
12052   /* "yt/utilities/lib/geometry_utils.pxd":258
12053  *     for i in range(3):
12054  *         dds[i] = (DRE[i] - DLE[i]) / (1 << order)
12055  *     x_ind = <np.uint64_t> ((x - DLE[0])/dds[0])             # <<<<<<<<<<<<<<
12056  *     y_ind = <np.uint64_t> ((y - DLE[1])/dds[1])
12057  *     z_ind = <np.uint64_t> ((z - DLE[2])/dds[2])
12058  */
12059   __pyx_v_x_ind = ((__pyx_t_5numpy_uint64_t)((__pyx_v_x - (__pyx_v_DLE[0])) / (__pyx_v_dds[0])));
12060 
12061   /* "yt/utilities/lib/geometry_utils.pxd":259
12062  *         dds[i] = (DRE[i] - DLE[i]) / (1 << order)
12063  *     x_ind = <np.uint64_t> ((x - DLE[0])/dds[0])
12064  *     y_ind = <np.uint64_t> ((y - DLE[1])/dds[1])             # <<<<<<<<<<<<<<
12065  *     z_ind = <np.uint64_t> ((z - DLE[2])/dds[2])
12066  *     mi = encode_morton_64bit(x_ind,y_ind,z_ind)
12067  */
12068   __pyx_v_y_ind = ((__pyx_t_5numpy_uint64_t)((__pyx_v_y - (__pyx_v_DLE[1])) / (__pyx_v_dds[1])));
12069 
12070   /* "yt/utilities/lib/geometry_utils.pxd":260
12071  *     x_ind = <np.uint64_t> ((x - DLE[0])/dds[0])
12072  *     y_ind = <np.uint64_t> ((y - DLE[1])/dds[1])
12073  *     z_ind = <np.uint64_t> ((z - DLE[2])/dds[2])             # <<<<<<<<<<<<<<
12074  *     mi = encode_morton_64bit(x_ind,y_ind,z_ind)
12075  *     return mi
12076  */
12077   __pyx_v_z_ind = ((__pyx_t_5numpy_uint64_t)((__pyx_v_z - (__pyx_v_DLE[2])) / (__pyx_v_dds[2])));
12078 
12079   /* "yt/utilities/lib/geometry_utils.pxd":261
12080  *     y_ind = <np.uint64_t> ((y - DLE[1])/dds[1])
12081  *     z_ind = <np.uint64_t> ((z - DLE[2])/dds[2])
12082  *     mi = encode_morton_64bit(x_ind,y_ind,z_ind)             # <<<<<<<<<<<<<<
12083  *     return mi
12084  *
12085  */
12086   __pyx_v_mi = __pyx_f_2yt_9utilities_3lib_14geometry_utils_encode_morton_64bit(__pyx_v_x_ind, __pyx_v_y_ind, __pyx_v_z_ind);
12087 
12088   /* "yt/utilities/lib/geometry_utils.pxd":262
12089  *     z_ind = <np.uint64_t> ((z - DLE[2])/dds[2])
12090  *     mi = encode_morton_64bit(x_ind,y_ind,z_ind)
12091  *     return mi             # <<<<<<<<<<<<<<
12092  *
12093  * @cython.cdivision(True)
12094  */
12095   __pyx_r = __pyx_v_mi;
12096   goto __pyx_L0;
12097 
12098   /* "yt/utilities/lib/geometry_utils.pxd":250
12099  *
12100  * @cython.cdivision(True)
12101  * cdef inline np.uint64_t bounded_morton(np.float64_t x, np.float64_t y, np.float64_t z,             # <<<<<<<<<<<<<<
12102  *                                np.float64_t *DLE, np.float64_t *DRE, np.int32_t order):
12103  *     cdef int i
12104  */
12105 
12106   /* function exit code */
12107   __pyx_L0:;
12108   __Pyx_RefNannyFinishContext();
12109   return __pyx_r;
12110 }
12111 
12112 /* "yt/utilities/lib/geometry_utils.pxd":265
12113  *
12114  * @cython.cdivision(True)
12115  * cdef inline np.uint64_t bounded_morton_relative(np.float64_t x, np.float64_t y, np.float64_t z,             # <<<<<<<<<<<<<<
12116  *                                np.float64_t *DLE, np.float64_t *DRE,
12117  *                                np.int32_t order1, np.int32_t order2):
12118  */
12119 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_bounded_morton_relative(__pyx_t_5numpy_float64_t __pyx_v_x,__pyx_t_5numpy_float64_t __pyx_v_y,__pyx_t_5numpy_float64_t __pyx_v_z,__pyx_t_5numpy_float64_t * __pyx_v_DLE,__pyx_t_5numpy_float64_t * __pyx_v_DRE,__pyx_t_5numpy_int32_t __pyx_v_order1,__pyx_t_5numpy_int32_t __pyx_v_order2)12120 static CYTHON_INLINE __pyx_t_5numpy_uint64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_bounded_morton_relative(__pyx_t_5numpy_float64_t __pyx_v_x, __pyx_t_5numpy_float64_t __pyx_v_y, __pyx_t_5numpy_float64_t __pyx_v_z, __pyx_t_5numpy_float64_t *__pyx_v_DLE, __pyx_t_5numpy_float64_t *__pyx_v_DRE, __pyx_t_5numpy_int32_t __pyx_v_order1, __pyx_t_5numpy_int32_t __pyx_v_order2) {
12121   int __pyx_v_i;
12122   __pyx_t_5numpy_float64_t __pyx_v_dds1[3];
12123   __pyx_t_5numpy_float64_t __pyx_v_dds2[3];
12124   __pyx_t_5numpy_float64_t __pyx_v_DLE2[3];
12125   __pyx_t_5numpy_uint64_t __pyx_v_x_ind;
12126   __pyx_t_5numpy_uint64_t __pyx_v_y_ind;
12127   __pyx_t_5numpy_uint64_t __pyx_v_z_ind;
12128   __pyx_t_5numpy_uint64_t __pyx_v_mi2;
12129   __pyx_t_5numpy_uint64_t __pyx_r;
12130   __Pyx_RefNannyDeclarations
12131   int __pyx_t_1;
12132   __Pyx_RefNannySetupContext("bounded_morton_relative", 0);
12133 
12134   /* "yt/utilities/lib/geometry_utils.pxd":274
12135  *     cdef np.uint64_t x_ind, y_ind, z_ind
12136  *     cdef np.uint64_t mi2
12137  *     for i in range(3):             # <<<<<<<<<<<<<<
12138  *         dds1[i] = (DRE[i] - DLE[i]) / (1 << order1)
12139  *         dds2[i] = dds1[i] / (1 << order2)
12140  */
12141   for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
12142     __pyx_v_i = __pyx_t_1;
12143 
12144     /* "yt/utilities/lib/geometry_utils.pxd":275
12145  *     cdef np.uint64_t mi2
12146  *     for i in range(3):
12147  *         dds1[i] = (DRE[i] - DLE[i]) / (1 << order1)             # <<<<<<<<<<<<<<
12148  *         dds2[i] = dds1[i] / (1 << order2)
12149  *     DLE2[0] = <np.float64_t> (<np.uint64_t> ((x - DLE[0])/dds1[0])) * dds1[0]
12150  */
12151     (__pyx_v_dds1[__pyx_v_i]) = (((__pyx_v_DRE[__pyx_v_i]) - (__pyx_v_DLE[__pyx_v_i])) / (1 << __pyx_v_order1));
12152 
12153     /* "yt/utilities/lib/geometry_utils.pxd":276
12154  *     for i in range(3):
12155  *         dds1[i] = (DRE[i] - DLE[i]) / (1 << order1)
12156  *         dds2[i] = dds1[i] / (1 << order2)             # <<<<<<<<<<<<<<
12157  *     DLE2[0] = <np.float64_t> (<np.uint64_t> ((x - DLE[0])/dds1[0])) * dds1[0]
12158  *     DLE2[1] = <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]
12159  */
12160     (__pyx_v_dds2[__pyx_v_i]) = ((__pyx_v_dds1[__pyx_v_i]) / (1 << __pyx_v_order2));
12161   }
12162 
12163   /* "yt/utilities/lib/geometry_utils.pxd":277
12164  *         dds1[i] = (DRE[i] - DLE[i]) / (1 << order1)
12165  *         dds2[i] = dds1[i] / (1 << order2)
12166  *     DLE2[0] = <np.float64_t> (<np.uint64_t> ((x - DLE[0])/dds1[0])) * dds1[0]             # <<<<<<<<<<<<<<
12167  *     DLE2[1] = <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]
12168  *     DLE2[2] = <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]
12169  */
12170   (__pyx_v_DLE2[0]) = (((__pyx_t_5numpy_float64_t)((__pyx_t_5numpy_uint64_t)((__pyx_v_x - (__pyx_v_DLE[0])) / (__pyx_v_dds1[0])))) * (__pyx_v_dds1[0]));
12171 
12172   /* "yt/utilities/lib/geometry_utils.pxd":278
12173  *         dds2[i] = dds1[i] / (1 << order2)
12174  *     DLE2[0] = <np.float64_t> (<np.uint64_t> ((x - DLE[0])/dds1[0])) * dds1[0]
12175  *     DLE2[1] = <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]             # <<<<<<<<<<<<<<
12176  *     DLE2[2] = <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]
12177  *     x_ind = <np.uint64_t> ((x - DLE2[0])/dds2[0])
12178  */
12179   (__pyx_v_DLE2[1]) = (((__pyx_t_5numpy_float64_t)((__pyx_t_5numpy_uint64_t)((__pyx_v_y - (__pyx_v_DLE[1])) / (__pyx_v_dds1[1])))) * (__pyx_v_dds1[1]));
12180 
12181   /* "yt/utilities/lib/geometry_utils.pxd":279
12182  *     DLE2[0] = <np.float64_t> (<np.uint64_t> ((x - DLE[0])/dds1[0])) * dds1[0]
12183  *     DLE2[1] = <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]
12184  *     DLE2[2] = <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]             # <<<<<<<<<<<<<<
12185  *     x_ind = <np.uint64_t> ((x - DLE2[0])/dds2[0])
12186  *     y_ind = <np.uint64_t> ((y - DLE2[1])/dds2[1])
12187  */
12188   (__pyx_v_DLE2[2]) = (((__pyx_t_5numpy_float64_t)((__pyx_t_5numpy_uint64_t)((__pyx_v_z - (__pyx_v_DLE[2])) / (__pyx_v_dds1[2])))) * (__pyx_v_dds1[2]));
12189 
12190   /* "yt/utilities/lib/geometry_utils.pxd":280
12191  *     DLE2[1] = <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]
12192  *     DLE2[2] = <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]
12193  *     x_ind = <np.uint64_t> ((x - DLE2[0])/dds2[0])             # <<<<<<<<<<<<<<
12194  *     y_ind = <np.uint64_t> ((y - DLE2[1])/dds2[1])
12195  *     z_ind = <np.uint64_t> ((z - DLE2[2])/dds2[2])
12196  */
12197   __pyx_v_x_ind = ((__pyx_t_5numpy_uint64_t)((__pyx_v_x - (__pyx_v_DLE2[0])) / (__pyx_v_dds2[0])));
12198 
12199   /* "yt/utilities/lib/geometry_utils.pxd":281
12200  *     DLE2[2] = <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]
12201  *     x_ind = <np.uint64_t> ((x - DLE2[0])/dds2[0])
12202  *     y_ind = <np.uint64_t> ((y - DLE2[1])/dds2[1])             # <<<<<<<<<<<<<<
12203  *     z_ind = <np.uint64_t> ((z - DLE2[2])/dds2[2])
12204  *     mi2 = encode_morton_64bit(x_ind,y_ind,z_ind)
12205  */
12206   __pyx_v_y_ind = ((__pyx_t_5numpy_uint64_t)((__pyx_v_y - (__pyx_v_DLE2[1])) / (__pyx_v_dds2[1])));
12207 
12208   /* "yt/utilities/lib/geometry_utils.pxd":282
12209  *     x_ind = <np.uint64_t> ((x - DLE2[0])/dds2[0])
12210  *     y_ind = <np.uint64_t> ((y - DLE2[1])/dds2[1])
12211  *     z_ind = <np.uint64_t> ((z - DLE2[2])/dds2[2])             # <<<<<<<<<<<<<<
12212  *     mi2 = encode_morton_64bit(x_ind,y_ind,z_ind)
12213  *     return mi2
12214  */
12215   __pyx_v_z_ind = ((__pyx_t_5numpy_uint64_t)((__pyx_v_z - (__pyx_v_DLE2[2])) / (__pyx_v_dds2[2])));
12216 
12217   /* "yt/utilities/lib/geometry_utils.pxd":283
12218  *     y_ind = <np.uint64_t> ((y - DLE2[1])/dds2[1])
12219  *     z_ind = <np.uint64_t> ((z - DLE2[2])/dds2[2])
12220  *     mi2 = encode_morton_64bit(x_ind,y_ind,z_ind)             # <<<<<<<<<<<<<<
12221  *     return mi2
12222  *
12223  */
12224   __pyx_v_mi2 = __pyx_f_2yt_9utilities_3lib_14geometry_utils_encode_morton_64bit(__pyx_v_x_ind, __pyx_v_y_ind, __pyx_v_z_ind);
12225 
12226   /* "yt/utilities/lib/geometry_utils.pxd":284
12227  *     z_ind = <np.uint64_t> ((z - DLE2[2])/dds2[2])
12228  *     mi2 = encode_morton_64bit(x_ind,y_ind,z_ind)
12229  *     return mi2             # <<<<<<<<<<<<<<
12230  *
12231  *
12232  */
12233   __pyx_r = __pyx_v_mi2;
12234   goto __pyx_L0;
12235 
12236   /* "yt/utilities/lib/geometry_utils.pxd":265
12237  *
12238  * @cython.cdivision(True)
12239  * cdef inline np.uint64_t bounded_morton_relative(np.float64_t x, np.float64_t y, np.float64_t z,             # <<<<<<<<<<<<<<
12240  *                                np.float64_t *DLE, np.float64_t *DRE,
12241  *                                np.int32_t order1, np.int32_t order2):
12242  */
12243 
12244   /* function exit code */
12245   __pyx_L0:;
12246   __Pyx_RefNannyFinishContext();
12247   return __pyx_r;
12248 }
12249 
12250 /* "yt/utilities/lib/geometry_utils.pxd":289
12251  * # This dosn't seem to be much, if at all, faster...
12252  * @cython.cdivision(True)
12253  * cdef inline np.uint64_t bounded_morton_dds(np.float64_t x, np.float64_t y, np.float64_t z,             # <<<<<<<<<<<<<<
12254  *                                np.float64_t *DLE, np.float64_t *dds):
12255  *     cdef np.uint64_t x_ind, y_ind, z_ind
12256  */
12257 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_bounded_morton_dds(__pyx_t_5numpy_float64_t __pyx_v_x,__pyx_t_5numpy_float64_t __pyx_v_y,__pyx_t_5numpy_float64_t __pyx_v_z,__pyx_t_5numpy_float64_t * __pyx_v_DLE,__pyx_t_5numpy_float64_t * __pyx_v_dds)12258 static CYTHON_INLINE __pyx_t_5numpy_uint64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_bounded_morton_dds(__pyx_t_5numpy_float64_t __pyx_v_x, __pyx_t_5numpy_float64_t __pyx_v_y, __pyx_t_5numpy_float64_t __pyx_v_z, __pyx_t_5numpy_float64_t *__pyx_v_DLE, __pyx_t_5numpy_float64_t *__pyx_v_dds) {
12259   __pyx_t_5numpy_uint64_t __pyx_v_x_ind;
12260   __pyx_t_5numpy_uint64_t __pyx_v_y_ind;
12261   __pyx_t_5numpy_uint64_t __pyx_v_z_ind;
12262   __pyx_t_5numpy_uint64_t __pyx_v_mi;
12263   __pyx_t_5numpy_uint64_t __pyx_r;
12264   __Pyx_RefNannyDeclarations
12265   __Pyx_RefNannySetupContext("bounded_morton_dds", 0);
12266 
12267   /* "yt/utilities/lib/geometry_utils.pxd":293
12268  *     cdef np.uint64_t x_ind, y_ind, z_ind
12269  *     cdef np.uint64_t mi
12270  *     x_ind = <np.uint64_t> ((x - DLE[0])/dds[0])             # <<<<<<<<<<<<<<
12271  *     y_ind = <np.uint64_t> ((y - DLE[1])/dds[1])
12272  *     z_ind = <np.uint64_t> ((z - DLE[2])/dds[2])
12273  */
12274   __pyx_v_x_ind = ((__pyx_t_5numpy_uint64_t)((__pyx_v_x - (__pyx_v_DLE[0])) / (__pyx_v_dds[0])));
12275 
12276   /* "yt/utilities/lib/geometry_utils.pxd":294
12277  *     cdef np.uint64_t mi
12278  *     x_ind = <np.uint64_t> ((x - DLE[0])/dds[0])
12279  *     y_ind = <np.uint64_t> ((y - DLE[1])/dds[1])             # <<<<<<<<<<<<<<
12280  *     z_ind = <np.uint64_t> ((z - DLE[2])/dds[2])
12281  *     mi = encode_morton_64bit(x_ind,y_ind,z_ind)
12282  */
12283   __pyx_v_y_ind = ((__pyx_t_5numpy_uint64_t)((__pyx_v_y - (__pyx_v_DLE[1])) / (__pyx_v_dds[1])));
12284 
12285   /* "yt/utilities/lib/geometry_utils.pxd":295
12286  *     x_ind = <np.uint64_t> ((x - DLE[0])/dds[0])
12287  *     y_ind = <np.uint64_t> ((y - DLE[1])/dds[1])
12288  *     z_ind = <np.uint64_t> ((z - DLE[2])/dds[2])             # <<<<<<<<<<<<<<
12289  *     mi = encode_morton_64bit(x_ind,y_ind,z_ind)
12290  *     return mi
12291  */
12292   __pyx_v_z_ind = ((__pyx_t_5numpy_uint64_t)((__pyx_v_z - (__pyx_v_DLE[2])) / (__pyx_v_dds[2])));
12293 
12294   /* "yt/utilities/lib/geometry_utils.pxd":296
12295  *     y_ind = <np.uint64_t> ((y - DLE[1])/dds[1])
12296  *     z_ind = <np.uint64_t> ((z - DLE[2])/dds[2])
12297  *     mi = encode_morton_64bit(x_ind,y_ind,z_ind)             # <<<<<<<<<<<<<<
12298  *     return mi
12299  *
12300  */
12301   __pyx_v_mi = __pyx_f_2yt_9utilities_3lib_14geometry_utils_encode_morton_64bit(__pyx_v_x_ind, __pyx_v_y_ind, __pyx_v_z_ind);
12302 
12303   /* "yt/utilities/lib/geometry_utils.pxd":297
12304  *     z_ind = <np.uint64_t> ((z - DLE[2])/dds[2])
12305  *     mi = encode_morton_64bit(x_ind,y_ind,z_ind)
12306  *     return mi             # <<<<<<<<<<<<<<
12307  *
12308  * @cython.cdivision(True)
12309  */
12310   __pyx_r = __pyx_v_mi;
12311   goto __pyx_L0;
12312 
12313   /* "yt/utilities/lib/geometry_utils.pxd":289
12314  * # This dosn't seem to be much, if at all, faster...
12315  * @cython.cdivision(True)
12316  * cdef inline np.uint64_t bounded_morton_dds(np.float64_t x, np.float64_t y, np.float64_t z,             # <<<<<<<<<<<<<<
12317  *                                np.float64_t *DLE, np.float64_t *dds):
12318  *     cdef np.uint64_t x_ind, y_ind, z_ind
12319  */
12320 
12321   /* function exit code */
12322   __pyx_L0:;
12323   __Pyx_RefNannyFinishContext();
12324   return __pyx_r;
12325 }
12326 
12327 /* "yt/utilities/lib/geometry_utils.pxd":300
12328  *
12329  * @cython.cdivision(True)
12330  * cdef inline np.uint64_t bounded_morton_relative_dds(np.float64_t x, np.float64_t y, np.float64_t z,             # <<<<<<<<<<<<<<
12331  *                                np.float64_t *DLE, np.float64_t *dds1, np.float64_t *dds2):
12332  *     cdef np.float64_t DLE2[3]
12333  */
12334 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_bounded_morton_relative_dds(__pyx_t_5numpy_float64_t __pyx_v_x,__pyx_t_5numpy_float64_t __pyx_v_y,__pyx_t_5numpy_float64_t __pyx_v_z,__pyx_t_5numpy_float64_t * __pyx_v_DLE,__pyx_t_5numpy_float64_t * __pyx_v_dds1,__pyx_t_5numpy_float64_t * __pyx_v_dds2)12335 static CYTHON_INLINE __pyx_t_5numpy_uint64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_bounded_morton_relative_dds(__pyx_t_5numpy_float64_t __pyx_v_x, __pyx_t_5numpy_float64_t __pyx_v_y, __pyx_t_5numpy_float64_t __pyx_v_z, __pyx_t_5numpy_float64_t *__pyx_v_DLE, __pyx_t_5numpy_float64_t *__pyx_v_dds1, __pyx_t_5numpy_float64_t *__pyx_v_dds2) {
12336   __pyx_t_5numpy_float64_t __pyx_v_DLE2[3];
12337   __pyx_t_5numpy_uint64_t __pyx_v_x_ind;
12338   __pyx_t_5numpy_uint64_t __pyx_v_y_ind;
12339   __pyx_t_5numpy_uint64_t __pyx_v_z_ind;
12340   __pyx_t_5numpy_uint64_t __pyx_v_mi2;
12341   __pyx_t_5numpy_uint64_t __pyx_r;
12342   __Pyx_RefNannyDeclarations
12343   __Pyx_RefNannySetupContext("bounded_morton_relative_dds", 0);
12344 
12345   /* "yt/utilities/lib/geometry_utils.pxd":305
12346  *     cdef np.uint64_t x_ind, y_ind, z_ind
12347  *     cdef np.uint64_t mi2
12348  *     DLE2[0] = <np.float64_t> (<np.uint64_t> ((x - DLE[0])/dds1[0])) * dds1[0]             # <<<<<<<<<<<<<<
12349  *     DLE2[1] = <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]
12350  *     DLE2[2] = <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]
12351  */
12352   (__pyx_v_DLE2[0]) = (((__pyx_t_5numpy_float64_t)((__pyx_t_5numpy_uint64_t)((__pyx_v_x - (__pyx_v_DLE[0])) / (__pyx_v_dds1[0])))) * (__pyx_v_dds1[0]));
12353 
12354   /* "yt/utilities/lib/geometry_utils.pxd":306
12355  *     cdef np.uint64_t mi2
12356  *     DLE2[0] = <np.float64_t> (<np.uint64_t> ((x - DLE[0])/dds1[0])) * dds1[0]
12357  *     DLE2[1] = <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]             # <<<<<<<<<<<<<<
12358  *     DLE2[2] = <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]
12359  *     x_ind = <np.uint64_t> ((x - DLE2[0])/dds2[0])
12360  */
12361   (__pyx_v_DLE2[1]) = (((__pyx_t_5numpy_float64_t)((__pyx_t_5numpy_uint64_t)((__pyx_v_y - (__pyx_v_DLE[1])) / (__pyx_v_dds1[1])))) * (__pyx_v_dds1[1]));
12362 
12363   /* "yt/utilities/lib/geometry_utils.pxd":307
12364  *     DLE2[0] = <np.float64_t> (<np.uint64_t> ((x - DLE[0])/dds1[0])) * dds1[0]
12365  *     DLE2[1] = <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]
12366  *     DLE2[2] = <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]             # <<<<<<<<<<<<<<
12367  *     x_ind = <np.uint64_t> ((x - DLE2[0])/dds2[0])
12368  *     y_ind = <np.uint64_t> ((y - DLE2[1])/dds2[1])
12369  */
12370   (__pyx_v_DLE2[2]) = (((__pyx_t_5numpy_float64_t)((__pyx_t_5numpy_uint64_t)((__pyx_v_z - (__pyx_v_DLE[2])) / (__pyx_v_dds1[2])))) * (__pyx_v_dds1[2]));
12371 
12372   /* "yt/utilities/lib/geometry_utils.pxd":308
12373  *     DLE2[1] = <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]
12374  *     DLE2[2] = <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]
12375  *     x_ind = <np.uint64_t> ((x - DLE2[0])/dds2[0])             # <<<<<<<<<<<<<<
12376  *     y_ind = <np.uint64_t> ((y - DLE2[1])/dds2[1])
12377  *     z_ind = <np.uint64_t> ((z - DLE2[2])/dds2[2])
12378  */
12379   __pyx_v_x_ind = ((__pyx_t_5numpy_uint64_t)((__pyx_v_x - (__pyx_v_DLE2[0])) / (__pyx_v_dds2[0])));
12380 
12381   /* "yt/utilities/lib/geometry_utils.pxd":309
12382  *     DLE2[2] = <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]
12383  *     x_ind = <np.uint64_t> ((x - DLE2[0])/dds2[0])
12384  *     y_ind = <np.uint64_t> ((y - DLE2[1])/dds2[1])             # <<<<<<<<<<<<<<
12385  *     z_ind = <np.uint64_t> ((z - DLE2[2])/dds2[2])
12386  *     mi2 = encode_morton_64bit(x_ind,y_ind,z_ind)
12387  */
12388   __pyx_v_y_ind = ((__pyx_t_5numpy_uint64_t)((__pyx_v_y - (__pyx_v_DLE2[1])) / (__pyx_v_dds2[1])));
12389 
12390   /* "yt/utilities/lib/geometry_utils.pxd":310
12391  *     x_ind = <np.uint64_t> ((x - DLE2[0])/dds2[0])
12392  *     y_ind = <np.uint64_t> ((y - DLE2[1])/dds2[1])
12393  *     z_ind = <np.uint64_t> ((z - DLE2[2])/dds2[2])             # <<<<<<<<<<<<<<
12394  *     mi2 = encode_morton_64bit(x_ind,y_ind,z_ind)
12395  *     return mi2
12396  */
12397   __pyx_v_z_ind = ((__pyx_t_5numpy_uint64_t)((__pyx_v_z - (__pyx_v_DLE2[2])) / (__pyx_v_dds2[2])));
12398 
12399   /* "yt/utilities/lib/geometry_utils.pxd":311
12400  *     y_ind = <np.uint64_t> ((y - DLE2[1])/dds2[1])
12401  *     z_ind = <np.uint64_t> ((z - DLE2[2])/dds2[2])
12402  *     mi2 = encode_morton_64bit(x_ind,y_ind,z_ind)             # <<<<<<<<<<<<<<
12403  *     return mi2
12404  *
12405  */
12406   __pyx_v_mi2 = __pyx_f_2yt_9utilities_3lib_14geometry_utils_encode_morton_64bit(__pyx_v_x_ind, __pyx_v_y_ind, __pyx_v_z_ind);
12407 
12408   /* "yt/utilities/lib/geometry_utils.pxd":312
12409  *     z_ind = <np.uint64_t> ((z - DLE2[2])/dds2[2])
12410  *     mi2 = encode_morton_64bit(x_ind,y_ind,z_ind)
12411  *     return mi2             # <<<<<<<<<<<<<<
12412  *
12413  *
12414  */
12415   __pyx_r = __pyx_v_mi2;
12416   goto __pyx_L0;
12417 
12418   /* "yt/utilities/lib/geometry_utils.pxd":300
12419  *
12420  * @cython.cdivision(True)
12421  * cdef inline np.uint64_t bounded_morton_relative_dds(np.float64_t x, np.float64_t y, np.float64_t z,             # <<<<<<<<<<<<<<
12422  *                                np.float64_t *DLE, np.float64_t *dds1, np.float64_t *dds2):
12423  *     cdef np.float64_t DLE2[3]
12424  */
12425 
12426   /* function exit code */
12427   __pyx_L0:;
12428   __Pyx_RefNannyFinishContext();
12429   return __pyx_r;
12430 }
12431 
12432 /* "yt/utilities/lib/geometry_utils.pxd":316
12433  *
12434  * @cython.cdivision(True)
12435  * cdef inline np.uint64_t bounded_morton_split_dds(np.float64_t x, np.float64_t y, np.float64_t z,             # <<<<<<<<<<<<<<
12436  *                                np.float64_t *DLE, np.float64_t *dds, np.uint64_t *p):
12437  *     cdef np.uint64_t mi
12438  */
12439 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_bounded_morton_split_dds(__pyx_t_5numpy_float64_t __pyx_v_x,__pyx_t_5numpy_float64_t __pyx_v_y,__pyx_t_5numpy_float64_t __pyx_v_z,__pyx_t_5numpy_float64_t * __pyx_v_DLE,__pyx_t_5numpy_float64_t * __pyx_v_dds,__pyx_t_5numpy_uint64_t * __pyx_v_p)12440 static CYTHON_INLINE __pyx_t_5numpy_uint64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_bounded_morton_split_dds(__pyx_t_5numpy_float64_t __pyx_v_x, __pyx_t_5numpy_float64_t __pyx_v_y, __pyx_t_5numpy_float64_t __pyx_v_z, __pyx_t_5numpy_float64_t *__pyx_v_DLE, __pyx_t_5numpy_float64_t *__pyx_v_dds, __pyx_t_5numpy_uint64_t *__pyx_v_p) {
12441   __pyx_t_5numpy_uint64_t __pyx_v_mi;
12442   __pyx_t_5numpy_uint64_t __pyx_r;
12443   __Pyx_RefNannyDeclarations
12444   __Pyx_RefNannySetupContext("bounded_morton_split_dds", 0);
12445 
12446   /* "yt/utilities/lib/geometry_utils.pxd":319
12447  *                                np.float64_t *DLE, np.float64_t *dds, np.uint64_t *p):
12448  *     cdef np.uint64_t mi
12449  *     p[0] = <np.uint64_t> ((x - DLE[0])/dds[0])             # <<<<<<<<<<<<<<
12450  *     p[1] = <np.uint64_t> ((y - DLE[1])/dds[1])
12451  *     p[2] = <np.uint64_t> ((z - DLE[2])/dds[2])
12452  */
12453   (__pyx_v_p[0]) = ((__pyx_t_5numpy_uint64_t)((__pyx_v_x - (__pyx_v_DLE[0])) / (__pyx_v_dds[0])));
12454 
12455   /* "yt/utilities/lib/geometry_utils.pxd":320
12456  *     cdef np.uint64_t mi
12457  *     p[0] = <np.uint64_t> ((x - DLE[0])/dds[0])
12458  *     p[1] = <np.uint64_t> ((y - DLE[1])/dds[1])             # <<<<<<<<<<<<<<
12459  *     p[2] = <np.uint64_t> ((z - DLE[2])/dds[2])
12460  *     mi = encode_morton_64bit(p[0], p[1], p[2])
12461  */
12462   (__pyx_v_p[1]) = ((__pyx_t_5numpy_uint64_t)((__pyx_v_y - (__pyx_v_DLE[1])) / (__pyx_v_dds[1])));
12463 
12464   /* "yt/utilities/lib/geometry_utils.pxd":321
12465  *     p[0] = <np.uint64_t> ((x - DLE[0])/dds[0])
12466  *     p[1] = <np.uint64_t> ((y - DLE[1])/dds[1])
12467  *     p[2] = <np.uint64_t> ((z - DLE[2])/dds[2])             # <<<<<<<<<<<<<<
12468  *     mi = encode_morton_64bit(p[0], p[1], p[2])
12469  *     return mi
12470  */
12471   (__pyx_v_p[2]) = ((__pyx_t_5numpy_uint64_t)((__pyx_v_z - (__pyx_v_DLE[2])) / (__pyx_v_dds[2])));
12472 
12473   /* "yt/utilities/lib/geometry_utils.pxd":322
12474  *     p[1] = <np.uint64_t> ((y - DLE[1])/dds[1])
12475  *     p[2] = <np.uint64_t> ((z - DLE[2])/dds[2])
12476  *     mi = encode_morton_64bit(p[0], p[1], p[2])             # <<<<<<<<<<<<<<
12477  *     return mi
12478  *
12479  */
12480   __pyx_v_mi = __pyx_f_2yt_9utilities_3lib_14geometry_utils_encode_morton_64bit((__pyx_v_p[0]), (__pyx_v_p[1]), (__pyx_v_p[2]));
12481 
12482   /* "yt/utilities/lib/geometry_utils.pxd":323
12483  *     p[2] = <np.uint64_t> ((z - DLE[2])/dds[2])
12484  *     mi = encode_morton_64bit(p[0], p[1], p[2])
12485  *     return mi             # <<<<<<<<<<<<<<
12486  *
12487  * @cython.cdivision(True)
12488  */
12489   __pyx_r = __pyx_v_mi;
12490   goto __pyx_L0;
12491 
12492   /* "yt/utilities/lib/geometry_utils.pxd":316
12493  *
12494  * @cython.cdivision(True)
12495  * cdef inline np.uint64_t bounded_morton_split_dds(np.float64_t x, np.float64_t y, np.float64_t z,             # <<<<<<<<<<<<<<
12496  *                                np.float64_t *DLE, np.float64_t *dds, np.uint64_t *p):
12497  *     cdef np.uint64_t mi
12498  */
12499 
12500   /* function exit code */
12501   __pyx_L0:;
12502   __Pyx_RefNannyFinishContext();
12503   return __pyx_r;
12504 }
12505 
12506 /* "yt/utilities/lib/geometry_utils.pxd":326
12507  *
12508  * @cython.cdivision(True)
12509  * cdef inline np.uint64_t bounded_morton_split_relative_dds(np.float64_t x, np.float64_t y, np.float64_t z,             # <<<<<<<<<<<<<<
12510  *                                np.float64_t *DLE, np.float64_t *dds1, np.float64_t *dds2,
12511  *                                np.uint64_t *p2):
12512  */
12513 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_bounded_morton_split_relative_dds(__pyx_t_5numpy_float64_t __pyx_v_x,__pyx_t_5numpy_float64_t __pyx_v_y,__pyx_t_5numpy_float64_t __pyx_v_z,__pyx_t_5numpy_float64_t * __pyx_v_DLE,__pyx_t_5numpy_float64_t * __pyx_v_dds1,__pyx_t_5numpy_float64_t * __pyx_v_dds2,__pyx_t_5numpy_uint64_t * __pyx_v_p2)12514 static CYTHON_INLINE __pyx_t_5numpy_uint64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_bounded_morton_split_relative_dds(__pyx_t_5numpy_float64_t __pyx_v_x, __pyx_t_5numpy_float64_t __pyx_v_y, __pyx_t_5numpy_float64_t __pyx_v_z, __pyx_t_5numpy_float64_t *__pyx_v_DLE, __pyx_t_5numpy_float64_t *__pyx_v_dds1, __pyx_t_5numpy_float64_t *__pyx_v_dds2, __pyx_t_5numpy_uint64_t *__pyx_v_p2) {
12515   __pyx_t_5numpy_float64_t __pyx_v_DLE2[3];
12516   __pyx_t_5numpy_uint64_t __pyx_v_mi2;
12517   __pyx_t_5numpy_uint64_t __pyx_r;
12518   __Pyx_RefNannyDeclarations
12519   __Pyx_RefNannySetupContext("bounded_morton_split_relative_dds", 0);
12520 
12521   /* "yt/utilities/lib/geometry_utils.pxd":331
12522  *     cdef np.float64_t DLE2[3]
12523  *     cdef np.uint64_t mi2
12524  *     DLE2[0] = DLE[0] + <np.float64_t> (<np.uint64_t> ((x - DLE[0])/dds1[0])) * dds1[0]             # <<<<<<<<<<<<<<
12525  *     DLE2[1] = DLE[1] + <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]
12526  *     DLE2[2] = DLE[2] + <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]
12527  */
12528   (__pyx_v_DLE2[0]) = ((__pyx_v_DLE[0]) + (((__pyx_t_5numpy_float64_t)((__pyx_t_5numpy_uint64_t)((__pyx_v_x - (__pyx_v_DLE[0])) / (__pyx_v_dds1[0])))) * (__pyx_v_dds1[0])));
12529 
12530   /* "yt/utilities/lib/geometry_utils.pxd":332
12531  *     cdef np.uint64_t mi2
12532  *     DLE2[0] = DLE[0] + <np.float64_t> (<np.uint64_t> ((x - DLE[0])/dds1[0])) * dds1[0]
12533  *     DLE2[1] = DLE[1] + <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]             # <<<<<<<<<<<<<<
12534  *     DLE2[2] = DLE[2] + <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]
12535  *     p2[0] = <np.uint64_t> ((x - DLE2[0])/dds2[0])
12536  */
12537   (__pyx_v_DLE2[1]) = ((__pyx_v_DLE[1]) + (((__pyx_t_5numpy_float64_t)((__pyx_t_5numpy_uint64_t)((__pyx_v_y - (__pyx_v_DLE[1])) / (__pyx_v_dds1[1])))) * (__pyx_v_dds1[1])));
12538 
12539   /* "yt/utilities/lib/geometry_utils.pxd":333
12540  *     DLE2[0] = DLE[0] + <np.float64_t> (<np.uint64_t> ((x - DLE[0])/dds1[0])) * dds1[0]
12541  *     DLE2[1] = DLE[1] + <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]
12542  *     DLE2[2] = DLE[2] + <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]             # <<<<<<<<<<<<<<
12543  *     p2[0] = <np.uint64_t> ((x - DLE2[0])/dds2[0])
12544  *     p2[1] = <np.uint64_t> ((y - DLE2[1])/dds2[1])
12545  */
12546   (__pyx_v_DLE2[2]) = ((__pyx_v_DLE[2]) + (((__pyx_t_5numpy_float64_t)((__pyx_t_5numpy_uint64_t)((__pyx_v_z - (__pyx_v_DLE[2])) / (__pyx_v_dds1[2])))) * (__pyx_v_dds1[2])));
12547 
12548   /* "yt/utilities/lib/geometry_utils.pxd":334
12549  *     DLE2[1] = DLE[1] + <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]
12550  *     DLE2[2] = DLE[2] + <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]
12551  *     p2[0] = <np.uint64_t> ((x - DLE2[0])/dds2[0])             # <<<<<<<<<<<<<<
12552  *     p2[1] = <np.uint64_t> ((y - DLE2[1])/dds2[1])
12553  *     p2[2] = <np.uint64_t> ((z - DLE2[2])/dds2[2])
12554  */
12555   (__pyx_v_p2[0]) = ((__pyx_t_5numpy_uint64_t)((__pyx_v_x - (__pyx_v_DLE2[0])) / (__pyx_v_dds2[0])));
12556 
12557   /* "yt/utilities/lib/geometry_utils.pxd":335
12558  *     DLE2[2] = DLE[2] + <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]
12559  *     p2[0] = <np.uint64_t> ((x - DLE2[0])/dds2[0])
12560  *     p2[1] = <np.uint64_t> ((y - DLE2[1])/dds2[1])             # <<<<<<<<<<<<<<
12561  *     p2[2] = <np.uint64_t> ((z - DLE2[2])/dds2[2])
12562  *     mi2 = encode_morton_64bit(p2[0], p2[1], p2[2])
12563  */
12564   (__pyx_v_p2[1]) = ((__pyx_t_5numpy_uint64_t)((__pyx_v_y - (__pyx_v_DLE2[1])) / (__pyx_v_dds2[1])));
12565 
12566   /* "yt/utilities/lib/geometry_utils.pxd":336
12567  *     p2[0] = <np.uint64_t> ((x - DLE2[0])/dds2[0])
12568  *     p2[1] = <np.uint64_t> ((y - DLE2[1])/dds2[1])
12569  *     p2[2] = <np.uint64_t> ((z - DLE2[2])/dds2[2])             # <<<<<<<<<<<<<<
12570  *     mi2 = encode_morton_64bit(p2[0], p2[1], p2[2])
12571  *     return mi2
12572  */
12573   (__pyx_v_p2[2]) = ((__pyx_t_5numpy_uint64_t)((__pyx_v_z - (__pyx_v_DLE2[2])) / (__pyx_v_dds2[2])));
12574 
12575   /* "yt/utilities/lib/geometry_utils.pxd":337
12576  *     p2[1] = <np.uint64_t> ((y - DLE2[1])/dds2[1])
12577  *     p2[2] = <np.uint64_t> ((z - DLE2[2])/dds2[2])
12578  *     mi2 = encode_morton_64bit(p2[0], p2[1], p2[2])             # <<<<<<<<<<<<<<
12579  *     return mi2
12580  *
12581  */
12582   __pyx_v_mi2 = __pyx_f_2yt_9utilities_3lib_14geometry_utils_encode_morton_64bit((__pyx_v_p2[0]), (__pyx_v_p2[1]), (__pyx_v_p2[2]));
12583 
12584   /* "yt/utilities/lib/geometry_utils.pxd":338
12585  *     p2[2] = <np.uint64_t> ((z - DLE2[2])/dds2[2])
12586  *     mi2 = encode_morton_64bit(p2[0], p2[1], p2[2])
12587  *     return mi2             # <<<<<<<<<<<<<<
12588  *
12589  *
12590  */
12591   __pyx_r = __pyx_v_mi2;
12592   goto __pyx_L0;
12593 
12594   /* "yt/utilities/lib/geometry_utils.pxd":326
12595  *
12596  * @cython.cdivision(True)
12597  * cdef inline np.uint64_t bounded_morton_split_relative_dds(np.float64_t x, np.float64_t y, np.float64_t z,             # <<<<<<<<<<<<<<
12598  *                                np.float64_t *DLE, np.float64_t *dds1, np.float64_t *dds2,
12599  *                                np.uint64_t *p2):
12600  */
12601 
12602   /* function exit code */
12603   __pyx_L0:;
12604   __Pyx_RefNannyFinishContext();
12605   return __pyx_r;
12606 }
12607 
12608 /* "selection_routines.pxd":81
12609  *     cdef public SelectorObject sel2
12610  *
12611  * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2,             # <<<<<<<<<<<<<<
12612  *                                         np.float64_t dw, bint periodic) nogil:
12613  *     cdef np.float64_t rel = x1 - x2
12614  */
12615 
__pyx_f_2yt_8geometry_18selection_routines__periodic_dist(__pyx_t_5numpy_float64_t __pyx_v_x1,__pyx_t_5numpy_float64_t __pyx_v_x2,__pyx_t_5numpy_float64_t __pyx_v_dw,int __pyx_v_periodic)12616 static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_8geometry_18selection_routines__periodic_dist(__pyx_t_5numpy_float64_t __pyx_v_x1, __pyx_t_5numpy_float64_t __pyx_v_x2, __pyx_t_5numpy_float64_t __pyx_v_dw, int __pyx_v_periodic) {
12617   __pyx_t_5numpy_float64_t __pyx_v_rel;
12618   __pyx_t_5numpy_float64_t __pyx_r;
12619   int __pyx_t_1;
12620 
12621   /* "selection_routines.pxd":83
12622  * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2,
12623  *                                         np.float64_t dw, bint periodic) nogil:
12624  *     cdef np.float64_t rel = x1 - x2             # <<<<<<<<<<<<<<
12625  *     if not periodic: return rel
12626  *     if rel > dw * 0.5:
12627  */
12628   __pyx_v_rel = (__pyx_v_x1 - __pyx_v_x2);
12629 
12630   /* "selection_routines.pxd":84
12631  *                                         np.float64_t dw, bint periodic) nogil:
12632  *     cdef np.float64_t rel = x1 - x2
12633  *     if not periodic: return rel             # <<<<<<<<<<<<<<
12634  *     if rel > dw * 0.5:
12635  *         rel -= dw
12636  */
12637   __pyx_t_1 = ((!(__pyx_v_periodic != 0)) != 0);
12638   if (__pyx_t_1) {
12639     __pyx_r = __pyx_v_rel;
12640     goto __pyx_L0;
12641   }
12642 
12643   /* "selection_routines.pxd":85
12644  *     cdef np.float64_t rel = x1 - x2
12645  *     if not periodic: return rel
12646  *     if rel > dw * 0.5:             # <<<<<<<<<<<<<<
12647  *         rel -= dw
12648  *     elif rel < -dw * 0.5:
12649  */
12650   __pyx_t_1 = ((__pyx_v_rel > (__pyx_v_dw * 0.5)) != 0);
12651   if (__pyx_t_1) {
12652 
12653     /* "selection_routines.pxd":86
12654  *     if not periodic: return rel
12655  *     if rel > dw * 0.5:
12656  *         rel -= dw             # <<<<<<<<<<<<<<
12657  *     elif rel < -dw * 0.5:
12658  *         rel += dw
12659  */
12660     __pyx_v_rel = (__pyx_v_rel - __pyx_v_dw);
12661 
12662     /* "selection_routines.pxd":85
12663  *     cdef np.float64_t rel = x1 - x2
12664  *     if not periodic: return rel
12665  *     if rel > dw * 0.5:             # <<<<<<<<<<<<<<
12666  *         rel -= dw
12667  *     elif rel < -dw * 0.5:
12668  */
12669     goto __pyx_L4;
12670   }
12671 
12672   /* "selection_routines.pxd":87
12673  *     if rel > dw * 0.5:
12674  *         rel -= dw
12675  *     elif rel < -dw * 0.5:             # <<<<<<<<<<<<<<
12676  *         rel += dw
12677  *     return rel
12678  */
12679   __pyx_t_1 = ((__pyx_v_rel < ((-__pyx_v_dw) * 0.5)) != 0);
12680   if (__pyx_t_1) {
12681 
12682     /* "selection_routines.pxd":88
12683  *         rel -= dw
12684  *     elif rel < -dw * 0.5:
12685  *         rel += dw             # <<<<<<<<<<<<<<
12686  *     return rel
12687  */
12688     __pyx_v_rel = (__pyx_v_rel + __pyx_v_dw);
12689 
12690     /* "selection_routines.pxd":87
12691  *     if rel > dw * 0.5:
12692  *         rel -= dw
12693  *     elif rel < -dw * 0.5:             # <<<<<<<<<<<<<<
12694  *         rel += dw
12695  *     return rel
12696  */
12697   }
12698   __pyx_L4:;
12699 
12700   /* "selection_routines.pxd":89
12701  *     elif rel < -dw * 0.5:
12702  *         rel += dw
12703  *     return rel             # <<<<<<<<<<<<<<
12704  */
12705   __pyx_r = __pyx_v_rel;
12706   goto __pyx_L0;
12707 
12708   /* "selection_routines.pxd":81
12709  *     cdef public SelectorObject sel2
12710  *
12711  * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2,             # <<<<<<<<<<<<<<
12712  *                                         np.float64_t dw, bint periodic) nogil:
12713  *     cdef np.float64_t rel = x1 - x2
12714  */
12715 
12716   /* function exit code */
12717   __pyx_L0:;
12718   return __pyx_r;
12719 }
12720 
12721 /* "yt/geometry/oct_container.pxd":48
12722  *
12723  * cdef class OctObjectPool(ObjectPool):
12724  *     cdef inline OctAllocationContainer *get_cont(self, int i):             # <<<<<<<<<<<<<<
12725  *         return <OctAllocationContainer*> (&self.containers[i])
12726  *
12727  */
12728 
__pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool * __pyx_v_self,int __pyx_v_i)12729 static CYTHON_INLINE struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *__pyx_v_self, int __pyx_v_i) {
12730   struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_r;
12731   __Pyx_RefNannyDeclarations
12732   __Pyx_RefNannySetupContext("get_cont", 0);
12733 
12734   /* "yt/geometry/oct_container.pxd":49
12735  * cdef class OctObjectPool(ObjectPool):
12736  *     cdef inline OctAllocationContainer *get_cont(self, int i):
12737  *         return <OctAllocationContainer*> (&self.containers[i])             # <<<<<<<<<<<<<<
12738  *
12739  * cdef OctList *OctList_append(OctList *list, Oct *o)
12740  */
12741   __pyx_r = ((struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *)(&(__pyx_v_self->__pyx_base.containers[__pyx_v_i])));
12742   goto __pyx_L0;
12743 
12744   /* "yt/geometry/oct_container.pxd":48
12745  *
12746  * cdef class OctObjectPool(ObjectPool):
12747  *     cdef inline OctAllocationContainer *get_cont(self, int i):             # <<<<<<<<<<<<<<
12748  *         return <OctAllocationContainer*> (&self.containers[i])
12749  *
12750  */
12751 
12752   /* function exit code */
12753   __pyx_L0:;
12754   __Pyx_RefNannyFinishContext();
12755   return __pyx_r;
12756 }
12757 
12758 /* "View.MemoryView":122
12759  *         cdef bint dtype_is_object
12760  *
12761  *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,             # <<<<<<<<<<<<<<
12762  *                   mode="c", bint allocate_buffer=True):
12763  *
12764  */
12765 
12766 /* Python wrapper */
12767 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)12768 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
12769   PyObject *__pyx_v_shape = 0;
12770   Py_ssize_t __pyx_v_itemsize;
12771   PyObject *__pyx_v_format = 0;
12772   PyObject *__pyx_v_mode = 0;
12773   int __pyx_v_allocate_buffer;
12774   int __pyx_r;
12775   __Pyx_RefNannyDeclarations
12776   __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
12777   {
12778     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};
12779     PyObject* values[5] = {0,0,0,0,0};
12780     values[3] = ((PyObject *)__pyx_n_s_c);
12781     if (unlikely(__pyx_kwds)) {
12782       Py_ssize_t kw_args;
12783       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
12784       switch (pos_args) {
12785         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
12786         CYTHON_FALLTHROUGH;
12787         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
12788         CYTHON_FALLTHROUGH;
12789         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
12790         CYTHON_FALLTHROUGH;
12791         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12792         CYTHON_FALLTHROUGH;
12793         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12794         CYTHON_FALLTHROUGH;
12795         case  0: break;
12796         default: goto __pyx_L5_argtuple_error;
12797       }
12798       kw_args = PyDict_Size(__pyx_kwds);
12799       switch (pos_args) {
12800         case  0:
12801         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
12802         else goto __pyx_L5_argtuple_error;
12803         CYTHON_FALLTHROUGH;
12804         case  1:
12805         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
12806         else {
12807           __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(4, 122, __pyx_L3_error)
12808         }
12809         CYTHON_FALLTHROUGH;
12810         case  2:
12811         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
12812         else {
12813           __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(4, 122, __pyx_L3_error)
12814         }
12815         CYTHON_FALLTHROUGH;
12816         case  3:
12817         if (kw_args > 0) {
12818           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
12819           if (value) { values[3] = value; kw_args--; }
12820         }
12821         CYTHON_FALLTHROUGH;
12822         case  4:
12823         if (kw_args > 0) {
12824           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
12825           if (value) { values[4] = value; kw_args--; }
12826         }
12827       }
12828       if (unlikely(kw_args > 0)) {
12829         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(4, 122, __pyx_L3_error)
12830       }
12831     } else {
12832       switch (PyTuple_GET_SIZE(__pyx_args)) {
12833         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
12834         CYTHON_FALLTHROUGH;
12835         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
12836         CYTHON_FALLTHROUGH;
12837         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
12838         values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12839         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12840         break;
12841         default: goto __pyx_L5_argtuple_error;
12842       }
12843     }
12844     __pyx_v_shape = ((PyObject*)values[0]);
12845     __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 122, __pyx_L3_error)
12846     __pyx_v_format = values[2];
12847     __pyx_v_mode = values[3];
12848     if (values[4]) {
12849       __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 123, __pyx_L3_error)
12850     } else {
12851 
12852       /* "View.MemoryView":123
12853  *
12854  *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
12855  *                   mode="c", bint allocate_buffer=True):             # <<<<<<<<<<<<<<
12856  *
12857  *         cdef int idx
12858  */
12859       __pyx_v_allocate_buffer = ((int)1);
12860     }
12861   }
12862   goto __pyx_L4_argument_unpacking_done;
12863   __pyx_L5_argtuple_error:;
12864   __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 122, __pyx_L3_error)
12865   __pyx_L3_error:;
12866   __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12867   __Pyx_RefNannyFinishContext();
12868   return -1;
12869   __pyx_L4_argument_unpacking_done:;
12870   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(4, 122, __pyx_L1_error)
12871   if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
12872     PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(4, 122, __pyx_L1_error)
12873   }
12874   __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);
12875 
12876   /* "View.MemoryView":122
12877  *         cdef bint dtype_is_object
12878  *
12879  *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,             # <<<<<<<<<<<<<<
12880  *                   mode="c", bint allocate_buffer=True):
12881  *
12882  */
12883 
12884   /* function exit code */
12885   goto __pyx_L0;
12886   __pyx_L1_error:;
12887   __pyx_r = -1;
12888   __pyx_L0:;
12889   __Pyx_RefNannyFinishContext();
12890   return __pyx_r;
12891 }
12892 
__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)12893 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) {
12894   int __pyx_v_idx;
12895   Py_ssize_t __pyx_v_i;
12896   Py_ssize_t __pyx_v_dim;
12897   PyObject **__pyx_v_p;
12898   char __pyx_v_order;
12899   int __pyx_r;
12900   __Pyx_RefNannyDeclarations
12901   Py_ssize_t __pyx_t_1;
12902   int __pyx_t_2;
12903   PyObject *__pyx_t_3 = NULL;
12904   int __pyx_t_4;
12905   PyObject *__pyx_t_5 = NULL;
12906   PyObject *__pyx_t_6 = NULL;
12907   char *__pyx_t_7;
12908   int __pyx_t_8;
12909   Py_ssize_t __pyx_t_9;
12910   PyObject *__pyx_t_10 = NULL;
12911   Py_ssize_t __pyx_t_11;
12912   __Pyx_RefNannySetupContext("__cinit__", 0);
12913   __Pyx_INCREF(__pyx_v_format);
12914 
12915   /* "View.MemoryView":129
12916  *         cdef PyObject **p
12917  *
12918  *         self.ndim = <int> len(shape)             # <<<<<<<<<<<<<<
12919  *         self.itemsize = itemsize
12920  *
12921  */
12922   if (unlikely(__pyx_v_shape == Py_None)) {
12923     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
12924     __PYX_ERR(4, 129, __pyx_L1_error)
12925   }
12926   __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(4, 129, __pyx_L1_error)
12927   __pyx_v_self->ndim = ((int)__pyx_t_1);
12928 
12929   /* "View.MemoryView":130
12930  *
12931  *         self.ndim = <int> len(shape)
12932  *         self.itemsize = itemsize             # <<<<<<<<<<<<<<
12933  *
12934  *         if not self.ndim:
12935  */
12936   __pyx_v_self->itemsize = __pyx_v_itemsize;
12937 
12938   /* "View.MemoryView":132
12939  *         self.itemsize = itemsize
12940  *
12941  *         if not self.ndim:             # <<<<<<<<<<<<<<
12942  *             raise ValueError("Empty shape tuple for cython.array")
12943  *
12944  */
12945   __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
12946   if (unlikely(__pyx_t_2)) {
12947 
12948     /* "View.MemoryView":133
12949  *
12950  *         if not self.ndim:
12951  *             raise ValueError("Empty shape tuple for cython.array")             # <<<<<<<<<<<<<<
12952  *
12953  *         if itemsize <= 0:
12954  */
12955     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 133, __pyx_L1_error)
12956     __Pyx_GOTREF(__pyx_t_3);
12957     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
12958     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12959     __PYX_ERR(4, 133, __pyx_L1_error)
12960 
12961     /* "View.MemoryView":132
12962  *         self.itemsize = itemsize
12963  *
12964  *         if not self.ndim:             # <<<<<<<<<<<<<<
12965  *             raise ValueError("Empty shape tuple for cython.array")
12966  *
12967  */
12968   }
12969 
12970   /* "View.MemoryView":135
12971  *             raise ValueError("Empty shape tuple for cython.array")
12972  *
12973  *         if itemsize <= 0:             # <<<<<<<<<<<<<<
12974  *             raise ValueError("itemsize <= 0 for cython.array")
12975  *
12976  */
12977   __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
12978   if (unlikely(__pyx_t_2)) {
12979 
12980     /* "View.MemoryView":136
12981  *
12982  *         if itemsize <= 0:
12983  *             raise ValueError("itemsize <= 0 for cython.array")             # <<<<<<<<<<<<<<
12984  *
12985  *         if not isinstance(format, bytes):
12986  */
12987     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 136, __pyx_L1_error)
12988     __Pyx_GOTREF(__pyx_t_3);
12989     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
12990     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12991     __PYX_ERR(4, 136, __pyx_L1_error)
12992 
12993     /* "View.MemoryView":135
12994  *             raise ValueError("Empty shape tuple for cython.array")
12995  *
12996  *         if itemsize <= 0:             # <<<<<<<<<<<<<<
12997  *             raise ValueError("itemsize <= 0 for cython.array")
12998  *
12999  */
13000   }
13001 
13002   /* "View.MemoryView":138
13003  *             raise ValueError("itemsize <= 0 for cython.array")
13004  *
13005  *         if not isinstance(format, bytes):             # <<<<<<<<<<<<<<
13006  *             format = format.encode('ASCII')
13007  *         self._format = format  # keep a reference to the byte string
13008  */
13009   __pyx_t_2 = PyBytes_Check(__pyx_v_format);
13010   __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
13011   if (__pyx_t_4) {
13012 
13013     /* "View.MemoryView":139
13014  *
13015  *         if not isinstance(format, bytes):
13016  *             format = format.encode('ASCII')             # <<<<<<<<<<<<<<
13017  *         self._format = format  # keep a reference to the byte string
13018  *         self.format = self._format
13019  */
13020     __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 139, __pyx_L1_error)
13021     __Pyx_GOTREF(__pyx_t_5);
13022     __pyx_t_6 = NULL;
13023     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
13024       __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
13025       if (likely(__pyx_t_6)) {
13026         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
13027         __Pyx_INCREF(__pyx_t_6);
13028         __Pyx_INCREF(function);
13029         __Pyx_DECREF_SET(__pyx_t_5, function);
13030       }
13031     }
13032     __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);
13033     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
13034     if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 139, __pyx_L1_error)
13035     __Pyx_GOTREF(__pyx_t_3);
13036     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13037     __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
13038     __pyx_t_3 = 0;
13039 
13040     /* "View.MemoryView":138
13041  *             raise ValueError("itemsize <= 0 for cython.array")
13042  *
13043  *         if not isinstance(format, bytes):             # <<<<<<<<<<<<<<
13044  *             format = format.encode('ASCII')
13045  *         self._format = format  # keep a reference to the byte string
13046  */
13047   }
13048 
13049   /* "View.MemoryView":140
13050  *         if not isinstance(format, bytes):
13051  *             format = format.encode('ASCII')
13052  *         self._format = format  # keep a reference to the byte string             # <<<<<<<<<<<<<<
13053  *         self.format = self._format
13054  *
13055  */
13056   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(4, 140, __pyx_L1_error)
13057   __pyx_t_3 = __pyx_v_format;
13058   __Pyx_INCREF(__pyx_t_3);
13059   __Pyx_GIVEREF(__pyx_t_3);
13060   __Pyx_GOTREF(__pyx_v_self->_format);
13061   __Pyx_DECREF(__pyx_v_self->_format);
13062   __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
13063   __pyx_t_3 = 0;
13064 
13065   /* "View.MemoryView":141
13066  *             format = format.encode('ASCII')
13067  *         self._format = format  # keep a reference to the byte string
13068  *         self.format = self._format             # <<<<<<<<<<<<<<
13069  *
13070  *
13071  */
13072   if (unlikely(__pyx_v_self->_format == Py_None)) {
13073     PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
13074     __PYX_ERR(4, 141, __pyx_L1_error)
13075   }
13076   __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(4, 141, __pyx_L1_error)
13077   __pyx_v_self->format = __pyx_t_7;
13078 
13079   /* "View.MemoryView":144
13080  *
13081  *
13082  *         self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)             # <<<<<<<<<<<<<<
13083  *         self._strides = self._shape + self.ndim
13084  *
13085  */
13086   __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
13087 
13088   /* "View.MemoryView":145
13089  *
13090  *         self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
13091  *         self._strides = self._shape + self.ndim             # <<<<<<<<<<<<<<
13092  *
13093  *         if not self._shape:
13094  */
13095   __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
13096 
13097   /* "View.MemoryView":147
13098  *         self._strides = self._shape + self.ndim
13099  *
13100  *         if not self._shape:             # <<<<<<<<<<<<<<
13101  *             raise MemoryError("unable to allocate shape and strides.")
13102  *
13103  */
13104   __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
13105   if (unlikely(__pyx_t_4)) {
13106 
13107     /* "View.MemoryView":148
13108  *
13109  *         if not self._shape:
13110  *             raise MemoryError("unable to allocate shape and strides.")             # <<<<<<<<<<<<<<
13111  *
13112  *
13113  */
13114     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 148, __pyx_L1_error)
13115     __Pyx_GOTREF(__pyx_t_3);
13116     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
13117     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13118     __PYX_ERR(4, 148, __pyx_L1_error)
13119 
13120     /* "View.MemoryView":147
13121  *         self._strides = self._shape + self.ndim
13122  *
13123  *         if not self._shape:             # <<<<<<<<<<<<<<
13124  *             raise MemoryError("unable to allocate shape and strides.")
13125  *
13126  */
13127   }
13128 
13129   /* "View.MemoryView":151
13130  *
13131  *
13132  *         for idx, dim in enumerate(shape):             # <<<<<<<<<<<<<<
13133  *             if dim <= 0:
13134  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
13135  */
13136   __pyx_t_8 = 0;
13137   __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
13138   for (;;) {
13139     if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
13140     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13141     __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(4, 151, __pyx_L1_error)
13142     #else
13143     __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 151, __pyx_L1_error)
13144     __Pyx_GOTREF(__pyx_t_5);
13145     #endif
13146     __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 151, __pyx_L1_error)
13147     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13148     __pyx_v_dim = __pyx_t_9;
13149     __pyx_v_idx = __pyx_t_8;
13150     __pyx_t_8 = (__pyx_t_8 + 1);
13151 
13152     /* "View.MemoryView":152
13153  *
13154  *         for idx, dim in enumerate(shape):
13155  *             if dim <= 0:             # <<<<<<<<<<<<<<
13156  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
13157  *             self._shape[idx] = dim
13158  */
13159     __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
13160     if (unlikely(__pyx_t_4)) {
13161 
13162       /* "View.MemoryView":153
13163  *         for idx, dim in enumerate(shape):
13164  *             if dim <= 0:
13165  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))             # <<<<<<<<<<<<<<
13166  *             self._shape[idx] = dim
13167  *
13168  */
13169       __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 153, __pyx_L1_error)
13170       __Pyx_GOTREF(__pyx_t_5);
13171       __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 153, __pyx_L1_error)
13172       __Pyx_GOTREF(__pyx_t_6);
13173       __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 153, __pyx_L1_error)
13174       __Pyx_GOTREF(__pyx_t_10);
13175       __Pyx_GIVEREF(__pyx_t_5);
13176       PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
13177       __Pyx_GIVEREF(__pyx_t_6);
13178       PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
13179       __pyx_t_5 = 0;
13180       __pyx_t_6 = 0;
13181       __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(4, 153, __pyx_L1_error)
13182       __Pyx_GOTREF(__pyx_t_6);
13183       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13184       __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 153, __pyx_L1_error)
13185       __Pyx_GOTREF(__pyx_t_10);
13186       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13187       __Pyx_Raise(__pyx_t_10, 0, 0, 0);
13188       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13189       __PYX_ERR(4, 153, __pyx_L1_error)
13190 
13191       /* "View.MemoryView":152
13192  *
13193  *         for idx, dim in enumerate(shape):
13194  *             if dim <= 0:             # <<<<<<<<<<<<<<
13195  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
13196  *             self._shape[idx] = dim
13197  */
13198     }
13199 
13200     /* "View.MemoryView":154
13201  *             if dim <= 0:
13202  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
13203  *             self._shape[idx] = dim             # <<<<<<<<<<<<<<
13204  *
13205  *         cdef char order
13206  */
13207     (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
13208 
13209     /* "View.MemoryView":151
13210  *
13211  *
13212  *         for idx, dim in enumerate(shape):             # <<<<<<<<<<<<<<
13213  *             if dim <= 0:
13214  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
13215  */
13216   }
13217   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13218 
13219   /* "View.MemoryView":157
13220  *
13221  *         cdef char order
13222  *         if mode == 'fortran':             # <<<<<<<<<<<<<<
13223  *             order = b'F'
13224  *             self.mode = u'fortran'
13225  */
13226   __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(4, 157, __pyx_L1_error)
13227   if (__pyx_t_4) {
13228 
13229     /* "View.MemoryView":158
13230  *         cdef char order
13231  *         if mode == 'fortran':
13232  *             order = b'F'             # <<<<<<<<<<<<<<
13233  *             self.mode = u'fortran'
13234  *         elif mode == 'c':
13235  */
13236     __pyx_v_order = 'F';
13237 
13238     /* "View.MemoryView":159
13239  *         if mode == 'fortran':
13240  *             order = b'F'
13241  *             self.mode = u'fortran'             # <<<<<<<<<<<<<<
13242  *         elif mode == 'c':
13243  *             order = b'C'
13244  */
13245     __Pyx_INCREF(__pyx_n_u_fortran);
13246     __Pyx_GIVEREF(__pyx_n_u_fortran);
13247     __Pyx_GOTREF(__pyx_v_self->mode);
13248     __Pyx_DECREF(__pyx_v_self->mode);
13249     __pyx_v_self->mode = __pyx_n_u_fortran;
13250 
13251     /* "View.MemoryView":157
13252  *
13253  *         cdef char order
13254  *         if mode == 'fortran':             # <<<<<<<<<<<<<<
13255  *             order = b'F'
13256  *             self.mode = u'fortran'
13257  */
13258     goto __pyx_L10;
13259   }
13260 
13261   /* "View.MemoryView":160
13262  *             order = b'F'
13263  *             self.mode = u'fortran'
13264  *         elif mode == 'c':             # <<<<<<<<<<<<<<
13265  *             order = b'C'
13266  *             self.mode = u'c'
13267  */
13268   __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(4, 160, __pyx_L1_error)
13269   if (likely(__pyx_t_4)) {
13270 
13271     /* "View.MemoryView":161
13272  *             self.mode = u'fortran'
13273  *         elif mode == 'c':
13274  *             order = b'C'             # <<<<<<<<<<<<<<
13275  *             self.mode = u'c'
13276  *         else:
13277  */
13278     __pyx_v_order = 'C';
13279 
13280     /* "View.MemoryView":162
13281  *         elif mode == 'c':
13282  *             order = b'C'
13283  *             self.mode = u'c'             # <<<<<<<<<<<<<<
13284  *         else:
13285  *             raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
13286  */
13287     __Pyx_INCREF(__pyx_n_u_c);
13288     __Pyx_GIVEREF(__pyx_n_u_c);
13289     __Pyx_GOTREF(__pyx_v_self->mode);
13290     __Pyx_DECREF(__pyx_v_self->mode);
13291     __pyx_v_self->mode = __pyx_n_u_c;
13292 
13293     /* "View.MemoryView":160
13294  *             order = b'F'
13295  *             self.mode = u'fortran'
13296  *         elif mode == 'c':             # <<<<<<<<<<<<<<
13297  *             order = b'C'
13298  *             self.mode = u'c'
13299  */
13300     goto __pyx_L10;
13301   }
13302 
13303   /* "View.MemoryView":164
13304  *             self.mode = u'c'
13305  *         else:
13306  *             raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)             # <<<<<<<<<<<<<<
13307  *
13308  *         self.len = fill_contig_strides_array(self._shape, self._strides,
13309  */
13310   /*else*/ {
13311     __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(4, 164, __pyx_L1_error)
13312     __Pyx_GOTREF(__pyx_t_3);
13313     __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 164, __pyx_L1_error)
13314     __Pyx_GOTREF(__pyx_t_10);
13315     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13316     __Pyx_Raise(__pyx_t_10, 0, 0, 0);
13317     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13318     __PYX_ERR(4, 164, __pyx_L1_error)
13319   }
13320   __pyx_L10:;
13321 
13322   /* "View.MemoryView":166
13323  *             raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
13324  *
13325  *         self.len = fill_contig_strides_array(self._shape, self._strides,             # <<<<<<<<<<<<<<
13326  *                                              itemsize, self.ndim, order)
13327  *
13328  */
13329   __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);
13330 
13331   /* "View.MemoryView":169
13332  *                                              itemsize, self.ndim, order)
13333  *
13334  *         self.free_data = allocate_buffer             # <<<<<<<<<<<<<<
13335  *         self.dtype_is_object = format == b'O'
13336  *         if allocate_buffer:
13337  */
13338   __pyx_v_self->free_data = __pyx_v_allocate_buffer;
13339 
13340   /* "View.MemoryView":170
13341  *
13342  *         self.free_data = allocate_buffer
13343  *         self.dtype_is_object = format == b'O'             # <<<<<<<<<<<<<<
13344  *         if allocate_buffer:
13345  *
13346  */
13347   __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(4, 170, __pyx_L1_error)
13348   __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 170, __pyx_L1_error)
13349   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13350   __pyx_v_self->dtype_is_object = __pyx_t_4;
13351 
13352   /* "View.MemoryView":171
13353  *         self.free_data = allocate_buffer
13354  *         self.dtype_is_object = format == b'O'
13355  *         if allocate_buffer:             # <<<<<<<<<<<<<<
13356  *
13357  *
13358  */
13359   __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
13360   if (__pyx_t_4) {
13361 
13362     /* "View.MemoryView":174
13363  *
13364  *
13365  *             self.data = <char *>malloc(self.len)             # <<<<<<<<<<<<<<
13366  *             if not self.data:
13367  *                 raise MemoryError("unable to allocate array data.")
13368  */
13369     __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
13370 
13371     /* "View.MemoryView":175
13372  *
13373  *             self.data = <char *>malloc(self.len)
13374  *             if not self.data:             # <<<<<<<<<<<<<<
13375  *                 raise MemoryError("unable to allocate array data.")
13376  *
13377  */
13378     __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
13379     if (unlikely(__pyx_t_4)) {
13380 
13381       /* "View.MemoryView":176
13382  *             self.data = <char *>malloc(self.len)
13383  *             if not self.data:
13384  *                 raise MemoryError("unable to allocate array data.")             # <<<<<<<<<<<<<<
13385  *
13386  *             if self.dtype_is_object:
13387  */
13388       __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 176, __pyx_L1_error)
13389       __Pyx_GOTREF(__pyx_t_10);
13390       __Pyx_Raise(__pyx_t_10, 0, 0, 0);
13391       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13392       __PYX_ERR(4, 176, __pyx_L1_error)
13393 
13394       /* "View.MemoryView":175
13395  *
13396  *             self.data = <char *>malloc(self.len)
13397  *             if not self.data:             # <<<<<<<<<<<<<<
13398  *                 raise MemoryError("unable to allocate array data.")
13399  *
13400  */
13401     }
13402 
13403     /* "View.MemoryView":178
13404  *                 raise MemoryError("unable to allocate array data.")
13405  *
13406  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
13407  *                 p = <PyObject **> self.data
13408  *                 for i in range(self.len / itemsize):
13409  */
13410     __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
13411     if (__pyx_t_4) {
13412 
13413       /* "View.MemoryView":179
13414  *
13415  *             if self.dtype_is_object:
13416  *                 p = <PyObject **> self.data             # <<<<<<<<<<<<<<
13417  *                 for i in range(self.len / itemsize):
13418  *                     p[i] = Py_None
13419  */
13420       __pyx_v_p = ((PyObject **)__pyx_v_self->data);
13421 
13422       /* "View.MemoryView":180
13423  *             if self.dtype_is_object:
13424  *                 p = <PyObject **> self.data
13425  *                 for i in range(self.len / itemsize):             # <<<<<<<<<<<<<<
13426  *                     p[i] = Py_None
13427  *                     Py_INCREF(Py_None)
13428  */
13429       if (unlikely(__pyx_v_itemsize == 0)) {
13430         PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
13431         __PYX_ERR(4, 180, __pyx_L1_error)
13432       }
13433       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))) {
13434         PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
13435         __PYX_ERR(4, 180, __pyx_L1_error)
13436       }
13437       __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
13438       __pyx_t_9 = __pyx_t_1;
13439       for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
13440         __pyx_v_i = __pyx_t_11;
13441 
13442         /* "View.MemoryView":181
13443  *                 p = <PyObject **> self.data
13444  *                 for i in range(self.len / itemsize):
13445  *                     p[i] = Py_None             # <<<<<<<<<<<<<<
13446  *                     Py_INCREF(Py_None)
13447  *
13448  */
13449         (__pyx_v_p[__pyx_v_i]) = Py_None;
13450 
13451         /* "View.MemoryView":182
13452  *                 for i in range(self.len / itemsize):
13453  *                     p[i] = Py_None
13454  *                     Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
13455  *
13456  *     @cname('getbuffer')
13457  */
13458         Py_INCREF(Py_None);
13459       }
13460 
13461       /* "View.MemoryView":178
13462  *                 raise MemoryError("unable to allocate array data.")
13463  *
13464  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
13465  *                 p = <PyObject **> self.data
13466  *                 for i in range(self.len / itemsize):
13467  */
13468     }
13469 
13470     /* "View.MemoryView":171
13471  *         self.free_data = allocate_buffer
13472  *         self.dtype_is_object = format == b'O'
13473  *         if allocate_buffer:             # <<<<<<<<<<<<<<
13474  *
13475  *
13476  */
13477   }
13478 
13479   /* "View.MemoryView":122
13480  *         cdef bint dtype_is_object
13481  *
13482  *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,             # <<<<<<<<<<<<<<
13483  *                   mode="c", bint allocate_buffer=True):
13484  *
13485  */
13486 
13487   /* function exit code */
13488   __pyx_r = 0;
13489   goto __pyx_L0;
13490   __pyx_L1_error:;
13491   __Pyx_XDECREF(__pyx_t_3);
13492   __Pyx_XDECREF(__pyx_t_5);
13493   __Pyx_XDECREF(__pyx_t_6);
13494   __Pyx_XDECREF(__pyx_t_10);
13495   __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13496   __pyx_r = -1;
13497   __pyx_L0:;
13498   __Pyx_XDECREF(__pyx_v_format);
13499   __Pyx_RefNannyFinishContext();
13500   return __pyx_r;
13501 }
13502 
13503 /* "View.MemoryView":185
13504  *
13505  *     @cname('getbuffer')
13506  *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
13507  *         cdef int bufmode = -1
13508  *         if self.mode == u"c":
13509  */
13510 
13511 /* Python wrapper */
13512 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)13513 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
13514   int __pyx_r;
13515   __Pyx_RefNannyDeclarations
13516   __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
13517   __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));
13518 
13519   /* function exit code */
13520   __Pyx_RefNannyFinishContext();
13521   return __pyx_r;
13522 }
13523 
__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)13524 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) {
13525   int __pyx_v_bufmode;
13526   int __pyx_r;
13527   __Pyx_RefNannyDeclarations
13528   int __pyx_t_1;
13529   int __pyx_t_2;
13530   PyObject *__pyx_t_3 = NULL;
13531   char *__pyx_t_4;
13532   Py_ssize_t __pyx_t_5;
13533   int __pyx_t_6;
13534   Py_ssize_t *__pyx_t_7;
13535   if (__pyx_v_info == NULL) {
13536     PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
13537     return -1;
13538   }
13539   __Pyx_RefNannySetupContext("__getbuffer__", 0);
13540   __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
13541   __Pyx_GIVEREF(__pyx_v_info->obj);
13542 
13543   /* "View.MemoryView":186
13544  *     @cname('getbuffer')
13545  *     def __getbuffer__(self, Py_buffer *info, int flags):
13546  *         cdef int bufmode = -1             # <<<<<<<<<<<<<<
13547  *         if self.mode == u"c":
13548  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
13549  */
13550   __pyx_v_bufmode = -1;
13551 
13552   /* "View.MemoryView":187
13553  *     def __getbuffer__(self, Py_buffer *info, int flags):
13554  *         cdef int bufmode = -1
13555  *         if self.mode == u"c":             # <<<<<<<<<<<<<<
13556  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
13557  *         elif self.mode == u"fortran":
13558  */
13559   __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 187, __pyx_L1_error)
13560   __pyx_t_2 = (__pyx_t_1 != 0);
13561   if (__pyx_t_2) {
13562 
13563     /* "View.MemoryView":188
13564  *         cdef int bufmode = -1
13565  *         if self.mode == u"c":
13566  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS             # <<<<<<<<<<<<<<
13567  *         elif self.mode == u"fortran":
13568  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
13569  */
13570     __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
13571 
13572     /* "View.MemoryView":187
13573  *     def __getbuffer__(self, Py_buffer *info, int flags):
13574  *         cdef int bufmode = -1
13575  *         if self.mode == u"c":             # <<<<<<<<<<<<<<
13576  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
13577  *         elif self.mode == u"fortran":
13578  */
13579     goto __pyx_L3;
13580   }
13581 
13582   /* "View.MemoryView":189
13583  *         if self.mode == u"c":
13584  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
13585  *         elif self.mode == u"fortran":             # <<<<<<<<<<<<<<
13586  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
13587  *         if not (flags & bufmode):
13588  */
13589   __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(4, 189, __pyx_L1_error)
13590   __pyx_t_1 = (__pyx_t_2 != 0);
13591   if (__pyx_t_1) {
13592 
13593     /* "View.MemoryView":190
13594  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
13595  *         elif self.mode == u"fortran":
13596  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS             # <<<<<<<<<<<<<<
13597  *         if not (flags & bufmode):
13598  *             raise ValueError("Can only create a buffer that is contiguous in memory.")
13599  */
13600     __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
13601 
13602     /* "View.MemoryView":189
13603  *         if self.mode == u"c":
13604  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
13605  *         elif self.mode == u"fortran":             # <<<<<<<<<<<<<<
13606  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
13607  *         if not (flags & bufmode):
13608  */
13609   }
13610   __pyx_L3:;
13611 
13612   /* "View.MemoryView":191
13613  *         elif self.mode == u"fortran":
13614  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
13615  *         if not (flags & bufmode):             # <<<<<<<<<<<<<<
13616  *             raise ValueError("Can only create a buffer that is contiguous in memory.")
13617  *         info.buf = self.data
13618  */
13619   __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
13620   if (unlikely(__pyx_t_1)) {
13621 
13622     /* "View.MemoryView":192
13623  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
13624  *         if not (flags & bufmode):
13625  *             raise ValueError("Can only create a buffer that is contiguous in memory.")             # <<<<<<<<<<<<<<
13626  *         info.buf = self.data
13627  *         info.len = self.len
13628  */
13629     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 192, __pyx_L1_error)
13630     __Pyx_GOTREF(__pyx_t_3);
13631     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
13632     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13633     __PYX_ERR(4, 192, __pyx_L1_error)
13634 
13635     /* "View.MemoryView":191
13636  *         elif self.mode == u"fortran":
13637  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
13638  *         if not (flags & bufmode):             # <<<<<<<<<<<<<<
13639  *             raise ValueError("Can only create a buffer that is contiguous in memory.")
13640  *         info.buf = self.data
13641  */
13642   }
13643 
13644   /* "View.MemoryView":193
13645  *         if not (flags & bufmode):
13646  *             raise ValueError("Can only create a buffer that is contiguous in memory.")
13647  *         info.buf = self.data             # <<<<<<<<<<<<<<
13648  *         info.len = self.len
13649  *         info.ndim = self.ndim
13650  */
13651   __pyx_t_4 = __pyx_v_self->data;
13652   __pyx_v_info->buf = __pyx_t_4;
13653 
13654   /* "View.MemoryView":194
13655  *             raise ValueError("Can only create a buffer that is contiguous in memory.")
13656  *         info.buf = self.data
13657  *         info.len = self.len             # <<<<<<<<<<<<<<
13658  *         info.ndim = self.ndim
13659  *         info.shape = self._shape
13660  */
13661   __pyx_t_5 = __pyx_v_self->len;
13662   __pyx_v_info->len = __pyx_t_5;
13663 
13664   /* "View.MemoryView":195
13665  *         info.buf = self.data
13666  *         info.len = self.len
13667  *         info.ndim = self.ndim             # <<<<<<<<<<<<<<
13668  *         info.shape = self._shape
13669  *         info.strides = self._strides
13670  */
13671   __pyx_t_6 = __pyx_v_self->ndim;
13672   __pyx_v_info->ndim = __pyx_t_6;
13673 
13674   /* "View.MemoryView":196
13675  *         info.len = self.len
13676  *         info.ndim = self.ndim
13677  *         info.shape = self._shape             # <<<<<<<<<<<<<<
13678  *         info.strides = self._strides
13679  *         info.suboffsets = NULL
13680  */
13681   __pyx_t_7 = __pyx_v_self->_shape;
13682   __pyx_v_info->shape = __pyx_t_7;
13683 
13684   /* "View.MemoryView":197
13685  *         info.ndim = self.ndim
13686  *         info.shape = self._shape
13687  *         info.strides = self._strides             # <<<<<<<<<<<<<<
13688  *         info.suboffsets = NULL
13689  *         info.itemsize = self.itemsize
13690  */
13691   __pyx_t_7 = __pyx_v_self->_strides;
13692   __pyx_v_info->strides = __pyx_t_7;
13693 
13694   /* "View.MemoryView":198
13695  *         info.shape = self._shape
13696  *         info.strides = self._strides
13697  *         info.suboffsets = NULL             # <<<<<<<<<<<<<<
13698  *         info.itemsize = self.itemsize
13699  *         info.readonly = 0
13700  */
13701   __pyx_v_info->suboffsets = NULL;
13702 
13703   /* "View.MemoryView":199
13704  *         info.strides = self._strides
13705  *         info.suboffsets = NULL
13706  *         info.itemsize = self.itemsize             # <<<<<<<<<<<<<<
13707  *         info.readonly = 0
13708  *
13709  */
13710   __pyx_t_5 = __pyx_v_self->itemsize;
13711   __pyx_v_info->itemsize = __pyx_t_5;
13712 
13713   /* "View.MemoryView":200
13714  *         info.suboffsets = NULL
13715  *         info.itemsize = self.itemsize
13716  *         info.readonly = 0             # <<<<<<<<<<<<<<
13717  *
13718  *         if flags & PyBUF_FORMAT:
13719  */
13720   __pyx_v_info->readonly = 0;
13721 
13722   /* "View.MemoryView":202
13723  *         info.readonly = 0
13724  *
13725  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
13726  *             info.format = self.format
13727  *         else:
13728  */
13729   __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
13730   if (__pyx_t_1) {
13731 
13732     /* "View.MemoryView":203
13733  *
13734  *         if flags & PyBUF_FORMAT:
13735  *             info.format = self.format             # <<<<<<<<<<<<<<
13736  *         else:
13737  *             info.format = NULL
13738  */
13739     __pyx_t_4 = __pyx_v_self->format;
13740     __pyx_v_info->format = __pyx_t_4;
13741 
13742     /* "View.MemoryView":202
13743  *         info.readonly = 0
13744  *
13745  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
13746  *             info.format = self.format
13747  *         else:
13748  */
13749     goto __pyx_L5;
13750   }
13751 
13752   /* "View.MemoryView":205
13753  *             info.format = self.format
13754  *         else:
13755  *             info.format = NULL             # <<<<<<<<<<<<<<
13756  *
13757  *         info.obj = self
13758  */
13759   /*else*/ {
13760     __pyx_v_info->format = NULL;
13761   }
13762   __pyx_L5:;
13763 
13764   /* "View.MemoryView":207
13765  *             info.format = NULL
13766  *
13767  *         info.obj = self             # <<<<<<<<<<<<<<
13768  *
13769  *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
13770  */
13771   __Pyx_INCREF(((PyObject *)__pyx_v_self));
13772   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
13773   __Pyx_GOTREF(__pyx_v_info->obj);
13774   __Pyx_DECREF(__pyx_v_info->obj);
13775   __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
13776 
13777   /* "View.MemoryView":185
13778  *
13779  *     @cname('getbuffer')
13780  *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
13781  *         cdef int bufmode = -1
13782  *         if self.mode == u"c":
13783  */
13784 
13785   /* function exit code */
13786   __pyx_r = 0;
13787   goto __pyx_L0;
13788   __pyx_L1_error:;
13789   __Pyx_XDECREF(__pyx_t_3);
13790   __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13791   __pyx_r = -1;
13792   if (__pyx_v_info->obj != NULL) {
13793     __Pyx_GOTREF(__pyx_v_info->obj);
13794     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
13795   }
13796   goto __pyx_L2;
13797   __pyx_L0:;
13798   if (__pyx_v_info->obj == Py_None) {
13799     __Pyx_GOTREF(__pyx_v_info->obj);
13800     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
13801   }
13802   __pyx_L2:;
13803   __Pyx_RefNannyFinishContext();
13804   return __pyx_r;
13805 }
13806 
13807 /* "View.MemoryView":211
13808  *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
13809  *
13810  *     def __dealloc__(array self):             # <<<<<<<<<<<<<<
13811  *         if self.callback_free_data != NULL:
13812  *             self.callback_free_data(self.data)
13813  */
13814 
13815 /* Python wrapper */
13816 static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
__pyx_array___dealloc__(PyObject * __pyx_v_self)13817 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
13818   __Pyx_RefNannyDeclarations
13819   __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
13820   __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
13821 
13822   /* function exit code */
13823   __Pyx_RefNannyFinishContext();
13824 }
13825 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj * __pyx_v_self)13826 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
13827   __Pyx_RefNannyDeclarations
13828   int __pyx_t_1;
13829   __Pyx_RefNannySetupContext("__dealloc__", 0);
13830 
13831   /* "View.MemoryView":212
13832  *
13833  *     def __dealloc__(array self):
13834  *         if self.callback_free_data != NULL:             # <<<<<<<<<<<<<<
13835  *             self.callback_free_data(self.data)
13836  *         elif self.free_data:
13837  */
13838   __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
13839   if (__pyx_t_1) {
13840 
13841     /* "View.MemoryView":213
13842  *     def __dealloc__(array self):
13843  *         if self.callback_free_data != NULL:
13844  *             self.callback_free_data(self.data)             # <<<<<<<<<<<<<<
13845  *         elif self.free_data:
13846  *             if self.dtype_is_object:
13847  */
13848     __pyx_v_self->callback_free_data(__pyx_v_self->data);
13849 
13850     /* "View.MemoryView":212
13851  *
13852  *     def __dealloc__(array self):
13853  *         if self.callback_free_data != NULL:             # <<<<<<<<<<<<<<
13854  *             self.callback_free_data(self.data)
13855  *         elif self.free_data:
13856  */
13857     goto __pyx_L3;
13858   }
13859 
13860   /* "View.MemoryView":214
13861  *         if self.callback_free_data != NULL:
13862  *             self.callback_free_data(self.data)
13863  *         elif self.free_data:             # <<<<<<<<<<<<<<
13864  *             if self.dtype_is_object:
13865  *                 refcount_objects_in_slice(self.data, self._shape,
13866  */
13867   __pyx_t_1 = (__pyx_v_self->free_data != 0);
13868   if (__pyx_t_1) {
13869 
13870     /* "View.MemoryView":215
13871  *             self.callback_free_data(self.data)
13872  *         elif self.free_data:
13873  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
13874  *                 refcount_objects_in_slice(self.data, self._shape,
13875  *                                           self._strides, self.ndim, False)
13876  */
13877     __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
13878     if (__pyx_t_1) {
13879 
13880       /* "View.MemoryView":216
13881  *         elif self.free_data:
13882  *             if self.dtype_is_object:
13883  *                 refcount_objects_in_slice(self.data, self._shape,             # <<<<<<<<<<<<<<
13884  *                                           self._strides, self.ndim, False)
13885  *             free(self.data)
13886  */
13887       __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
13888 
13889       /* "View.MemoryView":215
13890  *             self.callback_free_data(self.data)
13891  *         elif self.free_data:
13892  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
13893  *                 refcount_objects_in_slice(self.data, self._shape,
13894  *                                           self._strides, self.ndim, False)
13895  */
13896     }
13897 
13898     /* "View.MemoryView":218
13899  *                 refcount_objects_in_slice(self.data, self._shape,
13900  *                                           self._strides, self.ndim, False)
13901  *             free(self.data)             # <<<<<<<<<<<<<<
13902  *         PyObject_Free(self._shape)
13903  *
13904  */
13905     free(__pyx_v_self->data);
13906 
13907     /* "View.MemoryView":214
13908  *         if self.callback_free_data != NULL:
13909  *             self.callback_free_data(self.data)
13910  *         elif self.free_data:             # <<<<<<<<<<<<<<
13911  *             if self.dtype_is_object:
13912  *                 refcount_objects_in_slice(self.data, self._shape,
13913  */
13914   }
13915   __pyx_L3:;
13916 
13917   /* "View.MemoryView":219
13918  *                                           self._strides, self.ndim, False)
13919  *             free(self.data)
13920  *         PyObject_Free(self._shape)             # <<<<<<<<<<<<<<
13921  *
13922  *     @property
13923  */
13924   PyObject_Free(__pyx_v_self->_shape);
13925 
13926   /* "View.MemoryView":211
13927  *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
13928  *
13929  *     def __dealloc__(array self):             # <<<<<<<<<<<<<<
13930  *         if self.callback_free_data != NULL:
13931  *             self.callback_free_data(self.data)
13932  */
13933 
13934   /* function exit code */
13935   __Pyx_RefNannyFinishContext();
13936 }
13937 
13938 /* "View.MemoryView":222
13939  *
13940  *     @property
13941  *     def memview(self):             # <<<<<<<<<<<<<<
13942  *         return self.get_memview()
13943  *
13944  */
13945 
13946 /* Python wrapper */
13947 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)13948 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
13949   PyObject *__pyx_r = 0;
13950   __Pyx_RefNannyDeclarations
13951   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13952   __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
13953 
13954   /* function exit code */
13955   __Pyx_RefNannyFinishContext();
13956   return __pyx_r;
13957 }
13958 
__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj * __pyx_v_self)13959 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
13960   PyObject *__pyx_r = NULL;
13961   __Pyx_RefNannyDeclarations
13962   PyObject *__pyx_t_1 = NULL;
13963   __Pyx_RefNannySetupContext("__get__", 0);
13964 
13965   /* "View.MemoryView":223
13966  *     @property
13967  *     def memview(self):
13968  *         return self.get_memview()             # <<<<<<<<<<<<<<
13969  *
13970  *     @cname('get_memview')
13971  */
13972   __Pyx_XDECREF(__pyx_r);
13973   __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 223, __pyx_L1_error)
13974   __Pyx_GOTREF(__pyx_t_1);
13975   __pyx_r = __pyx_t_1;
13976   __pyx_t_1 = 0;
13977   goto __pyx_L0;
13978 
13979   /* "View.MemoryView":222
13980  *
13981  *     @property
13982  *     def memview(self):             # <<<<<<<<<<<<<<
13983  *         return self.get_memview()
13984  *
13985  */
13986 
13987   /* function exit code */
13988   __pyx_L1_error:;
13989   __Pyx_XDECREF(__pyx_t_1);
13990   __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13991   __pyx_r = NULL;
13992   __pyx_L0:;
13993   __Pyx_XGIVEREF(__pyx_r);
13994   __Pyx_RefNannyFinishContext();
13995   return __pyx_r;
13996 }
13997 
13998 /* "View.MemoryView":226
13999  *
14000  *     @cname('get_memview')
14001  *     cdef get_memview(self):             # <<<<<<<<<<<<<<
14002  *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
14003  *         return  memoryview(self, flags, self.dtype_is_object)
14004  */
14005 
__pyx_array_get_memview(struct __pyx_array_obj * __pyx_v_self)14006 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
14007   int __pyx_v_flags;
14008   PyObject *__pyx_r = NULL;
14009   __Pyx_RefNannyDeclarations
14010   PyObject *__pyx_t_1 = NULL;
14011   PyObject *__pyx_t_2 = NULL;
14012   PyObject *__pyx_t_3 = NULL;
14013   __Pyx_RefNannySetupContext("get_memview", 0);
14014 
14015   /* "View.MemoryView":227
14016  *     @cname('get_memview')
14017  *     cdef get_memview(self):
14018  *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE             # <<<<<<<<<<<<<<
14019  *         return  memoryview(self, flags, self.dtype_is_object)
14020  *
14021  */
14022   __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
14023 
14024   /* "View.MemoryView":228
14025  *     cdef get_memview(self):
14026  *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
14027  *         return  memoryview(self, flags, self.dtype_is_object)             # <<<<<<<<<<<<<<
14028  *
14029  *     def __len__(self):
14030  */
14031   __Pyx_XDECREF(__pyx_r);
14032   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 228, __pyx_L1_error)
14033   __Pyx_GOTREF(__pyx_t_1);
14034   __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 228, __pyx_L1_error)
14035   __Pyx_GOTREF(__pyx_t_2);
14036   __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 228, __pyx_L1_error)
14037   __Pyx_GOTREF(__pyx_t_3);
14038   __Pyx_INCREF(((PyObject *)__pyx_v_self));
14039   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
14040   PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
14041   __Pyx_GIVEREF(__pyx_t_1);
14042   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
14043   __Pyx_GIVEREF(__pyx_t_2);
14044   PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
14045   __pyx_t_1 = 0;
14046   __pyx_t_2 = 0;
14047   __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 228, __pyx_L1_error)
14048   __Pyx_GOTREF(__pyx_t_2);
14049   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14050   __pyx_r = __pyx_t_2;
14051   __pyx_t_2 = 0;
14052   goto __pyx_L0;
14053 
14054   /* "View.MemoryView":226
14055  *
14056  *     @cname('get_memview')
14057  *     cdef get_memview(self):             # <<<<<<<<<<<<<<
14058  *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
14059  *         return  memoryview(self, flags, self.dtype_is_object)
14060  */
14061 
14062   /* function exit code */
14063   __pyx_L1_error:;
14064   __Pyx_XDECREF(__pyx_t_1);
14065   __Pyx_XDECREF(__pyx_t_2);
14066   __Pyx_XDECREF(__pyx_t_3);
14067   __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
14068   __pyx_r = 0;
14069   __pyx_L0:;
14070   __Pyx_XGIVEREF(__pyx_r);
14071   __Pyx_RefNannyFinishContext();
14072   return __pyx_r;
14073 }
14074 
14075 /* "View.MemoryView":230
14076  *         return  memoryview(self, flags, self.dtype_is_object)
14077  *
14078  *     def __len__(self):             # <<<<<<<<<<<<<<
14079  *         return self._shape[0]
14080  *
14081  */
14082 
14083 /* Python wrapper */
14084 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
__pyx_array___len__(PyObject * __pyx_v_self)14085 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
14086   Py_ssize_t __pyx_r;
14087   __Pyx_RefNannyDeclarations
14088   __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
14089   __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
14090 
14091   /* function exit code */
14092   __Pyx_RefNannyFinishContext();
14093   return __pyx_r;
14094 }
14095 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj * __pyx_v_self)14096 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
14097   Py_ssize_t __pyx_r;
14098   __Pyx_RefNannyDeclarations
14099   __Pyx_RefNannySetupContext("__len__", 0);
14100 
14101   /* "View.MemoryView":231
14102  *
14103  *     def __len__(self):
14104  *         return self._shape[0]             # <<<<<<<<<<<<<<
14105  *
14106  *     def __getattr__(self, attr):
14107  */
14108   __pyx_r = (__pyx_v_self->_shape[0]);
14109   goto __pyx_L0;
14110 
14111   /* "View.MemoryView":230
14112  *         return  memoryview(self, flags, self.dtype_is_object)
14113  *
14114  *     def __len__(self):             # <<<<<<<<<<<<<<
14115  *         return self._shape[0]
14116  *
14117  */
14118 
14119   /* function exit code */
14120   __pyx_L0:;
14121   __Pyx_RefNannyFinishContext();
14122   return __pyx_r;
14123 }
14124 
14125 /* "View.MemoryView":233
14126  *         return self._shape[0]
14127  *
14128  *     def __getattr__(self, attr):             # <<<<<<<<<<<<<<
14129  *         return getattr(self.memview, attr)
14130  *
14131  */
14132 
14133 /* Python wrapper */
14134 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)14135 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
14136   PyObject *__pyx_r = 0;
14137   __Pyx_RefNannyDeclarations
14138   __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
14139   __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
14140 
14141   /* function exit code */
14142   __Pyx_RefNannyFinishContext();
14143   return __pyx_r;
14144 }
14145 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj * __pyx_v_self,PyObject * __pyx_v_attr)14146 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
14147   PyObject *__pyx_r = NULL;
14148   __Pyx_RefNannyDeclarations
14149   PyObject *__pyx_t_1 = NULL;
14150   PyObject *__pyx_t_2 = NULL;
14151   __Pyx_RefNannySetupContext("__getattr__", 0);
14152 
14153   /* "View.MemoryView":234
14154  *
14155  *     def __getattr__(self, attr):
14156  *         return getattr(self.memview, attr)             # <<<<<<<<<<<<<<
14157  *
14158  *     def __getitem__(self, item):
14159  */
14160   __Pyx_XDECREF(__pyx_r);
14161   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 234, __pyx_L1_error)
14162   __Pyx_GOTREF(__pyx_t_1);
14163   __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 234, __pyx_L1_error)
14164   __Pyx_GOTREF(__pyx_t_2);
14165   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14166   __pyx_r = __pyx_t_2;
14167   __pyx_t_2 = 0;
14168   goto __pyx_L0;
14169 
14170   /* "View.MemoryView":233
14171  *         return self._shape[0]
14172  *
14173  *     def __getattr__(self, attr):             # <<<<<<<<<<<<<<
14174  *         return getattr(self.memview, attr)
14175  *
14176  */
14177 
14178   /* function exit code */
14179   __pyx_L1_error:;
14180   __Pyx_XDECREF(__pyx_t_1);
14181   __Pyx_XDECREF(__pyx_t_2);
14182   __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14183   __pyx_r = NULL;
14184   __pyx_L0:;
14185   __Pyx_XGIVEREF(__pyx_r);
14186   __Pyx_RefNannyFinishContext();
14187   return __pyx_r;
14188 }
14189 
14190 /* "View.MemoryView":236
14191  *         return getattr(self.memview, attr)
14192  *
14193  *     def __getitem__(self, item):             # <<<<<<<<<<<<<<
14194  *         return self.memview[item]
14195  *
14196  */
14197 
14198 /* Python wrapper */
14199 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)14200 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
14201   PyObject *__pyx_r = 0;
14202   __Pyx_RefNannyDeclarations
14203   __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
14204   __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
14205 
14206   /* function exit code */
14207   __Pyx_RefNannyFinishContext();
14208   return __pyx_r;
14209 }
14210 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj * __pyx_v_self,PyObject * __pyx_v_item)14211 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
14212   PyObject *__pyx_r = NULL;
14213   __Pyx_RefNannyDeclarations
14214   PyObject *__pyx_t_1 = NULL;
14215   PyObject *__pyx_t_2 = NULL;
14216   __Pyx_RefNannySetupContext("__getitem__", 0);
14217 
14218   /* "View.MemoryView":237
14219  *
14220  *     def __getitem__(self, item):
14221  *         return self.memview[item]             # <<<<<<<<<<<<<<
14222  *
14223  *     def __setitem__(self, item, value):
14224  */
14225   __Pyx_XDECREF(__pyx_r);
14226   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 237, __pyx_L1_error)
14227   __Pyx_GOTREF(__pyx_t_1);
14228   __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 237, __pyx_L1_error)
14229   __Pyx_GOTREF(__pyx_t_2);
14230   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14231   __pyx_r = __pyx_t_2;
14232   __pyx_t_2 = 0;
14233   goto __pyx_L0;
14234 
14235   /* "View.MemoryView":236
14236  *         return getattr(self.memview, attr)
14237  *
14238  *     def __getitem__(self, item):             # <<<<<<<<<<<<<<
14239  *         return self.memview[item]
14240  *
14241  */
14242 
14243   /* function exit code */
14244   __pyx_L1_error:;
14245   __Pyx_XDECREF(__pyx_t_1);
14246   __Pyx_XDECREF(__pyx_t_2);
14247   __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14248   __pyx_r = NULL;
14249   __pyx_L0:;
14250   __Pyx_XGIVEREF(__pyx_r);
14251   __Pyx_RefNannyFinishContext();
14252   return __pyx_r;
14253 }
14254 
14255 /* "View.MemoryView":239
14256  *         return self.memview[item]
14257  *
14258  *     def __setitem__(self, item, value):             # <<<<<<<<<<<<<<
14259  *         self.memview[item] = value
14260  *
14261  */
14262 
14263 /* Python wrapper */
14264 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)14265 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
14266   int __pyx_r;
14267   __Pyx_RefNannyDeclarations
14268   __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
14269   __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));
14270 
14271   /* function exit code */
14272   __Pyx_RefNannyFinishContext();
14273   return __pyx_r;
14274 }
14275 
__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)14276 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) {
14277   int __pyx_r;
14278   __Pyx_RefNannyDeclarations
14279   PyObject *__pyx_t_1 = NULL;
14280   __Pyx_RefNannySetupContext("__setitem__", 0);
14281 
14282   /* "View.MemoryView":240
14283  *
14284  *     def __setitem__(self, item, value):
14285  *         self.memview[item] = value             # <<<<<<<<<<<<<<
14286  *
14287  *
14288  */
14289   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 240, __pyx_L1_error)
14290   __Pyx_GOTREF(__pyx_t_1);
14291   if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(4, 240, __pyx_L1_error)
14292   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14293 
14294   /* "View.MemoryView":239
14295  *         return self.memview[item]
14296  *
14297  *     def __setitem__(self, item, value):             # <<<<<<<<<<<<<<
14298  *         self.memview[item] = value
14299  *
14300  */
14301 
14302   /* function exit code */
14303   __pyx_r = 0;
14304   goto __pyx_L0;
14305   __pyx_L1_error:;
14306   __Pyx_XDECREF(__pyx_t_1);
14307   __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14308   __pyx_r = -1;
14309   __pyx_L0:;
14310   __Pyx_RefNannyFinishContext();
14311   return __pyx_r;
14312 }
14313 
14314 /* "(tree fragment)":1
14315  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
14316  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14317  * def __setstate_cython__(self, __pyx_state):
14318  */
14319 
14320 /* Python wrapper */
14321 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)14322 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14323   PyObject *__pyx_r = 0;
14324   __Pyx_RefNannyDeclarations
14325   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
14326   __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
14327 
14328   /* function exit code */
14329   __Pyx_RefNannyFinishContext();
14330   return __pyx_r;
14331 }
14332 
__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj * __pyx_v_self)14333 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
14334   PyObject *__pyx_r = NULL;
14335   __Pyx_RefNannyDeclarations
14336   PyObject *__pyx_t_1 = NULL;
14337   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
14338 
14339   /* "(tree fragment)":2
14340  * def __reduce_cython__(self):
14341  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
14342  * def __setstate_cython__(self, __pyx_state):
14343  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14344  */
14345   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2, __pyx_L1_error)
14346   __Pyx_GOTREF(__pyx_t_1);
14347   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14348   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14349   __PYX_ERR(4, 2, __pyx_L1_error)
14350 
14351   /* "(tree fragment)":1
14352  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
14353  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14354  * def __setstate_cython__(self, __pyx_state):
14355  */
14356 
14357   /* function exit code */
14358   __pyx_L1_error:;
14359   __Pyx_XDECREF(__pyx_t_1);
14360   __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14361   __pyx_r = NULL;
14362   __Pyx_XGIVEREF(__pyx_r);
14363   __Pyx_RefNannyFinishContext();
14364   return __pyx_r;
14365 }
14366 
14367 /* "(tree fragment)":3
14368  * def __reduce_cython__(self):
14369  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14370  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
14371  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14372  */
14373 
14374 /* Python wrapper */
14375 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)14376 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
14377   PyObject *__pyx_r = 0;
14378   __Pyx_RefNannyDeclarations
14379   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
14380   __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
14381 
14382   /* function exit code */
14383   __Pyx_RefNannyFinishContext();
14384   return __pyx_r;
14385 }
14386 
__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)14387 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) {
14388   PyObject *__pyx_r = NULL;
14389   __Pyx_RefNannyDeclarations
14390   PyObject *__pyx_t_1 = NULL;
14391   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
14392 
14393   /* "(tree fragment)":4
14394  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14395  * def __setstate_cython__(self, __pyx_state):
14396  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
14397  */
14398   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 4, __pyx_L1_error)
14399   __Pyx_GOTREF(__pyx_t_1);
14400   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14401   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14402   __PYX_ERR(4, 4, __pyx_L1_error)
14403 
14404   /* "(tree fragment)":3
14405  * def __reduce_cython__(self):
14406  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14407  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
14408  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14409  */
14410 
14411   /* function exit code */
14412   __pyx_L1_error:;
14413   __Pyx_XDECREF(__pyx_t_1);
14414   __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14415   __pyx_r = NULL;
14416   __Pyx_XGIVEREF(__pyx_r);
14417   __Pyx_RefNannyFinishContext();
14418   return __pyx_r;
14419 }
14420 
14421 /* "View.MemoryView":244
14422  *
14423  * @cname("__pyx_array_new")
14424  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format,             # <<<<<<<<<<<<<<
14425  *                           char *mode, char *buf):
14426  *     cdef array result
14427  */
14428 
__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)14429 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) {
14430   struct __pyx_array_obj *__pyx_v_result = 0;
14431   struct __pyx_array_obj *__pyx_r = NULL;
14432   __Pyx_RefNannyDeclarations
14433   int __pyx_t_1;
14434   PyObject *__pyx_t_2 = NULL;
14435   PyObject *__pyx_t_3 = NULL;
14436   PyObject *__pyx_t_4 = NULL;
14437   PyObject *__pyx_t_5 = NULL;
14438   __Pyx_RefNannySetupContext("array_cwrapper", 0);
14439 
14440   /* "View.MemoryView":248
14441  *     cdef array result
14442  *
14443  *     if buf == NULL:             # <<<<<<<<<<<<<<
14444  *         result = array(shape, itemsize, format, mode.decode('ASCII'))
14445  *     else:
14446  */
14447   __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
14448   if (__pyx_t_1) {
14449 
14450     /* "View.MemoryView":249
14451  *
14452  *     if buf == NULL:
14453  *         result = array(shape, itemsize, format, mode.decode('ASCII'))             # <<<<<<<<<<<<<<
14454  *     else:
14455  *         result = array(shape, itemsize, format, mode.decode('ASCII'),
14456  */
14457     __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 249, __pyx_L1_error)
14458     __Pyx_GOTREF(__pyx_t_2);
14459     __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 249, __pyx_L1_error)
14460     __Pyx_GOTREF(__pyx_t_3);
14461     __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(4, 249, __pyx_L1_error)
14462     __Pyx_GOTREF(__pyx_t_4);
14463     __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 249, __pyx_L1_error)
14464     __Pyx_GOTREF(__pyx_t_5);
14465     __Pyx_INCREF(__pyx_v_shape);
14466     __Pyx_GIVEREF(__pyx_v_shape);
14467     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
14468     __Pyx_GIVEREF(__pyx_t_2);
14469     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
14470     __Pyx_GIVEREF(__pyx_t_3);
14471     PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
14472     __Pyx_GIVEREF(__pyx_t_4);
14473     PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
14474     __pyx_t_2 = 0;
14475     __pyx_t_3 = 0;
14476     __pyx_t_4 = 0;
14477     __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 249, __pyx_L1_error)
14478     __Pyx_GOTREF(__pyx_t_4);
14479     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14480     __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
14481     __pyx_t_4 = 0;
14482 
14483     /* "View.MemoryView":248
14484  *     cdef array result
14485  *
14486  *     if buf == NULL:             # <<<<<<<<<<<<<<
14487  *         result = array(shape, itemsize, format, mode.decode('ASCII'))
14488  *     else:
14489  */
14490     goto __pyx_L3;
14491   }
14492 
14493   /* "View.MemoryView":251
14494  *         result = array(shape, itemsize, format, mode.decode('ASCII'))
14495  *     else:
14496  *         result = array(shape, itemsize, format, mode.decode('ASCII'),             # <<<<<<<<<<<<<<
14497  *                        allocate_buffer=False)
14498  *         result.data = buf
14499  */
14500   /*else*/ {
14501     __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 251, __pyx_L1_error)
14502     __Pyx_GOTREF(__pyx_t_4);
14503     __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 251, __pyx_L1_error)
14504     __Pyx_GOTREF(__pyx_t_5);
14505     __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(4, 251, __pyx_L1_error)
14506     __Pyx_GOTREF(__pyx_t_3);
14507     __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 251, __pyx_L1_error)
14508     __Pyx_GOTREF(__pyx_t_2);
14509     __Pyx_INCREF(__pyx_v_shape);
14510     __Pyx_GIVEREF(__pyx_v_shape);
14511     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
14512     __Pyx_GIVEREF(__pyx_t_4);
14513     PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
14514     __Pyx_GIVEREF(__pyx_t_5);
14515     PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
14516     __Pyx_GIVEREF(__pyx_t_3);
14517     PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
14518     __pyx_t_4 = 0;
14519     __pyx_t_5 = 0;
14520     __pyx_t_3 = 0;
14521 
14522     /* "View.MemoryView":252
14523  *     else:
14524  *         result = array(shape, itemsize, format, mode.decode('ASCII'),
14525  *                        allocate_buffer=False)             # <<<<<<<<<<<<<<
14526  *         result.data = buf
14527  *
14528  */
14529     __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 252, __pyx_L1_error)
14530     __Pyx_GOTREF(__pyx_t_3);
14531     if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(4, 252, __pyx_L1_error)
14532 
14533     /* "View.MemoryView":251
14534  *         result = array(shape, itemsize, format, mode.decode('ASCII'))
14535  *     else:
14536  *         result = array(shape, itemsize, format, mode.decode('ASCII'),             # <<<<<<<<<<<<<<
14537  *                        allocate_buffer=False)
14538  *         result.data = buf
14539  */
14540     __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 251, __pyx_L1_error)
14541     __Pyx_GOTREF(__pyx_t_5);
14542     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14543     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14544     __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
14545     __pyx_t_5 = 0;
14546 
14547     /* "View.MemoryView":253
14548  *         result = array(shape, itemsize, format, mode.decode('ASCII'),
14549  *                        allocate_buffer=False)
14550  *         result.data = buf             # <<<<<<<<<<<<<<
14551  *
14552  *     return result
14553  */
14554     __pyx_v_result->data = __pyx_v_buf;
14555   }
14556   __pyx_L3:;
14557 
14558   /* "View.MemoryView":255
14559  *         result.data = buf
14560  *
14561  *     return result             # <<<<<<<<<<<<<<
14562  *
14563  *
14564  */
14565   __Pyx_XDECREF(((PyObject *)__pyx_r));
14566   __Pyx_INCREF(((PyObject *)__pyx_v_result));
14567   __pyx_r = __pyx_v_result;
14568   goto __pyx_L0;
14569 
14570   /* "View.MemoryView":244
14571  *
14572  * @cname("__pyx_array_new")
14573  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format,             # <<<<<<<<<<<<<<
14574  *                           char *mode, char *buf):
14575  *     cdef array result
14576  */
14577 
14578   /* function exit code */
14579   __pyx_L1_error:;
14580   __Pyx_XDECREF(__pyx_t_2);
14581   __Pyx_XDECREF(__pyx_t_3);
14582   __Pyx_XDECREF(__pyx_t_4);
14583   __Pyx_XDECREF(__pyx_t_5);
14584   __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
14585   __pyx_r = 0;
14586   __pyx_L0:;
14587   __Pyx_XDECREF((PyObject *)__pyx_v_result);
14588   __Pyx_XGIVEREF((PyObject *)__pyx_r);
14589   __Pyx_RefNannyFinishContext();
14590   return __pyx_r;
14591 }
14592 
14593 /* "View.MemoryView":281
14594  * cdef class Enum(object):
14595  *     cdef object name
14596  *     def __init__(self, name):             # <<<<<<<<<<<<<<
14597  *         self.name = name
14598  *     def __repr__(self):
14599  */
14600 
14601 /* Python wrapper */
14602 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)14603 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14604   PyObject *__pyx_v_name = 0;
14605   int __pyx_r;
14606   __Pyx_RefNannyDeclarations
14607   __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
14608   {
14609     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
14610     PyObject* values[1] = {0};
14611     if (unlikely(__pyx_kwds)) {
14612       Py_ssize_t kw_args;
14613       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14614       switch (pos_args) {
14615         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14616         CYTHON_FALLTHROUGH;
14617         case  0: break;
14618         default: goto __pyx_L5_argtuple_error;
14619       }
14620       kw_args = PyDict_Size(__pyx_kwds);
14621       switch (pos_args) {
14622         case  0:
14623         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
14624         else goto __pyx_L5_argtuple_error;
14625       }
14626       if (unlikely(kw_args > 0)) {
14627         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(4, 281, __pyx_L3_error)
14628       }
14629     } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
14630       goto __pyx_L5_argtuple_error;
14631     } else {
14632       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14633     }
14634     __pyx_v_name = values[0];
14635   }
14636   goto __pyx_L4_argument_unpacking_done;
14637   __pyx_L5_argtuple_error:;
14638   __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 281, __pyx_L3_error)
14639   __pyx_L3_error:;
14640   __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14641   __Pyx_RefNannyFinishContext();
14642   return -1;
14643   __pyx_L4_argument_unpacking_done:;
14644   __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
14645 
14646   /* function exit code */
14647   __Pyx_RefNannyFinishContext();
14648   return __pyx_r;
14649 }
14650 
__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj * __pyx_v_self,PyObject * __pyx_v_name)14651 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
14652   int __pyx_r;
14653   __Pyx_RefNannyDeclarations
14654   __Pyx_RefNannySetupContext("__init__", 0);
14655 
14656   /* "View.MemoryView":282
14657  *     cdef object name
14658  *     def __init__(self, name):
14659  *         self.name = name             # <<<<<<<<<<<<<<
14660  *     def __repr__(self):
14661  *         return self.name
14662  */
14663   __Pyx_INCREF(__pyx_v_name);
14664   __Pyx_GIVEREF(__pyx_v_name);
14665   __Pyx_GOTREF(__pyx_v_self->name);
14666   __Pyx_DECREF(__pyx_v_self->name);
14667   __pyx_v_self->name = __pyx_v_name;
14668 
14669   /* "View.MemoryView":281
14670  * cdef class Enum(object):
14671  *     cdef object name
14672  *     def __init__(self, name):             # <<<<<<<<<<<<<<
14673  *         self.name = name
14674  *     def __repr__(self):
14675  */
14676 
14677   /* function exit code */
14678   __pyx_r = 0;
14679   __Pyx_RefNannyFinishContext();
14680   return __pyx_r;
14681 }
14682 
14683 /* "View.MemoryView":283
14684  *     def __init__(self, name):
14685  *         self.name = name
14686  *     def __repr__(self):             # <<<<<<<<<<<<<<
14687  *         return self.name
14688  *
14689  */
14690 
14691 /* Python wrapper */
14692 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
__pyx_MemviewEnum___repr__(PyObject * __pyx_v_self)14693 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
14694   PyObject *__pyx_r = 0;
14695   __Pyx_RefNannyDeclarations
14696   __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
14697   __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
14698 
14699   /* function exit code */
14700   __Pyx_RefNannyFinishContext();
14701   return __pyx_r;
14702 }
14703 
__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj * __pyx_v_self)14704 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
14705   PyObject *__pyx_r = NULL;
14706   __Pyx_RefNannyDeclarations
14707   __Pyx_RefNannySetupContext("__repr__", 0);
14708 
14709   /* "View.MemoryView":284
14710  *         self.name = name
14711  *     def __repr__(self):
14712  *         return self.name             # <<<<<<<<<<<<<<
14713  *
14714  * cdef generic = Enum("<strided and direct or indirect>")
14715  */
14716   __Pyx_XDECREF(__pyx_r);
14717   __Pyx_INCREF(__pyx_v_self->name);
14718   __pyx_r = __pyx_v_self->name;
14719   goto __pyx_L0;
14720 
14721   /* "View.MemoryView":283
14722  *     def __init__(self, name):
14723  *         self.name = name
14724  *     def __repr__(self):             # <<<<<<<<<<<<<<
14725  *         return self.name
14726  *
14727  */
14728 
14729   /* function exit code */
14730   __pyx_L0:;
14731   __Pyx_XGIVEREF(__pyx_r);
14732   __Pyx_RefNannyFinishContext();
14733   return __pyx_r;
14734 }
14735 
14736 /* "(tree fragment)":1
14737  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
14738  *     cdef tuple state
14739  *     cdef object _dict
14740  */
14741 
14742 /* Python wrapper */
14743 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)14744 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14745   PyObject *__pyx_r = 0;
14746   __Pyx_RefNannyDeclarations
14747   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
14748   __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
14749 
14750   /* function exit code */
14751   __Pyx_RefNannyFinishContext();
14752   return __pyx_r;
14753 }
14754 
__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj * __pyx_v_self)14755 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
14756   PyObject *__pyx_v_state = 0;
14757   PyObject *__pyx_v__dict = 0;
14758   int __pyx_v_use_setstate;
14759   PyObject *__pyx_r = NULL;
14760   __Pyx_RefNannyDeclarations
14761   PyObject *__pyx_t_1 = NULL;
14762   int __pyx_t_2;
14763   int __pyx_t_3;
14764   PyObject *__pyx_t_4 = NULL;
14765   PyObject *__pyx_t_5 = NULL;
14766   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
14767 
14768   /* "(tree fragment)":5
14769  *     cdef object _dict
14770  *     cdef bint use_setstate
14771  *     state = (self.name,)             # <<<<<<<<<<<<<<
14772  *     _dict = getattr(self, '__dict__', None)
14773  *     if _dict is not None:
14774  */
14775   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 5, __pyx_L1_error)
14776   __Pyx_GOTREF(__pyx_t_1);
14777   __Pyx_INCREF(__pyx_v_self->name);
14778   __Pyx_GIVEREF(__pyx_v_self->name);
14779   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
14780   __pyx_v_state = ((PyObject*)__pyx_t_1);
14781   __pyx_t_1 = 0;
14782 
14783   /* "(tree fragment)":6
14784  *     cdef bint use_setstate
14785  *     state = (self.name,)
14786  *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
14787  *     if _dict is not None:
14788  *         state += (_dict,)
14789  */
14790   __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 6, __pyx_L1_error)
14791   __Pyx_GOTREF(__pyx_t_1);
14792   __pyx_v__dict = __pyx_t_1;
14793   __pyx_t_1 = 0;
14794 
14795   /* "(tree fragment)":7
14796  *     state = (self.name,)
14797  *     _dict = getattr(self, '__dict__', None)
14798  *     if _dict is not None:             # <<<<<<<<<<<<<<
14799  *         state += (_dict,)
14800  *         use_setstate = True
14801  */
14802   __pyx_t_2 = (__pyx_v__dict != Py_None);
14803   __pyx_t_3 = (__pyx_t_2 != 0);
14804   if (__pyx_t_3) {
14805 
14806     /* "(tree fragment)":8
14807  *     _dict = getattr(self, '__dict__', None)
14808  *     if _dict is not None:
14809  *         state += (_dict,)             # <<<<<<<<<<<<<<
14810  *         use_setstate = True
14811  *     else:
14812  */
14813     __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 8, __pyx_L1_error)
14814     __Pyx_GOTREF(__pyx_t_1);
14815     __Pyx_INCREF(__pyx_v__dict);
14816     __Pyx_GIVEREF(__pyx_v__dict);
14817     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
14818     __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 8, __pyx_L1_error)
14819     __Pyx_GOTREF(__pyx_t_4);
14820     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14821     __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
14822     __pyx_t_4 = 0;
14823 
14824     /* "(tree fragment)":9
14825  *     if _dict is not None:
14826  *         state += (_dict,)
14827  *         use_setstate = True             # <<<<<<<<<<<<<<
14828  *     else:
14829  *         use_setstate = self.name is not None
14830  */
14831     __pyx_v_use_setstate = 1;
14832 
14833     /* "(tree fragment)":7
14834  *     state = (self.name,)
14835  *     _dict = getattr(self, '__dict__', None)
14836  *     if _dict is not None:             # <<<<<<<<<<<<<<
14837  *         state += (_dict,)
14838  *         use_setstate = True
14839  */
14840     goto __pyx_L3;
14841   }
14842 
14843   /* "(tree fragment)":11
14844  *         use_setstate = True
14845  *     else:
14846  *         use_setstate = self.name is not None             # <<<<<<<<<<<<<<
14847  *     if use_setstate:
14848  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
14849  */
14850   /*else*/ {
14851     __pyx_t_3 = (__pyx_v_self->name != Py_None);
14852     __pyx_v_use_setstate = __pyx_t_3;
14853   }
14854   __pyx_L3:;
14855 
14856   /* "(tree fragment)":12
14857  *     else:
14858  *         use_setstate = self.name is not None
14859  *     if use_setstate:             # <<<<<<<<<<<<<<
14860  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
14861  *     else:
14862  */
14863   __pyx_t_3 = (__pyx_v_use_setstate != 0);
14864   if (__pyx_t_3) {
14865 
14866     /* "(tree fragment)":13
14867  *         use_setstate = self.name is not None
14868  *     if use_setstate:
14869  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state             # <<<<<<<<<<<<<<
14870  *     else:
14871  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
14872  */
14873     __Pyx_XDECREF(__pyx_r);
14874     __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 13, __pyx_L1_error)
14875     __Pyx_GOTREF(__pyx_t_4);
14876     __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 13, __pyx_L1_error)
14877     __Pyx_GOTREF(__pyx_t_1);
14878     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
14879     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
14880     PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
14881     __Pyx_INCREF(__pyx_int_184977713);
14882     __Pyx_GIVEREF(__pyx_int_184977713);
14883     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
14884     __Pyx_INCREF(Py_None);
14885     __Pyx_GIVEREF(Py_None);
14886     PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
14887     __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 13, __pyx_L1_error)
14888     __Pyx_GOTREF(__pyx_t_5);
14889     __Pyx_GIVEREF(__pyx_t_4);
14890     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
14891     __Pyx_GIVEREF(__pyx_t_1);
14892     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
14893     __Pyx_INCREF(__pyx_v_state);
14894     __Pyx_GIVEREF(__pyx_v_state);
14895     PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
14896     __pyx_t_4 = 0;
14897     __pyx_t_1 = 0;
14898     __pyx_r = __pyx_t_5;
14899     __pyx_t_5 = 0;
14900     goto __pyx_L0;
14901 
14902     /* "(tree fragment)":12
14903  *     else:
14904  *         use_setstate = self.name is not None
14905  *     if use_setstate:             # <<<<<<<<<<<<<<
14906  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
14907  *     else:
14908  */
14909   }
14910 
14911   /* "(tree fragment)":15
14912  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
14913  *     else:
14914  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)             # <<<<<<<<<<<<<<
14915  * def __setstate_cython__(self, __pyx_state):
14916  *     __pyx_unpickle_Enum__set_state(self, __pyx_state)
14917  */
14918   /*else*/ {
14919     __Pyx_XDECREF(__pyx_r);
14920     __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 15, __pyx_L1_error)
14921     __Pyx_GOTREF(__pyx_t_5);
14922     __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 15, __pyx_L1_error)
14923     __Pyx_GOTREF(__pyx_t_1);
14924     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
14925     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
14926     PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
14927     __Pyx_INCREF(__pyx_int_184977713);
14928     __Pyx_GIVEREF(__pyx_int_184977713);
14929     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
14930     __Pyx_INCREF(__pyx_v_state);
14931     __Pyx_GIVEREF(__pyx_v_state);
14932     PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
14933     __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 15, __pyx_L1_error)
14934     __Pyx_GOTREF(__pyx_t_4);
14935     __Pyx_GIVEREF(__pyx_t_5);
14936     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
14937     __Pyx_GIVEREF(__pyx_t_1);
14938     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
14939     __pyx_t_5 = 0;
14940     __pyx_t_1 = 0;
14941     __pyx_r = __pyx_t_4;
14942     __pyx_t_4 = 0;
14943     goto __pyx_L0;
14944   }
14945 
14946   /* "(tree fragment)":1
14947  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
14948  *     cdef tuple state
14949  *     cdef object _dict
14950  */
14951 
14952   /* function exit code */
14953   __pyx_L1_error:;
14954   __Pyx_XDECREF(__pyx_t_1);
14955   __Pyx_XDECREF(__pyx_t_4);
14956   __Pyx_XDECREF(__pyx_t_5);
14957   __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14958   __pyx_r = NULL;
14959   __pyx_L0:;
14960   __Pyx_XDECREF(__pyx_v_state);
14961   __Pyx_XDECREF(__pyx_v__dict);
14962   __Pyx_XGIVEREF(__pyx_r);
14963   __Pyx_RefNannyFinishContext();
14964   return __pyx_r;
14965 }
14966 
14967 /* "(tree fragment)":16
14968  *     else:
14969  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
14970  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
14971  *     __pyx_unpickle_Enum__set_state(self, __pyx_state)
14972  */
14973 
14974 /* Python wrapper */
14975 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)14976 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
14977   PyObject *__pyx_r = 0;
14978   __Pyx_RefNannyDeclarations
14979   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
14980   __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
14981 
14982   /* function exit code */
14983   __Pyx_RefNannyFinishContext();
14984   return __pyx_r;
14985 }
14986 
__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj * __pyx_v_self,PyObject * __pyx_v___pyx_state)14987 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
14988   PyObject *__pyx_r = NULL;
14989   __Pyx_RefNannyDeclarations
14990   PyObject *__pyx_t_1 = NULL;
14991   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
14992 
14993   /* "(tree fragment)":17
14994  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
14995  * def __setstate_cython__(self, __pyx_state):
14996  *     __pyx_unpickle_Enum__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
14997  */
14998   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(4, 17, __pyx_L1_error)
14999   __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 17, __pyx_L1_error)
15000   __Pyx_GOTREF(__pyx_t_1);
15001   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15002 
15003   /* "(tree fragment)":16
15004  *     else:
15005  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
15006  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
15007  *     __pyx_unpickle_Enum__set_state(self, __pyx_state)
15008  */
15009 
15010   /* function exit code */
15011   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15012   goto __pyx_L0;
15013   __pyx_L1_error:;
15014   __Pyx_XDECREF(__pyx_t_1);
15015   __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15016   __pyx_r = NULL;
15017   __pyx_L0:;
15018   __Pyx_XGIVEREF(__pyx_r);
15019   __Pyx_RefNannyFinishContext();
15020   return __pyx_r;
15021 }
15022 
15023 /* "View.MemoryView":298
15024  *
15025  * @cname('__pyx_align_pointer')
15026  * cdef void *align_pointer(void *memory, size_t alignment) nogil:             # <<<<<<<<<<<<<<
15027  *     "Align pointer memory on a given boundary"
15028  *     cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
15029  */
15030 
__pyx_align_pointer(void * __pyx_v_memory,size_t __pyx_v_alignment)15031 static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
15032   Py_intptr_t __pyx_v_aligned_p;
15033   size_t __pyx_v_offset;
15034   void *__pyx_r;
15035   int __pyx_t_1;
15036 
15037   /* "View.MemoryView":300
15038  * cdef void *align_pointer(void *memory, size_t alignment) nogil:
15039  *     "Align pointer memory on a given boundary"
15040  *     cdef Py_intptr_t aligned_p = <Py_intptr_t> memory             # <<<<<<<<<<<<<<
15041  *     cdef size_t offset
15042  *
15043  */
15044   __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
15045 
15046   /* "View.MemoryView":304
15047  *
15048  *     with cython.cdivision(True):
15049  *         offset = aligned_p % alignment             # <<<<<<<<<<<<<<
15050  *
15051  *     if offset > 0:
15052  */
15053   __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
15054 
15055   /* "View.MemoryView":306
15056  *         offset = aligned_p % alignment
15057  *
15058  *     if offset > 0:             # <<<<<<<<<<<<<<
15059  *         aligned_p += alignment - offset
15060  *
15061  */
15062   __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
15063   if (__pyx_t_1) {
15064 
15065     /* "View.MemoryView":307
15066  *
15067  *     if offset > 0:
15068  *         aligned_p += alignment - offset             # <<<<<<<<<<<<<<
15069  *
15070  *     return <void *> aligned_p
15071  */
15072     __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
15073 
15074     /* "View.MemoryView":306
15075  *         offset = aligned_p % alignment
15076  *
15077  *     if offset > 0:             # <<<<<<<<<<<<<<
15078  *         aligned_p += alignment - offset
15079  *
15080  */
15081   }
15082 
15083   /* "View.MemoryView":309
15084  *         aligned_p += alignment - offset
15085  *
15086  *     return <void *> aligned_p             # <<<<<<<<<<<<<<
15087  *
15088  *
15089  */
15090   __pyx_r = ((void *)__pyx_v_aligned_p);
15091   goto __pyx_L0;
15092 
15093   /* "View.MemoryView":298
15094  *
15095  * @cname('__pyx_align_pointer')
15096  * cdef void *align_pointer(void *memory, size_t alignment) nogil:             # <<<<<<<<<<<<<<
15097  *     "Align pointer memory on a given boundary"
15098  *     cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
15099  */
15100 
15101   /* function exit code */
15102   __pyx_L0:;
15103   return __pyx_r;
15104 }
15105 
15106 /* "View.MemoryView":345
15107  *     cdef __Pyx_TypeInfo *typeinfo
15108  *
15109  *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):             # <<<<<<<<<<<<<<
15110  *         self.obj = obj
15111  *         self.flags = flags
15112  */
15113 
15114 /* Python wrapper */
15115 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)15116 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15117   PyObject *__pyx_v_obj = 0;
15118   int __pyx_v_flags;
15119   int __pyx_v_dtype_is_object;
15120   int __pyx_r;
15121   __Pyx_RefNannyDeclarations
15122   __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
15123   {
15124     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
15125     PyObject* values[3] = {0,0,0};
15126     if (unlikely(__pyx_kwds)) {
15127       Py_ssize_t kw_args;
15128       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15129       switch (pos_args) {
15130         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15131         CYTHON_FALLTHROUGH;
15132         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15133         CYTHON_FALLTHROUGH;
15134         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15135         CYTHON_FALLTHROUGH;
15136         case  0: break;
15137         default: goto __pyx_L5_argtuple_error;
15138       }
15139       kw_args = PyDict_Size(__pyx_kwds);
15140       switch (pos_args) {
15141         case  0:
15142         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
15143         else goto __pyx_L5_argtuple_error;
15144         CYTHON_FALLTHROUGH;
15145         case  1:
15146         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
15147         else {
15148           __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(4, 345, __pyx_L3_error)
15149         }
15150         CYTHON_FALLTHROUGH;
15151         case  2:
15152         if (kw_args > 0) {
15153           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
15154           if (value) { values[2] = value; kw_args--; }
15155         }
15156       }
15157       if (unlikely(kw_args > 0)) {
15158         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(4, 345, __pyx_L3_error)
15159       }
15160     } else {
15161       switch (PyTuple_GET_SIZE(__pyx_args)) {
15162         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15163         CYTHON_FALLTHROUGH;
15164         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15165         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15166         break;
15167         default: goto __pyx_L5_argtuple_error;
15168       }
15169     }
15170     __pyx_v_obj = values[0];
15171     __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 345, __pyx_L3_error)
15172     if (values[2]) {
15173       __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 345, __pyx_L3_error)
15174     } else {
15175       __pyx_v_dtype_is_object = ((int)0);
15176     }
15177   }
15178   goto __pyx_L4_argument_unpacking_done;
15179   __pyx_L5_argtuple_error:;
15180   __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 345, __pyx_L3_error)
15181   __pyx_L3_error:;
15182   __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15183   __Pyx_RefNannyFinishContext();
15184   return -1;
15185   __pyx_L4_argument_unpacking_done:;
15186   __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);
15187 
15188   /* function exit code */
15189   __Pyx_RefNannyFinishContext();
15190   return __pyx_r;
15191 }
15192 
__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)15193 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) {
15194   int __pyx_r;
15195   __Pyx_RefNannyDeclarations
15196   int __pyx_t_1;
15197   int __pyx_t_2;
15198   int __pyx_t_3;
15199   int __pyx_t_4;
15200   __Pyx_RefNannySetupContext("__cinit__", 0);
15201 
15202   /* "View.MemoryView":346
15203  *
15204  *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
15205  *         self.obj = obj             # <<<<<<<<<<<<<<
15206  *         self.flags = flags
15207  *         if type(self) is memoryview or obj is not None:
15208  */
15209   __Pyx_INCREF(__pyx_v_obj);
15210   __Pyx_GIVEREF(__pyx_v_obj);
15211   __Pyx_GOTREF(__pyx_v_self->obj);
15212   __Pyx_DECREF(__pyx_v_self->obj);
15213   __pyx_v_self->obj = __pyx_v_obj;
15214 
15215   /* "View.MemoryView":347
15216  *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
15217  *         self.obj = obj
15218  *         self.flags = flags             # <<<<<<<<<<<<<<
15219  *         if type(self) is memoryview or obj is not None:
15220  *             __Pyx_GetBuffer(obj, &self.view, flags)
15221  */
15222   __pyx_v_self->flags = __pyx_v_flags;
15223 
15224   /* "View.MemoryView":348
15225  *         self.obj = obj
15226  *         self.flags = flags
15227  *         if type(self) is memoryview or obj is not None:             # <<<<<<<<<<<<<<
15228  *             __Pyx_GetBuffer(obj, &self.view, flags)
15229  *             if <PyObject *> self.view.obj == NULL:
15230  */
15231   __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
15232   __pyx_t_3 = (__pyx_t_2 != 0);
15233   if (!__pyx_t_3) {
15234   } else {
15235     __pyx_t_1 = __pyx_t_3;
15236     goto __pyx_L4_bool_binop_done;
15237   }
15238   __pyx_t_3 = (__pyx_v_obj != Py_None);
15239   __pyx_t_2 = (__pyx_t_3 != 0);
15240   __pyx_t_1 = __pyx_t_2;
15241   __pyx_L4_bool_binop_done:;
15242   if (__pyx_t_1) {
15243 
15244     /* "View.MemoryView":349
15245  *         self.flags = flags
15246  *         if type(self) is memoryview or obj is not None:
15247  *             __Pyx_GetBuffer(obj, &self.view, flags)             # <<<<<<<<<<<<<<
15248  *             if <PyObject *> self.view.obj == NULL:
15249  *                 (<__pyx_buffer *> &self.view).obj = Py_None
15250  */
15251     __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(4, 349, __pyx_L1_error)
15252 
15253     /* "View.MemoryView":350
15254  *         if type(self) is memoryview or obj is not None:
15255  *             __Pyx_GetBuffer(obj, &self.view, flags)
15256  *             if <PyObject *> self.view.obj == NULL:             # <<<<<<<<<<<<<<
15257  *                 (<__pyx_buffer *> &self.view).obj = Py_None
15258  *                 Py_INCREF(Py_None)
15259  */
15260     __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
15261     if (__pyx_t_1) {
15262 
15263       /* "View.MemoryView":351
15264  *             __Pyx_GetBuffer(obj, &self.view, flags)
15265  *             if <PyObject *> self.view.obj == NULL:
15266  *                 (<__pyx_buffer *> &self.view).obj = Py_None             # <<<<<<<<<<<<<<
15267  *                 Py_INCREF(Py_None)
15268  *
15269  */
15270       ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
15271 
15272       /* "View.MemoryView":352
15273  *             if <PyObject *> self.view.obj == NULL:
15274  *                 (<__pyx_buffer *> &self.view).obj = Py_None
15275  *                 Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
15276  *
15277  *         global __pyx_memoryview_thread_locks_used
15278  */
15279       Py_INCREF(Py_None);
15280 
15281       /* "View.MemoryView":350
15282  *         if type(self) is memoryview or obj is not None:
15283  *             __Pyx_GetBuffer(obj, &self.view, flags)
15284  *             if <PyObject *> self.view.obj == NULL:             # <<<<<<<<<<<<<<
15285  *                 (<__pyx_buffer *> &self.view).obj = Py_None
15286  *                 Py_INCREF(Py_None)
15287  */
15288     }
15289 
15290     /* "View.MemoryView":348
15291  *         self.obj = obj
15292  *         self.flags = flags
15293  *         if type(self) is memoryview or obj is not None:             # <<<<<<<<<<<<<<
15294  *             __Pyx_GetBuffer(obj, &self.view, flags)
15295  *             if <PyObject *> self.view.obj == NULL:
15296  */
15297   }
15298 
15299   /* "View.MemoryView":355
15300  *
15301  *         global __pyx_memoryview_thread_locks_used
15302  *         if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:             # <<<<<<<<<<<<<<
15303  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
15304  *             __pyx_memoryview_thread_locks_used += 1
15305  */
15306   __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
15307   if (__pyx_t_1) {
15308 
15309     /* "View.MemoryView":356
15310  *         global __pyx_memoryview_thread_locks_used
15311  *         if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
15312  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]             # <<<<<<<<<<<<<<
15313  *             __pyx_memoryview_thread_locks_used += 1
15314  *         if self.lock is NULL:
15315  */
15316     __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
15317 
15318     /* "View.MemoryView":357
15319  *         if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
15320  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
15321  *             __pyx_memoryview_thread_locks_used += 1             # <<<<<<<<<<<<<<
15322  *         if self.lock is NULL:
15323  *             self.lock = PyThread_allocate_lock()
15324  */
15325     __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
15326 
15327     /* "View.MemoryView":355
15328  *
15329  *         global __pyx_memoryview_thread_locks_used
15330  *         if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:             # <<<<<<<<<<<<<<
15331  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
15332  *             __pyx_memoryview_thread_locks_used += 1
15333  */
15334   }
15335 
15336   /* "View.MemoryView":358
15337  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
15338  *             __pyx_memoryview_thread_locks_used += 1
15339  *         if self.lock is NULL:             # <<<<<<<<<<<<<<
15340  *             self.lock = PyThread_allocate_lock()
15341  *             if self.lock is NULL:
15342  */
15343   __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
15344   if (__pyx_t_1) {
15345 
15346     /* "View.MemoryView":359
15347  *             __pyx_memoryview_thread_locks_used += 1
15348  *         if self.lock is NULL:
15349  *             self.lock = PyThread_allocate_lock()             # <<<<<<<<<<<<<<
15350  *             if self.lock is NULL:
15351  *                 raise MemoryError
15352  */
15353     __pyx_v_self->lock = PyThread_allocate_lock();
15354 
15355     /* "View.MemoryView":360
15356  *         if self.lock is NULL:
15357  *             self.lock = PyThread_allocate_lock()
15358  *             if self.lock is NULL:             # <<<<<<<<<<<<<<
15359  *                 raise MemoryError
15360  *
15361  */
15362     __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
15363     if (unlikely(__pyx_t_1)) {
15364 
15365       /* "View.MemoryView":361
15366  *             self.lock = PyThread_allocate_lock()
15367  *             if self.lock is NULL:
15368  *                 raise MemoryError             # <<<<<<<<<<<<<<
15369  *
15370  *         if flags & PyBUF_FORMAT:
15371  */
15372       PyErr_NoMemory(); __PYX_ERR(4, 361, __pyx_L1_error)
15373 
15374       /* "View.MemoryView":360
15375  *         if self.lock is NULL:
15376  *             self.lock = PyThread_allocate_lock()
15377  *             if self.lock is NULL:             # <<<<<<<<<<<<<<
15378  *                 raise MemoryError
15379  *
15380  */
15381     }
15382 
15383     /* "View.MemoryView":358
15384  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
15385  *             __pyx_memoryview_thread_locks_used += 1
15386  *         if self.lock is NULL:             # <<<<<<<<<<<<<<
15387  *             self.lock = PyThread_allocate_lock()
15388  *             if self.lock is NULL:
15389  */
15390   }
15391 
15392   /* "View.MemoryView":363
15393  *                 raise MemoryError
15394  *
15395  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
15396  *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
15397  *         else:
15398  */
15399   __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
15400   if (__pyx_t_1) {
15401 
15402     /* "View.MemoryView":364
15403  *
15404  *         if flags & PyBUF_FORMAT:
15405  *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')             # <<<<<<<<<<<<<<
15406  *         else:
15407  *             self.dtype_is_object = dtype_is_object
15408  */
15409     __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
15410     if (__pyx_t_2) {
15411     } else {
15412       __pyx_t_1 = __pyx_t_2;
15413       goto __pyx_L11_bool_binop_done;
15414     }
15415     __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
15416     __pyx_t_1 = __pyx_t_2;
15417     __pyx_L11_bool_binop_done:;
15418     __pyx_v_self->dtype_is_object = __pyx_t_1;
15419 
15420     /* "View.MemoryView":363
15421  *                 raise MemoryError
15422  *
15423  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
15424  *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
15425  *         else:
15426  */
15427     goto __pyx_L10;
15428   }
15429 
15430   /* "View.MemoryView":366
15431  *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
15432  *         else:
15433  *             self.dtype_is_object = dtype_is_object             # <<<<<<<<<<<<<<
15434  *
15435  *         self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
15436  */
15437   /*else*/ {
15438     __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
15439   }
15440   __pyx_L10:;
15441 
15442   /* "View.MemoryView":368
15443  *             self.dtype_is_object = dtype_is_object
15444  *
15445  *         self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(             # <<<<<<<<<<<<<<
15446  *                   <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
15447  *         self.typeinfo = NULL
15448  */
15449   __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));
15450 
15451   /* "View.MemoryView":370
15452  *         self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
15453  *                   <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
15454  *         self.typeinfo = NULL             # <<<<<<<<<<<<<<
15455  *
15456  *     def __dealloc__(memoryview self):
15457  */
15458   __pyx_v_self->typeinfo = NULL;
15459 
15460   /* "View.MemoryView":345
15461  *     cdef __Pyx_TypeInfo *typeinfo
15462  *
15463  *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):             # <<<<<<<<<<<<<<
15464  *         self.obj = obj
15465  *         self.flags = flags
15466  */
15467 
15468   /* function exit code */
15469   __pyx_r = 0;
15470   goto __pyx_L0;
15471   __pyx_L1_error:;
15472   __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15473   __pyx_r = -1;
15474   __pyx_L0:;
15475   __Pyx_RefNannyFinishContext();
15476   return __pyx_r;
15477 }
15478 
15479 /* "View.MemoryView":372
15480  *         self.typeinfo = NULL
15481  *
15482  *     def __dealloc__(memoryview self):             # <<<<<<<<<<<<<<
15483  *         if self.obj is not None:
15484  *             __Pyx_ReleaseBuffer(&self.view)
15485  */
15486 
15487 /* Python wrapper */
15488 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
__pyx_memoryview___dealloc__(PyObject * __pyx_v_self)15489 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
15490   __Pyx_RefNannyDeclarations
15491   __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
15492   __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
15493 
15494   /* function exit code */
15495   __Pyx_RefNannyFinishContext();
15496 }
15497 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj * __pyx_v_self)15498 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
15499   int __pyx_v_i;
15500   __Pyx_RefNannyDeclarations
15501   int __pyx_t_1;
15502   int __pyx_t_2;
15503   int __pyx_t_3;
15504   int __pyx_t_4;
15505   int __pyx_t_5;
15506   PyThread_type_lock __pyx_t_6;
15507   PyThread_type_lock __pyx_t_7;
15508   __Pyx_RefNannySetupContext("__dealloc__", 0);
15509 
15510   /* "View.MemoryView":373
15511  *
15512  *     def __dealloc__(memoryview self):
15513  *         if self.obj is not None:             # <<<<<<<<<<<<<<
15514  *             __Pyx_ReleaseBuffer(&self.view)
15515  *
15516  */
15517   __pyx_t_1 = (__pyx_v_self->obj != Py_None);
15518   __pyx_t_2 = (__pyx_t_1 != 0);
15519   if (__pyx_t_2) {
15520 
15521     /* "View.MemoryView":374
15522  *     def __dealloc__(memoryview self):
15523  *         if self.obj is not None:
15524  *             __Pyx_ReleaseBuffer(&self.view)             # <<<<<<<<<<<<<<
15525  *
15526  *         cdef int i
15527  */
15528     __Pyx_ReleaseBuffer((&__pyx_v_self->view));
15529 
15530     /* "View.MemoryView":373
15531  *
15532  *     def __dealloc__(memoryview self):
15533  *         if self.obj is not None:             # <<<<<<<<<<<<<<
15534  *             __Pyx_ReleaseBuffer(&self.view)
15535  *
15536  */
15537   }
15538 
15539   /* "View.MemoryView":378
15540  *         cdef int i
15541  *         global __pyx_memoryview_thread_locks_used
15542  *         if self.lock != NULL:             # <<<<<<<<<<<<<<
15543  *             for i in range(__pyx_memoryview_thread_locks_used):
15544  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
15545  */
15546   __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
15547   if (__pyx_t_2) {
15548 
15549     /* "View.MemoryView":379
15550  *         global __pyx_memoryview_thread_locks_used
15551  *         if self.lock != NULL:
15552  *             for i in range(__pyx_memoryview_thread_locks_used):             # <<<<<<<<<<<<<<
15553  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
15554  *                     __pyx_memoryview_thread_locks_used -= 1
15555  */
15556     __pyx_t_3 = __pyx_memoryview_thread_locks_used;
15557     __pyx_t_4 = __pyx_t_3;
15558     for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
15559       __pyx_v_i = __pyx_t_5;
15560 
15561       /* "View.MemoryView":380
15562  *         if self.lock != NULL:
15563  *             for i in range(__pyx_memoryview_thread_locks_used):
15564  *                 if __pyx_memoryview_thread_locks[i] is self.lock:             # <<<<<<<<<<<<<<
15565  *                     __pyx_memoryview_thread_locks_used -= 1
15566  *                     if i != __pyx_memoryview_thread_locks_used:
15567  */
15568       __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
15569       if (__pyx_t_2) {
15570 
15571         /* "View.MemoryView":381
15572  *             for i in range(__pyx_memoryview_thread_locks_used):
15573  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
15574  *                     __pyx_memoryview_thread_locks_used -= 1             # <<<<<<<<<<<<<<
15575  *                     if i != __pyx_memoryview_thread_locks_used:
15576  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
15577  */
15578         __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
15579 
15580         /* "View.MemoryView":382
15581  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
15582  *                     __pyx_memoryview_thread_locks_used -= 1
15583  *                     if i != __pyx_memoryview_thread_locks_used:             # <<<<<<<<<<<<<<
15584  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
15585  *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
15586  */
15587         __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
15588         if (__pyx_t_2) {
15589 
15590           /* "View.MemoryView":384
15591  *                     if i != __pyx_memoryview_thread_locks_used:
15592  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
15593  *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])             # <<<<<<<<<<<<<<
15594  *                     break
15595  *             else:
15596  */
15597           __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
15598           __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
15599 
15600           /* "View.MemoryView":383
15601  *                     __pyx_memoryview_thread_locks_used -= 1
15602  *                     if i != __pyx_memoryview_thread_locks_used:
15603  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (             # <<<<<<<<<<<<<<
15604  *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
15605  *                     break
15606  */
15607           (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
15608           (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
15609 
15610           /* "View.MemoryView":382
15611  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
15612  *                     __pyx_memoryview_thread_locks_used -= 1
15613  *                     if i != __pyx_memoryview_thread_locks_used:             # <<<<<<<<<<<<<<
15614  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
15615  *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
15616  */
15617         }
15618 
15619         /* "View.MemoryView":385
15620  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
15621  *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
15622  *                     break             # <<<<<<<<<<<<<<
15623  *             else:
15624  *                 PyThread_free_lock(self.lock)
15625  */
15626         goto __pyx_L6_break;
15627 
15628         /* "View.MemoryView":380
15629  *         if self.lock != NULL:
15630  *             for i in range(__pyx_memoryview_thread_locks_used):
15631  *                 if __pyx_memoryview_thread_locks[i] is self.lock:             # <<<<<<<<<<<<<<
15632  *                     __pyx_memoryview_thread_locks_used -= 1
15633  *                     if i != __pyx_memoryview_thread_locks_used:
15634  */
15635       }
15636     }
15637     /*else*/ {
15638 
15639       /* "View.MemoryView":387
15640  *                     break
15641  *             else:
15642  *                 PyThread_free_lock(self.lock)             # <<<<<<<<<<<<<<
15643  *
15644  *     cdef char *get_item_pointer(memoryview self, object index) except NULL:
15645  */
15646       PyThread_free_lock(__pyx_v_self->lock);
15647     }
15648     __pyx_L6_break:;
15649 
15650     /* "View.MemoryView":378
15651  *         cdef int i
15652  *         global __pyx_memoryview_thread_locks_used
15653  *         if self.lock != NULL:             # <<<<<<<<<<<<<<
15654  *             for i in range(__pyx_memoryview_thread_locks_used):
15655  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
15656  */
15657   }
15658 
15659   /* "View.MemoryView":372
15660  *         self.typeinfo = NULL
15661  *
15662  *     def __dealloc__(memoryview self):             # <<<<<<<<<<<<<<
15663  *         if self.obj is not None:
15664  *             __Pyx_ReleaseBuffer(&self.view)
15665  */
15666 
15667   /* function exit code */
15668   __Pyx_RefNannyFinishContext();
15669 }
15670 
15671 /* "View.MemoryView":389
15672  *                 PyThread_free_lock(self.lock)
15673  *
15674  *     cdef char *get_item_pointer(memoryview self, object index) except NULL:             # <<<<<<<<<<<<<<
15675  *         cdef Py_ssize_t dim
15676  *         cdef char *itemp = <char *> self.view.buf
15677  */
15678 
__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_index)15679 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
15680   Py_ssize_t __pyx_v_dim;
15681   char *__pyx_v_itemp;
15682   PyObject *__pyx_v_idx = NULL;
15683   char *__pyx_r;
15684   __Pyx_RefNannyDeclarations
15685   Py_ssize_t __pyx_t_1;
15686   PyObject *__pyx_t_2 = NULL;
15687   Py_ssize_t __pyx_t_3;
15688   PyObject *(*__pyx_t_4)(PyObject *);
15689   PyObject *__pyx_t_5 = NULL;
15690   Py_ssize_t __pyx_t_6;
15691   char *__pyx_t_7;
15692   __Pyx_RefNannySetupContext("get_item_pointer", 0);
15693 
15694   /* "View.MemoryView":391
15695  *     cdef char *get_item_pointer(memoryview self, object index) except NULL:
15696  *         cdef Py_ssize_t dim
15697  *         cdef char *itemp = <char *> self.view.buf             # <<<<<<<<<<<<<<
15698  *
15699  *         for dim, idx in enumerate(index):
15700  */
15701   __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
15702 
15703   /* "View.MemoryView":393
15704  *         cdef char *itemp = <char *> self.view.buf
15705  *
15706  *         for dim, idx in enumerate(index):             # <<<<<<<<<<<<<<
15707  *             itemp = pybuffer_index(&self.view, itemp, idx, dim)
15708  *
15709  */
15710   __pyx_t_1 = 0;
15711   if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
15712     __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
15713     __pyx_t_4 = NULL;
15714   } else {
15715     __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 393, __pyx_L1_error)
15716     __Pyx_GOTREF(__pyx_t_2);
15717     __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 393, __pyx_L1_error)
15718   }
15719   for (;;) {
15720     if (likely(!__pyx_t_4)) {
15721       if (likely(PyList_CheckExact(__pyx_t_2))) {
15722         if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
15723         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15724         __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(4, 393, __pyx_L1_error)
15725         #else
15726         __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 393, __pyx_L1_error)
15727         __Pyx_GOTREF(__pyx_t_5);
15728         #endif
15729       } else {
15730         if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
15731         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15732         __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(4, 393, __pyx_L1_error)
15733         #else
15734         __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 393, __pyx_L1_error)
15735         __Pyx_GOTREF(__pyx_t_5);
15736         #endif
15737       }
15738     } else {
15739       __pyx_t_5 = __pyx_t_4(__pyx_t_2);
15740       if (unlikely(!__pyx_t_5)) {
15741         PyObject* exc_type = PyErr_Occurred();
15742         if (exc_type) {
15743           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
15744           else __PYX_ERR(4, 393, __pyx_L1_error)
15745         }
15746         break;
15747       }
15748       __Pyx_GOTREF(__pyx_t_5);
15749     }
15750     __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
15751     __pyx_t_5 = 0;
15752     __pyx_v_dim = __pyx_t_1;
15753     __pyx_t_1 = (__pyx_t_1 + 1);
15754 
15755     /* "View.MemoryView":394
15756  *
15757  *         for dim, idx in enumerate(index):
15758  *             itemp = pybuffer_index(&self.view, itemp, idx, dim)             # <<<<<<<<<<<<<<
15759  *
15760  *         return itemp
15761  */
15762     __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 394, __pyx_L1_error)
15763     __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(4, 394, __pyx_L1_error)
15764     __pyx_v_itemp = __pyx_t_7;
15765 
15766     /* "View.MemoryView":393
15767  *         cdef char *itemp = <char *> self.view.buf
15768  *
15769  *         for dim, idx in enumerate(index):             # <<<<<<<<<<<<<<
15770  *             itemp = pybuffer_index(&self.view, itemp, idx, dim)
15771  *
15772  */
15773   }
15774   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15775 
15776   /* "View.MemoryView":396
15777  *             itemp = pybuffer_index(&self.view, itemp, idx, dim)
15778  *
15779  *         return itemp             # <<<<<<<<<<<<<<
15780  *
15781  *
15782  */
15783   __pyx_r = __pyx_v_itemp;
15784   goto __pyx_L0;
15785 
15786   /* "View.MemoryView":389
15787  *                 PyThread_free_lock(self.lock)
15788  *
15789  *     cdef char *get_item_pointer(memoryview self, object index) except NULL:             # <<<<<<<<<<<<<<
15790  *         cdef Py_ssize_t dim
15791  *         cdef char *itemp = <char *> self.view.buf
15792  */
15793 
15794   /* function exit code */
15795   __pyx_L1_error:;
15796   __Pyx_XDECREF(__pyx_t_2);
15797   __Pyx_XDECREF(__pyx_t_5);
15798   __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
15799   __pyx_r = NULL;
15800   __pyx_L0:;
15801   __Pyx_XDECREF(__pyx_v_idx);
15802   __Pyx_RefNannyFinishContext();
15803   return __pyx_r;
15804 }
15805 
15806 /* "View.MemoryView":399
15807  *
15808  *
15809  *     def __getitem__(memoryview self, object index):             # <<<<<<<<<<<<<<
15810  *         if index is Ellipsis:
15811  *             return self
15812  */
15813 
15814 /* Python wrapper */
15815 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)15816 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
15817   PyObject *__pyx_r = 0;
15818   __Pyx_RefNannyDeclarations
15819   __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
15820   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
15821 
15822   /* function exit code */
15823   __Pyx_RefNannyFinishContext();
15824   return __pyx_r;
15825 }
15826 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_index)15827 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
15828   PyObject *__pyx_v_have_slices = NULL;
15829   PyObject *__pyx_v_indices = NULL;
15830   char *__pyx_v_itemp;
15831   PyObject *__pyx_r = NULL;
15832   __Pyx_RefNannyDeclarations
15833   int __pyx_t_1;
15834   int __pyx_t_2;
15835   PyObject *__pyx_t_3 = NULL;
15836   PyObject *__pyx_t_4 = NULL;
15837   PyObject *__pyx_t_5 = NULL;
15838   char *__pyx_t_6;
15839   __Pyx_RefNannySetupContext("__getitem__", 0);
15840 
15841   /* "View.MemoryView":400
15842  *
15843  *     def __getitem__(memoryview self, object index):
15844  *         if index is Ellipsis:             # <<<<<<<<<<<<<<
15845  *             return self
15846  *
15847  */
15848   __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
15849   __pyx_t_2 = (__pyx_t_1 != 0);
15850   if (__pyx_t_2) {
15851 
15852     /* "View.MemoryView":401
15853  *     def __getitem__(memoryview self, object index):
15854  *         if index is Ellipsis:
15855  *             return self             # <<<<<<<<<<<<<<
15856  *
15857  *         have_slices, indices = _unellipsify(index, self.view.ndim)
15858  */
15859     __Pyx_XDECREF(__pyx_r);
15860     __Pyx_INCREF(((PyObject *)__pyx_v_self));
15861     __pyx_r = ((PyObject *)__pyx_v_self);
15862     goto __pyx_L0;
15863 
15864     /* "View.MemoryView":400
15865  *
15866  *     def __getitem__(memoryview self, object index):
15867  *         if index is Ellipsis:             # <<<<<<<<<<<<<<
15868  *             return self
15869  *
15870  */
15871   }
15872 
15873   /* "View.MemoryView":403
15874  *             return self
15875  *
15876  *         have_slices, indices = _unellipsify(index, self.view.ndim)             # <<<<<<<<<<<<<<
15877  *
15878  *         cdef char *itemp
15879  */
15880   __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 403, __pyx_L1_error)
15881   __Pyx_GOTREF(__pyx_t_3);
15882   if (likely(__pyx_t_3 != Py_None)) {
15883     PyObject* sequence = __pyx_t_3;
15884     Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
15885     if (unlikely(size != 2)) {
15886       if (size > 2) __Pyx_RaiseTooManyValuesError(2);
15887       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
15888       __PYX_ERR(4, 403, __pyx_L1_error)
15889     }
15890     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15891     __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
15892     __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
15893     __Pyx_INCREF(__pyx_t_4);
15894     __Pyx_INCREF(__pyx_t_5);
15895     #else
15896     __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 403, __pyx_L1_error)
15897     __Pyx_GOTREF(__pyx_t_4);
15898     __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 403, __pyx_L1_error)
15899     __Pyx_GOTREF(__pyx_t_5);
15900     #endif
15901     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15902   } else {
15903     __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(4, 403, __pyx_L1_error)
15904   }
15905   __pyx_v_have_slices = __pyx_t_4;
15906   __pyx_t_4 = 0;
15907   __pyx_v_indices = __pyx_t_5;
15908   __pyx_t_5 = 0;
15909 
15910   /* "View.MemoryView":406
15911  *
15912  *         cdef char *itemp
15913  *         if have_slices:             # <<<<<<<<<<<<<<
15914  *             return memview_slice(self, indices)
15915  *         else:
15916  */
15917   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(4, 406, __pyx_L1_error)
15918   if (__pyx_t_2) {
15919 
15920     /* "View.MemoryView":407
15921  *         cdef char *itemp
15922  *         if have_slices:
15923  *             return memview_slice(self, indices)             # <<<<<<<<<<<<<<
15924  *         else:
15925  *             itemp = self.get_item_pointer(indices)
15926  */
15927     __Pyx_XDECREF(__pyx_r);
15928     __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 407, __pyx_L1_error)
15929     __Pyx_GOTREF(__pyx_t_3);
15930     __pyx_r = __pyx_t_3;
15931     __pyx_t_3 = 0;
15932     goto __pyx_L0;
15933 
15934     /* "View.MemoryView":406
15935  *
15936  *         cdef char *itemp
15937  *         if have_slices:             # <<<<<<<<<<<<<<
15938  *             return memview_slice(self, indices)
15939  *         else:
15940  */
15941   }
15942 
15943   /* "View.MemoryView":409
15944  *             return memview_slice(self, indices)
15945  *         else:
15946  *             itemp = self.get_item_pointer(indices)             # <<<<<<<<<<<<<<
15947  *             return self.convert_item_to_object(itemp)
15948  *
15949  */
15950   /*else*/ {
15951     __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(4, 409, __pyx_L1_error)
15952     __pyx_v_itemp = __pyx_t_6;
15953 
15954     /* "View.MemoryView":410
15955  *         else:
15956  *             itemp = self.get_item_pointer(indices)
15957  *             return self.convert_item_to_object(itemp)             # <<<<<<<<<<<<<<
15958  *
15959  *     def __setitem__(memoryview self, object index, object value):
15960  */
15961     __Pyx_XDECREF(__pyx_r);
15962     __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(4, 410, __pyx_L1_error)
15963     __Pyx_GOTREF(__pyx_t_3);
15964     __pyx_r = __pyx_t_3;
15965     __pyx_t_3 = 0;
15966     goto __pyx_L0;
15967   }
15968 
15969   /* "View.MemoryView":399
15970  *
15971  *
15972  *     def __getitem__(memoryview self, object index):             # <<<<<<<<<<<<<<
15973  *         if index is Ellipsis:
15974  *             return self
15975  */
15976 
15977   /* function exit code */
15978   __pyx_L1_error:;
15979   __Pyx_XDECREF(__pyx_t_3);
15980   __Pyx_XDECREF(__pyx_t_4);
15981   __Pyx_XDECREF(__pyx_t_5);
15982   __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15983   __pyx_r = NULL;
15984   __pyx_L0:;
15985   __Pyx_XDECREF(__pyx_v_have_slices);
15986   __Pyx_XDECREF(__pyx_v_indices);
15987   __Pyx_XGIVEREF(__pyx_r);
15988   __Pyx_RefNannyFinishContext();
15989   return __pyx_r;
15990 }
15991 
15992 /* "View.MemoryView":412
15993  *             return self.convert_item_to_object(itemp)
15994  *
15995  *     def __setitem__(memoryview self, object index, object value):             # <<<<<<<<<<<<<<
15996  *         if self.view.readonly:
15997  *             raise TypeError("Cannot assign to read-only memoryview")
15998  */
15999 
16000 /* Python wrapper */
16001 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)16002 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
16003   int __pyx_r;
16004   __Pyx_RefNannyDeclarations
16005   __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
16006   __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));
16007 
16008   /* function exit code */
16009   __Pyx_RefNannyFinishContext();
16010   return __pyx_r;
16011 }
16012 
__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)16013 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) {
16014   PyObject *__pyx_v_have_slices = NULL;
16015   PyObject *__pyx_v_obj = NULL;
16016   int __pyx_r;
16017   __Pyx_RefNannyDeclarations
16018   int __pyx_t_1;
16019   PyObject *__pyx_t_2 = NULL;
16020   PyObject *__pyx_t_3 = NULL;
16021   PyObject *__pyx_t_4 = NULL;
16022   __Pyx_RefNannySetupContext("__setitem__", 0);
16023   __Pyx_INCREF(__pyx_v_index);
16024 
16025   /* "View.MemoryView":413
16026  *
16027  *     def __setitem__(memoryview self, object index, object value):
16028  *         if self.view.readonly:             # <<<<<<<<<<<<<<
16029  *             raise TypeError("Cannot assign to read-only memoryview")
16030  *
16031  */
16032   __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
16033   if (unlikely(__pyx_t_1)) {
16034 
16035     /* "View.MemoryView":414
16036  *     def __setitem__(memoryview self, object index, object value):
16037  *         if self.view.readonly:
16038  *             raise TypeError("Cannot assign to read-only memoryview")             # <<<<<<<<<<<<<<
16039  *
16040  *         have_slices, index = _unellipsify(index, self.view.ndim)
16041  */
16042     __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 414, __pyx_L1_error)
16043     __Pyx_GOTREF(__pyx_t_2);
16044     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
16045     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16046     __PYX_ERR(4, 414, __pyx_L1_error)
16047 
16048     /* "View.MemoryView":413
16049  *
16050  *     def __setitem__(memoryview self, object index, object value):
16051  *         if self.view.readonly:             # <<<<<<<<<<<<<<
16052  *             raise TypeError("Cannot assign to read-only memoryview")
16053  *
16054  */
16055   }
16056 
16057   /* "View.MemoryView":416
16058  *             raise TypeError("Cannot assign to read-only memoryview")
16059  *
16060  *         have_slices, index = _unellipsify(index, self.view.ndim)             # <<<<<<<<<<<<<<
16061  *
16062  *         if have_slices:
16063  */
16064   __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 416, __pyx_L1_error)
16065   __Pyx_GOTREF(__pyx_t_2);
16066   if (likely(__pyx_t_2 != Py_None)) {
16067     PyObject* sequence = __pyx_t_2;
16068     Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
16069     if (unlikely(size != 2)) {
16070       if (size > 2) __Pyx_RaiseTooManyValuesError(2);
16071       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
16072       __PYX_ERR(4, 416, __pyx_L1_error)
16073     }
16074     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16075     __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
16076     __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
16077     __Pyx_INCREF(__pyx_t_3);
16078     __Pyx_INCREF(__pyx_t_4);
16079     #else
16080     __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 416, __pyx_L1_error)
16081     __Pyx_GOTREF(__pyx_t_3);
16082     __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 416, __pyx_L1_error)
16083     __Pyx_GOTREF(__pyx_t_4);
16084     #endif
16085     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16086   } else {
16087     __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(4, 416, __pyx_L1_error)
16088   }
16089   __pyx_v_have_slices = __pyx_t_3;
16090   __pyx_t_3 = 0;
16091   __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
16092   __pyx_t_4 = 0;
16093 
16094   /* "View.MemoryView":418
16095  *         have_slices, index = _unellipsify(index, self.view.ndim)
16096  *
16097  *         if have_slices:             # <<<<<<<<<<<<<<
16098  *             obj = self.is_slice(value)
16099  *             if obj:
16100  */
16101   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 418, __pyx_L1_error)
16102   if (__pyx_t_1) {
16103 
16104     /* "View.MemoryView":419
16105  *
16106  *         if have_slices:
16107  *             obj = self.is_slice(value)             # <<<<<<<<<<<<<<
16108  *             if obj:
16109  *                 self.setitem_slice_assignment(self[index], obj)
16110  */
16111     __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(4, 419, __pyx_L1_error)
16112     __Pyx_GOTREF(__pyx_t_2);
16113     __pyx_v_obj = __pyx_t_2;
16114     __pyx_t_2 = 0;
16115 
16116     /* "View.MemoryView":420
16117  *         if have_slices:
16118  *             obj = self.is_slice(value)
16119  *             if obj:             # <<<<<<<<<<<<<<
16120  *                 self.setitem_slice_assignment(self[index], obj)
16121  *             else:
16122  */
16123     __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 420, __pyx_L1_error)
16124     if (__pyx_t_1) {
16125 
16126       /* "View.MemoryView":421
16127  *             obj = self.is_slice(value)
16128  *             if obj:
16129  *                 self.setitem_slice_assignment(self[index], obj)             # <<<<<<<<<<<<<<
16130  *             else:
16131  *                 self.setitem_slice_assign_scalar(self[index], value)
16132  */
16133       __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 421, __pyx_L1_error)
16134       __Pyx_GOTREF(__pyx_t_2);
16135       __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(4, 421, __pyx_L1_error)
16136       __Pyx_GOTREF(__pyx_t_4);
16137       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16138       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16139 
16140       /* "View.MemoryView":420
16141  *         if have_slices:
16142  *             obj = self.is_slice(value)
16143  *             if obj:             # <<<<<<<<<<<<<<
16144  *                 self.setitem_slice_assignment(self[index], obj)
16145  *             else:
16146  */
16147       goto __pyx_L5;
16148     }
16149 
16150     /* "View.MemoryView":423
16151  *                 self.setitem_slice_assignment(self[index], obj)
16152  *             else:
16153  *                 self.setitem_slice_assign_scalar(self[index], value)             # <<<<<<<<<<<<<<
16154  *         else:
16155  *             self.setitem_indexed(index, value)
16156  */
16157     /*else*/ {
16158       __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 423, __pyx_L1_error)
16159       __Pyx_GOTREF(__pyx_t_4);
16160       if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(4, 423, __pyx_L1_error)
16161       __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(4, 423, __pyx_L1_error)
16162       __Pyx_GOTREF(__pyx_t_2);
16163       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16164       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16165     }
16166     __pyx_L5:;
16167 
16168     /* "View.MemoryView":418
16169  *         have_slices, index = _unellipsify(index, self.view.ndim)
16170  *
16171  *         if have_slices:             # <<<<<<<<<<<<<<
16172  *             obj = self.is_slice(value)
16173  *             if obj:
16174  */
16175     goto __pyx_L4;
16176   }
16177 
16178   /* "View.MemoryView":425
16179  *                 self.setitem_slice_assign_scalar(self[index], value)
16180  *         else:
16181  *             self.setitem_indexed(index, value)             # <<<<<<<<<<<<<<
16182  *
16183  *     cdef is_slice(self, obj):
16184  */
16185   /*else*/ {
16186     __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(4, 425, __pyx_L1_error)
16187     __Pyx_GOTREF(__pyx_t_2);
16188     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16189   }
16190   __pyx_L4:;
16191 
16192   /* "View.MemoryView":412
16193  *             return self.convert_item_to_object(itemp)
16194  *
16195  *     def __setitem__(memoryview self, object index, object value):             # <<<<<<<<<<<<<<
16196  *         if self.view.readonly:
16197  *             raise TypeError("Cannot assign to read-only memoryview")
16198  */
16199 
16200   /* function exit code */
16201   __pyx_r = 0;
16202   goto __pyx_L0;
16203   __pyx_L1_error:;
16204   __Pyx_XDECREF(__pyx_t_2);
16205   __Pyx_XDECREF(__pyx_t_3);
16206   __Pyx_XDECREF(__pyx_t_4);
16207   __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16208   __pyx_r = -1;
16209   __pyx_L0:;
16210   __Pyx_XDECREF(__pyx_v_have_slices);
16211   __Pyx_XDECREF(__pyx_v_obj);
16212   __Pyx_XDECREF(__pyx_v_index);
16213   __Pyx_RefNannyFinishContext();
16214   return __pyx_r;
16215 }
16216 
16217 /* "View.MemoryView":427
16218  *             self.setitem_indexed(index, value)
16219  *
16220  *     cdef is_slice(self, obj):             # <<<<<<<<<<<<<<
16221  *         if not isinstance(obj, memoryview):
16222  *             try:
16223  */
16224 
__pyx_memoryview_is_slice(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_obj)16225 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
16226   PyObject *__pyx_r = NULL;
16227   __Pyx_RefNannyDeclarations
16228   int __pyx_t_1;
16229   int __pyx_t_2;
16230   PyObject *__pyx_t_3 = NULL;
16231   PyObject *__pyx_t_4 = NULL;
16232   PyObject *__pyx_t_5 = NULL;
16233   PyObject *__pyx_t_6 = NULL;
16234   PyObject *__pyx_t_7 = NULL;
16235   PyObject *__pyx_t_8 = NULL;
16236   int __pyx_t_9;
16237   __Pyx_RefNannySetupContext("is_slice", 0);
16238   __Pyx_INCREF(__pyx_v_obj);
16239 
16240   /* "View.MemoryView":428
16241  *
16242  *     cdef is_slice(self, obj):
16243  *         if not isinstance(obj, memoryview):             # <<<<<<<<<<<<<<
16244  *             try:
16245  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
16246  */
16247   __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
16248   __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
16249   if (__pyx_t_2) {
16250 
16251     /* "View.MemoryView":429
16252  *     cdef is_slice(self, obj):
16253  *         if not isinstance(obj, memoryview):
16254  *             try:             # <<<<<<<<<<<<<<
16255  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
16256  *                                  self.dtype_is_object)
16257  */
16258     {
16259       __Pyx_PyThreadState_declare
16260       __Pyx_PyThreadState_assign
16261       __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
16262       __Pyx_XGOTREF(__pyx_t_3);
16263       __Pyx_XGOTREF(__pyx_t_4);
16264       __Pyx_XGOTREF(__pyx_t_5);
16265       /*try:*/ {
16266 
16267         /* "View.MemoryView":430
16268  *         if not isinstance(obj, memoryview):
16269  *             try:
16270  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,             # <<<<<<<<<<<<<<
16271  *                                  self.dtype_is_object)
16272  *             except TypeError:
16273  */
16274         __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 430, __pyx_L4_error)
16275         __Pyx_GOTREF(__pyx_t_6);
16276 
16277         /* "View.MemoryView":431
16278  *             try:
16279  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
16280  *                                  self.dtype_is_object)             # <<<<<<<<<<<<<<
16281  *             except TypeError:
16282  *                 return None
16283  */
16284         __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 431, __pyx_L4_error)
16285         __Pyx_GOTREF(__pyx_t_7);
16286 
16287         /* "View.MemoryView":430
16288  *         if not isinstance(obj, memoryview):
16289  *             try:
16290  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,             # <<<<<<<<<<<<<<
16291  *                                  self.dtype_is_object)
16292  *             except TypeError:
16293  */
16294         __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 430, __pyx_L4_error)
16295         __Pyx_GOTREF(__pyx_t_8);
16296         __Pyx_INCREF(__pyx_v_obj);
16297         __Pyx_GIVEREF(__pyx_v_obj);
16298         PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
16299         __Pyx_GIVEREF(__pyx_t_6);
16300         PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
16301         __Pyx_GIVEREF(__pyx_t_7);
16302         PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
16303         __pyx_t_6 = 0;
16304         __pyx_t_7 = 0;
16305         __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 430, __pyx_L4_error)
16306         __Pyx_GOTREF(__pyx_t_7);
16307         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
16308         __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
16309         __pyx_t_7 = 0;
16310 
16311         /* "View.MemoryView":429
16312  *     cdef is_slice(self, obj):
16313  *         if not isinstance(obj, memoryview):
16314  *             try:             # <<<<<<<<<<<<<<
16315  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
16316  *                                  self.dtype_is_object)
16317  */
16318       }
16319       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16320       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
16321       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16322       goto __pyx_L9_try_end;
16323       __pyx_L4_error:;
16324       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
16325       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
16326       __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
16327 
16328       /* "View.MemoryView":432
16329  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
16330  *                                  self.dtype_is_object)
16331  *             except TypeError:             # <<<<<<<<<<<<<<
16332  *                 return None
16333  *
16334  */
16335       __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
16336       if (__pyx_t_9) {
16337         __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16338         if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(4, 432, __pyx_L6_except_error)
16339         __Pyx_GOTREF(__pyx_t_7);
16340         __Pyx_GOTREF(__pyx_t_8);
16341         __Pyx_GOTREF(__pyx_t_6);
16342 
16343         /* "View.MemoryView":433
16344  *                                  self.dtype_is_object)
16345  *             except TypeError:
16346  *                 return None             # <<<<<<<<<<<<<<
16347  *
16348  *         return obj
16349  */
16350         __Pyx_XDECREF(__pyx_r);
16351         __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16352         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16353         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16354         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
16355         goto __pyx_L7_except_return;
16356       }
16357       goto __pyx_L6_except_error;
16358       __pyx_L6_except_error:;
16359 
16360       /* "View.MemoryView":429
16361  *     cdef is_slice(self, obj):
16362  *         if not isinstance(obj, memoryview):
16363  *             try:             # <<<<<<<<<<<<<<
16364  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
16365  *                                  self.dtype_is_object)
16366  */
16367       __Pyx_XGIVEREF(__pyx_t_3);
16368       __Pyx_XGIVEREF(__pyx_t_4);
16369       __Pyx_XGIVEREF(__pyx_t_5);
16370       __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
16371       goto __pyx_L1_error;
16372       __pyx_L7_except_return:;
16373       __Pyx_XGIVEREF(__pyx_t_3);
16374       __Pyx_XGIVEREF(__pyx_t_4);
16375       __Pyx_XGIVEREF(__pyx_t_5);
16376       __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
16377       goto __pyx_L0;
16378       __pyx_L9_try_end:;
16379     }
16380 
16381     /* "View.MemoryView":428
16382  *
16383  *     cdef is_slice(self, obj):
16384  *         if not isinstance(obj, memoryview):             # <<<<<<<<<<<<<<
16385  *             try:
16386  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
16387  */
16388   }
16389 
16390   /* "View.MemoryView":435
16391  *                 return None
16392  *
16393  *         return obj             # <<<<<<<<<<<<<<
16394  *
16395  *     cdef setitem_slice_assignment(self, dst, src):
16396  */
16397   __Pyx_XDECREF(__pyx_r);
16398   __Pyx_INCREF(__pyx_v_obj);
16399   __pyx_r = __pyx_v_obj;
16400   goto __pyx_L0;
16401 
16402   /* "View.MemoryView":427
16403  *             self.setitem_indexed(index, value)
16404  *
16405  *     cdef is_slice(self, obj):             # <<<<<<<<<<<<<<
16406  *         if not isinstance(obj, memoryview):
16407  *             try:
16408  */
16409 
16410   /* function exit code */
16411   __pyx_L1_error:;
16412   __Pyx_XDECREF(__pyx_t_6);
16413   __Pyx_XDECREF(__pyx_t_7);
16414   __Pyx_XDECREF(__pyx_t_8);
16415   __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16416   __pyx_r = 0;
16417   __pyx_L0:;
16418   __Pyx_XDECREF(__pyx_v_obj);
16419   __Pyx_XGIVEREF(__pyx_r);
16420   __Pyx_RefNannyFinishContext();
16421   return __pyx_r;
16422 }
16423 
16424 /* "View.MemoryView":437
16425  *         return obj
16426  *
16427  *     cdef setitem_slice_assignment(self, dst, src):             # <<<<<<<<<<<<<<
16428  *         cdef __Pyx_memviewslice dst_slice
16429  *         cdef __Pyx_memviewslice src_slice
16430  */
16431 
__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_dst,PyObject * __pyx_v_src)16432 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
16433   __Pyx_memviewslice __pyx_v_dst_slice;
16434   __Pyx_memviewslice __pyx_v_src_slice;
16435   PyObject *__pyx_r = NULL;
16436   __Pyx_RefNannyDeclarations
16437   PyObject *__pyx_t_1 = NULL;
16438   int __pyx_t_2;
16439   int __pyx_t_3;
16440   int __pyx_t_4;
16441   __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
16442 
16443   /* "View.MemoryView":441
16444  *         cdef __Pyx_memviewslice src_slice
16445  *
16446  *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],             # <<<<<<<<<<<<<<
16447  *                                  get_slice_from_memview(dst, &dst_slice)[0],
16448  *                                  src.ndim, dst.ndim, self.dtype_is_object)
16449  */
16450   if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(4, 441, __pyx_L1_error)
16451 
16452   /* "View.MemoryView":442
16453  *
16454  *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
16455  *                                  get_slice_from_memview(dst, &dst_slice)[0],             # <<<<<<<<<<<<<<
16456  *                                  src.ndim, dst.ndim, self.dtype_is_object)
16457  *
16458  */
16459   if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(4, 442, __pyx_L1_error)
16460 
16461   /* "View.MemoryView":443
16462  *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
16463  *                                  get_slice_from_memview(dst, &dst_slice)[0],
16464  *                                  src.ndim, dst.ndim, self.dtype_is_object)             # <<<<<<<<<<<<<<
16465  *
16466  *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):
16467  */
16468   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 443, __pyx_L1_error)
16469   __Pyx_GOTREF(__pyx_t_1);
16470   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 443, __pyx_L1_error)
16471   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16472   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 443, __pyx_L1_error)
16473   __Pyx_GOTREF(__pyx_t_1);
16474   __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 443, __pyx_L1_error)
16475   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16476 
16477   /* "View.MemoryView":441
16478  *         cdef __Pyx_memviewslice src_slice
16479  *
16480  *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],             # <<<<<<<<<<<<<<
16481  *                                  get_slice_from_memview(dst, &dst_slice)[0],
16482  *                                  src.ndim, dst.ndim, self.dtype_is_object)
16483  */
16484   __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(4, 441, __pyx_L1_error)
16485 
16486   /* "View.MemoryView":437
16487  *         return obj
16488  *
16489  *     cdef setitem_slice_assignment(self, dst, src):             # <<<<<<<<<<<<<<
16490  *         cdef __Pyx_memviewslice dst_slice
16491  *         cdef __Pyx_memviewslice src_slice
16492  */
16493 
16494   /* function exit code */
16495   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16496   goto __pyx_L0;
16497   __pyx_L1_error:;
16498   __Pyx_XDECREF(__pyx_t_1);
16499   __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
16500   __pyx_r = 0;
16501   __pyx_L0:;
16502   __Pyx_XGIVEREF(__pyx_r);
16503   __Pyx_RefNannyFinishContext();
16504   return __pyx_r;
16505 }
16506 
16507 /* "View.MemoryView":445
16508  *                                  src.ndim, dst.ndim, self.dtype_is_object)
16509  *
16510  *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):             # <<<<<<<<<<<<<<
16511  *         cdef int array[128]
16512  *         cdef void *tmp = NULL
16513  */
16514 
__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj * __pyx_v_self,struct __pyx_memoryview_obj * __pyx_v_dst,PyObject * __pyx_v_value)16515 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) {
16516   int __pyx_v_array[0x80];
16517   void *__pyx_v_tmp;
16518   void *__pyx_v_item;
16519   __Pyx_memviewslice *__pyx_v_dst_slice;
16520   __Pyx_memviewslice __pyx_v_tmp_slice;
16521   PyObject *__pyx_r = NULL;
16522   __Pyx_RefNannyDeclarations
16523   int __pyx_t_1;
16524   PyObject *__pyx_t_2 = NULL;
16525   int __pyx_t_3;
16526   int __pyx_t_4;
16527   char const *__pyx_t_5;
16528   PyObject *__pyx_t_6 = NULL;
16529   PyObject *__pyx_t_7 = NULL;
16530   PyObject *__pyx_t_8 = NULL;
16531   PyObject *__pyx_t_9 = NULL;
16532   PyObject *__pyx_t_10 = NULL;
16533   PyObject *__pyx_t_11 = NULL;
16534   __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
16535 
16536   /* "View.MemoryView":447
16537  *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):
16538  *         cdef int array[128]
16539  *         cdef void *tmp = NULL             # <<<<<<<<<<<<<<
16540  *         cdef void *item
16541  *
16542  */
16543   __pyx_v_tmp = NULL;
16544 
16545   /* "View.MemoryView":452
16546  *         cdef __Pyx_memviewslice *dst_slice
16547  *         cdef __Pyx_memviewslice tmp_slice
16548  *         dst_slice = get_slice_from_memview(dst, &tmp_slice)             # <<<<<<<<<<<<<<
16549  *
16550  *         if <size_t>self.view.itemsize > sizeof(array):
16551  */
16552   __pyx_v_dst_slice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));
16553 
16554   /* "View.MemoryView":454
16555  *         dst_slice = get_slice_from_memview(dst, &tmp_slice)
16556  *
16557  *         if <size_t>self.view.itemsize > sizeof(array):             # <<<<<<<<<<<<<<
16558  *             tmp = PyMem_Malloc(self.view.itemsize)
16559  *             if tmp == NULL:
16560  */
16561   __pyx_t_1 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
16562   if (__pyx_t_1) {
16563 
16564     /* "View.MemoryView":455
16565  *
16566  *         if <size_t>self.view.itemsize > sizeof(array):
16567  *             tmp = PyMem_Malloc(self.view.itemsize)             # <<<<<<<<<<<<<<
16568  *             if tmp == NULL:
16569  *                 raise MemoryError
16570  */
16571     __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
16572 
16573     /* "View.MemoryView":456
16574  *         if <size_t>self.view.itemsize > sizeof(array):
16575  *             tmp = PyMem_Malloc(self.view.itemsize)
16576  *             if tmp == NULL:             # <<<<<<<<<<<<<<
16577  *                 raise MemoryError
16578  *             item = tmp
16579  */
16580     __pyx_t_1 = ((__pyx_v_tmp == NULL) != 0);
16581     if (unlikely(__pyx_t_1)) {
16582 
16583       /* "View.MemoryView":457
16584  *             tmp = PyMem_Malloc(self.view.itemsize)
16585  *             if tmp == NULL:
16586  *                 raise MemoryError             # <<<<<<<<<<<<<<
16587  *             item = tmp
16588  *         else:
16589  */
16590       PyErr_NoMemory(); __PYX_ERR(4, 457, __pyx_L1_error)
16591 
16592       /* "View.MemoryView":456
16593  *         if <size_t>self.view.itemsize > sizeof(array):
16594  *             tmp = PyMem_Malloc(self.view.itemsize)
16595  *             if tmp == NULL:             # <<<<<<<<<<<<<<
16596  *                 raise MemoryError
16597  *             item = tmp
16598  */
16599     }
16600 
16601     /* "View.MemoryView":458
16602  *             if tmp == NULL:
16603  *                 raise MemoryError
16604  *             item = tmp             # <<<<<<<<<<<<<<
16605  *         else:
16606  *             item = <void *> array
16607  */
16608     __pyx_v_item = __pyx_v_tmp;
16609 
16610     /* "View.MemoryView":454
16611  *         dst_slice = get_slice_from_memview(dst, &tmp_slice)
16612  *
16613  *         if <size_t>self.view.itemsize > sizeof(array):             # <<<<<<<<<<<<<<
16614  *             tmp = PyMem_Malloc(self.view.itemsize)
16615  *             if tmp == NULL:
16616  */
16617     goto __pyx_L3;
16618   }
16619 
16620   /* "View.MemoryView":460
16621  *             item = tmp
16622  *         else:
16623  *             item = <void *> array             # <<<<<<<<<<<<<<
16624  *
16625  *         try:
16626  */
16627   /*else*/ {
16628     __pyx_v_item = ((void *)__pyx_v_array);
16629   }
16630   __pyx_L3:;
16631 
16632   /* "View.MemoryView":462
16633  *             item = <void *> array
16634  *
16635  *         try:             # <<<<<<<<<<<<<<
16636  *             if self.dtype_is_object:
16637  *                 (<PyObject **> item)[0] = <PyObject *> value
16638  */
16639   /*try:*/ {
16640 
16641     /* "View.MemoryView":463
16642  *
16643  *         try:
16644  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
16645  *                 (<PyObject **> item)[0] = <PyObject *> value
16646  *             else:
16647  */
16648     __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
16649     if (__pyx_t_1) {
16650 
16651       /* "View.MemoryView":464
16652  *         try:
16653  *             if self.dtype_is_object:
16654  *                 (<PyObject **> item)[0] = <PyObject *> value             # <<<<<<<<<<<<<<
16655  *             else:
16656  *                 self.assign_item_from_object(<char *> item, value)
16657  */
16658       (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
16659 
16660       /* "View.MemoryView":463
16661  *
16662  *         try:
16663  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
16664  *                 (<PyObject **> item)[0] = <PyObject *> value
16665  *             else:
16666  */
16667       goto __pyx_L8;
16668     }
16669 
16670     /* "View.MemoryView":466
16671  *                 (<PyObject **> item)[0] = <PyObject *> value
16672  *             else:
16673  *                 self.assign_item_from_object(<char *> item, value)             # <<<<<<<<<<<<<<
16674  *
16675  *
16676  */
16677     /*else*/ {
16678       __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(4, 466, __pyx_L6_error)
16679       __Pyx_GOTREF(__pyx_t_2);
16680       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16681     }
16682     __pyx_L8:;
16683 
16684     /* "View.MemoryView":470
16685  *
16686  *
16687  *             if self.view.suboffsets != NULL:             # <<<<<<<<<<<<<<
16688  *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
16689  *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
16690  */
16691     __pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
16692     if (__pyx_t_1) {
16693 
16694       /* "View.MemoryView":471
16695  *
16696  *             if self.view.suboffsets != NULL:
16697  *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)             # <<<<<<<<<<<<<<
16698  *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
16699  *                                 item, self.dtype_is_object)
16700  */
16701       __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 471, __pyx_L6_error)
16702       __Pyx_GOTREF(__pyx_t_2);
16703       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16704 
16705       /* "View.MemoryView":470
16706  *
16707  *
16708  *             if self.view.suboffsets != NULL:             # <<<<<<<<<<<<<<
16709  *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
16710  *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
16711  */
16712     }
16713 
16714     /* "View.MemoryView":472
16715  *             if self.view.suboffsets != NULL:
16716  *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
16717  *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,             # <<<<<<<<<<<<<<
16718  *                                 item, self.dtype_is_object)
16719  *         finally:
16720  */
16721     __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);
16722   }
16723 
16724   /* "View.MemoryView":475
16725  *                                 item, self.dtype_is_object)
16726  *         finally:
16727  *             PyMem_Free(tmp)             # <<<<<<<<<<<<<<
16728  *
16729  *     cdef setitem_indexed(self, index, value):
16730  */
16731   /*finally:*/ {
16732     /*normal exit:*/{
16733       PyMem_Free(__pyx_v_tmp);
16734       goto __pyx_L7;
16735     }
16736     __pyx_L6_error:;
16737     /*exception exit:*/{
16738       __Pyx_PyThreadState_declare
16739       __Pyx_PyThreadState_assign
16740       __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
16741       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
16742       if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
16743       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);
16744       __Pyx_XGOTREF(__pyx_t_6);
16745       __Pyx_XGOTREF(__pyx_t_7);
16746       __Pyx_XGOTREF(__pyx_t_8);
16747       __Pyx_XGOTREF(__pyx_t_9);
16748       __Pyx_XGOTREF(__pyx_t_10);
16749       __Pyx_XGOTREF(__pyx_t_11);
16750       __pyx_t_3 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename;
16751       {
16752         PyMem_Free(__pyx_v_tmp);
16753       }
16754       if (PY_MAJOR_VERSION >= 3) {
16755         __Pyx_XGIVEREF(__pyx_t_9);
16756         __Pyx_XGIVEREF(__pyx_t_10);
16757         __Pyx_XGIVEREF(__pyx_t_11);
16758         __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
16759       }
16760       __Pyx_XGIVEREF(__pyx_t_6);
16761       __Pyx_XGIVEREF(__pyx_t_7);
16762       __Pyx_XGIVEREF(__pyx_t_8);
16763       __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
16764       __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
16765       __pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5;
16766       goto __pyx_L1_error;
16767     }
16768     __pyx_L7:;
16769   }
16770 
16771   /* "View.MemoryView":445
16772  *                                  src.ndim, dst.ndim, self.dtype_is_object)
16773  *
16774  *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):             # <<<<<<<<<<<<<<
16775  *         cdef int array[128]
16776  *         cdef void *tmp = NULL
16777  */
16778 
16779   /* function exit code */
16780   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16781   goto __pyx_L0;
16782   __pyx_L1_error:;
16783   __Pyx_XDECREF(__pyx_t_2);
16784   __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
16785   __pyx_r = 0;
16786   __pyx_L0:;
16787   __Pyx_XGIVEREF(__pyx_r);
16788   __Pyx_RefNannyFinishContext();
16789   return __pyx_r;
16790 }
16791 
16792 /* "View.MemoryView":477
16793  *             PyMem_Free(tmp)
16794  *
16795  *     cdef setitem_indexed(self, index, value):             # <<<<<<<<<<<<<<
16796  *         cdef char *itemp = self.get_item_pointer(index)
16797  *         self.assign_item_from_object(itemp, value)
16798  */
16799 
__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_index,PyObject * __pyx_v_value)16800 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
16801   char *__pyx_v_itemp;
16802   PyObject *__pyx_r = NULL;
16803   __Pyx_RefNannyDeclarations
16804   char *__pyx_t_1;
16805   PyObject *__pyx_t_2 = NULL;
16806   __Pyx_RefNannySetupContext("setitem_indexed", 0);
16807 
16808   /* "View.MemoryView":478
16809  *
16810  *     cdef setitem_indexed(self, index, value):
16811  *         cdef char *itemp = self.get_item_pointer(index)             # <<<<<<<<<<<<<<
16812  *         self.assign_item_from_object(itemp, value)
16813  *
16814  */
16815   __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(4, 478, __pyx_L1_error)
16816   __pyx_v_itemp = __pyx_t_1;
16817 
16818   /* "View.MemoryView":479
16819  *     cdef setitem_indexed(self, index, value):
16820  *         cdef char *itemp = self.get_item_pointer(index)
16821  *         self.assign_item_from_object(itemp, value)             # <<<<<<<<<<<<<<
16822  *
16823  *     cdef convert_item_to_object(self, char *itemp):
16824  */
16825   __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(4, 479, __pyx_L1_error)
16826   __Pyx_GOTREF(__pyx_t_2);
16827   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16828 
16829   /* "View.MemoryView":477
16830  *             PyMem_Free(tmp)
16831  *
16832  *     cdef setitem_indexed(self, index, value):             # <<<<<<<<<<<<<<
16833  *         cdef char *itemp = self.get_item_pointer(index)
16834  *         self.assign_item_from_object(itemp, value)
16835  */
16836 
16837   /* function exit code */
16838   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16839   goto __pyx_L0;
16840   __pyx_L1_error:;
16841   __Pyx_XDECREF(__pyx_t_2);
16842   __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
16843   __pyx_r = 0;
16844   __pyx_L0:;
16845   __Pyx_XGIVEREF(__pyx_r);
16846   __Pyx_RefNannyFinishContext();
16847   return __pyx_r;
16848 }
16849 
16850 /* "View.MemoryView":481
16851  *         self.assign_item_from_object(itemp, value)
16852  *
16853  *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
16854  *         """Only used if instantiated manually by the user, or if Cython doesn't
16855  *         know how to convert the type"""
16856  */
16857 
__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj * __pyx_v_self,char * __pyx_v_itemp)16858 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
16859   PyObject *__pyx_v_struct = NULL;
16860   PyObject *__pyx_v_bytesitem = 0;
16861   PyObject *__pyx_v_result = NULL;
16862   PyObject *__pyx_r = NULL;
16863   __Pyx_RefNannyDeclarations
16864   PyObject *__pyx_t_1 = NULL;
16865   PyObject *__pyx_t_2 = NULL;
16866   PyObject *__pyx_t_3 = NULL;
16867   PyObject *__pyx_t_4 = NULL;
16868   PyObject *__pyx_t_5 = NULL;
16869   PyObject *__pyx_t_6 = NULL;
16870   PyObject *__pyx_t_7 = NULL;
16871   int __pyx_t_8;
16872   PyObject *__pyx_t_9 = NULL;
16873   size_t __pyx_t_10;
16874   int __pyx_t_11;
16875   __Pyx_RefNannySetupContext("convert_item_to_object", 0);
16876 
16877   /* "View.MemoryView":484
16878  *         """Only used if instantiated manually by the user, or if Cython doesn't
16879  *         know how to convert the type"""
16880  *         import struct             # <<<<<<<<<<<<<<
16881  *         cdef bytes bytesitem
16882  *
16883  */
16884   __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 484, __pyx_L1_error)
16885   __Pyx_GOTREF(__pyx_t_1);
16886   __pyx_v_struct = __pyx_t_1;
16887   __pyx_t_1 = 0;
16888 
16889   /* "View.MemoryView":487
16890  *         cdef bytes bytesitem
16891  *
16892  *         bytesitem = itemp[:self.view.itemsize]             # <<<<<<<<<<<<<<
16893  *         try:
16894  *             result = struct.unpack(self.view.format, bytesitem)
16895  */
16896   __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 487, __pyx_L1_error)
16897   __Pyx_GOTREF(__pyx_t_1);
16898   __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
16899   __pyx_t_1 = 0;
16900 
16901   /* "View.MemoryView":488
16902  *
16903  *         bytesitem = itemp[:self.view.itemsize]
16904  *         try:             # <<<<<<<<<<<<<<
16905  *             result = struct.unpack(self.view.format, bytesitem)
16906  *         except struct.error:
16907  */
16908   {
16909     __Pyx_PyThreadState_declare
16910     __Pyx_PyThreadState_assign
16911     __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
16912     __Pyx_XGOTREF(__pyx_t_2);
16913     __Pyx_XGOTREF(__pyx_t_3);
16914     __Pyx_XGOTREF(__pyx_t_4);
16915     /*try:*/ {
16916 
16917       /* "View.MemoryView":489
16918  *         bytesitem = itemp[:self.view.itemsize]
16919  *         try:
16920  *             result = struct.unpack(self.view.format, bytesitem)             # <<<<<<<<<<<<<<
16921  *         except struct.error:
16922  *             raise ValueError("Unable to convert item to object")
16923  */
16924       __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 489, __pyx_L3_error)
16925       __Pyx_GOTREF(__pyx_t_5);
16926       __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 489, __pyx_L3_error)
16927       __Pyx_GOTREF(__pyx_t_6);
16928       __pyx_t_7 = NULL;
16929       __pyx_t_8 = 0;
16930       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
16931         __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
16932         if (likely(__pyx_t_7)) {
16933           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
16934           __Pyx_INCREF(__pyx_t_7);
16935           __Pyx_INCREF(function);
16936           __Pyx_DECREF_SET(__pyx_t_5, function);
16937           __pyx_t_8 = 1;
16938         }
16939       }
16940       #if CYTHON_FAST_PYCALL
16941       if (PyFunction_Check(__pyx_t_5)) {
16942         PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
16943         __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(4, 489, __pyx_L3_error)
16944         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
16945         __Pyx_GOTREF(__pyx_t_1);
16946         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16947       } else
16948       #endif
16949       #if CYTHON_FAST_PYCCALL
16950       if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
16951         PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
16952         __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(4, 489, __pyx_L3_error)
16953         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
16954         __Pyx_GOTREF(__pyx_t_1);
16955         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16956       } else
16957       #endif
16958       {
16959         __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 489, __pyx_L3_error)
16960         __Pyx_GOTREF(__pyx_t_9);
16961         if (__pyx_t_7) {
16962           __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
16963         }
16964         __Pyx_GIVEREF(__pyx_t_6);
16965         PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
16966         __Pyx_INCREF(__pyx_v_bytesitem);
16967         __Pyx_GIVEREF(__pyx_v_bytesitem);
16968         PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
16969         __pyx_t_6 = 0;
16970         __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 489, __pyx_L3_error)
16971         __Pyx_GOTREF(__pyx_t_1);
16972         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16973       }
16974       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16975       __pyx_v_result = __pyx_t_1;
16976       __pyx_t_1 = 0;
16977 
16978       /* "View.MemoryView":488
16979  *
16980  *         bytesitem = itemp[:self.view.itemsize]
16981  *         try:             # <<<<<<<<<<<<<<
16982  *             result = struct.unpack(self.view.format, bytesitem)
16983  *         except struct.error:
16984  */
16985     }
16986 
16987     /* "View.MemoryView":493
16988  *             raise ValueError("Unable to convert item to object")
16989  *         else:
16990  *             if len(self.view.format) == 1:             # <<<<<<<<<<<<<<
16991  *                 return result[0]
16992  *             return result
16993  */
16994     /*else:*/ {
16995       __pyx_t_10 = strlen(__pyx_v_self->view.format);
16996       __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
16997       if (__pyx_t_11) {
16998 
16999         /* "View.MemoryView":494
17000  *         else:
17001  *             if len(self.view.format) == 1:
17002  *                 return result[0]             # <<<<<<<<<<<<<<
17003  *             return result
17004  *
17005  */
17006         __Pyx_XDECREF(__pyx_r);
17007         __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(4, 494, __pyx_L5_except_error)
17008         __Pyx_GOTREF(__pyx_t_1);
17009         __pyx_r = __pyx_t_1;
17010         __pyx_t_1 = 0;
17011         goto __pyx_L6_except_return;
17012 
17013         /* "View.MemoryView":493
17014  *             raise ValueError("Unable to convert item to object")
17015  *         else:
17016  *             if len(self.view.format) == 1:             # <<<<<<<<<<<<<<
17017  *                 return result[0]
17018  *             return result
17019  */
17020       }
17021 
17022       /* "View.MemoryView":495
17023  *             if len(self.view.format) == 1:
17024  *                 return result[0]
17025  *             return result             # <<<<<<<<<<<<<<
17026  *
17027  *     cdef assign_item_from_object(self, char *itemp, object value):
17028  */
17029       __Pyx_XDECREF(__pyx_r);
17030       __Pyx_INCREF(__pyx_v_result);
17031       __pyx_r = __pyx_v_result;
17032       goto __pyx_L6_except_return;
17033     }
17034     __pyx_L3_error:;
17035     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
17036     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17037     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
17038     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
17039     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
17040 
17041     /* "View.MemoryView":490
17042  *         try:
17043  *             result = struct.unpack(self.view.format, bytesitem)
17044  *         except struct.error:             # <<<<<<<<<<<<<<
17045  *             raise ValueError("Unable to convert item to object")
17046  *         else:
17047  */
17048     __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
17049     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 490, __pyx_L5_except_error)
17050     __Pyx_GOTREF(__pyx_t_6);
17051     __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
17052     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17053     __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
17054     __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
17055     if (__pyx_t_8) {
17056       __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
17057       if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(4, 490, __pyx_L5_except_error)
17058       __Pyx_GOTREF(__pyx_t_9);
17059       __Pyx_GOTREF(__pyx_t_5);
17060       __Pyx_GOTREF(__pyx_t_1);
17061 
17062       /* "View.MemoryView":491
17063  *             result = struct.unpack(self.view.format, bytesitem)
17064  *         except struct.error:
17065  *             raise ValueError("Unable to convert item to object")             # <<<<<<<<<<<<<<
17066  *         else:
17067  *             if len(self.view.format) == 1:
17068  */
17069       __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 491, __pyx_L5_except_error)
17070       __Pyx_GOTREF(__pyx_t_6);
17071       __Pyx_Raise(__pyx_t_6, 0, 0, 0);
17072       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17073       __PYX_ERR(4, 491, __pyx_L5_except_error)
17074     }
17075     goto __pyx_L5_except_error;
17076     __pyx_L5_except_error:;
17077 
17078     /* "View.MemoryView":488
17079  *
17080  *         bytesitem = itemp[:self.view.itemsize]
17081  *         try:             # <<<<<<<<<<<<<<
17082  *             result = struct.unpack(self.view.format, bytesitem)
17083  *         except struct.error:
17084  */
17085     __Pyx_XGIVEREF(__pyx_t_2);
17086     __Pyx_XGIVEREF(__pyx_t_3);
17087     __Pyx_XGIVEREF(__pyx_t_4);
17088     __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
17089     goto __pyx_L1_error;
17090     __pyx_L6_except_return:;
17091     __Pyx_XGIVEREF(__pyx_t_2);
17092     __Pyx_XGIVEREF(__pyx_t_3);
17093     __Pyx_XGIVEREF(__pyx_t_4);
17094     __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
17095     goto __pyx_L0;
17096   }
17097 
17098   /* "View.MemoryView":481
17099  *         self.assign_item_from_object(itemp, value)
17100  *
17101  *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
17102  *         """Only used if instantiated manually by the user, or if Cython doesn't
17103  *         know how to convert the type"""
17104  */
17105 
17106   /* function exit code */
17107   __pyx_L1_error:;
17108   __Pyx_XDECREF(__pyx_t_1);
17109   __Pyx_XDECREF(__pyx_t_5);
17110   __Pyx_XDECREF(__pyx_t_6);
17111   __Pyx_XDECREF(__pyx_t_7);
17112   __Pyx_XDECREF(__pyx_t_9);
17113   __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
17114   __pyx_r = 0;
17115   __pyx_L0:;
17116   __Pyx_XDECREF(__pyx_v_struct);
17117   __Pyx_XDECREF(__pyx_v_bytesitem);
17118   __Pyx_XDECREF(__pyx_v_result);
17119   __Pyx_XGIVEREF(__pyx_r);
17120   __Pyx_RefNannyFinishContext();
17121   return __pyx_r;
17122 }
17123 
17124 /* "View.MemoryView":497
17125  *             return result
17126  *
17127  *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
17128  *         """Only used if instantiated manually by the user, or if Cython doesn't
17129  *         know how to convert the type"""
17130  */
17131 
__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj * __pyx_v_self,char * __pyx_v_itemp,PyObject * __pyx_v_value)17132 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
17133   PyObject *__pyx_v_struct = NULL;
17134   char __pyx_v_c;
17135   PyObject *__pyx_v_bytesvalue = 0;
17136   Py_ssize_t __pyx_v_i;
17137   PyObject *__pyx_r = NULL;
17138   __Pyx_RefNannyDeclarations
17139   PyObject *__pyx_t_1 = NULL;
17140   int __pyx_t_2;
17141   int __pyx_t_3;
17142   PyObject *__pyx_t_4 = NULL;
17143   PyObject *__pyx_t_5 = NULL;
17144   PyObject *__pyx_t_6 = NULL;
17145   int __pyx_t_7;
17146   PyObject *__pyx_t_8 = NULL;
17147   Py_ssize_t __pyx_t_9;
17148   PyObject *__pyx_t_10 = NULL;
17149   char *__pyx_t_11;
17150   char *__pyx_t_12;
17151   char *__pyx_t_13;
17152   char *__pyx_t_14;
17153   __Pyx_RefNannySetupContext("assign_item_from_object", 0);
17154 
17155   /* "View.MemoryView":500
17156  *         """Only used if instantiated manually by the user, or if Cython doesn't
17157  *         know how to convert the type"""
17158  *         import struct             # <<<<<<<<<<<<<<
17159  *         cdef char c
17160  *         cdef bytes bytesvalue
17161  */
17162   __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 500, __pyx_L1_error)
17163   __Pyx_GOTREF(__pyx_t_1);
17164   __pyx_v_struct = __pyx_t_1;
17165   __pyx_t_1 = 0;
17166 
17167   /* "View.MemoryView":505
17168  *         cdef Py_ssize_t i
17169  *
17170  *         if isinstance(value, tuple):             # <<<<<<<<<<<<<<
17171  *             bytesvalue = struct.pack(self.view.format, *value)
17172  *         else:
17173  */
17174   __pyx_t_2 = PyTuple_Check(__pyx_v_value);
17175   __pyx_t_3 = (__pyx_t_2 != 0);
17176   if (__pyx_t_3) {
17177 
17178     /* "View.MemoryView":506
17179  *
17180  *         if isinstance(value, tuple):
17181  *             bytesvalue = struct.pack(self.view.format, *value)             # <<<<<<<<<<<<<<
17182  *         else:
17183  *             bytesvalue = struct.pack(self.view.format, value)
17184  */
17185     __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 506, __pyx_L1_error)
17186     __Pyx_GOTREF(__pyx_t_1);
17187     __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 506, __pyx_L1_error)
17188     __Pyx_GOTREF(__pyx_t_4);
17189     __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 506, __pyx_L1_error)
17190     __Pyx_GOTREF(__pyx_t_5);
17191     __Pyx_GIVEREF(__pyx_t_4);
17192     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
17193     __pyx_t_4 = 0;
17194     __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 506, __pyx_L1_error)
17195     __Pyx_GOTREF(__pyx_t_4);
17196     __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 506, __pyx_L1_error)
17197     __Pyx_GOTREF(__pyx_t_6);
17198     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17199     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17200     __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 506, __pyx_L1_error)
17201     __Pyx_GOTREF(__pyx_t_4);
17202     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17203     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17204     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(4, 506, __pyx_L1_error)
17205     __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
17206     __pyx_t_4 = 0;
17207 
17208     /* "View.MemoryView":505
17209  *         cdef Py_ssize_t i
17210  *
17211  *         if isinstance(value, tuple):             # <<<<<<<<<<<<<<
17212  *             bytesvalue = struct.pack(self.view.format, *value)
17213  *         else:
17214  */
17215     goto __pyx_L3;
17216   }
17217 
17218   /* "View.MemoryView":508
17219  *             bytesvalue = struct.pack(self.view.format, *value)
17220  *         else:
17221  *             bytesvalue = struct.pack(self.view.format, value)             # <<<<<<<<<<<<<<
17222  *
17223  *         for i, c in enumerate(bytesvalue):
17224  */
17225   /*else*/ {
17226     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 508, __pyx_L1_error)
17227     __Pyx_GOTREF(__pyx_t_6);
17228     __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 508, __pyx_L1_error)
17229     __Pyx_GOTREF(__pyx_t_1);
17230     __pyx_t_5 = NULL;
17231     __pyx_t_7 = 0;
17232     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
17233       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
17234       if (likely(__pyx_t_5)) {
17235         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
17236         __Pyx_INCREF(__pyx_t_5);
17237         __Pyx_INCREF(function);
17238         __Pyx_DECREF_SET(__pyx_t_6, function);
17239         __pyx_t_7 = 1;
17240       }
17241     }
17242     #if CYTHON_FAST_PYCALL
17243     if (PyFunction_Check(__pyx_t_6)) {
17244       PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
17245       __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(4, 508, __pyx_L1_error)
17246       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17247       __Pyx_GOTREF(__pyx_t_4);
17248       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17249     } else
17250     #endif
17251     #if CYTHON_FAST_PYCCALL
17252     if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
17253       PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
17254       __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(4, 508, __pyx_L1_error)
17255       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17256       __Pyx_GOTREF(__pyx_t_4);
17257       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17258     } else
17259     #endif
17260     {
17261       __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 508, __pyx_L1_error)
17262       __Pyx_GOTREF(__pyx_t_8);
17263       if (__pyx_t_5) {
17264         __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
17265       }
17266       __Pyx_GIVEREF(__pyx_t_1);
17267       PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
17268       __Pyx_INCREF(__pyx_v_value);
17269       __Pyx_GIVEREF(__pyx_v_value);
17270       PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
17271       __pyx_t_1 = 0;
17272       __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 508, __pyx_L1_error)
17273       __Pyx_GOTREF(__pyx_t_4);
17274       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
17275     }
17276     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17277     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(4, 508, __pyx_L1_error)
17278     __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
17279     __pyx_t_4 = 0;
17280   }
17281   __pyx_L3:;
17282 
17283   /* "View.MemoryView":510
17284  *             bytesvalue = struct.pack(self.view.format, value)
17285  *
17286  *         for i, c in enumerate(bytesvalue):             # <<<<<<<<<<<<<<
17287  *             itemp[i] = c
17288  *
17289  */
17290   __pyx_t_9 = 0;
17291   if (unlikely(__pyx_v_bytesvalue == Py_None)) {
17292     PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
17293     __PYX_ERR(4, 510, __pyx_L1_error)
17294   }
17295   __Pyx_INCREF(__pyx_v_bytesvalue);
17296   __pyx_t_10 = __pyx_v_bytesvalue;
17297   __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
17298   __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
17299   for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
17300     __pyx_t_11 = __pyx_t_14;
17301     __pyx_v_c = (__pyx_t_11[0]);
17302 
17303     /* "View.MemoryView":511
17304  *
17305  *         for i, c in enumerate(bytesvalue):
17306  *             itemp[i] = c             # <<<<<<<<<<<<<<
17307  *
17308  *     @cname('getbuffer')
17309  */
17310     __pyx_v_i = __pyx_t_9;
17311 
17312     /* "View.MemoryView":510
17313  *             bytesvalue = struct.pack(self.view.format, value)
17314  *
17315  *         for i, c in enumerate(bytesvalue):             # <<<<<<<<<<<<<<
17316  *             itemp[i] = c
17317  *
17318  */
17319     __pyx_t_9 = (__pyx_t_9 + 1);
17320 
17321     /* "View.MemoryView":511
17322  *
17323  *         for i, c in enumerate(bytesvalue):
17324  *             itemp[i] = c             # <<<<<<<<<<<<<<
17325  *
17326  *     @cname('getbuffer')
17327  */
17328     (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
17329   }
17330   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
17331 
17332   /* "View.MemoryView":497
17333  *             return result
17334  *
17335  *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
17336  *         """Only used if instantiated manually by the user, or if Cython doesn't
17337  *         know how to convert the type"""
17338  */
17339 
17340   /* function exit code */
17341   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17342   goto __pyx_L0;
17343   __pyx_L1_error:;
17344   __Pyx_XDECREF(__pyx_t_1);
17345   __Pyx_XDECREF(__pyx_t_4);
17346   __Pyx_XDECREF(__pyx_t_5);
17347   __Pyx_XDECREF(__pyx_t_6);
17348   __Pyx_XDECREF(__pyx_t_8);
17349   __Pyx_XDECREF(__pyx_t_10);
17350   __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
17351   __pyx_r = 0;
17352   __pyx_L0:;
17353   __Pyx_XDECREF(__pyx_v_struct);
17354   __Pyx_XDECREF(__pyx_v_bytesvalue);
17355   __Pyx_XGIVEREF(__pyx_r);
17356   __Pyx_RefNannyFinishContext();
17357   return __pyx_r;
17358 }
17359 
17360 /* "View.MemoryView":514
17361  *
17362  *     @cname('getbuffer')
17363  *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
17364  *         if flags & PyBUF_WRITABLE and self.view.readonly:
17365  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
17366  */
17367 
17368 /* Python wrapper */
17369 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)17370 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
17371   int __pyx_r;
17372   __Pyx_RefNannyDeclarations
17373   __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
17374   __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));
17375 
17376   /* function exit code */
17377   __Pyx_RefNannyFinishContext();
17378   return __pyx_r;
17379 }
17380 
__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)17381 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) {
17382   int __pyx_r;
17383   __Pyx_RefNannyDeclarations
17384   int __pyx_t_1;
17385   int __pyx_t_2;
17386   PyObject *__pyx_t_3 = NULL;
17387   Py_ssize_t *__pyx_t_4;
17388   char *__pyx_t_5;
17389   void *__pyx_t_6;
17390   int __pyx_t_7;
17391   Py_ssize_t __pyx_t_8;
17392   if (__pyx_v_info == NULL) {
17393     PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
17394     return -1;
17395   }
17396   __Pyx_RefNannySetupContext("__getbuffer__", 0);
17397   __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
17398   __Pyx_GIVEREF(__pyx_v_info->obj);
17399 
17400   /* "View.MemoryView":515
17401  *     @cname('getbuffer')
17402  *     def __getbuffer__(self, Py_buffer *info, int flags):
17403  *         if flags & PyBUF_WRITABLE and self.view.readonly:             # <<<<<<<<<<<<<<
17404  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
17405  *
17406  */
17407   __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
17408   if (__pyx_t_2) {
17409   } else {
17410     __pyx_t_1 = __pyx_t_2;
17411     goto __pyx_L4_bool_binop_done;
17412   }
17413   __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
17414   __pyx_t_1 = __pyx_t_2;
17415   __pyx_L4_bool_binop_done:;
17416   if (unlikely(__pyx_t_1)) {
17417 
17418     /* "View.MemoryView":516
17419  *     def __getbuffer__(self, Py_buffer *info, int flags):
17420  *         if flags & PyBUF_WRITABLE and self.view.readonly:
17421  *             raise ValueError("Cannot create writable memory view from read-only memoryview")             # <<<<<<<<<<<<<<
17422  *
17423  *         if flags & PyBUF_ND:
17424  */
17425     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 516, __pyx_L1_error)
17426     __Pyx_GOTREF(__pyx_t_3);
17427     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
17428     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17429     __PYX_ERR(4, 516, __pyx_L1_error)
17430 
17431     /* "View.MemoryView":515
17432  *     @cname('getbuffer')
17433  *     def __getbuffer__(self, Py_buffer *info, int flags):
17434  *         if flags & PyBUF_WRITABLE and self.view.readonly:             # <<<<<<<<<<<<<<
17435  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
17436  *
17437  */
17438   }
17439 
17440   /* "View.MemoryView":518
17441  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
17442  *
17443  *         if flags & PyBUF_ND:             # <<<<<<<<<<<<<<
17444  *             info.shape = self.view.shape
17445  *         else:
17446  */
17447   __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
17448   if (__pyx_t_1) {
17449 
17450     /* "View.MemoryView":519
17451  *
17452  *         if flags & PyBUF_ND:
17453  *             info.shape = self.view.shape             # <<<<<<<<<<<<<<
17454  *         else:
17455  *             info.shape = NULL
17456  */
17457     __pyx_t_4 = __pyx_v_self->view.shape;
17458     __pyx_v_info->shape = __pyx_t_4;
17459 
17460     /* "View.MemoryView":518
17461  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
17462  *
17463  *         if flags & PyBUF_ND:             # <<<<<<<<<<<<<<
17464  *             info.shape = self.view.shape
17465  *         else:
17466  */
17467     goto __pyx_L6;
17468   }
17469 
17470   /* "View.MemoryView":521
17471  *             info.shape = self.view.shape
17472  *         else:
17473  *             info.shape = NULL             # <<<<<<<<<<<<<<
17474  *
17475  *         if flags & PyBUF_STRIDES:
17476  */
17477   /*else*/ {
17478     __pyx_v_info->shape = NULL;
17479   }
17480   __pyx_L6:;
17481 
17482   /* "View.MemoryView":523
17483  *             info.shape = NULL
17484  *
17485  *         if flags & PyBUF_STRIDES:             # <<<<<<<<<<<<<<
17486  *             info.strides = self.view.strides
17487  *         else:
17488  */
17489   __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
17490   if (__pyx_t_1) {
17491 
17492     /* "View.MemoryView":524
17493  *
17494  *         if flags & PyBUF_STRIDES:
17495  *             info.strides = self.view.strides             # <<<<<<<<<<<<<<
17496  *         else:
17497  *             info.strides = NULL
17498  */
17499     __pyx_t_4 = __pyx_v_self->view.strides;
17500     __pyx_v_info->strides = __pyx_t_4;
17501 
17502     /* "View.MemoryView":523
17503  *             info.shape = NULL
17504  *
17505  *         if flags & PyBUF_STRIDES:             # <<<<<<<<<<<<<<
17506  *             info.strides = self.view.strides
17507  *         else:
17508  */
17509     goto __pyx_L7;
17510   }
17511 
17512   /* "View.MemoryView":526
17513  *             info.strides = self.view.strides
17514  *         else:
17515  *             info.strides = NULL             # <<<<<<<<<<<<<<
17516  *
17517  *         if flags & PyBUF_INDIRECT:
17518  */
17519   /*else*/ {
17520     __pyx_v_info->strides = NULL;
17521   }
17522   __pyx_L7:;
17523 
17524   /* "View.MemoryView":528
17525  *             info.strides = NULL
17526  *
17527  *         if flags & PyBUF_INDIRECT:             # <<<<<<<<<<<<<<
17528  *             info.suboffsets = self.view.suboffsets
17529  *         else:
17530  */
17531   __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
17532   if (__pyx_t_1) {
17533 
17534     /* "View.MemoryView":529
17535  *
17536  *         if flags & PyBUF_INDIRECT:
17537  *             info.suboffsets = self.view.suboffsets             # <<<<<<<<<<<<<<
17538  *         else:
17539  *             info.suboffsets = NULL
17540  */
17541     __pyx_t_4 = __pyx_v_self->view.suboffsets;
17542     __pyx_v_info->suboffsets = __pyx_t_4;
17543 
17544     /* "View.MemoryView":528
17545  *             info.strides = NULL
17546  *
17547  *         if flags & PyBUF_INDIRECT:             # <<<<<<<<<<<<<<
17548  *             info.suboffsets = self.view.suboffsets
17549  *         else:
17550  */
17551     goto __pyx_L8;
17552   }
17553 
17554   /* "View.MemoryView":531
17555  *             info.suboffsets = self.view.suboffsets
17556  *         else:
17557  *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
17558  *
17559  *         if flags & PyBUF_FORMAT:
17560  */
17561   /*else*/ {
17562     __pyx_v_info->suboffsets = NULL;
17563   }
17564   __pyx_L8:;
17565 
17566   /* "View.MemoryView":533
17567  *             info.suboffsets = NULL
17568  *
17569  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
17570  *             info.format = self.view.format
17571  *         else:
17572  */
17573   __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
17574   if (__pyx_t_1) {
17575 
17576     /* "View.MemoryView":534
17577  *
17578  *         if flags & PyBUF_FORMAT:
17579  *             info.format = self.view.format             # <<<<<<<<<<<<<<
17580  *         else:
17581  *             info.format = NULL
17582  */
17583     __pyx_t_5 = __pyx_v_self->view.format;
17584     __pyx_v_info->format = __pyx_t_5;
17585 
17586     /* "View.MemoryView":533
17587  *             info.suboffsets = NULL
17588  *
17589  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
17590  *             info.format = self.view.format
17591  *         else:
17592  */
17593     goto __pyx_L9;
17594   }
17595 
17596   /* "View.MemoryView":536
17597  *             info.format = self.view.format
17598  *         else:
17599  *             info.format = NULL             # <<<<<<<<<<<<<<
17600  *
17601  *         info.buf = self.view.buf
17602  */
17603   /*else*/ {
17604     __pyx_v_info->format = NULL;
17605   }
17606   __pyx_L9:;
17607 
17608   /* "View.MemoryView":538
17609  *             info.format = NULL
17610  *
17611  *         info.buf = self.view.buf             # <<<<<<<<<<<<<<
17612  *         info.ndim = self.view.ndim
17613  *         info.itemsize = self.view.itemsize
17614  */
17615   __pyx_t_6 = __pyx_v_self->view.buf;
17616   __pyx_v_info->buf = __pyx_t_6;
17617 
17618   /* "View.MemoryView":539
17619  *
17620  *         info.buf = self.view.buf
17621  *         info.ndim = self.view.ndim             # <<<<<<<<<<<<<<
17622  *         info.itemsize = self.view.itemsize
17623  *         info.len = self.view.len
17624  */
17625   __pyx_t_7 = __pyx_v_self->view.ndim;
17626   __pyx_v_info->ndim = __pyx_t_7;
17627 
17628   /* "View.MemoryView":540
17629  *         info.buf = self.view.buf
17630  *         info.ndim = self.view.ndim
17631  *         info.itemsize = self.view.itemsize             # <<<<<<<<<<<<<<
17632  *         info.len = self.view.len
17633  *         info.readonly = self.view.readonly
17634  */
17635   __pyx_t_8 = __pyx_v_self->view.itemsize;
17636   __pyx_v_info->itemsize = __pyx_t_8;
17637 
17638   /* "View.MemoryView":541
17639  *         info.ndim = self.view.ndim
17640  *         info.itemsize = self.view.itemsize
17641  *         info.len = self.view.len             # <<<<<<<<<<<<<<
17642  *         info.readonly = self.view.readonly
17643  *         info.obj = self
17644  */
17645   __pyx_t_8 = __pyx_v_self->view.len;
17646   __pyx_v_info->len = __pyx_t_8;
17647 
17648   /* "View.MemoryView":542
17649  *         info.itemsize = self.view.itemsize
17650  *         info.len = self.view.len
17651  *         info.readonly = self.view.readonly             # <<<<<<<<<<<<<<
17652  *         info.obj = self
17653  *
17654  */
17655   __pyx_t_1 = __pyx_v_self->view.readonly;
17656   __pyx_v_info->readonly = __pyx_t_1;
17657 
17658   /* "View.MemoryView":543
17659  *         info.len = self.view.len
17660  *         info.readonly = self.view.readonly
17661  *         info.obj = self             # <<<<<<<<<<<<<<
17662  *
17663  *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
17664  */
17665   __Pyx_INCREF(((PyObject *)__pyx_v_self));
17666   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
17667   __Pyx_GOTREF(__pyx_v_info->obj);
17668   __Pyx_DECREF(__pyx_v_info->obj);
17669   __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
17670 
17671   /* "View.MemoryView":514
17672  *
17673  *     @cname('getbuffer')
17674  *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
17675  *         if flags & PyBUF_WRITABLE and self.view.readonly:
17676  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
17677  */
17678 
17679   /* function exit code */
17680   __pyx_r = 0;
17681   goto __pyx_L0;
17682   __pyx_L1_error:;
17683   __Pyx_XDECREF(__pyx_t_3);
17684   __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17685   __pyx_r = -1;
17686   if (__pyx_v_info->obj != NULL) {
17687     __Pyx_GOTREF(__pyx_v_info->obj);
17688     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
17689   }
17690   goto __pyx_L2;
17691   __pyx_L0:;
17692   if (__pyx_v_info->obj == Py_None) {
17693     __Pyx_GOTREF(__pyx_v_info->obj);
17694     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
17695   }
17696   __pyx_L2:;
17697   __Pyx_RefNannyFinishContext();
17698   return __pyx_r;
17699 }
17700 
17701 /* "View.MemoryView":549
17702  *
17703  *     @property
17704  *     def T(self):             # <<<<<<<<<<<<<<
17705  *         cdef _memoryviewslice result = memoryview_copy(self)
17706  *         transpose_memslice(&result.from_slice)
17707  */
17708 
17709 /* Python wrapper */
17710 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)17711 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
17712   PyObject *__pyx_r = 0;
17713   __Pyx_RefNannyDeclarations
17714   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
17715   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
17716 
17717   /* function exit code */
17718   __Pyx_RefNannyFinishContext();
17719   return __pyx_r;
17720 }
17721 
__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj * __pyx_v_self)17722 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
17723   struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
17724   PyObject *__pyx_r = NULL;
17725   __Pyx_RefNannyDeclarations
17726   PyObject *__pyx_t_1 = NULL;
17727   int __pyx_t_2;
17728   __Pyx_RefNannySetupContext("__get__", 0);
17729 
17730   /* "View.MemoryView":550
17731  *     @property
17732  *     def T(self):
17733  *         cdef _memoryviewslice result = memoryview_copy(self)             # <<<<<<<<<<<<<<
17734  *         transpose_memslice(&result.from_slice)
17735  *         return result
17736  */
17737   __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 550, __pyx_L1_error)
17738   __Pyx_GOTREF(__pyx_t_1);
17739   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(4, 550, __pyx_L1_error)
17740   __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
17741   __pyx_t_1 = 0;
17742 
17743   /* "View.MemoryView":551
17744  *     def T(self):
17745  *         cdef _memoryviewslice result = memoryview_copy(self)
17746  *         transpose_memslice(&result.from_slice)             # <<<<<<<<<<<<<<
17747  *         return result
17748  *
17749  */
17750   __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(4, 551, __pyx_L1_error)
17751 
17752   /* "View.MemoryView":552
17753  *         cdef _memoryviewslice result = memoryview_copy(self)
17754  *         transpose_memslice(&result.from_slice)
17755  *         return result             # <<<<<<<<<<<<<<
17756  *
17757  *     @property
17758  */
17759   __Pyx_XDECREF(__pyx_r);
17760   __Pyx_INCREF(((PyObject *)__pyx_v_result));
17761   __pyx_r = ((PyObject *)__pyx_v_result);
17762   goto __pyx_L0;
17763 
17764   /* "View.MemoryView":549
17765  *
17766  *     @property
17767  *     def T(self):             # <<<<<<<<<<<<<<
17768  *         cdef _memoryviewslice result = memoryview_copy(self)
17769  *         transpose_memslice(&result.from_slice)
17770  */
17771 
17772   /* function exit code */
17773   __pyx_L1_error:;
17774   __Pyx_XDECREF(__pyx_t_1);
17775   __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17776   __pyx_r = NULL;
17777   __pyx_L0:;
17778   __Pyx_XDECREF((PyObject *)__pyx_v_result);
17779   __Pyx_XGIVEREF(__pyx_r);
17780   __Pyx_RefNannyFinishContext();
17781   return __pyx_r;
17782 }
17783 
17784 /* "View.MemoryView":555
17785  *
17786  *     @property
17787  *     def base(self):             # <<<<<<<<<<<<<<
17788  *         return self.obj
17789  *
17790  */
17791 
17792 /* Python wrapper */
17793 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)17794 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
17795   PyObject *__pyx_r = 0;
17796   __Pyx_RefNannyDeclarations
17797   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
17798   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
17799 
17800   /* function exit code */
17801   __Pyx_RefNannyFinishContext();
17802   return __pyx_r;
17803 }
17804 
__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj * __pyx_v_self)17805 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
17806   PyObject *__pyx_r = NULL;
17807   __Pyx_RefNannyDeclarations
17808   __Pyx_RefNannySetupContext("__get__", 0);
17809 
17810   /* "View.MemoryView":556
17811  *     @property
17812  *     def base(self):
17813  *         return self.obj             # <<<<<<<<<<<<<<
17814  *
17815  *     @property
17816  */
17817   __Pyx_XDECREF(__pyx_r);
17818   __Pyx_INCREF(__pyx_v_self->obj);
17819   __pyx_r = __pyx_v_self->obj;
17820   goto __pyx_L0;
17821 
17822   /* "View.MemoryView":555
17823  *
17824  *     @property
17825  *     def base(self):             # <<<<<<<<<<<<<<
17826  *         return self.obj
17827  *
17828  */
17829 
17830   /* function exit code */
17831   __pyx_L0:;
17832   __Pyx_XGIVEREF(__pyx_r);
17833   __Pyx_RefNannyFinishContext();
17834   return __pyx_r;
17835 }
17836 
17837 /* "View.MemoryView":559
17838  *
17839  *     @property
17840  *     def shape(self):             # <<<<<<<<<<<<<<
17841  *         return tuple([length for length in self.view.shape[:self.view.ndim]])
17842  *
17843  */
17844 
17845 /* Python wrapper */
17846 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)17847 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
17848   PyObject *__pyx_r = 0;
17849   __Pyx_RefNannyDeclarations
17850   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
17851   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
17852 
17853   /* function exit code */
17854   __Pyx_RefNannyFinishContext();
17855   return __pyx_r;
17856 }
17857 
__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj * __pyx_v_self)17858 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
17859   Py_ssize_t __pyx_v_length;
17860   PyObject *__pyx_r = NULL;
17861   __Pyx_RefNannyDeclarations
17862   PyObject *__pyx_t_1 = NULL;
17863   Py_ssize_t *__pyx_t_2;
17864   Py_ssize_t *__pyx_t_3;
17865   Py_ssize_t *__pyx_t_4;
17866   PyObject *__pyx_t_5 = NULL;
17867   __Pyx_RefNannySetupContext("__get__", 0);
17868 
17869   /* "View.MemoryView":560
17870  *     @property
17871  *     def shape(self):
17872  *         return tuple([length for length in self.view.shape[:self.view.ndim]])             # <<<<<<<<<<<<<<
17873  *
17874  *     @property
17875  */
17876   __Pyx_XDECREF(__pyx_r);
17877   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 560, __pyx_L1_error)
17878   __Pyx_GOTREF(__pyx_t_1);
17879   __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
17880   for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
17881     __pyx_t_2 = __pyx_t_4;
17882     __pyx_v_length = (__pyx_t_2[0]);
17883     __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 560, __pyx_L1_error)
17884     __Pyx_GOTREF(__pyx_t_5);
17885     if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(4, 560, __pyx_L1_error)
17886     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17887   }
17888   __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 560, __pyx_L1_error)
17889   __Pyx_GOTREF(__pyx_t_5);
17890   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17891   __pyx_r = __pyx_t_5;
17892   __pyx_t_5 = 0;
17893   goto __pyx_L0;
17894 
17895   /* "View.MemoryView":559
17896  *
17897  *     @property
17898  *     def shape(self):             # <<<<<<<<<<<<<<
17899  *         return tuple([length for length in self.view.shape[:self.view.ndim]])
17900  *
17901  */
17902 
17903   /* function exit code */
17904   __pyx_L1_error:;
17905   __Pyx_XDECREF(__pyx_t_1);
17906   __Pyx_XDECREF(__pyx_t_5);
17907   __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17908   __pyx_r = NULL;
17909   __pyx_L0:;
17910   __Pyx_XGIVEREF(__pyx_r);
17911   __Pyx_RefNannyFinishContext();
17912   return __pyx_r;
17913 }
17914 
17915 /* "View.MemoryView":563
17916  *
17917  *     @property
17918  *     def strides(self):             # <<<<<<<<<<<<<<
17919  *         if self.view.strides == NULL:
17920  *
17921  */
17922 
17923 /* Python wrapper */
17924 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)17925 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
17926   PyObject *__pyx_r = 0;
17927   __Pyx_RefNannyDeclarations
17928   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
17929   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
17930 
17931   /* function exit code */
17932   __Pyx_RefNannyFinishContext();
17933   return __pyx_r;
17934 }
17935 
__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj * __pyx_v_self)17936 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
17937   Py_ssize_t __pyx_v_stride;
17938   PyObject *__pyx_r = NULL;
17939   __Pyx_RefNannyDeclarations
17940   int __pyx_t_1;
17941   PyObject *__pyx_t_2 = NULL;
17942   Py_ssize_t *__pyx_t_3;
17943   Py_ssize_t *__pyx_t_4;
17944   Py_ssize_t *__pyx_t_5;
17945   PyObject *__pyx_t_6 = NULL;
17946   __Pyx_RefNannySetupContext("__get__", 0);
17947 
17948   /* "View.MemoryView":564
17949  *     @property
17950  *     def strides(self):
17951  *         if self.view.strides == NULL:             # <<<<<<<<<<<<<<
17952  *
17953  *             raise ValueError("Buffer view does not expose strides")
17954  */
17955   __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
17956   if (unlikely(__pyx_t_1)) {
17957 
17958     /* "View.MemoryView":566
17959  *         if self.view.strides == NULL:
17960  *
17961  *             raise ValueError("Buffer view does not expose strides")             # <<<<<<<<<<<<<<
17962  *
17963  *         return tuple([stride for stride in self.view.strides[:self.view.ndim]])
17964  */
17965     __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 566, __pyx_L1_error)
17966     __Pyx_GOTREF(__pyx_t_2);
17967     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
17968     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17969     __PYX_ERR(4, 566, __pyx_L1_error)
17970 
17971     /* "View.MemoryView":564
17972  *     @property
17973  *     def strides(self):
17974  *         if self.view.strides == NULL:             # <<<<<<<<<<<<<<
17975  *
17976  *             raise ValueError("Buffer view does not expose strides")
17977  */
17978   }
17979 
17980   /* "View.MemoryView":568
17981  *             raise ValueError("Buffer view does not expose strides")
17982  *
17983  *         return tuple([stride for stride in self.view.strides[:self.view.ndim]])             # <<<<<<<<<<<<<<
17984  *
17985  *     @property
17986  */
17987   __Pyx_XDECREF(__pyx_r);
17988   __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 568, __pyx_L1_error)
17989   __Pyx_GOTREF(__pyx_t_2);
17990   __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
17991   for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
17992     __pyx_t_3 = __pyx_t_5;
17993     __pyx_v_stride = (__pyx_t_3[0]);
17994     __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 568, __pyx_L1_error)
17995     __Pyx_GOTREF(__pyx_t_6);
17996     if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(4, 568, __pyx_L1_error)
17997     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17998   }
17999   __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 568, __pyx_L1_error)
18000   __Pyx_GOTREF(__pyx_t_6);
18001   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18002   __pyx_r = __pyx_t_6;
18003   __pyx_t_6 = 0;
18004   goto __pyx_L0;
18005 
18006   /* "View.MemoryView":563
18007  *
18008  *     @property
18009  *     def strides(self):             # <<<<<<<<<<<<<<
18010  *         if self.view.strides == NULL:
18011  *
18012  */
18013 
18014   /* function exit code */
18015   __pyx_L1_error:;
18016   __Pyx_XDECREF(__pyx_t_2);
18017   __Pyx_XDECREF(__pyx_t_6);
18018   __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18019   __pyx_r = NULL;
18020   __pyx_L0:;
18021   __Pyx_XGIVEREF(__pyx_r);
18022   __Pyx_RefNannyFinishContext();
18023   return __pyx_r;
18024 }
18025 
18026 /* "View.MemoryView":571
18027  *
18028  *     @property
18029  *     def suboffsets(self):             # <<<<<<<<<<<<<<
18030  *         if self.view.suboffsets == NULL:
18031  *             return (-1,) * self.view.ndim
18032  */
18033 
18034 /* Python wrapper */
18035 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)18036 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
18037   PyObject *__pyx_r = 0;
18038   __Pyx_RefNannyDeclarations
18039   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
18040   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
18041 
18042   /* function exit code */
18043   __Pyx_RefNannyFinishContext();
18044   return __pyx_r;
18045 }
18046 
__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj * __pyx_v_self)18047 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
18048   Py_ssize_t __pyx_v_suboffset;
18049   PyObject *__pyx_r = NULL;
18050   __Pyx_RefNannyDeclarations
18051   int __pyx_t_1;
18052   PyObject *__pyx_t_2 = NULL;
18053   PyObject *__pyx_t_3 = NULL;
18054   Py_ssize_t *__pyx_t_4;
18055   Py_ssize_t *__pyx_t_5;
18056   Py_ssize_t *__pyx_t_6;
18057   __Pyx_RefNannySetupContext("__get__", 0);
18058 
18059   /* "View.MemoryView":572
18060  *     @property
18061  *     def suboffsets(self):
18062  *         if self.view.suboffsets == NULL:             # <<<<<<<<<<<<<<
18063  *             return (-1,) * self.view.ndim
18064  *
18065  */
18066   __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
18067   if (__pyx_t_1) {
18068 
18069     /* "View.MemoryView":573
18070  *     def suboffsets(self):
18071  *         if self.view.suboffsets == NULL:
18072  *             return (-1,) * self.view.ndim             # <<<<<<<<<<<<<<
18073  *
18074  *         return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
18075  */
18076     __Pyx_XDECREF(__pyx_r);
18077     __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 573, __pyx_L1_error)
18078     __Pyx_GOTREF(__pyx_t_2);
18079     __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__23, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 573, __pyx_L1_error)
18080     __Pyx_GOTREF(__pyx_t_3);
18081     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18082     __pyx_r = __pyx_t_3;
18083     __pyx_t_3 = 0;
18084     goto __pyx_L0;
18085 
18086     /* "View.MemoryView":572
18087  *     @property
18088  *     def suboffsets(self):
18089  *         if self.view.suboffsets == NULL:             # <<<<<<<<<<<<<<
18090  *             return (-1,) * self.view.ndim
18091  *
18092  */
18093   }
18094 
18095   /* "View.MemoryView":575
18096  *             return (-1,) * self.view.ndim
18097  *
18098  *         return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])             # <<<<<<<<<<<<<<
18099  *
18100  *     @property
18101  */
18102   __Pyx_XDECREF(__pyx_r);
18103   __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 575, __pyx_L1_error)
18104   __Pyx_GOTREF(__pyx_t_3);
18105   __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
18106   for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
18107     __pyx_t_4 = __pyx_t_6;
18108     __pyx_v_suboffset = (__pyx_t_4[0]);
18109     __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 575, __pyx_L1_error)
18110     __Pyx_GOTREF(__pyx_t_2);
18111     if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(4, 575, __pyx_L1_error)
18112     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18113   }
18114   __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 575, __pyx_L1_error)
18115   __Pyx_GOTREF(__pyx_t_2);
18116   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18117   __pyx_r = __pyx_t_2;
18118   __pyx_t_2 = 0;
18119   goto __pyx_L0;
18120 
18121   /* "View.MemoryView":571
18122  *
18123  *     @property
18124  *     def suboffsets(self):             # <<<<<<<<<<<<<<
18125  *         if self.view.suboffsets == NULL:
18126  *             return (-1,) * self.view.ndim
18127  */
18128 
18129   /* function exit code */
18130   __pyx_L1_error:;
18131   __Pyx_XDECREF(__pyx_t_2);
18132   __Pyx_XDECREF(__pyx_t_3);
18133   __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18134   __pyx_r = NULL;
18135   __pyx_L0:;
18136   __Pyx_XGIVEREF(__pyx_r);
18137   __Pyx_RefNannyFinishContext();
18138   return __pyx_r;
18139 }
18140 
18141 /* "View.MemoryView":578
18142  *
18143  *     @property
18144  *     def ndim(self):             # <<<<<<<<<<<<<<
18145  *         return self.view.ndim
18146  *
18147  */
18148 
18149 /* Python wrapper */
18150 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)18151 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
18152   PyObject *__pyx_r = 0;
18153   __Pyx_RefNannyDeclarations
18154   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
18155   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
18156 
18157   /* function exit code */
18158   __Pyx_RefNannyFinishContext();
18159   return __pyx_r;
18160 }
18161 
__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj * __pyx_v_self)18162 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
18163   PyObject *__pyx_r = NULL;
18164   __Pyx_RefNannyDeclarations
18165   PyObject *__pyx_t_1 = NULL;
18166   __Pyx_RefNannySetupContext("__get__", 0);
18167 
18168   /* "View.MemoryView":579
18169  *     @property
18170  *     def ndim(self):
18171  *         return self.view.ndim             # <<<<<<<<<<<<<<
18172  *
18173  *     @property
18174  */
18175   __Pyx_XDECREF(__pyx_r);
18176   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 579, __pyx_L1_error)
18177   __Pyx_GOTREF(__pyx_t_1);
18178   __pyx_r = __pyx_t_1;
18179   __pyx_t_1 = 0;
18180   goto __pyx_L0;
18181 
18182   /* "View.MemoryView":578
18183  *
18184  *     @property
18185  *     def ndim(self):             # <<<<<<<<<<<<<<
18186  *         return self.view.ndim
18187  *
18188  */
18189 
18190   /* function exit code */
18191   __pyx_L1_error:;
18192   __Pyx_XDECREF(__pyx_t_1);
18193   __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18194   __pyx_r = NULL;
18195   __pyx_L0:;
18196   __Pyx_XGIVEREF(__pyx_r);
18197   __Pyx_RefNannyFinishContext();
18198   return __pyx_r;
18199 }
18200 
18201 /* "View.MemoryView":582
18202  *
18203  *     @property
18204  *     def itemsize(self):             # <<<<<<<<<<<<<<
18205  *         return self.view.itemsize
18206  *
18207  */
18208 
18209 /* Python wrapper */
18210 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)18211 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
18212   PyObject *__pyx_r = 0;
18213   __Pyx_RefNannyDeclarations
18214   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
18215   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
18216 
18217   /* function exit code */
18218   __Pyx_RefNannyFinishContext();
18219   return __pyx_r;
18220 }
18221 
__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj * __pyx_v_self)18222 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
18223   PyObject *__pyx_r = NULL;
18224   __Pyx_RefNannyDeclarations
18225   PyObject *__pyx_t_1 = NULL;
18226   __Pyx_RefNannySetupContext("__get__", 0);
18227 
18228   /* "View.MemoryView":583
18229  *     @property
18230  *     def itemsize(self):
18231  *         return self.view.itemsize             # <<<<<<<<<<<<<<
18232  *
18233  *     @property
18234  */
18235   __Pyx_XDECREF(__pyx_r);
18236   __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 583, __pyx_L1_error)
18237   __Pyx_GOTREF(__pyx_t_1);
18238   __pyx_r = __pyx_t_1;
18239   __pyx_t_1 = 0;
18240   goto __pyx_L0;
18241 
18242   /* "View.MemoryView":582
18243  *
18244  *     @property
18245  *     def itemsize(self):             # <<<<<<<<<<<<<<
18246  *         return self.view.itemsize
18247  *
18248  */
18249 
18250   /* function exit code */
18251   __pyx_L1_error:;
18252   __Pyx_XDECREF(__pyx_t_1);
18253   __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18254   __pyx_r = NULL;
18255   __pyx_L0:;
18256   __Pyx_XGIVEREF(__pyx_r);
18257   __Pyx_RefNannyFinishContext();
18258   return __pyx_r;
18259 }
18260 
18261 /* "View.MemoryView":586
18262  *
18263  *     @property
18264  *     def nbytes(self):             # <<<<<<<<<<<<<<
18265  *         return self.size * self.view.itemsize
18266  *
18267  */
18268 
18269 /* Python wrapper */
18270 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)18271 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
18272   PyObject *__pyx_r = 0;
18273   __Pyx_RefNannyDeclarations
18274   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
18275   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
18276 
18277   /* function exit code */
18278   __Pyx_RefNannyFinishContext();
18279   return __pyx_r;
18280 }
18281 
__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj * __pyx_v_self)18282 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
18283   PyObject *__pyx_r = NULL;
18284   __Pyx_RefNannyDeclarations
18285   PyObject *__pyx_t_1 = NULL;
18286   PyObject *__pyx_t_2 = NULL;
18287   PyObject *__pyx_t_3 = NULL;
18288   __Pyx_RefNannySetupContext("__get__", 0);
18289 
18290   /* "View.MemoryView":587
18291  *     @property
18292  *     def nbytes(self):
18293  *         return self.size * self.view.itemsize             # <<<<<<<<<<<<<<
18294  *
18295  *     @property
18296  */
18297   __Pyx_XDECREF(__pyx_r);
18298   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 587, __pyx_L1_error)
18299   __Pyx_GOTREF(__pyx_t_1);
18300   __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 587, __pyx_L1_error)
18301   __Pyx_GOTREF(__pyx_t_2);
18302   __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 587, __pyx_L1_error)
18303   __Pyx_GOTREF(__pyx_t_3);
18304   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18305   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18306   __pyx_r = __pyx_t_3;
18307   __pyx_t_3 = 0;
18308   goto __pyx_L0;
18309 
18310   /* "View.MemoryView":586
18311  *
18312  *     @property
18313  *     def nbytes(self):             # <<<<<<<<<<<<<<
18314  *         return self.size * self.view.itemsize
18315  *
18316  */
18317 
18318   /* function exit code */
18319   __pyx_L1_error:;
18320   __Pyx_XDECREF(__pyx_t_1);
18321   __Pyx_XDECREF(__pyx_t_2);
18322   __Pyx_XDECREF(__pyx_t_3);
18323   __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18324   __pyx_r = NULL;
18325   __pyx_L0:;
18326   __Pyx_XGIVEREF(__pyx_r);
18327   __Pyx_RefNannyFinishContext();
18328   return __pyx_r;
18329 }
18330 
18331 /* "View.MemoryView":590
18332  *
18333  *     @property
18334  *     def size(self):             # <<<<<<<<<<<<<<
18335  *         if self._size is None:
18336  *             result = 1
18337  */
18338 
18339 /* Python wrapper */
18340 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)18341 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
18342   PyObject *__pyx_r = 0;
18343   __Pyx_RefNannyDeclarations
18344   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
18345   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
18346 
18347   /* function exit code */
18348   __Pyx_RefNannyFinishContext();
18349   return __pyx_r;
18350 }
18351 
__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj * __pyx_v_self)18352 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
18353   PyObject *__pyx_v_result = NULL;
18354   PyObject *__pyx_v_length = NULL;
18355   PyObject *__pyx_r = NULL;
18356   __Pyx_RefNannyDeclarations
18357   int __pyx_t_1;
18358   int __pyx_t_2;
18359   Py_ssize_t *__pyx_t_3;
18360   Py_ssize_t *__pyx_t_4;
18361   Py_ssize_t *__pyx_t_5;
18362   PyObject *__pyx_t_6 = NULL;
18363   __Pyx_RefNannySetupContext("__get__", 0);
18364 
18365   /* "View.MemoryView":591
18366  *     @property
18367  *     def size(self):
18368  *         if self._size is None:             # <<<<<<<<<<<<<<
18369  *             result = 1
18370  *
18371  */
18372   __pyx_t_1 = (__pyx_v_self->_size == Py_None);
18373   __pyx_t_2 = (__pyx_t_1 != 0);
18374   if (__pyx_t_2) {
18375 
18376     /* "View.MemoryView":592
18377  *     def size(self):
18378  *         if self._size is None:
18379  *             result = 1             # <<<<<<<<<<<<<<
18380  *
18381  *             for length in self.view.shape[:self.view.ndim]:
18382  */
18383     __Pyx_INCREF(__pyx_int_1);
18384     __pyx_v_result = __pyx_int_1;
18385 
18386     /* "View.MemoryView":594
18387  *             result = 1
18388  *
18389  *             for length in self.view.shape[:self.view.ndim]:             # <<<<<<<<<<<<<<
18390  *                 result *= length
18391  *
18392  */
18393     __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
18394     for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
18395       __pyx_t_3 = __pyx_t_5;
18396       __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 594, __pyx_L1_error)
18397       __Pyx_GOTREF(__pyx_t_6);
18398       __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
18399       __pyx_t_6 = 0;
18400 
18401       /* "View.MemoryView":595
18402  *
18403  *             for length in self.view.shape[:self.view.ndim]:
18404  *                 result *= length             # <<<<<<<<<<<<<<
18405  *
18406  *             self._size = result
18407  */
18408       __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 595, __pyx_L1_error)
18409       __Pyx_GOTREF(__pyx_t_6);
18410       __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
18411       __pyx_t_6 = 0;
18412     }
18413 
18414     /* "View.MemoryView":597
18415  *                 result *= length
18416  *
18417  *             self._size = result             # <<<<<<<<<<<<<<
18418  *
18419  *         return self._size
18420  */
18421     __Pyx_INCREF(__pyx_v_result);
18422     __Pyx_GIVEREF(__pyx_v_result);
18423     __Pyx_GOTREF(__pyx_v_self->_size);
18424     __Pyx_DECREF(__pyx_v_self->_size);
18425     __pyx_v_self->_size = __pyx_v_result;
18426 
18427     /* "View.MemoryView":591
18428  *     @property
18429  *     def size(self):
18430  *         if self._size is None:             # <<<<<<<<<<<<<<
18431  *             result = 1
18432  *
18433  */
18434   }
18435 
18436   /* "View.MemoryView":599
18437  *             self._size = result
18438  *
18439  *         return self._size             # <<<<<<<<<<<<<<
18440  *
18441  *     def __len__(self):
18442  */
18443   __Pyx_XDECREF(__pyx_r);
18444   __Pyx_INCREF(__pyx_v_self->_size);
18445   __pyx_r = __pyx_v_self->_size;
18446   goto __pyx_L0;
18447 
18448   /* "View.MemoryView":590
18449  *
18450  *     @property
18451  *     def size(self):             # <<<<<<<<<<<<<<
18452  *         if self._size is None:
18453  *             result = 1
18454  */
18455 
18456   /* function exit code */
18457   __pyx_L1_error:;
18458   __Pyx_XDECREF(__pyx_t_6);
18459   __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18460   __pyx_r = NULL;
18461   __pyx_L0:;
18462   __Pyx_XDECREF(__pyx_v_result);
18463   __Pyx_XDECREF(__pyx_v_length);
18464   __Pyx_XGIVEREF(__pyx_r);
18465   __Pyx_RefNannyFinishContext();
18466   return __pyx_r;
18467 }
18468 
18469 /* "View.MemoryView":601
18470  *         return self._size
18471  *
18472  *     def __len__(self):             # <<<<<<<<<<<<<<
18473  *         if self.view.ndim >= 1:
18474  *             return self.view.shape[0]
18475  */
18476 
18477 /* Python wrapper */
18478 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
__pyx_memoryview___len__(PyObject * __pyx_v_self)18479 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
18480   Py_ssize_t __pyx_r;
18481   __Pyx_RefNannyDeclarations
18482   __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
18483   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
18484 
18485   /* function exit code */
18486   __Pyx_RefNannyFinishContext();
18487   return __pyx_r;
18488 }
18489 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj * __pyx_v_self)18490 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
18491   Py_ssize_t __pyx_r;
18492   __Pyx_RefNannyDeclarations
18493   int __pyx_t_1;
18494   __Pyx_RefNannySetupContext("__len__", 0);
18495 
18496   /* "View.MemoryView":602
18497  *
18498  *     def __len__(self):
18499  *         if self.view.ndim >= 1:             # <<<<<<<<<<<<<<
18500  *             return self.view.shape[0]
18501  *
18502  */
18503   __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
18504   if (__pyx_t_1) {
18505 
18506     /* "View.MemoryView":603
18507  *     def __len__(self):
18508  *         if self.view.ndim >= 1:
18509  *             return self.view.shape[0]             # <<<<<<<<<<<<<<
18510  *
18511  *         return 0
18512  */
18513     __pyx_r = (__pyx_v_self->view.shape[0]);
18514     goto __pyx_L0;
18515 
18516     /* "View.MemoryView":602
18517  *
18518  *     def __len__(self):
18519  *         if self.view.ndim >= 1:             # <<<<<<<<<<<<<<
18520  *             return self.view.shape[0]
18521  *
18522  */
18523   }
18524 
18525   /* "View.MemoryView":605
18526  *             return self.view.shape[0]
18527  *
18528  *         return 0             # <<<<<<<<<<<<<<
18529  *
18530  *     def __repr__(self):
18531  */
18532   __pyx_r = 0;
18533   goto __pyx_L0;
18534 
18535   /* "View.MemoryView":601
18536  *         return self._size
18537  *
18538  *     def __len__(self):             # <<<<<<<<<<<<<<
18539  *         if self.view.ndim >= 1:
18540  *             return self.view.shape[0]
18541  */
18542 
18543   /* function exit code */
18544   __pyx_L0:;
18545   __Pyx_RefNannyFinishContext();
18546   return __pyx_r;
18547 }
18548 
18549 /* "View.MemoryView":607
18550  *         return 0
18551  *
18552  *     def __repr__(self):             # <<<<<<<<<<<<<<
18553  *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
18554  *                                                id(self))
18555  */
18556 
18557 /* Python wrapper */
18558 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
__pyx_memoryview___repr__(PyObject * __pyx_v_self)18559 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
18560   PyObject *__pyx_r = 0;
18561   __Pyx_RefNannyDeclarations
18562   __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
18563   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
18564 
18565   /* function exit code */
18566   __Pyx_RefNannyFinishContext();
18567   return __pyx_r;
18568 }
18569 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj * __pyx_v_self)18570 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
18571   PyObject *__pyx_r = NULL;
18572   __Pyx_RefNannyDeclarations
18573   PyObject *__pyx_t_1 = NULL;
18574   PyObject *__pyx_t_2 = NULL;
18575   PyObject *__pyx_t_3 = NULL;
18576   __Pyx_RefNannySetupContext("__repr__", 0);
18577 
18578   /* "View.MemoryView":608
18579  *
18580  *     def __repr__(self):
18581  *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,             # <<<<<<<<<<<<<<
18582  *                                                id(self))
18583  *
18584  */
18585   __Pyx_XDECREF(__pyx_r);
18586   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 608, __pyx_L1_error)
18587   __Pyx_GOTREF(__pyx_t_1);
18588   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 608, __pyx_L1_error)
18589   __Pyx_GOTREF(__pyx_t_2);
18590   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18591   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 608, __pyx_L1_error)
18592   __Pyx_GOTREF(__pyx_t_1);
18593   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18594 
18595   /* "View.MemoryView":609
18596  *     def __repr__(self):
18597  *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
18598  *                                                id(self))             # <<<<<<<<<<<<<<
18599  *
18600  *     def __str__(self):
18601  */
18602   __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 609, __pyx_L1_error)
18603   __Pyx_GOTREF(__pyx_t_2);
18604 
18605   /* "View.MemoryView":608
18606  *
18607  *     def __repr__(self):
18608  *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,             # <<<<<<<<<<<<<<
18609  *                                                id(self))
18610  *
18611  */
18612   __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 608, __pyx_L1_error)
18613   __Pyx_GOTREF(__pyx_t_3);
18614   __Pyx_GIVEREF(__pyx_t_1);
18615   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
18616   __Pyx_GIVEREF(__pyx_t_2);
18617   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
18618   __pyx_t_1 = 0;
18619   __pyx_t_2 = 0;
18620   __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(4, 608, __pyx_L1_error)
18621   __Pyx_GOTREF(__pyx_t_2);
18622   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18623   __pyx_r = __pyx_t_2;
18624   __pyx_t_2 = 0;
18625   goto __pyx_L0;
18626 
18627   /* "View.MemoryView":607
18628  *         return 0
18629  *
18630  *     def __repr__(self):             # <<<<<<<<<<<<<<
18631  *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
18632  *                                                id(self))
18633  */
18634 
18635   /* function exit code */
18636   __pyx_L1_error:;
18637   __Pyx_XDECREF(__pyx_t_1);
18638   __Pyx_XDECREF(__pyx_t_2);
18639   __Pyx_XDECREF(__pyx_t_3);
18640   __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18641   __pyx_r = NULL;
18642   __pyx_L0:;
18643   __Pyx_XGIVEREF(__pyx_r);
18644   __Pyx_RefNannyFinishContext();
18645   return __pyx_r;
18646 }
18647 
18648 /* "View.MemoryView":611
18649  *                                                id(self))
18650  *
18651  *     def __str__(self):             # <<<<<<<<<<<<<<
18652  *         return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
18653  *
18654  */
18655 
18656 /* Python wrapper */
18657 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
__pyx_memoryview___str__(PyObject * __pyx_v_self)18658 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
18659   PyObject *__pyx_r = 0;
18660   __Pyx_RefNannyDeclarations
18661   __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
18662   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
18663 
18664   /* function exit code */
18665   __Pyx_RefNannyFinishContext();
18666   return __pyx_r;
18667 }
18668 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj * __pyx_v_self)18669 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
18670   PyObject *__pyx_r = NULL;
18671   __Pyx_RefNannyDeclarations
18672   PyObject *__pyx_t_1 = NULL;
18673   PyObject *__pyx_t_2 = NULL;
18674   __Pyx_RefNannySetupContext("__str__", 0);
18675 
18676   /* "View.MemoryView":612
18677  *
18678  *     def __str__(self):
18679  *         return "<MemoryView of %r object>" % (self.base.__class__.__name__,)             # <<<<<<<<<<<<<<
18680  *
18681  *
18682  */
18683   __Pyx_XDECREF(__pyx_r);
18684   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 612, __pyx_L1_error)
18685   __Pyx_GOTREF(__pyx_t_1);
18686   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 612, __pyx_L1_error)
18687   __Pyx_GOTREF(__pyx_t_2);
18688   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18689   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 612, __pyx_L1_error)
18690   __Pyx_GOTREF(__pyx_t_1);
18691   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18692   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 612, __pyx_L1_error)
18693   __Pyx_GOTREF(__pyx_t_2);
18694   __Pyx_GIVEREF(__pyx_t_1);
18695   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
18696   __pyx_t_1 = 0;
18697   __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 612, __pyx_L1_error)
18698   __Pyx_GOTREF(__pyx_t_1);
18699   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18700   __pyx_r = __pyx_t_1;
18701   __pyx_t_1 = 0;
18702   goto __pyx_L0;
18703 
18704   /* "View.MemoryView":611
18705  *                                                id(self))
18706  *
18707  *     def __str__(self):             # <<<<<<<<<<<<<<
18708  *         return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
18709  *
18710  */
18711 
18712   /* function exit code */
18713   __pyx_L1_error:;
18714   __Pyx_XDECREF(__pyx_t_1);
18715   __Pyx_XDECREF(__pyx_t_2);
18716   __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18717   __pyx_r = NULL;
18718   __pyx_L0:;
18719   __Pyx_XGIVEREF(__pyx_r);
18720   __Pyx_RefNannyFinishContext();
18721   return __pyx_r;
18722 }
18723 
18724 /* "View.MemoryView":615
18725  *
18726  *
18727  *     def is_c_contig(self):             # <<<<<<<<<<<<<<
18728  *         cdef __Pyx_memviewslice *mslice
18729  *         cdef __Pyx_memviewslice tmp
18730  */
18731 
18732 /* Python wrapper */
18733 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)18734 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
18735   PyObject *__pyx_r = 0;
18736   __Pyx_RefNannyDeclarations
18737   __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
18738   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
18739 
18740   /* function exit code */
18741   __Pyx_RefNannyFinishContext();
18742   return __pyx_r;
18743 }
18744 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj * __pyx_v_self)18745 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
18746   __Pyx_memviewslice *__pyx_v_mslice;
18747   __Pyx_memviewslice __pyx_v_tmp;
18748   PyObject *__pyx_r = NULL;
18749   __Pyx_RefNannyDeclarations
18750   PyObject *__pyx_t_1 = NULL;
18751   __Pyx_RefNannySetupContext("is_c_contig", 0);
18752 
18753   /* "View.MemoryView":618
18754  *         cdef __Pyx_memviewslice *mslice
18755  *         cdef __Pyx_memviewslice tmp
18756  *         mslice = get_slice_from_memview(self, &tmp)             # <<<<<<<<<<<<<<
18757  *         return slice_is_contig(mslice[0], 'C', self.view.ndim)
18758  *
18759  */
18760   __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
18761 
18762   /* "View.MemoryView":619
18763  *         cdef __Pyx_memviewslice tmp
18764  *         mslice = get_slice_from_memview(self, &tmp)
18765  *         return slice_is_contig(mslice[0], 'C', self.view.ndim)             # <<<<<<<<<<<<<<
18766  *
18767  *     def is_f_contig(self):
18768  */
18769   __Pyx_XDECREF(__pyx_r);
18770   __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(4, 619, __pyx_L1_error)
18771   __Pyx_GOTREF(__pyx_t_1);
18772   __pyx_r = __pyx_t_1;
18773   __pyx_t_1 = 0;
18774   goto __pyx_L0;
18775 
18776   /* "View.MemoryView":615
18777  *
18778  *
18779  *     def is_c_contig(self):             # <<<<<<<<<<<<<<
18780  *         cdef __Pyx_memviewslice *mslice
18781  *         cdef __Pyx_memviewslice tmp
18782  */
18783 
18784   /* function exit code */
18785   __pyx_L1_error:;
18786   __Pyx_XDECREF(__pyx_t_1);
18787   __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
18788   __pyx_r = NULL;
18789   __pyx_L0:;
18790   __Pyx_XGIVEREF(__pyx_r);
18791   __Pyx_RefNannyFinishContext();
18792   return __pyx_r;
18793 }
18794 
18795 /* "View.MemoryView":621
18796  *         return slice_is_contig(mslice[0], 'C', self.view.ndim)
18797  *
18798  *     def is_f_contig(self):             # <<<<<<<<<<<<<<
18799  *         cdef __Pyx_memviewslice *mslice
18800  *         cdef __Pyx_memviewslice tmp
18801  */
18802 
18803 /* Python wrapper */
18804 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)18805 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
18806   PyObject *__pyx_r = 0;
18807   __Pyx_RefNannyDeclarations
18808   __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
18809   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
18810 
18811   /* function exit code */
18812   __Pyx_RefNannyFinishContext();
18813   return __pyx_r;
18814 }
18815 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj * __pyx_v_self)18816 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
18817   __Pyx_memviewslice *__pyx_v_mslice;
18818   __Pyx_memviewslice __pyx_v_tmp;
18819   PyObject *__pyx_r = NULL;
18820   __Pyx_RefNannyDeclarations
18821   PyObject *__pyx_t_1 = NULL;
18822   __Pyx_RefNannySetupContext("is_f_contig", 0);
18823 
18824   /* "View.MemoryView":624
18825  *         cdef __Pyx_memviewslice *mslice
18826  *         cdef __Pyx_memviewslice tmp
18827  *         mslice = get_slice_from_memview(self, &tmp)             # <<<<<<<<<<<<<<
18828  *         return slice_is_contig(mslice[0], 'F', self.view.ndim)
18829  *
18830  */
18831   __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
18832 
18833   /* "View.MemoryView":625
18834  *         cdef __Pyx_memviewslice tmp
18835  *         mslice = get_slice_from_memview(self, &tmp)
18836  *         return slice_is_contig(mslice[0], 'F', self.view.ndim)             # <<<<<<<<<<<<<<
18837  *
18838  *     def copy(self):
18839  */
18840   __Pyx_XDECREF(__pyx_r);
18841   __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(4, 625, __pyx_L1_error)
18842   __Pyx_GOTREF(__pyx_t_1);
18843   __pyx_r = __pyx_t_1;
18844   __pyx_t_1 = 0;
18845   goto __pyx_L0;
18846 
18847   /* "View.MemoryView":621
18848  *         return slice_is_contig(mslice[0], 'C', self.view.ndim)
18849  *
18850  *     def is_f_contig(self):             # <<<<<<<<<<<<<<
18851  *         cdef __Pyx_memviewslice *mslice
18852  *         cdef __Pyx_memviewslice tmp
18853  */
18854 
18855   /* function exit code */
18856   __pyx_L1_error:;
18857   __Pyx_XDECREF(__pyx_t_1);
18858   __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
18859   __pyx_r = NULL;
18860   __pyx_L0:;
18861   __Pyx_XGIVEREF(__pyx_r);
18862   __Pyx_RefNannyFinishContext();
18863   return __pyx_r;
18864 }
18865 
18866 /* "View.MemoryView":627
18867  *         return slice_is_contig(mslice[0], 'F', self.view.ndim)
18868  *
18869  *     def copy(self):             # <<<<<<<<<<<<<<
18870  *         cdef __Pyx_memviewslice mslice
18871  *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
18872  */
18873 
18874 /* Python wrapper */
18875 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)18876 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
18877   PyObject *__pyx_r = 0;
18878   __Pyx_RefNannyDeclarations
18879   __Pyx_RefNannySetupContext("copy (wrapper)", 0);
18880   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
18881 
18882   /* function exit code */
18883   __Pyx_RefNannyFinishContext();
18884   return __pyx_r;
18885 }
18886 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj * __pyx_v_self)18887 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
18888   __Pyx_memviewslice __pyx_v_mslice;
18889   int __pyx_v_flags;
18890   PyObject *__pyx_r = NULL;
18891   __Pyx_RefNannyDeclarations
18892   __Pyx_memviewslice __pyx_t_1;
18893   PyObject *__pyx_t_2 = NULL;
18894   __Pyx_RefNannySetupContext("copy", 0);
18895 
18896   /* "View.MemoryView":629
18897  *     def copy(self):
18898  *         cdef __Pyx_memviewslice mslice
18899  *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS             # <<<<<<<<<<<<<<
18900  *
18901  *         slice_copy(self, &mslice)
18902  */
18903   __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
18904 
18905   /* "View.MemoryView":631
18906  *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
18907  *
18908  *         slice_copy(self, &mslice)             # <<<<<<<<<<<<<<
18909  *         mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
18910  *                                    self.view.itemsize,
18911  */
18912   __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
18913 
18914   /* "View.MemoryView":632
18915  *
18916  *         slice_copy(self, &mslice)
18917  *         mslice = slice_copy_contig(&mslice, "c", self.view.ndim,             # <<<<<<<<<<<<<<
18918  *                                    self.view.itemsize,
18919  *                                    flags|PyBUF_C_CONTIGUOUS,
18920  */
18921   __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(4, 632, __pyx_L1_error)
18922   __pyx_v_mslice = __pyx_t_1;
18923 
18924   /* "View.MemoryView":637
18925  *                                    self.dtype_is_object)
18926  *
18927  *         return memoryview_copy_from_slice(self, &mslice)             # <<<<<<<<<<<<<<
18928  *
18929  *     def copy_fortran(self):
18930  */
18931   __Pyx_XDECREF(__pyx_r);
18932   __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 637, __pyx_L1_error)
18933   __Pyx_GOTREF(__pyx_t_2);
18934   __pyx_r = __pyx_t_2;
18935   __pyx_t_2 = 0;
18936   goto __pyx_L0;
18937 
18938   /* "View.MemoryView":627
18939  *         return slice_is_contig(mslice[0], 'F', self.view.ndim)
18940  *
18941  *     def copy(self):             # <<<<<<<<<<<<<<
18942  *         cdef __Pyx_memviewslice mslice
18943  *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
18944  */
18945 
18946   /* function exit code */
18947   __pyx_L1_error:;
18948   __Pyx_XDECREF(__pyx_t_2);
18949   __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
18950   __pyx_r = NULL;
18951   __pyx_L0:;
18952   __Pyx_XGIVEREF(__pyx_r);
18953   __Pyx_RefNannyFinishContext();
18954   return __pyx_r;
18955 }
18956 
18957 /* "View.MemoryView":639
18958  *         return memoryview_copy_from_slice(self, &mslice)
18959  *
18960  *     def copy_fortran(self):             # <<<<<<<<<<<<<<
18961  *         cdef __Pyx_memviewslice src, dst
18962  *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
18963  */
18964 
18965 /* Python wrapper */
18966 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)18967 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
18968   PyObject *__pyx_r = 0;
18969   __Pyx_RefNannyDeclarations
18970   __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
18971   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
18972 
18973   /* function exit code */
18974   __Pyx_RefNannyFinishContext();
18975   return __pyx_r;
18976 }
18977 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj * __pyx_v_self)18978 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
18979   __Pyx_memviewslice __pyx_v_src;
18980   __Pyx_memviewslice __pyx_v_dst;
18981   int __pyx_v_flags;
18982   PyObject *__pyx_r = NULL;
18983   __Pyx_RefNannyDeclarations
18984   __Pyx_memviewslice __pyx_t_1;
18985   PyObject *__pyx_t_2 = NULL;
18986   __Pyx_RefNannySetupContext("copy_fortran", 0);
18987 
18988   /* "View.MemoryView":641
18989  *     def copy_fortran(self):
18990  *         cdef __Pyx_memviewslice src, dst
18991  *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS             # <<<<<<<<<<<<<<
18992  *
18993  *         slice_copy(self, &src)
18994  */
18995   __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
18996 
18997   /* "View.MemoryView":643
18998  *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
18999  *
19000  *         slice_copy(self, &src)             # <<<<<<<<<<<<<<
19001  *         dst = slice_copy_contig(&src, "fortran", self.view.ndim,
19002  *                                 self.view.itemsize,
19003  */
19004   __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
19005 
19006   /* "View.MemoryView":644
19007  *
19008  *         slice_copy(self, &src)
19009  *         dst = slice_copy_contig(&src, "fortran", self.view.ndim,             # <<<<<<<<<<<<<<
19010  *                                 self.view.itemsize,
19011  *                                 flags|PyBUF_F_CONTIGUOUS,
19012  */
19013   __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(4, 644, __pyx_L1_error)
19014   __pyx_v_dst = __pyx_t_1;
19015 
19016   /* "View.MemoryView":649
19017  *                                 self.dtype_is_object)
19018  *
19019  *         return memoryview_copy_from_slice(self, &dst)             # <<<<<<<<<<<<<<
19020  *
19021  *
19022  */
19023   __Pyx_XDECREF(__pyx_r);
19024   __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 649, __pyx_L1_error)
19025   __Pyx_GOTREF(__pyx_t_2);
19026   __pyx_r = __pyx_t_2;
19027   __pyx_t_2 = 0;
19028   goto __pyx_L0;
19029 
19030   /* "View.MemoryView":639
19031  *         return memoryview_copy_from_slice(self, &mslice)
19032  *
19033  *     def copy_fortran(self):             # <<<<<<<<<<<<<<
19034  *         cdef __Pyx_memviewslice src, dst
19035  *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
19036  */
19037 
19038   /* function exit code */
19039   __pyx_L1_error:;
19040   __Pyx_XDECREF(__pyx_t_2);
19041   __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
19042   __pyx_r = NULL;
19043   __pyx_L0:;
19044   __Pyx_XGIVEREF(__pyx_r);
19045   __Pyx_RefNannyFinishContext();
19046   return __pyx_r;
19047 }
19048 
19049 /* "(tree fragment)":1
19050  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
19051  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
19052  * def __setstate_cython__(self, __pyx_state):
19053  */
19054 
19055 /* Python wrapper */
19056 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)19057 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
19058   PyObject *__pyx_r = 0;
19059   __Pyx_RefNannyDeclarations
19060   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
19061   __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
19062 
19063   /* function exit code */
19064   __Pyx_RefNannyFinishContext();
19065   return __pyx_r;
19066 }
19067 
__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj * __pyx_v_self)19068 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
19069   PyObject *__pyx_r = NULL;
19070   __Pyx_RefNannyDeclarations
19071   PyObject *__pyx_t_1 = NULL;
19072   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
19073 
19074   /* "(tree fragment)":2
19075  * def __reduce_cython__(self):
19076  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
19077  * def __setstate_cython__(self, __pyx_state):
19078  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
19079  */
19080   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2, __pyx_L1_error)
19081   __Pyx_GOTREF(__pyx_t_1);
19082   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
19083   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19084   __PYX_ERR(4, 2, __pyx_L1_error)
19085 
19086   /* "(tree fragment)":1
19087  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
19088  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
19089  * def __setstate_cython__(self, __pyx_state):
19090  */
19091 
19092   /* function exit code */
19093   __pyx_L1_error:;
19094   __Pyx_XDECREF(__pyx_t_1);
19095   __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
19096   __pyx_r = NULL;
19097   __Pyx_XGIVEREF(__pyx_r);
19098   __Pyx_RefNannyFinishContext();
19099   return __pyx_r;
19100 }
19101 
19102 /* "(tree fragment)":3
19103  * def __reduce_cython__(self):
19104  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
19105  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
19106  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
19107  */
19108 
19109 /* Python wrapper */
19110 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)19111 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
19112   PyObject *__pyx_r = 0;
19113   __Pyx_RefNannyDeclarations
19114   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
19115   __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
19116 
19117   /* function exit code */
19118   __Pyx_RefNannyFinishContext();
19119   return __pyx_r;
19120 }
19121 
__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)19122 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) {
19123   PyObject *__pyx_r = NULL;
19124   __Pyx_RefNannyDeclarations
19125   PyObject *__pyx_t_1 = NULL;
19126   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
19127 
19128   /* "(tree fragment)":4
19129  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
19130  * def __setstate_cython__(self, __pyx_state):
19131  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
19132  */
19133   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 4, __pyx_L1_error)
19134   __Pyx_GOTREF(__pyx_t_1);
19135   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
19136   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19137   __PYX_ERR(4, 4, __pyx_L1_error)
19138 
19139   /* "(tree fragment)":3
19140  * def __reduce_cython__(self):
19141  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
19142  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
19143  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
19144  */
19145 
19146   /* function exit code */
19147   __pyx_L1_error:;
19148   __Pyx_XDECREF(__pyx_t_1);
19149   __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
19150   __pyx_r = NULL;
19151   __Pyx_XGIVEREF(__pyx_r);
19152   __Pyx_RefNannyFinishContext();
19153   return __pyx_r;
19154 }
19155 
19156 /* "View.MemoryView":653
19157  *
19158  * @cname('__pyx_memoryview_new')
19159  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):             # <<<<<<<<<<<<<<
19160  *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
19161  *     result.typeinfo = typeinfo
19162  */
19163 
__pyx_memoryview_new(PyObject * __pyx_v_o,int __pyx_v_flags,int __pyx_v_dtype_is_object,__Pyx_TypeInfo * __pyx_v_typeinfo)19164 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
19165   struct __pyx_memoryview_obj *__pyx_v_result = 0;
19166   PyObject *__pyx_r = NULL;
19167   __Pyx_RefNannyDeclarations
19168   PyObject *__pyx_t_1 = NULL;
19169   PyObject *__pyx_t_2 = NULL;
19170   PyObject *__pyx_t_3 = NULL;
19171   __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
19172 
19173   /* "View.MemoryView":654
19174  * @cname('__pyx_memoryview_new')
19175  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
19176  *     cdef memoryview result = memoryview(o, flags, dtype_is_object)             # <<<<<<<<<<<<<<
19177  *     result.typeinfo = typeinfo
19178  *     return result
19179  */
19180   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 654, __pyx_L1_error)
19181   __Pyx_GOTREF(__pyx_t_1);
19182   __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 654, __pyx_L1_error)
19183   __Pyx_GOTREF(__pyx_t_2);
19184   __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 654, __pyx_L1_error)
19185   __Pyx_GOTREF(__pyx_t_3);
19186   __Pyx_INCREF(__pyx_v_o);
19187   __Pyx_GIVEREF(__pyx_v_o);
19188   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
19189   __Pyx_GIVEREF(__pyx_t_1);
19190   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
19191   __Pyx_GIVEREF(__pyx_t_2);
19192   PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
19193   __pyx_t_1 = 0;
19194   __pyx_t_2 = 0;
19195   __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 654, __pyx_L1_error)
19196   __Pyx_GOTREF(__pyx_t_2);
19197   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19198   __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
19199   __pyx_t_2 = 0;
19200 
19201   /* "View.MemoryView":655
19202  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
19203  *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
19204  *     result.typeinfo = typeinfo             # <<<<<<<<<<<<<<
19205  *     return result
19206  *
19207  */
19208   __pyx_v_result->typeinfo = __pyx_v_typeinfo;
19209 
19210   /* "View.MemoryView":656
19211  *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
19212  *     result.typeinfo = typeinfo
19213  *     return result             # <<<<<<<<<<<<<<
19214  *
19215  * @cname('__pyx_memoryview_check')
19216  */
19217   __Pyx_XDECREF(__pyx_r);
19218   __Pyx_INCREF(((PyObject *)__pyx_v_result));
19219   __pyx_r = ((PyObject *)__pyx_v_result);
19220   goto __pyx_L0;
19221 
19222   /* "View.MemoryView":653
19223  *
19224  * @cname('__pyx_memoryview_new')
19225  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):             # <<<<<<<<<<<<<<
19226  *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
19227  *     result.typeinfo = typeinfo
19228  */
19229 
19230   /* function exit code */
19231   __pyx_L1_error:;
19232   __Pyx_XDECREF(__pyx_t_1);
19233   __Pyx_XDECREF(__pyx_t_2);
19234   __Pyx_XDECREF(__pyx_t_3);
19235   __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
19236   __pyx_r = 0;
19237   __pyx_L0:;
19238   __Pyx_XDECREF((PyObject *)__pyx_v_result);
19239   __Pyx_XGIVEREF(__pyx_r);
19240   __Pyx_RefNannyFinishContext();
19241   return __pyx_r;
19242 }
19243 
19244 /* "View.MemoryView":659
19245  *
19246  * @cname('__pyx_memoryview_check')
19247  * cdef inline bint memoryview_check(object o):             # <<<<<<<<<<<<<<
19248  *     return isinstance(o, memoryview)
19249  *
19250  */
19251 
__pyx_memoryview_check(PyObject * __pyx_v_o)19252 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
19253   int __pyx_r;
19254   __Pyx_RefNannyDeclarations
19255   int __pyx_t_1;
19256   __Pyx_RefNannySetupContext("memoryview_check", 0);
19257 
19258   /* "View.MemoryView":660
19259  * @cname('__pyx_memoryview_check')
19260  * cdef inline bint memoryview_check(object o):
19261  *     return isinstance(o, memoryview)             # <<<<<<<<<<<<<<
19262  *
19263  * cdef tuple _unellipsify(object index, int ndim):
19264  */
19265   __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
19266   __pyx_r = __pyx_t_1;
19267   goto __pyx_L0;
19268 
19269   /* "View.MemoryView":659
19270  *
19271  * @cname('__pyx_memoryview_check')
19272  * cdef inline bint memoryview_check(object o):             # <<<<<<<<<<<<<<
19273  *     return isinstance(o, memoryview)
19274  *
19275  */
19276 
19277   /* function exit code */
19278   __pyx_L0:;
19279   __Pyx_RefNannyFinishContext();
19280   return __pyx_r;
19281 }
19282 
19283 /* "View.MemoryView":662
19284  *     return isinstance(o, memoryview)
19285  *
19286  * cdef tuple _unellipsify(object index, int ndim):             # <<<<<<<<<<<<<<
19287  *     """
19288  *     Replace all ellipses with full slices and fill incomplete indices with
19289  */
19290 
_unellipsify(PyObject * __pyx_v_index,int __pyx_v_ndim)19291 static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
19292   PyObject *__pyx_v_tup = NULL;
19293   PyObject *__pyx_v_result = NULL;
19294   int __pyx_v_have_slices;
19295   int __pyx_v_seen_ellipsis;
19296   CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
19297   PyObject *__pyx_v_item = NULL;
19298   Py_ssize_t __pyx_v_nslices;
19299   PyObject *__pyx_r = NULL;
19300   __Pyx_RefNannyDeclarations
19301   int __pyx_t_1;
19302   int __pyx_t_2;
19303   PyObject *__pyx_t_3 = NULL;
19304   PyObject *__pyx_t_4 = NULL;
19305   Py_ssize_t __pyx_t_5;
19306   PyObject *(*__pyx_t_6)(PyObject *);
19307   PyObject *__pyx_t_7 = NULL;
19308   Py_ssize_t __pyx_t_8;
19309   int __pyx_t_9;
19310   int __pyx_t_10;
19311   PyObject *__pyx_t_11 = NULL;
19312   __Pyx_RefNannySetupContext("_unellipsify", 0);
19313 
19314   /* "View.MemoryView":667
19315  *     full slices.
19316  *     """
19317  *     if not isinstance(index, tuple):             # <<<<<<<<<<<<<<
19318  *         tup = (index,)
19319  *     else:
19320  */
19321   __pyx_t_1 = PyTuple_Check(__pyx_v_index);
19322   __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
19323   if (__pyx_t_2) {
19324 
19325     /* "View.MemoryView":668
19326  *     """
19327  *     if not isinstance(index, tuple):
19328  *         tup = (index,)             # <<<<<<<<<<<<<<
19329  *     else:
19330  *         tup = index
19331  */
19332     __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 668, __pyx_L1_error)
19333     __Pyx_GOTREF(__pyx_t_3);
19334     __Pyx_INCREF(__pyx_v_index);
19335     __Pyx_GIVEREF(__pyx_v_index);
19336     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
19337     __pyx_v_tup = __pyx_t_3;
19338     __pyx_t_3 = 0;
19339 
19340     /* "View.MemoryView":667
19341  *     full slices.
19342  *     """
19343  *     if not isinstance(index, tuple):             # <<<<<<<<<<<<<<
19344  *         tup = (index,)
19345  *     else:
19346  */
19347     goto __pyx_L3;
19348   }
19349 
19350   /* "View.MemoryView":670
19351  *         tup = (index,)
19352  *     else:
19353  *         tup = index             # <<<<<<<<<<<<<<
19354  *
19355  *     result = []
19356  */
19357   /*else*/ {
19358     __Pyx_INCREF(__pyx_v_index);
19359     __pyx_v_tup = __pyx_v_index;
19360   }
19361   __pyx_L3:;
19362 
19363   /* "View.MemoryView":672
19364  *         tup = index
19365  *
19366  *     result = []             # <<<<<<<<<<<<<<
19367  *     have_slices = False
19368  *     seen_ellipsis = False
19369  */
19370   __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 672, __pyx_L1_error)
19371   __Pyx_GOTREF(__pyx_t_3);
19372   __pyx_v_result = ((PyObject*)__pyx_t_3);
19373   __pyx_t_3 = 0;
19374 
19375   /* "View.MemoryView":673
19376  *
19377  *     result = []
19378  *     have_slices = False             # <<<<<<<<<<<<<<
19379  *     seen_ellipsis = False
19380  *     for idx, item in enumerate(tup):
19381  */
19382   __pyx_v_have_slices = 0;
19383 
19384   /* "View.MemoryView":674
19385  *     result = []
19386  *     have_slices = False
19387  *     seen_ellipsis = False             # <<<<<<<<<<<<<<
19388  *     for idx, item in enumerate(tup):
19389  *         if item is Ellipsis:
19390  */
19391   __pyx_v_seen_ellipsis = 0;
19392 
19393   /* "View.MemoryView":675
19394  *     have_slices = False
19395  *     seen_ellipsis = False
19396  *     for idx, item in enumerate(tup):             # <<<<<<<<<<<<<<
19397  *         if item is Ellipsis:
19398  *             if not seen_ellipsis:
19399  */
19400   __Pyx_INCREF(__pyx_int_0);
19401   __pyx_t_3 = __pyx_int_0;
19402   if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
19403     __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
19404     __pyx_t_6 = NULL;
19405   } else {
19406     __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 675, __pyx_L1_error)
19407     __Pyx_GOTREF(__pyx_t_4);
19408     __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 675, __pyx_L1_error)
19409   }
19410   for (;;) {
19411     if (likely(!__pyx_t_6)) {
19412       if (likely(PyList_CheckExact(__pyx_t_4))) {
19413         if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
19414         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
19415         __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(4, 675, __pyx_L1_error)
19416         #else
19417         __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 675, __pyx_L1_error)
19418         __Pyx_GOTREF(__pyx_t_7);
19419         #endif
19420       } else {
19421         if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
19422         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
19423         __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(4, 675, __pyx_L1_error)
19424         #else
19425         __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 675, __pyx_L1_error)
19426         __Pyx_GOTREF(__pyx_t_7);
19427         #endif
19428       }
19429     } else {
19430       __pyx_t_7 = __pyx_t_6(__pyx_t_4);
19431       if (unlikely(!__pyx_t_7)) {
19432         PyObject* exc_type = PyErr_Occurred();
19433         if (exc_type) {
19434           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
19435           else __PYX_ERR(4, 675, __pyx_L1_error)
19436         }
19437         break;
19438       }
19439       __Pyx_GOTREF(__pyx_t_7);
19440     }
19441     __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
19442     __pyx_t_7 = 0;
19443     __Pyx_INCREF(__pyx_t_3);
19444     __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
19445     __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 675, __pyx_L1_error)
19446     __Pyx_GOTREF(__pyx_t_7);
19447     __Pyx_DECREF(__pyx_t_3);
19448     __pyx_t_3 = __pyx_t_7;
19449     __pyx_t_7 = 0;
19450 
19451     /* "View.MemoryView":676
19452  *     seen_ellipsis = False
19453  *     for idx, item in enumerate(tup):
19454  *         if item is Ellipsis:             # <<<<<<<<<<<<<<
19455  *             if not seen_ellipsis:
19456  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
19457  */
19458     __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
19459     __pyx_t_1 = (__pyx_t_2 != 0);
19460     if (__pyx_t_1) {
19461 
19462       /* "View.MemoryView":677
19463  *     for idx, item in enumerate(tup):
19464  *         if item is Ellipsis:
19465  *             if not seen_ellipsis:             # <<<<<<<<<<<<<<
19466  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
19467  *                 seen_ellipsis = True
19468  */
19469       __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
19470       if (__pyx_t_1) {
19471 
19472         /* "View.MemoryView":678
19473  *         if item is Ellipsis:
19474  *             if not seen_ellipsis:
19475  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))             # <<<<<<<<<<<<<<
19476  *                 seen_ellipsis = True
19477  *             else:
19478  */
19479         __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(4, 678, __pyx_L1_error)
19480         __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(4, 678, __pyx_L1_error)
19481         __Pyx_GOTREF(__pyx_t_7);
19482         { Py_ssize_t __pyx_temp;
19483           for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
19484             __Pyx_INCREF(__pyx_slice__3);
19485             __Pyx_GIVEREF(__pyx_slice__3);
19486             PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__3);
19487           }
19488         }
19489         __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(4, 678, __pyx_L1_error)
19490         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
19491 
19492         /* "View.MemoryView":679
19493  *             if not seen_ellipsis:
19494  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
19495  *                 seen_ellipsis = True             # <<<<<<<<<<<<<<
19496  *             else:
19497  *                 result.append(slice(None))
19498  */
19499         __pyx_v_seen_ellipsis = 1;
19500 
19501         /* "View.MemoryView":677
19502  *     for idx, item in enumerate(tup):
19503  *         if item is Ellipsis:
19504  *             if not seen_ellipsis:             # <<<<<<<<<<<<<<
19505  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
19506  *                 seen_ellipsis = True
19507  */
19508         goto __pyx_L7;
19509       }
19510 
19511       /* "View.MemoryView":681
19512  *                 seen_ellipsis = True
19513  *             else:
19514  *                 result.append(slice(None))             # <<<<<<<<<<<<<<
19515  *             have_slices = True
19516  *         else:
19517  */
19518       /*else*/ {
19519         __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(4, 681, __pyx_L1_error)
19520       }
19521       __pyx_L7:;
19522 
19523       /* "View.MemoryView":682
19524  *             else:
19525  *                 result.append(slice(None))
19526  *             have_slices = True             # <<<<<<<<<<<<<<
19527  *         else:
19528  *             if not isinstance(item, slice) and not PyIndex_Check(item):
19529  */
19530       __pyx_v_have_slices = 1;
19531 
19532       /* "View.MemoryView":676
19533  *     seen_ellipsis = False
19534  *     for idx, item in enumerate(tup):
19535  *         if item is Ellipsis:             # <<<<<<<<<<<<<<
19536  *             if not seen_ellipsis:
19537  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
19538  */
19539       goto __pyx_L6;
19540     }
19541 
19542     /* "View.MemoryView":684
19543  *             have_slices = True
19544  *         else:
19545  *             if not isinstance(item, slice) and not PyIndex_Check(item):             # <<<<<<<<<<<<<<
19546  *                 raise TypeError("Cannot index with type '%s'" % type(item))
19547  *
19548  */
19549     /*else*/ {
19550       __pyx_t_2 = PySlice_Check(__pyx_v_item);
19551       __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
19552       if (__pyx_t_10) {
19553       } else {
19554         __pyx_t_1 = __pyx_t_10;
19555         goto __pyx_L9_bool_binop_done;
19556       }
19557       __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
19558       __pyx_t_1 = __pyx_t_10;
19559       __pyx_L9_bool_binop_done:;
19560       if (unlikely(__pyx_t_1)) {
19561 
19562         /* "View.MemoryView":685
19563  *         else:
19564  *             if not isinstance(item, slice) and not PyIndex_Check(item):
19565  *                 raise TypeError("Cannot index with type '%s'" % type(item))             # <<<<<<<<<<<<<<
19566  *
19567  *             have_slices = have_slices or isinstance(item, slice)
19568  */
19569         __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(4, 685, __pyx_L1_error)
19570         __Pyx_GOTREF(__pyx_t_7);
19571         __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 685, __pyx_L1_error)
19572         __Pyx_GOTREF(__pyx_t_11);
19573         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
19574         __Pyx_Raise(__pyx_t_11, 0, 0, 0);
19575         __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
19576         __PYX_ERR(4, 685, __pyx_L1_error)
19577 
19578         /* "View.MemoryView":684
19579  *             have_slices = True
19580  *         else:
19581  *             if not isinstance(item, slice) and not PyIndex_Check(item):             # <<<<<<<<<<<<<<
19582  *                 raise TypeError("Cannot index with type '%s'" % type(item))
19583  *
19584  */
19585       }
19586 
19587       /* "View.MemoryView":687
19588  *                 raise TypeError("Cannot index with type '%s'" % type(item))
19589  *
19590  *             have_slices = have_slices or isinstance(item, slice)             # <<<<<<<<<<<<<<
19591  *             result.append(item)
19592  *
19593  */
19594       __pyx_t_10 = (__pyx_v_have_slices != 0);
19595       if (!__pyx_t_10) {
19596       } else {
19597         __pyx_t_1 = __pyx_t_10;
19598         goto __pyx_L11_bool_binop_done;
19599       }
19600       __pyx_t_10 = PySlice_Check(__pyx_v_item);
19601       __pyx_t_2 = (__pyx_t_10 != 0);
19602       __pyx_t_1 = __pyx_t_2;
19603       __pyx_L11_bool_binop_done:;
19604       __pyx_v_have_slices = __pyx_t_1;
19605 
19606       /* "View.MemoryView":688
19607  *
19608  *             have_slices = have_slices or isinstance(item, slice)
19609  *             result.append(item)             # <<<<<<<<<<<<<<
19610  *
19611  *     nslices = ndim - len(result)
19612  */
19613       __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(4, 688, __pyx_L1_error)
19614     }
19615     __pyx_L6:;
19616 
19617     /* "View.MemoryView":675
19618  *     have_slices = False
19619  *     seen_ellipsis = False
19620  *     for idx, item in enumerate(tup):             # <<<<<<<<<<<<<<
19621  *         if item is Ellipsis:
19622  *             if not seen_ellipsis:
19623  */
19624   }
19625   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19626   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19627 
19628   /* "View.MemoryView":690
19629  *             result.append(item)
19630  *
19631  *     nslices = ndim - len(result)             # <<<<<<<<<<<<<<
19632  *     if nslices:
19633  *         result.extend([slice(None)] * nslices)
19634  */
19635   __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(4, 690, __pyx_L1_error)
19636   __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
19637 
19638   /* "View.MemoryView":691
19639  *
19640  *     nslices = ndim - len(result)
19641  *     if nslices:             # <<<<<<<<<<<<<<
19642  *         result.extend([slice(None)] * nslices)
19643  *
19644  */
19645   __pyx_t_1 = (__pyx_v_nslices != 0);
19646   if (__pyx_t_1) {
19647 
19648     /* "View.MemoryView":692
19649  *     nslices = ndim - len(result)
19650  *     if nslices:
19651  *         result.extend([slice(None)] * nslices)             # <<<<<<<<<<<<<<
19652  *
19653  *     return have_slices or nslices, tuple(result)
19654  */
19655     __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 692, __pyx_L1_error)
19656     __Pyx_GOTREF(__pyx_t_3);
19657     { Py_ssize_t __pyx_temp;
19658       for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
19659         __Pyx_INCREF(__pyx_slice__3);
19660         __Pyx_GIVEREF(__pyx_slice__3);
19661         PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__3);
19662       }
19663     }
19664     __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(4, 692, __pyx_L1_error)
19665     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19666 
19667     /* "View.MemoryView":691
19668  *
19669  *     nslices = ndim - len(result)
19670  *     if nslices:             # <<<<<<<<<<<<<<
19671  *         result.extend([slice(None)] * nslices)
19672  *
19673  */
19674   }
19675 
19676   /* "View.MemoryView":694
19677  *         result.extend([slice(None)] * nslices)
19678  *
19679  *     return have_slices or nslices, tuple(result)             # <<<<<<<<<<<<<<
19680  *
19681  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
19682  */
19683   __Pyx_XDECREF(__pyx_r);
19684   if (!__pyx_v_have_slices) {
19685   } else {
19686     __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 694, __pyx_L1_error)
19687     __Pyx_GOTREF(__pyx_t_4);
19688     __pyx_t_3 = __pyx_t_4;
19689     __pyx_t_4 = 0;
19690     goto __pyx_L14_bool_binop_done;
19691   }
19692   __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 694, __pyx_L1_error)
19693   __Pyx_GOTREF(__pyx_t_4);
19694   __pyx_t_3 = __pyx_t_4;
19695   __pyx_t_4 = 0;
19696   __pyx_L14_bool_binop_done:;
19697   __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 694, __pyx_L1_error)
19698   __Pyx_GOTREF(__pyx_t_4);
19699   __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 694, __pyx_L1_error)
19700   __Pyx_GOTREF(__pyx_t_11);
19701   __Pyx_GIVEREF(__pyx_t_3);
19702   PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
19703   __Pyx_GIVEREF(__pyx_t_4);
19704   PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
19705   __pyx_t_3 = 0;
19706   __pyx_t_4 = 0;
19707   __pyx_r = ((PyObject*)__pyx_t_11);
19708   __pyx_t_11 = 0;
19709   goto __pyx_L0;
19710 
19711   /* "View.MemoryView":662
19712  *     return isinstance(o, memoryview)
19713  *
19714  * cdef tuple _unellipsify(object index, int ndim):             # <<<<<<<<<<<<<<
19715  *     """
19716  *     Replace all ellipses with full slices and fill incomplete indices with
19717  */
19718 
19719   /* function exit code */
19720   __pyx_L1_error:;
19721   __Pyx_XDECREF(__pyx_t_3);
19722   __Pyx_XDECREF(__pyx_t_4);
19723   __Pyx_XDECREF(__pyx_t_7);
19724   __Pyx_XDECREF(__pyx_t_11);
19725   __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
19726   __pyx_r = 0;
19727   __pyx_L0:;
19728   __Pyx_XDECREF(__pyx_v_tup);
19729   __Pyx_XDECREF(__pyx_v_result);
19730   __Pyx_XDECREF(__pyx_v_idx);
19731   __Pyx_XDECREF(__pyx_v_item);
19732   __Pyx_XGIVEREF(__pyx_r);
19733   __Pyx_RefNannyFinishContext();
19734   return __pyx_r;
19735 }
19736 
19737 /* "View.MemoryView":696
19738  *     return have_slices or nslices, tuple(result)
19739  *
19740  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):             # <<<<<<<<<<<<<<
19741  *     for suboffset in suboffsets[:ndim]:
19742  *         if suboffset >= 0:
19743  */
19744 
assert_direct_dimensions(Py_ssize_t * __pyx_v_suboffsets,int __pyx_v_ndim)19745 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
19746   Py_ssize_t __pyx_v_suboffset;
19747   PyObject *__pyx_r = NULL;
19748   __Pyx_RefNannyDeclarations
19749   Py_ssize_t *__pyx_t_1;
19750   Py_ssize_t *__pyx_t_2;
19751   Py_ssize_t *__pyx_t_3;
19752   int __pyx_t_4;
19753   PyObject *__pyx_t_5 = NULL;
19754   __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
19755 
19756   /* "View.MemoryView":697
19757  *
19758  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
19759  *     for suboffset in suboffsets[:ndim]:             # <<<<<<<<<<<<<<
19760  *         if suboffset >= 0:
19761  *             raise ValueError("Indirect dimensions not supported")
19762  */
19763   __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
19764   for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
19765     __pyx_t_1 = __pyx_t_3;
19766     __pyx_v_suboffset = (__pyx_t_1[0]);
19767 
19768     /* "View.MemoryView":698
19769  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
19770  *     for suboffset in suboffsets[:ndim]:
19771  *         if suboffset >= 0:             # <<<<<<<<<<<<<<
19772  *             raise ValueError("Indirect dimensions not supported")
19773  *
19774  */
19775     __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
19776     if (unlikely(__pyx_t_4)) {
19777 
19778       /* "View.MemoryView":699
19779  *     for suboffset in suboffsets[:ndim]:
19780  *         if suboffset >= 0:
19781  *             raise ValueError("Indirect dimensions not supported")             # <<<<<<<<<<<<<<
19782  *
19783  *
19784  */
19785       __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 699, __pyx_L1_error)
19786       __Pyx_GOTREF(__pyx_t_5);
19787       __Pyx_Raise(__pyx_t_5, 0, 0, 0);
19788       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19789       __PYX_ERR(4, 699, __pyx_L1_error)
19790 
19791       /* "View.MemoryView":698
19792  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
19793  *     for suboffset in suboffsets[:ndim]:
19794  *         if suboffset >= 0:             # <<<<<<<<<<<<<<
19795  *             raise ValueError("Indirect dimensions not supported")
19796  *
19797  */
19798     }
19799   }
19800 
19801   /* "View.MemoryView":696
19802  *     return have_slices or nslices, tuple(result)
19803  *
19804  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):             # <<<<<<<<<<<<<<
19805  *     for suboffset in suboffsets[:ndim]:
19806  *         if suboffset >= 0:
19807  */
19808 
19809   /* function exit code */
19810   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19811   goto __pyx_L0;
19812   __pyx_L1_error:;
19813   __Pyx_XDECREF(__pyx_t_5);
19814   __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
19815   __pyx_r = 0;
19816   __pyx_L0:;
19817   __Pyx_XGIVEREF(__pyx_r);
19818   __Pyx_RefNannyFinishContext();
19819   return __pyx_r;
19820 }
19821 
19822 /* "View.MemoryView":706
19823  *
19824  * @cname('__pyx_memview_slice')
19825  * cdef memoryview memview_slice(memoryview memview, object indices):             # <<<<<<<<<<<<<<
19826  *     cdef int new_ndim = 0, suboffset_dim = -1, dim
19827  *     cdef bint negative_step
19828  */
19829 
__pyx_memview_slice(struct __pyx_memoryview_obj * __pyx_v_memview,PyObject * __pyx_v_indices)19830 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
19831   int __pyx_v_new_ndim;
19832   int __pyx_v_suboffset_dim;
19833   int __pyx_v_dim;
19834   __Pyx_memviewslice __pyx_v_src;
19835   __Pyx_memviewslice __pyx_v_dst;
19836   __Pyx_memviewslice *__pyx_v_p_src;
19837   struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
19838   __Pyx_memviewslice *__pyx_v_p_dst;
19839   int *__pyx_v_p_suboffset_dim;
19840   Py_ssize_t __pyx_v_start;
19841   Py_ssize_t __pyx_v_stop;
19842   Py_ssize_t __pyx_v_step;
19843   int __pyx_v_have_start;
19844   int __pyx_v_have_stop;
19845   int __pyx_v_have_step;
19846   PyObject *__pyx_v_index = NULL;
19847   struct __pyx_memoryview_obj *__pyx_r = NULL;
19848   __Pyx_RefNannyDeclarations
19849   int __pyx_t_1;
19850   int __pyx_t_2;
19851   PyObject *__pyx_t_3 = NULL;
19852   struct __pyx_memoryview_obj *__pyx_t_4;
19853   char *__pyx_t_5;
19854   int __pyx_t_6;
19855   Py_ssize_t __pyx_t_7;
19856   PyObject *(*__pyx_t_8)(PyObject *);
19857   PyObject *__pyx_t_9 = NULL;
19858   Py_ssize_t __pyx_t_10;
19859   int __pyx_t_11;
19860   Py_ssize_t __pyx_t_12;
19861   __Pyx_RefNannySetupContext("memview_slice", 0);
19862 
19863   /* "View.MemoryView":707
19864  * @cname('__pyx_memview_slice')
19865  * cdef memoryview memview_slice(memoryview memview, object indices):
19866  *     cdef int new_ndim = 0, suboffset_dim = -1, dim             # <<<<<<<<<<<<<<
19867  *     cdef bint negative_step
19868  *     cdef __Pyx_memviewslice src, dst
19869  */
19870   __pyx_v_new_ndim = 0;
19871   __pyx_v_suboffset_dim = -1;
19872 
19873   /* "View.MemoryView":714
19874  *
19875  *
19876  *     memset(&dst, 0, sizeof(dst))             # <<<<<<<<<<<<<<
19877  *
19878  *     cdef _memoryviewslice memviewsliceobj
19879  */
19880   (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
19881 
19882   /* "View.MemoryView":718
19883  *     cdef _memoryviewslice memviewsliceobj
19884  *
19885  *     assert memview.view.ndim > 0             # <<<<<<<<<<<<<<
19886  *
19887  *     if isinstance(memview, _memoryviewslice):
19888  */
19889   #ifndef CYTHON_WITHOUT_ASSERTIONS
19890   if (unlikely(!Py_OptimizeFlag)) {
19891     if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
19892       PyErr_SetNone(PyExc_AssertionError);
19893       __PYX_ERR(4, 718, __pyx_L1_error)
19894     }
19895   }
19896   #endif
19897 
19898   /* "View.MemoryView":720
19899  *     assert memview.view.ndim > 0
19900  *
19901  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
19902  *         memviewsliceobj = memview
19903  *         p_src = &memviewsliceobj.from_slice
19904  */
19905   __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
19906   __pyx_t_2 = (__pyx_t_1 != 0);
19907   if (__pyx_t_2) {
19908 
19909     /* "View.MemoryView":721
19910  *
19911  *     if isinstance(memview, _memoryviewslice):
19912  *         memviewsliceobj = memview             # <<<<<<<<<<<<<<
19913  *         p_src = &memviewsliceobj.from_slice
19914  *     else:
19915  */
19916     if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(4, 721, __pyx_L1_error)
19917     __pyx_t_3 = ((PyObject *)__pyx_v_memview);
19918     __Pyx_INCREF(__pyx_t_3);
19919     __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
19920     __pyx_t_3 = 0;
19921 
19922     /* "View.MemoryView":722
19923  *     if isinstance(memview, _memoryviewslice):
19924  *         memviewsliceobj = memview
19925  *         p_src = &memviewsliceobj.from_slice             # <<<<<<<<<<<<<<
19926  *     else:
19927  *         slice_copy(memview, &src)
19928  */
19929     __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
19930 
19931     /* "View.MemoryView":720
19932  *     assert memview.view.ndim > 0
19933  *
19934  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
19935  *         memviewsliceobj = memview
19936  *         p_src = &memviewsliceobj.from_slice
19937  */
19938     goto __pyx_L3;
19939   }
19940 
19941   /* "View.MemoryView":724
19942  *         p_src = &memviewsliceobj.from_slice
19943  *     else:
19944  *         slice_copy(memview, &src)             # <<<<<<<<<<<<<<
19945  *         p_src = &src
19946  *
19947  */
19948   /*else*/ {
19949     __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
19950 
19951     /* "View.MemoryView":725
19952  *     else:
19953  *         slice_copy(memview, &src)
19954  *         p_src = &src             # <<<<<<<<<<<<<<
19955  *
19956  *
19957  */
19958     __pyx_v_p_src = (&__pyx_v_src);
19959   }
19960   __pyx_L3:;
19961 
19962   /* "View.MemoryView":731
19963  *
19964  *
19965  *     dst.memview = p_src.memview             # <<<<<<<<<<<<<<
19966  *     dst.data = p_src.data
19967  *
19968  */
19969   __pyx_t_4 = __pyx_v_p_src->memview;
19970   __pyx_v_dst.memview = __pyx_t_4;
19971 
19972   /* "View.MemoryView":732
19973  *
19974  *     dst.memview = p_src.memview
19975  *     dst.data = p_src.data             # <<<<<<<<<<<<<<
19976  *
19977  *
19978  */
19979   __pyx_t_5 = __pyx_v_p_src->data;
19980   __pyx_v_dst.data = __pyx_t_5;
19981 
19982   /* "View.MemoryView":737
19983  *
19984  *
19985  *     cdef __Pyx_memviewslice *p_dst = &dst             # <<<<<<<<<<<<<<
19986  *     cdef int *p_suboffset_dim = &suboffset_dim
19987  *     cdef Py_ssize_t start, stop, step
19988  */
19989   __pyx_v_p_dst = (&__pyx_v_dst);
19990 
19991   /* "View.MemoryView":738
19992  *
19993  *     cdef __Pyx_memviewslice *p_dst = &dst
19994  *     cdef int *p_suboffset_dim = &suboffset_dim             # <<<<<<<<<<<<<<
19995  *     cdef Py_ssize_t start, stop, step
19996  *     cdef bint have_start, have_stop, have_step
19997  */
19998   __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
19999 
20000   /* "View.MemoryView":742
20001  *     cdef bint have_start, have_stop, have_step
20002  *
20003  *     for dim, index in enumerate(indices):             # <<<<<<<<<<<<<<
20004  *         if PyIndex_Check(index):
20005  *             slice_memviewslice(
20006  */
20007   __pyx_t_6 = 0;
20008   if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
20009     __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
20010     __pyx_t_8 = NULL;
20011   } else {
20012     __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 742, __pyx_L1_error)
20013     __Pyx_GOTREF(__pyx_t_3);
20014     __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 742, __pyx_L1_error)
20015   }
20016   for (;;) {
20017     if (likely(!__pyx_t_8)) {
20018       if (likely(PyList_CheckExact(__pyx_t_3))) {
20019         if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
20020         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
20021         __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(4, 742, __pyx_L1_error)
20022         #else
20023         __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 742, __pyx_L1_error)
20024         __Pyx_GOTREF(__pyx_t_9);
20025         #endif
20026       } else {
20027         if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
20028         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
20029         __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(4, 742, __pyx_L1_error)
20030         #else
20031         __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 742, __pyx_L1_error)
20032         __Pyx_GOTREF(__pyx_t_9);
20033         #endif
20034       }
20035     } else {
20036       __pyx_t_9 = __pyx_t_8(__pyx_t_3);
20037       if (unlikely(!__pyx_t_9)) {
20038         PyObject* exc_type = PyErr_Occurred();
20039         if (exc_type) {
20040           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
20041           else __PYX_ERR(4, 742, __pyx_L1_error)
20042         }
20043         break;
20044       }
20045       __Pyx_GOTREF(__pyx_t_9);
20046     }
20047     __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
20048     __pyx_t_9 = 0;
20049     __pyx_v_dim = __pyx_t_6;
20050     __pyx_t_6 = (__pyx_t_6 + 1);
20051 
20052     /* "View.MemoryView":743
20053  *
20054  *     for dim, index in enumerate(indices):
20055  *         if PyIndex_Check(index):             # <<<<<<<<<<<<<<
20056  *             slice_memviewslice(
20057  *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
20058  */
20059     __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
20060     if (__pyx_t_2) {
20061 
20062       /* "View.MemoryView":747
20063  *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
20064  *                 dim, new_ndim, p_suboffset_dim,
20065  *                 index, 0, 0, # start, stop, step             # <<<<<<<<<<<<<<
20066  *                 0, 0, 0, # have_{start,stop,step}
20067  *                 False)
20068  */
20069       __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 747, __pyx_L1_error)
20070 
20071       /* "View.MemoryView":744
20072  *     for dim, index in enumerate(indices):
20073  *         if PyIndex_Check(index):
20074  *             slice_memviewslice(             # <<<<<<<<<<<<<<
20075  *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
20076  *                 dim, new_ndim, p_suboffset_dim,
20077  */
20078       __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(4, 744, __pyx_L1_error)
20079 
20080       /* "View.MemoryView":743
20081  *
20082  *     for dim, index in enumerate(indices):
20083  *         if PyIndex_Check(index):             # <<<<<<<<<<<<<<
20084  *             slice_memviewslice(
20085  *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
20086  */
20087       goto __pyx_L6;
20088     }
20089 
20090     /* "View.MemoryView":750
20091  *                 0, 0, 0, # have_{start,stop,step}
20092  *                 False)
20093  *         elif index is None:             # <<<<<<<<<<<<<<
20094  *             p_dst.shape[new_ndim] = 1
20095  *             p_dst.strides[new_ndim] = 0
20096  */
20097     __pyx_t_2 = (__pyx_v_index == Py_None);
20098     __pyx_t_1 = (__pyx_t_2 != 0);
20099     if (__pyx_t_1) {
20100 
20101       /* "View.MemoryView":751
20102  *                 False)
20103  *         elif index is None:
20104  *             p_dst.shape[new_ndim] = 1             # <<<<<<<<<<<<<<
20105  *             p_dst.strides[new_ndim] = 0
20106  *             p_dst.suboffsets[new_ndim] = -1
20107  */
20108       (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
20109 
20110       /* "View.MemoryView":752
20111  *         elif index is None:
20112  *             p_dst.shape[new_ndim] = 1
20113  *             p_dst.strides[new_ndim] = 0             # <<<<<<<<<<<<<<
20114  *             p_dst.suboffsets[new_ndim] = -1
20115  *             new_ndim += 1
20116  */
20117       (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
20118 
20119       /* "View.MemoryView":753
20120  *             p_dst.shape[new_ndim] = 1
20121  *             p_dst.strides[new_ndim] = 0
20122  *             p_dst.suboffsets[new_ndim] = -1             # <<<<<<<<<<<<<<
20123  *             new_ndim += 1
20124  *         else:
20125  */
20126       (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
20127 
20128       /* "View.MemoryView":754
20129  *             p_dst.strides[new_ndim] = 0
20130  *             p_dst.suboffsets[new_ndim] = -1
20131  *             new_ndim += 1             # <<<<<<<<<<<<<<
20132  *         else:
20133  *             start = index.start or 0
20134  */
20135       __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
20136 
20137       /* "View.MemoryView":750
20138  *                 0, 0, 0, # have_{start,stop,step}
20139  *                 False)
20140  *         elif index is None:             # <<<<<<<<<<<<<<
20141  *             p_dst.shape[new_ndim] = 1
20142  *             p_dst.strides[new_ndim] = 0
20143  */
20144       goto __pyx_L6;
20145     }
20146 
20147     /* "View.MemoryView":756
20148  *             new_ndim += 1
20149  *         else:
20150  *             start = index.start or 0             # <<<<<<<<<<<<<<
20151  *             stop = index.stop or 0
20152  *             step = index.step or 0
20153  */
20154     /*else*/ {
20155       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 756, __pyx_L1_error)
20156       __Pyx_GOTREF(__pyx_t_9);
20157       __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 756, __pyx_L1_error)
20158       if (!__pyx_t_1) {
20159         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
20160       } else {
20161         __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 756, __pyx_L1_error)
20162         __pyx_t_10 = __pyx_t_12;
20163         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
20164         goto __pyx_L7_bool_binop_done;
20165       }
20166       __pyx_t_10 = 0;
20167       __pyx_L7_bool_binop_done:;
20168       __pyx_v_start = __pyx_t_10;
20169 
20170       /* "View.MemoryView":757
20171  *         else:
20172  *             start = index.start or 0
20173  *             stop = index.stop or 0             # <<<<<<<<<<<<<<
20174  *             step = index.step or 0
20175  *
20176  */
20177       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 757, __pyx_L1_error)
20178       __Pyx_GOTREF(__pyx_t_9);
20179       __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 757, __pyx_L1_error)
20180       if (!__pyx_t_1) {
20181         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
20182       } else {
20183         __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 757, __pyx_L1_error)
20184         __pyx_t_10 = __pyx_t_12;
20185         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
20186         goto __pyx_L9_bool_binop_done;
20187       }
20188       __pyx_t_10 = 0;
20189       __pyx_L9_bool_binop_done:;
20190       __pyx_v_stop = __pyx_t_10;
20191 
20192       /* "View.MemoryView":758
20193  *             start = index.start or 0
20194  *             stop = index.stop or 0
20195  *             step = index.step or 0             # <<<<<<<<<<<<<<
20196  *
20197  *             have_start = index.start is not None
20198  */
20199       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 758, __pyx_L1_error)
20200       __Pyx_GOTREF(__pyx_t_9);
20201       __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 758, __pyx_L1_error)
20202       if (!__pyx_t_1) {
20203         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
20204       } else {
20205         __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 758, __pyx_L1_error)
20206         __pyx_t_10 = __pyx_t_12;
20207         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
20208         goto __pyx_L11_bool_binop_done;
20209       }
20210       __pyx_t_10 = 0;
20211       __pyx_L11_bool_binop_done:;
20212       __pyx_v_step = __pyx_t_10;
20213 
20214       /* "View.MemoryView":760
20215  *             step = index.step or 0
20216  *
20217  *             have_start = index.start is not None             # <<<<<<<<<<<<<<
20218  *             have_stop = index.stop is not None
20219  *             have_step = index.step is not None
20220  */
20221       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 760, __pyx_L1_error)
20222       __Pyx_GOTREF(__pyx_t_9);
20223       __pyx_t_1 = (__pyx_t_9 != Py_None);
20224       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
20225       __pyx_v_have_start = __pyx_t_1;
20226 
20227       /* "View.MemoryView":761
20228  *
20229  *             have_start = index.start is not None
20230  *             have_stop = index.stop is not None             # <<<<<<<<<<<<<<
20231  *             have_step = index.step is not None
20232  *
20233  */
20234       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 761, __pyx_L1_error)
20235       __Pyx_GOTREF(__pyx_t_9);
20236       __pyx_t_1 = (__pyx_t_9 != Py_None);
20237       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
20238       __pyx_v_have_stop = __pyx_t_1;
20239 
20240       /* "View.MemoryView":762
20241  *             have_start = index.start is not None
20242  *             have_stop = index.stop is not None
20243  *             have_step = index.step is not None             # <<<<<<<<<<<<<<
20244  *
20245  *             slice_memviewslice(
20246  */
20247       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 762, __pyx_L1_error)
20248       __Pyx_GOTREF(__pyx_t_9);
20249       __pyx_t_1 = (__pyx_t_9 != Py_None);
20250       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
20251       __pyx_v_have_step = __pyx_t_1;
20252 
20253       /* "View.MemoryView":764
20254  *             have_step = index.step is not None
20255  *
20256  *             slice_memviewslice(             # <<<<<<<<<<<<<<
20257  *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
20258  *                 dim, new_ndim, p_suboffset_dim,
20259  */
20260       __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(4, 764, __pyx_L1_error)
20261 
20262       /* "View.MemoryView":770
20263  *                 have_start, have_stop, have_step,
20264  *                 True)
20265  *             new_ndim += 1             # <<<<<<<<<<<<<<
20266  *
20267  *     if isinstance(memview, _memoryviewslice):
20268  */
20269       __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
20270     }
20271     __pyx_L6:;
20272 
20273     /* "View.MemoryView":742
20274  *     cdef bint have_start, have_stop, have_step
20275  *
20276  *     for dim, index in enumerate(indices):             # <<<<<<<<<<<<<<
20277  *         if PyIndex_Check(index):
20278  *             slice_memviewslice(
20279  */
20280   }
20281   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20282 
20283   /* "View.MemoryView":772
20284  *             new_ndim += 1
20285  *
20286  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
20287  *         return memoryview_fromslice(dst, new_ndim,
20288  *                                     memviewsliceobj.to_object_func,
20289  */
20290   __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
20291   __pyx_t_2 = (__pyx_t_1 != 0);
20292   if (__pyx_t_2) {
20293 
20294     /* "View.MemoryView":773
20295  *
20296  *     if isinstance(memview, _memoryviewslice):
20297  *         return memoryview_fromslice(dst, new_ndim,             # <<<<<<<<<<<<<<
20298  *                                     memviewsliceobj.to_object_func,
20299  *                                     memviewsliceobj.to_dtype_func,
20300  */
20301     __Pyx_XDECREF(((PyObject *)__pyx_r));
20302 
20303     /* "View.MemoryView":774
20304  *     if isinstance(memview, _memoryviewslice):
20305  *         return memoryview_fromslice(dst, new_ndim,
20306  *                                     memviewsliceobj.to_object_func,             # <<<<<<<<<<<<<<
20307  *                                     memviewsliceobj.to_dtype_func,
20308  *                                     memview.dtype_is_object)
20309  */
20310     if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(4, 774, __pyx_L1_error) }
20311 
20312     /* "View.MemoryView":775
20313  *         return memoryview_fromslice(dst, new_ndim,
20314  *                                     memviewsliceobj.to_object_func,
20315  *                                     memviewsliceobj.to_dtype_func,             # <<<<<<<<<<<<<<
20316  *                                     memview.dtype_is_object)
20317  *     else:
20318  */
20319     if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(4, 775, __pyx_L1_error) }
20320 
20321     /* "View.MemoryView":773
20322  *
20323  *     if isinstance(memview, _memoryviewslice):
20324  *         return memoryview_fromslice(dst, new_ndim,             # <<<<<<<<<<<<<<
20325  *                                     memviewsliceobj.to_object_func,
20326  *                                     memviewsliceobj.to_dtype_func,
20327  */
20328     __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(4, 773, __pyx_L1_error)
20329     __Pyx_GOTREF(__pyx_t_3);
20330     if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(4, 773, __pyx_L1_error)
20331     __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
20332     __pyx_t_3 = 0;
20333     goto __pyx_L0;
20334 
20335     /* "View.MemoryView":772
20336  *             new_ndim += 1
20337  *
20338  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
20339  *         return memoryview_fromslice(dst, new_ndim,
20340  *                                     memviewsliceobj.to_object_func,
20341  */
20342   }
20343 
20344   /* "View.MemoryView":778
20345  *                                     memview.dtype_is_object)
20346  *     else:
20347  *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,             # <<<<<<<<<<<<<<
20348  *                                     memview.dtype_is_object)
20349  *
20350  */
20351   /*else*/ {
20352     __Pyx_XDECREF(((PyObject *)__pyx_r));
20353 
20354     /* "View.MemoryView":779
20355  *     else:
20356  *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,
20357  *                                     memview.dtype_is_object)             # <<<<<<<<<<<<<<
20358  *
20359  *
20360  */
20361     __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(4, 778, __pyx_L1_error)
20362     __Pyx_GOTREF(__pyx_t_3);
20363 
20364     /* "View.MemoryView":778
20365  *                                     memview.dtype_is_object)
20366  *     else:
20367  *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,             # <<<<<<<<<<<<<<
20368  *                                     memview.dtype_is_object)
20369  *
20370  */
20371     if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(4, 778, __pyx_L1_error)
20372     __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
20373     __pyx_t_3 = 0;
20374     goto __pyx_L0;
20375   }
20376 
20377   /* "View.MemoryView":706
20378  *
20379  * @cname('__pyx_memview_slice')
20380  * cdef memoryview memview_slice(memoryview memview, object indices):             # <<<<<<<<<<<<<<
20381  *     cdef int new_ndim = 0, suboffset_dim = -1, dim
20382  *     cdef bint negative_step
20383  */
20384 
20385   /* function exit code */
20386   __pyx_L1_error:;
20387   __Pyx_XDECREF(__pyx_t_3);
20388   __Pyx_XDECREF(__pyx_t_9);
20389   __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
20390   __pyx_r = 0;
20391   __pyx_L0:;
20392   __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
20393   __Pyx_XDECREF(__pyx_v_index);
20394   __Pyx_XGIVEREF((PyObject *)__pyx_r);
20395   __Pyx_RefNannyFinishContext();
20396   return __pyx_r;
20397 }
20398 
20399 /* "View.MemoryView":803
20400  *
20401  * @cname('__pyx_memoryview_slice_memviewslice')
20402  * cdef int slice_memviewslice(             # <<<<<<<<<<<<<<
20403  *         __Pyx_memviewslice *dst,
20404  *         Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
20405  */
20406 
__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)20407 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) {
20408   Py_ssize_t __pyx_v_new_shape;
20409   int __pyx_v_negative_step;
20410   int __pyx_r;
20411   int __pyx_t_1;
20412   int __pyx_t_2;
20413   int __pyx_t_3;
20414 
20415   /* "View.MemoryView":823
20416  *     cdef bint negative_step
20417  *
20418  *     if not is_slice:             # <<<<<<<<<<<<<<
20419  *
20420  *         if start < 0:
20421  */
20422   __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
20423   if (__pyx_t_1) {
20424 
20425     /* "View.MemoryView":825
20426  *     if not is_slice:
20427  *
20428  *         if start < 0:             # <<<<<<<<<<<<<<
20429  *             start += shape
20430  *         if not 0 <= start < shape:
20431  */
20432     __pyx_t_1 = ((__pyx_v_start < 0) != 0);
20433     if (__pyx_t_1) {
20434 
20435       /* "View.MemoryView":826
20436  *
20437  *         if start < 0:
20438  *             start += shape             # <<<<<<<<<<<<<<
20439  *         if not 0 <= start < shape:
20440  *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
20441  */
20442       __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
20443 
20444       /* "View.MemoryView":825
20445  *     if not is_slice:
20446  *
20447  *         if start < 0:             # <<<<<<<<<<<<<<
20448  *             start += shape
20449  *         if not 0 <= start < shape:
20450  */
20451     }
20452 
20453     /* "View.MemoryView":827
20454  *         if start < 0:
20455  *             start += shape
20456  *         if not 0 <= start < shape:             # <<<<<<<<<<<<<<
20457  *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
20458  *     else:
20459  */
20460     __pyx_t_1 = (0 <= __pyx_v_start);
20461     if (__pyx_t_1) {
20462       __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
20463     }
20464     __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
20465     if (__pyx_t_2) {
20466 
20467       /* "View.MemoryView":828
20468  *             start += shape
20469  *         if not 0 <= start < shape:
20470  *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)             # <<<<<<<<<<<<<<
20471  *     else:
20472  *
20473  */
20474       __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(4, 828, __pyx_L1_error)
20475 
20476       /* "View.MemoryView":827
20477  *         if start < 0:
20478  *             start += shape
20479  *         if not 0 <= start < shape:             # <<<<<<<<<<<<<<
20480  *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
20481  *     else:
20482  */
20483     }
20484 
20485     /* "View.MemoryView":823
20486  *     cdef bint negative_step
20487  *
20488  *     if not is_slice:             # <<<<<<<<<<<<<<
20489  *
20490  *         if start < 0:
20491  */
20492     goto __pyx_L3;
20493   }
20494 
20495   /* "View.MemoryView":831
20496  *     else:
20497  *
20498  *         negative_step = have_step != 0 and step < 0             # <<<<<<<<<<<<<<
20499  *
20500  *         if have_step and step == 0:
20501  */
20502   /*else*/ {
20503     __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
20504     if (__pyx_t_1) {
20505     } else {
20506       __pyx_t_2 = __pyx_t_1;
20507       goto __pyx_L6_bool_binop_done;
20508     }
20509     __pyx_t_1 = ((__pyx_v_step < 0) != 0);
20510     __pyx_t_2 = __pyx_t_1;
20511     __pyx_L6_bool_binop_done:;
20512     __pyx_v_negative_step = __pyx_t_2;
20513 
20514     /* "View.MemoryView":833
20515  *         negative_step = have_step != 0 and step < 0
20516  *
20517  *         if have_step and step == 0:             # <<<<<<<<<<<<<<
20518  *             _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
20519  *
20520  */
20521     __pyx_t_1 = (__pyx_v_have_step != 0);
20522     if (__pyx_t_1) {
20523     } else {
20524       __pyx_t_2 = __pyx_t_1;
20525       goto __pyx_L9_bool_binop_done;
20526     }
20527     __pyx_t_1 = ((__pyx_v_step == 0) != 0);
20528     __pyx_t_2 = __pyx_t_1;
20529     __pyx_L9_bool_binop_done:;
20530     if (__pyx_t_2) {
20531 
20532       /* "View.MemoryView":834
20533  *
20534  *         if have_step and step == 0:
20535  *             _err_dim(ValueError, "Step may not be zero (axis %d)", dim)             # <<<<<<<<<<<<<<
20536  *
20537  *
20538  */
20539       __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(4, 834, __pyx_L1_error)
20540 
20541       /* "View.MemoryView":833
20542  *         negative_step = have_step != 0 and step < 0
20543  *
20544  *         if have_step and step == 0:             # <<<<<<<<<<<<<<
20545  *             _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
20546  *
20547  */
20548     }
20549 
20550     /* "View.MemoryView":837
20551  *
20552  *
20553  *         if have_start:             # <<<<<<<<<<<<<<
20554  *             if start < 0:
20555  *                 start += shape
20556  */
20557     __pyx_t_2 = (__pyx_v_have_start != 0);
20558     if (__pyx_t_2) {
20559 
20560       /* "View.MemoryView":838
20561  *
20562  *         if have_start:
20563  *             if start < 0:             # <<<<<<<<<<<<<<
20564  *                 start += shape
20565  *                 if start < 0:
20566  */
20567       __pyx_t_2 = ((__pyx_v_start < 0) != 0);
20568       if (__pyx_t_2) {
20569 
20570         /* "View.MemoryView":839
20571  *         if have_start:
20572  *             if start < 0:
20573  *                 start += shape             # <<<<<<<<<<<<<<
20574  *                 if start < 0:
20575  *                     start = 0
20576  */
20577         __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
20578 
20579         /* "View.MemoryView":840
20580  *             if start < 0:
20581  *                 start += shape
20582  *                 if start < 0:             # <<<<<<<<<<<<<<
20583  *                     start = 0
20584  *             elif start >= shape:
20585  */
20586         __pyx_t_2 = ((__pyx_v_start < 0) != 0);
20587         if (__pyx_t_2) {
20588 
20589           /* "View.MemoryView":841
20590  *                 start += shape
20591  *                 if start < 0:
20592  *                     start = 0             # <<<<<<<<<<<<<<
20593  *             elif start >= shape:
20594  *                 if negative_step:
20595  */
20596           __pyx_v_start = 0;
20597 
20598           /* "View.MemoryView":840
20599  *             if start < 0:
20600  *                 start += shape
20601  *                 if start < 0:             # <<<<<<<<<<<<<<
20602  *                     start = 0
20603  *             elif start >= shape:
20604  */
20605         }
20606 
20607         /* "View.MemoryView":838
20608  *
20609  *         if have_start:
20610  *             if start < 0:             # <<<<<<<<<<<<<<
20611  *                 start += shape
20612  *                 if start < 0:
20613  */
20614         goto __pyx_L12;
20615       }
20616 
20617       /* "View.MemoryView":842
20618  *                 if start < 0:
20619  *                     start = 0
20620  *             elif start >= shape:             # <<<<<<<<<<<<<<
20621  *                 if negative_step:
20622  *                     start = shape - 1
20623  */
20624       __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
20625       if (__pyx_t_2) {
20626 
20627         /* "View.MemoryView":843
20628  *                     start = 0
20629  *             elif start >= shape:
20630  *                 if negative_step:             # <<<<<<<<<<<<<<
20631  *                     start = shape - 1
20632  *                 else:
20633  */
20634         __pyx_t_2 = (__pyx_v_negative_step != 0);
20635         if (__pyx_t_2) {
20636 
20637           /* "View.MemoryView":844
20638  *             elif start >= shape:
20639  *                 if negative_step:
20640  *                     start = shape - 1             # <<<<<<<<<<<<<<
20641  *                 else:
20642  *                     start = shape
20643  */
20644           __pyx_v_start = (__pyx_v_shape - 1);
20645 
20646           /* "View.MemoryView":843
20647  *                     start = 0
20648  *             elif start >= shape:
20649  *                 if negative_step:             # <<<<<<<<<<<<<<
20650  *                     start = shape - 1
20651  *                 else:
20652  */
20653           goto __pyx_L14;
20654         }
20655 
20656         /* "View.MemoryView":846
20657  *                     start = shape - 1
20658  *                 else:
20659  *                     start = shape             # <<<<<<<<<<<<<<
20660  *         else:
20661  *             if negative_step:
20662  */
20663         /*else*/ {
20664           __pyx_v_start = __pyx_v_shape;
20665         }
20666         __pyx_L14:;
20667 
20668         /* "View.MemoryView":842
20669  *                 if start < 0:
20670  *                     start = 0
20671  *             elif start >= shape:             # <<<<<<<<<<<<<<
20672  *                 if negative_step:
20673  *                     start = shape - 1
20674  */
20675       }
20676       __pyx_L12:;
20677 
20678       /* "View.MemoryView":837
20679  *
20680  *
20681  *         if have_start:             # <<<<<<<<<<<<<<
20682  *             if start < 0:
20683  *                 start += shape
20684  */
20685       goto __pyx_L11;
20686     }
20687 
20688     /* "View.MemoryView":848
20689  *                     start = shape
20690  *         else:
20691  *             if negative_step:             # <<<<<<<<<<<<<<
20692  *                 start = shape - 1
20693  *             else:
20694  */
20695     /*else*/ {
20696       __pyx_t_2 = (__pyx_v_negative_step != 0);
20697       if (__pyx_t_2) {
20698 
20699         /* "View.MemoryView":849
20700  *         else:
20701  *             if negative_step:
20702  *                 start = shape - 1             # <<<<<<<<<<<<<<
20703  *             else:
20704  *                 start = 0
20705  */
20706         __pyx_v_start = (__pyx_v_shape - 1);
20707 
20708         /* "View.MemoryView":848
20709  *                     start = shape
20710  *         else:
20711  *             if negative_step:             # <<<<<<<<<<<<<<
20712  *                 start = shape - 1
20713  *             else:
20714  */
20715         goto __pyx_L15;
20716       }
20717 
20718       /* "View.MemoryView":851
20719  *                 start = shape - 1
20720  *             else:
20721  *                 start = 0             # <<<<<<<<<<<<<<
20722  *
20723  *         if have_stop:
20724  */
20725       /*else*/ {
20726         __pyx_v_start = 0;
20727       }
20728       __pyx_L15:;
20729     }
20730     __pyx_L11:;
20731 
20732     /* "View.MemoryView":853
20733  *                 start = 0
20734  *
20735  *         if have_stop:             # <<<<<<<<<<<<<<
20736  *             if stop < 0:
20737  *                 stop += shape
20738  */
20739     __pyx_t_2 = (__pyx_v_have_stop != 0);
20740     if (__pyx_t_2) {
20741 
20742       /* "View.MemoryView":854
20743  *
20744  *         if have_stop:
20745  *             if stop < 0:             # <<<<<<<<<<<<<<
20746  *                 stop += shape
20747  *                 if stop < 0:
20748  */
20749       __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
20750       if (__pyx_t_2) {
20751 
20752         /* "View.MemoryView":855
20753  *         if have_stop:
20754  *             if stop < 0:
20755  *                 stop += shape             # <<<<<<<<<<<<<<
20756  *                 if stop < 0:
20757  *                     stop = 0
20758  */
20759         __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
20760 
20761         /* "View.MemoryView":856
20762  *             if stop < 0:
20763  *                 stop += shape
20764  *                 if stop < 0:             # <<<<<<<<<<<<<<
20765  *                     stop = 0
20766  *             elif stop > shape:
20767  */
20768         __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
20769         if (__pyx_t_2) {
20770 
20771           /* "View.MemoryView":857
20772  *                 stop += shape
20773  *                 if stop < 0:
20774  *                     stop = 0             # <<<<<<<<<<<<<<
20775  *             elif stop > shape:
20776  *                 stop = shape
20777  */
20778           __pyx_v_stop = 0;
20779 
20780           /* "View.MemoryView":856
20781  *             if stop < 0:
20782  *                 stop += shape
20783  *                 if stop < 0:             # <<<<<<<<<<<<<<
20784  *                     stop = 0
20785  *             elif stop > shape:
20786  */
20787         }
20788 
20789         /* "View.MemoryView":854
20790  *
20791  *         if have_stop:
20792  *             if stop < 0:             # <<<<<<<<<<<<<<
20793  *                 stop += shape
20794  *                 if stop < 0:
20795  */
20796         goto __pyx_L17;
20797       }
20798 
20799       /* "View.MemoryView":858
20800  *                 if stop < 0:
20801  *                     stop = 0
20802  *             elif stop > shape:             # <<<<<<<<<<<<<<
20803  *                 stop = shape
20804  *         else:
20805  */
20806       __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
20807       if (__pyx_t_2) {
20808 
20809         /* "View.MemoryView":859
20810  *                     stop = 0
20811  *             elif stop > shape:
20812  *                 stop = shape             # <<<<<<<<<<<<<<
20813  *         else:
20814  *             if negative_step:
20815  */
20816         __pyx_v_stop = __pyx_v_shape;
20817 
20818         /* "View.MemoryView":858
20819  *                 if stop < 0:
20820  *                     stop = 0
20821  *             elif stop > shape:             # <<<<<<<<<<<<<<
20822  *                 stop = shape
20823  *         else:
20824  */
20825       }
20826       __pyx_L17:;
20827 
20828       /* "View.MemoryView":853
20829  *                 start = 0
20830  *
20831  *         if have_stop:             # <<<<<<<<<<<<<<
20832  *             if stop < 0:
20833  *                 stop += shape
20834  */
20835       goto __pyx_L16;
20836     }
20837 
20838     /* "View.MemoryView":861
20839  *                 stop = shape
20840  *         else:
20841  *             if negative_step:             # <<<<<<<<<<<<<<
20842  *                 stop = -1
20843  *             else:
20844  */
20845     /*else*/ {
20846       __pyx_t_2 = (__pyx_v_negative_step != 0);
20847       if (__pyx_t_2) {
20848 
20849         /* "View.MemoryView":862
20850  *         else:
20851  *             if negative_step:
20852  *                 stop = -1             # <<<<<<<<<<<<<<
20853  *             else:
20854  *                 stop = shape
20855  */
20856         __pyx_v_stop = -1L;
20857 
20858         /* "View.MemoryView":861
20859  *                 stop = shape
20860  *         else:
20861  *             if negative_step:             # <<<<<<<<<<<<<<
20862  *                 stop = -1
20863  *             else:
20864  */
20865         goto __pyx_L19;
20866       }
20867 
20868       /* "View.MemoryView":864
20869  *                 stop = -1
20870  *             else:
20871  *                 stop = shape             # <<<<<<<<<<<<<<
20872  *
20873  *         if not have_step:
20874  */
20875       /*else*/ {
20876         __pyx_v_stop = __pyx_v_shape;
20877       }
20878       __pyx_L19:;
20879     }
20880     __pyx_L16:;
20881 
20882     /* "View.MemoryView":866
20883  *                 stop = shape
20884  *
20885  *         if not have_step:             # <<<<<<<<<<<<<<
20886  *             step = 1
20887  *
20888  */
20889     __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
20890     if (__pyx_t_2) {
20891 
20892       /* "View.MemoryView":867
20893  *
20894  *         if not have_step:
20895  *             step = 1             # <<<<<<<<<<<<<<
20896  *
20897  *
20898  */
20899       __pyx_v_step = 1;
20900 
20901       /* "View.MemoryView":866
20902  *                 stop = shape
20903  *
20904  *         if not have_step:             # <<<<<<<<<<<<<<
20905  *             step = 1
20906  *
20907  */
20908     }
20909 
20910     /* "View.MemoryView":871
20911  *
20912  *         with cython.cdivision(True):
20913  *             new_shape = (stop - start) // step             # <<<<<<<<<<<<<<
20914  *
20915  *             if (stop - start) - step * new_shape:
20916  */
20917     __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
20918 
20919     /* "View.MemoryView":873
20920  *             new_shape = (stop - start) // step
20921  *
20922  *             if (stop - start) - step * new_shape:             # <<<<<<<<<<<<<<
20923  *                 new_shape += 1
20924  *
20925  */
20926     __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
20927     if (__pyx_t_2) {
20928 
20929       /* "View.MemoryView":874
20930  *
20931  *             if (stop - start) - step * new_shape:
20932  *                 new_shape += 1             # <<<<<<<<<<<<<<
20933  *
20934  *         if new_shape < 0:
20935  */
20936       __pyx_v_new_shape = (__pyx_v_new_shape + 1);
20937 
20938       /* "View.MemoryView":873
20939  *             new_shape = (stop - start) // step
20940  *
20941  *             if (stop - start) - step * new_shape:             # <<<<<<<<<<<<<<
20942  *                 new_shape += 1
20943  *
20944  */
20945     }
20946 
20947     /* "View.MemoryView":876
20948  *                 new_shape += 1
20949  *
20950  *         if new_shape < 0:             # <<<<<<<<<<<<<<
20951  *             new_shape = 0
20952  *
20953  */
20954     __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
20955     if (__pyx_t_2) {
20956 
20957       /* "View.MemoryView":877
20958  *
20959  *         if new_shape < 0:
20960  *             new_shape = 0             # <<<<<<<<<<<<<<
20961  *
20962  *
20963  */
20964       __pyx_v_new_shape = 0;
20965 
20966       /* "View.MemoryView":876
20967  *                 new_shape += 1
20968  *
20969  *         if new_shape < 0:             # <<<<<<<<<<<<<<
20970  *             new_shape = 0
20971  *
20972  */
20973     }
20974 
20975     /* "View.MemoryView":880
20976  *
20977  *
20978  *         dst.strides[new_ndim] = stride * step             # <<<<<<<<<<<<<<
20979  *         dst.shape[new_ndim] = new_shape
20980  *         dst.suboffsets[new_ndim] = suboffset
20981  */
20982     (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
20983 
20984     /* "View.MemoryView":881
20985  *
20986  *         dst.strides[new_ndim] = stride * step
20987  *         dst.shape[new_ndim] = new_shape             # <<<<<<<<<<<<<<
20988  *         dst.suboffsets[new_ndim] = suboffset
20989  *
20990  */
20991     (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
20992 
20993     /* "View.MemoryView":882
20994  *         dst.strides[new_ndim] = stride * step
20995  *         dst.shape[new_ndim] = new_shape
20996  *         dst.suboffsets[new_ndim] = suboffset             # <<<<<<<<<<<<<<
20997  *
20998  *
20999  */
21000     (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
21001   }
21002   __pyx_L3:;
21003 
21004   /* "View.MemoryView":885
21005  *
21006  *
21007  *     if suboffset_dim[0] < 0:             # <<<<<<<<<<<<<<
21008  *         dst.data += start * stride
21009  *     else:
21010  */
21011   __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
21012   if (__pyx_t_2) {
21013 
21014     /* "View.MemoryView":886
21015  *
21016  *     if suboffset_dim[0] < 0:
21017  *         dst.data += start * stride             # <<<<<<<<<<<<<<
21018  *     else:
21019  *         dst.suboffsets[suboffset_dim[0]] += start * stride
21020  */
21021     __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
21022 
21023     /* "View.MemoryView":885
21024  *
21025  *
21026  *     if suboffset_dim[0] < 0:             # <<<<<<<<<<<<<<
21027  *         dst.data += start * stride
21028  *     else:
21029  */
21030     goto __pyx_L23;
21031   }
21032 
21033   /* "View.MemoryView":888
21034  *         dst.data += start * stride
21035  *     else:
21036  *         dst.suboffsets[suboffset_dim[0]] += start * stride             # <<<<<<<<<<<<<<
21037  *
21038  *     if suboffset >= 0:
21039  */
21040   /*else*/ {
21041     __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
21042     (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
21043   }
21044   __pyx_L23:;
21045 
21046   /* "View.MemoryView":890
21047  *         dst.suboffsets[suboffset_dim[0]] += start * stride
21048  *
21049  *     if suboffset >= 0:             # <<<<<<<<<<<<<<
21050  *         if not is_slice:
21051  *             if new_ndim == 0:
21052  */
21053   __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
21054   if (__pyx_t_2) {
21055 
21056     /* "View.MemoryView":891
21057  *
21058  *     if suboffset >= 0:
21059  *         if not is_slice:             # <<<<<<<<<<<<<<
21060  *             if new_ndim == 0:
21061  *                 dst.data = (<char **> dst.data)[0] + suboffset
21062  */
21063     __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
21064     if (__pyx_t_2) {
21065 
21066       /* "View.MemoryView":892
21067  *     if suboffset >= 0:
21068  *         if not is_slice:
21069  *             if new_ndim == 0:             # <<<<<<<<<<<<<<
21070  *                 dst.data = (<char **> dst.data)[0] + suboffset
21071  *             else:
21072  */
21073       __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
21074       if (__pyx_t_2) {
21075 
21076         /* "View.MemoryView":893
21077  *         if not is_slice:
21078  *             if new_ndim == 0:
21079  *                 dst.data = (<char **> dst.data)[0] + suboffset             # <<<<<<<<<<<<<<
21080  *             else:
21081  *                 _err_dim(IndexError, "All dimensions preceding dimension %d "
21082  */
21083         __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
21084 
21085         /* "View.MemoryView":892
21086  *     if suboffset >= 0:
21087  *         if not is_slice:
21088  *             if new_ndim == 0:             # <<<<<<<<<<<<<<
21089  *                 dst.data = (<char **> dst.data)[0] + suboffset
21090  *             else:
21091  */
21092         goto __pyx_L26;
21093       }
21094 
21095       /* "View.MemoryView":895
21096  *                 dst.data = (<char **> dst.data)[0] + suboffset
21097  *             else:
21098  *                 _err_dim(IndexError, "All dimensions preceding dimension %d "             # <<<<<<<<<<<<<<
21099  *                                      "must be indexed and not sliced", dim)
21100  *         else:
21101  */
21102       /*else*/ {
21103 
21104         /* "View.MemoryView":896
21105  *             else:
21106  *                 _err_dim(IndexError, "All dimensions preceding dimension %d "
21107  *                                      "must be indexed and not sliced", dim)             # <<<<<<<<<<<<<<
21108  *         else:
21109  *             suboffset_dim[0] = new_ndim
21110  */
21111         __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(4, 895, __pyx_L1_error)
21112       }
21113       __pyx_L26:;
21114 
21115       /* "View.MemoryView":891
21116  *
21117  *     if suboffset >= 0:
21118  *         if not is_slice:             # <<<<<<<<<<<<<<
21119  *             if new_ndim == 0:
21120  *                 dst.data = (<char **> dst.data)[0] + suboffset
21121  */
21122       goto __pyx_L25;
21123     }
21124 
21125     /* "View.MemoryView":898
21126  *                                      "must be indexed and not sliced", dim)
21127  *         else:
21128  *             suboffset_dim[0] = new_ndim             # <<<<<<<<<<<<<<
21129  *
21130  *     return 0
21131  */
21132     /*else*/ {
21133       (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
21134     }
21135     __pyx_L25:;
21136 
21137     /* "View.MemoryView":890
21138  *         dst.suboffsets[suboffset_dim[0]] += start * stride
21139  *
21140  *     if suboffset >= 0:             # <<<<<<<<<<<<<<
21141  *         if not is_slice:
21142  *             if new_ndim == 0:
21143  */
21144   }
21145 
21146   /* "View.MemoryView":900
21147  *             suboffset_dim[0] = new_ndim
21148  *
21149  *     return 0             # <<<<<<<<<<<<<<
21150  *
21151  *
21152  */
21153   __pyx_r = 0;
21154   goto __pyx_L0;
21155 
21156   /* "View.MemoryView":803
21157  *
21158  * @cname('__pyx_memoryview_slice_memviewslice')
21159  * cdef int slice_memviewslice(             # <<<<<<<<<<<<<<
21160  *         __Pyx_memviewslice *dst,
21161  *         Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
21162  */
21163 
21164   /* function exit code */
21165   __pyx_L1_error:;
21166   {
21167     #ifdef WITH_THREAD
21168     PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
21169     #endif
21170     __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
21171     #ifdef WITH_THREAD
21172     __Pyx_PyGILState_Release(__pyx_gilstate_save);
21173     #endif
21174   }
21175   __pyx_r = -1;
21176   __pyx_L0:;
21177   return __pyx_r;
21178 }
21179 
21180 /* "View.MemoryView":906
21181  *
21182  * @cname('__pyx_pybuffer_index')
21183  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,             # <<<<<<<<<<<<<<
21184  *                           Py_ssize_t dim) except NULL:
21185  *     cdef Py_ssize_t shape, stride, suboffset = -1
21186  */
21187 
__pyx_pybuffer_index(Py_buffer * __pyx_v_view,char * __pyx_v_bufp,Py_ssize_t __pyx_v_index,Py_ssize_t __pyx_v_dim)21188 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) {
21189   Py_ssize_t __pyx_v_shape;
21190   Py_ssize_t __pyx_v_stride;
21191   Py_ssize_t __pyx_v_suboffset;
21192   Py_ssize_t __pyx_v_itemsize;
21193   char *__pyx_v_resultp;
21194   char *__pyx_r;
21195   __Pyx_RefNannyDeclarations
21196   Py_ssize_t __pyx_t_1;
21197   int __pyx_t_2;
21198   PyObject *__pyx_t_3 = NULL;
21199   PyObject *__pyx_t_4 = NULL;
21200   __Pyx_RefNannySetupContext("pybuffer_index", 0);
21201 
21202   /* "View.MemoryView":908
21203  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
21204  *                           Py_ssize_t dim) except NULL:
21205  *     cdef Py_ssize_t shape, stride, suboffset = -1             # <<<<<<<<<<<<<<
21206  *     cdef Py_ssize_t itemsize = view.itemsize
21207  *     cdef char *resultp
21208  */
21209   __pyx_v_suboffset = -1L;
21210 
21211   /* "View.MemoryView":909
21212  *                           Py_ssize_t dim) except NULL:
21213  *     cdef Py_ssize_t shape, stride, suboffset = -1
21214  *     cdef Py_ssize_t itemsize = view.itemsize             # <<<<<<<<<<<<<<
21215  *     cdef char *resultp
21216  *
21217  */
21218   __pyx_t_1 = __pyx_v_view->itemsize;
21219   __pyx_v_itemsize = __pyx_t_1;
21220 
21221   /* "View.MemoryView":912
21222  *     cdef char *resultp
21223  *
21224  *     if view.ndim == 0:             # <<<<<<<<<<<<<<
21225  *         shape = view.len / itemsize
21226  *         stride = itemsize
21227  */
21228   __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
21229   if (__pyx_t_2) {
21230 
21231     /* "View.MemoryView":913
21232  *
21233  *     if view.ndim == 0:
21234  *         shape = view.len / itemsize             # <<<<<<<<<<<<<<
21235  *         stride = itemsize
21236  *     else:
21237  */
21238     if (unlikely(__pyx_v_itemsize == 0)) {
21239       PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
21240       __PYX_ERR(4, 913, __pyx_L1_error)
21241     }
21242     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))) {
21243       PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
21244       __PYX_ERR(4, 913, __pyx_L1_error)
21245     }
21246     __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
21247 
21248     /* "View.MemoryView":914
21249  *     if view.ndim == 0:
21250  *         shape = view.len / itemsize
21251  *         stride = itemsize             # <<<<<<<<<<<<<<
21252  *     else:
21253  *         shape = view.shape[dim]
21254  */
21255     __pyx_v_stride = __pyx_v_itemsize;
21256 
21257     /* "View.MemoryView":912
21258  *     cdef char *resultp
21259  *
21260  *     if view.ndim == 0:             # <<<<<<<<<<<<<<
21261  *         shape = view.len / itemsize
21262  *         stride = itemsize
21263  */
21264     goto __pyx_L3;
21265   }
21266 
21267   /* "View.MemoryView":916
21268  *         stride = itemsize
21269  *     else:
21270  *         shape = view.shape[dim]             # <<<<<<<<<<<<<<
21271  *         stride = view.strides[dim]
21272  *         if view.suboffsets != NULL:
21273  */
21274   /*else*/ {
21275     __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
21276 
21277     /* "View.MemoryView":917
21278  *     else:
21279  *         shape = view.shape[dim]
21280  *         stride = view.strides[dim]             # <<<<<<<<<<<<<<
21281  *         if view.suboffsets != NULL:
21282  *             suboffset = view.suboffsets[dim]
21283  */
21284     __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
21285 
21286     /* "View.MemoryView":918
21287  *         shape = view.shape[dim]
21288  *         stride = view.strides[dim]
21289  *         if view.suboffsets != NULL:             # <<<<<<<<<<<<<<
21290  *             suboffset = view.suboffsets[dim]
21291  *
21292  */
21293     __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
21294     if (__pyx_t_2) {
21295 
21296       /* "View.MemoryView":919
21297  *         stride = view.strides[dim]
21298  *         if view.suboffsets != NULL:
21299  *             suboffset = view.suboffsets[dim]             # <<<<<<<<<<<<<<
21300  *
21301  *     if index < 0:
21302  */
21303       __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
21304 
21305       /* "View.MemoryView":918
21306  *         shape = view.shape[dim]
21307  *         stride = view.strides[dim]
21308  *         if view.suboffsets != NULL:             # <<<<<<<<<<<<<<
21309  *             suboffset = view.suboffsets[dim]
21310  *
21311  */
21312     }
21313   }
21314   __pyx_L3:;
21315 
21316   /* "View.MemoryView":921
21317  *             suboffset = view.suboffsets[dim]
21318  *
21319  *     if index < 0:             # <<<<<<<<<<<<<<
21320  *         index += view.shape[dim]
21321  *         if index < 0:
21322  */
21323   __pyx_t_2 = ((__pyx_v_index < 0) != 0);
21324   if (__pyx_t_2) {
21325 
21326     /* "View.MemoryView":922
21327  *
21328  *     if index < 0:
21329  *         index += view.shape[dim]             # <<<<<<<<<<<<<<
21330  *         if index < 0:
21331  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
21332  */
21333     __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
21334 
21335     /* "View.MemoryView":923
21336  *     if index < 0:
21337  *         index += view.shape[dim]
21338  *         if index < 0:             # <<<<<<<<<<<<<<
21339  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
21340  *
21341  */
21342     __pyx_t_2 = ((__pyx_v_index < 0) != 0);
21343     if (unlikely(__pyx_t_2)) {
21344 
21345       /* "View.MemoryView":924
21346  *         index += view.shape[dim]
21347  *         if index < 0:
21348  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)             # <<<<<<<<<<<<<<
21349  *
21350  *     if index >= shape:
21351  */
21352       __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 924, __pyx_L1_error)
21353       __Pyx_GOTREF(__pyx_t_3);
21354       __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(4, 924, __pyx_L1_error)
21355       __Pyx_GOTREF(__pyx_t_4);
21356       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21357       __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 924, __pyx_L1_error)
21358       __Pyx_GOTREF(__pyx_t_3);
21359       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21360       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
21361       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21362       __PYX_ERR(4, 924, __pyx_L1_error)
21363 
21364       /* "View.MemoryView":923
21365  *     if index < 0:
21366  *         index += view.shape[dim]
21367  *         if index < 0:             # <<<<<<<<<<<<<<
21368  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
21369  *
21370  */
21371     }
21372 
21373     /* "View.MemoryView":921
21374  *             suboffset = view.suboffsets[dim]
21375  *
21376  *     if index < 0:             # <<<<<<<<<<<<<<
21377  *         index += view.shape[dim]
21378  *         if index < 0:
21379  */
21380   }
21381 
21382   /* "View.MemoryView":926
21383  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
21384  *
21385  *     if index >= shape:             # <<<<<<<<<<<<<<
21386  *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
21387  *
21388  */
21389   __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
21390   if (unlikely(__pyx_t_2)) {
21391 
21392     /* "View.MemoryView":927
21393  *
21394  *     if index >= shape:
21395  *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)             # <<<<<<<<<<<<<<
21396  *
21397  *     resultp = bufp + index * stride
21398  */
21399     __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 927, __pyx_L1_error)
21400     __Pyx_GOTREF(__pyx_t_3);
21401     __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(4, 927, __pyx_L1_error)
21402     __Pyx_GOTREF(__pyx_t_4);
21403     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21404     __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 927, __pyx_L1_error)
21405     __Pyx_GOTREF(__pyx_t_3);
21406     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21407     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
21408     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21409     __PYX_ERR(4, 927, __pyx_L1_error)
21410 
21411     /* "View.MemoryView":926
21412  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
21413  *
21414  *     if index >= shape:             # <<<<<<<<<<<<<<
21415  *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
21416  *
21417  */
21418   }
21419 
21420   /* "View.MemoryView":929
21421  *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
21422  *
21423  *     resultp = bufp + index * stride             # <<<<<<<<<<<<<<
21424  *     if suboffset >= 0:
21425  *         resultp = (<char **> resultp)[0] + suboffset
21426  */
21427   __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
21428 
21429   /* "View.MemoryView":930
21430  *
21431  *     resultp = bufp + index * stride
21432  *     if suboffset >= 0:             # <<<<<<<<<<<<<<
21433  *         resultp = (<char **> resultp)[0] + suboffset
21434  *
21435  */
21436   __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
21437   if (__pyx_t_2) {
21438 
21439     /* "View.MemoryView":931
21440  *     resultp = bufp + index * stride
21441  *     if suboffset >= 0:
21442  *         resultp = (<char **> resultp)[0] + suboffset             # <<<<<<<<<<<<<<
21443  *
21444  *     return resultp
21445  */
21446     __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
21447 
21448     /* "View.MemoryView":930
21449  *
21450  *     resultp = bufp + index * stride
21451  *     if suboffset >= 0:             # <<<<<<<<<<<<<<
21452  *         resultp = (<char **> resultp)[0] + suboffset
21453  *
21454  */
21455   }
21456 
21457   /* "View.MemoryView":933
21458  *         resultp = (<char **> resultp)[0] + suboffset
21459  *
21460  *     return resultp             # <<<<<<<<<<<<<<
21461  *
21462  *
21463  */
21464   __pyx_r = __pyx_v_resultp;
21465   goto __pyx_L0;
21466 
21467   /* "View.MemoryView":906
21468  *
21469  * @cname('__pyx_pybuffer_index')
21470  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,             # <<<<<<<<<<<<<<
21471  *                           Py_ssize_t dim) except NULL:
21472  *     cdef Py_ssize_t shape, stride, suboffset = -1
21473  */
21474 
21475   /* function exit code */
21476   __pyx_L1_error:;
21477   __Pyx_XDECREF(__pyx_t_3);
21478   __Pyx_XDECREF(__pyx_t_4);
21479   __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
21480   __pyx_r = NULL;
21481   __pyx_L0:;
21482   __Pyx_RefNannyFinishContext();
21483   return __pyx_r;
21484 }
21485 
21486 /* "View.MemoryView":939
21487  *
21488  * @cname('__pyx_memslice_transpose')
21489  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:             # <<<<<<<<<<<<<<
21490  *     cdef int ndim = memslice.memview.view.ndim
21491  *
21492  */
21493 
__pyx_memslice_transpose(__Pyx_memviewslice * __pyx_v_memslice)21494 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
21495   int __pyx_v_ndim;
21496   Py_ssize_t *__pyx_v_shape;
21497   Py_ssize_t *__pyx_v_strides;
21498   int __pyx_v_i;
21499   int __pyx_v_j;
21500   int __pyx_r;
21501   int __pyx_t_1;
21502   Py_ssize_t *__pyx_t_2;
21503   long __pyx_t_3;
21504   long __pyx_t_4;
21505   Py_ssize_t __pyx_t_5;
21506   Py_ssize_t __pyx_t_6;
21507   int __pyx_t_7;
21508   int __pyx_t_8;
21509   int __pyx_t_9;
21510 
21511   /* "View.MemoryView":940
21512  * @cname('__pyx_memslice_transpose')
21513  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
21514  *     cdef int ndim = memslice.memview.view.ndim             # <<<<<<<<<<<<<<
21515  *
21516  *     cdef Py_ssize_t *shape = memslice.shape
21517  */
21518   __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
21519   __pyx_v_ndim = __pyx_t_1;
21520 
21521   /* "View.MemoryView":942
21522  *     cdef int ndim = memslice.memview.view.ndim
21523  *
21524  *     cdef Py_ssize_t *shape = memslice.shape             # <<<<<<<<<<<<<<
21525  *     cdef Py_ssize_t *strides = memslice.strides
21526  *
21527  */
21528   __pyx_t_2 = __pyx_v_memslice->shape;
21529   __pyx_v_shape = __pyx_t_2;
21530 
21531   /* "View.MemoryView":943
21532  *
21533  *     cdef Py_ssize_t *shape = memslice.shape
21534  *     cdef Py_ssize_t *strides = memslice.strides             # <<<<<<<<<<<<<<
21535  *
21536  *
21537  */
21538   __pyx_t_2 = __pyx_v_memslice->strides;
21539   __pyx_v_strides = __pyx_t_2;
21540 
21541   /* "View.MemoryView":947
21542  *
21543  *     cdef int i, j
21544  *     for i in range(ndim / 2):             # <<<<<<<<<<<<<<
21545  *         j = ndim - 1 - i
21546  *         strides[i], strides[j] = strides[j], strides[i]
21547  */
21548   __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
21549   __pyx_t_4 = __pyx_t_3;
21550   for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
21551     __pyx_v_i = __pyx_t_1;
21552 
21553     /* "View.MemoryView":948
21554  *     cdef int i, j
21555  *     for i in range(ndim / 2):
21556  *         j = ndim - 1 - i             # <<<<<<<<<<<<<<
21557  *         strides[i], strides[j] = strides[j], strides[i]
21558  *         shape[i], shape[j] = shape[j], shape[i]
21559  */
21560     __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
21561 
21562     /* "View.MemoryView":949
21563  *     for i in range(ndim / 2):
21564  *         j = ndim - 1 - i
21565  *         strides[i], strides[j] = strides[j], strides[i]             # <<<<<<<<<<<<<<
21566  *         shape[i], shape[j] = shape[j], shape[i]
21567  *
21568  */
21569     __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
21570     __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
21571     (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
21572     (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
21573 
21574     /* "View.MemoryView":950
21575  *         j = ndim - 1 - i
21576  *         strides[i], strides[j] = strides[j], strides[i]
21577  *         shape[i], shape[j] = shape[j], shape[i]             # <<<<<<<<<<<<<<
21578  *
21579  *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
21580  */
21581     __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
21582     __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
21583     (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
21584     (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
21585 
21586     /* "View.MemoryView":952
21587  *         shape[i], shape[j] = shape[j], shape[i]
21588  *
21589  *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:             # <<<<<<<<<<<<<<
21590  *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
21591  *
21592  */
21593     __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
21594     if (!__pyx_t_8) {
21595     } else {
21596       __pyx_t_7 = __pyx_t_8;
21597       goto __pyx_L6_bool_binop_done;
21598     }
21599     __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
21600     __pyx_t_7 = __pyx_t_8;
21601     __pyx_L6_bool_binop_done:;
21602     if (__pyx_t_7) {
21603 
21604       /* "View.MemoryView":953
21605  *
21606  *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
21607  *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")             # <<<<<<<<<<<<<<
21608  *
21609  *     return 1
21610  */
21611       __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(4, 953, __pyx_L1_error)
21612 
21613       /* "View.MemoryView":952
21614  *         shape[i], shape[j] = shape[j], shape[i]
21615  *
21616  *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:             # <<<<<<<<<<<<<<
21617  *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
21618  *
21619  */
21620     }
21621   }
21622 
21623   /* "View.MemoryView":955
21624  *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
21625  *
21626  *     return 1             # <<<<<<<<<<<<<<
21627  *
21628  *
21629  */
21630   __pyx_r = 1;
21631   goto __pyx_L0;
21632 
21633   /* "View.MemoryView":939
21634  *
21635  * @cname('__pyx_memslice_transpose')
21636  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:             # <<<<<<<<<<<<<<
21637  *     cdef int ndim = memslice.memview.view.ndim
21638  *
21639  */
21640 
21641   /* function exit code */
21642   __pyx_L1_error:;
21643   {
21644     #ifdef WITH_THREAD
21645     PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
21646     #endif
21647     __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
21648     #ifdef WITH_THREAD
21649     __Pyx_PyGILState_Release(__pyx_gilstate_save);
21650     #endif
21651   }
21652   __pyx_r = 0;
21653   __pyx_L0:;
21654   return __pyx_r;
21655 }
21656 
21657 /* "View.MemoryView":972
21658  *     cdef int (*to_dtype_func)(char *, object) except 0
21659  *
21660  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
21661  *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
21662  *
21663  */
21664 
21665 /* Python wrapper */
21666 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
__pyx_memoryviewslice___dealloc__(PyObject * __pyx_v_self)21667 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
21668   __Pyx_RefNannyDeclarations
21669   __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
21670   __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
21671 
21672   /* function exit code */
21673   __Pyx_RefNannyFinishContext();
21674 }
21675 
__pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj * __pyx_v_self)21676 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
21677   __Pyx_RefNannyDeclarations
21678   __Pyx_RefNannySetupContext("__dealloc__", 0);
21679 
21680   /* "View.MemoryView":973
21681  *
21682  *     def __dealloc__(self):
21683  *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)             # <<<<<<<<<<<<<<
21684  *
21685  *     cdef convert_item_to_object(self, char *itemp):
21686  */
21687   __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
21688 
21689   /* "View.MemoryView":972
21690  *     cdef int (*to_dtype_func)(char *, object) except 0
21691  *
21692  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
21693  *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
21694  *
21695  */
21696 
21697   /* function exit code */
21698   __Pyx_RefNannyFinishContext();
21699 }
21700 
21701 /* "View.MemoryView":975
21702  *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
21703  *
21704  *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
21705  *         if self.to_object_func != NULL:
21706  *             return self.to_object_func(itemp)
21707  */
21708 
__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj * __pyx_v_self,char * __pyx_v_itemp)21709 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
21710   PyObject *__pyx_r = NULL;
21711   __Pyx_RefNannyDeclarations
21712   int __pyx_t_1;
21713   PyObject *__pyx_t_2 = NULL;
21714   __Pyx_RefNannySetupContext("convert_item_to_object", 0);
21715 
21716   /* "View.MemoryView":976
21717  *
21718  *     cdef convert_item_to_object(self, char *itemp):
21719  *         if self.to_object_func != NULL:             # <<<<<<<<<<<<<<
21720  *             return self.to_object_func(itemp)
21721  *         else:
21722  */
21723   __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
21724   if (__pyx_t_1) {
21725 
21726     /* "View.MemoryView":977
21727  *     cdef convert_item_to_object(self, char *itemp):
21728  *         if self.to_object_func != NULL:
21729  *             return self.to_object_func(itemp)             # <<<<<<<<<<<<<<
21730  *         else:
21731  *             return memoryview.convert_item_to_object(self, itemp)
21732  */
21733     __Pyx_XDECREF(__pyx_r);
21734     __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 977, __pyx_L1_error)
21735     __Pyx_GOTREF(__pyx_t_2);
21736     __pyx_r = __pyx_t_2;
21737     __pyx_t_2 = 0;
21738     goto __pyx_L0;
21739 
21740     /* "View.MemoryView":976
21741  *
21742  *     cdef convert_item_to_object(self, char *itemp):
21743  *         if self.to_object_func != NULL:             # <<<<<<<<<<<<<<
21744  *             return self.to_object_func(itemp)
21745  *         else:
21746  */
21747   }
21748 
21749   /* "View.MemoryView":979
21750  *             return self.to_object_func(itemp)
21751  *         else:
21752  *             return memoryview.convert_item_to_object(self, itemp)             # <<<<<<<<<<<<<<
21753  *
21754  *     cdef assign_item_from_object(self, char *itemp, object value):
21755  */
21756   /*else*/ {
21757     __Pyx_XDECREF(__pyx_r);
21758     __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(4, 979, __pyx_L1_error)
21759     __Pyx_GOTREF(__pyx_t_2);
21760     __pyx_r = __pyx_t_2;
21761     __pyx_t_2 = 0;
21762     goto __pyx_L0;
21763   }
21764 
21765   /* "View.MemoryView":975
21766  *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
21767  *
21768  *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
21769  *         if self.to_object_func != NULL:
21770  *             return self.to_object_func(itemp)
21771  */
21772 
21773   /* function exit code */
21774   __pyx_L1_error:;
21775   __Pyx_XDECREF(__pyx_t_2);
21776   __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
21777   __pyx_r = 0;
21778   __pyx_L0:;
21779   __Pyx_XGIVEREF(__pyx_r);
21780   __Pyx_RefNannyFinishContext();
21781   return __pyx_r;
21782 }
21783 
21784 /* "View.MemoryView":981
21785  *             return memoryview.convert_item_to_object(self, itemp)
21786  *
21787  *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
21788  *         if self.to_dtype_func != NULL:
21789  *             self.to_dtype_func(itemp, value)
21790  */
21791 
__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj * __pyx_v_self,char * __pyx_v_itemp,PyObject * __pyx_v_value)21792 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
21793   PyObject *__pyx_r = NULL;
21794   __Pyx_RefNannyDeclarations
21795   int __pyx_t_1;
21796   int __pyx_t_2;
21797   PyObject *__pyx_t_3 = NULL;
21798   __Pyx_RefNannySetupContext("assign_item_from_object", 0);
21799 
21800   /* "View.MemoryView":982
21801  *
21802  *     cdef assign_item_from_object(self, char *itemp, object value):
21803  *         if self.to_dtype_func != NULL:             # <<<<<<<<<<<<<<
21804  *             self.to_dtype_func(itemp, value)
21805  *         else:
21806  */
21807   __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
21808   if (__pyx_t_1) {
21809 
21810     /* "View.MemoryView":983
21811  *     cdef assign_item_from_object(self, char *itemp, object value):
21812  *         if self.to_dtype_func != NULL:
21813  *             self.to_dtype_func(itemp, value)             # <<<<<<<<<<<<<<
21814  *         else:
21815  *             memoryview.assign_item_from_object(self, itemp, value)
21816  */
21817     __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(4, 983, __pyx_L1_error)
21818 
21819     /* "View.MemoryView":982
21820  *
21821  *     cdef assign_item_from_object(self, char *itemp, object value):
21822  *         if self.to_dtype_func != NULL:             # <<<<<<<<<<<<<<
21823  *             self.to_dtype_func(itemp, value)
21824  *         else:
21825  */
21826     goto __pyx_L3;
21827   }
21828 
21829   /* "View.MemoryView":985
21830  *             self.to_dtype_func(itemp, value)
21831  *         else:
21832  *             memoryview.assign_item_from_object(self, itemp, value)             # <<<<<<<<<<<<<<
21833  *
21834  *     @property
21835  */
21836   /*else*/ {
21837     __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(4, 985, __pyx_L1_error)
21838     __Pyx_GOTREF(__pyx_t_3);
21839     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21840   }
21841   __pyx_L3:;
21842 
21843   /* "View.MemoryView":981
21844  *             return memoryview.convert_item_to_object(self, itemp)
21845  *
21846  *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
21847  *         if self.to_dtype_func != NULL:
21848  *             self.to_dtype_func(itemp, value)
21849  */
21850 
21851   /* function exit code */
21852   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21853   goto __pyx_L0;
21854   __pyx_L1_error:;
21855   __Pyx_XDECREF(__pyx_t_3);
21856   __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
21857   __pyx_r = 0;
21858   __pyx_L0:;
21859   __Pyx_XGIVEREF(__pyx_r);
21860   __Pyx_RefNannyFinishContext();
21861   return __pyx_r;
21862 }
21863 
21864 /* "View.MemoryView":988
21865  *
21866  *     @property
21867  *     def base(self):             # <<<<<<<<<<<<<<
21868  *         return self.from_object
21869  *
21870  */
21871 
21872 /* Python wrapper */
21873 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)21874 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
21875   PyObject *__pyx_r = 0;
21876   __Pyx_RefNannyDeclarations
21877   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
21878   __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
21879 
21880   /* function exit code */
21881   __Pyx_RefNannyFinishContext();
21882   return __pyx_r;
21883 }
21884 
__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj * __pyx_v_self)21885 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
21886   PyObject *__pyx_r = NULL;
21887   __Pyx_RefNannyDeclarations
21888   __Pyx_RefNannySetupContext("__get__", 0);
21889 
21890   /* "View.MemoryView":989
21891  *     @property
21892  *     def base(self):
21893  *         return self.from_object             # <<<<<<<<<<<<<<
21894  *
21895  *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
21896  */
21897   __Pyx_XDECREF(__pyx_r);
21898   __Pyx_INCREF(__pyx_v_self->from_object);
21899   __pyx_r = __pyx_v_self->from_object;
21900   goto __pyx_L0;
21901 
21902   /* "View.MemoryView":988
21903  *
21904  *     @property
21905  *     def base(self):             # <<<<<<<<<<<<<<
21906  *         return self.from_object
21907  *
21908  */
21909 
21910   /* function exit code */
21911   __pyx_L0:;
21912   __Pyx_XGIVEREF(__pyx_r);
21913   __Pyx_RefNannyFinishContext();
21914   return __pyx_r;
21915 }
21916 
21917 /* "(tree fragment)":1
21918  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
21919  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21920  * def __setstate_cython__(self, __pyx_state):
21921  */
21922 
21923 /* Python wrapper */
21924 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)21925 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
21926   PyObject *__pyx_r = 0;
21927   __Pyx_RefNannyDeclarations
21928   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
21929   __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
21930 
21931   /* function exit code */
21932   __Pyx_RefNannyFinishContext();
21933   return __pyx_r;
21934 }
21935 
__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj * __pyx_v_self)21936 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
21937   PyObject *__pyx_r = NULL;
21938   __Pyx_RefNannyDeclarations
21939   PyObject *__pyx_t_1 = NULL;
21940   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
21941 
21942   /* "(tree fragment)":2
21943  * def __reduce_cython__(self):
21944  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
21945  * def __setstate_cython__(self, __pyx_state):
21946  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21947  */
21948   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2, __pyx_L1_error)
21949   __Pyx_GOTREF(__pyx_t_1);
21950   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
21951   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21952   __PYX_ERR(4, 2, __pyx_L1_error)
21953 
21954   /* "(tree fragment)":1
21955  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
21956  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21957  * def __setstate_cython__(self, __pyx_state):
21958  */
21959 
21960   /* function exit code */
21961   __pyx_L1_error:;
21962   __Pyx_XDECREF(__pyx_t_1);
21963   __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21964   __pyx_r = NULL;
21965   __Pyx_XGIVEREF(__pyx_r);
21966   __Pyx_RefNannyFinishContext();
21967   return __pyx_r;
21968 }
21969 
21970 /* "(tree fragment)":3
21971  * def __reduce_cython__(self):
21972  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21973  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
21974  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21975  */
21976 
21977 /* Python wrapper */
21978 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)21979 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
21980   PyObject *__pyx_r = 0;
21981   __Pyx_RefNannyDeclarations
21982   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
21983   __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
21984 
21985   /* function exit code */
21986   __Pyx_RefNannyFinishContext();
21987   return __pyx_r;
21988 }
21989 
__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)21990 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) {
21991   PyObject *__pyx_r = NULL;
21992   __Pyx_RefNannyDeclarations
21993   PyObject *__pyx_t_1 = NULL;
21994   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
21995 
21996   /* "(tree fragment)":4
21997  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21998  * def __setstate_cython__(self, __pyx_state):
21999  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
22000  */
22001   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 4, __pyx_L1_error)
22002   __Pyx_GOTREF(__pyx_t_1);
22003   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
22004   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22005   __PYX_ERR(4, 4, __pyx_L1_error)
22006 
22007   /* "(tree fragment)":3
22008  * def __reduce_cython__(self):
22009  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22010  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
22011  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22012  */
22013 
22014   /* function exit code */
22015   __pyx_L1_error:;
22016   __Pyx_XDECREF(__pyx_t_1);
22017   __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22018   __pyx_r = NULL;
22019   __Pyx_XGIVEREF(__pyx_r);
22020   __Pyx_RefNannyFinishContext();
22021   return __pyx_r;
22022 }
22023 
22024 /* "View.MemoryView":995
22025  *
22026  * @cname('__pyx_memoryview_fromslice')
22027  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice,             # <<<<<<<<<<<<<<
22028  *                           int ndim,
22029  *                           object (*to_object_func)(char *),
22030  */
22031 
__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)22032 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) {
22033   struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
22034   Py_ssize_t __pyx_v_suboffset;
22035   PyObject *__pyx_v_length = NULL;
22036   PyObject *__pyx_r = NULL;
22037   __Pyx_RefNannyDeclarations
22038   int __pyx_t_1;
22039   PyObject *__pyx_t_2 = NULL;
22040   PyObject *__pyx_t_3 = NULL;
22041   __Pyx_TypeInfo *__pyx_t_4;
22042   Py_buffer __pyx_t_5;
22043   Py_ssize_t *__pyx_t_6;
22044   Py_ssize_t *__pyx_t_7;
22045   Py_ssize_t *__pyx_t_8;
22046   Py_ssize_t __pyx_t_9;
22047   __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
22048 
22049   /* "View.MemoryView":1003
22050  *     cdef _memoryviewslice result
22051  *
22052  *     if <PyObject *> memviewslice.memview == Py_None:             # <<<<<<<<<<<<<<
22053  *         return None
22054  *
22055  */
22056   __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
22057   if (__pyx_t_1) {
22058 
22059     /* "View.MemoryView":1004
22060  *
22061  *     if <PyObject *> memviewslice.memview == Py_None:
22062  *         return None             # <<<<<<<<<<<<<<
22063  *
22064  *
22065  */
22066     __Pyx_XDECREF(__pyx_r);
22067     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
22068     goto __pyx_L0;
22069 
22070     /* "View.MemoryView":1003
22071  *     cdef _memoryviewslice result
22072  *
22073  *     if <PyObject *> memviewslice.memview == Py_None:             # <<<<<<<<<<<<<<
22074  *         return None
22075  *
22076  */
22077   }
22078 
22079   /* "View.MemoryView":1009
22080  *
22081  *
22082  *     result = _memoryviewslice(None, 0, dtype_is_object)             # <<<<<<<<<<<<<<
22083  *
22084  *     result.from_slice = memviewslice
22085  */
22086   __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1009, __pyx_L1_error)
22087   __Pyx_GOTREF(__pyx_t_2);
22088   __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1009, __pyx_L1_error)
22089   __Pyx_GOTREF(__pyx_t_3);
22090   __Pyx_INCREF(Py_None);
22091   __Pyx_GIVEREF(Py_None);
22092   PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
22093   __Pyx_INCREF(__pyx_int_0);
22094   __Pyx_GIVEREF(__pyx_int_0);
22095   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
22096   __Pyx_GIVEREF(__pyx_t_2);
22097   PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
22098   __pyx_t_2 = 0;
22099   __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1009, __pyx_L1_error)
22100   __Pyx_GOTREF(__pyx_t_2);
22101   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22102   __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
22103   __pyx_t_2 = 0;
22104 
22105   /* "View.MemoryView":1011
22106  *     result = _memoryviewslice(None, 0, dtype_is_object)
22107  *
22108  *     result.from_slice = memviewslice             # <<<<<<<<<<<<<<
22109  *     __PYX_INC_MEMVIEW(&memviewslice, 1)
22110  *
22111  */
22112   __pyx_v_result->from_slice = __pyx_v_memviewslice;
22113 
22114   /* "View.MemoryView":1012
22115  *
22116  *     result.from_slice = memviewslice
22117  *     __PYX_INC_MEMVIEW(&memviewslice, 1)             # <<<<<<<<<<<<<<
22118  *
22119  *     result.from_object = (<memoryview> memviewslice.memview).base
22120  */
22121   __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
22122 
22123   /* "View.MemoryView":1014
22124  *     __PYX_INC_MEMVIEW(&memviewslice, 1)
22125  *
22126  *     result.from_object = (<memoryview> memviewslice.memview).base             # <<<<<<<<<<<<<<
22127  *     result.typeinfo = memviewslice.memview.typeinfo
22128  *
22129  */
22130   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1014, __pyx_L1_error)
22131   __Pyx_GOTREF(__pyx_t_2);
22132   __Pyx_GIVEREF(__pyx_t_2);
22133   __Pyx_GOTREF(__pyx_v_result->from_object);
22134   __Pyx_DECREF(__pyx_v_result->from_object);
22135   __pyx_v_result->from_object = __pyx_t_2;
22136   __pyx_t_2 = 0;
22137 
22138   /* "View.MemoryView":1015
22139  *
22140  *     result.from_object = (<memoryview> memviewslice.memview).base
22141  *     result.typeinfo = memviewslice.memview.typeinfo             # <<<<<<<<<<<<<<
22142  *
22143  *     result.view = memviewslice.memview.view
22144  */
22145   __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
22146   __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
22147 
22148   /* "View.MemoryView":1017
22149  *     result.typeinfo = memviewslice.memview.typeinfo
22150  *
22151  *     result.view = memviewslice.memview.view             # <<<<<<<<<<<<<<
22152  *     result.view.buf = <void *> memviewslice.data
22153  *     result.view.ndim = ndim
22154  */
22155   __pyx_t_5 = __pyx_v_memviewslice.memview->view;
22156   __pyx_v_result->__pyx_base.view = __pyx_t_5;
22157 
22158   /* "View.MemoryView":1018
22159  *
22160  *     result.view = memviewslice.memview.view
22161  *     result.view.buf = <void *> memviewslice.data             # <<<<<<<<<<<<<<
22162  *     result.view.ndim = ndim
22163  *     (<__pyx_buffer *> &result.view).obj = Py_None
22164  */
22165   __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
22166 
22167   /* "View.MemoryView":1019
22168  *     result.view = memviewslice.memview.view
22169  *     result.view.buf = <void *> memviewslice.data
22170  *     result.view.ndim = ndim             # <<<<<<<<<<<<<<
22171  *     (<__pyx_buffer *> &result.view).obj = Py_None
22172  *     Py_INCREF(Py_None)
22173  */
22174   __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
22175 
22176   /* "View.MemoryView":1020
22177  *     result.view.buf = <void *> memviewslice.data
22178  *     result.view.ndim = ndim
22179  *     (<__pyx_buffer *> &result.view).obj = Py_None             # <<<<<<<<<<<<<<
22180  *     Py_INCREF(Py_None)
22181  *
22182  */
22183   ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
22184 
22185   /* "View.MemoryView":1021
22186  *     result.view.ndim = ndim
22187  *     (<__pyx_buffer *> &result.view).obj = Py_None
22188  *     Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
22189  *
22190  *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
22191  */
22192   Py_INCREF(Py_None);
22193 
22194   /* "View.MemoryView":1023
22195  *     Py_INCREF(Py_None)
22196  *
22197  *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:             # <<<<<<<<<<<<<<
22198  *         result.flags = PyBUF_RECORDS
22199  *     else:
22200  */
22201   __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
22202   if (__pyx_t_1) {
22203 
22204     /* "View.MemoryView":1024
22205  *
22206  *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
22207  *         result.flags = PyBUF_RECORDS             # <<<<<<<<<<<<<<
22208  *     else:
22209  *         result.flags = PyBUF_RECORDS_RO
22210  */
22211     __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
22212 
22213     /* "View.MemoryView":1023
22214  *     Py_INCREF(Py_None)
22215  *
22216  *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:             # <<<<<<<<<<<<<<
22217  *         result.flags = PyBUF_RECORDS
22218  *     else:
22219  */
22220     goto __pyx_L4;
22221   }
22222 
22223   /* "View.MemoryView":1026
22224  *         result.flags = PyBUF_RECORDS
22225  *     else:
22226  *         result.flags = PyBUF_RECORDS_RO             # <<<<<<<<<<<<<<
22227  *
22228  *     result.view.shape = <Py_ssize_t *> result.from_slice.shape
22229  */
22230   /*else*/ {
22231     __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
22232   }
22233   __pyx_L4:;
22234 
22235   /* "View.MemoryView":1028
22236  *         result.flags = PyBUF_RECORDS_RO
22237  *
22238  *     result.view.shape = <Py_ssize_t *> result.from_slice.shape             # <<<<<<<<<<<<<<
22239  *     result.view.strides = <Py_ssize_t *> result.from_slice.strides
22240  *
22241  */
22242   __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
22243 
22244   /* "View.MemoryView":1029
22245  *
22246  *     result.view.shape = <Py_ssize_t *> result.from_slice.shape
22247  *     result.view.strides = <Py_ssize_t *> result.from_slice.strides             # <<<<<<<<<<<<<<
22248  *
22249  *
22250  */
22251   __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
22252 
22253   /* "View.MemoryView":1032
22254  *
22255  *
22256  *     result.view.suboffsets = NULL             # <<<<<<<<<<<<<<
22257  *     for suboffset in result.from_slice.suboffsets[:ndim]:
22258  *         if suboffset >= 0:
22259  */
22260   __pyx_v_result->__pyx_base.view.suboffsets = NULL;
22261 
22262   /* "View.MemoryView":1033
22263  *
22264  *     result.view.suboffsets = NULL
22265  *     for suboffset in result.from_slice.suboffsets[:ndim]:             # <<<<<<<<<<<<<<
22266  *         if suboffset >= 0:
22267  *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
22268  */
22269   __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
22270   for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
22271     __pyx_t_6 = __pyx_t_8;
22272     __pyx_v_suboffset = (__pyx_t_6[0]);
22273 
22274     /* "View.MemoryView":1034
22275  *     result.view.suboffsets = NULL
22276  *     for suboffset in result.from_slice.suboffsets[:ndim]:
22277  *         if suboffset >= 0:             # <<<<<<<<<<<<<<
22278  *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
22279  *             break
22280  */
22281     __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
22282     if (__pyx_t_1) {
22283 
22284       /* "View.MemoryView":1035
22285  *     for suboffset in result.from_slice.suboffsets[:ndim]:
22286  *         if suboffset >= 0:
22287  *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets             # <<<<<<<<<<<<<<
22288  *             break
22289  *
22290  */
22291       __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
22292 
22293       /* "View.MemoryView":1036
22294  *         if suboffset >= 0:
22295  *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
22296  *             break             # <<<<<<<<<<<<<<
22297  *
22298  *     result.view.len = result.view.itemsize
22299  */
22300       goto __pyx_L6_break;
22301 
22302       /* "View.MemoryView":1034
22303  *     result.view.suboffsets = NULL
22304  *     for suboffset in result.from_slice.suboffsets[:ndim]:
22305  *         if suboffset >= 0:             # <<<<<<<<<<<<<<
22306  *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
22307  *             break
22308  */
22309     }
22310   }
22311   __pyx_L6_break:;
22312 
22313   /* "View.MemoryView":1038
22314  *             break
22315  *
22316  *     result.view.len = result.view.itemsize             # <<<<<<<<<<<<<<
22317  *     for length in result.view.shape[:ndim]:
22318  *         result.view.len *= length
22319  */
22320   __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
22321   __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
22322 
22323   /* "View.MemoryView":1039
22324  *
22325  *     result.view.len = result.view.itemsize
22326  *     for length in result.view.shape[:ndim]:             # <<<<<<<<<<<<<<
22327  *         result.view.len *= length
22328  *
22329  */
22330   __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
22331   for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
22332     __pyx_t_6 = __pyx_t_8;
22333     __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1039, __pyx_L1_error)
22334     __Pyx_GOTREF(__pyx_t_2);
22335     __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
22336     __pyx_t_2 = 0;
22337 
22338     /* "View.MemoryView":1040
22339  *     result.view.len = result.view.itemsize
22340  *     for length in result.view.shape[:ndim]:
22341  *         result.view.len *= length             # <<<<<<<<<<<<<<
22342  *
22343  *     result.to_object_func = to_object_func
22344  */
22345     __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1040, __pyx_L1_error)
22346     __Pyx_GOTREF(__pyx_t_2);
22347     __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1040, __pyx_L1_error)
22348     __Pyx_GOTREF(__pyx_t_3);
22349     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22350     __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 1040, __pyx_L1_error)
22351     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22352     __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
22353   }
22354 
22355   /* "View.MemoryView":1042
22356  *         result.view.len *= length
22357  *
22358  *     result.to_object_func = to_object_func             # <<<<<<<<<<<<<<
22359  *     result.to_dtype_func = to_dtype_func
22360  *
22361  */
22362   __pyx_v_result->to_object_func = __pyx_v_to_object_func;
22363 
22364   /* "View.MemoryView":1043
22365  *
22366  *     result.to_object_func = to_object_func
22367  *     result.to_dtype_func = to_dtype_func             # <<<<<<<<<<<<<<
22368  *
22369  *     return result
22370  */
22371   __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
22372 
22373   /* "View.MemoryView":1045
22374  *     result.to_dtype_func = to_dtype_func
22375  *
22376  *     return result             # <<<<<<<<<<<<<<
22377  *
22378  * @cname('__pyx_memoryview_get_slice_from_memoryview')
22379  */
22380   __Pyx_XDECREF(__pyx_r);
22381   __Pyx_INCREF(((PyObject *)__pyx_v_result));
22382   __pyx_r = ((PyObject *)__pyx_v_result);
22383   goto __pyx_L0;
22384 
22385   /* "View.MemoryView":995
22386  *
22387  * @cname('__pyx_memoryview_fromslice')
22388  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice,             # <<<<<<<<<<<<<<
22389  *                           int ndim,
22390  *                           object (*to_object_func)(char *),
22391  */
22392 
22393   /* function exit code */
22394   __pyx_L1_error:;
22395   __Pyx_XDECREF(__pyx_t_2);
22396   __Pyx_XDECREF(__pyx_t_3);
22397   __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
22398   __pyx_r = 0;
22399   __pyx_L0:;
22400   __Pyx_XDECREF((PyObject *)__pyx_v_result);
22401   __Pyx_XDECREF(__pyx_v_length);
22402   __Pyx_XGIVEREF(__pyx_r);
22403   __Pyx_RefNannyFinishContext();
22404   return __pyx_r;
22405 }
22406 
22407 /* "View.MemoryView":1048
22408  *
22409  * @cname('__pyx_memoryview_get_slice_from_memoryview')
22410  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview,             # <<<<<<<<<<<<<<
22411  *                                                    __Pyx_memviewslice *mslice):
22412  *     cdef _memoryviewslice obj
22413  */
22414 
__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj * __pyx_v_memview,__Pyx_memviewslice * __pyx_v_mslice)22415 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
22416   struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
22417   __Pyx_memviewslice *__pyx_r;
22418   __Pyx_RefNannyDeclarations
22419   int __pyx_t_1;
22420   int __pyx_t_2;
22421   PyObject *__pyx_t_3 = NULL;
22422   __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
22423 
22424   /* "View.MemoryView":1051
22425  *                                                    __Pyx_memviewslice *mslice):
22426  *     cdef _memoryviewslice obj
22427  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
22428  *         obj = memview
22429  *         return &obj.from_slice
22430  */
22431   __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
22432   __pyx_t_2 = (__pyx_t_1 != 0);
22433   if (__pyx_t_2) {
22434 
22435     /* "View.MemoryView":1052
22436  *     cdef _memoryviewslice obj
22437  *     if isinstance(memview, _memoryviewslice):
22438  *         obj = memview             # <<<<<<<<<<<<<<
22439  *         return &obj.from_slice
22440  *     else:
22441  */
22442     if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(4, 1052, __pyx_L1_error)
22443     __pyx_t_3 = ((PyObject *)__pyx_v_memview);
22444     __Pyx_INCREF(__pyx_t_3);
22445     __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
22446     __pyx_t_3 = 0;
22447 
22448     /* "View.MemoryView":1053
22449  *     if isinstance(memview, _memoryviewslice):
22450  *         obj = memview
22451  *         return &obj.from_slice             # <<<<<<<<<<<<<<
22452  *     else:
22453  *         slice_copy(memview, mslice)
22454  */
22455     __pyx_r = (&__pyx_v_obj->from_slice);
22456     goto __pyx_L0;
22457 
22458     /* "View.MemoryView":1051
22459  *                                                    __Pyx_memviewslice *mslice):
22460  *     cdef _memoryviewslice obj
22461  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
22462  *         obj = memview
22463  *         return &obj.from_slice
22464  */
22465   }
22466 
22467   /* "View.MemoryView":1055
22468  *         return &obj.from_slice
22469  *     else:
22470  *         slice_copy(memview, mslice)             # <<<<<<<<<<<<<<
22471  *         return mslice
22472  *
22473  */
22474   /*else*/ {
22475     __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
22476 
22477     /* "View.MemoryView":1056
22478  *     else:
22479  *         slice_copy(memview, mslice)
22480  *         return mslice             # <<<<<<<<<<<<<<
22481  *
22482  * @cname('__pyx_memoryview_slice_copy')
22483  */
22484     __pyx_r = __pyx_v_mslice;
22485     goto __pyx_L0;
22486   }
22487 
22488   /* "View.MemoryView":1048
22489  *
22490  * @cname('__pyx_memoryview_get_slice_from_memoryview')
22491  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview,             # <<<<<<<<<<<<<<
22492  *                                                    __Pyx_memviewslice *mslice):
22493  *     cdef _memoryviewslice obj
22494  */
22495 
22496   /* function exit code */
22497   __pyx_L1_error:;
22498   __Pyx_XDECREF(__pyx_t_3);
22499   __Pyx_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
22500   __pyx_r = 0;
22501   __pyx_L0:;
22502   __Pyx_XDECREF((PyObject *)__pyx_v_obj);
22503   __Pyx_RefNannyFinishContext();
22504   return __pyx_r;
22505 }
22506 
22507 /* "View.MemoryView":1059
22508  *
22509  * @cname('__pyx_memoryview_slice_copy')
22510  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst):             # <<<<<<<<<<<<<<
22511  *     cdef int dim
22512  *     cdef (Py_ssize_t*) shape, strides, suboffsets
22513  */
22514 
__pyx_memoryview_slice_copy(struct __pyx_memoryview_obj * __pyx_v_memview,__Pyx_memviewslice * __pyx_v_dst)22515 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
22516   int __pyx_v_dim;
22517   Py_ssize_t *__pyx_v_shape;
22518   Py_ssize_t *__pyx_v_strides;
22519   Py_ssize_t *__pyx_v_suboffsets;
22520   __Pyx_RefNannyDeclarations
22521   Py_ssize_t *__pyx_t_1;
22522   int __pyx_t_2;
22523   int __pyx_t_3;
22524   int __pyx_t_4;
22525   Py_ssize_t __pyx_t_5;
22526   __Pyx_RefNannySetupContext("slice_copy", 0);
22527 
22528   /* "View.MemoryView":1063
22529  *     cdef (Py_ssize_t*) shape, strides, suboffsets
22530  *
22531  *     shape = memview.view.shape             # <<<<<<<<<<<<<<
22532  *     strides = memview.view.strides
22533  *     suboffsets = memview.view.suboffsets
22534  */
22535   __pyx_t_1 = __pyx_v_memview->view.shape;
22536   __pyx_v_shape = __pyx_t_1;
22537 
22538   /* "View.MemoryView":1064
22539  *
22540  *     shape = memview.view.shape
22541  *     strides = memview.view.strides             # <<<<<<<<<<<<<<
22542  *     suboffsets = memview.view.suboffsets
22543  *
22544  */
22545   __pyx_t_1 = __pyx_v_memview->view.strides;
22546   __pyx_v_strides = __pyx_t_1;
22547 
22548   /* "View.MemoryView":1065
22549  *     shape = memview.view.shape
22550  *     strides = memview.view.strides
22551  *     suboffsets = memview.view.suboffsets             # <<<<<<<<<<<<<<
22552  *
22553  *     dst.memview = <__pyx_memoryview *> memview
22554  */
22555   __pyx_t_1 = __pyx_v_memview->view.suboffsets;
22556   __pyx_v_suboffsets = __pyx_t_1;
22557 
22558   /* "View.MemoryView":1067
22559  *     suboffsets = memview.view.suboffsets
22560  *
22561  *     dst.memview = <__pyx_memoryview *> memview             # <<<<<<<<<<<<<<
22562  *     dst.data = <char *> memview.view.buf
22563  *
22564  */
22565   __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
22566 
22567   /* "View.MemoryView":1068
22568  *
22569  *     dst.memview = <__pyx_memoryview *> memview
22570  *     dst.data = <char *> memview.view.buf             # <<<<<<<<<<<<<<
22571  *
22572  *     for dim in range(memview.view.ndim):
22573  */
22574   __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
22575 
22576   /* "View.MemoryView":1070
22577  *     dst.data = <char *> memview.view.buf
22578  *
22579  *     for dim in range(memview.view.ndim):             # <<<<<<<<<<<<<<
22580  *         dst.shape[dim] = shape[dim]
22581  *         dst.strides[dim] = strides[dim]
22582  */
22583   __pyx_t_2 = __pyx_v_memview->view.ndim;
22584   __pyx_t_3 = __pyx_t_2;
22585   for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
22586     __pyx_v_dim = __pyx_t_4;
22587 
22588     /* "View.MemoryView":1071
22589  *
22590  *     for dim in range(memview.view.ndim):
22591  *         dst.shape[dim] = shape[dim]             # <<<<<<<<<<<<<<
22592  *         dst.strides[dim] = strides[dim]
22593  *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
22594  */
22595     (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
22596 
22597     /* "View.MemoryView":1072
22598  *     for dim in range(memview.view.ndim):
22599  *         dst.shape[dim] = shape[dim]
22600  *         dst.strides[dim] = strides[dim]             # <<<<<<<<<<<<<<
22601  *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
22602  *
22603  */
22604     (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
22605 
22606     /* "View.MemoryView":1073
22607  *         dst.shape[dim] = shape[dim]
22608  *         dst.strides[dim] = strides[dim]
22609  *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1             # <<<<<<<<<<<<<<
22610  *
22611  * @cname('__pyx_memoryview_copy_object')
22612  */
22613     if ((__pyx_v_suboffsets != 0)) {
22614       __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
22615     } else {
22616       __pyx_t_5 = -1L;
22617     }
22618     (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
22619   }
22620 
22621   /* "View.MemoryView":1059
22622  *
22623  * @cname('__pyx_memoryview_slice_copy')
22624  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst):             # <<<<<<<<<<<<<<
22625  *     cdef int dim
22626  *     cdef (Py_ssize_t*) shape, strides, suboffsets
22627  */
22628 
22629   /* function exit code */
22630   __Pyx_RefNannyFinishContext();
22631 }
22632 
22633 /* "View.MemoryView":1076
22634  *
22635  * @cname('__pyx_memoryview_copy_object')
22636  * cdef memoryview_copy(memoryview memview):             # <<<<<<<<<<<<<<
22637  *     "Create a new memoryview object"
22638  *     cdef __Pyx_memviewslice memviewslice
22639  */
22640 
__pyx_memoryview_copy_object(struct __pyx_memoryview_obj * __pyx_v_memview)22641 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
22642   __Pyx_memviewslice __pyx_v_memviewslice;
22643   PyObject *__pyx_r = NULL;
22644   __Pyx_RefNannyDeclarations
22645   PyObject *__pyx_t_1 = NULL;
22646   __Pyx_RefNannySetupContext("memoryview_copy", 0);
22647 
22648   /* "View.MemoryView":1079
22649  *     "Create a new memoryview object"
22650  *     cdef __Pyx_memviewslice memviewslice
22651  *     slice_copy(memview, &memviewslice)             # <<<<<<<<<<<<<<
22652  *     return memoryview_copy_from_slice(memview, &memviewslice)
22653  *
22654  */
22655   __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
22656 
22657   /* "View.MemoryView":1080
22658  *     cdef __Pyx_memviewslice memviewslice
22659  *     slice_copy(memview, &memviewslice)
22660  *     return memoryview_copy_from_slice(memview, &memviewslice)             # <<<<<<<<<<<<<<
22661  *
22662  * @cname('__pyx_memoryview_copy_object_from_slice')
22663  */
22664   __Pyx_XDECREF(__pyx_r);
22665   __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1080, __pyx_L1_error)
22666   __Pyx_GOTREF(__pyx_t_1);
22667   __pyx_r = __pyx_t_1;
22668   __pyx_t_1 = 0;
22669   goto __pyx_L0;
22670 
22671   /* "View.MemoryView":1076
22672  *
22673  * @cname('__pyx_memoryview_copy_object')
22674  * cdef memoryview_copy(memoryview memview):             # <<<<<<<<<<<<<<
22675  *     "Create a new memoryview object"
22676  *     cdef __Pyx_memviewslice memviewslice
22677  */
22678 
22679   /* function exit code */
22680   __pyx_L1_error:;
22681   __Pyx_XDECREF(__pyx_t_1);
22682   __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
22683   __pyx_r = 0;
22684   __pyx_L0:;
22685   __Pyx_XGIVEREF(__pyx_r);
22686   __Pyx_RefNannyFinishContext();
22687   return __pyx_r;
22688 }
22689 
22690 /* "View.MemoryView":1083
22691  *
22692  * @cname('__pyx_memoryview_copy_object_from_slice')
22693  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice):             # <<<<<<<<<<<<<<
22694  *     """
22695  *     Create a new memoryview object from a given memoryview object and slice.
22696  */
22697 
__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj * __pyx_v_memview,__Pyx_memviewslice * __pyx_v_memviewslice)22698 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
22699   PyObject *(*__pyx_v_to_object_func)(char *);
22700   int (*__pyx_v_to_dtype_func)(char *, PyObject *);
22701   PyObject *__pyx_r = NULL;
22702   __Pyx_RefNannyDeclarations
22703   int __pyx_t_1;
22704   int __pyx_t_2;
22705   PyObject *(*__pyx_t_3)(char *);
22706   int (*__pyx_t_4)(char *, PyObject *);
22707   PyObject *__pyx_t_5 = NULL;
22708   __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
22709 
22710   /* "View.MemoryView":1090
22711  *     cdef int (*to_dtype_func)(char *, object) except 0
22712  *
22713  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
22714  *         to_object_func = (<_memoryviewslice> memview).to_object_func
22715  *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
22716  */
22717   __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
22718   __pyx_t_2 = (__pyx_t_1 != 0);
22719   if (__pyx_t_2) {
22720 
22721     /* "View.MemoryView":1091
22722  *
22723  *     if isinstance(memview, _memoryviewslice):
22724  *         to_object_func = (<_memoryviewslice> memview).to_object_func             # <<<<<<<<<<<<<<
22725  *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
22726  *     else:
22727  */
22728     __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
22729     __pyx_v_to_object_func = __pyx_t_3;
22730 
22731     /* "View.MemoryView":1092
22732  *     if isinstance(memview, _memoryviewslice):
22733  *         to_object_func = (<_memoryviewslice> memview).to_object_func
22734  *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func             # <<<<<<<<<<<<<<
22735  *     else:
22736  *         to_object_func = NULL
22737  */
22738     __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
22739     __pyx_v_to_dtype_func = __pyx_t_4;
22740 
22741     /* "View.MemoryView":1090
22742  *     cdef int (*to_dtype_func)(char *, object) except 0
22743  *
22744  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
22745  *         to_object_func = (<_memoryviewslice> memview).to_object_func
22746  *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
22747  */
22748     goto __pyx_L3;
22749   }
22750 
22751   /* "View.MemoryView":1094
22752  *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
22753  *     else:
22754  *         to_object_func = NULL             # <<<<<<<<<<<<<<
22755  *         to_dtype_func = NULL
22756  *
22757  */
22758   /*else*/ {
22759     __pyx_v_to_object_func = NULL;
22760 
22761     /* "View.MemoryView":1095
22762  *     else:
22763  *         to_object_func = NULL
22764  *         to_dtype_func = NULL             # <<<<<<<<<<<<<<
22765  *
22766  *     return memoryview_fromslice(memviewslice[0], memview.view.ndim,
22767  */
22768     __pyx_v_to_dtype_func = NULL;
22769   }
22770   __pyx_L3:;
22771 
22772   /* "View.MemoryView":1097
22773  *         to_dtype_func = NULL
22774  *
22775  *     return memoryview_fromslice(memviewslice[0], memview.view.ndim,             # <<<<<<<<<<<<<<
22776  *                                 to_object_func, to_dtype_func,
22777  *                                 memview.dtype_is_object)
22778  */
22779   __Pyx_XDECREF(__pyx_r);
22780 
22781   /* "View.MemoryView":1099
22782  *     return memoryview_fromslice(memviewslice[0], memview.view.ndim,
22783  *                                 to_object_func, to_dtype_func,
22784  *                                 memview.dtype_is_object)             # <<<<<<<<<<<<<<
22785  *
22786  *
22787  */
22788   __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(4, 1097, __pyx_L1_error)
22789   __Pyx_GOTREF(__pyx_t_5);
22790   __pyx_r = __pyx_t_5;
22791   __pyx_t_5 = 0;
22792   goto __pyx_L0;
22793 
22794   /* "View.MemoryView":1083
22795  *
22796  * @cname('__pyx_memoryview_copy_object_from_slice')
22797  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice):             # <<<<<<<<<<<<<<
22798  *     """
22799  *     Create a new memoryview object from a given memoryview object and slice.
22800  */
22801 
22802   /* function exit code */
22803   __pyx_L1_error:;
22804   __Pyx_XDECREF(__pyx_t_5);
22805   __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
22806   __pyx_r = 0;
22807   __pyx_L0:;
22808   __Pyx_XGIVEREF(__pyx_r);
22809   __Pyx_RefNannyFinishContext();
22810   return __pyx_r;
22811 }
22812 
22813 /* "View.MemoryView":1105
22814  *
22815  *
22816  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:             # <<<<<<<<<<<<<<
22817  *     if arg < 0:
22818  *         return -arg
22819  */
22820 
abs_py_ssize_t(Py_ssize_t __pyx_v_arg)22821 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
22822   Py_ssize_t __pyx_r;
22823   int __pyx_t_1;
22824 
22825   /* "View.MemoryView":1106
22826  *
22827  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
22828  *     if arg < 0:             # <<<<<<<<<<<<<<
22829  *         return -arg
22830  *     else:
22831  */
22832   __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
22833   if (__pyx_t_1) {
22834 
22835     /* "View.MemoryView":1107
22836  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
22837  *     if arg < 0:
22838  *         return -arg             # <<<<<<<<<<<<<<
22839  *     else:
22840  *         return arg
22841  */
22842     __pyx_r = (-__pyx_v_arg);
22843     goto __pyx_L0;
22844 
22845     /* "View.MemoryView":1106
22846  *
22847  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
22848  *     if arg < 0:             # <<<<<<<<<<<<<<
22849  *         return -arg
22850  *     else:
22851  */
22852   }
22853 
22854   /* "View.MemoryView":1109
22855  *         return -arg
22856  *     else:
22857  *         return arg             # <<<<<<<<<<<<<<
22858  *
22859  * @cname('__pyx_get_best_slice_order')
22860  */
22861   /*else*/ {
22862     __pyx_r = __pyx_v_arg;
22863     goto __pyx_L0;
22864   }
22865 
22866   /* "View.MemoryView":1105
22867  *
22868  *
22869  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:             # <<<<<<<<<<<<<<
22870  *     if arg < 0:
22871  *         return -arg
22872  */
22873 
22874   /* function exit code */
22875   __pyx_L0:;
22876   return __pyx_r;
22877 }
22878 
22879 /* "View.MemoryView":1112
22880  *
22881  * @cname('__pyx_get_best_slice_order')
22882  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil:             # <<<<<<<<<<<<<<
22883  *     """
22884  *     Figure out the best memory access order for a given slice.
22885  */
22886 
__pyx_get_best_slice_order(__Pyx_memviewslice * __pyx_v_mslice,int __pyx_v_ndim)22887 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
22888   int __pyx_v_i;
22889   Py_ssize_t __pyx_v_c_stride;
22890   Py_ssize_t __pyx_v_f_stride;
22891   char __pyx_r;
22892   int __pyx_t_1;
22893   int __pyx_t_2;
22894   int __pyx_t_3;
22895   int __pyx_t_4;
22896 
22897   /* "View.MemoryView":1117
22898  *     """
22899  *     cdef int i
22900  *     cdef Py_ssize_t c_stride = 0             # <<<<<<<<<<<<<<
22901  *     cdef Py_ssize_t f_stride = 0
22902  *
22903  */
22904   __pyx_v_c_stride = 0;
22905 
22906   /* "View.MemoryView":1118
22907  *     cdef int i
22908  *     cdef Py_ssize_t c_stride = 0
22909  *     cdef Py_ssize_t f_stride = 0             # <<<<<<<<<<<<<<
22910  *
22911  *     for i in range(ndim - 1, -1, -1):
22912  */
22913   __pyx_v_f_stride = 0;
22914 
22915   /* "View.MemoryView":1120
22916  *     cdef Py_ssize_t f_stride = 0
22917  *
22918  *     for i in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
22919  *         if mslice.shape[i] > 1:
22920  *             c_stride = mslice.strides[i]
22921  */
22922   for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
22923     __pyx_v_i = __pyx_t_1;
22924 
22925     /* "View.MemoryView":1121
22926  *
22927  *     for i in range(ndim - 1, -1, -1):
22928  *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
22929  *             c_stride = mslice.strides[i]
22930  *             break
22931  */
22932     __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
22933     if (__pyx_t_2) {
22934 
22935       /* "View.MemoryView":1122
22936  *     for i in range(ndim - 1, -1, -1):
22937  *         if mslice.shape[i] > 1:
22938  *             c_stride = mslice.strides[i]             # <<<<<<<<<<<<<<
22939  *             break
22940  *
22941  */
22942       __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
22943 
22944       /* "View.MemoryView":1123
22945  *         if mslice.shape[i] > 1:
22946  *             c_stride = mslice.strides[i]
22947  *             break             # <<<<<<<<<<<<<<
22948  *
22949  *     for i in range(ndim):
22950  */
22951       goto __pyx_L4_break;
22952 
22953       /* "View.MemoryView":1121
22954  *
22955  *     for i in range(ndim - 1, -1, -1):
22956  *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
22957  *             c_stride = mslice.strides[i]
22958  *             break
22959  */
22960     }
22961   }
22962   __pyx_L4_break:;
22963 
22964   /* "View.MemoryView":1125
22965  *             break
22966  *
22967  *     for i in range(ndim):             # <<<<<<<<<<<<<<
22968  *         if mslice.shape[i] > 1:
22969  *             f_stride = mslice.strides[i]
22970  */
22971   __pyx_t_1 = __pyx_v_ndim;
22972   __pyx_t_3 = __pyx_t_1;
22973   for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
22974     __pyx_v_i = __pyx_t_4;
22975 
22976     /* "View.MemoryView":1126
22977  *
22978  *     for i in range(ndim):
22979  *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
22980  *             f_stride = mslice.strides[i]
22981  *             break
22982  */
22983     __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
22984     if (__pyx_t_2) {
22985 
22986       /* "View.MemoryView":1127
22987  *     for i in range(ndim):
22988  *         if mslice.shape[i] > 1:
22989  *             f_stride = mslice.strides[i]             # <<<<<<<<<<<<<<
22990  *             break
22991  *
22992  */
22993       __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
22994 
22995       /* "View.MemoryView":1128
22996  *         if mslice.shape[i] > 1:
22997  *             f_stride = mslice.strides[i]
22998  *             break             # <<<<<<<<<<<<<<
22999  *
23000  *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
23001  */
23002       goto __pyx_L7_break;
23003 
23004       /* "View.MemoryView":1126
23005  *
23006  *     for i in range(ndim):
23007  *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
23008  *             f_stride = mslice.strides[i]
23009  *             break
23010  */
23011     }
23012   }
23013   __pyx_L7_break:;
23014 
23015   /* "View.MemoryView":1130
23016  *             break
23017  *
23018  *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):             # <<<<<<<<<<<<<<
23019  *         return 'C'
23020  *     else:
23021  */
23022   __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
23023   if (__pyx_t_2) {
23024 
23025     /* "View.MemoryView":1131
23026  *
23027  *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
23028  *         return 'C'             # <<<<<<<<<<<<<<
23029  *     else:
23030  *         return 'F'
23031  */
23032     __pyx_r = 'C';
23033     goto __pyx_L0;
23034 
23035     /* "View.MemoryView":1130
23036  *             break
23037  *
23038  *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):             # <<<<<<<<<<<<<<
23039  *         return 'C'
23040  *     else:
23041  */
23042   }
23043 
23044   /* "View.MemoryView":1133
23045  *         return 'C'
23046  *     else:
23047  *         return 'F'             # <<<<<<<<<<<<<<
23048  *
23049  * @cython.cdivision(True)
23050  */
23051   /*else*/ {
23052     __pyx_r = 'F';
23053     goto __pyx_L0;
23054   }
23055 
23056   /* "View.MemoryView":1112
23057  *
23058  * @cname('__pyx_get_best_slice_order')
23059  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil:             # <<<<<<<<<<<<<<
23060  *     """
23061  *     Figure out the best memory access order for a given slice.
23062  */
23063 
23064   /* function exit code */
23065   __pyx_L0:;
23066   return __pyx_r;
23067 }
23068 
23069 /* "View.MemoryView":1136
23070  *
23071  * @cython.cdivision(True)
23072  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides,             # <<<<<<<<<<<<<<
23073  *                                    char *dst_data, Py_ssize_t *dst_strides,
23074  *                                    Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
23075  */
23076 
_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)23077 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) {
23078   CYTHON_UNUSED Py_ssize_t __pyx_v_i;
23079   CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
23080   Py_ssize_t __pyx_v_dst_extent;
23081   Py_ssize_t __pyx_v_src_stride;
23082   Py_ssize_t __pyx_v_dst_stride;
23083   int __pyx_t_1;
23084   int __pyx_t_2;
23085   int __pyx_t_3;
23086   Py_ssize_t __pyx_t_4;
23087   Py_ssize_t __pyx_t_5;
23088   Py_ssize_t __pyx_t_6;
23089 
23090   /* "View.MemoryView":1143
23091  *
23092  *     cdef Py_ssize_t i
23093  *     cdef Py_ssize_t src_extent = src_shape[0]             # <<<<<<<<<<<<<<
23094  *     cdef Py_ssize_t dst_extent = dst_shape[0]
23095  *     cdef Py_ssize_t src_stride = src_strides[0]
23096  */
23097   __pyx_v_src_extent = (__pyx_v_src_shape[0]);
23098 
23099   /* "View.MemoryView":1144
23100  *     cdef Py_ssize_t i
23101  *     cdef Py_ssize_t src_extent = src_shape[0]
23102  *     cdef Py_ssize_t dst_extent = dst_shape[0]             # <<<<<<<<<<<<<<
23103  *     cdef Py_ssize_t src_stride = src_strides[0]
23104  *     cdef Py_ssize_t dst_stride = dst_strides[0]
23105  */
23106   __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
23107 
23108   /* "View.MemoryView":1145
23109  *     cdef Py_ssize_t src_extent = src_shape[0]
23110  *     cdef Py_ssize_t dst_extent = dst_shape[0]
23111  *     cdef Py_ssize_t src_stride = src_strides[0]             # <<<<<<<<<<<<<<
23112  *     cdef Py_ssize_t dst_stride = dst_strides[0]
23113  *
23114  */
23115   __pyx_v_src_stride = (__pyx_v_src_strides[0]);
23116 
23117   /* "View.MemoryView":1146
23118  *     cdef Py_ssize_t dst_extent = dst_shape[0]
23119  *     cdef Py_ssize_t src_stride = src_strides[0]
23120  *     cdef Py_ssize_t dst_stride = dst_strides[0]             # <<<<<<<<<<<<<<
23121  *
23122  *     if ndim == 1:
23123  */
23124   __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
23125 
23126   /* "View.MemoryView":1148
23127  *     cdef Py_ssize_t dst_stride = dst_strides[0]
23128  *
23129  *     if ndim == 1:             # <<<<<<<<<<<<<<
23130  *        if (src_stride > 0 and dst_stride > 0 and
23131  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
23132  */
23133   __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
23134   if (__pyx_t_1) {
23135 
23136     /* "View.MemoryView":1149
23137  *
23138  *     if ndim == 1:
23139  *        if (src_stride > 0 and dst_stride > 0 and             # <<<<<<<<<<<<<<
23140  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
23141  *            memcpy(dst_data, src_data, itemsize * dst_extent)
23142  */
23143     __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
23144     if (__pyx_t_2) {
23145     } else {
23146       __pyx_t_1 = __pyx_t_2;
23147       goto __pyx_L5_bool_binop_done;
23148     }
23149     __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
23150     if (__pyx_t_2) {
23151     } else {
23152       __pyx_t_1 = __pyx_t_2;
23153       goto __pyx_L5_bool_binop_done;
23154     }
23155 
23156     /* "View.MemoryView":1150
23157  *     if ndim == 1:
23158  *        if (src_stride > 0 and dst_stride > 0 and
23159  *            <size_t> src_stride == itemsize == <size_t> dst_stride):             # <<<<<<<<<<<<<<
23160  *            memcpy(dst_data, src_data, itemsize * dst_extent)
23161  *        else:
23162  */
23163     __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
23164     if (__pyx_t_2) {
23165       __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
23166     }
23167     __pyx_t_3 = (__pyx_t_2 != 0);
23168     __pyx_t_1 = __pyx_t_3;
23169     __pyx_L5_bool_binop_done:;
23170 
23171     /* "View.MemoryView":1149
23172  *
23173  *     if ndim == 1:
23174  *        if (src_stride > 0 and dst_stride > 0 and             # <<<<<<<<<<<<<<
23175  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
23176  *            memcpy(dst_data, src_data, itemsize * dst_extent)
23177  */
23178     if (__pyx_t_1) {
23179 
23180       /* "View.MemoryView":1151
23181  *        if (src_stride > 0 and dst_stride > 0 and
23182  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
23183  *            memcpy(dst_data, src_data, itemsize * dst_extent)             # <<<<<<<<<<<<<<
23184  *        else:
23185  *            for i in range(dst_extent):
23186  */
23187       (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
23188 
23189       /* "View.MemoryView":1149
23190  *
23191  *     if ndim == 1:
23192  *        if (src_stride > 0 and dst_stride > 0 and             # <<<<<<<<<<<<<<
23193  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
23194  *            memcpy(dst_data, src_data, itemsize * dst_extent)
23195  */
23196       goto __pyx_L4;
23197     }
23198 
23199     /* "View.MemoryView":1153
23200  *            memcpy(dst_data, src_data, itemsize * dst_extent)
23201  *        else:
23202  *            for i in range(dst_extent):             # <<<<<<<<<<<<<<
23203  *                memcpy(dst_data, src_data, itemsize)
23204  *                src_data += src_stride
23205  */
23206     /*else*/ {
23207       __pyx_t_4 = __pyx_v_dst_extent;
23208       __pyx_t_5 = __pyx_t_4;
23209       for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
23210         __pyx_v_i = __pyx_t_6;
23211 
23212         /* "View.MemoryView":1154
23213  *        else:
23214  *            for i in range(dst_extent):
23215  *                memcpy(dst_data, src_data, itemsize)             # <<<<<<<<<<<<<<
23216  *                src_data += src_stride
23217  *                dst_data += dst_stride
23218  */
23219         (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
23220 
23221         /* "View.MemoryView":1155
23222  *            for i in range(dst_extent):
23223  *                memcpy(dst_data, src_data, itemsize)
23224  *                src_data += src_stride             # <<<<<<<<<<<<<<
23225  *                dst_data += dst_stride
23226  *     else:
23227  */
23228         __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
23229 
23230         /* "View.MemoryView":1156
23231  *                memcpy(dst_data, src_data, itemsize)
23232  *                src_data += src_stride
23233  *                dst_data += dst_stride             # <<<<<<<<<<<<<<
23234  *     else:
23235  *         for i in range(dst_extent):
23236  */
23237         __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
23238       }
23239     }
23240     __pyx_L4:;
23241 
23242     /* "View.MemoryView":1148
23243  *     cdef Py_ssize_t dst_stride = dst_strides[0]
23244  *
23245  *     if ndim == 1:             # <<<<<<<<<<<<<<
23246  *        if (src_stride > 0 and dst_stride > 0 and
23247  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
23248  */
23249     goto __pyx_L3;
23250   }
23251 
23252   /* "View.MemoryView":1158
23253  *                dst_data += dst_stride
23254  *     else:
23255  *         for i in range(dst_extent):             # <<<<<<<<<<<<<<
23256  *             _copy_strided_to_strided(src_data, src_strides + 1,
23257  *                                      dst_data, dst_strides + 1,
23258  */
23259   /*else*/ {
23260     __pyx_t_4 = __pyx_v_dst_extent;
23261     __pyx_t_5 = __pyx_t_4;
23262     for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
23263       __pyx_v_i = __pyx_t_6;
23264 
23265       /* "View.MemoryView":1159
23266  *     else:
23267  *         for i in range(dst_extent):
23268  *             _copy_strided_to_strided(src_data, src_strides + 1,             # <<<<<<<<<<<<<<
23269  *                                      dst_data, dst_strides + 1,
23270  *                                      src_shape + 1, dst_shape + 1,
23271  */
23272       _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);
23273 
23274       /* "View.MemoryView":1163
23275  *                                      src_shape + 1, dst_shape + 1,
23276  *                                      ndim - 1, itemsize)
23277  *             src_data += src_stride             # <<<<<<<<<<<<<<
23278  *             dst_data += dst_stride
23279  *
23280  */
23281       __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
23282 
23283       /* "View.MemoryView":1164
23284  *                                      ndim - 1, itemsize)
23285  *             src_data += src_stride
23286  *             dst_data += dst_stride             # <<<<<<<<<<<<<<
23287  *
23288  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
23289  */
23290       __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
23291     }
23292   }
23293   __pyx_L3:;
23294 
23295   /* "View.MemoryView":1136
23296  *
23297  * @cython.cdivision(True)
23298  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides,             # <<<<<<<<<<<<<<
23299  *                                    char *dst_data, Py_ssize_t *dst_strides,
23300  *                                    Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
23301  */
23302 
23303   /* function exit code */
23304 }
23305 
23306 /* "View.MemoryView":1166
23307  *             dst_data += dst_stride
23308  *
23309  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
23310  *                                   __Pyx_memviewslice *dst,
23311  *                                   int ndim, size_t itemsize) nogil:
23312  */
23313 
copy_strided_to_strided(__Pyx_memviewslice * __pyx_v_src,__Pyx_memviewslice * __pyx_v_dst,int __pyx_v_ndim,size_t __pyx_v_itemsize)23314 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) {
23315 
23316   /* "View.MemoryView":1169
23317  *                                   __Pyx_memviewslice *dst,
23318  *                                   int ndim, size_t itemsize) nogil:
23319  *     _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides,             # <<<<<<<<<<<<<<
23320  *                              src.shape, dst.shape, ndim, itemsize)
23321  *
23322  */
23323   _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);
23324 
23325   /* "View.MemoryView":1166
23326  *             dst_data += dst_stride
23327  *
23328  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
23329  *                                   __Pyx_memviewslice *dst,
23330  *                                   int ndim, size_t itemsize) nogil:
23331  */
23332 
23333   /* function exit code */
23334 }
23335 
23336 /* "View.MemoryView":1173
23337  *
23338  * @cname('__pyx_memoryview_slice_get_size')
23339  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:             # <<<<<<<<<<<<<<
23340  *     "Return the size of the memory occupied by the slice in number of bytes"
23341  *     cdef int i
23342  */
23343 
__pyx_memoryview_slice_get_size(__Pyx_memviewslice * __pyx_v_src,int __pyx_v_ndim)23344 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
23345   int __pyx_v_i;
23346   Py_ssize_t __pyx_v_size;
23347   Py_ssize_t __pyx_r;
23348   Py_ssize_t __pyx_t_1;
23349   int __pyx_t_2;
23350   int __pyx_t_3;
23351   int __pyx_t_4;
23352 
23353   /* "View.MemoryView":1176
23354  *     "Return the size of the memory occupied by the slice in number of bytes"
23355  *     cdef int i
23356  *     cdef Py_ssize_t size = src.memview.view.itemsize             # <<<<<<<<<<<<<<
23357  *
23358  *     for i in range(ndim):
23359  */
23360   __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
23361   __pyx_v_size = __pyx_t_1;
23362 
23363   /* "View.MemoryView":1178
23364  *     cdef Py_ssize_t size = src.memview.view.itemsize
23365  *
23366  *     for i in range(ndim):             # <<<<<<<<<<<<<<
23367  *         size *= src.shape[i]
23368  *
23369  */
23370   __pyx_t_2 = __pyx_v_ndim;
23371   __pyx_t_3 = __pyx_t_2;
23372   for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
23373     __pyx_v_i = __pyx_t_4;
23374 
23375     /* "View.MemoryView":1179
23376  *
23377  *     for i in range(ndim):
23378  *         size *= src.shape[i]             # <<<<<<<<<<<<<<
23379  *
23380  *     return size
23381  */
23382     __pyx_v_size = (__pyx_v_size * (__pyx_v_src->shape[__pyx_v_i]));
23383   }
23384 
23385   /* "View.MemoryView":1181
23386  *         size *= src.shape[i]
23387  *
23388  *     return size             # <<<<<<<<<<<<<<
23389  *
23390  * @cname('__pyx_fill_contig_strides_array')
23391  */
23392   __pyx_r = __pyx_v_size;
23393   goto __pyx_L0;
23394 
23395   /* "View.MemoryView":1173
23396  *
23397  * @cname('__pyx_memoryview_slice_get_size')
23398  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:             # <<<<<<<<<<<<<<
23399  *     "Return the size of the memory occupied by the slice in number of bytes"
23400  *     cdef int i
23401  */
23402 
23403   /* function exit code */
23404   __pyx_L0:;
23405   return __pyx_r;
23406 }
23407 
23408 /* "View.MemoryView":1184
23409  *
23410  * @cname('__pyx_fill_contig_strides_array')
23411  * cdef Py_ssize_t fill_contig_strides_array(             # <<<<<<<<<<<<<<
23412  *                 Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
23413  *                 int ndim, char order) nogil:
23414  */
23415 
__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)23416 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) {
23417   int __pyx_v_idx;
23418   Py_ssize_t __pyx_r;
23419   int __pyx_t_1;
23420   int __pyx_t_2;
23421   int __pyx_t_3;
23422   int __pyx_t_4;
23423 
23424   /* "View.MemoryView":1193
23425  *     cdef int idx
23426  *
23427  *     if order == 'F':             # <<<<<<<<<<<<<<
23428  *         for idx in range(ndim):
23429  *             strides[idx] = stride
23430  */
23431   __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
23432   if (__pyx_t_1) {
23433 
23434     /* "View.MemoryView":1194
23435  *
23436  *     if order == 'F':
23437  *         for idx in range(ndim):             # <<<<<<<<<<<<<<
23438  *             strides[idx] = stride
23439  *             stride = stride * shape[idx]
23440  */
23441     __pyx_t_2 = __pyx_v_ndim;
23442     __pyx_t_3 = __pyx_t_2;
23443     for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
23444       __pyx_v_idx = __pyx_t_4;
23445 
23446       /* "View.MemoryView":1195
23447  *     if order == 'F':
23448  *         for idx in range(ndim):
23449  *             strides[idx] = stride             # <<<<<<<<<<<<<<
23450  *             stride = stride * shape[idx]
23451  *     else:
23452  */
23453       (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
23454 
23455       /* "View.MemoryView":1196
23456  *         for idx in range(ndim):
23457  *             strides[idx] = stride
23458  *             stride = stride * shape[idx]             # <<<<<<<<<<<<<<
23459  *     else:
23460  *         for idx in range(ndim - 1, -1, -1):
23461  */
23462       __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
23463     }
23464 
23465     /* "View.MemoryView":1193
23466  *     cdef int idx
23467  *
23468  *     if order == 'F':             # <<<<<<<<<<<<<<
23469  *         for idx in range(ndim):
23470  *             strides[idx] = stride
23471  */
23472     goto __pyx_L3;
23473   }
23474 
23475   /* "View.MemoryView":1198
23476  *             stride = stride * shape[idx]
23477  *     else:
23478  *         for idx in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
23479  *             strides[idx] = stride
23480  *             stride = stride * shape[idx]
23481  */
23482   /*else*/ {
23483     for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
23484       __pyx_v_idx = __pyx_t_2;
23485 
23486       /* "View.MemoryView":1199
23487  *     else:
23488  *         for idx in range(ndim - 1, -1, -1):
23489  *             strides[idx] = stride             # <<<<<<<<<<<<<<
23490  *             stride = stride * shape[idx]
23491  *
23492  */
23493       (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
23494 
23495       /* "View.MemoryView":1200
23496  *         for idx in range(ndim - 1, -1, -1):
23497  *             strides[idx] = stride
23498  *             stride = stride * shape[idx]             # <<<<<<<<<<<<<<
23499  *
23500  *     return stride
23501  */
23502       __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
23503     }
23504   }
23505   __pyx_L3:;
23506 
23507   /* "View.MemoryView":1202
23508  *             stride = stride * shape[idx]
23509  *
23510  *     return stride             # <<<<<<<<<<<<<<
23511  *
23512  * @cname('__pyx_memoryview_copy_data_to_temp')
23513  */
23514   __pyx_r = __pyx_v_stride;
23515   goto __pyx_L0;
23516 
23517   /* "View.MemoryView":1184
23518  *
23519  * @cname('__pyx_fill_contig_strides_array')
23520  * cdef Py_ssize_t fill_contig_strides_array(             # <<<<<<<<<<<<<<
23521  *                 Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
23522  *                 int ndim, char order) nogil:
23523  */
23524 
23525   /* function exit code */
23526   __pyx_L0:;
23527   return __pyx_r;
23528 }
23529 
23530 /* "View.MemoryView":1205
23531  *
23532  * @cname('__pyx_memoryview_copy_data_to_temp')
23533  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
23534  *                              __Pyx_memviewslice *tmpslice,
23535  *                              char order,
23536  */
23537 
__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice * __pyx_v_src,__Pyx_memviewslice * __pyx_v_tmpslice,char __pyx_v_order,int __pyx_v_ndim)23538 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) {
23539   int __pyx_v_i;
23540   void *__pyx_v_result;
23541   size_t __pyx_v_itemsize;
23542   size_t __pyx_v_size;
23543   void *__pyx_r;
23544   Py_ssize_t __pyx_t_1;
23545   int __pyx_t_2;
23546   int __pyx_t_3;
23547   struct __pyx_memoryview_obj *__pyx_t_4;
23548   int __pyx_t_5;
23549   int __pyx_t_6;
23550 
23551   /* "View.MemoryView":1216
23552  *     cdef void *result
23553  *
23554  *     cdef size_t itemsize = src.memview.view.itemsize             # <<<<<<<<<<<<<<
23555  *     cdef size_t size = slice_get_size(src, ndim)
23556  *
23557  */
23558   __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
23559   __pyx_v_itemsize = __pyx_t_1;
23560 
23561   /* "View.MemoryView":1217
23562  *
23563  *     cdef size_t itemsize = src.memview.view.itemsize
23564  *     cdef size_t size = slice_get_size(src, ndim)             # <<<<<<<<<<<<<<
23565  *
23566  *     result = malloc(size)
23567  */
23568   __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
23569 
23570   /* "View.MemoryView":1219
23571  *     cdef size_t size = slice_get_size(src, ndim)
23572  *
23573  *     result = malloc(size)             # <<<<<<<<<<<<<<
23574  *     if not result:
23575  *         _err(MemoryError, NULL)
23576  */
23577   __pyx_v_result = malloc(__pyx_v_size);
23578 
23579   /* "View.MemoryView":1220
23580  *
23581  *     result = malloc(size)
23582  *     if not result:             # <<<<<<<<<<<<<<
23583  *         _err(MemoryError, NULL)
23584  *
23585  */
23586   __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
23587   if (__pyx_t_2) {
23588 
23589     /* "View.MemoryView":1221
23590  *     result = malloc(size)
23591  *     if not result:
23592  *         _err(MemoryError, NULL)             # <<<<<<<<<<<<<<
23593  *
23594  *
23595  */
23596     __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(4, 1221, __pyx_L1_error)
23597 
23598     /* "View.MemoryView":1220
23599  *
23600  *     result = malloc(size)
23601  *     if not result:             # <<<<<<<<<<<<<<
23602  *         _err(MemoryError, NULL)
23603  *
23604  */
23605   }
23606 
23607   /* "View.MemoryView":1224
23608  *
23609  *
23610  *     tmpslice.data = <char *> result             # <<<<<<<<<<<<<<
23611  *     tmpslice.memview = src.memview
23612  *     for i in range(ndim):
23613  */
23614   __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
23615 
23616   /* "View.MemoryView":1225
23617  *
23618  *     tmpslice.data = <char *> result
23619  *     tmpslice.memview = src.memview             # <<<<<<<<<<<<<<
23620  *     for i in range(ndim):
23621  *         tmpslice.shape[i] = src.shape[i]
23622  */
23623   __pyx_t_4 = __pyx_v_src->memview;
23624   __pyx_v_tmpslice->memview = __pyx_t_4;
23625 
23626   /* "View.MemoryView":1226
23627  *     tmpslice.data = <char *> result
23628  *     tmpslice.memview = src.memview
23629  *     for i in range(ndim):             # <<<<<<<<<<<<<<
23630  *         tmpslice.shape[i] = src.shape[i]
23631  *         tmpslice.suboffsets[i] = -1
23632  */
23633   __pyx_t_3 = __pyx_v_ndim;
23634   __pyx_t_5 = __pyx_t_3;
23635   for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
23636     __pyx_v_i = __pyx_t_6;
23637 
23638     /* "View.MemoryView":1227
23639  *     tmpslice.memview = src.memview
23640  *     for i in range(ndim):
23641  *         tmpslice.shape[i] = src.shape[i]             # <<<<<<<<<<<<<<
23642  *         tmpslice.suboffsets[i] = -1
23643  *
23644  */
23645     (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
23646 
23647     /* "View.MemoryView":1228
23648  *     for i in range(ndim):
23649  *         tmpslice.shape[i] = src.shape[i]
23650  *         tmpslice.suboffsets[i] = -1             # <<<<<<<<<<<<<<
23651  *
23652  *     fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
23653  */
23654     (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
23655   }
23656 
23657   /* "View.MemoryView":1230
23658  *         tmpslice.suboffsets[i] = -1
23659  *
23660  *     fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,             # <<<<<<<<<<<<<<
23661  *                               ndim, order)
23662  *
23663  */
23664   (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));
23665 
23666   /* "View.MemoryView":1234
23667  *
23668  *
23669  *     for i in range(ndim):             # <<<<<<<<<<<<<<
23670  *         if tmpslice.shape[i] == 1:
23671  *             tmpslice.strides[i] = 0
23672  */
23673   __pyx_t_3 = __pyx_v_ndim;
23674   __pyx_t_5 = __pyx_t_3;
23675   for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
23676     __pyx_v_i = __pyx_t_6;
23677 
23678     /* "View.MemoryView":1235
23679  *
23680  *     for i in range(ndim):
23681  *         if tmpslice.shape[i] == 1:             # <<<<<<<<<<<<<<
23682  *             tmpslice.strides[i] = 0
23683  *
23684  */
23685     __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
23686     if (__pyx_t_2) {
23687 
23688       /* "View.MemoryView":1236
23689  *     for i in range(ndim):
23690  *         if tmpslice.shape[i] == 1:
23691  *             tmpslice.strides[i] = 0             # <<<<<<<<<<<<<<
23692  *
23693  *     if slice_is_contig(src[0], order, ndim):
23694  */
23695       (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
23696 
23697       /* "View.MemoryView":1235
23698  *
23699  *     for i in range(ndim):
23700  *         if tmpslice.shape[i] == 1:             # <<<<<<<<<<<<<<
23701  *             tmpslice.strides[i] = 0
23702  *
23703  */
23704     }
23705   }
23706 
23707   /* "View.MemoryView":1238
23708  *             tmpslice.strides[i] = 0
23709  *
23710  *     if slice_is_contig(src[0], order, ndim):             # <<<<<<<<<<<<<<
23711  *         memcpy(result, src.data, size)
23712  *     else:
23713  */
23714   __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
23715   if (__pyx_t_2) {
23716 
23717     /* "View.MemoryView":1239
23718  *
23719  *     if slice_is_contig(src[0], order, ndim):
23720  *         memcpy(result, src.data, size)             # <<<<<<<<<<<<<<
23721  *     else:
23722  *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)
23723  */
23724     (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
23725 
23726     /* "View.MemoryView":1238
23727  *             tmpslice.strides[i] = 0
23728  *
23729  *     if slice_is_contig(src[0], order, ndim):             # <<<<<<<<<<<<<<
23730  *         memcpy(result, src.data, size)
23731  *     else:
23732  */
23733     goto __pyx_L9;
23734   }
23735 
23736   /* "View.MemoryView":1241
23737  *         memcpy(result, src.data, size)
23738  *     else:
23739  *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)             # <<<<<<<<<<<<<<
23740  *
23741  *     return result
23742  */
23743   /*else*/ {
23744     copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
23745   }
23746   __pyx_L9:;
23747 
23748   /* "View.MemoryView":1243
23749  *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)
23750  *
23751  *     return result             # <<<<<<<<<<<<<<
23752  *
23753  *
23754  */
23755   __pyx_r = __pyx_v_result;
23756   goto __pyx_L0;
23757 
23758   /* "View.MemoryView":1205
23759  *
23760  * @cname('__pyx_memoryview_copy_data_to_temp')
23761  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
23762  *                              __Pyx_memviewslice *tmpslice,
23763  *                              char order,
23764  */
23765 
23766   /* function exit code */
23767   __pyx_L1_error:;
23768   {
23769     #ifdef WITH_THREAD
23770     PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
23771     #endif
23772     __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
23773     #ifdef WITH_THREAD
23774     __Pyx_PyGILState_Release(__pyx_gilstate_save);
23775     #endif
23776   }
23777   __pyx_r = NULL;
23778   __pyx_L0:;
23779   return __pyx_r;
23780 }
23781 
23782 /* "View.MemoryView":1248
23783  *
23784  * @cname('__pyx_memoryview_err_extents')
23785  * cdef int _err_extents(int i, Py_ssize_t extent1,             # <<<<<<<<<<<<<<
23786  *                              Py_ssize_t extent2) except -1 with gil:
23787  *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %
23788  */
23789 
__pyx_memoryview_err_extents(int __pyx_v_i,Py_ssize_t __pyx_v_extent1,Py_ssize_t __pyx_v_extent2)23790 static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
23791   int __pyx_r;
23792   __Pyx_RefNannyDeclarations
23793   PyObject *__pyx_t_1 = NULL;
23794   PyObject *__pyx_t_2 = NULL;
23795   PyObject *__pyx_t_3 = NULL;
23796   PyObject *__pyx_t_4 = NULL;
23797   #ifdef WITH_THREAD
23798   PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
23799   #endif
23800   __Pyx_RefNannySetupContext("_err_extents", 0);
23801 
23802   /* "View.MemoryView":1251
23803  *                              Py_ssize_t extent2) except -1 with gil:
23804  *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %
23805  *                                                         (i, extent1, extent2))             # <<<<<<<<<<<<<<
23806  *
23807  * @cname('__pyx_memoryview_err_dim')
23808  */
23809   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1251, __pyx_L1_error)
23810   __Pyx_GOTREF(__pyx_t_1);
23811   __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1251, __pyx_L1_error)
23812   __Pyx_GOTREF(__pyx_t_2);
23813   __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1251, __pyx_L1_error)
23814   __Pyx_GOTREF(__pyx_t_3);
23815   __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1251, __pyx_L1_error)
23816   __Pyx_GOTREF(__pyx_t_4);
23817   __Pyx_GIVEREF(__pyx_t_1);
23818   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
23819   __Pyx_GIVEREF(__pyx_t_2);
23820   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
23821   __Pyx_GIVEREF(__pyx_t_3);
23822   PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
23823   __pyx_t_1 = 0;
23824   __pyx_t_2 = 0;
23825   __pyx_t_3 = 0;
23826 
23827   /* "View.MemoryView":1250
23828  * cdef int _err_extents(int i, Py_ssize_t extent1,
23829  *                              Py_ssize_t extent2) except -1 with gil:
23830  *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %             # <<<<<<<<<<<<<<
23831  *                                                         (i, extent1, extent2))
23832  *
23833  */
23834   __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1250, __pyx_L1_error)
23835   __Pyx_GOTREF(__pyx_t_3);
23836   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23837   __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1250, __pyx_L1_error)
23838   __Pyx_GOTREF(__pyx_t_4);
23839   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23840   __Pyx_Raise(__pyx_t_4, 0, 0, 0);
23841   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23842   __PYX_ERR(4, 1250, __pyx_L1_error)
23843 
23844   /* "View.MemoryView":1248
23845  *
23846  * @cname('__pyx_memoryview_err_extents')
23847  * cdef int _err_extents(int i, Py_ssize_t extent1,             # <<<<<<<<<<<<<<
23848  *                              Py_ssize_t extent2) except -1 with gil:
23849  *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %
23850  */
23851 
23852   /* function exit code */
23853   __pyx_L1_error:;
23854   __Pyx_XDECREF(__pyx_t_1);
23855   __Pyx_XDECREF(__pyx_t_2);
23856   __Pyx_XDECREF(__pyx_t_3);
23857   __Pyx_XDECREF(__pyx_t_4);
23858   __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
23859   __pyx_r = -1;
23860   __Pyx_RefNannyFinishContext();
23861   #ifdef WITH_THREAD
23862   __Pyx_PyGILState_Release(__pyx_gilstate_save);
23863   #endif
23864   return __pyx_r;
23865 }
23866 
23867 /* "View.MemoryView":1254
23868  *
23869  * @cname('__pyx_memoryview_err_dim')
23870  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:             # <<<<<<<<<<<<<<
23871  *     raise error(msg.decode('ascii') % dim)
23872  *
23873  */
23874 
__pyx_memoryview_err_dim(PyObject * __pyx_v_error,char * __pyx_v_msg,int __pyx_v_dim)23875 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
23876   int __pyx_r;
23877   __Pyx_RefNannyDeclarations
23878   PyObject *__pyx_t_1 = NULL;
23879   PyObject *__pyx_t_2 = NULL;
23880   PyObject *__pyx_t_3 = NULL;
23881   PyObject *__pyx_t_4 = NULL;
23882   #ifdef WITH_THREAD
23883   PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
23884   #endif
23885   __Pyx_RefNannySetupContext("_err_dim", 0);
23886   __Pyx_INCREF(__pyx_v_error);
23887 
23888   /* "View.MemoryView":1255
23889  * @cname('__pyx_memoryview_err_dim')
23890  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
23891  *     raise error(msg.decode('ascii') % dim)             # <<<<<<<<<<<<<<
23892  *
23893  * @cname('__pyx_memoryview_err')
23894  */
23895   __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(4, 1255, __pyx_L1_error)
23896   __Pyx_GOTREF(__pyx_t_2);
23897   __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1255, __pyx_L1_error)
23898   __Pyx_GOTREF(__pyx_t_3);
23899   __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1255, __pyx_L1_error)
23900   __Pyx_GOTREF(__pyx_t_4);
23901   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23902   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23903   __Pyx_INCREF(__pyx_v_error);
23904   __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
23905   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
23906     __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
23907     if (likely(__pyx_t_2)) {
23908       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
23909       __Pyx_INCREF(__pyx_t_2);
23910       __Pyx_INCREF(function);
23911       __Pyx_DECREF_SET(__pyx_t_3, function);
23912     }
23913   }
23914   __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);
23915   __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
23916   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23917   if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1255, __pyx_L1_error)
23918   __Pyx_GOTREF(__pyx_t_1);
23919   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23920   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
23921   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23922   __PYX_ERR(4, 1255, __pyx_L1_error)
23923 
23924   /* "View.MemoryView":1254
23925  *
23926  * @cname('__pyx_memoryview_err_dim')
23927  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:             # <<<<<<<<<<<<<<
23928  *     raise error(msg.decode('ascii') % dim)
23929  *
23930  */
23931 
23932   /* function exit code */
23933   __pyx_L1_error:;
23934   __Pyx_XDECREF(__pyx_t_1);
23935   __Pyx_XDECREF(__pyx_t_2);
23936   __Pyx_XDECREF(__pyx_t_3);
23937   __Pyx_XDECREF(__pyx_t_4);
23938   __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
23939   __pyx_r = -1;
23940   __Pyx_XDECREF(__pyx_v_error);
23941   __Pyx_RefNannyFinishContext();
23942   #ifdef WITH_THREAD
23943   __Pyx_PyGILState_Release(__pyx_gilstate_save);
23944   #endif
23945   return __pyx_r;
23946 }
23947 
23948 /* "View.MemoryView":1258
23949  *
23950  * @cname('__pyx_memoryview_err')
23951  * cdef int _err(object error, char *msg) except -1 with gil:             # <<<<<<<<<<<<<<
23952  *     if msg != NULL:
23953  *         raise error(msg.decode('ascii'))
23954  */
23955 
__pyx_memoryview_err(PyObject * __pyx_v_error,char * __pyx_v_msg)23956 static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
23957   int __pyx_r;
23958   __Pyx_RefNannyDeclarations
23959   int __pyx_t_1;
23960   PyObject *__pyx_t_2 = NULL;
23961   PyObject *__pyx_t_3 = NULL;
23962   PyObject *__pyx_t_4 = NULL;
23963   PyObject *__pyx_t_5 = NULL;
23964   #ifdef WITH_THREAD
23965   PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
23966   #endif
23967   __Pyx_RefNannySetupContext("_err", 0);
23968   __Pyx_INCREF(__pyx_v_error);
23969 
23970   /* "View.MemoryView":1259
23971  * @cname('__pyx_memoryview_err')
23972  * cdef int _err(object error, char *msg) except -1 with gil:
23973  *     if msg != NULL:             # <<<<<<<<<<<<<<
23974  *         raise error(msg.decode('ascii'))
23975  *     else:
23976  */
23977   __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
23978   if (unlikely(__pyx_t_1)) {
23979 
23980     /* "View.MemoryView":1260
23981  * cdef int _err(object error, char *msg) except -1 with gil:
23982  *     if msg != NULL:
23983  *         raise error(msg.decode('ascii'))             # <<<<<<<<<<<<<<
23984  *     else:
23985  *         raise error
23986  */
23987     __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(4, 1260, __pyx_L1_error)
23988     __Pyx_GOTREF(__pyx_t_3);
23989     __Pyx_INCREF(__pyx_v_error);
23990     __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
23991     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
23992       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
23993       if (likely(__pyx_t_5)) {
23994         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
23995         __Pyx_INCREF(__pyx_t_5);
23996         __Pyx_INCREF(function);
23997         __Pyx_DECREF_SET(__pyx_t_4, function);
23998       }
23999     }
24000     __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);
24001     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
24002     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24003     if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1260, __pyx_L1_error)
24004     __Pyx_GOTREF(__pyx_t_2);
24005     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24006     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
24007     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24008     __PYX_ERR(4, 1260, __pyx_L1_error)
24009 
24010     /* "View.MemoryView":1259
24011  * @cname('__pyx_memoryview_err')
24012  * cdef int _err(object error, char *msg) except -1 with gil:
24013  *     if msg != NULL:             # <<<<<<<<<<<<<<
24014  *         raise error(msg.decode('ascii'))
24015  *     else:
24016  */
24017   }
24018 
24019   /* "View.MemoryView":1262
24020  *         raise error(msg.decode('ascii'))
24021  *     else:
24022  *         raise error             # <<<<<<<<<<<<<<
24023  *
24024  * @cname('__pyx_memoryview_copy_contents')
24025  */
24026   /*else*/ {
24027     __Pyx_Raise(__pyx_v_error, 0, 0, 0);
24028     __PYX_ERR(4, 1262, __pyx_L1_error)
24029   }
24030 
24031   /* "View.MemoryView":1258
24032  *
24033  * @cname('__pyx_memoryview_err')
24034  * cdef int _err(object error, char *msg) except -1 with gil:             # <<<<<<<<<<<<<<
24035  *     if msg != NULL:
24036  *         raise error(msg.decode('ascii'))
24037  */
24038 
24039   /* function exit code */
24040   __pyx_L1_error:;
24041   __Pyx_XDECREF(__pyx_t_2);
24042   __Pyx_XDECREF(__pyx_t_3);
24043   __Pyx_XDECREF(__pyx_t_4);
24044   __Pyx_XDECREF(__pyx_t_5);
24045   __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
24046   __pyx_r = -1;
24047   __Pyx_XDECREF(__pyx_v_error);
24048   __Pyx_RefNannyFinishContext();
24049   #ifdef WITH_THREAD
24050   __Pyx_PyGILState_Release(__pyx_gilstate_save);
24051   #endif
24052   return __pyx_r;
24053 }
24054 
24055 /* "View.MemoryView":1265
24056  *
24057  * @cname('__pyx_memoryview_copy_contents')
24058  * cdef int memoryview_copy_contents(__Pyx_memviewslice src,             # <<<<<<<<<<<<<<
24059  *                                   __Pyx_memviewslice dst,
24060  *                                   int src_ndim, int dst_ndim,
24061  */
24062 
__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)24063 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) {
24064   void *__pyx_v_tmpdata;
24065   size_t __pyx_v_itemsize;
24066   int __pyx_v_i;
24067   char __pyx_v_order;
24068   int __pyx_v_broadcasting;
24069   int __pyx_v_direct_copy;
24070   __Pyx_memviewslice __pyx_v_tmp;
24071   int __pyx_v_ndim;
24072   int __pyx_r;
24073   Py_ssize_t __pyx_t_1;
24074   int __pyx_t_2;
24075   int __pyx_t_3;
24076   int __pyx_t_4;
24077   int __pyx_t_5;
24078   int __pyx_t_6;
24079   void *__pyx_t_7;
24080   int __pyx_t_8;
24081 
24082   /* "View.MemoryView":1273
24083  *     Check for overlapping memory and verify the shapes.
24084  *     """
24085  *     cdef void *tmpdata = NULL             # <<<<<<<<<<<<<<
24086  *     cdef size_t itemsize = src.memview.view.itemsize
24087  *     cdef int i
24088  */
24089   __pyx_v_tmpdata = NULL;
24090 
24091   /* "View.MemoryView":1274
24092  *     """
24093  *     cdef void *tmpdata = NULL
24094  *     cdef size_t itemsize = src.memview.view.itemsize             # <<<<<<<<<<<<<<
24095  *     cdef int i
24096  *     cdef char order = get_best_order(&src, src_ndim)
24097  */
24098   __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
24099   __pyx_v_itemsize = __pyx_t_1;
24100 
24101   /* "View.MemoryView":1276
24102  *     cdef size_t itemsize = src.memview.view.itemsize
24103  *     cdef int i
24104  *     cdef char order = get_best_order(&src, src_ndim)             # <<<<<<<<<<<<<<
24105  *     cdef bint broadcasting = False
24106  *     cdef bint direct_copy = False
24107  */
24108   __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
24109 
24110   /* "View.MemoryView":1277
24111  *     cdef int i
24112  *     cdef char order = get_best_order(&src, src_ndim)
24113  *     cdef bint broadcasting = False             # <<<<<<<<<<<<<<
24114  *     cdef bint direct_copy = False
24115  *     cdef __Pyx_memviewslice tmp
24116  */
24117   __pyx_v_broadcasting = 0;
24118 
24119   /* "View.MemoryView":1278
24120  *     cdef char order = get_best_order(&src, src_ndim)
24121  *     cdef bint broadcasting = False
24122  *     cdef bint direct_copy = False             # <<<<<<<<<<<<<<
24123  *     cdef __Pyx_memviewslice tmp
24124  *
24125  */
24126   __pyx_v_direct_copy = 0;
24127 
24128   /* "View.MemoryView":1281
24129  *     cdef __Pyx_memviewslice tmp
24130  *
24131  *     if src_ndim < dst_ndim:             # <<<<<<<<<<<<<<
24132  *         broadcast_leading(&src, src_ndim, dst_ndim)
24133  *     elif dst_ndim < src_ndim:
24134  */
24135   __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
24136   if (__pyx_t_2) {
24137 
24138     /* "View.MemoryView":1282
24139  *
24140  *     if src_ndim < dst_ndim:
24141  *         broadcast_leading(&src, src_ndim, dst_ndim)             # <<<<<<<<<<<<<<
24142  *     elif dst_ndim < src_ndim:
24143  *         broadcast_leading(&dst, dst_ndim, src_ndim)
24144  */
24145     __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
24146 
24147     /* "View.MemoryView":1281
24148  *     cdef __Pyx_memviewslice tmp
24149  *
24150  *     if src_ndim < dst_ndim:             # <<<<<<<<<<<<<<
24151  *         broadcast_leading(&src, src_ndim, dst_ndim)
24152  *     elif dst_ndim < src_ndim:
24153  */
24154     goto __pyx_L3;
24155   }
24156 
24157   /* "View.MemoryView":1283
24158  *     if src_ndim < dst_ndim:
24159  *         broadcast_leading(&src, src_ndim, dst_ndim)
24160  *     elif dst_ndim < src_ndim:             # <<<<<<<<<<<<<<
24161  *         broadcast_leading(&dst, dst_ndim, src_ndim)
24162  *
24163  */
24164   __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
24165   if (__pyx_t_2) {
24166 
24167     /* "View.MemoryView":1284
24168  *         broadcast_leading(&src, src_ndim, dst_ndim)
24169  *     elif dst_ndim < src_ndim:
24170  *         broadcast_leading(&dst, dst_ndim, src_ndim)             # <<<<<<<<<<<<<<
24171  *
24172  *     cdef int ndim = max(src_ndim, dst_ndim)
24173  */
24174     __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
24175 
24176     /* "View.MemoryView":1283
24177  *     if src_ndim < dst_ndim:
24178  *         broadcast_leading(&src, src_ndim, dst_ndim)
24179  *     elif dst_ndim < src_ndim:             # <<<<<<<<<<<<<<
24180  *         broadcast_leading(&dst, dst_ndim, src_ndim)
24181  *
24182  */
24183   }
24184   __pyx_L3:;
24185 
24186   /* "View.MemoryView":1286
24187  *         broadcast_leading(&dst, dst_ndim, src_ndim)
24188  *
24189  *     cdef int ndim = max(src_ndim, dst_ndim)             # <<<<<<<<<<<<<<
24190  *
24191  *     for i in range(ndim):
24192  */
24193   __pyx_t_3 = __pyx_v_dst_ndim;
24194   __pyx_t_4 = __pyx_v_src_ndim;
24195   if (((__pyx_t_3 > __pyx_t_4) != 0)) {
24196     __pyx_t_5 = __pyx_t_3;
24197   } else {
24198     __pyx_t_5 = __pyx_t_4;
24199   }
24200   __pyx_v_ndim = __pyx_t_5;
24201 
24202   /* "View.MemoryView":1288
24203  *     cdef int ndim = max(src_ndim, dst_ndim)
24204  *
24205  *     for i in range(ndim):             # <<<<<<<<<<<<<<
24206  *         if src.shape[i] != dst.shape[i]:
24207  *             if src.shape[i] == 1:
24208  */
24209   __pyx_t_5 = __pyx_v_ndim;
24210   __pyx_t_3 = __pyx_t_5;
24211   for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
24212     __pyx_v_i = __pyx_t_4;
24213 
24214     /* "View.MemoryView":1289
24215  *
24216  *     for i in range(ndim):
24217  *         if src.shape[i] != dst.shape[i]:             # <<<<<<<<<<<<<<
24218  *             if src.shape[i] == 1:
24219  *                 broadcasting = True
24220  */
24221     __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
24222     if (__pyx_t_2) {
24223 
24224       /* "View.MemoryView":1290
24225  *     for i in range(ndim):
24226  *         if src.shape[i] != dst.shape[i]:
24227  *             if src.shape[i] == 1:             # <<<<<<<<<<<<<<
24228  *                 broadcasting = True
24229  *                 src.strides[i] = 0
24230  */
24231       __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
24232       if (__pyx_t_2) {
24233 
24234         /* "View.MemoryView":1291
24235  *         if src.shape[i] != dst.shape[i]:
24236  *             if src.shape[i] == 1:
24237  *                 broadcasting = True             # <<<<<<<<<<<<<<
24238  *                 src.strides[i] = 0
24239  *             else:
24240  */
24241         __pyx_v_broadcasting = 1;
24242 
24243         /* "View.MemoryView":1292
24244  *             if src.shape[i] == 1:
24245  *                 broadcasting = True
24246  *                 src.strides[i] = 0             # <<<<<<<<<<<<<<
24247  *             else:
24248  *                 _err_extents(i, dst.shape[i], src.shape[i])
24249  */
24250         (__pyx_v_src.strides[__pyx_v_i]) = 0;
24251 
24252         /* "View.MemoryView":1290
24253  *     for i in range(ndim):
24254  *         if src.shape[i] != dst.shape[i]:
24255  *             if src.shape[i] == 1:             # <<<<<<<<<<<<<<
24256  *                 broadcasting = True
24257  *                 src.strides[i] = 0
24258  */
24259         goto __pyx_L7;
24260       }
24261 
24262       /* "View.MemoryView":1294
24263  *                 src.strides[i] = 0
24264  *             else:
24265  *                 _err_extents(i, dst.shape[i], src.shape[i])             # <<<<<<<<<<<<<<
24266  *
24267  *         if src.suboffsets[i] >= 0:
24268  */
24269       /*else*/ {
24270         __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(4, 1294, __pyx_L1_error)
24271       }
24272       __pyx_L7:;
24273 
24274       /* "View.MemoryView":1289
24275  *
24276  *     for i in range(ndim):
24277  *         if src.shape[i] != dst.shape[i]:             # <<<<<<<<<<<<<<
24278  *             if src.shape[i] == 1:
24279  *                 broadcasting = True
24280  */
24281     }
24282 
24283     /* "View.MemoryView":1296
24284  *                 _err_extents(i, dst.shape[i], src.shape[i])
24285  *
24286  *         if src.suboffsets[i] >= 0:             # <<<<<<<<<<<<<<
24287  *             _err_dim(ValueError, "Dimension %d is not direct", i)
24288  *
24289  */
24290     __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
24291     if (__pyx_t_2) {
24292 
24293       /* "View.MemoryView":1297
24294  *
24295  *         if src.suboffsets[i] >= 0:
24296  *             _err_dim(ValueError, "Dimension %d is not direct", i)             # <<<<<<<<<<<<<<
24297  *
24298  *     if slices_overlap(&src, &dst, ndim, itemsize):
24299  */
24300       __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(4, 1297, __pyx_L1_error)
24301 
24302       /* "View.MemoryView":1296
24303  *                 _err_extents(i, dst.shape[i], src.shape[i])
24304  *
24305  *         if src.suboffsets[i] >= 0:             # <<<<<<<<<<<<<<
24306  *             _err_dim(ValueError, "Dimension %d is not direct", i)
24307  *
24308  */
24309     }
24310   }
24311 
24312   /* "View.MemoryView":1299
24313  *             _err_dim(ValueError, "Dimension %d is not direct", i)
24314  *
24315  *     if slices_overlap(&src, &dst, ndim, itemsize):             # <<<<<<<<<<<<<<
24316  *
24317  *         if not slice_is_contig(src, order, ndim):
24318  */
24319   __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
24320   if (__pyx_t_2) {
24321 
24322     /* "View.MemoryView":1301
24323  *     if slices_overlap(&src, &dst, ndim, itemsize):
24324  *
24325  *         if not slice_is_contig(src, order, ndim):             # <<<<<<<<<<<<<<
24326  *             order = get_best_order(&dst, ndim)
24327  *
24328  */
24329     __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
24330     if (__pyx_t_2) {
24331 
24332       /* "View.MemoryView":1302
24333  *
24334  *         if not slice_is_contig(src, order, ndim):
24335  *             order = get_best_order(&dst, ndim)             # <<<<<<<<<<<<<<
24336  *
24337  *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
24338  */
24339       __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
24340 
24341       /* "View.MemoryView":1301
24342  *     if slices_overlap(&src, &dst, ndim, itemsize):
24343  *
24344  *         if not slice_is_contig(src, order, ndim):             # <<<<<<<<<<<<<<
24345  *             order = get_best_order(&dst, ndim)
24346  *
24347  */
24348     }
24349 
24350     /* "View.MemoryView":1304
24351  *             order = get_best_order(&dst, ndim)
24352  *
24353  *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)             # <<<<<<<<<<<<<<
24354  *         src = tmp
24355  *
24356  */
24357     __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(4, 1304, __pyx_L1_error)
24358     __pyx_v_tmpdata = __pyx_t_7;
24359 
24360     /* "View.MemoryView":1305
24361  *
24362  *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
24363  *         src = tmp             # <<<<<<<<<<<<<<
24364  *
24365  *     if not broadcasting:
24366  */
24367     __pyx_v_src = __pyx_v_tmp;
24368 
24369     /* "View.MemoryView":1299
24370  *             _err_dim(ValueError, "Dimension %d is not direct", i)
24371  *
24372  *     if slices_overlap(&src, &dst, ndim, itemsize):             # <<<<<<<<<<<<<<
24373  *
24374  *         if not slice_is_contig(src, order, ndim):
24375  */
24376   }
24377 
24378   /* "View.MemoryView":1307
24379  *         src = tmp
24380  *
24381  *     if not broadcasting:             # <<<<<<<<<<<<<<
24382  *
24383  *
24384  */
24385   __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
24386   if (__pyx_t_2) {
24387 
24388     /* "View.MemoryView":1310
24389  *
24390  *
24391  *         if slice_is_contig(src, 'C', ndim):             # <<<<<<<<<<<<<<
24392  *             direct_copy = slice_is_contig(dst, 'C', ndim)
24393  *         elif slice_is_contig(src, 'F', ndim):
24394  */
24395     __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
24396     if (__pyx_t_2) {
24397 
24398       /* "View.MemoryView":1311
24399  *
24400  *         if slice_is_contig(src, 'C', ndim):
24401  *             direct_copy = slice_is_contig(dst, 'C', ndim)             # <<<<<<<<<<<<<<
24402  *         elif slice_is_contig(src, 'F', ndim):
24403  *             direct_copy = slice_is_contig(dst, 'F', ndim)
24404  */
24405       __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
24406 
24407       /* "View.MemoryView":1310
24408  *
24409  *
24410  *         if slice_is_contig(src, 'C', ndim):             # <<<<<<<<<<<<<<
24411  *             direct_copy = slice_is_contig(dst, 'C', ndim)
24412  *         elif slice_is_contig(src, 'F', ndim):
24413  */
24414       goto __pyx_L12;
24415     }
24416 
24417     /* "View.MemoryView":1312
24418  *         if slice_is_contig(src, 'C', ndim):
24419  *             direct_copy = slice_is_contig(dst, 'C', ndim)
24420  *         elif slice_is_contig(src, 'F', ndim):             # <<<<<<<<<<<<<<
24421  *             direct_copy = slice_is_contig(dst, 'F', ndim)
24422  *
24423  */
24424     __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0);
24425     if (__pyx_t_2) {
24426 
24427       /* "View.MemoryView":1313
24428  *             direct_copy = slice_is_contig(dst, 'C', ndim)
24429  *         elif slice_is_contig(src, 'F', ndim):
24430  *             direct_copy = slice_is_contig(dst, 'F', ndim)             # <<<<<<<<<<<<<<
24431  *
24432  *         if direct_copy:
24433  */
24434       __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
24435 
24436       /* "View.MemoryView":1312
24437  *         if slice_is_contig(src, 'C', ndim):
24438  *             direct_copy = slice_is_contig(dst, 'C', ndim)
24439  *         elif slice_is_contig(src, 'F', ndim):             # <<<<<<<<<<<<<<
24440  *             direct_copy = slice_is_contig(dst, 'F', ndim)
24441  *
24442  */
24443     }
24444     __pyx_L12:;
24445 
24446     /* "View.MemoryView":1315
24447  *             direct_copy = slice_is_contig(dst, 'F', ndim)
24448  *
24449  *         if direct_copy:             # <<<<<<<<<<<<<<
24450  *
24451  *             refcount_copying(&dst, dtype_is_object, ndim, False)
24452  */
24453     __pyx_t_2 = (__pyx_v_direct_copy != 0);
24454     if (__pyx_t_2) {
24455 
24456       /* "View.MemoryView":1317
24457  *         if direct_copy:
24458  *
24459  *             refcount_copying(&dst, dtype_is_object, ndim, False)             # <<<<<<<<<<<<<<
24460  *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))
24461  *             refcount_copying(&dst, dtype_is_object, ndim, True)
24462  */
24463       __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
24464 
24465       /* "View.MemoryView":1318
24466  *
24467  *             refcount_copying(&dst, dtype_is_object, ndim, False)
24468  *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))             # <<<<<<<<<<<<<<
24469  *             refcount_copying(&dst, dtype_is_object, ndim, True)
24470  *             free(tmpdata)
24471  */
24472       (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
24473 
24474       /* "View.MemoryView":1319
24475  *             refcount_copying(&dst, dtype_is_object, ndim, False)
24476  *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))
24477  *             refcount_copying(&dst, dtype_is_object, ndim, True)             # <<<<<<<<<<<<<<
24478  *             free(tmpdata)
24479  *             return 0
24480  */
24481       __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
24482 
24483       /* "View.MemoryView":1320
24484  *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))
24485  *             refcount_copying(&dst, dtype_is_object, ndim, True)
24486  *             free(tmpdata)             # <<<<<<<<<<<<<<
24487  *             return 0
24488  *
24489  */
24490       free(__pyx_v_tmpdata);
24491 
24492       /* "View.MemoryView":1321
24493  *             refcount_copying(&dst, dtype_is_object, ndim, True)
24494  *             free(tmpdata)
24495  *             return 0             # <<<<<<<<<<<<<<
24496  *
24497  *     if order == 'F' == get_best_order(&dst, ndim):
24498  */
24499       __pyx_r = 0;
24500       goto __pyx_L0;
24501 
24502       /* "View.MemoryView":1315
24503  *             direct_copy = slice_is_contig(dst, 'F', ndim)
24504  *
24505  *         if direct_copy:             # <<<<<<<<<<<<<<
24506  *
24507  *             refcount_copying(&dst, dtype_is_object, ndim, False)
24508  */
24509     }
24510 
24511     /* "View.MemoryView":1307
24512  *         src = tmp
24513  *
24514  *     if not broadcasting:             # <<<<<<<<<<<<<<
24515  *
24516  *
24517  */
24518   }
24519 
24520   /* "View.MemoryView":1323
24521  *             return 0
24522  *
24523  *     if order == 'F' == get_best_order(&dst, ndim):             # <<<<<<<<<<<<<<
24524  *
24525  *
24526  */
24527   __pyx_t_2 = (__pyx_v_order == 'F');
24528   if (__pyx_t_2) {
24529     __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
24530   }
24531   __pyx_t_8 = (__pyx_t_2 != 0);
24532   if (__pyx_t_8) {
24533 
24534     /* "View.MemoryView":1326
24535  *
24536  *
24537  *         transpose_memslice(&src)             # <<<<<<<<<<<<<<
24538  *         transpose_memslice(&dst)
24539  *
24540  */
24541     __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(4, 1326, __pyx_L1_error)
24542 
24543     /* "View.MemoryView":1327
24544  *
24545  *         transpose_memslice(&src)
24546  *         transpose_memslice(&dst)             # <<<<<<<<<<<<<<
24547  *
24548  *     refcount_copying(&dst, dtype_is_object, ndim, False)
24549  */
24550     __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(4, 1327, __pyx_L1_error)
24551 
24552     /* "View.MemoryView":1323
24553  *             return 0
24554  *
24555  *     if order == 'F' == get_best_order(&dst, ndim):             # <<<<<<<<<<<<<<
24556  *
24557  *
24558  */
24559   }
24560 
24561   /* "View.MemoryView":1329
24562  *         transpose_memslice(&dst)
24563  *
24564  *     refcount_copying(&dst, dtype_is_object, ndim, False)             # <<<<<<<<<<<<<<
24565  *     copy_strided_to_strided(&src, &dst, ndim, itemsize)
24566  *     refcount_copying(&dst, dtype_is_object, ndim, True)
24567  */
24568   __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
24569 
24570   /* "View.MemoryView":1330
24571  *
24572  *     refcount_copying(&dst, dtype_is_object, ndim, False)
24573  *     copy_strided_to_strided(&src, &dst, ndim, itemsize)             # <<<<<<<<<<<<<<
24574  *     refcount_copying(&dst, dtype_is_object, ndim, True)
24575  *
24576  */
24577   copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
24578 
24579   /* "View.MemoryView":1331
24580  *     refcount_copying(&dst, dtype_is_object, ndim, False)
24581  *     copy_strided_to_strided(&src, &dst, ndim, itemsize)
24582  *     refcount_copying(&dst, dtype_is_object, ndim, True)             # <<<<<<<<<<<<<<
24583  *
24584  *     free(tmpdata)
24585  */
24586   __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
24587 
24588   /* "View.MemoryView":1333
24589  *     refcount_copying(&dst, dtype_is_object, ndim, True)
24590  *
24591  *     free(tmpdata)             # <<<<<<<<<<<<<<
24592  *     return 0
24593  *
24594  */
24595   free(__pyx_v_tmpdata);
24596 
24597   /* "View.MemoryView":1334
24598  *
24599  *     free(tmpdata)
24600  *     return 0             # <<<<<<<<<<<<<<
24601  *
24602  * @cname('__pyx_memoryview_broadcast_leading')
24603  */
24604   __pyx_r = 0;
24605   goto __pyx_L0;
24606 
24607   /* "View.MemoryView":1265
24608  *
24609  * @cname('__pyx_memoryview_copy_contents')
24610  * cdef int memoryview_copy_contents(__Pyx_memviewslice src,             # <<<<<<<<<<<<<<
24611  *                                   __Pyx_memviewslice dst,
24612  *                                   int src_ndim, int dst_ndim,
24613  */
24614 
24615   /* function exit code */
24616   __pyx_L1_error:;
24617   {
24618     #ifdef WITH_THREAD
24619     PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
24620     #endif
24621     __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
24622     #ifdef WITH_THREAD
24623     __Pyx_PyGILState_Release(__pyx_gilstate_save);
24624     #endif
24625   }
24626   __pyx_r = -1;
24627   __pyx_L0:;
24628   return __pyx_r;
24629 }
24630 
24631 /* "View.MemoryView":1337
24632  *
24633  * @cname('__pyx_memoryview_broadcast_leading')
24634  * cdef void broadcast_leading(__Pyx_memviewslice *mslice,             # <<<<<<<<<<<<<<
24635  *                             int ndim,
24636  *                             int ndim_other) nogil:
24637  */
24638 
__pyx_memoryview_broadcast_leading(__Pyx_memviewslice * __pyx_v_mslice,int __pyx_v_ndim,int __pyx_v_ndim_other)24639 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
24640   int __pyx_v_i;
24641   int __pyx_v_offset;
24642   int __pyx_t_1;
24643   int __pyx_t_2;
24644   int __pyx_t_3;
24645 
24646   /* "View.MemoryView":1341
24647  *                             int ndim_other) nogil:
24648  *     cdef int i
24649  *     cdef int offset = ndim_other - ndim             # <<<<<<<<<<<<<<
24650  *
24651  *     for i in range(ndim - 1, -1, -1):
24652  */
24653   __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
24654 
24655   /* "View.MemoryView":1343
24656  *     cdef int offset = ndim_other - ndim
24657  *
24658  *     for i in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
24659  *         mslice.shape[i + offset] = mslice.shape[i]
24660  *         mslice.strides[i + offset] = mslice.strides[i]
24661  */
24662   for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
24663     __pyx_v_i = __pyx_t_1;
24664 
24665     /* "View.MemoryView":1344
24666  *
24667  *     for i in range(ndim - 1, -1, -1):
24668  *         mslice.shape[i + offset] = mslice.shape[i]             # <<<<<<<<<<<<<<
24669  *         mslice.strides[i + offset] = mslice.strides[i]
24670  *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]
24671  */
24672     (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
24673 
24674     /* "View.MemoryView":1345
24675  *     for i in range(ndim - 1, -1, -1):
24676  *         mslice.shape[i + offset] = mslice.shape[i]
24677  *         mslice.strides[i + offset] = mslice.strides[i]             # <<<<<<<<<<<<<<
24678  *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]
24679  *
24680  */
24681     (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
24682 
24683     /* "View.MemoryView":1346
24684  *         mslice.shape[i + offset] = mslice.shape[i]
24685  *         mslice.strides[i + offset] = mslice.strides[i]
24686  *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]             # <<<<<<<<<<<<<<
24687  *
24688  *     for i in range(offset):
24689  */
24690     (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
24691   }
24692 
24693   /* "View.MemoryView":1348
24694  *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]
24695  *
24696  *     for i in range(offset):             # <<<<<<<<<<<<<<
24697  *         mslice.shape[i] = 1
24698  *         mslice.strides[i] = mslice.strides[0]
24699  */
24700   __pyx_t_1 = __pyx_v_offset;
24701   __pyx_t_2 = __pyx_t_1;
24702   for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
24703     __pyx_v_i = __pyx_t_3;
24704 
24705     /* "View.MemoryView":1349
24706  *
24707  *     for i in range(offset):
24708  *         mslice.shape[i] = 1             # <<<<<<<<<<<<<<
24709  *         mslice.strides[i] = mslice.strides[0]
24710  *         mslice.suboffsets[i] = -1
24711  */
24712     (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
24713 
24714     /* "View.MemoryView":1350
24715  *     for i in range(offset):
24716  *         mslice.shape[i] = 1
24717  *         mslice.strides[i] = mslice.strides[0]             # <<<<<<<<<<<<<<
24718  *         mslice.suboffsets[i] = -1
24719  *
24720  */
24721     (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
24722 
24723     /* "View.MemoryView":1351
24724  *         mslice.shape[i] = 1
24725  *         mslice.strides[i] = mslice.strides[0]
24726  *         mslice.suboffsets[i] = -1             # <<<<<<<<<<<<<<
24727  *
24728  *
24729  */
24730     (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
24731   }
24732 
24733   /* "View.MemoryView":1337
24734  *
24735  * @cname('__pyx_memoryview_broadcast_leading')
24736  * cdef void broadcast_leading(__Pyx_memviewslice *mslice,             # <<<<<<<<<<<<<<
24737  *                             int ndim,
24738  *                             int ndim_other) nogil:
24739  */
24740 
24741   /* function exit code */
24742 }
24743 
24744 /* "View.MemoryView":1359
24745  *
24746  * @cname('__pyx_memoryview_refcount_copying')
24747  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object,             # <<<<<<<<<<<<<<
24748  *                            int ndim, bint inc) nogil:
24749  *
24750  */
24751 
__pyx_memoryview_refcount_copying(__Pyx_memviewslice * __pyx_v_dst,int __pyx_v_dtype_is_object,int __pyx_v_ndim,int __pyx_v_inc)24752 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) {
24753   int __pyx_t_1;
24754 
24755   /* "View.MemoryView":1363
24756  *
24757  *
24758  *     if dtype_is_object:             # <<<<<<<<<<<<<<
24759  *         refcount_objects_in_slice_with_gil(dst.data, dst.shape,
24760  *                                            dst.strides, ndim, inc)
24761  */
24762   __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
24763   if (__pyx_t_1) {
24764 
24765     /* "View.MemoryView":1364
24766  *
24767  *     if dtype_is_object:
24768  *         refcount_objects_in_slice_with_gil(dst.data, dst.shape,             # <<<<<<<<<<<<<<
24769  *                                            dst.strides, ndim, inc)
24770  *
24771  */
24772     __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);
24773 
24774     /* "View.MemoryView":1363
24775  *
24776  *
24777  *     if dtype_is_object:             # <<<<<<<<<<<<<<
24778  *         refcount_objects_in_slice_with_gil(dst.data, dst.shape,
24779  *                                            dst.strides, ndim, inc)
24780  */
24781   }
24782 
24783   /* "View.MemoryView":1359
24784  *
24785  * @cname('__pyx_memoryview_refcount_copying')
24786  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object,             # <<<<<<<<<<<<<<
24787  *                            int ndim, bint inc) nogil:
24788  *
24789  */
24790 
24791   /* function exit code */
24792 }
24793 
24794 /* "View.MemoryView":1368
24795  *
24796  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
24797  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
24798  *                                              Py_ssize_t *strides, int ndim,
24799  *                                              bint inc) with gil:
24800  */
24801 
__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)24802 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) {
24803   __Pyx_RefNannyDeclarations
24804   #ifdef WITH_THREAD
24805   PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
24806   #endif
24807   __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
24808 
24809   /* "View.MemoryView":1371
24810  *                                              Py_ssize_t *strides, int ndim,
24811  *                                              bint inc) with gil:
24812  *     refcount_objects_in_slice(data, shape, strides, ndim, inc)             # <<<<<<<<<<<<<<
24813  *
24814  * @cname('__pyx_memoryview_refcount_objects_in_slice')
24815  */
24816   __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
24817 
24818   /* "View.MemoryView":1368
24819  *
24820  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
24821  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
24822  *                                              Py_ssize_t *strides, int ndim,
24823  *                                              bint inc) with gil:
24824  */
24825 
24826   /* function exit code */
24827   __Pyx_RefNannyFinishContext();
24828   #ifdef WITH_THREAD
24829   __Pyx_PyGILState_Release(__pyx_gilstate_save);
24830   #endif
24831 }
24832 
24833 /* "View.MemoryView":1374
24834  *
24835  * @cname('__pyx_memoryview_refcount_objects_in_slice')
24836  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
24837  *                                     Py_ssize_t *strides, int ndim, bint inc):
24838  *     cdef Py_ssize_t i
24839  */
24840 
__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)24841 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) {
24842   CYTHON_UNUSED Py_ssize_t __pyx_v_i;
24843   __Pyx_RefNannyDeclarations
24844   Py_ssize_t __pyx_t_1;
24845   Py_ssize_t __pyx_t_2;
24846   Py_ssize_t __pyx_t_3;
24847   int __pyx_t_4;
24848   __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
24849 
24850   /* "View.MemoryView":1378
24851  *     cdef Py_ssize_t i
24852  *
24853  *     for i in range(shape[0]):             # <<<<<<<<<<<<<<
24854  *         if ndim == 1:
24855  *             if inc:
24856  */
24857   __pyx_t_1 = (__pyx_v_shape[0]);
24858   __pyx_t_2 = __pyx_t_1;
24859   for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
24860     __pyx_v_i = __pyx_t_3;
24861 
24862     /* "View.MemoryView":1379
24863  *
24864  *     for i in range(shape[0]):
24865  *         if ndim == 1:             # <<<<<<<<<<<<<<
24866  *             if inc:
24867  *                 Py_INCREF((<PyObject **> data)[0])
24868  */
24869     __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
24870     if (__pyx_t_4) {
24871 
24872       /* "View.MemoryView":1380
24873  *     for i in range(shape[0]):
24874  *         if ndim == 1:
24875  *             if inc:             # <<<<<<<<<<<<<<
24876  *                 Py_INCREF((<PyObject **> data)[0])
24877  *             else:
24878  */
24879       __pyx_t_4 = (__pyx_v_inc != 0);
24880       if (__pyx_t_4) {
24881 
24882         /* "View.MemoryView":1381
24883  *         if ndim == 1:
24884  *             if inc:
24885  *                 Py_INCREF((<PyObject **> data)[0])             # <<<<<<<<<<<<<<
24886  *             else:
24887  *                 Py_DECREF((<PyObject **> data)[0])
24888  */
24889         Py_INCREF((((PyObject **)__pyx_v_data)[0]));
24890 
24891         /* "View.MemoryView":1380
24892  *     for i in range(shape[0]):
24893  *         if ndim == 1:
24894  *             if inc:             # <<<<<<<<<<<<<<
24895  *                 Py_INCREF((<PyObject **> data)[0])
24896  *             else:
24897  */
24898         goto __pyx_L6;
24899       }
24900 
24901       /* "View.MemoryView":1383
24902  *                 Py_INCREF((<PyObject **> data)[0])
24903  *             else:
24904  *                 Py_DECREF((<PyObject **> data)[0])             # <<<<<<<<<<<<<<
24905  *         else:
24906  *             refcount_objects_in_slice(data, shape + 1, strides + 1,
24907  */
24908       /*else*/ {
24909         Py_DECREF((((PyObject **)__pyx_v_data)[0]));
24910       }
24911       __pyx_L6:;
24912 
24913       /* "View.MemoryView":1379
24914  *
24915  *     for i in range(shape[0]):
24916  *         if ndim == 1:             # <<<<<<<<<<<<<<
24917  *             if inc:
24918  *                 Py_INCREF((<PyObject **> data)[0])
24919  */
24920       goto __pyx_L5;
24921     }
24922 
24923     /* "View.MemoryView":1385
24924  *                 Py_DECREF((<PyObject **> data)[0])
24925  *         else:
24926  *             refcount_objects_in_slice(data, shape + 1, strides + 1,             # <<<<<<<<<<<<<<
24927  *                                       ndim - 1, inc)
24928  *
24929  */
24930     /*else*/ {
24931 
24932       /* "View.MemoryView":1386
24933  *         else:
24934  *             refcount_objects_in_slice(data, shape + 1, strides + 1,
24935  *                                       ndim - 1, inc)             # <<<<<<<<<<<<<<
24936  *
24937  *         data += strides[0]
24938  */
24939       __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
24940     }
24941     __pyx_L5:;
24942 
24943     /* "View.MemoryView":1388
24944  *                                       ndim - 1, inc)
24945  *
24946  *         data += strides[0]             # <<<<<<<<<<<<<<
24947  *
24948  *
24949  */
24950     __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
24951   }
24952 
24953   /* "View.MemoryView":1374
24954  *
24955  * @cname('__pyx_memoryview_refcount_objects_in_slice')
24956  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
24957  *                                     Py_ssize_t *strides, int ndim, bint inc):
24958  *     cdef Py_ssize_t i
24959  */
24960 
24961   /* function exit code */
24962   __Pyx_RefNannyFinishContext();
24963 }
24964 
24965 /* "View.MemoryView":1394
24966  *
24967  * @cname('__pyx_memoryview_slice_assign_scalar')
24968  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim,             # <<<<<<<<<<<<<<
24969  *                               size_t itemsize, void *item,
24970  *                               bint dtype_is_object) nogil:
24971  */
24972 
__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)24973 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) {
24974 
24975   /* "View.MemoryView":1397
24976  *                               size_t itemsize, void *item,
24977  *                               bint dtype_is_object) nogil:
24978  *     refcount_copying(dst, dtype_is_object, ndim, False)             # <<<<<<<<<<<<<<
24979  *     _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
24980  *                          itemsize, item)
24981  */
24982   __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
24983 
24984   /* "View.MemoryView":1398
24985  *                               bint dtype_is_object) nogil:
24986  *     refcount_copying(dst, dtype_is_object, ndim, False)
24987  *     _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,             # <<<<<<<<<<<<<<
24988  *                          itemsize, item)
24989  *     refcount_copying(dst, dtype_is_object, ndim, True)
24990  */
24991   __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);
24992 
24993   /* "View.MemoryView":1400
24994  *     _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
24995  *                          itemsize, item)
24996  *     refcount_copying(dst, dtype_is_object, ndim, True)             # <<<<<<<<<<<<<<
24997  *
24998  *
24999  */
25000   __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
25001 
25002   /* "View.MemoryView":1394
25003  *
25004  * @cname('__pyx_memoryview_slice_assign_scalar')
25005  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim,             # <<<<<<<<<<<<<<
25006  *                               size_t itemsize, void *item,
25007  *                               bint dtype_is_object) nogil:
25008  */
25009 
25010   /* function exit code */
25011 }
25012 
25013 /* "View.MemoryView":1404
25014  *
25015  * @cname('__pyx_memoryview__slice_assign_scalar')
25016  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
25017  *                               Py_ssize_t *strides, int ndim,
25018  *                               size_t itemsize, void *item) nogil:
25019  */
25020 
__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)25021 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) {
25022   CYTHON_UNUSED Py_ssize_t __pyx_v_i;
25023   Py_ssize_t __pyx_v_stride;
25024   Py_ssize_t __pyx_v_extent;
25025   int __pyx_t_1;
25026   Py_ssize_t __pyx_t_2;
25027   Py_ssize_t __pyx_t_3;
25028   Py_ssize_t __pyx_t_4;
25029 
25030   /* "View.MemoryView":1408
25031  *                               size_t itemsize, void *item) nogil:
25032  *     cdef Py_ssize_t i
25033  *     cdef Py_ssize_t stride = strides[0]             # <<<<<<<<<<<<<<
25034  *     cdef Py_ssize_t extent = shape[0]
25035  *
25036  */
25037   __pyx_v_stride = (__pyx_v_strides[0]);
25038 
25039   /* "View.MemoryView":1409
25040  *     cdef Py_ssize_t i
25041  *     cdef Py_ssize_t stride = strides[0]
25042  *     cdef Py_ssize_t extent = shape[0]             # <<<<<<<<<<<<<<
25043  *
25044  *     if ndim == 1:
25045  */
25046   __pyx_v_extent = (__pyx_v_shape[0]);
25047 
25048   /* "View.MemoryView":1411
25049  *     cdef Py_ssize_t extent = shape[0]
25050  *
25051  *     if ndim == 1:             # <<<<<<<<<<<<<<
25052  *         for i in range(extent):
25053  *             memcpy(data, item, itemsize)
25054  */
25055   __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
25056   if (__pyx_t_1) {
25057 
25058     /* "View.MemoryView":1412
25059  *
25060  *     if ndim == 1:
25061  *         for i in range(extent):             # <<<<<<<<<<<<<<
25062  *             memcpy(data, item, itemsize)
25063  *             data += stride
25064  */
25065     __pyx_t_2 = __pyx_v_extent;
25066     __pyx_t_3 = __pyx_t_2;
25067     for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
25068       __pyx_v_i = __pyx_t_4;
25069 
25070       /* "View.MemoryView":1413
25071  *     if ndim == 1:
25072  *         for i in range(extent):
25073  *             memcpy(data, item, itemsize)             # <<<<<<<<<<<<<<
25074  *             data += stride
25075  *     else:
25076  */
25077       (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
25078 
25079       /* "View.MemoryView":1414
25080  *         for i in range(extent):
25081  *             memcpy(data, item, itemsize)
25082  *             data += stride             # <<<<<<<<<<<<<<
25083  *     else:
25084  *         for i in range(extent):
25085  */
25086       __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
25087     }
25088 
25089     /* "View.MemoryView":1411
25090  *     cdef Py_ssize_t extent = shape[0]
25091  *
25092  *     if ndim == 1:             # <<<<<<<<<<<<<<
25093  *         for i in range(extent):
25094  *             memcpy(data, item, itemsize)
25095  */
25096     goto __pyx_L3;
25097   }
25098 
25099   /* "View.MemoryView":1416
25100  *             data += stride
25101  *     else:
25102  *         for i in range(extent):             # <<<<<<<<<<<<<<
25103  *             _slice_assign_scalar(data, shape + 1, strides + 1,
25104  *                                 ndim - 1, itemsize, item)
25105  */
25106   /*else*/ {
25107     __pyx_t_2 = __pyx_v_extent;
25108     __pyx_t_3 = __pyx_t_2;
25109     for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
25110       __pyx_v_i = __pyx_t_4;
25111 
25112       /* "View.MemoryView":1417
25113  *     else:
25114  *         for i in range(extent):
25115  *             _slice_assign_scalar(data, shape + 1, strides + 1,             # <<<<<<<<<<<<<<
25116  *                                 ndim - 1, itemsize, item)
25117  *             data += stride
25118  */
25119       __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);
25120 
25121       /* "View.MemoryView":1419
25122  *             _slice_assign_scalar(data, shape + 1, strides + 1,
25123  *                                 ndim - 1, itemsize, item)
25124  *             data += stride             # <<<<<<<<<<<<<<
25125  *
25126  *
25127  */
25128       __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
25129     }
25130   }
25131   __pyx_L3:;
25132 
25133   /* "View.MemoryView":1404
25134  *
25135  * @cname('__pyx_memoryview__slice_assign_scalar')
25136  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
25137  *                               Py_ssize_t *strides, int ndim,
25138  *                               size_t itemsize, void *item) nogil:
25139  */
25140 
25141   /* function exit code */
25142 }
25143 
25144 /* "(tree fragment)":1
25145  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
25146  *     cdef object __pyx_PickleError
25147  *     cdef object __pyx_result
25148  */
25149 
25150 /* Python wrapper */
25151 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
25152 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)25153 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
25154   PyObject *__pyx_v___pyx_type = 0;
25155   long __pyx_v___pyx_checksum;
25156   PyObject *__pyx_v___pyx_state = 0;
25157   PyObject *__pyx_r = 0;
25158   __Pyx_RefNannyDeclarations
25159   __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
25160   {
25161     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
25162     PyObject* values[3] = {0,0,0};
25163     if (unlikely(__pyx_kwds)) {
25164       Py_ssize_t kw_args;
25165       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
25166       switch (pos_args) {
25167         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
25168         CYTHON_FALLTHROUGH;
25169         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
25170         CYTHON_FALLTHROUGH;
25171         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
25172         CYTHON_FALLTHROUGH;
25173         case  0: break;
25174         default: goto __pyx_L5_argtuple_error;
25175       }
25176       kw_args = PyDict_Size(__pyx_kwds);
25177       switch (pos_args) {
25178         case  0:
25179         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
25180         else goto __pyx_L5_argtuple_error;
25181         CYTHON_FALLTHROUGH;
25182         case  1:
25183         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
25184         else {
25185           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(4, 1, __pyx_L3_error)
25186         }
25187         CYTHON_FALLTHROUGH;
25188         case  2:
25189         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
25190         else {
25191           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(4, 1, __pyx_L3_error)
25192         }
25193       }
25194       if (unlikely(kw_args > 0)) {
25195         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(4, 1, __pyx_L3_error)
25196       }
25197     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
25198       goto __pyx_L5_argtuple_error;
25199     } else {
25200       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
25201       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
25202       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
25203     }
25204     __pyx_v___pyx_type = values[0];
25205     __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(4, 1, __pyx_L3_error)
25206     __pyx_v___pyx_state = values[2];
25207   }
25208   goto __pyx_L4_argument_unpacking_done;
25209   __pyx_L5_argtuple_error:;
25210   __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 1, __pyx_L3_error)
25211   __pyx_L3_error:;
25212   __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
25213   __Pyx_RefNannyFinishContext();
25214   return NULL;
25215   __pyx_L4_argument_unpacking_done:;
25216   __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
25217 
25218   /* function exit code */
25219   __Pyx_RefNannyFinishContext();
25220   return __pyx_r;
25221 }
25222 
__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)25223 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) {
25224   PyObject *__pyx_v___pyx_PickleError = 0;
25225   PyObject *__pyx_v___pyx_result = 0;
25226   PyObject *__pyx_r = NULL;
25227   __Pyx_RefNannyDeclarations
25228   int __pyx_t_1;
25229   PyObject *__pyx_t_2 = NULL;
25230   PyObject *__pyx_t_3 = NULL;
25231   PyObject *__pyx_t_4 = NULL;
25232   PyObject *__pyx_t_5 = NULL;
25233   int __pyx_t_6;
25234   __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);
25235 
25236   /* "(tree fragment)":4
25237  *     cdef object __pyx_PickleError
25238  *     cdef object __pyx_result
25239  *     if __pyx_checksum != 0xb068931:             # <<<<<<<<<<<<<<
25240  *         from pickle import PickleError as __pyx_PickleError
25241  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
25242  */
25243   __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0);
25244   if (__pyx_t_1) {
25245 
25246     /* "(tree fragment)":5
25247  *     cdef object __pyx_result
25248  *     if __pyx_checksum != 0xb068931:
25249  *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
25250  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
25251  *     __pyx_result = Enum.__new__(__pyx_type)
25252  */
25253     __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 5, __pyx_L1_error)
25254     __Pyx_GOTREF(__pyx_t_2);
25255     __Pyx_INCREF(__pyx_n_s_PickleError);
25256     __Pyx_GIVEREF(__pyx_n_s_PickleError);
25257     PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
25258     __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 5, __pyx_L1_error)
25259     __Pyx_GOTREF(__pyx_t_3);
25260     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25261     __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 5, __pyx_L1_error)
25262     __Pyx_GOTREF(__pyx_t_2);
25263     __Pyx_INCREF(__pyx_t_2);
25264     __pyx_v___pyx_PickleError = __pyx_t_2;
25265     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25266     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25267 
25268     /* "(tree fragment)":6
25269  *     if __pyx_checksum != 0xb068931:
25270  *         from pickle import PickleError as __pyx_PickleError
25271  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)             # <<<<<<<<<<<<<<
25272  *     __pyx_result = Enum.__new__(__pyx_type)
25273  *     if __pyx_state is not None:
25274  */
25275     __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 6, __pyx_L1_error)
25276     __Pyx_GOTREF(__pyx_t_2);
25277     __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 6, __pyx_L1_error)
25278     __Pyx_GOTREF(__pyx_t_4);
25279     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25280     __Pyx_INCREF(__pyx_v___pyx_PickleError);
25281     __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
25282     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
25283       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
25284       if (likely(__pyx_t_5)) {
25285         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
25286         __Pyx_INCREF(__pyx_t_5);
25287         __Pyx_INCREF(function);
25288         __Pyx_DECREF_SET(__pyx_t_2, function);
25289       }
25290     }
25291     __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);
25292     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
25293     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25294     if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 6, __pyx_L1_error)
25295     __Pyx_GOTREF(__pyx_t_3);
25296     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25297     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
25298     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25299     __PYX_ERR(4, 6, __pyx_L1_error)
25300 
25301     /* "(tree fragment)":4
25302  *     cdef object __pyx_PickleError
25303  *     cdef object __pyx_result
25304  *     if __pyx_checksum != 0xb068931:             # <<<<<<<<<<<<<<
25305  *         from pickle import PickleError as __pyx_PickleError
25306  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
25307  */
25308   }
25309 
25310   /* "(tree fragment)":7
25311  *         from pickle import PickleError as __pyx_PickleError
25312  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
25313  *     __pyx_result = Enum.__new__(__pyx_type)             # <<<<<<<<<<<<<<
25314  *     if __pyx_state is not None:
25315  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
25316  */
25317   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 7, __pyx_L1_error)
25318   __Pyx_GOTREF(__pyx_t_2);
25319   __pyx_t_4 = NULL;
25320   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
25321     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
25322     if (likely(__pyx_t_4)) {
25323       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
25324       __Pyx_INCREF(__pyx_t_4);
25325       __Pyx_INCREF(function);
25326       __Pyx_DECREF_SET(__pyx_t_2, function);
25327     }
25328   }
25329   __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);
25330   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
25331   if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 7, __pyx_L1_error)
25332   __Pyx_GOTREF(__pyx_t_3);
25333   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25334   __pyx_v___pyx_result = __pyx_t_3;
25335   __pyx_t_3 = 0;
25336 
25337   /* "(tree fragment)":8
25338  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
25339  *     __pyx_result = Enum.__new__(__pyx_type)
25340  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
25341  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
25342  *     return __pyx_result
25343  */
25344   __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
25345   __pyx_t_6 = (__pyx_t_1 != 0);
25346   if (__pyx_t_6) {
25347 
25348     /* "(tree fragment)":9
25349  *     __pyx_result = Enum.__new__(__pyx_type)
25350  *     if __pyx_state is not None:
25351  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
25352  *     return __pyx_result
25353  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
25354  */
25355     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(4, 9, __pyx_L1_error)
25356     __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(4, 9, __pyx_L1_error)
25357     __Pyx_GOTREF(__pyx_t_3);
25358     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25359 
25360     /* "(tree fragment)":8
25361  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
25362  *     __pyx_result = Enum.__new__(__pyx_type)
25363  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
25364  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
25365  *     return __pyx_result
25366  */
25367   }
25368 
25369   /* "(tree fragment)":10
25370  *     if __pyx_state is not None:
25371  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
25372  *     return __pyx_result             # <<<<<<<<<<<<<<
25373  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
25374  *     __pyx_result.name = __pyx_state[0]
25375  */
25376   __Pyx_XDECREF(__pyx_r);
25377   __Pyx_INCREF(__pyx_v___pyx_result);
25378   __pyx_r = __pyx_v___pyx_result;
25379   goto __pyx_L0;
25380 
25381   /* "(tree fragment)":1
25382  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
25383  *     cdef object __pyx_PickleError
25384  *     cdef object __pyx_result
25385  */
25386 
25387   /* function exit code */
25388   __pyx_L1_error:;
25389   __Pyx_XDECREF(__pyx_t_2);
25390   __Pyx_XDECREF(__pyx_t_3);
25391   __Pyx_XDECREF(__pyx_t_4);
25392   __Pyx_XDECREF(__pyx_t_5);
25393   __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
25394   __pyx_r = NULL;
25395   __pyx_L0:;
25396   __Pyx_XDECREF(__pyx_v___pyx_PickleError);
25397   __Pyx_XDECREF(__pyx_v___pyx_result);
25398   __Pyx_XGIVEREF(__pyx_r);
25399   __Pyx_RefNannyFinishContext();
25400   return __pyx_r;
25401 }
25402 
25403 /* "(tree fragment)":11
25404  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
25405  *     return __pyx_result
25406  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
25407  *     __pyx_result.name = __pyx_state[0]
25408  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
25409  */
25410 
__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj * __pyx_v___pyx_result,PyObject * __pyx_v___pyx_state)25411 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
25412   PyObject *__pyx_r = NULL;
25413   __Pyx_RefNannyDeclarations
25414   PyObject *__pyx_t_1 = NULL;
25415   int __pyx_t_2;
25416   Py_ssize_t __pyx_t_3;
25417   int __pyx_t_4;
25418   int __pyx_t_5;
25419   PyObject *__pyx_t_6 = NULL;
25420   PyObject *__pyx_t_7 = NULL;
25421   PyObject *__pyx_t_8 = NULL;
25422   __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);
25423 
25424   /* "(tree fragment)":12
25425  *     return __pyx_result
25426  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
25427  *     __pyx_result.name = __pyx_state[0]             # <<<<<<<<<<<<<<
25428  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
25429  *         __pyx_result.__dict__.update(__pyx_state[1])
25430  */
25431   if (unlikely(__pyx_v___pyx_state == Py_None)) {
25432     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
25433     __PYX_ERR(4, 12, __pyx_L1_error)
25434   }
25435   __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(4, 12, __pyx_L1_error)
25436   __Pyx_GOTREF(__pyx_t_1);
25437   __Pyx_GIVEREF(__pyx_t_1);
25438   __Pyx_GOTREF(__pyx_v___pyx_result->name);
25439   __Pyx_DECREF(__pyx_v___pyx_result->name);
25440   __pyx_v___pyx_result->name = __pyx_t_1;
25441   __pyx_t_1 = 0;
25442 
25443   /* "(tree fragment)":13
25444  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
25445  *     __pyx_result.name = __pyx_state[0]
25446  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
25447  *         __pyx_result.__dict__.update(__pyx_state[1])
25448  */
25449   if (unlikely(__pyx_v___pyx_state == Py_None)) {
25450     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
25451     __PYX_ERR(4, 13, __pyx_L1_error)
25452   }
25453   __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(4, 13, __pyx_L1_error)
25454   __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
25455   if (__pyx_t_4) {
25456   } else {
25457     __pyx_t_2 = __pyx_t_4;
25458     goto __pyx_L4_bool_binop_done;
25459   }
25460   __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(4, 13, __pyx_L1_error)
25461   __pyx_t_5 = (__pyx_t_4 != 0);
25462   __pyx_t_2 = __pyx_t_5;
25463   __pyx_L4_bool_binop_done:;
25464   if (__pyx_t_2) {
25465 
25466     /* "(tree fragment)":14
25467  *     __pyx_result.name = __pyx_state[0]
25468  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
25469  *         __pyx_result.__dict__.update(__pyx_state[1])             # <<<<<<<<<<<<<<
25470  */
25471     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 14, __pyx_L1_error)
25472     __Pyx_GOTREF(__pyx_t_6);
25473     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 14, __pyx_L1_error)
25474     __Pyx_GOTREF(__pyx_t_7);
25475     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
25476     if (unlikely(__pyx_v___pyx_state == Py_None)) {
25477       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
25478       __PYX_ERR(4, 14, __pyx_L1_error)
25479     }
25480     __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(4, 14, __pyx_L1_error)
25481     __Pyx_GOTREF(__pyx_t_6);
25482     __pyx_t_8 = NULL;
25483     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
25484       __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
25485       if (likely(__pyx_t_8)) {
25486         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
25487         __Pyx_INCREF(__pyx_t_8);
25488         __Pyx_INCREF(function);
25489         __Pyx_DECREF_SET(__pyx_t_7, function);
25490       }
25491     }
25492     __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);
25493     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
25494     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
25495     if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 14, __pyx_L1_error)
25496     __Pyx_GOTREF(__pyx_t_1);
25497     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
25498     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25499 
25500     /* "(tree fragment)":13
25501  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
25502  *     __pyx_result.name = __pyx_state[0]
25503  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
25504  *         __pyx_result.__dict__.update(__pyx_state[1])
25505  */
25506   }
25507 
25508   /* "(tree fragment)":11
25509  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
25510  *     return __pyx_result
25511  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
25512  *     __pyx_result.name = __pyx_state[0]
25513  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
25514  */
25515 
25516   /* function exit code */
25517   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
25518   goto __pyx_L0;
25519   __pyx_L1_error:;
25520   __Pyx_XDECREF(__pyx_t_1);
25521   __Pyx_XDECREF(__pyx_t_6);
25522   __Pyx_XDECREF(__pyx_t_7);
25523   __Pyx_XDECREF(__pyx_t_8);
25524   __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
25525   __pyx_r = 0;
25526   __pyx_L0:;
25527   __Pyx_XGIVEREF(__pyx_r);
25528   __Pyx_RefNannyFinishContext();
25529   return __pyx_r;
25530 }
25531 
25532 static struct __pyx_obj_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct__read_amr *__pyx_freelist_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct__read_amr[8];
25533 static int __pyx_freecount_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct__read_amr = 0;
25534 
__pyx_tp_new_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct__read_amr(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)25535 static PyObject *__pyx_tp_new_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct__read_amr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
25536   PyObject *o;
25537   if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct__read_amr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct__read_amr)))) {
25538     o = (PyObject*)__pyx_freelist_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct__read_amr[--__pyx_freecount_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct__read_amr];
25539     memset(o, 0, sizeof(struct __pyx_obj_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct__read_amr));
25540     (void) PyObject_INIT(o, t);
25541     PyObject_GC_Track(o);
25542   } else {
25543     o = (*t->tp_alloc)(t, 0);
25544     if (unlikely(!o)) return 0;
25545   }
25546   return o;
25547 }
25548 
__pyx_tp_dealloc_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct__read_amr(PyObject * o)25549 static void __pyx_tp_dealloc_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct__read_amr(PyObject *o) {
25550   struct __pyx_obj_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct__read_amr *p = (struct __pyx_obj_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct__read_amr *)o;
25551   PyObject_GC_UnTrack(o);
25552   Py_CLEAR(p->__pyx_v_headers);
25553   if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct__read_amr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct__read_amr)))) {
25554     __pyx_freelist_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct__read_amr[__pyx_freecount_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct__read_amr++] = ((struct __pyx_obj_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct__read_amr *)o);
25555   } else {
25556     (*Py_TYPE(o)->tp_free)(o);
25557   }
25558 }
25559 
__pyx_tp_traverse_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct__read_amr(PyObject * o,visitproc v,void * a)25560 static int __pyx_tp_traverse_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct__read_amr(PyObject *o, visitproc v, void *a) {
25561   int e;
25562   struct __pyx_obj_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct__read_amr *p = (struct __pyx_obj_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct__read_amr *)o;
25563   if (p->__pyx_v_headers) {
25564     e = (*v)(p->__pyx_v_headers, a); if (e) return e;
25565   }
25566   return 0;
25567 }
25568 
__pyx_tp_clear_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct__read_amr(PyObject * o)25569 static int __pyx_tp_clear_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct__read_amr(PyObject *o) {
25570   PyObject* tmp;
25571   struct __pyx_obj_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct__read_amr *p = (struct __pyx_obj_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct__read_amr *)o;
25572   tmp = ((PyObject*)p->__pyx_v_headers);
25573   p->__pyx_v_headers = ((PyObject*)Py_None); Py_INCREF(Py_None);
25574   Py_XDECREF(tmp);
25575   return 0;
25576 }
25577 
25578 static PyTypeObject __pyx_type_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct__read_amr = {
25579   PyVarObject_HEAD_INIT(0, 0)
25580   "yt.frontends.ramses.io_utils.__pyx_scope_struct__read_amr", /*tp_name*/
25581   sizeof(struct __pyx_obj_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct__read_amr), /*tp_basicsize*/
25582   0, /*tp_itemsize*/
25583   __pyx_tp_dealloc_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct__read_amr, /*tp_dealloc*/
25584   0, /*tp_print*/
25585   0, /*tp_getattr*/
25586   0, /*tp_setattr*/
25587   #if PY_MAJOR_VERSION < 3
25588   0, /*tp_compare*/
25589   #endif
25590   #if PY_MAJOR_VERSION >= 3
25591   0, /*tp_as_async*/
25592   #endif
25593   0, /*tp_repr*/
25594   0, /*tp_as_number*/
25595   0, /*tp_as_sequence*/
25596   0, /*tp_as_mapping*/
25597   0, /*tp_hash*/
25598   0, /*tp_call*/
25599   0, /*tp_str*/
25600   0, /*tp_getattro*/
25601   0, /*tp_setattro*/
25602   0, /*tp_as_buffer*/
25603   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
25604   0, /*tp_doc*/
25605   __pyx_tp_traverse_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct__read_amr, /*tp_traverse*/
25606   __pyx_tp_clear_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct__read_amr, /*tp_clear*/
25607   0, /*tp_richcompare*/
25608   0, /*tp_weaklistoffset*/
25609   0, /*tp_iter*/
25610   0, /*tp_iternext*/
25611   0, /*tp_methods*/
25612   0, /*tp_members*/
25613   0, /*tp_getset*/
25614   0, /*tp_base*/
25615   0, /*tp_dict*/
25616   0, /*tp_descr_get*/
25617   0, /*tp_descr_set*/
25618   0, /*tp_dictoffset*/
25619   0, /*tp_init*/
25620   0, /*tp_alloc*/
25621   __pyx_tp_new_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct__read_amr, /*tp_new*/
25622   0, /*tp_free*/
25623   0, /*tp_is_gc*/
25624   0, /*tp_bases*/
25625   0, /*tp_mro*/
25626   0, /*tp_cache*/
25627   0, /*tp_subclasses*/
25628   0, /*tp_weaklist*/
25629   0, /*tp_del*/
25630   0, /*tp_version_tag*/
25631   #if PY_VERSION_HEX >= 0x030400a1
25632   0, /*tp_finalize*/
25633   #endif
25634   #if PY_VERSION_HEX >= 0x030800b1
25635   0, /*tp_vectorcall*/
25636   #endif
25637 };
25638 
25639 static struct __pyx_obj_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct_1_genexpr *__pyx_freelist_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct_1_genexpr[8];
25640 static int __pyx_freecount_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct_1_genexpr = 0;
25641 
__pyx_tp_new_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct_1_genexpr(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)25642 static PyObject *__pyx_tp_new_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct_1_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
25643   PyObject *o;
25644   if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct_1_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct_1_genexpr)))) {
25645     o = (PyObject*)__pyx_freelist_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct_1_genexpr[--__pyx_freecount_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct_1_genexpr];
25646     memset(o, 0, sizeof(struct __pyx_obj_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct_1_genexpr));
25647     (void) PyObject_INIT(o, t);
25648     PyObject_GC_Track(o);
25649   } else {
25650     o = (*t->tp_alloc)(t, 0);
25651     if (unlikely(!o)) return 0;
25652   }
25653   return o;
25654 }
25655 
__pyx_tp_dealloc_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct_1_genexpr(PyObject * o)25656 static void __pyx_tp_dealloc_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct_1_genexpr(PyObject *o) {
25657   struct __pyx_obj_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct_1_genexpr *)o;
25658   PyObject_GC_UnTrack(o);
25659   Py_CLEAR(p->__pyx_outer_scope);
25660   Py_CLEAR(p->__pyx_v_i);
25661   Py_CLEAR(p->__pyx_t_0);
25662   if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct_1_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct_1_genexpr)))) {
25663     __pyx_freelist_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct_1_genexpr[__pyx_freecount_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct_1_genexpr++] = ((struct __pyx_obj_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct_1_genexpr *)o);
25664   } else {
25665     (*Py_TYPE(o)->tp_free)(o);
25666   }
25667 }
25668 
__pyx_tp_traverse_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct_1_genexpr(PyObject * o,visitproc v,void * a)25669 static int __pyx_tp_traverse_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct_1_genexpr(PyObject *o, visitproc v, void *a) {
25670   int e;
25671   struct __pyx_obj_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct_1_genexpr *)o;
25672   if (p->__pyx_outer_scope) {
25673     e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
25674   }
25675   if (p->__pyx_v_i) {
25676     e = (*v)(p->__pyx_v_i, a); if (e) return e;
25677   }
25678   if (p->__pyx_t_0) {
25679     e = (*v)(p->__pyx_t_0, a); if (e) return e;
25680   }
25681   return 0;
25682 }
25683 
25684 static PyTypeObject __pyx_type_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct_1_genexpr = {
25685   PyVarObject_HEAD_INIT(0, 0)
25686   "yt.frontends.ramses.io_utils.__pyx_scope_struct_1_genexpr", /*tp_name*/
25687   sizeof(struct __pyx_obj_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct_1_genexpr), /*tp_basicsize*/
25688   0, /*tp_itemsize*/
25689   __pyx_tp_dealloc_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct_1_genexpr, /*tp_dealloc*/
25690   0, /*tp_print*/
25691   0, /*tp_getattr*/
25692   0, /*tp_setattr*/
25693   #if PY_MAJOR_VERSION < 3
25694   0, /*tp_compare*/
25695   #endif
25696   #if PY_MAJOR_VERSION >= 3
25697   0, /*tp_as_async*/
25698   #endif
25699   0, /*tp_repr*/
25700   0, /*tp_as_number*/
25701   0, /*tp_as_sequence*/
25702   0, /*tp_as_mapping*/
25703   0, /*tp_hash*/
25704   0, /*tp_call*/
25705   0, /*tp_str*/
25706   0, /*tp_getattro*/
25707   0, /*tp_setattro*/
25708   0, /*tp_as_buffer*/
25709   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
25710   0, /*tp_doc*/
25711   __pyx_tp_traverse_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct_1_genexpr, /*tp_traverse*/
25712   0, /*tp_clear*/
25713   0, /*tp_richcompare*/
25714   0, /*tp_weaklistoffset*/
25715   0, /*tp_iter*/
25716   0, /*tp_iternext*/
25717   0, /*tp_methods*/
25718   0, /*tp_members*/
25719   0, /*tp_getset*/
25720   0, /*tp_base*/
25721   0, /*tp_dict*/
25722   0, /*tp_descr_get*/
25723   0, /*tp_descr_set*/
25724   0, /*tp_dictoffset*/
25725   0, /*tp_init*/
25726   0, /*tp_alloc*/
25727   __pyx_tp_new_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct_1_genexpr, /*tp_new*/
25728   0, /*tp_free*/
25729   0, /*tp_is_gc*/
25730   0, /*tp_bases*/
25731   0, /*tp_mro*/
25732   0, /*tp_cache*/
25733   0, /*tp_subclasses*/
25734   0, /*tp_weaklist*/
25735   0, /*tp_del*/
25736   0, /*tp_version_tag*/
25737   #if PY_VERSION_HEX >= 0x030400a1
25738   0, /*tp_finalize*/
25739   #endif
25740   #if PY_VERSION_HEX >= 0x030800b1
25741   0, /*tp_vectorcall*/
25742   #endif
25743 };
25744 static struct __pyx_vtabstruct_array __pyx_vtable_array;
25745 
__pyx_tp_new_array(PyTypeObject * t,PyObject * a,PyObject * k)25746 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
25747   struct __pyx_array_obj *p;
25748   PyObject *o;
25749   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
25750     o = (*t->tp_alloc)(t, 0);
25751   } else {
25752     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
25753   }
25754   if (unlikely(!o)) return 0;
25755   p = ((struct __pyx_array_obj *)o);
25756   p->__pyx_vtab = __pyx_vtabptr_array;
25757   p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
25758   p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
25759   if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
25760   return o;
25761   bad:
25762   Py_DECREF(o); o = 0;
25763   return NULL;
25764 }
25765 
__pyx_tp_dealloc_array(PyObject * o)25766 static void __pyx_tp_dealloc_array(PyObject *o) {
25767   struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
25768   #if CYTHON_USE_TP_FINALIZE
25769   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))) {
25770     if (PyObject_CallFinalizerFromDealloc(o)) return;
25771   }
25772   #endif
25773   {
25774     PyObject *etype, *eval, *etb;
25775     PyErr_Fetch(&etype, &eval, &etb);
25776     ++Py_REFCNT(o);
25777     __pyx_array___dealloc__(o);
25778     --Py_REFCNT(o);
25779     PyErr_Restore(etype, eval, etb);
25780   }
25781   Py_CLEAR(p->mode);
25782   Py_CLEAR(p->_format);
25783   (*Py_TYPE(o)->tp_free)(o);
25784 }
__pyx_sq_item_array(PyObject * o,Py_ssize_t i)25785 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
25786   PyObject *r;
25787   PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
25788   r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
25789   Py_DECREF(x);
25790   return r;
25791 }
25792 
__pyx_mp_ass_subscript_array(PyObject * o,PyObject * i,PyObject * v)25793 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
25794   if (v) {
25795     return __pyx_array___setitem__(o, i, v);
25796   }
25797   else {
25798     PyErr_Format(PyExc_NotImplementedError,
25799       "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
25800     return -1;
25801   }
25802 }
25803 
__pyx_tp_getattro_array(PyObject * o,PyObject * n)25804 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
25805   PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
25806   if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
25807     PyErr_Clear();
25808     v = __pyx_array___getattr__(o, n);
25809   }
25810   return v;
25811 }
25812 
__pyx_getprop___pyx_array_memview(PyObject * o,CYTHON_UNUSED void * x)25813 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
25814   return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
25815 }
25816 
25817 static PyMethodDef __pyx_methods_array[] = {
25818   {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
25819   {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
25820   {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
25821   {0, 0, 0, 0}
25822 };
25823 
25824 static struct PyGetSetDef __pyx_getsets_array[] = {
25825   {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
25826   {0, 0, 0, 0, 0}
25827 };
25828 
25829 static PySequenceMethods __pyx_tp_as_sequence_array = {
25830   __pyx_array___len__, /*sq_length*/
25831   0, /*sq_concat*/
25832   0, /*sq_repeat*/
25833   __pyx_sq_item_array, /*sq_item*/
25834   0, /*sq_slice*/
25835   0, /*sq_ass_item*/
25836   0, /*sq_ass_slice*/
25837   0, /*sq_contains*/
25838   0, /*sq_inplace_concat*/
25839   0, /*sq_inplace_repeat*/
25840 };
25841 
25842 static PyMappingMethods __pyx_tp_as_mapping_array = {
25843   __pyx_array___len__, /*mp_length*/
25844   __pyx_array___getitem__, /*mp_subscript*/
25845   __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
25846 };
25847 
25848 static PyBufferProcs __pyx_tp_as_buffer_array = {
25849   #if PY_MAJOR_VERSION < 3
25850   0, /*bf_getreadbuffer*/
25851   #endif
25852   #if PY_MAJOR_VERSION < 3
25853   0, /*bf_getwritebuffer*/
25854   #endif
25855   #if PY_MAJOR_VERSION < 3
25856   0, /*bf_getsegcount*/
25857   #endif
25858   #if PY_MAJOR_VERSION < 3
25859   0, /*bf_getcharbuffer*/
25860   #endif
25861   __pyx_array_getbuffer, /*bf_getbuffer*/
25862   0, /*bf_releasebuffer*/
25863 };
25864 
25865 static PyTypeObject __pyx_type___pyx_array = {
25866   PyVarObject_HEAD_INIT(0, 0)
25867   "yt.frontends.ramses.io_utils.array", /*tp_name*/
25868   sizeof(struct __pyx_array_obj), /*tp_basicsize*/
25869   0, /*tp_itemsize*/
25870   __pyx_tp_dealloc_array, /*tp_dealloc*/
25871   0, /*tp_print*/
25872   0, /*tp_getattr*/
25873   0, /*tp_setattr*/
25874   #if PY_MAJOR_VERSION < 3
25875   0, /*tp_compare*/
25876   #endif
25877   #if PY_MAJOR_VERSION >= 3
25878   0, /*tp_as_async*/
25879   #endif
25880   0, /*tp_repr*/
25881   0, /*tp_as_number*/
25882   &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
25883   &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
25884   0, /*tp_hash*/
25885   0, /*tp_call*/
25886   0, /*tp_str*/
25887   __pyx_tp_getattro_array, /*tp_getattro*/
25888   0, /*tp_setattro*/
25889   &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
25890   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
25891   0, /*tp_doc*/
25892   0, /*tp_traverse*/
25893   0, /*tp_clear*/
25894   0, /*tp_richcompare*/
25895   0, /*tp_weaklistoffset*/
25896   0, /*tp_iter*/
25897   0, /*tp_iternext*/
25898   __pyx_methods_array, /*tp_methods*/
25899   0, /*tp_members*/
25900   __pyx_getsets_array, /*tp_getset*/
25901   0, /*tp_base*/
25902   0, /*tp_dict*/
25903   0, /*tp_descr_get*/
25904   0, /*tp_descr_set*/
25905   0, /*tp_dictoffset*/
25906   0, /*tp_init*/
25907   0, /*tp_alloc*/
25908   __pyx_tp_new_array, /*tp_new*/
25909   0, /*tp_free*/
25910   0, /*tp_is_gc*/
25911   0, /*tp_bases*/
25912   0, /*tp_mro*/
25913   0, /*tp_cache*/
25914   0, /*tp_subclasses*/
25915   0, /*tp_weaklist*/
25916   0, /*tp_del*/
25917   0, /*tp_version_tag*/
25918   #if PY_VERSION_HEX >= 0x030400a1
25919   0, /*tp_finalize*/
25920   #endif
25921   #if PY_VERSION_HEX >= 0x030800b1
25922   0, /*tp_vectorcall*/
25923   #endif
25924 };
25925 
__pyx_tp_new_Enum(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)25926 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
25927   struct __pyx_MemviewEnum_obj *p;
25928   PyObject *o;
25929   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
25930     o = (*t->tp_alloc)(t, 0);
25931   } else {
25932     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
25933   }
25934   if (unlikely(!o)) return 0;
25935   p = ((struct __pyx_MemviewEnum_obj *)o);
25936   p->name = Py_None; Py_INCREF(Py_None);
25937   return o;
25938 }
25939 
__pyx_tp_dealloc_Enum(PyObject * o)25940 static void __pyx_tp_dealloc_Enum(PyObject *o) {
25941   struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
25942   #if CYTHON_USE_TP_FINALIZE
25943   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
25944     if (PyObject_CallFinalizerFromDealloc(o)) return;
25945   }
25946   #endif
25947   PyObject_GC_UnTrack(o);
25948   Py_CLEAR(p->name);
25949   (*Py_TYPE(o)->tp_free)(o);
25950 }
25951 
__pyx_tp_traverse_Enum(PyObject * o,visitproc v,void * a)25952 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
25953   int e;
25954   struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
25955   if (p->name) {
25956     e = (*v)(p->name, a); if (e) return e;
25957   }
25958   return 0;
25959 }
25960 
__pyx_tp_clear_Enum(PyObject * o)25961 static int __pyx_tp_clear_Enum(PyObject *o) {
25962   PyObject* tmp;
25963   struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
25964   tmp = ((PyObject*)p->name);
25965   p->name = Py_None; Py_INCREF(Py_None);
25966   Py_XDECREF(tmp);
25967   return 0;
25968 }
25969 
25970 static PyMethodDef __pyx_methods_Enum[] = {
25971   {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
25972   {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
25973   {0, 0, 0, 0}
25974 };
25975 
25976 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
25977   PyVarObject_HEAD_INIT(0, 0)
25978   "yt.frontends.ramses.io_utils.Enum", /*tp_name*/
25979   sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
25980   0, /*tp_itemsize*/
25981   __pyx_tp_dealloc_Enum, /*tp_dealloc*/
25982   0, /*tp_print*/
25983   0, /*tp_getattr*/
25984   0, /*tp_setattr*/
25985   #if PY_MAJOR_VERSION < 3
25986   0, /*tp_compare*/
25987   #endif
25988   #if PY_MAJOR_VERSION >= 3
25989   0, /*tp_as_async*/
25990   #endif
25991   __pyx_MemviewEnum___repr__, /*tp_repr*/
25992   0, /*tp_as_number*/
25993   0, /*tp_as_sequence*/
25994   0, /*tp_as_mapping*/
25995   0, /*tp_hash*/
25996   0, /*tp_call*/
25997   0, /*tp_str*/
25998   0, /*tp_getattro*/
25999   0, /*tp_setattro*/
26000   0, /*tp_as_buffer*/
26001   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
26002   0, /*tp_doc*/
26003   __pyx_tp_traverse_Enum, /*tp_traverse*/
26004   __pyx_tp_clear_Enum, /*tp_clear*/
26005   0, /*tp_richcompare*/
26006   0, /*tp_weaklistoffset*/
26007   0, /*tp_iter*/
26008   0, /*tp_iternext*/
26009   __pyx_methods_Enum, /*tp_methods*/
26010   0, /*tp_members*/
26011   0, /*tp_getset*/
26012   0, /*tp_base*/
26013   0, /*tp_dict*/
26014   0, /*tp_descr_get*/
26015   0, /*tp_descr_set*/
26016   0, /*tp_dictoffset*/
26017   __pyx_MemviewEnum___init__, /*tp_init*/
26018   0, /*tp_alloc*/
26019   __pyx_tp_new_Enum, /*tp_new*/
26020   0, /*tp_free*/
26021   0, /*tp_is_gc*/
26022   0, /*tp_bases*/
26023   0, /*tp_mro*/
26024   0, /*tp_cache*/
26025   0, /*tp_subclasses*/
26026   0, /*tp_weaklist*/
26027   0, /*tp_del*/
26028   0, /*tp_version_tag*/
26029   #if PY_VERSION_HEX >= 0x030400a1
26030   0, /*tp_finalize*/
26031   #endif
26032   #if PY_VERSION_HEX >= 0x030800b1
26033   0, /*tp_vectorcall*/
26034   #endif
26035 };
26036 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
26037 
__pyx_tp_new_memoryview(PyTypeObject * t,PyObject * a,PyObject * k)26038 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
26039   struct __pyx_memoryview_obj *p;
26040   PyObject *o;
26041   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
26042     o = (*t->tp_alloc)(t, 0);
26043   } else {
26044     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
26045   }
26046   if (unlikely(!o)) return 0;
26047   p = ((struct __pyx_memoryview_obj *)o);
26048   p->__pyx_vtab = __pyx_vtabptr_memoryview;
26049   p->obj = Py_None; Py_INCREF(Py_None);
26050   p->_size = Py_None; Py_INCREF(Py_None);
26051   p->_array_interface = Py_None; Py_INCREF(Py_None);
26052   p->view.obj = NULL;
26053   if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
26054   return o;
26055   bad:
26056   Py_DECREF(o); o = 0;
26057   return NULL;
26058 }
26059 
__pyx_tp_dealloc_memoryview(PyObject * o)26060 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
26061   struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
26062   #if CYTHON_USE_TP_FINALIZE
26063   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
26064     if (PyObject_CallFinalizerFromDealloc(o)) return;
26065   }
26066   #endif
26067   PyObject_GC_UnTrack(o);
26068   {
26069     PyObject *etype, *eval, *etb;
26070     PyErr_Fetch(&etype, &eval, &etb);
26071     ++Py_REFCNT(o);
26072     __pyx_memoryview___dealloc__(o);
26073     --Py_REFCNT(o);
26074     PyErr_Restore(etype, eval, etb);
26075   }
26076   Py_CLEAR(p->obj);
26077   Py_CLEAR(p->_size);
26078   Py_CLEAR(p->_array_interface);
26079   (*Py_TYPE(o)->tp_free)(o);
26080 }
26081 
__pyx_tp_traverse_memoryview(PyObject * o,visitproc v,void * a)26082 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
26083   int e;
26084   struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
26085   if (p->obj) {
26086     e = (*v)(p->obj, a); if (e) return e;
26087   }
26088   if (p->_size) {
26089     e = (*v)(p->_size, a); if (e) return e;
26090   }
26091   if (p->_array_interface) {
26092     e = (*v)(p->_array_interface, a); if (e) return e;
26093   }
26094   if (p->view.obj) {
26095     e = (*v)(p->view.obj, a); if (e) return e;
26096   }
26097   return 0;
26098 }
26099 
__pyx_tp_clear_memoryview(PyObject * o)26100 static int __pyx_tp_clear_memoryview(PyObject *o) {
26101   PyObject* tmp;
26102   struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
26103   tmp = ((PyObject*)p->obj);
26104   p->obj = Py_None; Py_INCREF(Py_None);
26105   Py_XDECREF(tmp);
26106   tmp = ((PyObject*)p->_size);
26107   p->_size = Py_None; Py_INCREF(Py_None);
26108   Py_XDECREF(tmp);
26109   tmp = ((PyObject*)p->_array_interface);
26110   p->_array_interface = Py_None; Py_INCREF(Py_None);
26111   Py_XDECREF(tmp);
26112   Py_CLEAR(p->view.obj);
26113   return 0;
26114 }
__pyx_sq_item_memoryview(PyObject * o,Py_ssize_t i)26115 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
26116   PyObject *r;
26117   PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
26118   r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
26119   Py_DECREF(x);
26120   return r;
26121 }
26122 
__pyx_mp_ass_subscript_memoryview(PyObject * o,PyObject * i,PyObject * v)26123 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
26124   if (v) {
26125     return __pyx_memoryview___setitem__(o, i, v);
26126   }
26127   else {
26128     PyErr_Format(PyExc_NotImplementedError,
26129       "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
26130     return -1;
26131   }
26132 }
26133 
__pyx_getprop___pyx_memoryview_T(PyObject * o,CYTHON_UNUSED void * x)26134 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
26135   return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
26136 }
26137 
__pyx_getprop___pyx_memoryview_base(PyObject * o,CYTHON_UNUSED void * x)26138 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
26139   return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
26140 }
26141 
__pyx_getprop___pyx_memoryview_shape(PyObject * o,CYTHON_UNUSED void * x)26142 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
26143   return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
26144 }
26145 
__pyx_getprop___pyx_memoryview_strides(PyObject * o,CYTHON_UNUSED void * x)26146 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
26147   return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
26148 }
26149 
__pyx_getprop___pyx_memoryview_suboffsets(PyObject * o,CYTHON_UNUSED void * x)26150 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
26151   return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
26152 }
26153 
__pyx_getprop___pyx_memoryview_ndim(PyObject * o,CYTHON_UNUSED void * x)26154 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
26155   return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
26156 }
26157 
__pyx_getprop___pyx_memoryview_itemsize(PyObject * o,CYTHON_UNUSED void * x)26158 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
26159   return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
26160 }
26161 
__pyx_getprop___pyx_memoryview_nbytes(PyObject * o,CYTHON_UNUSED void * x)26162 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
26163   return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
26164 }
26165 
__pyx_getprop___pyx_memoryview_size(PyObject * o,CYTHON_UNUSED void * x)26166 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
26167   return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
26168 }
26169 
26170 static PyMethodDef __pyx_methods_memoryview[] = {
26171   {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
26172   {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
26173   {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
26174   {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
26175   {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
26176   {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
26177   {0, 0, 0, 0}
26178 };
26179 
26180 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
26181   {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
26182   {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
26183   {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
26184   {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
26185   {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
26186   {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
26187   {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
26188   {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
26189   {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
26190   {0, 0, 0, 0, 0}
26191 };
26192 
26193 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
26194   __pyx_memoryview___len__, /*sq_length*/
26195   0, /*sq_concat*/
26196   0, /*sq_repeat*/
26197   __pyx_sq_item_memoryview, /*sq_item*/
26198   0, /*sq_slice*/
26199   0, /*sq_ass_item*/
26200   0, /*sq_ass_slice*/
26201   0, /*sq_contains*/
26202   0, /*sq_inplace_concat*/
26203   0, /*sq_inplace_repeat*/
26204 };
26205 
26206 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
26207   __pyx_memoryview___len__, /*mp_length*/
26208   __pyx_memoryview___getitem__, /*mp_subscript*/
26209   __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
26210 };
26211 
26212 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
26213   #if PY_MAJOR_VERSION < 3
26214   0, /*bf_getreadbuffer*/
26215   #endif
26216   #if PY_MAJOR_VERSION < 3
26217   0, /*bf_getwritebuffer*/
26218   #endif
26219   #if PY_MAJOR_VERSION < 3
26220   0, /*bf_getsegcount*/
26221   #endif
26222   #if PY_MAJOR_VERSION < 3
26223   0, /*bf_getcharbuffer*/
26224   #endif
26225   __pyx_memoryview_getbuffer, /*bf_getbuffer*/
26226   0, /*bf_releasebuffer*/
26227 };
26228 
26229 static PyTypeObject __pyx_type___pyx_memoryview = {
26230   PyVarObject_HEAD_INIT(0, 0)
26231   "yt.frontends.ramses.io_utils.memoryview", /*tp_name*/
26232   sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
26233   0, /*tp_itemsize*/
26234   __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
26235   0, /*tp_print*/
26236   0, /*tp_getattr*/
26237   0, /*tp_setattr*/
26238   #if PY_MAJOR_VERSION < 3
26239   0, /*tp_compare*/
26240   #endif
26241   #if PY_MAJOR_VERSION >= 3
26242   0, /*tp_as_async*/
26243   #endif
26244   __pyx_memoryview___repr__, /*tp_repr*/
26245   0, /*tp_as_number*/
26246   &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
26247   &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
26248   0, /*tp_hash*/
26249   0, /*tp_call*/
26250   __pyx_memoryview___str__, /*tp_str*/
26251   0, /*tp_getattro*/
26252   0, /*tp_setattro*/
26253   &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
26254   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
26255   0, /*tp_doc*/
26256   __pyx_tp_traverse_memoryview, /*tp_traverse*/
26257   __pyx_tp_clear_memoryview, /*tp_clear*/
26258   0, /*tp_richcompare*/
26259   0, /*tp_weaklistoffset*/
26260   0, /*tp_iter*/
26261   0, /*tp_iternext*/
26262   __pyx_methods_memoryview, /*tp_methods*/
26263   0, /*tp_members*/
26264   __pyx_getsets_memoryview, /*tp_getset*/
26265   0, /*tp_base*/
26266   0, /*tp_dict*/
26267   0, /*tp_descr_get*/
26268   0, /*tp_descr_set*/
26269   0, /*tp_dictoffset*/
26270   0, /*tp_init*/
26271   0, /*tp_alloc*/
26272   __pyx_tp_new_memoryview, /*tp_new*/
26273   0, /*tp_free*/
26274   0, /*tp_is_gc*/
26275   0, /*tp_bases*/
26276   0, /*tp_mro*/
26277   0, /*tp_cache*/
26278   0, /*tp_subclasses*/
26279   0, /*tp_weaklist*/
26280   0, /*tp_del*/
26281   0, /*tp_version_tag*/
26282   #if PY_VERSION_HEX >= 0x030400a1
26283   0, /*tp_finalize*/
26284   #endif
26285   #if PY_VERSION_HEX >= 0x030800b1
26286   0, /*tp_vectorcall*/
26287   #endif
26288 };
26289 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
26290 
__pyx_tp_new__memoryviewslice(PyTypeObject * t,PyObject * a,PyObject * k)26291 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
26292   struct __pyx_memoryviewslice_obj *p;
26293   PyObject *o = __pyx_tp_new_memoryview(t, a, k);
26294   if (unlikely(!o)) return 0;
26295   p = ((struct __pyx_memoryviewslice_obj *)o);
26296   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
26297   p->from_object = Py_None; Py_INCREF(Py_None);
26298   p->from_slice.memview = NULL;
26299   return o;
26300 }
26301 
__pyx_tp_dealloc__memoryviewslice(PyObject * o)26302 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
26303   struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
26304   #if CYTHON_USE_TP_FINALIZE
26305   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
26306     if (PyObject_CallFinalizerFromDealloc(o)) return;
26307   }
26308   #endif
26309   PyObject_GC_UnTrack(o);
26310   {
26311     PyObject *etype, *eval, *etb;
26312     PyErr_Fetch(&etype, &eval, &etb);
26313     ++Py_REFCNT(o);
26314     __pyx_memoryviewslice___dealloc__(o);
26315     --Py_REFCNT(o);
26316     PyErr_Restore(etype, eval, etb);
26317   }
26318   Py_CLEAR(p->from_object);
26319   PyObject_GC_Track(o);
26320   __pyx_tp_dealloc_memoryview(o);
26321 }
26322 
__pyx_tp_traverse__memoryviewslice(PyObject * o,visitproc v,void * a)26323 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
26324   int e;
26325   struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
26326   e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
26327   if (p->from_object) {
26328     e = (*v)(p->from_object, a); if (e) return e;
26329   }
26330   return 0;
26331 }
26332 
__pyx_tp_clear__memoryviewslice(PyObject * o)26333 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
26334   PyObject* tmp;
26335   struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
26336   __pyx_tp_clear_memoryview(o);
26337   tmp = ((PyObject*)p->from_object);
26338   p->from_object = Py_None; Py_INCREF(Py_None);
26339   Py_XDECREF(tmp);
26340   __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
26341   return 0;
26342 }
26343 
__pyx_getprop___pyx_memoryviewslice_base(PyObject * o,CYTHON_UNUSED void * x)26344 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
26345   return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
26346 }
26347 
26348 static PyMethodDef __pyx_methods__memoryviewslice[] = {
26349   {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
26350   {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
26351   {0, 0, 0, 0}
26352 };
26353 
26354 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
26355   {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
26356   {0, 0, 0, 0, 0}
26357 };
26358 
26359 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
26360   PyVarObject_HEAD_INIT(0, 0)
26361   "yt.frontends.ramses.io_utils._memoryviewslice", /*tp_name*/
26362   sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
26363   0, /*tp_itemsize*/
26364   __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
26365   0, /*tp_print*/
26366   0, /*tp_getattr*/
26367   0, /*tp_setattr*/
26368   #if PY_MAJOR_VERSION < 3
26369   0, /*tp_compare*/
26370   #endif
26371   #if PY_MAJOR_VERSION >= 3
26372   0, /*tp_as_async*/
26373   #endif
26374   #if CYTHON_COMPILING_IN_PYPY
26375   __pyx_memoryview___repr__, /*tp_repr*/
26376   #else
26377   0, /*tp_repr*/
26378   #endif
26379   0, /*tp_as_number*/
26380   0, /*tp_as_sequence*/
26381   0, /*tp_as_mapping*/
26382   0, /*tp_hash*/
26383   0, /*tp_call*/
26384   #if CYTHON_COMPILING_IN_PYPY
26385   __pyx_memoryview___str__, /*tp_str*/
26386   #else
26387   0, /*tp_str*/
26388   #endif
26389   0, /*tp_getattro*/
26390   0, /*tp_setattro*/
26391   0, /*tp_as_buffer*/
26392   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
26393   "Internal class for passing memoryview slices to Python", /*tp_doc*/
26394   __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
26395   __pyx_tp_clear__memoryviewslice, /*tp_clear*/
26396   0, /*tp_richcompare*/
26397   0, /*tp_weaklistoffset*/
26398   0, /*tp_iter*/
26399   0, /*tp_iternext*/
26400   __pyx_methods__memoryviewslice, /*tp_methods*/
26401   0, /*tp_members*/
26402   __pyx_getsets__memoryviewslice, /*tp_getset*/
26403   0, /*tp_base*/
26404   0, /*tp_dict*/
26405   0, /*tp_descr_get*/
26406   0, /*tp_descr_set*/
26407   0, /*tp_dictoffset*/
26408   0, /*tp_init*/
26409   0, /*tp_alloc*/
26410   __pyx_tp_new__memoryviewslice, /*tp_new*/
26411   0, /*tp_free*/
26412   0, /*tp_is_gc*/
26413   0, /*tp_bases*/
26414   0, /*tp_mro*/
26415   0, /*tp_cache*/
26416   0, /*tp_subclasses*/
26417   0, /*tp_weaklist*/
26418   0, /*tp_del*/
26419   0, /*tp_version_tag*/
26420   #if PY_VERSION_HEX >= 0x030400a1
26421   0, /*tp_finalize*/
26422   #endif
26423   #if PY_VERSION_HEX >= 0x030800b1
26424   0, /*tp_vectorcall*/
26425   #endif
26426 };
26427 
26428 static PyMethodDef __pyx_methods[] = {
26429   {"read_offset", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2yt_9frontends_6ramses_8io_utils_3read_offset, METH_VARARGS|METH_KEYWORDS, 0},
26430   {0, 0, 0, 0}
26431 };
26432 
26433 #if PY_MAJOR_VERSION >= 3
26434 #if CYTHON_PEP489_MULTI_PHASE_INIT
26435 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
26436 static int __pyx_pymod_exec_io_utils(PyObject* module); /*proto*/
26437 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
26438   {Py_mod_create, (void*)__pyx_pymod_create},
26439   {Py_mod_exec, (void*)__pyx_pymod_exec_io_utils},
26440   {0, NULL}
26441 };
26442 #endif
26443 
26444 static struct PyModuleDef __pyx_moduledef = {
26445     PyModuleDef_HEAD_INIT,
26446     "io_utils",
26447     0, /* m_doc */
26448   #if CYTHON_PEP489_MULTI_PHASE_INIT
26449     0, /* m_size */
26450   #else
26451     -1, /* m_size */
26452   #endif
26453     __pyx_methods /* m_methods */,
26454   #if CYTHON_PEP489_MULTI_PHASE_INIT
26455     __pyx_moduledef_slots, /* m_slots */
26456   #else
26457     NULL, /* m_reload */
26458   #endif
26459     NULL, /* m_traverse */
26460     NULL, /* m_clear */
26461     NULL /* m_free */
26462 };
26463 #endif
26464 #ifndef CYTHON_SMALL_CODE
26465 #if defined(__clang__)
26466     #define CYTHON_SMALL_CODE
26467 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
26468     #define CYTHON_SMALL_CODE __attribute__((cold))
26469 #else
26470     #define CYTHON_SMALL_CODE
26471 #endif
26472 #endif
26473 
26474 static __Pyx_StringTabEntry __pyx_string_tab[] = {
26475   {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
26476   {&__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},
26477   {&__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},
26478   {&__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},
26479   {&__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},
26480   {&__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},
26481   {&__pyx_kp_s_Cannot_read_offsets_in_file_s_Th, __pyx_k_Cannot_read_offsets_in_file_s_Th, sizeof(__pyx_k_Cannot_read_offsets_in_file_s_Th), 0, 0, 1, 0},
26482   {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
26483   {&__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},
26484   {&__pyx_n_s_F, __pyx_k_F, sizeof(__pyx_k_F), 0, 0, 1, 1},
26485   {&__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},
26486   {&__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},
26487   {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
26488   {&__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},
26489   {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
26490   {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
26491   {&__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},
26492   {&__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},
26493   {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
26494   {&__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},
26495   {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
26496   {&__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},
26497   {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
26498   {&__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},
26499   {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
26500   {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
26501   {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
26502   {&__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},
26503   {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
26504   {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
26505   {&__pyx_n_s_YTIllDefinedAMRData, __pyx_k_YTIllDefinedAMRData, sizeof(__pyx_k_YTIllDefinedAMRData), 0, 0, 1, 1},
26506   {&__pyx_n_s_add, __pyx_k_add, sizeof(__pyx_k_add), 0, 0, 1, 1},
26507   {&__pyx_n_s_all_fields, __pyx_k_all_fields, sizeof(__pyx_k_all_fields), 0, 0, 1, 1},
26508   {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
26509   {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
26510   {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1},
26511   {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
26512   {&__pyx_n_s_buffer_size, __pyx_k_buffer_size, sizeof(__pyx_k_buffer_size), 0, 0, 1, 1},
26513   {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
26514   {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
26515   {&__pyx_n_s_cell_inds, __pyx_k_cell_inds, sizeof(__pyx_k_cell_inds), 0, 0, 1, 1},
26516   {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
26517   {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
26518   {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
26519   {&__pyx_n_s_code_length, __pyx_k_code_length, sizeof(__pyx_k_code_length), 0, 0, 1, 1},
26520   {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
26521   {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
26522   {&__pyx_n_s_convert_to_units, __pyx_k_convert_to_units, sizeof(__pyx_k_convert_to_units), 0, 0, 1, 1},
26523   {&__pyx_n_s_count_boundary, __pyx_k_count_boundary, sizeof(__pyx_k_count_boundary), 0, 0, 1, 1},
26524   {&__pyx_n_s_cpu_enumerator, __pyx_k_cpu_enumerator, sizeof(__pyx_k_cpu_enumerator), 0, 0, 1, 1},
26525   {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1},
26526   {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
26527   {&__pyx_n_s_domain, __pyx_k_domain, sizeof(__pyx_k_domain), 0, 0, 1, 1},
26528   {&__pyx_n_s_domain_id, __pyx_k_domain_id, sizeof(__pyx_k_domain_id), 0, 0, 1, 1},
26529   {&__pyx_n_s_domains, __pyx_k_domains, sizeof(__pyx_k_domains), 0, 0, 1, 1},
26530   {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
26531   {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
26532   {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1},
26533   {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
26534   {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
26535   {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
26536   {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1},
26537   {&__pyx_n_s_field, __pyx_k_field, sizeof(__pyx_k_field), 0, 0, 1, 1},
26538   {&__pyx_n_s_fields, __pyx_k_fields, sizeof(__pyx_k_fields), 0, 0, 1, 1},
26539   {&__pyx_n_s_file_inds, __pyx_k_file_inds, sizeof(__pyx_k_file_inds), 0, 0, 1, 1},
26540   {&__pyx_n_s_fill_hydro, __pyx_k_fill_hydro, sizeof(__pyx_k_fill_hydro), 0, 0, 1, 1},
26541   {&__pyx_n_s_fill_level, __pyx_k_fill_level, sizeof(__pyx_k_fill_level), 0, 0, 1, 1},
26542   {&__pyx_n_s_fill_level_with_domain, __pyx_k_fill_level_with_domain, sizeof(__pyx_k_fill_level_with_domain), 0, 0, 1, 1},
26543   {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
26544   {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1},
26545   {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
26546   {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
26547   {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
26548   {&__pyx_n_s_full, __pyx_k_full, sizeof(__pyx_k_full), 0, 0, 1, 1},
26549   {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1},
26550   {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
26551   {&__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},
26552   {&__pyx_n_s_headers, __pyx_k_headers, sizeof(__pyx_k_headers), 0, 0, 1, 1},
26553   {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
26554   {&__pyx_n_s_icpu, __pyx_k_icpu, sizeof(__pyx_k_icpu), 0, 0, 1, 1},
26555   {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
26556   {&__pyx_n_s_ifield, __pyx_k_ifield, sizeof(__pyx_k_ifield), 0, 0, 1, 1},
26557   {&__pyx_n_s_ilevel, __pyx_k_ilevel, sizeof(__pyx_k_ilevel), 0, 0, 1, 1},
26558   {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
26559   {&__pyx_n_s_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 0, 1, 1},
26560   {&__pyx_n_s_int64, __pyx_k_int64, sizeof(__pyx_k_int64), 0, 0, 1, 1},
26561   {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
26562   {&__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},
26563   {&__pyx_n_s_level_count, __pyx_k_level_count, sizeof(__pyx_k_level_count), 0, 0, 1, 1},
26564   {&__pyx_n_s_levels, __pyx_k_levels, sizeof(__pyx_k_levels), 0, 0, 1, 1},
26565   {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
26566   {&__pyx_n_s_mask, __pyx_k_mask, sizeof(__pyx_k_mask), 0, 0, 1, 1},
26567   {&__pyx_n_s_max_level, __pyx_k_max_level, sizeof(__pyx_k_max_level), 0, 0, 1, 1},
26568   {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
26569   {&__pyx_n_s_min_level, __pyx_k_min_level, sizeof(__pyx_k_min_level), 0, 0, 1, 1},
26570   {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
26571   {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
26572   {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
26573   {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
26574   {&__pyx_n_s_nboundary, __pyx_k_nboundary, sizeof(__pyx_k_nboundary), 0, 0, 1, 1},
26575   {&__pyx_n_s_nc, __pyx_k_nc, sizeof(__pyx_k_nc), 0, 0, 1, 1},
26576   {&__pyx_n_s_ncpu, __pyx_k_ncpu, sizeof(__pyx_k_ncpu), 0, 0, 1, 1},
26577   {&__pyx_n_s_ncpu_and_bound, __pyx_k_ncpu_and_bound, sizeof(__pyx_k_ncpu_and_bound), 0, 0, 1, 1},
26578   {&__pyx_n_s_ncpu_selected, __pyx_k_ncpu_selected, sizeof(__pyx_k_ncpu_selected), 0, 0, 1, 1},
26579   {&__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},
26580   {&__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},
26581   {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
26582   {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
26583   {&__pyx_n_s_nfields, __pyx_k_nfields, sizeof(__pyx_k_nfields), 0, 0, 1, 1},
26584   {&__pyx_n_s_ng, __pyx_k_ng, sizeof(__pyx_k_ng), 0, 0, 1, 1},
26585   {&__pyx_n_s_ngridbound, __pyx_k_ngridbound, sizeof(__pyx_k_ngridbound), 0, 0, 1, 1},
26586   {&__pyx_n_s_nlevelmax, __pyx_k_nlevelmax, sizeof(__pyx_k_nlevelmax), 0, 0, 1, 1},
26587   {&__pyx_n_s_nlevels, __pyx_k_nlevels, sizeof(__pyx_k_nlevels), 0, 0, 1, 1},
26588   {&__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},
26589   {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
26590   {&__pyx_n_s_numbl, __pyx_k_numbl, sizeof(__pyx_k_numbl), 0, 0, 1, 1},
26591   {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
26592   {&__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},
26593   {&__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},
26594   {&__pyx_n_s_nvar, __pyx_k_nvar, sizeof(__pyx_k_nvar), 0, 0, 1, 1},
26595   {&__pyx_n_s_nx, __pyx_k_nx, sizeof(__pyx_k_nx), 0, 0, 1, 1},
26596   {&__pyx_n_s_ny, __pyx_k_ny, sizeof(__pyx_k_ny), 0, 0, 1, 1},
26597   {&__pyx_n_s_nz, __pyx_k_nz, sizeof(__pyx_k_nz), 0, 0, 1, 1},
26598   {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
26599   {&__pyx_n_s_oct_handler, __pyx_k_oct_handler, sizeof(__pyx_k_oct_handler), 0, 0, 1, 1},
26600   {&__pyx_n_s_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1},
26601   {&__pyx_n_s_offsets, __pyx_k_offsets, sizeof(__pyx_k_offsets), 0, 0, 1, 1},
26602   {&__pyx_n_s_order, __pyx_k_order, sizeof(__pyx_k_order), 0, 0, 1, 1},
26603   {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
26604   {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
26605   {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1},
26606   {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
26607   {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
26608   {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
26609   {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
26610   {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
26611   {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
26612   {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
26613   {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
26614   {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
26615   {&__pyx_n_s_read_amr, __pyx_k_read_amr, sizeof(__pyx_k_read_amr), 0, 0, 1, 1},
26616   {&__pyx_n_s_read_amr_locals_genexpr, __pyx_k_read_amr_locals_genexpr, sizeof(__pyx_k_read_amr_locals_genexpr), 0, 0, 1, 1},
26617   {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
26618   {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
26619   {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
26620   {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1},
26621   {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
26622   {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
26623   {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
26624   {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
26625   {&__pyx_n_s_skip_len, __pyx_k_skip_len, sizeof(__pyx_k_skip_len), 0, 0, 1, 1},
26626   {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
26627   {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
26628   {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
26629   {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
26630   {&__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},
26631   {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
26632   {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
26633   {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
26634   {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
26635   {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1},
26636   {&__pyx_n_s_tmp, __pyx_k_tmp, sizeof(__pyx_k_tmp), 0, 0, 1, 1},
26637   {&__pyx_n_s_tr, __pyx_k_tr, sizeof(__pyx_k_tr), 0, 0, 1, 1},
26638   {&__pyx_n_s_twotondim, __pyx_k_twotondim, sizeof(__pyx_k_twotondim), 0, 0, 1, 1},
26639   {&__pyx_n_s_uint8, __pyx_k_uint8, sizeof(__pyx_k_uint8), 0, 0, 1, 1},
26640   {&__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},
26641   {&__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},
26642   {&__pyx_n_s_units, __pyx_k_units, sizeof(__pyx_k_units), 0, 0, 1, 1},
26643   {&__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},
26644   {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
26645   {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
26646   {&__pyx_n_s_yt_frontends_ramses_io_utils, __pyx_k_yt_frontends_ramses_io_utils, sizeof(__pyx_k_yt_frontends_ramses_io_utils), 0, 0, 1, 1},
26647   {&__pyx_kp_s_yt_frontends_ramses_io_utils_pyx, __pyx_k_yt_frontends_ramses_io_utils_pyx, sizeof(__pyx_k_yt_frontends_ramses_io_utils_pyx), 0, 0, 1, 0},
26648   {&__pyx_n_s_yt_utilities_exceptions, __pyx_k_yt_utilities_exceptions, sizeof(__pyx_k_yt_utilities_exceptions), 0, 0, 1, 1},
26649   {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
26650   {0, 0, 0, 0, 0, 0, 0}
26651 };
__Pyx_InitCachedBuiltins(void)26652 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
26653   __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 52, __pyx_L1_error)
26654   __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 272, __pyx_L1_error)
26655   __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 856, __pyx_L1_error)
26656   __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 1038, __pyx_L1_error)
26657   __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(4, 148, __pyx_L1_error)
26658   __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(4, 151, __pyx_L1_error)
26659   __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(4, 2, __pyx_L1_error)
26660   __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(4, 400, __pyx_L1_error)
26661   __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(4, 609, __pyx_L1_error)
26662   __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(4, 828, __pyx_L1_error)
26663   return 0;
26664   __pyx_L1_error:;
26665   return -1;
26666 }
26667 
__Pyx_InitCachedConstants(void)26668 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
26669   __Pyx_RefNannyDeclarations
26670   __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
26671 
26672   /* "yt/frontends/ramses/io_utils.pyx":41
26673  *     ncpu_and_bound = nboundary + ncpu
26674  *
26675  *     pos = np.empty((0, 3), dtype=np.float64)             # <<<<<<<<<<<<<<
26676  *     buffer_size = 0
26677  *     # Compute number of fields to skip. This should be 31 in 3 dimensions
26678  */
26679   __pyx_tuple_ = PyTuple_Pack(2, __pyx_int_0, __pyx_int_3); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 41, __pyx_L1_error)
26680   __Pyx_GOTREF(__pyx_tuple_);
26681   __Pyx_GIVEREF(__pyx_tuple_);
26682   __pyx_tuple__2 = PyTuple_Pack(1, __pyx_tuple_); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 41, __pyx_L1_error)
26683   __Pyx_GOTREF(__pyx_tuple__2);
26684   __Pyx_GIVEREF(__pyx_tuple__2);
26685 
26686   /* "yt/frontends/ramses/io_utils.pyx":78
26687  *             # Note that we're adding *grids*, not individual cells.
26688  *             if ilevel >= min_level:
26689  *                 n = oct_handler.add(icpu + 1, ilevel - min_level, pos[:ng, :],             # <<<<<<<<<<<<<<
26690  *                                     count_boundary = 1)
26691  *                 if n > 0:
26692  */
26693   __pyx_slice__3 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__3)) __PYX_ERR(0, 78, __pyx_L1_error)
26694   __Pyx_GOTREF(__pyx_slice__3);
26695   __Pyx_GIVEREF(__pyx_slice__3);
26696 
26697   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272
26698  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
26699  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
26700  *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
26701  *
26702  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
26703  */
26704   __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 272, __pyx_L1_error)
26705   __Pyx_GOTREF(__pyx_tuple__5);
26706   __Pyx_GIVEREF(__pyx_tuple__5);
26707 
26708   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276
26709  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
26710  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
26711  *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
26712  *
26713  *             info.buf = PyArray_DATA(self)
26714  */
26715   __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 276, __pyx_L1_error)
26716   __Pyx_GOTREF(__pyx_tuple__6);
26717   __Pyx_GIVEREF(__pyx_tuple__6);
26718 
26719   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":306
26720  *                 if ((descr.byteorder == c'>' and little_endian) or
26721  *                     (descr.byteorder == c'<' and not little_endian)):
26722  *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
26723  *                 if   t == NPY_BYTE:        f = "b"
26724  *                 elif t == NPY_UBYTE:       f = "B"
26725  */
26726   __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 306, __pyx_L1_error)
26727   __Pyx_GOTREF(__pyx_tuple__7);
26728   __Pyx_GIVEREF(__pyx_tuple__7);
26729 
26730   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856
26731  *
26732  *         if (end - f) - <int>(new_offset - offset[0]) < 15:
26733  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
26734  *
26735  *         if ((child.byteorder == c'>' and little_endian) or
26736  */
26737   __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 856, __pyx_L1_error)
26738   __Pyx_GOTREF(__pyx_tuple__8);
26739   __Pyx_GIVEREF(__pyx_tuple__8);
26740 
26741   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":880
26742  *             t = child.type_num
26743  *             if end - f < 5:
26744  *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
26745  *
26746  *             # Until ticket #99 is fixed, use integers to avoid warnings
26747  */
26748   __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 880, __pyx_L1_error)
26749   __Pyx_GOTREF(__pyx_tuple__9);
26750   __Pyx_GIVEREF(__pyx_tuple__9);
26751 
26752   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1038
26753  *         _import_array()
26754  *     except Exception:
26755  *         raise ImportError("numpy.core.multiarray failed to import")             # <<<<<<<<<<<<<<
26756  *
26757  * cdef inline int import_umath() except -1:
26758  */
26759   __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 1038, __pyx_L1_error)
26760   __Pyx_GOTREF(__pyx_tuple__10);
26761   __Pyx_GIVEREF(__pyx_tuple__10);
26762 
26763   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1044
26764  *         _import_umath()
26765  *     except Exception:
26766  *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
26767  *
26768  * cdef inline int import_ufunc() except -1:
26769  */
26770   __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 1044, __pyx_L1_error)
26771   __Pyx_GOTREF(__pyx_tuple__11);
26772   __Pyx_GIVEREF(__pyx_tuple__11);
26773 
26774   /* "View.MemoryView":133
26775  *
26776  *         if not self.ndim:
26777  *             raise ValueError("Empty shape tuple for cython.array")             # <<<<<<<<<<<<<<
26778  *
26779  *         if itemsize <= 0:
26780  */
26781   __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(4, 133, __pyx_L1_error)
26782   __Pyx_GOTREF(__pyx_tuple__12);
26783   __Pyx_GIVEREF(__pyx_tuple__12);
26784 
26785   /* "View.MemoryView":136
26786  *
26787  *         if itemsize <= 0:
26788  *             raise ValueError("itemsize <= 0 for cython.array")             # <<<<<<<<<<<<<<
26789  *
26790  *         if not isinstance(format, bytes):
26791  */
26792   __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(4, 136, __pyx_L1_error)
26793   __Pyx_GOTREF(__pyx_tuple__13);
26794   __Pyx_GIVEREF(__pyx_tuple__13);
26795 
26796   /* "View.MemoryView":148
26797  *
26798  *         if not self._shape:
26799  *             raise MemoryError("unable to allocate shape and strides.")             # <<<<<<<<<<<<<<
26800  *
26801  *
26802  */
26803   __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(4, 148, __pyx_L1_error)
26804   __Pyx_GOTREF(__pyx_tuple__14);
26805   __Pyx_GIVEREF(__pyx_tuple__14);
26806 
26807   /* "View.MemoryView":176
26808  *             self.data = <char *>malloc(self.len)
26809  *             if not self.data:
26810  *                 raise MemoryError("unable to allocate array data.")             # <<<<<<<<<<<<<<
26811  *
26812  *             if self.dtype_is_object:
26813  */
26814   __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(4, 176, __pyx_L1_error)
26815   __Pyx_GOTREF(__pyx_tuple__15);
26816   __Pyx_GIVEREF(__pyx_tuple__15);
26817 
26818   /* "View.MemoryView":192
26819  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
26820  *         if not (flags & bufmode):
26821  *             raise ValueError("Can only create a buffer that is contiguous in memory.")             # <<<<<<<<<<<<<<
26822  *         info.buf = self.data
26823  *         info.len = self.len
26824  */
26825   __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(4, 192, __pyx_L1_error)
26826   __Pyx_GOTREF(__pyx_tuple__16);
26827   __Pyx_GIVEREF(__pyx_tuple__16);
26828 
26829   /* "(tree fragment)":2
26830  * def __reduce_cython__(self):
26831  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
26832  * def __setstate_cython__(self, __pyx_state):
26833  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
26834  */
26835   __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(4, 2, __pyx_L1_error)
26836   __Pyx_GOTREF(__pyx_tuple__17);
26837   __Pyx_GIVEREF(__pyx_tuple__17);
26838 
26839   /* "(tree fragment)":4
26840  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
26841  * def __setstate_cython__(self, __pyx_state):
26842  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
26843  */
26844   __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(4, 4, __pyx_L1_error)
26845   __Pyx_GOTREF(__pyx_tuple__18);
26846   __Pyx_GIVEREF(__pyx_tuple__18);
26847 
26848   /* "View.MemoryView":414
26849  *     def __setitem__(memoryview self, object index, object value):
26850  *         if self.view.readonly:
26851  *             raise TypeError("Cannot assign to read-only memoryview")             # <<<<<<<<<<<<<<
26852  *
26853  *         have_slices, index = _unellipsify(index, self.view.ndim)
26854  */
26855   __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(4, 414, __pyx_L1_error)
26856   __Pyx_GOTREF(__pyx_tuple__19);
26857   __Pyx_GIVEREF(__pyx_tuple__19);
26858 
26859   /* "View.MemoryView":491
26860  *             result = struct.unpack(self.view.format, bytesitem)
26861  *         except struct.error:
26862  *             raise ValueError("Unable to convert item to object")             # <<<<<<<<<<<<<<
26863  *         else:
26864  *             if len(self.view.format) == 1:
26865  */
26866   __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(4, 491, __pyx_L1_error)
26867   __Pyx_GOTREF(__pyx_tuple__20);
26868   __Pyx_GIVEREF(__pyx_tuple__20);
26869 
26870   /* "View.MemoryView":516
26871  *     def __getbuffer__(self, Py_buffer *info, int flags):
26872  *         if flags & PyBUF_WRITABLE and self.view.readonly:
26873  *             raise ValueError("Cannot create writable memory view from read-only memoryview")             # <<<<<<<<<<<<<<
26874  *
26875  *         if flags & PyBUF_ND:
26876  */
26877   __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(4, 516, __pyx_L1_error)
26878   __Pyx_GOTREF(__pyx_tuple__21);
26879   __Pyx_GIVEREF(__pyx_tuple__21);
26880 
26881   /* "View.MemoryView":566
26882  *         if self.view.strides == NULL:
26883  *
26884  *             raise ValueError("Buffer view does not expose strides")             # <<<<<<<<<<<<<<
26885  *
26886  *         return tuple([stride for stride in self.view.strides[:self.view.ndim]])
26887  */
26888   __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(4, 566, __pyx_L1_error)
26889   __Pyx_GOTREF(__pyx_tuple__22);
26890   __Pyx_GIVEREF(__pyx_tuple__22);
26891 
26892   /* "View.MemoryView":573
26893  *     def suboffsets(self):
26894  *         if self.view.suboffsets == NULL:
26895  *             return (-1,) * self.view.ndim             # <<<<<<<<<<<<<<
26896  *
26897  *         return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
26898  */
26899   __pyx_tuple__23 = PyTuple_New(1); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(4, 573, __pyx_L1_error)
26900   __Pyx_GOTREF(__pyx_tuple__23);
26901   __Pyx_INCREF(__pyx_int_neg_1);
26902   __Pyx_GIVEREF(__pyx_int_neg_1);
26903   PyTuple_SET_ITEM(__pyx_tuple__23, 0, __pyx_int_neg_1);
26904   __Pyx_GIVEREF(__pyx_tuple__23);
26905 
26906   /* "(tree fragment)":2
26907  * def __reduce_cython__(self):
26908  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
26909  * def __setstate_cython__(self, __pyx_state):
26910  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
26911  */
26912   __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(4, 2, __pyx_L1_error)
26913   __Pyx_GOTREF(__pyx_tuple__24);
26914   __Pyx_GIVEREF(__pyx_tuple__24);
26915 
26916   /* "(tree fragment)":4
26917  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
26918  * def __setstate_cython__(self, __pyx_state):
26919  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
26920  */
26921   __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(4, 4, __pyx_L1_error)
26922   __Pyx_GOTREF(__pyx_tuple__25);
26923   __Pyx_GIVEREF(__pyx_tuple__25);
26924 
26925   /* "View.MemoryView":699
26926  *     for suboffset in suboffsets[:ndim]:
26927  *         if suboffset >= 0:
26928  *             raise ValueError("Indirect dimensions not supported")             # <<<<<<<<<<<<<<
26929  *
26930  *
26931  */
26932   __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(4, 699, __pyx_L1_error)
26933   __Pyx_GOTREF(__pyx_tuple__26);
26934   __Pyx_GIVEREF(__pyx_tuple__26);
26935 
26936   /* "(tree fragment)":2
26937  * def __reduce_cython__(self):
26938  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
26939  * def __setstate_cython__(self, __pyx_state):
26940  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
26941  */
26942   __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(4, 2, __pyx_L1_error)
26943   __Pyx_GOTREF(__pyx_tuple__27);
26944   __Pyx_GIVEREF(__pyx_tuple__27);
26945 
26946   /* "(tree fragment)":4
26947  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
26948  * def __setstate_cython__(self, __pyx_state):
26949  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
26950  */
26951   __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(4, 4, __pyx_L1_error)
26952   __Pyx_GOTREF(__pyx_tuple__28);
26953   __Pyx_GIVEREF(__pyx_tuple__28);
26954 
26955   /* "yt/frontends/ramses/io_utils.pyx":21
26956  * @cython.cdivision(True)
26957  * @cython.nonecheck(False)
26958  * def read_amr(FortranFile f, dict headers,             # <<<<<<<<<<<<<<
26959  *              np.ndarray[np.int64_t, ndim=1] ngridbound, INT64_t min_level,
26960  *              RAMSESOctreeContainer oct_handler):
26961  */
26962   __pyx_tuple__29 = PyTuple_Pack(24, __pyx_n_s_f, __pyx_n_s_headers, __pyx_n_s_ngridbound, __pyx_n_s_min_level, __pyx_n_s_oct_handler, __pyx_n_s_ncpu, __pyx_n_s_nboundary, __pyx_n_s_max_level, __pyx_n_s_nlevelmax, __pyx_n_s_ncpu_and_bound, __pyx_n_s_nx, __pyx_n_s_ny, __pyx_n_s_nz, __pyx_n_s_ilevel, __pyx_n_s_icpu, __pyx_n_s_n, __pyx_n_s_ndim, __pyx_n_s_skip_len, __pyx_n_s_ng, __pyx_n_s_buffer_size, __pyx_n_s_numbl, __pyx_n_s_pos, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 21, __pyx_L1_error)
26963   __Pyx_GOTREF(__pyx_tuple__29);
26964   __Pyx_GIVEREF(__pyx_tuple__29);
26965   __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(5, 0, 24, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_yt_frontends_ramses_io_utils_pyx, __pyx_n_s_read_amr, 21, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 21, __pyx_L1_error)
26966 
26967   /* "yt/frontends/ramses/io_utils.pyx":139
26968  * @cython.cdivision(True)
26969  * @cython.nonecheck(False)
26970  * def fill_hydro(FortranFile f,             # <<<<<<<<<<<<<<
26971  *                np.ndarray[np.int64_t, ndim=2] offsets,
26972  *                np.ndarray[np.int64_t, ndim=2] level_count,
26973  */
26974   __pyx_tuple__31 = PyTuple_Pack(27, __pyx_n_s_f, __pyx_n_s_offsets, __pyx_n_s_level_count, __pyx_n_s_cpu_enumerator, __pyx_n_s_levels, __pyx_n_s_cell_inds, __pyx_n_s_file_inds, __pyx_n_s_ndim, __pyx_n_s_all_fields, __pyx_n_s_fields, __pyx_n_s_tr, __pyx_n_s_oct_handler, __pyx_n_s_domains, __pyx_n_s_offset, __pyx_n_s_tmp, __pyx_n_s_field, __pyx_n_s_twotondim, __pyx_n_s_ilevel, __pyx_n_s_icpu, __pyx_n_s_ifield, __pyx_n_s_nfields, __pyx_n_s_nlevels, __pyx_n_s_nc, __pyx_n_s_ncpu_selected, __pyx_n_s_mask, __pyx_n_s_ncpu, __pyx_n_s_i); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 139, __pyx_L1_error)
26975   __Pyx_GOTREF(__pyx_tuple__31);
26976   __Pyx_GIVEREF(__pyx_tuple__31);
26977   __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(13, 0, 27, 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_yt_frontends_ramses_io_utils_pyx, __pyx_n_s_fill_hydro, 139, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 139, __pyx_L1_error)
26978 
26979   /* "View.MemoryView":286
26980  *         return self.name
26981  *
26982  * cdef generic = Enum("<strided and direct or indirect>")             # <<<<<<<<<<<<<<
26983  * cdef strided = Enum("<strided and direct>") # default
26984  * cdef indirect = Enum("<strided and indirect>")
26985  */
26986   __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(4, 286, __pyx_L1_error)
26987   __Pyx_GOTREF(__pyx_tuple__33);
26988   __Pyx_GIVEREF(__pyx_tuple__33);
26989 
26990   /* "View.MemoryView":287
26991  *
26992  * cdef generic = Enum("<strided and direct or indirect>")
26993  * cdef strided = Enum("<strided and direct>") # default             # <<<<<<<<<<<<<<
26994  * cdef indirect = Enum("<strided and indirect>")
26995  *
26996  */
26997   __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(4, 287, __pyx_L1_error)
26998   __Pyx_GOTREF(__pyx_tuple__34);
26999   __Pyx_GIVEREF(__pyx_tuple__34);
27000 
27001   /* "View.MemoryView":288
27002  * cdef generic = Enum("<strided and direct or indirect>")
27003  * cdef strided = Enum("<strided and direct>") # default
27004  * cdef indirect = Enum("<strided and indirect>")             # <<<<<<<<<<<<<<
27005  *
27006  *
27007  */
27008   __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(4, 288, __pyx_L1_error)
27009   __Pyx_GOTREF(__pyx_tuple__35);
27010   __Pyx_GIVEREF(__pyx_tuple__35);
27011 
27012   /* "View.MemoryView":291
27013  *
27014  *
27015  * cdef contiguous = Enum("<contiguous and direct>")             # <<<<<<<<<<<<<<
27016  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
27017  *
27018  */
27019   __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(4, 291, __pyx_L1_error)
27020   __Pyx_GOTREF(__pyx_tuple__36);
27021   __Pyx_GIVEREF(__pyx_tuple__36);
27022 
27023   /* "View.MemoryView":292
27024  *
27025  * cdef contiguous = Enum("<contiguous and direct>")
27026  * cdef indirect_contiguous = Enum("<contiguous and indirect>")             # <<<<<<<<<<<<<<
27027  *
27028  *
27029  */
27030   __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(4, 292, __pyx_L1_error)
27031   __Pyx_GOTREF(__pyx_tuple__37);
27032   __Pyx_GIVEREF(__pyx_tuple__37);
27033 
27034   /* "(tree fragment)":1
27035  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
27036  *     cdef object __pyx_PickleError
27037  *     cdef object __pyx_result
27038  */
27039   __pyx_tuple__38 = 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__38)) __PYX_ERR(4, 1, __pyx_L1_error)
27040   __Pyx_GOTREF(__pyx_tuple__38);
27041   __Pyx_GIVEREF(__pyx_tuple__38);
27042   __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(4, 1, __pyx_L1_error)
27043   __Pyx_RefNannyFinishContext();
27044   return 0;
27045   __pyx_L1_error:;
27046   __Pyx_RefNannyFinishContext();
27047   return -1;
27048 }
27049 
__Pyx_InitGlobals(void)27050 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
27051   if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
27052   __pyx_float_1_0 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_float_1_0)) __PYX_ERR(0, 1, __pyx_L1_error)
27053   __pyx_float_2_0 = PyFloat_FromDouble(2.0); if (unlikely(!__pyx_float_2_0)) __PYX_ERR(0, 1, __pyx_L1_error)
27054   __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
27055   __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
27056   __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
27057   __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
27058   __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
27059   __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
27060   return 0;
27061   __pyx_L1_error:;
27062   return -1;
27063 }
27064 
27065 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
27066 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
27067 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
27068 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
27069 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
27070 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
27071 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
27072 
__Pyx_modinit_global_init_code(void)27073 static int __Pyx_modinit_global_init_code(void) {
27074   __Pyx_RefNannyDeclarations
27075   __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
27076   /*--- Global init code ---*/
27077   generic = Py_None; Py_INCREF(Py_None);
27078   strided = Py_None; Py_INCREF(Py_None);
27079   indirect = Py_None; Py_INCREF(Py_None);
27080   contiguous = Py_None; Py_INCREF(Py_None);
27081   indirect_contiguous = Py_None; Py_INCREF(Py_None);
27082   __Pyx_RefNannyFinishContext();
27083   return 0;
27084 }
27085 
__Pyx_modinit_variable_export_code(void)27086 static int __Pyx_modinit_variable_export_code(void) {
27087   __Pyx_RefNannyDeclarations
27088   __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
27089   /*--- Variable export code ---*/
27090   __Pyx_RefNannyFinishContext();
27091   return 0;
27092 }
27093 
__Pyx_modinit_function_export_code(void)27094 static int __Pyx_modinit_function_export_code(void) {
27095   __Pyx_RefNannyDeclarations
27096   __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
27097   /*--- Function export code ---*/
27098   __Pyx_RefNannyFinishContext();
27099   return 0;
27100 }
27101 
__Pyx_modinit_type_init_code(void)27102 static int __Pyx_modinit_type_init_code(void) {
27103   __Pyx_RefNannyDeclarations
27104   __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
27105   /*--- Type init code ---*/
27106   if (PyType_Ready(&__pyx_type_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct__read_amr) < 0) __PYX_ERR(0, 21, __pyx_L1_error)
27107   #if PY_VERSION_HEX < 0x030800B1
27108   __pyx_type_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct__read_amr.tp_print = 0;
27109   #endif
27110   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct__read_amr.tp_dictoffset && __pyx_type_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct__read_amr.tp_getattro == PyObject_GenericGetAttr)) {
27111     __pyx_type_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct__read_amr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
27112   }
27113   __pyx_ptype_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct__read_amr = &__pyx_type_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct__read_amr;
27114   if (PyType_Ready(&__pyx_type_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
27115   #if PY_VERSION_HEX < 0x030800B1
27116   __pyx_type_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct_1_genexpr.tp_print = 0;
27117   #endif
27118   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct_1_genexpr.tp_dictoffset && __pyx_type_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct_1_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
27119     __pyx_type_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct_1_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
27120   }
27121   __pyx_ptype_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct_1_genexpr = &__pyx_type_2yt_9frontends_6ramses_8io_utils___pyx_scope_struct_1_genexpr;
27122   __pyx_vtabptr_array = &__pyx_vtable_array;
27123   __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
27124   if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(4, 105, __pyx_L1_error)
27125   #if PY_VERSION_HEX < 0x030800B1
27126   __pyx_type___pyx_array.tp_print = 0;
27127   #endif
27128   if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(4, 105, __pyx_L1_error)
27129   if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(4, 105, __pyx_L1_error)
27130   __pyx_array_type = &__pyx_type___pyx_array;
27131   if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(4, 279, __pyx_L1_error)
27132   #if PY_VERSION_HEX < 0x030800B1
27133   __pyx_type___pyx_MemviewEnum.tp_print = 0;
27134   #endif
27135   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
27136     __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
27137   }
27138   if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(4, 279, __pyx_L1_error)
27139   __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
27140   __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
27141   __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
27142   __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
27143   __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
27144   __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
27145   __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
27146   __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
27147   __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
27148   if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(4, 330, __pyx_L1_error)
27149   #if PY_VERSION_HEX < 0x030800B1
27150   __pyx_type___pyx_memoryview.tp_print = 0;
27151   #endif
27152   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
27153     __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
27154   }
27155   if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(4, 330, __pyx_L1_error)
27156   if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(4, 330, __pyx_L1_error)
27157   __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
27158   __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
27159   __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
27160   __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
27161   __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
27162   __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
27163   if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(4, 961, __pyx_L1_error)
27164   #if PY_VERSION_HEX < 0x030800B1
27165   __pyx_type___pyx_memoryviewslice.tp_print = 0;
27166   #endif
27167   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
27168     __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
27169   }
27170   if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(4, 961, __pyx_L1_error)
27171   if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(4, 961, __pyx_L1_error)
27172   __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
27173   __Pyx_RefNannyFinishContext();
27174   return 0;
27175   __pyx_L1_error:;
27176   __Pyx_RefNannyFinishContext();
27177   return -1;
27178 }
27179 
__Pyx_modinit_type_import_code(void)27180 static int __Pyx_modinit_type_import_code(void) {
27181   __Pyx_RefNannyDeclarations
27182   PyObject *__pyx_t_1 = NULL;
27183   __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
27184   /*--- Type import code ---*/
27185   __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 9, __pyx_L1_error)
27186   __Pyx_GOTREF(__pyx_t_1);
27187   __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
27188   #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
27189   sizeof(PyTypeObject),
27190   #else
27191   sizeof(PyHeapTypeObject),
27192   #endif
27193   __Pyx_ImportType_CheckSize_Warn);
27194    if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(5, 9, __pyx_L1_error)
27195   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27196   __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 206, __pyx_L1_error)
27197   __Pyx_GOTREF(__pyx_t_1);
27198   __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
27199    if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 206, __pyx_L1_error)
27200   __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Warn);
27201    if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 229, __pyx_L1_error)
27202   __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Warn);
27203    if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 233, __pyx_L1_error)
27204   __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
27205    if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 242, __pyx_L1_error)
27206   __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Warn);
27207    if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 918, __pyx_L1_error)
27208   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27209   __pyx_t_1 = PyImport_ImportModule("yt.geometry.oct_visitors"); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 33, __pyx_L1_error)
27210   __Pyx_GOTREF(__pyx_t_1);
27211   __pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "OctVisitor", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor), __Pyx_ImportType_CheckSize_Warn);
27212    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor) __PYX_ERR(6, 33, __pyx_L1_error)
27213   __pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor)) __PYX_ERR(6, 33, __pyx_L1_error)
27214   __pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalOcts = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "CountTotalOcts", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalOcts), __Pyx_ImportType_CheckSize_Warn);
27215    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalOcts) __PYX_ERR(6, 59, __pyx_L1_error)
27216   __pyx_vtabptr_2yt_8geometry_12oct_visitors_CountTotalOcts = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CountTotalOcts*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalOcts->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_CountTotalOcts)) __PYX_ERR(6, 59, __pyx_L1_error)
27217   __pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalCells = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "CountTotalCells", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalCells), __Pyx_ImportType_CheckSize_Warn);
27218    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalCells) __PYX_ERR(6, 62, __pyx_L1_error)
27219   __pyx_vtabptr_2yt_8geometry_12oct_visitors_CountTotalCells = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CountTotalCells*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalCells->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_CountTotalCells)) __PYX_ERR(6, 62, __pyx_L1_error)
27220   __pyx_ptype_2yt_8geometry_12oct_visitors_MarkOcts = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "MarkOcts", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_MarkOcts), __Pyx_ImportType_CheckSize_Warn);
27221    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_MarkOcts) __PYX_ERR(6, 65, __pyx_L1_error)
27222   __pyx_vtabptr_2yt_8geometry_12oct_visitors_MarkOcts = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_MarkOcts*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_MarkOcts->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_MarkOcts)) __PYX_ERR(6, 65, __pyx_L1_error)
27223   __pyx_ptype_2yt_8geometry_12oct_visitors_MaskOcts = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "MaskOcts", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_MaskOcts), __Pyx_ImportType_CheckSize_Warn);
27224    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_MaskOcts) __PYX_ERR(6, 69, __pyx_L1_error)
27225   __pyx_vtabptr_2yt_8geometry_12oct_visitors_MaskOcts = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_MaskOcts*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_MaskOcts->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_MaskOcts)) __PYX_ERR(6, 69, __pyx_L1_error)
27226   __pyx_ptype_2yt_8geometry_12oct_visitors_IndexOcts = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "IndexOcts", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_IndexOcts), __Pyx_ImportType_CheckSize_Warn);
27227    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_IndexOcts) __PYX_ERR(6, 72, __pyx_L1_error)
27228   __pyx_vtabptr_2yt_8geometry_12oct_visitors_IndexOcts = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_IndexOcts*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_IndexOcts->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_IndexOcts)) __PYX_ERR(6, 72, __pyx_L1_error)
27229   __pyx_ptype_2yt_8geometry_12oct_visitors_MaskedIndexOcts = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "MaskedIndexOcts", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_MaskedIndexOcts), __Pyx_ImportType_CheckSize_Warn);
27230    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_MaskedIndexOcts) __PYX_ERR(6, 75, __pyx_L1_error)
27231   __pyx_vtabptr_2yt_8geometry_12oct_visitors_MaskedIndexOcts = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_MaskedIndexOcts*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_MaskedIndexOcts->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_MaskedIndexOcts)) __PYX_ERR(6, 75, __pyx_L1_error)
27232   __pyx_ptype_2yt_8geometry_12oct_visitors_IndexMaskMapOcts = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "IndexMaskMapOcts", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_IndexMaskMapOcts), __Pyx_ImportType_CheckSize_Warn);
27233    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_IndexMaskMapOcts) __PYX_ERR(6, 79, __pyx_L1_error)
27234   __pyx_vtabptr_2yt_8geometry_12oct_visitors_IndexMaskMapOcts = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_IndexMaskMapOcts*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_IndexMaskMapOcts->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_IndexMaskMapOcts)) __PYX_ERR(6, 79, __pyx_L1_error)
27235   __pyx_ptype_2yt_8geometry_12oct_visitors_ICoordsOcts = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "ICoordsOcts", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_ICoordsOcts), __Pyx_ImportType_CheckSize_Warn);
27236    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_ICoordsOcts) __PYX_ERR(6, 85, __pyx_L1_error)
27237   __pyx_vtabptr_2yt_8geometry_12oct_visitors_ICoordsOcts = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_ICoordsOcts*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_ICoordsOcts->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_ICoordsOcts)) __PYX_ERR(6, 85, __pyx_L1_error)
27238   __pyx_ptype_2yt_8geometry_12oct_visitors_IResOcts = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "IResOcts", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_IResOcts), __Pyx_ImportType_CheckSize_Warn);
27239    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_IResOcts) __PYX_ERR(6, 88, __pyx_L1_error)
27240   __pyx_vtabptr_2yt_8geometry_12oct_visitors_IResOcts = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_IResOcts*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_IResOcts->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_IResOcts)) __PYX_ERR(6, 88, __pyx_L1_error)
27241   __pyx_ptype_2yt_8geometry_12oct_visitors_FCoordsOcts = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "FCoordsOcts", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_FCoordsOcts), __Pyx_ImportType_CheckSize_Warn);
27242    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_FCoordsOcts) __PYX_ERR(6, 91, __pyx_L1_error)
27243   __pyx_vtabptr_2yt_8geometry_12oct_visitors_FCoordsOcts = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_FCoordsOcts*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_FCoordsOcts->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_FCoordsOcts)) __PYX_ERR(6, 91, __pyx_L1_error)
27244   __pyx_ptype_2yt_8geometry_12oct_visitors_FWidthOcts = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "FWidthOcts", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_FWidthOcts), __Pyx_ImportType_CheckSize_Warn);
27245    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_FWidthOcts) __PYX_ERR(6, 94, __pyx_L1_error)
27246   __pyx_vtabptr_2yt_8geometry_12oct_visitors_FWidthOcts = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_FWidthOcts*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_FWidthOcts->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_FWidthOcts)) __PYX_ERR(6, 94, __pyx_L1_error)
27247   __pyx_ptype_2yt_8geometry_12oct_visitors_CopyArrayI64 = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "CopyArrayI64", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayI64), __Pyx_ImportType_CheckSize_Warn);
27248    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_CopyArrayI64) __PYX_ERR(6, 97, __pyx_L1_error)
27249   __pyx_vtabptr_2yt_8geometry_12oct_visitors_CopyArrayI64 = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CopyArrayI64*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_CopyArrayI64->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_CopyArrayI64)) __PYX_ERR(6, 97, __pyx_L1_error)
27250   __pyx_ptype_2yt_8geometry_12oct_visitors_CopyArrayF64 = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "CopyArrayF64", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayF64), __Pyx_ImportType_CheckSize_Warn);
27251    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_CopyArrayF64) __PYX_ERR(6, 101, __pyx_L1_error)
27252   __pyx_vtabptr_2yt_8geometry_12oct_visitors_CopyArrayF64 = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CopyArrayF64*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_CopyArrayF64->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_CopyArrayF64)) __PYX_ERR(6, 101, __pyx_L1_error)
27253   __pyx_ptype_2yt_8geometry_12oct_visitors_CopyFileIndArrayI8 = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "CopyFileIndArrayI8", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyFileIndArrayI8), __Pyx_ImportType_CheckSize_Warn);
27254    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_CopyFileIndArrayI8) __PYX_ERR(6, 105, __pyx_L1_error)
27255   __pyx_vtabptr_2yt_8geometry_12oct_visitors_CopyFileIndArrayI8 = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CopyFileIndArrayI8*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_CopyFileIndArrayI8->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_CopyFileIndArrayI8)) __PYX_ERR(6, 105, __pyx_L1_error)
27256   __pyx_ptype_2yt_8geometry_12oct_visitors_IdentifyOcts = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "IdentifyOcts", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_IdentifyOcts), __Pyx_ImportType_CheckSize_Warn);
27257    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_IdentifyOcts) __PYX_ERR(6, 110, __pyx_L1_error)
27258   __pyx_vtabptr_2yt_8geometry_12oct_visitors_IdentifyOcts = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_IdentifyOcts*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_IdentifyOcts->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_IdentifyOcts)) __PYX_ERR(6, 110, __pyx_L1_error)
27259   __pyx_ptype_2yt_8geometry_12oct_visitors_AssignDomainInd = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "AssignDomainInd", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_AssignDomainInd), __Pyx_ImportType_CheckSize_Warn);
27260    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_AssignDomainInd) __PYX_ERR(6, 113, __pyx_L1_error)
27261   __pyx_vtabptr_2yt_8geometry_12oct_visitors_AssignDomainInd = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_AssignDomainInd*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_AssignDomainInd->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_AssignDomainInd)) __PYX_ERR(6, 113, __pyx_L1_error)
27262   __pyx_ptype_2yt_8geometry_12oct_visitors_FillFileIndicesO = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "FillFileIndicesO", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesO), __Pyx_ImportType_CheckSize_Warn);
27263    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_FillFileIndicesO) __PYX_ERR(6, 116, __pyx_L1_error)
27264   __pyx_vtabptr_2yt_8geometry_12oct_visitors_FillFileIndicesO = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_FillFileIndicesO*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_FillFileIndicesO->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_FillFileIndicesO)) __PYX_ERR(6, 116, __pyx_L1_error)
27265   __pyx_ptype_2yt_8geometry_12oct_visitors_FillFileIndicesR = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "FillFileIndicesR", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesR), __Pyx_ImportType_CheckSize_Warn);
27266    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_FillFileIndicesR) __PYX_ERR(6, 121, __pyx_L1_error)
27267   __pyx_vtabptr_2yt_8geometry_12oct_visitors_FillFileIndicesR = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_FillFileIndicesR*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_FillFileIndicesR->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_FillFileIndicesR)) __PYX_ERR(6, 121, __pyx_L1_error)
27268   __pyx_ptype_2yt_8geometry_12oct_visitors_CountByDomain = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "CountByDomain", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_CountByDomain), __Pyx_ImportType_CheckSize_Warn);
27269    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_CountByDomain) __PYX_ERR(6, 126, __pyx_L1_error)
27270   __pyx_vtabptr_2yt_8geometry_12oct_visitors_CountByDomain = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CountByDomain*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_CountByDomain->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_CountByDomain)) __PYX_ERR(6, 126, __pyx_L1_error)
27271   __pyx_ptype_2yt_8geometry_12oct_visitors_StoreOctree = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "StoreOctree", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_StoreOctree), __Pyx_ImportType_CheckSize_Warn);
27272    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_StoreOctree) __PYX_ERR(6, 129, __pyx_L1_error)
27273   __pyx_vtabptr_2yt_8geometry_12oct_visitors_StoreOctree = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_StoreOctree*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_StoreOctree->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_StoreOctree)) __PYX_ERR(6, 129, __pyx_L1_error)
27274   __pyx_ptype_2yt_8geometry_12oct_visitors_LoadOctree = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "LoadOctree", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_LoadOctree), __Pyx_ImportType_CheckSize_Warn);
27275    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_LoadOctree) __PYX_ERR(6, 132, __pyx_L1_error)
27276   __pyx_vtabptr_2yt_8geometry_12oct_visitors_LoadOctree = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_LoadOctree*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_LoadOctree->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_LoadOctree)) __PYX_ERR(6, 132, __pyx_L1_error)
27277   __pyx_ptype_2yt_8geometry_12oct_visitors_MortonIndexOcts = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "MortonIndexOcts", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_MortonIndexOcts), __Pyx_ImportType_CheckSize_Warn);
27278    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_MortonIndexOcts) __PYX_ERR(6, 138, __pyx_L1_error)
27279   __pyx_vtabptr_2yt_8geometry_12oct_visitors_MortonIndexOcts = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_MortonIndexOcts*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_MortonIndexOcts->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_MortonIndexOcts)) __PYX_ERR(6, 138, __pyx_L1_error)
27280   __pyx_ptype_2yt_8geometry_12oct_visitors_StoreIndex = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "StoreIndex", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_StoreIndex), __Pyx_ImportType_CheckSize_Warn);
27281    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_StoreIndex) __PYX_ERR(6, 149, __pyx_L1_error)
27282   __pyx_vtabptr_2yt_8geometry_12oct_visitors_StoreIndex = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_StoreIndex*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_StoreIndex->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_StoreIndex)) __PYX_ERR(6, 149, __pyx_L1_error)
27283   __pyx_ptype_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "BaseNeighbourVisitor", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor), __Pyx_ImportType_CheckSize_Warn);
27284    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor) __PYX_ERR(6, 153, __pyx_L1_error)
27285   __pyx_vtabptr_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor)) __PYX_ERR(6, 153, __pyx_L1_error)
27286   __pyx_ptype_2yt_8geometry_12oct_visitors_NeighbourCellIndexVisitor = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "NeighbourCellIndexVisitor", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_NeighbourCellIndexVisitor), __Pyx_ImportType_CheckSize_Warn);
27287    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_NeighbourCellIndexVisitor) __PYX_ERR(6, 169, __pyx_L1_error)
27288   __pyx_vtabptr_2yt_8geometry_12oct_visitors_NeighbourCellIndexVisitor = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_NeighbourCellIndexVisitor*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_NeighbourCellIndexVisitor->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_NeighbourCellIndexVisitor)) __PYX_ERR(6, 169, __pyx_L1_error)
27289   __pyx_ptype_2yt_8geometry_12oct_visitors_NeighbourCellVisitor = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_visitors", "NeighbourCellVisitor", sizeof(struct __pyx_obj_2yt_8geometry_12oct_visitors_NeighbourCellVisitor), __Pyx_ImportType_CheckSize_Warn);
27290    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_NeighbourCellVisitor) __PYX_ERR(6, 173, __pyx_L1_error)
27291   __pyx_vtabptr_2yt_8geometry_12oct_visitors_NeighbourCellVisitor = (struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_NeighbourCellVisitor*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_12oct_visitors_NeighbourCellVisitor->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_12oct_visitors_NeighbourCellVisitor)) __PYX_ERR(6, 173, __pyx_L1_error)
27292   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27293   __pyx_t_1 = PyImport_ImportModule("yt.geometry.selection_routines"); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 24, __pyx_L1_error)
27294   __Pyx_GOTREF(__pyx_t_1);
27295   __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject = __Pyx_ImportType(__pyx_t_1, "yt.geometry.selection_routines", "SelectorObject", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject), __Pyx_ImportType_CheckSize_Warn);
27296    if (!__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject) __PYX_ERR(7, 24, __pyx_L1_error)
27297   __pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject)) __PYX_ERR(7, 24, __pyx_L1_error)
27298   __pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector = __Pyx_ImportType(__pyx_t_1, "yt.geometry.selection_routines", "AlwaysSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector), __Pyx_ImportType_CheckSize_Warn);
27299    if (!__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector) __PYX_ERR(7, 70, __pyx_L1_error)
27300   __pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_AlwaysSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector)) __PYX_ERR(7, 70, __pyx_L1_error)
27301   __pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector = __Pyx_ImportType(__pyx_t_1, "yt.geometry.selection_routines", "OctreeSubsetSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector), __Pyx_ImportType_CheckSize_Warn);
27302    if (!__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector) __PYX_ERR(7, 73, __pyx_L1_error)
27303   __pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_OctreeSubsetSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector)) __PYX_ERR(7, 73, __pyx_L1_error)
27304   __pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector = __Pyx_ImportType(__pyx_t_1, "yt.geometry.selection_routines", "BooleanSelector", sizeof(struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector), __Pyx_ImportType_CheckSize_Warn);
27305    if (!__pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector) __PYX_ERR(7, 77, __pyx_L1_error)
27306   __pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanSelector = (struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanSelector*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanSelector)) __PYX_ERR(7, 77, __pyx_L1_error)
27307   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27308   __pyx_t_1 = PyImport_ImportModule("yt.utilities.lib.allocation_container"); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 20, __pyx_L1_error)
27309   __Pyx_GOTREF(__pyx_t_1);
27310   __pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool = __Pyx_ImportType(__pyx_t_1, "yt.utilities.lib.allocation_container", "ObjectPool", sizeof(struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool), __Pyx_ImportType_CheckSize_Warn);
27311    if (!__pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool) __PYX_ERR(8, 20, __pyx_L1_error)
27312   __pyx_vtabptr_2yt_9utilities_3lib_20allocation_container_ObjectPool = (struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_20allocation_container_ObjectPool)) __PYX_ERR(8, 20, __pyx_L1_error)
27313   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27314   __pyx_t_1 = PyImport_ImportModule("yt.geometry.oct_container"); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 47, __pyx_L1_error)
27315   __Pyx_GOTREF(__pyx_t_1);
27316   __pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_container", "OctObjectPool", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool), __Pyx_ImportType_CheckSize_Warn);
27317    if (!__pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool) __PYX_ERR(9, 47, __pyx_L1_error)
27318   __pyx_vtabptr_2yt_8geometry_13oct_container_OctObjectPool = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctObjectPool*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_OctObjectPool)) __PYX_ERR(9, 47, __pyx_L1_error)
27319   __pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_container", "OctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer), __Pyx_ImportType_CheckSize_Warn);
27320    if (!__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer) __PYX_ERR(9, 55, __pyx_L1_error)
27321   __pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer)) __PYX_ERR(9, 55, __pyx_L1_error)
27322   __pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_container", "SparseOctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer), __Pyx_ImportType_CheckSize_Warn);
27323    if (!__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer) __PYX_ERR(9, 85, __pyx_L1_error)
27324   __pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer)) __PYX_ERR(9, 85, __pyx_L1_error)
27325   __pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer = __Pyx_ImportType(__pyx_t_1, "yt.geometry.oct_container", "RAMSESOctreeContainer", sizeof(struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer), __Pyx_ImportType_CheckSize_Warn);
27326    if (!__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer) __PYX_ERR(9, 93, __pyx_L1_error)
27327   __pyx_vtabptr_2yt_8geometry_13oct_container_RAMSESOctreeContainer = (struct __pyx_vtabstruct_2yt_8geometry_13oct_container_RAMSESOctreeContainer*)__Pyx_GetVtable(__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_8geometry_13oct_container_RAMSESOctreeContainer)) __PYX_ERR(9, 93, __pyx_L1_error)
27328   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27329   __pyx_t_1 = PyImport_ImportModule("yt.utilities.cython_fortran_utils"); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 8, __pyx_L1_error)
27330   __Pyx_GOTREF(__pyx_t_1);
27331   __pyx_ptype_2yt_9utilities_20cython_fortran_utils_FortranFile = __Pyx_ImportType(__pyx_t_1, "yt.utilities.cython_fortran_utils", "FortranFile", sizeof(struct __pyx_obj_2yt_9utilities_20cython_fortran_utils_FortranFile), __Pyx_ImportType_CheckSize_Warn);
27332    if (!__pyx_ptype_2yt_9utilities_20cython_fortran_utils_FortranFile) __PYX_ERR(10, 8, __pyx_L1_error)
27333   __pyx_vtabptr_2yt_9utilities_20cython_fortran_utils_FortranFile = (struct __pyx_vtabstruct_2yt_9utilities_20cython_fortran_utils_FortranFile*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_20cython_fortran_utils_FortranFile->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_20cython_fortran_utils_FortranFile)) __PYX_ERR(10, 8, __pyx_L1_error)
27334   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27335   __Pyx_RefNannyFinishContext();
27336   return 0;
27337   __pyx_L1_error:;
27338   __Pyx_XDECREF(__pyx_t_1);
27339   __Pyx_RefNannyFinishContext();
27340   return -1;
27341 }
27342 
__Pyx_modinit_variable_import_code(void)27343 static int __Pyx_modinit_variable_import_code(void) {
27344   __Pyx_RefNannyDeclarations
27345   PyObject *__pyx_t_1 = NULL;
27346   __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
27347   /*--- Variable import code ---*/
27348   __pyx_t_1 = PyImport_ImportModule("yt.geometry.oct_container"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
27349   if (__Pyx_ImportVoidPtr(__pyx_t_1, "ORDER_MAX", (void **)&__pyx_vp_2yt_8geometry_13oct_container_ORDER_MAX, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27350   Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27351   __Pyx_RefNannyFinishContext();
27352   return 0;
27353   __pyx_L1_error:;
27354   __Pyx_XDECREF(__pyx_t_1);
27355   __Pyx_RefNannyFinishContext();
27356   return -1;
27357 }
27358 
__Pyx_modinit_function_import_code(void)27359 static int __Pyx_modinit_function_import_code(void) {
27360   __Pyx_RefNannyDeclarations
27361   PyObject *__pyx_t_1 = NULL;
27362   __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
27363   /*--- Function import code ---*/
27364   __pyx_t_1 = PyImport_ImportModule("yt.geometry.grid_visitors"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
27365   if (__Pyx_ImportFunction(__pyx_t_1, "check_child_masked", (void (**)(void))&__pyx_f_2yt_8geometry_13grid_visitors_check_child_masked, "__pyx_t_5numpy_uint8_t (struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27366   Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27367   __Pyx_RefNannyFinishContext();
27368   return 0;
27369   __pyx_L1_error:;
27370   __Pyx_XDECREF(__pyx_t_1);
27371   __Pyx_RefNannyFinishContext();
27372   return -1;
27373 }
27374 
27375 
27376 #if PY_MAJOR_VERSION < 3
27377 #ifdef CYTHON_NO_PYINIT_EXPORT
27378 #define __Pyx_PyMODINIT_FUNC void
27379 #else
27380 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
27381 #endif
27382 #else
27383 #ifdef CYTHON_NO_PYINIT_EXPORT
27384 #define __Pyx_PyMODINIT_FUNC PyObject *
27385 #else
27386 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
27387 #endif
27388 #endif
27389 
27390 
27391 #if PY_MAJOR_VERSION < 3
27392 __Pyx_PyMODINIT_FUNC initio_utils(void) CYTHON_SMALL_CODE; /*proto*/
initio_utils(void)27393 __Pyx_PyMODINIT_FUNC initio_utils(void)
27394 #else
27395 __Pyx_PyMODINIT_FUNC PyInit_io_utils(void) CYTHON_SMALL_CODE; /*proto*/
27396 __Pyx_PyMODINIT_FUNC PyInit_io_utils(void)
27397 #if CYTHON_PEP489_MULTI_PHASE_INIT
27398 {
27399   return PyModuleDef_Init(&__pyx_moduledef);
27400 }
27401 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
27402     #if PY_VERSION_HEX >= 0x030700A1
27403     static PY_INT64_T main_interpreter_id = -1;
27404     PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
27405     if (main_interpreter_id == -1) {
27406         main_interpreter_id = current_id;
27407         return (unlikely(current_id == -1)) ? -1 : 0;
27408     } else if (unlikely(main_interpreter_id != current_id))
27409     #else
27410     static PyInterpreterState *main_interpreter = NULL;
27411     PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
27412     if (!main_interpreter) {
27413         main_interpreter = current_interpreter;
27414     } else if (unlikely(main_interpreter != current_interpreter))
27415     #endif
27416     {
27417         PyErr_SetString(
27418             PyExc_ImportError,
27419             "Interpreter change detected - this module can only be loaded into one interpreter per process.");
27420         return -1;
27421     }
27422     return 0;
27423 }
27424 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) {
27425     PyObject *value = PyObject_GetAttrString(spec, from_name);
27426     int result = 0;
27427     if (likely(value)) {
27428         if (allow_none || value != Py_None) {
27429             result = PyDict_SetItemString(moddict, to_name, value);
27430         }
27431         Py_DECREF(value);
27432     } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
27433         PyErr_Clear();
27434     } else {
27435         result = -1;
27436     }
27437     return result;
27438 }
27439 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
27440     PyObject *module = NULL, *moddict, *modname;
27441     if (__Pyx_check_single_interpreter())
27442         return NULL;
27443     if (__pyx_m)
27444         return __Pyx_NewRef(__pyx_m);
27445     modname = PyObject_GetAttrString(spec, "name");
27446     if (unlikely(!modname)) goto bad;
27447     module = PyModule_NewObject(modname);
27448     Py_DECREF(modname);
27449     if (unlikely(!module)) goto bad;
27450     moddict = PyModule_GetDict(module);
27451     if (unlikely(!moddict)) goto bad;
27452     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
27453     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
27454     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
27455     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
27456     return module;
27457 bad:
27458     Py_XDECREF(module);
27459     return NULL;
27460 }
27461 
27462 
27463 static CYTHON_SMALL_CODE int __pyx_pymod_exec_io_utils(PyObject *__pyx_pyinit_module)
27464 #endif
27465 #endif
27466 {
27467   PyObject *__pyx_t_1 = NULL;
27468   PyObject *__pyx_t_2 = NULL;
27469   PyObject *__pyx_t_3 = NULL;
27470   PyObject *__pyx_t_4 = NULL;
27471   static PyThread_type_lock __pyx_t_5[8];
27472   __Pyx_RefNannyDeclarations
27473   #if CYTHON_PEP489_MULTI_PHASE_INIT
27474   if (__pyx_m) {
27475     if (__pyx_m == __pyx_pyinit_module) return 0;
27476     PyErr_SetString(PyExc_RuntimeError, "Module 'io_utils' has already been imported. Re-initialisation is not supported.");
27477     return -1;
27478   }
27479   #elif PY_MAJOR_VERSION >= 3
27480   if (__pyx_m) return __Pyx_NewRef(__pyx_m);
27481   #endif
27482   #if CYTHON_REFNANNY
27483 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
27484 if (!__Pyx_RefNanny) {
27485   PyErr_Clear();
27486   __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
27487   if (!__Pyx_RefNanny)
27488       Py_FatalError("failed to import 'refnanny' module");
27489 }
27490 #endif
27491   __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_io_utils(void)", 0);
27492   if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27493   #ifdef __Pxy_PyFrame_Initialize_Offsets
27494   __Pxy_PyFrame_Initialize_Offsets();
27495   #endif
27496   __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
27497   __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
27498   __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
27499   #ifdef __Pyx_CyFunction_USED
27500   if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27501   #endif
27502   #ifdef __Pyx_FusedFunction_USED
27503   if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27504   #endif
27505   #ifdef __Pyx_Coroutine_USED
27506   if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27507   #endif
27508   #ifdef __Pyx_Generator_USED
27509   if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27510   #endif
27511   #ifdef __Pyx_AsyncGen_USED
27512   if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27513   #endif
27514   #ifdef __Pyx_StopAsyncIteration_USED
27515   if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27516   #endif
27517   /*--- Library function declarations ---*/
27518   /*--- Threads initialization code ---*/
27519   #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
27520   #ifdef WITH_THREAD /* Python build with threading support? */
27521   PyEval_InitThreads();
27522   #endif
27523   #endif
27524   /*--- Module creation code ---*/
27525   #if CYTHON_PEP489_MULTI_PHASE_INIT
27526   __pyx_m = __pyx_pyinit_module;
27527   Py_INCREF(__pyx_m);
27528   #else
27529   #if PY_MAJOR_VERSION < 3
27530   __pyx_m = Py_InitModule4("io_utils", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
27531   #else
27532   __pyx_m = PyModule_Create(&__pyx_moduledef);
27533   #endif
27534   if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
27535   #endif
27536   __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
27537   Py_INCREF(__pyx_d);
27538   __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
27539   Py_INCREF(__pyx_b);
27540   __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
27541   Py_INCREF(__pyx_cython_runtime);
27542   if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
27543   /*--- Initialize various global constants etc. ---*/
27544   if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27545   #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
27546   if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27547   #endif
27548   if (__pyx_module_is_main_yt__frontends__ramses__io_utils) {
27549     if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27550   }
27551   #if PY_MAJOR_VERSION >= 3
27552   {
27553     PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
27554     if (!PyDict_GetItemString(modules, "yt.frontends.ramses.io_utils")) {
27555       if (unlikely(PyDict_SetItemString(modules, "yt.frontends.ramses.io_utils", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
27556     }
27557   }
27558   #endif
27559   /*--- Builtin init code ---*/
27560   if (__Pyx_InitCachedBuiltins() < 0) goto __pyx_L1_error;
27561   /*--- Constants init code ---*/
27562   if (__Pyx_InitCachedConstants() < 0) goto __pyx_L1_error;
27563   /*--- Global type/function init code ---*/
27564   (void)__Pyx_modinit_global_init_code();
27565   (void)__Pyx_modinit_variable_export_code();
27566   (void)__Pyx_modinit_function_export_code();
27567   if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error;
27568   if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error;
27569   if (unlikely(__Pyx_modinit_variable_import_code() != 0)) goto __pyx_L1_error;
27570   if (unlikely(__Pyx_modinit_function_import_code() != 0)) goto __pyx_L1_error;
27571   /*--- Execution code ---*/
27572   #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
27573   if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27574   #endif
27575 
27576   /* "yt/frontends/ramses/io_utils.pyx":6
27577  * cimport numpy as np
27578  *
27579  * import numpy as np             # <<<<<<<<<<<<<<
27580  *
27581  * from yt.geometry.oct_container cimport RAMSESOctreeContainer
27582  */
27583   __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error)
27584   __Pyx_GOTREF(__pyx_t_1);
27585   if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 6, __pyx_L1_error)
27586   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27587 
27588   /* "yt/frontends/ramses/io_utils.pyx":11
27589  * from yt.utilities.cython_fortran_utils cimport FortranFile
27590  *
27591  * from yt.utilities.exceptions import YTIllDefinedAMRData             # <<<<<<<<<<<<<<
27592  *
27593  * ctypedef np.int32_t INT32_t
27594  */
27595   __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
27596   __Pyx_GOTREF(__pyx_t_1);
27597   __Pyx_INCREF(__pyx_n_s_YTIllDefinedAMRData);
27598   __Pyx_GIVEREF(__pyx_n_s_YTIllDefinedAMRData);
27599   PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_YTIllDefinedAMRData);
27600   __pyx_t_2 = __Pyx_Import(__pyx_n_s_yt_utilities_exceptions, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error)
27601   __Pyx_GOTREF(__pyx_t_2);
27602   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27603   __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_YTIllDefinedAMRData); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
27604   __Pyx_GOTREF(__pyx_t_1);
27605   if (PyDict_SetItem(__pyx_d, __pyx_n_s_YTIllDefinedAMRData, __pyx_t_1) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
27606   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27607   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27608 
27609   /* "yt/frontends/ramses/io_utils.pyx":21
27610  * @cython.cdivision(True)
27611  * @cython.nonecheck(False)
27612  * def read_amr(FortranFile f, dict headers,             # <<<<<<<<<<<<<<
27613  *              np.ndarray[np.int64_t, ndim=1] ngridbound, INT64_t min_level,
27614  *              RAMSESOctreeContainer oct_handler):
27615  */
27616   __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_2yt_9frontends_6ramses_8io_utils_1read_amr, NULL, __pyx_n_s_yt_frontends_ramses_io_utils); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error)
27617   __Pyx_GOTREF(__pyx_t_2);
27618   if (PyDict_SetItem(__pyx_d, __pyx_n_s_read_amr, __pyx_t_2) < 0) __PYX_ERR(0, 21, __pyx_L1_error)
27619   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27620 
27621   /* "yt/frontends/ramses/io_utils.pyx":149
27622  *                dict tr,
27623  *                RAMSESOctreeContainer oct_handler,
27624  *                np.ndarray[np.int32_t, ndim=1] domains=np.array([], dtype='int32')):             # <<<<<<<<<<<<<<
27625  *     cdef INT64_t offset
27626  *     cdef dict tmp
27627  */
27628   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error)
27629   __Pyx_GOTREF(__pyx_t_2);
27630   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error)
27631   __Pyx_GOTREF(__pyx_t_1);
27632   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27633   __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error)
27634   __Pyx_GOTREF(__pyx_t_2);
27635   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 149, __pyx_L1_error)
27636   __Pyx_GOTREF(__pyx_t_3);
27637   __Pyx_GIVEREF(__pyx_t_2);
27638   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
27639   __pyx_t_2 = 0;
27640   __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error)
27641   __Pyx_GOTREF(__pyx_t_2);
27642   if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_int32) < 0) __PYX_ERR(0, 149, __pyx_L1_error)
27643   __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L1_error)
27644   __Pyx_GOTREF(__pyx_t_4);
27645   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27646   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27647   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27648   if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 149, __pyx_L1_error)
27649   __pyx_k__4 = ((PyArrayObject *)__pyx_t_4);
27650   __Pyx_GIVEREF(__pyx_t_4);
27651   __pyx_t_4 = 0;
27652 
27653   /* "yt/frontends/ramses/io_utils.pyx":139
27654  * @cython.cdivision(True)
27655  * @cython.nonecheck(False)
27656  * def fill_hydro(FortranFile f,             # <<<<<<<<<<<<<<
27657  *                np.ndarray[np.int64_t, ndim=2] offsets,
27658  *                np.ndarray[np.int64_t, ndim=2] level_count,
27659  */
27660   __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_2yt_9frontends_6ramses_8io_utils_5fill_hydro, NULL, __pyx_n_s_yt_frontends_ramses_io_utils); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L1_error)
27661   __Pyx_GOTREF(__pyx_t_4);
27662   if (PyDict_SetItem(__pyx_d, __pyx_n_s_fill_hydro, __pyx_t_4) < 0) __PYX_ERR(0, 139, __pyx_L1_error)
27663   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27664 
27665   /* "yt/frontends/ramses/io_utils.pyx":1
27666  * # distutils: libraries = STD_LIBS             # <<<<<<<<<<<<<<
27667  * # distutils: include_dirs = LIB_DIR
27668  * cimport cython
27669  */
27670   __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error)
27671   __Pyx_GOTREF(__pyx_t_4);
27672   if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27673   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27674 
27675   /* "View.MemoryView":209
27676  *         info.obj = self
27677  *
27678  *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")             # <<<<<<<<<<<<<<
27679  *
27680  *     def __dealloc__(array self):
27681  */
27682   __pyx_t_4 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 209, __pyx_L1_error)
27683   __Pyx_GOTREF(__pyx_t_4);
27684   if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_4) < 0) __PYX_ERR(4, 209, __pyx_L1_error)
27685   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27686   PyType_Modified(__pyx_array_type);
27687 
27688   /* "View.MemoryView":286
27689  *         return self.name
27690  *
27691  * cdef generic = Enum("<strided and direct or indirect>")             # <<<<<<<<<<<<<<
27692  * cdef strided = Enum("<strided and direct>") # default
27693  * cdef indirect = Enum("<strided and indirect>")
27694  */
27695   __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 286, __pyx_L1_error)
27696   __Pyx_GOTREF(__pyx_t_4);
27697   __Pyx_XGOTREF(generic);
27698   __Pyx_DECREF_SET(generic, __pyx_t_4);
27699   __Pyx_GIVEREF(__pyx_t_4);
27700   __pyx_t_4 = 0;
27701 
27702   /* "View.MemoryView":287
27703  *
27704  * cdef generic = Enum("<strided and direct or indirect>")
27705  * cdef strided = Enum("<strided and direct>") # default             # <<<<<<<<<<<<<<
27706  * cdef indirect = Enum("<strided and indirect>")
27707  *
27708  */
27709   __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 287, __pyx_L1_error)
27710   __Pyx_GOTREF(__pyx_t_4);
27711   __Pyx_XGOTREF(strided);
27712   __Pyx_DECREF_SET(strided, __pyx_t_4);
27713   __Pyx_GIVEREF(__pyx_t_4);
27714   __pyx_t_4 = 0;
27715 
27716   /* "View.MemoryView":288
27717  * cdef generic = Enum("<strided and direct or indirect>")
27718  * cdef strided = Enum("<strided and direct>") # default
27719  * cdef indirect = Enum("<strided and indirect>")             # <<<<<<<<<<<<<<
27720  *
27721  *
27722  */
27723   __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 288, __pyx_L1_error)
27724   __Pyx_GOTREF(__pyx_t_4);
27725   __Pyx_XGOTREF(indirect);
27726   __Pyx_DECREF_SET(indirect, __pyx_t_4);
27727   __Pyx_GIVEREF(__pyx_t_4);
27728   __pyx_t_4 = 0;
27729 
27730   /* "View.MemoryView":291
27731  *
27732  *
27733  * cdef contiguous = Enum("<contiguous and direct>")             # <<<<<<<<<<<<<<
27734  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
27735  *
27736  */
27737   __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 291, __pyx_L1_error)
27738   __Pyx_GOTREF(__pyx_t_4);
27739   __Pyx_XGOTREF(contiguous);
27740   __Pyx_DECREF_SET(contiguous, __pyx_t_4);
27741   __Pyx_GIVEREF(__pyx_t_4);
27742   __pyx_t_4 = 0;
27743 
27744   /* "View.MemoryView":292
27745  *
27746  * cdef contiguous = Enum("<contiguous and direct>")
27747  * cdef indirect_contiguous = Enum("<contiguous and indirect>")             # <<<<<<<<<<<<<<
27748  *
27749  *
27750  */
27751   __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 292, __pyx_L1_error)
27752   __Pyx_GOTREF(__pyx_t_4);
27753   __Pyx_XGOTREF(indirect_contiguous);
27754   __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_4);
27755   __Pyx_GIVEREF(__pyx_t_4);
27756   __pyx_t_4 = 0;
27757 
27758   /* "View.MemoryView":316
27759  *
27760  * DEF THREAD_LOCKS_PREALLOCATED = 8
27761  * cdef int __pyx_memoryview_thread_locks_used = 0             # <<<<<<<<<<<<<<
27762  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
27763  *     PyThread_allocate_lock(),
27764  */
27765   __pyx_memoryview_thread_locks_used = 0;
27766 
27767   /* "View.MemoryView":317
27768  * DEF THREAD_LOCKS_PREALLOCATED = 8
27769  * cdef int __pyx_memoryview_thread_locks_used = 0
27770  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [             # <<<<<<<<<<<<<<
27771  *     PyThread_allocate_lock(),
27772  *     PyThread_allocate_lock(),
27773  */
27774   __pyx_t_5[0] = PyThread_allocate_lock();
27775   __pyx_t_5[1] = PyThread_allocate_lock();
27776   __pyx_t_5[2] = PyThread_allocate_lock();
27777   __pyx_t_5[3] = PyThread_allocate_lock();
27778   __pyx_t_5[4] = PyThread_allocate_lock();
27779   __pyx_t_5[5] = PyThread_allocate_lock();
27780   __pyx_t_5[6] = PyThread_allocate_lock();
27781   __pyx_t_5[7] = PyThread_allocate_lock();
27782   memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_5, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
27783 
27784   /* "View.MemoryView":545
27785  *         info.obj = self
27786  *
27787  *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")             # <<<<<<<<<<<<<<
27788  *
27789  *
27790  */
27791   __pyx_t_4 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 545, __pyx_L1_error)
27792   __Pyx_GOTREF(__pyx_t_4);
27793   if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_4) < 0) __PYX_ERR(4, 545, __pyx_L1_error)
27794   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27795   PyType_Modified(__pyx_memoryview_type);
27796 
27797   /* "View.MemoryView":991
27798  *         return self.from_object
27799  *
27800  *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")             # <<<<<<<<<<<<<<
27801  *
27802  *
27803  */
27804   __pyx_t_4 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 991, __pyx_L1_error)
27805   __Pyx_GOTREF(__pyx_t_4);
27806   if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_4) < 0) __PYX_ERR(4, 991, __pyx_L1_error)
27807   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27808   PyType_Modified(__pyx_memoryviewslice_type);
27809 
27810   /* "(tree fragment)":1
27811  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
27812  *     cdef object __pyx_PickleError
27813  *     cdef object __pyx_result
27814  */
27815   __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1, __pyx_L1_error)
27816   __Pyx_GOTREF(__pyx_t_4);
27817   if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_4) < 0) __PYX_ERR(4, 1, __pyx_L1_error)
27818   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27819 
27820   /* "(tree fragment)":11
27821  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
27822  *     return __pyx_result
27823  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
27824  *     __pyx_result.name = __pyx_state[0]
27825  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
27826  */
27827 
27828   /*--- Wrapped vars code ---*/
27829 
27830   goto __pyx_L0;
27831   __pyx_L1_error:;
27832   __Pyx_XDECREF(__pyx_t_1);
27833   __Pyx_XDECREF(__pyx_t_2);
27834   __Pyx_XDECREF(__pyx_t_3);
27835   __Pyx_XDECREF(__pyx_t_4);
27836   if (__pyx_m) {
27837     if (__pyx_d) {
27838       __Pyx_AddTraceback("init yt.frontends.ramses.io_utils", __pyx_clineno, __pyx_lineno, __pyx_filename);
27839     }
27840     Py_CLEAR(__pyx_m);
27841   } else if (!PyErr_Occurred()) {
27842     PyErr_SetString(PyExc_ImportError, "init yt.frontends.ramses.io_utils");
27843   }
27844   __pyx_L0:;
27845   __Pyx_RefNannyFinishContext();
27846   #if CYTHON_PEP489_MULTI_PHASE_INIT
27847   return (__pyx_m != NULL) ? 0 : -1;
27848   #elif PY_MAJOR_VERSION >= 3
27849   return __pyx_m;
27850   #else
27851   return;
27852   #endif
27853 }
27854 
27855 /* --- Runtime support code --- */
27856 /* Refnanny */
27857 #if CYTHON_REFNANNY
__Pyx_RefNannyImportAPI(const char * modname)27858 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
27859     PyObject *m = NULL, *p = NULL;
27860     void *r = NULL;
27861     m = PyImport_ImportModule(modname);
27862     if (!m) goto end;
27863     p = PyObject_GetAttrString(m, "RefNannyAPI");
27864     if (!p) goto end;
27865     r = PyLong_AsVoidPtr(p);
27866 end:
27867     Py_XDECREF(p);
27868     Py_XDECREF(m);
27869     return (__Pyx_RefNannyAPIStruct *)r;
27870 }
27871 #endif
27872 
27873 /* PyObjectGetAttrStr */
27874 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetAttrStr(PyObject * obj,PyObject * attr_name)27875 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
27876     PyTypeObject* tp = Py_TYPE(obj);
27877     if (likely(tp->tp_getattro))
27878         return tp->tp_getattro(obj, attr_name);
27879 #if PY_MAJOR_VERSION < 3
27880     if (likely(tp->tp_getattr))
27881         return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
27882 #endif
27883     return PyObject_GetAttr(obj, attr_name);
27884 }
27885 #endif
27886 
27887 /* GetBuiltinName */
__Pyx_GetBuiltinName(PyObject * name)27888 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
27889     PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
27890     if (unlikely(!result)) {
27891         PyErr_Format(PyExc_NameError,
27892 #if PY_MAJOR_VERSION >= 3
27893             "name '%U' is not defined", name);
27894 #else
27895             "name '%.200s' is not defined", PyString_AS_STRING(name));
27896 #endif
27897     }
27898     return result;
27899 }
27900 
27901 /* RaiseArgTupleInvalid */
__Pyx_RaiseArgtupleInvalid(const char * func_name,int exact,Py_ssize_t num_min,Py_ssize_t num_max,Py_ssize_t num_found)27902 static void __Pyx_RaiseArgtupleInvalid(
27903     const char* func_name,
27904     int exact,
27905     Py_ssize_t num_min,
27906     Py_ssize_t num_max,
27907     Py_ssize_t num_found)
27908 {
27909     Py_ssize_t num_expected;
27910     const char *more_or_less;
27911     if (num_found < num_min) {
27912         num_expected = num_min;
27913         more_or_less = "at least";
27914     } else {
27915         num_expected = num_max;
27916         more_or_less = "at most";
27917     }
27918     if (exact) {
27919         more_or_less = "exactly";
27920     }
27921     PyErr_Format(PyExc_TypeError,
27922                  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
27923                  func_name, more_or_less, num_expected,
27924                  (num_expected == 1) ? "" : "s", num_found);
27925 }
27926 
27927 /* RaiseDoubleKeywords */
__Pyx_RaiseDoubleKeywordsError(const char * func_name,PyObject * kw_name)27928 static void __Pyx_RaiseDoubleKeywordsError(
27929     const char* func_name,
27930     PyObject* kw_name)
27931 {
27932     PyErr_Format(PyExc_TypeError,
27933         #if PY_MAJOR_VERSION >= 3
27934         "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
27935         #else
27936         "%s() got multiple values for keyword argument '%s'", func_name,
27937         PyString_AsString(kw_name));
27938         #endif
27939 }
27940 
27941 /* ParseKeywords */
__Pyx_ParseOptionalKeywords(PyObject * kwds,PyObject ** argnames[],PyObject * kwds2,PyObject * values[],Py_ssize_t num_pos_args,const char * function_name)27942 static int __Pyx_ParseOptionalKeywords(
27943     PyObject *kwds,
27944     PyObject **argnames[],
27945     PyObject *kwds2,
27946     PyObject *values[],
27947     Py_ssize_t num_pos_args,
27948     const char* function_name)
27949 {
27950     PyObject *key = 0, *value = 0;
27951     Py_ssize_t pos = 0;
27952     PyObject*** name;
27953     PyObject*** first_kw_arg = argnames + num_pos_args;
27954     while (PyDict_Next(kwds, &pos, &key, &value)) {
27955         name = first_kw_arg;
27956         while (*name && (**name != key)) name++;
27957         if (*name) {
27958             values[name-argnames] = value;
27959             continue;
27960         }
27961         name = first_kw_arg;
27962         #if PY_MAJOR_VERSION < 3
27963         if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
27964             while (*name) {
27965                 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
27966                         && _PyString_Eq(**name, key)) {
27967                     values[name-argnames] = value;
27968                     break;
27969                 }
27970                 name++;
27971             }
27972             if (*name) continue;
27973             else {
27974                 PyObject*** argname = argnames;
27975                 while (argname != first_kw_arg) {
27976                     if ((**argname == key) || (
27977                             (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
27978                              && _PyString_Eq(**argname, key))) {
27979                         goto arg_passed_twice;
27980                     }
27981                     argname++;
27982                 }
27983             }
27984         } else
27985         #endif
27986         if (likely(PyUnicode_Check(key))) {
27987             while (*name) {
27988                 int cmp = (**name == key) ? 0 :
27989                 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
27990                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
27991                 #endif
27992                     PyUnicode_Compare(**name, key);
27993                 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
27994                 if (cmp == 0) {
27995                     values[name-argnames] = value;
27996                     break;
27997                 }
27998                 name++;
27999             }
28000             if (*name) continue;
28001             else {
28002                 PyObject*** argname = argnames;
28003                 while (argname != first_kw_arg) {
28004                     int cmp = (**argname == key) ? 0 :
28005                     #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
28006                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
28007                     #endif
28008                         PyUnicode_Compare(**argname, key);
28009                     if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
28010                     if (cmp == 0) goto arg_passed_twice;
28011                     argname++;
28012                 }
28013             }
28014         } else
28015             goto invalid_keyword_type;
28016         if (kwds2) {
28017             if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
28018         } else {
28019             goto invalid_keyword;
28020         }
28021     }
28022     return 0;
28023 arg_passed_twice:
28024     __Pyx_RaiseDoubleKeywordsError(function_name, key);
28025     goto bad;
28026 invalid_keyword_type:
28027     PyErr_Format(PyExc_TypeError,
28028         "%.200s() keywords must be strings", function_name);
28029     goto bad;
28030 invalid_keyword:
28031     PyErr_Format(PyExc_TypeError,
28032     #if PY_MAJOR_VERSION < 3
28033         "%.200s() got an unexpected keyword argument '%.200s'",
28034         function_name, PyString_AsString(key));
28035     #else
28036         "%s() got an unexpected keyword argument '%U'",
28037         function_name, key);
28038     #endif
28039 bad:
28040     return -1;
28041 }
28042 
28043 /* ArgTypeTest */
__Pyx__ArgTypeTest(PyObject * obj,PyTypeObject * type,const char * name,int exact)28044 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
28045 {
28046     if (unlikely(!type)) {
28047         PyErr_SetString(PyExc_SystemError, "Missing type object");
28048         return 0;
28049     }
28050     else if (exact) {
28051         #if PY_MAJOR_VERSION == 2
28052         if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
28053         #endif
28054     }
28055     else {
28056         if (likely(__Pyx_TypeCheck(obj, type))) return 1;
28057     }
28058     PyErr_Format(PyExc_TypeError,
28059         "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
28060         name, type->tp_name, Py_TYPE(obj)->tp_name);
28061     return 0;
28062 }
28063 
28064 /* None */
__Pyx_RaiseClosureNameError(const char * varname)28065 static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
28066     PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
28067 }
28068 
28069 /* DictGetItem */
28070 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
__Pyx_PyDict_GetItem(PyObject * d,PyObject * key)28071 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
28072     PyObject *value;
28073     value = PyDict_GetItemWithError(d, key);
28074     if (unlikely(!value)) {
28075         if (!PyErr_Occurred()) {
28076             if (unlikely(PyTuple_Check(key))) {
28077                 PyObject* args = PyTuple_Pack(1, key);
28078                 if (likely(args)) {
28079                     PyErr_SetObject(PyExc_KeyError, args);
28080                     Py_DECREF(args);
28081                 }
28082             } else {
28083                 PyErr_SetObject(PyExc_KeyError, key);
28084             }
28085         }
28086         return NULL;
28087     }
28088     Py_INCREF(value);
28089     return value;
28090 }
28091 #endif
28092 
28093 /* PyFloatBinop */
28094 #if !CYTHON_COMPILING_IN_PYPY
__Pyx_PyFloat_DivideObjC(PyObject * op1,PyObject * op2,double floatval,int inplace,int zerodivision_check)28095 static PyObject* __Pyx_PyFloat_DivideObjC(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check) {
28096     const double b = floatval;
28097     double a, result;
28098     (void)inplace;
28099     (void)zerodivision_check;
28100     if (likely(PyFloat_CheckExact(op1))) {
28101         a = PyFloat_AS_DOUBLE(op1);
28102 
28103     } else
28104     #if PY_MAJOR_VERSION < 3
28105     if (likely(PyInt_CheckExact(op1))) {
28106         a = (double) PyInt_AS_LONG(op1);
28107 
28108     } else
28109     #endif
28110     if (likely(PyLong_CheckExact(op1))) {
28111         #if CYTHON_USE_PYLONG_INTERNALS
28112         const digit* digits = ((PyLongObject*)op1)->ob_digit;
28113         const Py_ssize_t size = Py_SIZE(op1);
28114         switch (size) {
28115             case  0: a = 0.0; break;
28116             case -1: a = -(double) digits[0]; break;
28117             case  1: a = (double) digits[0]; break;
28118             case -2:
28119             case 2:
28120                 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
28121                     a = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
28122                     if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
28123                         if (size == -2)
28124                             a = -a;
28125                         break;
28126                     }
28127                 }
28128                 CYTHON_FALLTHROUGH;
28129             case -3:
28130             case 3:
28131                 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
28132                     a = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
28133                     if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
28134                         if (size == -3)
28135                             a = -a;
28136                         break;
28137                     }
28138                 }
28139                 CYTHON_FALLTHROUGH;
28140             case -4:
28141             case 4:
28142                 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
28143                     a = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
28144                     if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
28145                         if (size == -4)
28146                             a = -a;
28147                         break;
28148                     }
28149                 }
28150                 CYTHON_FALLTHROUGH;
28151             default:
28152         #else
28153         {
28154         #endif
28155             a = PyLong_AsDouble(op1);
28156             if (unlikely(a == -1.0 && PyErr_Occurred())) return NULL;
28157 
28158         }
28159     } else {
28160         return (inplace ? __Pyx_PyNumber_InPlaceDivide(op1, op2) : __Pyx_PyNumber_Divide(op1, op2));
28161     }
28162 
28163         PyFPE_START_PROTECT("divide", return NULL)
28164         result = a / b;
28165         PyFPE_END_PROTECT(result)
28166         return PyFloat_FromDouble(result);
28167 }
28168 #endif
28169 
28170 /* PyFloatBinop */
28171   #if !CYTHON_COMPILING_IN_PYPY
28172 static PyObject* __Pyx_PyFloat_SubtractObjC(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check) {
28173     const double b = floatval;
28174     double a, result;
28175     (void)inplace;
28176     (void)zerodivision_check;
28177     if (likely(PyFloat_CheckExact(op1))) {
28178         a = PyFloat_AS_DOUBLE(op1);
28179 
28180     } else
28181     #if PY_MAJOR_VERSION < 3
28182     if (likely(PyInt_CheckExact(op1))) {
28183         a = (double) PyInt_AS_LONG(op1);
28184 
28185     } else
28186     #endif
28187     if (likely(PyLong_CheckExact(op1))) {
28188         #if CYTHON_USE_PYLONG_INTERNALS
28189         const digit* digits = ((PyLongObject*)op1)->ob_digit;
28190         const Py_ssize_t size = Py_SIZE(op1);
28191         switch (size) {
28192             case  0: a = 0.0; break;
28193             case -1: a = -(double) digits[0]; break;
28194             case  1: a = (double) digits[0]; break;
28195             case -2:
28196             case 2:
28197                 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
28198                     a = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
28199                     if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
28200                         if (size == -2)
28201                             a = -a;
28202                         break;
28203                     }
28204                 }
28205                 CYTHON_FALLTHROUGH;
28206             case -3:
28207             case 3:
28208                 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
28209                     a = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
28210                     if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
28211                         if (size == -3)
28212                             a = -a;
28213                         break;
28214                     }
28215                 }
28216                 CYTHON_FALLTHROUGH;
28217             case -4:
28218             case 4:
28219                 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
28220                     a = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
28221                     if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
28222                         if (size == -4)
28223                             a = -a;
28224                         break;
28225                     }
28226                 }
28227                 CYTHON_FALLTHROUGH;
28228             default:
28229         #else
28230         {
28231         #endif
28232             a = PyLong_AsDouble(op1);
28233             if (unlikely(a == -1.0 && PyErr_Occurred())) return NULL;
28234 
28235         }
28236     } else {
28237         return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
28238     }
28239 
28240         PyFPE_START_PROTECT("subtract", return NULL)
28241         result = a - b;
28242         PyFPE_END_PROTECT(result)
28243         return PyFloat_FromDouble(result);
28244 }
28245 #endif
28246 
28247 /* IsLittleEndian */
28248     static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
28249 {
28250   union {
28251     uint32_t u32;
28252     uint8_t u8[4];
28253   } S;
28254   S.u32 = 0x01020304;
28255   return S.u8[0] == 4;
28256 }
28257 
28258 /* BufferFormatCheck */
28259     static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
28260                               __Pyx_BufFmt_StackElem* stack,
28261                               __Pyx_TypeInfo* type) {
28262   stack[0].field = &ctx->root;
28263   stack[0].parent_offset = 0;
28264   ctx->root.type = type;
28265   ctx->root.name = "buffer dtype";
28266   ctx->root.offset = 0;
28267   ctx->head = stack;
28268   ctx->head->field = &ctx->root;
28269   ctx->fmt_offset = 0;
28270   ctx->head->parent_offset = 0;
28271   ctx->new_packmode = '@';
28272   ctx->enc_packmode = '@';
28273   ctx->new_count = 1;
28274   ctx->enc_count = 0;
28275   ctx->enc_type = 0;
28276   ctx->is_complex = 0;
28277   ctx->is_valid_array = 0;
28278   ctx->struct_alignment = 0;
28279   while (type->typegroup == 'S') {
28280     ++ctx->head;
28281     ctx->head->field = type->fields;
28282     ctx->head->parent_offset = 0;
28283     type = type->fields->type;
28284   }
28285 }
28286 static int __Pyx_BufFmt_ParseNumber(const char** ts) {
28287     int count;
28288     const char* t = *ts;
28289     if (*t < '0' || *t > '9') {
28290       return -1;
28291     } else {
28292         count = *t++ - '0';
28293         while (*t >= '0' && *t <= '9') {
28294             count *= 10;
28295             count += *t++ - '0';
28296         }
28297     }
28298     *ts = t;
28299     return count;
28300 }
28301 static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
28302     int number = __Pyx_BufFmt_ParseNumber(ts);
28303     if (number == -1)
28304         PyErr_Format(PyExc_ValueError,\
28305                      "Does not understand character buffer dtype format string ('%c')", **ts);
28306     return number;
28307 }
28308 static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
28309   PyErr_Format(PyExc_ValueError,
28310                "Unexpected format string character: '%c'", ch);
28311 }
28312 static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
28313   switch (ch) {
28314     case 'c': return "'char'";
28315     case 'b': return "'signed char'";
28316     case 'B': return "'unsigned char'";
28317     case 'h': return "'short'";
28318     case 'H': return "'unsigned short'";
28319     case 'i': return "'int'";
28320     case 'I': return "'unsigned int'";
28321     case 'l': return "'long'";
28322     case 'L': return "'unsigned long'";
28323     case 'q': return "'long long'";
28324     case 'Q': return "'unsigned long long'";
28325     case 'f': return (is_complex ? "'complex float'" : "'float'");
28326     case 'd': return (is_complex ? "'complex double'" : "'double'");
28327     case 'g': return (is_complex ? "'complex long double'" : "'long double'");
28328     case 'T': return "a struct";
28329     case 'O': return "Python object";
28330     case 'P': return "a pointer";
28331     case 's': case 'p': return "a string";
28332     case 0: return "end";
28333     default: return "unparseable format string";
28334   }
28335 }
28336 static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
28337   switch (ch) {
28338     case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
28339     case 'h': case 'H': return 2;
28340     case 'i': case 'I': case 'l': case 'L': return 4;
28341     case 'q': case 'Q': return 8;
28342     case 'f': return (is_complex ? 8 : 4);
28343     case 'd': return (is_complex ? 16 : 8);
28344     case 'g': {
28345       PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
28346       return 0;
28347     }
28348     case 'O': case 'P': return sizeof(void*);
28349     default:
28350       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
28351       return 0;
28352     }
28353 }
28354 static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
28355   switch (ch) {
28356     case 'c': case 'b': case 'B': case 's': case 'p': return 1;
28357     case 'h': case 'H': return sizeof(short);
28358     case 'i': case 'I': return sizeof(int);
28359     case 'l': case 'L': return sizeof(long);
28360     #ifdef HAVE_LONG_LONG
28361     case 'q': case 'Q': return sizeof(PY_LONG_LONG);
28362     #endif
28363     case 'f': return sizeof(float) * (is_complex ? 2 : 1);
28364     case 'd': return sizeof(double) * (is_complex ? 2 : 1);
28365     case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
28366     case 'O': case 'P': return sizeof(void*);
28367     default: {
28368       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
28369       return 0;
28370     }
28371   }
28372 }
28373 typedef struct { char c; short x; } __Pyx_st_short;
28374 typedef struct { char c; int x; } __Pyx_st_int;
28375 typedef struct { char c; long x; } __Pyx_st_long;
28376 typedef struct { char c; float x; } __Pyx_st_float;
28377 typedef struct { char c; double x; } __Pyx_st_double;
28378 typedef struct { char c; long double x; } __Pyx_st_longdouble;
28379 typedef struct { char c; void *x; } __Pyx_st_void_p;
28380 #ifdef HAVE_LONG_LONG
28381 typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
28382 #endif
28383 static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
28384   switch (ch) {
28385     case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
28386     case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
28387     case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
28388     case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
28389 #ifdef HAVE_LONG_LONG
28390     case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
28391 #endif
28392     case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
28393     case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
28394     case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
28395     case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
28396     default:
28397       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
28398       return 0;
28399     }
28400 }
28401 /* These are for computing the padding at the end of the struct to align
28402    on the first member of the struct. This will probably the same as above,
28403    but we don't have any guarantees.
28404  */
28405 typedef struct { short x; char c; } __Pyx_pad_short;
28406 typedef struct { int x; char c; } __Pyx_pad_int;
28407 typedef struct { long x; char c; } __Pyx_pad_long;
28408 typedef struct { float x; char c; } __Pyx_pad_float;
28409 typedef struct { double x; char c; } __Pyx_pad_double;
28410 typedef struct { long double x; char c; } __Pyx_pad_longdouble;
28411 typedef struct { void *x; char c; } __Pyx_pad_void_p;
28412 #ifdef HAVE_LONG_LONG
28413 typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
28414 #endif
28415 static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
28416   switch (ch) {
28417     case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
28418     case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
28419     case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
28420     case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
28421 #ifdef HAVE_LONG_LONG
28422     case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
28423 #endif
28424     case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
28425     case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
28426     case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
28427     case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
28428     default:
28429       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
28430       return 0;
28431     }
28432 }
28433 static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
28434   switch (ch) {
28435     case 'c':
28436         return 'H';
28437     case 'b': case 'h': case 'i':
28438     case 'l': case 'q': case 's': case 'p':
28439         return 'I';
28440     case 'B': case 'H': case 'I': case 'L': case 'Q':
28441         return 'U';
28442     case 'f': case 'd': case 'g':
28443         return (is_complex ? 'C' : 'R');
28444     case 'O':
28445         return 'O';
28446     case 'P':
28447         return 'P';
28448     default: {
28449       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
28450       return 0;
28451     }
28452   }
28453 }
28454 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
28455   if (ctx->head == NULL || ctx->head->field == &ctx->root) {
28456     const char* expected;
28457     const char* quote;
28458     if (ctx->head == NULL) {
28459       expected = "end";
28460       quote = "";
28461     } else {
28462       expected = ctx->head->field->type->name;
28463       quote = "'";
28464     }
28465     PyErr_Format(PyExc_ValueError,
28466                  "Buffer dtype mismatch, expected %s%s%s but got %s",
28467                  quote, expected, quote,
28468                  __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
28469   } else {
28470     __Pyx_StructField* field = ctx->head->field;
28471     __Pyx_StructField* parent = (ctx->head - 1)->field;
28472     PyErr_Format(PyExc_ValueError,
28473                  "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
28474                  field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
28475                  parent->type->name, field->name);
28476   }
28477 }
28478 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
28479   char group;
28480   size_t size, offset, arraysize = 1;
28481   if (ctx->enc_type == 0) return 0;
28482   if (ctx->head->field->type->arraysize[0]) {
28483     int i, ndim = 0;
28484     if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
28485         ctx->is_valid_array = ctx->head->field->type->ndim == 1;
28486         ndim = 1;
28487         if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
28488             PyErr_Format(PyExc_ValueError,
28489                          "Expected a dimension of size %zu, got %zu",
28490                          ctx->head->field->type->arraysize[0], ctx->enc_count);
28491             return -1;
28492         }
28493     }
28494     if (!ctx->is_valid_array) {
28495       PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
28496                    ctx->head->field->type->ndim, ndim);
28497       return -1;
28498     }
28499     for (i = 0; i < ctx->head->field->type->ndim; i++) {
28500       arraysize *= ctx->head->field->type->arraysize[i];
28501     }
28502     ctx->is_valid_array = 0;
28503     ctx->enc_count = 1;
28504   }
28505   group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
28506   do {
28507     __Pyx_StructField* field = ctx->head->field;
28508     __Pyx_TypeInfo* type = field->type;
28509     if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
28510       size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
28511     } else {
28512       size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
28513     }
28514     if (ctx->enc_packmode == '@') {
28515       size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
28516       size_t align_mod_offset;
28517       if (align_at == 0) return -1;
28518       align_mod_offset = ctx->fmt_offset % align_at;
28519       if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
28520       if (ctx->struct_alignment == 0)
28521           ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
28522                                                                  ctx->is_complex);
28523     }
28524     if (type->size != size || type->typegroup != group) {
28525       if (type->typegroup == 'C' && type->fields != NULL) {
28526         size_t parent_offset = ctx->head->parent_offset + field->offset;
28527         ++ctx->head;
28528         ctx->head->field = type->fields;
28529         ctx->head->parent_offset = parent_offset;
28530         continue;
28531       }
28532       if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
28533       } else {
28534           __Pyx_BufFmt_RaiseExpected(ctx);
28535           return -1;
28536       }
28537     }
28538     offset = ctx->head->parent_offset + field->offset;
28539     if (ctx->fmt_offset != offset) {
28540       PyErr_Format(PyExc_ValueError,
28541                    "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
28542                    (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
28543       return -1;
28544     }
28545     ctx->fmt_offset += size;
28546     if (arraysize)
28547       ctx->fmt_offset += (arraysize - 1) * size;
28548     --ctx->enc_count;
28549     while (1) {
28550       if (field == &ctx->root) {
28551         ctx->head = NULL;
28552         if (ctx->enc_count != 0) {
28553           __Pyx_BufFmt_RaiseExpected(ctx);
28554           return -1;
28555         }
28556         break;
28557       }
28558       ctx->head->field = ++field;
28559       if (field->type == NULL) {
28560         --ctx->head;
28561         field = ctx->head->field;
28562         continue;
28563       } else if (field->type->typegroup == 'S') {
28564         size_t parent_offset = ctx->head->parent_offset + field->offset;
28565         if (field->type->fields->type == NULL) continue;
28566         field = field->type->fields;
28567         ++ctx->head;
28568         ctx->head->field = field;
28569         ctx->head->parent_offset = parent_offset;
28570         break;
28571       } else {
28572         break;
28573       }
28574     }
28575   } while (ctx->enc_count);
28576   ctx->enc_type = 0;
28577   ctx->is_complex = 0;
28578   return 0;
28579 }
28580 static PyObject *
28581 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
28582 {
28583     const char *ts = *tsp;
28584     int i = 0, number;
28585     int ndim = ctx->head->field->type->ndim;
28586 ;
28587     ++ts;
28588     if (ctx->new_count != 1) {
28589         PyErr_SetString(PyExc_ValueError,
28590                         "Cannot handle repeated arrays in format string");
28591         return NULL;
28592     }
28593     if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
28594     while (*ts && *ts != ')') {
28595         switch (*ts) {
28596             case ' ': case '\f': case '\r': case '\n': case '\t': case '\v':  continue;
28597             default:  break;
28598         }
28599         number = __Pyx_BufFmt_ExpectNumber(&ts);
28600         if (number == -1) return NULL;
28601         if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
28602             return PyErr_Format(PyExc_ValueError,
28603                         "Expected a dimension of size %zu, got %d",
28604                         ctx->head->field->type->arraysize[i], number);
28605         if (*ts != ',' && *ts != ')')
28606             return PyErr_Format(PyExc_ValueError,
28607                                 "Expected a comma in format string, got '%c'", *ts);
28608         if (*ts == ',') ts++;
28609         i++;
28610     }
28611     if (i != ndim)
28612         return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
28613                             ctx->head->field->type->ndim, i);
28614     if (!*ts) {
28615         PyErr_SetString(PyExc_ValueError,
28616                         "Unexpected end of format string, expected ')'");
28617         return NULL;
28618     }
28619     ctx->is_valid_array = 1;
28620     ctx->new_count = 1;
28621     *tsp = ++ts;
28622     return Py_None;
28623 }
28624 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
28625   int got_Z = 0;
28626   while (1) {
28627     switch(*ts) {
28628       case 0:
28629         if (ctx->enc_type != 0 && ctx->head == NULL) {
28630           __Pyx_BufFmt_RaiseExpected(ctx);
28631           return NULL;
28632         }
28633         if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
28634         if (ctx->head != NULL) {
28635           __Pyx_BufFmt_RaiseExpected(ctx);
28636           return NULL;
28637         }
28638         return ts;
28639       case ' ':
28640       case '\r':
28641       case '\n':
28642         ++ts;
28643         break;
28644       case '<':
28645         if (!__Pyx_Is_Little_Endian()) {
28646           PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
28647           return NULL;
28648         }
28649         ctx->new_packmode = '=';
28650         ++ts;
28651         break;
28652       case '>':
28653       case '!':
28654         if (__Pyx_Is_Little_Endian()) {
28655           PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
28656           return NULL;
28657         }
28658         ctx->new_packmode = '=';
28659         ++ts;
28660         break;
28661       case '=':
28662       case '@':
28663       case '^':
28664         ctx->new_packmode = *ts++;
28665         break;
28666       case 'T':
28667         {
28668           const char* ts_after_sub;
28669           size_t i, struct_count = ctx->new_count;
28670           size_t struct_alignment = ctx->struct_alignment;
28671           ctx->new_count = 1;
28672           ++ts;
28673           if (*ts != '{') {
28674             PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
28675             return NULL;
28676           }
28677           if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
28678           ctx->enc_type = 0;
28679           ctx->enc_count = 0;
28680           ctx->struct_alignment = 0;
28681           ++ts;
28682           ts_after_sub = ts;
28683           for (i = 0; i != struct_count; ++i) {
28684             ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
28685             if (!ts_after_sub) return NULL;
28686           }
28687           ts = ts_after_sub;
28688           if (struct_alignment) ctx->struct_alignment = struct_alignment;
28689         }
28690         break;
28691       case '}':
28692         {
28693           size_t alignment = ctx->struct_alignment;
28694           ++ts;
28695           if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
28696           ctx->enc_type = 0;
28697           if (alignment && ctx->fmt_offset % alignment) {
28698             ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
28699           }
28700         }
28701         return ts;
28702       case 'x':
28703         if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
28704         ctx->fmt_offset += ctx->new_count;
28705         ctx->new_count = 1;
28706         ctx->enc_count = 0;
28707         ctx->enc_type = 0;
28708         ctx->enc_packmode = ctx->new_packmode;
28709         ++ts;
28710         break;
28711       case 'Z':
28712         got_Z = 1;
28713         ++ts;
28714         if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
28715           __Pyx_BufFmt_RaiseUnexpectedChar('Z');
28716           return NULL;
28717         }
28718         CYTHON_FALLTHROUGH;
28719       case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
28720       case 'l': case 'L': case 'q': case 'Q':
28721       case 'f': case 'd': case 'g':
28722       case 'O': case 'p':
28723         if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
28724             ctx->enc_packmode == ctx->new_packmode) {
28725           ctx->enc_count += ctx->new_count;
28726           ctx->new_count = 1;
28727           got_Z = 0;
28728           ++ts;
28729           break;
28730         }
28731         CYTHON_FALLTHROUGH;
28732       case 's':
28733         if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
28734         ctx->enc_count = ctx->new_count;
28735         ctx->enc_packmode = ctx->new_packmode;
28736         ctx->enc_type = *ts;
28737         ctx->is_complex = got_Z;
28738         ++ts;
28739         ctx->new_count = 1;
28740         got_Z = 0;
28741         break;
28742       case ':':
28743         ++ts;
28744         while(*ts != ':') ++ts;
28745         ++ts;
28746         break;
28747       case '(':
28748         if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
28749         break;
28750       default:
28751         {
28752           int number = __Pyx_BufFmt_ExpectNumber(&ts);
28753           if (number == -1) return NULL;
28754           ctx->new_count = (size_t)number;
28755         }
28756     }
28757   }
28758 }
28759 
28760 /* BufferGetAndValidate */
28761       static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
28762   if (unlikely(info->buf == NULL)) return;
28763   if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
28764   __Pyx_ReleaseBuffer(info);
28765 }
28766 static void __Pyx_ZeroBuffer(Py_buffer* buf) {
28767   buf->buf = NULL;
28768   buf->obj = NULL;
28769   buf->strides = __Pyx_zeros;
28770   buf->shape = __Pyx_zeros;
28771   buf->suboffsets = __Pyx_minusones;
28772 }
28773 static int __Pyx__GetBufferAndValidate(
28774         Py_buffer* buf, PyObject* obj,  __Pyx_TypeInfo* dtype, int flags,
28775         int nd, int cast, __Pyx_BufFmt_StackElem* stack)
28776 {
28777   buf->buf = NULL;
28778   if (unlikely(__Pyx_GetBuffer(obj, buf, flags) == -1)) {
28779     __Pyx_ZeroBuffer(buf);
28780     return -1;
28781   }
28782   if (unlikely(buf->ndim != nd)) {
28783     PyErr_Format(PyExc_ValueError,
28784                  "Buffer has wrong number of dimensions (expected %d, got %d)",
28785                  nd, buf->ndim);
28786     goto fail;
28787   }
28788   if (!cast) {
28789     __Pyx_BufFmt_Context ctx;
28790     __Pyx_BufFmt_Init(&ctx, stack, dtype);
28791     if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
28792   }
28793   if (unlikely((size_t)buf->itemsize != dtype->size)) {
28794     PyErr_Format(PyExc_ValueError,
28795       "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)",
28796       buf->itemsize, (buf->itemsize > 1) ? "s" : "",
28797       dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : "");
28798     goto fail;
28799   }
28800   if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
28801   return 0;
28802 fail:;
28803   __Pyx_SafeReleaseBuffer(buf);
28804   return -1;
28805 }
28806 
28807 /* ExtTypeTest */
28808       static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
28809     if (unlikely(!type)) {
28810         PyErr_SetString(PyExc_SystemError, "Missing type object");
28811         return 0;
28812     }
28813     if (likely(__Pyx_TypeCheck(obj, type)))
28814         return 1;
28815     PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
28816                  Py_TYPE(obj)->tp_name, type->tp_name);
28817     return 0;
28818 }
28819 
28820 /* BufferFallbackError */
28821       static void __Pyx_RaiseBufferFallbackError(void) {
28822   PyErr_SetString(PyExc_ValueError,
28823      "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!");
28824 }
28825 
28826 /* RaiseTooManyValuesToUnpack */
28827       static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
28828     PyErr_Format(PyExc_ValueError,
28829                  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
28830 }
28831 
28832 /* RaiseNeedMoreValuesToUnpack */
28833       static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
28834     PyErr_Format(PyExc_ValueError,
28835                  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
28836                  index, (index == 1) ? "" : "s");
28837 }
28838 
28839 /* IterFinish */
28840       static CYTHON_INLINE int __Pyx_IterFinish(void) {
28841 #if CYTHON_FAST_THREAD_STATE
28842     PyThreadState *tstate = __Pyx_PyThreadState_Current;
28843     PyObject* exc_type = tstate->curexc_type;
28844     if (unlikely(exc_type)) {
28845         if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
28846             PyObject *exc_value, *exc_tb;
28847             exc_value = tstate->curexc_value;
28848             exc_tb = tstate->curexc_traceback;
28849             tstate->curexc_type = 0;
28850             tstate->curexc_value = 0;
28851             tstate->curexc_traceback = 0;
28852             Py_DECREF(exc_type);
28853             Py_XDECREF(exc_value);
28854             Py_XDECREF(exc_tb);
28855             return 0;
28856         } else {
28857             return -1;
28858         }
28859     }
28860     return 0;
28861 #else
28862     if (unlikely(PyErr_Occurred())) {
28863         if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
28864             PyErr_Clear();
28865             return 0;
28866         } else {
28867             return -1;
28868         }
28869     }
28870     return 0;
28871 #endif
28872 }
28873 
28874 /* UnpackItemEndCheck */
28875       static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
28876     if (unlikely(retval)) {
28877         Py_DECREF(retval);
28878         __Pyx_RaiseTooManyValuesError(expected);
28879         return -1;
28880     } else {
28881         return __Pyx_IterFinish();
28882     }
28883     return 0;
28884 }
28885 
28886 /* PyDictVersioning */
28887       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
28888 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
28889     PyObject *dict = Py_TYPE(obj)->tp_dict;
28890     return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
28891 }
28892 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
28893     PyObject **dictptr = NULL;
28894     Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
28895     if (offset) {
28896 #if CYTHON_COMPILING_IN_CPYTHON
28897         dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
28898 #else
28899         dictptr = _PyObject_GetDictPtr(obj);
28900 #endif
28901     }
28902     return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
28903 }
28904 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
28905     PyObject *dict = Py_TYPE(obj)->tp_dict;
28906     if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
28907         return 0;
28908     return obj_dict_version == __Pyx_get_object_dict_version(obj);
28909 }
28910 #endif
28911 
28912 /* GetModuleGlobalName */
28913       #if CYTHON_USE_DICT_VERSIONS
28914 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
28915 #else
28916 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
28917 #endif
28918 {
28919     PyObject *result;
28920 #if !CYTHON_AVOID_BORROWED_REFS
28921 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
28922     result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
28923     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
28924     if (likely(result)) {
28925         return __Pyx_NewRef(result);
28926     } else if (unlikely(PyErr_Occurred())) {
28927         return NULL;
28928     }
28929 #else
28930     result = PyDict_GetItem(__pyx_d, name);
28931     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
28932     if (likely(result)) {
28933         return __Pyx_NewRef(result);
28934     }
28935 #endif
28936 #else
28937     result = PyObject_GetItem(__pyx_d, name);
28938     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
28939     if (likely(result)) {
28940         return __Pyx_NewRef(result);
28941     }
28942     PyErr_Clear();
28943 #endif
28944     return __Pyx_GetBuiltinName(name);
28945 }
28946 
28947 /* PyObjectCall */
28948       #if CYTHON_COMPILING_IN_CPYTHON
28949 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
28950     PyObject *result;
28951     ternaryfunc call = func->ob_type->tp_call;
28952     if (unlikely(!call))
28953         return PyObject_Call(func, arg, kw);
28954     if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
28955         return NULL;
28956     result = (*call)(func, arg, kw);
28957     Py_LeaveRecursiveCall();
28958     if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
28959         PyErr_SetString(
28960             PyExc_SystemError,
28961             "NULL result without error in PyObject_Call");
28962     }
28963     return result;
28964 }
28965 #endif
28966 
28967 /* GetItemInt */
28968       static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
28969     PyObject *r;
28970     if (!j) return NULL;
28971     r = PyObject_GetItem(o, j);
28972     Py_DECREF(j);
28973     return r;
28974 }
28975 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
28976                                                               CYTHON_NCP_UNUSED int wraparound,
28977                                                               CYTHON_NCP_UNUSED int boundscheck) {
28978 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
28979     Py_ssize_t wrapped_i = i;
28980     if (wraparound & unlikely(i < 0)) {
28981         wrapped_i += PyList_GET_SIZE(o);
28982     }
28983     if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
28984         PyObject *r = PyList_GET_ITEM(o, wrapped_i);
28985         Py_INCREF(r);
28986         return r;
28987     }
28988     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
28989 #else
28990     return PySequence_GetItem(o, i);
28991 #endif
28992 }
28993 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
28994                                                               CYTHON_NCP_UNUSED int wraparound,
28995                                                               CYTHON_NCP_UNUSED int boundscheck) {
28996 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
28997     Py_ssize_t wrapped_i = i;
28998     if (wraparound & unlikely(i < 0)) {
28999         wrapped_i += PyTuple_GET_SIZE(o);
29000     }
29001     if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
29002         PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
29003         Py_INCREF(r);
29004         return r;
29005     }
29006     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
29007 #else
29008     return PySequence_GetItem(o, i);
29009 #endif
29010 }
29011 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
29012                                                      CYTHON_NCP_UNUSED int wraparound,
29013                                                      CYTHON_NCP_UNUSED int boundscheck) {
29014 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
29015     if (is_list || PyList_CheckExact(o)) {
29016         Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
29017         if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
29018             PyObject *r = PyList_GET_ITEM(o, n);
29019             Py_INCREF(r);
29020             return r;
29021         }
29022     }
29023     else if (PyTuple_CheckExact(o)) {
29024         Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
29025         if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
29026             PyObject *r = PyTuple_GET_ITEM(o, n);
29027             Py_INCREF(r);
29028             return r;
29029         }
29030     } else {
29031         PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
29032         if (likely(m && m->sq_item)) {
29033             if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
29034                 Py_ssize_t l = m->sq_length(o);
29035                 if (likely(l >= 0)) {
29036                     i += l;
29037                 } else {
29038                     if (!PyErr_ExceptionMatches(PyExc_OverflowError))
29039                         return NULL;
29040                     PyErr_Clear();
29041                 }
29042             }
29043             return m->sq_item(o, i);
29044         }
29045     }
29046 #else
29047     if (is_list || PySequence_Check(o)) {
29048         return PySequence_GetItem(o, i);
29049     }
29050 #endif
29051     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
29052 }
29053 
29054 /* ObjectGetItem */
29055       #if CYTHON_USE_TYPE_SLOTS
29056 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
29057     PyObject *runerr;
29058     Py_ssize_t key_value;
29059     PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
29060     if (unlikely(!(m && m->sq_item))) {
29061         PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
29062         return NULL;
29063     }
29064     key_value = __Pyx_PyIndex_AsSsize_t(index);
29065     if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
29066         return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
29067     }
29068     if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
29069         PyErr_Clear();
29070         PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
29071     }
29072     return NULL;
29073 }
29074 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
29075     PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
29076     if (likely(m && m->mp_subscript)) {
29077         return m->mp_subscript(obj, key);
29078     }
29079     return __Pyx_PyObject_GetIndex(obj, key);
29080 }
29081 #endif
29082 
29083 /* PyErrFetchRestore */
29084       #if CYTHON_FAST_THREAD_STATE
29085 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
29086     PyObject *tmp_type, *tmp_value, *tmp_tb;
29087     tmp_type = tstate->curexc_type;
29088     tmp_value = tstate->curexc_value;
29089     tmp_tb = tstate->curexc_traceback;
29090     tstate->curexc_type = type;
29091     tstate->curexc_value = value;
29092     tstate->curexc_traceback = tb;
29093     Py_XDECREF(tmp_type);
29094     Py_XDECREF(tmp_value);
29095     Py_XDECREF(tmp_tb);
29096 }
29097 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
29098     *type = tstate->curexc_type;
29099     *value = tstate->curexc_value;
29100     *tb = tstate->curexc_traceback;
29101     tstate->curexc_type = 0;
29102     tstate->curexc_value = 0;
29103     tstate->curexc_traceback = 0;
29104 }
29105 #endif
29106 
29107 /* PyFunctionFastCall */
29108       #if CYTHON_FAST_PYCALL
29109 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
29110                                                PyObject *globals) {
29111     PyFrameObject *f;
29112     PyThreadState *tstate = __Pyx_PyThreadState_Current;
29113     PyObject **fastlocals;
29114     Py_ssize_t i;
29115     PyObject *result;
29116     assert(globals != NULL);
29117     /* XXX Perhaps we should create a specialized
29118        PyFrame_New() that doesn't take locals, but does
29119        take builtins without sanity checking them.
29120        */
29121     assert(tstate != NULL);
29122     f = PyFrame_New(tstate, co, globals, NULL);
29123     if (f == NULL) {
29124         return NULL;
29125     }
29126     fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
29127     for (i = 0; i < na; i++) {
29128         Py_INCREF(*args);
29129         fastlocals[i] = *args++;
29130     }
29131     result = PyEval_EvalFrameEx(f,0);
29132     ++tstate->recursion_depth;
29133     Py_DECREF(f);
29134     --tstate->recursion_depth;
29135     return result;
29136 }
29137 #if 1 || PY_VERSION_HEX < 0x030600B1
29138 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
29139     PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
29140     PyObject *globals = PyFunction_GET_GLOBALS(func);
29141     PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
29142     PyObject *closure;
29143 #if PY_MAJOR_VERSION >= 3
29144     PyObject *kwdefs;
29145 #endif
29146     PyObject *kwtuple, **k;
29147     PyObject **d;
29148     Py_ssize_t nd;
29149     Py_ssize_t nk;
29150     PyObject *result;
29151     assert(kwargs == NULL || PyDict_Check(kwargs));
29152     nk = kwargs ? PyDict_Size(kwargs) : 0;
29153     if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
29154         return NULL;
29155     }
29156     if (
29157 #if PY_MAJOR_VERSION >= 3
29158             co->co_kwonlyargcount == 0 &&
29159 #endif
29160             likely(kwargs == NULL || nk == 0) &&
29161             co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
29162         if (argdefs == NULL && co->co_argcount == nargs) {
29163             result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
29164             goto done;
29165         }
29166         else if (nargs == 0 && argdefs != NULL
29167                  && co->co_argcount == Py_SIZE(argdefs)) {
29168             /* function called with no arguments, but all parameters have
29169                a default value: use default values as arguments .*/
29170             args = &PyTuple_GET_ITEM(argdefs, 0);
29171             result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
29172             goto done;
29173         }
29174     }
29175     if (kwargs != NULL) {
29176         Py_ssize_t pos, i;
29177         kwtuple = PyTuple_New(2 * nk);
29178         if (kwtuple == NULL) {
29179             result = NULL;
29180             goto done;
29181         }
29182         k = &PyTuple_GET_ITEM(kwtuple, 0);
29183         pos = i = 0;
29184         while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
29185             Py_INCREF(k[i]);
29186             Py_INCREF(k[i+1]);
29187             i += 2;
29188         }
29189         nk = i / 2;
29190     }
29191     else {
29192         kwtuple = NULL;
29193         k = NULL;
29194     }
29195     closure = PyFunction_GET_CLOSURE(func);
29196 #if PY_MAJOR_VERSION >= 3
29197     kwdefs = PyFunction_GET_KW_DEFAULTS(func);
29198 #endif
29199     if (argdefs != NULL) {
29200         d = &PyTuple_GET_ITEM(argdefs, 0);
29201         nd = Py_SIZE(argdefs);
29202     }
29203     else {
29204         d = NULL;
29205         nd = 0;
29206     }
29207 #if PY_MAJOR_VERSION >= 3
29208     result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
29209                                args, (int)nargs,
29210                                k, (int)nk,
29211                                d, (int)nd, kwdefs, closure);
29212 #else
29213     result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
29214                                args, (int)nargs,
29215                                k, (int)nk,
29216                                d, (int)nd, closure);
29217 #endif
29218     Py_XDECREF(kwtuple);
29219 done:
29220     Py_LeaveRecursiveCall();
29221     return result;
29222 }
29223 #endif
29224 #endif
29225 
29226 /* PyCFunctionFastCall */
29227       #if CYTHON_FAST_PYCCALL
29228 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
29229     PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
29230     PyCFunction meth = PyCFunction_GET_FUNCTION(func);
29231     PyObject *self = PyCFunction_GET_SELF(func);
29232     int flags = PyCFunction_GET_FLAGS(func);
29233     assert(PyCFunction_Check(func));
29234     assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
29235     assert(nargs >= 0);
29236     assert(nargs == 0 || args != NULL);
29237     /* _PyCFunction_FastCallDict() must not be called with an exception set,
29238        because it may clear it (directly or indirectly) and so the
29239        caller loses its exception */
29240     assert(!PyErr_Occurred());
29241     if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
29242         return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
29243     } else {
29244         return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
29245     }
29246 }
29247 #endif
29248 
29249 /* RaiseException */
29250       #if PY_MAJOR_VERSION < 3
29251 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
29252                         CYTHON_UNUSED PyObject *cause) {
29253     __Pyx_PyThreadState_declare
29254     Py_XINCREF(type);
29255     if (!value || value == Py_None)
29256         value = NULL;
29257     else
29258         Py_INCREF(value);
29259     if (!tb || tb == Py_None)
29260         tb = NULL;
29261     else {
29262         Py_INCREF(tb);
29263         if (!PyTraceBack_Check(tb)) {
29264             PyErr_SetString(PyExc_TypeError,
29265                 "raise: arg 3 must be a traceback or None");
29266             goto raise_error;
29267         }
29268     }
29269     if (PyType_Check(type)) {
29270 #if CYTHON_COMPILING_IN_PYPY
29271         if (!value) {
29272             Py_INCREF(Py_None);
29273             value = Py_None;
29274         }
29275 #endif
29276         PyErr_NormalizeException(&type, &value, &tb);
29277     } else {
29278         if (value) {
29279             PyErr_SetString(PyExc_TypeError,
29280                 "instance exception may not have a separate value");
29281             goto raise_error;
29282         }
29283         value = type;
29284         type = (PyObject*) Py_TYPE(type);
29285         Py_INCREF(type);
29286         if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
29287             PyErr_SetString(PyExc_TypeError,
29288                 "raise: exception class must be a subclass of BaseException");
29289             goto raise_error;
29290         }
29291     }
29292     __Pyx_PyThreadState_assign
29293     __Pyx_ErrRestore(type, value, tb);
29294     return;
29295 raise_error:
29296     Py_XDECREF(value);
29297     Py_XDECREF(type);
29298     Py_XDECREF(tb);
29299     return;
29300 }
29301 #else
29302 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
29303     PyObject* owned_instance = NULL;
29304     if (tb == Py_None) {
29305         tb = 0;
29306     } else if (tb && !PyTraceBack_Check(tb)) {
29307         PyErr_SetString(PyExc_TypeError,
29308             "raise: arg 3 must be a traceback or None");
29309         goto bad;
29310     }
29311     if (value == Py_None)
29312         value = 0;
29313     if (PyExceptionInstance_Check(type)) {
29314         if (value) {
29315             PyErr_SetString(PyExc_TypeError,
29316                 "instance exception may not have a separate value");
29317             goto bad;
29318         }
29319         value = type;
29320         type = (PyObject*) Py_TYPE(value);
29321     } else if (PyExceptionClass_Check(type)) {
29322         PyObject *instance_class = NULL;
29323         if (value && PyExceptionInstance_Check(value)) {
29324             instance_class = (PyObject*) Py_TYPE(value);
29325             if (instance_class != type) {
29326                 int is_subclass = PyObject_IsSubclass(instance_class, type);
29327                 if (!is_subclass) {
29328                     instance_class = NULL;
29329                 } else if (unlikely(is_subclass == -1)) {
29330                     goto bad;
29331                 } else {
29332                     type = instance_class;
29333                 }
29334             }
29335         }
29336         if (!instance_class) {
29337             PyObject *args;
29338             if (!value)
29339                 args = PyTuple_New(0);
29340             else if (PyTuple_Check(value)) {
29341                 Py_INCREF(value);
29342                 args = value;
29343             } else
29344                 args = PyTuple_Pack(1, value);
29345             if (!args)
29346                 goto bad;
29347             owned_instance = PyObject_Call(type, args, NULL);
29348             Py_DECREF(args);
29349             if (!owned_instance)
29350                 goto bad;
29351             value = owned_instance;
29352             if (!PyExceptionInstance_Check(value)) {
29353                 PyErr_Format(PyExc_TypeError,
29354                              "calling %R should have returned an instance of "
29355                              "BaseException, not %R",
29356                              type, Py_TYPE(value));
29357                 goto bad;
29358             }
29359         }
29360     } else {
29361         PyErr_SetString(PyExc_TypeError,
29362             "raise: exception class must be a subclass of BaseException");
29363         goto bad;
29364     }
29365     if (cause) {
29366         PyObject *fixed_cause;
29367         if (cause == Py_None) {
29368             fixed_cause = NULL;
29369         } else if (PyExceptionClass_Check(cause)) {
29370             fixed_cause = PyObject_CallObject(cause, NULL);
29371             if (fixed_cause == NULL)
29372                 goto bad;
29373         } else if (PyExceptionInstance_Check(cause)) {
29374             fixed_cause = cause;
29375             Py_INCREF(fixed_cause);
29376         } else {
29377             PyErr_SetString(PyExc_TypeError,
29378                             "exception causes must derive from "
29379                             "BaseException");
29380             goto bad;
29381         }
29382         PyException_SetCause(value, fixed_cause);
29383     }
29384     PyErr_SetObject(type, value);
29385     if (tb) {
29386 #if CYTHON_COMPILING_IN_PYPY
29387         PyObject *tmp_type, *tmp_value, *tmp_tb;
29388         PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
29389         Py_INCREF(tb);
29390         PyErr_Restore(tmp_type, tmp_value, tb);
29391         Py_XDECREF(tmp_tb);
29392 #else
29393         PyThreadState *tstate = __Pyx_PyThreadState_Current;
29394         PyObject* tmp_tb = tstate->curexc_traceback;
29395         if (tb != tmp_tb) {
29396             Py_INCREF(tb);
29397             tstate->curexc_traceback = tb;
29398             Py_XDECREF(tmp_tb);
29399         }
29400 #endif
29401     }
29402 bad:
29403     Py_XDECREF(owned_instance);
29404     return;
29405 }
29406 #endif
29407 
29408 /* MemviewSliceInit */
29409       static int
29410 __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
29411                         int ndim,
29412                         __Pyx_memviewslice *memviewslice,
29413                         int memview_is_new_reference)
29414 {
29415     __Pyx_RefNannyDeclarations
29416     int i, retval=-1;
29417     Py_buffer *buf = &memview->view;
29418     __Pyx_RefNannySetupContext("init_memviewslice", 0);
29419     if (memviewslice->memview || memviewslice->data) {
29420         PyErr_SetString(PyExc_ValueError,
29421             "memviewslice is already initialized!");
29422         goto fail;
29423     }
29424     if (buf->strides) {
29425         for (i = 0; i < ndim; i++) {
29426             memviewslice->strides[i] = buf->strides[i];
29427         }
29428     } else {
29429         Py_ssize_t stride = buf->itemsize;
29430         for (i = ndim - 1; i >= 0; i--) {
29431             memviewslice->strides[i] = stride;
29432             stride *= buf->shape[i];
29433         }
29434     }
29435     for (i = 0; i < ndim; i++) {
29436         memviewslice->shape[i]   = buf->shape[i];
29437         if (buf->suboffsets) {
29438             memviewslice->suboffsets[i] = buf->suboffsets[i];
29439         } else {
29440             memviewslice->suboffsets[i] = -1;
29441         }
29442     }
29443     memviewslice->memview = memview;
29444     memviewslice->data = (char *)buf->buf;
29445     if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
29446         Py_INCREF(memview);
29447     }
29448     retval = 0;
29449     goto no_fail;
29450 fail:
29451     memviewslice->memview = 0;
29452     memviewslice->data = 0;
29453     retval = -1;
29454 no_fail:
29455     __Pyx_RefNannyFinishContext();
29456     return retval;
29457 }
29458 #ifndef Py_NO_RETURN
29459 #define Py_NO_RETURN
29460 #endif
29461 static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
29462     va_list vargs;
29463     char msg[200];
29464 #ifdef HAVE_STDARG_PROTOTYPES
29465     va_start(vargs, fmt);
29466 #else
29467     va_start(vargs);
29468 #endif
29469     vsnprintf(msg, 200, fmt, vargs);
29470     va_end(vargs);
29471     Py_FatalError(msg);
29472 }
29473 static CYTHON_INLINE int
29474 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
29475                                    PyThread_type_lock lock)
29476 {
29477     int result;
29478     PyThread_acquire_lock(lock, 1);
29479     result = (*acquisition_count)++;
29480     PyThread_release_lock(lock);
29481     return result;
29482 }
29483 static CYTHON_INLINE int
29484 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
29485                                    PyThread_type_lock lock)
29486 {
29487     int result;
29488     PyThread_acquire_lock(lock, 1);
29489     result = (*acquisition_count)--;
29490     PyThread_release_lock(lock);
29491     return result;
29492 }
29493 static CYTHON_INLINE void
29494 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
29495 {
29496     int first_time;
29497     struct __pyx_memoryview_obj *memview = memslice->memview;
29498     if (!memview || (PyObject *) memview == Py_None)
29499         return;
29500     if (__pyx_get_slice_count(memview) < 0)
29501         __pyx_fatalerror("Acquisition count is %d (line %d)",
29502                          __pyx_get_slice_count(memview), lineno);
29503     first_time = __pyx_add_acquisition_count(memview) == 0;
29504     if (first_time) {
29505         if (have_gil) {
29506             Py_INCREF((PyObject *) memview);
29507         } else {
29508             PyGILState_STATE _gilstate = PyGILState_Ensure();
29509             Py_INCREF((PyObject *) memview);
29510             PyGILState_Release(_gilstate);
29511         }
29512     }
29513 }
29514 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
29515                                              int have_gil, int lineno) {
29516     int last_time;
29517     struct __pyx_memoryview_obj *memview = memslice->memview;
29518     if (!memview ) {
29519         return;
29520     } else if ((PyObject *) memview == Py_None) {
29521         memslice->memview = NULL;
29522         return;
29523     }
29524     if (__pyx_get_slice_count(memview) <= 0)
29525         __pyx_fatalerror("Acquisition count is %d (line %d)",
29526                          __pyx_get_slice_count(memview), lineno);
29527     last_time = __pyx_sub_acquisition_count(memview) == 1;
29528     memslice->data = NULL;
29529     if (last_time) {
29530         if (have_gil) {
29531             Py_CLEAR(memslice->memview);
29532         } else {
29533             PyGILState_STATE _gilstate = PyGILState_Ensure();
29534             Py_CLEAR(memslice->memview);
29535             PyGILState_Release(_gilstate);
29536         }
29537     } else {
29538         memslice->memview = NULL;
29539     }
29540 }
29541 
29542 /* PyObjectCallMethO */
29543       #if CYTHON_COMPILING_IN_CPYTHON
29544 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
29545     PyObject *self, *result;
29546     PyCFunction cfunc;
29547     cfunc = PyCFunction_GET_FUNCTION(func);
29548     self = PyCFunction_GET_SELF(func);
29549     if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
29550         return NULL;
29551     result = cfunc(self, arg);
29552     Py_LeaveRecursiveCall();
29553     if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
29554         PyErr_SetString(
29555             PyExc_SystemError,
29556             "NULL result without error in PyObject_Call");
29557     }
29558     return result;
29559 }
29560 #endif
29561 
29562 /* PyObjectCallOneArg */
29563       #if CYTHON_COMPILING_IN_CPYTHON
29564 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
29565     PyObject *result;
29566     PyObject *args = PyTuple_New(1);
29567     if (unlikely(!args)) return NULL;
29568     Py_INCREF(arg);
29569     PyTuple_SET_ITEM(args, 0, arg);
29570     result = __Pyx_PyObject_Call(func, args, NULL);
29571     Py_DECREF(args);
29572     return result;
29573 }
29574 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
29575 #if CYTHON_FAST_PYCALL
29576     if (PyFunction_Check(func)) {
29577         return __Pyx_PyFunction_FastCall(func, &arg, 1);
29578     }
29579 #endif
29580     if (likely(PyCFunction_Check(func))) {
29581         if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
29582             return __Pyx_PyObject_CallMethO(func, arg);
29583 #if CYTHON_FAST_PYCCALL
29584         } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
29585             return __Pyx_PyCFunction_FastCall(func, &arg, 1);
29586 #endif
29587         }
29588     }
29589     return __Pyx__PyObject_CallOneArg(func, arg);
29590 }
29591 #else
29592 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
29593     PyObject *result;
29594     PyObject *args = PyTuple_Pack(1, arg);
29595     if (unlikely(!args)) return NULL;
29596     result = __Pyx_PyObject_Call(func, args, NULL);
29597     Py_DECREF(args);
29598     return result;
29599 }
29600 #endif
29601 
29602 /* RaiseNoneIterError */
29603       static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
29604     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
29605 }
29606 
29607 /* GetTopmostException */
29608       #if CYTHON_USE_EXC_INFO_STACK
29609 static _PyErr_StackItem *
29610 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
29611 {
29612     _PyErr_StackItem *exc_info = tstate->exc_info;
29613     while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
29614            exc_info->previous_item != NULL)
29615     {
29616         exc_info = exc_info->previous_item;
29617     }
29618     return exc_info;
29619 }
29620 #endif
29621 
29622 /* SaveResetException */
29623       #if CYTHON_FAST_THREAD_STATE
29624 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
29625     #if CYTHON_USE_EXC_INFO_STACK
29626     _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
29627     *type = exc_info->exc_type;
29628     *value = exc_info->exc_value;
29629     *tb = exc_info->exc_traceback;
29630     #else
29631     *type = tstate->exc_type;
29632     *value = tstate->exc_value;
29633     *tb = tstate->exc_traceback;
29634     #endif
29635     Py_XINCREF(*type);
29636     Py_XINCREF(*value);
29637     Py_XINCREF(*tb);
29638 }
29639 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
29640     PyObject *tmp_type, *tmp_value, *tmp_tb;
29641     #if CYTHON_USE_EXC_INFO_STACK
29642     _PyErr_StackItem *exc_info = tstate->exc_info;
29643     tmp_type = exc_info->exc_type;
29644     tmp_value = exc_info->exc_value;
29645     tmp_tb = exc_info->exc_traceback;
29646     exc_info->exc_type = type;
29647     exc_info->exc_value = value;
29648     exc_info->exc_traceback = tb;
29649     #else
29650     tmp_type = tstate->exc_type;
29651     tmp_value = tstate->exc_value;
29652     tmp_tb = tstate->exc_traceback;
29653     tstate->exc_type = type;
29654     tstate->exc_value = value;
29655     tstate->exc_traceback = tb;
29656     #endif
29657     Py_XDECREF(tmp_type);
29658     Py_XDECREF(tmp_value);
29659     Py_XDECREF(tmp_tb);
29660 }
29661 #endif
29662 
29663 /* PyErrExceptionMatches */
29664       #if CYTHON_FAST_THREAD_STATE
29665 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
29666     Py_ssize_t i, n;
29667     n = PyTuple_GET_SIZE(tuple);
29668 #if PY_MAJOR_VERSION >= 3
29669     for (i=0; i<n; i++) {
29670         if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
29671     }
29672 #endif
29673     for (i=0; i<n; i++) {
29674         if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
29675     }
29676     return 0;
29677 }
29678 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
29679     PyObject *exc_type = tstate->curexc_type;
29680     if (exc_type == err) return 1;
29681     if (unlikely(!exc_type)) return 0;
29682     if (unlikely(PyTuple_Check(err)))
29683         return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
29684     return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
29685 }
29686 #endif
29687 
29688 /* GetException */
29689       #if CYTHON_FAST_THREAD_STATE
29690 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
29691 #else
29692 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
29693 #endif
29694 {
29695     PyObject *local_type, *local_value, *local_tb;
29696 #if CYTHON_FAST_THREAD_STATE
29697     PyObject *tmp_type, *tmp_value, *tmp_tb;
29698     local_type = tstate->curexc_type;
29699     local_value = tstate->curexc_value;
29700     local_tb = tstate->curexc_traceback;
29701     tstate->curexc_type = 0;
29702     tstate->curexc_value = 0;
29703     tstate->curexc_traceback = 0;
29704 #else
29705     PyErr_Fetch(&local_type, &local_value, &local_tb);
29706 #endif
29707     PyErr_NormalizeException(&local_type, &local_value, &local_tb);
29708 #if CYTHON_FAST_THREAD_STATE
29709     if (unlikely(tstate->curexc_type))
29710 #else
29711     if (unlikely(PyErr_Occurred()))
29712 #endif
29713         goto bad;
29714     #if PY_MAJOR_VERSION >= 3
29715     if (local_tb) {
29716         if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
29717             goto bad;
29718     }
29719     #endif
29720     Py_XINCREF(local_tb);
29721     Py_XINCREF(local_type);
29722     Py_XINCREF(local_value);
29723     *type = local_type;
29724     *value = local_value;
29725     *tb = local_tb;
29726 #if CYTHON_FAST_THREAD_STATE
29727     #if CYTHON_USE_EXC_INFO_STACK
29728     {
29729         _PyErr_StackItem *exc_info = tstate->exc_info;
29730         tmp_type = exc_info->exc_type;
29731         tmp_value = exc_info->exc_value;
29732         tmp_tb = exc_info->exc_traceback;
29733         exc_info->exc_type = local_type;
29734         exc_info->exc_value = local_value;
29735         exc_info->exc_traceback = local_tb;
29736     }
29737     #else
29738     tmp_type = tstate->exc_type;
29739     tmp_value = tstate->exc_value;
29740     tmp_tb = tstate->exc_traceback;
29741     tstate->exc_type = local_type;
29742     tstate->exc_value = local_value;
29743     tstate->exc_traceback = local_tb;
29744     #endif
29745     Py_XDECREF(tmp_type);
29746     Py_XDECREF(tmp_value);
29747     Py_XDECREF(tmp_tb);
29748 #else
29749     PyErr_SetExcInfo(local_type, local_value, local_tb);
29750 #endif
29751     return 0;
29752 bad:
29753     *type = 0;
29754     *value = 0;
29755     *tb = 0;
29756     Py_XDECREF(local_type);
29757     Py_XDECREF(local_value);
29758     Py_XDECREF(local_tb);
29759     return -1;
29760 }
29761 
29762 /* GetAttr */
29763       static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
29764 #if CYTHON_USE_TYPE_SLOTS
29765 #if PY_MAJOR_VERSION >= 3
29766     if (likely(PyUnicode_Check(n)))
29767 #else
29768     if (likely(PyString_Check(n)))
29769 #endif
29770         return __Pyx_PyObject_GetAttrStr(o, n);
29771 #endif
29772     return PyObject_GetAttr(o, n);
29773 }
29774 
29775 /* HasAttr */
29776       static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
29777     PyObject *r;
29778     if (unlikely(!__Pyx_PyBaseString_Check(n))) {
29779         PyErr_SetString(PyExc_TypeError,
29780                         "hasattr(): attribute name must be string");
29781         return -1;
29782     }
29783     r = __Pyx_GetAttr(o, n);
29784     if (unlikely(!r)) {
29785         PyErr_Clear();
29786         return 0;
29787     } else {
29788         Py_DECREF(r);
29789         return 1;
29790     }
29791 }
29792 
29793 /* BytesEquals */
29794       static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
29795 #if CYTHON_COMPILING_IN_PYPY
29796     return PyObject_RichCompareBool(s1, s2, equals);
29797 #else
29798     if (s1 == s2) {
29799         return (equals == Py_EQ);
29800     } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
29801         const char *ps1, *ps2;
29802         Py_ssize_t length = PyBytes_GET_SIZE(s1);
29803         if (length != PyBytes_GET_SIZE(s2))
29804             return (equals == Py_NE);
29805         ps1 = PyBytes_AS_STRING(s1);
29806         ps2 = PyBytes_AS_STRING(s2);
29807         if (ps1[0] != ps2[0]) {
29808             return (equals == Py_NE);
29809         } else if (length == 1) {
29810             return (equals == Py_EQ);
29811         } else {
29812             int result;
29813 #if CYTHON_USE_UNICODE_INTERNALS
29814             Py_hash_t hash1, hash2;
29815             hash1 = ((PyBytesObject*)s1)->ob_shash;
29816             hash2 = ((PyBytesObject*)s2)->ob_shash;
29817             if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
29818                 return (equals == Py_NE);
29819             }
29820 #endif
29821             result = memcmp(ps1, ps2, (size_t)length);
29822             return (equals == Py_EQ) ? (result == 0) : (result != 0);
29823         }
29824     } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
29825         return (equals == Py_NE);
29826     } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
29827         return (equals == Py_NE);
29828     } else {
29829         int result;
29830         PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
29831         if (!py_result)
29832             return -1;
29833         result = __Pyx_PyObject_IsTrue(py_result);
29834         Py_DECREF(py_result);
29835         return result;
29836     }
29837 #endif
29838 }
29839 
29840 /* UnicodeEquals */
29841       static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
29842 #if CYTHON_COMPILING_IN_PYPY
29843     return PyObject_RichCompareBool(s1, s2, equals);
29844 #else
29845 #if PY_MAJOR_VERSION < 3
29846     PyObject* owned_ref = NULL;
29847 #endif
29848     int s1_is_unicode, s2_is_unicode;
29849     if (s1 == s2) {
29850         goto return_eq;
29851     }
29852     s1_is_unicode = PyUnicode_CheckExact(s1);
29853     s2_is_unicode = PyUnicode_CheckExact(s2);
29854 #if PY_MAJOR_VERSION < 3
29855     if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
29856         owned_ref = PyUnicode_FromObject(s2);
29857         if (unlikely(!owned_ref))
29858             return -1;
29859         s2 = owned_ref;
29860         s2_is_unicode = 1;
29861     } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
29862         owned_ref = PyUnicode_FromObject(s1);
29863         if (unlikely(!owned_ref))
29864             return -1;
29865         s1 = owned_ref;
29866         s1_is_unicode = 1;
29867     } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
29868         return __Pyx_PyBytes_Equals(s1, s2, equals);
29869     }
29870 #endif
29871     if (s1_is_unicode & s2_is_unicode) {
29872         Py_ssize_t length;
29873         int kind;
29874         void *data1, *data2;
29875         if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
29876             return -1;
29877         length = __Pyx_PyUnicode_GET_LENGTH(s1);
29878         if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
29879             goto return_ne;
29880         }
29881 #if CYTHON_USE_UNICODE_INTERNALS
29882         {
29883             Py_hash_t hash1, hash2;
29884         #if CYTHON_PEP393_ENABLED
29885             hash1 = ((PyASCIIObject*)s1)->hash;
29886             hash2 = ((PyASCIIObject*)s2)->hash;
29887         #else
29888             hash1 = ((PyUnicodeObject*)s1)->hash;
29889             hash2 = ((PyUnicodeObject*)s2)->hash;
29890         #endif
29891             if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
29892                 goto return_ne;
29893             }
29894         }
29895 #endif
29896         kind = __Pyx_PyUnicode_KIND(s1);
29897         if (kind != __Pyx_PyUnicode_KIND(s2)) {
29898             goto return_ne;
29899         }
29900         data1 = __Pyx_PyUnicode_DATA(s1);
29901         data2 = __Pyx_PyUnicode_DATA(s2);
29902         if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
29903             goto return_ne;
29904         } else if (length == 1) {
29905             goto return_eq;
29906         } else {
29907             int result = memcmp(data1, data2, (size_t)(length * kind));
29908             #if PY_MAJOR_VERSION < 3
29909             Py_XDECREF(owned_ref);
29910             #endif
29911             return (equals == Py_EQ) ? (result == 0) : (result != 0);
29912         }
29913     } else if ((s1 == Py_None) & s2_is_unicode) {
29914         goto return_ne;
29915     } else if ((s2 == Py_None) & s1_is_unicode) {
29916         goto return_ne;
29917     } else {
29918         int result;
29919         PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
29920         #if PY_MAJOR_VERSION < 3
29921         Py_XDECREF(owned_ref);
29922         #endif
29923         if (!py_result)
29924             return -1;
29925         result = __Pyx_PyObject_IsTrue(py_result);
29926         Py_DECREF(py_result);
29927         return result;
29928     }
29929 return_eq:
29930     #if PY_MAJOR_VERSION < 3
29931     Py_XDECREF(owned_ref);
29932     #endif
29933     return (equals == Py_EQ);
29934 return_ne:
29935     #if PY_MAJOR_VERSION < 3
29936     Py_XDECREF(owned_ref);
29937     #endif
29938     return (equals == Py_NE);
29939 #endif
29940 }
29941 
29942 /* PyObjectCall2Args */
29943       static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
29944     PyObject *args, *result = NULL;
29945     #if CYTHON_FAST_PYCALL
29946     if (PyFunction_Check(function)) {
29947         PyObject *args[2] = {arg1, arg2};
29948         return __Pyx_PyFunction_FastCall(function, args, 2);
29949     }
29950     #endif
29951     #if CYTHON_FAST_PYCCALL
29952     if (__Pyx_PyFastCFunction_Check(function)) {
29953         PyObject *args[2] = {arg1, arg2};
29954         return __Pyx_PyCFunction_FastCall(function, args, 2);
29955     }
29956     #endif
29957     args = PyTuple_New(2);
29958     if (unlikely(!args)) goto done;
29959     Py_INCREF(arg1);
29960     PyTuple_SET_ITEM(args, 0, arg1);
29961     Py_INCREF(arg2);
29962     PyTuple_SET_ITEM(args, 1, arg2);
29963     Py_INCREF(function);
29964     result = __Pyx_PyObject_Call(function, args, NULL);
29965     Py_DECREF(args);
29966     Py_DECREF(function);
29967 done:
29968     return result;
29969 }
29970 
29971 /* BufferIndexError */
29972       static void __Pyx_RaiseBufferIndexError(int axis) {
29973   PyErr_Format(PyExc_IndexError,
29974      "Out of bounds on buffer access (axis %d)", axis);
29975 }
29976 
29977 /* WriteUnraisableException */
29978       static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
29979                                   CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
29980                                   int full_traceback, CYTHON_UNUSED int nogil) {
29981     PyObject *old_exc, *old_val, *old_tb;
29982     PyObject *ctx;
29983     __Pyx_PyThreadState_declare
29984 #ifdef WITH_THREAD
29985     PyGILState_STATE state;
29986     if (nogil)
29987         state = PyGILState_Ensure();
29988 #ifdef _MSC_VER
29989     else state = (PyGILState_STATE)-1;
29990 #endif
29991 #endif
29992     __Pyx_PyThreadState_assign
29993     __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
29994     if (full_traceback) {
29995         Py_XINCREF(old_exc);
29996         Py_XINCREF(old_val);
29997         Py_XINCREF(old_tb);
29998         __Pyx_ErrRestore(old_exc, old_val, old_tb);
29999         PyErr_PrintEx(1);
30000     }
30001     #if PY_MAJOR_VERSION < 3
30002     ctx = PyString_FromString(name);
30003     #else
30004     ctx = PyUnicode_FromString(name);
30005     #endif
30006     __Pyx_ErrRestore(old_exc, old_val, old_tb);
30007     if (!ctx) {
30008         PyErr_WriteUnraisable(Py_None);
30009     } else {
30010         PyErr_WriteUnraisable(ctx);
30011         Py_DECREF(ctx);
30012     }
30013 #ifdef WITH_THREAD
30014     if (nogil)
30015         PyGILState_Release(state);
30016 #endif
30017 }
30018 
30019 /* None */
30020       static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
30021     Py_ssize_t q = a / b;
30022     Py_ssize_t r = a - q*b;
30023     q -= ((r != 0) & ((r ^ b) < 0));
30024     return q;
30025 }
30026 
30027 /* decode_c_string */
30028       static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
30029          const char* cstring, Py_ssize_t start, Py_ssize_t stop,
30030          const char* encoding, const char* errors,
30031          PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
30032     Py_ssize_t length;
30033     if (unlikely((start < 0) | (stop < 0))) {
30034         size_t slen = strlen(cstring);
30035         if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
30036             PyErr_SetString(PyExc_OverflowError,
30037                             "c-string too long to convert to Python");
30038             return NULL;
30039         }
30040         length = (Py_ssize_t) slen;
30041         if (start < 0) {
30042             start += length;
30043             if (start < 0)
30044                 start = 0;
30045         }
30046         if (stop < 0)
30047             stop += length;
30048     }
30049     length = stop - start;
30050     if (unlikely(length <= 0))
30051         return PyUnicode_FromUnicode(NULL, 0);
30052     cstring += start;
30053     if (decode_func) {
30054         return decode_func(cstring, length, errors);
30055     } else {
30056         return PyUnicode_Decode(cstring, length, encoding, errors);
30057     }
30058 }
30059 
30060 /* GetAttr3 */
30061       static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
30062     __Pyx_PyThreadState_declare
30063     __Pyx_PyThreadState_assign
30064     if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
30065         return NULL;
30066     __Pyx_PyErr_Clear();
30067     Py_INCREF(d);
30068     return d;
30069 }
30070 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
30071     PyObject *r = __Pyx_GetAttr(o, n);
30072     return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
30073 }
30074 
30075 /* SwapException */
30076       #if CYTHON_FAST_THREAD_STATE
30077 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
30078     PyObject *tmp_type, *tmp_value, *tmp_tb;
30079     #if CYTHON_USE_EXC_INFO_STACK
30080     _PyErr_StackItem *exc_info = tstate->exc_info;
30081     tmp_type = exc_info->exc_type;
30082     tmp_value = exc_info->exc_value;
30083     tmp_tb = exc_info->exc_traceback;
30084     exc_info->exc_type = *type;
30085     exc_info->exc_value = *value;
30086     exc_info->exc_traceback = *tb;
30087     #else
30088     tmp_type = tstate->exc_type;
30089     tmp_value = tstate->exc_value;
30090     tmp_tb = tstate->exc_traceback;
30091     tstate->exc_type = *type;
30092     tstate->exc_value = *value;
30093     tstate->exc_traceback = *tb;
30094     #endif
30095     *type = tmp_type;
30096     *value = tmp_value;
30097     *tb = tmp_tb;
30098 }
30099 #else
30100 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
30101     PyObject *tmp_type, *tmp_value, *tmp_tb;
30102     PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
30103     PyErr_SetExcInfo(*type, *value, *tb);
30104     *type = tmp_type;
30105     *value = tmp_value;
30106     *tb = tmp_tb;
30107 }
30108 #endif
30109 
30110 /* Import */
30111       static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
30112     PyObject *empty_list = 0;
30113     PyObject *module = 0;
30114     PyObject *global_dict = 0;
30115     PyObject *empty_dict = 0;
30116     PyObject *list;
30117     #if PY_MAJOR_VERSION < 3
30118     PyObject *py_import;
30119     py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
30120     if (!py_import)
30121         goto bad;
30122     #endif
30123     if (from_list)
30124         list = from_list;
30125     else {
30126         empty_list = PyList_New(0);
30127         if (!empty_list)
30128             goto bad;
30129         list = empty_list;
30130     }
30131     global_dict = PyModule_GetDict(__pyx_m);
30132     if (!global_dict)
30133         goto bad;
30134     empty_dict = PyDict_New();
30135     if (!empty_dict)
30136         goto bad;
30137     {
30138         #if PY_MAJOR_VERSION >= 3
30139         if (level == -1) {
30140             if (strchr(__Pyx_MODULE_NAME, '.')) {
30141                 module = PyImport_ImportModuleLevelObject(
30142                     name, global_dict, empty_dict, list, 1);
30143                 if (!module) {
30144                     if (!PyErr_ExceptionMatches(PyExc_ImportError))
30145                         goto bad;
30146                     PyErr_Clear();
30147                 }
30148             }
30149             level = 0;
30150         }
30151         #endif
30152         if (!module) {
30153             #if PY_MAJOR_VERSION < 3
30154             PyObject *py_level = PyInt_FromLong(level);
30155             if (!py_level)
30156                 goto bad;
30157             module = PyObject_CallFunctionObjArgs(py_import,
30158                 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
30159             Py_DECREF(py_level);
30160             #else
30161             module = PyImport_ImportModuleLevelObject(
30162                 name, global_dict, empty_dict, list, level);
30163             #endif
30164         }
30165     }
30166 bad:
30167     #if PY_MAJOR_VERSION < 3
30168     Py_XDECREF(py_import);
30169     #endif
30170     Py_XDECREF(empty_list);
30171     Py_XDECREF(empty_dict);
30172     return module;
30173 }
30174 
30175 /* FastTypeChecks */
30176       #if CYTHON_COMPILING_IN_CPYTHON
30177 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
30178     while (a) {
30179         a = a->tp_base;
30180         if (a == b)
30181             return 1;
30182     }
30183     return b == &PyBaseObject_Type;
30184 }
30185 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
30186     PyObject *mro;
30187     if (a == b) return 1;
30188     mro = a->tp_mro;
30189     if (likely(mro)) {
30190         Py_ssize_t i, n;
30191         n = PyTuple_GET_SIZE(mro);
30192         for (i = 0; i < n; i++) {
30193             if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
30194                 return 1;
30195         }
30196         return 0;
30197     }
30198     return __Pyx_InBases(a, b);
30199 }
30200 #if PY_MAJOR_VERSION == 2
30201 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
30202     PyObject *exception, *value, *tb;
30203     int res;
30204     __Pyx_PyThreadState_declare
30205     __Pyx_PyThreadState_assign
30206     __Pyx_ErrFetch(&exception, &value, &tb);
30207     res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
30208     if (unlikely(res == -1)) {
30209         PyErr_WriteUnraisable(err);
30210         res = 0;
30211     }
30212     if (!res) {
30213         res = PyObject_IsSubclass(err, exc_type2);
30214         if (unlikely(res == -1)) {
30215             PyErr_WriteUnraisable(err);
30216             res = 0;
30217         }
30218     }
30219     __Pyx_ErrRestore(exception, value, tb);
30220     return res;
30221 }
30222 #else
30223 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
30224     int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
30225     if (!res) {
30226         res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
30227     }
30228     return res;
30229 }
30230 #endif
30231 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
30232     Py_ssize_t i, n;
30233     assert(PyExceptionClass_Check(exc_type));
30234     n = PyTuple_GET_SIZE(tuple);
30235 #if PY_MAJOR_VERSION >= 3
30236     for (i=0; i<n; i++) {
30237         if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
30238     }
30239 #endif
30240     for (i=0; i<n; i++) {
30241         PyObject *t = PyTuple_GET_ITEM(tuple, i);
30242         #if PY_MAJOR_VERSION < 3
30243         if (likely(exc_type == t)) return 1;
30244         #endif
30245         if (likely(PyExceptionClass_Check(t))) {
30246             if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
30247         } else {
30248         }
30249     }
30250     return 0;
30251 }
30252 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
30253     if (likely(err == exc_type)) return 1;
30254     if (likely(PyExceptionClass_Check(err))) {
30255         if (likely(PyExceptionClass_Check(exc_type))) {
30256             return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
30257         } else if (likely(PyTuple_Check(exc_type))) {
30258             return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
30259         } else {
30260         }
30261     }
30262     return PyErr_GivenExceptionMatches(err, exc_type);
30263 }
30264 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
30265     assert(PyExceptionClass_Check(exc_type1));
30266     assert(PyExceptionClass_Check(exc_type2));
30267     if (likely(err == exc_type1 || err == exc_type2)) return 1;
30268     if (likely(PyExceptionClass_Check(err))) {
30269         return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
30270     }
30271     return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
30272 }
30273 #endif
30274 
30275 /* PyIntBinop */
30276       #if !CYTHON_COMPILING_IN_PYPY
30277 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
30278     (void)inplace;
30279     (void)zerodivision_check;
30280     #if PY_MAJOR_VERSION < 3
30281     if (likely(PyInt_CheckExact(op1))) {
30282         const long b = intval;
30283         long x;
30284         long a = PyInt_AS_LONG(op1);
30285             x = (long)((unsigned long)a + b);
30286             if (likely((x^a) >= 0 || (x^b) >= 0))
30287                 return PyInt_FromLong(x);
30288             return PyLong_Type.tp_as_number->nb_add(op1, op2);
30289     }
30290     #endif
30291     #if CYTHON_USE_PYLONG_INTERNALS
30292     if (likely(PyLong_CheckExact(op1))) {
30293         const long b = intval;
30294         long a, x;
30295 #ifdef HAVE_LONG_LONG
30296         const PY_LONG_LONG llb = intval;
30297         PY_LONG_LONG lla, llx;
30298 #endif
30299         const digit* digits = ((PyLongObject*)op1)->ob_digit;
30300         const Py_ssize_t size = Py_SIZE(op1);
30301         if (likely(__Pyx_sst_abs(size) <= 1)) {
30302             a = likely(size) ? digits[0] : 0;
30303             if (size == -1) a = -a;
30304         } else {
30305             switch (size) {
30306                 case -2:
30307                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
30308                         a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
30309                         break;
30310 #ifdef HAVE_LONG_LONG
30311                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
30312                         lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
30313                         goto long_long;
30314 #endif
30315                     }
30316                     CYTHON_FALLTHROUGH;
30317                 case 2:
30318                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
30319                         a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
30320                         break;
30321 #ifdef HAVE_LONG_LONG
30322                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
30323                         lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
30324                         goto long_long;
30325 #endif
30326                     }
30327                     CYTHON_FALLTHROUGH;
30328                 case -3:
30329                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
30330                         a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
30331                         break;
30332 #ifdef HAVE_LONG_LONG
30333                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
30334                         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]));
30335                         goto long_long;
30336 #endif
30337                     }
30338                     CYTHON_FALLTHROUGH;
30339                 case 3:
30340                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
30341                         a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
30342                         break;
30343 #ifdef HAVE_LONG_LONG
30344                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
30345                         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]));
30346                         goto long_long;
30347 #endif
30348                     }
30349                     CYTHON_FALLTHROUGH;
30350                 case -4:
30351                     if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
30352                         a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
30353                         break;
30354 #ifdef HAVE_LONG_LONG
30355                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
30356                         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]));
30357                         goto long_long;
30358 #endif
30359                     }
30360                     CYTHON_FALLTHROUGH;
30361                 case 4:
30362                     if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
30363                         a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
30364                         break;
30365 #ifdef HAVE_LONG_LONG
30366                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
30367                         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]));
30368                         goto long_long;
30369 #endif
30370                     }
30371                     CYTHON_FALLTHROUGH;
30372                 default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
30373             }
30374         }
30375                 x = a + b;
30376             return PyLong_FromLong(x);
30377 #ifdef HAVE_LONG_LONG
30378         long_long:
30379                 llx = lla + llb;
30380             return PyLong_FromLongLong(llx);
30381 #endif
30382 
30383 
30384     }
30385     #endif
30386     if (PyFloat_CheckExact(op1)) {
30387         const long b = intval;
30388         double a = PyFloat_AS_DOUBLE(op1);
30389             double result;
30390             PyFPE_START_PROTECT("add", return NULL)
30391             result = ((double)a) + (double)b;
30392             PyFPE_END_PROTECT(result)
30393             return PyFloat_FromDouble(result);
30394     }
30395     return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
30396 }
30397 #endif
30398 
30399 /* None */
30400       static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
30401     PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
30402 }
30403 
30404 /* None */
30405       static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
30406     long q = a / b;
30407     long r = a - q*b;
30408     q -= ((r != 0) & ((r ^ b) < 0));
30409     return q;
30410 }
30411 
30412 /* ImportFrom */
30413       static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
30414     PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
30415     if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
30416         PyErr_Format(PyExc_ImportError,
30417         #if PY_MAJOR_VERSION < 3
30418             "cannot import name %.230s", PyString_AS_STRING(name));
30419         #else
30420             "cannot import name %S", name);
30421         #endif
30422     }
30423     return value;
30424 }
30425 
30426 /* PyObject_GenericGetAttrNoDict */
30427       #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
30428 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
30429     PyErr_Format(PyExc_AttributeError,
30430 #if PY_MAJOR_VERSION >= 3
30431                  "'%.50s' object has no attribute '%U'",
30432                  tp->tp_name, attr_name);
30433 #else
30434                  "'%.50s' object has no attribute '%.400s'",
30435                  tp->tp_name, PyString_AS_STRING(attr_name));
30436 #endif
30437     return NULL;
30438 }
30439 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
30440     PyObject *descr;
30441     PyTypeObject *tp = Py_TYPE(obj);
30442     if (unlikely(!PyString_Check(attr_name))) {
30443         return PyObject_GenericGetAttr(obj, attr_name);
30444     }
30445     assert(!tp->tp_dictoffset);
30446     descr = _PyType_Lookup(tp, attr_name);
30447     if (unlikely(!descr)) {
30448         return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
30449     }
30450     Py_INCREF(descr);
30451     #if PY_MAJOR_VERSION < 3
30452     if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
30453     #endif
30454     {
30455         descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
30456         if (unlikely(f)) {
30457             PyObject *res = f(descr, obj, (PyObject *)tp);
30458             Py_DECREF(descr);
30459             return res;
30460         }
30461     }
30462     return descr;
30463 }
30464 #endif
30465 
30466 /* PyObject_GenericGetAttr */
30467       #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
30468 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
30469     if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
30470         return PyObject_GenericGetAttr(obj, attr_name);
30471     }
30472     return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
30473 }
30474 #endif
30475 
30476 /* SetVTable */
30477       static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
30478 #if PY_VERSION_HEX >= 0x02070000
30479     PyObject *ob = PyCapsule_New(vtable, 0, 0);
30480 #else
30481     PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
30482 #endif
30483     if (!ob)
30484         goto bad;
30485     if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
30486         goto bad;
30487     Py_DECREF(ob);
30488     return 0;
30489 bad:
30490     Py_XDECREF(ob);
30491     return -1;
30492 }
30493 
30494 /* SetupReduce */
30495       static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
30496   int ret;
30497   PyObject *name_attr;
30498   name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
30499   if (likely(name_attr)) {
30500       ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
30501   } else {
30502       ret = -1;
30503   }
30504   if (unlikely(ret < 0)) {
30505       PyErr_Clear();
30506       ret = 0;
30507   }
30508   Py_XDECREF(name_attr);
30509   return ret;
30510 }
30511 static int __Pyx_setup_reduce(PyObject* type_obj) {
30512     int ret = 0;
30513     PyObject *object_reduce = NULL;
30514     PyObject *object_reduce_ex = NULL;
30515     PyObject *reduce = NULL;
30516     PyObject *reduce_ex = NULL;
30517     PyObject *reduce_cython = NULL;
30518     PyObject *setstate = NULL;
30519     PyObject *setstate_cython = NULL;
30520 #if CYTHON_USE_PYTYPE_LOOKUP
30521     if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto GOOD;
30522 #else
30523     if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto GOOD;
30524 #endif
30525 #if CYTHON_USE_PYTYPE_LOOKUP
30526     object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
30527 #else
30528     object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
30529 #endif
30530     reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto BAD;
30531     if (reduce_ex == object_reduce_ex) {
30532 #if CYTHON_USE_PYTYPE_LOOKUP
30533         object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
30534 #else
30535         object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
30536 #endif
30537         reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto BAD;
30538         if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
30539             reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto BAD;
30540             ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto BAD;
30541             ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto BAD;
30542             setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
30543             if (!setstate) PyErr_Clear();
30544             if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
30545                 setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto BAD;
30546                 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto BAD;
30547                 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto BAD;
30548             }
30549             PyType_Modified((PyTypeObject*)type_obj);
30550         }
30551     }
30552     goto GOOD;
30553 BAD:
30554     if (!PyErr_Occurred())
30555         PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
30556     ret = -1;
30557 GOOD:
30558 #if !CYTHON_USE_PYTYPE_LOOKUP
30559     Py_XDECREF(object_reduce);
30560     Py_XDECREF(object_reduce_ex);
30561 #endif
30562     Py_XDECREF(reduce);
30563     Py_XDECREF(reduce_ex);
30564     Py_XDECREF(reduce_cython);
30565     Py_XDECREF(setstate);
30566     Py_XDECREF(setstate_cython);
30567     return ret;
30568 }
30569 
30570 /* TypeImport */
30571       #ifndef __PYX_HAVE_RT_ImportType
30572 #define __PYX_HAVE_RT_ImportType
30573 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
30574     size_t size, enum __Pyx_ImportType_CheckSize check_size)
30575 {
30576     PyObject *result = 0;
30577     char warning[200];
30578     Py_ssize_t basicsize;
30579 #ifdef Py_LIMITED_API
30580     PyObject *py_basicsize;
30581 #endif
30582     result = PyObject_GetAttrString(module, class_name);
30583     if (!result)
30584         goto bad;
30585     if (!PyType_Check(result)) {
30586         PyErr_Format(PyExc_TypeError,
30587             "%.200s.%.200s is not a type object",
30588             module_name, class_name);
30589         goto bad;
30590     }
30591 #ifndef Py_LIMITED_API
30592     basicsize = ((PyTypeObject *)result)->tp_basicsize;
30593 #else
30594     py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
30595     if (!py_basicsize)
30596         goto bad;
30597     basicsize = PyLong_AsSsize_t(py_basicsize);
30598     Py_DECREF(py_basicsize);
30599     py_basicsize = 0;
30600     if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
30601         goto bad;
30602 #endif
30603     if ((size_t)basicsize < size) {
30604         PyErr_Format(PyExc_ValueError,
30605             "%.200s.%.200s size changed, may indicate binary incompatibility. "
30606             "Expected %zd from C header, got %zd from PyObject",
30607             module_name, class_name, size, basicsize);
30608         goto bad;
30609     }
30610     if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
30611         PyErr_Format(PyExc_ValueError,
30612             "%.200s.%.200s size changed, may indicate binary incompatibility. "
30613             "Expected %zd from C header, got %zd from PyObject",
30614             module_name, class_name, size, basicsize);
30615         goto bad;
30616     }
30617     else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
30618         PyOS_snprintf(warning, sizeof(warning),
30619             "%s.%s size changed, may indicate binary incompatibility. "
30620             "Expected %zd from C header, got %zd from PyObject",
30621             module_name, class_name, size, basicsize);
30622         if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
30623     }
30624     return (PyTypeObject *)result;
30625 bad:
30626     Py_XDECREF(result);
30627     return NULL;
30628 }
30629 #endif
30630 
30631 /* GetVTable */
30632       static void* __Pyx_GetVtable(PyObject *dict) {
30633     void* ptr;
30634     PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable);
30635     if (!ob)
30636         goto bad;
30637 #if PY_VERSION_HEX >= 0x02070000
30638     ptr = PyCapsule_GetPointer(ob, 0);
30639 #else
30640     ptr = PyCObject_AsVoidPtr(ob);
30641 #endif
30642     if (!ptr && !PyErr_Occurred())
30643         PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
30644     Py_DECREF(ob);
30645     return ptr;
30646 bad:
30647     Py_XDECREF(ob);
30648     return NULL;
30649 }
30650 
30651 /* CLineInTraceback */
30652       #ifndef CYTHON_CLINE_IN_TRACEBACK
30653 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
30654     PyObject *use_cline;
30655     PyObject *ptype, *pvalue, *ptraceback;
30656 #if CYTHON_COMPILING_IN_CPYTHON
30657     PyObject **cython_runtime_dict;
30658 #endif
30659     if (unlikely(!__pyx_cython_runtime)) {
30660         return c_line;
30661     }
30662     __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
30663 #if CYTHON_COMPILING_IN_CPYTHON
30664     cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
30665     if (likely(cython_runtime_dict)) {
30666         __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
30667             use_cline, *cython_runtime_dict,
30668             __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
30669     } else
30670 #endif
30671     {
30672       PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
30673       if (use_cline_obj) {
30674         use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
30675         Py_DECREF(use_cline_obj);
30676       } else {
30677         PyErr_Clear();
30678         use_cline = NULL;
30679       }
30680     }
30681     if (!use_cline) {
30682         c_line = 0;
30683         PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
30684     }
30685     else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
30686         c_line = 0;
30687     }
30688     __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
30689     return c_line;
30690 }
30691 #endif
30692 
30693 /* CodeObjectCache */
30694       static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
30695     int start = 0, mid = 0, end = count - 1;
30696     if (end >= 0 && code_line > entries[end].code_line) {
30697         return count;
30698     }
30699     while (start < end) {
30700         mid = start + (end - start) / 2;
30701         if (code_line < entries[mid].code_line) {
30702             end = mid;
30703         } else if (code_line > entries[mid].code_line) {
30704              start = mid + 1;
30705         } else {
30706             return mid;
30707         }
30708     }
30709     if (code_line <= entries[mid].code_line) {
30710         return mid;
30711     } else {
30712         return mid + 1;
30713     }
30714 }
30715 static PyCodeObject *__pyx_find_code_object(int code_line) {
30716     PyCodeObject* code_object;
30717     int pos;
30718     if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
30719         return NULL;
30720     }
30721     pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
30722     if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
30723         return NULL;
30724     }
30725     code_object = __pyx_code_cache.entries[pos].code_object;
30726     Py_INCREF(code_object);
30727     return code_object;
30728 }
30729 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
30730     int pos, i;
30731     __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
30732     if (unlikely(!code_line)) {
30733         return;
30734     }
30735     if (unlikely(!entries)) {
30736         entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
30737         if (likely(entries)) {
30738             __pyx_code_cache.entries = entries;
30739             __pyx_code_cache.max_count = 64;
30740             __pyx_code_cache.count = 1;
30741             entries[0].code_line = code_line;
30742             entries[0].code_object = code_object;
30743             Py_INCREF(code_object);
30744         }
30745         return;
30746     }
30747     pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
30748     if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
30749         PyCodeObject* tmp = entries[pos].code_object;
30750         entries[pos].code_object = code_object;
30751         Py_DECREF(tmp);
30752         return;
30753     }
30754     if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
30755         int new_max = __pyx_code_cache.max_count + 64;
30756         entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
30757             __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
30758         if (unlikely(!entries)) {
30759             return;
30760         }
30761         __pyx_code_cache.entries = entries;
30762         __pyx_code_cache.max_count = new_max;
30763     }
30764     for (i=__pyx_code_cache.count; i>pos; i--) {
30765         entries[i] = entries[i-1];
30766     }
30767     entries[pos].code_line = code_line;
30768     entries[pos].code_object = code_object;
30769     __pyx_code_cache.count++;
30770     Py_INCREF(code_object);
30771 }
30772 
30773 /* AddTraceback */
30774       #include "compile.h"
30775 #include "frameobject.h"
30776 #include "traceback.h"
30777 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
30778             const char *funcname, int c_line,
30779             int py_line, const char *filename) {
30780     PyCodeObject *py_code = 0;
30781     PyObject *py_srcfile = 0;
30782     PyObject *py_funcname = 0;
30783     #if PY_MAJOR_VERSION < 3
30784     py_srcfile = PyString_FromString(filename);
30785     #else
30786     py_srcfile = PyUnicode_FromString(filename);
30787     #endif
30788     if (!py_srcfile) goto bad;
30789     if (c_line) {
30790         #if PY_MAJOR_VERSION < 3
30791         py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
30792         #else
30793         py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
30794         #endif
30795     }
30796     else {
30797         #if PY_MAJOR_VERSION < 3
30798         py_funcname = PyString_FromString(funcname);
30799         #else
30800         py_funcname = PyUnicode_FromString(funcname);
30801         #endif
30802     }
30803     if (!py_funcname) goto bad;
30804     py_code = __Pyx_PyCode_New(
30805         0,
30806         0,
30807         0,
30808         0,
30809         0,
30810         __pyx_empty_bytes, /*PyObject *code,*/
30811         __pyx_empty_tuple, /*PyObject *consts,*/
30812         __pyx_empty_tuple, /*PyObject *names,*/
30813         __pyx_empty_tuple, /*PyObject *varnames,*/
30814         __pyx_empty_tuple, /*PyObject *freevars,*/
30815         __pyx_empty_tuple, /*PyObject *cellvars,*/
30816         py_srcfile,   /*PyObject *filename,*/
30817         py_funcname,  /*PyObject *name,*/
30818         py_line,
30819         __pyx_empty_bytes  /*PyObject *lnotab*/
30820     );
30821     Py_DECREF(py_srcfile);
30822     Py_DECREF(py_funcname);
30823     return py_code;
30824 bad:
30825     Py_XDECREF(py_srcfile);
30826     Py_XDECREF(py_funcname);
30827     return NULL;
30828 }
30829 static void __Pyx_AddTraceback(const char *funcname, int c_line,
30830                                int py_line, const char *filename) {
30831     PyCodeObject *py_code = 0;
30832     PyFrameObject *py_frame = 0;
30833     PyThreadState *tstate = __Pyx_PyThreadState_Current;
30834     if (c_line) {
30835         c_line = __Pyx_CLineForTraceback(tstate, c_line);
30836     }
30837     py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
30838     if (!py_code) {
30839         py_code = __Pyx_CreateCodeObjectForTraceback(
30840             funcname, c_line, py_line, filename);
30841         if (!py_code) goto bad;
30842         __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
30843     }
30844     py_frame = PyFrame_New(
30845         tstate,            /*PyThreadState *tstate,*/
30846         py_code,           /*PyCodeObject *code,*/
30847         __pyx_d,    /*PyObject *globals,*/
30848         0                  /*PyObject *locals*/
30849     );
30850     if (!py_frame) goto bad;
30851     __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
30852     PyTraceBack_Here(py_frame);
30853 bad:
30854     Py_XDECREF(py_code);
30855     Py_XDECREF(py_frame);
30856 }
30857 
30858 #if PY_MAJOR_VERSION < 3
30859 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
30860     if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
30861         if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
30862         if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
30863         if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
30864     PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
30865     return -1;
30866 }
30867 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
30868     PyObject *obj = view->obj;
30869     if (!obj) return;
30870     if (PyObject_CheckBuffer(obj)) {
30871         PyBuffer_Release(view);
30872         return;
30873     }
30874     if ((0)) {}
30875         else if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view);
30876     view->obj = NULL;
30877     Py_DECREF(obj);
30878 }
30879 #endif
30880 
30881 
30882       /* MemviewSliceIsContig */
30883       static int
30884 __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
30885 {
30886     int i, index, step, start;
30887     Py_ssize_t itemsize = mvs.memview->view.itemsize;
30888     if (order == 'F') {
30889         step = 1;
30890         start = 0;
30891     } else {
30892         step = -1;
30893         start = ndim - 1;
30894     }
30895     for (i = 0; i < ndim; i++) {
30896         index = start + step * i;
30897         if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
30898             return 0;
30899         itemsize *= mvs.shape[index];
30900     }
30901     return 1;
30902 }
30903 
30904 /* OverlappingSlices */
30905       static void
30906 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
30907                                void **out_start, void **out_end,
30908                                int ndim, size_t itemsize)
30909 {
30910     char *start, *end;
30911     int i;
30912     start = end = slice->data;
30913     for (i = 0; i < ndim; i++) {
30914         Py_ssize_t stride = slice->strides[i];
30915         Py_ssize_t extent = slice->shape[i];
30916         if (extent == 0) {
30917             *out_start = *out_end = start;
30918             return;
30919         } else {
30920             if (stride > 0)
30921                 end += stride * (extent - 1);
30922             else
30923                 start += stride * (extent - 1);
30924         }
30925     }
30926     *out_start = start;
30927     *out_end = end + itemsize;
30928 }
30929 static int
30930 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
30931                      __Pyx_memviewslice *slice2,
30932                      int ndim, size_t itemsize)
30933 {
30934     void *start1, *end1, *start2, *end2;
30935     __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
30936     __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
30937     return (start1 < end2) && (start2 < end1);
30938 }
30939 
30940 /* Capsule */
30941       static CYTHON_INLINE PyObject *
30942 __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
30943 {
30944     PyObject *cobj;
30945 #if PY_VERSION_HEX >= 0x02070000
30946     cobj = PyCapsule_New(p, sig, NULL);
30947 #else
30948     cobj = PyCObject_FromVoidPtr(p, NULL);
30949 #endif
30950     return cobj;
30951 }
30952 
30953 /* CIntFromPyVerify */
30954       #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
30955     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
30956 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
30957     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
30958 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
30959     {\
30960         func_type value = func_value;\
30961         if (sizeof(target_type) < sizeof(func_type)) {\
30962             if (unlikely(value != (func_type) (target_type) value)) {\
30963                 func_type zero = 0;\
30964                 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
30965                     return (target_type) -1;\
30966                 if (is_unsigned && unlikely(value < zero))\
30967                     goto raise_neg_overflow;\
30968                 else\
30969                     goto raise_overflow;\
30970             }\
30971         }\
30972         return (target_type) value;\
30973     }
30974 
30975 /* None */
30976       static CYTHON_INLINE __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t __Pyx_pow___pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t(__pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t b, __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t e) {
30977     __pyx_t_2yt_9frontends_6ramses_8io_utils_INT64_t t = b;
30978     switch (e) {
30979         case 3:
30980             t *= b;
30981         CYTHON_FALLTHROUGH;
30982         case 2:
30983             t *= b;
30984         CYTHON_FALLTHROUGH;
30985         case 1:
30986             return t;
30987         case 0:
30988             return 1;
30989     }
30990     #if 1
30991     if (unlikely(e<0)) return 0;
30992     #endif
30993     t = 1;
30994     while (likely(e)) {
30995         t *= (b * (e&1)) | ((~e)&1);
30996         b *= b;
30997         e >>= 1;
30998     }
30999     return t;
31000 }
31001 
31002 /* CIntToPy */
31003       static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value) {
31004     const npy_int64 neg_one = (npy_int64) ((npy_int64) 0 - (npy_int64) 1), const_zero = (npy_int64) 0;
31005     const int is_unsigned = neg_one > const_zero;
31006     if (is_unsigned) {
31007         if (sizeof(npy_int64) < sizeof(long)) {
31008             return PyInt_FromLong((long) value);
31009         } else if (sizeof(npy_int64) <= sizeof(unsigned long)) {
31010             return PyLong_FromUnsignedLong((unsigned long) value);
31011 #ifdef HAVE_LONG_LONG
31012         } else if (sizeof(npy_int64) <= sizeof(unsigned PY_LONG_LONG)) {
31013             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
31014 #endif
31015         }
31016     } else {
31017         if (sizeof(npy_int64) <= sizeof(long)) {
31018             return PyInt_FromLong((long) value);
31019 #ifdef HAVE_LONG_LONG
31020         } else if (sizeof(npy_int64) <= sizeof(PY_LONG_LONG)) {
31021             return PyLong_FromLongLong((PY_LONG_LONG) value);
31022 #endif
31023         }
31024     }
31025     {
31026         int one = 1; int little = (int)*(unsigned char *)&one;
31027         unsigned char *bytes = (unsigned char *)&value;
31028         return _PyLong_FromByteArray(bytes, sizeof(npy_int64),
31029                                      little, !is_unsigned);
31030     }
31031 }
31032 
31033 /* CIntToPy */
31034       static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value) {
31035     const npy_int32 neg_one = (npy_int32) ((npy_int32) 0 - (npy_int32) 1), const_zero = (npy_int32) 0;
31036     const int is_unsigned = neg_one > const_zero;
31037     if (is_unsigned) {
31038         if (sizeof(npy_int32) < sizeof(long)) {
31039             return PyInt_FromLong((long) value);
31040         } else if (sizeof(npy_int32) <= sizeof(unsigned long)) {
31041             return PyLong_FromUnsignedLong((unsigned long) value);
31042 #ifdef HAVE_LONG_LONG
31043         } else if (sizeof(npy_int32) <= sizeof(unsigned PY_LONG_LONG)) {
31044             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
31045 #endif
31046         }
31047     } else {
31048         if (sizeof(npy_int32) <= sizeof(long)) {
31049             return PyInt_FromLong((long) value);
31050 #ifdef HAVE_LONG_LONG
31051         } else if (sizeof(npy_int32) <= sizeof(PY_LONG_LONG)) {
31052             return PyLong_FromLongLong((PY_LONG_LONG) value);
31053 #endif
31054         }
31055     }
31056     {
31057         int one = 1; int little = (int)*(unsigned char *)&one;
31058         unsigned char *bytes = (unsigned char *)&value;
31059         return _PyLong_FromByteArray(bytes, sizeof(npy_int32),
31060                                      little, !is_unsigned);
31061     }
31062 }
31063 
31064 /* CIntToPy */
31065       static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
31066     const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
31067     const int is_unsigned = neg_one > const_zero;
31068     if (is_unsigned) {
31069         if (sizeof(int) < sizeof(long)) {
31070             return PyInt_FromLong((long) value);
31071         } else if (sizeof(int) <= sizeof(unsigned long)) {
31072             return PyLong_FromUnsignedLong((unsigned long) value);
31073 #ifdef HAVE_LONG_LONG
31074         } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
31075             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
31076 #endif
31077         }
31078     } else {
31079         if (sizeof(int) <= sizeof(long)) {
31080             return PyInt_FromLong((long) value);
31081 #ifdef HAVE_LONG_LONG
31082         } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
31083             return PyLong_FromLongLong((PY_LONG_LONG) value);
31084 #endif
31085         }
31086     }
31087     {
31088         int one = 1; int little = (int)*(unsigned char *)&one;
31089         unsigned char *bytes = (unsigned char *)&value;
31090         return _PyLong_FromByteArray(bytes, sizeof(int),
31091                                      little, !is_unsigned);
31092     }
31093 }
31094 
31095 /* CIntToPy */
31096       static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
31097     const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
31098     const int is_unsigned = neg_one > const_zero;
31099     if (is_unsigned) {
31100         if (sizeof(long) < sizeof(long)) {
31101             return PyInt_FromLong((long) value);
31102         } else if (sizeof(long) <= sizeof(unsigned long)) {
31103             return PyLong_FromUnsignedLong((unsigned long) value);
31104 #ifdef HAVE_LONG_LONG
31105         } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
31106             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
31107 #endif
31108         }
31109     } else {
31110         if (sizeof(long) <= sizeof(long)) {
31111             return PyInt_FromLong((long) value);
31112 #ifdef HAVE_LONG_LONG
31113         } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
31114             return PyLong_FromLongLong((PY_LONG_LONG) value);
31115 #endif
31116         }
31117     }
31118     {
31119         int one = 1; int little = (int)*(unsigned char *)&one;
31120         unsigned char *bytes = (unsigned char *)&value;
31121         return _PyLong_FromByteArray(bytes, sizeof(long),
31122                                      little, !is_unsigned);
31123     }
31124 }
31125 
31126 /* Declarations */
31127       #if CYTHON_CCOMPLEX
31128   #ifdef __cplusplus
31129     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
31130       return ::std::complex< float >(x, y);
31131     }
31132   #else
31133     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
31134       return x + y*(__pyx_t_float_complex)_Complex_I;
31135     }
31136   #endif
31137 #else
31138     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
31139       __pyx_t_float_complex z;
31140       z.real = x;
31141       z.imag = y;
31142       return z;
31143     }
31144 #endif
31145 
31146 /* Arithmetic */
31147       #if CYTHON_CCOMPLEX
31148 #else
31149     static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
31150        return (a.real == b.real) && (a.imag == b.imag);
31151     }
31152     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
31153         __pyx_t_float_complex z;
31154         z.real = a.real + b.real;
31155         z.imag = a.imag + b.imag;
31156         return z;
31157     }
31158     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
31159         __pyx_t_float_complex z;
31160         z.real = a.real - b.real;
31161         z.imag = a.imag - b.imag;
31162         return z;
31163     }
31164     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
31165         __pyx_t_float_complex z;
31166         z.real = a.real * b.real - a.imag * b.imag;
31167         z.imag = a.real * b.imag + a.imag * b.real;
31168         return z;
31169     }
31170     #if 1
31171     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
31172         if (b.imag == 0) {
31173             return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
31174         } else if (fabsf(b.real) >= fabsf(b.imag)) {
31175             if (b.real == 0 && b.imag == 0) {
31176                 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
31177             } else {
31178                 float r = b.imag / b.real;
31179                 float s = (float)(1.0) / (b.real + b.imag * r);
31180                 return __pyx_t_float_complex_from_parts(
31181                     (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
31182             }
31183         } else {
31184             float r = b.real / b.imag;
31185             float s = (float)(1.0) / (b.imag + b.real * r);
31186             return __pyx_t_float_complex_from_parts(
31187                 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
31188         }
31189     }
31190     #else
31191     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
31192         if (b.imag == 0) {
31193             return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
31194         } else {
31195             float denom = b.real * b.real + b.imag * b.imag;
31196             return __pyx_t_float_complex_from_parts(
31197                 (a.real * b.real + a.imag * b.imag) / denom,
31198                 (a.imag * b.real - a.real * b.imag) / denom);
31199         }
31200     }
31201     #endif
31202     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
31203         __pyx_t_float_complex z;
31204         z.real = -a.real;
31205         z.imag = -a.imag;
31206         return z;
31207     }
31208     static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
31209        return (a.real == 0) && (a.imag == 0);
31210     }
31211     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
31212         __pyx_t_float_complex z;
31213         z.real =  a.real;
31214         z.imag = -a.imag;
31215         return z;
31216     }
31217     #if 1
31218         static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
31219           #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
31220             return sqrtf(z.real*z.real + z.imag*z.imag);
31221           #else
31222             return hypotf(z.real, z.imag);
31223           #endif
31224         }
31225         static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
31226             __pyx_t_float_complex z;
31227             float r, lnr, theta, z_r, z_theta;
31228             if (b.imag == 0 && b.real == (int)b.real) {
31229                 if (b.real < 0) {
31230                     float denom = a.real * a.real + a.imag * a.imag;
31231                     a.real = a.real / denom;
31232                     a.imag = -a.imag / denom;
31233                     b.real = -b.real;
31234                 }
31235                 switch ((int)b.real) {
31236                     case 0:
31237                         z.real = 1;
31238                         z.imag = 0;
31239                         return z;
31240                     case 1:
31241                         return a;
31242                     case 2:
31243                         z = __Pyx_c_prod_float(a, a);
31244                         return __Pyx_c_prod_float(a, a);
31245                     case 3:
31246                         z = __Pyx_c_prod_float(a, a);
31247                         return __Pyx_c_prod_float(z, a);
31248                     case 4:
31249                         z = __Pyx_c_prod_float(a, a);
31250                         return __Pyx_c_prod_float(z, z);
31251                 }
31252             }
31253             if (a.imag == 0) {
31254                 if (a.real == 0) {
31255                     return a;
31256                 } else if (b.imag == 0) {
31257                     z.real = powf(a.real, b.real);
31258                     z.imag = 0;
31259                     return z;
31260                 } else if (a.real > 0) {
31261                     r = a.real;
31262                     theta = 0;
31263                 } else {
31264                     r = -a.real;
31265                     theta = atan2f(0.0, -1.0);
31266                 }
31267             } else {
31268                 r = __Pyx_c_abs_float(a);
31269                 theta = atan2f(a.imag, a.real);
31270             }
31271             lnr = logf(r);
31272             z_r = expf(lnr * b.real - theta * b.imag);
31273             z_theta = theta * b.real + lnr * b.imag;
31274             z.real = z_r * cosf(z_theta);
31275             z.imag = z_r * sinf(z_theta);
31276             return z;
31277         }
31278     #endif
31279 #endif
31280 
31281 /* Declarations */
31282       #if CYTHON_CCOMPLEX
31283   #ifdef __cplusplus
31284     static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
31285       return ::std::complex< double >(x, y);
31286     }
31287   #else
31288     static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
31289       return x + y*(__pyx_t_double_complex)_Complex_I;
31290     }
31291   #endif
31292 #else
31293     static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
31294       __pyx_t_double_complex z;
31295       z.real = x;
31296       z.imag = y;
31297       return z;
31298     }
31299 #endif
31300 
31301 /* Arithmetic */
31302       #if CYTHON_CCOMPLEX
31303 #else
31304     static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
31305        return (a.real == b.real) && (a.imag == b.imag);
31306     }
31307     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
31308         __pyx_t_double_complex z;
31309         z.real = a.real + b.real;
31310         z.imag = a.imag + b.imag;
31311         return z;
31312     }
31313     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
31314         __pyx_t_double_complex z;
31315         z.real = a.real - b.real;
31316         z.imag = a.imag - b.imag;
31317         return z;
31318     }
31319     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
31320         __pyx_t_double_complex z;
31321         z.real = a.real * b.real - a.imag * b.imag;
31322         z.imag = a.real * b.imag + a.imag * b.real;
31323         return z;
31324     }
31325     #if 1
31326     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
31327         if (b.imag == 0) {
31328             return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
31329         } else if (fabs(b.real) >= fabs(b.imag)) {
31330             if (b.real == 0 && b.imag == 0) {
31331                 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
31332             } else {
31333                 double r = b.imag / b.real;
31334                 double s = (double)(1.0) / (b.real + b.imag * r);
31335                 return __pyx_t_double_complex_from_parts(
31336                     (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
31337             }
31338         } else {
31339             double r = b.real / b.imag;
31340             double s = (double)(1.0) / (b.imag + b.real * r);
31341             return __pyx_t_double_complex_from_parts(
31342                 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
31343         }
31344     }
31345     #else
31346     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
31347         if (b.imag == 0) {
31348             return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
31349         } else {
31350             double denom = b.real * b.real + b.imag * b.imag;
31351             return __pyx_t_double_complex_from_parts(
31352                 (a.real * b.real + a.imag * b.imag) / denom,
31353                 (a.imag * b.real - a.real * b.imag) / denom);
31354         }
31355     }
31356     #endif
31357     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
31358         __pyx_t_double_complex z;
31359         z.real = -a.real;
31360         z.imag = -a.imag;
31361         return z;
31362     }
31363     static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
31364        return (a.real == 0) && (a.imag == 0);
31365     }
31366     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
31367         __pyx_t_double_complex z;
31368         z.real =  a.real;
31369         z.imag = -a.imag;
31370         return z;
31371     }
31372     #if 1
31373         static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
31374           #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
31375             return sqrt(z.real*z.real + z.imag*z.imag);
31376           #else
31377             return hypot(z.real, z.imag);
31378           #endif
31379         }
31380         static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
31381             __pyx_t_double_complex z;
31382             double r, lnr, theta, z_r, z_theta;
31383             if (b.imag == 0 && b.real == (int)b.real) {
31384                 if (b.real < 0) {
31385                     double denom = a.real * a.real + a.imag * a.imag;
31386                     a.real = a.real / denom;
31387                     a.imag = -a.imag / denom;
31388                     b.real = -b.real;
31389                 }
31390                 switch ((int)b.real) {
31391                     case 0:
31392                         z.real = 1;
31393                         z.imag = 0;
31394                         return z;
31395                     case 1:
31396                         return a;
31397                     case 2:
31398                         z = __Pyx_c_prod_double(a, a);
31399                         return __Pyx_c_prod_double(a, a);
31400                     case 3:
31401                         z = __Pyx_c_prod_double(a, a);
31402                         return __Pyx_c_prod_double(z, a);
31403                     case 4:
31404                         z = __Pyx_c_prod_double(a, a);
31405                         return __Pyx_c_prod_double(z, z);
31406                 }
31407             }
31408             if (a.imag == 0) {
31409                 if (a.real == 0) {
31410                     return a;
31411                 } else if (b.imag == 0) {
31412                     z.real = pow(a.real, b.real);
31413                     z.imag = 0;
31414                     return z;
31415                 } else if (a.real > 0) {
31416                     r = a.real;
31417                     theta = 0;
31418                 } else {
31419                     r = -a.real;
31420                     theta = atan2(0.0, -1.0);
31421                 }
31422             } else {
31423                 r = __Pyx_c_abs_double(a);
31424                 theta = atan2(a.imag, a.real);
31425             }
31426             lnr = log(r);
31427             z_r = exp(lnr * b.real - theta * b.imag);
31428             z_theta = theta * b.real + lnr * b.imag;
31429             z.real = z_r * cos(z_theta);
31430             z.imag = z_r * sin(z_theta);
31431             return z;
31432         }
31433     #endif
31434 #endif
31435 
31436 /* CIntToPy */
31437       static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) {
31438     const enum NPY_TYPES neg_one = (enum NPY_TYPES) ((enum NPY_TYPES) 0 - (enum NPY_TYPES) 1), const_zero = (enum NPY_TYPES) 0;
31439     const int is_unsigned = neg_one > const_zero;
31440     if (is_unsigned) {
31441         if (sizeof(enum NPY_TYPES) < sizeof(long)) {
31442             return PyInt_FromLong((long) value);
31443         } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) {
31444             return PyLong_FromUnsignedLong((unsigned long) value);
31445 #ifdef HAVE_LONG_LONG
31446         } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) {
31447             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
31448 #endif
31449         }
31450     } else {
31451         if (sizeof(enum NPY_TYPES) <= sizeof(long)) {
31452             return PyInt_FromLong((long) value);
31453 #ifdef HAVE_LONG_LONG
31454         } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) {
31455             return PyLong_FromLongLong((PY_LONG_LONG) value);
31456 #endif
31457         }
31458     }
31459     {
31460         int one = 1; int little = (int)*(unsigned char *)&one;
31461         unsigned char *bytes = (unsigned char *)&value;
31462         return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES),
31463                                      little, !is_unsigned);
31464     }
31465 }
31466 
31467 /* MemviewSliceCopyTemplate */
31468       static __Pyx_memviewslice
31469 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
31470                                  const char *mode, int ndim,
31471                                  size_t sizeof_dtype, int contig_flag,
31472                                  int dtype_is_object)
31473 {
31474     __Pyx_RefNannyDeclarations
31475     int i;
31476     __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
31477     struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
31478     Py_buffer *buf = &from_memview->view;
31479     PyObject *shape_tuple = NULL;
31480     PyObject *temp_int = NULL;
31481     struct __pyx_array_obj *array_obj = NULL;
31482     struct __pyx_memoryview_obj *memview_obj = NULL;
31483     __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
31484     for (i = 0; i < ndim; i++) {
31485         if (from_mvs->suboffsets[i] >= 0) {
31486             PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
31487                                            "indirect dimensions (axis %d)", i);
31488             goto fail;
31489         }
31490     }
31491     shape_tuple = PyTuple_New(ndim);
31492     if (unlikely(!shape_tuple)) {
31493         goto fail;
31494     }
31495     __Pyx_GOTREF(shape_tuple);
31496     for(i = 0; i < ndim; i++) {
31497         temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
31498         if(unlikely(!temp_int)) {
31499             goto fail;
31500         } else {
31501             PyTuple_SET_ITEM(shape_tuple, i, temp_int);
31502             temp_int = NULL;
31503         }
31504     }
31505     array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
31506     if (unlikely(!array_obj)) {
31507         goto fail;
31508     }
31509     __Pyx_GOTREF(array_obj);
31510     memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
31511                                     (PyObject *) array_obj, contig_flag,
31512                                     dtype_is_object,
31513                                     from_mvs->memview->typeinfo);
31514     if (unlikely(!memview_obj))
31515         goto fail;
31516     if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
31517         goto fail;
31518     if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
31519                                                 dtype_is_object) < 0))
31520         goto fail;
31521     goto no_fail;
31522 fail:
31523     __Pyx_XDECREF(new_mvs.memview);
31524     new_mvs.memview = NULL;
31525     new_mvs.data = NULL;
31526 no_fail:
31527     __Pyx_XDECREF(shape_tuple);
31528     __Pyx_XDECREF(temp_int);
31529     __Pyx_XDECREF(array_obj);
31530     __Pyx_RefNannyFinishContext();
31531     return new_mvs;
31532 }
31533 
31534 /* CIntFromPy */
31535       static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *x) {
31536     const npy_int64 neg_one = (npy_int64) ((npy_int64) 0 - (npy_int64) 1), const_zero = (npy_int64) 0;
31537     const int is_unsigned = neg_one > const_zero;
31538 #if PY_MAJOR_VERSION < 3
31539     if (likely(PyInt_Check(x))) {
31540         if (sizeof(npy_int64) < sizeof(long)) {
31541             __PYX_VERIFY_RETURN_INT(npy_int64, long, PyInt_AS_LONG(x))
31542         } else {
31543             long val = PyInt_AS_LONG(x);
31544             if (is_unsigned && unlikely(val < 0)) {
31545                 goto raise_neg_overflow;
31546             }
31547             return (npy_int64) val;
31548         }
31549     } else
31550 #endif
31551     if (likely(PyLong_Check(x))) {
31552         if (is_unsigned) {
31553 #if CYTHON_USE_PYLONG_INTERNALS
31554             const digit* digits = ((PyLongObject*)x)->ob_digit;
31555             switch (Py_SIZE(x)) {
31556                 case  0: return (npy_int64) 0;
31557                 case  1: __PYX_VERIFY_RETURN_INT(npy_int64, digit, digits[0])
31558                 case 2:
31559                     if (8 * sizeof(npy_int64) > 1 * PyLong_SHIFT) {
31560                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
31561                             __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
31562                         } else if (8 * sizeof(npy_int64) >= 2 * PyLong_SHIFT) {
31563                             return (npy_int64) (((((npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]));
31564                         }
31565                     }
31566                     break;
31567                 case 3:
31568                     if (8 * sizeof(npy_int64) > 2 * PyLong_SHIFT) {
31569                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
31570                             __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
31571                         } else if (8 * sizeof(npy_int64) >= 3 * PyLong_SHIFT) {
31572                             return (npy_int64) (((((((npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]));
31573                         }
31574                     }
31575                     break;
31576                 case 4:
31577                     if (8 * sizeof(npy_int64) > 3 * PyLong_SHIFT) {
31578                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
31579                             __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
31580                         } else if (8 * sizeof(npy_int64) >= 4 * PyLong_SHIFT) {
31581                             return (npy_int64) (((((((((npy_int64)digits[3]) << PyLong_SHIFT) | (npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]));
31582                         }
31583                     }
31584                     break;
31585             }
31586 #endif
31587 #if CYTHON_COMPILING_IN_CPYTHON
31588             if (unlikely(Py_SIZE(x) < 0)) {
31589                 goto raise_neg_overflow;
31590             }
31591 #else
31592             {
31593                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
31594                 if (unlikely(result < 0))
31595                     return (npy_int64) -1;
31596                 if (unlikely(result == 1))
31597                     goto raise_neg_overflow;
31598             }
31599 #endif
31600             if (sizeof(npy_int64) <= sizeof(unsigned long)) {
31601                 __PYX_VERIFY_RETURN_INT_EXC(npy_int64, unsigned long, PyLong_AsUnsignedLong(x))
31602 #ifdef HAVE_LONG_LONG
31603             } else if (sizeof(npy_int64) <= sizeof(unsigned PY_LONG_LONG)) {
31604                 __PYX_VERIFY_RETURN_INT_EXC(npy_int64, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
31605 #endif
31606             }
31607         } else {
31608 #if CYTHON_USE_PYLONG_INTERNALS
31609             const digit* digits = ((PyLongObject*)x)->ob_digit;
31610             switch (Py_SIZE(x)) {
31611                 case  0: return (npy_int64) 0;
31612                 case -1: __PYX_VERIFY_RETURN_INT(npy_int64, sdigit, (sdigit) (-(sdigit)digits[0]))
31613                 case  1: __PYX_VERIFY_RETURN_INT(npy_int64,  digit, +digits[0])
31614                 case -2:
31615                     if (8 * sizeof(npy_int64) - 1 > 1 * PyLong_SHIFT) {
31616                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
31617                             __PYX_VERIFY_RETURN_INT(npy_int64, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
31618                         } else if (8 * sizeof(npy_int64) - 1 > 2 * PyLong_SHIFT) {
31619                             return (npy_int64) (((npy_int64)-1)*(((((npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
31620                         }
31621                     }
31622                     break;
31623                 case 2:
31624                     if (8 * sizeof(npy_int64) > 1 * PyLong_SHIFT) {
31625                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
31626                             __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
31627                         } else if (8 * sizeof(npy_int64) - 1 > 2 * PyLong_SHIFT) {
31628                             return (npy_int64) ((((((npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
31629                         }
31630                     }
31631                     break;
31632                 case -3:
31633                     if (8 * sizeof(npy_int64) - 1 > 2 * PyLong_SHIFT) {
31634                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
31635                             __PYX_VERIFY_RETURN_INT(npy_int64, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
31636                         } else if (8 * sizeof(npy_int64) - 1 > 3 * PyLong_SHIFT) {
31637                             return (npy_int64) (((npy_int64)-1)*(((((((npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
31638                         }
31639                     }
31640                     break;
31641                 case 3:
31642                     if (8 * sizeof(npy_int64) > 2 * PyLong_SHIFT) {
31643                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
31644                             __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
31645                         } else if (8 * sizeof(npy_int64) - 1 > 3 * PyLong_SHIFT) {
31646                             return (npy_int64) ((((((((npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
31647                         }
31648                     }
31649                     break;
31650                 case -4:
31651                     if (8 * sizeof(npy_int64) - 1 > 3 * PyLong_SHIFT) {
31652                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
31653                             __PYX_VERIFY_RETURN_INT(npy_int64, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
31654                         } else if (8 * sizeof(npy_int64) - 1 > 4 * PyLong_SHIFT) {
31655                             return (npy_int64) (((npy_int64)-1)*(((((((((npy_int64)digits[3]) << PyLong_SHIFT) | (npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
31656                         }
31657                     }
31658                     break;
31659                 case 4:
31660                     if (8 * sizeof(npy_int64) > 3 * PyLong_SHIFT) {
31661                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
31662                             __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
31663                         } else if (8 * sizeof(npy_int64) - 1 > 4 * PyLong_SHIFT) {
31664                             return (npy_int64) ((((((((((npy_int64)digits[3]) << PyLong_SHIFT) | (npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
31665                         }
31666                     }
31667                     break;
31668             }
31669 #endif
31670             if (sizeof(npy_int64) <= sizeof(long)) {
31671                 __PYX_VERIFY_RETURN_INT_EXC(npy_int64, long, PyLong_AsLong(x))
31672 #ifdef HAVE_LONG_LONG
31673             } else if (sizeof(npy_int64) <= sizeof(PY_LONG_LONG)) {
31674                 __PYX_VERIFY_RETURN_INT_EXC(npy_int64, PY_LONG_LONG, PyLong_AsLongLong(x))
31675 #endif
31676             }
31677         }
31678         {
31679 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
31680             PyErr_SetString(PyExc_RuntimeError,
31681                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
31682 #else
31683             npy_int64 val;
31684             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
31685  #if PY_MAJOR_VERSION < 3
31686             if (likely(v) && !PyLong_Check(v)) {
31687                 PyObject *tmp = v;
31688                 v = PyNumber_Long(tmp);
31689                 Py_DECREF(tmp);
31690             }
31691  #endif
31692             if (likely(v)) {
31693                 int one = 1; int is_little = (int)*(unsigned char *)&one;
31694                 unsigned char *bytes = (unsigned char *)&val;
31695                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
31696                                               bytes, sizeof(val),
31697                                               is_little, !is_unsigned);
31698                 Py_DECREF(v);
31699                 if (likely(!ret))
31700                     return val;
31701             }
31702 #endif
31703             return (npy_int64) -1;
31704         }
31705     } else {
31706         npy_int64 val;
31707         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
31708         if (!tmp) return (npy_int64) -1;
31709         val = __Pyx_PyInt_As_npy_int64(tmp);
31710         Py_DECREF(tmp);
31711         return val;
31712     }
31713 raise_overflow:
31714     PyErr_SetString(PyExc_OverflowError,
31715         "value too large to convert to npy_int64");
31716     return (npy_int64) -1;
31717 raise_neg_overflow:
31718     PyErr_SetString(PyExc_OverflowError,
31719         "can't convert negative value to npy_int64");
31720     return (npy_int64) -1;
31721 }
31722 
31723 /* CIntFromPy */
31724       static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
31725     const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
31726     const int is_unsigned = neg_one > const_zero;
31727 #if PY_MAJOR_VERSION < 3
31728     if (likely(PyInt_Check(x))) {
31729         if (sizeof(int) < sizeof(long)) {
31730             __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
31731         } else {
31732             long val = PyInt_AS_LONG(x);
31733             if (is_unsigned && unlikely(val < 0)) {
31734                 goto raise_neg_overflow;
31735             }
31736             return (int) val;
31737         }
31738     } else
31739 #endif
31740     if (likely(PyLong_Check(x))) {
31741         if (is_unsigned) {
31742 #if CYTHON_USE_PYLONG_INTERNALS
31743             const digit* digits = ((PyLongObject*)x)->ob_digit;
31744             switch (Py_SIZE(x)) {
31745                 case  0: return (int) 0;
31746                 case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
31747                 case 2:
31748                     if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
31749                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
31750                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
31751                         } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
31752                             return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
31753                         }
31754                     }
31755                     break;
31756                 case 3:
31757                     if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
31758                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
31759                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
31760                         } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
31761                             return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
31762                         }
31763                     }
31764                     break;
31765                 case 4:
31766                     if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
31767                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
31768                             __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])))
31769                         } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
31770                             return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
31771                         }
31772                     }
31773                     break;
31774             }
31775 #endif
31776 #if CYTHON_COMPILING_IN_CPYTHON
31777             if (unlikely(Py_SIZE(x) < 0)) {
31778                 goto raise_neg_overflow;
31779             }
31780 #else
31781             {
31782                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
31783                 if (unlikely(result < 0))
31784                     return (int) -1;
31785                 if (unlikely(result == 1))
31786                     goto raise_neg_overflow;
31787             }
31788 #endif
31789             if (sizeof(int) <= sizeof(unsigned long)) {
31790                 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
31791 #ifdef HAVE_LONG_LONG
31792             } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
31793                 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
31794 #endif
31795             }
31796         } else {
31797 #if CYTHON_USE_PYLONG_INTERNALS
31798             const digit* digits = ((PyLongObject*)x)->ob_digit;
31799             switch (Py_SIZE(x)) {
31800                 case  0: return (int) 0;
31801                 case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
31802                 case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
31803                 case -2:
31804                     if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
31805                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
31806                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
31807                         } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
31808                             return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
31809                         }
31810                     }
31811                     break;
31812                 case 2:
31813                     if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
31814                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
31815                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
31816                         } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
31817                             return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
31818                         }
31819                     }
31820                     break;
31821                 case -3:
31822                     if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
31823                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
31824                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
31825                         } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
31826                             return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
31827                         }
31828                     }
31829                     break;
31830                 case 3:
31831                     if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
31832                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
31833                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
31834                         } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
31835                             return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
31836                         }
31837                     }
31838                     break;
31839                 case -4:
31840                     if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
31841                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
31842                             __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])))
31843                         } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
31844                             return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
31845                         }
31846                     }
31847                     break;
31848                 case 4:
31849                     if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
31850                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
31851                             __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])))
31852                         } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
31853                             return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
31854                         }
31855                     }
31856                     break;
31857             }
31858 #endif
31859             if (sizeof(int) <= sizeof(long)) {
31860                 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
31861 #ifdef HAVE_LONG_LONG
31862             } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
31863                 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
31864 #endif
31865             }
31866         }
31867         {
31868 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
31869             PyErr_SetString(PyExc_RuntimeError,
31870                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
31871 #else
31872             int val;
31873             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
31874  #if PY_MAJOR_VERSION < 3
31875             if (likely(v) && !PyLong_Check(v)) {
31876                 PyObject *tmp = v;
31877                 v = PyNumber_Long(tmp);
31878                 Py_DECREF(tmp);
31879             }
31880  #endif
31881             if (likely(v)) {
31882                 int one = 1; int is_little = (int)*(unsigned char *)&one;
31883                 unsigned char *bytes = (unsigned char *)&val;
31884                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
31885                                               bytes, sizeof(val),
31886                                               is_little, !is_unsigned);
31887                 Py_DECREF(v);
31888                 if (likely(!ret))
31889                     return val;
31890             }
31891 #endif
31892             return (int) -1;
31893         }
31894     } else {
31895         int val;
31896         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
31897         if (!tmp) return (int) -1;
31898         val = __Pyx_PyInt_As_int(tmp);
31899         Py_DECREF(tmp);
31900         return val;
31901     }
31902 raise_overflow:
31903     PyErr_SetString(PyExc_OverflowError,
31904         "value too large to convert to int");
31905     return (int) -1;
31906 raise_neg_overflow:
31907     PyErr_SetString(PyExc_OverflowError,
31908         "can't convert negative value to int");
31909     return (int) -1;
31910 }
31911 
31912 /* CIntFromPy */
31913       static CYTHON_INLINE npy_uint64 __Pyx_PyInt_As_npy_uint64(PyObject *x) {
31914     const npy_uint64 neg_one = (npy_uint64) ((npy_uint64) 0 - (npy_uint64) 1), const_zero = (npy_uint64) 0;
31915     const int is_unsigned = neg_one > const_zero;
31916 #if PY_MAJOR_VERSION < 3
31917     if (likely(PyInt_Check(x))) {
31918         if (sizeof(npy_uint64) < sizeof(long)) {
31919             __PYX_VERIFY_RETURN_INT(npy_uint64, long, PyInt_AS_LONG(x))
31920         } else {
31921             long val = PyInt_AS_LONG(x);
31922             if (is_unsigned && unlikely(val < 0)) {
31923                 goto raise_neg_overflow;
31924             }
31925             return (npy_uint64) val;
31926         }
31927     } else
31928 #endif
31929     if (likely(PyLong_Check(x))) {
31930         if (is_unsigned) {
31931 #if CYTHON_USE_PYLONG_INTERNALS
31932             const digit* digits = ((PyLongObject*)x)->ob_digit;
31933             switch (Py_SIZE(x)) {
31934                 case  0: return (npy_uint64) 0;
31935                 case  1: __PYX_VERIFY_RETURN_INT(npy_uint64, digit, digits[0])
31936                 case 2:
31937                     if (8 * sizeof(npy_uint64) > 1 * PyLong_SHIFT) {
31938                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
31939                             __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
31940                         } else if (8 * sizeof(npy_uint64) >= 2 * PyLong_SHIFT) {
31941                             return (npy_uint64) (((((npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]));
31942                         }
31943                     }
31944                     break;
31945                 case 3:
31946                     if (8 * sizeof(npy_uint64) > 2 * PyLong_SHIFT) {
31947                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
31948                             __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
31949                         } else if (8 * sizeof(npy_uint64) >= 3 * PyLong_SHIFT) {
31950                             return (npy_uint64) (((((((npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]));
31951                         }
31952                     }
31953                     break;
31954                 case 4:
31955                     if (8 * sizeof(npy_uint64) > 3 * PyLong_SHIFT) {
31956                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
31957                             __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
31958                         } else if (8 * sizeof(npy_uint64) >= 4 * PyLong_SHIFT) {
31959                             return (npy_uint64) (((((((((npy_uint64)digits[3]) << PyLong_SHIFT) | (npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]));
31960                         }
31961                     }
31962                     break;
31963             }
31964 #endif
31965 #if CYTHON_COMPILING_IN_CPYTHON
31966             if (unlikely(Py_SIZE(x) < 0)) {
31967                 goto raise_neg_overflow;
31968             }
31969 #else
31970             {
31971                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
31972                 if (unlikely(result < 0))
31973                     return (npy_uint64) -1;
31974                 if (unlikely(result == 1))
31975                     goto raise_neg_overflow;
31976             }
31977 #endif
31978             if (sizeof(npy_uint64) <= sizeof(unsigned long)) {
31979                 __PYX_VERIFY_RETURN_INT_EXC(npy_uint64, unsigned long, PyLong_AsUnsignedLong(x))
31980 #ifdef HAVE_LONG_LONG
31981             } else if (sizeof(npy_uint64) <= sizeof(unsigned PY_LONG_LONG)) {
31982                 __PYX_VERIFY_RETURN_INT_EXC(npy_uint64, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
31983 #endif
31984             }
31985         } else {
31986 #if CYTHON_USE_PYLONG_INTERNALS
31987             const digit* digits = ((PyLongObject*)x)->ob_digit;
31988             switch (Py_SIZE(x)) {
31989                 case  0: return (npy_uint64) 0;
31990                 case -1: __PYX_VERIFY_RETURN_INT(npy_uint64, sdigit, (sdigit) (-(sdigit)digits[0]))
31991                 case  1: __PYX_VERIFY_RETURN_INT(npy_uint64,  digit, +digits[0])
31992                 case -2:
31993                     if (8 * sizeof(npy_uint64) - 1 > 1 * PyLong_SHIFT) {
31994                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
31995                             __PYX_VERIFY_RETURN_INT(npy_uint64, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
31996                         } else if (8 * sizeof(npy_uint64) - 1 > 2 * PyLong_SHIFT) {
31997                             return (npy_uint64) (((npy_uint64)-1)*(((((npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0])));
31998                         }
31999                     }
32000                     break;
32001                 case 2:
32002                     if (8 * sizeof(npy_uint64) > 1 * PyLong_SHIFT) {
32003                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
32004                             __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32005                         } else if (8 * sizeof(npy_uint64) - 1 > 2 * PyLong_SHIFT) {
32006                             return (npy_uint64) ((((((npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0])));
32007                         }
32008                     }
32009                     break;
32010                 case -3:
32011                     if (8 * sizeof(npy_uint64) - 1 > 2 * PyLong_SHIFT) {
32012                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
32013                             __PYX_VERIFY_RETURN_INT(npy_uint64, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32014                         } else if (8 * sizeof(npy_uint64) - 1 > 3 * PyLong_SHIFT) {
32015                             return (npy_uint64) (((npy_uint64)-1)*(((((((npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0])));
32016                         }
32017                     }
32018                     break;
32019                 case 3:
32020                     if (8 * sizeof(npy_uint64) > 2 * PyLong_SHIFT) {
32021                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
32022                             __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32023                         } else if (8 * sizeof(npy_uint64) - 1 > 3 * PyLong_SHIFT) {
32024                             return (npy_uint64) ((((((((npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0])));
32025                         }
32026                     }
32027                     break;
32028                 case -4:
32029                     if (8 * sizeof(npy_uint64) - 1 > 3 * PyLong_SHIFT) {
32030                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
32031                             __PYX_VERIFY_RETURN_INT(npy_uint64, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32032                         } else if (8 * sizeof(npy_uint64) - 1 > 4 * PyLong_SHIFT) {
32033                             return (npy_uint64) (((npy_uint64)-1)*(((((((((npy_uint64)digits[3]) << PyLong_SHIFT) | (npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0])));
32034                         }
32035                     }
32036                     break;
32037                 case 4:
32038                     if (8 * sizeof(npy_uint64) > 3 * PyLong_SHIFT) {
32039                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
32040                             __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32041                         } else if (8 * sizeof(npy_uint64) - 1 > 4 * PyLong_SHIFT) {
32042                             return (npy_uint64) ((((((((((npy_uint64)digits[3]) << PyLong_SHIFT) | (npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0])));
32043                         }
32044                     }
32045                     break;
32046             }
32047 #endif
32048             if (sizeof(npy_uint64) <= sizeof(long)) {
32049                 __PYX_VERIFY_RETURN_INT_EXC(npy_uint64, long, PyLong_AsLong(x))
32050 #ifdef HAVE_LONG_LONG
32051             } else if (sizeof(npy_uint64) <= sizeof(PY_LONG_LONG)) {
32052                 __PYX_VERIFY_RETURN_INT_EXC(npy_uint64, PY_LONG_LONG, PyLong_AsLongLong(x))
32053 #endif
32054             }
32055         }
32056         {
32057 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
32058             PyErr_SetString(PyExc_RuntimeError,
32059                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
32060 #else
32061             npy_uint64 val;
32062             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
32063  #if PY_MAJOR_VERSION < 3
32064             if (likely(v) && !PyLong_Check(v)) {
32065                 PyObject *tmp = v;
32066                 v = PyNumber_Long(tmp);
32067                 Py_DECREF(tmp);
32068             }
32069  #endif
32070             if (likely(v)) {
32071                 int one = 1; int is_little = (int)*(unsigned char *)&one;
32072                 unsigned char *bytes = (unsigned char *)&val;
32073                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
32074                                               bytes, sizeof(val),
32075                                               is_little, !is_unsigned);
32076                 Py_DECREF(v);
32077                 if (likely(!ret))
32078                     return val;
32079             }
32080 #endif
32081             return (npy_uint64) -1;
32082         }
32083     } else {
32084         npy_uint64 val;
32085         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
32086         if (!tmp) return (npy_uint64) -1;
32087         val = __Pyx_PyInt_As_npy_uint64(tmp);
32088         Py_DECREF(tmp);
32089         return val;
32090     }
32091 raise_overflow:
32092     PyErr_SetString(PyExc_OverflowError,
32093         "value too large to convert to npy_uint64");
32094     return (npy_uint64) -1;
32095 raise_neg_overflow:
32096     PyErr_SetString(PyExc_OverflowError,
32097         "can't convert negative value to npy_uint64");
32098     return (npy_uint64) -1;
32099 }
32100 
32101 /* CIntFromPy */
32102       static CYTHON_INLINE npy_uint32 __Pyx_PyInt_As_npy_uint32(PyObject *x) {
32103     const npy_uint32 neg_one = (npy_uint32) ((npy_uint32) 0 - (npy_uint32) 1), const_zero = (npy_uint32) 0;
32104     const int is_unsigned = neg_one > const_zero;
32105 #if PY_MAJOR_VERSION < 3
32106     if (likely(PyInt_Check(x))) {
32107         if (sizeof(npy_uint32) < sizeof(long)) {
32108             __PYX_VERIFY_RETURN_INT(npy_uint32, long, PyInt_AS_LONG(x))
32109         } else {
32110             long val = PyInt_AS_LONG(x);
32111             if (is_unsigned && unlikely(val < 0)) {
32112                 goto raise_neg_overflow;
32113             }
32114             return (npy_uint32) val;
32115         }
32116     } else
32117 #endif
32118     if (likely(PyLong_Check(x))) {
32119         if (is_unsigned) {
32120 #if CYTHON_USE_PYLONG_INTERNALS
32121             const digit* digits = ((PyLongObject*)x)->ob_digit;
32122             switch (Py_SIZE(x)) {
32123                 case  0: return (npy_uint32) 0;
32124                 case  1: __PYX_VERIFY_RETURN_INT(npy_uint32, digit, digits[0])
32125                 case 2:
32126                     if (8 * sizeof(npy_uint32) > 1 * PyLong_SHIFT) {
32127                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
32128                             __PYX_VERIFY_RETURN_INT(npy_uint32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32129                         } else if (8 * sizeof(npy_uint32) >= 2 * PyLong_SHIFT) {
32130                             return (npy_uint32) (((((npy_uint32)digits[1]) << PyLong_SHIFT) | (npy_uint32)digits[0]));
32131                         }
32132                     }
32133                     break;
32134                 case 3:
32135                     if (8 * sizeof(npy_uint32) > 2 * PyLong_SHIFT) {
32136                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
32137                             __PYX_VERIFY_RETURN_INT(npy_uint32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32138                         } else if (8 * sizeof(npy_uint32) >= 3 * PyLong_SHIFT) {
32139                             return (npy_uint32) (((((((npy_uint32)digits[2]) << PyLong_SHIFT) | (npy_uint32)digits[1]) << PyLong_SHIFT) | (npy_uint32)digits[0]));
32140                         }
32141                     }
32142                     break;
32143                 case 4:
32144                     if (8 * sizeof(npy_uint32) > 3 * PyLong_SHIFT) {
32145                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
32146                             __PYX_VERIFY_RETURN_INT(npy_uint32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32147                         } else if (8 * sizeof(npy_uint32) >= 4 * PyLong_SHIFT) {
32148                             return (npy_uint32) (((((((((npy_uint32)digits[3]) << PyLong_SHIFT) | (npy_uint32)digits[2]) << PyLong_SHIFT) | (npy_uint32)digits[1]) << PyLong_SHIFT) | (npy_uint32)digits[0]));
32149                         }
32150                     }
32151                     break;
32152             }
32153 #endif
32154 #if CYTHON_COMPILING_IN_CPYTHON
32155             if (unlikely(Py_SIZE(x) < 0)) {
32156                 goto raise_neg_overflow;
32157             }
32158 #else
32159             {
32160                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
32161                 if (unlikely(result < 0))
32162                     return (npy_uint32) -1;
32163                 if (unlikely(result == 1))
32164                     goto raise_neg_overflow;
32165             }
32166 #endif
32167             if (sizeof(npy_uint32) <= sizeof(unsigned long)) {
32168                 __PYX_VERIFY_RETURN_INT_EXC(npy_uint32, unsigned long, PyLong_AsUnsignedLong(x))
32169 #ifdef HAVE_LONG_LONG
32170             } else if (sizeof(npy_uint32) <= sizeof(unsigned PY_LONG_LONG)) {
32171                 __PYX_VERIFY_RETURN_INT_EXC(npy_uint32, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
32172 #endif
32173             }
32174         } else {
32175 #if CYTHON_USE_PYLONG_INTERNALS
32176             const digit* digits = ((PyLongObject*)x)->ob_digit;
32177             switch (Py_SIZE(x)) {
32178                 case  0: return (npy_uint32) 0;
32179                 case -1: __PYX_VERIFY_RETURN_INT(npy_uint32, sdigit, (sdigit) (-(sdigit)digits[0]))
32180                 case  1: __PYX_VERIFY_RETURN_INT(npy_uint32,  digit, +digits[0])
32181                 case -2:
32182                     if (8 * sizeof(npy_uint32) - 1 > 1 * PyLong_SHIFT) {
32183                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
32184                             __PYX_VERIFY_RETURN_INT(npy_uint32, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32185                         } else if (8 * sizeof(npy_uint32) - 1 > 2 * PyLong_SHIFT) {
32186                             return (npy_uint32) (((npy_uint32)-1)*(((((npy_uint32)digits[1]) << PyLong_SHIFT) | (npy_uint32)digits[0])));
32187                         }
32188                     }
32189                     break;
32190                 case 2:
32191                     if (8 * sizeof(npy_uint32) > 1 * PyLong_SHIFT) {
32192                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
32193                             __PYX_VERIFY_RETURN_INT(npy_uint32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32194                         } else if (8 * sizeof(npy_uint32) - 1 > 2 * PyLong_SHIFT) {
32195                             return (npy_uint32) ((((((npy_uint32)digits[1]) << PyLong_SHIFT) | (npy_uint32)digits[0])));
32196                         }
32197                     }
32198                     break;
32199                 case -3:
32200                     if (8 * sizeof(npy_uint32) - 1 > 2 * PyLong_SHIFT) {
32201                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
32202                             __PYX_VERIFY_RETURN_INT(npy_uint32, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32203                         } else if (8 * sizeof(npy_uint32) - 1 > 3 * PyLong_SHIFT) {
32204                             return (npy_uint32) (((npy_uint32)-1)*(((((((npy_uint32)digits[2]) << PyLong_SHIFT) | (npy_uint32)digits[1]) << PyLong_SHIFT) | (npy_uint32)digits[0])));
32205                         }
32206                     }
32207                     break;
32208                 case 3:
32209                     if (8 * sizeof(npy_uint32) > 2 * PyLong_SHIFT) {
32210                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
32211                             __PYX_VERIFY_RETURN_INT(npy_uint32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32212                         } else if (8 * sizeof(npy_uint32) - 1 > 3 * PyLong_SHIFT) {
32213                             return (npy_uint32) ((((((((npy_uint32)digits[2]) << PyLong_SHIFT) | (npy_uint32)digits[1]) << PyLong_SHIFT) | (npy_uint32)digits[0])));
32214                         }
32215                     }
32216                     break;
32217                 case -4:
32218                     if (8 * sizeof(npy_uint32) - 1 > 3 * PyLong_SHIFT) {
32219                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
32220                             __PYX_VERIFY_RETURN_INT(npy_uint32, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32221                         } else if (8 * sizeof(npy_uint32) - 1 > 4 * PyLong_SHIFT) {
32222                             return (npy_uint32) (((npy_uint32)-1)*(((((((((npy_uint32)digits[3]) << PyLong_SHIFT) | (npy_uint32)digits[2]) << PyLong_SHIFT) | (npy_uint32)digits[1]) << PyLong_SHIFT) | (npy_uint32)digits[0])));
32223                         }
32224                     }
32225                     break;
32226                 case 4:
32227                     if (8 * sizeof(npy_uint32) > 3 * PyLong_SHIFT) {
32228                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
32229                             __PYX_VERIFY_RETURN_INT(npy_uint32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32230                         } else if (8 * sizeof(npy_uint32) - 1 > 4 * PyLong_SHIFT) {
32231                             return (npy_uint32) ((((((((((npy_uint32)digits[3]) << PyLong_SHIFT) | (npy_uint32)digits[2]) << PyLong_SHIFT) | (npy_uint32)digits[1]) << PyLong_SHIFT) | (npy_uint32)digits[0])));
32232                         }
32233                     }
32234                     break;
32235             }
32236 #endif
32237             if (sizeof(npy_uint32) <= sizeof(long)) {
32238                 __PYX_VERIFY_RETURN_INT_EXC(npy_uint32, long, PyLong_AsLong(x))
32239 #ifdef HAVE_LONG_LONG
32240             } else if (sizeof(npy_uint32) <= sizeof(PY_LONG_LONG)) {
32241                 __PYX_VERIFY_RETURN_INT_EXC(npy_uint32, PY_LONG_LONG, PyLong_AsLongLong(x))
32242 #endif
32243             }
32244         }
32245         {
32246 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
32247             PyErr_SetString(PyExc_RuntimeError,
32248                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
32249 #else
32250             npy_uint32 val;
32251             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
32252  #if PY_MAJOR_VERSION < 3
32253             if (likely(v) && !PyLong_Check(v)) {
32254                 PyObject *tmp = v;
32255                 v = PyNumber_Long(tmp);
32256                 Py_DECREF(tmp);
32257             }
32258  #endif
32259             if (likely(v)) {
32260                 int one = 1; int is_little = (int)*(unsigned char *)&one;
32261                 unsigned char *bytes = (unsigned char *)&val;
32262                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
32263                                               bytes, sizeof(val),
32264                                               is_little, !is_unsigned);
32265                 Py_DECREF(v);
32266                 if (likely(!ret))
32267                     return val;
32268             }
32269 #endif
32270             return (npy_uint32) -1;
32271         }
32272     } else {
32273         npy_uint32 val;
32274         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
32275         if (!tmp) return (npy_uint32) -1;
32276         val = __Pyx_PyInt_As_npy_uint32(tmp);
32277         Py_DECREF(tmp);
32278         return val;
32279     }
32280 raise_overflow:
32281     PyErr_SetString(PyExc_OverflowError,
32282         "value too large to convert to npy_uint32");
32283     return (npy_uint32) -1;
32284 raise_neg_overflow:
32285     PyErr_SetString(PyExc_OverflowError,
32286         "can't convert negative value to npy_uint32");
32287     return (npy_uint32) -1;
32288 }
32289 
32290 /* CIntFromPy */
32291       static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
32292     const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
32293     const int is_unsigned = neg_one > const_zero;
32294 #if PY_MAJOR_VERSION < 3
32295     if (likely(PyInt_Check(x))) {
32296         if (sizeof(long) < sizeof(long)) {
32297             __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
32298         } else {
32299             long val = PyInt_AS_LONG(x);
32300             if (is_unsigned && unlikely(val < 0)) {
32301                 goto raise_neg_overflow;
32302             }
32303             return (long) val;
32304         }
32305     } else
32306 #endif
32307     if (likely(PyLong_Check(x))) {
32308         if (is_unsigned) {
32309 #if CYTHON_USE_PYLONG_INTERNALS
32310             const digit* digits = ((PyLongObject*)x)->ob_digit;
32311             switch (Py_SIZE(x)) {
32312                 case  0: return (long) 0;
32313                 case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
32314                 case 2:
32315                     if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
32316                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
32317                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32318                         } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
32319                             return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
32320                         }
32321                     }
32322                     break;
32323                 case 3:
32324                     if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
32325                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
32326                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32327                         } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
32328                             return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
32329                         }
32330                     }
32331                     break;
32332                 case 4:
32333                     if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
32334                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
32335                             __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])))
32336                         } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
32337                             return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
32338                         }
32339                     }
32340                     break;
32341             }
32342 #endif
32343 #if CYTHON_COMPILING_IN_CPYTHON
32344             if (unlikely(Py_SIZE(x) < 0)) {
32345                 goto raise_neg_overflow;
32346             }
32347 #else
32348             {
32349                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
32350                 if (unlikely(result < 0))
32351                     return (long) -1;
32352                 if (unlikely(result == 1))
32353                     goto raise_neg_overflow;
32354             }
32355 #endif
32356             if (sizeof(long) <= sizeof(unsigned long)) {
32357                 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
32358 #ifdef HAVE_LONG_LONG
32359             } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
32360                 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
32361 #endif
32362             }
32363         } else {
32364 #if CYTHON_USE_PYLONG_INTERNALS
32365             const digit* digits = ((PyLongObject*)x)->ob_digit;
32366             switch (Py_SIZE(x)) {
32367                 case  0: return (long) 0;
32368                 case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
32369                 case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
32370                 case -2:
32371                     if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
32372                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
32373                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32374                         } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
32375                             return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
32376                         }
32377                     }
32378                     break;
32379                 case 2:
32380                     if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
32381                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
32382                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32383                         } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
32384                             return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
32385                         }
32386                     }
32387                     break;
32388                 case -3:
32389                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
32390                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
32391                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32392                         } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
32393                             return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
32394                         }
32395                     }
32396                     break;
32397                 case 3:
32398                     if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
32399                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
32400                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32401                         } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
32402                             return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
32403                         }
32404                     }
32405                     break;
32406                 case -4:
32407                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
32408                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
32409                             __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])))
32410                         } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
32411                             return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
32412                         }
32413                     }
32414                     break;
32415                 case 4:
32416                     if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
32417                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
32418                             __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])))
32419                         } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
32420                             return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
32421                         }
32422                     }
32423                     break;
32424             }
32425 #endif
32426             if (sizeof(long) <= sizeof(long)) {
32427                 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
32428 #ifdef HAVE_LONG_LONG
32429             } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
32430                 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
32431 #endif
32432             }
32433         }
32434         {
32435 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
32436             PyErr_SetString(PyExc_RuntimeError,
32437                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
32438 #else
32439             long val;
32440             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
32441  #if PY_MAJOR_VERSION < 3
32442             if (likely(v) && !PyLong_Check(v)) {
32443                 PyObject *tmp = v;
32444                 v = PyNumber_Long(tmp);
32445                 Py_DECREF(tmp);
32446             }
32447  #endif
32448             if (likely(v)) {
32449                 int one = 1; int is_little = (int)*(unsigned char *)&one;
32450                 unsigned char *bytes = (unsigned char *)&val;
32451                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
32452                                               bytes, sizeof(val),
32453                                               is_little, !is_unsigned);
32454                 Py_DECREF(v);
32455                 if (likely(!ret))
32456                     return val;
32457             }
32458 #endif
32459             return (long) -1;
32460         }
32461     } else {
32462         long val;
32463         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
32464         if (!tmp) return (long) -1;
32465         val = __Pyx_PyInt_As_long(tmp);
32466         Py_DECREF(tmp);
32467         return val;
32468     }
32469 raise_overflow:
32470     PyErr_SetString(PyExc_OverflowError,
32471         "value too large to convert to long");
32472     return (long) -1;
32473 raise_neg_overflow:
32474     PyErr_SetString(PyExc_OverflowError,
32475         "can't convert negative value to long");
32476     return (long) -1;
32477 }
32478 
32479 /* CIntFromPy */
32480       static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
32481     const char neg_one = (char) ((char) 0 - (char) 1), const_zero = (char) 0;
32482     const int is_unsigned = neg_one > const_zero;
32483 #if PY_MAJOR_VERSION < 3
32484     if (likely(PyInt_Check(x))) {
32485         if (sizeof(char) < sizeof(long)) {
32486             __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
32487         } else {
32488             long val = PyInt_AS_LONG(x);
32489             if (is_unsigned && unlikely(val < 0)) {
32490                 goto raise_neg_overflow;
32491             }
32492             return (char) val;
32493         }
32494     } else
32495 #endif
32496     if (likely(PyLong_Check(x))) {
32497         if (is_unsigned) {
32498 #if CYTHON_USE_PYLONG_INTERNALS
32499             const digit* digits = ((PyLongObject*)x)->ob_digit;
32500             switch (Py_SIZE(x)) {
32501                 case  0: return (char) 0;
32502                 case  1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
32503                 case 2:
32504                     if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
32505                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
32506                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32507                         } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
32508                             return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
32509                         }
32510                     }
32511                     break;
32512                 case 3:
32513                     if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
32514                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
32515                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32516                         } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
32517                             return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
32518                         }
32519                     }
32520                     break;
32521                 case 4:
32522                     if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
32523                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
32524                             __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])))
32525                         } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
32526                             return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
32527                         }
32528                     }
32529                     break;
32530             }
32531 #endif
32532 #if CYTHON_COMPILING_IN_CPYTHON
32533             if (unlikely(Py_SIZE(x) < 0)) {
32534                 goto raise_neg_overflow;
32535             }
32536 #else
32537             {
32538                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
32539                 if (unlikely(result < 0))
32540                     return (char) -1;
32541                 if (unlikely(result == 1))
32542                     goto raise_neg_overflow;
32543             }
32544 #endif
32545             if (sizeof(char) <= sizeof(unsigned long)) {
32546                 __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
32547 #ifdef HAVE_LONG_LONG
32548             } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
32549                 __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
32550 #endif
32551             }
32552         } else {
32553 #if CYTHON_USE_PYLONG_INTERNALS
32554             const digit* digits = ((PyLongObject*)x)->ob_digit;
32555             switch (Py_SIZE(x)) {
32556                 case  0: return (char) 0;
32557                 case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
32558                 case  1: __PYX_VERIFY_RETURN_INT(char,  digit, +digits[0])
32559                 case -2:
32560                     if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
32561                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
32562                             __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32563                         } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
32564                             return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
32565                         }
32566                     }
32567                     break;
32568                 case 2:
32569                     if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
32570                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
32571                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32572                         } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
32573                             return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
32574                         }
32575                     }
32576                     break;
32577                 case -3:
32578                     if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
32579                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
32580                             __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32581                         } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
32582                             return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
32583                         }
32584                     }
32585                     break;
32586                 case 3:
32587                     if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
32588                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
32589                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32590                         } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
32591                             return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
32592                         }
32593                     }
32594                     break;
32595                 case -4:
32596                     if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
32597                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
32598                             __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])))
32599                         } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
32600                             return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
32601                         }
32602                     }
32603                     break;
32604                 case 4:
32605                     if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
32606                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
32607                             __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])))
32608                         } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
32609                             return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
32610                         }
32611                     }
32612                     break;
32613             }
32614 #endif
32615             if (sizeof(char) <= sizeof(long)) {
32616                 __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
32617 #ifdef HAVE_LONG_LONG
32618             } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
32619                 __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
32620 #endif
32621             }
32622         }
32623         {
32624 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
32625             PyErr_SetString(PyExc_RuntimeError,
32626                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
32627 #else
32628             char val;
32629             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
32630  #if PY_MAJOR_VERSION < 3
32631             if (likely(v) && !PyLong_Check(v)) {
32632                 PyObject *tmp = v;
32633                 v = PyNumber_Long(tmp);
32634                 Py_DECREF(tmp);
32635             }
32636  #endif
32637             if (likely(v)) {
32638                 int one = 1; int is_little = (int)*(unsigned char *)&one;
32639                 unsigned char *bytes = (unsigned char *)&val;
32640                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
32641                                               bytes, sizeof(val),
32642                                               is_little, !is_unsigned);
32643                 Py_DECREF(v);
32644                 if (likely(!ret))
32645                     return val;
32646             }
32647 #endif
32648             return (char) -1;
32649         }
32650     } else {
32651         char val;
32652         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
32653         if (!tmp) return (char) -1;
32654         val = __Pyx_PyInt_As_char(tmp);
32655         Py_DECREF(tmp);
32656         return val;
32657     }
32658 raise_overflow:
32659     PyErr_SetString(PyExc_OverflowError,
32660         "value too large to convert to char");
32661     return (char) -1;
32662 raise_neg_overflow:
32663     PyErr_SetString(PyExc_OverflowError,
32664         "can't convert negative value to char");
32665     return (char) -1;
32666 }
32667 
32668 /* FetchCommonType */
32669       static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
32670     PyObject* fake_module;
32671     PyTypeObject* cached_type = NULL;
32672     fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
32673     if (!fake_module) return NULL;
32674     Py_INCREF(fake_module);
32675     cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
32676     if (cached_type) {
32677         if (!PyType_Check((PyObject*)cached_type)) {
32678             PyErr_Format(PyExc_TypeError,
32679                 "Shared Cython type %.200s is not a type object",
32680                 type->tp_name);
32681             goto bad;
32682         }
32683         if (cached_type->tp_basicsize != type->tp_basicsize) {
32684             PyErr_Format(PyExc_TypeError,
32685                 "Shared Cython type %.200s has the wrong size, try recompiling",
32686                 type->tp_name);
32687             goto bad;
32688         }
32689     } else {
32690         if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
32691         PyErr_Clear();
32692         if (PyType_Ready(type) < 0) goto bad;
32693         if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
32694             goto bad;
32695         Py_INCREF(type);
32696         cached_type = type;
32697     }
32698 done:
32699     Py_DECREF(fake_module);
32700     return cached_type;
32701 bad:
32702     Py_XDECREF(cached_type);
32703     cached_type = NULL;
32704     goto done;
32705 }
32706 
32707 /* PyObjectGetMethod */
32708       static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
32709     PyObject *attr;
32710 #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
32711     PyTypeObject *tp = Py_TYPE(obj);
32712     PyObject *descr;
32713     descrgetfunc f = NULL;
32714     PyObject **dictptr, *dict;
32715     int meth_found = 0;
32716     assert (*method == NULL);
32717     if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
32718         attr = __Pyx_PyObject_GetAttrStr(obj, name);
32719         goto try_unpack;
32720     }
32721     if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
32722         return 0;
32723     }
32724     descr = _PyType_Lookup(tp, name);
32725     if (likely(descr != NULL)) {
32726         Py_INCREF(descr);
32727 #if PY_MAJOR_VERSION >= 3
32728         #ifdef __Pyx_CyFunction_USED
32729         if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
32730         #else
32731         if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type)))
32732         #endif
32733 #else
32734         #ifdef __Pyx_CyFunction_USED
32735         if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
32736         #else
32737         if (likely(PyFunction_Check(descr)))
32738         #endif
32739 #endif
32740         {
32741             meth_found = 1;
32742         } else {
32743             f = Py_TYPE(descr)->tp_descr_get;
32744             if (f != NULL && PyDescr_IsData(descr)) {
32745                 attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
32746                 Py_DECREF(descr);
32747                 goto try_unpack;
32748             }
32749         }
32750     }
32751     dictptr = _PyObject_GetDictPtr(obj);
32752     if (dictptr != NULL && (dict = *dictptr) != NULL) {
32753         Py_INCREF(dict);
32754         attr = __Pyx_PyDict_GetItemStr(dict, name);
32755         if (attr != NULL) {
32756             Py_INCREF(attr);
32757             Py_DECREF(dict);
32758             Py_XDECREF(descr);
32759             goto try_unpack;
32760         }
32761         Py_DECREF(dict);
32762     }
32763     if (meth_found) {
32764         *method = descr;
32765         return 1;
32766     }
32767     if (f != NULL) {
32768         attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
32769         Py_DECREF(descr);
32770         goto try_unpack;
32771     }
32772     if (descr != NULL) {
32773         *method = descr;
32774         return 0;
32775     }
32776     PyErr_Format(PyExc_AttributeError,
32777 #if PY_MAJOR_VERSION >= 3
32778                  "'%.50s' object has no attribute '%U'",
32779                  tp->tp_name, name);
32780 #else
32781                  "'%.50s' object has no attribute '%.400s'",
32782                  tp->tp_name, PyString_AS_STRING(name));
32783 #endif
32784     return 0;
32785 #else
32786     attr = __Pyx_PyObject_GetAttrStr(obj, name);
32787     goto try_unpack;
32788 #endif
32789 try_unpack:
32790 #if CYTHON_UNPACK_METHODS
32791     if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
32792         PyObject *function = PyMethod_GET_FUNCTION(attr);
32793         Py_INCREF(function);
32794         Py_DECREF(attr);
32795         *method = function;
32796         return 1;
32797     }
32798 #endif
32799     *method = attr;
32800     return 0;
32801 }
32802 
32803 /* PyObjectCallMethod1 */
32804       static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
32805     PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
32806     Py_DECREF(method);
32807     return result;
32808 }
32809 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
32810     PyObject *method = NULL, *result;
32811     int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
32812     if (likely(is_method)) {
32813         result = __Pyx_PyObject_Call2Args(method, obj, arg);
32814         Py_DECREF(method);
32815         return result;
32816     }
32817     if (unlikely(!method)) return NULL;
32818     return __Pyx__PyObject_CallMethod1(method, arg);
32819 }
32820 
32821 /* CoroutineBase */
32822       #include <structmember.h>
32823 #include <frameobject.h>
32824 #define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
32825 static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject **pvalue) {
32826     PyObject *et, *ev, *tb;
32827     PyObject *value = NULL;
32828     __Pyx_ErrFetch(&et, &ev, &tb);
32829     if (!et) {
32830         Py_XDECREF(tb);
32831         Py_XDECREF(ev);
32832         Py_INCREF(Py_None);
32833         *pvalue = Py_None;
32834         return 0;
32835     }
32836     if (likely(et == PyExc_StopIteration)) {
32837         if (!ev) {
32838             Py_INCREF(Py_None);
32839             value = Py_None;
32840         }
32841 #if PY_VERSION_HEX >= 0x030300A0
32842         else if (Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) {
32843             value = ((PyStopIterationObject *)ev)->value;
32844             Py_INCREF(value);
32845             Py_DECREF(ev);
32846         }
32847 #endif
32848         else if (unlikely(PyTuple_Check(ev))) {
32849             if (PyTuple_GET_SIZE(ev) >= 1) {
32850 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
32851                 value = PyTuple_GET_ITEM(ev, 0);
32852                 Py_INCREF(value);
32853 #else
32854                 value = PySequence_ITEM(ev, 0);
32855 #endif
32856             } else {
32857                 Py_INCREF(Py_None);
32858                 value = Py_None;
32859             }
32860             Py_DECREF(ev);
32861         }
32862         else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
32863             value = ev;
32864         }
32865         if (likely(value)) {
32866             Py_XDECREF(tb);
32867             Py_DECREF(et);
32868             *pvalue = value;
32869             return 0;
32870         }
32871     } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
32872         __Pyx_ErrRestore(et, ev, tb);
32873         return -1;
32874     }
32875     PyErr_NormalizeException(&et, &ev, &tb);
32876     if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
32877         __Pyx_ErrRestore(et, ev, tb);
32878         return -1;
32879     }
32880     Py_XDECREF(tb);
32881     Py_DECREF(et);
32882 #if PY_VERSION_HEX >= 0x030300A0
32883     value = ((PyStopIterationObject *)ev)->value;
32884     Py_INCREF(value);
32885     Py_DECREF(ev);
32886 #else
32887     {
32888         PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args);
32889         Py_DECREF(ev);
32890         if (likely(args)) {
32891             value = PySequence_GetItem(args, 0);
32892             Py_DECREF(args);
32893         }
32894         if (unlikely(!value)) {
32895             __Pyx_ErrRestore(NULL, NULL, NULL);
32896             Py_INCREF(Py_None);
32897             value = Py_None;
32898         }
32899     }
32900 #endif
32901     *pvalue = value;
32902     return 0;
32903 }
32904 static CYTHON_INLINE
32905 void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) {
32906     PyObject *t, *v, *tb;
32907     t = exc_state->exc_type;
32908     v = exc_state->exc_value;
32909     tb = exc_state->exc_traceback;
32910     exc_state->exc_type = NULL;
32911     exc_state->exc_value = NULL;
32912     exc_state->exc_traceback = NULL;
32913     Py_XDECREF(t);
32914     Py_XDECREF(v);
32915     Py_XDECREF(tb);
32916 }
32917 #define __Pyx_Coroutine_AlreadyRunningError(gen)  (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL)
32918 static void __Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject *gen) {
32919     const char *msg;
32920     if ((0)) {
32921     #ifdef __Pyx_Coroutine_USED
32922     } else if (__Pyx_Coroutine_Check((PyObject*)gen)) {
32923         msg = "coroutine already executing";
32924     #endif
32925     #ifdef __Pyx_AsyncGen_USED
32926     } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
32927         msg = "async generator already executing";
32928     #endif
32929     } else {
32930         msg = "generator already executing";
32931     }
32932     PyErr_SetString(PyExc_ValueError, msg);
32933 }
32934 #define __Pyx_Coroutine_NotStartedError(gen)  (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL)
32935 static void __Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject *gen) {
32936     const char *msg;
32937     if ((0)) {
32938     #ifdef __Pyx_Coroutine_USED
32939     } else if (__Pyx_Coroutine_Check(gen)) {
32940         msg = "can't send non-None value to a just-started coroutine";
32941     #endif
32942     #ifdef __Pyx_AsyncGen_USED
32943     } else if (__Pyx_AsyncGen_CheckExact(gen)) {
32944         msg = "can't send non-None value to a just-started async generator";
32945     #endif
32946     } else {
32947         msg = "can't send non-None value to a just-started generator";
32948     }
32949     PyErr_SetString(PyExc_TypeError, msg);
32950 }
32951 #define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing)  (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL)
32952 static void __Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject *gen, PyObject *value, CYTHON_UNUSED int closing) {
32953     #ifdef __Pyx_Coroutine_USED
32954     if (!closing && __Pyx_Coroutine_Check(gen)) {
32955         PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine");
32956     } else
32957     #endif
32958     if (value) {
32959         #ifdef __Pyx_AsyncGen_USED
32960         if (__Pyx_AsyncGen_CheckExact(gen))
32961             PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration);
32962         else
32963         #endif
32964         PyErr_SetNone(PyExc_StopIteration);
32965     }
32966 }
32967 static
32968 PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) {
32969     __Pyx_PyThreadState_declare
32970     PyThreadState *tstate;
32971     __Pyx_ExcInfoStruct *exc_state;
32972     PyObject *retval;
32973     assert(!self->is_running);
32974     if (unlikely(self->resume_label == 0)) {
32975         if (unlikely(value && value != Py_None)) {
32976             return __Pyx_Coroutine_NotStartedError((PyObject*)self);
32977         }
32978     }
32979     if (unlikely(self->resume_label == -1)) {
32980         return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing);
32981     }
32982 #if CYTHON_FAST_THREAD_STATE
32983     __Pyx_PyThreadState_assign
32984     tstate = __pyx_tstate;
32985 #else
32986     tstate = __Pyx_PyThreadState_Current;
32987 #endif
32988     exc_state = &self->gi_exc_state;
32989     if (exc_state->exc_type) {
32990         #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
32991         #else
32992         if (exc_state->exc_traceback) {
32993             PyTracebackObject *tb = (PyTracebackObject *) exc_state->exc_traceback;
32994             PyFrameObject *f = tb->tb_frame;
32995             Py_XINCREF(tstate->frame);
32996             assert(f->f_back == NULL);
32997             f->f_back = tstate->frame;
32998         }
32999         #endif
33000     }
33001 #if CYTHON_USE_EXC_INFO_STACK
33002     exc_state->previous_item = tstate->exc_info;
33003     tstate->exc_info = exc_state;
33004 #else
33005     if (exc_state->exc_type) {
33006         __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
33007     } else {
33008         __Pyx_Coroutine_ExceptionClear(exc_state);
33009         __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
33010     }
33011 #endif
33012     self->is_running = 1;
33013     retval = self->body((PyObject *) self, tstate, value);
33014     self->is_running = 0;
33015 #if CYTHON_USE_EXC_INFO_STACK
33016     exc_state = &self->gi_exc_state;
33017     tstate->exc_info = exc_state->previous_item;
33018     exc_state->previous_item = NULL;
33019     __Pyx_Coroutine_ResetFrameBackpointer(exc_state);
33020 #endif
33021     return retval;
33022 }
33023 static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) {
33024     PyObject *exc_tb = exc_state->exc_traceback;
33025     if (likely(exc_tb)) {
33026 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
33027 #else
33028         PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
33029         PyFrameObject *f = tb->tb_frame;
33030         Py_CLEAR(f->f_back);
33031 #endif
33032     }
33033 }
33034 static CYTHON_INLINE
33035 PyObject *__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject* gen, PyObject *retval) {
33036     if (unlikely(!retval)) {
33037         __Pyx_PyThreadState_declare
33038         __Pyx_PyThreadState_assign
33039         if (!__Pyx_PyErr_Occurred()) {
33040             PyObject *exc = PyExc_StopIteration;
33041             #ifdef __Pyx_AsyncGen_USED
33042             if (__Pyx_AsyncGen_CheckExact(gen))
33043                 exc = __Pyx_PyExc_StopAsyncIteration;
33044             #endif
33045             __Pyx_PyErr_SetNone(exc);
33046         }
33047     }
33048     return retval;
33049 }
33050 static CYTHON_INLINE
33051 PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
33052     PyObject *ret;
33053     PyObject *val = NULL;
33054     __Pyx_Coroutine_Undelegate(gen);
33055     __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
33056     ret = __Pyx_Coroutine_SendEx(gen, val, 0);
33057     Py_XDECREF(val);
33058     return ret;
33059 }
33060 static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
33061     PyObject *retval;
33062     __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
33063     PyObject *yf = gen->yieldfrom;
33064     if (unlikely(gen->is_running))
33065         return __Pyx_Coroutine_AlreadyRunningError(gen);
33066     if (yf) {
33067         PyObject *ret;
33068         gen->is_running = 1;
33069         #ifdef __Pyx_Generator_USED
33070         if (__Pyx_Generator_CheckExact(yf)) {
33071             ret = __Pyx_Coroutine_Send(yf, value);
33072         } else
33073         #endif
33074         #ifdef __Pyx_Coroutine_USED
33075         if (__Pyx_Coroutine_Check(yf)) {
33076             ret = __Pyx_Coroutine_Send(yf, value);
33077         } else
33078         #endif
33079         #ifdef __Pyx_AsyncGen_USED
33080         if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
33081             ret = __Pyx_async_gen_asend_send(yf, value);
33082         } else
33083         #endif
33084         #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
33085         if (PyGen_CheckExact(yf)) {
33086             ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
33087         } else
33088         #endif
33089         #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
33090         if (PyCoro_CheckExact(yf)) {
33091             ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
33092         } else
33093         #endif
33094         {
33095             if (value == Py_None)
33096                 ret = Py_TYPE(yf)->tp_iternext(yf);
33097             else
33098                 ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
33099         }
33100         gen->is_running = 0;
33101         if (likely(ret)) {
33102             return ret;
33103         }
33104         retval = __Pyx_Coroutine_FinishDelegation(gen);
33105     } else {
33106         retval = __Pyx_Coroutine_SendEx(gen, value, 0);
33107     }
33108     return __Pyx_Coroutine_MethodReturn(self, retval);
33109 }
33110 static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
33111     PyObject *retval = NULL;
33112     int err = 0;
33113     #ifdef __Pyx_Generator_USED
33114     if (__Pyx_Generator_CheckExact(yf)) {
33115         retval = __Pyx_Coroutine_Close(yf);
33116         if (!retval)
33117             return -1;
33118     } else
33119     #endif
33120     #ifdef __Pyx_Coroutine_USED
33121     if (__Pyx_Coroutine_Check(yf)) {
33122         retval = __Pyx_Coroutine_Close(yf);
33123         if (!retval)
33124             return -1;
33125     } else
33126     if (__Pyx_CoroutineAwait_CheckExact(yf)) {
33127         retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL);
33128         if (!retval)
33129             return -1;
33130     } else
33131     #endif
33132     #ifdef __Pyx_AsyncGen_USED
33133     if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
33134         retval = __Pyx_async_gen_asend_close(yf, NULL);
33135     } else
33136     if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
33137         retval = __Pyx_async_gen_athrow_close(yf, NULL);
33138     } else
33139     #endif
33140     {
33141         PyObject *meth;
33142         gen->is_running = 1;
33143         meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close);
33144         if (unlikely(!meth)) {
33145             if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
33146                 PyErr_WriteUnraisable(yf);
33147             }
33148             PyErr_Clear();
33149         } else {
33150             retval = PyObject_CallFunction(meth, NULL);
33151             Py_DECREF(meth);
33152             if (!retval)
33153                 err = -1;
33154         }
33155         gen->is_running = 0;
33156     }
33157     Py_XDECREF(retval);
33158     return err;
33159 }
33160 static PyObject *__Pyx_Generator_Next(PyObject *self) {
33161     __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
33162     PyObject *yf = gen->yieldfrom;
33163     if (unlikely(gen->is_running))
33164         return __Pyx_Coroutine_AlreadyRunningError(gen);
33165     if (yf) {
33166         PyObject *ret;
33167         gen->is_running = 1;
33168         #ifdef __Pyx_Generator_USED
33169         if (__Pyx_Generator_CheckExact(yf)) {
33170             ret = __Pyx_Generator_Next(yf);
33171         } else
33172         #endif
33173         #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
33174         if (PyGen_CheckExact(yf)) {
33175             ret = _PyGen_Send((PyGenObject*)yf, NULL);
33176         } else
33177         #endif
33178         #ifdef __Pyx_Coroutine_USED
33179         if (__Pyx_Coroutine_Check(yf)) {
33180             ret = __Pyx_Coroutine_Send(yf, Py_None);
33181         } else
33182         #endif
33183             ret = Py_TYPE(yf)->tp_iternext(yf);
33184         gen->is_running = 0;
33185         if (likely(ret)) {
33186             return ret;
33187         }
33188         return __Pyx_Coroutine_FinishDelegation(gen);
33189     }
33190     return __Pyx_Coroutine_SendEx(gen, Py_None, 0);
33191 }
33192 static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, CYTHON_UNUSED PyObject *arg) {
33193     return __Pyx_Coroutine_Close(self);
33194 }
33195 static PyObject *__Pyx_Coroutine_Close(PyObject *self) {
33196     __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
33197     PyObject *retval, *raised_exception;
33198     PyObject *yf = gen->yieldfrom;
33199     int err = 0;
33200     if (unlikely(gen->is_running))
33201         return __Pyx_Coroutine_AlreadyRunningError(gen);
33202     if (yf) {
33203         Py_INCREF(yf);
33204         err = __Pyx_Coroutine_CloseIter(gen, yf);
33205         __Pyx_Coroutine_Undelegate(gen);
33206         Py_DECREF(yf);
33207     }
33208     if (err == 0)
33209         PyErr_SetNone(PyExc_GeneratorExit);
33210     retval = __Pyx_Coroutine_SendEx(gen, NULL, 1);
33211     if (unlikely(retval)) {
33212         const char *msg;
33213         Py_DECREF(retval);
33214         if ((0)) {
33215         #ifdef __Pyx_Coroutine_USED
33216         } else if (__Pyx_Coroutine_Check(self)) {
33217             msg = "coroutine ignored GeneratorExit";
33218         #endif
33219         #ifdef __Pyx_AsyncGen_USED
33220         } else if (__Pyx_AsyncGen_CheckExact(self)) {
33221 #if PY_VERSION_HEX < 0x03060000
33222             msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)";
33223 #else
33224             msg = "async generator ignored GeneratorExit";
33225 #endif
33226         #endif
33227         } else {
33228             msg = "generator ignored GeneratorExit";
33229         }
33230         PyErr_SetString(PyExc_RuntimeError, msg);
33231         return NULL;
33232     }
33233     raised_exception = PyErr_Occurred();
33234     if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) {
33235         if (raised_exception) PyErr_Clear();
33236         Py_INCREF(Py_None);
33237         return Py_None;
33238     }
33239     return NULL;
33240 }
33241 static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb,
33242                                         PyObject *args, int close_on_genexit) {
33243     __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
33244     PyObject *yf = gen->yieldfrom;
33245     if (unlikely(gen->is_running))
33246         return __Pyx_Coroutine_AlreadyRunningError(gen);
33247     if (yf) {
33248         PyObject *ret;
33249         Py_INCREF(yf);
33250         if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
33251             int err = __Pyx_Coroutine_CloseIter(gen, yf);
33252             Py_DECREF(yf);
33253             __Pyx_Coroutine_Undelegate(gen);
33254             if (err < 0)
33255                 return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
33256             goto throw_here;
33257         }
33258         gen->is_running = 1;
33259         if (0
33260         #ifdef __Pyx_Generator_USED
33261             || __Pyx_Generator_CheckExact(yf)
33262         #endif
33263         #ifdef __Pyx_Coroutine_USED
33264             || __Pyx_Coroutine_Check(yf)
33265         #endif
33266             ) {
33267             ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
33268         #ifdef __Pyx_Coroutine_USED
33269         } else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
33270             ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
33271         #endif
33272         } else {
33273             PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw);
33274             if (unlikely(!meth)) {
33275                 Py_DECREF(yf);
33276                 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
33277                     gen->is_running = 0;
33278                     return NULL;
33279                 }
33280                 PyErr_Clear();
33281                 __Pyx_Coroutine_Undelegate(gen);
33282                 gen->is_running = 0;
33283                 goto throw_here;
33284             }
33285             if (likely(args)) {
33286                 ret = PyObject_CallObject(meth, args);
33287             } else {
33288                 ret = PyObject_CallFunctionObjArgs(meth, typ, val, tb, NULL);
33289             }
33290             Py_DECREF(meth);
33291         }
33292         gen->is_running = 0;
33293         Py_DECREF(yf);
33294         if (!ret) {
33295             ret = __Pyx_Coroutine_FinishDelegation(gen);
33296         }
33297         return __Pyx_Coroutine_MethodReturn(self, ret);
33298     }
33299 throw_here:
33300     __Pyx_Raise(typ, val, tb, NULL);
33301     return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
33302 }
33303 static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
33304     PyObject *typ;
33305     PyObject *val = NULL;
33306     PyObject *tb = NULL;
33307     if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))
33308         return NULL;
33309     return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1);
33310 }
33311 static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) {
33312     Py_VISIT(exc_state->exc_type);
33313     Py_VISIT(exc_state->exc_value);
33314     Py_VISIT(exc_state->exc_traceback);
33315     return 0;
33316 }
33317 static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) {
33318     Py_VISIT(gen->closure);
33319     Py_VISIT(gen->classobj);
33320     Py_VISIT(gen->yieldfrom);
33321     return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg);
33322 }
33323 static int __Pyx_Coroutine_clear(PyObject *self) {
33324     __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
33325     Py_CLEAR(gen->closure);
33326     Py_CLEAR(gen->classobj);
33327     Py_CLEAR(gen->yieldfrom);
33328     __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state);
33329 #ifdef __Pyx_AsyncGen_USED
33330     if (__Pyx_AsyncGen_CheckExact(self)) {
33331         Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
33332     }
33333 #endif
33334     Py_CLEAR(gen->gi_code);
33335     Py_CLEAR(gen->gi_name);
33336     Py_CLEAR(gen->gi_qualname);
33337     Py_CLEAR(gen->gi_modulename);
33338     return 0;
33339 }
33340 static void __Pyx_Coroutine_dealloc(PyObject *self) {
33341     __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
33342     PyObject_GC_UnTrack(gen);
33343     if (gen->gi_weakreflist != NULL)
33344         PyObject_ClearWeakRefs(self);
33345     if (gen->resume_label >= 0) {
33346         PyObject_GC_Track(self);
33347 #if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE
33348         if (PyObject_CallFinalizerFromDealloc(self))
33349 #else
33350         Py_TYPE(gen)->tp_del(self);
33351         if (self->ob_refcnt > 0)
33352 #endif
33353         {
33354             return;
33355         }
33356         PyObject_GC_UnTrack(self);
33357     }
33358 #ifdef __Pyx_AsyncGen_USED
33359     if (__Pyx_AsyncGen_CheckExact(self)) {
33360         /* We have to handle this case for asynchronous generators
33361            right here, because this code has to be between UNTRACK
33362            and GC_Del. */
33363         Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer);
33364     }
33365 #endif
33366     __Pyx_Coroutine_clear(self);
33367     PyObject_GC_Del(gen);
33368 }
33369 static void __Pyx_Coroutine_del(PyObject *self) {
33370     PyObject *error_type, *error_value, *error_traceback;
33371     __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
33372     __Pyx_PyThreadState_declare
33373     if (gen->resume_label < 0) {
33374         return;
33375     }
33376 #if !CYTHON_USE_TP_FINALIZE
33377     assert(self->ob_refcnt == 0);
33378     self->ob_refcnt = 1;
33379 #endif
33380     __Pyx_PyThreadState_assign
33381     __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
33382 #ifdef __Pyx_AsyncGen_USED
33383     if (__Pyx_AsyncGen_CheckExact(self)) {
33384         __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self;
33385         PyObject *finalizer = agen->ag_finalizer;
33386         if (finalizer && !agen->ag_closed) {
33387             PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self);
33388             if (unlikely(!res)) {
33389                 PyErr_WriteUnraisable(self);
33390             } else {
33391                 Py_DECREF(res);
33392             }
33393             __Pyx_ErrRestore(error_type, error_value, error_traceback);
33394             return;
33395         }
33396     }
33397 #endif
33398     if (unlikely(gen->resume_label == 0 && !error_value)) {
33399 #ifdef __Pyx_Coroutine_USED
33400 #ifdef __Pyx_Generator_USED
33401     if (!__Pyx_Generator_CheckExact(self))
33402 #endif
33403         {
33404         PyObject_GC_UnTrack(self);
33405 #if PY_MAJOR_VERSION >= 3  || defined(PyErr_WarnFormat)
33406         if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
33407             PyErr_WriteUnraisable(self);
33408 #else
33409         {PyObject *msg;
33410         char *cmsg;
33411         #if CYTHON_COMPILING_IN_PYPY
33412         msg = NULL;
33413         cmsg = (char*) "coroutine was never awaited";
33414         #else
33415         char *cname;
33416         PyObject *qualname;
33417         qualname = gen->gi_qualname;
33418         cname = PyString_AS_STRING(qualname);
33419         msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname);
33420         if (unlikely(!msg)) {
33421             PyErr_Clear();
33422             cmsg = (char*) "coroutine was never awaited";
33423         } else {
33424             cmsg = PyString_AS_STRING(msg);
33425         }
33426         #endif
33427         if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0))
33428             PyErr_WriteUnraisable(self);
33429         Py_XDECREF(msg);}
33430 #endif
33431         PyObject_GC_Track(self);
33432         }
33433 #endif
33434     } else {
33435         PyObject *res = __Pyx_Coroutine_Close(self);
33436         if (unlikely(!res)) {
33437             if (PyErr_Occurred())
33438                 PyErr_WriteUnraisable(self);
33439         } else {
33440             Py_DECREF(res);
33441         }
33442     }
33443     __Pyx_ErrRestore(error_type, error_value, error_traceback);
33444 #if !CYTHON_USE_TP_FINALIZE
33445     assert(self->ob_refcnt > 0);
33446     if (--self->ob_refcnt == 0) {
33447         return;
33448     }
33449     {
33450         Py_ssize_t refcnt = self->ob_refcnt;
33451         _Py_NewReference(self);
33452         self->ob_refcnt = refcnt;
33453     }
33454 #if CYTHON_COMPILING_IN_CPYTHON
33455     assert(PyType_IS_GC(self->ob_type) &&
33456            _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
33457     _Py_DEC_REFTOTAL;
33458 #endif
33459 #ifdef COUNT_ALLOCS
33460     --Py_TYPE(self)->tp_frees;
33461     --Py_TYPE(self)->tp_allocs;
33462 #endif
33463 #endif
33464 }
33465 static PyObject *
33466 __Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
33467 {
33468     PyObject *name = self->gi_name;
33469     if (unlikely(!name)) name = Py_None;
33470     Py_INCREF(name);
33471     return name;
33472 }
33473 static int
33474 __Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context)
33475 {
33476     PyObject *tmp;
33477 #if PY_MAJOR_VERSION >= 3
33478     if (unlikely(value == NULL || !PyUnicode_Check(value)))
33479 #else
33480     if (unlikely(value == NULL || !PyString_Check(value)))
33481 #endif
33482     {
33483         PyErr_SetString(PyExc_TypeError,
33484                         "__name__ must be set to a string object");
33485         return -1;
33486     }
33487     tmp = self->gi_name;
33488     Py_INCREF(value);
33489     self->gi_name = value;
33490     Py_XDECREF(tmp);
33491     return 0;
33492 }
33493 static PyObject *
33494 __Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
33495 {
33496     PyObject *name = self->gi_qualname;
33497     if (unlikely(!name)) name = Py_None;
33498     Py_INCREF(name);
33499     return name;
33500 }
33501 static int
33502 __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context)
33503 {
33504     PyObject *tmp;
33505 #if PY_MAJOR_VERSION >= 3
33506     if (unlikely(value == NULL || !PyUnicode_Check(value)))
33507 #else
33508     if (unlikely(value == NULL || !PyString_Check(value)))
33509 #endif
33510     {
33511         PyErr_SetString(PyExc_TypeError,
33512                         "__qualname__ must be set to a string object");
33513         return -1;
33514     }
33515     tmp = self->gi_qualname;
33516     Py_INCREF(value);
33517     self->gi_qualname = value;
33518     Py_XDECREF(tmp);
33519     return 0;
33520 }
33521 static __pyx_CoroutineObject *__Pyx__Coroutine_New(
33522             PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
33523             PyObject *name, PyObject *qualname, PyObject *module_name) {
33524     __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
33525     if (unlikely(!gen))
33526         return NULL;
33527     return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name);
33528 }
33529 static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
33530             __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
33531             PyObject *name, PyObject *qualname, PyObject *module_name) {
33532     gen->body = body;
33533     gen->closure = closure;
33534     Py_XINCREF(closure);
33535     gen->is_running = 0;
33536     gen->resume_label = 0;
33537     gen->classobj = NULL;
33538     gen->yieldfrom = NULL;
33539     gen->gi_exc_state.exc_type = NULL;
33540     gen->gi_exc_state.exc_value = NULL;
33541     gen->gi_exc_state.exc_traceback = NULL;
33542 #if CYTHON_USE_EXC_INFO_STACK
33543     gen->gi_exc_state.previous_item = NULL;
33544 #endif
33545     gen->gi_weakreflist = NULL;
33546     Py_XINCREF(qualname);
33547     gen->gi_qualname = qualname;
33548     Py_XINCREF(name);
33549     gen->gi_name = name;
33550     Py_XINCREF(module_name);
33551     gen->gi_modulename = module_name;
33552     Py_XINCREF(code);
33553     gen->gi_code = code;
33554     PyObject_GC_Track(gen);
33555     return gen;
33556 }
33557 
33558 /* PatchModuleWithCoroutine */
33559       static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) {
33560 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
33561     int result;
33562     PyObject *globals, *result_obj;
33563     globals = PyDict_New();  if (unlikely(!globals)) goto ignore;
33564     result = PyDict_SetItemString(globals, "_cython_coroutine_type",
33565     #ifdef __Pyx_Coroutine_USED
33566         (PyObject*)__pyx_CoroutineType);
33567     #else
33568         Py_None);
33569     #endif
33570     if (unlikely(result < 0)) goto ignore;
33571     result = PyDict_SetItemString(globals, "_cython_generator_type",
33572     #ifdef __Pyx_Generator_USED
33573         (PyObject*)__pyx_GeneratorType);
33574     #else
33575         Py_None);
33576     #endif
33577     if (unlikely(result < 0)) goto ignore;
33578     if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore;
33579     if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore;
33580     result_obj = PyRun_String(py_code, Py_file_input, globals, globals);
33581     if (unlikely(!result_obj)) goto ignore;
33582     Py_DECREF(result_obj);
33583     Py_DECREF(globals);
33584     return module;
33585 ignore:
33586     Py_XDECREF(globals);
33587     PyErr_WriteUnraisable(module);
33588     if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) {
33589         Py_DECREF(module);
33590         module = NULL;
33591     }
33592 #else
33593     py_code++;
33594 #endif
33595     return module;
33596 }
33597 
33598 /* PatchGeneratorABC */
33599       #ifndef CYTHON_REGISTER_ABCS
33600 #define CYTHON_REGISTER_ABCS 1
33601 #endif
33602 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
33603 static PyObject* __Pyx_patch_abc_module(PyObject *module);
33604 static PyObject* __Pyx_patch_abc_module(PyObject *module) {
33605     module = __Pyx_Coroutine_patch_module(
33606         module, ""
33607 "if _cython_generator_type is not None:\n"
33608 "    try: Generator = _module.Generator\n"
33609 "    except AttributeError: pass\n"
33610 "    else: Generator.register(_cython_generator_type)\n"
33611 "if _cython_coroutine_type is not None:\n"
33612 "    try: Coroutine = _module.Coroutine\n"
33613 "    except AttributeError: pass\n"
33614 "    else: Coroutine.register(_cython_coroutine_type)\n"
33615     );
33616     return module;
33617 }
33618 #endif
33619 static int __Pyx_patch_abc(void) {
33620 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
33621     static int abc_patched = 0;
33622     if (CYTHON_REGISTER_ABCS && !abc_patched) {
33623         PyObject *module;
33624         module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections");
33625         if (!module) {
33626             PyErr_WriteUnraisable(NULL);
33627             if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
33628                     ((PY_MAJOR_VERSION >= 3) ?
33629                         "Cython module failed to register with collections.abc module" :
33630                         "Cython module failed to register with collections module"), 1) < 0)) {
33631                 return -1;
33632             }
33633         } else {
33634             module = __Pyx_patch_abc_module(module);
33635             abc_patched = 1;
33636             if (unlikely(!module))
33637                 return -1;
33638             Py_DECREF(module);
33639         }
33640         module = PyImport_ImportModule("backports_abc");
33641         if (module) {
33642             module = __Pyx_patch_abc_module(module);
33643             Py_XDECREF(module);
33644         }
33645         if (!module) {
33646             PyErr_Clear();
33647         }
33648     }
33649 #else
33650     if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL);
33651 #endif
33652     return 0;
33653 }
33654 
33655 /* Generator */
33656       static PyMethodDef __pyx_Generator_methods[] = {
33657     {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
33658      (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
33659     {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
33660      (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
33661     {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS,
33662      (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")},
33663     {0, 0, 0, 0}
33664 };
33665 static PyMemberDef __pyx_Generator_memberlist[] = {
33666     {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL},
33667     {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
33668      (char*) PyDoc_STR("object being iterated by 'yield from', or None")},
33669     {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
33670     {0, 0, 0, 0, 0}
33671 };
33672 static PyGetSetDef __pyx_Generator_getsets[] = {
33673     {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
33674      (char*) PyDoc_STR("name of the generator"), 0},
33675     {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
33676      (char*) PyDoc_STR("qualified name of the generator"), 0},
33677     {0, 0, 0, 0, 0}
33678 };
33679 static PyTypeObject __pyx_GeneratorType_type = {
33680     PyVarObject_HEAD_INIT(0, 0)
33681     "generator",
33682     sizeof(__pyx_CoroutineObject),
33683     0,
33684     (destructor) __Pyx_Coroutine_dealloc,
33685     0,
33686     0,
33687     0,
33688     0,
33689     0,
33690     0,
33691     0,
33692     0,
33693     0,
33694     0,
33695     0,
33696     0,
33697     0,
33698     0,
33699     Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
33700     0,
33701     (traverseproc) __Pyx_Coroutine_traverse,
33702     0,
33703     0,
33704     offsetof(__pyx_CoroutineObject, gi_weakreflist),
33705     0,
33706     (iternextfunc) __Pyx_Generator_Next,
33707     __pyx_Generator_methods,
33708     __pyx_Generator_memberlist,
33709     __pyx_Generator_getsets,
33710     0,
33711     0,
33712     0,
33713     0,
33714     0,
33715     0,
33716     0,
33717     0,
33718     0,
33719     0,
33720     0,
33721     0,
33722     0,
33723     0,
33724     0,
33725 #if CYTHON_USE_TP_FINALIZE
33726     0,
33727 #else
33728     __Pyx_Coroutine_del,
33729 #endif
33730     0,
33731 #if CYTHON_USE_TP_FINALIZE
33732     __Pyx_Coroutine_del,
33733 #elif PY_VERSION_HEX >= 0x030400a1
33734     0,
33735 #endif
33736 #if PY_VERSION_HEX >= 0x030800b1
33737     0,
33738 #endif
33739 };
33740 static int __pyx_Generator_init(void) {
33741     __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
33742     __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
33743     __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
33744     if (unlikely(!__pyx_GeneratorType)) {
33745         return -1;
33746     }
33747     return 0;
33748 }
33749 
33750 /* TypeInfoCompare */
33751       static int
33752 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
33753 {
33754     int i;
33755     if (!a || !b)
33756         return 0;
33757     if (a == b)
33758         return 1;
33759     if (a->size != b->size || a->typegroup != b->typegroup ||
33760             a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
33761         if (a->typegroup == 'H' || b->typegroup == 'H') {
33762             return a->size == b->size;
33763         } else {
33764             return 0;
33765         }
33766     }
33767     if (a->ndim) {
33768         for (i = 0; i < a->ndim; i++)
33769             if (a->arraysize[i] != b->arraysize[i])
33770                 return 0;
33771     }
33772     if (a->typegroup == 'S') {
33773         if (a->flags != b->flags)
33774             return 0;
33775         if (a->fields || b->fields) {
33776             if (!(a->fields && b->fields))
33777                 return 0;
33778             for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
33779                 __Pyx_StructField *field_a = a->fields + i;
33780                 __Pyx_StructField *field_b = b->fields + i;
33781                 if (field_a->offset != field_b->offset ||
33782                     !__pyx_typeinfo_cmp(field_a->type, field_b->type))
33783                     return 0;
33784             }
33785             return !a->fields[i].type && !b->fields[i].type;
33786         }
33787     }
33788     return 1;
33789 }
33790 
33791 /* MemviewSliceValidateAndInit */
33792       static int
33793 __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
33794 {
33795     if (buf->shape[dim] <= 1)
33796         return 1;
33797     if (buf->strides) {
33798         if (spec & __Pyx_MEMVIEW_CONTIG) {
33799             if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
33800                 if (buf->strides[dim] != sizeof(void *)) {
33801                     PyErr_Format(PyExc_ValueError,
33802                                  "Buffer is not indirectly contiguous "
33803                                  "in dimension %d.", dim);
33804                     goto fail;
33805                 }
33806             } else if (buf->strides[dim] != buf->itemsize) {
33807                 PyErr_SetString(PyExc_ValueError,
33808                                 "Buffer and memoryview are not contiguous "
33809                                 "in the same dimension.");
33810                 goto fail;
33811             }
33812         }
33813         if (spec & __Pyx_MEMVIEW_FOLLOW) {
33814             Py_ssize_t stride = buf->strides[dim];
33815             if (stride < 0)
33816                 stride = -stride;
33817             if (stride < buf->itemsize) {
33818                 PyErr_SetString(PyExc_ValueError,
33819                                 "Buffer and memoryview are not contiguous "
33820                                 "in the same dimension.");
33821                 goto fail;
33822             }
33823         }
33824     } else {
33825         if (spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1) {
33826             PyErr_Format(PyExc_ValueError,
33827                          "C-contiguous buffer is not contiguous in "
33828                          "dimension %d", dim);
33829             goto fail;
33830         } else if (spec & (__Pyx_MEMVIEW_PTR)) {
33831             PyErr_Format(PyExc_ValueError,
33832                          "C-contiguous buffer is not indirect in "
33833                          "dimension %d", dim);
33834             goto fail;
33835         } else if (buf->suboffsets) {
33836             PyErr_SetString(PyExc_ValueError,
33837                             "Buffer exposes suboffsets but no strides");
33838             goto fail;
33839         }
33840     }
33841     return 1;
33842 fail:
33843     return 0;
33844 }
33845 static int
33846 __pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec)
33847 {
33848     if (spec & __Pyx_MEMVIEW_DIRECT) {
33849         if (buf->suboffsets && buf->suboffsets[dim] >= 0) {
33850             PyErr_Format(PyExc_ValueError,
33851                          "Buffer not compatible with direct access "
33852                          "in dimension %d.", dim);
33853             goto fail;
33854         }
33855     }
33856     if (spec & __Pyx_MEMVIEW_PTR) {
33857         if (!buf->suboffsets || (buf->suboffsets[dim] < 0)) {
33858             PyErr_Format(PyExc_ValueError,
33859                          "Buffer is not indirectly accessible "
33860                          "in dimension %d.", dim);
33861             goto fail;
33862         }
33863     }
33864     return 1;
33865 fail:
33866     return 0;
33867 }
33868 static int
33869 __pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
33870 {
33871     int i;
33872     if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
33873         Py_ssize_t stride = 1;
33874         for (i = 0; i < ndim; i++) {
33875             if (stride * buf->itemsize != buf->strides[i] &&
33876                     buf->shape[i] > 1)
33877             {
33878                 PyErr_SetString(PyExc_ValueError,
33879                     "Buffer not fortran contiguous.");
33880                 goto fail;
33881             }
33882             stride = stride * buf->shape[i];
33883         }
33884     } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
33885         Py_ssize_t stride = 1;
33886         for (i = ndim - 1; i >- 1; i--) {
33887             if (stride * buf->itemsize != buf->strides[i] &&
33888                     buf->shape[i] > 1) {
33889                 PyErr_SetString(PyExc_ValueError,
33890                     "Buffer not C contiguous.");
33891                 goto fail;
33892             }
33893             stride = stride * buf->shape[i];
33894         }
33895     }
33896     return 1;
33897 fail:
33898     return 0;
33899 }
33900 static int __Pyx_ValidateAndInit_memviewslice(
33901                 int *axes_specs,
33902                 int c_or_f_flag,
33903                 int buf_flags,
33904                 int ndim,
33905                 __Pyx_TypeInfo *dtype,
33906                 __Pyx_BufFmt_StackElem stack[],
33907                 __Pyx_memviewslice *memviewslice,
33908                 PyObject *original_obj)
33909 {
33910     struct __pyx_memoryview_obj *memview, *new_memview;
33911     __Pyx_RefNannyDeclarations
33912     Py_buffer *buf;
33913     int i, spec = 0, retval = -1;
33914     __Pyx_BufFmt_Context ctx;
33915     int from_memoryview = __pyx_memoryview_check(original_obj);
33916     __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
33917     if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
33918                                                             original_obj)->typeinfo)) {
33919         memview = (struct __pyx_memoryview_obj *) original_obj;
33920         new_memview = NULL;
33921     } else {
33922         memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
33923                                             original_obj, buf_flags, 0, dtype);
33924         new_memview = memview;
33925         if (unlikely(!memview))
33926             goto fail;
33927     }
33928     buf = &memview->view;
33929     if (buf->ndim != ndim) {
33930         PyErr_Format(PyExc_ValueError,
33931                 "Buffer has wrong number of dimensions (expected %d, got %d)",
33932                 ndim, buf->ndim);
33933         goto fail;
33934     }
33935     if (new_memview) {
33936         __Pyx_BufFmt_Init(&ctx, stack, dtype);
33937         if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
33938     }
33939     if ((unsigned) buf->itemsize != dtype->size) {
33940         PyErr_Format(PyExc_ValueError,
33941                      "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
33942                      "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
33943                      buf->itemsize,
33944                      (buf->itemsize > 1) ? "s" : "",
33945                      dtype->name,
33946                      dtype->size,
33947                      (dtype->size > 1) ? "s" : "");
33948         goto fail;
33949     }
33950     for (i = 0; i < ndim; i++) {
33951         spec = axes_specs[i];
33952         if (!__pyx_check_strides(buf, i, ndim, spec))
33953             goto fail;
33954         if (!__pyx_check_suboffsets(buf, i, ndim, spec))
33955             goto fail;
33956     }
33957     if (buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag))
33958         goto fail;
33959     if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
33960                                          new_memview != NULL) == -1)) {
33961         goto fail;
33962     }
33963     retval = 0;
33964     goto no_fail;
33965 fail:
33966     Py_XDECREF(new_memview);
33967     retval = -1;
33968 no_fail:
33969     __Pyx_RefNannyFinishContext();
33970     return retval;
33971 }
33972 
33973 /* ObjectToMemviewSlice */
33974       static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_int64_t(PyObject *obj, int writable_flag) {
33975     __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
33976     __Pyx_BufFmt_StackElem stack[1];
33977     int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
33978     int retcode;
33979     if (obj == Py_None) {
33980         result.memview = (struct __pyx_memoryview_obj *) Py_None;
33981         return result;
33982     }
33983     retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
33984                                                  (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
33985                                                  &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, stack,
33986                                                  &result, obj);
33987     if (unlikely(retcode == -1))
33988         goto __pyx_fail;
33989     return result;
33990 __pyx_fail:
33991     result.memview = NULL;
33992     result.data = NULL;
33993     return result;
33994 }
33995 
33996 /* CheckBinaryVersion */
33997       static int __Pyx_check_binary_version(void) {
33998     char ctversion[4], rtversion[4];
33999     PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
34000     PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
34001     if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
34002         char message[200];
34003         PyOS_snprintf(message, sizeof(message),
34004                       "compiletime version %s of module '%.100s' "
34005                       "does not match runtime version %s",
34006                       ctversion, __Pyx_MODULE_NAME, rtversion);
34007         return PyErr_WarnEx(NULL, message, 1);
34008     }
34009     return 0;
34010 }
34011 
34012 /* VoidPtrImport */
34013       #ifndef __PYX_HAVE_RT_ImportVoidPtr
34014 #define __PYX_HAVE_RT_ImportVoidPtr
34015 static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig) {
34016     PyObject *d = 0;
34017     PyObject *cobj = 0;
34018     d = PyObject_GetAttrString(module, (char *)"__pyx_capi__");
34019     if (!d)
34020         goto bad;
34021     cobj = PyDict_GetItemString(d, name);
34022     if (!cobj) {
34023         PyErr_Format(PyExc_ImportError,
34024             "%.200s does not export expected C variable %.200s",
34025                 PyModule_GetName(module), name);
34026         goto bad;
34027     }
34028 #if PY_VERSION_HEX >= 0x02070000
34029     if (!PyCapsule_IsValid(cobj, sig)) {
34030         PyErr_Format(PyExc_TypeError,
34031             "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
34032              PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj));
34033         goto bad;
34034     }
34035     *p = PyCapsule_GetPointer(cobj, sig);
34036 #else
34037     {const char *desc, *s1, *s2;
34038     desc = (const char *)PyCObject_GetDesc(cobj);
34039     if (!desc)
34040         goto bad;
34041     s1 = desc; s2 = sig;
34042     while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; }
34043     if (*s1 != *s2) {
34044         PyErr_Format(PyExc_TypeError,
34045             "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
34046              PyModule_GetName(module), name, sig, desc);
34047         goto bad;
34048     }
34049     *p = PyCObject_AsVoidPtr(cobj);}
34050 #endif
34051     if (!(*p))
34052         goto bad;
34053     Py_DECREF(d);
34054     return 0;
34055 bad:
34056     Py_XDECREF(d);
34057     return -1;
34058 }
34059 #endif
34060 
34061 /* FunctionImport */
34062       #ifndef __PYX_HAVE_RT_ImportFunction
34063 #define __PYX_HAVE_RT_ImportFunction
34064 static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {
34065     PyObject *d = 0;
34066     PyObject *cobj = 0;
34067     union {
34068         void (*fp)(void);
34069         void *p;
34070     } tmp;
34071     d = PyObject_GetAttrString(module, (char *)"__pyx_capi__");
34072     if (!d)
34073         goto bad;
34074     cobj = PyDict_GetItemString(d, funcname);
34075     if (!cobj) {
34076         PyErr_Format(PyExc_ImportError,
34077             "%.200s does not export expected C function %.200s",
34078                 PyModule_GetName(module), funcname);
34079         goto bad;
34080     }
34081 #if PY_VERSION_HEX >= 0x02070000
34082     if (!PyCapsule_IsValid(cobj, sig)) {
34083         PyErr_Format(PyExc_TypeError,
34084             "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
34085              PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj));
34086         goto bad;
34087     }
34088     tmp.p = PyCapsule_GetPointer(cobj, sig);
34089 #else
34090     {const char *desc, *s1, *s2;
34091     desc = (const char *)PyCObject_GetDesc(cobj);
34092     if (!desc)
34093         goto bad;
34094     s1 = desc; s2 = sig;
34095     while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; }
34096     if (*s1 != *s2) {
34097         PyErr_Format(PyExc_TypeError,
34098             "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
34099              PyModule_GetName(module), funcname, sig, desc);
34100         goto bad;
34101     }
34102     tmp.p = PyCObject_AsVoidPtr(cobj);}
34103 #endif
34104     *f = tmp.fp;
34105     if (!(*f))
34106         goto bad;
34107     Py_DECREF(d);
34108     return 0;
34109 bad:
34110     Py_XDECREF(d);
34111     return -1;
34112 }
34113 #endif
34114 
34115 /* InitStrings */
34116       static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
34117     while (t->p) {
34118         #if PY_MAJOR_VERSION < 3
34119         if (t->is_unicode) {
34120             *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
34121         } else if (t->intern) {
34122             *t->p = PyString_InternFromString(t->s);
34123         } else {
34124             *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
34125         }
34126         #else
34127         if (t->is_unicode | t->is_str) {
34128             if (t->intern) {
34129                 *t->p = PyUnicode_InternFromString(t->s);
34130             } else if (t->encoding) {
34131                 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
34132             } else {
34133                 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
34134             }
34135         } else {
34136             *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
34137         }
34138         #endif
34139         if (!*t->p)
34140             return -1;
34141         if (PyObject_Hash(*t->p) == -1)
34142             return -1;
34143         ++t;
34144     }
34145     return 0;
34146 }
34147 
34148 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
34149     return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
34150 }
34151 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
34152     Py_ssize_t ignore;
34153     return __Pyx_PyObject_AsStringAndSize(o, &ignore);
34154 }
34155 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
34156 #if !CYTHON_PEP393_ENABLED
34157 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
34158     char* defenc_c;
34159     PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
34160     if (!defenc) return NULL;
34161     defenc_c = PyBytes_AS_STRING(defenc);
34162 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
34163     {
34164         char* end = defenc_c + PyBytes_GET_SIZE(defenc);
34165         char* c;
34166         for (c = defenc_c; c < end; c++) {
34167             if ((unsigned char) (*c) >= 128) {
34168                 PyUnicode_AsASCIIString(o);
34169                 return NULL;
34170             }
34171         }
34172     }
34173 #endif
34174     *length = PyBytes_GET_SIZE(defenc);
34175     return defenc_c;
34176 }
34177 #else
34178 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
34179     if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
34180 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
34181     if (likely(PyUnicode_IS_ASCII(o))) {
34182         *length = PyUnicode_GET_LENGTH(o);
34183         return PyUnicode_AsUTF8(o);
34184     } else {
34185         PyUnicode_AsASCIIString(o);
34186         return NULL;
34187     }
34188 #else
34189     return PyUnicode_AsUTF8AndSize(o, length);
34190 #endif
34191 }
34192 #endif
34193 #endif
34194 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
34195 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
34196     if (
34197 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
34198             __Pyx_sys_getdefaultencoding_not_ascii &&
34199 #endif
34200             PyUnicode_Check(o)) {
34201         return __Pyx_PyUnicode_AsStringAndSize(o, length);
34202     } else
34203 #endif
34204 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
34205     if (PyByteArray_Check(o)) {
34206         *length = PyByteArray_GET_SIZE(o);
34207         return PyByteArray_AS_STRING(o);
34208     } else
34209 #endif
34210     {
34211         char* result;
34212         int r = PyBytes_AsStringAndSize(o, &result, length);
34213         if (unlikely(r < 0)) {
34214             return NULL;
34215         } else {
34216             return result;
34217         }
34218     }
34219 }
34220 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
34221    int is_true = x == Py_True;
34222    if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
34223    else return PyObject_IsTrue(x);
34224 }
34225 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
34226     int retval;
34227     if (unlikely(!x)) return -1;
34228     retval = __Pyx_PyObject_IsTrue(x);
34229     Py_DECREF(x);
34230     return retval;
34231 }
34232 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
34233 #if PY_MAJOR_VERSION >= 3
34234     if (PyLong_Check(result)) {
34235         if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
34236                 "__int__ returned non-int (type %.200s).  "
34237                 "The ability to return an instance of a strict subclass of int "
34238                 "is deprecated, and may be removed in a future version of Python.",
34239                 Py_TYPE(result)->tp_name)) {
34240             Py_DECREF(result);
34241             return NULL;
34242         }
34243         return result;
34244     }
34245 #endif
34246     PyErr_Format(PyExc_TypeError,
34247                  "__%.4s__ returned non-%.4s (type %.200s)",
34248                  type_name, type_name, Py_TYPE(result)->tp_name);
34249     Py_DECREF(result);
34250     return NULL;
34251 }
34252 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
34253 #if CYTHON_USE_TYPE_SLOTS
34254   PyNumberMethods *m;
34255 #endif
34256   const char *name = NULL;
34257   PyObject *res = NULL;
34258 #if PY_MAJOR_VERSION < 3
34259   if (likely(PyInt_Check(x) || PyLong_Check(x)))
34260 #else
34261   if (likely(PyLong_Check(x)))
34262 #endif
34263     return __Pyx_NewRef(x);
34264 #if CYTHON_USE_TYPE_SLOTS
34265   m = Py_TYPE(x)->tp_as_number;
34266   #if PY_MAJOR_VERSION < 3
34267   if (m && m->nb_int) {
34268     name = "int";
34269     res = m->nb_int(x);
34270   }
34271   else if (m && m->nb_long) {
34272     name = "long";
34273     res = m->nb_long(x);
34274   }
34275   #else
34276   if (likely(m && m->nb_int)) {
34277     name = "int";
34278     res = m->nb_int(x);
34279   }
34280   #endif
34281 #else
34282   if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
34283     res = PyNumber_Int(x);
34284   }
34285 #endif
34286   if (likely(res)) {
34287 #if PY_MAJOR_VERSION < 3
34288     if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
34289 #else
34290     if (unlikely(!PyLong_CheckExact(res))) {
34291 #endif
34292         return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
34293     }
34294   }
34295   else if (!PyErr_Occurred()) {
34296     PyErr_SetString(PyExc_TypeError,
34297                     "an integer is required");
34298   }
34299   return res;
34300 }
34301 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
34302   Py_ssize_t ival;
34303   PyObject *x;
34304 #if PY_MAJOR_VERSION < 3
34305   if (likely(PyInt_CheckExact(b))) {
34306     if (sizeof(Py_ssize_t) >= sizeof(long))
34307         return PyInt_AS_LONG(b);
34308     else
34309         return PyInt_AsSsize_t(b);
34310   }
34311 #endif
34312   if (likely(PyLong_CheckExact(b))) {
34313     #if CYTHON_USE_PYLONG_INTERNALS
34314     const digit* digits = ((PyLongObject*)b)->ob_digit;
34315     const Py_ssize_t size = Py_SIZE(b);
34316     if (likely(__Pyx_sst_abs(size) <= 1)) {
34317         ival = likely(size) ? digits[0] : 0;
34318         if (size == -1) ival = -ival;
34319         return ival;
34320     } else {
34321       switch (size) {
34322          case 2:
34323            if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
34324              return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
34325            }
34326            break;
34327          case -2:
34328            if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
34329              return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
34330            }
34331            break;
34332          case 3:
34333            if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
34334              return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
34335            }
34336            break;
34337          case -3:
34338            if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
34339              return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
34340            }
34341            break;
34342          case 4:
34343            if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
34344              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]));
34345            }
34346            break;
34347          case -4:
34348            if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
34349              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]));
34350            }
34351            break;
34352       }
34353     }
34354     #endif
34355     return PyLong_AsSsize_t(b);
34356   }
34357   x = PyNumber_Index(b);
34358   if (!x) return -1;
34359   ival = PyInt_AsSsize_t(x);
34360   Py_DECREF(x);
34361   return ival;
34362 }
34363 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
34364   return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
34365 }
34366 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
34367     return PyInt_FromSize_t(ival);
34368 }
34369 
34370 
34371 #endif /* Py_PYTHON_H */
34372