1 /* Generated by Cython 0.29.12 */
2 
3 /* BEGIN: Cython Metadata
4 {
5     "distutils": {
6         "depends": [
7             "yt/utilities/lib/platform_dep.h",
8             "yt/utilities/lib/tsearch.h"
9         ],
10         "include_dirs": [
11             "yt/utilities/lib/"
12         ],
13         "libraries": [
14             "m"
15         ],
16         "name": "yt.geometry.grid_container",
17         "sources": [
18             "yt/geometry/grid_container.pyx"
19         ]
20     },
21     "module_name": "yt.geometry.grid_container"
22 }
23 END: Cython Metadata */
24 
25 #define PY_SSIZE_T_CLEAN
26 #include "Python.h"
27 #ifndef Py_PYTHON_H
28     #error Python headers needed to compile C extensions, please install development version of Python.
29 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
30     #error Cython requires Python 2.6+ or Python 3.3+.
31 #else
32 #define CYTHON_ABI "0_29_12"
33 #define CYTHON_HEX_VERSION 0x001D0CF0
34 #define CYTHON_FUTURE_DIVISION 0
35 #include <stddef.h>
36 #ifndef offsetof
37   #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
38 #endif
39 #if !defined(WIN32) && !defined(MS_WINDOWS)
40   #ifndef __stdcall
41     #define __stdcall
42   #endif
43   #ifndef __cdecl
44     #define __cdecl
45   #endif
46   #ifndef __fastcall
47     #define __fastcall
48   #endif
49 #endif
50 #ifndef DL_IMPORT
51   #define DL_IMPORT(t) t
52 #endif
53 #ifndef DL_EXPORT
54   #define DL_EXPORT(t) t
55 #endif
56 #define __PYX_COMMA ,
57 #ifndef HAVE_LONG_LONG
58   #if PY_VERSION_HEX >= 0x02070000
59     #define HAVE_LONG_LONG
60   #endif
61 #endif
62 #ifndef PY_LONG_LONG
63   #define PY_LONG_LONG LONG_LONG
64 #endif
65 #ifndef Py_HUGE_VAL
66   #define Py_HUGE_VAL HUGE_VAL
67 #endif
68 #ifdef PYPY_VERSION
69   #define CYTHON_COMPILING_IN_PYPY 1
70   #define CYTHON_COMPILING_IN_PYSTON 0
71   #define CYTHON_COMPILING_IN_CPYTHON 0
72   #undef CYTHON_USE_TYPE_SLOTS
73   #define CYTHON_USE_TYPE_SLOTS 0
74   #undef CYTHON_USE_PYTYPE_LOOKUP
75   #define CYTHON_USE_PYTYPE_LOOKUP 0
76   #if PY_VERSION_HEX < 0x03050000
77     #undef CYTHON_USE_ASYNC_SLOTS
78     #define CYTHON_USE_ASYNC_SLOTS 0
79   #elif !defined(CYTHON_USE_ASYNC_SLOTS)
80     #define CYTHON_USE_ASYNC_SLOTS 1
81   #endif
82   #undef CYTHON_USE_PYLIST_INTERNALS
83   #define CYTHON_USE_PYLIST_INTERNALS 0
84   #undef CYTHON_USE_UNICODE_INTERNALS
85   #define CYTHON_USE_UNICODE_INTERNALS 0
86   #undef CYTHON_USE_UNICODE_WRITER
87   #define CYTHON_USE_UNICODE_WRITER 0
88   #undef CYTHON_USE_PYLONG_INTERNALS
89   #define CYTHON_USE_PYLONG_INTERNALS 0
90   #undef CYTHON_AVOID_BORROWED_REFS
91   #define CYTHON_AVOID_BORROWED_REFS 1
92   #undef CYTHON_ASSUME_SAFE_MACROS
93   #define CYTHON_ASSUME_SAFE_MACROS 0
94   #undef CYTHON_UNPACK_METHODS
95   #define CYTHON_UNPACK_METHODS 0
96   #undef CYTHON_FAST_THREAD_STATE
97   #define CYTHON_FAST_THREAD_STATE 0
98   #undef CYTHON_FAST_PYCALL
99   #define CYTHON_FAST_PYCALL 0
100   #undef CYTHON_PEP489_MULTI_PHASE_INIT
101   #define CYTHON_PEP489_MULTI_PHASE_INIT 0
102   #undef CYTHON_USE_TP_FINALIZE
103   #define CYTHON_USE_TP_FINALIZE 0
104   #undef CYTHON_USE_DICT_VERSIONS
105   #define CYTHON_USE_DICT_VERSIONS 0
106   #undef CYTHON_USE_EXC_INFO_STACK
107   #define CYTHON_USE_EXC_INFO_STACK 0
108 #elif defined(PYSTON_VERSION)
109   #define CYTHON_COMPILING_IN_PYPY 0
110   #define CYTHON_COMPILING_IN_PYSTON 1
111   #define CYTHON_COMPILING_IN_CPYTHON 0
112   #ifndef CYTHON_USE_TYPE_SLOTS
113     #define CYTHON_USE_TYPE_SLOTS 1
114   #endif
115   #undef CYTHON_USE_PYTYPE_LOOKUP
116   #define CYTHON_USE_PYTYPE_LOOKUP 0
117   #undef CYTHON_USE_ASYNC_SLOTS
118   #define CYTHON_USE_ASYNC_SLOTS 0
119   #undef CYTHON_USE_PYLIST_INTERNALS
120   #define CYTHON_USE_PYLIST_INTERNALS 0
121   #ifndef CYTHON_USE_UNICODE_INTERNALS
122     #define CYTHON_USE_UNICODE_INTERNALS 1
123   #endif
124   #undef CYTHON_USE_UNICODE_WRITER
125   #define CYTHON_USE_UNICODE_WRITER 0
126   #undef CYTHON_USE_PYLONG_INTERNALS
127   #define CYTHON_USE_PYLONG_INTERNALS 0
128   #ifndef CYTHON_AVOID_BORROWED_REFS
129     #define CYTHON_AVOID_BORROWED_REFS 0
130   #endif
131   #ifndef CYTHON_ASSUME_SAFE_MACROS
132     #define CYTHON_ASSUME_SAFE_MACROS 1
133   #endif
134   #ifndef CYTHON_UNPACK_METHODS
135     #define CYTHON_UNPACK_METHODS 1
136   #endif
137   #undef CYTHON_FAST_THREAD_STATE
138   #define CYTHON_FAST_THREAD_STATE 0
139   #undef CYTHON_FAST_PYCALL
140   #define CYTHON_FAST_PYCALL 0
141   #undef CYTHON_PEP489_MULTI_PHASE_INIT
142   #define CYTHON_PEP489_MULTI_PHASE_INIT 0
143   #undef CYTHON_USE_TP_FINALIZE
144   #define CYTHON_USE_TP_FINALIZE 0
145   #undef CYTHON_USE_DICT_VERSIONS
146   #define CYTHON_USE_DICT_VERSIONS 0
147   #undef CYTHON_USE_EXC_INFO_STACK
148   #define CYTHON_USE_EXC_INFO_STACK 0
149 #else
150   #define CYTHON_COMPILING_IN_PYPY 0
151   #define CYTHON_COMPILING_IN_PYSTON 0
152   #define CYTHON_COMPILING_IN_CPYTHON 1
153   #ifndef CYTHON_USE_TYPE_SLOTS
154     #define CYTHON_USE_TYPE_SLOTS 1
155   #endif
156   #if PY_VERSION_HEX < 0x02070000
157     #undef CYTHON_USE_PYTYPE_LOOKUP
158     #define CYTHON_USE_PYTYPE_LOOKUP 0
159   #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
160     #define CYTHON_USE_PYTYPE_LOOKUP 1
161   #endif
162   #if PY_MAJOR_VERSION < 3
163     #undef CYTHON_USE_ASYNC_SLOTS
164     #define CYTHON_USE_ASYNC_SLOTS 0
165   #elif !defined(CYTHON_USE_ASYNC_SLOTS)
166     #define CYTHON_USE_ASYNC_SLOTS 1
167   #endif
168   #if PY_VERSION_HEX < 0x02070000
169     #undef CYTHON_USE_PYLONG_INTERNALS
170     #define CYTHON_USE_PYLONG_INTERNALS 0
171   #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
172     #define CYTHON_USE_PYLONG_INTERNALS 1
173   #endif
174   #ifndef CYTHON_USE_PYLIST_INTERNALS
175     #define CYTHON_USE_PYLIST_INTERNALS 1
176   #endif
177   #ifndef CYTHON_USE_UNICODE_INTERNALS
178     #define CYTHON_USE_UNICODE_INTERNALS 1
179   #endif
180   #if PY_VERSION_HEX < 0x030300F0
181     #undef CYTHON_USE_UNICODE_WRITER
182     #define CYTHON_USE_UNICODE_WRITER 0
183   #elif !defined(CYTHON_USE_UNICODE_WRITER)
184     #define CYTHON_USE_UNICODE_WRITER 1
185   #endif
186   #ifndef CYTHON_AVOID_BORROWED_REFS
187     #define CYTHON_AVOID_BORROWED_REFS 0
188   #endif
189   #ifndef CYTHON_ASSUME_SAFE_MACROS
190     #define CYTHON_ASSUME_SAFE_MACROS 1
191   #endif
192   #ifndef CYTHON_UNPACK_METHODS
193     #define CYTHON_UNPACK_METHODS 1
194   #endif
195   #ifndef CYTHON_FAST_THREAD_STATE
196     #define CYTHON_FAST_THREAD_STATE 1
197   #endif
198   #ifndef CYTHON_FAST_PYCALL
199     #define CYTHON_FAST_PYCALL 1
200   #endif
201   #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
202     #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
203   #endif
204   #ifndef CYTHON_USE_TP_FINALIZE
205     #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
206   #endif
207   #ifndef CYTHON_USE_DICT_VERSIONS
208     #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
209   #endif
210   #ifndef CYTHON_USE_EXC_INFO_STACK
211     #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
212   #endif
213 #endif
214 #if !defined(CYTHON_FAST_PYCCALL)
215 #define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
216 #endif
217 #if CYTHON_USE_PYLONG_INTERNALS
218   #include "longintrepr.h"
219   #undef SHIFT
220   #undef BASE
221   #undef MASK
222   #ifdef SIZEOF_VOID_P
223     enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
224   #endif
225 #endif
226 #ifndef __has_attribute
227   #define __has_attribute(x) 0
228 #endif
229 #ifndef __has_cpp_attribute
230   #define __has_cpp_attribute(x) 0
231 #endif
232 #ifndef CYTHON_RESTRICT
233   #if defined(__GNUC__)
234     #define CYTHON_RESTRICT __restrict__
235   #elif defined(_MSC_VER) && _MSC_VER >= 1400
236     #define CYTHON_RESTRICT __restrict
237   #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
238     #define CYTHON_RESTRICT restrict
239   #else
240     #define CYTHON_RESTRICT
241   #endif
242 #endif
243 #ifndef CYTHON_UNUSED
244 # if defined(__GNUC__)
245 #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
246 #     define CYTHON_UNUSED __attribute__ ((__unused__))
247 #   else
248 #     define CYTHON_UNUSED
249 #   endif
250 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
251 #   define CYTHON_UNUSED __attribute__ ((__unused__))
252 # else
253 #   define CYTHON_UNUSED
254 # endif
255 #endif
256 #ifndef CYTHON_MAYBE_UNUSED_VAR
257 #  if defined(__cplusplus)
CYTHON_MAYBE_UNUSED_VAR(const T &)258      template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
259 #  else
260 #    define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
261 #  endif
262 #endif
263 #ifndef CYTHON_NCP_UNUSED
264 # if CYTHON_COMPILING_IN_CPYTHON
265 #  define CYTHON_NCP_UNUSED
266 # else
267 #  define CYTHON_NCP_UNUSED CYTHON_UNUSED
268 # endif
269 #endif
270 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
271 #ifdef _MSC_VER
272     #ifndef _MSC_STDINT_H_
273         #if _MSC_VER < 1300
274            typedef unsigned char     uint8_t;
275            typedef unsigned int      uint32_t;
276         #else
277            typedef unsigned __int8   uint8_t;
278            typedef unsigned __int32  uint32_t;
279         #endif
280     #endif
281 #else
282    #include <stdint.h>
283 #endif
284 #ifndef CYTHON_FALLTHROUGH
285   #if defined(__cplusplus) && __cplusplus >= 201103L
286     #if __has_cpp_attribute(fallthrough)
287       #define CYTHON_FALLTHROUGH [[fallthrough]]
288     #elif __has_cpp_attribute(clang::fallthrough)
289       #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
290     #elif __has_cpp_attribute(gnu::fallthrough)
291       #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
292     #endif
293   #endif
294   #ifndef CYTHON_FALLTHROUGH
295     #if __has_attribute(fallthrough)
296       #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
297     #else
298       #define CYTHON_FALLTHROUGH
299     #endif
300   #endif
301   #if defined(__clang__ ) && defined(__apple_build_version__)
302     #if __apple_build_version__ < 7000000
303       #undef  CYTHON_FALLTHROUGH
304       #define CYTHON_FALLTHROUGH
305     #endif
306   #endif
307 #endif
308 
309 #ifndef CYTHON_INLINE
310   #if defined(__clang__)
311     #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
312   #elif defined(__GNUC__)
313     #define CYTHON_INLINE __inline__
314   #elif defined(_MSC_VER)
315     #define CYTHON_INLINE __inline
316   #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
317     #define CYTHON_INLINE inline
318   #else
319     #define CYTHON_INLINE
320   #endif
321 #endif
322 
323 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
324   #define Py_OptimizeFlag 0
325 #endif
326 #define __PYX_BUILD_PY_SSIZE_T "n"
327 #define CYTHON_FORMAT_SSIZE_T "z"
328 #if PY_MAJOR_VERSION < 3
329   #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
330   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
331           PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
332   #define __Pyx_DefaultClassType PyClass_Type
333 #else
334   #define __Pyx_BUILTIN_MODULE_NAME "builtins"
335 #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
336   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
337           PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
338 #else
339   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
340           PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
341 #endif
342   #define __Pyx_DefaultClassType PyType_Type
343 #endif
344 #ifndef Py_TPFLAGS_CHECKTYPES
345   #define Py_TPFLAGS_CHECKTYPES 0
346 #endif
347 #ifndef Py_TPFLAGS_HAVE_INDEX
348   #define Py_TPFLAGS_HAVE_INDEX 0
349 #endif
350 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
351   #define Py_TPFLAGS_HAVE_NEWBUFFER 0
352 #endif
353 #ifndef Py_TPFLAGS_HAVE_FINALIZE
354   #define Py_TPFLAGS_HAVE_FINALIZE 0
355 #endif
356 #ifndef METH_STACKLESS
357   #define METH_STACKLESS 0
358 #endif
359 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
360   #ifndef METH_FASTCALL
361      #define METH_FASTCALL 0x80
362   #endif
363   typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
364   typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
365                                                           Py_ssize_t nargs, PyObject *kwnames);
366 #else
367   #define __Pyx_PyCFunctionFast _PyCFunctionFast
368   #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
369 #endif
370 #if CYTHON_FAST_PYCCALL
371 #define __Pyx_PyFastCFunction_Check(func)\
372     ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
373 #else
374 #define __Pyx_PyFastCFunction_Check(func) 0
375 #endif
376 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
377   #define PyObject_Malloc(s)   PyMem_Malloc(s)
378   #define PyObject_Free(p)     PyMem_Free(p)
379   #define PyObject_Realloc(p)  PyMem_Realloc(p)
380 #endif
381 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
382   #define PyMem_RawMalloc(n)           PyMem_Malloc(n)
383   #define PyMem_RawRealloc(p, n)       PyMem_Realloc(p, n)
384   #define PyMem_RawFree(p)             PyMem_Free(p)
385 #endif
386 #if CYTHON_COMPILING_IN_PYSTON
387   #define __Pyx_PyCode_HasFreeVars(co)  PyCode_HasFreeVars(co)
388   #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
389 #else
390   #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
391   #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
392 #endif
393 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
394   #define __Pyx_PyThreadState_Current PyThreadState_GET()
395 #elif PY_VERSION_HEX >= 0x03060000
396   #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
397 #elif PY_VERSION_HEX >= 0x03000000
398   #define __Pyx_PyThreadState_Current PyThreadState_GET()
399 #else
400   #define __Pyx_PyThreadState_Current _PyThreadState_Current
401 #endif
402 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
403 #include "pythread.h"
404 #define Py_tss_NEEDS_INIT 0
405 typedef int Py_tss_t;
PyThread_tss_create(Py_tss_t * key)406 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
407   *key = PyThread_create_key();
408   return 0;
409 }
PyThread_tss_alloc(void)410 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
411   Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
412   *key = Py_tss_NEEDS_INIT;
413   return key;
414 }
PyThread_tss_free(Py_tss_t * key)415 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
416   PyObject_Free(key);
417 }
PyThread_tss_is_created(Py_tss_t * key)418 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
419   return *key != Py_tss_NEEDS_INIT;
420 }
PyThread_tss_delete(Py_tss_t * key)421 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
422   PyThread_delete_key(*key);
423   *key = Py_tss_NEEDS_INIT;
424 }
PyThread_tss_set(Py_tss_t * key,void * value)425 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
426   return PyThread_set_key_value(*key, value);
427 }
PyThread_tss_get(Py_tss_t * key)428 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
429   return PyThread_get_key_value(*key);
430 }
431 #endif
432 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
433 #define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
434 #else
435 #define __Pyx_PyDict_NewPresized(n)  PyDict_New()
436 #endif
437 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
438   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
439   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
440 #else
441   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
442   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
443 #endif
444 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
445 #define __Pyx_PyDict_GetItemStr(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
446 #else
447 #define __Pyx_PyDict_GetItemStr(dict, name)  PyDict_GetItem(dict, name)
448 #endif
449 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
450   #define CYTHON_PEP393_ENABLED 1
451   #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
452                                               0 : _PyUnicode_Ready((PyObject *)(op)))
453   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
454   #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
455   #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
456   #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
457   #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
458   #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
459   #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, ch)
460   #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
461 #else
462   #define CYTHON_PEP393_ENABLED 0
463   #define PyUnicode_1BYTE_KIND  1
464   #define PyUnicode_2BYTE_KIND  2
465   #define PyUnicode_4BYTE_KIND  4
466   #define __Pyx_PyUnicode_READY(op)       (0)
467   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
468   #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
469   #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
470   #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
471   #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
472   #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
473   #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
474   #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_SIZE(u))
475 #endif
476 #if CYTHON_COMPILING_IN_PYPY
477   #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
478   #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
479 #else
480   #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
481   #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
482       PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
483 #endif
484 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
485   #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
486 #endif
487 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
488   #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
489 #endif
490 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
491   #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
492 #endif
493 #define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
494 #define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
495 #if PY_MAJOR_VERSION >= 3
496   #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
497 #else
498   #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
499 #endif
500 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
501   #define PyObject_ASCII(o)            PyObject_Repr(o)
502 #endif
503 #if PY_MAJOR_VERSION >= 3
504   #define PyBaseString_Type            PyUnicode_Type
505   #define PyStringObject               PyUnicodeObject
506   #define PyString_Type                PyUnicode_Type
507   #define PyString_Check               PyUnicode_Check
508   #define PyString_CheckExact          PyUnicode_CheckExact
509   #define PyObject_Unicode             PyObject_Str
510 #endif
511 #if PY_MAJOR_VERSION >= 3
512   #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
513   #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
514 #else
515   #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
516   #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
517 #endif
518 #ifndef PySet_CheckExact
519   #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
520 #endif
521 #if CYTHON_ASSUME_SAFE_MACROS
522   #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
523 #else
524   #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
525 #endif
526 #if PY_MAJOR_VERSION >= 3
527   #define PyIntObject                  PyLongObject
528   #define PyInt_Type                   PyLong_Type
529   #define PyInt_Check(op)              PyLong_Check(op)
530   #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
531   #define PyInt_FromString             PyLong_FromString
532   #define PyInt_FromUnicode            PyLong_FromUnicode
533   #define PyInt_FromLong               PyLong_FromLong
534   #define PyInt_FromSize_t             PyLong_FromSize_t
535   #define PyInt_FromSsize_t            PyLong_FromSsize_t
536   #define PyInt_AsLong                 PyLong_AsLong
537   #define PyInt_AS_LONG                PyLong_AS_LONG
538   #define PyInt_AsSsize_t              PyLong_AsSsize_t
539   #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
540   #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
541   #define PyNumber_Int                 PyNumber_Long
542 #endif
543 #if PY_MAJOR_VERSION >= 3
544   #define PyBoolObject                 PyLongObject
545 #endif
546 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
547   #ifndef PyUnicode_InternFromString
548     #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
549   #endif
550 #endif
551 #if PY_VERSION_HEX < 0x030200A4
552   typedef long Py_hash_t;
553   #define __Pyx_PyInt_FromHash_t PyInt_FromLong
554   #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
555 #else
556   #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
557   #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
558 #endif
559 #if PY_MAJOR_VERSION >= 3
560   #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
561 #else
562   #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
563 #endif
564 #if CYTHON_USE_ASYNC_SLOTS
565   #if PY_VERSION_HEX >= 0x030500B1
566     #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
567     #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
568   #else
569     #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
570   #endif
571 #else
572   #define __Pyx_PyType_AsAsync(obj) NULL
573 #endif
574 #ifndef __Pyx_PyAsyncMethodsStruct
575     typedef struct {
576         unaryfunc am_await;
577         unaryfunc am_aiter;
578         unaryfunc am_anext;
579     } __Pyx_PyAsyncMethodsStruct;
580 #endif
581 
582 #if defined(WIN32) || defined(MS_WINDOWS)
583   #define _USE_MATH_DEFINES
584 #endif
585 #include <math.h>
586 #ifdef NAN
587 #define __PYX_NAN() ((float) NAN)
588 #else
__PYX_NAN()589 static CYTHON_INLINE float __PYX_NAN() {
590   float value;
591   memset(&value, 0xFF, sizeof(value));
592   return value;
593 }
594 #endif
595 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
596 #define __Pyx_truncl trunc
597 #else
598 #define __Pyx_truncl truncl
599 #endif
600 
601 
602 #define __PYX_ERR(f_index, lineno, Ln_error) \
603 { \
604   __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
605 }
606 
607 #ifndef __PYX_EXTERN_C
608   #ifdef __cplusplus
609     #define __PYX_EXTERN_C extern "C"
610   #else
611     #define __PYX_EXTERN_C extern
612   #endif
613 #endif
614 
615 #define __PYX_HAVE__yt__geometry__grid_container
616 #define __PYX_HAVE_API__yt__geometry__grid_container
617 /* Early includes */
618 #include <string.h>
619 #include <stdio.h>
620 #include "numpy/arrayobject.h"
621 #include "numpy/ufuncobject.h"
622 #include <stdlib.h>
623 #include <math.h>
624 #include "tsearch.h"
625 #include <float.h>
626 #include "platform_dep.h"
627 #include "pythread.h"
628 #include "pystate.h"
629 #ifdef _OPENMP
630 #include <omp.h>
631 #endif /* _OPENMP */
632 
633 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
634 #define CYTHON_WITHOUT_ASSERTIONS
635 #endif
636 
637 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
638                 const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
639 
640 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
641 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
642 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
643 #define __PYX_DEFAULT_STRING_ENCODING ""
644 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
645 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
646 #define __Pyx_uchar_cast(c) ((unsigned char)c)
647 #define __Pyx_long_cast(x) ((long)x)
648 #define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
649     (sizeof(type) < sizeof(Py_ssize_t))  ||\
650     (sizeof(type) > sizeof(Py_ssize_t) &&\
651           likely(v < (type)PY_SSIZE_T_MAX ||\
652                  v == (type)PY_SSIZE_T_MAX)  &&\
653           (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
654                                 v == (type)PY_SSIZE_T_MIN)))  ||\
655     (sizeof(type) == sizeof(Py_ssize_t) &&\
656           (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
657                                v == (type)PY_SSIZE_T_MAX)))  )
__Pyx_is_valid_index(Py_ssize_t i,Py_ssize_t limit)658 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
659     return (size_t) i < (size_t) limit;
660 }
661 #if defined (__cplusplus) && __cplusplus >= 201103L
662     #include <cstdlib>
663     #define __Pyx_sst_abs(value) std::abs(value)
664 #elif SIZEOF_INT >= SIZEOF_SIZE_T
665     #define __Pyx_sst_abs(value) abs(value)
666 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
667     #define __Pyx_sst_abs(value) labs(value)
668 #elif defined (_MSC_VER)
669     #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
670 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
671     #define __Pyx_sst_abs(value) llabs(value)
672 #elif defined (__GNUC__)
673     #define __Pyx_sst_abs(value) __builtin_llabs(value)
674 #else
675     #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
676 #endif
677 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
678 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
679 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
680 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
681 #define __Pyx_PyBytes_FromString        PyBytes_FromString
682 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
683 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
684 #if PY_MAJOR_VERSION < 3
685     #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
686     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
687 #else
688     #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
689     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
690 #endif
691 #define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AS_STRING(s))
692 #define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AS_STRING(s))
693 #define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AS_STRING(s))
694 #define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AS_STRING(s))
695 #define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AS_STRING(s))
696 #define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AS_STRING(s))
697 #define __Pyx_PyObject_AsWritableString(s)    ((char*) __Pyx_PyObject_AsString(s))
698 #define __Pyx_PyObject_AsWritableSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
699 #define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
700 #define __Pyx_PyObject_AsSString(s)    ((const signed char*) __Pyx_PyObject_AsString(s))
701 #define __Pyx_PyObject_AsUString(s)    ((const unsigned char*) __Pyx_PyObject_AsString(s))
702 #define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
703 #define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
704 #define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
705 #define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
706 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
__Pyx_Py_UNICODE_strlen(const Py_UNICODE * u)707 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
708     const Py_UNICODE *u_end = u;
709     while (*u_end++) ;
710     return (size_t)(u_end - u - 1);
711 }
712 #define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
713 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
714 #define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
715 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
716 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
717 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
718 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
719 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
720 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
721 #define __Pyx_PySequence_Tuple(obj)\
722     (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
723 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
724 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
725 #if CYTHON_ASSUME_SAFE_MACROS
726 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
727 #else
728 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
729 #endif
730 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
731 #if PY_MAJOR_VERSION >= 3
732 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
733 #else
734 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
735 #endif
736 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
737 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
738 static int __Pyx_sys_getdefaultencoding_not_ascii;
__Pyx_init_sys_getdefaultencoding_params(void)739 static int __Pyx_init_sys_getdefaultencoding_params(void) {
740     PyObject* sys;
741     PyObject* default_encoding = NULL;
742     PyObject* ascii_chars_u = NULL;
743     PyObject* ascii_chars_b = NULL;
744     const char* default_encoding_c;
745     sys = PyImport_ImportModule("sys");
746     if (!sys) goto bad;
747     default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
748     Py_DECREF(sys);
749     if (!default_encoding) goto bad;
750     default_encoding_c = PyBytes_AsString(default_encoding);
751     if (!default_encoding_c) goto bad;
752     if (strcmp(default_encoding_c, "ascii") == 0) {
753         __Pyx_sys_getdefaultencoding_not_ascii = 0;
754     } else {
755         char ascii_chars[128];
756         int c;
757         for (c = 0; c < 128; c++) {
758             ascii_chars[c] = c;
759         }
760         __Pyx_sys_getdefaultencoding_not_ascii = 1;
761         ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
762         if (!ascii_chars_u) goto bad;
763         ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
764         if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
765             PyErr_Format(
766                 PyExc_ValueError,
767                 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
768                 default_encoding_c);
769             goto bad;
770         }
771         Py_DECREF(ascii_chars_u);
772         Py_DECREF(ascii_chars_b);
773     }
774     Py_DECREF(default_encoding);
775     return 0;
776 bad:
777     Py_XDECREF(default_encoding);
778     Py_XDECREF(ascii_chars_u);
779     Py_XDECREF(ascii_chars_b);
780     return -1;
781 }
782 #endif
783 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
784 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
785 #else
786 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
787 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
788 static char* __PYX_DEFAULT_STRING_ENCODING;
__Pyx_init_sys_getdefaultencoding_params(void)789 static int __Pyx_init_sys_getdefaultencoding_params(void) {
790     PyObject* sys;
791     PyObject* default_encoding = NULL;
792     char* default_encoding_c;
793     sys = PyImport_ImportModule("sys");
794     if (!sys) goto bad;
795     default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
796     Py_DECREF(sys);
797     if (!default_encoding) goto bad;
798     default_encoding_c = PyBytes_AsString(default_encoding);
799     if (!default_encoding_c) goto bad;
800     __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
801     if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
802     strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
803     Py_DECREF(default_encoding);
804     return 0;
805 bad:
806     Py_XDECREF(default_encoding);
807     return -1;
808 }
809 #endif
810 #endif
811 
812 
813 /* Test for GCC > 2.95 */
814 #if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
815   #define likely(x)   __builtin_expect(!!(x), 1)
816   #define unlikely(x) __builtin_expect(!!(x), 0)
817 #else /* !__GNUC__ or GCC < 2.95 */
818   #define likely(x)   (x)
819   #define unlikely(x) (x)
820 #endif /* __GNUC__ */
__Pyx_pretend_to_initialize(void * ptr)821 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
822 
823 static PyObject *__pyx_m = NULL;
824 static PyObject *__pyx_d;
825 static PyObject *__pyx_b;
826 static PyObject *__pyx_cython_runtime = NULL;
827 static PyObject *__pyx_empty_tuple;
828 static PyObject *__pyx_empty_bytes;
829 static PyObject *__pyx_empty_unicode;
830 static int __pyx_lineno;
831 static int __pyx_clineno = 0;
832 static const char * __pyx_cfilenm= __FILE__;
833 static const char *__pyx_filename;
834 
835 /* Header.proto */
836 #if !defined(CYTHON_CCOMPLEX)
837   #if defined(__cplusplus)
838     #define CYTHON_CCOMPLEX 1
839   #elif defined(_Complex_I)
840     #define CYTHON_CCOMPLEX 1
841   #else
842     #define CYTHON_CCOMPLEX 0
843   #endif
844 #endif
845 #if CYTHON_CCOMPLEX
846   #ifdef __cplusplus
847     #include <complex>
848   #else
849     #include <complex.h>
850   #endif
851 #endif
852 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
853   #undef _Complex_I
854   #define _Complex_I 1.0fj
855 #endif
856 
857 
858 static const char *__pyx_f[] = {
859   "yt/geometry/grid_container.pyx",
860   "stringsource",
861   "yt/geometry/grid_container.pxd",
862   "__init__.pxd",
863   "yt/utilities/lib/fp_utils.pxd",
864   "yt/utilities/lib/geometry_utils.pxd",
865   "type.pxd",
866   "yt/geometry/oct_visitors.pxd",
867   "yt/utilities/lib/allocation_container.pxd",
868   "yt/geometry/oct_container.pxd",
869   "yt/geometry/selection_routines.pxd",
870   "yt/utilities/lib/bitarray.pxd",
871 };
872 /* BufferFormatStructs.proto */
873 #define IS_UNSIGNED(type) (((type) -1) > 0)
874 struct __Pyx_StructField_;
875 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
876 typedef struct {
877   const char* name;
878   struct __Pyx_StructField_* fields;
879   size_t size;
880   size_t arraysize[8];
881   int ndim;
882   char typegroup;
883   char is_unsigned;
884   int flags;
885 } __Pyx_TypeInfo;
886 typedef struct __Pyx_StructField_ {
887   __Pyx_TypeInfo* type;
888   const char* name;
889   size_t offset;
890 } __Pyx_StructField;
891 typedef struct {
892   __Pyx_StructField* field;
893   size_t parent_offset;
894 } __Pyx_BufFmt_StackElem;
895 typedef struct {
896   __Pyx_StructField root;
897   __Pyx_BufFmt_StackElem* head;
898   size_t fmt_offset;
899   size_t new_count, enc_count;
900   size_t struct_alignment;
901   int is_complex;
902   char enc_type;
903   char new_packmode;
904   char enc_packmode;
905   char is_valid_array;
906 } __Pyx_BufFmt_Context;
907 
908 /* MemviewSliceStruct.proto */
909 struct __pyx_memoryview_obj;
910 typedef struct {
911   struct __pyx_memoryview_obj *memview;
912   char *data;
913   Py_ssize_t shape[8];
914   Py_ssize_t strides[8];
915   Py_ssize_t suboffsets[8];
916 } __Pyx_memviewslice;
917 #define __Pyx_MemoryView_Len(m)  (m.shape[0])
918 
919 /* Atomics.proto */
920 #include <pythread.h>
921 #ifndef CYTHON_ATOMICS
922     #define CYTHON_ATOMICS 1
923 #endif
924 #define __pyx_atomic_int_type int
925 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
926                     (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
927                     !defined(__i386__)
928     #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
929     #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
930     #ifdef __PYX_DEBUG_ATOMICS
931         #warning "Using GNU atomics"
932     #endif
933 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
934     #include <Windows.h>
935     #undef __pyx_atomic_int_type
936     #define __pyx_atomic_int_type LONG
937     #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
938     #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
939     #ifdef __PYX_DEBUG_ATOMICS
940         #pragma message ("Using MSVC atomics")
941     #endif
942 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
943     #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
944     #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
945     #ifdef __PYX_DEBUG_ATOMICS
946         #warning "Using Intel atomics"
947     #endif
948 #else
949     #undef CYTHON_ATOMICS
950     #define CYTHON_ATOMICS 0
951     #ifdef __PYX_DEBUG_ATOMICS
952         #warning "Not using atomics"
953     #endif
954 #endif
955 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
956 #if CYTHON_ATOMICS
957     #define __pyx_add_acquisition_count(memview)\
958              __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
959     #define __pyx_sub_acquisition_count(memview)\
960             __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
961 #else
962     #define __pyx_add_acquisition_count(memview)\
963             __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
964     #define __pyx_sub_acquisition_count(memview)\
965             __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
966 #endif
967 
968 /* ForceInitThreads.proto */
969 #ifndef __PYX_FORCE_INIT_THREADS
970   #define __PYX_FORCE_INIT_THREADS 0
971 #endif
972 
973 /* NoFastGil.proto */
974 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
975 #define __Pyx_PyGILState_Release PyGILState_Release
976 #define __Pyx_FastGIL_Remember()
977 #define __Pyx_FastGIL_Forget()
978 #define __Pyx_FastGilFuncInit()
979 
980 
981 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":776
982  * # in Cython to enable them only on the right systems.
983  *
984  * ctypedef npy_int8       int8_t             # <<<<<<<<<<<<<<
985  * ctypedef npy_int16      int16_t
986  * ctypedef npy_int32      int32_t
987  */
988 typedef npy_int8 __pyx_t_5numpy_int8_t;
989 
990 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":777
991  *
992  * ctypedef npy_int8       int8_t
993  * ctypedef npy_int16      int16_t             # <<<<<<<<<<<<<<
994  * ctypedef npy_int32      int32_t
995  * ctypedef npy_int64      int64_t
996  */
997 typedef npy_int16 __pyx_t_5numpy_int16_t;
998 
999 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778
1000  * ctypedef npy_int8       int8_t
1001  * ctypedef npy_int16      int16_t
1002  * ctypedef npy_int32      int32_t             # <<<<<<<<<<<<<<
1003  * ctypedef npy_int64      int64_t
1004  * #ctypedef npy_int96      int96_t
1005  */
1006 typedef npy_int32 __pyx_t_5numpy_int32_t;
1007 
1008 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":779
1009  * ctypedef npy_int16      int16_t
1010  * ctypedef npy_int32      int32_t
1011  * ctypedef npy_int64      int64_t             # <<<<<<<<<<<<<<
1012  * #ctypedef npy_int96      int96_t
1013  * #ctypedef npy_int128     int128_t
1014  */
1015 typedef npy_int64 __pyx_t_5numpy_int64_t;
1016 
1017 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":783
1018  * #ctypedef npy_int128     int128_t
1019  *
1020  * ctypedef npy_uint8      uint8_t             # <<<<<<<<<<<<<<
1021  * ctypedef npy_uint16     uint16_t
1022  * ctypedef npy_uint32     uint32_t
1023  */
1024 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1025 
1026 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784
1027  *
1028  * ctypedef npy_uint8      uint8_t
1029  * ctypedef npy_uint16     uint16_t             # <<<<<<<<<<<<<<
1030  * ctypedef npy_uint32     uint32_t
1031  * ctypedef npy_uint64     uint64_t
1032  */
1033 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1034 
1035 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":785
1036  * ctypedef npy_uint8      uint8_t
1037  * ctypedef npy_uint16     uint16_t
1038  * ctypedef npy_uint32     uint32_t             # <<<<<<<<<<<<<<
1039  * ctypedef npy_uint64     uint64_t
1040  * #ctypedef npy_uint96     uint96_t
1041  */
1042 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1043 
1044 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":786
1045  * ctypedef npy_uint16     uint16_t
1046  * ctypedef npy_uint32     uint32_t
1047  * ctypedef npy_uint64     uint64_t             # <<<<<<<<<<<<<<
1048  * #ctypedef npy_uint96     uint96_t
1049  * #ctypedef npy_uint128    uint128_t
1050  */
1051 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1052 
1053 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790
1054  * #ctypedef npy_uint128    uint128_t
1055  *
1056  * ctypedef npy_float32    float32_t             # <<<<<<<<<<<<<<
1057  * ctypedef npy_float64    float64_t
1058  * #ctypedef npy_float80    float80_t
1059  */
1060 typedef npy_float32 __pyx_t_5numpy_float32_t;
1061 
1062 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791
1063  *
1064  * ctypedef npy_float32    float32_t
1065  * ctypedef npy_float64    float64_t             # <<<<<<<<<<<<<<
1066  * #ctypedef npy_float80    float80_t
1067  * #ctypedef npy_float128   float128_t
1068  */
1069 typedef npy_float64 __pyx_t_5numpy_float64_t;
1070 
1071 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":800
1072  * # The int types are mapped a bit surprising --
1073  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1074  * ctypedef npy_long       int_t             # <<<<<<<<<<<<<<
1075  * ctypedef npy_longlong   long_t
1076  * ctypedef npy_longlong   longlong_t
1077  */
1078 typedef npy_long __pyx_t_5numpy_int_t;
1079 
1080 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":801
1081  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1082  * ctypedef npy_long       int_t
1083  * ctypedef npy_longlong   long_t             # <<<<<<<<<<<<<<
1084  * ctypedef npy_longlong   longlong_t
1085  *
1086  */
1087 typedef npy_longlong __pyx_t_5numpy_long_t;
1088 
1089 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":802
1090  * ctypedef npy_long       int_t
1091  * ctypedef npy_longlong   long_t
1092  * ctypedef npy_longlong   longlong_t             # <<<<<<<<<<<<<<
1093  *
1094  * ctypedef npy_ulong      uint_t
1095  */
1096 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1097 
1098 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":804
1099  * ctypedef npy_longlong   longlong_t
1100  *
1101  * ctypedef npy_ulong      uint_t             # <<<<<<<<<<<<<<
1102  * ctypedef npy_ulonglong  ulong_t
1103  * ctypedef npy_ulonglong  ulonglong_t
1104  */
1105 typedef npy_ulong __pyx_t_5numpy_uint_t;
1106 
1107 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805
1108  *
1109  * ctypedef npy_ulong      uint_t
1110  * ctypedef npy_ulonglong  ulong_t             # <<<<<<<<<<<<<<
1111  * ctypedef npy_ulonglong  ulonglong_t
1112  *
1113  */
1114 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1115 
1116 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":806
1117  * ctypedef npy_ulong      uint_t
1118  * ctypedef npy_ulonglong  ulong_t
1119  * ctypedef npy_ulonglong  ulonglong_t             # <<<<<<<<<<<<<<
1120  *
1121  * ctypedef npy_intp       intp_t
1122  */
1123 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1124 
1125 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":808
1126  * ctypedef npy_ulonglong  ulonglong_t
1127  *
1128  * ctypedef npy_intp       intp_t             # <<<<<<<<<<<<<<
1129  * ctypedef npy_uintp      uintp_t
1130  *
1131  */
1132 typedef npy_intp __pyx_t_5numpy_intp_t;
1133 
1134 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809
1135  *
1136  * ctypedef npy_intp       intp_t
1137  * ctypedef npy_uintp      uintp_t             # <<<<<<<<<<<<<<
1138  *
1139  * ctypedef npy_double     float_t
1140  */
1141 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1142 
1143 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":811
1144  * ctypedef npy_uintp      uintp_t
1145  *
1146  * ctypedef npy_double     float_t             # <<<<<<<<<<<<<<
1147  * ctypedef npy_double     double_t
1148  * ctypedef npy_longdouble longdouble_t
1149  */
1150 typedef npy_double __pyx_t_5numpy_float_t;
1151 
1152 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812
1153  *
1154  * ctypedef npy_double     float_t
1155  * ctypedef npy_double     double_t             # <<<<<<<<<<<<<<
1156  * ctypedef npy_longdouble longdouble_t
1157  *
1158  */
1159 typedef npy_double __pyx_t_5numpy_double_t;
1160 
1161 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":813
1162  * ctypedef npy_double     float_t
1163  * ctypedef npy_double     double_t
1164  * ctypedef npy_longdouble longdouble_t             # <<<<<<<<<<<<<<
1165  *
1166  * ctypedef npy_cfloat      cfloat_t
1167  */
1168 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1169 /* Declarations.proto */
1170 #if CYTHON_CCOMPLEX
1171   #ifdef __cplusplus
1172     typedef ::std::complex< float > __pyx_t_float_complex;
1173   #else
1174     typedef float _Complex __pyx_t_float_complex;
1175   #endif
1176 #else
1177     typedef struct { float real, imag; } __pyx_t_float_complex;
1178 #endif
1179 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1180 
1181 /* Declarations.proto */
1182 #if CYTHON_CCOMPLEX
1183   #ifdef __cplusplus
1184     typedef ::std::complex< double > __pyx_t_double_complex;
1185   #else
1186     typedef double _Complex __pyx_t_double_complex;
1187   #endif
1188 #else
1189     typedef struct { double real, imag; } __pyx_t_double_complex;
1190 #endif
1191 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1192 
1193 
1194 /*--- Type declarations ---*/
1195 struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor;
1196 struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalOcts;
1197 struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalCells;
1198 struct __pyx_obj_2yt_8geometry_12oct_visitors_MarkOcts;
1199 struct __pyx_obj_2yt_8geometry_12oct_visitors_MaskOcts;
1200 struct __pyx_obj_2yt_8geometry_12oct_visitors_IndexOcts;
1201 struct __pyx_obj_2yt_8geometry_12oct_visitors_MaskedIndexOcts;
1202 struct __pyx_obj_2yt_8geometry_12oct_visitors_IndexMaskMapOcts;
1203 struct __pyx_obj_2yt_8geometry_12oct_visitors_ICoordsOcts;
1204 struct __pyx_obj_2yt_8geometry_12oct_visitors_IResOcts;
1205 struct __pyx_obj_2yt_8geometry_12oct_visitors_FCoordsOcts;
1206 struct __pyx_obj_2yt_8geometry_12oct_visitors_FWidthOcts;
1207 struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayI64;
1208 struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayF64;
1209 struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyFileIndArrayI8;
1210 struct __pyx_obj_2yt_8geometry_12oct_visitors_IdentifyOcts;
1211 struct __pyx_obj_2yt_8geometry_12oct_visitors_AssignDomainInd;
1212 struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesO;
1213 struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesR;
1214 struct __pyx_obj_2yt_8geometry_12oct_visitors_CountByDomain;
1215 struct __pyx_obj_2yt_8geometry_12oct_visitors_StoreOctree;
1216 struct __pyx_obj_2yt_8geometry_12oct_visitors_LoadOctree;
1217 struct __pyx_obj_2yt_8geometry_12oct_visitors_MortonIndexOcts;
1218 struct __pyx_obj_2yt_8geometry_12oct_visitors_StoreIndex;
1219 struct __pyx_obj_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor;
1220 struct __pyx_obj_2yt_8geometry_12oct_visitors_NeighbourCellIndexVisitor;
1221 struct __pyx_obj_2yt_8geometry_12oct_visitors_NeighbourCellVisitor;
1222 struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool;
1223 struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool;
1224 struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer;
1225 struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer;
1226 struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer;
1227 struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject;
1228 struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector;
1229 struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector;
1230 struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector;
1231 struct __pyx_obj_2yt_9utilities_3lib_8bitarray_bitarray;
1232 struct __pyx_obj_2yt_8geometry_14grid_container_GridTree;
1233 struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids;
1234 struct __pyx_obj_2yt_8geometry_14grid_container___pyx_scope_struct____iter__;
1235 struct __pyx_array_obj;
1236 struct __pyx_MemviewEnum_obj;
1237 struct __pyx_memoryview_obj;
1238 struct __pyx_memoryviewslice_obj;
1239 
1240 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":815
1241  * ctypedef npy_longdouble longdouble_t
1242  *
1243  * ctypedef npy_cfloat      cfloat_t             # <<<<<<<<<<<<<<
1244  * ctypedef npy_cdouble     cdouble_t
1245  * ctypedef npy_clongdouble clongdouble_t
1246  */
1247 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1248 
1249 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":816
1250  *
1251  * ctypedef npy_cfloat      cfloat_t
1252  * ctypedef npy_cdouble     cdouble_t             # <<<<<<<<<<<<<<
1253  * ctypedef npy_clongdouble clongdouble_t
1254  *
1255  */
1256 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1257 
1258 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":817
1259  * ctypedef npy_cfloat      cfloat_t
1260  * ctypedef npy_cdouble     cdouble_t
1261  * ctypedef npy_clongdouble clongdouble_t             # <<<<<<<<<<<<<<
1262  *
1263  * ctypedef npy_cdouble     complex_t
1264  */
1265 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1266 
1267 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":819
1268  * ctypedef npy_clongdouble clongdouble_t
1269  *
1270  * ctypedef npy_cdouble     complex_t             # <<<<<<<<<<<<<<
1271  *
1272  * cdef inline object PyArray_MultiIterNew1(a):
1273  */
1274 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1275 struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode;
1276 struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded;
1277 struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData;
1278 
1279 /* "grid_visitors.pxd":13
1280  *
1281  *
1282  * cdef struct GridTreeNode:             # <<<<<<<<<<<<<<
1283  *     np.int32_t num_children
1284  *     np.int32_t level
1285  */
1286 struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode {
1287   __pyx_t_5numpy_int32_t num_children;
1288   __pyx_t_5numpy_int32_t level;
1289   __pyx_t_5numpy_int64_t index;
1290   __pyx_t_5numpy_float64_t left_edge[3];
1291   __pyx_t_5numpy_float64_t right_edge[3];
1292   struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode **children;
1293   __pyx_t_5numpy_int64_t start_index[3];
1294   __pyx_t_5numpy_int32_t dims[3];
1295   __pyx_t_5numpy_float64_t dds[3];
1296 };
1297 
1298 /* "grid_visitors.pxd":24
1299  *     np.float64_t dds[3]
1300  *
1301  * cdef struct GridTreeNodePadded:             # <<<<<<<<<<<<<<
1302  *     np.int32_t num_children
1303  *     np.int32_t level
1304  */
1305 struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded {
1306   __pyx_t_5numpy_int32_t num_children;
1307   __pyx_t_5numpy_int32_t level;
1308   __pyx_t_5numpy_int64_t index;
1309   __pyx_t_5numpy_float64_t left_edge_x;
1310   __pyx_t_5numpy_float64_t left_edge_y;
1311   __pyx_t_5numpy_float64_t left_edge_z;
1312   __pyx_t_5numpy_float64_t right_edge_x;
1313   __pyx_t_5numpy_float64_t right_edge_y;
1314   __pyx_t_5numpy_float64_t right_edge_z;
1315   __pyx_t_5numpy_int_t children_pointers;
1316   __pyx_t_5numpy_int64_t start_index_x;
1317   __pyx_t_5numpy_int64_t start_index_y;
1318   __pyx_t_5numpy_int64_t start_index_z;
1319   __pyx_t_5numpy_int32_t dims_x;
1320   __pyx_t_5numpy_int32_t dims_y;
1321   __pyx_t_5numpy_int32_t dims_z;
1322   __pyx_t_5numpy_float64_t dds_x;
1323   __pyx_t_5numpy_float64_t dds_y;
1324   __pyx_t_5numpy_float64_t dds_z;
1325 };
1326 
1327 /* "grid_visitors.pxd":45
1328  *     np.float64_t dds_z
1329  *
1330  * cdef struct GridVisitorData:             # <<<<<<<<<<<<<<
1331  *     GridTreeNode *grid
1332  *     np.uint64_t index
1333  */
1334 struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData {
1335   struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode *grid;
1336   __pyx_t_5numpy_uint64_t index;
1337   __pyx_t_5numpy_uint64_t global_index;
1338   __pyx_t_5numpy_int64_t pos[3];
1339   int n_tuples;
1340   int **child_tuples;
1341   void *array;
1342   int ref_factor;
1343 };
1344 
1345 /* "grid_visitors.pxd":61
1346  * cdef np.uint8_t check_child_masked(GridVisitorData *data) nogil
1347  *
1348  * ctypedef void grid_visitor_function(GridVisitorData *data,             # <<<<<<<<<<<<<<
1349  *                                          np.uint8_t selected) nogil
1350  * # This is similar in spirit to the way oct visitor functions work.  However,
1351  */
1352 typedef void __pyx_t_2yt_8geometry_13grid_visitors_grid_visitor_function(struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *, __pyx_t_5numpy_uint8_t);
1353 struct __pyx_t_2yt_8geometry_12oct_visitors_Oct;
1354 struct __pyx_t_2yt_8geometry_12oct_visitors_OctInfo;
1355 struct __pyx_t_2yt_8geometry_12oct_visitors_OctPadded;
1356 
1357 /* "oct_visitors.pxd":13
1358  *
1359  *
1360  * cdef struct Oct             # <<<<<<<<<<<<<<
1361  * cdef struct Oct:
1362  *     np.int64_t file_ind     # index with respect to the order in which it was
1363  */
1364 struct __pyx_t_2yt_8geometry_12oct_visitors_Oct {
1365   __pyx_t_5numpy_int64_t file_ind;
1366   __pyx_t_5numpy_int64_t domain_ind;
1367   __pyx_t_5numpy_int64_t domain;
1368   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct **children;
1369 };
1370 
1371 /* "oct_visitors.pxd":21
1372  *     Oct **children          # Up to 8 long
1373  *
1374  * cdef struct OctInfo:             # <<<<<<<<<<<<<<
1375  *     np.float64_t left_edge[3]
1376  *     np.float64_t dds[3]
1377  */
1378 struct __pyx_t_2yt_8geometry_12oct_visitors_OctInfo {
1379   __pyx_t_5numpy_float64_t left_edge[3];
1380   __pyx_t_5numpy_float64_t dds[3];
1381   __pyx_t_5numpy_int64_t ipos[3];
1382   __pyx_t_5numpy_int32_t level;
1383 };
1384 
1385 /* "oct_visitors.pxd":27
1386  *     np.int32_t level
1387  *
1388  * cdef struct OctPadded:             # <<<<<<<<<<<<<<
1389  *     np.int64_t file_ind
1390  *     np.int64_t domain_ind
1391  */
1392 struct __pyx_t_2yt_8geometry_12oct_visitors_OctPadded {
1393   __pyx_t_5numpy_int64_t file_ind;
1394   __pyx_t_5numpy_int64_t domain_ind;
1395   __pyx_t_5numpy_int64_t domain;
1396   __pyx_t_5numpy_int64_t padding;
1397 };
1398 struct __pyx_t_2yt_9utilities_3lib_20allocation_container_AllocationContainer;
1399 struct __pyx_opt_args_2yt_9utilities_3lib_20allocation_container_10ObjectPool_allocate_objs;
1400 
1401 /* "yt/utilities/lib/allocation_container.pxd":13
1402  *
1403  *
1404  * cdef struct AllocationContainer:             # <<<<<<<<<<<<<<
1405  *     np.uint64_t n
1406  *     np.uint64_t n_assigned
1407  */
1408 struct __pyx_t_2yt_9utilities_3lib_20allocation_container_AllocationContainer {
1409   __pyx_t_5numpy_uint64_t n;
1410   __pyx_t_5numpy_uint64_t n_assigned;
1411   __pyx_t_5numpy_uint64_t offset;
1412   __pyx_t_5numpy_int64_t con_id;
1413   void *my_objs;
1414 };
1415 
1416 /* "yt/utilities/lib/allocation_container.pxd":24
1417  *     cdef np.uint64_t n_con
1418  *     cdef AllocationContainer* containers
1419  *     cdef void allocate_objs(self, int n_objs, np.int64_t con_id = ?) except *             # <<<<<<<<<<<<<<
1420  *     cdef void setup_objs(self, void *obj, np.uint64_t count,
1421  *                          np.uint64_t offset, np.int64_t con_id)
1422  */
1423 struct __pyx_opt_args_2yt_9utilities_3lib_20allocation_container_10ObjectPool_allocate_objs {
1424   int __pyx_n;
1425   __pyx_t_5numpy_int64_t con_id;
1426 };
1427 struct __pyx_t_2yt_8geometry_13oct_container_OctKey;
1428 struct __pyx_t_2yt_8geometry_13oct_container_OctList;
1429 struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer;
1430 struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_get;
1431 struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_visit_all_octs;
1432 
1433 /* "oct_container.pxd":25
1434  * cdef int ORDER_MAX
1435  *
1436  * cdef struct OctKey:             # <<<<<<<<<<<<<<
1437  *     np.int64_t key
1438  *     Oct *node
1439  */
1440 struct __pyx_t_2yt_8geometry_13oct_container_OctKey {
1441   __pyx_t_5numpy_int64_t key;
1442   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *node;
1443   __pyx_t_5numpy_int64_t *indices;
1444   __pyx_t_5numpy_int64_t pcount;
1445 };
1446 
1447 /* "oct_container.pxd":32
1448  *     np.int64_t pcount
1449  *
1450  * cdef struct OctList             # <<<<<<<<<<<<<<
1451  *
1452  * cdef struct OctList:
1453  */
1454 struct __pyx_t_2yt_8geometry_13oct_container_OctList {
1455   struct __pyx_t_2yt_8geometry_13oct_container_OctList *next;
1456   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *o;
1457 };
1458 
1459 /* "oct_container.pxd":40
1460  * # NOTE: This object *has* to be the same size as the AllocationContainer
1461  * # object.  There's an assert in the __cinit__ function.
1462  * cdef struct OctAllocationContainer:             # <<<<<<<<<<<<<<
1463  *     np.uint64_t n
1464  *     np.uint64_t n_assigned
1465  */
1466 struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer {
1467   __pyx_t_5numpy_uint64_t n;
1468   __pyx_t_5numpy_uint64_t n_assigned;
1469   __pyx_t_5numpy_uint64_t offset;
1470   __pyx_t_5numpy_int64_t con_id;
1471   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *my_objs;
1472 };
1473 
1474 /* "oct_container.pxd":66
1475  *     cdef public np.int64_t nocts
1476  *     cdef public int num_domains
1477  *     cdef Oct *get(self, np.float64_t ppos[3], OctInfo *oinfo = ?,             # <<<<<<<<<<<<<<
1478  *                   int max_level = ?) nogil
1479  *     cdef int get_root(self, int ind[3], Oct **o) nogil
1480  */
1481 struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_get {
1482   int __pyx_n;
1483   struct __pyx_t_2yt_8geometry_12oct_visitors_OctInfo *oinfo;
1484   int max_level;
1485 };
1486 
1487 /* "oct_container.pxd":74
1488  *     # AllocationContainer.offset if such a thing exists.
1489  *     cdef np.int64_t get_domain_offset(self, int domain_id)
1490  *     cdef void visit_all_octs(self,             # <<<<<<<<<<<<<<
1491  *                         selection_routines.SelectorObject selector,
1492  *                         OctVisitor visitor,
1493  */
1494 struct __pyx_opt_args_2yt_8geometry_13oct_container_15OctreeContainer_visit_all_octs {
1495   int __pyx_n;
1496   int vc;
1497   __pyx_t_5numpy_int64_t *indices;
1498 };
1499 struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_recursively_visit_octs;
1500 struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_select_grid;
1501 struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_select_grid_edge;
1502 struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_visit_grid_cells;
1503 
1504 /* "yt/geometry/selection_routines.pxd":34
1505  *     cdef np.int64_t _hash
1506  *
1507  *     cdef void recursively_visit_octs(self, Oct *root,             # <<<<<<<<<<<<<<
1508  *                         np.float64_t pos[3], np.float64_t dds[3],
1509  *                         int level,
1510  */
1511 struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_recursively_visit_octs {
1512   int __pyx_n;
1513   int visit_covered;
1514 };
1515 
1516 /* "yt/geometry/selection_routines.pxd":42
1517  *                               np.float64_t spos[3], np.float64_t sdds[3],
1518  *                               OctVisitor visitor, int i, int j, int k)
1519  *     cdef int select_grid(self, np.float64_t left_edge[3],             # <<<<<<<<<<<<<<
1520  *                                np.float64_t right_edge[3],
1521  *                                np.int32_t level, Oct *o = ?) nogil
1522  */
1523 struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_select_grid {
1524   int __pyx_n;
1525   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *o;
1526 };
1527 
1528 /* "yt/geometry/selection_routines.pxd":45
1529  *                                np.float64_t right_edge[3],
1530  *                                np.int32_t level, Oct *o = ?) nogil
1531  *     cdef int select_grid_edge(self, np.float64_t left_edge[3],             # <<<<<<<<<<<<<<
1532  *                                     np.float64_t right_edge[3],
1533  *                                     np.int32_t level, Oct *o = ?) nogil
1534  */
1535 struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_select_grid_edge {
1536   int __pyx_n;
1537   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *o;
1538 };
1539 
1540 /* "yt/geometry/selection_routines.pxd":62
1541  *                                 np.ndarray[np.uint8_t, ndim=3] mask,
1542  *                                 int level)
1543  *     cdef void visit_grid_cells(self, GridVisitorData *data,             # <<<<<<<<<<<<<<
1544  *                     grid_visitor_function *func, np.uint8_t *cached_mask = ?)
1545  *
1546  */
1547 struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_visit_grid_cells {
1548   int __pyx_n;
1549   __pyx_t_5numpy_uint8_t *cached_mask;
1550 };
1551 struct __pyx_opt_args_2yt_8geometry_14grid_container_8GridTree_recursively_visit_grid;
1552 
1553 /* "yt/geometry/grid_container.pxd":38
1554  *                           grid_visitor_function *func,
1555  *                           SelectorObject selector)
1556  *     cdef void recursively_visit_grid(self,             # <<<<<<<<<<<<<<
1557  *                           GridVisitorData *data,
1558  *                           grid_visitor_function *func,
1559  */
1560 struct __pyx_opt_args_2yt_8geometry_14grid_container_8GridTree_recursively_visit_grid {
1561   int __pyx_n;
1562   __pyx_t_5numpy_uint8_t *buf;
1563 };
1564 
1565 /* "oct_visitors.pxd":33
1566  *     np.int64_t padding
1567  *
1568  * cdef class OctVisitor:             # <<<<<<<<<<<<<<
1569  *     cdef np.uint64_t index
1570  *     cdef np.uint64_t last
1571  */
1572 struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor {
1573   PyObject_HEAD
1574   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_vtab;
1575   __pyx_t_5numpy_uint64_t index;
1576   __pyx_t_5numpy_uint64_t last;
1577   __pyx_t_5numpy_int64_t global_index;
1578   __pyx_t_5numpy_int64_t pos[3];
1579   __pyx_t_5numpy_uint8_t ind[3];
1580   int dims;
1581   __pyx_t_5numpy_int32_t domain;
1582   __pyx_t_5numpy_int8_t level;
1583   __pyx_t_5numpy_int8_t oref;
1584   __pyx_t_5numpy_int32_t nz;
1585 };
1586 
1587 
1588 /* "oct_visitors.pxd":59
1589  *         return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0])
1590  *
1591  * cdef class CountTotalOcts(OctVisitor):             # <<<<<<<<<<<<<<
1592  *     pass
1593  *
1594  */
1595 struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalOcts {
1596   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1597 };
1598 
1599 
1600 /* "oct_visitors.pxd":62
1601  *     pass
1602  *
1603  * cdef class CountTotalCells(OctVisitor):             # <<<<<<<<<<<<<<
1604  *     pass
1605  *
1606  */
1607 struct __pyx_obj_2yt_8geometry_12oct_visitors_CountTotalCells {
1608   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1609 };
1610 
1611 
1612 /* "oct_visitors.pxd":65
1613  *     pass
1614  *
1615  * cdef class MarkOcts(OctVisitor):             # <<<<<<<<<<<<<<
1616  *     # Unused
1617  *     cdef np.uint8_t[:,:,:,:] mark
1618  */
1619 struct __pyx_obj_2yt_8geometry_12oct_visitors_MarkOcts {
1620   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1621   __Pyx_memviewslice mark;
1622 };
1623 
1624 
1625 /* "oct_visitors.pxd":69
1626  *     cdef np.uint8_t[:,:,:,:] mark
1627  *
1628  * cdef class MaskOcts(OctVisitor):             # <<<<<<<<<<<<<<
1629  *     cdef np.uint8_t[:,:,:,:] mask
1630  *
1631  */
1632 struct __pyx_obj_2yt_8geometry_12oct_visitors_MaskOcts {
1633   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1634   __Pyx_memviewslice mask;
1635 };
1636 
1637 
1638 /* "oct_visitors.pxd":72
1639  *     cdef np.uint8_t[:,:,:,:] mask
1640  *
1641  * cdef class IndexOcts(OctVisitor):             # <<<<<<<<<<<<<<
1642  *     cdef np.int64_t[:] oct_index
1643  *
1644  */
1645 struct __pyx_obj_2yt_8geometry_12oct_visitors_IndexOcts {
1646   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1647   __Pyx_memviewslice oct_index;
1648 };
1649 
1650 
1651 /* "oct_visitors.pxd":75
1652  *     cdef np.int64_t[:] oct_index
1653  *
1654  * cdef class MaskedIndexOcts(OctVisitor):             # <<<<<<<<<<<<<<
1655  *     cdef np.int64_t[:] oct_index
1656  *     cdef np.uint8_t[:] oct_mask
1657  */
1658 struct __pyx_obj_2yt_8geometry_12oct_visitors_MaskedIndexOcts {
1659   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1660   __Pyx_memviewslice oct_index;
1661   __Pyx_memviewslice oct_mask;
1662 };
1663 
1664 
1665 /* "oct_visitors.pxd":79
1666  *     cdef np.uint8_t[:] oct_mask
1667  *
1668  * cdef class IndexMaskMapOcts(OctVisitor):             # <<<<<<<<<<<<<<
1669  *     cdef np.int64_t[:] oct_index
1670  *     cdef np.uint8_t[:] oct_mask
1671  */
1672 struct __pyx_obj_2yt_8geometry_12oct_visitors_IndexMaskMapOcts {
1673   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1674   __Pyx_memviewslice oct_index;
1675   __Pyx_memviewslice oct_mask;
1676   __Pyx_memviewslice map_domain_ind;
1677   __pyx_t_5numpy_uint64_t map_index;
1678 };
1679 
1680 
1681 /* "oct_visitors.pxd":85
1682  *     cdef np.uint64_t map_index
1683  *
1684  * cdef class ICoordsOcts(OctVisitor):             # <<<<<<<<<<<<<<
1685  *     cdef np.int64_t[:,:] icoords
1686  *
1687  */
1688 struct __pyx_obj_2yt_8geometry_12oct_visitors_ICoordsOcts {
1689   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1690   __Pyx_memviewslice icoords;
1691 };
1692 
1693 
1694 /* "oct_visitors.pxd":88
1695  *     cdef np.int64_t[:,:] icoords
1696  *
1697  * cdef class IResOcts(OctVisitor):             # <<<<<<<<<<<<<<
1698  *     cdef np.int64_t[:] ires
1699  *
1700  */
1701 struct __pyx_obj_2yt_8geometry_12oct_visitors_IResOcts {
1702   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1703   __Pyx_memviewslice ires;
1704 };
1705 
1706 
1707 /* "oct_visitors.pxd":91
1708  *     cdef np.int64_t[:] ires
1709  *
1710  * cdef class FCoordsOcts(OctVisitor):             # <<<<<<<<<<<<<<
1711  *     cdef np.float64_t[:,:] fcoords
1712  *
1713  */
1714 struct __pyx_obj_2yt_8geometry_12oct_visitors_FCoordsOcts {
1715   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1716   __Pyx_memviewslice fcoords;
1717 };
1718 
1719 
1720 /* "oct_visitors.pxd":94
1721  *     cdef np.float64_t[:,:] fcoords
1722  *
1723  * cdef class FWidthOcts(OctVisitor):             # <<<<<<<<<<<<<<
1724  *     cdef np.float64_t[:,:] fwidth
1725  *
1726  */
1727 struct __pyx_obj_2yt_8geometry_12oct_visitors_FWidthOcts {
1728   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1729   __Pyx_memviewslice fwidth;
1730 };
1731 
1732 
1733 /* "oct_visitors.pxd":97
1734  *     cdef np.float64_t[:,:] fwidth
1735  *
1736  * cdef class CopyArrayI64(OctVisitor):             # <<<<<<<<<<<<<<
1737  *     cdef np.int64_t[:,:,:,:,:,:] source
1738  *     cdef np.int64_t[:,:] dest
1739  */
1740 struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayI64 {
1741   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1742   __Pyx_memviewslice source;
1743   __Pyx_memviewslice dest;
1744 };
1745 
1746 
1747 /* "oct_visitors.pxd":101
1748  *     cdef np.int64_t[:,:] dest
1749  *
1750  * cdef class CopyArrayF64(OctVisitor):             # <<<<<<<<<<<<<<
1751  *     cdef np.float64_t[:,:,:,:,:] source
1752  *     cdef np.float64_t[:,:] dest
1753  */
1754 struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyArrayF64 {
1755   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1756   __Pyx_memviewslice source;
1757   __Pyx_memviewslice dest;
1758 };
1759 
1760 
1761 /* "oct_visitors.pxd":105
1762  *     cdef np.float64_t[:,:] dest
1763  *
1764  * cdef class CopyFileIndArrayI8(OctVisitor):             # <<<<<<<<<<<<<<
1765  *     cdef np.int64_t root
1766  *     cdef np.uint8_t[:] source
1767  */
1768 struct __pyx_obj_2yt_8geometry_12oct_visitors_CopyFileIndArrayI8 {
1769   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1770   __pyx_t_5numpy_int64_t root;
1771   __Pyx_memviewslice source;
1772   __Pyx_memviewslice dest;
1773 };
1774 
1775 
1776 /* "oct_visitors.pxd":110
1777  *     cdef np.uint8_t[:] dest
1778  *
1779  * cdef class IdentifyOcts(OctVisitor):             # <<<<<<<<<<<<<<
1780  *     cdef np.uint8_t[:] domain_mask
1781  *
1782  */
1783 struct __pyx_obj_2yt_8geometry_12oct_visitors_IdentifyOcts {
1784   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1785   __Pyx_memviewslice domain_mask;
1786 };
1787 
1788 
1789 /* "oct_visitors.pxd":113
1790  *     cdef np.uint8_t[:] domain_mask
1791  *
1792  * cdef class AssignDomainInd(OctVisitor):             # <<<<<<<<<<<<<<
1793  *     pass
1794  *
1795  */
1796 struct __pyx_obj_2yt_8geometry_12oct_visitors_AssignDomainInd {
1797   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1798 };
1799 
1800 
1801 /* "oct_visitors.pxd":116
1802  *     pass
1803  *
1804  * cdef class FillFileIndicesO(OctVisitor):             # <<<<<<<<<<<<<<
1805  *     cdef np.uint8_t[:] levels
1806  *     cdef np.int64_t[:] file_inds
1807  */
1808 struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesO {
1809   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1810   __Pyx_memviewslice levels;
1811   __Pyx_memviewslice file_inds;
1812   __Pyx_memviewslice cell_inds;
1813 };
1814 
1815 
1816 /* "oct_visitors.pxd":121
1817  *     cdef np.uint8_t[:] cell_inds
1818  *
1819  * cdef class FillFileIndicesR(OctVisitor):             # <<<<<<<<<<<<<<
1820  *     cdef np.uint8_t[:] levels
1821  *     cdef np.int64_t[:] file_inds
1822  */
1823 struct __pyx_obj_2yt_8geometry_12oct_visitors_FillFileIndicesR {
1824   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1825   __Pyx_memviewslice levels;
1826   __Pyx_memviewslice file_inds;
1827   __Pyx_memviewslice cell_inds;
1828 };
1829 
1830 
1831 /* "oct_visitors.pxd":126
1832  *     cdef np.uint8_t[:] cell_inds
1833  *
1834  * cdef class CountByDomain(OctVisitor):             # <<<<<<<<<<<<<<
1835  *     cdef np.int64_t[:] domain_counts
1836  *
1837  */
1838 struct __pyx_obj_2yt_8geometry_12oct_visitors_CountByDomain {
1839   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1840   __Pyx_memviewslice domain_counts;
1841 };
1842 
1843 
1844 /* "oct_visitors.pxd":129
1845  *     cdef np.int64_t[:] domain_counts
1846  *
1847  * cdef class StoreOctree(OctVisitor):             # <<<<<<<<<<<<<<
1848  *     cdef np.uint8_t[:] ref_mask
1849  *
1850  */
1851 struct __pyx_obj_2yt_8geometry_12oct_visitors_StoreOctree {
1852   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1853   __Pyx_memviewslice ref_mask;
1854 };
1855 
1856 
1857 /* "oct_visitors.pxd":132
1858  *     cdef np.uint8_t[:] ref_mask
1859  *
1860  * cdef class LoadOctree(OctVisitor):             # <<<<<<<<<<<<<<
1861  *     cdef np.uint8_t[:] ref_mask
1862  *     cdef Oct* octs
1863  */
1864 struct __pyx_obj_2yt_8geometry_12oct_visitors_LoadOctree {
1865   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1866   __Pyx_memviewslice ref_mask;
1867   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *octs;
1868   __pyx_t_5numpy_uint64_t *nocts;
1869   __pyx_t_5numpy_uint64_t *nfinest;
1870 };
1871 
1872 
1873 /* "oct_visitors.pxd":138
1874  *     cdef np.uint64_t *nfinest
1875  *
1876  * cdef class MortonIndexOcts(OctVisitor):             # <<<<<<<<<<<<<<
1877  *     cdef np.uint8_t[:] level_arr
1878  *     cdef np.uint64_t[:] morton_ind
1879  */
1880 struct __pyx_obj_2yt_8geometry_12oct_visitors_MortonIndexOcts {
1881   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1882   __Pyx_memviewslice level_arr;
1883   __Pyx_memviewslice morton_ind;
1884 };
1885 
1886 
1887 /* "oct_visitors.pxd":149
1888  *
1889  *
1890  * cdef class StoreIndex(OctVisitor):             # <<<<<<<<<<<<<<
1891  *     cdef np.int64_t[:,:,:,:] cell_inds
1892  *
1893  */
1894 struct __pyx_obj_2yt_8geometry_12oct_visitors_StoreIndex {
1895   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1896   __Pyx_memviewslice cell_inds;
1897 };
1898 
1899 
1900 /* "oct_visitors.pxd":153
1901  *
1902  * # cimport oct_container
1903  * cdef class BaseNeighbourVisitor(OctVisitor):             # <<<<<<<<<<<<<<
1904  *     cdef int idim      # 0,1,2 for x,y,z
1905  *     cdef int direction # +1 for +x, -1 for -x
1906  */
1907 struct __pyx_obj_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor {
1908   struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
1909   int idim;
1910   int direction;
1911   __pyx_t_5numpy_uint8_t neigh_ind[3];
1912   int other_oct;
1913   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *neighbour;
1914   struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *octree;
1915   struct __pyx_t_2yt_8geometry_12oct_visitors_OctInfo oi;
1916   int n_ghost_zones;
1917 };
1918 
1919 
1920 /* "oct_visitors.pxd":169
1921  *         return (((self.neigh_ind[2]*d)+self.neigh_ind[1])*d+self.neigh_ind[0])
1922  *
1923  * cdef class NeighbourCellIndexVisitor(BaseNeighbourVisitor):             # <<<<<<<<<<<<<<
1924  *     cdef np.uint8_t[::1] cell_inds
1925  *     cdef np.int64_t[::1] domain_inds
1926  */
1927 struct __pyx_obj_2yt_8geometry_12oct_visitors_NeighbourCellIndexVisitor {
1928   struct __pyx_obj_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor __pyx_base;
1929   __Pyx_memviewslice cell_inds;
1930   __Pyx_memviewslice domain_inds;
1931 };
1932 
1933 
1934 /* "oct_visitors.pxd":173
1935  *     cdef np.int64_t[::1] domain_inds
1936  *
1937  * cdef class NeighbourCellVisitor(BaseNeighbourVisitor):             # <<<<<<<<<<<<<<
1938  *     cdef np.uint8_t[::1] levels
1939  *     cdef np.int64_t[::1] file_inds
1940  */
1941 struct __pyx_obj_2yt_8geometry_12oct_visitors_NeighbourCellVisitor {
1942   struct __pyx_obj_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor __pyx_base;
1943   __Pyx_memviewslice levels;
1944   __Pyx_memviewslice file_inds;
1945   __Pyx_memviewslice cell_inds;
1946   __Pyx_memviewslice domains;
1947 };
1948 
1949 
1950 /* "yt/utilities/lib/allocation_container.pxd":20
1951  *     void *my_objs
1952  *
1953  * cdef class ObjectPool:             # <<<<<<<<<<<<<<
1954  *     cdef public np.uint64_t itemsize
1955  *     cdef np.uint64_t n_con
1956  */
1957 struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool {
1958   PyObject_HEAD
1959   struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_vtab;
1960   __pyx_t_5numpy_uint64_t itemsize;
1961   __pyx_t_5numpy_uint64_t n_con;
1962   struct __pyx_t_2yt_9utilities_3lib_20allocation_container_AllocationContainer *containers;
1963 };
1964 
1965 
1966 /* "oct_container.pxd":47
1967  *     Oct *my_objs
1968  *
1969  * cdef class OctObjectPool(ObjectPool):             # <<<<<<<<<<<<<<
1970  *     cdef inline OctAllocationContainer *get_cont(self, int i):
1971  *         return <OctAllocationContainer*> (&self.containers[i])
1972  */
1973 struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool {
1974   struct __pyx_obj_2yt_9utilities_3lib_20allocation_container_ObjectPool __pyx_base;
1975 };
1976 
1977 
1978 /* "oct_container.pxd":55
1979  * cdef void OctList_delete(OctList *list)
1980  *
1981  * cdef class OctreeContainer:             # <<<<<<<<<<<<<<
1982  *     cdef public OctObjectPool domains
1983  *     cdef Oct ****root_mesh
1984  */
1985 struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer {
1986   PyObject_HEAD
1987   struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *__pyx_vtab;
1988   struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *domains;
1989   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct ****root_mesh;
1990   int partial_coverage;
1991   int level_offset;
1992   int nn[3];
1993   __pyx_t_5numpy_uint8_t oref;
1994   __pyx_t_5numpy_float64_t DLE[3];
1995   __pyx_t_5numpy_float64_t DRE[3];
1996   __pyx_t_5numpy_int64_t nocts;
1997   int num_domains;
1998   PyObject *fill_style;
1999 };
2000 
2001 
2002 /* "oct_container.pxd":85
2003  *     cdef public object fill_style
2004  *
2005  * cdef class SparseOctreeContainer(OctreeContainer):             # <<<<<<<<<<<<<<
2006  *     cdef OctKey *root_nodes
2007  *     cdef void *tree_root
2008  */
2009 struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer {
2010   struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer __pyx_base;
2011   struct __pyx_t_2yt_8geometry_13oct_container_OctKey *root_nodes;
2012   void *tree_root;
2013   int num_root;
2014   int max_root;
2015 };
2016 
2017 
2018 /* "oct_container.pxd":93
2019  *     cdef np.int64_t ipos_to_key(self, int pos[3]) nogil
2020  *
2021  * cdef class RAMSESOctreeContainer(SparseOctreeContainer):             # <<<<<<<<<<<<<<
2022  *     pass
2023  *
2024  */
2025 struct __pyx_obj_2yt_8geometry_13oct_container_RAMSESOctreeContainer {
2026   struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer __pyx_base;
2027 };
2028 
2029 
2030 /* "yt/geometry/selection_routines.pxd":24
2031  *
2032  *
2033  * cdef class SelectorObject:             # <<<<<<<<<<<<<<
2034  *     cdef public np.int32_t min_level
2035  *     cdef public np.int32_t max_level
2036  */
2037 struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject {
2038   PyObject_HEAD
2039   struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *__pyx_vtab;
2040   __pyx_t_5numpy_int32_t min_level;
2041   __pyx_t_5numpy_int32_t max_level;
2042   int overlap_cells;
2043   __pyx_t_5numpy_float64_t domain_width[3];
2044   __pyx_t_5numpy_float64_t domain_center[3];
2045   int periodicity[3];
2046   int _hash_initialized;
2047   __pyx_t_5numpy_int64_t _hash;
2048 };
2049 
2050 
2051 /* "yt/geometry/selection_routines.pxd":70
2052  *         self, np.float64_t x1, np.float64_t x2, int d) nogil
2053  *
2054  * cdef class AlwaysSelector(SelectorObject):             # <<<<<<<<<<<<<<
2055  *     pass
2056  *
2057  */
2058 struct __pyx_obj_2yt_8geometry_18selection_routines_AlwaysSelector {
2059   struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject __pyx_base;
2060 };
2061 
2062 
2063 /* "yt/geometry/selection_routines.pxd":73
2064  *     pass
2065  *
2066  * cdef class OctreeSubsetSelector(SelectorObject):             # <<<<<<<<<<<<<<
2067  *     cdef public SelectorObject base_selector
2068  *     cdef public np.int64_t domain_id
2069  */
2070 struct __pyx_obj_2yt_8geometry_18selection_routines_OctreeSubsetSelector {
2071   struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject __pyx_base;
2072   struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *base_selector;
2073   __pyx_t_5numpy_int64_t domain_id;
2074 };
2075 
2076 
2077 /* "yt/geometry/selection_routines.pxd":77
2078  *     cdef public np.int64_t domain_id
2079  *
2080  * cdef class BooleanSelector(SelectorObject):             # <<<<<<<<<<<<<<
2081  *     cdef public SelectorObject sel1
2082  *     cdef public SelectorObject sel2
2083  */
2084 struct __pyx_obj_2yt_8geometry_18selection_routines_BooleanSelector {
2085   struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject __pyx_base;
2086   struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *sel1;
2087   struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *sel2;
2088 };
2089 
2090 
2091 /* "yt/utilities/lib/bitarray.pxd":28
2092  *     return 1
2093  *
2094  * cdef class bitarray:             # <<<<<<<<<<<<<<
2095  *     cdef np.uint8_t *buf
2096  *     cdef np.uint64_t size
2097  */
2098 struct __pyx_obj_2yt_9utilities_3lib_8bitarray_bitarray {
2099   PyObject_HEAD
2100   struct __pyx_vtabstruct_2yt_9utilities_3lib_8bitarray_bitarray *__pyx_vtab;
2101   __pyx_t_5numpy_uint8_t *buf;
2102   __pyx_t_5numpy_uint64_t size;
2103   __pyx_t_5numpy_uint64_t buf_size;
2104   PyObject *ibuf;
2105 };
2106 
2107 
2108 /* "yt/geometry/grid_container.pxd":27
2109  *
2110  *
2111  * cdef class GridTree:             # <<<<<<<<<<<<<<
2112  *     cdef GridTreeNode *grids
2113  *     cdef GridTreeNode *root_grids
2114  */
2115 struct __pyx_obj_2yt_8geometry_14grid_container_GridTree {
2116   PyObject_HEAD
2117   struct __pyx_vtabstruct_2yt_8geometry_14grid_container_GridTree *__pyx_vtab;
2118   struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode *grids;
2119   struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode *root_grids;
2120   int num_grids;
2121   int num_root_grids;
2122   int num_leaf_grids;
2123   struct __pyx_obj_2yt_9utilities_3lib_8bitarray_bitarray *mask;
2124 };
2125 
2126 
2127 /* "yt/geometry/grid_container.pxd":45
2128  *                           np.uint8_t *buf = ?)
2129  *
2130  * cdef class MatchPointsToGrids:             # <<<<<<<<<<<<<<
2131  *
2132  *     cdef int num_points
2133  */
2134 struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids {
2135   PyObject_HEAD
2136   struct __pyx_vtabstruct_2yt_8geometry_14grid_container_MatchPointsToGrids *__pyx_vtab;
2137   int num_points;
2138   __pyx_t_5numpy_float64_t *xp;
2139   __pyx_t_5numpy_float64_t *yp;
2140   __pyx_t_5numpy_float64_t *zp;
2141   struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *tree;
2142   __pyx_t_5numpy_int64_t *point_grids;
2143 };
2144 
2145 
2146 /* "yt/geometry/grid_container.pyx":102
2147  *         self.mask = None
2148  *
2149  *     def __iter__(self):             # <<<<<<<<<<<<<<
2150  *         yield self
2151  *
2152  */
2153 struct __pyx_obj_2yt_8geometry_14grid_container___pyx_scope_struct____iter__ {
2154   PyObject_HEAD
2155   struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *__pyx_v_self;
2156 };
2157 
2158 
2159 /* "View.MemoryView":105
2160  *
2161  * @cname("__pyx_array")
2162  * cdef class array:             # <<<<<<<<<<<<<<
2163  *
2164  *     cdef:
2165  */
2166 struct __pyx_array_obj {
2167   PyObject_HEAD
2168   struct __pyx_vtabstruct_array *__pyx_vtab;
2169   char *data;
2170   Py_ssize_t len;
2171   char *format;
2172   int ndim;
2173   Py_ssize_t *_shape;
2174   Py_ssize_t *_strides;
2175   Py_ssize_t itemsize;
2176   PyObject *mode;
2177   PyObject *_format;
2178   void (*callback_free_data)(void *);
2179   int free_data;
2180   int dtype_is_object;
2181 };
2182 
2183 
2184 /* "View.MemoryView":279
2185  *
2186  * @cname('__pyx_MemviewEnum')
2187  * cdef class Enum(object):             # <<<<<<<<<<<<<<
2188  *     cdef object name
2189  *     def __init__(self, name):
2190  */
2191 struct __pyx_MemviewEnum_obj {
2192   PyObject_HEAD
2193   PyObject *name;
2194 };
2195 
2196 
2197 /* "View.MemoryView":330
2198  *
2199  * @cname('__pyx_memoryview')
2200  * cdef class memoryview(object):             # <<<<<<<<<<<<<<
2201  *
2202  *     cdef object obj
2203  */
2204 struct __pyx_memoryview_obj {
2205   PyObject_HEAD
2206   struct __pyx_vtabstruct_memoryview *__pyx_vtab;
2207   PyObject *obj;
2208   PyObject *_size;
2209   PyObject *_array_interface;
2210   PyThread_type_lock lock;
2211   __pyx_atomic_int acquisition_count[2];
2212   __pyx_atomic_int *acquisition_count_aligned_p;
2213   Py_buffer view;
2214   int flags;
2215   int dtype_is_object;
2216   __Pyx_TypeInfo *typeinfo;
2217 };
2218 
2219 
2220 /* "View.MemoryView":961
2221  *
2222  * @cname('__pyx_memoryviewslice')
2223  * cdef class _memoryviewslice(memoryview):             # <<<<<<<<<<<<<<
2224  *     "Internal class for passing memoryview slices to Python"
2225  *
2226  */
2227 struct __pyx_memoryviewslice_obj {
2228   struct __pyx_memoryview_obj __pyx_base;
2229   __Pyx_memviewslice from_slice;
2230   PyObject *from_object;
2231   PyObject *(*to_object_func)(char *);
2232   int (*to_dtype_func)(char *, PyObject *);
2233 };
2234 
2235 
2236 
2237 /* "oct_visitors.pxd":33
2238  *     np.int64_t padding
2239  *
2240  * cdef class OctVisitor:             # <<<<<<<<<<<<<<
2241  *     cdef np.uint64_t index
2242  *     cdef np.uint64_t last
2243  */
2244 
2245 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor {
2246   void (*visit)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, __pyx_t_5numpy_uint8_t);
2247   int (*oind)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *);
2248   int (*rind)(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *);
2249 };
2250 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_vtabptr_2yt_8geometry_12oct_visitors_OctVisitor;
2251 static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_oind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *);
2252 static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_rind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *);
2253 
2254 
2255 /* "oct_visitors.pxd":59
2256  *         return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0])
2257  *
2258  * cdef class CountTotalOcts(OctVisitor):             # <<<<<<<<<<<<<<
2259  *     pass
2260  *
2261  */
2262 
2263 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CountTotalOcts {
2264   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2265 };
2266 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CountTotalOcts *__pyx_vtabptr_2yt_8geometry_12oct_visitors_CountTotalOcts;
2267 
2268 
2269 /* "oct_visitors.pxd":62
2270  *     pass
2271  *
2272  * cdef class CountTotalCells(OctVisitor):             # <<<<<<<<<<<<<<
2273  *     pass
2274  *
2275  */
2276 
2277 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CountTotalCells {
2278   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2279 };
2280 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CountTotalCells *__pyx_vtabptr_2yt_8geometry_12oct_visitors_CountTotalCells;
2281 
2282 
2283 /* "oct_visitors.pxd":65
2284  *     pass
2285  *
2286  * cdef class MarkOcts(OctVisitor):             # <<<<<<<<<<<<<<
2287  *     # Unused
2288  *     cdef np.uint8_t[:,:,:,:] mark
2289  */
2290 
2291 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_MarkOcts {
2292   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2293 };
2294 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_MarkOcts *__pyx_vtabptr_2yt_8geometry_12oct_visitors_MarkOcts;
2295 
2296 
2297 /* "oct_visitors.pxd":69
2298  *     cdef np.uint8_t[:,:,:,:] mark
2299  *
2300  * cdef class MaskOcts(OctVisitor):             # <<<<<<<<<<<<<<
2301  *     cdef np.uint8_t[:,:,:,:] mask
2302  *
2303  */
2304 
2305 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_MaskOcts {
2306   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2307 };
2308 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_MaskOcts *__pyx_vtabptr_2yt_8geometry_12oct_visitors_MaskOcts;
2309 
2310 
2311 /* "oct_visitors.pxd":72
2312  *     cdef np.uint8_t[:,:,:,:] mask
2313  *
2314  * cdef class IndexOcts(OctVisitor):             # <<<<<<<<<<<<<<
2315  *     cdef np.int64_t[:] oct_index
2316  *
2317  */
2318 
2319 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_IndexOcts {
2320   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2321 };
2322 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_IndexOcts *__pyx_vtabptr_2yt_8geometry_12oct_visitors_IndexOcts;
2323 
2324 
2325 /* "oct_visitors.pxd":75
2326  *     cdef np.int64_t[:] oct_index
2327  *
2328  * cdef class MaskedIndexOcts(OctVisitor):             # <<<<<<<<<<<<<<
2329  *     cdef np.int64_t[:] oct_index
2330  *     cdef np.uint8_t[:] oct_mask
2331  */
2332 
2333 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_MaskedIndexOcts {
2334   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2335 };
2336 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_MaskedIndexOcts *__pyx_vtabptr_2yt_8geometry_12oct_visitors_MaskedIndexOcts;
2337 
2338 
2339 /* "oct_visitors.pxd":79
2340  *     cdef np.uint8_t[:] oct_mask
2341  *
2342  * cdef class IndexMaskMapOcts(OctVisitor):             # <<<<<<<<<<<<<<
2343  *     cdef np.int64_t[:] oct_index
2344  *     cdef np.uint8_t[:] oct_mask
2345  */
2346 
2347 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_IndexMaskMapOcts {
2348   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2349 };
2350 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_IndexMaskMapOcts *__pyx_vtabptr_2yt_8geometry_12oct_visitors_IndexMaskMapOcts;
2351 
2352 
2353 /* "oct_visitors.pxd":85
2354  *     cdef np.uint64_t map_index
2355  *
2356  * cdef class ICoordsOcts(OctVisitor):             # <<<<<<<<<<<<<<
2357  *     cdef np.int64_t[:,:] icoords
2358  *
2359  */
2360 
2361 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_ICoordsOcts {
2362   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2363 };
2364 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_ICoordsOcts *__pyx_vtabptr_2yt_8geometry_12oct_visitors_ICoordsOcts;
2365 
2366 
2367 /* "oct_visitors.pxd":88
2368  *     cdef np.int64_t[:,:] icoords
2369  *
2370  * cdef class IResOcts(OctVisitor):             # <<<<<<<<<<<<<<
2371  *     cdef np.int64_t[:] ires
2372  *
2373  */
2374 
2375 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_IResOcts {
2376   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2377 };
2378 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_IResOcts *__pyx_vtabptr_2yt_8geometry_12oct_visitors_IResOcts;
2379 
2380 
2381 /* "oct_visitors.pxd":91
2382  *     cdef np.int64_t[:] ires
2383  *
2384  * cdef class FCoordsOcts(OctVisitor):             # <<<<<<<<<<<<<<
2385  *     cdef np.float64_t[:,:] fcoords
2386  *
2387  */
2388 
2389 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_FCoordsOcts {
2390   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2391 };
2392 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_FCoordsOcts *__pyx_vtabptr_2yt_8geometry_12oct_visitors_FCoordsOcts;
2393 
2394 
2395 /* "oct_visitors.pxd":94
2396  *     cdef np.float64_t[:,:] fcoords
2397  *
2398  * cdef class FWidthOcts(OctVisitor):             # <<<<<<<<<<<<<<
2399  *     cdef np.float64_t[:,:] fwidth
2400  *
2401  */
2402 
2403 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_FWidthOcts {
2404   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2405 };
2406 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_FWidthOcts *__pyx_vtabptr_2yt_8geometry_12oct_visitors_FWidthOcts;
2407 
2408 
2409 /* "oct_visitors.pxd":97
2410  *     cdef np.float64_t[:,:] fwidth
2411  *
2412  * cdef class CopyArrayI64(OctVisitor):             # <<<<<<<<<<<<<<
2413  *     cdef np.int64_t[:,:,:,:,:,:] source
2414  *     cdef np.int64_t[:,:] dest
2415  */
2416 
2417 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CopyArrayI64 {
2418   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2419 };
2420 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CopyArrayI64 *__pyx_vtabptr_2yt_8geometry_12oct_visitors_CopyArrayI64;
2421 
2422 
2423 /* "oct_visitors.pxd":101
2424  *     cdef np.int64_t[:,:] dest
2425  *
2426  * cdef class CopyArrayF64(OctVisitor):             # <<<<<<<<<<<<<<
2427  *     cdef np.float64_t[:,:,:,:,:] source
2428  *     cdef np.float64_t[:,:] dest
2429  */
2430 
2431 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CopyArrayF64 {
2432   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2433 };
2434 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CopyArrayF64 *__pyx_vtabptr_2yt_8geometry_12oct_visitors_CopyArrayF64;
2435 
2436 
2437 /* "oct_visitors.pxd":105
2438  *     cdef np.float64_t[:,:] dest
2439  *
2440  * cdef class CopyFileIndArrayI8(OctVisitor):             # <<<<<<<<<<<<<<
2441  *     cdef np.int64_t root
2442  *     cdef np.uint8_t[:] source
2443  */
2444 
2445 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CopyFileIndArrayI8 {
2446   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2447 };
2448 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CopyFileIndArrayI8 *__pyx_vtabptr_2yt_8geometry_12oct_visitors_CopyFileIndArrayI8;
2449 
2450 
2451 /* "oct_visitors.pxd":110
2452  *     cdef np.uint8_t[:] dest
2453  *
2454  * cdef class IdentifyOcts(OctVisitor):             # <<<<<<<<<<<<<<
2455  *     cdef np.uint8_t[:] domain_mask
2456  *
2457  */
2458 
2459 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_IdentifyOcts {
2460   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2461 };
2462 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_IdentifyOcts *__pyx_vtabptr_2yt_8geometry_12oct_visitors_IdentifyOcts;
2463 
2464 
2465 /* "oct_visitors.pxd":113
2466  *     cdef np.uint8_t[:] domain_mask
2467  *
2468  * cdef class AssignDomainInd(OctVisitor):             # <<<<<<<<<<<<<<
2469  *     pass
2470  *
2471  */
2472 
2473 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_AssignDomainInd {
2474   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2475 };
2476 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_AssignDomainInd *__pyx_vtabptr_2yt_8geometry_12oct_visitors_AssignDomainInd;
2477 
2478 
2479 /* "oct_visitors.pxd":116
2480  *     pass
2481  *
2482  * cdef class FillFileIndicesO(OctVisitor):             # <<<<<<<<<<<<<<
2483  *     cdef np.uint8_t[:] levels
2484  *     cdef np.int64_t[:] file_inds
2485  */
2486 
2487 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_FillFileIndicesO {
2488   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2489 };
2490 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_FillFileIndicesO *__pyx_vtabptr_2yt_8geometry_12oct_visitors_FillFileIndicesO;
2491 
2492 
2493 /* "oct_visitors.pxd":121
2494  *     cdef np.uint8_t[:] cell_inds
2495  *
2496  * cdef class FillFileIndicesR(OctVisitor):             # <<<<<<<<<<<<<<
2497  *     cdef np.uint8_t[:] levels
2498  *     cdef np.int64_t[:] file_inds
2499  */
2500 
2501 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_FillFileIndicesR {
2502   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2503 };
2504 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_FillFileIndicesR *__pyx_vtabptr_2yt_8geometry_12oct_visitors_FillFileIndicesR;
2505 
2506 
2507 /* "oct_visitors.pxd":126
2508  *     cdef np.uint8_t[:] cell_inds
2509  *
2510  * cdef class CountByDomain(OctVisitor):             # <<<<<<<<<<<<<<
2511  *     cdef np.int64_t[:] domain_counts
2512  *
2513  */
2514 
2515 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CountByDomain {
2516   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2517 };
2518 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_CountByDomain *__pyx_vtabptr_2yt_8geometry_12oct_visitors_CountByDomain;
2519 
2520 
2521 /* "oct_visitors.pxd":129
2522  *     cdef np.int64_t[:] domain_counts
2523  *
2524  * cdef class StoreOctree(OctVisitor):             # <<<<<<<<<<<<<<
2525  *     cdef np.uint8_t[:] ref_mask
2526  *
2527  */
2528 
2529 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_StoreOctree {
2530   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2531 };
2532 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_StoreOctree *__pyx_vtabptr_2yt_8geometry_12oct_visitors_StoreOctree;
2533 
2534 
2535 /* "oct_visitors.pxd":132
2536  *     cdef np.uint8_t[:] ref_mask
2537  *
2538  * cdef class LoadOctree(OctVisitor):             # <<<<<<<<<<<<<<
2539  *     cdef np.uint8_t[:] ref_mask
2540  *     cdef Oct* octs
2541  */
2542 
2543 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_LoadOctree {
2544   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2545 };
2546 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_LoadOctree *__pyx_vtabptr_2yt_8geometry_12oct_visitors_LoadOctree;
2547 
2548 
2549 /* "oct_visitors.pxd":138
2550  *     cdef np.uint64_t *nfinest
2551  *
2552  * cdef class MortonIndexOcts(OctVisitor):             # <<<<<<<<<<<<<<
2553  *     cdef np.uint8_t[:] level_arr
2554  *     cdef np.uint64_t[:] morton_ind
2555  */
2556 
2557 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_MortonIndexOcts {
2558   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2559 };
2560 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_MortonIndexOcts *__pyx_vtabptr_2yt_8geometry_12oct_visitors_MortonIndexOcts;
2561 
2562 
2563 /* "oct_visitors.pxd":149
2564  *
2565  *
2566  * cdef class StoreIndex(OctVisitor):             # <<<<<<<<<<<<<<
2567  *     cdef np.int64_t[:,:,:,:] cell_inds
2568  *
2569  */
2570 
2571 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_StoreIndex {
2572   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2573 };
2574 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_StoreIndex *__pyx_vtabptr_2yt_8geometry_12oct_visitors_StoreIndex;
2575 
2576 
2577 /* "oct_visitors.pxd":153
2578  *
2579  * # cimport oct_container
2580  * cdef class BaseNeighbourVisitor(OctVisitor):             # <<<<<<<<<<<<<<
2581  *     cdef int idim      # 0,1,2 for x,y,z
2582  *     cdef int direction # +1 for +x, -1 for -x
2583  */
2584 
2585 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor {
2586   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_OctVisitor __pyx_base;
2587   void (*set_neighbour_info)(struct __pyx_obj_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *, int *);
2588   __pyx_t_5numpy_uint8_t (*neighbour_rind)(struct __pyx_obj_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor *);
2589 };
2590 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor *__pyx_vtabptr_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor;
2591 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 *);
2592 
2593 
2594 /* "oct_visitors.pxd":169
2595  *         return (((self.neigh_ind[2]*d)+self.neigh_ind[1])*d+self.neigh_ind[0])
2596  *
2597  * cdef class NeighbourCellIndexVisitor(BaseNeighbourVisitor):             # <<<<<<<<<<<<<<
2598  *     cdef np.uint8_t[::1] cell_inds
2599  *     cdef np.int64_t[::1] domain_inds
2600  */
2601 
2602 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_NeighbourCellIndexVisitor {
2603   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor __pyx_base;
2604 };
2605 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_NeighbourCellIndexVisitor *__pyx_vtabptr_2yt_8geometry_12oct_visitors_NeighbourCellIndexVisitor;
2606 
2607 
2608 /* "oct_visitors.pxd":173
2609  *     cdef np.int64_t[::1] domain_inds
2610  *
2611  * cdef class NeighbourCellVisitor(BaseNeighbourVisitor):             # <<<<<<<<<<<<<<
2612  *     cdef np.uint8_t[::1] levels
2613  *     cdef np.int64_t[::1] file_inds
2614  */
2615 
2616 struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_NeighbourCellVisitor {
2617   struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor __pyx_base;
2618 };
2619 static struct __pyx_vtabstruct_2yt_8geometry_12oct_visitors_NeighbourCellVisitor *__pyx_vtabptr_2yt_8geometry_12oct_visitors_NeighbourCellVisitor;
2620 
2621 
2622 /* "yt/utilities/lib/allocation_container.pxd":20
2623  *     void *my_objs
2624  *
2625  * cdef class ObjectPool:             # <<<<<<<<<<<<<<
2626  *     cdef public np.uint64_t itemsize
2627  *     cdef np.uint64_t n_con
2628  */
2629 
2630 struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool {
2631   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);
2632   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);
2633   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);
2634 };
2635 static struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool *__pyx_vtabptr_2yt_9utilities_3lib_20allocation_container_ObjectPool;
2636 
2637 
2638 /* "oct_container.pxd":47
2639  *     Oct *my_objs
2640  *
2641  * cdef class OctObjectPool(ObjectPool):             # <<<<<<<<<<<<<<
2642  *     cdef inline OctAllocationContainer *get_cont(self, int i):
2643  *         return <OctAllocationContainer*> (&self.containers[i])
2644  */
2645 
2646 struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctObjectPool {
2647   struct __pyx_vtabstruct_2yt_9utilities_3lib_20allocation_container_ObjectPool __pyx_base;
2648   struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *(*get_cont)(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool *, int);
2649 };
2650 static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctObjectPool *__pyx_vtabptr_2yt_8geometry_13oct_container_OctObjectPool;
2651 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);
2652 
2653 
2654 /* "oct_container.pxd":55
2655  * cdef void OctList_delete(OctList *list)
2656  *
2657  * cdef class OctreeContainer:             # <<<<<<<<<<<<<<
2658  *     cdef public OctObjectPool domains
2659  *     cdef Oct ****root_mesh
2660  */
2661 
2662 struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer {
2663   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);
2664   int (*get_root)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, int *, struct __pyx_t_2yt_8geometry_12oct_visitors_Oct **);
2665   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 *);
2666   __pyx_t_5numpy_int64_t (*get_domain_offset)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, int);
2667   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);
2668   struct __pyx_t_2yt_8geometry_12oct_visitors_Oct *(*next_root)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, int, int *);
2669   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 *);
2670   void (*append_domain)(struct __pyx_obj_2yt_8geometry_13oct_container_OctreeContainer *, __pyx_t_5numpy_int64_t);
2671 };
2672 static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer *__pyx_vtabptr_2yt_8geometry_13oct_container_OctreeContainer;
2673 
2674 
2675 /* "oct_container.pxd":85
2676  *     cdef public object fill_style
2677  *
2678  * cdef class SparseOctreeContainer(OctreeContainer):             # <<<<<<<<<<<<<<
2679  *     cdef OctKey *root_nodes
2680  *     cdef void *tree_root
2681  */
2682 
2683 struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer {
2684   struct __pyx_vtabstruct_2yt_8geometry_13oct_container_OctreeContainer __pyx_base;
2685   void (*key_to_ipos)(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t *);
2686   __pyx_t_5numpy_int64_t (*ipos_to_key)(struct __pyx_obj_2yt_8geometry_13oct_container_SparseOctreeContainer *, int *);
2687 };
2688 static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer *__pyx_vtabptr_2yt_8geometry_13oct_container_SparseOctreeContainer;
2689 
2690 
2691 /* "oct_container.pxd":93
2692  *     cdef np.int64_t ipos_to_key(self, int pos[3]) nogil
2693  *
2694  * cdef class RAMSESOctreeContainer(SparseOctreeContainer):             # <<<<<<<<<<<<<<
2695  *     pass
2696  *
2697  */
2698 
2699 struct __pyx_vtabstruct_2yt_8geometry_13oct_container_RAMSESOctreeContainer {
2700   struct __pyx_vtabstruct_2yt_8geometry_13oct_container_SparseOctreeContainer __pyx_base;
2701 };
2702 static struct __pyx_vtabstruct_2yt_8geometry_13oct_container_RAMSESOctreeContainer *__pyx_vtabptr_2yt_8geometry_13oct_container_RAMSESOctreeContainer;
2703 
2704 
2705 /* "yt/geometry/selection_routines.pxd":24
2706  *
2707  *
2708  * cdef class SelectorObject:             # <<<<<<<<<<<<<<
2709  *     cdef public np.int32_t min_level
2710  *     cdef public np.int32_t max_level
2711  */
2712 
2713 struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject {
2714   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);
2715   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);
2716   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);
2717   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);
2718   int (*select_cell)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *);
2719   int (*select_point)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *);
2720   int (*select_sphere)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t);
2721   int (*select_bbox)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *);
2722   int (*select_bbox_edge)(struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *);
2723   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);
2724   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);
2725   __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);
2726 };
2727 static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *__pyx_vtabptr_2yt_8geometry_18selection_routines_SelectorObject;
2728 
2729 
2730 /* "yt/geometry/selection_routines.pxd":70
2731  *         self, np.float64_t x1, np.float64_t x2, int d) nogil
2732  *
2733  * cdef class AlwaysSelector(SelectorObject):             # <<<<<<<<<<<<<<
2734  *     pass
2735  *
2736  */
2737 
2738 struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_AlwaysSelector {
2739   struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject __pyx_base;
2740 };
2741 static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_AlwaysSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_AlwaysSelector;
2742 
2743 
2744 /* "yt/geometry/selection_routines.pxd":73
2745  *     pass
2746  *
2747  * cdef class OctreeSubsetSelector(SelectorObject):             # <<<<<<<<<<<<<<
2748  *     cdef public SelectorObject base_selector
2749  *     cdef public np.int64_t domain_id
2750  */
2751 
2752 struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_OctreeSubsetSelector {
2753   struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject __pyx_base;
2754 };
2755 static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_OctreeSubsetSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_OctreeSubsetSelector;
2756 
2757 
2758 /* "yt/geometry/selection_routines.pxd":77
2759  *     cdef public np.int64_t domain_id
2760  *
2761  * cdef class BooleanSelector(SelectorObject):             # <<<<<<<<<<<<<<
2762  *     cdef public SelectorObject sel1
2763  *     cdef public SelectorObject sel2
2764  */
2765 
2766 struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanSelector {
2767   struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject __pyx_base;
2768 };
2769 static struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_BooleanSelector *__pyx_vtabptr_2yt_8geometry_18selection_routines_BooleanSelector;
2770 
2771 
2772 /* "yt/utilities/lib/bitarray.pxd":28
2773  *     return 1
2774  *
2775  * cdef class bitarray:             # <<<<<<<<<<<<<<
2776  *     cdef np.uint8_t *buf
2777  *     cdef np.uint64_t size
2778  */
2779 
2780 struct __pyx_vtabstruct_2yt_9utilities_3lib_8bitarray_bitarray {
2781   void (*_set_value)(struct __pyx_obj_2yt_9utilities_3lib_8bitarray_bitarray *, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_uint8_t);
2782   __pyx_t_5numpy_uint8_t (*_query_value)(struct __pyx_obj_2yt_9utilities_3lib_8bitarray_bitarray *, __pyx_t_5numpy_uint64_t);
2783 };
2784 static struct __pyx_vtabstruct_2yt_9utilities_3lib_8bitarray_bitarray *__pyx_vtabptr_2yt_9utilities_3lib_8bitarray_bitarray;
2785 
2786 
2787 /* "yt/geometry/grid_container.pyx":49
2788  *     return node
2789  *
2790  * cdef class GridTree:             # <<<<<<<<<<<<<<
2791  *
2792  *     @cython.boundscheck(False)
2793  */
2794 
2795 struct __pyx_vtabstruct_2yt_8geometry_14grid_container_GridTree {
2796   void (*setup_data)(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *, struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *);
2797   void (*visit_grids)(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *, struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *, __pyx_t_2yt_8geometry_13grid_visitors_grid_visitor_function *, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *);
2798   void (*recursively_visit_grid)(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *, struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *, __pyx_t_2yt_8geometry_13grid_visitors_grid_visitor_function *, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode *, struct __pyx_opt_args_2yt_8geometry_14grid_container_8GridTree_recursively_visit_grid *__pyx_optional_args);
2799 };
2800 static struct __pyx_vtabstruct_2yt_8geometry_14grid_container_GridTree *__pyx_vtabptr_2yt_8geometry_14grid_container_GridTree;
2801 
2802 
2803 /* "yt/geometry/grid_container.pyx":269
2804  *         return fwidth
2805  *
2806  * cdef class MatchPointsToGrids:             # <<<<<<<<<<<<<<
2807  *
2808  *     @cython.boundscheck(False)
2809  */
2810 
2811 struct __pyx_vtabstruct_2yt_8geometry_14grid_container_MatchPointsToGrids {
2812   __pyx_t_5numpy_uint8_t (*check_position)(struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode *);
2813   __pyx_t_5numpy_uint8_t (*is_in_grid)(struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode *);
2814 };
2815 static struct __pyx_vtabstruct_2yt_8geometry_14grid_container_MatchPointsToGrids *__pyx_vtabptr_2yt_8geometry_14grid_container_MatchPointsToGrids;
2816 
2817 
2818 /* "View.MemoryView":105
2819  *
2820  * @cname("__pyx_array")
2821  * cdef class array:             # <<<<<<<<<<<<<<
2822  *
2823  *     cdef:
2824  */
2825 
2826 struct __pyx_vtabstruct_array {
2827   PyObject *(*get_memview)(struct __pyx_array_obj *);
2828 };
2829 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
2830 
2831 
2832 /* "View.MemoryView":330
2833  *
2834  * @cname('__pyx_memoryview')
2835  * cdef class memoryview(object):             # <<<<<<<<<<<<<<
2836  *
2837  *     cdef object obj
2838  */
2839 
2840 struct __pyx_vtabstruct_memoryview {
2841   char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
2842   PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
2843   PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
2844   PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
2845   PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
2846   PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
2847   PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
2848 };
2849 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
2850 
2851 
2852 /* "View.MemoryView":961
2853  *
2854  * @cname('__pyx_memoryviewslice')
2855  * cdef class _memoryviewslice(memoryview):             # <<<<<<<<<<<<<<
2856  *     "Internal class for passing memoryview slices to Python"
2857  *
2858  */
2859 
2860 struct __pyx_vtabstruct__memoryviewslice {
2861   struct __pyx_vtabstruct_memoryview __pyx_base;
2862 };
2863 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
2864 
2865 /* --- Runtime support code (head) --- */
2866 /* Refnanny.proto */
2867 #ifndef CYTHON_REFNANNY
2868   #define CYTHON_REFNANNY 0
2869 #endif
2870 #if CYTHON_REFNANNY
2871   typedef struct {
2872     void (*INCREF)(void*, PyObject*, int);
2873     void (*DECREF)(void*, PyObject*, int);
2874     void (*GOTREF)(void*, PyObject*, int);
2875     void (*GIVEREF)(void*, PyObject*, int);
2876     void* (*SetupContext)(const char*, int, const char*);
2877     void (*FinishContext)(void**);
2878   } __Pyx_RefNannyAPIStruct;
2879   static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
2880   static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
2881   #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
2882 #ifdef WITH_THREAD
2883   #define __Pyx_RefNannySetupContext(name, acquire_gil)\
2884           if (acquire_gil) {\
2885               PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2886               __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
2887               PyGILState_Release(__pyx_gilstate_save);\
2888           } else {\
2889               __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
2890           }
2891 #else
2892   #define __Pyx_RefNannySetupContext(name, acquire_gil)\
2893           __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
2894 #endif
2895   #define __Pyx_RefNannyFinishContext()\
2896           __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
2897   #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
2898   #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
2899   #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
2900   #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
2901   #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
2902   #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
2903   #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
2904   #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
2905 #else
2906   #define __Pyx_RefNannyDeclarations
2907   #define __Pyx_RefNannySetupContext(name, acquire_gil)
2908   #define __Pyx_RefNannyFinishContext()
2909   #define __Pyx_INCREF(r) Py_INCREF(r)
2910   #define __Pyx_DECREF(r) Py_DECREF(r)
2911   #define __Pyx_GOTREF(r)
2912   #define __Pyx_GIVEREF(r)
2913   #define __Pyx_XINCREF(r) Py_XINCREF(r)
2914   #define __Pyx_XDECREF(r) Py_XDECREF(r)
2915   #define __Pyx_XGOTREF(r)
2916   #define __Pyx_XGIVEREF(r)
2917 #endif
2918 #define __Pyx_XDECREF_SET(r, v) do {\
2919         PyObject *tmp = (PyObject *) r;\
2920         r = v; __Pyx_XDECREF(tmp);\
2921     } while (0)
2922 #define __Pyx_DECREF_SET(r, v) do {\
2923         PyObject *tmp = (PyObject *) r;\
2924         r = v; __Pyx_DECREF(tmp);\
2925     } while (0)
2926 #define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
2927 #define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
2928 
2929 /* PyObjectGetAttrStr.proto */
2930 #if CYTHON_USE_TYPE_SLOTS
2931 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
2932 #else
2933 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
2934 #endif
2935 
2936 /* GetBuiltinName.proto */
2937 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
2938 
2939 /* IsLittleEndian.proto */
2940 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
2941 
2942 /* BufferFormatCheck.proto */
2943 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
2944 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2945                               __Pyx_BufFmt_StackElem* stack,
2946                               __Pyx_TypeInfo* type);
2947 
2948 /* BufferGetAndValidate.proto */
2949 #define __Pyx_GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)\
2950     ((obj == Py_None || obj == NULL) ?\
2951     (__Pyx_ZeroBuffer(buf), 0) :\
2952     __Pyx__GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack))
2953 static int  __Pyx__GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
2954     __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
2955 static void __Pyx_ZeroBuffer(Py_buffer* buf);
2956 static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);
2957 static Py_ssize_t __Pyx_minusones[] = { -1, -1, -1, -1, -1, -1, -1, -1 };
2958 static Py_ssize_t __Pyx_zeros[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
2959 
2960 #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
2961 /* PyThreadStateGet.proto */
2962 #if CYTHON_FAST_THREAD_STATE
2963 #define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
2964 #define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
2965 #define __Pyx_PyErr_Occurred()  __pyx_tstate->curexc_type
2966 #else
2967 #define __Pyx_PyThreadState_declare
2968 #define __Pyx_PyThreadState_assign
2969 #define __Pyx_PyErr_Occurred()  PyErr_Occurred()
2970 #endif
2971 
2972 /* PyErrFetchRestore.proto */
2973 #if CYTHON_FAST_THREAD_STATE
2974 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
2975 #define __Pyx_ErrRestoreWithState(type, value, tb)  __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
2976 #define __Pyx_ErrFetchWithState(type, value, tb)    __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
2977 #define __Pyx_ErrRestore(type, value, tb)  __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
2978 #define __Pyx_ErrFetch(type, value, tb)    __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
2979 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2980 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2981 #if CYTHON_COMPILING_IN_CPYTHON
2982 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
2983 #else
2984 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2985 #endif
2986 #else
2987 #define __Pyx_PyErr_Clear() PyErr_Clear()
2988 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2989 #define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
2990 #define __Pyx_ErrFetchWithState(type, value, tb)  PyErr_Fetch(type, value, tb)
2991 #define __Pyx_ErrRestoreInState(tstate, type, value, tb)  PyErr_Restore(type, value, tb)
2992 #define __Pyx_ErrFetchInState(tstate, type, value, tb)  PyErr_Fetch(type, value, tb)
2993 #define __Pyx_ErrRestore(type, value, tb)  PyErr_Restore(type, value, tb)
2994 #define __Pyx_ErrFetch(type, value, tb)  PyErr_Fetch(type, value, tb)
2995 #endif
2996 
2997 /* WriteUnraisableException.proto */
2998 static void __Pyx_WriteUnraisable(const char *name, int clineno,
2999                                   int lineno, const char *filename,
3000                                   int full_traceback, int nogil);
3001 
3002 /* RaiseArgTupleInvalid.proto */
3003 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
3004     Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
3005 
3006 /* RaiseDoubleKeywords.proto */
3007 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
3008 
3009 /* ParseKeywords.proto */
3010 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
3011     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
3012     const char* function_name);
3013 
3014 /* ArgTypeTest.proto */
3015 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
3016     ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
3017         __Pyx__ArgTypeTest(obj, type, name, exact))
3018 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
3019 
3020 /* PyDictVersioning.proto */
3021 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
3022 #define __PYX_DICT_VERSION_INIT  ((PY_UINT64_T) -1)
3023 #define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
3024 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
3025     (version_var) = __PYX_GET_DICT_VERSION(dict);\
3026     (cache_var) = (value);
3027 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
3028     static PY_UINT64_T __pyx_dict_version = 0;\
3029     static PyObject *__pyx_dict_cached_value = NULL;\
3030     if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
3031         (VAR) = __pyx_dict_cached_value;\
3032     } else {\
3033         (VAR) = __pyx_dict_cached_value = (LOOKUP);\
3034         __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
3035     }\
3036 }
3037 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
3038 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
3039 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
3040 #else
3041 #define __PYX_GET_DICT_VERSION(dict)  (0)
3042 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
3043 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP)  (VAR) = (LOOKUP);
3044 #endif
3045 
3046 /* GetModuleGlobalName.proto */
3047 #if CYTHON_USE_DICT_VERSIONS
3048 #define __Pyx_GetModuleGlobalName(var, name)  {\
3049     static PY_UINT64_T __pyx_dict_version = 0;\
3050     static PyObject *__pyx_dict_cached_value = NULL;\
3051     (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
3052         (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
3053         __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
3054 }
3055 #define __Pyx_GetModuleGlobalNameUncached(var, name)  {\
3056     PY_UINT64_T __pyx_dict_version;\
3057     PyObject *__pyx_dict_cached_value;\
3058     (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
3059 }
3060 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
3061 #else
3062 #define __Pyx_GetModuleGlobalName(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
3063 #define __Pyx_GetModuleGlobalNameUncached(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
3064 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
3065 #endif
3066 
3067 /* PyObjectCall.proto */
3068 #if CYTHON_COMPILING_IN_CPYTHON
3069 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
3070 #else
3071 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
3072 #endif
3073 
3074 /* ExtTypeTest.proto */
3075 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
3076 
3077 /* BufferFallbackError.proto */
3078 static void __Pyx_RaiseBufferFallbackError(void);
3079 
3080 /* GetItemInt.proto */
3081 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
3082     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
3083     __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
3084     (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
3085                __Pyx_GetItemInt_Generic(o, to_py_func(i))))
3086 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
3087     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
3088     __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
3089     (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
3090 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
3091                                                               int wraparound, int boundscheck);
3092 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
3093     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
3094     __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
3095     (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
3096 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
3097                                                               int wraparound, int boundscheck);
3098 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
3099 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
3100                                                      int is_list, int wraparound, int boundscheck);
3101 
3102 /* ObjectGetItem.proto */
3103 #if CYTHON_USE_TYPE_SLOTS
3104 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
3105 #else
3106 #define __Pyx_PyObject_GetItem(obj, key)  PyObject_GetItem(obj, key)
3107 #endif
3108 
3109 /* RaiseException.proto */
3110 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
3111 
3112 /* KeywordStringCheck.proto */
3113 static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);
3114 
3115 /* ListAppend.proto */
3116 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
__Pyx_PyList_Append(PyObject * list,PyObject * x)3117 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
3118     PyListObject* L = (PyListObject*) list;
3119     Py_ssize_t len = Py_SIZE(list);
3120     if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
3121         Py_INCREF(x);
3122         PyList_SET_ITEM(list, len, x);
3123         Py_SIZE(list) = len+1;
3124         return 0;
3125     }
3126     return PyList_Append(list, x);
3127 }
3128 #else
3129 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
3130 #endif
3131 
3132 /* PyCFunctionFastCall.proto */
3133 #if CYTHON_FAST_PYCCALL
3134 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
3135 #else
3136 #define __Pyx_PyCFunction_FastCall(func, args, nargs)  (assert(0), NULL)
3137 #endif
3138 
3139 /* PyFunctionFastCall.proto */
3140 #if CYTHON_FAST_PYCALL
3141 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
3142     __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
3143 #if 1 || PY_VERSION_HEX < 0x030600B1
3144 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
3145 #else
3146 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
3147 #endif
3148 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
3149     (sizeof(char [1 - 2*!(cond)]) - 1)
3150 #ifndef Py_MEMBER_SIZE
3151 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
3152 #endif
3153   static size_t __pyx_pyframe_localsplus_offset = 0;
3154   #include "frameobject.h"
3155   #define __Pxy_PyFrame_Initialize_Offsets()\
3156     ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
3157      (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
3158   #define __Pyx_PyFrame_GetLocalsplus(frame)\
3159     (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
3160 #endif
3161 
3162 /* PyObjectCall2Args.proto */
3163 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
3164 
3165 /* PyObjectCallMethO.proto */
3166 #if CYTHON_COMPILING_IN_CPYTHON
3167 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
3168 #endif
3169 
3170 /* PyObjectCallOneArg.proto */
3171 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
3172 
3173 /* RaiseTooManyValuesToUnpack.proto */
3174 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
3175 
3176 /* RaiseNeedMoreValuesToUnpack.proto */
3177 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
3178 
3179 /* IterFinish.proto */
3180 static CYTHON_INLINE int __Pyx_IterFinish(void);
3181 
3182 /* UnpackItemEndCheck.proto */
3183 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
3184 
3185 /* SliceObject.proto */
3186 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
3187         PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
3188         PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
3189         int has_cstart, int has_cstop, int wraparound);
3190 
3191 /* MemviewSliceInit.proto */
3192 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
3193 #define __Pyx_MEMVIEW_DIRECT   1
3194 #define __Pyx_MEMVIEW_PTR      2
3195 #define __Pyx_MEMVIEW_FULL     4
3196 #define __Pyx_MEMVIEW_CONTIG   8
3197 #define __Pyx_MEMVIEW_STRIDED  16
3198 #define __Pyx_MEMVIEW_FOLLOW   32
3199 #define __Pyx_IS_C_CONTIG 1
3200 #define __Pyx_IS_F_CONTIG 2
3201 static int __Pyx_init_memviewslice(
3202                 struct __pyx_memoryview_obj *memview,
3203                 int ndim,
3204                 __Pyx_memviewslice *memviewslice,
3205                 int memview_is_new_reference);
3206 static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
3207     __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
3208 static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
3209     __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
3210 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
3211 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
3212 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
3213 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
3214 static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
3215 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
3216 
3217 /* DictGetItem.proto */
3218 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
3219 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
3220 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
3221     (likely(PyDict_CheckExact(obj)) ?\
3222      __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
3223 #else
3224 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
3225 #define __Pyx_PyObject_Dict_GetItem(obj, name)  PyObject_GetItem(obj, name)
3226 #endif
3227 
3228 /* RaiseNoneIterError.proto */
3229 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
3230 
3231 /* GetTopmostException.proto */
3232 #if CYTHON_USE_EXC_INFO_STACK
3233 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
3234 #endif
3235 
3236 /* SaveResetException.proto */
3237 #if CYTHON_FAST_THREAD_STATE
3238 #define __Pyx_ExceptionSave(type, value, tb)  __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
3239 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
3240 #define __Pyx_ExceptionReset(type, value, tb)  __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
3241 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
3242 #else
3243 #define __Pyx_ExceptionSave(type, value, tb)   PyErr_GetExcInfo(type, value, tb)
3244 #define __Pyx_ExceptionReset(type, value, tb)  PyErr_SetExcInfo(type, value, tb)
3245 #endif
3246 
3247 /* PyErrExceptionMatches.proto */
3248 #if CYTHON_FAST_THREAD_STATE
3249 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
3250 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
3251 #else
3252 #define __Pyx_PyErr_ExceptionMatches(err)  PyErr_ExceptionMatches(err)
3253 #endif
3254 
3255 /* GetException.proto */
3256 #if CYTHON_FAST_THREAD_STATE
3257 #define __Pyx_GetException(type, value, tb)  __Pyx__GetException(__pyx_tstate, type, value, tb)
3258 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
3259 #else
3260 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
3261 #endif
3262 
3263 /* GetAttr.proto */
3264 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
3265 
3266 /* HasAttr.proto */
3267 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
3268 
3269 /* IncludeStringH.proto */
3270 #include <string.h>
3271 
3272 /* BytesEquals.proto */
3273 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
3274 
3275 /* UnicodeEquals.proto */
3276 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
3277 
3278 /* StrEquals.proto */
3279 #if PY_MAJOR_VERSION >= 3
3280 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
3281 #else
3282 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
3283 #endif
3284 
3285 /* BufferIndexError.proto */
3286 static void __Pyx_RaiseBufferIndexError(int axis);
3287 
3288 /* None.proto */
3289 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
3290 
3291 /* UnaryNegOverflows.proto */
3292 #define UNARY_NEG_WOULD_OVERFLOW(x)\
3293         (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
3294 
3295 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
3296 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
3297 /* decode_c_string_utf16.proto */
__Pyx_PyUnicode_DecodeUTF16(const char * s,Py_ssize_t size,const char * errors)3298 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
3299     int byteorder = 0;
3300     return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
3301 }
__Pyx_PyUnicode_DecodeUTF16LE(const char * s,Py_ssize_t size,const char * errors)3302 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
3303     int byteorder = -1;
3304     return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
3305 }
__Pyx_PyUnicode_DecodeUTF16BE(const char * s,Py_ssize_t size,const char * errors)3306 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
3307     int byteorder = 1;
3308     return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
3309 }
3310 
3311 /* decode_c_string.proto */
3312 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
3313          const char* cstring, Py_ssize_t start, Py_ssize_t stop,
3314          const char* encoding, const char* errors,
3315          PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
3316 
3317 /* GetAttr3.proto */
3318 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
3319 
3320 /* SwapException.proto */
3321 #if CYTHON_FAST_THREAD_STATE
3322 #define __Pyx_ExceptionSwap(type, value, tb)  __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
3323 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
3324 #else
3325 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
3326 #endif
3327 
3328 /* Import.proto */
3329 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
3330 
3331 /* FastTypeChecks.proto */
3332 #if CYTHON_COMPILING_IN_CPYTHON
3333 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
3334 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
3335 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
3336 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
3337 #else
3338 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
3339 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
3340 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
3341 #endif
3342 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
3343 
3344 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
3345 /* ListCompAppend.proto */
3346 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
__Pyx_ListComp_Append(PyObject * list,PyObject * x)3347 static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
3348     PyListObject* L = (PyListObject*) list;
3349     Py_ssize_t len = Py_SIZE(list);
3350     if (likely(L->allocated > len)) {
3351         Py_INCREF(x);
3352         PyList_SET_ITEM(list, len, x);
3353         Py_SIZE(list) = len+1;
3354         return 0;
3355     }
3356     return PyList_Append(list, x);
3357 }
3358 #else
3359 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
3360 #endif
3361 
3362 /* PyIntBinop.proto */
3363 #if !CYTHON_COMPILING_IN_PYPY
3364 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
3365 #else
3366 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
3367     (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
3368 #endif
3369 
3370 /* ListExtend.proto */
__Pyx_PyList_Extend(PyObject * L,PyObject * v)3371 static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
3372 #if CYTHON_COMPILING_IN_CPYTHON
3373     PyObject* none = _PyList_Extend((PyListObject*)L, v);
3374     if (unlikely(!none))
3375         return -1;
3376     Py_DECREF(none);
3377     return 0;
3378 #else
3379     return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
3380 #endif
3381 }
3382 
3383 /* None.proto */
3384 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
3385 
3386 /* None.proto */
3387 static CYTHON_INLINE long __Pyx_div_long(long, long);
3388 
3389 /* ImportFrom.proto */
3390 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
3391 
3392 /* StringJoin.proto */
3393 #if PY_MAJOR_VERSION < 3
3394 #define __Pyx_PyString_Join __Pyx_PyBytes_Join
3395 #define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v))
3396 #else
3397 #define __Pyx_PyString_Join PyUnicode_Join
3398 #define __Pyx_PyBaseString_Join PyUnicode_Join
3399 #endif
3400 #if CYTHON_COMPILING_IN_CPYTHON
3401     #if PY_MAJOR_VERSION < 3
3402     #define __Pyx_PyBytes_Join _PyString_Join
3403     #else
3404     #define __Pyx_PyBytes_Join _PyBytes_Join
3405     #endif
3406 #else
3407 static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values);
3408 #endif
3409 
3410 /* PyObject_Unicode.proto */
3411 #if PY_MAJOR_VERSION >= 3
3412 #define __Pyx_PyObject_Unicode(obj)\
3413     (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj))
3414 #else
3415 #define __Pyx_PyObject_Unicode(obj)\
3416     (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Unicode(obj))
3417 #endif
3418 
3419 /* PyObject_GenericGetAttrNoDict.proto */
3420 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
3421 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
3422 #else
3423 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
3424 #endif
3425 
3426 /* PyObject_GenericGetAttr.proto */
3427 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
3428 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
3429 #else
3430 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
3431 #endif
3432 
3433 /* SetVTable.proto */
3434 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
3435 
3436 /* SetupReduce.proto */
3437 static int __Pyx_setup_reduce(PyObject* type_obj);
3438 
3439 /* TypeImport.proto */
3440 #ifndef __PYX_HAVE_RT_ImportType_proto
3441 #define __PYX_HAVE_RT_ImportType_proto
3442 enum __Pyx_ImportType_CheckSize {
3443    __Pyx_ImportType_CheckSize_Error = 0,
3444    __Pyx_ImportType_CheckSize_Warn = 1,
3445    __Pyx_ImportType_CheckSize_Ignore = 2
3446 };
3447 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
3448 #endif
3449 
3450 /* GetVTable.proto */
3451 static void* __Pyx_GetVtable(PyObject *dict);
3452 
3453 /* CLineInTraceback.proto */
3454 #ifdef CYTHON_CLINE_IN_TRACEBACK
3455 #define __Pyx_CLineForTraceback(tstate, c_line)  (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
3456 #else
3457 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
3458 #endif
3459 
3460 /* CodeObjectCache.proto */
3461 typedef struct {
3462     PyCodeObject* code_object;
3463     int code_line;
3464 } __Pyx_CodeObjectCacheEntry;
3465 struct __Pyx_CodeObjectCache {
3466     int count;
3467     int max_count;
3468     __Pyx_CodeObjectCacheEntry* entries;
3469 };
3470 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
3471 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
3472 static PyCodeObject *__pyx_find_code_object(int code_line);
3473 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
3474 
3475 /* AddTraceback.proto */
3476 static void __Pyx_AddTraceback(const char *funcname, int c_line,
3477                                int py_line, const char *filename);
3478 
3479 #if PY_MAJOR_VERSION < 3
3480     static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
3481     static void __Pyx_ReleaseBuffer(Py_buffer *view);
3482 #else
3483     #define __Pyx_GetBuffer PyObject_GetBuffer
3484     #define __Pyx_ReleaseBuffer PyBuffer_Release
3485 #endif
3486 
3487 
3488 /* BufferStructDeclare.proto */
3489 typedef struct {
3490   Py_ssize_t shape, strides, suboffsets;
3491 } __Pyx_Buf_DimInfo;
3492 typedef struct {
3493   size_t refcount;
3494   Py_buffer pybuffer;
3495 } __Pyx_Buffer;
3496 typedef struct {
3497   __Pyx_Buffer *rcbuffer;
3498   char *data;
3499   __Pyx_Buf_DimInfo diminfo[8];
3500 } __Pyx_LocalBuf_ND;
3501 
3502 /* MemviewSliceIsContig.proto */
3503 static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
3504 
3505 /* OverlappingSlices.proto */
3506 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
3507                                 __Pyx_memviewslice *slice2,
3508                                 int ndim, size_t itemsize);
3509 
3510 /* Capsule.proto */
3511 static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
3512 
3513 /* CIntToPy.proto */
3514 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
3515 
3516 /* CIntToPy.proto */
3517 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value);
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_long(npy_long value);
3524 
3525 struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded;
3526 static PyObject* __pyx_convert__to_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded(struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded s);
3527 /* MemviewDtypeToObject.proto */
3528 static CYTHON_INLINE PyObject *__pyx_memview_get_nn_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded(const char *itemp);
3529 static CYTHON_INLINE int __pyx_memview_set_nn_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded(const char *itemp, PyObject *obj);
3530 
3531 /* CIntToPy.proto */
3532 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint64(npy_uint64 value);
3533 
3534 /* RealImag.proto */
3535 #if CYTHON_CCOMPLEX
3536   #ifdef __cplusplus
3537     #define __Pyx_CREAL(z) ((z).real())
3538     #define __Pyx_CIMAG(z) ((z).imag())
3539   #else
3540     #define __Pyx_CREAL(z) (__real__(z))
3541     #define __Pyx_CIMAG(z) (__imag__(z))
3542   #endif
3543 #else
3544     #define __Pyx_CREAL(z) ((z).real)
3545     #define __Pyx_CIMAG(z) ((z).imag)
3546 #endif
3547 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
3548         && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
3549     #define __Pyx_SET_CREAL(z,x) ((z).real(x))
3550     #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
3551 #else
3552     #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
3553     #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
3554 #endif
3555 
3556 /* Arithmetic.proto */
3557 #if CYTHON_CCOMPLEX
3558     #define __Pyx_c_eq_float(a, b)   ((a)==(b))
3559     #define __Pyx_c_sum_float(a, b)  ((a)+(b))
3560     #define __Pyx_c_diff_float(a, b) ((a)-(b))
3561     #define __Pyx_c_prod_float(a, b) ((a)*(b))
3562     #define __Pyx_c_quot_float(a, b) ((a)/(b))
3563     #define __Pyx_c_neg_float(a)     (-(a))
3564   #ifdef __cplusplus
3565     #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
3566     #define __Pyx_c_conj_float(z)    (::std::conj(z))
3567     #if 1
3568         #define __Pyx_c_abs_float(z)     (::std::abs(z))
3569         #define __Pyx_c_pow_float(a, b)  (::std::pow(a, b))
3570     #endif
3571   #else
3572     #define __Pyx_c_is_zero_float(z) ((z)==0)
3573     #define __Pyx_c_conj_float(z)    (conjf(z))
3574     #if 1
3575         #define __Pyx_c_abs_float(z)     (cabsf(z))
3576         #define __Pyx_c_pow_float(a, b)  (cpowf(a, b))
3577     #endif
3578  #endif
3579 #else
3580     static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
3581     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
3582     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
3583     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
3584     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
3585     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
3586     static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
3587     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
3588     #if 1
3589         static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
3590         static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
3591     #endif
3592 #endif
3593 
3594 /* Arithmetic.proto */
3595 #if CYTHON_CCOMPLEX
3596     #define __Pyx_c_eq_double(a, b)   ((a)==(b))
3597     #define __Pyx_c_sum_double(a, b)  ((a)+(b))
3598     #define __Pyx_c_diff_double(a, b) ((a)-(b))
3599     #define __Pyx_c_prod_double(a, b) ((a)*(b))
3600     #define __Pyx_c_quot_double(a, b) ((a)/(b))
3601     #define __Pyx_c_neg_double(a)     (-(a))
3602   #ifdef __cplusplus
3603     #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
3604     #define __Pyx_c_conj_double(z)    (::std::conj(z))
3605     #if 1
3606         #define __Pyx_c_abs_double(z)     (::std::abs(z))
3607         #define __Pyx_c_pow_double(a, b)  (::std::pow(a, b))
3608     #endif
3609   #else
3610     #define __Pyx_c_is_zero_double(z) ((z)==0)
3611     #define __Pyx_c_conj_double(z)    (conj(z))
3612     #if 1
3613         #define __Pyx_c_abs_double(z)     (cabs(z))
3614         #define __Pyx_c_pow_double(a, b)  (cpow(a, b))
3615     #endif
3616  #endif
3617 #else
3618     static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
3619     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
3620     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
3621     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
3622     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
3623     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
3624     static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
3625     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
3626     #if 1
3627         static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
3628         static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
3629     #endif
3630 #endif
3631 
3632 /* CIntToPy.proto */
3633 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value);
3634 
3635 /* MemviewSliceCopyTemplate.proto */
3636 static __Pyx_memviewslice
3637 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
3638                                  const char *mode, int ndim,
3639                                  size_t sizeof_dtype, int contig_flag,
3640                                  int dtype_is_object);
3641 
3642 /* TypeInfoToFormat.proto */
3643 struct __pyx_typeinfo_string {
3644     char string[3];
3645 };
3646 static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type);
3647 
3648 /* CIntFromPy.proto */
3649 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
3650 
3651 /* CIntFromPy.proto */
3652 static CYTHON_INLINE npy_uint64 __Pyx_PyInt_As_npy_uint64(PyObject *);
3653 
3654 /* CIntFromPy.proto */
3655 static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *);
3656 
3657 /* CIntFromPy.proto */
3658 static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *);
3659 
3660 /* CIntFromPy.proto */
3661 static CYTHON_INLINE npy_long __Pyx_PyInt_As_npy_long(PyObject *);
3662 
3663 /* CIntFromPy.proto */
3664 static CYTHON_INLINE npy_uint32 __Pyx_PyInt_As_npy_uint32(PyObject *);
3665 
3666 /* CIntFromPy.proto */
3667 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
3668 
3669 /* CIntToPy.proto */
3670 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
3671 
3672 /* CIntFromPy.proto */
3673 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
3674 
3675 /* FetchCommonType.proto */
3676 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
3677 
3678 /* PyObjectGetMethod.proto */
3679 static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
3680 
3681 /* PyObjectCallMethod1.proto */
3682 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
3683 
3684 /* CoroutineBase.proto */
3685 typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyThreadState *, PyObject *);
3686 #if CYTHON_USE_EXC_INFO_STACK
3687 #define __Pyx_ExcInfoStruct  _PyErr_StackItem
3688 #else
3689 typedef struct {
3690     PyObject *exc_type;
3691     PyObject *exc_value;
3692     PyObject *exc_traceback;
3693 } __Pyx_ExcInfoStruct;
3694 #endif
3695 typedef struct {
3696     PyObject_HEAD
3697     __pyx_coroutine_body_t body;
3698     PyObject *closure;
3699     __Pyx_ExcInfoStruct gi_exc_state;
3700     PyObject *gi_weakreflist;
3701     PyObject *classobj;
3702     PyObject *yieldfrom;
3703     PyObject *gi_name;
3704     PyObject *gi_qualname;
3705     PyObject *gi_modulename;
3706     PyObject *gi_code;
3707     int resume_label;
3708     char is_running;
3709 } __pyx_CoroutineObject;
3710 static __pyx_CoroutineObject *__Pyx__Coroutine_New(
3711     PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
3712     PyObject *name, PyObject *qualname, PyObject *module_name);
3713 static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
3714             __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
3715             PyObject *name, PyObject *qualname, PyObject *module_name);
3716 static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self);
3717 static int __Pyx_Coroutine_clear(PyObject *self);
3718 static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value);
3719 static PyObject *__Pyx_Coroutine_Close(PyObject *self);
3720 static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
3721 #if CYTHON_USE_EXC_INFO_STACK
3722 #define __Pyx_Coroutine_SwapException(self)
3723 #define __Pyx_Coroutine_ResetAndClearException(self)  __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state)
3724 #else
3725 #define __Pyx_Coroutine_SwapException(self) {\
3726     __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\
3727     __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\
3728     }
3729 #define __Pyx_Coroutine_ResetAndClearException(self) {\
3730     __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\
3731     (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\
3732     }
3733 #endif
3734 #if CYTHON_FAST_THREAD_STATE
3735 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
3736     __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue)
3737 #else
3738 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
3739     __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue)
3740 #endif
3741 static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue);
3742 static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state);
3743 
3744 /* PatchModuleWithCoroutine.proto */
3745 static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code);
3746 
3747 /* PatchGeneratorABC.proto */
3748 static int __Pyx_patch_abc(void);
3749 
3750 /* Generator.proto */
3751 #define __Pyx_Generator_USED
3752 static PyTypeObject *__pyx_GeneratorType = 0;
3753 #define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType)
3754 #define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\
3755     __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name)
3756 static PyObject *__Pyx_Generator_Next(PyObject *self);
3757 static int __pyx_Generator_init(void);
3758 
3759 /* TypeInfoCompare.proto */
3760 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
3761 
3762 /* MemviewSliceValidateAndInit.proto */
3763 static int __Pyx_ValidateAndInit_memviewslice(
3764                 int *axes_specs,
3765                 int c_or_f_flag,
3766                 int buf_flags,
3767                 int ndim,
3768                 __Pyx_TypeInfo *dtype,
3769                 __Pyx_BufFmt_StackElem stack[],
3770                 __Pyx_memviewslice *memviewslice,
3771                 PyObject *original_obj);
3772 
3773 /* ObjectToMemviewSlice.proto */
3774 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded(PyObject *, int writable_flag);
3775 
3776 /* CheckBinaryVersion.proto */
3777 static int __Pyx_check_binary_version(void);
3778 
3779 /* VoidPtrImport.proto */
3780 static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig);
3781 
3782 /* FunctionImport.proto */
3783 static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig);
3784 
3785 /* InitStrings.proto */
3786 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
3787 
3788 static void __pyx_f_2yt_8geometry_14grid_container_8GridTree_setup_data(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *__pyx_v_self, struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *__pyx_v_data); /* proto*/
3789 static void __pyx_f_2yt_8geometry_14grid_container_8GridTree_visit_grids(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *__pyx_v_self, struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *__pyx_v_data, __pyx_t_2yt_8geometry_13grid_visitors_grid_visitor_function *__pyx_v_func, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector); /* proto*/
3790 static void __pyx_f_2yt_8geometry_14grid_container_8GridTree_recursively_visit_grid(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *__pyx_v_self, struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *__pyx_v_data, __pyx_t_2yt_8geometry_13grid_visitors_grid_visitor_function *__pyx_v_func, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode *__pyx_v_grid, struct __pyx_opt_args_2yt_8geometry_14grid_container_8GridTree_recursively_visit_grid *__pyx_optional_args); /* proto*/
3791 static __pyx_t_5numpy_uint8_t __pyx_f_2yt_8geometry_14grid_container_18MatchPointsToGrids_check_position(struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_pt_index, __pyx_t_5numpy_float64_t __pyx_v_x, __pyx_t_5numpy_float64_t __pyx_v_y, __pyx_t_5numpy_float64_t __pyx_v_z, struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode *__pyx_v_grid); /* proto*/
3792 static __pyx_t_5numpy_uint8_t __pyx_f_2yt_8geometry_14grid_container_18MatchPointsToGrids_is_in_grid(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_x, __pyx_t_5numpy_float64_t __pyx_v_y, __pyx_t_5numpy_float64_t __pyx_v_z, struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode *__pyx_v_grid); /* proto*/
3793 static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_oind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self); /* proto*/
3794 static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_rind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self); /* proto*/
3795 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*/
3796 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*/
3797 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
3798 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
3799 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
3800 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
3801 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*/
3802 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
3803 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
3804 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
3805 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
3806 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
3807 
3808 /* Module declarations from 'cython.view' */
3809 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
3810 
3811 /* Module declarations from 'cython' */
3812 
3813 /* Module declarations from 'cpython.buffer' */
3814 
3815 /* Module declarations from 'libc.string' */
3816 
3817 /* Module declarations from 'libc.stdio' */
3818 
3819 /* Module declarations from '__builtin__' */
3820 
3821 /* Module declarations from 'cpython.type' */
3822 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
3823 
3824 /* Module declarations from 'cpython' */
3825 
3826 /* Module declarations from 'cpython.object' */
3827 
3828 /* Module declarations from 'cpython.ref' */
3829 
3830 /* Module declarations from 'cpython.mem' */
3831 
3832 /* Module declarations from 'numpy' */
3833 
3834 /* Module declarations from 'numpy' */
3835 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
3836 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
3837 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
3838 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
3839 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
3840 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
3841 
3842 /* Module declarations from 'yt.geometry.grid_visitors' */
3843 static void (*__pyx_f_2yt_8geometry_13grid_visitors_free_tuples)(struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *); /*proto*/
3844 static void (*__pyx_f_2yt_8geometry_13grid_visitors_setup_tuples)(struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *); /*proto*/
3845 static __pyx_t_5numpy_uint8_t (*__pyx_f_2yt_8geometry_13grid_visitors_check_child_masked)(struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *); /*proto*/
3846 static __pyx_t_2yt_8geometry_13grid_visitors_grid_visitor_function *__pyx_f_2yt_8geometry_13grid_visitors_count_cells; /*proto*/
3847 static __pyx_t_2yt_8geometry_13grid_visitors_grid_visitor_function *__pyx_f_2yt_8geometry_13grid_visitors_mask_cells; /*proto*/
3848 static __pyx_t_2yt_8geometry_13grid_visitors_grid_visitor_function *__pyx_f_2yt_8geometry_13grid_visitors_icoords_cells; /*proto*/
3849 static __pyx_t_2yt_8geometry_13grid_visitors_grid_visitor_function *__pyx_f_2yt_8geometry_13grid_visitors_ires_cells; /*proto*/
3850 static __pyx_t_2yt_8geometry_13grid_visitors_grid_visitor_function *__pyx_f_2yt_8geometry_13grid_visitors_fcoords_cells; /*proto*/
3851 static __pyx_t_2yt_8geometry_13grid_visitors_grid_visitor_function *__pyx_f_2yt_8geometry_13grid_visitors_fwidth_cells; /*proto*/
3852 
3853 /* Module declarations from 'libc.stdlib' */
3854 
3855 /* Module declarations from 'yt.geometry.oct_visitors' */
3856 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor = 0;
3857 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalOcts = 0;
3858 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalCells = 0;
3859 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_MarkOcts = 0;
3860 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_MaskOcts = 0;
3861 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_IndexOcts = 0;
3862 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_MaskedIndexOcts = 0;
3863 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_IndexMaskMapOcts = 0;
3864 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_ICoordsOcts = 0;
3865 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_IResOcts = 0;
3866 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_FCoordsOcts = 0;
3867 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_FWidthOcts = 0;
3868 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_CopyArrayI64 = 0;
3869 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_CopyArrayF64 = 0;
3870 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_CopyFileIndArrayI8 = 0;
3871 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_IdentifyOcts = 0;
3872 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_AssignDomainInd = 0;
3873 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_FillFileIndicesO = 0;
3874 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_FillFileIndicesR = 0;
3875 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_CountByDomain = 0;
3876 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_StoreOctree = 0;
3877 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_LoadOctree = 0;
3878 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_MortonIndexOcts = 0;
3879 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_StoreIndex = 0;
3880 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor = 0;
3881 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_NeighbourCellIndexVisitor = 0;
3882 static PyTypeObject *__pyx_ptype_2yt_8geometry_12oct_visitors_NeighbourCellVisitor = 0;
3883 static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_cind(int, int, int); /*proto*/
3884 
3885 /* Module declarations from 'libc.math' */
3886 
3887 /* Module declarations from 'yt.utilities.lib.allocation_container' */
3888 static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool = 0;
3889 
3890 /* Module declarations from 'yt.utilities.lib.fp_utils' */
3891 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*/
3892 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*/
3893 static CYTHON_INLINE __pyx_t_5numpy_int64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /*proto*/
3894 static CYTHON_INLINE PyObject *__pyx_f_2yt_9utilities_3lib_8fp_utils__ensure_code(PyObject *); /*proto*/
3895 
3896 /* Module declarations from 'yt.geometry.oct_container' */
3897 static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool = 0;
3898 static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer = 0;
3899 static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer = 0;
3900 static PyTypeObject *__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer = 0;
3901 static int *__pyx_vp_2yt_8geometry_13oct_container_ORDER_MAX = 0;
3902 #define __pyx_v_2yt_8geometry_13oct_container_ORDER_MAX (*__pyx_vp_2yt_8geometry_13oct_container_ORDER_MAX)
3903 
3904 /* Module declarations from 'libc.float' */
3905 
3906 /* Module declarations from 'yt.utilities.lib.geometry_utils' */
3907 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*/
3908 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*/
3909 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*/
3910 static CYTHON_INLINE __pyx_t_5numpy_uint64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_spread_64bits_by2(__pyx_t_5numpy_uint64_t); /*proto*/
3911 static CYTHON_INLINE __pyx_t_5numpy_uint64_t __pyx_f_2yt_9utilities_3lib_14geometry_utils_compact_64bits_by2(__pyx_t_5numpy_uint64_t); /*proto*/
3912 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*/
3913 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*/
3914 
3915 /* Module declarations from 'yt.geometry.selection_routines' */
3916 static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject = 0;
3917 static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector = 0;
3918 static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector = 0;
3919 static PyTypeObject *__pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector = 0;
3920 
3921 /* Module declarations from 'yt.utilities.lib.bitarray' */
3922 static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_8bitarray_bitarray = 0;
3923 
3924 /* Module declarations from 'yt.geometry.grid_container' */
3925 static PyTypeObject *__pyx_ptype_2yt_8geometry_14grid_container_GridTree = 0;
3926 static PyTypeObject *__pyx_ptype_2yt_8geometry_14grid_container_MatchPointsToGrids = 0;
3927 static PyTypeObject *__pyx_ptype_2yt_8geometry_14grid_container___pyx_scope_struct____iter__ = 0;
3928 static PyTypeObject *__pyx_array_type = 0;
3929 static PyTypeObject *__pyx_MemviewEnum_type = 0;
3930 static PyTypeObject *__pyx_memoryview_type = 0;
3931 static PyTypeObject *__pyx_memoryviewslice_type = 0;
3932 static PyObject *generic = 0;
3933 static PyObject *strided = 0;
3934 static PyObject *indirect = 0;
3935 static PyObject *contiguous = 0;
3936 static PyObject *indirect_contiguous = 0;
3937 static int __pyx_memoryview_thread_locks_used;
3938 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
3939 static struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode __pyx_f_2yt_8geometry_14grid_container_Grid_initialize(PyArrayObject *, PyArrayObject *, PyArrayObject *, int, int, int); /*proto*/
3940 static struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded __pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded(PyObject *); /*proto*/
3941 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
3942 static void *__pyx_align_pointer(void *, size_t); /*proto*/
3943 static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
3944 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
3945 static PyObject *_unellipsify(PyObject *, int); /*proto*/
3946 static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
3947 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
3948 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*/
3949 static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
3950 static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
3951 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
3952 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
3953 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
3954 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
3955 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
3956 static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
3957 static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
3958 static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
3959 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
3960 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
3961 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
3962 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
3963 static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
3964 static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
3965 static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
3966 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
3967 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
3968 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
3969 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
3970 static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
3971 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
3972 static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
3973 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
3974 static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *); /*proto*/
3975 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 };
3976 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 };
3977 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 };
3978 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int_t = { "int_t", NULL, sizeof(__pyx_t_5numpy_int_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_5numpy_int_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_5numpy_int_t), 0 };
3979 static __Pyx_StructField __Pyx_StructFields_nn_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded[] = {
3980   {&__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, "num_children", offsetof(struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded, num_children)},
3981   {&__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, "level", offsetof(struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded, level)},
3982   {&__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, "index", offsetof(struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded, index)},
3983   {&__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, "left_edge_x", offsetof(struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded, left_edge_x)},
3984   {&__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, "left_edge_y", offsetof(struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded, left_edge_y)},
3985   {&__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, "left_edge_z", offsetof(struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded, left_edge_z)},
3986   {&__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, "right_edge_x", offsetof(struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded, right_edge_x)},
3987   {&__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, "right_edge_y", offsetof(struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded, right_edge_y)},
3988   {&__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, "right_edge_z", offsetof(struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded, right_edge_z)},
3989   {&__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, "children_pointers", offsetof(struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded, children_pointers)},
3990   {&__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, "start_index_x", offsetof(struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded, start_index_x)},
3991   {&__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, "start_index_y", offsetof(struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded, start_index_y)},
3992   {&__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, "start_index_z", offsetof(struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded, start_index_z)},
3993   {&__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, "dims_x", offsetof(struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded, dims_x)},
3994   {&__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, "dims_y", offsetof(struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded, dims_y)},
3995   {&__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, "dims_z", offsetof(struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded, dims_z)},
3996   {&__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, "dds_x", offsetof(struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded, dds_x)},
3997   {&__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, "dds_y", offsetof(struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded, dds_y)},
3998   {&__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, "dds_z", offsetof(struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded, dds_z)},
3999   {NULL, NULL, 0}
4000 };
4001 static __Pyx_TypeInfo __Pyx_TypeInfo_nn_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded = { "GridTreeNodePadded", __Pyx_StructFields_nn_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded, sizeof(struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded), { 0 }, 0, 'S', 0, 0 };
4002 #define __Pyx_MODULE_NAME "yt.geometry.grid_container"
4003 extern int __pyx_module_is_main_yt__geometry__grid_container;
4004 int __pyx_module_is_main_yt__geometry__grid_container = 0;
4005 
4006 /* Implementation of 'yt.geometry.grid_container' */
4007 static PyObject *__pyx_builtin_range;
4008 static PyObject *__pyx_builtin_RuntimeError;
4009 static PyObject *__pyx_builtin_TypeError;
4010 static PyObject *__pyx_builtin_ValueError;
4011 static PyObject *__pyx_builtin_ImportError;
4012 static PyObject *__pyx_builtin_KeyError;
4013 static PyObject *__pyx_builtin_MemoryError;
4014 static PyObject *__pyx_builtin_enumerate;
4015 static PyObject *__pyx_builtin_Ellipsis;
4016 static PyObject *__pyx_builtin_id;
4017 static PyObject *__pyx_builtin_IndexError;
4018 static const char __pyx_k_O[] = "O";
4019 static const char __pyx_k_T[] = "T{";
4020   static const char __pyx_k_c[] = "c";
4021   static const char __pyx_k_s[] = "(%s)";
4022   static const char __pyx_k_x[] = "_x";
4023   static const char __pyx_k_y[] = "_y";
4024   static const char __pyx_k_z[] = "_z";
4025   static const char __pyx_k_id[] = "id";
4026   static const char __pyx_k_np[] = "np";
4027   static const char __pyx_k__50[] = "^";
4028   static const char __pyx_k__51[] = "";
4029   static const char __pyx_k__52[] = ":";
4030 static const char __pyx_k__53[] = "}";
4031 static const char __pyx_k__54[] = ",";
4032 static const char __pyx_k_int[] = "int";
4033 static const char __pyx_k_new[] = "__new__";
4034 static const char __pyx_k_obj[] = "obj";
4035 static const char __pyx_k_x_2[] = "x";
4036 static const char __pyx_k_y_2[] = "y";
4037 static const char __pyx_k_z_2[] = "z";
4038 static const char __pyx_k_args[] = "args";
4039 static const char __pyx_k_base[] = "base";
4040 static const char __pyx_k_char[] = "char";
4041 static const char __pyx_k_dict[] = "__dict__";
4042 static const char __pyx_k_iter[] = "__iter__";
4043 static const char __pyx_k_join[] = "join";
4044 static const char __pyx_k_main[] = "__main__";
4045 static const char __pyx_k_mode[] = "mode";
4046 static const char __pyx_k_name[] = "name";
4047 static const char __pyx_k_ndim[] = "ndim";
4048 static const char __pyx_k_pack[] = "pack";
4049 static const char __pyx_k_send[] = "send";
4050 static const char __pyx_k_size[] = "size";
4051 static const char __pyx_k_step[] = "step";
4052 static const char __pyx_k_stop[] = "stop";
4053 static const char __pyx_k_test[] = "__test__";
4054 static const char __pyx_k_tree[] = "tree";
4055 static const char __pyx_k_view[] = "view";
4056 static const char __pyx_k_ASCII[] = "ASCII";
4057 static const char __pyx_k_class[] = "__class__";
4058 static const char __pyx_k_close[] = "close";
4059 static const char __pyx_k_dds_x[] = "dds_x";
4060 static const char __pyx_k_dds_y[] = "dds_y";
4061 static const char __pyx_k_dds_z[] = "dds_z";
4062 static const char __pyx_k_dtype[] = "dtype";
4063 static const char __pyx_k_empty[] = "empty";
4064 static const char __pyx_k_error[] = "error";
4065 static const char __pyx_k_flags[] = "flags";
4066 static const char __pyx_k_index[] = "index";
4067 static const char __pyx_k_int64[] = "int64";
4068 static const char __pyx_k_level[] = "level";
4069 static const char __pyx_k_names[] = "names";
4070 static const char __pyx_k_numpy[] = "numpy";
4071 static const char __pyx_k_range[] = "range";
4072 static const char __pyx_k_shape[] = "shape";
4073 static const char __pyx_k_start[] = "start";
4074 static const char __pyx_k_throw[] = "throw";
4075 static const char __pyx_k_units[] = "units";
4076 static const char __pyx_k_zeros[] = "zeros";
4077 static const char __pyx_k_dims_x[] = "dims_x";
4078 static const char __pyx_k_dims_y[] = "dims_y";
4079 static const char __pyx_k_dims_z[] = "dims_z";
4080 static const char __pyx_k_encode[] = "encode";
4081 static const char __pyx_k_fields[] = "fields";
4082 static const char __pyx_k_format[] = "format";
4083 static const char __pyx_k_import[] = "__import__";
4084 static const char __pyx_k_name_2[] = "__name__";
4085 static const char __pyx_k_pickle[] = "pickle";
4086 static const char __pyx_k_reduce[] = "__reduce__";
4087 static const char __pyx_k_struct[] = "struct";
4088 static const char __pyx_k_unpack[] = "unpack";
4089 static const char __pyx_k_update[] = "update";
4090 static const char __pyx_k_asarray[] = "asarray";
4091 static const char __pyx_k_float64[] = "float64";
4092 static const char __pyx_k_fortran[] = "fortran";
4093 static const char __pyx_k_memview[] = "memview";
4094 static const char __pyx_k_Ellipsis[] = "Ellipsis";
4095 static const char __pyx_k_GridTree[] = "GridTree";
4096 static const char __pyx_k_KeyError[] = "KeyError";
4097 static const char __pyx_k_endswith[] = "endswith";
4098 static const char __pyx_k_getstate[] = "__getstate__";
4099 static const char __pyx_k_itemsize[] = "itemsize";
4100 static const char __pyx_k_pyx_type[] = "__pyx_type";
4101 static const char __pyx_k_selector[] = "selector";
4102 static const char __pyx_k_setstate[] = "__setstate__";
4103 static const char __pyx_k_TypeError[] = "TypeError";
4104 static const char __pyx_k_enumerate[] = "enumerate";
4105 static const char __pyx_k_left_edge[] = "left_edge";
4106 static const char __pyx_k_num_grids[] = "num_grids";
4107 static const char __pyx_k_pyx_state[] = "__pyx_state";
4108 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
4109 static const char __pyx_k_IndexError[] = "IndexError";
4110 static const char __pyx_k_ValueError[] = "ValueError";
4111 static const char __pyx_k_dimensions[] = "dimensions";
4112 static const char __pyx_k_num_points[] = "num_points";
4113 static const char __pyx_k_parent_ind[] = "parent_ind";
4114 static const char __pyx_k_pyx_result[] = "__pyx_result";
4115 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
4116 static const char __pyx_k_right_edge[] = "right_edge";
4117 static const char __pyx_k_ImportError[] = "ImportError";
4118 static const char __pyx_k_MemoryError[] = "MemoryError";
4119 static const char __pyx_k_PickleError[] = "PickleError";
4120 static const char __pyx_k_code_length[] = "code_length";
4121 static const char __pyx_k_left_edge_x[] = "left_edge_x";
4122 static const char __pyx_k_left_edge_y[] = "left_edge_y";
4123 static const char __pyx_k_left_edge_z[] = "left_edge_z";
4124 static const char __pyx_k_RuntimeError[] = "RuntimeError";
4125 static const char __pyx_k_num_children[] = "num_children";
4126 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
4127 static const char __pyx_k_right_edge_x[] = "right_edge_x";
4128 static const char __pyx_k_right_edge_y[] = "right_edge_y";
4129 static const char __pyx_k_right_edge_z[] = "right_edge_z";
4130 static const char __pyx_k_stringsource[] = "stringsource";
4131 static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
4132 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
4133 static const char __pyx_k_start_index_x[] = "start_index_x";
4134 static const char __pyx_k_start_index_y[] = "start_index_y";
4135 static const char __pyx_k_start_index_z[] = "start_index_z";
4136 static const char __pyx_k_GridTree___iter[] = "GridTree.__iter__";
4137 static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
4138 static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
4139 static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
4140 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
4141 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
4142 static const char __pyx_k_convert_to_units[] = "convert_to_units";
4143 static const char __pyx_k_children_pointers[] = "children_pointers";
4144 static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
4145 static const char __pyx_k_MatchPointsToGrids[] = "MatchPointsToGrids";
4146 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
4147 static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
4148 static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
4149 static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
4150 static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
4151 static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
4152 static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
4153 static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
4154 static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
4155 static const char __pyx_k_yt_geometry_grid_container[] = "yt.geometry.grid_container";
4156 static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
4157 static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
4158 static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
4159 static const char __pyx_k_Matching_points_on_the_grid_to[] = "\nMatching points on the grid to specific grids\n\n\n\n";
4160 static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
4161 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
4162 static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
4163 static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
4164 static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
4165 static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
4166 static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
4167 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
4168 static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
4169 static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] = "Incompatible checksums (%s vs 0xb068931 = (name))";
4170 static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
4171 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
4172 static const char __pyx_k_No_value_specified_for_struct_at[] = "No value specified for struct attribute 'num_children'";
4173 static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
4174 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
4175 static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
4176 static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
4177 static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
4178 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
4179 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
4180 static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
4181 static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
4182 static const char __pyx_k_No_value_specified_for_struct_at_2[] = "No value specified for struct attribute 'level'";
4183 static const char __pyx_k_No_value_specified_for_struct_at_3[] = "No value specified for struct attribute 'index'";
4184 static const char __pyx_k_No_value_specified_for_struct_at_4[] = "No value specified for struct attribute 'left_edge_x'";
4185 static const char __pyx_k_No_value_specified_for_struct_at_5[] = "No value specified for struct attribute 'left_edge_y'";
4186 static const char __pyx_k_No_value_specified_for_struct_at_6[] = "No value specified for struct attribute 'left_edge_z'";
4187 static const char __pyx_k_No_value_specified_for_struct_at_7[] = "No value specified for struct attribute 'right_edge_x'";
4188 static const char __pyx_k_No_value_specified_for_struct_at_8[] = "No value specified for struct attribute 'right_edge_y'";
4189 static const char __pyx_k_No_value_specified_for_struct_at_9[] = "No value specified for struct attribute 'right_edge_z'";
4190 static const char __pyx_k_No_value_specified_for_struct_at_10[] = "No value specified for struct attribute 'children_pointers'";
4191 static const char __pyx_k_No_value_specified_for_struct_at_11[] = "No value specified for struct attribute 'start_index_x'";
4192 static const char __pyx_k_No_value_specified_for_struct_at_12[] = "No value specified for struct attribute 'start_index_y'";
4193 static const char __pyx_k_No_value_specified_for_struct_at_13[] = "No value specified for struct attribute 'start_index_z'";
4194 static const char __pyx_k_No_value_specified_for_struct_at_14[] = "No value specified for struct attribute 'dims_x'";
4195 static const char __pyx_k_No_value_specified_for_struct_at_15[] = "No value specified for struct attribute 'dims_y'";
4196 static const char __pyx_k_No_value_specified_for_struct_at_16[] = "No value specified for struct attribute 'dims_z'";
4197 static const char __pyx_k_No_value_specified_for_struct_at_17[] = "No value specified for struct attribute 'dds_x'";
4198 static const char __pyx_k_No_value_specified_for_struct_at_18[] = "No value specified for struct attribute 'dds_y'";
4199 static const char __pyx_k_No_value_specified_for_struct_at_19[] = "No value specified for struct attribute 'dds_z'";
4200 static PyObject *__pyx_n_s_ASCII;
4201 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
4202 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
4203 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
4204 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
4205 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
4206 static PyObject *__pyx_n_s_Ellipsis;
4207 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
4208 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
4209 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
4210 static PyObject *__pyx_n_s_GridTree;
4211 static PyObject *__pyx_n_s_GridTree___iter;
4212 static PyObject *__pyx_n_s_ImportError;
4213 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0;
4214 static PyObject *__pyx_n_s_IndexError;
4215 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
4216 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
4217 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
4218 static PyObject *__pyx_n_s_KeyError;
4219 static PyObject *__pyx_n_s_MatchPointsToGrids;
4220 static PyObject *__pyx_n_s_MemoryError;
4221 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
4222 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
4223 static PyObject *__pyx_kp_s_No_value_specified_for_struct_at;
4224 static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_10;
4225 static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_11;
4226 static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_12;
4227 static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_13;
4228 static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_14;
4229 static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_15;
4230 static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_16;
4231 static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_17;
4232 static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_18;
4233 static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_19;
4234 static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_2;
4235 static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_3;
4236 static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_4;
4237 static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_5;
4238 static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_6;
4239 static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_7;
4240 static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_8;
4241 static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_9;
4242 static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
4243 static PyObject *__pyx_n_b_O;
4244 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
4245 static PyObject *__pyx_n_s_PickleError;
4246 static PyObject *__pyx_n_s_RuntimeError;
4247 static PyObject *__pyx_kp_b_T;
4248 static PyObject *__pyx_n_s_TypeError;
4249 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
4250 static PyObject *__pyx_n_s_ValueError;
4251 static PyObject *__pyx_n_s_View_MemoryView;
4252 static PyObject *__pyx_kp_b__50;
4253 static PyObject *__pyx_kp_b__51;
4254 static PyObject *__pyx_kp_b__52;
4255 static PyObject *__pyx_kp_b__53;
4256 static PyObject *__pyx_kp_u__54;
4257 static PyObject *__pyx_n_s_allocate_buffer;
4258 static PyObject *__pyx_n_s_args;
4259 static PyObject *__pyx_n_s_asarray;
4260 static PyObject *__pyx_n_s_base;
4261 static PyObject *__pyx_n_s_c;
4262 static PyObject *__pyx_n_u_c;
4263 static PyObject *__pyx_n_s_char;
4264 static PyObject *__pyx_n_s_children_pointers;
4265 static PyObject *__pyx_n_s_class;
4266 static PyObject *__pyx_n_s_cline_in_traceback;
4267 static PyObject *__pyx_n_s_close;
4268 static PyObject *__pyx_n_s_code_length;
4269 static PyObject *__pyx_kp_s_contiguous_and_direct;
4270 static PyObject *__pyx_kp_s_contiguous_and_indirect;
4271 static PyObject *__pyx_n_s_convert_to_units;
4272 static PyObject *__pyx_n_s_dds_x;
4273 static PyObject *__pyx_n_s_dds_y;
4274 static PyObject *__pyx_n_s_dds_z;
4275 static PyObject *__pyx_n_s_dict;
4276 static PyObject *__pyx_n_s_dimensions;
4277 static PyObject *__pyx_n_s_dims_x;
4278 static PyObject *__pyx_n_s_dims_y;
4279 static PyObject *__pyx_n_s_dims_z;
4280 static PyObject *__pyx_n_s_dtype;
4281 static PyObject *__pyx_n_s_dtype_is_object;
4282 static PyObject *__pyx_n_s_empty;
4283 static PyObject *__pyx_n_s_encode;
4284 static PyObject *__pyx_n_s_endswith;
4285 static PyObject *__pyx_n_s_enumerate;
4286 static PyObject *__pyx_n_s_error;
4287 static PyObject *__pyx_n_s_fields;
4288 static PyObject *__pyx_n_s_flags;
4289 static PyObject *__pyx_n_s_float64;
4290 static PyObject *__pyx_n_s_format;
4291 static PyObject *__pyx_n_s_fortran;
4292 static PyObject *__pyx_n_u_fortran;
4293 static PyObject *__pyx_n_s_getstate;
4294 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
4295 static PyObject *__pyx_n_s_id;
4296 static PyObject *__pyx_n_s_import;
4297 static PyObject *__pyx_n_s_index;
4298 static PyObject *__pyx_n_s_int;
4299 static PyObject *__pyx_n_s_int64;
4300 static PyObject *__pyx_n_s_itemsize;
4301 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
4302 static PyObject *__pyx_n_s_iter;
4303 static PyObject *__pyx_n_s_join;
4304 static PyObject *__pyx_n_s_left_edge;
4305 static PyObject *__pyx_n_s_left_edge_x;
4306 static PyObject *__pyx_n_s_left_edge_y;
4307 static PyObject *__pyx_n_s_left_edge_z;
4308 static PyObject *__pyx_n_s_level;
4309 static PyObject *__pyx_n_s_main;
4310 static PyObject *__pyx_n_s_memview;
4311 static PyObject *__pyx_n_s_mode;
4312 static PyObject *__pyx_n_s_name;
4313 static PyObject *__pyx_n_s_name_2;
4314 static PyObject *__pyx_n_s_names;
4315 static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
4316 static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
4317 static PyObject *__pyx_n_s_ndim;
4318 static PyObject *__pyx_n_s_new;
4319 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
4320 static PyObject *__pyx_n_s_np;
4321 static PyObject *__pyx_n_s_num_children;
4322 static PyObject *__pyx_n_s_num_grids;
4323 static PyObject *__pyx_n_s_num_points;
4324 static PyObject *__pyx_n_s_numpy;
4325 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
4326 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
4327 static PyObject *__pyx_n_s_obj;
4328 static PyObject *__pyx_n_s_pack;
4329 static PyObject *__pyx_n_s_parent_ind;
4330 static PyObject *__pyx_n_s_pickle;
4331 static PyObject *__pyx_n_s_pyx_PickleError;
4332 static PyObject *__pyx_n_s_pyx_checksum;
4333 static PyObject *__pyx_n_s_pyx_getbuffer;
4334 static PyObject *__pyx_n_s_pyx_result;
4335 static PyObject *__pyx_n_s_pyx_state;
4336 static PyObject *__pyx_n_s_pyx_type;
4337 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
4338 static PyObject *__pyx_n_s_pyx_vtable;
4339 static PyObject *__pyx_n_s_range;
4340 static PyObject *__pyx_n_s_reduce;
4341 static PyObject *__pyx_n_s_reduce_cython;
4342 static PyObject *__pyx_n_s_reduce_ex;
4343 static PyObject *__pyx_n_s_right_edge;
4344 static PyObject *__pyx_n_s_right_edge_x;
4345 static PyObject *__pyx_n_s_right_edge_y;
4346 static PyObject *__pyx_n_s_right_edge_z;
4347 static PyObject *__pyx_kp_u_s;
4348 static PyObject *__pyx_n_s_selector;
4349 static PyObject *__pyx_n_s_send;
4350 static PyObject *__pyx_n_s_setstate;
4351 static PyObject *__pyx_n_s_setstate_cython;
4352 static PyObject *__pyx_n_s_shape;
4353 static PyObject *__pyx_n_s_size;
4354 static PyObject *__pyx_n_s_start;
4355 static PyObject *__pyx_n_s_start_index_x;
4356 static PyObject *__pyx_n_s_start_index_y;
4357 static PyObject *__pyx_n_s_start_index_z;
4358 static PyObject *__pyx_n_s_step;
4359 static PyObject *__pyx_n_s_stop;
4360 static PyObject *__pyx_kp_s_strided_and_direct;
4361 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
4362 static PyObject *__pyx_kp_s_strided_and_indirect;
4363 static PyObject *__pyx_kp_s_stringsource;
4364 static PyObject *__pyx_n_s_struct;
4365 static PyObject *__pyx_n_s_test;
4366 static PyObject *__pyx_n_s_throw;
4367 static PyObject *__pyx_n_s_tree;
4368 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
4369 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
4370 static PyObject *__pyx_n_s_units;
4371 static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
4372 static PyObject *__pyx_n_s_unpack;
4373 static PyObject *__pyx_n_s_update;
4374 static PyObject *__pyx_n_s_view;
4375 static PyObject *__pyx_n_s_x;
4376 static PyObject *__pyx_n_s_x_2;
4377 static PyObject *__pyx_n_s_y;
4378 static PyObject *__pyx_n_s_y_2;
4379 static PyObject *__pyx_n_s_yt_geometry_grid_container;
4380 static PyObject *__pyx_n_s_z;
4381 static PyObject *__pyx_n_s_z_2;
4382 static PyObject *__pyx_n_s_zeros;
4383 static int __pyx_pf_2yt_8geometry_14grid_container_8GridTree___cinit__(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *__pyx_v_self, int __pyx_v_num_grids, PyArrayObject *__pyx_v_left_edge, PyArrayObject *__pyx_v_right_edge, PyArrayObject *__pyx_v_dimensions, PyArrayObject *__pyx_v_parent_ind, PyArrayObject *__pyx_v_level, PyArrayObject *__pyx_v_num_children); /* proto */
4384 static int __pyx_pf_2yt_8geometry_14grid_container_8GridTree_2__init__(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
4385 static PyObject *__pyx_pf_2yt_8geometry_14grid_container_8GridTree_4__iter__(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *__pyx_v_self); /* proto */
4386 static PyObject *__pyx_pf_2yt_8geometry_14grid_container_8GridTree_7return_tree_info(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *__pyx_v_self); /* proto */
4387 static PyObject *__pyx_pf_2yt_8geometry_14grid_container_8GridTree_11grid_arrays___get__(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *__pyx_v_self); /* proto */
4388 static PyObject *__pyx_pf_2yt_8geometry_14grid_container_8GridTree_9count(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector); /* proto */
4389 static PyObject *__pyx_pf_2yt_8geometry_14grid_container_8GridTree_11select_icoords(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, __pyx_t_5numpy_uint64_t __pyx_v_size); /* proto */
4390 static PyObject *__pyx_pf_2yt_8geometry_14grid_container_8GridTree_13select_ires(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, __pyx_t_5numpy_uint64_t __pyx_v_size); /* proto */
4391 static PyObject *__pyx_pf_2yt_8geometry_14grid_container_8GridTree_15select_fcoords(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, __pyx_t_5numpy_uint64_t __pyx_v_size); /* proto */
4392 static PyObject *__pyx_pf_2yt_8geometry_14grid_container_8GridTree_17select_fwidth(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, __pyx_t_5numpy_uint64_t __pyx_v_size); /* proto */
4393 static PyObject *__pyx_pf_2yt_8geometry_14grid_container_8GridTree_4mask___get__(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *__pyx_v_self); /* proto */
4394 static int __pyx_pf_2yt_8geometry_14grid_container_8GridTree_4mask_2__set__(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
4395 static int __pyx_pf_2yt_8geometry_14grid_container_8GridTree_4mask_4__del__(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *__pyx_v_self); /* proto */
4396 static PyObject *__pyx_pf_2yt_8geometry_14grid_container_8GridTree_19__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *__pyx_v_self); /* proto */
4397 static PyObject *__pyx_pf_2yt_8geometry_14grid_container_8GridTree_21__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
4398 static int __pyx_pf_2yt_8geometry_14grid_container_18MatchPointsToGrids___cinit__(struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *__pyx_v_self, struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *__pyx_v_tree, int __pyx_v_num_points, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_y, PyArrayObject *__pyx_v_z); /* proto */
4399 static PyObject *__pyx_pf_2yt_8geometry_14grid_container_18MatchPointsToGrids_2find_points_in_tree(struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *__pyx_v_self); /* proto */
4400 static PyObject *__pyx_pf_2yt_8geometry_14grid_container_18MatchPointsToGrids_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *__pyx_v_self); /* proto */
4401 static PyObject *__pyx_pf_2yt_8geometry_14grid_container_18MatchPointsToGrids_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
4402 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
4403 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
4404 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 */
4405 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 */
4406 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
4407 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
4408 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
4409 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
4410 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
4411 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 */
4412 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
4413 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 */
4414 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
4415 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
4416 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
4417 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
4418 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 */
4419 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4420 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
4421 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 */
4422 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 */
4423 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4424 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4425 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4426 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4427 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4428 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4429 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4430 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4431 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4432 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4433 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4434 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4435 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4436 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4437 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4438 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4439 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4440 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 */
4441 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
4442 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
4443 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
4444 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 */
4445 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 */
4446 static PyObject *__pyx_tp_new_2yt_8geometry_14grid_container_GridTree(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4447 static PyObject *__pyx_tp_new_2yt_8geometry_14grid_container_MatchPointsToGrids(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4448 static PyObject *__pyx_tp_new_2yt_8geometry_14grid_container___pyx_scope_struct____iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4449 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4450 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4451 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4452 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4453 static PyObject *__pyx_int_0;
4454 static PyObject *__pyx_int_1;
4455 static PyObject *__pyx_int_3;
4456 static PyObject *__pyx_int_184977713;
4457 static PyObject *__pyx_int_neg_1;
4458 static PyObject *__pyx_int_neg_2;
4459 static PyObject *__pyx_slice_;
4460 static PyObject *__pyx_slice__2;
4461 static PyObject *__pyx_tuple__3;
4462 static PyObject *__pyx_tuple__4;
4463 static PyObject *__pyx_tuple__5;
4464 static PyObject *__pyx_tuple__6;
4465 static PyObject *__pyx_tuple__7;
4466 static PyObject *__pyx_tuple__8;
4467 static PyObject *__pyx_tuple__9;
4468 static PyObject *__pyx_tuple__10;
4469 static PyObject *__pyx_tuple__11;
4470 static PyObject *__pyx_tuple__12;
4471 static PyObject *__pyx_tuple__13;
4472 static PyObject *__pyx_tuple__14;
4473 static PyObject *__pyx_tuple__15;
4474 static PyObject *__pyx_tuple__16;
4475 static PyObject *__pyx_tuple__17;
4476 static PyObject *__pyx_tuple__18;
4477 static PyObject *__pyx_tuple__19;
4478 static PyObject *__pyx_tuple__20;
4479 static PyObject *__pyx_tuple__21;
4480 static PyObject *__pyx_tuple__22;
4481 static PyObject *__pyx_tuple__23;
4482 static PyObject *__pyx_tuple__24;
4483 static PyObject *__pyx_tuple__25;
4484 static PyObject *__pyx_tuple__26;
4485 static PyObject *__pyx_tuple__27;
4486 static PyObject *__pyx_tuple__28;
4487 static PyObject *__pyx_tuple__29;
4488 static PyObject *__pyx_tuple__30;
4489 static PyObject *__pyx_tuple__31;
4490 static PyObject *__pyx_tuple__32;
4491 static PyObject *__pyx_tuple__33;
4492 static PyObject *__pyx_tuple__34;
4493 static PyObject *__pyx_tuple__35;
4494 static PyObject *__pyx_tuple__36;
4495 static PyObject *__pyx_tuple__37;
4496 static PyObject *__pyx_tuple__38;
4497 static PyObject *__pyx_tuple__39;
4498 static PyObject *__pyx_tuple__40;
4499 static PyObject *__pyx_tuple__41;
4500 static PyObject *__pyx_tuple__42;
4501 static PyObject *__pyx_tuple__43;
4502 static PyObject *__pyx_tuple__44;
4503 static PyObject *__pyx_tuple__45;
4504 static PyObject *__pyx_tuple__46;
4505 static PyObject *__pyx_tuple__47;
4506 static PyObject *__pyx_tuple__48;
4507 static PyObject *__pyx_tuple__49;
4508 static PyObject *__pyx_tuple__55;
4509 static PyObject *__pyx_tuple__56;
4510 static PyObject *__pyx_tuple__57;
4511 static PyObject *__pyx_tuple__58;
4512 static PyObject *__pyx_tuple__59;
4513 static PyObject *__pyx_tuple__60;
4514 static PyObject *__pyx_codeobj__61;
4515 /* Late includes */
4516 
4517 /* "yt/geometry/grid_container.pyx":22
4518  * @cython.wraparound(False)
4519  * @cython.cdivision(True)
4520  * cdef GridTreeNode Grid_initialize(np.ndarray[np.float64_t, ndim=1] le,             # <<<<<<<<<<<<<<
4521  *                                   np.ndarray[np.float64_t, ndim=1] re,
4522  *                                   np.ndarray[np.int32_t, ndim=1] dims,
4523  */
4524 
__pyx_f_2yt_8geometry_14grid_container_Grid_initialize(PyArrayObject * __pyx_v_le,PyArrayObject * __pyx_v_re,PyArrayObject * __pyx_v_dims,int __pyx_v_num_children,int __pyx_v_level,int __pyx_v_index)4525 static struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode __pyx_f_2yt_8geometry_14grid_container_Grid_initialize(PyArrayObject *__pyx_v_le, PyArrayObject *__pyx_v_re, PyArrayObject *__pyx_v_dims, int __pyx_v_num_children, int __pyx_v_level, int __pyx_v_index) {
4526   struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode __pyx_v_node;
4527   int __pyx_v_i;
4528   __Pyx_LocalBuf_ND __pyx_pybuffernd_dims;
4529   __Pyx_Buffer __pyx_pybuffer_dims;
4530   __Pyx_LocalBuf_ND __pyx_pybuffernd_le;
4531   __Pyx_Buffer __pyx_pybuffer_le;
4532   __Pyx_LocalBuf_ND __pyx_pybuffernd_re;
4533   __Pyx_Buffer __pyx_pybuffer_re;
4534   struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode __pyx_r;
4535   __Pyx_RefNannyDeclarations
4536   int __pyx_t_1;
4537   Py_ssize_t __pyx_t_2;
4538   Py_ssize_t __pyx_t_3;
4539   Py_ssize_t __pyx_t_4;
4540   Py_ssize_t __pyx_t_5;
4541   Py_ssize_t __pyx_t_6;
4542   Py_ssize_t __pyx_t_7;
4543   Py_ssize_t __pyx_t_8;
4544   int __pyx_t_9;
4545   int __pyx_t_10;
4546   int __pyx_t_11;
4547   __Pyx_RefNannySetupContext("Grid_initialize", 0);
4548   __pyx_pybuffer_le.pybuffer.buf = NULL;
4549   __pyx_pybuffer_le.refcount = 0;
4550   __pyx_pybuffernd_le.data = NULL;
4551   __pyx_pybuffernd_le.rcbuffer = &__pyx_pybuffer_le;
4552   __pyx_pybuffer_re.pybuffer.buf = NULL;
4553   __pyx_pybuffer_re.refcount = 0;
4554   __pyx_pybuffernd_re.data = NULL;
4555   __pyx_pybuffernd_re.rcbuffer = &__pyx_pybuffer_re;
4556   __pyx_pybuffer_dims.pybuffer.buf = NULL;
4557   __pyx_pybuffer_dims.refcount = 0;
4558   __pyx_pybuffernd_dims.data = NULL;
4559   __pyx_pybuffernd_dims.rcbuffer = &__pyx_pybuffer_dims;
4560   {
4561     __Pyx_BufFmt_StackElem __pyx_stack[1];
4562     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_le.rcbuffer->pybuffer, (PyObject*)__pyx_v_le, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 22, __pyx_L1_error)
4563   }
4564   __pyx_pybuffernd_le.diminfo[0].strides = __pyx_pybuffernd_le.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_le.diminfo[0].shape = __pyx_pybuffernd_le.rcbuffer->pybuffer.shape[0];
4565   {
4566     __Pyx_BufFmt_StackElem __pyx_stack[1];
4567     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_re.rcbuffer->pybuffer, (PyObject*)__pyx_v_re, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 22, __pyx_L1_error)
4568   }
4569   __pyx_pybuffernd_re.diminfo[0].strides = __pyx_pybuffernd_re.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_re.diminfo[0].shape = __pyx_pybuffernd_re.rcbuffer->pybuffer.shape[0];
4570   {
4571     __Pyx_BufFmt_StackElem __pyx_stack[1];
4572     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dims.rcbuffer->pybuffer, (PyObject*)__pyx_v_dims, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 22, __pyx_L1_error)
4573   }
4574   __pyx_pybuffernd_dims.diminfo[0].strides = __pyx_pybuffernd_dims.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dims.diminfo[0].shape = __pyx_pybuffernd_dims.rcbuffer->pybuffer.shape[0];
4575 
4576   /* "yt/geometry/grid_container.pyx":30
4577  *     cdef int i
4578  *
4579  *     node.index = index             # <<<<<<<<<<<<<<
4580  *     node.level = level
4581  *     for i in range(3):
4582  */
4583   __pyx_v_node.index = __pyx_v_index;
4584 
4585   /* "yt/geometry/grid_container.pyx":31
4586  *
4587  *     node.index = index
4588  *     node.level = level             # <<<<<<<<<<<<<<
4589  *     for i in range(3):
4590  *         node.left_edge[i] = le[i]
4591  */
4592   __pyx_v_node.level = __pyx_v_level;
4593 
4594   /* "yt/geometry/grid_container.pyx":32
4595  *     node.index = index
4596  *     node.level = level
4597  *     for i in range(3):             # <<<<<<<<<<<<<<
4598  *         node.left_edge[i] = le[i]
4599  *         node.right_edge[i] = re[i]
4600  */
4601   for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
4602     __pyx_v_i = __pyx_t_1;
4603 
4604     /* "yt/geometry/grid_container.pyx":33
4605  *     node.level = level
4606  *     for i in range(3):
4607  *         node.left_edge[i] = le[i]             # <<<<<<<<<<<<<<
4608  *         node.right_edge[i] = re[i]
4609  *         node.dims[i] = dims[i]
4610  */
4611     __pyx_t_2 = __pyx_v_i;
4612     (__pyx_v_node.left_edge[__pyx_v_i]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_le.rcbuffer->pybuffer.buf, __pyx_t_2, __pyx_pybuffernd_le.diminfo[0].strides));
4613 
4614     /* "yt/geometry/grid_container.pyx":34
4615  *     for i in range(3):
4616  *         node.left_edge[i] = le[i]
4617  *         node.right_edge[i] = re[i]             # <<<<<<<<<<<<<<
4618  *         node.dims[i] = dims[i]
4619  *         node.dds[i] = (re[i] - le[i])/dims[i]
4620  */
4621     __pyx_t_3 = __pyx_v_i;
4622     (__pyx_v_node.right_edge[__pyx_v_i]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_re.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_re.diminfo[0].strides));
4623 
4624     /* "yt/geometry/grid_container.pyx":35
4625  *         node.left_edge[i] = le[i]
4626  *         node.right_edge[i] = re[i]
4627  *         node.dims[i] = dims[i]             # <<<<<<<<<<<<<<
4628  *         node.dds[i] = (re[i] - le[i])/dims[i]
4629  *         node.start_index[i] = <np.int64_t> rint(le[i] / node.dds[i])
4630  */
4631     __pyx_t_4 = __pyx_v_i;
4632     (__pyx_v_node.dims[__pyx_v_i]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_dims.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_dims.diminfo[0].strides));
4633 
4634     /* "yt/geometry/grid_container.pyx":36
4635  *         node.right_edge[i] = re[i]
4636  *         node.dims[i] = dims[i]
4637  *         node.dds[i] = (re[i] - le[i])/dims[i]             # <<<<<<<<<<<<<<
4638  *         node.start_index[i] = <np.int64_t> rint(le[i] / node.dds[i])
4639  *     node.num_children = num_children
4640  */
4641     __pyx_t_5 = __pyx_v_i;
4642     __pyx_t_6 = __pyx_v_i;
4643     __pyx_t_7 = __pyx_v_i;
4644     (__pyx_v_node.dds[__pyx_v_i]) = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_re.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_re.diminfo[0].strides)) - (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_le.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_le.diminfo[0].strides))) / (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_dims.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_dims.diminfo[0].strides)));
4645 
4646     /* "yt/geometry/grid_container.pyx":37
4647  *         node.dims[i] = dims[i]
4648  *         node.dds[i] = (re[i] - le[i])/dims[i]
4649  *         node.start_index[i] = <np.int64_t> rint(le[i] / node.dds[i])             # <<<<<<<<<<<<<<
4650  *     node.num_children = num_children
4651  *     if num_children <= 0:
4652  */
4653     __pyx_t_8 = __pyx_v_i;
4654     (__pyx_v_node.start_index[__pyx_v_i]) = ((__pyx_t_5numpy_int64_t)rint(((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_le.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_le.diminfo[0].strides)) / (__pyx_v_node.dds[__pyx_v_i]))));
4655   }
4656 
4657   /* "yt/geometry/grid_container.pyx":38
4658  *         node.dds[i] = (re[i] - le[i])/dims[i]
4659  *         node.start_index[i] = <np.int64_t> rint(le[i] / node.dds[i])
4660  *     node.num_children = num_children             # <<<<<<<<<<<<<<
4661  *     if num_children <= 0:
4662  *         node.children = NULL
4663  */
4664   __pyx_v_node.num_children = __pyx_v_num_children;
4665 
4666   /* "yt/geometry/grid_container.pyx":39
4667  *         node.start_index[i] = <np.int64_t> rint(le[i] / node.dds[i])
4668  *     node.num_children = num_children
4669  *     if num_children <= 0:             # <<<<<<<<<<<<<<
4670  *         node.children = NULL
4671  *         return node
4672  */
4673   __pyx_t_9 = ((__pyx_v_num_children <= 0) != 0);
4674   if (__pyx_t_9) {
4675 
4676     /* "yt/geometry/grid_container.pyx":40
4677  *     node.num_children = num_children
4678  *     if num_children <= 0:
4679  *         node.children = NULL             # <<<<<<<<<<<<<<
4680  *         return node
4681  *     node.children = <GridTreeNode **> malloc(
4682  */
4683     __pyx_v_node.children = NULL;
4684 
4685     /* "yt/geometry/grid_container.pyx":41
4686  *     if num_children <= 0:
4687  *         node.children = NULL
4688  *         return node             # <<<<<<<<<<<<<<
4689  *     node.children = <GridTreeNode **> malloc(
4690  *             sizeof(GridTreeNode *) * num_children)
4691  */
4692     __pyx_r = __pyx_v_node;
4693     goto __pyx_L0;
4694 
4695     /* "yt/geometry/grid_container.pyx":39
4696  *         node.start_index[i] = <np.int64_t> rint(le[i] / node.dds[i])
4697  *     node.num_children = num_children
4698  *     if num_children <= 0:             # <<<<<<<<<<<<<<
4699  *         node.children = NULL
4700  *         return node
4701  */
4702   }
4703 
4704   /* "yt/geometry/grid_container.pyx":42
4705  *         node.children = NULL
4706  *         return node
4707  *     node.children = <GridTreeNode **> malloc(             # <<<<<<<<<<<<<<
4708  *             sizeof(GridTreeNode *) * num_children)
4709  *     for i in range(num_children):
4710  */
4711   __pyx_v_node.children = ((struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode **)malloc(((sizeof(struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode *)) * __pyx_v_num_children)));
4712 
4713   /* "yt/geometry/grid_container.pyx":44
4714  *     node.children = <GridTreeNode **> malloc(
4715  *             sizeof(GridTreeNode *) * num_children)
4716  *     for i in range(num_children):             # <<<<<<<<<<<<<<
4717  *         node.children[i] = NULL
4718  *
4719  */
4720   __pyx_t_1 = __pyx_v_num_children;
4721   __pyx_t_10 = __pyx_t_1;
4722   for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
4723     __pyx_v_i = __pyx_t_11;
4724 
4725     /* "yt/geometry/grid_container.pyx":45
4726  *             sizeof(GridTreeNode *) * num_children)
4727  *     for i in range(num_children):
4728  *         node.children[i] = NULL             # <<<<<<<<<<<<<<
4729  *
4730  *     return node
4731  */
4732     (__pyx_v_node.children[__pyx_v_i]) = NULL;
4733   }
4734 
4735   /* "yt/geometry/grid_container.pyx":47
4736  *         node.children[i] = NULL
4737  *
4738  *     return node             # <<<<<<<<<<<<<<
4739  *
4740  * cdef class GridTree:
4741  */
4742   __pyx_r = __pyx_v_node;
4743   goto __pyx_L0;
4744 
4745   /* "yt/geometry/grid_container.pyx":22
4746  * @cython.wraparound(False)
4747  * @cython.cdivision(True)
4748  * cdef GridTreeNode Grid_initialize(np.ndarray[np.float64_t, ndim=1] le,             # <<<<<<<<<<<<<<
4749  *                                   np.ndarray[np.float64_t, ndim=1] re,
4750  *                                   np.ndarray[np.int32_t, ndim=1] dims,
4751  */
4752 
4753   /* function exit code */
4754   __pyx_L1_error:;
4755   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
4756     __Pyx_PyThreadState_declare
4757     __Pyx_PyThreadState_assign
4758     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
4759     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dims.rcbuffer->pybuffer);
4760     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_le.rcbuffer->pybuffer);
4761     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_re.rcbuffer->pybuffer);
4762   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
4763   __Pyx_WriteUnraisable("yt.geometry.grid_container.Grid_initialize", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4764   __Pyx_pretend_to_initialize(&__pyx_r);
4765   goto __pyx_L2;
4766   __pyx_L0:;
4767   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dims.rcbuffer->pybuffer);
4768   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_le.rcbuffer->pybuffer);
4769   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_re.rcbuffer->pybuffer);
4770   __pyx_L2:;
4771   __Pyx_RefNannyFinishContext();
4772   return __pyx_r;
4773 }
4774 
4775 /* "yt/geometry/grid_container.pyx":54
4776  *     @cython.wraparound(False)
4777  *     @cython.cdivision(True)
4778  *     def __cinit__(self, int num_grids,             # <<<<<<<<<<<<<<
4779  *                   np.ndarray[np.float64_t, ndim=2] left_edge,
4780  *                   np.ndarray[np.float64_t, ndim=2] right_edge,
4781  */
4782 
4783 /* Python wrapper */
4784 static int __pyx_pw_2yt_8geometry_14grid_container_8GridTree_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2yt_8geometry_14grid_container_8GridTree_1__cinit__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)4785 static int __pyx_pw_2yt_8geometry_14grid_container_8GridTree_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4786   int __pyx_v_num_grids;
4787   PyArrayObject *__pyx_v_left_edge = 0;
4788   PyArrayObject *__pyx_v_right_edge = 0;
4789   PyArrayObject *__pyx_v_dimensions = 0;
4790   PyArrayObject *__pyx_v_parent_ind = 0;
4791   PyArrayObject *__pyx_v_level = 0;
4792   PyArrayObject *__pyx_v_num_children = 0;
4793   int __pyx_r;
4794   __Pyx_RefNannyDeclarations
4795   __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
4796   {
4797     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_num_grids,&__pyx_n_s_left_edge,&__pyx_n_s_right_edge,&__pyx_n_s_dimensions,&__pyx_n_s_parent_ind,&__pyx_n_s_level,&__pyx_n_s_num_children,0};
4798     PyObject* values[7] = {0,0,0,0,0,0,0};
4799     if (unlikely(__pyx_kwds)) {
4800       Py_ssize_t kw_args;
4801       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4802       switch (pos_args) {
4803         case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
4804         CYTHON_FALLTHROUGH;
4805         case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4806         CYTHON_FALLTHROUGH;
4807         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4808         CYTHON_FALLTHROUGH;
4809         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4810         CYTHON_FALLTHROUGH;
4811         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4812         CYTHON_FALLTHROUGH;
4813         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4814         CYTHON_FALLTHROUGH;
4815         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4816         CYTHON_FALLTHROUGH;
4817         case  0: break;
4818         default: goto __pyx_L5_argtuple_error;
4819       }
4820       kw_args = PyDict_Size(__pyx_kwds);
4821       switch (pos_args) {
4822         case  0:
4823         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_num_grids)) != 0)) kw_args--;
4824         else goto __pyx_L5_argtuple_error;
4825         CYTHON_FALLTHROUGH;
4826         case  1:
4827         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_left_edge)) != 0)) kw_args--;
4828         else {
4829           __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 7, 7, 1); __PYX_ERR(0, 54, __pyx_L3_error)
4830         }
4831         CYTHON_FALLTHROUGH;
4832         case  2:
4833         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_right_edge)) != 0)) kw_args--;
4834         else {
4835           __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 7, 7, 2); __PYX_ERR(0, 54, __pyx_L3_error)
4836         }
4837         CYTHON_FALLTHROUGH;
4838         case  3:
4839         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dimensions)) != 0)) kw_args--;
4840         else {
4841           __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 7, 7, 3); __PYX_ERR(0, 54, __pyx_L3_error)
4842         }
4843         CYTHON_FALLTHROUGH;
4844         case  4:
4845         if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parent_ind)) != 0)) kw_args--;
4846         else {
4847           __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 7, 7, 4); __PYX_ERR(0, 54, __pyx_L3_error)
4848         }
4849         CYTHON_FALLTHROUGH;
4850         case  5:
4851         if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_level)) != 0)) kw_args--;
4852         else {
4853           __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 7, 7, 5); __PYX_ERR(0, 54, __pyx_L3_error)
4854         }
4855         CYTHON_FALLTHROUGH;
4856         case  6:
4857         if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_num_children)) != 0)) kw_args--;
4858         else {
4859           __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 7, 7, 6); __PYX_ERR(0, 54, __pyx_L3_error)
4860         }
4861       }
4862       if (unlikely(kw_args > 0)) {
4863         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 54, __pyx_L3_error)
4864       }
4865     } else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
4866       goto __pyx_L5_argtuple_error;
4867     } else {
4868       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4869       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4870       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4871       values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4872       values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4873       values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4874       values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
4875     }
4876     __pyx_v_num_grids = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_num_grids == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error)
4877     __pyx_v_left_edge = ((PyArrayObject *)values[1]);
4878     __pyx_v_right_edge = ((PyArrayObject *)values[2]);
4879     __pyx_v_dimensions = ((PyArrayObject *)values[3]);
4880     __pyx_v_parent_ind = ((PyArrayObject *)values[4]);
4881     __pyx_v_level = ((PyArrayObject *)values[5]);
4882     __pyx_v_num_children = ((PyArrayObject *)values[6]);
4883   }
4884   goto __pyx_L4_argument_unpacking_done;
4885   __pyx_L5_argtuple_error:;
4886   __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 54, __pyx_L3_error)
4887   __pyx_L3_error:;
4888   __Pyx_AddTraceback("yt.geometry.grid_container.GridTree.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4889   __Pyx_RefNannyFinishContext();
4890   return -1;
4891   __pyx_L4_argument_unpacking_done:;
4892   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_left_edge), __pyx_ptype_5numpy_ndarray, 1, "left_edge", 0))) __PYX_ERR(0, 55, __pyx_L1_error)
4893   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_right_edge), __pyx_ptype_5numpy_ndarray, 1, "right_edge", 0))) __PYX_ERR(0, 56, __pyx_L1_error)
4894   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dimensions), __pyx_ptype_5numpy_ndarray, 1, "dimensions", 0))) __PYX_ERR(0, 57, __pyx_L1_error)
4895   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parent_ind), __pyx_ptype_5numpy_ndarray, 1, "parent_ind", 0))) __PYX_ERR(0, 58, __pyx_L1_error)
4896   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_level), __pyx_ptype_5numpy_ndarray, 1, "level", 0))) __PYX_ERR(0, 59, __pyx_L1_error)
4897   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_num_children), __pyx_ptype_5numpy_ndarray, 1, "num_children", 0))) __PYX_ERR(0, 60, __pyx_L1_error)
4898   __pyx_r = __pyx_pf_2yt_8geometry_14grid_container_8GridTree___cinit__(((struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self), __pyx_v_num_grids, __pyx_v_left_edge, __pyx_v_right_edge, __pyx_v_dimensions, __pyx_v_parent_ind, __pyx_v_level, __pyx_v_num_children);
4899 
4900   /* function exit code */
4901   goto __pyx_L0;
4902   __pyx_L1_error:;
4903   __pyx_r = -1;
4904   __pyx_L0:;
4905   __Pyx_RefNannyFinishContext();
4906   return __pyx_r;
4907 }
4908 
__pyx_pf_2yt_8geometry_14grid_container_8GridTree___cinit__(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree * __pyx_v_self,int __pyx_v_num_grids,PyArrayObject * __pyx_v_left_edge,PyArrayObject * __pyx_v_right_edge,PyArrayObject * __pyx_v_dimensions,PyArrayObject * __pyx_v_parent_ind,PyArrayObject * __pyx_v_level,PyArrayObject * __pyx_v_num_children)4909 static int __pyx_pf_2yt_8geometry_14grid_container_8GridTree___cinit__(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *__pyx_v_self, int __pyx_v_num_grids, PyArrayObject *__pyx_v_left_edge, PyArrayObject *__pyx_v_right_edge, PyArrayObject *__pyx_v_dimensions, PyArrayObject *__pyx_v_parent_ind, PyArrayObject *__pyx_v_level, PyArrayObject *__pyx_v_num_children) {
4910   int __pyx_v_i;
4911   int __pyx_v_j;
4912   int __pyx_v_k;
4913   PyArrayObject *__pyx_v_child_ptr = 0;
4914   __Pyx_LocalBuf_ND __pyx_pybuffernd_child_ptr;
4915   __Pyx_Buffer __pyx_pybuffer_child_ptr;
4916   __Pyx_LocalBuf_ND __pyx_pybuffernd_dimensions;
4917   __Pyx_Buffer __pyx_pybuffer_dimensions;
4918   __Pyx_LocalBuf_ND __pyx_pybuffernd_left_edge;
4919   __Pyx_Buffer __pyx_pybuffer_left_edge;
4920   __Pyx_LocalBuf_ND __pyx_pybuffernd_level;
4921   __Pyx_Buffer __pyx_pybuffer_level;
4922   __Pyx_LocalBuf_ND __pyx_pybuffernd_num_children;
4923   __Pyx_Buffer __pyx_pybuffer_num_children;
4924   __Pyx_LocalBuf_ND __pyx_pybuffernd_parent_ind;
4925   __Pyx_Buffer __pyx_pybuffer_parent_ind;
4926   __Pyx_LocalBuf_ND __pyx_pybuffernd_right_edge;
4927   __Pyx_Buffer __pyx_pybuffer_right_edge;
4928   int __pyx_r;
4929   __Pyx_RefNannyDeclarations
4930   PyObject *__pyx_t_1 = NULL;
4931   PyObject *__pyx_t_2 = NULL;
4932   PyObject *__pyx_t_3 = NULL;
4933   PyObject *__pyx_t_4 = NULL;
4934   PyArrayObject *__pyx_t_5 = NULL;
4935   int __pyx_t_6;
4936   PyObject *__pyx_t_7 = NULL;
4937   PyObject *__pyx_t_8 = NULL;
4938   PyObject *__pyx_t_9 = NULL;
4939   int __pyx_t_10;
4940   int __pyx_t_11;
4941   Py_ssize_t __pyx_t_12;
4942   Py_ssize_t __pyx_t_13;
4943   Py_ssize_t __pyx_t_14;
4944   int __pyx_t_15;
4945   Py_ssize_t __pyx_t_16;
4946   Py_ssize_t __pyx_t_17;
4947   Py_ssize_t __pyx_t_18;
4948   Py_ssize_t __pyx_t_19;
4949   __Pyx_RefNannySetupContext("__cinit__", 0);
4950   __pyx_pybuffer_child_ptr.pybuffer.buf = NULL;
4951   __pyx_pybuffer_child_ptr.refcount = 0;
4952   __pyx_pybuffernd_child_ptr.data = NULL;
4953   __pyx_pybuffernd_child_ptr.rcbuffer = &__pyx_pybuffer_child_ptr;
4954   __pyx_pybuffer_left_edge.pybuffer.buf = NULL;
4955   __pyx_pybuffer_left_edge.refcount = 0;
4956   __pyx_pybuffernd_left_edge.data = NULL;
4957   __pyx_pybuffernd_left_edge.rcbuffer = &__pyx_pybuffer_left_edge;
4958   __pyx_pybuffer_right_edge.pybuffer.buf = NULL;
4959   __pyx_pybuffer_right_edge.refcount = 0;
4960   __pyx_pybuffernd_right_edge.data = NULL;
4961   __pyx_pybuffernd_right_edge.rcbuffer = &__pyx_pybuffer_right_edge;
4962   __pyx_pybuffer_dimensions.pybuffer.buf = NULL;
4963   __pyx_pybuffer_dimensions.refcount = 0;
4964   __pyx_pybuffernd_dimensions.data = NULL;
4965   __pyx_pybuffernd_dimensions.rcbuffer = &__pyx_pybuffer_dimensions;
4966   __pyx_pybuffer_parent_ind.pybuffer.buf = NULL;
4967   __pyx_pybuffer_parent_ind.refcount = 0;
4968   __pyx_pybuffernd_parent_ind.data = NULL;
4969   __pyx_pybuffernd_parent_ind.rcbuffer = &__pyx_pybuffer_parent_ind;
4970   __pyx_pybuffer_level.pybuffer.buf = NULL;
4971   __pyx_pybuffer_level.refcount = 0;
4972   __pyx_pybuffernd_level.data = NULL;
4973   __pyx_pybuffernd_level.rcbuffer = &__pyx_pybuffer_level;
4974   __pyx_pybuffer_num_children.pybuffer.buf = NULL;
4975   __pyx_pybuffer_num_children.refcount = 0;
4976   __pyx_pybuffernd_num_children.data = NULL;
4977   __pyx_pybuffernd_num_children.rcbuffer = &__pyx_pybuffer_num_children;
4978   {
4979     __Pyx_BufFmt_StackElem __pyx_stack[1];
4980     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_left_edge.rcbuffer->pybuffer, (PyObject*)__pyx_v_left_edge, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 54, __pyx_L1_error)
4981   }
4982   __pyx_pybuffernd_left_edge.diminfo[0].strides = __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_left_edge.diminfo[0].shape = __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_left_edge.diminfo[1].strides = __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_left_edge.diminfo[1].shape = __pyx_pybuffernd_left_edge.rcbuffer->pybuffer.shape[1];
4983   {
4984     __Pyx_BufFmt_StackElem __pyx_stack[1];
4985     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_right_edge.rcbuffer->pybuffer, (PyObject*)__pyx_v_right_edge, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 54, __pyx_L1_error)
4986   }
4987   __pyx_pybuffernd_right_edge.diminfo[0].strides = __pyx_pybuffernd_right_edge.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_right_edge.diminfo[0].shape = __pyx_pybuffernd_right_edge.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_right_edge.diminfo[1].strides = __pyx_pybuffernd_right_edge.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_right_edge.diminfo[1].shape = __pyx_pybuffernd_right_edge.rcbuffer->pybuffer.shape[1];
4988   {
4989     __Pyx_BufFmt_StackElem __pyx_stack[1];
4990     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dimensions.rcbuffer->pybuffer, (PyObject*)__pyx_v_dimensions, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 54, __pyx_L1_error)
4991   }
4992   __pyx_pybuffernd_dimensions.diminfo[0].strides = __pyx_pybuffernd_dimensions.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dimensions.diminfo[0].shape = __pyx_pybuffernd_dimensions.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dimensions.diminfo[1].strides = __pyx_pybuffernd_dimensions.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dimensions.diminfo[1].shape = __pyx_pybuffernd_dimensions.rcbuffer->pybuffer.shape[1];
4993   {
4994     __Pyx_BufFmt_StackElem __pyx_stack[1];
4995     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_parent_ind.rcbuffer->pybuffer, (PyObject*)__pyx_v_parent_ind, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 54, __pyx_L1_error)
4996   }
4997   __pyx_pybuffernd_parent_ind.diminfo[0].strides = __pyx_pybuffernd_parent_ind.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_parent_ind.diminfo[0].shape = __pyx_pybuffernd_parent_ind.rcbuffer->pybuffer.shape[0];
4998   {
4999     __Pyx_BufFmt_StackElem __pyx_stack[1];
5000     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_level.rcbuffer->pybuffer, (PyObject*)__pyx_v_level, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 54, __pyx_L1_error)
5001   }
5002   __pyx_pybuffernd_level.diminfo[0].strides = __pyx_pybuffernd_level.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_level.diminfo[0].shape = __pyx_pybuffernd_level.rcbuffer->pybuffer.shape[0];
5003   {
5004     __Pyx_BufFmt_StackElem __pyx_stack[1];
5005     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_num_children.rcbuffer->pybuffer, (PyObject*)__pyx_v_num_children, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 54, __pyx_L1_error)
5006   }
5007   __pyx_pybuffernd_num_children.diminfo[0].strides = __pyx_pybuffernd_num_children.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_num_children.diminfo[0].shape = __pyx_pybuffernd_num_children.rcbuffer->pybuffer.shape[0];
5008 
5009   /* "yt/geometry/grid_container.pyx":65
5010  *         cdef np.ndarray[np.int_t, ndim=1] child_ptr
5011  *
5012  *         child_ptr = np.zeros(num_grids, dtype='int')             # <<<<<<<<<<<<<<
5013  *
5014  *         self.num_grids = num_grids
5015  */
5016   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error)
5017   __Pyx_GOTREF(__pyx_t_1);
5018   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error)
5019   __Pyx_GOTREF(__pyx_t_2);
5020   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5021   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_num_grids); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error)
5022   __Pyx_GOTREF(__pyx_t_1);
5023   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error)
5024   __Pyx_GOTREF(__pyx_t_3);
5025   __Pyx_GIVEREF(__pyx_t_1);
5026   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
5027   __pyx_t_1 = 0;
5028   __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error)
5029   __Pyx_GOTREF(__pyx_t_1);
5030   if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_int) < 0) __PYX_ERR(0, 65, __pyx_L1_error)
5031   __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 65, __pyx_L1_error)
5032   __Pyx_GOTREF(__pyx_t_4);
5033   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5034   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5035   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5036   if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 65, __pyx_L1_error)
5037   __pyx_t_5 = ((PyArrayObject *)__pyx_t_4);
5038   {
5039     __Pyx_BufFmt_StackElem __pyx_stack[1];
5040     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_child_ptr.rcbuffer->pybuffer);
5041     __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_child_ptr.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
5042     if (unlikely(__pyx_t_6 < 0)) {
5043       PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
5044       if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_child_ptr.rcbuffer->pybuffer, (PyObject*)__pyx_v_child_ptr, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
5045         Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9);
5046         __Pyx_RaiseBufferFallbackError();
5047       } else {
5048         PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
5049       }
5050       __pyx_t_7 = __pyx_t_8 = __pyx_t_9 = 0;
5051     }
5052     __pyx_pybuffernd_child_ptr.diminfo[0].strides = __pyx_pybuffernd_child_ptr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_child_ptr.diminfo[0].shape = __pyx_pybuffernd_child_ptr.rcbuffer->pybuffer.shape[0];
5053     if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 65, __pyx_L1_error)
5054   }
5055   __pyx_t_5 = 0;
5056   __pyx_v_child_ptr = ((PyArrayObject *)__pyx_t_4);
5057   __pyx_t_4 = 0;
5058 
5059   /* "yt/geometry/grid_container.pyx":67
5060  *         child_ptr = np.zeros(num_grids, dtype='int')
5061  *
5062  *         self.num_grids = num_grids             # <<<<<<<<<<<<<<
5063  *         self.num_root_grids = 0
5064  *         self.num_leaf_grids = 0
5065  */
5066   __pyx_v_self->num_grids = __pyx_v_num_grids;
5067 
5068   /* "yt/geometry/grid_container.pyx":68
5069  *
5070  *         self.num_grids = num_grids
5071  *         self.num_root_grids = 0             # <<<<<<<<<<<<<<
5072  *         self.num_leaf_grids = 0
5073  *
5074  */
5075   __pyx_v_self->num_root_grids = 0;
5076 
5077   /* "yt/geometry/grid_container.pyx":69
5078  *         self.num_grids = num_grids
5079  *         self.num_root_grids = 0
5080  *         self.num_leaf_grids = 0             # <<<<<<<<<<<<<<
5081  *
5082  *         self.grids = <GridTreeNode *> malloc(
5083  */
5084   __pyx_v_self->num_leaf_grids = 0;
5085 
5086   /* "yt/geometry/grid_container.pyx":71
5087  *         self.num_leaf_grids = 0
5088  *
5089  *         self.grids = <GridTreeNode *> malloc(             # <<<<<<<<<<<<<<
5090  *                 sizeof(GridTreeNode) * num_grids)
5091  *
5092  */
5093   __pyx_v_self->grids = ((struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode *)malloc(((sizeof(struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode)) * __pyx_v_num_grids)));
5094 
5095   /* "yt/geometry/grid_container.pyx":74
5096  *                 sizeof(GridTreeNode) * num_grids)
5097  *
5098  *         for i in range(num_grids):             # <<<<<<<<<<<<<<
5099  *             self.grids[i] = Grid_initialize(left_edge[i,:],
5100  *                                             right_edge[i,:],
5101  */
5102   __pyx_t_6 = __pyx_v_num_grids;
5103   __pyx_t_10 = __pyx_t_6;
5104   for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
5105     __pyx_v_i = __pyx_t_11;
5106 
5107     /* "yt/geometry/grid_container.pyx":75
5108  *
5109  *         for i in range(num_grids):
5110  *             self.grids[i] = Grid_initialize(left_edge[i,:],             # <<<<<<<<<<<<<<
5111  *                                             right_edge[i,:],
5112  *                                             dimensions[i,:],
5113  */
5114     __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 75, __pyx_L1_error)
5115     __Pyx_GOTREF(__pyx_t_4);
5116     __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error)
5117     __Pyx_GOTREF(__pyx_t_1);
5118     __Pyx_GIVEREF(__pyx_t_4);
5119     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
5120     __Pyx_INCREF(__pyx_slice_);
5121     __Pyx_GIVEREF(__pyx_slice_);
5122     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_slice_);
5123     __pyx_t_4 = 0;
5124     __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_left_edge), __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 75, __pyx_L1_error)
5125     __Pyx_GOTREF(__pyx_t_4);
5126     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5127     if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 75, __pyx_L1_error)
5128 
5129     /* "yt/geometry/grid_container.pyx":76
5130  *         for i in range(num_grids):
5131  *             self.grids[i] = Grid_initialize(left_edge[i,:],
5132  *                                             right_edge[i,:],             # <<<<<<<<<<<<<<
5133  *                                             dimensions[i,:],
5134  *                                             num_children[i],
5135  */
5136     __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error)
5137     __Pyx_GOTREF(__pyx_t_1);
5138     __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error)
5139     __Pyx_GOTREF(__pyx_t_3);
5140     __Pyx_GIVEREF(__pyx_t_1);
5141     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
5142     __Pyx_INCREF(__pyx_slice_);
5143     __Pyx_GIVEREF(__pyx_slice_);
5144     PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_slice_);
5145     __pyx_t_1 = 0;
5146     __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_right_edge), __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error)
5147     __Pyx_GOTREF(__pyx_t_1);
5148     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5149     if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 76, __pyx_L1_error)
5150 
5151     /* "yt/geometry/grid_container.pyx":77
5152  *             self.grids[i] = Grid_initialize(left_edge[i,:],
5153  *                                             right_edge[i,:],
5154  *                                             dimensions[i,:],             # <<<<<<<<<<<<<<
5155  *                                             num_children[i],
5156  *                                             level[i], i)
5157  */
5158     __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error)
5159     __Pyx_GOTREF(__pyx_t_3);
5160     __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 77, __pyx_L1_error)
5161     __Pyx_GOTREF(__pyx_t_2);
5162     __Pyx_GIVEREF(__pyx_t_3);
5163     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
5164     __Pyx_INCREF(__pyx_slice_);
5165     __Pyx_GIVEREF(__pyx_slice_);
5166     PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_slice_);
5167     __pyx_t_3 = 0;
5168     __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_dimensions), __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error)
5169     __Pyx_GOTREF(__pyx_t_3);
5170     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5171     if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 77, __pyx_L1_error)
5172 
5173     /* "yt/geometry/grid_container.pyx":78
5174  *                                             right_edge[i,:],
5175  *                                             dimensions[i,:],
5176  *                                             num_children[i],             # <<<<<<<<<<<<<<
5177  *                                             level[i], i)
5178  *             if level[i] == 0:
5179  */
5180     __pyx_t_12 = __pyx_v_i;
5181 
5182     /* "yt/geometry/grid_container.pyx":79
5183  *                                             dimensions[i,:],
5184  *                                             num_children[i],
5185  *                                             level[i], i)             # <<<<<<<<<<<<<<
5186  *             if level[i] == 0:
5187  *                 self.num_root_grids += 1
5188  */
5189     __pyx_t_13 = __pyx_v_i;
5190 
5191     /* "yt/geometry/grid_container.pyx":75
5192  *
5193  *         for i in range(num_grids):
5194  *             self.grids[i] = Grid_initialize(left_edge[i,:],             # <<<<<<<<<<<<<<
5195  *                                             right_edge[i,:],
5196  *                                             dimensions[i,:],
5197  */
5198     (__pyx_v_self->grids[__pyx_v_i]) = __pyx_f_2yt_8geometry_14grid_container_Grid_initialize(((PyArrayObject *)__pyx_t_4), ((PyArrayObject *)__pyx_t_1), ((PyArrayObject *)__pyx_t_3), (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_num_children.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_num_children.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_level.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_level.diminfo[0].strides)), __pyx_v_i);
5199     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5200     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5201     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5202 
5203     /* "yt/geometry/grid_container.pyx":80
5204  *                                             num_children[i],
5205  *                                             level[i], i)
5206  *             if level[i] == 0:             # <<<<<<<<<<<<<<
5207  *                 self.num_root_grids += 1
5208  *             if num_children[i] == 0:
5209  */
5210     __pyx_t_14 = __pyx_v_i;
5211     __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_level.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_level.diminfo[0].strides)) == 0) != 0);
5212     if (__pyx_t_15) {
5213 
5214       /* "yt/geometry/grid_container.pyx":81
5215  *                                             level[i], i)
5216  *             if level[i] == 0:
5217  *                 self.num_root_grids += 1             # <<<<<<<<<<<<<<
5218  *             if num_children[i] == 0:
5219  *                 self.num_leaf_grids += 1
5220  */
5221       __pyx_v_self->num_root_grids = (__pyx_v_self->num_root_grids + 1);
5222 
5223       /* "yt/geometry/grid_container.pyx":80
5224  *                                             num_children[i],
5225  *                                             level[i], i)
5226  *             if level[i] == 0:             # <<<<<<<<<<<<<<
5227  *                 self.num_root_grids += 1
5228  *             if num_children[i] == 0:
5229  */
5230     }
5231 
5232     /* "yt/geometry/grid_container.pyx":82
5233  *             if level[i] == 0:
5234  *                 self.num_root_grids += 1
5235  *             if num_children[i] == 0:             # <<<<<<<<<<<<<<
5236  *                 self.num_leaf_grids += 1
5237  *
5238  */
5239     __pyx_t_16 = __pyx_v_i;
5240     __pyx_t_15 = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_num_children.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_num_children.diminfo[0].strides)) == 0) != 0);
5241     if (__pyx_t_15) {
5242 
5243       /* "yt/geometry/grid_container.pyx":83
5244  *                 self.num_root_grids += 1
5245  *             if num_children[i] == 0:
5246  *                 self.num_leaf_grids += 1             # <<<<<<<<<<<<<<
5247  *
5248  *         self.root_grids = <GridTreeNode *> malloc(
5249  */
5250       __pyx_v_self->num_leaf_grids = (__pyx_v_self->num_leaf_grids + 1);
5251 
5252       /* "yt/geometry/grid_container.pyx":82
5253  *             if level[i] == 0:
5254  *                 self.num_root_grids += 1
5255  *             if num_children[i] == 0:             # <<<<<<<<<<<<<<
5256  *                 self.num_leaf_grids += 1
5257  *
5258  */
5259     }
5260   }
5261 
5262   /* "yt/geometry/grid_container.pyx":85
5263  *                 self.num_leaf_grids += 1
5264  *
5265  *         self.root_grids = <GridTreeNode *> malloc(             # <<<<<<<<<<<<<<
5266  *                 sizeof(GridTreeNode) * self.num_root_grids)
5267  *         k = 0
5268  */
5269   __pyx_v_self->root_grids = ((struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode *)malloc(((sizeof(struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode)) * __pyx_v_self->num_root_grids)));
5270 
5271   /* "yt/geometry/grid_container.pyx":87
5272  *         self.root_grids = <GridTreeNode *> malloc(
5273  *                 sizeof(GridTreeNode) * self.num_root_grids)
5274  *         k = 0             # <<<<<<<<<<<<<<
5275  *         for i in range(num_grids):
5276  *             j = parent_ind[i]
5277  */
5278   __pyx_v_k = 0;
5279 
5280   /* "yt/geometry/grid_container.pyx":88
5281  *                 sizeof(GridTreeNode) * self.num_root_grids)
5282  *         k = 0
5283  *         for i in range(num_grids):             # <<<<<<<<<<<<<<
5284  *             j = parent_ind[i]
5285  *             if j >= 0:
5286  */
5287   __pyx_t_6 = __pyx_v_num_grids;
5288   __pyx_t_10 = __pyx_t_6;
5289   for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
5290     __pyx_v_i = __pyx_t_11;
5291 
5292     /* "yt/geometry/grid_container.pyx":89
5293  *         k = 0
5294  *         for i in range(num_grids):
5295  *             j = parent_ind[i]             # <<<<<<<<<<<<<<
5296  *             if j >= 0:
5297  *                 self.grids[j].children[child_ptr[j]] = &self.grids[i]
5298  */
5299     __pyx_t_17 = __pyx_v_i;
5300     __pyx_v_j = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_parent_ind.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_parent_ind.diminfo[0].strides));
5301 
5302     /* "yt/geometry/grid_container.pyx":90
5303  *         for i in range(num_grids):
5304  *             j = parent_ind[i]
5305  *             if j >= 0:             # <<<<<<<<<<<<<<
5306  *                 self.grids[j].children[child_ptr[j]] = &self.grids[i]
5307  *                 child_ptr[j] += 1
5308  */
5309     __pyx_t_15 = ((__pyx_v_j >= 0) != 0);
5310     if (__pyx_t_15) {
5311 
5312       /* "yt/geometry/grid_container.pyx":91
5313  *             j = parent_ind[i]
5314  *             if j >= 0:
5315  *                 self.grids[j].children[child_ptr[j]] = &self.grids[i]             # <<<<<<<<<<<<<<
5316  *                 child_ptr[j] += 1
5317  *             else:
5318  */
5319       __pyx_t_18 = __pyx_v_j;
5320       ((__pyx_v_self->grids[__pyx_v_j]).children[(*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int_t *, __pyx_pybuffernd_child_ptr.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_child_ptr.diminfo[0].strides))]) = (&(__pyx_v_self->grids[__pyx_v_i]));
5321 
5322       /* "yt/geometry/grid_container.pyx":92
5323  *             if j >= 0:
5324  *                 self.grids[j].children[child_ptr[j]] = &self.grids[i]
5325  *                 child_ptr[j] += 1             # <<<<<<<<<<<<<<
5326  *             else:
5327  *                 if k >= self.num_root_grids:
5328  */
5329       __pyx_t_19 = __pyx_v_j;
5330       *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int_t *, __pyx_pybuffernd_child_ptr.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_child_ptr.diminfo[0].strides) += 1;
5331 
5332       /* "yt/geometry/grid_container.pyx":90
5333  *         for i in range(num_grids):
5334  *             j = parent_ind[i]
5335  *             if j >= 0:             # <<<<<<<<<<<<<<
5336  *                 self.grids[j].children[child_ptr[j]] = &self.grids[i]
5337  *                 child_ptr[j] += 1
5338  */
5339       goto __pyx_L9;
5340     }
5341 
5342     /* "yt/geometry/grid_container.pyx":94
5343  *                 child_ptr[j] += 1
5344  *             else:
5345  *                 if k >= self.num_root_grids:             # <<<<<<<<<<<<<<
5346  *                     raise RuntimeError
5347  *                 self.root_grids[k] = self.grids[i]
5348  */
5349     /*else*/ {
5350       __pyx_t_15 = ((__pyx_v_k >= __pyx_v_self->num_root_grids) != 0);
5351       if (unlikely(__pyx_t_15)) {
5352 
5353         /* "yt/geometry/grid_container.pyx":95
5354  *             else:
5355  *                 if k >= self.num_root_grids:
5356  *                     raise RuntimeError             # <<<<<<<<<<<<<<
5357  *                 self.root_grids[k] = self.grids[i]
5358  *                 k = k + 1
5359  */
5360         __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0);
5361         __PYX_ERR(0, 95, __pyx_L1_error)
5362 
5363         /* "yt/geometry/grid_container.pyx":94
5364  *                 child_ptr[j] += 1
5365  *             else:
5366  *                 if k >= self.num_root_grids:             # <<<<<<<<<<<<<<
5367  *                     raise RuntimeError
5368  *                 self.root_grids[k] = self.grids[i]
5369  */
5370       }
5371 
5372       /* "yt/geometry/grid_container.pyx":96
5373  *                 if k >= self.num_root_grids:
5374  *                     raise RuntimeError
5375  *                 self.root_grids[k] = self.grids[i]             # <<<<<<<<<<<<<<
5376  *                 k = k + 1
5377  *
5378  */
5379       (__pyx_v_self->root_grids[__pyx_v_k]) = (__pyx_v_self->grids[__pyx_v_i]);
5380 
5381       /* "yt/geometry/grid_container.pyx":97
5382  *                     raise RuntimeError
5383  *                 self.root_grids[k] = self.grids[i]
5384  *                 k = k + 1             # <<<<<<<<<<<<<<
5385  *
5386  *     def __init__(self, *args, **kwargs):
5387  */
5388       __pyx_v_k = (__pyx_v_k + 1);
5389     }
5390     __pyx_L9:;
5391   }
5392 
5393   /* "yt/geometry/grid_container.pyx":54
5394  *     @cython.wraparound(False)
5395  *     @cython.cdivision(True)
5396  *     def __cinit__(self, int num_grids,             # <<<<<<<<<<<<<<
5397  *                   np.ndarray[np.float64_t, ndim=2] left_edge,
5398  *                   np.ndarray[np.float64_t, ndim=2] right_edge,
5399  */
5400 
5401   /* function exit code */
5402   __pyx_r = 0;
5403   goto __pyx_L0;
5404   __pyx_L1_error:;
5405   __Pyx_XDECREF(__pyx_t_1);
5406   __Pyx_XDECREF(__pyx_t_2);
5407   __Pyx_XDECREF(__pyx_t_3);
5408   __Pyx_XDECREF(__pyx_t_4);
5409   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
5410     __Pyx_PyThreadState_declare
5411     __Pyx_PyThreadState_assign
5412     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
5413     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_child_ptr.rcbuffer->pybuffer);
5414     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dimensions.rcbuffer->pybuffer);
5415     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_edge.rcbuffer->pybuffer);
5416     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_level.rcbuffer->pybuffer);
5417     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_num_children.rcbuffer->pybuffer);
5418     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_parent_ind.rcbuffer->pybuffer);
5419     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_edge.rcbuffer->pybuffer);
5420   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
5421   __Pyx_AddTraceback("yt.geometry.grid_container.GridTree.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5422   __pyx_r = -1;
5423   goto __pyx_L2;
5424   __pyx_L0:;
5425   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_child_ptr.rcbuffer->pybuffer);
5426   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dimensions.rcbuffer->pybuffer);
5427   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_left_edge.rcbuffer->pybuffer);
5428   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_level.rcbuffer->pybuffer);
5429   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_num_children.rcbuffer->pybuffer);
5430   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_parent_ind.rcbuffer->pybuffer);
5431   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_right_edge.rcbuffer->pybuffer);
5432   __pyx_L2:;
5433   __Pyx_XDECREF((PyObject *)__pyx_v_child_ptr);
5434   __Pyx_RefNannyFinishContext();
5435   return __pyx_r;
5436 }
5437 
5438 /* "yt/geometry/grid_container.pyx":99
5439  *                 k = k + 1
5440  *
5441  *     def __init__(self, *args, **kwargs):             # <<<<<<<<<<<<<<
5442  *         self.mask = None
5443  *
5444  */
5445 
5446 /* Python wrapper */
5447 static int __pyx_pw_2yt_8geometry_14grid_container_8GridTree_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2yt_8geometry_14grid_container_8GridTree_3__init__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)5448 static int __pyx_pw_2yt_8geometry_14grid_container_8GridTree_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5449   CYTHON_UNUSED PyObject *__pyx_v_args = 0;
5450   CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0;
5451   int __pyx_r;
5452   __Pyx_RefNannyDeclarations
5453   __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
5454   if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1;
5455   __Pyx_INCREF(__pyx_args);
5456   __pyx_v_args = __pyx_args;
5457   __pyx_r = __pyx_pf_2yt_8geometry_14grid_container_8GridTree_2__init__(((struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs);
5458 
5459   /* function exit code */
5460   __Pyx_XDECREF(__pyx_v_args);
5461   __Pyx_XDECREF(__pyx_v_kwargs);
5462   __Pyx_RefNannyFinishContext();
5463   return __pyx_r;
5464 }
5465 
__pyx_pf_2yt_8geometry_14grid_container_8GridTree_2__init__(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v_args,CYTHON_UNUSED PyObject * __pyx_v_kwargs)5466 static int __pyx_pf_2yt_8geometry_14grid_container_8GridTree_2__init__(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs) {
5467   int __pyx_r;
5468   __Pyx_RefNannyDeclarations
5469   __Pyx_RefNannySetupContext("__init__", 0);
5470 
5471   /* "yt/geometry/grid_container.pyx":100
5472  *
5473  *     def __init__(self, *args, **kwargs):
5474  *         self.mask = None             # <<<<<<<<<<<<<<
5475  *
5476  *     def __iter__(self):
5477  */
5478   __Pyx_INCREF(Py_None);
5479   __Pyx_GIVEREF(Py_None);
5480   __Pyx_GOTREF(__pyx_v_self->mask);
5481   __Pyx_DECREF(((PyObject *)__pyx_v_self->mask));
5482   __pyx_v_self->mask = ((struct __pyx_obj_2yt_9utilities_3lib_8bitarray_bitarray *)Py_None);
5483 
5484   /* "yt/geometry/grid_container.pyx":99
5485  *                 k = k + 1
5486  *
5487  *     def __init__(self, *args, **kwargs):             # <<<<<<<<<<<<<<
5488  *         self.mask = None
5489  *
5490  */
5491 
5492   /* function exit code */
5493   __pyx_r = 0;
5494   __Pyx_RefNannyFinishContext();
5495   return __pyx_r;
5496 }
5497 static PyObject *__pyx_gb_2yt_8geometry_14grid_container_8GridTree_6generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
5498 
5499 /* "yt/geometry/grid_container.pyx":102
5500  *         self.mask = None
5501  *
5502  *     def __iter__(self):             # <<<<<<<<<<<<<<
5503  *         yield self
5504  *
5505  */
5506 
5507 /* Python wrapper */
5508 static PyObject *__pyx_pw_2yt_8geometry_14grid_container_8GridTree_5__iter__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2yt_8geometry_14grid_container_8GridTree_5__iter__(PyObject * __pyx_v_self)5509 static PyObject *__pyx_pw_2yt_8geometry_14grid_container_8GridTree_5__iter__(PyObject *__pyx_v_self) {
5510   PyObject *__pyx_r = 0;
5511   __Pyx_RefNannyDeclarations
5512   __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
5513   __pyx_r = __pyx_pf_2yt_8geometry_14grid_container_8GridTree_4__iter__(((struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self));
5514 
5515   /* function exit code */
5516   __Pyx_RefNannyFinishContext();
5517   return __pyx_r;
5518 }
5519 
__pyx_pf_2yt_8geometry_14grid_container_8GridTree_4__iter__(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree * __pyx_v_self)5520 static PyObject *__pyx_pf_2yt_8geometry_14grid_container_8GridTree_4__iter__(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *__pyx_v_self) {
5521   struct __pyx_obj_2yt_8geometry_14grid_container___pyx_scope_struct____iter__ *__pyx_cur_scope;
5522   PyObject *__pyx_r = NULL;
5523   __Pyx_RefNannyDeclarations
5524   __Pyx_RefNannySetupContext("__iter__", 0);
5525   __pyx_cur_scope = (struct __pyx_obj_2yt_8geometry_14grid_container___pyx_scope_struct____iter__ *)__pyx_tp_new_2yt_8geometry_14grid_container___pyx_scope_struct____iter__(__pyx_ptype_2yt_8geometry_14grid_container___pyx_scope_struct____iter__, __pyx_empty_tuple, NULL);
5526   if (unlikely(!__pyx_cur_scope)) {
5527     __pyx_cur_scope = ((struct __pyx_obj_2yt_8geometry_14grid_container___pyx_scope_struct____iter__ *)Py_None);
5528     __Pyx_INCREF(Py_None);
5529     __PYX_ERR(0, 102, __pyx_L1_error)
5530   } else {
5531     __Pyx_GOTREF(__pyx_cur_scope);
5532   }
5533   __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
5534   __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
5535   __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
5536   {
5537     __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_2yt_8geometry_14grid_container_8GridTree_6generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_GridTree___iter, __pyx_n_s_yt_geometry_grid_container); if (unlikely(!gen)) __PYX_ERR(0, 102, __pyx_L1_error)
5538     __Pyx_DECREF(__pyx_cur_scope);
5539     __Pyx_RefNannyFinishContext();
5540     return (PyObject *) gen;
5541   }
5542 
5543   /* function exit code */
5544   __pyx_L1_error:;
5545   __Pyx_AddTraceback("yt.geometry.grid_container.GridTree.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5546   __pyx_r = NULL;
5547   __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
5548   __Pyx_XGIVEREF(__pyx_r);
5549   __Pyx_RefNannyFinishContext();
5550   return __pyx_r;
5551 }
5552 
__pyx_gb_2yt_8geometry_14grid_container_8GridTree_6generator(__pyx_CoroutineObject * __pyx_generator,CYTHON_UNUSED PyThreadState * __pyx_tstate,PyObject * __pyx_sent_value)5553 static PyObject *__pyx_gb_2yt_8geometry_14grid_container_8GridTree_6generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
5554 {
5555   struct __pyx_obj_2yt_8geometry_14grid_container___pyx_scope_struct____iter__ *__pyx_cur_scope = ((struct __pyx_obj_2yt_8geometry_14grid_container___pyx_scope_struct____iter__ *)__pyx_generator->closure);
5556   PyObject *__pyx_r = NULL;
5557   __Pyx_RefNannyDeclarations
5558   __Pyx_RefNannySetupContext("__iter__", 0);
5559   switch (__pyx_generator->resume_label) {
5560     case 0: goto __pyx_L3_first_run;
5561     case 1: goto __pyx_L4_resume_from_yield;
5562     default: /* CPython raises the right error here */
5563     __Pyx_RefNannyFinishContext();
5564     return NULL;
5565   }
5566   __pyx_L3_first_run:;
5567   if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 102, __pyx_L1_error)
5568 
5569   /* "yt/geometry/grid_container.pyx":103
5570  *
5571  *     def __iter__(self):
5572  *         yield self             # <<<<<<<<<<<<<<
5573  *
5574  *     @cython.boundscheck(False)
5575  */
5576   __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_self));
5577   __pyx_r = ((PyObject *)__pyx_cur_scope->__pyx_v_self);
5578   __Pyx_XGIVEREF(__pyx_r);
5579   __Pyx_RefNannyFinishContext();
5580   __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
5581   /* return from generator, yielding value */
5582   __pyx_generator->resume_label = 1;
5583   return __pyx_r;
5584   __pyx_L4_resume_from_yield:;
5585   if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 103, __pyx_L1_error)
5586   CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
5587 
5588   /* "yt/geometry/grid_container.pyx":102
5589  *         self.mask = None
5590  *
5591  *     def __iter__(self):             # <<<<<<<<<<<<<<
5592  *         yield self
5593  *
5594  */
5595 
5596   /* function exit code */
5597   PyErr_SetNone(PyExc_StopIteration);
5598   goto __pyx_L0;
5599   __pyx_L1_error:;
5600   __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5601   __pyx_L0:;
5602   __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
5603   #if !CYTHON_USE_EXC_INFO_STACK
5604   __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
5605   #endif
5606   __pyx_generator->resume_label = -1;
5607   __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
5608   __Pyx_RefNannyFinishContext();
5609   return __pyx_r;
5610 }
5611 
5612 /* "yt/geometry/grid_container.pyx":108
5613  *     @cython.wraparound(False)
5614  *     @cython.cdivision(True)
5615  *     def return_tree_info(self):             # <<<<<<<<<<<<<<
5616  *         cdef int i, j
5617  *         levels = []
5618  */
5619 
5620 /* Python wrapper */
5621 static PyObject *__pyx_pw_2yt_8geometry_14grid_container_8GridTree_8return_tree_info(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_2yt_8geometry_14grid_container_8GridTree_8return_tree_info(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)5622 static PyObject *__pyx_pw_2yt_8geometry_14grid_container_8GridTree_8return_tree_info(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5623   PyObject *__pyx_r = 0;
5624   __Pyx_RefNannyDeclarations
5625   __Pyx_RefNannySetupContext("return_tree_info (wrapper)", 0);
5626   __pyx_r = __pyx_pf_2yt_8geometry_14grid_container_8GridTree_7return_tree_info(((struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self));
5627 
5628   /* function exit code */
5629   __Pyx_RefNannyFinishContext();
5630   return __pyx_r;
5631 }
5632 
__pyx_pf_2yt_8geometry_14grid_container_8GridTree_7return_tree_info(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree * __pyx_v_self)5633 static PyObject *__pyx_pf_2yt_8geometry_14grid_container_8GridTree_7return_tree_info(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *__pyx_v_self) {
5634   int __pyx_v_i;
5635   int __pyx_v_j;
5636   PyObject *__pyx_v_levels = NULL;
5637   PyObject *__pyx_v_indices = NULL;
5638   PyObject *__pyx_v_nchild = NULL;
5639   PyObject *__pyx_v_children = NULL;
5640   PyObject *__pyx_v_childs = NULL;
5641   PyObject *__pyx_r = NULL;
5642   __Pyx_RefNannyDeclarations
5643   PyObject *__pyx_t_1 = NULL;
5644   int __pyx_t_2;
5645   int __pyx_t_3;
5646   int __pyx_t_4;
5647   int __pyx_t_5;
5648   __pyx_t_5numpy_int32_t __pyx_t_6;
5649   __pyx_t_5numpy_int32_t __pyx_t_7;
5650   int __pyx_t_8;
5651   __Pyx_RefNannySetupContext("return_tree_info", 0);
5652 
5653   /* "yt/geometry/grid_container.pyx":110
5654  *     def return_tree_info(self):
5655  *         cdef int i, j
5656  *         levels = []             # <<<<<<<<<<<<<<
5657  *         indices = []
5658  *         nchild = []
5659  */
5660   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error)
5661   __Pyx_GOTREF(__pyx_t_1);
5662   __pyx_v_levels = ((PyObject*)__pyx_t_1);
5663   __pyx_t_1 = 0;
5664 
5665   /* "yt/geometry/grid_container.pyx":111
5666  *         cdef int i, j
5667  *         levels = []
5668  *         indices = []             # <<<<<<<<<<<<<<
5669  *         nchild = []
5670  *         children = []
5671  */
5672   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error)
5673   __Pyx_GOTREF(__pyx_t_1);
5674   __pyx_v_indices = ((PyObject*)__pyx_t_1);
5675   __pyx_t_1 = 0;
5676 
5677   /* "yt/geometry/grid_container.pyx":112
5678  *         levels = []
5679  *         indices = []
5680  *         nchild = []             # <<<<<<<<<<<<<<
5681  *         children = []
5682  *         for i in range(self.num_grids):
5683  */
5684   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error)
5685   __Pyx_GOTREF(__pyx_t_1);
5686   __pyx_v_nchild = ((PyObject*)__pyx_t_1);
5687   __pyx_t_1 = 0;
5688 
5689   /* "yt/geometry/grid_container.pyx":113
5690  *         indices = []
5691  *         nchild = []
5692  *         children = []             # <<<<<<<<<<<<<<
5693  *         for i in range(self.num_grids):
5694  *             childs = []
5695  */
5696   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error)
5697   __Pyx_GOTREF(__pyx_t_1);
5698   __pyx_v_children = ((PyObject*)__pyx_t_1);
5699   __pyx_t_1 = 0;
5700 
5701   /* "yt/geometry/grid_container.pyx":114
5702  *         nchild = []
5703  *         children = []
5704  *         for i in range(self.num_grids):             # <<<<<<<<<<<<<<
5705  *             childs = []
5706  *             levels.append(self.grids[i].level)
5707  */
5708   __pyx_t_2 = __pyx_v_self->num_grids;
5709   __pyx_t_3 = __pyx_t_2;
5710   for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
5711     __pyx_v_i = __pyx_t_4;
5712 
5713     /* "yt/geometry/grid_container.pyx":115
5714  *         children = []
5715  *         for i in range(self.num_grids):
5716  *             childs = []             # <<<<<<<<<<<<<<
5717  *             levels.append(self.grids[i].level)
5718  *             indices.append(self.grids[i].index)
5719  */
5720     __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error)
5721     __Pyx_GOTREF(__pyx_t_1);
5722     __Pyx_XDECREF_SET(__pyx_v_childs, ((PyObject*)__pyx_t_1));
5723     __pyx_t_1 = 0;
5724 
5725     /* "yt/geometry/grid_container.pyx":116
5726  *         for i in range(self.num_grids):
5727  *             childs = []
5728  *             levels.append(self.grids[i].level)             # <<<<<<<<<<<<<<
5729  *             indices.append(self.grids[i].index)
5730  *             nchild.append(self.grids[i].num_children)
5731  */
5732     __pyx_t_1 = __Pyx_PyInt_From_npy_int32((__pyx_v_self->grids[__pyx_v_i]).level); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error)
5733     __Pyx_GOTREF(__pyx_t_1);
5734     __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_levels, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 116, __pyx_L1_error)
5735     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5736 
5737     /* "yt/geometry/grid_container.pyx":117
5738  *             childs = []
5739  *             levels.append(self.grids[i].level)
5740  *             indices.append(self.grids[i].index)             # <<<<<<<<<<<<<<
5741  *             nchild.append(self.grids[i].num_children)
5742  *             for j in range(self.grids[i].num_children):
5743  */
5744     __pyx_t_1 = __Pyx_PyInt_From_npy_int64((__pyx_v_self->grids[__pyx_v_i]).index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error)
5745     __Pyx_GOTREF(__pyx_t_1);
5746     __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_indices, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 117, __pyx_L1_error)
5747     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5748 
5749     /* "yt/geometry/grid_container.pyx":118
5750  *             levels.append(self.grids[i].level)
5751  *             indices.append(self.grids[i].index)
5752  *             nchild.append(self.grids[i].num_children)             # <<<<<<<<<<<<<<
5753  *             for j in range(self.grids[i].num_children):
5754  *                 childs.append(self.grids[i].children[j].index)
5755  */
5756     __pyx_t_1 = __Pyx_PyInt_From_npy_int32((__pyx_v_self->grids[__pyx_v_i]).num_children); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error)
5757     __Pyx_GOTREF(__pyx_t_1);
5758     __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_nchild, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 118, __pyx_L1_error)
5759     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5760 
5761     /* "yt/geometry/grid_container.pyx":119
5762  *             indices.append(self.grids[i].index)
5763  *             nchild.append(self.grids[i].num_children)
5764  *             for j in range(self.grids[i].num_children):             # <<<<<<<<<<<<<<
5765  *                 childs.append(self.grids[i].children[j].index)
5766  *             children.append(childs)
5767  */
5768     __pyx_t_6 = (__pyx_v_self->grids[__pyx_v_i]).num_children;
5769     __pyx_t_7 = __pyx_t_6;
5770     for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
5771       __pyx_v_j = __pyx_t_8;
5772 
5773       /* "yt/geometry/grid_container.pyx":120
5774  *             nchild.append(self.grids[i].num_children)
5775  *             for j in range(self.grids[i].num_children):
5776  *                 childs.append(self.grids[i].children[j].index)             # <<<<<<<<<<<<<<
5777  *             children.append(childs)
5778  *         return indices, levels, nchild, children
5779  */
5780       __pyx_t_1 = __Pyx_PyInt_From_npy_int64(((__pyx_v_self->grids[__pyx_v_i]).children[__pyx_v_j])->index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error)
5781       __Pyx_GOTREF(__pyx_t_1);
5782       __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_childs, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 120, __pyx_L1_error)
5783       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5784     }
5785 
5786     /* "yt/geometry/grid_container.pyx":121
5787  *             for j in range(self.grids[i].num_children):
5788  *                 childs.append(self.grids[i].children[j].index)
5789  *             children.append(childs)             # <<<<<<<<<<<<<<
5790  *         return indices, levels, nchild, children
5791  *
5792  */
5793     __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_children, __pyx_v_childs); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 121, __pyx_L1_error)
5794   }
5795 
5796   /* "yt/geometry/grid_container.pyx":122
5797  *                 childs.append(self.grids[i].children[j].index)
5798  *             children.append(childs)
5799  *         return indices, levels, nchild, children             # <<<<<<<<<<<<<<
5800  *
5801  *     @property
5802  */
5803   __Pyx_XDECREF(__pyx_r);
5804   __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error)
5805   __Pyx_GOTREF(__pyx_t_1);
5806   __Pyx_INCREF(__pyx_v_indices);
5807   __Pyx_GIVEREF(__pyx_v_indices);
5808   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_indices);
5809   __Pyx_INCREF(__pyx_v_levels);
5810   __Pyx_GIVEREF(__pyx_v_levels);
5811   PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_levels);
5812   __Pyx_INCREF(__pyx_v_nchild);
5813   __Pyx_GIVEREF(__pyx_v_nchild);
5814   PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_nchild);
5815   __Pyx_INCREF(__pyx_v_children);
5816   __Pyx_GIVEREF(__pyx_v_children);
5817   PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_children);
5818   __pyx_r = __pyx_t_1;
5819   __pyx_t_1 = 0;
5820   goto __pyx_L0;
5821 
5822   /* "yt/geometry/grid_container.pyx":108
5823  *     @cython.wraparound(False)
5824  *     @cython.cdivision(True)
5825  *     def return_tree_info(self):             # <<<<<<<<<<<<<<
5826  *         cdef int i, j
5827  *         levels = []
5828  */
5829 
5830   /* function exit code */
5831   __pyx_L1_error:;
5832   __Pyx_XDECREF(__pyx_t_1);
5833   __Pyx_AddTraceback("yt.geometry.grid_container.GridTree.return_tree_info", __pyx_clineno, __pyx_lineno, __pyx_filename);
5834   __pyx_r = NULL;
5835   __pyx_L0:;
5836   __Pyx_XDECREF(__pyx_v_levels);
5837   __Pyx_XDECREF(__pyx_v_indices);
5838   __Pyx_XDECREF(__pyx_v_nchild);
5839   __Pyx_XDECREF(__pyx_v_children);
5840   __Pyx_XDECREF(__pyx_v_childs);
5841   __Pyx_XGIVEREF(__pyx_r);
5842   __Pyx_RefNannyFinishContext();
5843   return __pyx_r;
5844 }
5845 
5846 /* "yt/geometry/grid_container.pyx":125
5847  *
5848  *     @property
5849  *     def grid_arrays(self):             # <<<<<<<<<<<<<<
5850  *         cdef GridTreeNodePadded[:] grids
5851  *         grids = <GridTreeNodePadded[:self.num_grids]> \
5852  */
5853 
5854 /* Python wrapper */
5855 static PyObject *__pyx_pw_2yt_8geometry_14grid_container_8GridTree_11grid_arrays_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2yt_8geometry_14grid_container_8GridTree_11grid_arrays_1__get__(PyObject * __pyx_v_self)5856 static PyObject *__pyx_pw_2yt_8geometry_14grid_container_8GridTree_11grid_arrays_1__get__(PyObject *__pyx_v_self) {
5857   PyObject *__pyx_r = 0;
5858   __Pyx_RefNannyDeclarations
5859   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
5860   __pyx_r = __pyx_pf_2yt_8geometry_14grid_container_8GridTree_11grid_arrays___get__(((struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self));
5861 
5862   /* function exit code */
5863   __Pyx_RefNannyFinishContext();
5864   return __pyx_r;
5865 }
5866 
__pyx_pf_2yt_8geometry_14grid_container_8GridTree_11grid_arrays___get__(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree * __pyx_v_self)5867 static PyObject *__pyx_pf_2yt_8geometry_14grid_container_8GridTree_11grid_arrays___get__(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *__pyx_v_self) {
5868   __Pyx_memviewslice __pyx_v_grids = { 0, 0, { 0 }, { 0 }, { 0 } };
5869   PyObject *__pyx_v_grids_basic = NULL;
5870   PyObject *__pyx_v_dtn = NULL;
5871   PyObject *__pyx_v_dt = NULL;
5872   PyObject *__pyx_v_name = NULL;
5873   PyObject *__pyx_v_d = NULL;
5874   PyObject *__pyx_v_o = NULL;
5875   PyObject *__pyx_v_n = NULL;
5876   PyObject *__pyx_v_f = NULL;
5877   PyObject *__pyx_r = NULL;
5878   __Pyx_RefNannyDeclarations
5879   struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded *__pyx_t_1;
5880   struct __pyx_array_obj *__pyx_t_2 = NULL;
5881   PyObject *__pyx_t_3 = NULL;
5882   PyObject *__pyx_t_4 = NULL;
5883   __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
5884   PyObject *__pyx_t_6 = NULL;
5885   PyObject *__pyx_t_7 = NULL;
5886   Py_ssize_t __pyx_t_8;
5887   PyObject *(*__pyx_t_9)(PyObject *);
5888   PyObject *__pyx_t_10 = NULL;
5889   PyObject *(*__pyx_t_11)(PyObject *);
5890   int __pyx_t_12;
5891   int __pyx_t_13;
5892   __Pyx_RefNannySetupContext("__get__", 0);
5893 
5894   /* "yt/geometry/grid_container.pyx":128
5895  *         cdef GridTreeNodePadded[:] grids
5896  *         grids = <GridTreeNodePadded[:self.num_grids]> \
5897  *             (<GridTreeNodePadded*> self.grids)             # <<<<<<<<<<<<<<
5898  *         grids_basic = np.asarray(grids)
5899  *         # This next bit is necessary because as of 0.23.4, Cython can't make
5900  */
5901   __pyx_t_1 = ((struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded *)__pyx_v_self->grids);
5902 
5903   /* "yt/geometry/grid_container.pyx":127
5904  *     def grid_arrays(self):
5905  *         cdef GridTreeNodePadded[:] grids
5906  *         grids = <GridTreeNodePadded[:self.num_grids]> \             # <<<<<<<<<<<<<<
5907  *             (<GridTreeNodePadded*> self.grids)
5908  *         grids_basic = np.asarray(grids)
5909  */
5910   if (!__pyx_t_1) {
5911     PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
5912     __PYX_ERR(0, 128, __pyx_L1_error)
5913   }
5914   __pyx_t_4 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded);
5915   __pyx_t_3 = Py_BuildValue((char*) "("  __PYX_BUILD_PY_SSIZE_T  ")", ((Py_ssize_t)__pyx_v_self->num_grids));
5916   if (unlikely(!__pyx_t_4 || !__pyx_t_3 || !PyBytes_AsString(__pyx_t_4))) __PYX_ERR(0, 127, __pyx_L1_error)
5917   __Pyx_GOTREF(__pyx_t_4);
5918   __Pyx_GOTREF(__pyx_t_3);
5919   __pyx_t_2 = __pyx_array_new(__pyx_t_3, sizeof(struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded), PyBytes_AS_STRING(__pyx_t_4), (char *) "c", (char *) __pyx_t_1);
5920   if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 127, __pyx_L1_error)
5921   __Pyx_GOTREF(__pyx_t_2);
5922   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5923   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5924   __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded(((PyObject *)__pyx_t_2), PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 127, __pyx_L1_error)
5925   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
5926   __pyx_v_grids = __pyx_t_5;
5927   __pyx_t_5.memview = NULL;
5928   __pyx_t_5.data = NULL;
5929 
5930   /* "yt/geometry/grid_container.pyx":129
5931  *         grids = <GridTreeNodePadded[:self.num_grids]> \
5932  *             (<GridTreeNodePadded*> self.grids)
5933  *         grids_basic = np.asarray(grids)             # <<<<<<<<<<<<<<
5934  *         # This next bit is necessary because as of 0.23.4, Cython can't make
5935  *         # nested dtypes automatically where you have a property that is
5936  */
5937   __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 129, __pyx_L1_error)
5938   __Pyx_GOTREF(__pyx_t_3);
5939   __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 129, __pyx_L1_error)
5940   __Pyx_GOTREF(__pyx_t_6);
5941   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5942   __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_grids, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded, (int (*)(char *, PyObject *)) __pyx_memview_set_nn_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 129, __pyx_L1_error)
5943   __Pyx_GOTREF(__pyx_t_3);
5944   __pyx_t_7 = NULL;
5945   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
5946     __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
5947     if (likely(__pyx_t_7)) {
5948       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
5949       __Pyx_INCREF(__pyx_t_7);
5950       __Pyx_INCREF(function);
5951       __Pyx_DECREF_SET(__pyx_t_6, function);
5952     }
5953   }
5954   __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3);
5955   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
5956   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5957   if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 129, __pyx_L1_error)
5958   __Pyx_GOTREF(__pyx_t_4);
5959   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5960   __pyx_v_grids_basic = __pyx_t_4;
5961   __pyx_t_4 = 0;
5962 
5963   /* "yt/geometry/grid_container.pyx":134
5964  *         # something like float[3].  So we unroll all of those, then re-roll
5965  *         # them in a new dtype.
5966  *         dtn = {}             # <<<<<<<<<<<<<<
5967  *         dt = grids_basic.dtype
5968  *         for name in dt.names:
5969  */
5970   __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 134, __pyx_L1_error)
5971   __Pyx_GOTREF(__pyx_t_4);
5972   __pyx_v_dtn = ((PyObject*)__pyx_t_4);
5973   __pyx_t_4 = 0;
5974 
5975   /* "yt/geometry/grid_container.pyx":135
5976  *         # them in a new dtype.
5977  *         dtn = {}
5978  *         dt = grids_basic.dtype             # <<<<<<<<<<<<<<
5979  *         for name in dt.names:
5980  *             d, o = dt.fields[name]
5981  */
5982   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_grids_basic, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 135, __pyx_L1_error)
5983   __Pyx_GOTREF(__pyx_t_4);
5984   __pyx_v_dt = __pyx_t_4;
5985   __pyx_t_4 = 0;
5986 
5987   /* "yt/geometry/grid_container.pyx":136
5988  *         dtn = {}
5989  *         dt = grids_basic.dtype
5990  *         for name in dt.names:             # <<<<<<<<<<<<<<
5991  *             d, o = dt.fields[name]
5992  *             n = name
5993  */
5994   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_names); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 136, __pyx_L1_error)
5995   __Pyx_GOTREF(__pyx_t_4);
5996   if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
5997     __pyx_t_6 = __pyx_t_4; __Pyx_INCREF(__pyx_t_6); __pyx_t_8 = 0;
5998     __pyx_t_9 = NULL;
5999   } else {
6000     __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 136, __pyx_L1_error)
6001     __Pyx_GOTREF(__pyx_t_6);
6002     __pyx_t_9 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 136, __pyx_L1_error)
6003   }
6004   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6005   for (;;) {
6006     if (likely(!__pyx_t_9)) {
6007       if (likely(PyList_CheckExact(__pyx_t_6))) {
6008         if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_6)) break;
6009         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6010         __pyx_t_4 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 136, __pyx_L1_error)
6011         #else
6012         __pyx_t_4 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 136, __pyx_L1_error)
6013         __Pyx_GOTREF(__pyx_t_4);
6014         #endif
6015       } else {
6016         if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
6017         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6018         __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 136, __pyx_L1_error)
6019         #else
6020         __pyx_t_4 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 136, __pyx_L1_error)
6021         __Pyx_GOTREF(__pyx_t_4);
6022         #endif
6023       }
6024     } else {
6025       __pyx_t_4 = __pyx_t_9(__pyx_t_6);
6026       if (unlikely(!__pyx_t_4)) {
6027         PyObject* exc_type = PyErr_Occurred();
6028         if (exc_type) {
6029           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
6030           else __PYX_ERR(0, 136, __pyx_L1_error)
6031         }
6032         break;
6033       }
6034       __Pyx_GOTREF(__pyx_t_4);
6035     }
6036     __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_4);
6037     __pyx_t_4 = 0;
6038 
6039     /* "yt/geometry/grid_container.pyx":137
6040  *         dt = grids_basic.dtype
6041  *         for name in dt.names:
6042  *             d, o = dt.fields[name]             # <<<<<<<<<<<<<<
6043  *             n = name
6044  *             if name.endswith("_x"):
6045  */
6046     __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_fields); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 137, __pyx_L1_error)
6047     __Pyx_GOTREF(__pyx_t_4);
6048     __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 137, __pyx_L1_error)
6049     __Pyx_GOTREF(__pyx_t_3);
6050     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6051     if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
6052       PyObject* sequence = __pyx_t_3;
6053       Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
6054       if (unlikely(size != 2)) {
6055         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
6056         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
6057         __PYX_ERR(0, 137, __pyx_L1_error)
6058       }
6059       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6060       if (likely(PyTuple_CheckExact(sequence))) {
6061         __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
6062         __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
6063       } else {
6064         __pyx_t_4 = PyList_GET_ITEM(sequence, 0);
6065         __pyx_t_7 = PyList_GET_ITEM(sequence, 1);
6066       }
6067       __Pyx_INCREF(__pyx_t_4);
6068       __Pyx_INCREF(__pyx_t_7);
6069       #else
6070       __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 137, __pyx_L1_error)
6071       __Pyx_GOTREF(__pyx_t_4);
6072       __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 137, __pyx_L1_error)
6073       __Pyx_GOTREF(__pyx_t_7);
6074       #endif
6075       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6076     } else {
6077       Py_ssize_t index = -1;
6078       __pyx_t_10 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 137, __pyx_L1_error)
6079       __Pyx_GOTREF(__pyx_t_10);
6080       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6081       __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext;
6082       index = 0; __pyx_t_4 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
6083       __Pyx_GOTREF(__pyx_t_4);
6084       index = 1; __pyx_t_7 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_7)) goto __pyx_L5_unpacking_failed;
6085       __Pyx_GOTREF(__pyx_t_7);
6086       if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) __PYX_ERR(0, 137, __pyx_L1_error)
6087       __pyx_t_11 = NULL;
6088       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6089       goto __pyx_L6_unpacking_done;
6090       __pyx_L5_unpacking_failed:;
6091       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6092       __pyx_t_11 = NULL;
6093       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
6094       __PYX_ERR(0, 137, __pyx_L1_error)
6095       __pyx_L6_unpacking_done:;
6096     }
6097     __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_4);
6098     __pyx_t_4 = 0;
6099     __Pyx_XDECREF_SET(__pyx_v_o, __pyx_t_7);
6100     __pyx_t_7 = 0;
6101 
6102     /* "yt/geometry/grid_container.pyx":138
6103  *         for name in dt.names:
6104  *             d, o = dt.fields[name]
6105  *             n = name             # <<<<<<<<<<<<<<
6106  *             if name.endswith("_x"):
6107  *                 f = (d.char, 3)
6108  */
6109     __Pyx_INCREF(__pyx_v_name);
6110     __Pyx_XDECREF_SET(__pyx_v_n, __pyx_v_name);
6111 
6112     /* "yt/geometry/grid_container.pyx":139
6113  *             d, o = dt.fields[name]
6114  *             n = name
6115  *             if name.endswith("_x"):             # <<<<<<<<<<<<<<
6116  *                 f = (d.char, 3)
6117  *                 n = name[:-2]
6118  */
6119     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_endswith); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 139, __pyx_L1_error)
6120     __Pyx_GOTREF(__pyx_t_7);
6121     __pyx_t_4 = NULL;
6122     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
6123       __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
6124       if (likely(__pyx_t_4)) {
6125         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
6126         __Pyx_INCREF(__pyx_t_4);
6127         __Pyx_INCREF(function);
6128         __Pyx_DECREF_SET(__pyx_t_7, function);
6129       }
6130     }
6131     __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_4, __pyx_n_s_x) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_n_s_x);
6132     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6133     if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error)
6134     __Pyx_GOTREF(__pyx_t_3);
6135     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6136     __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 139, __pyx_L1_error)
6137     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6138     if (__pyx_t_12) {
6139 
6140       /* "yt/geometry/grid_container.pyx":140
6141  *             n = name
6142  *             if name.endswith("_x"):
6143  *                 f = (d.char, 3)             # <<<<<<<<<<<<<<
6144  *                 n = name[:-2]
6145  *             elif name.endswith("_y") or name.endswith("_z"):
6146  */
6147       __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s_char); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 140, __pyx_L1_error)
6148       __Pyx_GOTREF(__pyx_t_3);
6149       __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 140, __pyx_L1_error)
6150       __Pyx_GOTREF(__pyx_t_7);
6151       __Pyx_GIVEREF(__pyx_t_3);
6152       PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
6153       __Pyx_INCREF(__pyx_int_3);
6154       __Pyx_GIVEREF(__pyx_int_3);
6155       PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_int_3);
6156       __pyx_t_3 = 0;
6157       __Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_7);
6158       __pyx_t_7 = 0;
6159 
6160       /* "yt/geometry/grid_container.pyx":141
6161  *             if name.endswith("_x"):
6162  *                 f = (d.char, 3)
6163  *                 n = name[:-2]             # <<<<<<<<<<<<<<
6164  *             elif name.endswith("_y") or name.endswith("_z"):
6165  *                 continue
6166  */
6167       __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_v_name, 0, -2L, NULL, NULL, &__pyx_slice__2, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 141, __pyx_L1_error)
6168       __Pyx_GOTREF(__pyx_t_7);
6169       __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_7);
6170       __pyx_t_7 = 0;
6171 
6172       /* "yt/geometry/grid_container.pyx":139
6173  *             d, o = dt.fields[name]
6174  *             n = name
6175  *             if name.endswith("_x"):             # <<<<<<<<<<<<<<
6176  *                 f = (d.char, 3)
6177  *                 n = name[:-2]
6178  */
6179       goto __pyx_L7;
6180     }
6181 
6182     /* "yt/geometry/grid_container.pyx":142
6183  *                 f = (d.char, 3)
6184  *                 n = name[:-2]
6185  *             elif name.endswith("_y") or name.endswith("_z"):             # <<<<<<<<<<<<<<
6186  *                 continue
6187  *             else:
6188  */
6189     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_endswith); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 142, __pyx_L1_error)
6190     __Pyx_GOTREF(__pyx_t_3);
6191     __pyx_t_4 = NULL;
6192     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
6193       __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
6194       if (likely(__pyx_t_4)) {
6195         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
6196         __Pyx_INCREF(__pyx_t_4);
6197         __Pyx_INCREF(function);
6198         __Pyx_DECREF_SET(__pyx_t_3, function);
6199       }
6200     }
6201     __pyx_t_7 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_n_s_y) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_n_s_y);
6202     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6203     if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 142, __pyx_L1_error)
6204     __Pyx_GOTREF(__pyx_t_7);
6205     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6206     __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 142, __pyx_L1_error)
6207     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6208     if (!__pyx_t_13) {
6209     } else {
6210       __pyx_t_12 = __pyx_t_13;
6211       goto __pyx_L8_bool_binop_done;
6212     }
6213     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_endswith); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 142, __pyx_L1_error)
6214     __Pyx_GOTREF(__pyx_t_3);
6215     __pyx_t_4 = NULL;
6216     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
6217       __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
6218       if (likely(__pyx_t_4)) {
6219         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
6220         __Pyx_INCREF(__pyx_t_4);
6221         __Pyx_INCREF(function);
6222         __Pyx_DECREF_SET(__pyx_t_3, function);
6223       }
6224     }
6225     __pyx_t_7 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_n_s_z) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_n_s_z);
6226     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6227     if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 142, __pyx_L1_error)
6228     __Pyx_GOTREF(__pyx_t_7);
6229     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6230     __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 142, __pyx_L1_error)
6231     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6232     __pyx_t_12 = __pyx_t_13;
6233     __pyx_L8_bool_binop_done:;
6234     if (__pyx_t_12) {
6235 
6236       /* "yt/geometry/grid_container.pyx":143
6237  *                 n = name[:-2]
6238  *             elif name.endswith("_y") or name.endswith("_z"):
6239  *                 continue             # <<<<<<<<<<<<<<
6240  *             else:
6241  *                 f = d.char
6242  */
6243       goto __pyx_L3_continue;
6244 
6245       /* "yt/geometry/grid_container.pyx":142
6246  *                 f = (d.char, 3)
6247  *                 n = name[:-2]
6248  *             elif name.endswith("_y") or name.endswith("_z"):             # <<<<<<<<<<<<<<
6249  *                 continue
6250  *             else:
6251  */
6252     }
6253 
6254     /* "yt/geometry/grid_container.pyx":145
6255  *                 continue
6256  *             else:
6257  *                 f = d.char             # <<<<<<<<<<<<<<
6258  *             dtn[n] = (f, o)
6259  *         return grids_basic.view(dtype=np.dtype(dtn))
6260  */
6261     /*else*/ {
6262       __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s_char); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 145, __pyx_L1_error)
6263       __Pyx_GOTREF(__pyx_t_7);
6264       __Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_7);
6265       __pyx_t_7 = 0;
6266     }
6267     __pyx_L7:;
6268 
6269     /* "yt/geometry/grid_container.pyx":146
6270  *             else:
6271  *                 f = d.char
6272  *             dtn[n] = (f, o)             # <<<<<<<<<<<<<<
6273  *         return grids_basic.view(dtype=np.dtype(dtn))
6274  *
6275  */
6276     __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 146, __pyx_L1_error)
6277     __Pyx_GOTREF(__pyx_t_7);
6278     __Pyx_INCREF(__pyx_v_f);
6279     __Pyx_GIVEREF(__pyx_v_f);
6280     PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_f);
6281     __Pyx_INCREF(__pyx_v_o);
6282     __Pyx_GIVEREF(__pyx_v_o);
6283     PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_o);
6284     if (unlikely(PyDict_SetItem(__pyx_v_dtn, __pyx_v_n, __pyx_t_7) < 0)) __PYX_ERR(0, 146, __pyx_L1_error)
6285     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6286 
6287     /* "yt/geometry/grid_container.pyx":136
6288  *         dtn = {}
6289  *         dt = grids_basic.dtype
6290  *         for name in dt.names:             # <<<<<<<<<<<<<<
6291  *             d, o = dt.fields[name]
6292  *             n = name
6293  */
6294     __pyx_L3_continue:;
6295   }
6296   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6297 
6298   /* "yt/geometry/grid_container.pyx":147
6299  *                 f = d.char
6300  *             dtn[n] = (f, o)
6301  *         return grids_basic.view(dtype=np.dtype(dtn))             # <<<<<<<<<<<<<<
6302  *
6303  *     cdef void setup_data(self, GridVisitorData *data):
6304  */
6305   __Pyx_XDECREF(__pyx_r);
6306   __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_grids_basic, __pyx_n_s_view); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 147, __pyx_L1_error)
6307   __Pyx_GOTREF(__pyx_t_6);
6308   __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 147, __pyx_L1_error)
6309   __Pyx_GOTREF(__pyx_t_7);
6310   __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_5numpy_dtype), __pyx_v_dtn); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 147, __pyx_L1_error)
6311   __Pyx_GOTREF(__pyx_t_3);
6312   if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 147, __pyx_L1_error)
6313   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6314   __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 147, __pyx_L1_error)
6315   __Pyx_GOTREF(__pyx_t_3);
6316   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6317   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6318   __pyx_r = __pyx_t_3;
6319   __pyx_t_3 = 0;
6320   goto __pyx_L0;
6321 
6322   /* "yt/geometry/grid_container.pyx":125
6323  *
6324  *     @property
6325  *     def grid_arrays(self):             # <<<<<<<<<<<<<<
6326  *         cdef GridTreeNodePadded[:] grids
6327  *         grids = <GridTreeNodePadded[:self.num_grids]> \
6328  */
6329 
6330   /* function exit code */
6331   __pyx_L1_error:;
6332   __Pyx_XDECREF(((PyObject *)__pyx_t_2));
6333   __Pyx_XDECREF(__pyx_t_3);
6334   __Pyx_XDECREF(__pyx_t_4);
6335   __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
6336   __Pyx_XDECREF(__pyx_t_6);
6337   __Pyx_XDECREF(__pyx_t_7);
6338   __Pyx_XDECREF(__pyx_t_10);
6339   __Pyx_AddTraceback("yt.geometry.grid_container.GridTree.grid_arrays.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6340   __pyx_r = NULL;
6341   __pyx_L0:;
6342   __PYX_XDEC_MEMVIEW(&__pyx_v_grids, 1);
6343   __Pyx_XDECREF(__pyx_v_grids_basic);
6344   __Pyx_XDECREF(__pyx_v_dtn);
6345   __Pyx_XDECREF(__pyx_v_dt);
6346   __Pyx_XDECREF(__pyx_v_name);
6347   __Pyx_XDECREF(__pyx_v_d);
6348   __Pyx_XDECREF(__pyx_v_o);
6349   __Pyx_XDECREF(__pyx_v_n);
6350   __Pyx_XDECREF(__pyx_v_f);
6351   __Pyx_XGIVEREF(__pyx_r);
6352   __Pyx_RefNannyFinishContext();
6353   return __pyx_r;
6354 }
6355 
6356 /* "yt/geometry/grid_container.pyx":149
6357  *         return grids_basic.view(dtype=np.dtype(dtn))
6358  *
6359  *     cdef void setup_data(self, GridVisitorData *data):             # <<<<<<<<<<<<<<
6360  *         # Being handed a new GVD object, we initialize it to sane defaults.
6361  *         data.index = 0
6362  */
6363 
__pyx_f_2yt_8geometry_14grid_container_8GridTree_setup_data(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_14grid_container_GridTree * __pyx_v_self,struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData * __pyx_v_data)6364 static void __pyx_f_2yt_8geometry_14grid_container_8GridTree_setup_data(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *__pyx_v_self, struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *__pyx_v_data) {
6365   __Pyx_RefNannyDeclarations
6366   __Pyx_RefNannySetupContext("setup_data", 0);
6367 
6368   /* "yt/geometry/grid_container.pyx":151
6369  *     cdef void setup_data(self, GridVisitorData *data):
6370  *         # Being handed a new GVD object, we initialize it to sane defaults.
6371  *         data.index = 0             # <<<<<<<<<<<<<<
6372  *         data.global_index = 0
6373  *         data.n_tuples = 0
6374  */
6375   __pyx_v_data->index = 0;
6376 
6377   /* "yt/geometry/grid_container.pyx":152
6378  *         # Being handed a new GVD object, we initialize it to sane defaults.
6379  *         data.index = 0
6380  *         data.global_index = 0             # <<<<<<<<<<<<<<
6381  *         data.n_tuples = 0
6382  *         data.child_tuples = NULL
6383  */
6384   __pyx_v_data->global_index = 0;
6385 
6386   /* "yt/geometry/grid_container.pyx":153
6387  *         data.index = 0
6388  *         data.global_index = 0
6389  *         data.n_tuples = 0             # <<<<<<<<<<<<<<
6390  *         data.child_tuples = NULL
6391  *         data.array = NULL
6392  */
6393   __pyx_v_data->n_tuples = 0;
6394 
6395   /* "yt/geometry/grid_container.pyx":154
6396  *         data.global_index = 0
6397  *         data.n_tuples = 0
6398  *         data.child_tuples = NULL             # <<<<<<<<<<<<<<
6399  *         data.array = NULL
6400  *         data.ref_factor = 2 #### FIX THIS
6401  */
6402   __pyx_v_data->child_tuples = NULL;
6403 
6404   /* "yt/geometry/grid_container.pyx":155
6405  *         data.n_tuples = 0
6406  *         data.child_tuples = NULL
6407  *         data.array = NULL             # <<<<<<<<<<<<<<
6408  *         data.ref_factor = 2 #### FIX THIS
6409  *
6410  */
6411   __pyx_v_data->array = NULL;
6412 
6413   /* "yt/geometry/grid_container.pyx":156
6414  *         data.child_tuples = NULL
6415  *         data.array = NULL
6416  *         data.ref_factor = 2 #### FIX THIS             # <<<<<<<<<<<<<<
6417  *
6418  *     cdef void visit_grids(self, GridVisitorData *data,
6419  */
6420   __pyx_v_data->ref_factor = 2;
6421 
6422   /* "yt/geometry/grid_container.pyx":149
6423  *         return grids_basic.view(dtype=np.dtype(dtn))
6424  *
6425  *     cdef void setup_data(self, GridVisitorData *data):             # <<<<<<<<<<<<<<
6426  *         # Being handed a new GVD object, we initialize it to sane defaults.
6427  *         data.index = 0
6428  */
6429 
6430   /* function exit code */
6431   __Pyx_RefNannyFinishContext();
6432 }
6433 
6434 /* "yt/geometry/grid_container.pyx":158
6435  *         data.ref_factor = 2 #### FIX THIS
6436  *
6437  *     cdef void visit_grids(self, GridVisitorData *data,             # <<<<<<<<<<<<<<
6438  *                           grid_visitor_function *func,
6439  *                           SelectorObject selector):
6440  */
6441 
__pyx_f_2yt_8geometry_14grid_container_8GridTree_visit_grids(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree * __pyx_v_self,struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData * __pyx_v_data,__pyx_t_2yt_8geometry_13grid_visitors_grid_visitor_function * __pyx_v_func,struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject * __pyx_v_selector)6442 static void __pyx_f_2yt_8geometry_14grid_container_8GridTree_visit_grids(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *__pyx_v_self, struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *__pyx_v_data, __pyx_t_2yt_8geometry_13grid_visitors_grid_visitor_function *__pyx_v_func, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector) {
6443   int __pyx_v_i;
6444   struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode *__pyx_v_grid;
6445   __pyx_t_5numpy_uint8_t *__pyx_v_buf;
6446   __Pyx_RefNannyDeclarations
6447   int __pyx_t_1;
6448   int __pyx_t_2;
6449   __pyx_t_5numpy_uint8_t *__pyx_t_3;
6450   int __pyx_t_4;
6451   int __pyx_t_5;
6452   int __pyx_t_6;
6453   struct __pyx_opt_args_2yt_8geometry_14grid_container_8GridTree_recursively_visit_grid __pyx_t_7;
6454   __Pyx_RefNannySetupContext("visit_grids", 0);
6455 
6456   /* "yt/geometry/grid_container.pyx":167
6457  *         # going to do this the stupid way for now.
6458  *         cdef GridTreeNode *grid
6459  *         cdef np.uint8_t *buf = NULL             # <<<<<<<<<<<<<<
6460  *         if self.mask is not None:
6461  *             buf = self.mask.buf
6462  */
6463   __pyx_v_buf = NULL;
6464 
6465   /* "yt/geometry/grid_container.pyx":168
6466  *         cdef GridTreeNode *grid
6467  *         cdef np.uint8_t *buf = NULL
6468  *         if self.mask is not None:             # <<<<<<<<<<<<<<
6469  *             buf = self.mask.buf
6470  *         for i in range(self.num_root_grids):
6471  */
6472   __pyx_t_1 = (((PyObject *)__pyx_v_self->mask) != Py_None);
6473   __pyx_t_2 = (__pyx_t_1 != 0);
6474   if (__pyx_t_2) {
6475 
6476     /* "yt/geometry/grid_container.pyx":169
6477  *         cdef np.uint8_t *buf = NULL
6478  *         if self.mask is not None:
6479  *             buf = self.mask.buf             # <<<<<<<<<<<<<<
6480  *         for i in range(self.num_root_grids):
6481  *             grid = &self.root_grids[i]
6482  */
6483     __pyx_t_3 = __pyx_v_self->mask->buf;
6484     __pyx_v_buf = __pyx_t_3;
6485 
6486     /* "yt/geometry/grid_container.pyx":168
6487  *         cdef GridTreeNode *grid
6488  *         cdef np.uint8_t *buf = NULL
6489  *         if self.mask is not None:             # <<<<<<<<<<<<<<
6490  *             buf = self.mask.buf
6491  *         for i in range(self.num_root_grids):
6492  */
6493   }
6494 
6495   /* "yt/geometry/grid_container.pyx":170
6496  *         if self.mask is not None:
6497  *             buf = self.mask.buf
6498  *         for i in range(self.num_root_grids):             # <<<<<<<<<<<<<<
6499  *             grid = &self.root_grids[i]
6500  *             self.recursively_visit_grid(data, func, selector, grid, buf)
6501  */
6502   __pyx_t_4 = __pyx_v_self->num_root_grids;
6503   __pyx_t_5 = __pyx_t_4;
6504   for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
6505     __pyx_v_i = __pyx_t_6;
6506 
6507     /* "yt/geometry/grid_container.pyx":171
6508  *             buf = self.mask.buf
6509  *         for i in range(self.num_root_grids):
6510  *             grid = &self.root_grids[i]             # <<<<<<<<<<<<<<
6511  *             self.recursively_visit_grid(data, func, selector, grid, buf)
6512  *         grid_visitors.free_tuples(data)
6513  */
6514     __pyx_v_grid = (&(__pyx_v_self->root_grids[__pyx_v_i]));
6515 
6516     /* "yt/geometry/grid_container.pyx":172
6517  *         for i in range(self.num_root_grids):
6518  *             grid = &self.root_grids[i]
6519  *             self.recursively_visit_grid(data, func, selector, grid, buf)             # <<<<<<<<<<<<<<
6520  *         grid_visitors.free_tuples(data)
6521  *
6522  */
6523     __pyx_t_7.__pyx_n = 1;
6524     __pyx_t_7.buf = __pyx_v_buf;
6525     ((struct __pyx_vtabstruct_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self->__pyx_vtab)->recursively_visit_grid(__pyx_v_self, __pyx_v_data, __pyx_v_func, __pyx_v_selector, __pyx_v_grid, &__pyx_t_7);
6526   }
6527 
6528   /* "yt/geometry/grid_container.pyx":173
6529  *             grid = &self.root_grids[i]
6530  *             self.recursively_visit_grid(data, func, selector, grid, buf)
6531  *         grid_visitors.free_tuples(data)             # <<<<<<<<<<<<<<
6532  *
6533  *     cdef void recursively_visit_grid(self, GridVisitorData *data,
6534  */
6535   __pyx_f_2yt_8geometry_13grid_visitors_free_tuples(__pyx_v_data);
6536 
6537   /* "yt/geometry/grid_container.pyx":158
6538  *         data.ref_factor = 2 #### FIX THIS
6539  *
6540  *     cdef void visit_grids(self, GridVisitorData *data,             # <<<<<<<<<<<<<<
6541  *                           grid_visitor_function *func,
6542  *                           SelectorObject selector):
6543  */
6544 
6545   /* function exit code */
6546   __Pyx_RefNannyFinishContext();
6547 }
6548 
6549 /* "yt/geometry/grid_container.pyx":175
6550  *         grid_visitors.free_tuples(data)
6551  *
6552  *     cdef void recursively_visit_grid(self, GridVisitorData *data,             # <<<<<<<<<<<<<<
6553  *                                      grid_visitor_function *func,
6554  *                                      SelectorObject selector,
6555  */
6556 
__pyx_f_2yt_8geometry_14grid_container_8GridTree_recursively_visit_grid(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree * __pyx_v_self,struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData * __pyx_v_data,__pyx_t_2yt_8geometry_13grid_visitors_grid_visitor_function * __pyx_v_func,struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject * __pyx_v_selector,struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode * __pyx_v_grid,struct __pyx_opt_args_2yt_8geometry_14grid_container_8GridTree_recursively_visit_grid * __pyx_optional_args)6557 static void __pyx_f_2yt_8geometry_14grid_container_8GridTree_recursively_visit_grid(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *__pyx_v_self, struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *__pyx_v_data, __pyx_t_2yt_8geometry_13grid_visitors_grid_visitor_function *__pyx_v_func, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode *__pyx_v_grid, struct __pyx_opt_args_2yt_8geometry_14grid_container_8GridTree_recursively_visit_grid *__pyx_optional_args) {
6558 
6559   /* "yt/geometry/grid_container.pyx":179
6560  *                                      SelectorObject selector,
6561  *                                      GridTreeNode *grid,
6562  *                                      np.uint8_t *buf = NULL):             # <<<<<<<<<<<<<<
6563  *         # Visit this grid and all of its child grids, with a given grid visitor
6564  *         # function.  We early terminate if we are not selected by the selector.
6565  */
6566   __pyx_t_5numpy_uint8_t *__pyx_v_buf = ((__pyx_t_5numpy_uint8_t *)NULL);
6567   int __pyx_v_i;
6568   __Pyx_RefNannyDeclarations
6569   int __pyx_t_1;
6570   struct __pyx_opt_args_2yt_8geometry_18selection_routines_14SelectorObject_visit_grid_cells __pyx_t_2;
6571   __pyx_t_5numpy_int32_t __pyx_t_3;
6572   __pyx_t_5numpy_int32_t __pyx_t_4;
6573   int __pyx_t_5;
6574   struct __pyx_opt_args_2yt_8geometry_14grid_container_8GridTree_recursively_visit_grid __pyx_t_6;
6575   __Pyx_RefNannySetupContext("recursively_visit_grid", 0);
6576   if (__pyx_optional_args) {
6577     if (__pyx_optional_args->__pyx_n > 0) {
6578       __pyx_v_buf = __pyx_optional_args->buf;
6579     }
6580   }
6581 
6582   /* "yt/geometry/grid_container.pyx":183
6583  *         # function.  We early terminate if we are not selected by the selector.
6584  *         cdef int i
6585  *         data.grid = grid             # <<<<<<<<<<<<<<
6586  *         if selector.select_bbox(grid.left_edge, grid.right_edge) == 0:
6587  *             # Note that this does not increment the global_index.
6588  */
6589   __pyx_v_data->grid = __pyx_v_grid;
6590 
6591   /* "yt/geometry/grid_container.pyx":184
6592  *         cdef int i
6593  *         data.grid = grid
6594  *         if selector.select_bbox(grid.left_edge, grid.right_edge) == 0:             # <<<<<<<<<<<<<<
6595  *             # Note that this does not increment the global_index.
6596  *             return
6597  */
6598   __pyx_t_1 = ((((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_selector->__pyx_vtab)->select_bbox(__pyx_v_selector, __pyx_v_grid->left_edge, __pyx_v_grid->right_edge) == 0) != 0);
6599   if (__pyx_t_1) {
6600 
6601     /* "yt/geometry/grid_container.pyx":186
6602  *         if selector.select_bbox(grid.left_edge, grid.right_edge) == 0:
6603  *             # Note that this does not increment the global_index.
6604  *             return             # <<<<<<<<<<<<<<
6605  *         grid_visitors.setup_tuples(data)
6606  *         selector.visit_grid_cells(data, func, buf)
6607  */
6608     goto __pyx_L0;
6609 
6610     /* "yt/geometry/grid_container.pyx":184
6611  *         cdef int i
6612  *         data.grid = grid
6613  *         if selector.select_bbox(grid.left_edge, grid.right_edge) == 0:             # <<<<<<<<<<<<<<
6614  *             # Note that this does not increment the global_index.
6615  *             return
6616  */
6617   }
6618 
6619   /* "yt/geometry/grid_container.pyx":187
6620  *             # Note that this does not increment the global_index.
6621  *             return
6622  *         grid_visitors.setup_tuples(data)             # <<<<<<<<<<<<<<
6623  *         selector.visit_grid_cells(data, func, buf)
6624  *         for i in range(grid.num_children):
6625  */
6626   __pyx_f_2yt_8geometry_13grid_visitors_setup_tuples(__pyx_v_data);
6627 
6628   /* "yt/geometry/grid_container.pyx":188
6629  *             return
6630  *         grid_visitors.setup_tuples(data)
6631  *         selector.visit_grid_cells(data, func, buf)             # <<<<<<<<<<<<<<
6632  *         for i in range(grid.num_children):
6633  *             self.recursively_visit_grid(data, func, selector, grid.children[i],
6634  */
6635   __pyx_t_2.__pyx_n = 1;
6636   __pyx_t_2.cached_mask = __pyx_v_buf;
6637   ((struct __pyx_vtabstruct_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_selector->__pyx_vtab)->visit_grid_cells(__pyx_v_selector, __pyx_v_data, __pyx_v_func, &__pyx_t_2);
6638 
6639   /* "yt/geometry/grid_container.pyx":189
6640  *         grid_visitors.setup_tuples(data)
6641  *         selector.visit_grid_cells(data, func, buf)
6642  *         for i in range(grid.num_children):             # <<<<<<<<<<<<<<
6643  *             self.recursively_visit_grid(data, func, selector, grid.children[i],
6644  *                                         buf)
6645  */
6646   __pyx_t_3 = __pyx_v_grid->num_children;
6647   __pyx_t_4 = __pyx_t_3;
6648   for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
6649     __pyx_v_i = __pyx_t_5;
6650 
6651     /* "yt/geometry/grid_container.pyx":190
6652  *         selector.visit_grid_cells(data, func, buf)
6653  *         for i in range(grid.num_children):
6654  *             self.recursively_visit_grid(data, func, selector, grid.children[i],             # <<<<<<<<<<<<<<
6655  *                                         buf)
6656  *
6657  */
6658     __pyx_t_6.__pyx_n = 1;
6659     __pyx_t_6.buf = __pyx_v_buf;
6660     ((struct __pyx_vtabstruct_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self->__pyx_vtab)->recursively_visit_grid(__pyx_v_self, __pyx_v_data, __pyx_v_func, __pyx_v_selector, (__pyx_v_grid->children[__pyx_v_i]), &__pyx_t_6);
6661   }
6662 
6663   /* "yt/geometry/grid_container.pyx":175
6664  *         grid_visitors.free_tuples(data)
6665  *
6666  *     cdef void recursively_visit_grid(self, GridVisitorData *data,             # <<<<<<<<<<<<<<
6667  *                                      grid_visitor_function *func,
6668  *                                      SelectorObject selector,
6669  */
6670 
6671   /* function exit code */
6672   __pyx_L0:;
6673   __Pyx_RefNannyFinishContext();
6674 }
6675 
6676 /* "yt/geometry/grid_container.pyx":193
6677  *                                         buf)
6678  *
6679  *     def count(self, SelectorObject selector):             # <<<<<<<<<<<<<<
6680  *         # Use the counting grid visitor
6681  *         cdef GridVisitorData data
6682  */
6683 
6684 /* Python wrapper */
6685 static PyObject *__pyx_pw_2yt_8geometry_14grid_container_8GridTree_10count(PyObject *__pyx_v_self, PyObject *__pyx_v_selector); /*proto*/
__pyx_pw_2yt_8geometry_14grid_container_8GridTree_10count(PyObject * __pyx_v_self,PyObject * __pyx_v_selector)6686 static PyObject *__pyx_pw_2yt_8geometry_14grid_container_8GridTree_10count(PyObject *__pyx_v_self, PyObject *__pyx_v_selector) {
6687   PyObject *__pyx_r = 0;
6688   __Pyx_RefNannyDeclarations
6689   __Pyx_RefNannySetupContext("count (wrapper)", 0);
6690   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) __PYX_ERR(0, 193, __pyx_L1_error)
6691   __pyx_r = __pyx_pf_2yt_8geometry_14grid_container_8GridTree_9count(((struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self), ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)__pyx_v_selector));
6692 
6693   /* function exit code */
6694   goto __pyx_L0;
6695   __pyx_L1_error:;
6696   __pyx_r = NULL;
6697   __pyx_L0:;
6698   __Pyx_RefNannyFinishContext();
6699   return __pyx_r;
6700 }
6701 
__pyx_pf_2yt_8geometry_14grid_container_8GridTree_9count(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree * __pyx_v_self,struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject * __pyx_v_selector)6702 static PyObject *__pyx_pf_2yt_8geometry_14grid_container_8GridTree_9count(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector) {
6703   struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData __pyx_v_data;
6704   __pyx_t_5numpy_uint64_t __pyx_v_size;
6705   int __pyx_v_i;
6706   struct __pyx_obj_2yt_9utilities_3lib_8bitarray_bitarray *__pyx_v_mask = 0;
6707   PyObject *__pyx_r = NULL;
6708   __Pyx_RefNannyDeclarations
6709   int __pyx_t_1;
6710   int __pyx_t_2;
6711   int __pyx_t_3;
6712   PyObject *__pyx_t_4 = NULL;
6713   PyObject *__pyx_t_5 = NULL;
6714   __Pyx_RefNannySetupContext("count", 0);
6715 
6716   /* "yt/geometry/grid_container.pyx":196
6717  *         # Use the counting grid visitor
6718  *         cdef GridVisitorData data
6719  *         self.setup_data(&data)             # <<<<<<<<<<<<<<
6720  *         cdef np.uint64_t size = 0
6721  *         cdef int i
6722  */
6723   ((struct __pyx_vtabstruct_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self->__pyx_vtab)->setup_data(__pyx_v_self, (&__pyx_v_data));
6724 
6725   /* "yt/geometry/grid_container.pyx":197
6726  *         cdef GridVisitorData data
6727  *         self.setup_data(&data)
6728  *         cdef np.uint64_t size = 0             # <<<<<<<<<<<<<<
6729  *         cdef int i
6730  *         for i in range(self.num_grids):
6731  */
6732   __pyx_v_size = 0;
6733 
6734   /* "yt/geometry/grid_container.pyx":199
6735  *         cdef np.uint64_t size = 0
6736  *         cdef int i
6737  *         for i in range(self.num_grids):             # <<<<<<<<<<<<<<
6738  *             size += (self.grids[i].dims[0] *
6739  *                      self.grids[i].dims[1] *
6740  */
6741   __pyx_t_1 = __pyx_v_self->num_grids;
6742   __pyx_t_2 = __pyx_t_1;
6743   for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
6744     __pyx_v_i = __pyx_t_3;
6745 
6746     /* "yt/geometry/grid_container.pyx":200
6747  *         cdef int i
6748  *         for i in range(self.num_grids):
6749  *             size += (self.grids[i].dims[0] *             # <<<<<<<<<<<<<<
6750  *                      self.grids[i].dims[1] *
6751  *                      self.grids[i].dims[2])
6752  */
6753     __pyx_v_size = (__pyx_v_size + ((((__pyx_v_self->grids[__pyx_v_i]).dims[0]) * ((__pyx_v_self->grids[__pyx_v_i]).dims[1])) * ((__pyx_v_self->grids[__pyx_v_i]).dims[2])));
6754   }
6755 
6756   /* "yt/geometry/grid_container.pyx":203
6757  *                      self.grids[i].dims[1] *
6758  *                      self.grids[i].dims[2])
6759  *         cdef bitarray mask = bitarray(size)             # <<<<<<<<<<<<<<
6760  *         data.array = <void*>mask.buf
6761  *         self.visit_grids(&data, grid_visitors.mask_cells, selector)
6762  */
6763   __pyx_t_4 = __Pyx_PyInt_From_npy_uint64(__pyx_v_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 203, __pyx_L1_error)
6764   __Pyx_GOTREF(__pyx_t_4);
6765   __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_2yt_9utilities_3lib_8bitarray_bitarray), __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 203, __pyx_L1_error)
6766   __Pyx_GOTREF(__pyx_t_5);
6767   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6768   __pyx_v_mask = ((struct __pyx_obj_2yt_9utilities_3lib_8bitarray_bitarray *)__pyx_t_5);
6769   __pyx_t_5 = 0;
6770 
6771   /* "yt/geometry/grid_container.pyx":204
6772  *                      self.grids[i].dims[2])
6773  *         cdef bitarray mask = bitarray(size)
6774  *         data.array = <void*>mask.buf             # <<<<<<<<<<<<<<
6775  *         self.visit_grids(&data, grid_visitors.mask_cells, selector)
6776  *         self.mask = mask
6777  */
6778   __pyx_v_data.array = ((void *)__pyx_v_mask->buf);
6779 
6780   /* "yt/geometry/grid_container.pyx":205
6781  *         cdef bitarray mask = bitarray(size)
6782  *         data.array = <void*>mask.buf
6783  *         self.visit_grids(&data, grid_visitors.mask_cells, selector)             # <<<<<<<<<<<<<<
6784  *         self.mask = mask
6785  *         size = 0
6786  */
6787   ((struct __pyx_vtabstruct_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self->__pyx_vtab)->visit_grids(__pyx_v_self, (&__pyx_v_data), __pyx_f_2yt_8geometry_13grid_visitors_mask_cells, __pyx_v_selector);
6788 
6789   /* "yt/geometry/grid_container.pyx":206
6790  *         data.array = <void*>mask.buf
6791  *         self.visit_grids(&data, grid_visitors.mask_cells, selector)
6792  *         self.mask = mask             # <<<<<<<<<<<<<<
6793  *         size = 0
6794  *         self.setup_data(&data)
6795  */
6796   __Pyx_INCREF(((PyObject *)__pyx_v_mask));
6797   __Pyx_GIVEREF(((PyObject *)__pyx_v_mask));
6798   __Pyx_GOTREF(__pyx_v_self->mask);
6799   __Pyx_DECREF(((PyObject *)__pyx_v_self->mask));
6800   __pyx_v_self->mask = __pyx_v_mask;
6801 
6802   /* "yt/geometry/grid_container.pyx":207
6803  *         self.visit_grids(&data, grid_visitors.mask_cells, selector)
6804  *         self.mask = mask
6805  *         size = 0             # <<<<<<<<<<<<<<
6806  *         self.setup_data(&data)
6807  *         data.array = <void*>(&size)
6808  */
6809   __pyx_v_size = 0;
6810 
6811   /* "yt/geometry/grid_container.pyx":208
6812  *         self.mask = mask
6813  *         size = 0
6814  *         self.setup_data(&data)             # <<<<<<<<<<<<<<
6815  *         data.array = <void*>(&size)
6816  *         self.visit_grids(&data,  grid_visitors.count_cells, selector)
6817  */
6818   ((struct __pyx_vtabstruct_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self->__pyx_vtab)->setup_data(__pyx_v_self, (&__pyx_v_data));
6819 
6820   /* "yt/geometry/grid_container.pyx":209
6821  *         size = 0
6822  *         self.setup_data(&data)
6823  *         data.array = <void*>(&size)             # <<<<<<<<<<<<<<
6824  *         self.visit_grids(&data,  grid_visitors.count_cells, selector)
6825  *         return size
6826  */
6827   __pyx_v_data.array = ((void *)(&__pyx_v_size));
6828 
6829   /* "yt/geometry/grid_container.pyx":210
6830  *         self.setup_data(&data)
6831  *         data.array = <void*>(&size)
6832  *         self.visit_grids(&data,  grid_visitors.count_cells, selector)             # <<<<<<<<<<<<<<
6833  *         return size
6834  *
6835  */
6836   ((struct __pyx_vtabstruct_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self->__pyx_vtab)->visit_grids(__pyx_v_self, (&__pyx_v_data), __pyx_f_2yt_8geometry_13grid_visitors_count_cells, __pyx_v_selector);
6837 
6838   /* "yt/geometry/grid_container.pyx":211
6839  *         data.array = <void*>(&size)
6840  *         self.visit_grids(&data,  grid_visitors.count_cells, selector)
6841  *         return size             # <<<<<<<<<<<<<<
6842  *
6843  *     def select_icoords(self, SelectorObject selector, np.uint64_t size = -1):
6844  */
6845   __Pyx_XDECREF(__pyx_r);
6846   __pyx_t_5 = __Pyx_PyInt_From_npy_uint64(__pyx_v_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 211, __pyx_L1_error)
6847   __Pyx_GOTREF(__pyx_t_5);
6848   __pyx_r = __pyx_t_5;
6849   __pyx_t_5 = 0;
6850   goto __pyx_L0;
6851 
6852   /* "yt/geometry/grid_container.pyx":193
6853  *                                         buf)
6854  *
6855  *     def count(self, SelectorObject selector):             # <<<<<<<<<<<<<<
6856  *         # Use the counting grid visitor
6857  *         cdef GridVisitorData data
6858  */
6859 
6860   /* function exit code */
6861   __pyx_L1_error:;
6862   __Pyx_XDECREF(__pyx_t_4);
6863   __Pyx_XDECREF(__pyx_t_5);
6864   __Pyx_AddTraceback("yt.geometry.grid_container.GridTree.count", __pyx_clineno, __pyx_lineno, __pyx_filename);
6865   __pyx_r = NULL;
6866   __pyx_L0:;
6867   __Pyx_XDECREF((PyObject *)__pyx_v_mask);
6868   __Pyx_XGIVEREF(__pyx_r);
6869   __Pyx_RefNannyFinishContext();
6870   return __pyx_r;
6871 }
6872 
6873 /* "yt/geometry/grid_container.pyx":213
6874  *         return size
6875  *
6876  *     def select_icoords(self, SelectorObject selector, np.uint64_t size = -1):             # <<<<<<<<<<<<<<
6877  *         # Fill icoords with a selector
6878  *         cdef GridVisitorData data
6879  */
6880 
6881 /* Python wrapper */
6882 static PyObject *__pyx_pw_2yt_8geometry_14grid_container_8GridTree_12select_icoords(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2yt_8geometry_14grid_container_8GridTree_12select_icoords(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)6883 static PyObject *__pyx_pw_2yt_8geometry_14grid_container_8GridTree_12select_icoords(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6884   struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector = 0;
6885   __pyx_t_5numpy_uint64_t __pyx_v_size;
6886   PyObject *__pyx_r = 0;
6887   __Pyx_RefNannyDeclarations
6888   __Pyx_RefNannySetupContext("select_icoords (wrapper)", 0);
6889   {
6890     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_selector,&__pyx_n_s_size,0};
6891     PyObject* values[2] = {0,0};
6892     if (unlikely(__pyx_kwds)) {
6893       Py_ssize_t kw_args;
6894       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6895       switch (pos_args) {
6896         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6897         CYTHON_FALLTHROUGH;
6898         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6899         CYTHON_FALLTHROUGH;
6900         case  0: break;
6901         default: goto __pyx_L5_argtuple_error;
6902       }
6903       kw_args = PyDict_Size(__pyx_kwds);
6904       switch (pos_args) {
6905         case  0:
6906         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_selector)) != 0)) kw_args--;
6907         else goto __pyx_L5_argtuple_error;
6908         CYTHON_FALLTHROUGH;
6909         case  1:
6910         if (kw_args > 0) {
6911           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size);
6912           if (value) { values[1] = value; kw_args--; }
6913         }
6914       }
6915       if (unlikely(kw_args > 0)) {
6916         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "select_icoords") < 0)) __PYX_ERR(0, 213, __pyx_L3_error)
6917       }
6918     } else {
6919       switch (PyTuple_GET_SIZE(__pyx_args)) {
6920         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6921         CYTHON_FALLTHROUGH;
6922         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6923         break;
6924         default: goto __pyx_L5_argtuple_error;
6925       }
6926     }
6927     __pyx_v_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)values[0]);
6928     if (values[1]) {
6929       __pyx_v_size = __Pyx_PyInt_As_npy_uint64(values[1]); if (unlikely((__pyx_v_size == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 213, __pyx_L3_error)
6930     } else {
6931       __pyx_v_size = ((__pyx_t_5numpy_uint64_t)-1LL);
6932     }
6933   }
6934   goto __pyx_L4_argument_unpacking_done;
6935   __pyx_L5_argtuple_error:;
6936   __Pyx_RaiseArgtupleInvalid("select_icoords", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 213, __pyx_L3_error)
6937   __pyx_L3_error:;
6938   __Pyx_AddTraceback("yt.geometry.grid_container.GridTree.select_icoords", __pyx_clineno, __pyx_lineno, __pyx_filename);
6939   __Pyx_RefNannyFinishContext();
6940   return NULL;
6941   __pyx_L4_argument_unpacking_done:;
6942   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) __PYX_ERR(0, 213, __pyx_L1_error)
6943   __pyx_r = __pyx_pf_2yt_8geometry_14grid_container_8GridTree_11select_icoords(((struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self), __pyx_v_selector, __pyx_v_size);
6944 
6945   /* function exit code */
6946   goto __pyx_L0;
6947   __pyx_L1_error:;
6948   __pyx_r = NULL;
6949   __pyx_L0:;
6950   __Pyx_RefNannyFinishContext();
6951   return __pyx_r;
6952 }
6953 
__pyx_pf_2yt_8geometry_14grid_container_8GridTree_11select_icoords(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree * __pyx_v_self,struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject * __pyx_v_selector,__pyx_t_5numpy_uint64_t __pyx_v_size)6954 static PyObject *__pyx_pf_2yt_8geometry_14grid_container_8GridTree_11select_icoords(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, __pyx_t_5numpy_uint64_t __pyx_v_size) {
6955   struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData __pyx_v_data;
6956   PyArrayObject *__pyx_v_icoords = 0;
6957   __Pyx_LocalBuf_ND __pyx_pybuffernd_icoords;
6958   __Pyx_Buffer __pyx_pybuffer_icoords;
6959   PyObject *__pyx_r = NULL;
6960   __Pyx_RefNannyDeclarations
6961   int __pyx_t_1;
6962   PyObject *__pyx_t_2 = NULL;
6963   PyObject *__pyx_t_3 = NULL;
6964   PyObject *__pyx_t_4 = NULL;
6965   PyObject *__pyx_t_5 = NULL;
6966   PyArrayObject *__pyx_t_6 = NULL;
6967   int __pyx_t_7;
6968   PyObject *__pyx_t_8 = NULL;
6969   PyObject *__pyx_t_9 = NULL;
6970   PyObject *__pyx_t_10 = NULL;
6971   char *__pyx_t_11;
6972   __Pyx_RefNannySetupContext("select_icoords", 0);
6973   __pyx_pybuffer_icoords.pybuffer.buf = NULL;
6974   __pyx_pybuffer_icoords.refcount = 0;
6975   __pyx_pybuffernd_icoords.data = NULL;
6976   __pyx_pybuffernd_icoords.rcbuffer = &__pyx_pybuffer_icoords;
6977 
6978   /* "yt/geometry/grid_container.pyx":216
6979  *         # Fill icoords with a selector
6980  *         cdef GridVisitorData data
6981  *         self.setup_data(&data)             # <<<<<<<<<<<<<<
6982  *         if size == -1:
6983  *             size = 0
6984  */
6985   ((struct __pyx_vtabstruct_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self->__pyx_vtab)->setup_data(__pyx_v_self, (&__pyx_v_data));
6986 
6987   /* "yt/geometry/grid_container.pyx":217
6988  *         cdef GridVisitorData data
6989  *         self.setup_data(&data)
6990  *         if size == -1:             # <<<<<<<<<<<<<<
6991  *             size = 0
6992  *             data.array = <void*>(&size)
6993  */
6994   __pyx_t_1 = ((__pyx_v_size == -1LL) != 0);
6995   if (__pyx_t_1) {
6996 
6997     /* "yt/geometry/grid_container.pyx":218
6998  *         self.setup_data(&data)
6999  *         if size == -1:
7000  *             size = 0             # <<<<<<<<<<<<<<
7001  *             data.array = <void*>(&size)
7002  *             self.visit_grids(&data,  grid_visitors.count_cells, selector)
7003  */
7004     __pyx_v_size = 0;
7005 
7006     /* "yt/geometry/grid_container.pyx":219
7007  *         if size == -1:
7008  *             size = 0
7009  *             data.array = <void*>(&size)             # <<<<<<<<<<<<<<
7010  *             self.visit_grids(&data,  grid_visitors.count_cells, selector)
7011  *         cdef np.ndarray[np.int64_t, ndim=2] icoords
7012  */
7013     __pyx_v_data.array = ((void *)(&__pyx_v_size));
7014 
7015     /* "yt/geometry/grid_container.pyx":220
7016  *             size = 0
7017  *             data.array = <void*>(&size)
7018  *             self.visit_grids(&data,  grid_visitors.count_cells, selector)             # <<<<<<<<<<<<<<
7019  *         cdef np.ndarray[np.int64_t, ndim=2] icoords
7020  *         icoords = np.empty((size, 3), dtype="int64")
7021  */
7022     ((struct __pyx_vtabstruct_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self->__pyx_vtab)->visit_grids(__pyx_v_self, (&__pyx_v_data), __pyx_f_2yt_8geometry_13grid_visitors_count_cells, __pyx_v_selector);
7023 
7024     /* "yt/geometry/grid_container.pyx":217
7025  *         cdef GridVisitorData data
7026  *         self.setup_data(&data)
7027  *         if size == -1:             # <<<<<<<<<<<<<<
7028  *             size = 0
7029  *             data.array = <void*>(&size)
7030  */
7031   }
7032 
7033   /* "yt/geometry/grid_container.pyx":222
7034  *             self.visit_grids(&data,  grid_visitors.count_cells, selector)
7035  *         cdef np.ndarray[np.int64_t, ndim=2] icoords
7036  *         icoords = np.empty((size, 3), dtype="int64")             # <<<<<<<<<<<<<<
7037  *         data.array = icoords.data
7038  *         self.visit_grids(&data, grid_visitors.icoords_cells, selector)
7039  */
7040   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __pyx_L1_error)
7041   __Pyx_GOTREF(__pyx_t_2);
7042   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 222, __pyx_L1_error)
7043   __Pyx_GOTREF(__pyx_t_3);
7044   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7045   __pyx_t_2 = __Pyx_PyInt_From_npy_uint64(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __pyx_L1_error)
7046   __Pyx_GOTREF(__pyx_t_2);
7047   __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 222, __pyx_L1_error)
7048   __Pyx_GOTREF(__pyx_t_4);
7049   __Pyx_GIVEREF(__pyx_t_2);
7050   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
7051   __Pyx_INCREF(__pyx_int_3);
7052   __Pyx_GIVEREF(__pyx_int_3);
7053   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_3);
7054   __pyx_t_2 = 0;
7055   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __pyx_L1_error)
7056   __Pyx_GOTREF(__pyx_t_2);
7057   __Pyx_GIVEREF(__pyx_t_4);
7058   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
7059   __pyx_t_4 = 0;
7060   __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 222, __pyx_L1_error)
7061   __Pyx_GOTREF(__pyx_t_4);
7062   if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 222, __pyx_L1_error)
7063   __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 222, __pyx_L1_error)
7064   __Pyx_GOTREF(__pyx_t_5);
7065   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7066   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7067   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7068   if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 222, __pyx_L1_error)
7069   __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
7070   {
7071     __Pyx_BufFmt_StackElem __pyx_stack[1];
7072     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_icoords.rcbuffer->pybuffer);
7073     __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_icoords.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
7074     if (unlikely(__pyx_t_7 < 0)) {
7075       PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
7076       if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_icoords.rcbuffer->pybuffer, (PyObject*)__pyx_v_icoords, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
7077         Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
7078         __Pyx_RaiseBufferFallbackError();
7079       } else {
7080         PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
7081       }
7082       __pyx_t_8 = __pyx_t_9 = __pyx_t_10 = 0;
7083     }
7084     __pyx_pybuffernd_icoords.diminfo[0].strides = __pyx_pybuffernd_icoords.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_icoords.diminfo[0].shape = __pyx_pybuffernd_icoords.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_icoords.diminfo[1].strides = __pyx_pybuffernd_icoords.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_icoords.diminfo[1].shape = __pyx_pybuffernd_icoords.rcbuffer->pybuffer.shape[1];
7085     if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 222, __pyx_L1_error)
7086   }
7087   __pyx_t_6 = 0;
7088   __pyx_v_icoords = ((PyArrayObject *)__pyx_t_5);
7089   __pyx_t_5 = 0;
7090 
7091   /* "yt/geometry/grid_container.pyx":223
7092  *         cdef np.ndarray[np.int64_t, ndim=2] icoords
7093  *         icoords = np.empty((size, 3), dtype="int64")
7094  *         data.array = icoords.data             # <<<<<<<<<<<<<<
7095  *         self.visit_grids(&data, grid_visitors.icoords_cells, selector)
7096  *         return icoords
7097  */
7098   __pyx_t_11 = __pyx_v_icoords->data;
7099   __pyx_v_data.array = __pyx_t_11;
7100 
7101   /* "yt/geometry/grid_container.pyx":224
7102  *         icoords = np.empty((size, 3), dtype="int64")
7103  *         data.array = icoords.data
7104  *         self.visit_grids(&data, grid_visitors.icoords_cells, selector)             # <<<<<<<<<<<<<<
7105  *         return icoords
7106  *
7107  */
7108   ((struct __pyx_vtabstruct_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self->__pyx_vtab)->visit_grids(__pyx_v_self, (&__pyx_v_data), __pyx_f_2yt_8geometry_13grid_visitors_icoords_cells, __pyx_v_selector);
7109 
7110   /* "yt/geometry/grid_container.pyx":225
7111  *         data.array = icoords.data
7112  *         self.visit_grids(&data, grid_visitors.icoords_cells, selector)
7113  *         return icoords             # <<<<<<<<<<<<<<
7114  *
7115  *     def select_ires(self, SelectorObject selector, np.uint64_t size = -1):
7116  */
7117   __Pyx_XDECREF(__pyx_r);
7118   __Pyx_INCREF(((PyObject *)__pyx_v_icoords));
7119   __pyx_r = ((PyObject *)__pyx_v_icoords);
7120   goto __pyx_L0;
7121 
7122   /* "yt/geometry/grid_container.pyx":213
7123  *         return size
7124  *
7125  *     def select_icoords(self, SelectorObject selector, np.uint64_t size = -1):             # <<<<<<<<<<<<<<
7126  *         # Fill icoords with a selector
7127  *         cdef GridVisitorData data
7128  */
7129 
7130   /* function exit code */
7131   __pyx_L1_error:;
7132   __Pyx_XDECREF(__pyx_t_2);
7133   __Pyx_XDECREF(__pyx_t_3);
7134   __Pyx_XDECREF(__pyx_t_4);
7135   __Pyx_XDECREF(__pyx_t_5);
7136   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
7137     __Pyx_PyThreadState_declare
7138     __Pyx_PyThreadState_assign
7139     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
7140     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_icoords.rcbuffer->pybuffer);
7141   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
7142   __Pyx_AddTraceback("yt.geometry.grid_container.GridTree.select_icoords", __pyx_clineno, __pyx_lineno, __pyx_filename);
7143   __pyx_r = NULL;
7144   goto __pyx_L2;
7145   __pyx_L0:;
7146   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_icoords.rcbuffer->pybuffer);
7147   __pyx_L2:;
7148   __Pyx_XDECREF((PyObject *)__pyx_v_icoords);
7149   __Pyx_XGIVEREF(__pyx_r);
7150   __Pyx_RefNannyFinishContext();
7151   return __pyx_r;
7152 }
7153 
7154 /* "yt/geometry/grid_container.pyx":227
7155  *         return icoords
7156  *
7157  *     def select_ires(self, SelectorObject selector, np.uint64_t size = -1):             # <<<<<<<<<<<<<<
7158  *         # Fill ires with a selector
7159  *         cdef GridVisitorData data
7160  */
7161 
7162 /* Python wrapper */
7163 static PyObject *__pyx_pw_2yt_8geometry_14grid_container_8GridTree_14select_ires(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2yt_8geometry_14grid_container_8GridTree_14select_ires(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)7164 static PyObject *__pyx_pw_2yt_8geometry_14grid_container_8GridTree_14select_ires(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7165   struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector = 0;
7166   __pyx_t_5numpy_uint64_t __pyx_v_size;
7167   PyObject *__pyx_r = 0;
7168   __Pyx_RefNannyDeclarations
7169   __Pyx_RefNannySetupContext("select_ires (wrapper)", 0);
7170   {
7171     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_selector,&__pyx_n_s_size,0};
7172     PyObject* values[2] = {0,0};
7173     if (unlikely(__pyx_kwds)) {
7174       Py_ssize_t kw_args;
7175       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7176       switch (pos_args) {
7177         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7178         CYTHON_FALLTHROUGH;
7179         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7180         CYTHON_FALLTHROUGH;
7181         case  0: break;
7182         default: goto __pyx_L5_argtuple_error;
7183       }
7184       kw_args = PyDict_Size(__pyx_kwds);
7185       switch (pos_args) {
7186         case  0:
7187         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_selector)) != 0)) kw_args--;
7188         else goto __pyx_L5_argtuple_error;
7189         CYTHON_FALLTHROUGH;
7190         case  1:
7191         if (kw_args > 0) {
7192           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size);
7193           if (value) { values[1] = value; kw_args--; }
7194         }
7195       }
7196       if (unlikely(kw_args > 0)) {
7197         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "select_ires") < 0)) __PYX_ERR(0, 227, __pyx_L3_error)
7198       }
7199     } else {
7200       switch (PyTuple_GET_SIZE(__pyx_args)) {
7201         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7202         CYTHON_FALLTHROUGH;
7203         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7204         break;
7205         default: goto __pyx_L5_argtuple_error;
7206       }
7207     }
7208     __pyx_v_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)values[0]);
7209     if (values[1]) {
7210       __pyx_v_size = __Pyx_PyInt_As_npy_uint64(values[1]); if (unlikely((__pyx_v_size == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 227, __pyx_L3_error)
7211     } else {
7212       __pyx_v_size = ((__pyx_t_5numpy_uint64_t)-1LL);
7213     }
7214   }
7215   goto __pyx_L4_argument_unpacking_done;
7216   __pyx_L5_argtuple_error:;
7217   __Pyx_RaiseArgtupleInvalid("select_ires", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 227, __pyx_L3_error)
7218   __pyx_L3_error:;
7219   __Pyx_AddTraceback("yt.geometry.grid_container.GridTree.select_ires", __pyx_clineno, __pyx_lineno, __pyx_filename);
7220   __Pyx_RefNannyFinishContext();
7221   return NULL;
7222   __pyx_L4_argument_unpacking_done:;
7223   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) __PYX_ERR(0, 227, __pyx_L1_error)
7224   __pyx_r = __pyx_pf_2yt_8geometry_14grid_container_8GridTree_13select_ires(((struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self), __pyx_v_selector, __pyx_v_size);
7225 
7226   /* function exit code */
7227   goto __pyx_L0;
7228   __pyx_L1_error:;
7229   __pyx_r = NULL;
7230   __pyx_L0:;
7231   __Pyx_RefNannyFinishContext();
7232   return __pyx_r;
7233 }
7234 
__pyx_pf_2yt_8geometry_14grid_container_8GridTree_13select_ires(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree * __pyx_v_self,struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject * __pyx_v_selector,__pyx_t_5numpy_uint64_t __pyx_v_size)7235 static PyObject *__pyx_pf_2yt_8geometry_14grid_container_8GridTree_13select_ires(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, __pyx_t_5numpy_uint64_t __pyx_v_size) {
7236   struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData __pyx_v_data;
7237   PyArrayObject *__pyx_v_ires = 0;
7238   __Pyx_LocalBuf_ND __pyx_pybuffernd_ires;
7239   __Pyx_Buffer __pyx_pybuffer_ires;
7240   PyObject *__pyx_r = NULL;
7241   __Pyx_RefNannyDeclarations
7242   int __pyx_t_1;
7243   PyObject *__pyx_t_2 = NULL;
7244   PyObject *__pyx_t_3 = NULL;
7245   PyObject *__pyx_t_4 = NULL;
7246   PyObject *__pyx_t_5 = NULL;
7247   PyArrayObject *__pyx_t_6 = NULL;
7248   int __pyx_t_7;
7249   PyObject *__pyx_t_8 = NULL;
7250   PyObject *__pyx_t_9 = NULL;
7251   PyObject *__pyx_t_10 = NULL;
7252   char *__pyx_t_11;
7253   __Pyx_RefNannySetupContext("select_ires", 0);
7254   __pyx_pybuffer_ires.pybuffer.buf = NULL;
7255   __pyx_pybuffer_ires.refcount = 0;
7256   __pyx_pybuffernd_ires.data = NULL;
7257   __pyx_pybuffernd_ires.rcbuffer = &__pyx_pybuffer_ires;
7258 
7259   /* "yt/geometry/grid_container.pyx":230
7260  *         # Fill ires with a selector
7261  *         cdef GridVisitorData data
7262  *         self.setup_data(&data)             # <<<<<<<<<<<<<<
7263  *         if size == -1:
7264  *             size = 0
7265  */
7266   ((struct __pyx_vtabstruct_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self->__pyx_vtab)->setup_data(__pyx_v_self, (&__pyx_v_data));
7267 
7268   /* "yt/geometry/grid_container.pyx":231
7269  *         cdef GridVisitorData data
7270  *         self.setup_data(&data)
7271  *         if size == -1:             # <<<<<<<<<<<<<<
7272  *             size = 0
7273  *             data.array = <void*>(&size)
7274  */
7275   __pyx_t_1 = ((__pyx_v_size == -1LL) != 0);
7276   if (__pyx_t_1) {
7277 
7278     /* "yt/geometry/grid_container.pyx":232
7279  *         self.setup_data(&data)
7280  *         if size == -1:
7281  *             size = 0             # <<<<<<<<<<<<<<
7282  *             data.array = <void*>(&size)
7283  *             self.visit_grids(&data,  grid_visitors.count_cells, selector)
7284  */
7285     __pyx_v_size = 0;
7286 
7287     /* "yt/geometry/grid_container.pyx":233
7288  *         if size == -1:
7289  *             size = 0
7290  *             data.array = <void*>(&size)             # <<<<<<<<<<<<<<
7291  *             self.visit_grids(&data,  grid_visitors.count_cells, selector)
7292  *         cdef np.ndarray[np.int64_t, ndim=1] ires
7293  */
7294     __pyx_v_data.array = ((void *)(&__pyx_v_size));
7295 
7296     /* "yt/geometry/grid_container.pyx":234
7297  *             size = 0
7298  *             data.array = <void*>(&size)
7299  *             self.visit_grids(&data,  grid_visitors.count_cells, selector)             # <<<<<<<<<<<<<<
7300  *         cdef np.ndarray[np.int64_t, ndim=1] ires
7301  *         ires = np.empty(size, dtype="int64")
7302  */
7303     ((struct __pyx_vtabstruct_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self->__pyx_vtab)->visit_grids(__pyx_v_self, (&__pyx_v_data), __pyx_f_2yt_8geometry_13grid_visitors_count_cells, __pyx_v_selector);
7304 
7305     /* "yt/geometry/grid_container.pyx":231
7306  *         cdef GridVisitorData data
7307  *         self.setup_data(&data)
7308  *         if size == -1:             # <<<<<<<<<<<<<<
7309  *             size = 0
7310  *             data.array = <void*>(&size)
7311  */
7312   }
7313 
7314   /* "yt/geometry/grid_container.pyx":236
7315  *             self.visit_grids(&data,  grid_visitors.count_cells, selector)
7316  *         cdef np.ndarray[np.int64_t, ndim=1] ires
7317  *         ires = np.empty(size, dtype="int64")             # <<<<<<<<<<<<<<
7318  *         data.array = ires.data
7319  *         self.visit_grids(&data, grid_visitors.ires_cells, selector)
7320  */
7321   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error)
7322   __Pyx_GOTREF(__pyx_t_2);
7323   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 236, __pyx_L1_error)
7324   __Pyx_GOTREF(__pyx_t_3);
7325   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7326   __pyx_t_2 = __Pyx_PyInt_From_npy_uint64(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error)
7327   __Pyx_GOTREF(__pyx_t_2);
7328   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 236, __pyx_L1_error)
7329   __Pyx_GOTREF(__pyx_t_4);
7330   __Pyx_GIVEREF(__pyx_t_2);
7331   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
7332   __pyx_t_2 = 0;
7333   __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error)
7334   __Pyx_GOTREF(__pyx_t_2);
7335   if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 236, __pyx_L1_error)
7336   __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 236, __pyx_L1_error)
7337   __Pyx_GOTREF(__pyx_t_5);
7338   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7339   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7340   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7341   if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 236, __pyx_L1_error)
7342   __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
7343   {
7344     __Pyx_BufFmt_StackElem __pyx_stack[1];
7345     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ires.rcbuffer->pybuffer);
7346     __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ires.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
7347     if (unlikely(__pyx_t_7 < 0)) {
7348       PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
7349       if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ires.rcbuffer->pybuffer, (PyObject*)__pyx_v_ires, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
7350         Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
7351         __Pyx_RaiseBufferFallbackError();
7352       } else {
7353         PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
7354       }
7355       __pyx_t_8 = __pyx_t_9 = __pyx_t_10 = 0;
7356     }
7357     __pyx_pybuffernd_ires.diminfo[0].strides = __pyx_pybuffernd_ires.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ires.diminfo[0].shape = __pyx_pybuffernd_ires.rcbuffer->pybuffer.shape[0];
7358     if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 236, __pyx_L1_error)
7359   }
7360   __pyx_t_6 = 0;
7361   __pyx_v_ires = ((PyArrayObject *)__pyx_t_5);
7362   __pyx_t_5 = 0;
7363 
7364   /* "yt/geometry/grid_container.pyx":237
7365  *         cdef np.ndarray[np.int64_t, ndim=1] ires
7366  *         ires = np.empty(size, dtype="int64")
7367  *         data.array = ires.data             # <<<<<<<<<<<<<<
7368  *         self.visit_grids(&data, grid_visitors.ires_cells, selector)
7369  *         return ires
7370  */
7371   __pyx_t_11 = __pyx_v_ires->data;
7372   __pyx_v_data.array = __pyx_t_11;
7373 
7374   /* "yt/geometry/grid_container.pyx":238
7375  *         ires = np.empty(size, dtype="int64")
7376  *         data.array = ires.data
7377  *         self.visit_grids(&data, grid_visitors.ires_cells, selector)             # <<<<<<<<<<<<<<
7378  *         return ires
7379  *
7380  */
7381   ((struct __pyx_vtabstruct_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self->__pyx_vtab)->visit_grids(__pyx_v_self, (&__pyx_v_data), __pyx_f_2yt_8geometry_13grid_visitors_ires_cells, __pyx_v_selector);
7382 
7383   /* "yt/geometry/grid_container.pyx":239
7384  *         data.array = ires.data
7385  *         self.visit_grids(&data, grid_visitors.ires_cells, selector)
7386  *         return ires             # <<<<<<<<<<<<<<
7387  *
7388  *     def select_fcoords(self, SelectorObject selector, np.uint64_t size = -1):
7389  */
7390   __Pyx_XDECREF(__pyx_r);
7391   __Pyx_INCREF(((PyObject *)__pyx_v_ires));
7392   __pyx_r = ((PyObject *)__pyx_v_ires);
7393   goto __pyx_L0;
7394 
7395   /* "yt/geometry/grid_container.pyx":227
7396  *         return icoords
7397  *
7398  *     def select_ires(self, SelectorObject selector, np.uint64_t size = -1):             # <<<<<<<<<<<<<<
7399  *         # Fill ires with a selector
7400  *         cdef GridVisitorData data
7401  */
7402 
7403   /* function exit code */
7404   __pyx_L1_error:;
7405   __Pyx_XDECREF(__pyx_t_2);
7406   __Pyx_XDECREF(__pyx_t_3);
7407   __Pyx_XDECREF(__pyx_t_4);
7408   __Pyx_XDECREF(__pyx_t_5);
7409   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
7410     __Pyx_PyThreadState_declare
7411     __Pyx_PyThreadState_assign
7412     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
7413     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ires.rcbuffer->pybuffer);
7414   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
7415   __Pyx_AddTraceback("yt.geometry.grid_container.GridTree.select_ires", __pyx_clineno, __pyx_lineno, __pyx_filename);
7416   __pyx_r = NULL;
7417   goto __pyx_L2;
7418   __pyx_L0:;
7419   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ires.rcbuffer->pybuffer);
7420   __pyx_L2:;
7421   __Pyx_XDECREF((PyObject *)__pyx_v_ires);
7422   __Pyx_XGIVEREF(__pyx_r);
7423   __Pyx_RefNannyFinishContext();
7424   return __pyx_r;
7425 }
7426 
7427 /* "yt/geometry/grid_container.pyx":241
7428  *         return ires
7429  *
7430  *     def select_fcoords(self, SelectorObject selector, np.uint64_t size = -1):             # <<<<<<<<<<<<<<
7431  *         # Fill fcoords with a selector
7432  *         cdef GridVisitorData data
7433  */
7434 
7435 /* Python wrapper */
7436 static PyObject *__pyx_pw_2yt_8geometry_14grid_container_8GridTree_16select_fcoords(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2yt_8geometry_14grid_container_8GridTree_16select_fcoords(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)7437 static PyObject *__pyx_pw_2yt_8geometry_14grid_container_8GridTree_16select_fcoords(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7438   struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector = 0;
7439   __pyx_t_5numpy_uint64_t __pyx_v_size;
7440   PyObject *__pyx_r = 0;
7441   __Pyx_RefNannyDeclarations
7442   __Pyx_RefNannySetupContext("select_fcoords (wrapper)", 0);
7443   {
7444     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_selector,&__pyx_n_s_size,0};
7445     PyObject* values[2] = {0,0};
7446     if (unlikely(__pyx_kwds)) {
7447       Py_ssize_t kw_args;
7448       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7449       switch (pos_args) {
7450         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7451         CYTHON_FALLTHROUGH;
7452         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7453         CYTHON_FALLTHROUGH;
7454         case  0: break;
7455         default: goto __pyx_L5_argtuple_error;
7456       }
7457       kw_args = PyDict_Size(__pyx_kwds);
7458       switch (pos_args) {
7459         case  0:
7460         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_selector)) != 0)) kw_args--;
7461         else goto __pyx_L5_argtuple_error;
7462         CYTHON_FALLTHROUGH;
7463         case  1:
7464         if (kw_args > 0) {
7465           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size);
7466           if (value) { values[1] = value; kw_args--; }
7467         }
7468       }
7469       if (unlikely(kw_args > 0)) {
7470         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "select_fcoords") < 0)) __PYX_ERR(0, 241, __pyx_L3_error)
7471       }
7472     } else {
7473       switch (PyTuple_GET_SIZE(__pyx_args)) {
7474         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7475         CYTHON_FALLTHROUGH;
7476         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7477         break;
7478         default: goto __pyx_L5_argtuple_error;
7479       }
7480     }
7481     __pyx_v_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)values[0]);
7482     if (values[1]) {
7483       __pyx_v_size = __Pyx_PyInt_As_npy_uint64(values[1]); if (unlikely((__pyx_v_size == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 241, __pyx_L3_error)
7484     } else {
7485       __pyx_v_size = ((__pyx_t_5numpy_uint64_t)-1LL);
7486     }
7487   }
7488   goto __pyx_L4_argument_unpacking_done;
7489   __pyx_L5_argtuple_error:;
7490   __Pyx_RaiseArgtupleInvalid("select_fcoords", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 241, __pyx_L3_error)
7491   __pyx_L3_error:;
7492   __Pyx_AddTraceback("yt.geometry.grid_container.GridTree.select_fcoords", __pyx_clineno, __pyx_lineno, __pyx_filename);
7493   __Pyx_RefNannyFinishContext();
7494   return NULL;
7495   __pyx_L4_argument_unpacking_done:;
7496   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) __PYX_ERR(0, 241, __pyx_L1_error)
7497   __pyx_r = __pyx_pf_2yt_8geometry_14grid_container_8GridTree_15select_fcoords(((struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self), __pyx_v_selector, __pyx_v_size);
7498 
7499   /* function exit code */
7500   goto __pyx_L0;
7501   __pyx_L1_error:;
7502   __pyx_r = NULL;
7503   __pyx_L0:;
7504   __Pyx_RefNannyFinishContext();
7505   return __pyx_r;
7506 }
7507 
__pyx_pf_2yt_8geometry_14grid_container_8GridTree_15select_fcoords(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree * __pyx_v_self,struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject * __pyx_v_selector,__pyx_t_5numpy_uint64_t __pyx_v_size)7508 static PyObject *__pyx_pf_2yt_8geometry_14grid_container_8GridTree_15select_fcoords(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, __pyx_t_5numpy_uint64_t __pyx_v_size) {
7509   struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData __pyx_v_data;
7510   PyArrayObject *__pyx_v_fcoords = 0;
7511   __Pyx_LocalBuf_ND __pyx_pybuffernd_fcoords;
7512   __Pyx_Buffer __pyx_pybuffer_fcoords;
7513   PyObject *__pyx_r = NULL;
7514   __Pyx_RefNannyDeclarations
7515   int __pyx_t_1;
7516   PyObject *__pyx_t_2 = NULL;
7517   PyObject *__pyx_t_3 = NULL;
7518   PyObject *__pyx_t_4 = NULL;
7519   PyObject *__pyx_t_5 = NULL;
7520   PyArrayObject *__pyx_t_6 = NULL;
7521   int __pyx_t_7;
7522   PyObject *__pyx_t_8 = NULL;
7523   PyObject *__pyx_t_9 = NULL;
7524   PyObject *__pyx_t_10 = NULL;
7525   char *__pyx_t_11;
7526   __Pyx_RefNannySetupContext("select_fcoords", 0);
7527   __pyx_pybuffer_fcoords.pybuffer.buf = NULL;
7528   __pyx_pybuffer_fcoords.refcount = 0;
7529   __pyx_pybuffernd_fcoords.data = NULL;
7530   __pyx_pybuffernd_fcoords.rcbuffer = &__pyx_pybuffer_fcoords;
7531 
7532   /* "yt/geometry/grid_container.pyx":244
7533  *         # Fill fcoords with a selector
7534  *         cdef GridVisitorData data
7535  *         self.setup_data(&data)             # <<<<<<<<<<<<<<
7536  *         if size == -1:
7537  *             size = 0
7538  */
7539   ((struct __pyx_vtabstruct_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self->__pyx_vtab)->setup_data(__pyx_v_self, (&__pyx_v_data));
7540 
7541   /* "yt/geometry/grid_container.pyx":245
7542  *         cdef GridVisitorData data
7543  *         self.setup_data(&data)
7544  *         if size == -1:             # <<<<<<<<<<<<<<
7545  *             size = 0
7546  *             data.array = <void*>(&size)
7547  */
7548   __pyx_t_1 = ((__pyx_v_size == -1LL) != 0);
7549   if (__pyx_t_1) {
7550 
7551     /* "yt/geometry/grid_container.pyx":246
7552  *         self.setup_data(&data)
7553  *         if size == -1:
7554  *             size = 0             # <<<<<<<<<<<<<<
7555  *             data.array = <void*>(&size)
7556  *             self.visit_grids(&data,  grid_visitors.count_cells, selector)
7557  */
7558     __pyx_v_size = 0;
7559 
7560     /* "yt/geometry/grid_container.pyx":247
7561  *         if size == -1:
7562  *             size = 0
7563  *             data.array = <void*>(&size)             # <<<<<<<<<<<<<<
7564  *             self.visit_grids(&data,  grid_visitors.count_cells, selector)
7565  *         cdef np.ndarray[np.float64_t, ndim=2] fcoords
7566  */
7567     __pyx_v_data.array = ((void *)(&__pyx_v_size));
7568 
7569     /* "yt/geometry/grid_container.pyx":248
7570  *             size = 0
7571  *             data.array = <void*>(&size)
7572  *             self.visit_grids(&data,  grid_visitors.count_cells, selector)             # <<<<<<<<<<<<<<
7573  *         cdef np.ndarray[np.float64_t, ndim=2] fcoords
7574  *         fcoords = np.empty((size, 3), dtype="float64")
7575  */
7576     ((struct __pyx_vtabstruct_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self->__pyx_vtab)->visit_grids(__pyx_v_self, (&__pyx_v_data), __pyx_f_2yt_8geometry_13grid_visitors_count_cells, __pyx_v_selector);
7577 
7578     /* "yt/geometry/grid_container.pyx":245
7579  *         cdef GridVisitorData data
7580  *         self.setup_data(&data)
7581  *         if size == -1:             # <<<<<<<<<<<<<<
7582  *             size = 0
7583  *             data.array = <void*>(&size)
7584  */
7585   }
7586 
7587   /* "yt/geometry/grid_container.pyx":250
7588  *             self.visit_grids(&data,  grid_visitors.count_cells, selector)
7589  *         cdef np.ndarray[np.float64_t, ndim=2] fcoords
7590  *         fcoords = np.empty((size, 3), dtype="float64")             # <<<<<<<<<<<<<<
7591  *         data.array = fcoords.data
7592  *         self.visit_grids(&data, grid_visitors.fcoords_cells, selector)
7593  */
7594   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 250, __pyx_L1_error)
7595   __Pyx_GOTREF(__pyx_t_2);
7596   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 250, __pyx_L1_error)
7597   __Pyx_GOTREF(__pyx_t_3);
7598   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7599   __pyx_t_2 = __Pyx_PyInt_From_npy_uint64(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 250, __pyx_L1_error)
7600   __Pyx_GOTREF(__pyx_t_2);
7601   __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 250, __pyx_L1_error)
7602   __Pyx_GOTREF(__pyx_t_4);
7603   __Pyx_GIVEREF(__pyx_t_2);
7604   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
7605   __Pyx_INCREF(__pyx_int_3);
7606   __Pyx_GIVEREF(__pyx_int_3);
7607   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_3);
7608   __pyx_t_2 = 0;
7609   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 250, __pyx_L1_error)
7610   __Pyx_GOTREF(__pyx_t_2);
7611   __Pyx_GIVEREF(__pyx_t_4);
7612   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
7613   __pyx_t_4 = 0;
7614   __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 250, __pyx_L1_error)
7615   __Pyx_GOTREF(__pyx_t_4);
7616   if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 250, __pyx_L1_error)
7617   __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 250, __pyx_L1_error)
7618   __Pyx_GOTREF(__pyx_t_5);
7619   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7620   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7621   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7622   if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 250, __pyx_L1_error)
7623   __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
7624   {
7625     __Pyx_BufFmt_StackElem __pyx_stack[1];
7626     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_fcoords.rcbuffer->pybuffer);
7627     __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_fcoords.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
7628     if (unlikely(__pyx_t_7 < 0)) {
7629       PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
7630       if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_fcoords.rcbuffer->pybuffer, (PyObject*)__pyx_v_fcoords, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
7631         Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
7632         __Pyx_RaiseBufferFallbackError();
7633       } else {
7634         PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
7635       }
7636       __pyx_t_8 = __pyx_t_9 = __pyx_t_10 = 0;
7637     }
7638     __pyx_pybuffernd_fcoords.diminfo[0].strides = __pyx_pybuffernd_fcoords.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_fcoords.diminfo[0].shape = __pyx_pybuffernd_fcoords.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_fcoords.diminfo[1].strides = __pyx_pybuffernd_fcoords.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_fcoords.diminfo[1].shape = __pyx_pybuffernd_fcoords.rcbuffer->pybuffer.shape[1];
7639     if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 250, __pyx_L1_error)
7640   }
7641   __pyx_t_6 = 0;
7642   __pyx_v_fcoords = ((PyArrayObject *)__pyx_t_5);
7643   __pyx_t_5 = 0;
7644 
7645   /* "yt/geometry/grid_container.pyx":251
7646  *         cdef np.ndarray[np.float64_t, ndim=2] fcoords
7647  *         fcoords = np.empty((size, 3), dtype="float64")
7648  *         data.array = fcoords.data             # <<<<<<<<<<<<<<
7649  *         self.visit_grids(&data, grid_visitors.fcoords_cells, selector)
7650  *         return fcoords
7651  */
7652   __pyx_t_11 = __pyx_v_fcoords->data;
7653   __pyx_v_data.array = __pyx_t_11;
7654 
7655   /* "yt/geometry/grid_container.pyx":252
7656  *         fcoords = np.empty((size, 3), dtype="float64")
7657  *         data.array = fcoords.data
7658  *         self.visit_grids(&data, grid_visitors.fcoords_cells, selector)             # <<<<<<<<<<<<<<
7659  *         return fcoords
7660  *
7661  */
7662   ((struct __pyx_vtabstruct_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self->__pyx_vtab)->visit_grids(__pyx_v_self, (&__pyx_v_data), __pyx_f_2yt_8geometry_13grid_visitors_fcoords_cells, __pyx_v_selector);
7663 
7664   /* "yt/geometry/grid_container.pyx":253
7665  *         data.array = fcoords.data
7666  *         self.visit_grids(&data, grid_visitors.fcoords_cells, selector)
7667  *         return fcoords             # <<<<<<<<<<<<<<
7668  *
7669  *     def select_fwidth(self, SelectorObject selector, np.uint64_t size = -1):
7670  */
7671   __Pyx_XDECREF(__pyx_r);
7672   __Pyx_INCREF(((PyObject *)__pyx_v_fcoords));
7673   __pyx_r = ((PyObject *)__pyx_v_fcoords);
7674   goto __pyx_L0;
7675 
7676   /* "yt/geometry/grid_container.pyx":241
7677  *         return ires
7678  *
7679  *     def select_fcoords(self, SelectorObject selector, np.uint64_t size = -1):             # <<<<<<<<<<<<<<
7680  *         # Fill fcoords with a selector
7681  *         cdef GridVisitorData data
7682  */
7683 
7684   /* function exit code */
7685   __pyx_L1_error:;
7686   __Pyx_XDECREF(__pyx_t_2);
7687   __Pyx_XDECREF(__pyx_t_3);
7688   __Pyx_XDECREF(__pyx_t_4);
7689   __Pyx_XDECREF(__pyx_t_5);
7690   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
7691     __Pyx_PyThreadState_declare
7692     __Pyx_PyThreadState_assign
7693     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
7694     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_fcoords.rcbuffer->pybuffer);
7695   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
7696   __Pyx_AddTraceback("yt.geometry.grid_container.GridTree.select_fcoords", __pyx_clineno, __pyx_lineno, __pyx_filename);
7697   __pyx_r = NULL;
7698   goto __pyx_L2;
7699   __pyx_L0:;
7700   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_fcoords.rcbuffer->pybuffer);
7701   __pyx_L2:;
7702   __Pyx_XDECREF((PyObject *)__pyx_v_fcoords);
7703   __Pyx_XGIVEREF(__pyx_r);
7704   __Pyx_RefNannyFinishContext();
7705   return __pyx_r;
7706 }
7707 
7708 /* "yt/geometry/grid_container.pyx":255
7709  *         return fcoords
7710  *
7711  *     def select_fwidth(self, SelectorObject selector, np.uint64_t size = -1):             # <<<<<<<<<<<<<<
7712  *         # Fill fwidth with a selector
7713  *         cdef GridVisitorData data
7714  */
7715 
7716 /* Python wrapper */
7717 static PyObject *__pyx_pw_2yt_8geometry_14grid_container_8GridTree_18select_fwidth(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2yt_8geometry_14grid_container_8GridTree_18select_fwidth(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)7718 static PyObject *__pyx_pw_2yt_8geometry_14grid_container_8GridTree_18select_fwidth(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7719   struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector = 0;
7720   __pyx_t_5numpy_uint64_t __pyx_v_size;
7721   PyObject *__pyx_r = 0;
7722   __Pyx_RefNannyDeclarations
7723   __Pyx_RefNannySetupContext("select_fwidth (wrapper)", 0);
7724   {
7725     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_selector,&__pyx_n_s_size,0};
7726     PyObject* values[2] = {0,0};
7727     if (unlikely(__pyx_kwds)) {
7728       Py_ssize_t kw_args;
7729       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7730       switch (pos_args) {
7731         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7732         CYTHON_FALLTHROUGH;
7733         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7734         CYTHON_FALLTHROUGH;
7735         case  0: break;
7736         default: goto __pyx_L5_argtuple_error;
7737       }
7738       kw_args = PyDict_Size(__pyx_kwds);
7739       switch (pos_args) {
7740         case  0:
7741         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_selector)) != 0)) kw_args--;
7742         else goto __pyx_L5_argtuple_error;
7743         CYTHON_FALLTHROUGH;
7744         case  1:
7745         if (kw_args > 0) {
7746           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size);
7747           if (value) { values[1] = value; kw_args--; }
7748         }
7749       }
7750       if (unlikely(kw_args > 0)) {
7751         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "select_fwidth") < 0)) __PYX_ERR(0, 255, __pyx_L3_error)
7752       }
7753     } else {
7754       switch (PyTuple_GET_SIZE(__pyx_args)) {
7755         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7756         CYTHON_FALLTHROUGH;
7757         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7758         break;
7759         default: goto __pyx_L5_argtuple_error;
7760       }
7761     }
7762     __pyx_v_selector = ((struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *)values[0]);
7763     if (values[1]) {
7764       __pyx_v_size = __Pyx_PyInt_As_npy_uint64(values[1]); if (unlikely((__pyx_v_size == ((npy_uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 255, __pyx_L3_error)
7765     } else {
7766       __pyx_v_size = ((__pyx_t_5numpy_uint64_t)-1LL);
7767     }
7768   }
7769   goto __pyx_L4_argument_unpacking_done;
7770   __pyx_L5_argtuple_error:;
7771   __Pyx_RaiseArgtupleInvalid("select_fwidth", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 255, __pyx_L3_error)
7772   __pyx_L3_error:;
7773   __Pyx_AddTraceback("yt.geometry.grid_container.GridTree.select_fwidth", __pyx_clineno, __pyx_lineno, __pyx_filename);
7774   __Pyx_RefNannyFinishContext();
7775   return NULL;
7776   __pyx_L4_argument_unpacking_done:;
7777   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_selector), __pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject, 1, "selector", 0))) __PYX_ERR(0, 255, __pyx_L1_error)
7778   __pyx_r = __pyx_pf_2yt_8geometry_14grid_container_8GridTree_17select_fwidth(((struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self), __pyx_v_selector, __pyx_v_size);
7779 
7780   /* function exit code */
7781   goto __pyx_L0;
7782   __pyx_L1_error:;
7783   __pyx_r = NULL;
7784   __pyx_L0:;
7785   __Pyx_RefNannyFinishContext();
7786   return __pyx_r;
7787 }
7788 
__pyx_pf_2yt_8geometry_14grid_container_8GridTree_17select_fwidth(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree * __pyx_v_self,struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject * __pyx_v_selector,__pyx_t_5numpy_uint64_t __pyx_v_size)7789 static PyObject *__pyx_pf_2yt_8geometry_14grid_container_8GridTree_17select_fwidth(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *__pyx_v_self, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *__pyx_v_selector, __pyx_t_5numpy_uint64_t __pyx_v_size) {
7790   struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData __pyx_v_data;
7791   PyArrayObject *__pyx_v_fwidth = 0;
7792   __Pyx_LocalBuf_ND __pyx_pybuffernd_fwidth;
7793   __Pyx_Buffer __pyx_pybuffer_fwidth;
7794   PyObject *__pyx_r = NULL;
7795   __Pyx_RefNannyDeclarations
7796   int __pyx_t_1;
7797   PyObject *__pyx_t_2 = NULL;
7798   PyObject *__pyx_t_3 = NULL;
7799   PyObject *__pyx_t_4 = NULL;
7800   PyObject *__pyx_t_5 = NULL;
7801   PyArrayObject *__pyx_t_6 = NULL;
7802   int __pyx_t_7;
7803   PyObject *__pyx_t_8 = NULL;
7804   PyObject *__pyx_t_9 = NULL;
7805   PyObject *__pyx_t_10 = NULL;
7806   char *__pyx_t_11;
7807   __Pyx_RefNannySetupContext("select_fwidth", 0);
7808   __pyx_pybuffer_fwidth.pybuffer.buf = NULL;
7809   __pyx_pybuffer_fwidth.refcount = 0;
7810   __pyx_pybuffernd_fwidth.data = NULL;
7811   __pyx_pybuffernd_fwidth.rcbuffer = &__pyx_pybuffer_fwidth;
7812 
7813   /* "yt/geometry/grid_container.pyx":258
7814  *         # Fill fwidth with a selector
7815  *         cdef GridVisitorData data
7816  *         self.setup_data(&data)             # <<<<<<<<<<<<<<
7817  *         if size == -1:
7818  *             size = 0
7819  */
7820   ((struct __pyx_vtabstruct_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self->__pyx_vtab)->setup_data(__pyx_v_self, (&__pyx_v_data));
7821 
7822   /* "yt/geometry/grid_container.pyx":259
7823  *         cdef GridVisitorData data
7824  *         self.setup_data(&data)
7825  *         if size == -1:             # <<<<<<<<<<<<<<
7826  *             size = 0
7827  *             data.array = <void*>(&size)
7828  */
7829   __pyx_t_1 = ((__pyx_v_size == -1LL) != 0);
7830   if (__pyx_t_1) {
7831 
7832     /* "yt/geometry/grid_container.pyx":260
7833  *         self.setup_data(&data)
7834  *         if size == -1:
7835  *             size = 0             # <<<<<<<<<<<<<<
7836  *             data.array = <void*>(&size)
7837  *             self.visit_grids(&data,  grid_visitors.count_cells, selector)
7838  */
7839     __pyx_v_size = 0;
7840 
7841     /* "yt/geometry/grid_container.pyx":261
7842  *         if size == -1:
7843  *             size = 0
7844  *             data.array = <void*>(&size)             # <<<<<<<<<<<<<<
7845  *             self.visit_grids(&data,  grid_visitors.count_cells, selector)
7846  *         cdef np.ndarray[np.float64_t, ndim=2] fwidth
7847  */
7848     __pyx_v_data.array = ((void *)(&__pyx_v_size));
7849 
7850     /* "yt/geometry/grid_container.pyx":262
7851  *             size = 0
7852  *             data.array = <void*>(&size)
7853  *             self.visit_grids(&data,  grid_visitors.count_cells, selector)             # <<<<<<<<<<<<<<
7854  *         cdef np.ndarray[np.float64_t, ndim=2] fwidth
7855  *         fwidth = np.empty((size, 3), dtype="float64")
7856  */
7857     ((struct __pyx_vtabstruct_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self->__pyx_vtab)->visit_grids(__pyx_v_self, (&__pyx_v_data), __pyx_f_2yt_8geometry_13grid_visitors_count_cells, __pyx_v_selector);
7858 
7859     /* "yt/geometry/grid_container.pyx":259
7860  *         cdef GridVisitorData data
7861  *         self.setup_data(&data)
7862  *         if size == -1:             # <<<<<<<<<<<<<<
7863  *             size = 0
7864  *             data.array = <void*>(&size)
7865  */
7866   }
7867 
7868   /* "yt/geometry/grid_container.pyx":264
7869  *             self.visit_grids(&data,  grid_visitors.count_cells, selector)
7870  *         cdef np.ndarray[np.float64_t, ndim=2] fwidth
7871  *         fwidth = np.empty((size, 3), dtype="float64")             # <<<<<<<<<<<<<<
7872  *         data.array = fwidth.data
7873  *         self.visit_grids(&data, grid_visitors.fwidth_cells, selector)
7874  */
7875   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __pyx_L1_error)
7876   __Pyx_GOTREF(__pyx_t_2);
7877   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 264, __pyx_L1_error)
7878   __Pyx_GOTREF(__pyx_t_3);
7879   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7880   __pyx_t_2 = __Pyx_PyInt_From_npy_uint64(__pyx_v_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __pyx_L1_error)
7881   __Pyx_GOTREF(__pyx_t_2);
7882   __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 264, __pyx_L1_error)
7883   __Pyx_GOTREF(__pyx_t_4);
7884   __Pyx_GIVEREF(__pyx_t_2);
7885   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
7886   __Pyx_INCREF(__pyx_int_3);
7887   __Pyx_GIVEREF(__pyx_int_3);
7888   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_3);
7889   __pyx_t_2 = 0;
7890   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __pyx_L1_error)
7891   __Pyx_GOTREF(__pyx_t_2);
7892   __Pyx_GIVEREF(__pyx_t_4);
7893   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
7894   __pyx_t_4 = 0;
7895   __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 264, __pyx_L1_error)
7896   __Pyx_GOTREF(__pyx_t_4);
7897   if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_n_s_float64) < 0) __PYX_ERR(0, 264, __pyx_L1_error)
7898   __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 264, __pyx_L1_error)
7899   __Pyx_GOTREF(__pyx_t_5);
7900   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7901   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7902   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7903   if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 264, __pyx_L1_error)
7904   __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
7905   {
7906     __Pyx_BufFmt_StackElem __pyx_stack[1];
7907     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_fwidth.rcbuffer->pybuffer);
7908     __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_fwidth.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
7909     if (unlikely(__pyx_t_7 < 0)) {
7910       PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
7911       if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_fwidth.rcbuffer->pybuffer, (PyObject*)__pyx_v_fwidth, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
7912         Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10);
7913         __Pyx_RaiseBufferFallbackError();
7914       } else {
7915         PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
7916       }
7917       __pyx_t_8 = __pyx_t_9 = __pyx_t_10 = 0;
7918     }
7919     __pyx_pybuffernd_fwidth.diminfo[0].strides = __pyx_pybuffernd_fwidth.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_fwidth.diminfo[0].shape = __pyx_pybuffernd_fwidth.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_fwidth.diminfo[1].strides = __pyx_pybuffernd_fwidth.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_fwidth.diminfo[1].shape = __pyx_pybuffernd_fwidth.rcbuffer->pybuffer.shape[1];
7920     if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 264, __pyx_L1_error)
7921   }
7922   __pyx_t_6 = 0;
7923   __pyx_v_fwidth = ((PyArrayObject *)__pyx_t_5);
7924   __pyx_t_5 = 0;
7925 
7926   /* "yt/geometry/grid_container.pyx":265
7927  *         cdef np.ndarray[np.float64_t, ndim=2] fwidth
7928  *         fwidth = np.empty((size, 3), dtype="float64")
7929  *         data.array = fwidth.data             # <<<<<<<<<<<<<<
7930  *         self.visit_grids(&data, grid_visitors.fwidth_cells, selector)
7931  *         return fwidth
7932  */
7933   __pyx_t_11 = __pyx_v_fwidth->data;
7934   __pyx_v_data.array = __pyx_t_11;
7935 
7936   /* "yt/geometry/grid_container.pyx":266
7937  *         fwidth = np.empty((size, 3), dtype="float64")
7938  *         data.array = fwidth.data
7939  *         self.visit_grids(&data, grid_visitors.fwidth_cells, selector)             # <<<<<<<<<<<<<<
7940  *         return fwidth
7941  *
7942  */
7943   ((struct __pyx_vtabstruct_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self->__pyx_vtab)->visit_grids(__pyx_v_self, (&__pyx_v_data), __pyx_f_2yt_8geometry_13grid_visitors_fwidth_cells, __pyx_v_selector);
7944 
7945   /* "yt/geometry/grid_container.pyx":267
7946  *         data.array = fwidth.data
7947  *         self.visit_grids(&data, grid_visitors.fwidth_cells, selector)
7948  *         return fwidth             # <<<<<<<<<<<<<<
7949  *
7950  * cdef class MatchPointsToGrids:
7951  */
7952   __Pyx_XDECREF(__pyx_r);
7953   __Pyx_INCREF(((PyObject *)__pyx_v_fwidth));
7954   __pyx_r = ((PyObject *)__pyx_v_fwidth);
7955   goto __pyx_L0;
7956 
7957   /* "yt/geometry/grid_container.pyx":255
7958  *         return fcoords
7959  *
7960  *     def select_fwidth(self, SelectorObject selector, np.uint64_t size = -1):             # <<<<<<<<<<<<<<
7961  *         # Fill fwidth with a selector
7962  *         cdef GridVisitorData data
7963  */
7964 
7965   /* function exit code */
7966   __pyx_L1_error:;
7967   __Pyx_XDECREF(__pyx_t_2);
7968   __Pyx_XDECREF(__pyx_t_3);
7969   __Pyx_XDECREF(__pyx_t_4);
7970   __Pyx_XDECREF(__pyx_t_5);
7971   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
7972     __Pyx_PyThreadState_declare
7973     __Pyx_PyThreadState_assign
7974     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
7975     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_fwidth.rcbuffer->pybuffer);
7976   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
7977   __Pyx_AddTraceback("yt.geometry.grid_container.GridTree.select_fwidth", __pyx_clineno, __pyx_lineno, __pyx_filename);
7978   __pyx_r = NULL;
7979   goto __pyx_L2;
7980   __pyx_L0:;
7981   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_fwidth.rcbuffer->pybuffer);
7982   __pyx_L2:;
7983   __Pyx_XDECREF((PyObject *)__pyx_v_fwidth);
7984   __Pyx_XGIVEREF(__pyx_r);
7985   __Pyx_RefNannyFinishContext();
7986   return __pyx_r;
7987 }
7988 
7989 /* "yt/geometry/grid_container.pxd":33
7990  *     cdef int num_root_grids
7991  *     cdef int num_leaf_grids
7992  *     cdef public bitarray mask             # <<<<<<<<<<<<<<
7993  *     cdef void setup_data(self, GridVisitorData *data)
7994  *     cdef void visit_grids(self, GridVisitorData *data,
7995  */
7996 
7997 /* Python wrapper */
7998 static PyObject *__pyx_pw_2yt_8geometry_14grid_container_8GridTree_4mask_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2yt_8geometry_14grid_container_8GridTree_4mask_1__get__(PyObject * __pyx_v_self)7999 static PyObject *__pyx_pw_2yt_8geometry_14grid_container_8GridTree_4mask_1__get__(PyObject *__pyx_v_self) {
8000   PyObject *__pyx_r = 0;
8001   __Pyx_RefNannyDeclarations
8002   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
8003   __pyx_r = __pyx_pf_2yt_8geometry_14grid_container_8GridTree_4mask___get__(((struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self));
8004 
8005   /* function exit code */
8006   __Pyx_RefNannyFinishContext();
8007   return __pyx_r;
8008 }
8009 
__pyx_pf_2yt_8geometry_14grid_container_8GridTree_4mask___get__(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree * __pyx_v_self)8010 static PyObject *__pyx_pf_2yt_8geometry_14grid_container_8GridTree_4mask___get__(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *__pyx_v_self) {
8011   PyObject *__pyx_r = NULL;
8012   __Pyx_RefNannyDeclarations
8013   __Pyx_RefNannySetupContext("__get__", 0);
8014   __Pyx_XDECREF(__pyx_r);
8015   __Pyx_INCREF(((PyObject *)__pyx_v_self->mask));
8016   __pyx_r = ((PyObject *)__pyx_v_self->mask);
8017   goto __pyx_L0;
8018 
8019   /* function exit code */
8020   __pyx_L0:;
8021   __Pyx_XGIVEREF(__pyx_r);
8022   __Pyx_RefNannyFinishContext();
8023   return __pyx_r;
8024 }
8025 
8026 /* Python wrapper */
8027 static int __pyx_pw_2yt_8geometry_14grid_container_8GridTree_4mask_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_2yt_8geometry_14grid_container_8GridTree_4mask_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)8028 static int __pyx_pw_2yt_8geometry_14grid_container_8GridTree_4mask_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
8029   int __pyx_r;
8030   __Pyx_RefNannyDeclarations
8031   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
8032   __pyx_r = __pyx_pf_2yt_8geometry_14grid_container_8GridTree_4mask_2__set__(((struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self), ((PyObject *)__pyx_v_value));
8033 
8034   /* function exit code */
8035   __Pyx_RefNannyFinishContext();
8036   return __pyx_r;
8037 }
8038 
__pyx_pf_2yt_8geometry_14grid_container_8GridTree_4mask_2__set__(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree * __pyx_v_self,PyObject * __pyx_v_value)8039 static int __pyx_pf_2yt_8geometry_14grid_container_8GridTree_4mask_2__set__(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *__pyx_v_self, PyObject *__pyx_v_value) {
8040   int __pyx_r;
8041   __Pyx_RefNannyDeclarations
8042   PyObject *__pyx_t_1 = NULL;
8043   __Pyx_RefNannySetupContext("__set__", 0);
8044   if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_2yt_9utilities_3lib_8bitarray_bitarray))))) __PYX_ERR(2, 33, __pyx_L1_error)
8045   __pyx_t_1 = __pyx_v_value;
8046   __Pyx_INCREF(__pyx_t_1);
8047   __Pyx_GIVEREF(__pyx_t_1);
8048   __Pyx_GOTREF(__pyx_v_self->mask);
8049   __Pyx_DECREF(((PyObject *)__pyx_v_self->mask));
8050   __pyx_v_self->mask = ((struct __pyx_obj_2yt_9utilities_3lib_8bitarray_bitarray *)__pyx_t_1);
8051   __pyx_t_1 = 0;
8052 
8053   /* function exit code */
8054   __pyx_r = 0;
8055   goto __pyx_L0;
8056   __pyx_L1_error:;
8057   __Pyx_XDECREF(__pyx_t_1);
8058   __Pyx_AddTraceback("yt.geometry.grid_container.GridTree.mask.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8059   __pyx_r = -1;
8060   __pyx_L0:;
8061   __Pyx_RefNannyFinishContext();
8062   return __pyx_r;
8063 }
8064 
8065 /* Python wrapper */
8066 static int __pyx_pw_2yt_8geometry_14grid_container_8GridTree_4mask_5__del__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_2yt_8geometry_14grid_container_8GridTree_4mask_5__del__(PyObject * __pyx_v_self)8067 static int __pyx_pw_2yt_8geometry_14grid_container_8GridTree_4mask_5__del__(PyObject *__pyx_v_self) {
8068   int __pyx_r;
8069   __Pyx_RefNannyDeclarations
8070   __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
8071   __pyx_r = __pyx_pf_2yt_8geometry_14grid_container_8GridTree_4mask_4__del__(((struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self));
8072 
8073   /* function exit code */
8074   __Pyx_RefNannyFinishContext();
8075   return __pyx_r;
8076 }
8077 
__pyx_pf_2yt_8geometry_14grid_container_8GridTree_4mask_4__del__(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree * __pyx_v_self)8078 static int __pyx_pf_2yt_8geometry_14grid_container_8GridTree_4mask_4__del__(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *__pyx_v_self) {
8079   int __pyx_r;
8080   __Pyx_RefNannyDeclarations
8081   __Pyx_RefNannySetupContext("__del__", 0);
8082   __Pyx_INCREF(Py_None);
8083   __Pyx_GIVEREF(Py_None);
8084   __Pyx_GOTREF(__pyx_v_self->mask);
8085   __Pyx_DECREF(((PyObject *)__pyx_v_self->mask));
8086   __pyx_v_self->mask = ((struct __pyx_obj_2yt_9utilities_3lib_8bitarray_bitarray *)Py_None);
8087 
8088   /* function exit code */
8089   __pyx_r = 0;
8090   __Pyx_RefNannyFinishContext();
8091   return __pyx_r;
8092 }
8093 
8094 /* "(tree fragment)":1
8095  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
8096  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8097  * def __setstate_cython__(self, __pyx_state):
8098  */
8099 
8100 /* Python wrapper */
8101 static PyObject *__pyx_pw_2yt_8geometry_14grid_container_8GridTree_20__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_2yt_8geometry_14grid_container_8GridTree_20__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)8102 static PyObject *__pyx_pw_2yt_8geometry_14grid_container_8GridTree_20__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
8103   PyObject *__pyx_r = 0;
8104   __Pyx_RefNannyDeclarations
8105   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
8106   __pyx_r = __pyx_pf_2yt_8geometry_14grid_container_8GridTree_19__reduce_cython__(((struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self));
8107 
8108   /* function exit code */
8109   __Pyx_RefNannyFinishContext();
8110   return __pyx_r;
8111 }
8112 
__pyx_pf_2yt_8geometry_14grid_container_8GridTree_19__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_14grid_container_GridTree * __pyx_v_self)8113 static PyObject *__pyx_pf_2yt_8geometry_14grid_container_8GridTree_19__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *__pyx_v_self) {
8114   PyObject *__pyx_r = NULL;
8115   __Pyx_RefNannyDeclarations
8116   PyObject *__pyx_t_1 = NULL;
8117   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
8118 
8119   /* "(tree fragment)":2
8120  * def __reduce_cython__(self):
8121  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
8122  * def __setstate_cython__(self, __pyx_state):
8123  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8124  */
8125   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
8126   __Pyx_GOTREF(__pyx_t_1);
8127   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
8128   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8129   __PYX_ERR(1, 2, __pyx_L1_error)
8130 
8131   /* "(tree fragment)":1
8132  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
8133  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8134  * def __setstate_cython__(self, __pyx_state):
8135  */
8136 
8137   /* function exit code */
8138   __pyx_L1_error:;
8139   __Pyx_XDECREF(__pyx_t_1);
8140   __Pyx_AddTraceback("yt.geometry.grid_container.GridTree.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8141   __pyx_r = NULL;
8142   __Pyx_XGIVEREF(__pyx_r);
8143   __Pyx_RefNannyFinishContext();
8144   return __pyx_r;
8145 }
8146 
8147 /* "(tree fragment)":3
8148  * def __reduce_cython__(self):
8149  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8150  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
8151  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8152  */
8153 
8154 /* Python wrapper */
8155 static PyObject *__pyx_pw_2yt_8geometry_14grid_container_8GridTree_22__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_2yt_8geometry_14grid_container_8GridTree_22__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)8156 static PyObject *__pyx_pw_2yt_8geometry_14grid_container_8GridTree_22__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
8157   PyObject *__pyx_r = 0;
8158   __Pyx_RefNannyDeclarations
8159   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
8160   __pyx_r = __pyx_pf_2yt_8geometry_14grid_container_8GridTree_21__setstate_cython__(((struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
8161 
8162   /* function exit code */
8163   __Pyx_RefNannyFinishContext();
8164   return __pyx_r;
8165 }
8166 
__pyx_pf_2yt_8geometry_14grid_container_8GridTree_21__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_14grid_container_GridTree * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)8167 static PyObject *__pyx_pf_2yt_8geometry_14grid_container_8GridTree_21__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
8168   PyObject *__pyx_r = NULL;
8169   __Pyx_RefNannyDeclarations
8170   PyObject *__pyx_t_1 = NULL;
8171   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
8172 
8173   /* "(tree fragment)":4
8174  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8175  * def __setstate_cython__(self, __pyx_state):
8176  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
8177  */
8178   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
8179   __Pyx_GOTREF(__pyx_t_1);
8180   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
8181   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8182   __PYX_ERR(1, 4, __pyx_L1_error)
8183 
8184   /* "(tree fragment)":3
8185  * def __reduce_cython__(self):
8186  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8187  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
8188  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8189  */
8190 
8191   /* function exit code */
8192   __pyx_L1_error:;
8193   __Pyx_XDECREF(__pyx_t_1);
8194   __Pyx_AddTraceback("yt.geometry.grid_container.GridTree.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8195   __pyx_r = NULL;
8196   __Pyx_XGIVEREF(__pyx_r);
8197   __Pyx_RefNannyFinishContext();
8198   return __pyx_r;
8199 }
8200 
8201 /* "yt/geometry/grid_container.pyx":274
8202  *     @cython.wraparound(False)
8203  *     @cython.cdivision(True)
8204  *     def __cinit__(self, GridTree tree,             # <<<<<<<<<<<<<<
8205  *                   int num_points,
8206  *                   np.ndarray[np.float64_t, ndim=1] x,
8207  */
8208 
8209 /* Python wrapper */
8210 static int __pyx_pw_2yt_8geometry_14grid_container_18MatchPointsToGrids_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_2yt_8geometry_14grid_container_18MatchPointsToGrids_1__cinit__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)8211 static int __pyx_pw_2yt_8geometry_14grid_container_18MatchPointsToGrids_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8212   struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *__pyx_v_tree = 0;
8213   int __pyx_v_num_points;
8214   PyArrayObject *__pyx_v_x = 0;
8215   PyArrayObject *__pyx_v_y = 0;
8216   PyArrayObject *__pyx_v_z = 0;
8217   int __pyx_r;
8218   __Pyx_RefNannyDeclarations
8219   __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
8220   {
8221     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tree,&__pyx_n_s_num_points,&__pyx_n_s_x_2,&__pyx_n_s_y_2,&__pyx_n_s_z_2,0};
8222     PyObject* values[5] = {0,0,0,0,0};
8223     if (unlikely(__pyx_kwds)) {
8224       Py_ssize_t kw_args;
8225       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8226       switch (pos_args) {
8227         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8228         CYTHON_FALLTHROUGH;
8229         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8230         CYTHON_FALLTHROUGH;
8231         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8232         CYTHON_FALLTHROUGH;
8233         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8234         CYTHON_FALLTHROUGH;
8235         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8236         CYTHON_FALLTHROUGH;
8237         case  0: break;
8238         default: goto __pyx_L5_argtuple_error;
8239       }
8240       kw_args = PyDict_Size(__pyx_kwds);
8241       switch (pos_args) {
8242         case  0:
8243         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tree)) != 0)) kw_args--;
8244         else goto __pyx_L5_argtuple_error;
8245         CYTHON_FALLTHROUGH;
8246         case  1:
8247         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_num_points)) != 0)) kw_args--;
8248         else {
8249           __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 1); __PYX_ERR(0, 274, __pyx_L3_error)
8250         }
8251         CYTHON_FALLTHROUGH;
8252         case  2:
8253         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x_2)) != 0)) kw_args--;
8254         else {
8255           __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 2); __PYX_ERR(0, 274, __pyx_L3_error)
8256         }
8257         CYTHON_FALLTHROUGH;
8258         case  3:
8259         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y_2)) != 0)) kw_args--;
8260         else {
8261           __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 3); __PYX_ERR(0, 274, __pyx_L3_error)
8262         }
8263         CYTHON_FALLTHROUGH;
8264         case  4:
8265         if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_z_2)) != 0)) kw_args--;
8266         else {
8267           __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, 4); __PYX_ERR(0, 274, __pyx_L3_error)
8268         }
8269       }
8270       if (unlikely(kw_args > 0)) {
8271         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 274, __pyx_L3_error)
8272       }
8273     } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
8274       goto __pyx_L5_argtuple_error;
8275     } else {
8276       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8277       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8278       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8279       values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8280       values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8281     }
8282     __pyx_v_tree = ((struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *)values[0]);
8283     __pyx_v_num_points = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_num_points == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 275, __pyx_L3_error)
8284     __pyx_v_x = ((PyArrayObject *)values[2]);
8285     __pyx_v_y = ((PyArrayObject *)values[3]);
8286     __pyx_v_z = ((PyArrayObject *)values[4]);
8287   }
8288   goto __pyx_L4_argument_unpacking_done;
8289   __pyx_L5_argtuple_error:;
8290   __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 274, __pyx_L3_error)
8291   __pyx_L3_error:;
8292   __Pyx_AddTraceback("yt.geometry.grid_container.MatchPointsToGrids.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8293   __Pyx_RefNannyFinishContext();
8294   return -1;
8295   __pyx_L4_argument_unpacking_done:;
8296   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tree), __pyx_ptype_2yt_8geometry_14grid_container_GridTree, 1, "tree", 0))) __PYX_ERR(0, 274, __pyx_L1_error)
8297   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) __PYX_ERR(0, 276, __pyx_L1_error)
8298   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_5numpy_ndarray, 1, "y", 0))) __PYX_ERR(0, 277, __pyx_L1_error)
8299   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_z), __pyx_ptype_5numpy_ndarray, 1, "z", 0))) __PYX_ERR(0, 278, __pyx_L1_error)
8300   __pyx_r = __pyx_pf_2yt_8geometry_14grid_container_18MatchPointsToGrids___cinit__(((struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *)__pyx_v_self), __pyx_v_tree, __pyx_v_num_points, __pyx_v_x, __pyx_v_y, __pyx_v_z);
8301 
8302   /* function exit code */
8303   goto __pyx_L0;
8304   __pyx_L1_error:;
8305   __pyx_r = -1;
8306   __pyx_L0:;
8307   __Pyx_RefNannyFinishContext();
8308   return __pyx_r;
8309 }
8310 
__pyx_pf_2yt_8geometry_14grid_container_18MatchPointsToGrids___cinit__(struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids * __pyx_v_self,struct __pyx_obj_2yt_8geometry_14grid_container_GridTree * __pyx_v_tree,int __pyx_v_num_points,PyArrayObject * __pyx_v_x,PyArrayObject * __pyx_v_y,PyArrayObject * __pyx_v_z)8311 static int __pyx_pf_2yt_8geometry_14grid_container_18MatchPointsToGrids___cinit__(struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *__pyx_v_self, struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *__pyx_v_tree, int __pyx_v_num_points, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_y, PyArrayObject *__pyx_v_z) {
8312   int __pyx_v_i;
8313   __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
8314   __Pyx_Buffer __pyx_pybuffer_x;
8315   __Pyx_LocalBuf_ND __pyx_pybuffernd_y;
8316   __Pyx_Buffer __pyx_pybuffer_y;
8317   __Pyx_LocalBuf_ND __pyx_pybuffernd_z;
8318   __Pyx_Buffer __pyx_pybuffer_z;
8319   int __pyx_r;
8320   __Pyx_RefNannyDeclarations
8321   int __pyx_t_1;
8322   int __pyx_t_2;
8323   int __pyx_t_3;
8324   Py_ssize_t __pyx_t_4;
8325   Py_ssize_t __pyx_t_5;
8326   Py_ssize_t __pyx_t_6;
8327   __Pyx_RefNannySetupContext("__cinit__", 0);
8328   __pyx_pybuffer_x.pybuffer.buf = NULL;
8329   __pyx_pybuffer_x.refcount = 0;
8330   __pyx_pybuffernd_x.data = NULL;
8331   __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
8332   __pyx_pybuffer_y.pybuffer.buf = NULL;
8333   __pyx_pybuffer_y.refcount = 0;
8334   __pyx_pybuffernd_y.data = NULL;
8335   __pyx_pybuffernd_y.rcbuffer = &__pyx_pybuffer_y;
8336   __pyx_pybuffer_z.pybuffer.buf = NULL;
8337   __pyx_pybuffer_z.refcount = 0;
8338   __pyx_pybuffernd_z.data = NULL;
8339   __pyx_pybuffernd_z.rcbuffer = &__pyx_pybuffer_z;
8340   {
8341     __Pyx_BufFmt_StackElem __pyx_stack[1];
8342     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 274, __pyx_L1_error)
8343   }
8344   __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0];
8345   {
8346     __Pyx_BufFmt_StackElem __pyx_stack[1];
8347     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_y.rcbuffer->pybuffer, (PyObject*)__pyx_v_y, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 274, __pyx_L1_error)
8348   }
8349   __pyx_pybuffernd_y.diminfo[0].strides = __pyx_pybuffernd_y.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_y.diminfo[0].shape = __pyx_pybuffernd_y.rcbuffer->pybuffer.shape[0];
8350   {
8351     __Pyx_BufFmt_StackElem __pyx_stack[1];
8352     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_z.rcbuffer->pybuffer, (PyObject*)__pyx_v_z, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 274, __pyx_L1_error)
8353   }
8354   __pyx_pybuffernd_z.diminfo[0].strides = __pyx_pybuffernd_z.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_z.diminfo[0].shape = __pyx_pybuffernd_z.rcbuffer->pybuffer.shape[0];
8355 
8356   /* "yt/geometry/grid_container.pyx":282
8357  *         cdef int i
8358  *
8359  *         self.num_points = num_points             # <<<<<<<<<<<<<<
8360  *         self.xp = <np.float64_t *> malloc(
8361  *                 sizeof(np.float64_t) * num_points)
8362  */
8363   __pyx_v_self->num_points = __pyx_v_num_points;
8364 
8365   /* "yt/geometry/grid_container.pyx":283
8366  *
8367  *         self.num_points = num_points
8368  *         self.xp = <np.float64_t *> malloc(             # <<<<<<<<<<<<<<
8369  *                 sizeof(np.float64_t) * num_points)
8370  *         self.yp = <np.float64_t *> malloc(
8371  */
8372   __pyx_v_self->xp = ((__pyx_t_5numpy_float64_t *)malloc(((sizeof(__pyx_t_5numpy_float64_t)) * __pyx_v_num_points)));
8373 
8374   /* "yt/geometry/grid_container.pyx":285
8375  *         self.xp = <np.float64_t *> malloc(
8376  *                 sizeof(np.float64_t) * num_points)
8377  *         self.yp = <np.float64_t *> malloc(             # <<<<<<<<<<<<<<
8378  *                 sizeof(np.float64_t) * num_points)
8379  *         self.zp = <np.float64_t *> malloc(
8380  */
8381   __pyx_v_self->yp = ((__pyx_t_5numpy_float64_t *)malloc(((sizeof(__pyx_t_5numpy_float64_t)) * __pyx_v_num_points)));
8382 
8383   /* "yt/geometry/grid_container.pyx":287
8384  *         self.yp = <np.float64_t *> malloc(
8385  *                 sizeof(np.float64_t) * num_points)
8386  *         self.zp = <np.float64_t *> malloc(             # <<<<<<<<<<<<<<
8387  *                 sizeof(np.float64_t) * num_points)
8388  *         self.point_grids = <np.int64_t *> malloc(
8389  */
8390   __pyx_v_self->zp = ((__pyx_t_5numpy_float64_t *)malloc(((sizeof(__pyx_t_5numpy_float64_t)) * __pyx_v_num_points)));
8391 
8392   /* "yt/geometry/grid_container.pyx":289
8393  *         self.zp = <np.float64_t *> malloc(
8394  *                 sizeof(np.float64_t) * num_points)
8395  *         self.point_grids = <np.int64_t *> malloc(             # <<<<<<<<<<<<<<
8396  *                 sizeof(np.int64_t) * num_points)
8397  *         for i in range(num_points):
8398  */
8399   __pyx_v_self->point_grids = ((__pyx_t_5numpy_int64_t *)malloc(((sizeof(__pyx_t_5numpy_int64_t)) * __pyx_v_num_points)));
8400 
8401   /* "yt/geometry/grid_container.pyx":291
8402  *         self.point_grids = <np.int64_t *> malloc(
8403  *                 sizeof(np.int64_t) * num_points)
8404  *         for i in range(num_points):             # <<<<<<<<<<<<<<
8405  *             self.xp[i] = x[i]
8406  *             self.yp[i] = y[i]
8407  */
8408   __pyx_t_1 = __pyx_v_num_points;
8409   __pyx_t_2 = __pyx_t_1;
8410   for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
8411     __pyx_v_i = __pyx_t_3;
8412 
8413     /* "yt/geometry/grid_container.pyx":292
8414  *                 sizeof(np.int64_t) * num_points)
8415  *         for i in range(num_points):
8416  *             self.xp[i] = x[i]             # <<<<<<<<<<<<<<
8417  *             self.yp[i] = y[i]
8418  *             self.zp[i] = z[i]
8419  */
8420     __pyx_t_4 = __pyx_v_i;
8421     (__pyx_v_self->xp[__pyx_v_i]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_x.diminfo[0].strides));
8422 
8423     /* "yt/geometry/grid_container.pyx":293
8424  *         for i in range(num_points):
8425  *             self.xp[i] = x[i]
8426  *             self.yp[i] = y[i]             # <<<<<<<<<<<<<<
8427  *             self.zp[i] = z[i]
8428  *             self.point_grids[i] = -1
8429  */
8430     __pyx_t_5 = __pyx_v_i;
8431     (__pyx_v_self->yp[__pyx_v_i]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_y.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_y.diminfo[0].strides));
8432 
8433     /* "yt/geometry/grid_container.pyx":294
8434  *             self.xp[i] = x[i]
8435  *             self.yp[i] = y[i]
8436  *             self.zp[i] = z[i]             # <<<<<<<<<<<<<<
8437  *             self.point_grids[i] = -1
8438  *         self.tree = tree
8439  */
8440     __pyx_t_6 = __pyx_v_i;
8441     (__pyx_v_self->zp[__pyx_v_i]) = (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_z.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_z.diminfo[0].strides));
8442 
8443     /* "yt/geometry/grid_container.pyx":295
8444  *             self.yp[i] = y[i]
8445  *             self.zp[i] = z[i]
8446  *             self.point_grids[i] = -1             # <<<<<<<<<<<<<<
8447  *         self.tree = tree
8448  *
8449  */
8450     (__pyx_v_self->point_grids[__pyx_v_i]) = -1LL;
8451   }
8452 
8453   /* "yt/geometry/grid_container.pyx":296
8454  *             self.zp[i] = z[i]
8455  *             self.point_grids[i] = -1
8456  *         self.tree = tree             # <<<<<<<<<<<<<<
8457  *
8458  *     @cython.boundscheck(False)
8459  */
8460   __Pyx_INCREF(((PyObject *)__pyx_v_tree));
8461   __Pyx_GIVEREF(((PyObject *)__pyx_v_tree));
8462   __Pyx_GOTREF(__pyx_v_self->tree);
8463   __Pyx_DECREF(((PyObject *)__pyx_v_self->tree));
8464   __pyx_v_self->tree = __pyx_v_tree;
8465 
8466   /* "yt/geometry/grid_container.pyx":274
8467  *     @cython.wraparound(False)
8468  *     @cython.cdivision(True)
8469  *     def __cinit__(self, GridTree tree,             # <<<<<<<<<<<<<<
8470  *                   int num_points,
8471  *                   np.ndarray[np.float64_t, ndim=1] x,
8472  */
8473 
8474   /* function exit code */
8475   __pyx_r = 0;
8476   goto __pyx_L0;
8477   __pyx_L1_error:;
8478   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
8479     __Pyx_PyThreadState_declare
8480     __Pyx_PyThreadState_assign
8481     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
8482     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
8483     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer);
8484     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_z.rcbuffer->pybuffer);
8485   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
8486   __Pyx_AddTraceback("yt.geometry.grid_container.MatchPointsToGrids.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8487   __pyx_r = -1;
8488   goto __pyx_L2;
8489   __pyx_L0:;
8490   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
8491   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_y.rcbuffer->pybuffer);
8492   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_z.rcbuffer->pybuffer);
8493   __pyx_L2:;
8494   __Pyx_RefNannyFinishContext();
8495   return __pyx_r;
8496 }
8497 
8498 /* "yt/geometry/grid_container.pyx":300
8499  *     @cython.boundscheck(False)
8500  *     @cython.wraparound(False)
8501  *     def find_points_in_tree(self):             # <<<<<<<<<<<<<<
8502  *         cdef np.ndarray[np.int64_t, ndim=1] pt_grids
8503  *         cdef int i, j
8504  */
8505 
8506 /* Python wrapper */
8507 static PyObject *__pyx_pw_2yt_8geometry_14grid_container_18MatchPointsToGrids_3find_points_in_tree(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_2yt_8geometry_14grid_container_18MatchPointsToGrids_3find_points_in_tree(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)8508 static PyObject *__pyx_pw_2yt_8geometry_14grid_container_18MatchPointsToGrids_3find_points_in_tree(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
8509   PyObject *__pyx_r = 0;
8510   __Pyx_RefNannyDeclarations
8511   __Pyx_RefNannySetupContext("find_points_in_tree (wrapper)", 0);
8512   __pyx_r = __pyx_pf_2yt_8geometry_14grid_container_18MatchPointsToGrids_2find_points_in_tree(((struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *)__pyx_v_self));
8513 
8514   /* function exit code */
8515   __Pyx_RefNannyFinishContext();
8516   return __pyx_r;
8517 }
8518 
__pyx_pf_2yt_8geometry_14grid_container_18MatchPointsToGrids_2find_points_in_tree(struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids * __pyx_v_self)8519 static PyObject *__pyx_pf_2yt_8geometry_14grid_container_18MatchPointsToGrids_2find_points_in_tree(struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *__pyx_v_self) {
8520   PyArrayObject *__pyx_v_pt_grids = 0;
8521   int __pyx_v_i;
8522   int __pyx_v_j;
8523   __pyx_t_5numpy_uint8_t __pyx_v_in_grid;
8524   __Pyx_LocalBuf_ND __pyx_pybuffernd_pt_grids;
8525   __Pyx_Buffer __pyx_pybuffer_pt_grids;
8526   PyObject *__pyx_r = NULL;
8527   __Pyx_RefNannyDeclarations
8528   PyObject *__pyx_t_1 = NULL;
8529   PyObject *__pyx_t_2 = NULL;
8530   PyObject *__pyx_t_3 = NULL;
8531   PyObject *__pyx_t_4 = NULL;
8532   PyArrayObject *__pyx_t_5 = NULL;
8533   int __pyx_t_6;
8534   PyObject *__pyx_t_7 = NULL;
8535   PyObject *__pyx_t_8 = NULL;
8536   PyObject *__pyx_t_9 = NULL;
8537   int __pyx_t_10;
8538   int __pyx_t_11;
8539   int __pyx_t_12;
8540   int __pyx_t_13;
8541   int __pyx_t_14;
8542   int __pyx_t_15;
8543   Py_ssize_t __pyx_t_16;
8544   __Pyx_RefNannySetupContext("find_points_in_tree", 0);
8545   __pyx_pybuffer_pt_grids.pybuffer.buf = NULL;
8546   __pyx_pybuffer_pt_grids.refcount = 0;
8547   __pyx_pybuffernd_pt_grids.data = NULL;
8548   __pyx_pybuffernd_pt_grids.rcbuffer = &__pyx_pybuffer_pt_grids;
8549 
8550   /* "yt/geometry/grid_container.pyx":304
8551  *         cdef int i, j
8552  *         cdef np.uint8_t in_grid
8553  *         pt_grids = np.zeros(self.num_points, dtype='int64')             # <<<<<<<<<<<<<<
8554  *         for i in range(self.num_points):
8555  *             in_grid = 0
8556  */
8557   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error)
8558   __Pyx_GOTREF(__pyx_t_1);
8559   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L1_error)
8560   __Pyx_GOTREF(__pyx_t_2);
8561   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8562   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->num_points); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error)
8563   __Pyx_GOTREF(__pyx_t_1);
8564   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 304, __pyx_L1_error)
8565   __Pyx_GOTREF(__pyx_t_3);
8566   __Pyx_GIVEREF(__pyx_t_1);
8567   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
8568   __pyx_t_1 = 0;
8569   __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error)
8570   __Pyx_GOTREF(__pyx_t_1);
8571   if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_n_s_int64) < 0) __PYX_ERR(0, 304, __pyx_L1_error)
8572   __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L1_error)
8573   __Pyx_GOTREF(__pyx_t_4);
8574   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8575   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8576   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8577   if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 304, __pyx_L1_error)
8578   __pyx_t_5 = ((PyArrayObject *)__pyx_t_4);
8579   {
8580     __Pyx_BufFmt_StackElem __pyx_stack[1];
8581     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pt_grids.rcbuffer->pybuffer);
8582     __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pt_grids.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack);
8583     if (unlikely(__pyx_t_6 < 0)) {
8584       PyErr_Fetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
8585       if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_pt_grids.rcbuffer->pybuffer, (PyObject*)__pyx_v_pt_grids, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
8586         Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9);
8587         __Pyx_RaiseBufferFallbackError();
8588       } else {
8589         PyErr_Restore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
8590       }
8591       __pyx_t_7 = __pyx_t_8 = __pyx_t_9 = 0;
8592     }
8593     __pyx_pybuffernd_pt_grids.diminfo[0].strides = __pyx_pybuffernd_pt_grids.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_pt_grids.diminfo[0].shape = __pyx_pybuffernd_pt_grids.rcbuffer->pybuffer.shape[0];
8594     if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 304, __pyx_L1_error)
8595   }
8596   __pyx_t_5 = 0;
8597   __pyx_v_pt_grids = ((PyArrayObject *)__pyx_t_4);
8598   __pyx_t_4 = 0;
8599 
8600   /* "yt/geometry/grid_container.pyx":305
8601  *         cdef np.uint8_t in_grid
8602  *         pt_grids = np.zeros(self.num_points, dtype='int64')
8603  *         for i in range(self.num_points):             # <<<<<<<<<<<<<<
8604  *             in_grid = 0
8605  *             for j in range(self.tree.num_root_grids):
8606  */
8607   __pyx_t_6 = __pyx_v_self->num_points;
8608   __pyx_t_10 = __pyx_t_6;
8609   for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
8610     __pyx_v_i = __pyx_t_11;
8611 
8612     /* "yt/geometry/grid_container.pyx":306
8613  *         pt_grids = np.zeros(self.num_points, dtype='int64')
8614  *         for i in range(self.num_points):
8615  *             in_grid = 0             # <<<<<<<<<<<<<<
8616  *             for j in range(self.tree.num_root_grids):
8617  *                 if not in_grid:
8618  */
8619     __pyx_v_in_grid = 0;
8620 
8621     /* "yt/geometry/grid_container.pyx":307
8622  *         for i in range(self.num_points):
8623  *             in_grid = 0
8624  *             for j in range(self.tree.num_root_grids):             # <<<<<<<<<<<<<<
8625  *                 if not in_grid:
8626  *                     in_grid = self.check_position(i, self.xp[i], self.yp[i], self.zp[i],
8627  */
8628     __pyx_t_12 = __pyx_v_self->tree->num_root_grids;
8629     __pyx_t_13 = __pyx_t_12;
8630     for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
8631       __pyx_v_j = __pyx_t_14;
8632 
8633       /* "yt/geometry/grid_container.pyx":308
8634  *             in_grid = 0
8635  *             for j in range(self.tree.num_root_grids):
8636  *                 if not in_grid:             # <<<<<<<<<<<<<<
8637  *                     in_grid = self.check_position(i, self.xp[i], self.yp[i], self.zp[i],
8638  *                                                   &self.tree.root_grids[j])
8639  */
8640       __pyx_t_15 = ((!(__pyx_v_in_grid != 0)) != 0);
8641       if (__pyx_t_15) {
8642 
8643         /* "yt/geometry/grid_container.pyx":309
8644  *             for j in range(self.tree.num_root_grids):
8645  *                 if not in_grid:
8646  *                     in_grid = self.check_position(i, self.xp[i], self.yp[i], self.zp[i],             # <<<<<<<<<<<<<<
8647  *                                                   &self.tree.root_grids[j])
8648  *         for i in range(self.num_points):
8649  */
8650         __pyx_v_in_grid = ((struct __pyx_vtabstruct_2yt_8geometry_14grid_container_MatchPointsToGrids *)__pyx_v_self->__pyx_vtab)->check_position(__pyx_v_self, __pyx_v_i, (__pyx_v_self->xp[__pyx_v_i]), (__pyx_v_self->yp[__pyx_v_i]), (__pyx_v_self->zp[__pyx_v_i]), (&(__pyx_v_self->tree->root_grids[__pyx_v_j])));
8651 
8652         /* "yt/geometry/grid_container.pyx":308
8653  *             in_grid = 0
8654  *             for j in range(self.tree.num_root_grids):
8655  *                 if not in_grid:             # <<<<<<<<<<<<<<
8656  *                     in_grid = self.check_position(i, self.xp[i], self.yp[i], self.zp[i],
8657  *                                                   &self.tree.root_grids[j])
8658  */
8659       }
8660     }
8661   }
8662 
8663   /* "yt/geometry/grid_container.pyx":311
8664  *                     in_grid = self.check_position(i, self.xp[i], self.yp[i], self.zp[i],
8665  *                                                   &self.tree.root_grids[j])
8666  *         for i in range(self.num_points):             # <<<<<<<<<<<<<<
8667  *             pt_grids[i] = self.point_grids[i]
8668  *         return pt_grids
8669  */
8670   __pyx_t_6 = __pyx_v_self->num_points;
8671   __pyx_t_10 = __pyx_t_6;
8672   for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
8673     __pyx_v_i = __pyx_t_11;
8674 
8675     /* "yt/geometry/grid_container.pyx":312
8676  *                                                   &self.tree.root_grids[j])
8677  *         for i in range(self.num_points):
8678  *             pt_grids[i] = self.point_grids[i]             # <<<<<<<<<<<<<<
8679  *         return pt_grids
8680  *
8681  */
8682     __pyx_t_16 = __pyx_v_i;
8683     *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_int64_t *, __pyx_pybuffernd_pt_grids.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_pt_grids.diminfo[0].strides) = (__pyx_v_self->point_grids[__pyx_v_i]);
8684   }
8685 
8686   /* "yt/geometry/grid_container.pyx":313
8687  *         for i in range(self.num_points):
8688  *             pt_grids[i] = self.point_grids[i]
8689  *         return pt_grids             # <<<<<<<<<<<<<<
8690  *
8691  *     @cython.boundscheck(False)
8692  */
8693   __Pyx_XDECREF(__pyx_r);
8694   __Pyx_INCREF(((PyObject *)__pyx_v_pt_grids));
8695   __pyx_r = ((PyObject *)__pyx_v_pt_grids);
8696   goto __pyx_L0;
8697 
8698   /* "yt/geometry/grid_container.pyx":300
8699  *     @cython.boundscheck(False)
8700  *     @cython.wraparound(False)
8701  *     def find_points_in_tree(self):             # <<<<<<<<<<<<<<
8702  *         cdef np.ndarray[np.int64_t, ndim=1] pt_grids
8703  *         cdef int i, j
8704  */
8705 
8706   /* function exit code */
8707   __pyx_L1_error:;
8708   __Pyx_XDECREF(__pyx_t_1);
8709   __Pyx_XDECREF(__pyx_t_2);
8710   __Pyx_XDECREF(__pyx_t_3);
8711   __Pyx_XDECREF(__pyx_t_4);
8712   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
8713     __Pyx_PyThreadState_declare
8714     __Pyx_PyThreadState_assign
8715     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
8716     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pt_grids.rcbuffer->pybuffer);
8717   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
8718   __Pyx_AddTraceback("yt.geometry.grid_container.MatchPointsToGrids.find_points_in_tree", __pyx_clineno, __pyx_lineno, __pyx_filename);
8719   __pyx_r = NULL;
8720   goto __pyx_L2;
8721   __pyx_L0:;
8722   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_pt_grids.rcbuffer->pybuffer);
8723   __pyx_L2:;
8724   __Pyx_XDECREF((PyObject *)__pyx_v_pt_grids);
8725   __Pyx_XGIVEREF(__pyx_r);
8726   __Pyx_RefNannyFinishContext();
8727   return __pyx_r;
8728 }
8729 
8730 /* "yt/geometry/grid_container.pyx":317
8731  *     @cython.boundscheck(False)
8732  *     @cython.wraparound(False)
8733  *     cdef np.uint8_t check_position(self,             # <<<<<<<<<<<<<<
8734  *                                    np.int64_t pt_index,
8735  *                                    np.float64_t x,
8736  */
8737 
__pyx_f_2yt_8geometry_14grid_container_18MatchPointsToGrids_check_position(struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids * __pyx_v_self,__pyx_t_5numpy_int64_t __pyx_v_pt_index,__pyx_t_5numpy_float64_t __pyx_v_x,__pyx_t_5numpy_float64_t __pyx_v_y,__pyx_t_5numpy_float64_t __pyx_v_z,struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode * __pyx_v_grid)8738 static __pyx_t_5numpy_uint8_t __pyx_f_2yt_8geometry_14grid_container_18MatchPointsToGrids_check_position(struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *__pyx_v_self, __pyx_t_5numpy_int64_t __pyx_v_pt_index, __pyx_t_5numpy_float64_t __pyx_v_x, __pyx_t_5numpy_float64_t __pyx_v_y, __pyx_t_5numpy_float64_t __pyx_v_z, struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode *__pyx_v_grid) {
8739   int __pyx_v_i;
8740   __pyx_t_5numpy_uint8_t __pyx_v_in_grid;
8741   __pyx_t_5numpy_uint8_t __pyx_r;
8742   __Pyx_RefNannyDeclarations
8743   int __pyx_t_1;
8744   __pyx_t_5numpy_int32_t __pyx_t_2;
8745   __pyx_t_5numpy_int32_t __pyx_t_3;
8746   int __pyx_t_4;
8747   __pyx_t_5numpy_int64_t __pyx_t_5;
8748   __Pyx_RefNannySetupContext("check_position", 0);
8749 
8750   /* "yt/geometry/grid_container.pyx":325
8751  *         cdef int i
8752  *         cdef np.uint8_t in_grid
8753  *         in_grid = self.is_in_grid(x, y, z, grid)             # <<<<<<<<<<<<<<
8754  *         if in_grid:
8755  *             if grid.num_children > 0:
8756  */
8757   __pyx_v_in_grid = ((struct __pyx_vtabstruct_2yt_8geometry_14grid_container_MatchPointsToGrids *)__pyx_v_self->__pyx_vtab)->is_in_grid(__pyx_v_self, __pyx_v_x, __pyx_v_y, __pyx_v_z, __pyx_v_grid);
8758 
8759   /* "yt/geometry/grid_container.pyx":326
8760  *         cdef np.uint8_t in_grid
8761  *         in_grid = self.is_in_grid(x, y, z, grid)
8762  *         if in_grid:             # <<<<<<<<<<<<<<
8763  *             if grid.num_children > 0:
8764  *                 in_grid = 0
8765  */
8766   __pyx_t_1 = (__pyx_v_in_grid != 0);
8767   if (__pyx_t_1) {
8768 
8769     /* "yt/geometry/grid_container.pyx":327
8770  *         in_grid = self.is_in_grid(x, y, z, grid)
8771  *         if in_grid:
8772  *             if grid.num_children > 0:             # <<<<<<<<<<<<<<
8773  *                 in_grid = 0
8774  *                 for i in range(grid.num_children):
8775  */
8776     __pyx_t_1 = ((__pyx_v_grid->num_children > 0) != 0);
8777     if (__pyx_t_1) {
8778 
8779       /* "yt/geometry/grid_container.pyx":328
8780  *         if in_grid:
8781  *             if grid.num_children > 0:
8782  *                 in_grid = 0             # <<<<<<<<<<<<<<
8783  *                 for i in range(grid.num_children):
8784  *                     if not in_grid:
8785  */
8786       __pyx_v_in_grid = 0;
8787 
8788       /* "yt/geometry/grid_container.pyx":329
8789  *             if grid.num_children > 0:
8790  *                 in_grid = 0
8791  *                 for i in range(grid.num_children):             # <<<<<<<<<<<<<<
8792  *                     if not in_grid:
8793  *                         in_grid = self.check_position(pt_index, x, y, z, grid.children[i])
8794  */
8795       __pyx_t_2 = __pyx_v_grid->num_children;
8796       __pyx_t_3 = __pyx_t_2;
8797       for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
8798         __pyx_v_i = __pyx_t_4;
8799 
8800         /* "yt/geometry/grid_container.pyx":330
8801  *                 in_grid = 0
8802  *                 for i in range(grid.num_children):
8803  *                     if not in_grid:             # <<<<<<<<<<<<<<
8804  *                         in_grid = self.check_position(pt_index, x, y, z, grid.children[i])
8805  *                 if not in_grid:
8806  */
8807         __pyx_t_1 = ((!(__pyx_v_in_grid != 0)) != 0);
8808         if (__pyx_t_1) {
8809 
8810           /* "yt/geometry/grid_container.pyx":331
8811  *                 for i in range(grid.num_children):
8812  *                     if not in_grid:
8813  *                         in_grid = self.check_position(pt_index, x, y, z, grid.children[i])             # <<<<<<<<<<<<<<
8814  *                 if not in_grid:
8815  *                     self.point_grids[pt_index] = grid.index
8816  */
8817           __pyx_v_in_grid = ((struct __pyx_vtabstruct_2yt_8geometry_14grid_container_MatchPointsToGrids *)__pyx_v_self->__pyx_vtab)->check_position(__pyx_v_self, __pyx_v_pt_index, __pyx_v_x, __pyx_v_y, __pyx_v_z, (__pyx_v_grid->children[__pyx_v_i]));
8818 
8819           /* "yt/geometry/grid_container.pyx":330
8820  *                 in_grid = 0
8821  *                 for i in range(grid.num_children):
8822  *                     if not in_grid:             # <<<<<<<<<<<<<<
8823  *                         in_grid = self.check_position(pt_index, x, y, z, grid.children[i])
8824  *                 if not in_grid:
8825  */
8826         }
8827       }
8828 
8829       /* "yt/geometry/grid_container.pyx":332
8830  *                     if not in_grid:
8831  *                         in_grid = self.check_position(pt_index, x, y, z, grid.children[i])
8832  *                 if not in_grid:             # <<<<<<<<<<<<<<
8833  *                     self.point_grids[pt_index] = grid.index
8834  *                     in_grid = 1
8835  */
8836       __pyx_t_1 = ((!(__pyx_v_in_grid != 0)) != 0);
8837       if (__pyx_t_1) {
8838 
8839         /* "yt/geometry/grid_container.pyx":333
8840  *                         in_grid = self.check_position(pt_index, x, y, z, grid.children[i])
8841  *                 if not in_grid:
8842  *                     self.point_grids[pt_index] = grid.index             # <<<<<<<<<<<<<<
8843  *                     in_grid = 1
8844  *             else:
8845  */
8846         __pyx_t_5 = __pyx_v_grid->index;
8847         (__pyx_v_self->point_grids[__pyx_v_pt_index]) = __pyx_t_5;
8848 
8849         /* "yt/geometry/grid_container.pyx":334
8850  *                 if not in_grid:
8851  *                     self.point_grids[pt_index] = grid.index
8852  *                     in_grid = 1             # <<<<<<<<<<<<<<
8853  *             else:
8854  *                 self.point_grids[pt_index] = grid.index
8855  */
8856         __pyx_v_in_grid = 1;
8857 
8858         /* "yt/geometry/grid_container.pyx":332
8859  *                     if not in_grid:
8860  *                         in_grid = self.check_position(pt_index, x, y, z, grid.children[i])
8861  *                 if not in_grid:             # <<<<<<<<<<<<<<
8862  *                     self.point_grids[pt_index] = grid.index
8863  *                     in_grid = 1
8864  */
8865       }
8866 
8867       /* "yt/geometry/grid_container.pyx":327
8868  *         in_grid = self.is_in_grid(x, y, z, grid)
8869  *         if in_grid:
8870  *             if grid.num_children > 0:             # <<<<<<<<<<<<<<
8871  *                 in_grid = 0
8872  *                 for i in range(grid.num_children):
8873  */
8874       goto __pyx_L4;
8875     }
8876 
8877     /* "yt/geometry/grid_container.pyx":336
8878  *                     in_grid = 1
8879  *             else:
8880  *                 self.point_grids[pt_index] = grid.index             # <<<<<<<<<<<<<<
8881  *                 in_grid = 1
8882  *         return in_grid
8883  */
8884     /*else*/ {
8885       __pyx_t_5 = __pyx_v_grid->index;
8886       (__pyx_v_self->point_grids[__pyx_v_pt_index]) = __pyx_t_5;
8887 
8888       /* "yt/geometry/grid_container.pyx":337
8889  *             else:
8890  *                 self.point_grids[pt_index] = grid.index
8891  *                 in_grid = 1             # <<<<<<<<<<<<<<
8892  *         return in_grid
8893  *
8894  */
8895       __pyx_v_in_grid = 1;
8896     }
8897     __pyx_L4:;
8898 
8899     /* "yt/geometry/grid_container.pyx":326
8900  *         cdef np.uint8_t in_grid
8901  *         in_grid = self.is_in_grid(x, y, z, grid)
8902  *         if in_grid:             # <<<<<<<<<<<<<<
8903  *             if grid.num_children > 0:
8904  *                 in_grid = 0
8905  */
8906   }
8907 
8908   /* "yt/geometry/grid_container.pyx":338
8909  *                 self.point_grids[pt_index] = grid.index
8910  *                 in_grid = 1
8911  *         return in_grid             # <<<<<<<<<<<<<<
8912  *
8913  *     @cython.boundscheck(False)
8914  */
8915   __pyx_r = __pyx_v_in_grid;
8916   goto __pyx_L0;
8917 
8918   /* "yt/geometry/grid_container.pyx":317
8919  *     @cython.boundscheck(False)
8920  *     @cython.wraparound(False)
8921  *     cdef np.uint8_t check_position(self,             # <<<<<<<<<<<<<<
8922  *                                    np.int64_t pt_index,
8923  *                                    np.float64_t x,
8924  */
8925 
8926   /* function exit code */
8927   __pyx_L0:;
8928   __Pyx_RefNannyFinishContext();
8929   return __pyx_r;
8930 }
8931 
8932 /* "yt/geometry/grid_container.pyx":343
8933  *     @cython.wraparound(False)
8934  *     @cython.cdivision(True)
8935  *     cdef np.uint8_t is_in_grid(self,             # <<<<<<<<<<<<<<
8936  *              np.float64_t x,
8937  *              np.float64_t y,
8938  */
8939 
__pyx_f_2yt_8geometry_14grid_container_18MatchPointsToGrids_is_in_grid(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids * __pyx_v_self,__pyx_t_5numpy_float64_t __pyx_v_x,__pyx_t_5numpy_float64_t __pyx_v_y,__pyx_t_5numpy_float64_t __pyx_v_z,struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode * __pyx_v_grid)8940 static __pyx_t_5numpy_uint8_t __pyx_f_2yt_8geometry_14grid_container_18MatchPointsToGrids_is_in_grid(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *__pyx_v_self, __pyx_t_5numpy_float64_t __pyx_v_x, __pyx_t_5numpy_float64_t __pyx_v_y, __pyx_t_5numpy_float64_t __pyx_v_z, struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode *__pyx_v_grid) {
8941   __pyx_t_5numpy_uint8_t __pyx_r;
8942   __Pyx_RefNannyDeclarations
8943   int __pyx_t_1;
8944   __Pyx_RefNannySetupContext("is_in_grid", 0);
8945 
8946   /* "yt/geometry/grid_container.pyx":348
8947  *              np.float64_t z,
8948  *              GridTreeNode * grid):
8949  *         if x >= grid.right_edge[0]: return 0             # <<<<<<<<<<<<<<
8950  *         if y >= grid.right_edge[1]: return 0
8951  *         if z >= grid.right_edge[2]: return 0
8952  */
8953   __pyx_t_1 = ((__pyx_v_x >= (__pyx_v_grid->right_edge[0])) != 0);
8954   if (__pyx_t_1) {
8955     __pyx_r = 0;
8956     goto __pyx_L0;
8957   }
8958 
8959   /* "yt/geometry/grid_container.pyx":349
8960  *              GridTreeNode * grid):
8961  *         if x >= grid.right_edge[0]: return 0
8962  *         if y >= grid.right_edge[1]: return 0             # <<<<<<<<<<<<<<
8963  *         if z >= grid.right_edge[2]: return 0
8964  *         if x < grid.left_edge[0]: return 0
8965  */
8966   __pyx_t_1 = ((__pyx_v_y >= (__pyx_v_grid->right_edge[1])) != 0);
8967   if (__pyx_t_1) {
8968     __pyx_r = 0;
8969     goto __pyx_L0;
8970   }
8971 
8972   /* "yt/geometry/grid_container.pyx":350
8973  *         if x >= grid.right_edge[0]: return 0
8974  *         if y >= grid.right_edge[1]: return 0
8975  *         if z >= grid.right_edge[2]: return 0             # <<<<<<<<<<<<<<
8976  *         if x < grid.left_edge[0]: return 0
8977  *         if y < grid.left_edge[1]: return 0
8978  */
8979   __pyx_t_1 = ((__pyx_v_z >= (__pyx_v_grid->right_edge[2])) != 0);
8980   if (__pyx_t_1) {
8981     __pyx_r = 0;
8982     goto __pyx_L0;
8983   }
8984 
8985   /* "yt/geometry/grid_container.pyx":351
8986  *         if y >= grid.right_edge[1]: return 0
8987  *         if z >= grid.right_edge[2]: return 0
8988  *         if x < grid.left_edge[0]: return 0             # <<<<<<<<<<<<<<
8989  *         if y < grid.left_edge[1]: return 0
8990  *         if z < grid.left_edge[2]: return 0
8991  */
8992   __pyx_t_1 = ((__pyx_v_x < (__pyx_v_grid->left_edge[0])) != 0);
8993   if (__pyx_t_1) {
8994     __pyx_r = 0;
8995     goto __pyx_L0;
8996   }
8997 
8998   /* "yt/geometry/grid_container.pyx":352
8999  *         if z >= grid.right_edge[2]: return 0
9000  *         if x < grid.left_edge[0]: return 0
9001  *         if y < grid.left_edge[1]: return 0             # <<<<<<<<<<<<<<
9002  *         if z < grid.left_edge[2]: return 0
9003  *         return 1
9004  */
9005   __pyx_t_1 = ((__pyx_v_y < (__pyx_v_grid->left_edge[1])) != 0);
9006   if (__pyx_t_1) {
9007     __pyx_r = 0;
9008     goto __pyx_L0;
9009   }
9010 
9011   /* "yt/geometry/grid_container.pyx":353
9012  *         if x < grid.left_edge[0]: return 0
9013  *         if y < grid.left_edge[1]: return 0
9014  *         if z < grid.left_edge[2]: return 0             # <<<<<<<<<<<<<<
9015  *         return 1
9016  */
9017   __pyx_t_1 = ((__pyx_v_z < (__pyx_v_grid->left_edge[2])) != 0);
9018   if (__pyx_t_1) {
9019     __pyx_r = 0;
9020     goto __pyx_L0;
9021   }
9022 
9023   /* "yt/geometry/grid_container.pyx":354
9024  *         if y < grid.left_edge[1]: return 0
9025  *         if z < grid.left_edge[2]: return 0
9026  *         return 1             # <<<<<<<<<<<<<<
9027  */
9028   __pyx_r = 1;
9029   goto __pyx_L0;
9030 
9031   /* "yt/geometry/grid_container.pyx":343
9032  *     @cython.wraparound(False)
9033  *     @cython.cdivision(True)
9034  *     cdef np.uint8_t is_in_grid(self,             # <<<<<<<<<<<<<<
9035  *              np.float64_t x,
9036  *              np.float64_t y,
9037  */
9038 
9039   /* function exit code */
9040   __pyx_L0:;
9041   __Pyx_RefNannyFinishContext();
9042   return __pyx_r;
9043 }
9044 
9045 /* "(tree fragment)":1
9046  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
9047  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9048  * def __setstate_cython__(self, __pyx_state):
9049  */
9050 
9051 /* Python wrapper */
9052 static PyObject *__pyx_pw_2yt_8geometry_14grid_container_18MatchPointsToGrids_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_2yt_8geometry_14grid_container_18MatchPointsToGrids_5__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)9053 static PyObject *__pyx_pw_2yt_8geometry_14grid_container_18MatchPointsToGrids_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9054   PyObject *__pyx_r = 0;
9055   __Pyx_RefNannyDeclarations
9056   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
9057   __pyx_r = __pyx_pf_2yt_8geometry_14grid_container_18MatchPointsToGrids_4__reduce_cython__(((struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *)__pyx_v_self));
9058 
9059   /* function exit code */
9060   __Pyx_RefNannyFinishContext();
9061   return __pyx_r;
9062 }
9063 
__pyx_pf_2yt_8geometry_14grid_container_18MatchPointsToGrids_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids * __pyx_v_self)9064 static PyObject *__pyx_pf_2yt_8geometry_14grid_container_18MatchPointsToGrids_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *__pyx_v_self) {
9065   PyObject *__pyx_r = NULL;
9066   __Pyx_RefNannyDeclarations
9067   PyObject *__pyx_t_1 = NULL;
9068   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
9069 
9070   /* "(tree fragment)":2
9071  * def __reduce_cython__(self):
9072  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
9073  * def __setstate_cython__(self, __pyx_state):
9074  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9075  */
9076   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
9077   __Pyx_GOTREF(__pyx_t_1);
9078   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
9079   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9080   __PYX_ERR(1, 2, __pyx_L1_error)
9081 
9082   /* "(tree fragment)":1
9083  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
9084  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9085  * def __setstate_cython__(self, __pyx_state):
9086  */
9087 
9088   /* function exit code */
9089   __pyx_L1_error:;
9090   __Pyx_XDECREF(__pyx_t_1);
9091   __Pyx_AddTraceback("yt.geometry.grid_container.MatchPointsToGrids.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9092   __pyx_r = NULL;
9093   __Pyx_XGIVEREF(__pyx_r);
9094   __Pyx_RefNannyFinishContext();
9095   return __pyx_r;
9096 }
9097 
9098 /* "(tree fragment)":3
9099  * def __reduce_cython__(self):
9100  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9101  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
9102  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9103  */
9104 
9105 /* Python wrapper */
9106 static PyObject *__pyx_pw_2yt_8geometry_14grid_container_18MatchPointsToGrids_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_2yt_8geometry_14grid_container_18MatchPointsToGrids_7__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)9107 static PyObject *__pyx_pw_2yt_8geometry_14grid_container_18MatchPointsToGrids_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
9108   PyObject *__pyx_r = 0;
9109   __Pyx_RefNannyDeclarations
9110   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
9111   __pyx_r = __pyx_pf_2yt_8geometry_14grid_container_18MatchPointsToGrids_6__setstate_cython__(((struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
9112 
9113   /* function exit code */
9114   __Pyx_RefNannyFinishContext();
9115   return __pyx_r;
9116 }
9117 
__pyx_pf_2yt_8geometry_14grid_container_18MatchPointsToGrids_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)9118 static PyObject *__pyx_pf_2yt_8geometry_14grid_container_18MatchPointsToGrids_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
9119   PyObject *__pyx_r = NULL;
9120   __Pyx_RefNannyDeclarations
9121   PyObject *__pyx_t_1 = NULL;
9122   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
9123 
9124   /* "(tree fragment)":4
9125  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9126  * def __setstate_cython__(self, __pyx_state):
9127  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
9128  */
9129   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
9130   __Pyx_GOTREF(__pyx_t_1);
9131   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
9132   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9133   __PYX_ERR(1, 4, __pyx_L1_error)
9134 
9135   /* "(tree fragment)":3
9136  * def __reduce_cython__(self):
9137  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9138  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
9139  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9140  */
9141 
9142   /* function exit code */
9143   __pyx_L1_error:;
9144   __Pyx_XDECREF(__pyx_t_1);
9145   __Pyx_AddTraceback("yt.geometry.grid_container.MatchPointsToGrids.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9146   __pyx_r = NULL;
9147   __Pyx_XGIVEREF(__pyx_r);
9148   __Pyx_RefNannyFinishContext();
9149   return __pyx_r;
9150 }
9151 
9152 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":258
9153  *         # experimental exception made for __getbuffer__ and __releasebuffer__
9154  *         # -- the details of this may change.
9155  *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
9156  *             # This implementation of getbuffer is geared towards Cython
9157  *             # requirements, and does not yet fulfill the PEP.
9158  */
9159 
9160 /* Python wrapper */
9161 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)9162 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
9163   int __pyx_r;
9164   __Pyx_RefNannyDeclarations
9165   __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
9166   __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
9167 
9168   /* function exit code */
9169   __Pyx_RefNannyFinishContext();
9170   return __pyx_r;
9171 }
9172 
__pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject * __pyx_v_self,Py_buffer * __pyx_v_info,int __pyx_v_flags)9173 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
9174   int __pyx_v_i;
9175   int __pyx_v_ndim;
9176   int __pyx_v_endian_detector;
9177   int __pyx_v_little_endian;
9178   int __pyx_v_t;
9179   char *__pyx_v_f;
9180   PyArray_Descr *__pyx_v_descr = 0;
9181   int __pyx_v_offset;
9182   int __pyx_r;
9183   __Pyx_RefNannyDeclarations
9184   int __pyx_t_1;
9185   int __pyx_t_2;
9186   PyObject *__pyx_t_3 = NULL;
9187   int __pyx_t_4;
9188   int __pyx_t_5;
9189   int __pyx_t_6;
9190   PyArray_Descr *__pyx_t_7;
9191   PyObject *__pyx_t_8 = NULL;
9192   char *__pyx_t_9;
9193   if (__pyx_v_info == NULL) {
9194     PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
9195     return -1;
9196   }
9197   __Pyx_RefNannySetupContext("__getbuffer__", 0);
9198   __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
9199   __Pyx_GIVEREF(__pyx_v_info->obj);
9200 
9201   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":265
9202  *
9203  *             cdef int i, ndim
9204  *             cdef int endian_detector = 1             # <<<<<<<<<<<<<<
9205  *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
9206  *
9207  */
9208   __pyx_v_endian_detector = 1;
9209 
9210   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":266
9211  *             cdef int i, ndim
9212  *             cdef int endian_detector = 1
9213  *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
9214  *
9215  *             ndim = PyArray_NDIM(self)
9216  */
9217   __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
9218 
9219   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":268
9220  *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
9221  *
9222  *             ndim = PyArray_NDIM(self)             # <<<<<<<<<<<<<<
9223  *
9224  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
9225  */
9226   __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
9227 
9228   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270
9229  *             ndim = PyArray_NDIM(self)
9230  *
9231  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
9232  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
9233  *                 raise ValueError(u"ndarray is not C contiguous")
9234  */
9235   __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
9236   if (__pyx_t_2) {
9237   } else {
9238     __pyx_t_1 = __pyx_t_2;
9239     goto __pyx_L4_bool_binop_done;
9240   }
9241 
9242   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":271
9243  *
9244  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
9245  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):             # <<<<<<<<<<<<<<
9246  *                 raise ValueError(u"ndarray is not C contiguous")
9247  *
9248  */
9249   __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_C_CONTIGUOUS) != 0)) != 0);
9250   __pyx_t_1 = __pyx_t_2;
9251   __pyx_L4_bool_binop_done:;
9252 
9253   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270
9254  *             ndim = PyArray_NDIM(self)
9255  *
9256  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
9257  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
9258  *                 raise ValueError(u"ndarray is not C contiguous")
9259  */
9260   if (unlikely(__pyx_t_1)) {
9261 
9262     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272
9263  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
9264  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
9265  *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
9266  *
9267  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
9268  */
9269     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 272, __pyx_L1_error)
9270     __Pyx_GOTREF(__pyx_t_3);
9271     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
9272     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9273     __PYX_ERR(3, 272, __pyx_L1_error)
9274 
9275     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270
9276  *             ndim = PyArray_NDIM(self)
9277  *
9278  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
9279  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
9280  *                 raise ValueError(u"ndarray is not C contiguous")
9281  */
9282   }
9283 
9284   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274
9285  *                 raise ValueError(u"ndarray is not C contiguous")
9286  *
9287  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
9288  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
9289  *                 raise ValueError(u"ndarray is not Fortran contiguous")
9290  */
9291   __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
9292   if (__pyx_t_2) {
9293   } else {
9294     __pyx_t_1 = __pyx_t_2;
9295     goto __pyx_L7_bool_binop_done;
9296   }
9297 
9298   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":275
9299  *
9300  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
9301  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):             # <<<<<<<<<<<<<<
9302  *                 raise ValueError(u"ndarray is not Fortran contiguous")
9303  *
9304  */
9305   __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_F_CONTIGUOUS) != 0)) != 0);
9306   __pyx_t_1 = __pyx_t_2;
9307   __pyx_L7_bool_binop_done:;
9308 
9309   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274
9310  *                 raise ValueError(u"ndarray is not C contiguous")
9311  *
9312  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
9313  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
9314  *                 raise ValueError(u"ndarray is not Fortran contiguous")
9315  */
9316   if (unlikely(__pyx_t_1)) {
9317 
9318     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276
9319  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
9320  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
9321  *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
9322  *
9323  *             info.buf = PyArray_DATA(self)
9324  */
9325     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 276, __pyx_L1_error)
9326     __Pyx_GOTREF(__pyx_t_3);
9327     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
9328     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9329     __PYX_ERR(3, 276, __pyx_L1_error)
9330 
9331     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274
9332  *                 raise ValueError(u"ndarray is not C contiguous")
9333  *
9334  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
9335  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
9336  *                 raise ValueError(u"ndarray is not Fortran contiguous")
9337  */
9338   }
9339 
9340   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":278
9341  *                 raise ValueError(u"ndarray is not Fortran contiguous")
9342  *
9343  *             info.buf = PyArray_DATA(self)             # <<<<<<<<<<<<<<
9344  *             info.ndim = ndim
9345  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
9346  */
9347   __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
9348 
9349   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":279
9350  *
9351  *             info.buf = PyArray_DATA(self)
9352  *             info.ndim = ndim             # <<<<<<<<<<<<<<
9353  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
9354  *                 # Allocate new buffer for strides and shape info.
9355  */
9356   __pyx_v_info->ndim = __pyx_v_ndim;
9357 
9358   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280
9359  *             info.buf = PyArray_DATA(self)
9360  *             info.ndim = ndim
9361  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
9362  *                 # Allocate new buffer for strides and shape info.
9363  *                 # This is allocated as one block, strides first.
9364  */
9365   __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
9366   if (__pyx_t_1) {
9367 
9368     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":283
9369  *                 # Allocate new buffer for strides and shape info.
9370  *                 # This is allocated as one block, strides first.
9371  *                 info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)             # <<<<<<<<<<<<<<
9372  *                 info.shape = info.strides + ndim
9373  *                 for i in range(ndim):
9374  */
9375     __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim))));
9376 
9377     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":284
9378  *                 # This is allocated as one block, strides first.
9379  *                 info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
9380  *                 info.shape = info.strides + ndim             # <<<<<<<<<<<<<<
9381  *                 for i in range(ndim):
9382  *                     info.strides[i] = PyArray_STRIDES(self)[i]
9383  */
9384     __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
9385 
9386     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":285
9387  *                 info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
9388  *                 info.shape = info.strides + ndim
9389  *                 for i in range(ndim):             # <<<<<<<<<<<<<<
9390  *                     info.strides[i] = PyArray_STRIDES(self)[i]
9391  *                     info.shape[i] = PyArray_DIMS(self)[i]
9392  */
9393     __pyx_t_4 = __pyx_v_ndim;
9394     __pyx_t_5 = __pyx_t_4;
9395     for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
9396       __pyx_v_i = __pyx_t_6;
9397 
9398       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":286
9399  *                 info.shape = info.strides + ndim
9400  *                 for i in range(ndim):
9401  *                     info.strides[i] = PyArray_STRIDES(self)[i]             # <<<<<<<<<<<<<<
9402  *                     info.shape[i] = PyArray_DIMS(self)[i]
9403  *             else:
9404  */
9405       (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
9406 
9407       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":287
9408  *                 for i in range(ndim):
9409  *                     info.strides[i] = PyArray_STRIDES(self)[i]
9410  *                     info.shape[i] = PyArray_DIMS(self)[i]             # <<<<<<<<<<<<<<
9411  *             else:
9412  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
9413  */
9414       (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
9415     }
9416 
9417     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280
9418  *             info.buf = PyArray_DATA(self)
9419  *             info.ndim = ndim
9420  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
9421  *                 # Allocate new buffer for strides and shape info.
9422  *                 # This is allocated as one block, strides first.
9423  */
9424     goto __pyx_L9;
9425   }
9426 
9427   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":289
9428  *                     info.shape[i] = PyArray_DIMS(self)[i]
9429  *             else:
9430  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)             # <<<<<<<<<<<<<<
9431  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
9432  *             info.suboffsets = NULL
9433  */
9434   /*else*/ {
9435     __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
9436 
9437     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":290
9438  *             else:
9439  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
9440  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)             # <<<<<<<<<<<<<<
9441  *             info.suboffsets = NULL
9442  *             info.itemsize = PyArray_ITEMSIZE(self)
9443  */
9444     __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
9445   }
9446   __pyx_L9:;
9447 
9448   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":291
9449  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
9450  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
9451  *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
9452  *             info.itemsize = PyArray_ITEMSIZE(self)
9453  *             info.readonly = not PyArray_ISWRITEABLE(self)
9454  */
9455   __pyx_v_info->suboffsets = NULL;
9456 
9457   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":292
9458  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
9459  *             info.suboffsets = NULL
9460  *             info.itemsize = PyArray_ITEMSIZE(self)             # <<<<<<<<<<<<<<
9461  *             info.readonly = not PyArray_ISWRITEABLE(self)
9462  *
9463  */
9464   __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
9465 
9466   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":293
9467  *             info.suboffsets = NULL
9468  *             info.itemsize = PyArray_ITEMSIZE(self)
9469  *             info.readonly = not PyArray_ISWRITEABLE(self)             # <<<<<<<<<<<<<<
9470  *
9471  *             cdef int t
9472  */
9473   __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
9474 
9475   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":296
9476  *
9477  *             cdef int t
9478  *             cdef char* f = NULL             # <<<<<<<<<<<<<<
9479  *             cdef dtype descr = <dtype>PyArray_DESCR(self)
9480  *             cdef int offset
9481  */
9482   __pyx_v_f = NULL;
9483 
9484   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297
9485  *             cdef int t
9486  *             cdef char* f = NULL
9487  *             cdef dtype descr = <dtype>PyArray_DESCR(self)             # <<<<<<<<<<<<<<
9488  *             cdef int offset
9489  *
9490  */
9491   __pyx_t_7 = PyArray_DESCR(__pyx_v_self);
9492   __pyx_t_3 = ((PyObject *)__pyx_t_7);
9493   __Pyx_INCREF(__pyx_t_3);
9494   __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
9495   __pyx_t_3 = 0;
9496 
9497   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":300
9498  *             cdef int offset
9499  *
9500  *             info.obj = self             # <<<<<<<<<<<<<<
9501  *
9502  *             if not PyDataType_HASFIELDS(descr):
9503  */
9504   __Pyx_INCREF(((PyObject *)__pyx_v_self));
9505   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
9506   __Pyx_GOTREF(__pyx_v_info->obj);
9507   __Pyx_DECREF(__pyx_v_info->obj);
9508   __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
9509 
9510   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":302
9511  *             info.obj = self
9512  *
9513  *             if not PyDataType_HASFIELDS(descr):             # <<<<<<<<<<<<<<
9514  *                 t = descr.type_num
9515  *                 if ((descr.byteorder == c'>' and little_endian) or
9516  */
9517   __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0);
9518   if (__pyx_t_1) {
9519 
9520     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":303
9521  *
9522  *             if not PyDataType_HASFIELDS(descr):
9523  *                 t = descr.type_num             # <<<<<<<<<<<<<<
9524  *                 if ((descr.byteorder == c'>' and little_endian) or
9525  *                     (descr.byteorder == c'<' and not little_endian)):
9526  */
9527     __pyx_t_4 = __pyx_v_descr->type_num;
9528     __pyx_v_t = __pyx_t_4;
9529 
9530     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304
9531  *             if not PyDataType_HASFIELDS(descr):
9532  *                 t = descr.type_num
9533  *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
9534  *                     (descr.byteorder == c'<' and not little_endian)):
9535  *                     raise ValueError(u"Non-native byte order not supported")
9536  */
9537     __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0);
9538     if (!__pyx_t_2) {
9539       goto __pyx_L15_next_or;
9540     } else {
9541     }
9542     __pyx_t_2 = (__pyx_v_little_endian != 0);
9543     if (!__pyx_t_2) {
9544     } else {
9545       __pyx_t_1 = __pyx_t_2;
9546       goto __pyx_L14_bool_binop_done;
9547     }
9548     __pyx_L15_next_or:;
9549 
9550     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":305
9551  *                 t = descr.type_num
9552  *                 if ((descr.byteorder == c'>' and little_endian) or
9553  *                     (descr.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
9554  *                     raise ValueError(u"Non-native byte order not supported")
9555  *                 if   t == NPY_BYTE:        f = "b"
9556  */
9557     __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0);
9558     if (__pyx_t_2) {
9559     } else {
9560       __pyx_t_1 = __pyx_t_2;
9561       goto __pyx_L14_bool_binop_done;
9562     }
9563     __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
9564     __pyx_t_1 = __pyx_t_2;
9565     __pyx_L14_bool_binop_done:;
9566 
9567     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304
9568  *             if not PyDataType_HASFIELDS(descr):
9569  *                 t = descr.type_num
9570  *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
9571  *                     (descr.byteorder == c'<' and not little_endian)):
9572  *                     raise ValueError(u"Non-native byte order not supported")
9573  */
9574     if (unlikely(__pyx_t_1)) {
9575 
9576       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":306
9577  *                 if ((descr.byteorder == c'>' and little_endian) or
9578  *                     (descr.byteorder == c'<' and not little_endian)):
9579  *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
9580  *                 if   t == NPY_BYTE:        f = "b"
9581  *                 elif t == NPY_UBYTE:       f = "B"
9582  */
9583       __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 306, __pyx_L1_error)
9584       __Pyx_GOTREF(__pyx_t_3);
9585       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
9586       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9587       __PYX_ERR(3, 306, __pyx_L1_error)
9588 
9589       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304
9590  *             if not PyDataType_HASFIELDS(descr):
9591  *                 t = descr.type_num
9592  *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
9593  *                     (descr.byteorder == c'<' and not little_endian)):
9594  *                     raise ValueError(u"Non-native byte order not supported")
9595  */
9596     }
9597 
9598     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":307
9599  *                     (descr.byteorder == c'<' and not little_endian)):
9600  *                     raise ValueError(u"Non-native byte order not supported")
9601  *                 if   t == NPY_BYTE:        f = "b"             # <<<<<<<<<<<<<<
9602  *                 elif t == NPY_UBYTE:       f = "B"
9603  *                 elif t == NPY_SHORT:       f = "h"
9604  */
9605     switch (__pyx_v_t) {
9606       case NPY_BYTE:
9607       __pyx_v_f = ((char *)"b");
9608       break;
9609       case NPY_UBYTE:
9610 
9611       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":308
9612  *                     raise ValueError(u"Non-native byte order not supported")
9613  *                 if   t == NPY_BYTE:        f = "b"
9614  *                 elif t == NPY_UBYTE:       f = "B"             # <<<<<<<<<<<<<<
9615  *                 elif t == NPY_SHORT:       f = "h"
9616  *                 elif t == NPY_USHORT:      f = "H"
9617  */
9618       __pyx_v_f = ((char *)"B");
9619       break;
9620       case NPY_SHORT:
9621 
9622       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":309
9623  *                 if   t == NPY_BYTE:        f = "b"
9624  *                 elif t == NPY_UBYTE:       f = "B"
9625  *                 elif t == NPY_SHORT:       f = "h"             # <<<<<<<<<<<<<<
9626  *                 elif t == NPY_USHORT:      f = "H"
9627  *                 elif t == NPY_INT:         f = "i"
9628  */
9629       __pyx_v_f = ((char *)"h");
9630       break;
9631       case NPY_USHORT:
9632 
9633       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":310
9634  *                 elif t == NPY_UBYTE:       f = "B"
9635  *                 elif t == NPY_SHORT:       f = "h"
9636  *                 elif t == NPY_USHORT:      f = "H"             # <<<<<<<<<<<<<<
9637  *                 elif t == NPY_INT:         f = "i"
9638  *                 elif t == NPY_UINT:        f = "I"
9639  */
9640       __pyx_v_f = ((char *)"H");
9641       break;
9642       case NPY_INT:
9643 
9644       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":311
9645  *                 elif t == NPY_SHORT:       f = "h"
9646  *                 elif t == NPY_USHORT:      f = "H"
9647  *                 elif t == NPY_INT:         f = "i"             # <<<<<<<<<<<<<<
9648  *                 elif t == NPY_UINT:        f = "I"
9649  *                 elif t == NPY_LONG:        f = "l"
9650  */
9651       __pyx_v_f = ((char *)"i");
9652       break;
9653       case NPY_UINT:
9654 
9655       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":312
9656  *                 elif t == NPY_USHORT:      f = "H"
9657  *                 elif t == NPY_INT:         f = "i"
9658  *                 elif t == NPY_UINT:        f = "I"             # <<<<<<<<<<<<<<
9659  *                 elif t == NPY_LONG:        f = "l"
9660  *                 elif t == NPY_ULONG:       f = "L"
9661  */
9662       __pyx_v_f = ((char *)"I");
9663       break;
9664       case NPY_LONG:
9665 
9666       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":313
9667  *                 elif t == NPY_INT:         f = "i"
9668  *                 elif t == NPY_UINT:        f = "I"
9669  *                 elif t == NPY_LONG:        f = "l"             # <<<<<<<<<<<<<<
9670  *                 elif t == NPY_ULONG:       f = "L"
9671  *                 elif t == NPY_LONGLONG:    f = "q"
9672  */
9673       __pyx_v_f = ((char *)"l");
9674       break;
9675       case NPY_ULONG:
9676 
9677       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":314
9678  *                 elif t == NPY_UINT:        f = "I"
9679  *                 elif t == NPY_LONG:        f = "l"
9680  *                 elif t == NPY_ULONG:       f = "L"             # <<<<<<<<<<<<<<
9681  *                 elif t == NPY_LONGLONG:    f = "q"
9682  *                 elif t == NPY_ULONGLONG:   f = "Q"
9683  */
9684       __pyx_v_f = ((char *)"L");
9685       break;
9686       case NPY_LONGLONG:
9687 
9688       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":315
9689  *                 elif t == NPY_LONG:        f = "l"
9690  *                 elif t == NPY_ULONG:       f = "L"
9691  *                 elif t == NPY_LONGLONG:    f = "q"             # <<<<<<<<<<<<<<
9692  *                 elif t == NPY_ULONGLONG:   f = "Q"
9693  *                 elif t == NPY_FLOAT:       f = "f"
9694  */
9695       __pyx_v_f = ((char *)"q");
9696       break;
9697       case NPY_ULONGLONG:
9698 
9699       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":316
9700  *                 elif t == NPY_ULONG:       f = "L"
9701  *                 elif t == NPY_LONGLONG:    f = "q"
9702  *                 elif t == NPY_ULONGLONG:   f = "Q"             # <<<<<<<<<<<<<<
9703  *                 elif t == NPY_FLOAT:       f = "f"
9704  *                 elif t == NPY_DOUBLE:      f = "d"
9705  */
9706       __pyx_v_f = ((char *)"Q");
9707       break;
9708       case NPY_FLOAT:
9709 
9710       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":317
9711  *                 elif t == NPY_LONGLONG:    f = "q"
9712  *                 elif t == NPY_ULONGLONG:   f = "Q"
9713  *                 elif t == NPY_FLOAT:       f = "f"             # <<<<<<<<<<<<<<
9714  *                 elif t == NPY_DOUBLE:      f = "d"
9715  *                 elif t == NPY_LONGDOUBLE:  f = "g"
9716  */
9717       __pyx_v_f = ((char *)"f");
9718       break;
9719       case NPY_DOUBLE:
9720 
9721       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":318
9722  *                 elif t == NPY_ULONGLONG:   f = "Q"
9723  *                 elif t == NPY_FLOAT:       f = "f"
9724  *                 elif t == NPY_DOUBLE:      f = "d"             # <<<<<<<<<<<<<<
9725  *                 elif t == NPY_LONGDOUBLE:  f = "g"
9726  *                 elif t == NPY_CFLOAT:      f = "Zf"
9727  */
9728       __pyx_v_f = ((char *)"d");
9729       break;
9730       case NPY_LONGDOUBLE:
9731 
9732       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":319
9733  *                 elif t == NPY_FLOAT:       f = "f"
9734  *                 elif t == NPY_DOUBLE:      f = "d"
9735  *                 elif t == NPY_LONGDOUBLE:  f = "g"             # <<<<<<<<<<<<<<
9736  *                 elif t == NPY_CFLOAT:      f = "Zf"
9737  *                 elif t == NPY_CDOUBLE:     f = "Zd"
9738  */
9739       __pyx_v_f = ((char *)"g");
9740       break;
9741       case NPY_CFLOAT:
9742 
9743       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":320
9744  *                 elif t == NPY_DOUBLE:      f = "d"
9745  *                 elif t == NPY_LONGDOUBLE:  f = "g"
9746  *                 elif t == NPY_CFLOAT:      f = "Zf"             # <<<<<<<<<<<<<<
9747  *                 elif t == NPY_CDOUBLE:     f = "Zd"
9748  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
9749  */
9750       __pyx_v_f = ((char *)"Zf");
9751       break;
9752       case NPY_CDOUBLE:
9753 
9754       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":321
9755  *                 elif t == NPY_LONGDOUBLE:  f = "g"
9756  *                 elif t == NPY_CFLOAT:      f = "Zf"
9757  *                 elif t == NPY_CDOUBLE:     f = "Zd"             # <<<<<<<<<<<<<<
9758  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
9759  *                 elif t == NPY_OBJECT:      f = "O"
9760  */
9761       __pyx_v_f = ((char *)"Zd");
9762       break;
9763       case NPY_CLONGDOUBLE:
9764 
9765       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":322
9766  *                 elif t == NPY_CFLOAT:      f = "Zf"
9767  *                 elif t == NPY_CDOUBLE:     f = "Zd"
9768  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"             # <<<<<<<<<<<<<<
9769  *                 elif t == NPY_OBJECT:      f = "O"
9770  *                 else:
9771  */
9772       __pyx_v_f = ((char *)"Zg");
9773       break;
9774       case NPY_OBJECT:
9775 
9776       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":323
9777  *                 elif t == NPY_CDOUBLE:     f = "Zd"
9778  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
9779  *                 elif t == NPY_OBJECT:      f = "O"             # <<<<<<<<<<<<<<
9780  *                 else:
9781  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
9782  */
9783       __pyx_v_f = ((char *)"O");
9784       break;
9785       default:
9786 
9787       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":325
9788  *                 elif t == NPY_OBJECT:      f = "O"
9789  *                 else:
9790  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
9791  *                 info.format = f
9792  *                 return
9793  */
9794       __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 325, __pyx_L1_error)
9795       __Pyx_GOTREF(__pyx_t_3);
9796       __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 325, __pyx_L1_error)
9797       __Pyx_GOTREF(__pyx_t_8);
9798       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9799       __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 325, __pyx_L1_error)
9800       __Pyx_GOTREF(__pyx_t_3);
9801       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9802       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
9803       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9804       __PYX_ERR(3, 325, __pyx_L1_error)
9805       break;
9806     }
9807 
9808     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":326
9809  *                 else:
9810  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
9811  *                 info.format = f             # <<<<<<<<<<<<<<
9812  *                 return
9813  *             else:
9814  */
9815     __pyx_v_info->format = __pyx_v_f;
9816 
9817     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":327
9818  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
9819  *                 info.format = f
9820  *                 return             # <<<<<<<<<<<<<<
9821  *             else:
9822  *                 info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
9823  */
9824     __pyx_r = 0;
9825     goto __pyx_L0;
9826 
9827     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":302
9828  *             info.obj = self
9829  *
9830  *             if not PyDataType_HASFIELDS(descr):             # <<<<<<<<<<<<<<
9831  *                 t = descr.type_num
9832  *                 if ((descr.byteorder == c'>' and little_endian) or
9833  */
9834   }
9835 
9836   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":329
9837  *                 return
9838  *             else:
9839  *                 info.format = <char*>PyObject_Malloc(_buffer_format_string_len)             # <<<<<<<<<<<<<<
9840  *                 info.format[0] = c'^' # Native data types, manual alignment
9841  *                 offset = 0
9842  */
9843   /*else*/ {
9844     __pyx_v_info->format = ((char *)PyObject_Malloc(0xFF));
9845 
9846     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":330
9847  *             else:
9848  *                 info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
9849  *                 info.format[0] = c'^' # Native data types, manual alignment             # <<<<<<<<<<<<<<
9850  *                 offset = 0
9851  *                 f = _util_dtypestring(descr, info.format + 1,
9852  */
9853     (__pyx_v_info->format[0]) = '^';
9854 
9855     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":331
9856  *                 info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
9857  *                 info.format[0] = c'^' # Native data types, manual alignment
9858  *                 offset = 0             # <<<<<<<<<<<<<<
9859  *                 f = _util_dtypestring(descr, info.format + 1,
9860  *                                       info.format + _buffer_format_string_len,
9861  */
9862     __pyx_v_offset = 0;
9863 
9864     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":332
9865  *                 info.format[0] = c'^' # Native data types, manual alignment
9866  *                 offset = 0
9867  *                 f = _util_dtypestring(descr, info.format + 1,             # <<<<<<<<<<<<<<
9868  *                                       info.format + _buffer_format_string_len,
9869  *                                       &offset)
9870  */
9871     __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(3, 332, __pyx_L1_error)
9872     __pyx_v_f = __pyx_t_9;
9873 
9874     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":335
9875  *                                       info.format + _buffer_format_string_len,
9876  *                                       &offset)
9877  *                 f[0] = c'\0' # Terminate format string             # <<<<<<<<<<<<<<
9878  *
9879  *         def __releasebuffer__(ndarray self, Py_buffer* info):
9880  */
9881     (__pyx_v_f[0]) = '\x00';
9882   }
9883 
9884   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":258
9885  *         # experimental exception made for __getbuffer__ and __releasebuffer__
9886  *         # -- the details of this may change.
9887  *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
9888  *             # This implementation of getbuffer is geared towards Cython
9889  *             # requirements, and does not yet fulfill the PEP.
9890  */
9891 
9892   /* function exit code */
9893   __pyx_r = 0;
9894   goto __pyx_L0;
9895   __pyx_L1_error:;
9896   __Pyx_XDECREF(__pyx_t_3);
9897   __Pyx_XDECREF(__pyx_t_8);
9898   __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9899   __pyx_r = -1;
9900   if (__pyx_v_info->obj != NULL) {
9901     __Pyx_GOTREF(__pyx_v_info->obj);
9902     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
9903   }
9904   goto __pyx_L2;
9905   __pyx_L0:;
9906   if (__pyx_v_info->obj == Py_None) {
9907     __Pyx_GOTREF(__pyx_v_info->obj);
9908     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
9909   }
9910   __pyx_L2:;
9911   __Pyx_XDECREF((PyObject *)__pyx_v_descr);
9912   __Pyx_RefNannyFinishContext();
9913   return __pyx_r;
9914 }
9915 
9916 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":337
9917  *                 f[0] = c'\0' # Terminate format string
9918  *
9919  *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
9920  *             if PyArray_HASFIELDS(self):
9921  *                 PyObject_Free(info.format)
9922  */
9923 
9924 /* Python wrapper */
9925 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)9926 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
9927   __Pyx_RefNannyDeclarations
9928   __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
9929   __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
9930 
9931   /* function exit code */
9932   __Pyx_RefNannyFinishContext();
9933 }
9934 
__pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject * __pyx_v_self,Py_buffer * __pyx_v_info)9935 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
9936   __Pyx_RefNannyDeclarations
9937   int __pyx_t_1;
9938   __Pyx_RefNannySetupContext("__releasebuffer__", 0);
9939 
9940   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":338
9941  *
9942  *         def __releasebuffer__(ndarray self, Py_buffer* info):
9943  *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
9944  *                 PyObject_Free(info.format)
9945  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
9946  */
9947   __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
9948   if (__pyx_t_1) {
9949 
9950     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":339
9951  *         def __releasebuffer__(ndarray self, Py_buffer* info):
9952  *             if PyArray_HASFIELDS(self):
9953  *                 PyObject_Free(info.format)             # <<<<<<<<<<<<<<
9954  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
9955  *                 PyObject_Free(info.strides)
9956  */
9957     PyObject_Free(__pyx_v_info->format);
9958 
9959     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":338
9960  *
9961  *         def __releasebuffer__(ndarray self, Py_buffer* info):
9962  *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
9963  *                 PyObject_Free(info.format)
9964  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
9965  */
9966   }
9967 
9968   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":340
9969  *             if PyArray_HASFIELDS(self):
9970  *                 PyObject_Free(info.format)
9971  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
9972  *                 PyObject_Free(info.strides)
9973  *                 # info.shape was stored after info.strides in the same block
9974  */
9975   __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
9976   if (__pyx_t_1) {
9977 
9978     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":341
9979  *                 PyObject_Free(info.format)
9980  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
9981  *                 PyObject_Free(info.strides)             # <<<<<<<<<<<<<<
9982  *                 # info.shape was stored after info.strides in the same block
9983  *
9984  */
9985     PyObject_Free(__pyx_v_info->strides);
9986 
9987     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":340
9988  *             if PyArray_HASFIELDS(self):
9989  *                 PyObject_Free(info.format)
9990  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
9991  *                 PyObject_Free(info.strides)
9992  *                 # info.shape was stored after info.strides in the same block
9993  */
9994   }
9995 
9996   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":337
9997  *                 f[0] = c'\0' # Terminate format string
9998  *
9999  *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
10000  *             if PyArray_HASFIELDS(self):
10001  *                 PyObject_Free(info.format)
10002  */
10003 
10004   /* function exit code */
10005   __Pyx_RefNannyFinishContext();
10006 }
10007 
10008 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":821
10009  * ctypedef npy_cdouble     complex_t
10010  *
10011  * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
10012  *     return PyArray_MultiIterNew(1, <void*>a)
10013  *
10014  */
10015 
__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject * __pyx_v_a)10016 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
10017   PyObject *__pyx_r = NULL;
10018   __Pyx_RefNannyDeclarations
10019   PyObject *__pyx_t_1 = NULL;
10020   __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
10021 
10022   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":822
10023  *
10024  * cdef inline object PyArray_MultiIterNew1(a):
10025  *     return PyArray_MultiIterNew(1, <void*>a)             # <<<<<<<<<<<<<<
10026  *
10027  * cdef inline object PyArray_MultiIterNew2(a, b):
10028  */
10029   __Pyx_XDECREF(__pyx_r);
10030   __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 822, __pyx_L1_error)
10031   __Pyx_GOTREF(__pyx_t_1);
10032   __pyx_r = __pyx_t_1;
10033   __pyx_t_1 = 0;
10034   goto __pyx_L0;
10035 
10036   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":821
10037  * ctypedef npy_cdouble     complex_t
10038  *
10039  * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
10040  *     return PyArray_MultiIterNew(1, <void*>a)
10041  *
10042  */
10043 
10044   /* function exit code */
10045   __pyx_L1_error:;
10046   __Pyx_XDECREF(__pyx_t_1);
10047   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
10048   __pyx_r = 0;
10049   __pyx_L0:;
10050   __Pyx_XGIVEREF(__pyx_r);
10051   __Pyx_RefNannyFinishContext();
10052   return __pyx_r;
10053 }
10054 
10055 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824
10056  *     return PyArray_MultiIterNew(1, <void*>a)
10057  *
10058  * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
10059  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
10060  *
10061  */
10062 
__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject * __pyx_v_a,PyObject * __pyx_v_b)10063 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
10064   PyObject *__pyx_r = NULL;
10065   __Pyx_RefNannyDeclarations
10066   PyObject *__pyx_t_1 = NULL;
10067   __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
10068 
10069   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":825
10070  *
10071  * cdef inline object PyArray_MultiIterNew2(a, b):
10072  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)             # <<<<<<<<<<<<<<
10073  *
10074  * cdef inline object PyArray_MultiIterNew3(a, b, c):
10075  */
10076   __Pyx_XDECREF(__pyx_r);
10077   __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 825, __pyx_L1_error)
10078   __Pyx_GOTREF(__pyx_t_1);
10079   __pyx_r = __pyx_t_1;
10080   __pyx_t_1 = 0;
10081   goto __pyx_L0;
10082 
10083   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824
10084  *     return PyArray_MultiIterNew(1, <void*>a)
10085  *
10086  * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
10087  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
10088  *
10089  */
10090 
10091   /* function exit code */
10092   __pyx_L1_error:;
10093   __Pyx_XDECREF(__pyx_t_1);
10094   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
10095   __pyx_r = 0;
10096   __pyx_L0:;
10097   __Pyx_XGIVEREF(__pyx_r);
10098   __Pyx_RefNannyFinishContext();
10099   return __pyx_r;
10100 }
10101 
10102 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827
10103  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
10104  *
10105  * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
10106  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
10107  *
10108  */
10109 
__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject * __pyx_v_a,PyObject * __pyx_v_b,PyObject * __pyx_v_c)10110 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
10111   PyObject *__pyx_r = NULL;
10112   __Pyx_RefNannyDeclarations
10113   PyObject *__pyx_t_1 = NULL;
10114   __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
10115 
10116   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":828
10117  *
10118  * cdef inline object PyArray_MultiIterNew3(a, b, c):
10119  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)             # <<<<<<<<<<<<<<
10120  *
10121  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
10122  */
10123   __Pyx_XDECREF(__pyx_r);
10124   __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(3, 828, __pyx_L1_error)
10125   __Pyx_GOTREF(__pyx_t_1);
10126   __pyx_r = __pyx_t_1;
10127   __pyx_t_1 = 0;
10128   goto __pyx_L0;
10129 
10130   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827
10131  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
10132  *
10133  * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
10134  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
10135  *
10136  */
10137 
10138   /* function exit code */
10139   __pyx_L1_error:;
10140   __Pyx_XDECREF(__pyx_t_1);
10141   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
10142   __pyx_r = 0;
10143   __pyx_L0:;
10144   __Pyx_XGIVEREF(__pyx_r);
10145   __Pyx_RefNannyFinishContext();
10146   return __pyx_r;
10147 }
10148 
10149 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":830
10150  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
10151  *
10152  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
10153  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
10154  *
10155  */
10156 
__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject * __pyx_v_a,PyObject * __pyx_v_b,PyObject * __pyx_v_c,PyObject * __pyx_v_d)10157 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) {
10158   PyObject *__pyx_r = NULL;
10159   __Pyx_RefNannyDeclarations
10160   PyObject *__pyx_t_1 = NULL;
10161   __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
10162 
10163   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831
10164  *
10165  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
10166  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)             # <<<<<<<<<<<<<<
10167  *
10168  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
10169  */
10170   __Pyx_XDECREF(__pyx_r);
10171   __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(3, 831, __pyx_L1_error)
10172   __Pyx_GOTREF(__pyx_t_1);
10173   __pyx_r = __pyx_t_1;
10174   __pyx_t_1 = 0;
10175   goto __pyx_L0;
10176 
10177   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":830
10178  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
10179  *
10180  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
10181  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
10182  *
10183  */
10184 
10185   /* function exit code */
10186   __pyx_L1_error:;
10187   __Pyx_XDECREF(__pyx_t_1);
10188   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
10189   __pyx_r = 0;
10190   __pyx_L0:;
10191   __Pyx_XGIVEREF(__pyx_r);
10192   __Pyx_RefNannyFinishContext();
10193   return __pyx_r;
10194 }
10195 
10196 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833
10197  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
10198  *
10199  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
10200  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
10201  *
10202  */
10203 
__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)10204 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) {
10205   PyObject *__pyx_r = NULL;
10206   __Pyx_RefNannyDeclarations
10207   PyObject *__pyx_t_1 = NULL;
10208   __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
10209 
10210   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834
10211  *
10212  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
10213  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)             # <<<<<<<<<<<<<<
10214  *
10215  * cdef inline tuple PyDataType_SHAPE(dtype d):
10216  */
10217   __Pyx_XDECREF(__pyx_r);
10218   __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(3, 834, __pyx_L1_error)
10219   __Pyx_GOTREF(__pyx_t_1);
10220   __pyx_r = __pyx_t_1;
10221   __pyx_t_1 = 0;
10222   goto __pyx_L0;
10223 
10224   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833
10225  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
10226  *
10227  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
10228  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
10229  *
10230  */
10231 
10232   /* function exit code */
10233   __pyx_L1_error:;
10234   __Pyx_XDECREF(__pyx_t_1);
10235   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
10236   __pyx_r = 0;
10237   __pyx_L0:;
10238   __Pyx_XGIVEREF(__pyx_r);
10239   __Pyx_RefNannyFinishContext();
10240   return __pyx_r;
10241 }
10242 
10243 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":836
10244  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
10245  *
10246  * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
10247  *     if PyDataType_HASSUBARRAY(d):
10248  *         return <tuple>d.subarray.shape
10249  */
10250 
__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr * __pyx_v_d)10251 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
10252   PyObject *__pyx_r = NULL;
10253   __Pyx_RefNannyDeclarations
10254   int __pyx_t_1;
10255   __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
10256 
10257   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837
10258  *
10259  * cdef inline tuple PyDataType_SHAPE(dtype d):
10260  *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
10261  *         return <tuple>d.subarray.shape
10262  *     else:
10263  */
10264   __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
10265   if (__pyx_t_1) {
10266 
10267     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":838
10268  * cdef inline tuple PyDataType_SHAPE(dtype d):
10269  *     if PyDataType_HASSUBARRAY(d):
10270  *         return <tuple>d.subarray.shape             # <<<<<<<<<<<<<<
10271  *     else:
10272  *         return ()
10273  */
10274     __Pyx_XDECREF(__pyx_r);
10275     __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
10276     __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
10277     goto __pyx_L0;
10278 
10279     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837
10280  *
10281  * cdef inline tuple PyDataType_SHAPE(dtype d):
10282  *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
10283  *         return <tuple>d.subarray.shape
10284  *     else:
10285  */
10286   }
10287 
10288   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":840
10289  *         return <tuple>d.subarray.shape
10290  *     else:
10291  *         return ()             # <<<<<<<<<<<<<<
10292  *
10293  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
10294  */
10295   /*else*/ {
10296     __Pyx_XDECREF(__pyx_r);
10297     __Pyx_INCREF(__pyx_empty_tuple);
10298     __pyx_r = __pyx_empty_tuple;
10299     goto __pyx_L0;
10300   }
10301 
10302   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":836
10303  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
10304  *
10305  * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
10306  *     if PyDataType_HASSUBARRAY(d):
10307  *         return <tuple>d.subarray.shape
10308  */
10309 
10310   /* function exit code */
10311   __pyx_L0:;
10312   __Pyx_XGIVEREF(__pyx_r);
10313   __Pyx_RefNannyFinishContext();
10314   return __pyx_r;
10315 }
10316 
10317 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842
10318  *         return ()
10319  *
10320  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
10321  *     # Recursive utility function used in __getbuffer__ to get format
10322  *     # string. The new location in the format string is returned.
10323  */
10324 
__pyx_f_5numpy__util_dtypestring(PyArray_Descr * __pyx_v_descr,char * __pyx_v_f,char * __pyx_v_end,int * __pyx_v_offset)10325 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) {
10326   PyArray_Descr *__pyx_v_child = 0;
10327   int __pyx_v_endian_detector;
10328   int __pyx_v_little_endian;
10329   PyObject *__pyx_v_fields = 0;
10330   PyObject *__pyx_v_childname = NULL;
10331   PyObject *__pyx_v_new_offset = NULL;
10332   PyObject *__pyx_v_t = NULL;
10333   char *__pyx_r;
10334   __Pyx_RefNannyDeclarations
10335   PyObject *__pyx_t_1 = NULL;
10336   Py_ssize_t __pyx_t_2;
10337   PyObject *__pyx_t_3 = NULL;
10338   PyObject *__pyx_t_4 = NULL;
10339   int __pyx_t_5;
10340   int __pyx_t_6;
10341   int __pyx_t_7;
10342   long __pyx_t_8;
10343   char *__pyx_t_9;
10344   __Pyx_RefNannySetupContext("_util_dtypestring", 0);
10345 
10346   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":847
10347  *
10348  *     cdef dtype child
10349  *     cdef int endian_detector = 1             # <<<<<<<<<<<<<<
10350  *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
10351  *     cdef tuple fields
10352  */
10353   __pyx_v_endian_detector = 1;
10354 
10355   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":848
10356  *     cdef dtype child
10357  *     cdef int endian_detector = 1
10358  *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
10359  *     cdef tuple fields
10360  *
10361  */
10362   __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
10363 
10364   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851
10365  *     cdef tuple fields
10366  *
10367  *     for childname in descr.names:             # <<<<<<<<<<<<<<
10368  *         fields = descr.fields[childname]
10369  *         child, new_offset = fields
10370  */
10371   if (unlikely(__pyx_v_descr->names == Py_None)) {
10372     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
10373     __PYX_ERR(3, 851, __pyx_L1_error)
10374   }
10375   __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
10376   for (;;) {
10377     if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
10378     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10379     __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(3, 851, __pyx_L1_error)
10380     #else
10381     __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 851, __pyx_L1_error)
10382     __Pyx_GOTREF(__pyx_t_3);
10383     #endif
10384     __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
10385     __pyx_t_3 = 0;
10386 
10387     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":852
10388  *
10389  *     for childname in descr.names:
10390  *         fields = descr.fields[childname]             # <<<<<<<<<<<<<<
10391  *         child, new_offset = fields
10392  *
10393  */
10394     if (unlikely(__pyx_v_descr->fields == Py_None)) {
10395       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
10396       __PYX_ERR(3, 852, __pyx_L1_error)
10397     }
10398     __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 852, __pyx_L1_error)
10399     __Pyx_GOTREF(__pyx_t_3);
10400     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(3, 852, __pyx_L1_error)
10401     __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
10402     __pyx_t_3 = 0;
10403 
10404     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":853
10405  *     for childname in descr.names:
10406  *         fields = descr.fields[childname]
10407  *         child, new_offset = fields             # <<<<<<<<<<<<<<
10408  *
10409  *         if (end - f) - <int>(new_offset - offset[0]) < 15:
10410  */
10411     if (likely(__pyx_v_fields != Py_None)) {
10412       PyObject* sequence = __pyx_v_fields;
10413       Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
10414       if (unlikely(size != 2)) {
10415         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
10416         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
10417         __PYX_ERR(3, 853, __pyx_L1_error)
10418       }
10419       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10420       __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
10421       __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
10422       __Pyx_INCREF(__pyx_t_3);
10423       __Pyx_INCREF(__pyx_t_4);
10424       #else
10425       __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 853, __pyx_L1_error)
10426       __Pyx_GOTREF(__pyx_t_3);
10427       __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 853, __pyx_L1_error)
10428       __Pyx_GOTREF(__pyx_t_4);
10429       #endif
10430     } else {
10431       __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(3, 853, __pyx_L1_error)
10432     }
10433     if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(3, 853, __pyx_L1_error)
10434     __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
10435     __pyx_t_3 = 0;
10436     __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
10437     __pyx_t_4 = 0;
10438 
10439     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855
10440  *         child, new_offset = fields
10441  *
10442  *         if (end - f) - <int>(new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
10443  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
10444  *
10445  */
10446     __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 855, __pyx_L1_error)
10447     __Pyx_GOTREF(__pyx_t_4);
10448     __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 855, __pyx_L1_error)
10449     __Pyx_GOTREF(__pyx_t_3);
10450     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10451     __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 855, __pyx_L1_error)
10452     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10453     __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
10454     if (unlikely(__pyx_t_6)) {
10455 
10456       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856
10457  *
10458  *         if (end - f) - <int>(new_offset - offset[0]) < 15:
10459  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
10460  *
10461  *         if ((child.byteorder == c'>' and little_endian) or
10462  */
10463       __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 856, __pyx_L1_error)
10464       __Pyx_GOTREF(__pyx_t_3);
10465       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
10466       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10467       __PYX_ERR(3, 856, __pyx_L1_error)
10468 
10469       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855
10470  *         child, new_offset = fields
10471  *
10472  *         if (end - f) - <int>(new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
10473  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
10474  *
10475  */
10476     }
10477 
10478     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858
10479  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
10480  *
10481  *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
10482  *             (child.byteorder == c'<' and not little_endian)):
10483  *             raise ValueError(u"Non-native byte order not supported")
10484  */
10485     __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
10486     if (!__pyx_t_7) {
10487       goto __pyx_L8_next_or;
10488     } else {
10489     }
10490     __pyx_t_7 = (__pyx_v_little_endian != 0);
10491     if (!__pyx_t_7) {
10492     } else {
10493       __pyx_t_6 = __pyx_t_7;
10494       goto __pyx_L7_bool_binop_done;
10495     }
10496     __pyx_L8_next_or:;
10497 
10498     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":859
10499  *
10500  *         if ((child.byteorder == c'>' and little_endian) or
10501  *             (child.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
10502  *             raise ValueError(u"Non-native byte order not supported")
10503  *             # One could encode it in the format string and have Cython
10504  */
10505     __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
10506     if (__pyx_t_7) {
10507     } else {
10508       __pyx_t_6 = __pyx_t_7;
10509       goto __pyx_L7_bool_binop_done;
10510     }
10511     __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
10512     __pyx_t_6 = __pyx_t_7;
10513     __pyx_L7_bool_binop_done:;
10514 
10515     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858
10516  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
10517  *
10518  *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
10519  *             (child.byteorder == c'<' and not little_endian)):
10520  *             raise ValueError(u"Non-native byte order not supported")
10521  */
10522     if (unlikely(__pyx_t_6)) {
10523 
10524       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":860
10525  *         if ((child.byteorder == c'>' and little_endian) or
10526  *             (child.byteorder == c'<' and not little_endian)):
10527  *             raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
10528  *             # One could encode it in the format string and have Cython
10529  *             # complain instead, BUT: < and > in format strings also imply
10530  */
10531       __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 860, __pyx_L1_error)
10532       __Pyx_GOTREF(__pyx_t_3);
10533       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
10534       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10535       __PYX_ERR(3, 860, __pyx_L1_error)
10536 
10537       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858
10538  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
10539  *
10540  *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
10541  *             (child.byteorder == c'<' and not little_endian)):
10542  *             raise ValueError(u"Non-native byte order not supported")
10543  */
10544     }
10545 
10546     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":870
10547  *
10548  *         # Output padding bytes
10549  *         while offset[0] < new_offset:             # <<<<<<<<<<<<<<
10550  *             f[0] = 120 # "x"; pad byte
10551  *             f += 1
10552  */
10553     while (1) {
10554       __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 870, __pyx_L1_error)
10555       __Pyx_GOTREF(__pyx_t_3);
10556       __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(3, 870, __pyx_L1_error)
10557       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10558       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 870, __pyx_L1_error)
10559       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10560       if (!__pyx_t_6) break;
10561 
10562       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":871
10563  *         # Output padding bytes
10564  *         while offset[0] < new_offset:
10565  *             f[0] = 120 # "x"; pad byte             # <<<<<<<<<<<<<<
10566  *             f += 1
10567  *             offset[0] += 1
10568  */
10569       (__pyx_v_f[0]) = 0x78;
10570 
10571       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":872
10572  *         while offset[0] < new_offset:
10573  *             f[0] = 120 # "x"; pad byte
10574  *             f += 1             # <<<<<<<<<<<<<<
10575  *             offset[0] += 1
10576  *
10577  */
10578       __pyx_v_f = (__pyx_v_f + 1);
10579 
10580       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":873
10581  *             f[0] = 120 # "x"; pad byte
10582  *             f += 1
10583  *             offset[0] += 1             # <<<<<<<<<<<<<<
10584  *
10585  *         offset[0] += child.itemsize
10586  */
10587       __pyx_t_8 = 0;
10588       (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
10589     }
10590 
10591     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":875
10592  *             offset[0] += 1
10593  *
10594  *         offset[0] += child.itemsize             # <<<<<<<<<<<<<<
10595  *
10596  *         if not PyDataType_HASFIELDS(child):
10597  */
10598     __pyx_t_8 = 0;
10599     (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
10600 
10601     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":877
10602  *         offset[0] += child.itemsize
10603  *
10604  *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
10605  *             t = child.type_num
10606  *             if end - f < 5:
10607  */
10608     __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
10609     if (__pyx_t_6) {
10610 
10611       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":878
10612  *
10613  *         if not PyDataType_HASFIELDS(child):
10614  *             t = child.type_num             # <<<<<<<<<<<<<<
10615  *             if end - f < 5:
10616  *                 raise RuntimeError(u"Format string allocated too short.")
10617  */
10618       __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 878, __pyx_L1_error)
10619       __Pyx_GOTREF(__pyx_t_4);
10620       __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
10621       __pyx_t_4 = 0;
10622 
10623       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":879
10624  *         if not PyDataType_HASFIELDS(child):
10625  *             t = child.type_num
10626  *             if end - f < 5:             # <<<<<<<<<<<<<<
10627  *                 raise RuntimeError(u"Format string allocated too short.")
10628  *
10629  */
10630       __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
10631       if (unlikely(__pyx_t_6)) {
10632 
10633         /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":880
10634  *             t = child.type_num
10635  *             if end - f < 5:
10636  *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
10637  *
10638  *             # Until ticket #99 is fixed, use integers to avoid warnings
10639  */
10640         __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 880, __pyx_L1_error)
10641         __Pyx_GOTREF(__pyx_t_4);
10642         __Pyx_Raise(__pyx_t_4, 0, 0, 0);
10643         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10644         __PYX_ERR(3, 880, __pyx_L1_error)
10645 
10646         /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":879
10647  *         if not PyDataType_HASFIELDS(child):
10648  *             t = child.type_num
10649  *             if end - f < 5:             # <<<<<<<<<<<<<<
10650  *                 raise RuntimeError(u"Format string allocated too short.")
10651  *
10652  */
10653       }
10654 
10655       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":883
10656  *
10657  *             # Until ticket #99 is fixed, use integers to avoid warnings
10658  *             if   t == NPY_BYTE:        f[0] =  98 #"b"             # <<<<<<<<<<<<<<
10659  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
10660  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
10661  */
10662       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 883, __pyx_L1_error)
10663       __Pyx_GOTREF(__pyx_t_4);
10664       __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(3, 883, __pyx_L1_error)
10665       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10666       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 883, __pyx_L1_error)
10667       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10668       if (__pyx_t_6) {
10669         (__pyx_v_f[0]) = 98;
10670         goto __pyx_L15;
10671       }
10672 
10673       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":884
10674  *             # Until ticket #99 is fixed, use integers to avoid warnings
10675  *             if   t == NPY_BYTE:        f[0] =  98 #"b"
10676  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"             # <<<<<<<<<<<<<<
10677  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
10678  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
10679  */
10680       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 884, __pyx_L1_error)
10681       __Pyx_GOTREF(__pyx_t_3);
10682       __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(3, 884, __pyx_L1_error)
10683       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10684       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 884, __pyx_L1_error)
10685       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10686       if (__pyx_t_6) {
10687         (__pyx_v_f[0]) = 66;
10688         goto __pyx_L15;
10689       }
10690 
10691       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":885
10692  *             if   t == NPY_BYTE:        f[0] =  98 #"b"
10693  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
10694  *             elif t == NPY_SHORT:       f[0] = 104 #"h"             # <<<<<<<<<<<<<<
10695  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
10696  *             elif t == NPY_INT:         f[0] = 105 #"i"
10697  */
10698       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 885, __pyx_L1_error)
10699       __Pyx_GOTREF(__pyx_t_4);
10700       __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(3, 885, __pyx_L1_error)
10701       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10702       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 885, __pyx_L1_error)
10703       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10704       if (__pyx_t_6) {
10705         (__pyx_v_f[0]) = 0x68;
10706         goto __pyx_L15;
10707       }
10708 
10709       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":886
10710  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
10711  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
10712  *             elif t == NPY_USHORT:      f[0] =  72 #"H"             # <<<<<<<<<<<<<<
10713  *             elif t == NPY_INT:         f[0] = 105 #"i"
10714  *             elif t == NPY_UINT:        f[0] =  73 #"I"
10715  */
10716       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 886, __pyx_L1_error)
10717       __Pyx_GOTREF(__pyx_t_3);
10718       __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(3, 886, __pyx_L1_error)
10719       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10720       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 886, __pyx_L1_error)
10721       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10722       if (__pyx_t_6) {
10723         (__pyx_v_f[0]) = 72;
10724         goto __pyx_L15;
10725       }
10726 
10727       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":887
10728  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
10729  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
10730  *             elif t == NPY_INT:         f[0] = 105 #"i"             # <<<<<<<<<<<<<<
10731  *             elif t == NPY_UINT:        f[0] =  73 #"I"
10732  *             elif t == NPY_LONG:        f[0] = 108 #"l"
10733  */
10734       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 887, __pyx_L1_error)
10735       __Pyx_GOTREF(__pyx_t_4);
10736       __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(3, 887, __pyx_L1_error)
10737       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10738       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 887, __pyx_L1_error)
10739       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10740       if (__pyx_t_6) {
10741         (__pyx_v_f[0]) = 0x69;
10742         goto __pyx_L15;
10743       }
10744 
10745       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":888
10746  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
10747  *             elif t == NPY_INT:         f[0] = 105 #"i"
10748  *             elif t == NPY_UINT:        f[0] =  73 #"I"             # <<<<<<<<<<<<<<
10749  *             elif t == NPY_LONG:        f[0] = 108 #"l"
10750  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
10751  */
10752       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 888, __pyx_L1_error)
10753       __Pyx_GOTREF(__pyx_t_3);
10754       __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(3, 888, __pyx_L1_error)
10755       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10756       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 888, __pyx_L1_error)
10757       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10758       if (__pyx_t_6) {
10759         (__pyx_v_f[0]) = 73;
10760         goto __pyx_L15;
10761       }
10762 
10763       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":889
10764  *             elif t == NPY_INT:         f[0] = 105 #"i"
10765  *             elif t == NPY_UINT:        f[0] =  73 #"I"
10766  *             elif t == NPY_LONG:        f[0] = 108 #"l"             # <<<<<<<<<<<<<<
10767  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
10768  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
10769  */
10770       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 889, __pyx_L1_error)
10771       __Pyx_GOTREF(__pyx_t_4);
10772       __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(3, 889, __pyx_L1_error)
10773       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10774       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 889, __pyx_L1_error)
10775       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10776       if (__pyx_t_6) {
10777         (__pyx_v_f[0]) = 0x6C;
10778         goto __pyx_L15;
10779       }
10780 
10781       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":890
10782  *             elif t == NPY_UINT:        f[0] =  73 #"I"
10783  *             elif t == NPY_LONG:        f[0] = 108 #"l"
10784  *             elif t == NPY_ULONG:       f[0] = 76  #"L"             # <<<<<<<<<<<<<<
10785  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
10786  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
10787  */
10788       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 890, __pyx_L1_error)
10789       __Pyx_GOTREF(__pyx_t_3);
10790       __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(3, 890, __pyx_L1_error)
10791       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10792       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 890, __pyx_L1_error)
10793       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10794       if (__pyx_t_6) {
10795         (__pyx_v_f[0]) = 76;
10796         goto __pyx_L15;
10797       }
10798 
10799       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":891
10800  *             elif t == NPY_LONG:        f[0] = 108 #"l"
10801  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
10802  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"             # <<<<<<<<<<<<<<
10803  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
10804  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
10805  */
10806       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 891, __pyx_L1_error)
10807       __Pyx_GOTREF(__pyx_t_4);
10808       __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(3, 891, __pyx_L1_error)
10809       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10810       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 891, __pyx_L1_error)
10811       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10812       if (__pyx_t_6) {
10813         (__pyx_v_f[0]) = 0x71;
10814         goto __pyx_L15;
10815       }
10816 
10817       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":892
10818  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
10819  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
10820  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"             # <<<<<<<<<<<<<<
10821  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
10822  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
10823  */
10824       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 892, __pyx_L1_error)
10825       __Pyx_GOTREF(__pyx_t_3);
10826       __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(3, 892, __pyx_L1_error)
10827       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10828       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 892, __pyx_L1_error)
10829       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10830       if (__pyx_t_6) {
10831         (__pyx_v_f[0]) = 81;
10832         goto __pyx_L15;
10833       }
10834 
10835       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":893
10836  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
10837  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
10838  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"             # <<<<<<<<<<<<<<
10839  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
10840  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
10841  */
10842       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 893, __pyx_L1_error)
10843       __Pyx_GOTREF(__pyx_t_4);
10844       __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(3, 893, __pyx_L1_error)
10845       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10846       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 893, __pyx_L1_error)
10847       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10848       if (__pyx_t_6) {
10849         (__pyx_v_f[0]) = 0x66;
10850         goto __pyx_L15;
10851       }
10852 
10853       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":894
10854  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
10855  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
10856  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"             # <<<<<<<<<<<<<<
10857  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
10858  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
10859  */
10860       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 894, __pyx_L1_error)
10861       __Pyx_GOTREF(__pyx_t_3);
10862       __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(3, 894, __pyx_L1_error)
10863       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10864       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 894, __pyx_L1_error)
10865       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10866       if (__pyx_t_6) {
10867         (__pyx_v_f[0]) = 0x64;
10868         goto __pyx_L15;
10869       }
10870 
10871       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":895
10872  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
10873  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
10874  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"             # <<<<<<<<<<<<<<
10875  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
10876  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
10877  */
10878       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 895, __pyx_L1_error)
10879       __Pyx_GOTREF(__pyx_t_4);
10880       __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(3, 895, __pyx_L1_error)
10881       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10882       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 895, __pyx_L1_error)
10883       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10884       if (__pyx_t_6) {
10885         (__pyx_v_f[0]) = 0x67;
10886         goto __pyx_L15;
10887       }
10888 
10889       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":896
10890  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
10891  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
10892  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf             # <<<<<<<<<<<<<<
10893  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
10894  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
10895  */
10896       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 896, __pyx_L1_error)
10897       __Pyx_GOTREF(__pyx_t_3);
10898       __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(3, 896, __pyx_L1_error)
10899       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10900       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 896, __pyx_L1_error)
10901       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10902       if (__pyx_t_6) {
10903         (__pyx_v_f[0]) = 90;
10904         (__pyx_v_f[1]) = 0x66;
10905         __pyx_v_f = (__pyx_v_f + 1);
10906         goto __pyx_L15;
10907       }
10908 
10909       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":897
10910  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
10911  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
10912  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd             # <<<<<<<<<<<<<<
10913  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
10914  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
10915  */
10916       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 897, __pyx_L1_error)
10917       __Pyx_GOTREF(__pyx_t_4);
10918       __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(3, 897, __pyx_L1_error)
10919       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10920       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 897, __pyx_L1_error)
10921       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10922       if (__pyx_t_6) {
10923         (__pyx_v_f[0]) = 90;
10924         (__pyx_v_f[1]) = 0x64;
10925         __pyx_v_f = (__pyx_v_f + 1);
10926         goto __pyx_L15;
10927       }
10928 
10929       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":898
10930  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
10931  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
10932  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg             # <<<<<<<<<<<<<<
10933  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
10934  *             else:
10935  */
10936       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 898, __pyx_L1_error)
10937       __Pyx_GOTREF(__pyx_t_3);
10938       __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(3, 898, __pyx_L1_error)
10939       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10940       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 898, __pyx_L1_error)
10941       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10942       if (__pyx_t_6) {
10943         (__pyx_v_f[0]) = 90;
10944         (__pyx_v_f[1]) = 0x67;
10945         __pyx_v_f = (__pyx_v_f + 1);
10946         goto __pyx_L15;
10947       }
10948 
10949       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":899
10950  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
10951  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
10952  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"             # <<<<<<<<<<<<<<
10953  *             else:
10954  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
10955  */
10956       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 899, __pyx_L1_error)
10957       __Pyx_GOTREF(__pyx_t_4);
10958       __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(3, 899, __pyx_L1_error)
10959       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10960       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 899, __pyx_L1_error)
10961       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10962       if (likely(__pyx_t_6)) {
10963         (__pyx_v_f[0]) = 79;
10964         goto __pyx_L15;
10965       }
10966 
10967       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":901
10968  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
10969  *             else:
10970  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
10971  *             f += 1
10972  *         else:
10973  */
10974       /*else*/ {
10975         __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(3, 901, __pyx_L1_error)
10976         __Pyx_GOTREF(__pyx_t_3);
10977         __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 901, __pyx_L1_error)
10978         __Pyx_GOTREF(__pyx_t_4);
10979         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10980         __Pyx_Raise(__pyx_t_4, 0, 0, 0);
10981         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10982         __PYX_ERR(3, 901, __pyx_L1_error)
10983       }
10984       __pyx_L15:;
10985 
10986       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":902
10987  *             else:
10988  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
10989  *             f += 1             # <<<<<<<<<<<<<<
10990  *         else:
10991  *             # Cython ignores struct boundary information ("T{...}"),
10992  */
10993       __pyx_v_f = (__pyx_v_f + 1);
10994 
10995       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":877
10996  *         offset[0] += child.itemsize
10997  *
10998  *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
10999  *             t = child.type_num
11000  *             if end - f < 5:
11001  */
11002       goto __pyx_L13;
11003     }
11004 
11005     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":906
11006  *             # Cython ignores struct boundary information ("T{...}"),
11007  *             # so don't output it
11008  *             f = _util_dtypestring(child, f, end, offset)             # <<<<<<<<<<<<<<
11009  *     return f
11010  *
11011  */
11012     /*else*/ {
11013       __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(3, 906, __pyx_L1_error)
11014       __pyx_v_f = __pyx_t_9;
11015     }
11016     __pyx_L13:;
11017 
11018     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851
11019  *     cdef tuple fields
11020  *
11021  *     for childname in descr.names:             # <<<<<<<<<<<<<<
11022  *         fields = descr.fields[childname]
11023  *         child, new_offset = fields
11024  */
11025   }
11026   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11027 
11028   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":907
11029  *             # so don't output it
11030  *             f = _util_dtypestring(child, f, end, offset)
11031  *     return f             # <<<<<<<<<<<<<<
11032  *
11033  *
11034  */
11035   __pyx_r = __pyx_v_f;
11036   goto __pyx_L0;
11037 
11038   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842
11039  *         return ()
11040  *
11041  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
11042  *     # Recursive utility function used in __getbuffer__ to get format
11043  *     # string. The new location in the format string is returned.
11044  */
11045 
11046   /* function exit code */
11047   __pyx_L1_error:;
11048   __Pyx_XDECREF(__pyx_t_1);
11049   __Pyx_XDECREF(__pyx_t_3);
11050   __Pyx_XDECREF(__pyx_t_4);
11051   __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
11052   __pyx_r = NULL;
11053   __pyx_L0:;
11054   __Pyx_XDECREF((PyObject *)__pyx_v_child);
11055   __Pyx_XDECREF(__pyx_v_fields);
11056   __Pyx_XDECREF(__pyx_v_childname);
11057   __Pyx_XDECREF(__pyx_v_new_offset);
11058   __Pyx_XDECREF(__pyx_v_t);
11059   __Pyx_RefNannyFinishContext();
11060   return __pyx_r;
11061 }
11062 
11063 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1022
11064  *     int _import_umath() except -1
11065  *
11066  * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
11067  *     Py_INCREF(base) # important to do this before stealing the reference below!
11068  *     PyArray_SetBaseObject(arr, base)
11069  */
11070 
__pyx_f_5numpy_set_array_base(PyArrayObject * __pyx_v_arr,PyObject * __pyx_v_base)11071 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
11072   __Pyx_RefNannyDeclarations
11073   __Pyx_RefNannySetupContext("set_array_base", 0);
11074 
11075   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1023
11076  *
11077  * cdef inline void set_array_base(ndarray arr, object base):
11078  *     Py_INCREF(base) # important to do this before stealing the reference below!             # <<<<<<<<<<<<<<
11079  *     PyArray_SetBaseObject(arr, base)
11080  *
11081  */
11082   Py_INCREF(__pyx_v_base);
11083 
11084   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1024
11085  * cdef inline void set_array_base(ndarray arr, object base):
11086  *     Py_INCREF(base) # important to do this before stealing the reference below!
11087  *     PyArray_SetBaseObject(arr, base)             # <<<<<<<<<<<<<<
11088  *
11089  * cdef inline object get_array_base(ndarray arr):
11090  */
11091   (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
11092 
11093   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1022
11094  *     int _import_umath() except -1
11095  *
11096  * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
11097  *     Py_INCREF(base) # important to do this before stealing the reference below!
11098  *     PyArray_SetBaseObject(arr, base)
11099  */
11100 
11101   /* function exit code */
11102   __Pyx_RefNannyFinishContext();
11103 }
11104 
11105 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1026
11106  *     PyArray_SetBaseObject(arr, base)
11107  *
11108  * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
11109  *     base = PyArray_BASE(arr)
11110  *     if base is NULL:
11111  */
11112 
__pyx_f_5numpy_get_array_base(PyArrayObject * __pyx_v_arr)11113 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
11114   PyObject *__pyx_v_base;
11115   PyObject *__pyx_r = NULL;
11116   __Pyx_RefNannyDeclarations
11117   int __pyx_t_1;
11118   __Pyx_RefNannySetupContext("get_array_base", 0);
11119 
11120   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1027
11121  *
11122  * cdef inline object get_array_base(ndarray arr):
11123  *     base = PyArray_BASE(arr)             # <<<<<<<<<<<<<<
11124  *     if base is NULL:
11125  *         return None
11126  */
11127   __pyx_v_base = PyArray_BASE(__pyx_v_arr);
11128 
11129   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1028
11130  * cdef inline object get_array_base(ndarray arr):
11131  *     base = PyArray_BASE(arr)
11132  *     if base is NULL:             # <<<<<<<<<<<<<<
11133  *         return None
11134  *     return <object>base
11135  */
11136   __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
11137   if (__pyx_t_1) {
11138 
11139     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1029
11140  *     base = PyArray_BASE(arr)
11141  *     if base is NULL:
11142  *         return None             # <<<<<<<<<<<<<<
11143  *     return <object>base
11144  *
11145  */
11146     __Pyx_XDECREF(__pyx_r);
11147     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11148     goto __pyx_L0;
11149 
11150     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1028
11151  * cdef inline object get_array_base(ndarray arr):
11152  *     base = PyArray_BASE(arr)
11153  *     if base is NULL:             # <<<<<<<<<<<<<<
11154  *         return None
11155  *     return <object>base
11156  */
11157   }
11158 
11159   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1030
11160  *     if base is NULL:
11161  *         return None
11162  *     return <object>base             # <<<<<<<<<<<<<<
11163  *
11164  * # Versions of the import_* functions which are more suitable for
11165  */
11166   __Pyx_XDECREF(__pyx_r);
11167   __Pyx_INCREF(((PyObject *)__pyx_v_base));
11168   __pyx_r = ((PyObject *)__pyx_v_base);
11169   goto __pyx_L0;
11170 
11171   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1026
11172  *     PyArray_SetBaseObject(arr, base)
11173  *
11174  * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
11175  *     base = PyArray_BASE(arr)
11176  *     if base is NULL:
11177  */
11178 
11179   /* function exit code */
11180   __pyx_L0:;
11181   __Pyx_XGIVEREF(__pyx_r);
11182   __Pyx_RefNannyFinishContext();
11183   return __pyx_r;
11184 }
11185 
11186 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1034
11187  * # Versions of the import_* functions which are more suitable for
11188  * # Cython code.
11189  * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
11190  *     try:
11191  *         _import_array()
11192  */
11193 
__pyx_f_5numpy_import_array(void)11194 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
11195   int __pyx_r;
11196   __Pyx_RefNannyDeclarations
11197   PyObject *__pyx_t_1 = NULL;
11198   PyObject *__pyx_t_2 = NULL;
11199   PyObject *__pyx_t_3 = NULL;
11200   int __pyx_t_4;
11201   PyObject *__pyx_t_5 = NULL;
11202   PyObject *__pyx_t_6 = NULL;
11203   PyObject *__pyx_t_7 = NULL;
11204   PyObject *__pyx_t_8 = NULL;
11205   __Pyx_RefNannySetupContext("import_array", 0);
11206 
11207   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035
11208  * # Cython code.
11209  * cdef inline int import_array() except -1:
11210  *     try:             # <<<<<<<<<<<<<<
11211  *         _import_array()
11212  *     except Exception:
11213  */
11214   {
11215     __Pyx_PyThreadState_declare
11216     __Pyx_PyThreadState_assign
11217     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
11218     __Pyx_XGOTREF(__pyx_t_1);
11219     __Pyx_XGOTREF(__pyx_t_2);
11220     __Pyx_XGOTREF(__pyx_t_3);
11221     /*try:*/ {
11222 
11223       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1036
11224  * cdef inline int import_array() except -1:
11225  *     try:
11226  *         _import_array()             # <<<<<<<<<<<<<<
11227  *     except Exception:
11228  *         raise ImportError("numpy.core.multiarray failed to import")
11229  */
11230       __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 1036, __pyx_L3_error)
11231 
11232       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035
11233  * # Cython code.
11234  * cdef inline int import_array() except -1:
11235  *     try:             # <<<<<<<<<<<<<<
11236  *         _import_array()
11237  *     except Exception:
11238  */
11239     }
11240     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
11241     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11242     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11243     goto __pyx_L8_try_end;
11244     __pyx_L3_error:;
11245 
11246     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1037
11247  *     try:
11248  *         _import_array()
11249  *     except Exception:             # <<<<<<<<<<<<<<
11250  *         raise ImportError("numpy.core.multiarray failed to import")
11251  *
11252  */
11253     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
11254     if (__pyx_t_4) {
11255       __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
11256       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 1037, __pyx_L5_except_error)
11257       __Pyx_GOTREF(__pyx_t_5);
11258       __Pyx_GOTREF(__pyx_t_6);
11259       __Pyx_GOTREF(__pyx_t_7);
11260 
11261       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1038
11262  *         _import_array()
11263  *     except Exception:
11264  *         raise ImportError("numpy.core.multiarray failed to import")             # <<<<<<<<<<<<<<
11265  *
11266  * cdef inline int import_umath() except -1:
11267  */
11268       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1038, __pyx_L5_except_error)
11269       __Pyx_GOTREF(__pyx_t_8);
11270       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
11271       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11272       __PYX_ERR(3, 1038, __pyx_L5_except_error)
11273     }
11274     goto __pyx_L5_except_error;
11275     __pyx_L5_except_error:;
11276 
11277     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035
11278  * # Cython code.
11279  * cdef inline int import_array() except -1:
11280  *     try:             # <<<<<<<<<<<<<<
11281  *         _import_array()
11282  *     except Exception:
11283  */
11284     __Pyx_XGIVEREF(__pyx_t_1);
11285     __Pyx_XGIVEREF(__pyx_t_2);
11286     __Pyx_XGIVEREF(__pyx_t_3);
11287     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
11288     goto __pyx_L1_error;
11289     __pyx_L8_try_end:;
11290   }
11291 
11292   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1034
11293  * # Versions of the import_* functions which are more suitable for
11294  * # Cython code.
11295  * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
11296  *     try:
11297  *         _import_array()
11298  */
11299 
11300   /* function exit code */
11301   __pyx_r = 0;
11302   goto __pyx_L0;
11303   __pyx_L1_error:;
11304   __Pyx_XDECREF(__pyx_t_5);
11305   __Pyx_XDECREF(__pyx_t_6);
11306   __Pyx_XDECREF(__pyx_t_7);
11307   __Pyx_XDECREF(__pyx_t_8);
11308   __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
11309   __pyx_r = -1;
11310   __pyx_L0:;
11311   __Pyx_RefNannyFinishContext();
11312   return __pyx_r;
11313 }
11314 
11315 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1040
11316  *         raise ImportError("numpy.core.multiarray failed to import")
11317  *
11318  * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
11319  *     try:
11320  *         _import_umath()
11321  */
11322 
__pyx_f_5numpy_import_umath(void)11323 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
11324   int __pyx_r;
11325   __Pyx_RefNannyDeclarations
11326   PyObject *__pyx_t_1 = NULL;
11327   PyObject *__pyx_t_2 = NULL;
11328   PyObject *__pyx_t_3 = NULL;
11329   int __pyx_t_4;
11330   PyObject *__pyx_t_5 = NULL;
11331   PyObject *__pyx_t_6 = NULL;
11332   PyObject *__pyx_t_7 = NULL;
11333   PyObject *__pyx_t_8 = NULL;
11334   __Pyx_RefNannySetupContext("import_umath", 0);
11335 
11336   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041
11337  *
11338  * cdef inline int import_umath() except -1:
11339  *     try:             # <<<<<<<<<<<<<<
11340  *         _import_umath()
11341  *     except Exception:
11342  */
11343   {
11344     __Pyx_PyThreadState_declare
11345     __Pyx_PyThreadState_assign
11346     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
11347     __Pyx_XGOTREF(__pyx_t_1);
11348     __Pyx_XGOTREF(__pyx_t_2);
11349     __Pyx_XGOTREF(__pyx_t_3);
11350     /*try:*/ {
11351 
11352       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1042
11353  * cdef inline int import_umath() except -1:
11354  *     try:
11355  *         _import_umath()             # <<<<<<<<<<<<<<
11356  *     except Exception:
11357  *         raise ImportError("numpy.core.umath failed to import")
11358  */
11359       __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 1042, __pyx_L3_error)
11360 
11361       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041
11362  *
11363  * cdef inline int import_umath() except -1:
11364  *     try:             # <<<<<<<<<<<<<<
11365  *         _import_umath()
11366  *     except Exception:
11367  */
11368     }
11369     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
11370     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11371     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11372     goto __pyx_L8_try_end;
11373     __pyx_L3_error:;
11374 
11375     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1043
11376  *     try:
11377  *         _import_umath()
11378  *     except Exception:             # <<<<<<<<<<<<<<
11379  *         raise ImportError("numpy.core.umath failed to import")
11380  *
11381  */
11382     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
11383     if (__pyx_t_4) {
11384       __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
11385       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 1043, __pyx_L5_except_error)
11386       __Pyx_GOTREF(__pyx_t_5);
11387       __Pyx_GOTREF(__pyx_t_6);
11388       __Pyx_GOTREF(__pyx_t_7);
11389 
11390       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1044
11391  *         _import_umath()
11392  *     except Exception:
11393  *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
11394  *
11395  * cdef inline int import_ufunc() except -1:
11396  */
11397       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1044, __pyx_L5_except_error)
11398       __Pyx_GOTREF(__pyx_t_8);
11399       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
11400       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11401       __PYX_ERR(3, 1044, __pyx_L5_except_error)
11402     }
11403     goto __pyx_L5_except_error;
11404     __pyx_L5_except_error:;
11405 
11406     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041
11407  *
11408  * cdef inline int import_umath() except -1:
11409  *     try:             # <<<<<<<<<<<<<<
11410  *         _import_umath()
11411  *     except Exception:
11412  */
11413     __Pyx_XGIVEREF(__pyx_t_1);
11414     __Pyx_XGIVEREF(__pyx_t_2);
11415     __Pyx_XGIVEREF(__pyx_t_3);
11416     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
11417     goto __pyx_L1_error;
11418     __pyx_L8_try_end:;
11419   }
11420 
11421   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1040
11422  *         raise ImportError("numpy.core.multiarray failed to import")
11423  *
11424  * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
11425  *     try:
11426  *         _import_umath()
11427  */
11428 
11429   /* function exit code */
11430   __pyx_r = 0;
11431   goto __pyx_L0;
11432   __pyx_L1_error:;
11433   __Pyx_XDECREF(__pyx_t_5);
11434   __Pyx_XDECREF(__pyx_t_6);
11435   __Pyx_XDECREF(__pyx_t_7);
11436   __Pyx_XDECREF(__pyx_t_8);
11437   __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
11438   __pyx_r = -1;
11439   __pyx_L0:;
11440   __Pyx_RefNannyFinishContext();
11441   return __pyx_r;
11442 }
11443 
11444 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1046
11445  *         raise ImportError("numpy.core.umath failed to import")
11446  *
11447  * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
11448  *     try:
11449  *         _import_umath()
11450  */
11451 
__pyx_f_5numpy_import_ufunc(void)11452 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
11453   int __pyx_r;
11454   __Pyx_RefNannyDeclarations
11455   PyObject *__pyx_t_1 = NULL;
11456   PyObject *__pyx_t_2 = NULL;
11457   PyObject *__pyx_t_3 = NULL;
11458   int __pyx_t_4;
11459   PyObject *__pyx_t_5 = NULL;
11460   PyObject *__pyx_t_6 = NULL;
11461   PyObject *__pyx_t_7 = NULL;
11462   PyObject *__pyx_t_8 = NULL;
11463   __Pyx_RefNannySetupContext("import_ufunc", 0);
11464 
11465   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047
11466  *
11467  * cdef inline int import_ufunc() except -1:
11468  *     try:             # <<<<<<<<<<<<<<
11469  *         _import_umath()
11470  *     except Exception:
11471  */
11472   {
11473     __Pyx_PyThreadState_declare
11474     __Pyx_PyThreadState_assign
11475     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
11476     __Pyx_XGOTREF(__pyx_t_1);
11477     __Pyx_XGOTREF(__pyx_t_2);
11478     __Pyx_XGOTREF(__pyx_t_3);
11479     /*try:*/ {
11480 
11481       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1048
11482  * cdef inline int import_ufunc() except -1:
11483  *     try:
11484  *         _import_umath()             # <<<<<<<<<<<<<<
11485  *     except Exception:
11486  *         raise ImportError("numpy.core.umath failed to import")
11487  */
11488       __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 1048, __pyx_L3_error)
11489 
11490       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047
11491  *
11492  * cdef inline int import_ufunc() except -1:
11493  *     try:             # <<<<<<<<<<<<<<
11494  *         _import_umath()
11495  *     except Exception:
11496  */
11497     }
11498     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
11499     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11500     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11501     goto __pyx_L8_try_end;
11502     __pyx_L3_error:;
11503 
11504     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1049
11505  *     try:
11506  *         _import_umath()
11507  *     except Exception:             # <<<<<<<<<<<<<<
11508  *         raise ImportError("numpy.core.umath failed to import")
11509  */
11510     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
11511     if (__pyx_t_4) {
11512       __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
11513       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 1049, __pyx_L5_except_error)
11514       __Pyx_GOTREF(__pyx_t_5);
11515       __Pyx_GOTREF(__pyx_t_6);
11516       __Pyx_GOTREF(__pyx_t_7);
11517 
11518       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1050
11519  *         _import_umath()
11520  *     except Exception:
11521  *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
11522  */
11523       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1050, __pyx_L5_except_error)
11524       __Pyx_GOTREF(__pyx_t_8);
11525       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
11526       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11527       __PYX_ERR(3, 1050, __pyx_L5_except_error)
11528     }
11529     goto __pyx_L5_except_error;
11530     __pyx_L5_except_error:;
11531 
11532     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047
11533  *
11534  * cdef inline int import_ufunc() except -1:
11535  *     try:             # <<<<<<<<<<<<<<
11536  *         _import_umath()
11537  *     except Exception:
11538  */
11539     __Pyx_XGIVEREF(__pyx_t_1);
11540     __Pyx_XGIVEREF(__pyx_t_2);
11541     __Pyx_XGIVEREF(__pyx_t_3);
11542     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
11543     goto __pyx_L1_error;
11544     __pyx_L8_try_end:;
11545   }
11546 
11547   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1046
11548  *         raise ImportError("numpy.core.umath failed to import")
11549  *
11550  * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
11551  *     try:
11552  *         _import_umath()
11553  */
11554 
11555   /* function exit code */
11556   __pyx_r = 0;
11557   goto __pyx_L0;
11558   __pyx_L1_error:;
11559   __Pyx_XDECREF(__pyx_t_5);
11560   __Pyx_XDECREF(__pyx_t_6);
11561   __Pyx_XDECREF(__pyx_t_7);
11562   __Pyx_XDECREF(__pyx_t_8);
11563   __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
11564   __pyx_r = -1;
11565   __pyx_L0:;
11566   __Pyx_RefNannyFinishContext();
11567   return __pyx_r;
11568 }
11569 
11570 /* "oct_visitors.pxd":51
11571  *     cdef void visit(self, Oct*, np.uint8_t selected)
11572  *
11573  *     cdef inline int oind(self):             # <<<<<<<<<<<<<<
11574  *         cdef int d = (1 << self.oref)
11575  *         return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2])
11576  */
11577 
__pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_oind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor * __pyx_v_self)11578 static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_oind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self) {
11579   int __pyx_v_d;
11580   int __pyx_r;
11581   __Pyx_RefNannyDeclarations
11582   __Pyx_RefNannySetupContext("oind", 0);
11583 
11584   /* "oct_visitors.pxd":52
11585  *
11586  *     cdef inline int oind(self):
11587  *         cdef int d = (1 << self.oref)             # <<<<<<<<<<<<<<
11588  *         return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2])
11589  *
11590  */
11591   __pyx_v_d = (1 << __pyx_v_self->oref);
11592 
11593   /* "oct_visitors.pxd":53
11594  *     cdef inline int oind(self):
11595  *         cdef int d = (1 << self.oref)
11596  *         return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2])             # <<<<<<<<<<<<<<
11597  *
11598  *     cdef inline int rind(self):
11599  */
11600   __pyx_r = (((((__pyx_v_self->ind[0]) * __pyx_v_d) + (__pyx_v_self->ind[1])) * __pyx_v_d) + (__pyx_v_self->ind[2]));
11601   goto __pyx_L0;
11602 
11603   /* "oct_visitors.pxd":51
11604  *     cdef void visit(self, Oct*, np.uint8_t selected)
11605  *
11606  *     cdef inline int oind(self):             # <<<<<<<<<<<<<<
11607  *         cdef int d = (1 << self.oref)
11608  *         return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2])
11609  */
11610 
11611   /* function exit code */
11612   __pyx_L0:;
11613   __Pyx_RefNannyFinishContext();
11614   return __pyx_r;
11615 }
11616 
11617 /* "oct_visitors.pxd":55
11618  *         return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2])
11619  *
11620  *     cdef inline int rind(self):             # <<<<<<<<<<<<<<
11621  *         cdef int d = (1 << self.oref)
11622  *         return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0])
11623  */
11624 
__pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_rind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor * __pyx_v_self)11625 static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_10OctVisitor_rind(struct __pyx_obj_2yt_8geometry_12oct_visitors_OctVisitor *__pyx_v_self) {
11626   int __pyx_v_d;
11627   int __pyx_r;
11628   __Pyx_RefNannyDeclarations
11629   __Pyx_RefNannySetupContext("rind", 0);
11630 
11631   /* "oct_visitors.pxd":56
11632  *
11633  *     cdef inline int rind(self):
11634  *         cdef int d = (1 << self.oref)             # <<<<<<<<<<<<<<
11635  *         return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0])
11636  *
11637  */
11638   __pyx_v_d = (1 << __pyx_v_self->oref);
11639 
11640   /* "oct_visitors.pxd":57
11641  *     cdef inline int rind(self):
11642  *         cdef int d = (1 << self.oref)
11643  *         return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0])             # <<<<<<<<<<<<<<
11644  *
11645  * cdef class CountTotalOcts(OctVisitor):
11646  */
11647   __pyx_r = (((((__pyx_v_self->ind[2]) * __pyx_v_d) + (__pyx_v_self->ind[1])) * __pyx_v_d) + (__pyx_v_self->ind[0]));
11648   goto __pyx_L0;
11649 
11650   /* "oct_visitors.pxd":55
11651  *         return (((self.ind[0]*d)+self.ind[1])*d+self.ind[2])
11652  *
11653  *     cdef inline int rind(self):             # <<<<<<<<<<<<<<
11654  *         cdef int d = (1 << self.oref)
11655  *         return (((self.ind[2]*d)+self.ind[1])*d+self.ind[0])
11656  */
11657 
11658   /* function exit code */
11659   __pyx_L0:;
11660   __Pyx_RefNannyFinishContext();
11661   return __pyx_r;
11662 }
11663 
11664 /* "oct_visitors.pxd":142
11665  *     cdef np.uint64_t[:] morton_ind
11666  *
11667  * cdef inline int cind(int i, int j, int k) nogil:             # <<<<<<<<<<<<<<
11668  *     # THIS ONLY WORKS FOR CHILDREN.  It is not general for zones.
11669  *     return (((i*2)+j)*2+k)
11670  */
11671 
__pyx_f_2yt_8geometry_12oct_visitors_cind(int __pyx_v_i,int __pyx_v_j,int __pyx_v_k)11672 static CYTHON_INLINE int __pyx_f_2yt_8geometry_12oct_visitors_cind(int __pyx_v_i, int __pyx_v_j, int __pyx_v_k) {
11673   int __pyx_r;
11674 
11675   /* "oct_visitors.pxd":144
11676  * cdef inline int cind(int i, int j, int k) nogil:
11677  *     # THIS ONLY WORKS FOR CHILDREN.  It is not general for zones.
11678  *     return (((i*2)+j)*2+k)             # <<<<<<<<<<<<<<
11679  *
11680  * from oct_container cimport OctreeContainer
11681  */
11682   __pyx_r = ((((__pyx_v_i * 2) + __pyx_v_j) * 2) + __pyx_v_k);
11683   goto __pyx_L0;
11684 
11685   /* "oct_visitors.pxd":142
11686  *     cdef np.uint64_t[:] morton_ind
11687  *
11688  * cdef inline int cind(int i, int j, int k) nogil:             # <<<<<<<<<<<<<<
11689  *     # THIS ONLY WORKS FOR CHILDREN.  It is not general for zones.
11690  *     return (((i*2)+j)*2+k)
11691  */
11692 
11693   /* function exit code */
11694   __pyx_L0:;
11695   return __pyx_r;
11696 }
11697 
11698 /* "oct_visitors.pxd":165
11699  *     cdef void set_neighbour_info(self, Oct *o, int ishift[3])
11700  *
11701  *     cdef inline np.uint8_t neighbour_rind(self):             # <<<<<<<<<<<<<<
11702  *         cdef int d = (1 << self.oref)
11703  *         return (((self.neigh_ind[2]*d)+self.neigh_ind[1])*d+self.neigh_ind[0])
11704  */
11705 
__pyx_f_2yt_8geometry_12oct_visitors_20BaseNeighbourVisitor_neighbour_rind(struct __pyx_obj_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor * __pyx_v_self)11706 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) {
11707   int __pyx_v_d;
11708   __pyx_t_5numpy_uint8_t __pyx_r;
11709   __Pyx_RefNannyDeclarations
11710   __Pyx_RefNannySetupContext("neighbour_rind", 0);
11711 
11712   /* "oct_visitors.pxd":166
11713  *
11714  *     cdef inline np.uint8_t neighbour_rind(self):
11715  *         cdef int d = (1 << self.oref)             # <<<<<<<<<<<<<<
11716  *         return (((self.neigh_ind[2]*d)+self.neigh_ind[1])*d+self.neigh_ind[0])
11717  *
11718  */
11719   __pyx_v_d = (1 << __pyx_v_self->__pyx_base.oref);
11720 
11721   /* "oct_visitors.pxd":167
11722  *     cdef inline np.uint8_t neighbour_rind(self):
11723  *         cdef int d = (1 << self.oref)
11724  *         return (((self.neigh_ind[2]*d)+self.neigh_ind[1])*d+self.neigh_ind[0])             # <<<<<<<<<<<<<<
11725  *
11726  * cdef class NeighbourCellIndexVisitor(BaseNeighbourVisitor):
11727  */
11728   __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]));
11729   goto __pyx_L0;
11730 
11731   /* "oct_visitors.pxd":165
11732  *     cdef void set_neighbour_info(self, Oct *o, int ishift[3])
11733  *
11734  *     cdef inline np.uint8_t neighbour_rind(self):             # <<<<<<<<<<<<<<
11735  *         cdef int d = (1 << self.oref)
11736  *         return (((self.neigh_ind[2]*d)+self.neigh_ind[1])*d+self.neigh_ind[0])
11737  */
11738 
11739   /* function exit code */
11740   __pyx_L0:;
11741   __Pyx_RefNannyFinishContext();
11742   return __pyx_r;
11743 }
11744 
11745 /* "yt/utilities/lib/fp_utils.pxd":13
11746  *
11747  *
11748  * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil:             # <<<<<<<<<<<<<<
11749  *     if i0 > i1: return i0
11750  *     return i1
11751  */
11752 
__pyx_f_2yt_9utilities_3lib_8fp_utils_imax(__pyx_t_5numpy_int64_t __pyx_v_i0,__pyx_t_5numpy_int64_t __pyx_v_i1)11753 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) {
11754   __pyx_t_5numpy_int64_t __pyx_r;
11755   int __pyx_t_1;
11756 
11757   /* "yt/utilities/lib/fp_utils.pxd":14
11758  *
11759  * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil:
11760  *     if i0 > i1: return i0             # <<<<<<<<<<<<<<
11761  *     return i1
11762  *
11763  */
11764   __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0);
11765   if (__pyx_t_1) {
11766     __pyx_r = __pyx_v_i0;
11767     goto __pyx_L0;
11768   }
11769 
11770   /* "yt/utilities/lib/fp_utils.pxd":15
11771  * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil:
11772  *     if i0 > i1: return i0
11773  *     return i1             # <<<<<<<<<<<<<<
11774  *
11775  * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil:
11776  */
11777   __pyx_r = __pyx_v_i1;
11778   goto __pyx_L0;
11779 
11780   /* "yt/utilities/lib/fp_utils.pxd":13
11781  *
11782  *
11783  * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil:             # <<<<<<<<<<<<<<
11784  *     if i0 > i1: return i0
11785  *     return i1
11786  */
11787 
11788   /* function exit code */
11789   __pyx_L0:;
11790   return __pyx_r;
11791 }
11792 
11793 /* "yt/utilities/lib/fp_utils.pxd":17
11794  *     return i1
11795  *
11796  * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil:             # <<<<<<<<<<<<<<
11797  *     if f0 > f1: return f0
11798  *     return f1
11799  */
11800 
__pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t __pyx_v_f0,__pyx_t_5numpy_float64_t __pyx_v_f1)11801 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) {
11802   __pyx_t_5numpy_float64_t __pyx_r;
11803   int __pyx_t_1;
11804 
11805   /* "yt/utilities/lib/fp_utils.pxd":18
11806  *
11807  * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil:
11808  *     if f0 > f1: return f0             # <<<<<<<<<<<<<<
11809  *     return f1
11810  *
11811  */
11812   __pyx_t_1 = ((__pyx_v_f0 > __pyx_v_f1) != 0);
11813   if (__pyx_t_1) {
11814     __pyx_r = __pyx_v_f0;
11815     goto __pyx_L0;
11816   }
11817 
11818   /* "yt/utilities/lib/fp_utils.pxd":19
11819  * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil:
11820  *     if f0 > f1: return f0
11821  *     return f1             # <<<<<<<<<<<<<<
11822  *
11823  * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil:
11824  */
11825   __pyx_r = __pyx_v_f1;
11826   goto __pyx_L0;
11827 
11828   /* "yt/utilities/lib/fp_utils.pxd":17
11829  *     return i1
11830  *
11831  * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil:             # <<<<<<<<<<<<<<
11832  *     if f0 > f1: return f0
11833  *     return f1
11834  */
11835 
11836   /* function exit code */
11837   __pyx_L0:;
11838   return __pyx_r;
11839 }
11840 
11841 /* "yt/utilities/lib/fp_utils.pxd":21
11842  *     return f1
11843  *
11844  * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil:             # <<<<<<<<<<<<<<
11845  *     if i0 < i1: return i0
11846  *     return i1
11847  */
11848 
__pyx_f_2yt_9utilities_3lib_8fp_utils_imin(__pyx_t_5numpy_int64_t __pyx_v_i0,__pyx_t_5numpy_int64_t __pyx_v_i1)11849 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) {
11850   __pyx_t_5numpy_int64_t __pyx_r;
11851   int __pyx_t_1;
11852 
11853   /* "yt/utilities/lib/fp_utils.pxd":22
11854  *
11855  * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil:
11856  *     if i0 < i1: return i0             # <<<<<<<<<<<<<<
11857  *     return i1
11858  *
11859  */
11860   __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0);
11861   if (__pyx_t_1) {
11862     __pyx_r = __pyx_v_i0;
11863     goto __pyx_L0;
11864   }
11865 
11866   /* "yt/utilities/lib/fp_utils.pxd":23
11867  * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil:
11868  *     if i0 < i1: return i0
11869  *     return i1             # <<<<<<<<<<<<<<
11870  *
11871  * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil:
11872  */
11873   __pyx_r = __pyx_v_i1;
11874   goto __pyx_L0;
11875 
11876   /* "yt/utilities/lib/fp_utils.pxd":21
11877  *     return f1
11878  *
11879  * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil:             # <<<<<<<<<<<<<<
11880  *     if i0 < i1: return i0
11881  *     return i1
11882  */
11883 
11884   /* function exit code */
11885   __pyx_L0:;
11886   return __pyx_r;
11887 }
11888 
11889 /* "yt/utilities/lib/fp_utils.pxd":25
11890  *     return i1
11891  *
11892  * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil:             # <<<<<<<<<<<<<<
11893  *     if f0 < f1: return f0
11894  *     return f1
11895  */
11896 
__pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t __pyx_v_f0,__pyx_t_5numpy_float64_t __pyx_v_f1)11897 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) {
11898   __pyx_t_5numpy_float64_t __pyx_r;
11899   int __pyx_t_1;
11900 
11901   /* "yt/utilities/lib/fp_utils.pxd":26
11902  *
11903  * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil:
11904  *     if f0 < f1: return f0             # <<<<<<<<<<<<<<
11905  *     return f1
11906  *
11907  */
11908   __pyx_t_1 = ((__pyx_v_f0 < __pyx_v_f1) != 0);
11909   if (__pyx_t_1) {
11910     __pyx_r = __pyx_v_f0;
11911     goto __pyx_L0;
11912   }
11913 
11914   /* "yt/utilities/lib/fp_utils.pxd":27
11915  * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil:
11916  *     if f0 < f1: return f0
11917  *     return f1             # <<<<<<<<<<<<<<
11918  *
11919  * cdef inline np.float64_t fabs(np.float64_t f0) nogil:
11920  */
11921   __pyx_r = __pyx_v_f1;
11922   goto __pyx_L0;
11923 
11924   /* "yt/utilities/lib/fp_utils.pxd":25
11925  *     return i1
11926  *
11927  * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil:             # <<<<<<<<<<<<<<
11928  *     if f0 < f1: return f0
11929  *     return f1
11930  */
11931 
11932   /* function exit code */
11933   __pyx_L0:;
11934   return __pyx_r;
11935 }
11936 
11937 /* "yt/utilities/lib/fp_utils.pxd":29
11938  *     return f1
11939  *
11940  * cdef inline np.float64_t fabs(np.float64_t f0) nogil:             # <<<<<<<<<<<<<<
11941  *     if f0 < 0.0: return -f0
11942  *     return f0
11943  */
11944 
__pyx_f_2yt_9utilities_3lib_8fp_utils_fabs(__pyx_t_5numpy_float64_t __pyx_v_f0)11945 static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fabs(__pyx_t_5numpy_float64_t __pyx_v_f0) {
11946   __pyx_t_5numpy_float64_t __pyx_r;
11947   int __pyx_t_1;
11948 
11949   /* "yt/utilities/lib/fp_utils.pxd":30
11950  *
11951  * cdef inline np.float64_t fabs(np.float64_t f0) nogil:
11952  *     if f0 < 0.0: return -f0             # <<<<<<<<<<<<<<
11953  *     return f0
11954  *
11955  */
11956   __pyx_t_1 = ((__pyx_v_f0 < 0.0) != 0);
11957   if (__pyx_t_1) {
11958     __pyx_r = (-__pyx_v_f0);
11959     goto __pyx_L0;
11960   }
11961 
11962   /* "yt/utilities/lib/fp_utils.pxd":31
11963  * cdef inline np.float64_t fabs(np.float64_t f0) nogil:
11964  *     if f0 < 0.0: return -f0
11965  *     return f0             # <<<<<<<<<<<<<<
11966  *
11967  * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:
11968  */
11969   __pyx_r = __pyx_v_f0;
11970   goto __pyx_L0;
11971 
11972   /* "yt/utilities/lib/fp_utils.pxd":29
11973  *     return f1
11974  *
11975  * cdef inline np.float64_t fabs(np.float64_t f0) nogil:             # <<<<<<<<<<<<<<
11976  *     if f0 < 0.0: return -f0
11977  *     return f0
11978  */
11979 
11980   /* function exit code */
11981   __pyx_L0:;
11982   return __pyx_r;
11983 }
11984 
11985 /* "yt/utilities/lib/fp_utils.pxd":33
11986  *     return f0
11987  *
11988  * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:             # <<<<<<<<<<<<<<
11989  *     if i < a: return a
11990  *     if i > b: return b
11991  */
11992 
__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)11993 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) {
11994   __pyx_t_5numpy_int64_t __pyx_r;
11995   int __pyx_t_1;
11996 
11997   /* "yt/utilities/lib/fp_utils.pxd":34
11998  *
11999  * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:
12000  *     if i < a: return a             # <<<<<<<<<<<<<<
12001  *     if i > b: return b
12002  *     return i
12003  */
12004   __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0);
12005   if (__pyx_t_1) {
12006     __pyx_r = __pyx_v_a;
12007     goto __pyx_L0;
12008   }
12009 
12010   /* "yt/utilities/lib/fp_utils.pxd":35
12011  * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:
12012  *     if i < a: return a
12013  *     if i > b: return b             # <<<<<<<<<<<<<<
12014  *     return i
12015  *
12016  */
12017   __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0);
12018   if (__pyx_t_1) {
12019     __pyx_r = __pyx_v_b;
12020     goto __pyx_L0;
12021   }
12022 
12023   /* "yt/utilities/lib/fp_utils.pxd":36
12024  *     if i < a: return a
12025  *     if i > b: return b
12026  *     return i             # <<<<<<<<<<<<<<
12027  *
12028  * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:
12029  */
12030   __pyx_r = __pyx_v_i;
12031   goto __pyx_L0;
12032 
12033   /* "yt/utilities/lib/fp_utils.pxd":33
12034  *     return f0
12035  *
12036  * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:             # <<<<<<<<<<<<<<
12037  *     if i < a: return a
12038  *     if i > b: return b
12039  */
12040 
12041   /* function exit code */
12042   __pyx_L0:;
12043   return __pyx_r;
12044 }
12045 
12046 /* "yt/utilities/lib/fp_utils.pxd":38
12047  *     return i
12048  *
12049  * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:             # <<<<<<<<<<<<<<
12050  *     if i < a: return a
12051  *     if i > b: return b
12052  */
12053 
__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)12054 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) {
12055   __pyx_t_5numpy_int64_t __pyx_r;
12056   int __pyx_t_1;
12057 
12058   /* "yt/utilities/lib/fp_utils.pxd":39
12059  *
12060  * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:
12061  *     if i < a: return a             # <<<<<<<<<<<<<<
12062  *     if i > b: return b
12063  *     return i
12064  */
12065   __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0);
12066   if (__pyx_t_1) {
12067     __pyx_r = __pyx_v_a;
12068     goto __pyx_L0;
12069   }
12070 
12071   /* "yt/utilities/lib/fp_utils.pxd":40
12072  * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:
12073  *     if i < a: return a
12074  *     if i > b: return b             # <<<<<<<<<<<<<<
12075  *     return i
12076  *
12077  */
12078   __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0);
12079   if (__pyx_t_1) {
12080     __pyx_r = __pyx_v_b;
12081     goto __pyx_L0;
12082   }
12083 
12084   /* "yt/utilities/lib/fp_utils.pxd":41
12085  *     if i < a: return a
12086  *     if i > b: return b
12087  *     return i             # <<<<<<<<<<<<<<
12088  *
12089  * cdef inline np.float64_t fclip(np.float64_t f,
12090  */
12091   __pyx_r = __pyx_v_i;
12092   goto __pyx_L0;
12093 
12094   /* "yt/utilities/lib/fp_utils.pxd":38
12095  *     return i
12096  *
12097  * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:             # <<<<<<<<<<<<<<
12098  *     if i < a: return a
12099  *     if i > b: return b
12100  */
12101 
12102   /* function exit code */
12103   __pyx_L0:;
12104   return __pyx_r;
12105 }
12106 
12107 /* "yt/utilities/lib/fp_utils.pxd":43
12108  *     return i
12109  *
12110  * cdef inline np.float64_t fclip(np.float64_t f,             # <<<<<<<<<<<<<<
12111  *                       np.float64_t a, np.float64_t b) nogil:
12112  *     return fmin(fmax(f, a), b)
12113  */
12114 
__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)12115 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) {
12116   __pyx_t_5numpy_float64_t __pyx_r;
12117 
12118   /* "yt/utilities/lib/fp_utils.pxd":45
12119  * cdef inline np.float64_t fclip(np.float64_t f,
12120  *                       np.float64_t a, np.float64_t b) nogil:
12121  *     return fmin(fmax(f, a), b)             # <<<<<<<<<<<<<<
12122  *
12123  * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil:
12124  */
12125   __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);
12126   goto __pyx_L0;
12127 
12128   /* "yt/utilities/lib/fp_utils.pxd":43
12129  *     return i
12130  *
12131  * cdef inline np.float64_t fclip(np.float64_t f,             # <<<<<<<<<<<<<<
12132  *                       np.float64_t a, np.float64_t b) nogil:
12133  *     return fmin(fmax(f, a), b)
12134  */
12135 
12136   /* function exit code */
12137   __pyx_L0:;
12138   return __pyx_r;
12139 }
12140 
12141 /* "yt/utilities/lib/fp_utils.pxd":47
12142  *     return fmin(fmax(f, a), b)
12143  *
12144  * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil:             # <<<<<<<<<<<<<<
12145  *     if i0 > i1: return i0
12146  *     return i1
12147  */
12148 
__pyx_f_2yt_9utilities_3lib_8fp_utils_i64max(__pyx_t_5numpy_int64_t __pyx_v_i0,__pyx_t_5numpy_int64_t __pyx_v_i1)12149 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) {
12150   __pyx_t_5numpy_int64_t __pyx_r;
12151   int __pyx_t_1;
12152 
12153   /* "yt/utilities/lib/fp_utils.pxd":48
12154  *
12155  * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil:
12156  *     if i0 > i1: return i0             # <<<<<<<<<<<<<<
12157  *     return i1
12158  *
12159  */
12160   __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0);
12161   if (__pyx_t_1) {
12162     __pyx_r = __pyx_v_i0;
12163     goto __pyx_L0;
12164   }
12165 
12166   /* "yt/utilities/lib/fp_utils.pxd":49
12167  * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil:
12168  *     if i0 > i1: return i0
12169  *     return i1             # <<<<<<<<<<<<<<
12170  *
12171  * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil:
12172  */
12173   __pyx_r = __pyx_v_i1;
12174   goto __pyx_L0;
12175 
12176   /* "yt/utilities/lib/fp_utils.pxd":47
12177  *     return fmin(fmax(f, a), b)
12178  *
12179  * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil:             # <<<<<<<<<<<<<<
12180  *     if i0 > i1: return i0
12181  *     return i1
12182  */
12183 
12184   /* function exit code */
12185   __pyx_L0:;
12186   return __pyx_r;
12187 }
12188 
12189 /* "yt/utilities/lib/fp_utils.pxd":51
12190  *     return i1
12191  *
12192  * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil:             # <<<<<<<<<<<<<<
12193  *     if i0 < i1: return i0
12194  *     return i1
12195  */
12196 
__pyx_f_2yt_9utilities_3lib_8fp_utils_i64min(__pyx_t_5numpy_int64_t __pyx_v_i0,__pyx_t_5numpy_int64_t __pyx_v_i1)12197 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) {
12198   __pyx_t_5numpy_int64_t __pyx_r;
12199   int __pyx_t_1;
12200 
12201   /* "yt/utilities/lib/fp_utils.pxd":52
12202  *
12203  * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil:
12204  *     if i0 < i1: return i0             # <<<<<<<<<<<<<<
12205  *     return i1
12206  *
12207  */
12208   __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0);
12209   if (__pyx_t_1) {
12210     __pyx_r = __pyx_v_i0;
12211     goto __pyx_L0;
12212   }
12213 
12214   /* "yt/utilities/lib/fp_utils.pxd":53
12215  * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil:
12216  *     if i0 < i1: return i0
12217  *     return i1             # <<<<<<<<<<<<<<
12218  *
12219  * cdef inline _ensure_code(arr):
12220  */
12221   __pyx_r = __pyx_v_i1;
12222   goto __pyx_L0;
12223 
12224   /* "yt/utilities/lib/fp_utils.pxd":51
12225  *     return i1
12226  *
12227  * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil:             # <<<<<<<<<<<<<<
12228  *     if i0 < i1: return i0
12229  *     return i1
12230  */
12231 
12232   /* function exit code */
12233   __pyx_L0:;
12234   return __pyx_r;
12235 }
12236 
12237 /* "yt/utilities/lib/fp_utils.pxd":55
12238  *     return i1
12239  *
12240  * cdef inline _ensure_code(arr):             # <<<<<<<<<<<<<<
12241  *     if hasattr(arr, "units"):
12242  *         if "code_length" == str(arr.units):
12243  */
12244 
__pyx_f_2yt_9utilities_3lib_8fp_utils__ensure_code(PyObject * __pyx_v_arr)12245 static CYTHON_INLINE PyObject *__pyx_f_2yt_9utilities_3lib_8fp_utils__ensure_code(PyObject *__pyx_v_arr) {
12246   PyObject *__pyx_r = NULL;
12247   __Pyx_RefNannyDeclarations
12248   int __pyx_t_1;
12249   int __pyx_t_2;
12250   PyObject *__pyx_t_3 = NULL;
12251   PyObject *__pyx_t_4 = NULL;
12252   PyObject *__pyx_t_5 = NULL;
12253   __Pyx_RefNannySetupContext("_ensure_code", 0);
12254 
12255   /* "yt/utilities/lib/fp_utils.pxd":56
12256  *
12257  * cdef inline _ensure_code(arr):
12258  *     if hasattr(arr, "units"):             # <<<<<<<<<<<<<<
12259  *         if "code_length" == str(arr.units):
12260  *             return arr
12261  */
12262   __pyx_t_1 = __Pyx_HasAttr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 56, __pyx_L1_error)
12263   __pyx_t_2 = (__pyx_t_1 != 0);
12264   if (__pyx_t_2) {
12265 
12266     /* "yt/utilities/lib/fp_utils.pxd":57
12267  * cdef inline _ensure_code(arr):
12268  *     if hasattr(arr, "units"):
12269  *         if "code_length" == str(arr.units):             # <<<<<<<<<<<<<<
12270  *             return arr
12271  *         arr.convert_to_units("code_length")
12272  */
12273     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 57, __pyx_L1_error)
12274     __Pyx_GOTREF(__pyx_t_3);
12275     __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 57, __pyx_L1_error)
12276     __Pyx_GOTREF(__pyx_t_4);
12277     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12278     __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_n_s_code_length, __pyx_t_4, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(4, 57, __pyx_L1_error)
12279     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12280     if (__pyx_t_2) {
12281 
12282       /* "yt/utilities/lib/fp_utils.pxd":58
12283  *     if hasattr(arr, "units"):
12284  *         if "code_length" == str(arr.units):
12285  *             return arr             # <<<<<<<<<<<<<<
12286  *         arr.convert_to_units("code_length")
12287  *     return arr
12288  */
12289       __Pyx_XDECREF(__pyx_r);
12290       __Pyx_INCREF(__pyx_v_arr);
12291       __pyx_r = __pyx_v_arr;
12292       goto __pyx_L0;
12293 
12294       /* "yt/utilities/lib/fp_utils.pxd":57
12295  * cdef inline _ensure_code(arr):
12296  *     if hasattr(arr, "units"):
12297  *         if "code_length" == str(arr.units):             # <<<<<<<<<<<<<<
12298  *             return arr
12299  *         arr.convert_to_units("code_length")
12300  */
12301     }
12302 
12303     /* "yt/utilities/lib/fp_utils.pxd":59
12304  *         if "code_length" == str(arr.units):
12305  *             return arr
12306  *         arr.convert_to_units("code_length")             # <<<<<<<<<<<<<<
12307  *     return arr
12308  */
12309     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_convert_to_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 59, __pyx_L1_error)
12310     __Pyx_GOTREF(__pyx_t_3);
12311     __pyx_t_5 = NULL;
12312     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
12313       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
12314       if (likely(__pyx_t_5)) {
12315         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
12316         __Pyx_INCREF(__pyx_t_5);
12317         __Pyx_INCREF(function);
12318         __Pyx_DECREF_SET(__pyx_t_3, function);
12319       }
12320     }
12321     __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);
12322     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12323     if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 59, __pyx_L1_error)
12324     __Pyx_GOTREF(__pyx_t_4);
12325     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12326     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12327 
12328     /* "yt/utilities/lib/fp_utils.pxd":56
12329  *
12330  * cdef inline _ensure_code(arr):
12331  *     if hasattr(arr, "units"):             # <<<<<<<<<<<<<<
12332  *         if "code_length" == str(arr.units):
12333  *             return arr
12334  */
12335   }
12336 
12337   /* "yt/utilities/lib/fp_utils.pxd":60
12338  *             return arr
12339  *         arr.convert_to_units("code_length")
12340  *     return arr             # <<<<<<<<<<<<<<
12341  */
12342   __Pyx_XDECREF(__pyx_r);
12343   __Pyx_INCREF(__pyx_v_arr);
12344   __pyx_r = __pyx_v_arr;
12345   goto __pyx_L0;
12346 
12347   /* "yt/utilities/lib/fp_utils.pxd":55
12348  *     return i1
12349  *
12350  * cdef inline _ensure_code(arr):             # <<<<<<<<<<<<<<
12351  *     if hasattr(arr, "units"):
12352  *         if "code_length" == str(arr.units):
12353  */
12354 
12355   /* function exit code */
12356   __pyx_L1_error:;
12357   __Pyx_XDECREF(__pyx_t_3);
12358   __Pyx_XDECREF(__pyx_t_4);
12359   __Pyx_XDECREF(__pyx_t_5);
12360   __Pyx_AddTraceback("yt.utilities.lib.fp_utils._ensure_code", __pyx_clineno, __pyx_lineno, __pyx_filename);
12361   __pyx_r = 0;
12362   __pyx_L0:;
12363   __Pyx_XGIVEREF(__pyx_r);
12364   __Pyx_RefNannyFinishContext();
12365   return __pyx_r;
12366 }
12367 
12368 /* "oct_container.pxd":48
12369  *
12370  * cdef class OctObjectPool(ObjectPool):
12371  *     cdef inline OctAllocationContainer *get_cont(self, int i):             # <<<<<<<<<<<<<<
12372  *         return <OctAllocationContainer*> (&self.containers[i])
12373  *
12374  */
12375 
__pyx_f_2yt_8geometry_13oct_container_13OctObjectPool_get_cont(struct __pyx_obj_2yt_8geometry_13oct_container_OctObjectPool * __pyx_v_self,int __pyx_v_i)12376 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) {
12377   struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *__pyx_r;
12378   __Pyx_RefNannyDeclarations
12379   __Pyx_RefNannySetupContext("get_cont", 0);
12380 
12381   /* "oct_container.pxd":49
12382  * cdef class OctObjectPool(ObjectPool):
12383  *     cdef inline OctAllocationContainer *get_cont(self, int i):
12384  *         return <OctAllocationContainer*> (&self.containers[i])             # <<<<<<<<<<<<<<
12385  *
12386  * cdef OctList *OctList_append(OctList *list, Oct *o)
12387  */
12388   __pyx_r = ((struct __pyx_t_2yt_8geometry_13oct_container_OctAllocationContainer *)(&(__pyx_v_self->__pyx_base.containers[__pyx_v_i])));
12389   goto __pyx_L0;
12390 
12391   /* "oct_container.pxd":48
12392  *
12393  * cdef class OctObjectPool(ObjectPool):
12394  *     cdef inline OctAllocationContainer *get_cont(self, int i):             # <<<<<<<<<<<<<<
12395  *         return <OctAllocationContainer*> (&self.containers[i])
12396  *
12397  */
12398 
12399   /* function exit code */
12400   __pyx_L0:;
12401   __Pyx_RefNannyFinishContext();
12402   return __pyx_r;
12403 }
12404 
12405 /* "yt/utilities/lib/geometry_utils.pxd":24
12406  * @cython.boundscheck(False)
12407  * @cython.wraparound(False)
12408  * cdef inline np.int64_t ifrexp(np.float64_t x, np.int64_t *e):             # <<<<<<<<<<<<<<
12409  *     cdef np.float64_t m
12410  *     cdef int e0 = 0
12411  */
12412 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_ifrexp(__pyx_t_5numpy_float64_t __pyx_v_x,__pyx_t_5numpy_int64_t * __pyx_v_e)12413 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) {
12414   __pyx_t_5numpy_float64_t __pyx_v_m;
12415   int __pyx_v_e0;
12416   __pyx_t_5numpy_int64_t __pyx_r;
12417   __Pyx_RefNannyDeclarations
12418   __Pyx_RefNannySetupContext("ifrexp", 0);
12419 
12420   /* "yt/utilities/lib/geometry_utils.pxd":26
12421  * cdef inline np.int64_t ifrexp(np.float64_t x, np.int64_t *e):
12422  *     cdef np.float64_t m
12423  *     cdef int e0 = 0             # <<<<<<<<<<<<<<
12424  *     m = frexp(x,&e0)
12425  *     e[0] = <np.int64_t>e0
12426  */
12427   __pyx_v_e0 = 0;
12428 
12429   /* "yt/utilities/lib/geometry_utils.pxd":27
12430  *     cdef np.float64_t m
12431  *     cdef int e0 = 0
12432  *     m = frexp(x,&e0)             # <<<<<<<<<<<<<<
12433  *     e[0] = <np.int64_t>e0
12434  *     return <np.int64_t>ldexp(m,<int>DBL_MANT_DIG)
12435  */
12436   __pyx_v_m = frexp(__pyx_v_x, (&__pyx_v_e0));
12437 
12438   /* "yt/utilities/lib/geometry_utils.pxd":28
12439  *     cdef int e0 = 0
12440  *     m = frexp(x,&e0)
12441  *     e[0] = <np.int64_t>e0             # <<<<<<<<<<<<<<
12442  *     return <np.int64_t>ldexp(m,<int>DBL_MANT_DIG)
12443  *
12444  */
12445   (__pyx_v_e[0]) = ((__pyx_t_5numpy_int64_t)__pyx_v_e0);
12446 
12447   /* "yt/utilities/lib/geometry_utils.pxd":29
12448  *     m = frexp(x,&e0)
12449  *     e[0] = <np.int64_t>e0
12450  *     return <np.int64_t>ldexp(m,<int>DBL_MANT_DIG)             # <<<<<<<<<<<<<<
12451  *
12452  * @cython.cdivision(True)
12453  */
12454   __pyx_r = ((__pyx_t_5numpy_int64_t)ldexp(__pyx_v_m, ((int)DBL_MANT_DIG)));
12455   goto __pyx_L0;
12456 
12457   /* "yt/utilities/lib/geometry_utils.pxd":24
12458  * @cython.boundscheck(False)
12459  * @cython.wraparound(False)
12460  * cdef inline np.int64_t ifrexp(np.float64_t x, np.int64_t *e):             # <<<<<<<<<<<<<<
12461  *     cdef np.float64_t m
12462  *     cdef int e0 = 0
12463  */
12464 
12465   /* function exit code */
12466   __pyx_L0:;
12467   __Pyx_RefNannyFinishContext();
12468   return __pyx_r;
12469 }
12470 
12471 /* "yt/utilities/lib/geometry_utils.pxd":34
12472  * @cython.boundscheck(False)
12473  * @cython.wraparound(False)
12474  * cdef inline np.int64_t msdb(np.int64_t a, np.int64_t b):             # <<<<<<<<<<<<<<
12475  *     """Get the most significant differing bit between a and b."""
12476  *     cdef np.int64_t c, ndx
12477  */
12478 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_msdb(__pyx_t_5numpy_int64_t __pyx_v_a,__pyx_t_5numpy_int64_t __pyx_v_b)12479 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) {
12480   __pyx_t_5numpy_int64_t __pyx_v_c;
12481   __pyx_t_5numpy_int64_t __pyx_v_ndx;
12482   __pyx_t_5numpy_int64_t __pyx_r;
12483   __Pyx_RefNannyDeclarations
12484   int __pyx_t_1;
12485   __Pyx_RefNannySetupContext("msdb", 0);
12486 
12487   /* "yt/utilities/lib/geometry_utils.pxd":37
12488  *     """Get the most significant differing bit between a and b."""
12489  *     cdef np.int64_t c, ndx
12490  *     c = a ^ b             # <<<<<<<<<<<<<<
12491  *     ndx = 0
12492  *     while (0 < c):
12493  */
12494   __pyx_v_c = (__pyx_v_a ^ __pyx_v_b);
12495 
12496   /* "yt/utilities/lib/geometry_utils.pxd":38
12497  *     cdef np.int64_t c, ndx
12498  *     c = a ^ b
12499  *     ndx = 0             # <<<<<<<<<<<<<<
12500  *     while (0 < c):
12501  *         c = (c >> 1)
12502  */
12503   __pyx_v_ndx = 0;
12504 
12505   /* "yt/utilities/lib/geometry_utils.pxd":39
12506  *     c = a ^ b
12507  *     ndx = 0
12508  *     while (0 < c):             # <<<<<<<<<<<<<<
12509  *         c = (c >> 1)
12510  *         ndx+=1
12511  */
12512   while (1) {
12513     __pyx_t_1 = ((0 < __pyx_v_c) != 0);
12514     if (!__pyx_t_1) break;
12515 
12516     /* "yt/utilities/lib/geometry_utils.pxd":40
12517  *     ndx = 0
12518  *     while (0 < c):
12519  *         c = (c >> 1)             # <<<<<<<<<<<<<<
12520  *         ndx+=1
12521  *     return ndx
12522  */
12523     __pyx_v_c = (__pyx_v_c >> 1);
12524 
12525     /* "yt/utilities/lib/geometry_utils.pxd":41
12526  *     while (0 < c):
12527  *         c = (c >> 1)
12528  *         ndx+=1             # <<<<<<<<<<<<<<
12529  *     return ndx
12530  *
12531  */
12532     __pyx_v_ndx = (__pyx_v_ndx + 1);
12533   }
12534 
12535   /* "yt/utilities/lib/geometry_utils.pxd":42
12536  *         c = (c >> 1)
12537  *         ndx+=1
12538  *     return ndx             # <<<<<<<<<<<<<<
12539  *
12540  * @cython.cdivision(True)
12541  */
12542   __pyx_r = __pyx_v_ndx;
12543   goto __pyx_L0;
12544 
12545   /* "yt/utilities/lib/geometry_utils.pxd":34
12546  * @cython.boundscheck(False)
12547  * @cython.wraparound(False)
12548  * cdef inline np.int64_t msdb(np.int64_t a, np.int64_t b):             # <<<<<<<<<<<<<<
12549  *     """Get the most significant differing bit between a and b."""
12550  *     cdef np.int64_t c, ndx
12551  */
12552 
12553   /* function exit code */
12554   __pyx_L0:;
12555   __Pyx_RefNannyFinishContext();
12556   return __pyx_r;
12557 }
12558 
12559 /* "yt/utilities/lib/geometry_utils.pxd":47
12560  * @cython.boundscheck(False)
12561  * @cython.wraparound(False)
12562  * cdef inline np.int64_t xor_msb(np.float64_t a, np.float64_t b):             # <<<<<<<<<<<<<<
12563  *     """Get the exponent of the highest differing bit between a and b"""
12564  *     # Get mantissa and exponents for each number
12565  */
12566 
__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)12567 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) {
12568   __pyx_t_5numpy_int64_t __pyx_v_a_m;
12569   __pyx_t_5numpy_int64_t __pyx_v_a_e;
12570   __pyx_t_5numpy_int64_t __pyx_v_b_m;
12571   __pyx_t_5numpy_int64_t __pyx_v_b_e;
12572   __pyx_t_5numpy_int64_t __pyx_v_x;
12573   __pyx_t_5numpy_int64_t __pyx_v_y;
12574   __pyx_t_5numpy_int64_t __pyx_v_z;
12575   __pyx_t_5numpy_int64_t __pyx_r;
12576   __Pyx_RefNannyDeclarations
12577   int __pyx_t_1;
12578   __Pyx_RefNannySetupContext("xor_msb", 0);
12579 
12580   /* "yt/utilities/lib/geometry_utils.pxd":51
12581  *     # Get mantissa and exponents for each number
12582  *     cdef np.int64_t a_m, a_e, b_m, b_e, x, y, z
12583  *     b_e = 0             # <<<<<<<<<<<<<<
12584  *     a_e = 0
12585  *     a_m = ifrexp(a,&a_e)
12586  */
12587   __pyx_v_b_e = 0;
12588 
12589   /* "yt/utilities/lib/geometry_utils.pxd":52
12590  *     cdef np.int64_t a_m, a_e, b_m, b_e, x, y, z
12591  *     b_e = 0
12592  *     a_e = 0             # <<<<<<<<<<<<<<
12593  *     a_m = ifrexp(a,&a_e)
12594  *     b_m = ifrexp(b,&b_e)
12595  */
12596   __pyx_v_a_e = 0;
12597 
12598   /* "yt/utilities/lib/geometry_utils.pxd":53
12599  *     b_e = 0
12600  *     a_e = 0
12601  *     a_m = ifrexp(a,&a_e)             # <<<<<<<<<<<<<<
12602  *     b_m = ifrexp(b,&b_e)
12603  *     x = <np.int64_t> ((a_e+1)*DBL_MANT_DIG)
12604  */
12605   __pyx_v_a_m = __pyx_f_2yt_9utilities_3lib_14geometry_utils_ifrexp(__pyx_v_a, (&__pyx_v_a_e));
12606 
12607   /* "yt/utilities/lib/geometry_utils.pxd":54
12608  *     a_e = 0
12609  *     a_m = ifrexp(a,&a_e)
12610  *     b_m = ifrexp(b,&b_e)             # <<<<<<<<<<<<<<
12611  *     x = <np.int64_t> ((a_e+1)*DBL_MANT_DIG)
12612  *     y = <np.int64_t> ((b_e+1)*DBL_MANT_DIG)
12613  */
12614   __pyx_v_b_m = __pyx_f_2yt_9utilities_3lib_14geometry_utils_ifrexp(__pyx_v_b, (&__pyx_v_b_e));
12615 
12616   /* "yt/utilities/lib/geometry_utils.pxd":55
12617  *     a_m = ifrexp(a,&a_e)
12618  *     b_m = ifrexp(b,&b_e)
12619  *     x = <np.int64_t> ((a_e+1)*DBL_MANT_DIG)             # <<<<<<<<<<<<<<
12620  *     y = <np.int64_t> ((b_e+1)*DBL_MANT_DIG)
12621  *     # Compare mantissa if exponents equal
12622  */
12623   __pyx_v_x = ((__pyx_t_5numpy_int64_t)((__pyx_v_a_e + 1) * DBL_MANT_DIG));
12624 
12625   /* "yt/utilities/lib/geometry_utils.pxd":56
12626  *     b_m = ifrexp(b,&b_e)
12627  *     x = <np.int64_t> ((a_e+1)*DBL_MANT_DIG)
12628  *     y = <np.int64_t> ((b_e+1)*DBL_MANT_DIG)             # <<<<<<<<<<<<<<
12629  *     # Compare mantissa if exponents equal
12630  *     if x == y:
12631  */
12632   __pyx_v_y = ((__pyx_t_5numpy_int64_t)((__pyx_v_b_e + 1) * DBL_MANT_DIG));
12633 
12634   /* "yt/utilities/lib/geometry_utils.pxd":58
12635  *     y = <np.int64_t> ((b_e+1)*DBL_MANT_DIG)
12636  *     # Compare mantissa if exponents equal
12637  *     if x == y:             # <<<<<<<<<<<<<<
12638  *         if a_m == b_m: return 0
12639  *         z = msdb(a_m,b_m)
12640  */
12641   __pyx_t_1 = ((__pyx_v_x == __pyx_v_y) != 0);
12642   if (__pyx_t_1) {
12643 
12644     /* "yt/utilities/lib/geometry_utils.pxd":59
12645  *     # Compare mantissa if exponents equal
12646  *     if x == y:
12647  *         if a_m == b_m: return 0             # <<<<<<<<<<<<<<
12648  *         z = msdb(a_m,b_m)
12649  *         #if 1: return z
12650  */
12651     __pyx_t_1 = ((__pyx_v_a_m == __pyx_v_b_m) != 0);
12652     if (__pyx_t_1) {
12653       __pyx_r = 0;
12654       goto __pyx_L0;
12655     }
12656 
12657     /* "yt/utilities/lib/geometry_utils.pxd":60
12658  *     if x == y:
12659  *         if a_m == b_m: return 0
12660  *         z = msdb(a_m,b_m)             # <<<<<<<<<<<<<<
12661  *         #if 1: return z
12662  *         x = x - z
12663  */
12664     __pyx_v_z = __pyx_f_2yt_9utilities_3lib_14geometry_utils_msdb(__pyx_v_a_m, __pyx_v_b_m);
12665 
12666     /* "yt/utilities/lib/geometry_utils.pxd":62
12667  *         z = msdb(a_m,b_m)
12668  *         #if 1: return z
12669  *         x = x - z             # <<<<<<<<<<<<<<
12670  *         return x-1 # required so that xor_msb(0.0,1.0)!=xor_msb(1.0,1.0)
12671  *     # Otherwise return largest exponent
12672  */
12673     __pyx_v_x = (__pyx_v_x - __pyx_v_z);
12674 
12675     /* "yt/utilities/lib/geometry_utils.pxd":63
12676  *         #if 1: return z
12677  *         x = x - z
12678  *         return x-1 # required so that xor_msb(0.0,1.0)!=xor_msb(1.0,1.0)             # <<<<<<<<<<<<<<
12679  *     # Otherwise return largest exponent
12680  *     if y < x:
12681  */
12682     __pyx_r = (__pyx_v_x - 1);
12683     goto __pyx_L0;
12684 
12685     /* "yt/utilities/lib/geometry_utils.pxd":58
12686  *     y = <np.int64_t> ((b_e+1)*DBL_MANT_DIG)
12687  *     # Compare mantissa if exponents equal
12688  *     if x == y:             # <<<<<<<<<<<<<<
12689  *         if a_m == b_m: return 0
12690  *         z = msdb(a_m,b_m)
12691  */
12692   }
12693 
12694   /* "yt/utilities/lib/geometry_utils.pxd":65
12695  *         return x-1 # required so that xor_msb(0.0,1.0)!=xor_msb(1.0,1.0)
12696  *     # Otherwise return largest exponent
12697  *     if y < x:             # <<<<<<<<<<<<<<
12698  *         return x
12699  *     else:
12700  */
12701   __pyx_t_1 = ((__pyx_v_y < __pyx_v_x) != 0);
12702   if (__pyx_t_1) {
12703 
12704     /* "yt/utilities/lib/geometry_utils.pxd":66
12705  *     # Otherwise return largest exponent
12706  *     if y < x:
12707  *         return x             # <<<<<<<<<<<<<<
12708  *     else:
12709  *         return y
12710  */
12711     __pyx_r = __pyx_v_x;
12712     goto __pyx_L0;
12713 
12714     /* "yt/utilities/lib/geometry_utils.pxd":65
12715  *         return x-1 # required so that xor_msb(0.0,1.0)!=xor_msb(1.0,1.0)
12716  *     # Otherwise return largest exponent
12717  *     if y < x:             # <<<<<<<<<<<<<<
12718  *         return x
12719  *     else:
12720  */
12721   }
12722 
12723   /* "yt/utilities/lib/geometry_utils.pxd":68
12724  *         return x
12725  *     else:
12726  *         return y             # <<<<<<<<<<<<<<
12727  *
12728  * @cython.cdivision(True)
12729  */
12730   /*else*/ {
12731     __pyx_r = __pyx_v_y;
12732     goto __pyx_L0;
12733   }
12734 
12735   /* "yt/utilities/lib/geometry_utils.pxd":47
12736  * @cython.boundscheck(False)
12737  * @cython.wraparound(False)
12738  * cdef inline np.int64_t xor_msb(np.float64_t a, np.float64_t b):             # <<<<<<<<<<<<<<
12739  *     """Get the exponent of the highest differing bit between a and b"""
12740  *     # Get mantissa and exponents for each number
12741  */
12742 
12743   /* function exit code */
12744   __pyx_L0:;
12745   __Pyx_RefNannyFinishContext();
12746   return __pyx_r;
12747 }
12748 
12749 /* "yt/utilities/lib/geometry_utils.pxd":73
12750  * @cython.boundscheck(False)
12751  * @cython.wraparound(False)
12752  * cdef inline int compare_floats_morton(np.float64_t p[3], np.float64_t q[3]):             # <<<<<<<<<<<<<<
12753  *     cdef int j, out, dim
12754  *     cdef np.int64_t x, y
12755  */
12756 
__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)12757 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) {
12758   int __pyx_v_j;
12759   int __pyx_v_out;
12760   int __pyx_v_dim;
12761   __pyx_t_5numpy_int64_t __pyx_v_x;
12762   __pyx_t_5numpy_int64_t __pyx_v_y;
12763   int __pyx_r;
12764   __Pyx_RefNannyDeclarations
12765   int __pyx_t_1;
12766   int __pyx_t_2;
12767   __Pyx_RefNannySetupContext("compare_floats_morton", 0);
12768 
12769   /* "yt/utilities/lib/geometry_utils.pxd":76
12770  *     cdef int j, out, dim
12771  *     cdef np.int64_t x, y
12772  *     x = -9999999999             # <<<<<<<<<<<<<<
12773  *     y = 0
12774  *     dim = 0
12775  */
12776   __pyx_v_x = -9999999999LL;
12777 
12778   /* "yt/utilities/lib/geometry_utils.pxd":77
12779  *     cdef np.int64_t x, y
12780  *     x = -9999999999
12781  *     y = 0             # <<<<<<<<<<<<<<
12782  *     dim = 0
12783  *     for j in range(3):#[::-1]:
12784  */
12785   __pyx_v_y = 0;
12786 
12787   /* "yt/utilities/lib/geometry_utils.pxd":78
12788  *     x = -9999999999
12789  *     y = 0
12790  *     dim = 0             # <<<<<<<<<<<<<<
12791  *     for j in range(3):#[::-1]:
12792  *         y = xor_msb(p[j],q[j])
12793  */
12794   __pyx_v_dim = 0;
12795 
12796   /* "yt/utilities/lib/geometry_utils.pxd":79
12797  *     y = 0
12798  *     dim = 0
12799  *     for j in range(3):#[::-1]:             # <<<<<<<<<<<<<<
12800  *         y = xor_msb(p[j],q[j])
12801  *         if x < y:
12802  */
12803   for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
12804     __pyx_v_j = __pyx_t_1;
12805 
12806     /* "yt/utilities/lib/geometry_utils.pxd":80
12807  *     dim = 0
12808  *     for j in range(3):#[::-1]:
12809  *         y = xor_msb(p[j],q[j])             # <<<<<<<<<<<<<<
12810  *         if x < y:
12811  *            x = y
12812  */
12813     __pyx_v_y = __pyx_f_2yt_9utilities_3lib_14geometry_utils_xor_msb((__pyx_v_p[__pyx_v_j]), (__pyx_v_q[__pyx_v_j]));
12814 
12815     /* "yt/utilities/lib/geometry_utils.pxd":81
12816  *     for j in range(3):#[::-1]:
12817  *         y = xor_msb(p[j],q[j])
12818  *         if x < y:             # <<<<<<<<<<<<<<
12819  *            x = y
12820  *            dim = j
12821  */
12822     __pyx_t_2 = ((__pyx_v_x < __pyx_v_y) != 0);
12823     if (__pyx_t_2) {
12824 
12825       /* "yt/utilities/lib/geometry_utils.pxd":82
12826  *         y = xor_msb(p[j],q[j])
12827  *         if x < y:
12828  *            x = y             # <<<<<<<<<<<<<<
12829  *            dim = j
12830  *     if p[dim] < q[dim]:
12831  */
12832       __pyx_v_x = __pyx_v_y;
12833 
12834       /* "yt/utilities/lib/geometry_utils.pxd":83
12835  *         if x < y:
12836  *            x = y
12837  *            dim = j             # <<<<<<<<<<<<<<
12838  *     if p[dim] < q[dim]:
12839  *         out = 1
12840  */
12841       __pyx_v_dim = __pyx_v_j;
12842 
12843       /* "yt/utilities/lib/geometry_utils.pxd":81
12844  *     for j in range(3):#[::-1]:
12845  *         y = xor_msb(p[j],q[j])
12846  *         if x < y:             # <<<<<<<<<<<<<<
12847  *            x = y
12848  *            dim = j
12849  */
12850     }
12851   }
12852 
12853   /* "yt/utilities/lib/geometry_utils.pxd":84
12854  *            x = y
12855  *            dim = j
12856  *     if p[dim] < q[dim]:             # <<<<<<<<<<<<<<
12857  *         out = 1
12858  *     else:
12859  */
12860   __pyx_t_2 = (((__pyx_v_p[__pyx_v_dim]) < (__pyx_v_q[__pyx_v_dim])) != 0);
12861   if (__pyx_t_2) {
12862 
12863     /* "yt/utilities/lib/geometry_utils.pxd":85
12864  *            dim = j
12865  *     if p[dim] < q[dim]:
12866  *         out = 1             # <<<<<<<<<<<<<<
12867  *     else:
12868  *         out = 0
12869  */
12870     __pyx_v_out = 1;
12871 
12872     /* "yt/utilities/lib/geometry_utils.pxd":84
12873  *            x = y
12874  *            dim = j
12875  *     if p[dim] < q[dim]:             # <<<<<<<<<<<<<<
12876  *         out = 1
12877  *     else:
12878  */
12879     goto __pyx_L6;
12880   }
12881 
12882   /* "yt/utilities/lib/geometry_utils.pxd":87
12883  *         out = 1
12884  *     else:
12885  *         out = 0             # <<<<<<<<<<<<<<
12886  *     return out
12887  *
12888  */
12889   /*else*/ {
12890     __pyx_v_out = 0;
12891   }
12892   __pyx_L6:;
12893 
12894   /* "yt/utilities/lib/geometry_utils.pxd":88
12895  *     else:
12896  *         out = 0
12897  *     return out             # <<<<<<<<<<<<<<
12898  *
12899  * @cython.cdivision(True)
12900  */
12901   __pyx_r = __pyx_v_out;
12902   goto __pyx_L0;
12903 
12904   /* "yt/utilities/lib/geometry_utils.pxd":73
12905  * @cython.boundscheck(False)
12906  * @cython.wraparound(False)
12907  * cdef inline int compare_floats_morton(np.float64_t p[3], np.float64_t q[3]):             # <<<<<<<<<<<<<<
12908  *     cdef int j, out, dim
12909  *     cdef np.int64_t x, y
12910  */
12911 
12912   /* function exit code */
12913   __pyx_L0:;
12914   __Pyx_RefNannyFinishContext();
12915   return __pyx_r;
12916 }
12917 
12918 /* "yt/utilities/lib/geometry_utils.pxd":93
12919  * @cython.boundscheck(False)
12920  * @cython.wraparound(False)
12921  * cdef inline np.float64_t euclidean_distance(np.float64_t[:] p, np.float64_t[:] q):             # <<<<<<<<<<<<<<
12922  *     cdef int j
12923  *     cdef np.float64_t d
12924  */
12925 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_euclidean_distance(__Pyx_memviewslice __pyx_v_p,__Pyx_memviewslice __pyx_v_q)12926 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) {
12927   int __pyx_v_j;
12928   __pyx_t_5numpy_float64_t __pyx_v_d;
12929   __pyx_t_5numpy_float64_t __pyx_r;
12930   __Pyx_RefNannyDeclarations
12931   int __pyx_t_1;
12932   Py_ssize_t __pyx_t_2;
12933   int __pyx_t_3;
12934   Py_ssize_t __pyx_t_4;
12935   __Pyx_RefNannySetupContext("euclidean_distance", 0);
12936 
12937   /* "yt/utilities/lib/geometry_utils.pxd":96
12938  *     cdef int j
12939  *     cdef np.float64_t d
12940  *     d = 0.0             # <<<<<<<<<<<<<<
12941  *     for j in range(3):
12942  *         d+=(p[j]-q[j])**2
12943  */
12944   __pyx_v_d = 0.0;
12945 
12946   /* "yt/utilities/lib/geometry_utils.pxd":97
12947  *     cdef np.float64_t d
12948  *     d = 0.0
12949  *     for j in range(3):             # <<<<<<<<<<<<<<
12950  *         d+=(p[j]-q[j])**2
12951  *     return sqrt(d)
12952  */
12953   for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
12954     __pyx_v_j = __pyx_t_1;
12955 
12956     /* "yt/utilities/lib/geometry_utils.pxd":98
12957  *     d = 0.0
12958  *     for j in range(3):
12959  *         d+=(p[j]-q[j])**2             # <<<<<<<<<<<<<<
12960  *     return sqrt(d)
12961  *
12962  */
12963     __pyx_t_2 = __pyx_v_j;
12964     __pyx_t_3 = -1;
12965     if (__pyx_t_2 < 0) {
12966       __pyx_t_2 += __pyx_v_p.shape[0];
12967       if (unlikely(__pyx_t_2 < 0)) __pyx_t_3 = 0;
12968     } else if (unlikely(__pyx_t_2 >= __pyx_v_p.shape[0])) __pyx_t_3 = 0;
12969     if (unlikely(__pyx_t_3 != -1)) {
12970       __Pyx_RaiseBufferIndexError(__pyx_t_3);
12971       __PYX_ERR(5, 98, __pyx_L1_error)
12972     }
12973     __pyx_t_4 = __pyx_v_j;
12974     __pyx_t_3 = -1;
12975     if (__pyx_t_4 < 0) {
12976       __pyx_t_4 += __pyx_v_q.shape[0];
12977       if (unlikely(__pyx_t_4 < 0)) __pyx_t_3 = 0;
12978     } else if (unlikely(__pyx_t_4 >= __pyx_v_q.shape[0])) __pyx_t_3 = 0;
12979     if (unlikely(__pyx_t_3 != -1)) {
12980       __Pyx_RaiseBufferIndexError(__pyx_t_3);
12981       __PYX_ERR(5, 98, __pyx_L1_error)
12982     }
12983     __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));
12984   }
12985 
12986   /* "yt/utilities/lib/geometry_utils.pxd":99
12987  *     for j in range(3):
12988  *         d+=(p[j]-q[j])**2
12989  *     return sqrt(d)             # <<<<<<<<<<<<<<
12990  *
12991  * # Todo: allow radius reported independently in each dimension for rectangular domain
12992  */
12993   __pyx_r = sqrt(__pyx_v_d);
12994   goto __pyx_L0;
12995 
12996   /* "yt/utilities/lib/geometry_utils.pxd":93
12997  * @cython.boundscheck(False)
12998  * @cython.wraparound(False)
12999  * cdef inline np.float64_t euclidean_distance(np.float64_t[:] p, np.float64_t[:] q):             # <<<<<<<<<<<<<<
13000  *     cdef int j
13001  *     cdef np.float64_t d
13002  */
13003 
13004   /* function exit code */
13005   __pyx_L1_error:;
13006   __Pyx_WriteUnraisable("yt.utilities.lib.geometry_utils.euclidean_distance", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
13007   __pyx_r = 0;
13008   __pyx_L0:;
13009   __Pyx_RefNannyFinishContext();
13010   return __pyx_r;
13011 }
13012 
13013 /* "yt/utilities/lib/geometry_utils.pxd":105
13014  * @cython.boundscheck(False)
13015  * @cython.wraparound(False)
13016  * cdef inline np.float64_t smallest_quadtree_box(np.float64_t p[3], np.float64_t q[3], np.int32_t order,             # <<<<<<<<<<<<<<
13017  *                                                np.float64_t DLE[3], np.float64_t DRE[3],
13018  *                                                np.float64_t *cx, np.float64_t *cy, np.float64_t *cz):
13019  */
13020 
__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)13021 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) {
13022   int __pyx_v_j;
13023   __pyx_t_5numpy_float64_t __pyx_v_c[3];
13024   __pyx_t_5numpy_uint64_t __pyx_v_pidx[3];
13025   __pyx_t_5numpy_uint64_t __pyx_v_pidx_next[3];
13026   __pyx_t_5numpy_uint64_t __pyx_v_qidx_next[3];
13027   __pyx_t_5numpy_float64_t __pyx_v_dds[3];
13028   __pyx_t_5numpy_float64_t __pyx_v_rad;
13029   int __pyx_v_lvl;
13030   int __pyx_v_done;
13031   __pyx_t_5numpy_float64_t __pyx_r;
13032   __Pyx_RefNannyDeclarations
13033   int __pyx_t_1;
13034   int __pyx_t_2;
13035   __Pyx_RefNannySetupContext("smallest_quadtree_box", 0);
13036 
13037   /* "yt/utilities/lib/geometry_utils.pxd":112
13038  *     cdef np.uint64_t pidx[3]
13039  *     # cdef np.uint64_t qidx[3]
13040  *     for j in range(3):             # <<<<<<<<<<<<<<
13041  *         pidx[j] = 0
13042  *         # qidx[j] = 0
13043  */
13044   for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
13045     __pyx_v_j = __pyx_t_1;
13046 
13047     /* "yt/utilities/lib/geometry_utils.pxd":113
13048  *     # cdef np.uint64_t qidx[3]
13049  *     for j in range(3):
13050  *         pidx[j] = 0             # <<<<<<<<<<<<<<
13051  *         # qidx[j] = 0
13052  *     cdef np.uint64_t pidx_next[3]
13053  */
13054     (__pyx_v_pidx[__pyx_v_j]) = 0;
13055   }
13056 
13057   /* "yt/utilities/lib/geometry_utils.pxd":119
13058  *     cdef np.float64_t dds[3]
13059  *     cdef np.float64_t rad
13060  *     cdef int lvl = 0             # <<<<<<<<<<<<<<
13061  *     cdef int done = 0
13062  *     while not done:
13063  */
13064   __pyx_v_lvl = 0;
13065 
13066   /* "yt/utilities/lib/geometry_utils.pxd":120
13067  *     cdef np.float64_t rad
13068  *     cdef int lvl = 0
13069  *     cdef int done = 0             # <<<<<<<<<<<<<<
13070  *     while not done:
13071  *         if (lvl+1 >= order):
13072  */
13073   __pyx_v_done = 0;
13074 
13075   /* "yt/utilities/lib/geometry_utils.pxd":121
13076  *     cdef int lvl = 0
13077  *     cdef int done = 0
13078  *     while not done:             # <<<<<<<<<<<<<<
13079  *         if (lvl+1 >= order):
13080  *             done = 1
13081  */
13082   while (1) {
13083     __pyx_t_2 = ((!(__pyx_v_done != 0)) != 0);
13084     if (!__pyx_t_2) break;
13085 
13086     /* "yt/utilities/lib/geometry_utils.pxd":122
13087  *     cdef int done = 0
13088  *     while not done:
13089  *         if (lvl+1 >= order):             # <<<<<<<<<<<<<<
13090  *             done = 1
13091  *         for j in range(3):
13092  */
13093     __pyx_t_2 = (((__pyx_v_lvl + 1) >= __pyx_v_order) != 0);
13094     if (__pyx_t_2) {
13095 
13096       /* "yt/utilities/lib/geometry_utils.pxd":123
13097  *     while not done:
13098  *         if (lvl+1 >= order):
13099  *             done = 1             # <<<<<<<<<<<<<<
13100  *         for j in range(3):
13101  *             dds[j] = (DRE[j] - DLE[j])/(1 << (<int> lvl+1))
13102  */
13103       __pyx_v_done = 1;
13104 
13105       /* "yt/utilities/lib/geometry_utils.pxd":122
13106  *     cdef int done = 0
13107  *     while not done:
13108  *         if (lvl+1 >= order):             # <<<<<<<<<<<<<<
13109  *             done = 1
13110  *         for j in range(3):
13111  */
13112     }
13113 
13114     /* "yt/utilities/lib/geometry_utils.pxd":124
13115  *         if (lvl+1 >= order):
13116  *             done = 1
13117  *         for j in range(3):             # <<<<<<<<<<<<<<
13118  *             dds[j] = (DRE[j] - DLE[j])/(1 << (<int> lvl+1))
13119  *             pidx_next[j] = <np.uint64_t>((p[j] - DLE[j])/dds[j])
13120  */
13121     for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
13122       __pyx_v_j = __pyx_t_1;
13123 
13124       /* "yt/utilities/lib/geometry_utils.pxd":125
13125  *             done = 1
13126  *         for j in range(3):
13127  *             dds[j] = (DRE[j] - DLE[j])/(1 << (<int> lvl+1))             # <<<<<<<<<<<<<<
13128  *             pidx_next[j] = <np.uint64_t>((p[j] - DLE[j])/dds[j])
13129  *             qidx_next[j] = <np.uint64_t>((q[j] - DLE[j])/dds[j])
13130  */
13131       (__pyx_v_dds[__pyx_v_j]) = (((__pyx_v_DRE[__pyx_v_j]) - (__pyx_v_DLE[__pyx_v_j])) / (1 << (((int)__pyx_v_lvl) + 1)));
13132 
13133       /* "yt/utilities/lib/geometry_utils.pxd":126
13134  *         for j in range(3):
13135  *             dds[j] = (DRE[j] - DLE[j])/(1 << (<int> lvl+1))
13136  *             pidx_next[j] = <np.uint64_t>((p[j] - DLE[j])/dds[j])             # <<<<<<<<<<<<<<
13137  *             qidx_next[j] = <np.uint64_t>((q[j] - DLE[j])/dds[j])
13138  *         for j in range(3):
13139  */
13140       (__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])));
13141 
13142       /* "yt/utilities/lib/geometry_utils.pxd":127
13143  *             dds[j] = (DRE[j] - DLE[j])/(1 << (<int> lvl+1))
13144  *             pidx_next[j] = <np.uint64_t>((p[j] - DLE[j])/dds[j])
13145  *             qidx_next[j] = <np.uint64_t>((q[j] - DLE[j])/dds[j])             # <<<<<<<<<<<<<<
13146  *         for j in range(3):
13147  *             if pidx_next[j]!=qidx_next[j]:
13148  */
13149       (__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])));
13150     }
13151 
13152     /* "yt/utilities/lib/geometry_utils.pxd":128
13153  *             pidx_next[j] = <np.uint64_t>((p[j] - DLE[j])/dds[j])
13154  *             qidx_next[j] = <np.uint64_t>((q[j] - DLE[j])/dds[j])
13155  *         for j in range(3):             # <<<<<<<<<<<<<<
13156  *             if pidx_next[j]!=qidx_next[j]:
13157  *                 done = 1
13158  */
13159     for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
13160       __pyx_v_j = __pyx_t_1;
13161 
13162       /* "yt/utilities/lib/geometry_utils.pxd":129
13163  *             qidx_next[j] = <np.uint64_t>((q[j] - DLE[j])/dds[j])
13164  *         for j in range(3):
13165  *             if pidx_next[j]!=qidx_next[j]:             # <<<<<<<<<<<<<<
13166  *                 done = 1
13167  *                 break
13168  */
13169       __pyx_t_2 = (((__pyx_v_pidx_next[__pyx_v_j]) != (__pyx_v_qidx_next[__pyx_v_j])) != 0);
13170       if (__pyx_t_2) {
13171 
13172         /* "yt/utilities/lib/geometry_utils.pxd":130
13173  *         for j in range(3):
13174  *             if pidx_next[j]!=qidx_next[j]:
13175  *                 done = 1             # <<<<<<<<<<<<<<
13176  *                 break
13177  *         if not done:
13178  */
13179         __pyx_v_done = 1;
13180 
13181         /* "yt/utilities/lib/geometry_utils.pxd":131
13182  *             if pidx_next[j]!=qidx_next[j]:
13183  *                 done = 1
13184  *                 break             # <<<<<<<<<<<<<<
13185  *         if not done:
13186  *             for j in range(3):
13187  */
13188         goto __pyx_L11_break;
13189 
13190         /* "yt/utilities/lib/geometry_utils.pxd":129
13191  *             qidx_next[j] = <np.uint64_t>((q[j] - DLE[j])/dds[j])
13192  *         for j in range(3):
13193  *             if pidx_next[j]!=qidx_next[j]:             # <<<<<<<<<<<<<<
13194  *                 done = 1
13195  *                 break
13196  */
13197       }
13198     }
13199     __pyx_L11_break:;
13200 
13201     /* "yt/utilities/lib/geometry_utils.pxd":132
13202  *                 done = 1
13203  *                 break
13204  *         if not done:             # <<<<<<<<<<<<<<
13205  *             for j in range(3):
13206  *                 pidx[j] = pidx_next[j]
13207  */
13208     __pyx_t_2 = ((!(__pyx_v_done != 0)) != 0);
13209     if (__pyx_t_2) {
13210 
13211       /* "yt/utilities/lib/geometry_utils.pxd":133
13212  *                 break
13213  *         if not done:
13214  *             for j in range(3):             # <<<<<<<<<<<<<<
13215  *                 pidx[j] = pidx_next[j]
13216  *                 # qidx[j] = qidx_next[j]
13217  */
13218       for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
13219         __pyx_v_j = __pyx_t_1;
13220 
13221         /* "yt/utilities/lib/geometry_utils.pxd":134
13222  *         if not done:
13223  *             for j in range(3):
13224  *                 pidx[j] = pidx_next[j]             # <<<<<<<<<<<<<<
13225  *                 # qidx[j] = qidx_next[j]
13226  *             lvl+=1
13227  */
13228         (__pyx_v_pidx[__pyx_v_j]) = (__pyx_v_pidx_next[__pyx_v_j]);
13229       }
13230 
13231       /* "yt/utilities/lib/geometry_utils.pxd":136
13232  *                 pidx[j] = pidx_next[j]
13233  *                 # qidx[j] = qidx_next[j]
13234  *             lvl+=1             # <<<<<<<<<<<<<<
13235  *     rad = 0.0
13236  *     for j in range(3):
13237  */
13238       __pyx_v_lvl = (__pyx_v_lvl + 1);
13239 
13240       /* "yt/utilities/lib/geometry_utils.pxd":132
13241  *                 done = 1
13242  *                 break
13243  *         if not done:             # <<<<<<<<<<<<<<
13244  *             for j in range(3):
13245  *                 pidx[j] = pidx_next[j]
13246  */
13247     }
13248   }
13249 
13250   /* "yt/utilities/lib/geometry_utils.pxd":137
13251  *                 # qidx[j] = qidx_next[j]
13252  *             lvl+=1
13253  *     rad = 0.0             # <<<<<<<<<<<<<<
13254  *     for j in range(3):
13255  *         dds[j] = (DRE[j] - DLE[j])/(1 << lvl)
13256  */
13257   __pyx_v_rad = 0.0;
13258 
13259   /* "yt/utilities/lib/geometry_utils.pxd":138
13260  *             lvl+=1
13261  *     rad = 0.0
13262  *     for j in range(3):             # <<<<<<<<<<<<<<
13263  *         dds[j] = (DRE[j] - DLE[j])/(1 << lvl)
13264  *         c[j] = dds[j]*(<np.float64_t>pidx[j]+0.5)
13265  */
13266   for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
13267     __pyx_v_j = __pyx_t_1;
13268 
13269     /* "yt/utilities/lib/geometry_utils.pxd":139
13270  *     rad = 0.0
13271  *     for j in range(3):
13272  *         dds[j] = (DRE[j] - DLE[j])/(1 << lvl)             # <<<<<<<<<<<<<<
13273  *         c[j] = dds[j]*(<np.float64_t>pidx[j]+0.5)
13274  *         rad+=((dds[j]/2.0)**2)
13275  */
13276     (__pyx_v_dds[__pyx_v_j]) = (((__pyx_v_DRE[__pyx_v_j]) - (__pyx_v_DLE[__pyx_v_j])) / (1 << __pyx_v_lvl));
13277 
13278     /* "yt/utilities/lib/geometry_utils.pxd":140
13279  *     for j in range(3):
13280  *         dds[j] = (DRE[j] - DLE[j])/(1 << lvl)
13281  *         c[j] = dds[j]*(<np.float64_t>pidx[j]+0.5)             # <<<<<<<<<<<<<<
13282  *         rad+=((dds[j]/2.0)**2)
13283  *     cx[0] = c[0]
13284  */
13285     (__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));
13286 
13287     /* "yt/utilities/lib/geometry_utils.pxd":141
13288  *         dds[j] = (DRE[j] - DLE[j])/(1 << lvl)
13289  *         c[j] = dds[j]*(<np.float64_t>pidx[j]+0.5)
13290  *         rad+=((dds[j]/2.0)**2)             # <<<<<<<<<<<<<<
13291  *     cx[0] = c[0]
13292  *     cy[0] = c[1]
13293  */
13294     __pyx_v_rad = (__pyx_v_rad + pow(((__pyx_v_dds[__pyx_v_j]) / 2.0), 2.0));
13295   }
13296 
13297   /* "yt/utilities/lib/geometry_utils.pxd":142
13298  *         c[j] = dds[j]*(<np.float64_t>pidx[j]+0.5)
13299  *         rad+=((dds[j]/2.0)**2)
13300  *     cx[0] = c[0]             # <<<<<<<<<<<<<<
13301  *     cy[0] = c[1]
13302  *     cz[0] = c[2]
13303  */
13304   (__pyx_v_cx[0]) = (__pyx_v_c[0]);
13305 
13306   /* "yt/utilities/lib/geometry_utils.pxd":143
13307  *         rad+=((dds[j]/2.0)**2)
13308  *     cx[0] = c[0]
13309  *     cy[0] = c[1]             # <<<<<<<<<<<<<<
13310  *     cz[0] = c[2]
13311  *     return sqrt(rad)
13312  */
13313   (__pyx_v_cy[0]) = (__pyx_v_c[1]);
13314 
13315   /* "yt/utilities/lib/geometry_utils.pxd":144
13316  *     cx[0] = c[0]
13317  *     cy[0] = c[1]
13318  *     cz[0] = c[2]             # <<<<<<<<<<<<<<
13319  *     return sqrt(rad)
13320  *
13321  */
13322   (__pyx_v_cz[0]) = (__pyx_v_c[2]);
13323 
13324   /* "yt/utilities/lib/geometry_utils.pxd":145
13325  *     cy[0] = c[1]
13326  *     cz[0] = c[2]
13327  *     return sqrt(rad)             # <<<<<<<<<<<<<<
13328  *
13329  * #-----------------------------------------------------------------------------
13330  */
13331   __pyx_r = sqrt(__pyx_v_rad);
13332   goto __pyx_L0;
13333 
13334   /* "yt/utilities/lib/geometry_utils.pxd":105
13335  * @cython.boundscheck(False)
13336  * @cython.wraparound(False)
13337  * cdef inline np.float64_t smallest_quadtree_box(np.float64_t p[3], np.float64_t q[3], np.int32_t order,             # <<<<<<<<<<<<<<
13338  *                                                np.float64_t DLE[3], np.float64_t DRE[3],
13339  *                                                np.float64_t *cx, np.float64_t *cy, np.float64_t *cz):
13340  */
13341 
13342   /* function exit code */
13343   __pyx_L0:;
13344   __Pyx_RefNannyFinishContext();
13345   return __pyx_r;
13346 }
13347 
13348 /* "yt/utilities/lib/geometry_utils.pxd":152
13349  * @cython.boundscheck(False)
13350  * @cython.wraparound(False)
13351  * cdef inline np.uint64_t spread_64bits_by3(np.uint64_t x):             # <<<<<<<<<<<<<<
13352  *     x=(x&(<np.uint64_t>0x00000000001FFFFF))
13353  *     x=(x|(x<<20))*(<np.uint64_t>0x000001FFC00003FF)
13354  */
13355 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_spread_64bits_by3(__pyx_t_5numpy_uint64_t __pyx_v_x)13356 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) {
13357   __pyx_t_5numpy_uint64_t __pyx_r;
13358   __Pyx_RefNannyDeclarations
13359   __Pyx_RefNannySetupContext("spread_64bits_by3", 0);
13360 
13361   /* "yt/utilities/lib/geometry_utils.pxd":153
13362  * @cython.wraparound(False)
13363  * cdef inline np.uint64_t spread_64bits_by3(np.uint64_t x):
13364  *     x=(x&(<np.uint64_t>0x00000000001FFFFF))             # <<<<<<<<<<<<<<
13365  *     x=(x|(x<<20))*(<np.uint64_t>0x000001FFC00003FF)
13366  *
13367  */
13368   __pyx_v_x = (__pyx_v_x & ((__pyx_t_5numpy_uint64_t)0x00000000001FFFFF));
13369 
13370   /* "yt/utilities/lib/geometry_utils.pxd":154
13371  * cdef inline np.uint64_t spread_64bits_by3(np.uint64_t x):
13372  *     x=(x&(<np.uint64_t>0x00000000001FFFFF))
13373  *     x=(x|(x<<20))*(<np.uint64_t>0x000001FFC00003FF)             # <<<<<<<<<<<<<<
13374  *
13375  * #-----------------------------------------------------------------------------
13376  */
13377   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x << 20)) * ((__pyx_t_5numpy_uint64_t)0x000001FFC00003FF));
13378 
13379   /* "yt/utilities/lib/geometry_utils.pxd":152
13380  * @cython.boundscheck(False)
13381  * @cython.wraparound(False)
13382  * cdef inline np.uint64_t spread_64bits_by3(np.uint64_t x):             # <<<<<<<<<<<<<<
13383  *     x=(x&(<np.uint64_t>0x00000000001FFFFF))
13384  *     x=(x|(x<<20))*(<np.uint64_t>0x000001FFC00003FF)
13385  */
13386 
13387   /* function exit code */
13388   __pyx_r = 0;
13389   __Pyx_RefNannyFinishContext();
13390   return __pyx_r;
13391 }
13392 
13393 /* "yt/utilities/lib/geometry_utils.pxd":161
13394  * @cython.boundscheck(False)
13395  * @cython.wraparound(False)
13396  * cdef inline np.uint64_t spread_64bits_by2(np.uint64_t x):             # <<<<<<<<<<<<<<
13397  *     # This magic comes from http://stackoverflow.com/questions/1024754/how-to-compute-a-3d-morton-number-interleave-the-bits-of-3-ints
13398  *     # Only reversible up to 2097151
13399  */
13400 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_spread_64bits_by2(__pyx_t_5numpy_uint64_t __pyx_v_x)13401 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) {
13402   __pyx_t_5numpy_uint64_t __pyx_r;
13403   __Pyx_RefNannyDeclarations
13404   __Pyx_RefNannySetupContext("spread_64bits_by2", 0);
13405 
13406   /* "yt/utilities/lib/geometry_utils.pxd":166
13407  *     # Select highest 21 bits (Required to be reversible to 21st bit)
13408  *     # x = ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---k jihg fedc ba98 7654 3210
13409  *     x=(x&(<np.uint64_t>0x00000000001FFFFF))             # <<<<<<<<<<<<<<
13410  *     # x = ---- ---- ---- ---- ---- ---k jihg fedc ba-- ---- ---- ---- ---- --98 7654 3210
13411  *     x=(x|(x<<20))&(<np.uint64_t>0x000001FFC00003FF)
13412  */
13413   __pyx_v_x = (__pyx_v_x & ((__pyx_t_5numpy_uint64_t)0x00000000001FFFFF));
13414 
13415   /* "yt/utilities/lib/geometry_utils.pxd":168
13416  *     x=(x&(<np.uint64_t>0x00000000001FFFFF))
13417  *     # x = ---- ---- ---- ---- ---- ---k jihg fedc ba-- ---- ---- ---- ---- --98 7654 3210
13418  *     x=(x|(x<<20))&(<np.uint64_t>0x000001FFC00003FF)             # <<<<<<<<<<<<<<
13419  *     # x = ---- ---- ---- -kji hgf- ---- ---- -edc ba-- ---- ---- 9876 5--- ---- ---4 3210
13420  *     x=(x|(x<<10))&(<np.uint64_t>0x0007E007C00F801F)
13421  */
13422   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x << 20)) & ((__pyx_t_5numpy_uint64_t)0x000001FFC00003FF));
13423 
13424   /* "yt/utilities/lib/geometry_utils.pxd":170
13425  *     x=(x|(x<<20))&(<np.uint64_t>0x000001FFC00003FF)
13426  *     # x = ---- ---- ---- -kji hgf- ---- ---- -edc ba-- ---- ---- 9876 5--- ---- ---4 3210
13427  *     x=(x|(x<<10))&(<np.uint64_t>0x0007E007C00F801F)             # <<<<<<<<<<<<<<
13428  *     # x = ---- ---- -kji h--- -gf- ---- -edc ---- ba-- ---- 987- ---6 5--- ---4 32-- --10
13429  *     x=(x|(x<<4))&(<np.uint64_t>0x00786070C0E181C3)
13430  */
13431   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x << 10)) & ((__pyx_t_5numpy_uint64_t)0x0007E007C00F801F));
13432 
13433   /* "yt/utilities/lib/geometry_utils.pxd":172
13434  *     x=(x|(x<<10))&(<np.uint64_t>0x0007E007C00F801F)
13435  *     # x = ---- ---- -kji h--- -gf- ---- -edc ---- ba-- ---- 987- ---6 5--- ---4 32-- --10
13436  *     x=(x|(x<<4))&(<np.uint64_t>0x00786070C0E181C3)             # <<<<<<<<<<<<<<
13437  *     # x = ---- ---k ji-- h--g --f- ---e d--c --b- -a-- --98 --7- -6-- 5--- -43- -2-- 1--0
13438  *     x=(x|(x<<2))&(<np.uint64_t>0x0199219243248649)
13439  */
13440   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x << 4)) & ((__pyx_t_5numpy_uint64_t)0x00786070C0E181C3));
13441 
13442   /* "yt/utilities/lib/geometry_utils.pxd":174
13443  *     x=(x|(x<<4))&(<np.uint64_t>0x00786070C0E181C3)
13444  *     # x = ---- ---k ji-- h--g --f- ---e d--c --b- -a-- --98 --7- -6-- 5--- -43- -2-- 1--0
13445  *     x=(x|(x<<2))&(<np.uint64_t>0x0199219243248649)             # <<<<<<<<<<<<<<
13446  *     # x = ---- -kj- -i-- h--g --f- -e-- d--c --b- -a-- 9--8 --7- -6-- 5--4 --3- -2-- 1--0
13447  *     x=(x|(x<<2))&(<np.uint64_t>0x0649249249249249)
13448  */
13449   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x << 2)) & ((__pyx_t_5numpy_uint64_t)0x0199219243248649));
13450 
13451   /* "yt/utilities/lib/geometry_utils.pxd":176
13452  *     x=(x|(x<<2))&(<np.uint64_t>0x0199219243248649)
13453  *     # x = ---- -kj- -i-- h--g --f- -e-- d--c --b- -a-- 9--8 --7- -6-- 5--4 --3- -2-- 1--0
13454  *     x=(x|(x<<2))&(<np.uint64_t>0x0649249249249249)             # <<<<<<<<<<<<<<
13455  *     # x = ---k --j- -i-- h--g --f- -e-- d--c --b- -a-- 9--8 --7- -6-- 5--4 --3- -2-- 1--0
13456  *     x=(x|(x<<2))&(<np.uint64_t>0x1249249249249249)
13457  */
13458   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x << 2)) & ((__pyx_t_5numpy_uint64_t)0x0649249249249249));
13459 
13460   /* "yt/utilities/lib/geometry_utils.pxd":178
13461  *     x=(x|(x<<2))&(<np.uint64_t>0x0649249249249249)
13462  *     # x = ---k --j- -i-- h--g --f- -e-- d--c --b- -a-- 9--8 --7- -6-- 5--4 --3- -2-- 1--0
13463  *     x=(x|(x<<2))&(<np.uint64_t>0x1249249249249249)             # <<<<<<<<<<<<<<
13464  *     return x
13465  *
13466  */
13467   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x << 2)) & ((__pyx_t_5numpy_uint64_t)0x1249249249249249));
13468 
13469   /* "yt/utilities/lib/geometry_utils.pxd":179
13470  *     # x = ---k --j- -i-- h--g --f- -e-- d--c --b- -a-- 9--8 --7- -6-- 5--4 --3- -2-- 1--0
13471  *     x=(x|(x<<2))&(<np.uint64_t>0x1249249249249249)
13472  *     return x             # <<<<<<<<<<<<<<
13473  *
13474  * @cython.cdivision(True)
13475  */
13476   __pyx_r = __pyx_v_x;
13477   goto __pyx_L0;
13478 
13479   /* "yt/utilities/lib/geometry_utils.pxd":161
13480  * @cython.boundscheck(False)
13481  * @cython.wraparound(False)
13482  * cdef inline np.uint64_t spread_64bits_by2(np.uint64_t x):             # <<<<<<<<<<<<<<
13483  *     # This magic comes from http://stackoverflow.com/questions/1024754/how-to-compute-a-3d-morton-number-interleave-the-bits-of-3-ints
13484  *     # Only reversible up to 2097151
13485  */
13486 
13487   /* function exit code */
13488   __pyx_L0:;
13489   __Pyx_RefNannyFinishContext();
13490   return __pyx_r;
13491 }
13492 
13493 /* "yt/utilities/lib/geometry_utils.pxd":184
13494  * @cython.boundscheck(False)
13495  * @cython.wraparound(False)
13496  * cdef inline np.uint64_t compact_64bits_by2(np.uint64_t x):             # <<<<<<<<<<<<<<
13497  *     # Reversed magic
13498  *     x=x&(<np.uint64_t>0x1249249249249249)
13499  */
13500 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_compact_64bits_by2(__pyx_t_5numpy_uint64_t __pyx_v_x)13501 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) {
13502   __pyx_t_5numpy_uint64_t __pyx_r;
13503   __Pyx_RefNannyDeclarations
13504   __Pyx_RefNannySetupContext("compact_64bits_by2", 0);
13505 
13506   /* "yt/utilities/lib/geometry_utils.pxd":186
13507  * cdef inline np.uint64_t compact_64bits_by2(np.uint64_t x):
13508  *     # Reversed magic
13509  *     x=x&(<np.uint64_t>0x1249249249249249)             # <<<<<<<<<<<<<<
13510  *     x=(x|(x>>2))&(<np.uint64_t>0x0649249249249249)
13511  *     x=(x|(x>>2))&(<np.uint64_t>0x0199219243248649)
13512  */
13513   __pyx_v_x = (__pyx_v_x & ((__pyx_t_5numpy_uint64_t)0x1249249249249249));
13514 
13515   /* "yt/utilities/lib/geometry_utils.pxd":187
13516  *     # Reversed magic
13517  *     x=x&(<np.uint64_t>0x1249249249249249)
13518  *     x=(x|(x>>2))&(<np.uint64_t>0x0649249249249249)             # <<<<<<<<<<<<<<
13519  *     x=(x|(x>>2))&(<np.uint64_t>0x0199219243248649)
13520  *     x=(x|(x>>2))&(<np.uint64_t>0x00786070C0E181C3)
13521  */
13522   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x >> 2)) & ((__pyx_t_5numpy_uint64_t)0x0649249249249249));
13523 
13524   /* "yt/utilities/lib/geometry_utils.pxd":188
13525  *     x=x&(<np.uint64_t>0x1249249249249249)
13526  *     x=(x|(x>>2))&(<np.uint64_t>0x0649249249249249)
13527  *     x=(x|(x>>2))&(<np.uint64_t>0x0199219243248649)             # <<<<<<<<<<<<<<
13528  *     x=(x|(x>>2))&(<np.uint64_t>0x00786070C0E181C3)
13529  *     x=(x|(x>>4))&(<np.uint64_t>0x0007E007C00F801F)
13530  */
13531   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x >> 2)) & ((__pyx_t_5numpy_uint64_t)0x0199219243248649));
13532 
13533   /* "yt/utilities/lib/geometry_utils.pxd":189
13534  *     x=(x|(x>>2))&(<np.uint64_t>0x0649249249249249)
13535  *     x=(x|(x>>2))&(<np.uint64_t>0x0199219243248649)
13536  *     x=(x|(x>>2))&(<np.uint64_t>0x00786070C0E181C3)             # <<<<<<<<<<<<<<
13537  *     x=(x|(x>>4))&(<np.uint64_t>0x0007E007C00F801F)
13538  *     x=(x|(x>>10))&(<np.uint64_t>0x000001FFC00003FF)
13539  */
13540   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x >> 2)) & ((__pyx_t_5numpy_uint64_t)0x00786070C0E181C3));
13541 
13542   /* "yt/utilities/lib/geometry_utils.pxd":190
13543  *     x=(x|(x>>2))&(<np.uint64_t>0x0199219243248649)
13544  *     x=(x|(x>>2))&(<np.uint64_t>0x00786070C0E181C3)
13545  *     x=(x|(x>>4))&(<np.uint64_t>0x0007E007C00F801F)             # <<<<<<<<<<<<<<
13546  *     x=(x|(x>>10))&(<np.uint64_t>0x000001FFC00003FF)
13547  *     x=(x|(x>>20))&(<np.uint64_t>0x00000000001FFFFF)
13548  */
13549   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x >> 4)) & ((__pyx_t_5numpy_uint64_t)0x0007E007C00F801F));
13550 
13551   /* "yt/utilities/lib/geometry_utils.pxd":191
13552  *     x=(x|(x>>2))&(<np.uint64_t>0x00786070C0E181C3)
13553  *     x=(x|(x>>4))&(<np.uint64_t>0x0007E007C00F801F)
13554  *     x=(x|(x>>10))&(<np.uint64_t>0x000001FFC00003FF)             # <<<<<<<<<<<<<<
13555  *     x=(x|(x>>20))&(<np.uint64_t>0x00000000001FFFFF)
13556  *     return x
13557  */
13558   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x >> 10)) & ((__pyx_t_5numpy_uint64_t)0x000001FFC00003FF));
13559 
13560   /* "yt/utilities/lib/geometry_utils.pxd":192
13561  *     x=(x|(x>>4))&(<np.uint64_t>0x0007E007C00F801F)
13562  *     x=(x|(x>>10))&(<np.uint64_t>0x000001FFC00003FF)
13563  *     x=(x|(x>>20))&(<np.uint64_t>0x00000000001FFFFF)             # <<<<<<<<<<<<<<
13564  *     return x
13565  *
13566  */
13567   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x >> 20)) & ((__pyx_t_5numpy_uint64_t)0x00000000001FFFFF));
13568 
13569   /* "yt/utilities/lib/geometry_utils.pxd":193
13570  *     x=(x|(x>>10))&(<np.uint64_t>0x000001FFC00003FF)
13571  *     x=(x|(x>>20))&(<np.uint64_t>0x00000000001FFFFF)
13572  *     return x             # <<<<<<<<<<<<<<
13573  *
13574  * #-----------------------------------------------------------------------------
13575  */
13576   __pyx_r = __pyx_v_x;
13577   goto __pyx_L0;
13578 
13579   /* "yt/utilities/lib/geometry_utils.pxd":184
13580  * @cython.boundscheck(False)
13581  * @cython.wraparound(False)
13582  * cdef inline np.uint64_t compact_64bits_by2(np.uint64_t x):             # <<<<<<<<<<<<<<
13583  *     # Reversed magic
13584  *     x=x&(<np.uint64_t>0x1249249249249249)
13585  */
13586 
13587   /* function exit code */
13588   __pyx_L0:;
13589   __Pyx_RefNannyFinishContext();
13590   return __pyx_r;
13591 }
13592 
13593 /* "yt/utilities/lib/geometry_utils.pxd":200
13594  * @cython.boundscheck(False)
13595  * @cython.wraparound(False)
13596  * cdef inline np.uint32_t spread_32bits_by2(np.uint32_t x):             # <<<<<<<<<<<<<<
13597  *     # Only reversible up to 1023
13598  *     # Select highest 10 bits (Required to be reversible to 10st bit)
13599  */
13600 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_spread_32bits_by2(__pyx_t_5numpy_uint32_t __pyx_v_x)13601 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) {
13602   __pyx_t_5numpy_uint32_t __pyx_r;
13603   __Pyx_RefNannyDeclarations
13604   __Pyx_RefNannySetupContext("spread_32bits_by2", 0);
13605 
13606   /* "yt/utilities/lib/geometry_utils.pxd":204
13607  *     # Select highest 10 bits (Required to be reversible to 10st bit)
13608  *     # x = ---- ---- ---- ---- ---- --98 7654 3210
13609  *     x=(x&(<np.uint32_t>0x000003FF))             # <<<<<<<<<<<<<<
13610  *     # x = ---- --98 ---- ---- ---- ---- 7654 3210
13611  *     x=(x|(x<<16))&(<np.uint32_t>0xFF0000FF)
13612  */
13613   __pyx_v_x = (__pyx_v_x & ((__pyx_t_5numpy_uint32_t)0x000003FF));
13614 
13615   /* "yt/utilities/lib/geometry_utils.pxd":206
13616  *     x=(x&(<np.uint32_t>0x000003FF))
13617  *     # x = ---- --98 ---- ---- ---- ---- 7654 3210
13618  *     x=(x|(x<<16))&(<np.uint32_t>0xFF0000FF)             # <<<<<<<<<<<<<<
13619  *     # x = ---- --98 ---- ---- 7654 ---- ---- 3210
13620  *     x=(x|(x<<8))&(<np.uint32_t>0x0300F00F)
13621  */
13622   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x << 16)) & ((__pyx_t_5numpy_uint32_t)0xFF0000FF));
13623 
13624   /* "yt/utilities/lib/geometry_utils.pxd":208
13625  *     x=(x|(x<<16))&(<np.uint32_t>0xFF0000FF)
13626  *     # x = ---- --98 ---- ---- 7654 ---- ---- 3210
13627  *     x=(x|(x<<8))&(<np.uint32_t>0x0300F00F)             # <<<<<<<<<<<<<<
13628  *     # x = ---- --98 ---- 76-- --54 ---- 32-- --10
13629  *     x=(x|(x<<4))&(<np.uint32_t>0x030C30C3)
13630  */
13631   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x << 8)) & ((__pyx_t_5numpy_uint32_t)0x0300F00F));
13632 
13633   /* "yt/utilities/lib/geometry_utils.pxd":210
13634  *     x=(x|(x<<8))&(<np.uint32_t>0x0300F00F)
13635  *     # x = ---- --98 ---- 76-- --54 ---- 32-- --10
13636  *     x=(x|(x<<4))&(<np.uint32_t>0x030C30C3)             # <<<<<<<<<<<<<<
13637  *     # x = ---- 9--8 --7- -6-- 5--4 --3- -2-- 1--0
13638  *     x=(x|(x<<2))&(<np.uint32_t>0x09249249)
13639  */
13640   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x << 4)) & ((__pyx_t_5numpy_uint32_t)0x030C30C3));
13641 
13642   /* "yt/utilities/lib/geometry_utils.pxd":212
13643  *     x=(x|(x<<4))&(<np.uint32_t>0x030C30C3)
13644  *     # x = ---- 9--8 --7- -6-- 5--4 --3- -2-- 1--0
13645  *     x=(x|(x<<2))&(<np.uint32_t>0x09249249)             # <<<<<<<<<<<<<<
13646  *     return x
13647  *
13648  */
13649   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x << 2)) & ((__pyx_t_5numpy_uint32_t)0x09249249));
13650 
13651   /* "yt/utilities/lib/geometry_utils.pxd":213
13652  *     # x = ---- 9--8 --7- -6-- 5--4 --3- -2-- 1--0
13653  *     x=(x|(x<<2))&(<np.uint32_t>0x09249249)
13654  *     return x             # <<<<<<<<<<<<<<
13655  *
13656  * @cython.cdivision(True)
13657  */
13658   __pyx_r = __pyx_v_x;
13659   goto __pyx_L0;
13660 
13661   /* "yt/utilities/lib/geometry_utils.pxd":200
13662  * @cython.boundscheck(False)
13663  * @cython.wraparound(False)
13664  * cdef inline np.uint32_t spread_32bits_by2(np.uint32_t x):             # <<<<<<<<<<<<<<
13665  *     # Only reversible up to 1023
13666  *     # Select highest 10 bits (Required to be reversible to 10st bit)
13667  */
13668 
13669   /* function exit code */
13670   __pyx_L0:;
13671   __Pyx_RefNannyFinishContext();
13672   return __pyx_r;
13673 }
13674 
13675 /* "yt/utilities/lib/geometry_utils.pxd":218
13676  * @cython.boundscheck(False)
13677  * @cython.wraparound(False)
13678  * cdef inline np.uint32_t compact_32bits_by2(np.uint32_t x):             # <<<<<<<<<<<<<<
13679  *     # Reversed magic
13680  *     x=x&(<np.uint32_t>0x09249249)
13681  */
13682 
__pyx_f_2yt_9utilities_3lib_14geometry_utils_compact_32bits_by2(__pyx_t_5numpy_uint32_t __pyx_v_x)13683 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) {
13684   __pyx_t_5numpy_uint32_t __pyx_r;
13685   __Pyx_RefNannyDeclarations
13686   __Pyx_RefNannySetupContext("compact_32bits_by2", 0);
13687 
13688   /* "yt/utilities/lib/geometry_utils.pxd":220
13689  * cdef inline np.uint32_t compact_32bits_by2(np.uint32_t x):
13690  *     # Reversed magic
13691  *     x=x&(<np.uint32_t>0x09249249)             # <<<<<<<<<<<<<<
13692  *     x=(x|(x>>2))&(<np.uint32_t>0x030C30C3)
13693  *     x=(x|(x>>4))&(<np.uint32_t>0x0300F00F)
13694  */
13695   __pyx_v_x = (__pyx_v_x & ((__pyx_t_5numpy_uint32_t)0x09249249));
13696 
13697   /* "yt/utilities/lib/geometry_utils.pxd":221
13698  *     # Reversed magic
13699  *     x=x&(<np.uint32_t>0x09249249)
13700  *     x=(x|(x>>2))&(<np.uint32_t>0x030C30C3)             # <<<<<<<<<<<<<<
13701  *     x=(x|(x>>4))&(<np.uint32_t>0x0300F00F)
13702  *     x=(x|(x>>8))&(<np.uint32_t>0xFF0000FF)
13703  */
13704   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x >> 2)) & ((__pyx_t_5numpy_uint32_t)0x030C30C3));
13705 
13706   /* "yt/utilities/lib/geometry_utils.pxd":222
13707  *     x=x&(<np.uint32_t>0x09249249)
13708  *     x=(x|(x>>2))&(<np.uint32_t>0x030C30C3)
13709  *     x=(x|(x>>4))&(<np.uint32_t>0x0300F00F)             # <<<<<<<<<<<<<<
13710  *     x=(x|(x>>8))&(<np.uint32_t>0xFF0000FF)
13711  *     x=(x|(x>>16))&(<np.uint32_t>0x000003FF)
13712  */
13713   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x >> 4)) & ((__pyx_t_5numpy_uint32_t)0x0300F00F));
13714 
13715   /* "yt/utilities/lib/geometry_utils.pxd":223
13716  *     x=(x|(x>>2))&(<np.uint32_t>0x030C30C3)
13717  *     x=(x|(x>>4))&(<np.uint32_t>0x0300F00F)
13718  *     x=(x|(x>>8))&(<np.uint32_t>0xFF0000FF)             # <<<<<<<<<<<<<<
13719  *     x=(x|(x>>16))&(<np.uint32_t>0x000003FF)
13720  *     return x
13721  */
13722   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x >> 8)) & ((__pyx_t_5numpy_uint32_t)0xFF0000FF));
13723 
13724   /* "yt/utilities/lib/geometry_utils.pxd":224
13725  *     x=(x|(x>>4))&(<np.uint32_t>0x0300F00F)
13726  *     x=(x|(x>>8))&(<np.uint32_t>0xFF0000FF)
13727  *     x=(x|(x>>16))&(<np.uint32_t>0x000003FF)             # <<<<<<<<<<<<<<
13728  *     return x
13729  *
13730  */
13731   __pyx_v_x = ((__pyx_v_x | (__pyx_v_x >> 16)) & ((__pyx_t_5numpy_uint32_t)0x000003FF));
13732 
13733   /* "yt/utilities/lib/geometry_utils.pxd":225
13734  *     x=(x|(x>>8))&(<np.uint32_t>0xFF0000FF)
13735  *     x=(x|(x>>16))&(<np.uint32_t>0x000003FF)
13736  *     return x             # <<<<<<<<<<<<<<
13737  *
13738  * @cython.cdivision(True)
13739  */
13740   __pyx_r = __pyx_v_x;
13741   goto __pyx_L0;
13742 
13743   /* "yt/utilities/lib/geometry_utils.pxd":218
13744  * @cython.boundscheck(False)
13745  * @cython.wraparound(False)
13746  * cdef inline np.uint32_t compact_32bits_by2(np.uint32_t x):             # <<<<<<<<<<<<<<
13747  *     # Reversed magic
13748  *     x=x&(<np.uint32_t>0x09249249)
13749  */
13750 
13751   /* function exit code */
13752   __pyx_L0:;
13753   __Pyx_RefNannyFinishContext();
13754   return __pyx_r;
13755 }
13756 
13757 /* "yt/utilities/lib/geometry_utils.pxd":230
13758  * @cython.boundscheck(False)
13759  * @cython.wraparound(False)
13760  * cdef inline np.uint64_t masked_merge_64bit(np.uint64_t a, np.uint64_t b, np.uint64_t mask):             # <<<<<<<<<<<<<<
13761  *     # https://graphics.stanford.edu/~seander/bithacks.html#MaskedMerge
13762  *     return a ^ ((a ^ b) & mask)
13763  */
13764 
__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)13765 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) {
13766   __pyx_t_5numpy_uint64_t __pyx_r;
13767   __Pyx_RefNannyDeclarations
13768   __Pyx_RefNannySetupContext("masked_merge_64bit", 0);
13769 
13770   /* "yt/utilities/lib/geometry_utils.pxd":232
13771  * cdef inline np.uint64_t masked_merge_64bit(np.uint64_t a, np.uint64_t b, np.uint64_t mask):
13772  *     # https://graphics.stanford.edu/~seander/bithacks.html#MaskedMerge
13773  *     return a ^ ((a ^ b) & mask)             # <<<<<<<<<<<<<<
13774  *
13775  * @cython.cdivision(True)
13776  */
13777   __pyx_r = (__pyx_v_a ^ ((__pyx_v_a ^ __pyx_v_b) & __pyx_v_mask));
13778   goto __pyx_L0;
13779 
13780   /* "yt/utilities/lib/geometry_utils.pxd":230
13781  * @cython.boundscheck(False)
13782  * @cython.wraparound(False)
13783  * cdef inline np.uint64_t masked_merge_64bit(np.uint64_t a, np.uint64_t b, np.uint64_t mask):             # <<<<<<<<<<<<<<
13784  *     # https://graphics.stanford.edu/~seander/bithacks.html#MaskedMerge
13785  *     return a ^ ((a ^ b) & mask)
13786  */
13787 
13788   /* function exit code */
13789   __pyx_L0:;
13790   __Pyx_RefNannyFinishContext();
13791   return __pyx_r;
13792 }
13793 
13794 /* "yt/utilities/lib/geometry_utils.pxd":235
13795  *
13796  * @cython.cdivision(True)
13797  * cdef inline np.uint64_t encode_morton_64bit(np.uint64_t x_ind, np.uint64_t y_ind, np.uint64_t z_ind):             # <<<<<<<<<<<<<<
13798  *     cdef np.uint64_t mi
13799  *     mi = 0
13800  */
13801 
__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)13802 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) {
13803   __pyx_t_5numpy_uint64_t __pyx_v_mi;
13804   __pyx_t_5numpy_uint64_t __pyx_r;
13805   __Pyx_RefNannyDeclarations
13806   __Pyx_RefNannySetupContext("encode_morton_64bit", 0);
13807 
13808   /* "yt/utilities/lib/geometry_utils.pxd":237
13809  * cdef inline np.uint64_t encode_morton_64bit(np.uint64_t x_ind, np.uint64_t y_ind, np.uint64_t z_ind):
13810  *     cdef np.uint64_t mi
13811  *     mi = 0             # <<<<<<<<<<<<<<
13812  *     mi |= spread_64bits_by2(z_ind)<<ZSHIFT
13813  *     mi |= spread_64bits_by2(y_ind)<<YSHIFT
13814  */
13815   __pyx_v_mi = 0;
13816 
13817   /* "yt/utilities/lib/geometry_utils.pxd":238
13818  *     cdef np.uint64_t mi
13819  *     mi = 0
13820  *     mi |= spread_64bits_by2(z_ind)<<ZSHIFT             # <<<<<<<<<<<<<<
13821  *     mi |= spread_64bits_by2(y_ind)<<YSHIFT
13822  *     mi |= spread_64bits_by2(x_ind)<<XSHIFT
13823  */
13824   __pyx_v_mi = (__pyx_v_mi | (__pyx_f_2yt_9utilities_3lib_14geometry_utils_spread_64bits_by2(__pyx_v_z_ind) << 0));
13825 
13826   /* "yt/utilities/lib/geometry_utils.pxd":239
13827  *     mi = 0
13828  *     mi |= spread_64bits_by2(z_ind)<<ZSHIFT
13829  *     mi |= spread_64bits_by2(y_ind)<<YSHIFT             # <<<<<<<<<<<<<<
13830  *     mi |= spread_64bits_by2(x_ind)<<XSHIFT
13831  *     return mi
13832  */
13833   __pyx_v_mi = (__pyx_v_mi | (__pyx_f_2yt_9utilities_3lib_14geometry_utils_spread_64bits_by2(__pyx_v_y_ind) << 1));
13834 
13835   /* "yt/utilities/lib/geometry_utils.pxd":240
13836  *     mi |= spread_64bits_by2(z_ind)<<ZSHIFT
13837  *     mi |= spread_64bits_by2(y_ind)<<YSHIFT
13838  *     mi |= spread_64bits_by2(x_ind)<<XSHIFT             # <<<<<<<<<<<<<<
13839  *     return mi
13840  *
13841  */
13842   __pyx_v_mi = (__pyx_v_mi | (__pyx_f_2yt_9utilities_3lib_14geometry_utils_spread_64bits_by2(__pyx_v_x_ind) << 2));
13843 
13844   /* "yt/utilities/lib/geometry_utils.pxd":241
13845  *     mi |= spread_64bits_by2(y_ind)<<YSHIFT
13846  *     mi |= spread_64bits_by2(x_ind)<<XSHIFT
13847  *     return mi             # <<<<<<<<<<<<<<
13848  *
13849  * @cython.cdivision(True)
13850  */
13851   __pyx_r = __pyx_v_mi;
13852   goto __pyx_L0;
13853 
13854   /* "yt/utilities/lib/geometry_utils.pxd":235
13855  *
13856  * @cython.cdivision(True)
13857  * cdef inline np.uint64_t encode_morton_64bit(np.uint64_t x_ind, np.uint64_t y_ind, np.uint64_t z_ind):             # <<<<<<<<<<<<<<
13858  *     cdef np.uint64_t mi
13859  *     mi = 0
13860  */
13861 
13862   /* function exit code */
13863   __pyx_L0:;
13864   __Pyx_RefNannyFinishContext();
13865   return __pyx_r;
13866 }
13867 
13868 /* "yt/utilities/lib/geometry_utils.pxd":244
13869  *
13870  * @cython.cdivision(True)
13871  * cdef inline void decode_morton_64bit(np.uint64_t mi, np.uint64_t *p):             # <<<<<<<<<<<<<<
13872  *     p[0] = compact_64bits_by2(mi>>XSHIFT)
13873  *     p[1] = compact_64bits_by2(mi>>YSHIFT)
13874  */
13875 
__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)13876 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) {
13877   __Pyx_RefNannyDeclarations
13878   __Pyx_RefNannySetupContext("decode_morton_64bit", 0);
13879 
13880   /* "yt/utilities/lib/geometry_utils.pxd":245
13881  * @cython.cdivision(True)
13882  * cdef inline void decode_morton_64bit(np.uint64_t mi, np.uint64_t *p):
13883  *     p[0] = compact_64bits_by2(mi>>XSHIFT)             # <<<<<<<<<<<<<<
13884  *     p[1] = compact_64bits_by2(mi>>YSHIFT)
13885  *     p[2] = compact_64bits_by2(mi>>ZSHIFT)
13886  */
13887   (__pyx_v_p[0]) = __pyx_f_2yt_9utilities_3lib_14geometry_utils_compact_64bits_by2((__pyx_v_mi >> 2));
13888 
13889   /* "yt/utilities/lib/geometry_utils.pxd":246
13890  * cdef inline void decode_morton_64bit(np.uint64_t mi, np.uint64_t *p):
13891  *     p[0] = compact_64bits_by2(mi>>XSHIFT)
13892  *     p[1] = compact_64bits_by2(mi>>YSHIFT)             # <<<<<<<<<<<<<<
13893  *     p[2] = compact_64bits_by2(mi>>ZSHIFT)
13894  *
13895  */
13896   (__pyx_v_p[1]) = __pyx_f_2yt_9utilities_3lib_14geometry_utils_compact_64bits_by2((__pyx_v_mi >> 1));
13897 
13898   /* "yt/utilities/lib/geometry_utils.pxd":247
13899  *     p[0] = compact_64bits_by2(mi>>XSHIFT)
13900  *     p[1] = compact_64bits_by2(mi>>YSHIFT)
13901  *     p[2] = compact_64bits_by2(mi>>ZSHIFT)             # <<<<<<<<<<<<<<
13902  *
13903  * @cython.cdivision(True)
13904  */
13905   (__pyx_v_p[2]) = __pyx_f_2yt_9utilities_3lib_14geometry_utils_compact_64bits_by2((__pyx_v_mi >> 0));
13906 
13907   /* "yt/utilities/lib/geometry_utils.pxd":244
13908  *
13909  * @cython.cdivision(True)
13910  * cdef inline void decode_morton_64bit(np.uint64_t mi, np.uint64_t *p):             # <<<<<<<<<<<<<<
13911  *     p[0] = compact_64bits_by2(mi>>XSHIFT)
13912  *     p[1] = compact_64bits_by2(mi>>YSHIFT)
13913  */
13914 
13915   /* function exit code */
13916   __Pyx_RefNannyFinishContext();
13917 }
13918 
13919 /* "yt/utilities/lib/geometry_utils.pxd":250
13920  *
13921  * @cython.cdivision(True)
13922  * cdef inline np.uint64_t bounded_morton(np.float64_t x, np.float64_t y, np.float64_t z,             # <<<<<<<<<<<<<<
13923  *                                np.float64_t *DLE, np.float64_t *DRE, np.int32_t order):
13924  *     cdef int i
13925  */
13926 
__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)13927 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) {
13928   int __pyx_v_i;
13929   __pyx_t_5numpy_float64_t __pyx_v_dds[3];
13930   __pyx_t_5numpy_uint64_t __pyx_v_x_ind;
13931   __pyx_t_5numpy_uint64_t __pyx_v_y_ind;
13932   __pyx_t_5numpy_uint64_t __pyx_v_z_ind;
13933   __pyx_t_5numpy_uint64_t __pyx_v_mi;
13934   __pyx_t_5numpy_uint64_t __pyx_r;
13935   __Pyx_RefNannyDeclarations
13936   int __pyx_t_1;
13937   __Pyx_RefNannySetupContext("bounded_morton", 0);
13938 
13939   /* "yt/utilities/lib/geometry_utils.pxd":256
13940  *     cdef np.uint64_t x_ind, y_ind, z_ind
13941  *     cdef np.uint64_t mi
13942  *     for i in range(3):             # <<<<<<<<<<<<<<
13943  *         dds[i] = (DRE[i] - DLE[i]) / (1 << order)
13944  *     x_ind = <np.uint64_t> ((x - DLE[0])/dds[0])
13945  */
13946   for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
13947     __pyx_v_i = __pyx_t_1;
13948 
13949     /* "yt/utilities/lib/geometry_utils.pxd":257
13950  *     cdef np.uint64_t mi
13951  *     for i in range(3):
13952  *         dds[i] = (DRE[i] - DLE[i]) / (1 << order)             # <<<<<<<<<<<<<<
13953  *     x_ind = <np.uint64_t> ((x - DLE[0])/dds[0])
13954  *     y_ind = <np.uint64_t> ((y - DLE[1])/dds[1])
13955  */
13956     (__pyx_v_dds[__pyx_v_i]) = (((__pyx_v_DRE[__pyx_v_i]) - (__pyx_v_DLE[__pyx_v_i])) / (1 << __pyx_v_order));
13957   }
13958 
13959   /* "yt/utilities/lib/geometry_utils.pxd":258
13960  *     for i in range(3):
13961  *         dds[i] = (DRE[i] - DLE[i]) / (1 << order)
13962  *     x_ind = <np.uint64_t> ((x - DLE[0])/dds[0])             # <<<<<<<<<<<<<<
13963  *     y_ind = <np.uint64_t> ((y - DLE[1])/dds[1])
13964  *     z_ind = <np.uint64_t> ((z - DLE[2])/dds[2])
13965  */
13966   __pyx_v_x_ind = ((__pyx_t_5numpy_uint64_t)((__pyx_v_x - (__pyx_v_DLE[0])) / (__pyx_v_dds[0])));
13967 
13968   /* "yt/utilities/lib/geometry_utils.pxd":259
13969  *         dds[i] = (DRE[i] - DLE[i]) / (1 << order)
13970  *     x_ind = <np.uint64_t> ((x - DLE[0])/dds[0])
13971  *     y_ind = <np.uint64_t> ((y - DLE[1])/dds[1])             # <<<<<<<<<<<<<<
13972  *     z_ind = <np.uint64_t> ((z - DLE[2])/dds[2])
13973  *     mi = encode_morton_64bit(x_ind,y_ind,z_ind)
13974  */
13975   __pyx_v_y_ind = ((__pyx_t_5numpy_uint64_t)((__pyx_v_y - (__pyx_v_DLE[1])) / (__pyx_v_dds[1])));
13976 
13977   /* "yt/utilities/lib/geometry_utils.pxd":260
13978  *     x_ind = <np.uint64_t> ((x - DLE[0])/dds[0])
13979  *     y_ind = <np.uint64_t> ((y - DLE[1])/dds[1])
13980  *     z_ind = <np.uint64_t> ((z - DLE[2])/dds[2])             # <<<<<<<<<<<<<<
13981  *     mi = encode_morton_64bit(x_ind,y_ind,z_ind)
13982  *     return mi
13983  */
13984   __pyx_v_z_ind = ((__pyx_t_5numpy_uint64_t)((__pyx_v_z - (__pyx_v_DLE[2])) / (__pyx_v_dds[2])));
13985 
13986   /* "yt/utilities/lib/geometry_utils.pxd":261
13987  *     y_ind = <np.uint64_t> ((y - DLE[1])/dds[1])
13988  *     z_ind = <np.uint64_t> ((z - DLE[2])/dds[2])
13989  *     mi = encode_morton_64bit(x_ind,y_ind,z_ind)             # <<<<<<<<<<<<<<
13990  *     return mi
13991  *
13992  */
13993   __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);
13994 
13995   /* "yt/utilities/lib/geometry_utils.pxd":262
13996  *     z_ind = <np.uint64_t> ((z - DLE[2])/dds[2])
13997  *     mi = encode_morton_64bit(x_ind,y_ind,z_ind)
13998  *     return mi             # <<<<<<<<<<<<<<
13999  *
14000  * @cython.cdivision(True)
14001  */
14002   __pyx_r = __pyx_v_mi;
14003   goto __pyx_L0;
14004 
14005   /* "yt/utilities/lib/geometry_utils.pxd":250
14006  *
14007  * @cython.cdivision(True)
14008  * cdef inline np.uint64_t bounded_morton(np.float64_t x, np.float64_t y, np.float64_t z,             # <<<<<<<<<<<<<<
14009  *                                np.float64_t *DLE, np.float64_t *DRE, np.int32_t order):
14010  *     cdef int i
14011  */
14012 
14013   /* function exit code */
14014   __pyx_L0:;
14015   __Pyx_RefNannyFinishContext();
14016   return __pyx_r;
14017 }
14018 
14019 /* "yt/utilities/lib/geometry_utils.pxd":265
14020  *
14021  * @cython.cdivision(True)
14022  * cdef inline np.uint64_t bounded_morton_relative(np.float64_t x, np.float64_t y, np.float64_t z,             # <<<<<<<<<<<<<<
14023  *                                np.float64_t *DLE, np.float64_t *DRE,
14024  *                                np.int32_t order1, np.int32_t order2):
14025  */
14026 
__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)14027 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) {
14028   int __pyx_v_i;
14029   __pyx_t_5numpy_float64_t __pyx_v_dds1[3];
14030   __pyx_t_5numpy_float64_t __pyx_v_dds2[3];
14031   __pyx_t_5numpy_float64_t __pyx_v_DLE2[3];
14032   __pyx_t_5numpy_uint64_t __pyx_v_x_ind;
14033   __pyx_t_5numpy_uint64_t __pyx_v_y_ind;
14034   __pyx_t_5numpy_uint64_t __pyx_v_z_ind;
14035   __pyx_t_5numpy_uint64_t __pyx_v_mi2;
14036   __pyx_t_5numpy_uint64_t __pyx_r;
14037   __Pyx_RefNannyDeclarations
14038   int __pyx_t_1;
14039   __Pyx_RefNannySetupContext("bounded_morton_relative", 0);
14040 
14041   /* "yt/utilities/lib/geometry_utils.pxd":274
14042  *     cdef np.uint64_t x_ind, y_ind, z_ind
14043  *     cdef np.uint64_t mi2
14044  *     for i in range(3):             # <<<<<<<<<<<<<<
14045  *         dds1[i] = (DRE[i] - DLE[i]) / (1 << order1)
14046  *         dds2[i] = dds1[i] / (1 << order2)
14047  */
14048   for (__pyx_t_1 = 0; __pyx_t_1 < 3; __pyx_t_1+=1) {
14049     __pyx_v_i = __pyx_t_1;
14050 
14051     /* "yt/utilities/lib/geometry_utils.pxd":275
14052  *     cdef np.uint64_t mi2
14053  *     for i in range(3):
14054  *         dds1[i] = (DRE[i] - DLE[i]) / (1 << order1)             # <<<<<<<<<<<<<<
14055  *         dds2[i] = dds1[i] / (1 << order2)
14056  *     DLE2[0] = <np.float64_t> (<np.uint64_t> ((x - DLE[0])/dds1[0])) * dds1[0]
14057  */
14058     (__pyx_v_dds1[__pyx_v_i]) = (((__pyx_v_DRE[__pyx_v_i]) - (__pyx_v_DLE[__pyx_v_i])) / (1 << __pyx_v_order1));
14059 
14060     /* "yt/utilities/lib/geometry_utils.pxd":276
14061  *     for i in range(3):
14062  *         dds1[i] = (DRE[i] - DLE[i]) / (1 << order1)
14063  *         dds2[i] = dds1[i] / (1 << order2)             # <<<<<<<<<<<<<<
14064  *     DLE2[0] = <np.float64_t> (<np.uint64_t> ((x - DLE[0])/dds1[0])) * dds1[0]
14065  *     DLE2[1] = <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]
14066  */
14067     (__pyx_v_dds2[__pyx_v_i]) = ((__pyx_v_dds1[__pyx_v_i]) / (1 << __pyx_v_order2));
14068   }
14069 
14070   /* "yt/utilities/lib/geometry_utils.pxd":277
14071  *         dds1[i] = (DRE[i] - DLE[i]) / (1 << order1)
14072  *         dds2[i] = dds1[i] / (1 << order2)
14073  *     DLE2[0] = <np.float64_t> (<np.uint64_t> ((x - DLE[0])/dds1[0])) * dds1[0]             # <<<<<<<<<<<<<<
14074  *     DLE2[1] = <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]
14075  *     DLE2[2] = <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]
14076  */
14077   (__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]));
14078 
14079   /* "yt/utilities/lib/geometry_utils.pxd":278
14080  *         dds2[i] = dds1[i] / (1 << order2)
14081  *     DLE2[0] = <np.float64_t> (<np.uint64_t> ((x - DLE[0])/dds1[0])) * dds1[0]
14082  *     DLE2[1] = <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]             # <<<<<<<<<<<<<<
14083  *     DLE2[2] = <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]
14084  *     x_ind = <np.uint64_t> ((x - DLE2[0])/dds2[0])
14085  */
14086   (__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]));
14087 
14088   /* "yt/utilities/lib/geometry_utils.pxd":279
14089  *     DLE2[0] = <np.float64_t> (<np.uint64_t> ((x - DLE[0])/dds1[0])) * dds1[0]
14090  *     DLE2[1] = <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]
14091  *     DLE2[2] = <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]             # <<<<<<<<<<<<<<
14092  *     x_ind = <np.uint64_t> ((x - DLE2[0])/dds2[0])
14093  *     y_ind = <np.uint64_t> ((y - DLE2[1])/dds2[1])
14094  */
14095   (__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]));
14096 
14097   /* "yt/utilities/lib/geometry_utils.pxd":280
14098  *     DLE2[1] = <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]
14099  *     DLE2[2] = <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]
14100  *     x_ind = <np.uint64_t> ((x - DLE2[0])/dds2[0])             # <<<<<<<<<<<<<<
14101  *     y_ind = <np.uint64_t> ((y - DLE2[1])/dds2[1])
14102  *     z_ind = <np.uint64_t> ((z - DLE2[2])/dds2[2])
14103  */
14104   __pyx_v_x_ind = ((__pyx_t_5numpy_uint64_t)((__pyx_v_x - (__pyx_v_DLE2[0])) / (__pyx_v_dds2[0])));
14105 
14106   /* "yt/utilities/lib/geometry_utils.pxd":281
14107  *     DLE2[2] = <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]
14108  *     x_ind = <np.uint64_t> ((x - DLE2[0])/dds2[0])
14109  *     y_ind = <np.uint64_t> ((y - DLE2[1])/dds2[1])             # <<<<<<<<<<<<<<
14110  *     z_ind = <np.uint64_t> ((z - DLE2[2])/dds2[2])
14111  *     mi2 = encode_morton_64bit(x_ind,y_ind,z_ind)
14112  */
14113   __pyx_v_y_ind = ((__pyx_t_5numpy_uint64_t)((__pyx_v_y - (__pyx_v_DLE2[1])) / (__pyx_v_dds2[1])));
14114 
14115   /* "yt/utilities/lib/geometry_utils.pxd":282
14116  *     x_ind = <np.uint64_t> ((x - DLE2[0])/dds2[0])
14117  *     y_ind = <np.uint64_t> ((y - DLE2[1])/dds2[1])
14118  *     z_ind = <np.uint64_t> ((z - DLE2[2])/dds2[2])             # <<<<<<<<<<<<<<
14119  *     mi2 = encode_morton_64bit(x_ind,y_ind,z_ind)
14120  *     return mi2
14121  */
14122   __pyx_v_z_ind = ((__pyx_t_5numpy_uint64_t)((__pyx_v_z - (__pyx_v_DLE2[2])) / (__pyx_v_dds2[2])));
14123 
14124   /* "yt/utilities/lib/geometry_utils.pxd":283
14125  *     y_ind = <np.uint64_t> ((y - DLE2[1])/dds2[1])
14126  *     z_ind = <np.uint64_t> ((z - DLE2[2])/dds2[2])
14127  *     mi2 = encode_morton_64bit(x_ind,y_ind,z_ind)             # <<<<<<<<<<<<<<
14128  *     return mi2
14129  *
14130  */
14131   __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);
14132 
14133   /* "yt/utilities/lib/geometry_utils.pxd":284
14134  *     z_ind = <np.uint64_t> ((z - DLE2[2])/dds2[2])
14135  *     mi2 = encode_morton_64bit(x_ind,y_ind,z_ind)
14136  *     return mi2             # <<<<<<<<<<<<<<
14137  *
14138  *
14139  */
14140   __pyx_r = __pyx_v_mi2;
14141   goto __pyx_L0;
14142 
14143   /* "yt/utilities/lib/geometry_utils.pxd":265
14144  *
14145  * @cython.cdivision(True)
14146  * cdef inline np.uint64_t bounded_morton_relative(np.float64_t x, np.float64_t y, np.float64_t z,             # <<<<<<<<<<<<<<
14147  *                                np.float64_t *DLE, np.float64_t *DRE,
14148  *                                np.int32_t order1, np.int32_t order2):
14149  */
14150 
14151   /* function exit code */
14152   __pyx_L0:;
14153   __Pyx_RefNannyFinishContext();
14154   return __pyx_r;
14155 }
14156 
14157 /* "yt/utilities/lib/geometry_utils.pxd":289
14158  * # This dosn't seem to be much, if at all, faster...
14159  * @cython.cdivision(True)
14160  * cdef inline np.uint64_t bounded_morton_dds(np.float64_t x, np.float64_t y, np.float64_t z,             # <<<<<<<<<<<<<<
14161  *                                np.float64_t *DLE, np.float64_t *dds):
14162  *     cdef np.uint64_t x_ind, y_ind, z_ind
14163  */
14164 
__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)14165 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) {
14166   __pyx_t_5numpy_uint64_t __pyx_v_x_ind;
14167   __pyx_t_5numpy_uint64_t __pyx_v_y_ind;
14168   __pyx_t_5numpy_uint64_t __pyx_v_z_ind;
14169   __pyx_t_5numpy_uint64_t __pyx_v_mi;
14170   __pyx_t_5numpy_uint64_t __pyx_r;
14171   __Pyx_RefNannyDeclarations
14172   __Pyx_RefNannySetupContext("bounded_morton_dds", 0);
14173 
14174   /* "yt/utilities/lib/geometry_utils.pxd":293
14175  *     cdef np.uint64_t x_ind, y_ind, z_ind
14176  *     cdef np.uint64_t mi
14177  *     x_ind = <np.uint64_t> ((x - DLE[0])/dds[0])             # <<<<<<<<<<<<<<
14178  *     y_ind = <np.uint64_t> ((y - DLE[1])/dds[1])
14179  *     z_ind = <np.uint64_t> ((z - DLE[2])/dds[2])
14180  */
14181   __pyx_v_x_ind = ((__pyx_t_5numpy_uint64_t)((__pyx_v_x - (__pyx_v_DLE[0])) / (__pyx_v_dds[0])));
14182 
14183   /* "yt/utilities/lib/geometry_utils.pxd":294
14184  *     cdef np.uint64_t mi
14185  *     x_ind = <np.uint64_t> ((x - DLE[0])/dds[0])
14186  *     y_ind = <np.uint64_t> ((y - DLE[1])/dds[1])             # <<<<<<<<<<<<<<
14187  *     z_ind = <np.uint64_t> ((z - DLE[2])/dds[2])
14188  *     mi = encode_morton_64bit(x_ind,y_ind,z_ind)
14189  */
14190   __pyx_v_y_ind = ((__pyx_t_5numpy_uint64_t)((__pyx_v_y - (__pyx_v_DLE[1])) / (__pyx_v_dds[1])));
14191 
14192   /* "yt/utilities/lib/geometry_utils.pxd":295
14193  *     x_ind = <np.uint64_t> ((x - DLE[0])/dds[0])
14194  *     y_ind = <np.uint64_t> ((y - DLE[1])/dds[1])
14195  *     z_ind = <np.uint64_t> ((z - DLE[2])/dds[2])             # <<<<<<<<<<<<<<
14196  *     mi = encode_morton_64bit(x_ind,y_ind,z_ind)
14197  *     return mi
14198  */
14199   __pyx_v_z_ind = ((__pyx_t_5numpy_uint64_t)((__pyx_v_z - (__pyx_v_DLE[2])) / (__pyx_v_dds[2])));
14200 
14201   /* "yt/utilities/lib/geometry_utils.pxd":296
14202  *     y_ind = <np.uint64_t> ((y - DLE[1])/dds[1])
14203  *     z_ind = <np.uint64_t> ((z - DLE[2])/dds[2])
14204  *     mi = encode_morton_64bit(x_ind,y_ind,z_ind)             # <<<<<<<<<<<<<<
14205  *     return mi
14206  *
14207  */
14208   __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);
14209 
14210   /* "yt/utilities/lib/geometry_utils.pxd":297
14211  *     z_ind = <np.uint64_t> ((z - DLE[2])/dds[2])
14212  *     mi = encode_morton_64bit(x_ind,y_ind,z_ind)
14213  *     return mi             # <<<<<<<<<<<<<<
14214  *
14215  * @cython.cdivision(True)
14216  */
14217   __pyx_r = __pyx_v_mi;
14218   goto __pyx_L0;
14219 
14220   /* "yt/utilities/lib/geometry_utils.pxd":289
14221  * # This dosn't seem to be much, if at all, faster...
14222  * @cython.cdivision(True)
14223  * cdef inline np.uint64_t bounded_morton_dds(np.float64_t x, np.float64_t y, np.float64_t z,             # <<<<<<<<<<<<<<
14224  *                                np.float64_t *DLE, np.float64_t *dds):
14225  *     cdef np.uint64_t x_ind, y_ind, z_ind
14226  */
14227 
14228   /* function exit code */
14229   __pyx_L0:;
14230   __Pyx_RefNannyFinishContext();
14231   return __pyx_r;
14232 }
14233 
14234 /* "yt/utilities/lib/geometry_utils.pxd":300
14235  *
14236  * @cython.cdivision(True)
14237  * cdef inline np.uint64_t bounded_morton_relative_dds(np.float64_t x, np.float64_t y, np.float64_t z,             # <<<<<<<<<<<<<<
14238  *                                np.float64_t *DLE, np.float64_t *dds1, np.float64_t *dds2):
14239  *     cdef np.float64_t DLE2[3]
14240  */
14241 
__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)14242 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) {
14243   __pyx_t_5numpy_float64_t __pyx_v_DLE2[3];
14244   __pyx_t_5numpy_uint64_t __pyx_v_x_ind;
14245   __pyx_t_5numpy_uint64_t __pyx_v_y_ind;
14246   __pyx_t_5numpy_uint64_t __pyx_v_z_ind;
14247   __pyx_t_5numpy_uint64_t __pyx_v_mi2;
14248   __pyx_t_5numpy_uint64_t __pyx_r;
14249   __Pyx_RefNannyDeclarations
14250   __Pyx_RefNannySetupContext("bounded_morton_relative_dds", 0);
14251 
14252   /* "yt/utilities/lib/geometry_utils.pxd":305
14253  *     cdef np.uint64_t x_ind, y_ind, z_ind
14254  *     cdef np.uint64_t mi2
14255  *     DLE2[0] = <np.float64_t> (<np.uint64_t> ((x - DLE[0])/dds1[0])) * dds1[0]             # <<<<<<<<<<<<<<
14256  *     DLE2[1] = <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]
14257  *     DLE2[2] = <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]
14258  */
14259   (__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]));
14260 
14261   /* "yt/utilities/lib/geometry_utils.pxd":306
14262  *     cdef np.uint64_t mi2
14263  *     DLE2[0] = <np.float64_t> (<np.uint64_t> ((x - DLE[0])/dds1[0])) * dds1[0]
14264  *     DLE2[1] = <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]             # <<<<<<<<<<<<<<
14265  *     DLE2[2] = <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]
14266  *     x_ind = <np.uint64_t> ((x - DLE2[0])/dds2[0])
14267  */
14268   (__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]));
14269 
14270   /* "yt/utilities/lib/geometry_utils.pxd":307
14271  *     DLE2[0] = <np.float64_t> (<np.uint64_t> ((x - DLE[0])/dds1[0])) * dds1[0]
14272  *     DLE2[1] = <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]
14273  *     DLE2[2] = <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]             # <<<<<<<<<<<<<<
14274  *     x_ind = <np.uint64_t> ((x - DLE2[0])/dds2[0])
14275  *     y_ind = <np.uint64_t> ((y - DLE2[1])/dds2[1])
14276  */
14277   (__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]));
14278 
14279   /* "yt/utilities/lib/geometry_utils.pxd":308
14280  *     DLE2[1] = <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]
14281  *     DLE2[2] = <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]
14282  *     x_ind = <np.uint64_t> ((x - DLE2[0])/dds2[0])             # <<<<<<<<<<<<<<
14283  *     y_ind = <np.uint64_t> ((y - DLE2[1])/dds2[1])
14284  *     z_ind = <np.uint64_t> ((z - DLE2[2])/dds2[2])
14285  */
14286   __pyx_v_x_ind = ((__pyx_t_5numpy_uint64_t)((__pyx_v_x - (__pyx_v_DLE2[0])) / (__pyx_v_dds2[0])));
14287 
14288   /* "yt/utilities/lib/geometry_utils.pxd":309
14289  *     DLE2[2] = <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]
14290  *     x_ind = <np.uint64_t> ((x - DLE2[0])/dds2[0])
14291  *     y_ind = <np.uint64_t> ((y - DLE2[1])/dds2[1])             # <<<<<<<<<<<<<<
14292  *     z_ind = <np.uint64_t> ((z - DLE2[2])/dds2[2])
14293  *     mi2 = encode_morton_64bit(x_ind,y_ind,z_ind)
14294  */
14295   __pyx_v_y_ind = ((__pyx_t_5numpy_uint64_t)((__pyx_v_y - (__pyx_v_DLE2[1])) / (__pyx_v_dds2[1])));
14296 
14297   /* "yt/utilities/lib/geometry_utils.pxd":310
14298  *     x_ind = <np.uint64_t> ((x - DLE2[0])/dds2[0])
14299  *     y_ind = <np.uint64_t> ((y - DLE2[1])/dds2[1])
14300  *     z_ind = <np.uint64_t> ((z - DLE2[2])/dds2[2])             # <<<<<<<<<<<<<<
14301  *     mi2 = encode_morton_64bit(x_ind,y_ind,z_ind)
14302  *     return mi2
14303  */
14304   __pyx_v_z_ind = ((__pyx_t_5numpy_uint64_t)((__pyx_v_z - (__pyx_v_DLE2[2])) / (__pyx_v_dds2[2])));
14305 
14306   /* "yt/utilities/lib/geometry_utils.pxd":311
14307  *     y_ind = <np.uint64_t> ((y - DLE2[1])/dds2[1])
14308  *     z_ind = <np.uint64_t> ((z - DLE2[2])/dds2[2])
14309  *     mi2 = encode_morton_64bit(x_ind,y_ind,z_ind)             # <<<<<<<<<<<<<<
14310  *     return mi2
14311  *
14312  */
14313   __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);
14314 
14315   /* "yt/utilities/lib/geometry_utils.pxd":312
14316  *     z_ind = <np.uint64_t> ((z - DLE2[2])/dds2[2])
14317  *     mi2 = encode_morton_64bit(x_ind,y_ind,z_ind)
14318  *     return mi2             # <<<<<<<<<<<<<<
14319  *
14320  *
14321  */
14322   __pyx_r = __pyx_v_mi2;
14323   goto __pyx_L0;
14324 
14325   /* "yt/utilities/lib/geometry_utils.pxd":300
14326  *
14327  * @cython.cdivision(True)
14328  * cdef inline np.uint64_t bounded_morton_relative_dds(np.float64_t x, np.float64_t y, np.float64_t z,             # <<<<<<<<<<<<<<
14329  *                                np.float64_t *DLE, np.float64_t *dds1, np.float64_t *dds2):
14330  *     cdef np.float64_t DLE2[3]
14331  */
14332 
14333   /* function exit code */
14334   __pyx_L0:;
14335   __Pyx_RefNannyFinishContext();
14336   return __pyx_r;
14337 }
14338 
14339 /* "yt/utilities/lib/geometry_utils.pxd":316
14340  *
14341  * @cython.cdivision(True)
14342  * cdef inline np.uint64_t bounded_morton_split_dds(np.float64_t x, np.float64_t y, np.float64_t z,             # <<<<<<<<<<<<<<
14343  *                                np.float64_t *DLE, np.float64_t *dds, np.uint64_t *p):
14344  *     cdef np.uint64_t mi
14345  */
14346 
__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)14347 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) {
14348   __pyx_t_5numpy_uint64_t __pyx_v_mi;
14349   __pyx_t_5numpy_uint64_t __pyx_r;
14350   __Pyx_RefNannyDeclarations
14351   __Pyx_RefNannySetupContext("bounded_morton_split_dds", 0);
14352 
14353   /* "yt/utilities/lib/geometry_utils.pxd":319
14354  *                                np.float64_t *DLE, np.float64_t *dds, np.uint64_t *p):
14355  *     cdef np.uint64_t mi
14356  *     p[0] = <np.uint64_t> ((x - DLE[0])/dds[0])             # <<<<<<<<<<<<<<
14357  *     p[1] = <np.uint64_t> ((y - DLE[1])/dds[1])
14358  *     p[2] = <np.uint64_t> ((z - DLE[2])/dds[2])
14359  */
14360   (__pyx_v_p[0]) = ((__pyx_t_5numpy_uint64_t)((__pyx_v_x - (__pyx_v_DLE[0])) / (__pyx_v_dds[0])));
14361 
14362   /* "yt/utilities/lib/geometry_utils.pxd":320
14363  *     cdef np.uint64_t mi
14364  *     p[0] = <np.uint64_t> ((x - DLE[0])/dds[0])
14365  *     p[1] = <np.uint64_t> ((y - DLE[1])/dds[1])             # <<<<<<<<<<<<<<
14366  *     p[2] = <np.uint64_t> ((z - DLE[2])/dds[2])
14367  *     mi = encode_morton_64bit(p[0], p[1], p[2])
14368  */
14369   (__pyx_v_p[1]) = ((__pyx_t_5numpy_uint64_t)((__pyx_v_y - (__pyx_v_DLE[1])) / (__pyx_v_dds[1])));
14370 
14371   /* "yt/utilities/lib/geometry_utils.pxd":321
14372  *     p[0] = <np.uint64_t> ((x - DLE[0])/dds[0])
14373  *     p[1] = <np.uint64_t> ((y - DLE[1])/dds[1])
14374  *     p[2] = <np.uint64_t> ((z - DLE[2])/dds[2])             # <<<<<<<<<<<<<<
14375  *     mi = encode_morton_64bit(p[0], p[1], p[2])
14376  *     return mi
14377  */
14378   (__pyx_v_p[2]) = ((__pyx_t_5numpy_uint64_t)((__pyx_v_z - (__pyx_v_DLE[2])) / (__pyx_v_dds[2])));
14379 
14380   /* "yt/utilities/lib/geometry_utils.pxd":322
14381  *     p[1] = <np.uint64_t> ((y - DLE[1])/dds[1])
14382  *     p[2] = <np.uint64_t> ((z - DLE[2])/dds[2])
14383  *     mi = encode_morton_64bit(p[0], p[1], p[2])             # <<<<<<<<<<<<<<
14384  *     return mi
14385  *
14386  */
14387   __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]));
14388 
14389   /* "yt/utilities/lib/geometry_utils.pxd":323
14390  *     p[2] = <np.uint64_t> ((z - DLE[2])/dds[2])
14391  *     mi = encode_morton_64bit(p[0], p[1], p[2])
14392  *     return mi             # <<<<<<<<<<<<<<
14393  *
14394  * @cython.cdivision(True)
14395  */
14396   __pyx_r = __pyx_v_mi;
14397   goto __pyx_L0;
14398 
14399   /* "yt/utilities/lib/geometry_utils.pxd":316
14400  *
14401  * @cython.cdivision(True)
14402  * cdef inline np.uint64_t bounded_morton_split_dds(np.float64_t x, np.float64_t y, np.float64_t z,             # <<<<<<<<<<<<<<
14403  *                                np.float64_t *DLE, np.float64_t *dds, np.uint64_t *p):
14404  *     cdef np.uint64_t mi
14405  */
14406 
14407   /* function exit code */
14408   __pyx_L0:;
14409   __Pyx_RefNannyFinishContext();
14410   return __pyx_r;
14411 }
14412 
14413 /* "yt/utilities/lib/geometry_utils.pxd":326
14414  *
14415  * @cython.cdivision(True)
14416  * cdef inline np.uint64_t bounded_morton_split_relative_dds(np.float64_t x, np.float64_t y, np.float64_t z,             # <<<<<<<<<<<<<<
14417  *                                np.float64_t *DLE, np.float64_t *dds1, np.float64_t *dds2,
14418  *                                np.uint64_t *p2):
14419  */
14420 
__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)14421 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) {
14422   __pyx_t_5numpy_float64_t __pyx_v_DLE2[3];
14423   __pyx_t_5numpy_uint64_t __pyx_v_mi2;
14424   __pyx_t_5numpy_uint64_t __pyx_r;
14425   __Pyx_RefNannyDeclarations
14426   __Pyx_RefNannySetupContext("bounded_morton_split_relative_dds", 0);
14427 
14428   /* "yt/utilities/lib/geometry_utils.pxd":331
14429  *     cdef np.float64_t DLE2[3]
14430  *     cdef np.uint64_t mi2
14431  *     DLE2[0] = DLE[0] + <np.float64_t> (<np.uint64_t> ((x - DLE[0])/dds1[0])) * dds1[0]             # <<<<<<<<<<<<<<
14432  *     DLE2[1] = DLE[1] + <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]
14433  *     DLE2[2] = DLE[2] + <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]
14434  */
14435   (__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])));
14436 
14437   /* "yt/utilities/lib/geometry_utils.pxd":332
14438  *     cdef np.uint64_t mi2
14439  *     DLE2[0] = DLE[0] + <np.float64_t> (<np.uint64_t> ((x - DLE[0])/dds1[0])) * dds1[0]
14440  *     DLE2[1] = DLE[1] + <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]             # <<<<<<<<<<<<<<
14441  *     DLE2[2] = DLE[2] + <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]
14442  *     p2[0] = <np.uint64_t> ((x - DLE2[0])/dds2[0])
14443  */
14444   (__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])));
14445 
14446   /* "yt/utilities/lib/geometry_utils.pxd":333
14447  *     DLE2[0] = DLE[0] + <np.float64_t> (<np.uint64_t> ((x - DLE[0])/dds1[0])) * dds1[0]
14448  *     DLE2[1] = DLE[1] + <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]
14449  *     DLE2[2] = DLE[2] + <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]             # <<<<<<<<<<<<<<
14450  *     p2[0] = <np.uint64_t> ((x - DLE2[0])/dds2[0])
14451  *     p2[1] = <np.uint64_t> ((y - DLE2[1])/dds2[1])
14452  */
14453   (__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])));
14454 
14455   /* "yt/utilities/lib/geometry_utils.pxd":334
14456  *     DLE2[1] = DLE[1] + <np.float64_t> (<np.uint64_t> ((y - DLE[1])/dds1[1])) * dds1[1]
14457  *     DLE2[2] = DLE[2] + <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]
14458  *     p2[0] = <np.uint64_t> ((x - DLE2[0])/dds2[0])             # <<<<<<<<<<<<<<
14459  *     p2[1] = <np.uint64_t> ((y - DLE2[1])/dds2[1])
14460  *     p2[2] = <np.uint64_t> ((z - DLE2[2])/dds2[2])
14461  */
14462   (__pyx_v_p2[0]) = ((__pyx_t_5numpy_uint64_t)((__pyx_v_x - (__pyx_v_DLE2[0])) / (__pyx_v_dds2[0])));
14463 
14464   /* "yt/utilities/lib/geometry_utils.pxd":335
14465  *     DLE2[2] = DLE[2] + <np.float64_t> (<np.uint64_t> ((z - DLE[2])/dds1[2])) * dds1[2]
14466  *     p2[0] = <np.uint64_t> ((x - DLE2[0])/dds2[0])
14467  *     p2[1] = <np.uint64_t> ((y - DLE2[1])/dds2[1])             # <<<<<<<<<<<<<<
14468  *     p2[2] = <np.uint64_t> ((z - DLE2[2])/dds2[2])
14469  *     mi2 = encode_morton_64bit(p2[0], p2[1], p2[2])
14470  */
14471   (__pyx_v_p2[1]) = ((__pyx_t_5numpy_uint64_t)((__pyx_v_y - (__pyx_v_DLE2[1])) / (__pyx_v_dds2[1])));
14472 
14473   /* "yt/utilities/lib/geometry_utils.pxd":336
14474  *     p2[0] = <np.uint64_t> ((x - DLE2[0])/dds2[0])
14475  *     p2[1] = <np.uint64_t> ((y - DLE2[1])/dds2[1])
14476  *     p2[2] = <np.uint64_t> ((z - DLE2[2])/dds2[2])             # <<<<<<<<<<<<<<
14477  *     mi2 = encode_morton_64bit(p2[0], p2[1], p2[2])
14478  *     return mi2
14479  */
14480   (__pyx_v_p2[2]) = ((__pyx_t_5numpy_uint64_t)((__pyx_v_z - (__pyx_v_DLE2[2])) / (__pyx_v_dds2[2])));
14481 
14482   /* "yt/utilities/lib/geometry_utils.pxd":337
14483  *     p2[1] = <np.uint64_t> ((y - DLE2[1])/dds2[1])
14484  *     p2[2] = <np.uint64_t> ((z - DLE2[2])/dds2[2])
14485  *     mi2 = encode_morton_64bit(p2[0], p2[1], p2[2])             # <<<<<<<<<<<<<<
14486  *     return mi2
14487  *
14488  */
14489   __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]));
14490 
14491   /* "yt/utilities/lib/geometry_utils.pxd":338
14492  *     p2[2] = <np.uint64_t> ((z - DLE2[2])/dds2[2])
14493  *     mi2 = encode_morton_64bit(p2[0], p2[1], p2[2])
14494  *     return mi2             # <<<<<<<<<<<<<<
14495  *
14496  *
14497  */
14498   __pyx_r = __pyx_v_mi2;
14499   goto __pyx_L0;
14500 
14501   /* "yt/utilities/lib/geometry_utils.pxd":326
14502  *
14503  * @cython.cdivision(True)
14504  * cdef inline np.uint64_t bounded_morton_split_relative_dds(np.float64_t x, np.float64_t y, np.float64_t z,             # <<<<<<<<<<<<<<
14505  *                                np.float64_t *DLE, np.float64_t *dds1, np.float64_t *dds2,
14506  *                                np.uint64_t *p2):
14507  */
14508 
14509   /* function exit code */
14510   __pyx_L0:;
14511   __Pyx_RefNannyFinishContext();
14512   return __pyx_r;
14513 }
14514 
14515 /* "yt/geometry/selection_routines.pxd":81
14516  *     cdef public SelectorObject sel2
14517  *
14518  * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2,             # <<<<<<<<<<<<<<
14519  *                                         np.float64_t dw, bint periodic) nogil:
14520  *     cdef np.float64_t rel = x1 - x2
14521  */
14522 
__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)14523 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) {
14524   __pyx_t_5numpy_float64_t __pyx_v_rel;
14525   __pyx_t_5numpy_float64_t __pyx_r;
14526   int __pyx_t_1;
14527 
14528   /* "yt/geometry/selection_routines.pxd":83
14529  * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2,
14530  *                                         np.float64_t dw, bint periodic) nogil:
14531  *     cdef np.float64_t rel = x1 - x2             # <<<<<<<<<<<<<<
14532  *     if not periodic: return rel
14533  *     if rel > dw * 0.5:
14534  */
14535   __pyx_v_rel = (__pyx_v_x1 - __pyx_v_x2);
14536 
14537   /* "yt/geometry/selection_routines.pxd":84
14538  *                                         np.float64_t dw, bint periodic) nogil:
14539  *     cdef np.float64_t rel = x1 - x2
14540  *     if not periodic: return rel             # <<<<<<<<<<<<<<
14541  *     if rel > dw * 0.5:
14542  *         rel -= dw
14543  */
14544   __pyx_t_1 = ((!(__pyx_v_periodic != 0)) != 0);
14545   if (__pyx_t_1) {
14546     __pyx_r = __pyx_v_rel;
14547     goto __pyx_L0;
14548   }
14549 
14550   /* "yt/geometry/selection_routines.pxd":85
14551  *     cdef np.float64_t rel = x1 - x2
14552  *     if not periodic: return rel
14553  *     if rel > dw * 0.5:             # <<<<<<<<<<<<<<
14554  *         rel -= dw
14555  *     elif rel < -dw * 0.5:
14556  */
14557   __pyx_t_1 = ((__pyx_v_rel > (__pyx_v_dw * 0.5)) != 0);
14558   if (__pyx_t_1) {
14559 
14560     /* "yt/geometry/selection_routines.pxd":86
14561  *     if not periodic: return rel
14562  *     if rel > dw * 0.5:
14563  *         rel -= dw             # <<<<<<<<<<<<<<
14564  *     elif rel < -dw * 0.5:
14565  *         rel += dw
14566  */
14567     __pyx_v_rel = (__pyx_v_rel - __pyx_v_dw);
14568 
14569     /* "yt/geometry/selection_routines.pxd":85
14570  *     cdef np.float64_t rel = x1 - x2
14571  *     if not periodic: return rel
14572  *     if rel > dw * 0.5:             # <<<<<<<<<<<<<<
14573  *         rel -= dw
14574  *     elif rel < -dw * 0.5:
14575  */
14576     goto __pyx_L4;
14577   }
14578 
14579   /* "yt/geometry/selection_routines.pxd":87
14580  *     if rel > dw * 0.5:
14581  *         rel -= dw
14582  *     elif rel < -dw * 0.5:             # <<<<<<<<<<<<<<
14583  *         rel += dw
14584  *     return rel
14585  */
14586   __pyx_t_1 = ((__pyx_v_rel < ((-__pyx_v_dw) * 0.5)) != 0);
14587   if (__pyx_t_1) {
14588 
14589     /* "yt/geometry/selection_routines.pxd":88
14590  *         rel -= dw
14591  *     elif rel < -dw * 0.5:
14592  *         rel += dw             # <<<<<<<<<<<<<<
14593  *     return rel
14594  */
14595     __pyx_v_rel = (__pyx_v_rel + __pyx_v_dw);
14596 
14597     /* "yt/geometry/selection_routines.pxd":87
14598  *     if rel > dw * 0.5:
14599  *         rel -= dw
14600  *     elif rel < -dw * 0.5:             # <<<<<<<<<<<<<<
14601  *         rel += dw
14602  *     return rel
14603  */
14604   }
14605   __pyx_L4:;
14606 
14607   /* "yt/geometry/selection_routines.pxd":89
14608  *     elif rel < -dw * 0.5:
14609  *         rel += dw
14610  *     return rel             # <<<<<<<<<<<<<<
14611  */
14612   __pyx_r = __pyx_v_rel;
14613   goto __pyx_L0;
14614 
14615   /* "yt/geometry/selection_routines.pxd":81
14616  *     cdef public SelectorObject sel2
14617  *
14618  * cdef inline np.float64_t _periodic_dist(np.float64_t x1, np.float64_t x2,             # <<<<<<<<<<<<<<
14619  *                                         np.float64_t dw, bint periodic) nogil:
14620  *     cdef np.float64_t rel = x1 - x2
14621  */
14622 
14623   /* function exit code */
14624   __pyx_L0:;
14625   return __pyx_r;
14626 }
14627 
14628 /* "yt/utilities/lib/bitarray.pxd":15
14629  *
14630  *
14631  * cdef inline void ba_set_value(np.uint8_t *buf, np.uint64_t ind,             # <<<<<<<<<<<<<<
14632  *                               np.uint8_t val) nogil:
14633  *     # This assumes 8 bit buffer
14634  */
14635 
__pyx_f_2yt_9utilities_3lib_8bitarray_ba_set_value(__pyx_t_5numpy_uint8_t * __pyx_v_buf,__pyx_t_5numpy_uint64_t __pyx_v_ind,__pyx_t_5numpy_uint8_t __pyx_v_val)14636 static CYTHON_INLINE void __pyx_f_2yt_9utilities_3lib_8bitarray_ba_set_value(__pyx_t_5numpy_uint8_t *__pyx_v_buf, __pyx_t_5numpy_uint64_t __pyx_v_ind, __pyx_t_5numpy_uint8_t __pyx_v_val) {
14637   int __pyx_t_1;
14638   __pyx_t_5numpy_uint64_t __pyx_t_2;
14639 
14640   /* "yt/utilities/lib/bitarray.pxd":18
14641  *                               np.uint8_t val) nogil:
14642  *     # This assumes 8 bit buffer
14643  *     if val > 0:             # <<<<<<<<<<<<<<
14644  *         buf[ind >> 3] |= (1 << (ind & 7))
14645  *     else:
14646  */
14647   __pyx_t_1 = ((__pyx_v_val > 0) != 0);
14648   if (__pyx_t_1) {
14649 
14650     /* "yt/utilities/lib/bitarray.pxd":19
14651  *     # This assumes 8 bit buffer
14652  *     if val > 0:
14653  *         buf[ind >> 3] |= (1 << (ind & 7))             # <<<<<<<<<<<<<<
14654  *     else:
14655  *         buf[ind >> 3] &= ~(1 << (ind & 7))
14656  */
14657     __pyx_t_2 = (__pyx_v_ind >> 3);
14658     (__pyx_v_buf[__pyx_t_2]) = ((__pyx_v_buf[__pyx_t_2]) | (1 << (__pyx_v_ind & 7)));
14659 
14660     /* "yt/utilities/lib/bitarray.pxd":18
14661  *                               np.uint8_t val) nogil:
14662  *     # This assumes 8 bit buffer
14663  *     if val > 0:             # <<<<<<<<<<<<<<
14664  *         buf[ind >> 3] |= (1 << (ind & 7))
14665  *     else:
14666  */
14667     goto __pyx_L3;
14668   }
14669 
14670   /* "yt/utilities/lib/bitarray.pxd":21
14671  *         buf[ind >> 3] |= (1 << (ind & 7))
14672  *     else:
14673  *         buf[ind >> 3] &= ~(1 << (ind & 7))             # <<<<<<<<<<<<<<
14674  *
14675  * cdef inline np.uint8_t ba_get_value(np.uint8_t *buf, np.uint64_t ind) nogil:
14676  */
14677   /*else*/ {
14678     __pyx_t_2 = (__pyx_v_ind >> 3);
14679     (__pyx_v_buf[__pyx_t_2]) = ((__pyx_v_buf[__pyx_t_2]) & (~(1 << (__pyx_v_ind & 7))));
14680   }
14681   __pyx_L3:;
14682 
14683   /* "yt/utilities/lib/bitarray.pxd":15
14684  *
14685  *
14686  * cdef inline void ba_set_value(np.uint8_t *buf, np.uint64_t ind,             # <<<<<<<<<<<<<<
14687  *                               np.uint8_t val) nogil:
14688  *     # This assumes 8 bit buffer
14689  */
14690 
14691   /* function exit code */
14692 }
14693 
14694 /* "yt/utilities/lib/bitarray.pxd":23
14695  *         buf[ind >> 3] &= ~(1 << (ind & 7))
14696  *
14697  * cdef inline np.uint8_t ba_get_value(np.uint8_t *buf, np.uint64_t ind) nogil:             # <<<<<<<<<<<<<<
14698  *     cdef np.uint8_t rv = (buf[ind >> 3] & (1 << (ind & 7)))
14699  *     if rv == 0: return 0
14700  */
14701 
__pyx_f_2yt_9utilities_3lib_8bitarray_ba_get_value(__pyx_t_5numpy_uint8_t * __pyx_v_buf,__pyx_t_5numpy_uint64_t __pyx_v_ind)14702 static CYTHON_INLINE __pyx_t_5numpy_uint8_t __pyx_f_2yt_9utilities_3lib_8bitarray_ba_get_value(__pyx_t_5numpy_uint8_t *__pyx_v_buf, __pyx_t_5numpy_uint64_t __pyx_v_ind) {
14703   __pyx_t_5numpy_uint8_t __pyx_v_rv;
14704   __pyx_t_5numpy_uint8_t __pyx_r;
14705   int __pyx_t_1;
14706 
14707   /* "yt/utilities/lib/bitarray.pxd":24
14708  *
14709  * cdef inline np.uint8_t ba_get_value(np.uint8_t *buf, np.uint64_t ind) nogil:
14710  *     cdef np.uint8_t rv = (buf[ind >> 3] & (1 << (ind & 7)))             # <<<<<<<<<<<<<<
14711  *     if rv == 0: return 0
14712  *     return 1
14713  */
14714   __pyx_v_rv = ((__pyx_v_buf[(__pyx_v_ind >> 3)]) & (1 << (__pyx_v_ind & 7)));
14715 
14716   /* "yt/utilities/lib/bitarray.pxd":25
14717  * cdef inline np.uint8_t ba_get_value(np.uint8_t *buf, np.uint64_t ind) nogil:
14718  *     cdef np.uint8_t rv = (buf[ind >> 3] & (1 << (ind & 7)))
14719  *     if rv == 0: return 0             # <<<<<<<<<<<<<<
14720  *     return 1
14721  *
14722  */
14723   __pyx_t_1 = ((__pyx_v_rv == 0) != 0);
14724   if (__pyx_t_1) {
14725     __pyx_r = 0;
14726     goto __pyx_L0;
14727   }
14728 
14729   /* "yt/utilities/lib/bitarray.pxd":26
14730  *     cdef np.uint8_t rv = (buf[ind >> 3] & (1 << (ind & 7)))
14731  *     if rv == 0: return 0
14732  *     return 1             # <<<<<<<<<<<<<<
14733  *
14734  * cdef class bitarray:
14735  */
14736   __pyx_r = 1;
14737   goto __pyx_L0;
14738 
14739   /* "yt/utilities/lib/bitarray.pxd":23
14740  *         buf[ind >> 3] &= ~(1 << (ind & 7))
14741  *
14742  * cdef inline np.uint8_t ba_get_value(np.uint8_t *buf, np.uint64_t ind) nogil:             # <<<<<<<<<<<<<<
14743  *     cdef np.uint8_t rv = (buf[ind >> 3] & (1 << (ind & 7)))
14744  *     if rv == 0: return 0
14745  */
14746 
14747   /* function exit code */
14748   __pyx_L0:;
14749   return __pyx_r;
14750 }
14751 
14752 /* "FromPyStructUtility":11
14753  *
14754  * @cname("__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded")
14755  * cdef struct_type __pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded(obj) except *:             # <<<<<<<<<<<<<<
14756  *     cdef struct_type result
14757  *     if not PyMapping_Check(obj):
14758  */
14759 
__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded(PyObject * __pyx_v_obj)14760 static struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded __pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded(PyObject *__pyx_v_obj) {
14761   struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded __pyx_v_result;
14762   PyObject *__pyx_v_value = NULL;
14763   struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded __pyx_r;
14764   __Pyx_RefNannyDeclarations
14765   int __pyx_t_1;
14766   PyObject *__pyx_t_2 = NULL;
14767   PyObject *__pyx_t_3 = NULL;
14768   PyObject *__pyx_t_4 = NULL;
14769   PyObject *__pyx_t_5 = NULL;
14770   int __pyx_t_6;
14771   PyObject *__pyx_t_7 = NULL;
14772   PyObject *__pyx_t_8 = NULL;
14773   PyObject *__pyx_t_9 = NULL;
14774   __pyx_t_5numpy_int32_t __pyx_t_10;
14775   __pyx_t_5numpy_int64_t __pyx_t_11;
14776   __pyx_t_5numpy_float64_t __pyx_t_12;
14777   __pyx_t_5numpy_int_t __pyx_t_13;
14778   __Pyx_RefNannySetupContext("__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded", 0);
14779 
14780   /* "FromPyStructUtility":13
14781  * cdef struct_type __pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded(obj) except *:
14782  *     cdef struct_type result
14783  *     if not PyMapping_Check(obj):             # <<<<<<<<<<<<<<
14784  *         PyErr_Format(TypeError, b"Expected %.16s, got %.200s", b"a mapping", Py_TYPE(obj).tp_name)
14785  *
14786  */
14787   __pyx_t_1 = ((!(PyMapping_Check(__pyx_v_obj) != 0)) != 0);
14788   if (__pyx_t_1) {
14789 
14790     /* "FromPyStructUtility":14
14791  *     cdef struct_type result
14792  *     if not PyMapping_Check(obj):
14793  *         PyErr_Format(TypeError, b"Expected %.16s, got %.200s", b"a mapping", Py_TYPE(obj).tp_name)             # <<<<<<<<<<<<<<
14794  *
14795  *     try:
14796  */
14797     __pyx_t_2 = PyErr_Format(__pyx_builtin_TypeError, ((char const *)"Expected %.16s, got %.200s"), ((char *)"a mapping"), Py_TYPE(__pyx_v_obj)->tp_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 14, __pyx_L1_error)
14798     __Pyx_GOTREF(__pyx_t_2);
14799     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14800 
14801     /* "FromPyStructUtility":13
14802  * cdef struct_type __pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded(obj) except *:
14803  *     cdef struct_type result
14804  *     if not PyMapping_Check(obj):             # <<<<<<<<<<<<<<
14805  *         PyErr_Format(TypeError, b"Expected %.16s, got %.200s", b"a mapping", Py_TYPE(obj).tp_name)
14806  *
14807  */
14808   }
14809 
14810   /* "FromPyStructUtility":16
14811  *         PyErr_Format(TypeError, b"Expected %.16s, got %.200s", b"a mapping", Py_TYPE(obj).tp_name)
14812  *
14813  *     try:             # <<<<<<<<<<<<<<
14814  *         value = obj['num_children']
14815  *     except KeyError:
14816  */
14817   {
14818     __Pyx_PyThreadState_declare
14819     __Pyx_PyThreadState_assign
14820     __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
14821     __Pyx_XGOTREF(__pyx_t_3);
14822     __Pyx_XGOTREF(__pyx_t_4);
14823     __Pyx_XGOTREF(__pyx_t_5);
14824     /*try:*/ {
14825 
14826       /* "FromPyStructUtility":17
14827  *
14828  *     try:
14829  *         value = obj['num_children']             # <<<<<<<<<<<<<<
14830  *     except KeyError:
14831  *         raise ValueError("No value specified for struct attribute 'num_children'")
14832  */
14833       __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_num_children); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 17, __pyx_L4_error)
14834       __Pyx_GOTREF(__pyx_t_2);
14835       __pyx_v_value = __pyx_t_2;
14836       __pyx_t_2 = 0;
14837 
14838       /* "FromPyStructUtility":16
14839  *         PyErr_Format(TypeError, b"Expected %.16s, got %.200s", b"a mapping", Py_TYPE(obj).tp_name)
14840  *
14841  *     try:             # <<<<<<<<<<<<<<
14842  *         value = obj['num_children']
14843  *     except KeyError:
14844  */
14845     }
14846     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14847     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
14848     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14849     goto __pyx_L9_try_end;
14850     __pyx_L4_error:;
14851     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
14852 
14853     /* "FromPyStructUtility":18
14854  *     try:
14855  *         value = obj['num_children']
14856  *     except KeyError:             # <<<<<<<<<<<<<<
14857  *         raise ValueError("No value specified for struct attribute 'num_children'")
14858  *     result.num_children = value
14859  */
14860     __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
14861     if (__pyx_t_6) {
14862       __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded", __pyx_clineno, __pyx_lineno, __pyx_filename);
14863       if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 18, __pyx_L6_except_error)
14864       __Pyx_GOTREF(__pyx_t_2);
14865       __Pyx_GOTREF(__pyx_t_7);
14866       __Pyx_GOTREF(__pyx_t_8);
14867 
14868       /* "FromPyStructUtility":19
14869  *         value = obj['num_children']
14870  *     except KeyError:
14871  *         raise ValueError("No value specified for struct attribute 'num_children'")             # <<<<<<<<<<<<<<
14872  *     result.num_children = value
14873  *     try:
14874  */
14875       __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 19, __pyx_L6_except_error)
14876       __Pyx_GOTREF(__pyx_t_9);
14877       __Pyx_Raise(__pyx_t_9, 0, 0, 0);
14878       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14879       __PYX_ERR(1, 19, __pyx_L6_except_error)
14880     }
14881     goto __pyx_L6_except_error;
14882     __pyx_L6_except_error:;
14883 
14884     /* "FromPyStructUtility":16
14885  *         PyErr_Format(TypeError, b"Expected %.16s, got %.200s", b"a mapping", Py_TYPE(obj).tp_name)
14886  *
14887  *     try:             # <<<<<<<<<<<<<<
14888  *         value = obj['num_children']
14889  *     except KeyError:
14890  */
14891     __Pyx_XGIVEREF(__pyx_t_3);
14892     __Pyx_XGIVEREF(__pyx_t_4);
14893     __Pyx_XGIVEREF(__pyx_t_5);
14894     __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
14895     goto __pyx_L1_error;
14896     __pyx_L9_try_end:;
14897   }
14898 
14899   /* "FromPyStructUtility":20
14900  *     except KeyError:
14901  *         raise ValueError("No value specified for struct attribute 'num_children'")
14902  *     result.num_children = value             # <<<<<<<<<<<<<<
14903  *     try:
14904  *         value = obj['level']
14905  */
14906   __pyx_t_10 = __Pyx_PyInt_As_npy_int32(__pyx_v_value); if (unlikely((__pyx_t_10 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 20, __pyx_L1_error)
14907   __pyx_v_result.num_children = __pyx_t_10;
14908 
14909   /* "FromPyStructUtility":21
14910  *         raise ValueError("No value specified for struct attribute 'num_children'")
14911  *     result.num_children = value
14912  *     try:             # <<<<<<<<<<<<<<
14913  *         value = obj['level']
14914  *     except KeyError:
14915  */
14916   {
14917     __Pyx_PyThreadState_declare
14918     __Pyx_PyThreadState_assign
14919     __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
14920     __Pyx_XGOTREF(__pyx_t_5);
14921     __Pyx_XGOTREF(__pyx_t_4);
14922     __Pyx_XGOTREF(__pyx_t_3);
14923     /*try:*/ {
14924 
14925       /* "FromPyStructUtility":22
14926  *     result.num_children = value
14927  *     try:
14928  *         value = obj['level']             # <<<<<<<<<<<<<<
14929  *     except KeyError:
14930  *         raise ValueError("No value specified for struct attribute 'level'")
14931  */
14932       __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_level); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 22, __pyx_L12_error)
14933       __Pyx_GOTREF(__pyx_t_8);
14934       __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
14935       __pyx_t_8 = 0;
14936 
14937       /* "FromPyStructUtility":21
14938  *         raise ValueError("No value specified for struct attribute 'num_children'")
14939  *     result.num_children = value
14940  *     try:             # <<<<<<<<<<<<<<
14941  *         value = obj['level']
14942  *     except KeyError:
14943  */
14944     }
14945     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14946     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
14947     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14948     goto __pyx_L17_try_end;
14949     __pyx_L12_error:;
14950     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
14951     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
14952     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
14953     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
14954 
14955     /* "FromPyStructUtility":23
14956  *     try:
14957  *         value = obj['level']
14958  *     except KeyError:             # <<<<<<<<<<<<<<
14959  *         raise ValueError("No value specified for struct attribute 'level'")
14960  *     result.level = value
14961  */
14962     __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
14963     if (__pyx_t_6) {
14964       __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded", __pyx_clineno, __pyx_lineno, __pyx_filename);
14965       if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(1, 23, __pyx_L14_except_error)
14966       __Pyx_GOTREF(__pyx_t_8);
14967       __Pyx_GOTREF(__pyx_t_7);
14968       __Pyx_GOTREF(__pyx_t_2);
14969 
14970       /* "FromPyStructUtility":24
14971  *         value = obj['level']
14972  *     except KeyError:
14973  *         raise ValueError("No value specified for struct attribute 'level'")             # <<<<<<<<<<<<<<
14974  *     result.level = value
14975  *     try:
14976  */
14977       __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 24, __pyx_L14_except_error)
14978       __Pyx_GOTREF(__pyx_t_9);
14979       __Pyx_Raise(__pyx_t_9, 0, 0, 0);
14980       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14981       __PYX_ERR(1, 24, __pyx_L14_except_error)
14982     }
14983     goto __pyx_L14_except_error;
14984     __pyx_L14_except_error:;
14985 
14986     /* "FromPyStructUtility":21
14987  *         raise ValueError("No value specified for struct attribute 'num_children'")
14988  *     result.num_children = value
14989  *     try:             # <<<<<<<<<<<<<<
14990  *         value = obj['level']
14991  *     except KeyError:
14992  */
14993     __Pyx_XGIVEREF(__pyx_t_5);
14994     __Pyx_XGIVEREF(__pyx_t_4);
14995     __Pyx_XGIVEREF(__pyx_t_3);
14996     __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
14997     goto __pyx_L1_error;
14998     __pyx_L17_try_end:;
14999   }
15000 
15001   /* "FromPyStructUtility":25
15002  *     except KeyError:
15003  *         raise ValueError("No value specified for struct attribute 'level'")
15004  *     result.level = value             # <<<<<<<<<<<<<<
15005  *     try:
15006  *         value = obj['index']
15007  */
15008   __pyx_t_10 = __Pyx_PyInt_As_npy_int32(__pyx_v_value); if (unlikely((__pyx_t_10 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 25, __pyx_L1_error)
15009   __pyx_v_result.level = __pyx_t_10;
15010 
15011   /* "FromPyStructUtility":26
15012  *         raise ValueError("No value specified for struct attribute 'level'")
15013  *     result.level = value
15014  *     try:             # <<<<<<<<<<<<<<
15015  *         value = obj['index']
15016  *     except KeyError:
15017  */
15018   {
15019     __Pyx_PyThreadState_declare
15020     __Pyx_PyThreadState_assign
15021     __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
15022     __Pyx_XGOTREF(__pyx_t_3);
15023     __Pyx_XGOTREF(__pyx_t_4);
15024     __Pyx_XGOTREF(__pyx_t_5);
15025     /*try:*/ {
15026 
15027       /* "FromPyStructUtility":27
15028  *     result.level = value
15029  *     try:
15030  *         value = obj['index']             # <<<<<<<<<<<<<<
15031  *     except KeyError:
15032  *         raise ValueError("No value specified for struct attribute 'index'")
15033  */
15034       __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 27, __pyx_L20_error)
15035       __Pyx_GOTREF(__pyx_t_2);
15036       __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2);
15037       __pyx_t_2 = 0;
15038 
15039       /* "FromPyStructUtility":26
15040  *         raise ValueError("No value specified for struct attribute 'level'")
15041  *     result.level = value
15042  *     try:             # <<<<<<<<<<<<<<
15043  *         value = obj['index']
15044  *     except KeyError:
15045  */
15046     }
15047     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15048     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
15049     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15050     goto __pyx_L25_try_end;
15051     __pyx_L20_error:;
15052     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
15053     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
15054     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
15055     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
15056 
15057     /* "FromPyStructUtility":28
15058  *     try:
15059  *         value = obj['index']
15060  *     except KeyError:             # <<<<<<<<<<<<<<
15061  *         raise ValueError("No value specified for struct attribute 'index'")
15062  *     result.index = value
15063  */
15064     __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
15065     if (__pyx_t_6) {
15066       __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded", __pyx_clineno, __pyx_lineno, __pyx_filename);
15067       if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 28, __pyx_L22_except_error)
15068       __Pyx_GOTREF(__pyx_t_2);
15069       __Pyx_GOTREF(__pyx_t_7);
15070       __Pyx_GOTREF(__pyx_t_8);
15071 
15072       /* "FromPyStructUtility":29
15073  *         value = obj['index']
15074  *     except KeyError:
15075  *         raise ValueError("No value specified for struct attribute 'index'")             # <<<<<<<<<<<<<<
15076  *     result.index = value
15077  *     try:
15078  */
15079       __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 29, __pyx_L22_except_error)
15080       __Pyx_GOTREF(__pyx_t_9);
15081       __Pyx_Raise(__pyx_t_9, 0, 0, 0);
15082       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15083       __PYX_ERR(1, 29, __pyx_L22_except_error)
15084     }
15085     goto __pyx_L22_except_error;
15086     __pyx_L22_except_error:;
15087 
15088     /* "FromPyStructUtility":26
15089  *         raise ValueError("No value specified for struct attribute 'level'")
15090  *     result.level = value
15091  *     try:             # <<<<<<<<<<<<<<
15092  *         value = obj['index']
15093  *     except KeyError:
15094  */
15095     __Pyx_XGIVEREF(__pyx_t_3);
15096     __Pyx_XGIVEREF(__pyx_t_4);
15097     __Pyx_XGIVEREF(__pyx_t_5);
15098     __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
15099     goto __pyx_L1_error;
15100     __pyx_L25_try_end:;
15101   }
15102 
15103   /* "FromPyStructUtility":30
15104  *     except KeyError:
15105  *         raise ValueError("No value specified for struct attribute 'index'")
15106  *     result.index = value             # <<<<<<<<<<<<<<
15107  *     try:
15108  *         value = obj['left_edge_x']
15109  */
15110   __pyx_t_11 = __Pyx_PyInt_As_npy_int64(__pyx_v_value); if (unlikely((__pyx_t_11 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 30, __pyx_L1_error)
15111   __pyx_v_result.index = __pyx_t_11;
15112 
15113   /* "FromPyStructUtility":31
15114  *         raise ValueError("No value specified for struct attribute 'index'")
15115  *     result.index = value
15116  *     try:             # <<<<<<<<<<<<<<
15117  *         value = obj['left_edge_x']
15118  *     except KeyError:
15119  */
15120   {
15121     __Pyx_PyThreadState_declare
15122     __Pyx_PyThreadState_assign
15123     __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
15124     __Pyx_XGOTREF(__pyx_t_5);
15125     __Pyx_XGOTREF(__pyx_t_4);
15126     __Pyx_XGOTREF(__pyx_t_3);
15127     /*try:*/ {
15128 
15129       /* "FromPyStructUtility":32
15130  *     result.index = value
15131  *     try:
15132  *         value = obj['left_edge_x']             # <<<<<<<<<<<<<<
15133  *     except KeyError:
15134  *         raise ValueError("No value specified for struct attribute 'left_edge_x'")
15135  */
15136       __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_left_edge_x); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 32, __pyx_L28_error)
15137       __Pyx_GOTREF(__pyx_t_8);
15138       __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
15139       __pyx_t_8 = 0;
15140 
15141       /* "FromPyStructUtility":31
15142  *         raise ValueError("No value specified for struct attribute 'index'")
15143  *     result.index = value
15144  *     try:             # <<<<<<<<<<<<<<
15145  *         value = obj['left_edge_x']
15146  *     except KeyError:
15147  */
15148     }
15149     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15150     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
15151     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15152     goto __pyx_L33_try_end;
15153     __pyx_L28_error:;
15154     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
15155     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
15156     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
15157     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
15158 
15159     /* "FromPyStructUtility":33
15160  *     try:
15161  *         value = obj['left_edge_x']
15162  *     except KeyError:             # <<<<<<<<<<<<<<
15163  *         raise ValueError("No value specified for struct attribute 'left_edge_x'")
15164  *     result.left_edge_x = value
15165  */
15166     __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
15167     if (__pyx_t_6) {
15168       __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded", __pyx_clineno, __pyx_lineno, __pyx_filename);
15169       if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(1, 33, __pyx_L30_except_error)
15170       __Pyx_GOTREF(__pyx_t_8);
15171       __Pyx_GOTREF(__pyx_t_7);
15172       __Pyx_GOTREF(__pyx_t_2);
15173 
15174       /* "FromPyStructUtility":34
15175  *         value = obj['left_edge_x']
15176  *     except KeyError:
15177  *         raise ValueError("No value specified for struct attribute 'left_edge_x'")             # <<<<<<<<<<<<<<
15178  *     result.left_edge_x = value
15179  *     try:
15180  */
15181       __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 34, __pyx_L30_except_error)
15182       __Pyx_GOTREF(__pyx_t_9);
15183       __Pyx_Raise(__pyx_t_9, 0, 0, 0);
15184       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15185       __PYX_ERR(1, 34, __pyx_L30_except_error)
15186     }
15187     goto __pyx_L30_except_error;
15188     __pyx_L30_except_error:;
15189 
15190     /* "FromPyStructUtility":31
15191  *         raise ValueError("No value specified for struct attribute 'index'")
15192  *     result.index = value
15193  *     try:             # <<<<<<<<<<<<<<
15194  *         value = obj['left_edge_x']
15195  *     except KeyError:
15196  */
15197     __Pyx_XGIVEREF(__pyx_t_5);
15198     __Pyx_XGIVEREF(__pyx_t_4);
15199     __Pyx_XGIVEREF(__pyx_t_3);
15200     __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
15201     goto __pyx_L1_error;
15202     __pyx_L33_try_end:;
15203   }
15204 
15205   /* "FromPyStructUtility":35
15206  *     except KeyError:
15207  *         raise ValueError("No value specified for struct attribute 'left_edge_x'")
15208  *     result.left_edge_x = value             # <<<<<<<<<<<<<<
15209  *     try:
15210  *         value = obj['left_edge_y']
15211  */
15212   __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_12 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 35, __pyx_L1_error)
15213   __pyx_v_result.left_edge_x = __pyx_t_12;
15214 
15215   /* "FromPyStructUtility":36
15216  *         raise ValueError("No value specified for struct attribute 'left_edge_x'")
15217  *     result.left_edge_x = value
15218  *     try:             # <<<<<<<<<<<<<<
15219  *         value = obj['left_edge_y']
15220  *     except KeyError:
15221  */
15222   {
15223     __Pyx_PyThreadState_declare
15224     __Pyx_PyThreadState_assign
15225     __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
15226     __Pyx_XGOTREF(__pyx_t_3);
15227     __Pyx_XGOTREF(__pyx_t_4);
15228     __Pyx_XGOTREF(__pyx_t_5);
15229     /*try:*/ {
15230 
15231       /* "FromPyStructUtility":37
15232  *     result.left_edge_x = value
15233  *     try:
15234  *         value = obj['left_edge_y']             # <<<<<<<<<<<<<<
15235  *     except KeyError:
15236  *         raise ValueError("No value specified for struct attribute 'left_edge_y'")
15237  */
15238       __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_left_edge_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 37, __pyx_L36_error)
15239       __Pyx_GOTREF(__pyx_t_2);
15240       __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2);
15241       __pyx_t_2 = 0;
15242 
15243       /* "FromPyStructUtility":36
15244  *         raise ValueError("No value specified for struct attribute 'left_edge_x'")
15245  *     result.left_edge_x = value
15246  *     try:             # <<<<<<<<<<<<<<
15247  *         value = obj['left_edge_y']
15248  *     except KeyError:
15249  */
15250     }
15251     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15252     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
15253     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15254     goto __pyx_L41_try_end;
15255     __pyx_L36_error:;
15256     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
15257     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
15258     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
15259     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
15260 
15261     /* "FromPyStructUtility":38
15262  *     try:
15263  *         value = obj['left_edge_y']
15264  *     except KeyError:             # <<<<<<<<<<<<<<
15265  *         raise ValueError("No value specified for struct attribute 'left_edge_y'")
15266  *     result.left_edge_y = value
15267  */
15268     __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
15269     if (__pyx_t_6) {
15270       __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded", __pyx_clineno, __pyx_lineno, __pyx_filename);
15271       if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 38, __pyx_L38_except_error)
15272       __Pyx_GOTREF(__pyx_t_2);
15273       __Pyx_GOTREF(__pyx_t_7);
15274       __Pyx_GOTREF(__pyx_t_8);
15275 
15276       /* "FromPyStructUtility":39
15277  *         value = obj['left_edge_y']
15278  *     except KeyError:
15279  *         raise ValueError("No value specified for struct attribute 'left_edge_y'")             # <<<<<<<<<<<<<<
15280  *     result.left_edge_y = value
15281  *     try:
15282  */
15283       __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 39, __pyx_L38_except_error)
15284       __Pyx_GOTREF(__pyx_t_9);
15285       __Pyx_Raise(__pyx_t_9, 0, 0, 0);
15286       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15287       __PYX_ERR(1, 39, __pyx_L38_except_error)
15288     }
15289     goto __pyx_L38_except_error;
15290     __pyx_L38_except_error:;
15291 
15292     /* "FromPyStructUtility":36
15293  *         raise ValueError("No value specified for struct attribute 'left_edge_x'")
15294  *     result.left_edge_x = value
15295  *     try:             # <<<<<<<<<<<<<<
15296  *         value = obj['left_edge_y']
15297  *     except KeyError:
15298  */
15299     __Pyx_XGIVEREF(__pyx_t_3);
15300     __Pyx_XGIVEREF(__pyx_t_4);
15301     __Pyx_XGIVEREF(__pyx_t_5);
15302     __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
15303     goto __pyx_L1_error;
15304     __pyx_L41_try_end:;
15305   }
15306 
15307   /* "FromPyStructUtility":40
15308  *     except KeyError:
15309  *         raise ValueError("No value specified for struct attribute 'left_edge_y'")
15310  *     result.left_edge_y = value             # <<<<<<<<<<<<<<
15311  *     try:
15312  *         value = obj['left_edge_z']
15313  */
15314   __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_12 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 40, __pyx_L1_error)
15315   __pyx_v_result.left_edge_y = __pyx_t_12;
15316 
15317   /* "FromPyStructUtility":41
15318  *         raise ValueError("No value specified for struct attribute 'left_edge_y'")
15319  *     result.left_edge_y = value
15320  *     try:             # <<<<<<<<<<<<<<
15321  *         value = obj['left_edge_z']
15322  *     except KeyError:
15323  */
15324   {
15325     __Pyx_PyThreadState_declare
15326     __Pyx_PyThreadState_assign
15327     __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
15328     __Pyx_XGOTREF(__pyx_t_5);
15329     __Pyx_XGOTREF(__pyx_t_4);
15330     __Pyx_XGOTREF(__pyx_t_3);
15331     /*try:*/ {
15332 
15333       /* "FromPyStructUtility":42
15334  *     result.left_edge_y = value
15335  *     try:
15336  *         value = obj['left_edge_z']             # <<<<<<<<<<<<<<
15337  *     except KeyError:
15338  *         raise ValueError("No value specified for struct attribute 'left_edge_z'")
15339  */
15340       __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_left_edge_z); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 42, __pyx_L44_error)
15341       __Pyx_GOTREF(__pyx_t_8);
15342       __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
15343       __pyx_t_8 = 0;
15344 
15345       /* "FromPyStructUtility":41
15346  *         raise ValueError("No value specified for struct attribute 'left_edge_y'")
15347  *     result.left_edge_y = value
15348  *     try:             # <<<<<<<<<<<<<<
15349  *         value = obj['left_edge_z']
15350  *     except KeyError:
15351  */
15352     }
15353     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15354     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
15355     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15356     goto __pyx_L49_try_end;
15357     __pyx_L44_error:;
15358     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
15359     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
15360     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
15361     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
15362 
15363     /* "FromPyStructUtility":43
15364  *     try:
15365  *         value = obj['left_edge_z']
15366  *     except KeyError:             # <<<<<<<<<<<<<<
15367  *         raise ValueError("No value specified for struct attribute 'left_edge_z'")
15368  *     result.left_edge_z = value
15369  */
15370     __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
15371     if (__pyx_t_6) {
15372       __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded", __pyx_clineno, __pyx_lineno, __pyx_filename);
15373       if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(1, 43, __pyx_L46_except_error)
15374       __Pyx_GOTREF(__pyx_t_8);
15375       __Pyx_GOTREF(__pyx_t_7);
15376       __Pyx_GOTREF(__pyx_t_2);
15377 
15378       /* "FromPyStructUtility":44
15379  *         value = obj['left_edge_z']
15380  *     except KeyError:
15381  *         raise ValueError("No value specified for struct attribute 'left_edge_z'")             # <<<<<<<<<<<<<<
15382  *     result.left_edge_z = value
15383  *     try:
15384  */
15385       __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 44, __pyx_L46_except_error)
15386       __Pyx_GOTREF(__pyx_t_9);
15387       __Pyx_Raise(__pyx_t_9, 0, 0, 0);
15388       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15389       __PYX_ERR(1, 44, __pyx_L46_except_error)
15390     }
15391     goto __pyx_L46_except_error;
15392     __pyx_L46_except_error:;
15393 
15394     /* "FromPyStructUtility":41
15395  *         raise ValueError("No value specified for struct attribute 'left_edge_y'")
15396  *     result.left_edge_y = value
15397  *     try:             # <<<<<<<<<<<<<<
15398  *         value = obj['left_edge_z']
15399  *     except KeyError:
15400  */
15401     __Pyx_XGIVEREF(__pyx_t_5);
15402     __Pyx_XGIVEREF(__pyx_t_4);
15403     __Pyx_XGIVEREF(__pyx_t_3);
15404     __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
15405     goto __pyx_L1_error;
15406     __pyx_L49_try_end:;
15407   }
15408 
15409   /* "FromPyStructUtility":45
15410  *     except KeyError:
15411  *         raise ValueError("No value specified for struct attribute 'left_edge_z'")
15412  *     result.left_edge_z = value             # <<<<<<<<<<<<<<
15413  *     try:
15414  *         value = obj['right_edge_x']
15415  */
15416   __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_12 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 45, __pyx_L1_error)
15417   __pyx_v_result.left_edge_z = __pyx_t_12;
15418 
15419   /* "FromPyStructUtility":46
15420  *         raise ValueError("No value specified for struct attribute 'left_edge_z'")
15421  *     result.left_edge_z = value
15422  *     try:             # <<<<<<<<<<<<<<
15423  *         value = obj['right_edge_x']
15424  *     except KeyError:
15425  */
15426   {
15427     __Pyx_PyThreadState_declare
15428     __Pyx_PyThreadState_assign
15429     __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
15430     __Pyx_XGOTREF(__pyx_t_3);
15431     __Pyx_XGOTREF(__pyx_t_4);
15432     __Pyx_XGOTREF(__pyx_t_5);
15433     /*try:*/ {
15434 
15435       /* "FromPyStructUtility":47
15436  *     result.left_edge_z = value
15437  *     try:
15438  *         value = obj['right_edge_x']             # <<<<<<<<<<<<<<
15439  *     except KeyError:
15440  *         raise ValueError("No value specified for struct attribute 'right_edge_x'")
15441  */
15442       __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_right_edge_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 47, __pyx_L52_error)
15443       __Pyx_GOTREF(__pyx_t_2);
15444       __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2);
15445       __pyx_t_2 = 0;
15446 
15447       /* "FromPyStructUtility":46
15448  *         raise ValueError("No value specified for struct attribute 'left_edge_z'")
15449  *     result.left_edge_z = value
15450  *     try:             # <<<<<<<<<<<<<<
15451  *         value = obj['right_edge_x']
15452  *     except KeyError:
15453  */
15454     }
15455     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15456     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
15457     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15458     goto __pyx_L57_try_end;
15459     __pyx_L52_error:;
15460     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
15461     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
15462     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
15463     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
15464 
15465     /* "FromPyStructUtility":48
15466  *     try:
15467  *         value = obj['right_edge_x']
15468  *     except KeyError:             # <<<<<<<<<<<<<<
15469  *         raise ValueError("No value specified for struct attribute 'right_edge_x'")
15470  *     result.right_edge_x = value
15471  */
15472     __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
15473     if (__pyx_t_6) {
15474       __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded", __pyx_clineno, __pyx_lineno, __pyx_filename);
15475       if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 48, __pyx_L54_except_error)
15476       __Pyx_GOTREF(__pyx_t_2);
15477       __Pyx_GOTREF(__pyx_t_7);
15478       __Pyx_GOTREF(__pyx_t_8);
15479 
15480       /* "FromPyStructUtility":49
15481  *         value = obj['right_edge_x']
15482  *     except KeyError:
15483  *         raise ValueError("No value specified for struct attribute 'right_edge_x'")             # <<<<<<<<<<<<<<
15484  *     result.right_edge_x = value
15485  *     try:
15486  */
15487       __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 49, __pyx_L54_except_error)
15488       __Pyx_GOTREF(__pyx_t_9);
15489       __Pyx_Raise(__pyx_t_9, 0, 0, 0);
15490       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15491       __PYX_ERR(1, 49, __pyx_L54_except_error)
15492     }
15493     goto __pyx_L54_except_error;
15494     __pyx_L54_except_error:;
15495 
15496     /* "FromPyStructUtility":46
15497  *         raise ValueError("No value specified for struct attribute 'left_edge_z'")
15498  *     result.left_edge_z = value
15499  *     try:             # <<<<<<<<<<<<<<
15500  *         value = obj['right_edge_x']
15501  *     except KeyError:
15502  */
15503     __Pyx_XGIVEREF(__pyx_t_3);
15504     __Pyx_XGIVEREF(__pyx_t_4);
15505     __Pyx_XGIVEREF(__pyx_t_5);
15506     __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
15507     goto __pyx_L1_error;
15508     __pyx_L57_try_end:;
15509   }
15510 
15511   /* "FromPyStructUtility":50
15512  *     except KeyError:
15513  *         raise ValueError("No value specified for struct attribute 'right_edge_x'")
15514  *     result.right_edge_x = value             # <<<<<<<<<<<<<<
15515  *     try:
15516  *         value = obj['right_edge_y']
15517  */
15518   __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_12 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 50, __pyx_L1_error)
15519   __pyx_v_result.right_edge_x = __pyx_t_12;
15520 
15521   /* "FromPyStructUtility":51
15522  *         raise ValueError("No value specified for struct attribute 'right_edge_x'")
15523  *     result.right_edge_x = value
15524  *     try:             # <<<<<<<<<<<<<<
15525  *         value = obj['right_edge_y']
15526  *     except KeyError:
15527  */
15528   {
15529     __Pyx_PyThreadState_declare
15530     __Pyx_PyThreadState_assign
15531     __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
15532     __Pyx_XGOTREF(__pyx_t_5);
15533     __Pyx_XGOTREF(__pyx_t_4);
15534     __Pyx_XGOTREF(__pyx_t_3);
15535     /*try:*/ {
15536 
15537       /* "FromPyStructUtility":52
15538  *     result.right_edge_x = value
15539  *     try:
15540  *         value = obj['right_edge_y']             # <<<<<<<<<<<<<<
15541  *     except KeyError:
15542  *         raise ValueError("No value specified for struct attribute 'right_edge_y'")
15543  */
15544       __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_right_edge_y); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 52, __pyx_L60_error)
15545       __Pyx_GOTREF(__pyx_t_8);
15546       __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
15547       __pyx_t_8 = 0;
15548 
15549       /* "FromPyStructUtility":51
15550  *         raise ValueError("No value specified for struct attribute 'right_edge_x'")
15551  *     result.right_edge_x = value
15552  *     try:             # <<<<<<<<<<<<<<
15553  *         value = obj['right_edge_y']
15554  *     except KeyError:
15555  */
15556     }
15557     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15558     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
15559     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15560     goto __pyx_L65_try_end;
15561     __pyx_L60_error:;
15562     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
15563     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
15564     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
15565     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
15566 
15567     /* "FromPyStructUtility":53
15568  *     try:
15569  *         value = obj['right_edge_y']
15570  *     except KeyError:             # <<<<<<<<<<<<<<
15571  *         raise ValueError("No value specified for struct attribute 'right_edge_y'")
15572  *     result.right_edge_y = value
15573  */
15574     __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
15575     if (__pyx_t_6) {
15576       __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded", __pyx_clineno, __pyx_lineno, __pyx_filename);
15577       if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(1, 53, __pyx_L62_except_error)
15578       __Pyx_GOTREF(__pyx_t_8);
15579       __Pyx_GOTREF(__pyx_t_7);
15580       __Pyx_GOTREF(__pyx_t_2);
15581 
15582       /* "FromPyStructUtility":54
15583  *         value = obj['right_edge_y']
15584  *     except KeyError:
15585  *         raise ValueError("No value specified for struct attribute 'right_edge_y'")             # <<<<<<<<<<<<<<
15586  *     result.right_edge_y = value
15587  *     try:
15588  */
15589       __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 54, __pyx_L62_except_error)
15590       __Pyx_GOTREF(__pyx_t_9);
15591       __Pyx_Raise(__pyx_t_9, 0, 0, 0);
15592       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15593       __PYX_ERR(1, 54, __pyx_L62_except_error)
15594     }
15595     goto __pyx_L62_except_error;
15596     __pyx_L62_except_error:;
15597 
15598     /* "FromPyStructUtility":51
15599  *         raise ValueError("No value specified for struct attribute 'right_edge_x'")
15600  *     result.right_edge_x = value
15601  *     try:             # <<<<<<<<<<<<<<
15602  *         value = obj['right_edge_y']
15603  *     except KeyError:
15604  */
15605     __Pyx_XGIVEREF(__pyx_t_5);
15606     __Pyx_XGIVEREF(__pyx_t_4);
15607     __Pyx_XGIVEREF(__pyx_t_3);
15608     __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
15609     goto __pyx_L1_error;
15610     __pyx_L65_try_end:;
15611   }
15612 
15613   /* "FromPyStructUtility":55
15614  *     except KeyError:
15615  *         raise ValueError("No value specified for struct attribute 'right_edge_y'")
15616  *     result.right_edge_y = value             # <<<<<<<<<<<<<<
15617  *     try:
15618  *         value = obj['right_edge_z']
15619  */
15620   __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_12 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 55, __pyx_L1_error)
15621   __pyx_v_result.right_edge_y = __pyx_t_12;
15622 
15623   /* "FromPyStructUtility":56
15624  *         raise ValueError("No value specified for struct attribute 'right_edge_y'")
15625  *     result.right_edge_y = value
15626  *     try:             # <<<<<<<<<<<<<<
15627  *         value = obj['right_edge_z']
15628  *     except KeyError:
15629  */
15630   {
15631     __Pyx_PyThreadState_declare
15632     __Pyx_PyThreadState_assign
15633     __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
15634     __Pyx_XGOTREF(__pyx_t_3);
15635     __Pyx_XGOTREF(__pyx_t_4);
15636     __Pyx_XGOTREF(__pyx_t_5);
15637     /*try:*/ {
15638 
15639       /* "FromPyStructUtility":57
15640  *     result.right_edge_y = value
15641  *     try:
15642  *         value = obj['right_edge_z']             # <<<<<<<<<<<<<<
15643  *     except KeyError:
15644  *         raise ValueError("No value specified for struct attribute 'right_edge_z'")
15645  */
15646       __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_right_edge_z); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 57, __pyx_L68_error)
15647       __Pyx_GOTREF(__pyx_t_2);
15648       __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2);
15649       __pyx_t_2 = 0;
15650 
15651       /* "FromPyStructUtility":56
15652  *         raise ValueError("No value specified for struct attribute 'right_edge_y'")
15653  *     result.right_edge_y = value
15654  *     try:             # <<<<<<<<<<<<<<
15655  *         value = obj['right_edge_z']
15656  *     except KeyError:
15657  */
15658     }
15659     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15660     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
15661     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15662     goto __pyx_L73_try_end;
15663     __pyx_L68_error:;
15664     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
15665     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
15666     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
15667     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
15668 
15669     /* "FromPyStructUtility":58
15670  *     try:
15671  *         value = obj['right_edge_z']
15672  *     except KeyError:             # <<<<<<<<<<<<<<
15673  *         raise ValueError("No value specified for struct attribute 'right_edge_z'")
15674  *     result.right_edge_z = value
15675  */
15676     __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
15677     if (__pyx_t_6) {
15678       __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded", __pyx_clineno, __pyx_lineno, __pyx_filename);
15679       if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 58, __pyx_L70_except_error)
15680       __Pyx_GOTREF(__pyx_t_2);
15681       __Pyx_GOTREF(__pyx_t_7);
15682       __Pyx_GOTREF(__pyx_t_8);
15683 
15684       /* "FromPyStructUtility":59
15685  *         value = obj['right_edge_z']
15686  *     except KeyError:
15687  *         raise ValueError("No value specified for struct attribute 'right_edge_z'")             # <<<<<<<<<<<<<<
15688  *     result.right_edge_z = value
15689  *     try:
15690  */
15691       __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 59, __pyx_L70_except_error)
15692       __Pyx_GOTREF(__pyx_t_9);
15693       __Pyx_Raise(__pyx_t_9, 0, 0, 0);
15694       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15695       __PYX_ERR(1, 59, __pyx_L70_except_error)
15696     }
15697     goto __pyx_L70_except_error;
15698     __pyx_L70_except_error:;
15699 
15700     /* "FromPyStructUtility":56
15701  *         raise ValueError("No value specified for struct attribute 'right_edge_y'")
15702  *     result.right_edge_y = value
15703  *     try:             # <<<<<<<<<<<<<<
15704  *         value = obj['right_edge_z']
15705  *     except KeyError:
15706  */
15707     __Pyx_XGIVEREF(__pyx_t_3);
15708     __Pyx_XGIVEREF(__pyx_t_4);
15709     __Pyx_XGIVEREF(__pyx_t_5);
15710     __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
15711     goto __pyx_L1_error;
15712     __pyx_L73_try_end:;
15713   }
15714 
15715   /* "FromPyStructUtility":60
15716  *     except KeyError:
15717  *         raise ValueError("No value specified for struct attribute 'right_edge_z'")
15718  *     result.right_edge_z = value             # <<<<<<<<<<<<<<
15719  *     try:
15720  *         value = obj['children_pointers']
15721  */
15722   __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_12 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 60, __pyx_L1_error)
15723   __pyx_v_result.right_edge_z = __pyx_t_12;
15724 
15725   /* "FromPyStructUtility":61
15726  *         raise ValueError("No value specified for struct attribute 'right_edge_z'")
15727  *     result.right_edge_z = value
15728  *     try:             # <<<<<<<<<<<<<<
15729  *         value = obj['children_pointers']
15730  *     except KeyError:
15731  */
15732   {
15733     __Pyx_PyThreadState_declare
15734     __Pyx_PyThreadState_assign
15735     __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
15736     __Pyx_XGOTREF(__pyx_t_5);
15737     __Pyx_XGOTREF(__pyx_t_4);
15738     __Pyx_XGOTREF(__pyx_t_3);
15739     /*try:*/ {
15740 
15741       /* "FromPyStructUtility":62
15742  *     result.right_edge_z = value
15743  *     try:
15744  *         value = obj['children_pointers']             # <<<<<<<<<<<<<<
15745  *     except KeyError:
15746  *         raise ValueError("No value specified for struct attribute 'children_pointers'")
15747  */
15748       __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_children_pointers); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 62, __pyx_L76_error)
15749       __Pyx_GOTREF(__pyx_t_8);
15750       __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
15751       __pyx_t_8 = 0;
15752 
15753       /* "FromPyStructUtility":61
15754  *         raise ValueError("No value specified for struct attribute 'right_edge_z'")
15755  *     result.right_edge_z = value
15756  *     try:             # <<<<<<<<<<<<<<
15757  *         value = obj['children_pointers']
15758  *     except KeyError:
15759  */
15760     }
15761     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15762     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
15763     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15764     goto __pyx_L81_try_end;
15765     __pyx_L76_error:;
15766     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
15767     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
15768     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
15769     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
15770 
15771     /* "FromPyStructUtility":63
15772  *     try:
15773  *         value = obj['children_pointers']
15774  *     except KeyError:             # <<<<<<<<<<<<<<
15775  *         raise ValueError("No value specified for struct attribute 'children_pointers'")
15776  *     result.children_pointers = value
15777  */
15778     __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
15779     if (__pyx_t_6) {
15780       __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded", __pyx_clineno, __pyx_lineno, __pyx_filename);
15781       if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(1, 63, __pyx_L78_except_error)
15782       __Pyx_GOTREF(__pyx_t_8);
15783       __Pyx_GOTREF(__pyx_t_7);
15784       __Pyx_GOTREF(__pyx_t_2);
15785 
15786       /* "FromPyStructUtility":64
15787  *         value = obj['children_pointers']
15788  *     except KeyError:
15789  *         raise ValueError("No value specified for struct attribute 'children_pointers'")             # <<<<<<<<<<<<<<
15790  *     result.children_pointers = value
15791  *     try:
15792  */
15793       __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 64, __pyx_L78_except_error)
15794       __Pyx_GOTREF(__pyx_t_9);
15795       __Pyx_Raise(__pyx_t_9, 0, 0, 0);
15796       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15797       __PYX_ERR(1, 64, __pyx_L78_except_error)
15798     }
15799     goto __pyx_L78_except_error;
15800     __pyx_L78_except_error:;
15801 
15802     /* "FromPyStructUtility":61
15803  *         raise ValueError("No value specified for struct attribute 'right_edge_z'")
15804  *     result.right_edge_z = value
15805  *     try:             # <<<<<<<<<<<<<<
15806  *         value = obj['children_pointers']
15807  *     except KeyError:
15808  */
15809     __Pyx_XGIVEREF(__pyx_t_5);
15810     __Pyx_XGIVEREF(__pyx_t_4);
15811     __Pyx_XGIVEREF(__pyx_t_3);
15812     __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
15813     goto __pyx_L1_error;
15814     __pyx_L81_try_end:;
15815   }
15816 
15817   /* "FromPyStructUtility":65
15818  *     except KeyError:
15819  *         raise ValueError("No value specified for struct attribute 'children_pointers'")
15820  *     result.children_pointers = value             # <<<<<<<<<<<<<<
15821  *     try:
15822  *         value = obj['start_index_x']
15823  */
15824   __pyx_t_13 = __Pyx_PyInt_As_npy_long(__pyx_v_value); if (unlikely((__pyx_t_13 == ((npy_long)-1)) && PyErr_Occurred())) __PYX_ERR(1, 65, __pyx_L1_error)
15825   __pyx_v_result.children_pointers = __pyx_t_13;
15826 
15827   /* "FromPyStructUtility":66
15828  *         raise ValueError("No value specified for struct attribute 'children_pointers'")
15829  *     result.children_pointers = value
15830  *     try:             # <<<<<<<<<<<<<<
15831  *         value = obj['start_index_x']
15832  *     except KeyError:
15833  */
15834   {
15835     __Pyx_PyThreadState_declare
15836     __Pyx_PyThreadState_assign
15837     __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
15838     __Pyx_XGOTREF(__pyx_t_3);
15839     __Pyx_XGOTREF(__pyx_t_4);
15840     __Pyx_XGOTREF(__pyx_t_5);
15841     /*try:*/ {
15842 
15843       /* "FromPyStructUtility":67
15844  *     result.children_pointers = value
15845  *     try:
15846  *         value = obj['start_index_x']             # <<<<<<<<<<<<<<
15847  *     except KeyError:
15848  *         raise ValueError("No value specified for struct attribute 'start_index_x'")
15849  */
15850       __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_start_index_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 67, __pyx_L84_error)
15851       __Pyx_GOTREF(__pyx_t_2);
15852       __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2);
15853       __pyx_t_2 = 0;
15854 
15855       /* "FromPyStructUtility":66
15856  *         raise ValueError("No value specified for struct attribute 'children_pointers'")
15857  *     result.children_pointers = value
15858  *     try:             # <<<<<<<<<<<<<<
15859  *         value = obj['start_index_x']
15860  *     except KeyError:
15861  */
15862     }
15863     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15864     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
15865     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15866     goto __pyx_L89_try_end;
15867     __pyx_L84_error:;
15868     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
15869     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
15870     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
15871     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
15872 
15873     /* "FromPyStructUtility":68
15874  *     try:
15875  *         value = obj['start_index_x']
15876  *     except KeyError:             # <<<<<<<<<<<<<<
15877  *         raise ValueError("No value specified for struct attribute 'start_index_x'")
15878  *     result.start_index_x = value
15879  */
15880     __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
15881     if (__pyx_t_6) {
15882       __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded", __pyx_clineno, __pyx_lineno, __pyx_filename);
15883       if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 68, __pyx_L86_except_error)
15884       __Pyx_GOTREF(__pyx_t_2);
15885       __Pyx_GOTREF(__pyx_t_7);
15886       __Pyx_GOTREF(__pyx_t_8);
15887 
15888       /* "FromPyStructUtility":69
15889  *         value = obj['start_index_x']
15890  *     except KeyError:
15891  *         raise ValueError("No value specified for struct attribute 'start_index_x'")             # <<<<<<<<<<<<<<
15892  *     result.start_index_x = value
15893  *     try:
15894  */
15895       __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 69, __pyx_L86_except_error)
15896       __Pyx_GOTREF(__pyx_t_9);
15897       __Pyx_Raise(__pyx_t_9, 0, 0, 0);
15898       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15899       __PYX_ERR(1, 69, __pyx_L86_except_error)
15900     }
15901     goto __pyx_L86_except_error;
15902     __pyx_L86_except_error:;
15903 
15904     /* "FromPyStructUtility":66
15905  *         raise ValueError("No value specified for struct attribute 'children_pointers'")
15906  *     result.children_pointers = value
15907  *     try:             # <<<<<<<<<<<<<<
15908  *         value = obj['start_index_x']
15909  *     except KeyError:
15910  */
15911     __Pyx_XGIVEREF(__pyx_t_3);
15912     __Pyx_XGIVEREF(__pyx_t_4);
15913     __Pyx_XGIVEREF(__pyx_t_5);
15914     __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
15915     goto __pyx_L1_error;
15916     __pyx_L89_try_end:;
15917   }
15918 
15919   /* "FromPyStructUtility":70
15920  *     except KeyError:
15921  *         raise ValueError("No value specified for struct attribute 'start_index_x'")
15922  *     result.start_index_x = value             # <<<<<<<<<<<<<<
15923  *     try:
15924  *         value = obj['start_index_y']
15925  */
15926   __pyx_t_11 = __Pyx_PyInt_As_npy_int64(__pyx_v_value); if (unlikely((__pyx_t_11 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 70, __pyx_L1_error)
15927   __pyx_v_result.start_index_x = __pyx_t_11;
15928 
15929   /* "FromPyStructUtility":71
15930  *         raise ValueError("No value specified for struct attribute 'start_index_x'")
15931  *     result.start_index_x = value
15932  *     try:             # <<<<<<<<<<<<<<
15933  *         value = obj['start_index_y']
15934  *     except KeyError:
15935  */
15936   {
15937     __Pyx_PyThreadState_declare
15938     __Pyx_PyThreadState_assign
15939     __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
15940     __Pyx_XGOTREF(__pyx_t_5);
15941     __Pyx_XGOTREF(__pyx_t_4);
15942     __Pyx_XGOTREF(__pyx_t_3);
15943     /*try:*/ {
15944 
15945       /* "FromPyStructUtility":72
15946  *     result.start_index_x = value
15947  *     try:
15948  *         value = obj['start_index_y']             # <<<<<<<<<<<<<<
15949  *     except KeyError:
15950  *         raise ValueError("No value specified for struct attribute 'start_index_y'")
15951  */
15952       __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_start_index_y); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 72, __pyx_L92_error)
15953       __Pyx_GOTREF(__pyx_t_8);
15954       __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
15955       __pyx_t_8 = 0;
15956 
15957       /* "FromPyStructUtility":71
15958  *         raise ValueError("No value specified for struct attribute 'start_index_x'")
15959  *     result.start_index_x = value
15960  *     try:             # <<<<<<<<<<<<<<
15961  *         value = obj['start_index_y']
15962  *     except KeyError:
15963  */
15964     }
15965     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15966     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
15967     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15968     goto __pyx_L97_try_end;
15969     __pyx_L92_error:;
15970     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
15971     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
15972     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
15973     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
15974 
15975     /* "FromPyStructUtility":73
15976  *     try:
15977  *         value = obj['start_index_y']
15978  *     except KeyError:             # <<<<<<<<<<<<<<
15979  *         raise ValueError("No value specified for struct attribute 'start_index_y'")
15980  *     result.start_index_y = value
15981  */
15982     __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
15983     if (__pyx_t_6) {
15984       __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded", __pyx_clineno, __pyx_lineno, __pyx_filename);
15985       if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(1, 73, __pyx_L94_except_error)
15986       __Pyx_GOTREF(__pyx_t_8);
15987       __Pyx_GOTREF(__pyx_t_7);
15988       __Pyx_GOTREF(__pyx_t_2);
15989 
15990       /* "FromPyStructUtility":74
15991  *         value = obj['start_index_y']
15992  *     except KeyError:
15993  *         raise ValueError("No value specified for struct attribute 'start_index_y'")             # <<<<<<<<<<<<<<
15994  *     result.start_index_y = value
15995  *     try:
15996  */
15997       __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 74, __pyx_L94_except_error)
15998       __Pyx_GOTREF(__pyx_t_9);
15999       __Pyx_Raise(__pyx_t_9, 0, 0, 0);
16000       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16001       __PYX_ERR(1, 74, __pyx_L94_except_error)
16002     }
16003     goto __pyx_L94_except_error;
16004     __pyx_L94_except_error:;
16005 
16006     /* "FromPyStructUtility":71
16007  *         raise ValueError("No value specified for struct attribute 'start_index_x'")
16008  *     result.start_index_x = value
16009  *     try:             # <<<<<<<<<<<<<<
16010  *         value = obj['start_index_y']
16011  *     except KeyError:
16012  */
16013     __Pyx_XGIVEREF(__pyx_t_5);
16014     __Pyx_XGIVEREF(__pyx_t_4);
16015     __Pyx_XGIVEREF(__pyx_t_3);
16016     __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
16017     goto __pyx_L1_error;
16018     __pyx_L97_try_end:;
16019   }
16020 
16021   /* "FromPyStructUtility":75
16022  *     except KeyError:
16023  *         raise ValueError("No value specified for struct attribute 'start_index_y'")
16024  *     result.start_index_y = value             # <<<<<<<<<<<<<<
16025  *     try:
16026  *         value = obj['start_index_z']
16027  */
16028   __pyx_t_11 = __Pyx_PyInt_As_npy_int64(__pyx_v_value); if (unlikely((__pyx_t_11 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 75, __pyx_L1_error)
16029   __pyx_v_result.start_index_y = __pyx_t_11;
16030 
16031   /* "FromPyStructUtility":76
16032  *         raise ValueError("No value specified for struct attribute 'start_index_y'")
16033  *     result.start_index_y = value
16034  *     try:             # <<<<<<<<<<<<<<
16035  *         value = obj['start_index_z']
16036  *     except KeyError:
16037  */
16038   {
16039     __Pyx_PyThreadState_declare
16040     __Pyx_PyThreadState_assign
16041     __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
16042     __Pyx_XGOTREF(__pyx_t_3);
16043     __Pyx_XGOTREF(__pyx_t_4);
16044     __Pyx_XGOTREF(__pyx_t_5);
16045     /*try:*/ {
16046 
16047       /* "FromPyStructUtility":77
16048  *     result.start_index_y = value
16049  *     try:
16050  *         value = obj['start_index_z']             # <<<<<<<<<<<<<<
16051  *     except KeyError:
16052  *         raise ValueError("No value specified for struct attribute 'start_index_z'")
16053  */
16054       __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_start_index_z); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 77, __pyx_L100_error)
16055       __Pyx_GOTREF(__pyx_t_2);
16056       __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2);
16057       __pyx_t_2 = 0;
16058 
16059       /* "FromPyStructUtility":76
16060  *         raise ValueError("No value specified for struct attribute 'start_index_y'")
16061  *     result.start_index_y = value
16062  *     try:             # <<<<<<<<<<<<<<
16063  *         value = obj['start_index_z']
16064  *     except KeyError:
16065  */
16066     }
16067     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16068     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
16069     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16070     goto __pyx_L105_try_end;
16071     __pyx_L100_error:;
16072     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
16073     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
16074     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
16075     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
16076 
16077     /* "FromPyStructUtility":78
16078  *     try:
16079  *         value = obj['start_index_z']
16080  *     except KeyError:             # <<<<<<<<<<<<<<
16081  *         raise ValueError("No value specified for struct attribute 'start_index_z'")
16082  *     result.start_index_z = value
16083  */
16084     __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
16085     if (__pyx_t_6) {
16086       __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded", __pyx_clineno, __pyx_lineno, __pyx_filename);
16087       if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 78, __pyx_L102_except_error)
16088       __Pyx_GOTREF(__pyx_t_2);
16089       __Pyx_GOTREF(__pyx_t_7);
16090       __Pyx_GOTREF(__pyx_t_8);
16091 
16092       /* "FromPyStructUtility":79
16093  *         value = obj['start_index_z']
16094  *     except KeyError:
16095  *         raise ValueError("No value specified for struct attribute 'start_index_z'")             # <<<<<<<<<<<<<<
16096  *     result.start_index_z = value
16097  *     try:
16098  */
16099       __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 79, __pyx_L102_except_error)
16100       __Pyx_GOTREF(__pyx_t_9);
16101       __Pyx_Raise(__pyx_t_9, 0, 0, 0);
16102       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16103       __PYX_ERR(1, 79, __pyx_L102_except_error)
16104     }
16105     goto __pyx_L102_except_error;
16106     __pyx_L102_except_error:;
16107 
16108     /* "FromPyStructUtility":76
16109  *         raise ValueError("No value specified for struct attribute 'start_index_y'")
16110  *     result.start_index_y = value
16111  *     try:             # <<<<<<<<<<<<<<
16112  *         value = obj['start_index_z']
16113  *     except KeyError:
16114  */
16115     __Pyx_XGIVEREF(__pyx_t_3);
16116     __Pyx_XGIVEREF(__pyx_t_4);
16117     __Pyx_XGIVEREF(__pyx_t_5);
16118     __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
16119     goto __pyx_L1_error;
16120     __pyx_L105_try_end:;
16121   }
16122 
16123   /* "FromPyStructUtility":80
16124  *     except KeyError:
16125  *         raise ValueError("No value specified for struct attribute 'start_index_z'")
16126  *     result.start_index_z = value             # <<<<<<<<<<<<<<
16127  *     try:
16128  *         value = obj['dims_x']
16129  */
16130   __pyx_t_11 = __Pyx_PyInt_As_npy_int64(__pyx_v_value); if (unlikely((__pyx_t_11 == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 80, __pyx_L1_error)
16131   __pyx_v_result.start_index_z = __pyx_t_11;
16132 
16133   /* "FromPyStructUtility":81
16134  *         raise ValueError("No value specified for struct attribute 'start_index_z'")
16135  *     result.start_index_z = value
16136  *     try:             # <<<<<<<<<<<<<<
16137  *         value = obj['dims_x']
16138  *     except KeyError:
16139  */
16140   {
16141     __Pyx_PyThreadState_declare
16142     __Pyx_PyThreadState_assign
16143     __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
16144     __Pyx_XGOTREF(__pyx_t_5);
16145     __Pyx_XGOTREF(__pyx_t_4);
16146     __Pyx_XGOTREF(__pyx_t_3);
16147     /*try:*/ {
16148 
16149       /* "FromPyStructUtility":82
16150  *     result.start_index_z = value
16151  *     try:
16152  *         value = obj['dims_x']             # <<<<<<<<<<<<<<
16153  *     except KeyError:
16154  *         raise ValueError("No value specified for struct attribute 'dims_x'")
16155  */
16156       __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_dims_x); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 82, __pyx_L108_error)
16157       __Pyx_GOTREF(__pyx_t_8);
16158       __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
16159       __pyx_t_8 = 0;
16160 
16161       /* "FromPyStructUtility":81
16162  *         raise ValueError("No value specified for struct attribute 'start_index_z'")
16163  *     result.start_index_z = value
16164  *     try:             # <<<<<<<<<<<<<<
16165  *         value = obj['dims_x']
16166  *     except KeyError:
16167  */
16168     }
16169     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16170     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
16171     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16172     goto __pyx_L113_try_end;
16173     __pyx_L108_error:;
16174     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
16175     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
16176     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
16177     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
16178 
16179     /* "FromPyStructUtility":83
16180  *     try:
16181  *         value = obj['dims_x']
16182  *     except KeyError:             # <<<<<<<<<<<<<<
16183  *         raise ValueError("No value specified for struct attribute 'dims_x'")
16184  *     result.dims_x = value
16185  */
16186     __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
16187     if (__pyx_t_6) {
16188       __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded", __pyx_clineno, __pyx_lineno, __pyx_filename);
16189       if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(1, 83, __pyx_L110_except_error)
16190       __Pyx_GOTREF(__pyx_t_8);
16191       __Pyx_GOTREF(__pyx_t_7);
16192       __Pyx_GOTREF(__pyx_t_2);
16193 
16194       /* "FromPyStructUtility":84
16195  *         value = obj['dims_x']
16196  *     except KeyError:
16197  *         raise ValueError("No value specified for struct attribute 'dims_x'")             # <<<<<<<<<<<<<<
16198  *     result.dims_x = value
16199  *     try:
16200  */
16201       __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 84, __pyx_L110_except_error)
16202       __Pyx_GOTREF(__pyx_t_9);
16203       __Pyx_Raise(__pyx_t_9, 0, 0, 0);
16204       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16205       __PYX_ERR(1, 84, __pyx_L110_except_error)
16206     }
16207     goto __pyx_L110_except_error;
16208     __pyx_L110_except_error:;
16209 
16210     /* "FromPyStructUtility":81
16211  *         raise ValueError("No value specified for struct attribute 'start_index_z'")
16212  *     result.start_index_z = value
16213  *     try:             # <<<<<<<<<<<<<<
16214  *         value = obj['dims_x']
16215  *     except KeyError:
16216  */
16217     __Pyx_XGIVEREF(__pyx_t_5);
16218     __Pyx_XGIVEREF(__pyx_t_4);
16219     __Pyx_XGIVEREF(__pyx_t_3);
16220     __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
16221     goto __pyx_L1_error;
16222     __pyx_L113_try_end:;
16223   }
16224 
16225   /* "FromPyStructUtility":85
16226  *     except KeyError:
16227  *         raise ValueError("No value specified for struct attribute 'dims_x'")
16228  *     result.dims_x = value             # <<<<<<<<<<<<<<
16229  *     try:
16230  *         value = obj['dims_y']
16231  */
16232   __pyx_t_10 = __Pyx_PyInt_As_npy_int32(__pyx_v_value); if (unlikely((__pyx_t_10 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 85, __pyx_L1_error)
16233   __pyx_v_result.dims_x = __pyx_t_10;
16234 
16235   /* "FromPyStructUtility":86
16236  *         raise ValueError("No value specified for struct attribute 'dims_x'")
16237  *     result.dims_x = value
16238  *     try:             # <<<<<<<<<<<<<<
16239  *         value = obj['dims_y']
16240  *     except KeyError:
16241  */
16242   {
16243     __Pyx_PyThreadState_declare
16244     __Pyx_PyThreadState_assign
16245     __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
16246     __Pyx_XGOTREF(__pyx_t_3);
16247     __Pyx_XGOTREF(__pyx_t_4);
16248     __Pyx_XGOTREF(__pyx_t_5);
16249     /*try:*/ {
16250 
16251       /* "FromPyStructUtility":87
16252  *     result.dims_x = value
16253  *     try:
16254  *         value = obj['dims_y']             # <<<<<<<<<<<<<<
16255  *     except KeyError:
16256  *         raise ValueError("No value specified for struct attribute 'dims_y'")
16257  */
16258       __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_dims_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 87, __pyx_L116_error)
16259       __Pyx_GOTREF(__pyx_t_2);
16260       __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2);
16261       __pyx_t_2 = 0;
16262 
16263       /* "FromPyStructUtility":86
16264  *         raise ValueError("No value specified for struct attribute 'dims_x'")
16265  *     result.dims_x = value
16266  *     try:             # <<<<<<<<<<<<<<
16267  *         value = obj['dims_y']
16268  *     except KeyError:
16269  */
16270     }
16271     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16272     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
16273     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16274     goto __pyx_L121_try_end;
16275     __pyx_L116_error:;
16276     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
16277     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
16278     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
16279     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
16280 
16281     /* "FromPyStructUtility":88
16282  *     try:
16283  *         value = obj['dims_y']
16284  *     except KeyError:             # <<<<<<<<<<<<<<
16285  *         raise ValueError("No value specified for struct attribute 'dims_y'")
16286  *     result.dims_y = value
16287  */
16288     __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
16289     if (__pyx_t_6) {
16290       __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded", __pyx_clineno, __pyx_lineno, __pyx_filename);
16291       if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 88, __pyx_L118_except_error)
16292       __Pyx_GOTREF(__pyx_t_2);
16293       __Pyx_GOTREF(__pyx_t_7);
16294       __Pyx_GOTREF(__pyx_t_8);
16295 
16296       /* "FromPyStructUtility":89
16297  *         value = obj['dims_y']
16298  *     except KeyError:
16299  *         raise ValueError("No value specified for struct attribute 'dims_y'")             # <<<<<<<<<<<<<<
16300  *     result.dims_y = value
16301  *     try:
16302  */
16303       __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 89, __pyx_L118_except_error)
16304       __Pyx_GOTREF(__pyx_t_9);
16305       __Pyx_Raise(__pyx_t_9, 0, 0, 0);
16306       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16307       __PYX_ERR(1, 89, __pyx_L118_except_error)
16308     }
16309     goto __pyx_L118_except_error;
16310     __pyx_L118_except_error:;
16311 
16312     /* "FromPyStructUtility":86
16313  *         raise ValueError("No value specified for struct attribute 'dims_x'")
16314  *     result.dims_x = value
16315  *     try:             # <<<<<<<<<<<<<<
16316  *         value = obj['dims_y']
16317  *     except KeyError:
16318  */
16319     __Pyx_XGIVEREF(__pyx_t_3);
16320     __Pyx_XGIVEREF(__pyx_t_4);
16321     __Pyx_XGIVEREF(__pyx_t_5);
16322     __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
16323     goto __pyx_L1_error;
16324     __pyx_L121_try_end:;
16325   }
16326 
16327   /* "FromPyStructUtility":90
16328  *     except KeyError:
16329  *         raise ValueError("No value specified for struct attribute 'dims_y'")
16330  *     result.dims_y = value             # <<<<<<<<<<<<<<
16331  *     try:
16332  *         value = obj['dims_z']
16333  */
16334   __pyx_t_10 = __Pyx_PyInt_As_npy_int32(__pyx_v_value); if (unlikely((__pyx_t_10 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 90, __pyx_L1_error)
16335   __pyx_v_result.dims_y = __pyx_t_10;
16336 
16337   /* "FromPyStructUtility":91
16338  *         raise ValueError("No value specified for struct attribute 'dims_y'")
16339  *     result.dims_y = value
16340  *     try:             # <<<<<<<<<<<<<<
16341  *         value = obj['dims_z']
16342  *     except KeyError:
16343  */
16344   {
16345     __Pyx_PyThreadState_declare
16346     __Pyx_PyThreadState_assign
16347     __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
16348     __Pyx_XGOTREF(__pyx_t_5);
16349     __Pyx_XGOTREF(__pyx_t_4);
16350     __Pyx_XGOTREF(__pyx_t_3);
16351     /*try:*/ {
16352 
16353       /* "FromPyStructUtility":92
16354  *     result.dims_y = value
16355  *     try:
16356  *         value = obj['dims_z']             # <<<<<<<<<<<<<<
16357  *     except KeyError:
16358  *         raise ValueError("No value specified for struct attribute 'dims_z'")
16359  */
16360       __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_dims_z); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 92, __pyx_L124_error)
16361       __Pyx_GOTREF(__pyx_t_8);
16362       __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
16363       __pyx_t_8 = 0;
16364 
16365       /* "FromPyStructUtility":91
16366  *         raise ValueError("No value specified for struct attribute 'dims_y'")
16367  *     result.dims_y = value
16368  *     try:             # <<<<<<<<<<<<<<
16369  *         value = obj['dims_z']
16370  *     except KeyError:
16371  */
16372     }
16373     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16374     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
16375     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16376     goto __pyx_L129_try_end;
16377     __pyx_L124_error:;
16378     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
16379     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
16380     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
16381     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
16382 
16383     /* "FromPyStructUtility":93
16384  *     try:
16385  *         value = obj['dims_z']
16386  *     except KeyError:             # <<<<<<<<<<<<<<
16387  *         raise ValueError("No value specified for struct attribute 'dims_z'")
16388  *     result.dims_z = value
16389  */
16390     __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
16391     if (__pyx_t_6) {
16392       __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded", __pyx_clineno, __pyx_lineno, __pyx_filename);
16393       if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(1, 93, __pyx_L126_except_error)
16394       __Pyx_GOTREF(__pyx_t_8);
16395       __Pyx_GOTREF(__pyx_t_7);
16396       __Pyx_GOTREF(__pyx_t_2);
16397 
16398       /* "FromPyStructUtility":94
16399  *         value = obj['dims_z']
16400  *     except KeyError:
16401  *         raise ValueError("No value specified for struct attribute 'dims_z'")             # <<<<<<<<<<<<<<
16402  *     result.dims_z = value
16403  *     try:
16404  */
16405       __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 94, __pyx_L126_except_error)
16406       __Pyx_GOTREF(__pyx_t_9);
16407       __Pyx_Raise(__pyx_t_9, 0, 0, 0);
16408       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16409       __PYX_ERR(1, 94, __pyx_L126_except_error)
16410     }
16411     goto __pyx_L126_except_error;
16412     __pyx_L126_except_error:;
16413 
16414     /* "FromPyStructUtility":91
16415  *         raise ValueError("No value specified for struct attribute 'dims_y'")
16416  *     result.dims_y = value
16417  *     try:             # <<<<<<<<<<<<<<
16418  *         value = obj['dims_z']
16419  *     except KeyError:
16420  */
16421     __Pyx_XGIVEREF(__pyx_t_5);
16422     __Pyx_XGIVEREF(__pyx_t_4);
16423     __Pyx_XGIVEREF(__pyx_t_3);
16424     __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
16425     goto __pyx_L1_error;
16426     __pyx_L129_try_end:;
16427   }
16428 
16429   /* "FromPyStructUtility":95
16430  *     except KeyError:
16431  *         raise ValueError("No value specified for struct attribute 'dims_z'")
16432  *     result.dims_z = value             # <<<<<<<<<<<<<<
16433  *     try:
16434  *         value = obj['dds_x']
16435  */
16436   __pyx_t_10 = __Pyx_PyInt_As_npy_int32(__pyx_v_value); if (unlikely((__pyx_t_10 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(1, 95, __pyx_L1_error)
16437   __pyx_v_result.dims_z = __pyx_t_10;
16438 
16439   /* "FromPyStructUtility":96
16440  *         raise ValueError("No value specified for struct attribute 'dims_z'")
16441  *     result.dims_z = value
16442  *     try:             # <<<<<<<<<<<<<<
16443  *         value = obj['dds_x']
16444  *     except KeyError:
16445  */
16446   {
16447     __Pyx_PyThreadState_declare
16448     __Pyx_PyThreadState_assign
16449     __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
16450     __Pyx_XGOTREF(__pyx_t_3);
16451     __Pyx_XGOTREF(__pyx_t_4);
16452     __Pyx_XGOTREF(__pyx_t_5);
16453     /*try:*/ {
16454 
16455       /* "FromPyStructUtility":97
16456  *     result.dims_z = value
16457  *     try:
16458  *         value = obj['dds_x']             # <<<<<<<<<<<<<<
16459  *     except KeyError:
16460  *         raise ValueError("No value specified for struct attribute 'dds_x'")
16461  */
16462       __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_dds_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 97, __pyx_L132_error)
16463       __Pyx_GOTREF(__pyx_t_2);
16464       __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2);
16465       __pyx_t_2 = 0;
16466 
16467       /* "FromPyStructUtility":96
16468  *         raise ValueError("No value specified for struct attribute 'dims_z'")
16469  *     result.dims_z = value
16470  *     try:             # <<<<<<<<<<<<<<
16471  *         value = obj['dds_x']
16472  *     except KeyError:
16473  */
16474     }
16475     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16476     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
16477     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16478     goto __pyx_L137_try_end;
16479     __pyx_L132_error:;
16480     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
16481     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
16482     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
16483     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
16484 
16485     /* "FromPyStructUtility":98
16486  *     try:
16487  *         value = obj['dds_x']
16488  *     except KeyError:             # <<<<<<<<<<<<<<
16489  *         raise ValueError("No value specified for struct attribute 'dds_x'")
16490  *     result.dds_x = value
16491  */
16492     __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
16493     if (__pyx_t_6) {
16494       __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded", __pyx_clineno, __pyx_lineno, __pyx_filename);
16495       if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 98, __pyx_L134_except_error)
16496       __Pyx_GOTREF(__pyx_t_2);
16497       __Pyx_GOTREF(__pyx_t_7);
16498       __Pyx_GOTREF(__pyx_t_8);
16499 
16500       /* "FromPyStructUtility":99
16501  *         value = obj['dds_x']
16502  *     except KeyError:
16503  *         raise ValueError("No value specified for struct attribute 'dds_x'")             # <<<<<<<<<<<<<<
16504  *     result.dds_x = value
16505  *     try:
16506  */
16507       __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 99, __pyx_L134_except_error)
16508       __Pyx_GOTREF(__pyx_t_9);
16509       __Pyx_Raise(__pyx_t_9, 0, 0, 0);
16510       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16511       __PYX_ERR(1, 99, __pyx_L134_except_error)
16512     }
16513     goto __pyx_L134_except_error;
16514     __pyx_L134_except_error:;
16515 
16516     /* "FromPyStructUtility":96
16517  *         raise ValueError("No value specified for struct attribute 'dims_z'")
16518  *     result.dims_z = value
16519  *     try:             # <<<<<<<<<<<<<<
16520  *         value = obj['dds_x']
16521  *     except KeyError:
16522  */
16523     __Pyx_XGIVEREF(__pyx_t_3);
16524     __Pyx_XGIVEREF(__pyx_t_4);
16525     __Pyx_XGIVEREF(__pyx_t_5);
16526     __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
16527     goto __pyx_L1_error;
16528     __pyx_L137_try_end:;
16529   }
16530 
16531   /* "FromPyStructUtility":100
16532  *     except KeyError:
16533  *         raise ValueError("No value specified for struct attribute 'dds_x'")
16534  *     result.dds_x = value             # <<<<<<<<<<<<<<
16535  *     try:
16536  *         value = obj['dds_y']
16537  */
16538   __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_12 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 100, __pyx_L1_error)
16539   __pyx_v_result.dds_x = __pyx_t_12;
16540 
16541   /* "FromPyStructUtility":101
16542  *         raise ValueError("No value specified for struct attribute 'dds_x'")
16543  *     result.dds_x = value
16544  *     try:             # <<<<<<<<<<<<<<
16545  *         value = obj['dds_y']
16546  *     except KeyError:
16547  */
16548   {
16549     __Pyx_PyThreadState_declare
16550     __Pyx_PyThreadState_assign
16551     __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
16552     __Pyx_XGOTREF(__pyx_t_5);
16553     __Pyx_XGOTREF(__pyx_t_4);
16554     __Pyx_XGOTREF(__pyx_t_3);
16555     /*try:*/ {
16556 
16557       /* "FromPyStructUtility":102
16558  *     result.dds_x = value
16559  *     try:
16560  *         value = obj['dds_y']             # <<<<<<<<<<<<<<
16561  *     except KeyError:
16562  *         raise ValueError("No value specified for struct attribute 'dds_y'")
16563  */
16564       __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_dds_y); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 102, __pyx_L140_error)
16565       __Pyx_GOTREF(__pyx_t_8);
16566       __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
16567       __pyx_t_8 = 0;
16568 
16569       /* "FromPyStructUtility":101
16570  *         raise ValueError("No value specified for struct attribute 'dds_x'")
16571  *     result.dds_x = value
16572  *     try:             # <<<<<<<<<<<<<<
16573  *         value = obj['dds_y']
16574  *     except KeyError:
16575  */
16576     }
16577     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16578     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
16579     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16580     goto __pyx_L145_try_end;
16581     __pyx_L140_error:;
16582     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
16583     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
16584     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
16585     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
16586 
16587     /* "FromPyStructUtility":103
16588  *     try:
16589  *         value = obj['dds_y']
16590  *     except KeyError:             # <<<<<<<<<<<<<<
16591  *         raise ValueError("No value specified for struct attribute 'dds_y'")
16592  *     result.dds_y = value
16593  */
16594     __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
16595     if (__pyx_t_6) {
16596       __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded", __pyx_clineno, __pyx_lineno, __pyx_filename);
16597       if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(1, 103, __pyx_L142_except_error)
16598       __Pyx_GOTREF(__pyx_t_8);
16599       __Pyx_GOTREF(__pyx_t_7);
16600       __Pyx_GOTREF(__pyx_t_2);
16601 
16602       /* "FromPyStructUtility":104
16603  *         value = obj['dds_y']
16604  *     except KeyError:
16605  *         raise ValueError("No value specified for struct attribute 'dds_y'")             # <<<<<<<<<<<<<<
16606  *     result.dds_y = value
16607  *     try:
16608  */
16609       __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 104, __pyx_L142_except_error)
16610       __Pyx_GOTREF(__pyx_t_9);
16611       __Pyx_Raise(__pyx_t_9, 0, 0, 0);
16612       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16613       __PYX_ERR(1, 104, __pyx_L142_except_error)
16614     }
16615     goto __pyx_L142_except_error;
16616     __pyx_L142_except_error:;
16617 
16618     /* "FromPyStructUtility":101
16619  *         raise ValueError("No value specified for struct attribute 'dds_x'")
16620  *     result.dds_x = value
16621  *     try:             # <<<<<<<<<<<<<<
16622  *         value = obj['dds_y']
16623  *     except KeyError:
16624  */
16625     __Pyx_XGIVEREF(__pyx_t_5);
16626     __Pyx_XGIVEREF(__pyx_t_4);
16627     __Pyx_XGIVEREF(__pyx_t_3);
16628     __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
16629     goto __pyx_L1_error;
16630     __pyx_L145_try_end:;
16631   }
16632 
16633   /* "FromPyStructUtility":105
16634  *     except KeyError:
16635  *         raise ValueError("No value specified for struct attribute 'dds_y'")
16636  *     result.dds_y = value             # <<<<<<<<<<<<<<
16637  *     try:
16638  *         value = obj['dds_z']
16639  */
16640   __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_12 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 105, __pyx_L1_error)
16641   __pyx_v_result.dds_y = __pyx_t_12;
16642 
16643   /* "FromPyStructUtility":106
16644  *         raise ValueError("No value specified for struct attribute 'dds_y'")
16645  *     result.dds_y = value
16646  *     try:             # <<<<<<<<<<<<<<
16647  *         value = obj['dds_z']
16648  *     except KeyError:
16649  */
16650   {
16651     __Pyx_PyThreadState_declare
16652     __Pyx_PyThreadState_assign
16653     __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
16654     __Pyx_XGOTREF(__pyx_t_3);
16655     __Pyx_XGOTREF(__pyx_t_4);
16656     __Pyx_XGOTREF(__pyx_t_5);
16657     /*try:*/ {
16658 
16659       /* "FromPyStructUtility":107
16660  *     result.dds_y = value
16661  *     try:
16662  *         value = obj['dds_z']             # <<<<<<<<<<<<<<
16663  *     except KeyError:
16664  *         raise ValueError("No value specified for struct attribute 'dds_z'")
16665  */
16666       __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_dds_z); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 107, __pyx_L148_error)
16667       __Pyx_GOTREF(__pyx_t_2);
16668       __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2);
16669       __pyx_t_2 = 0;
16670 
16671       /* "FromPyStructUtility":106
16672  *         raise ValueError("No value specified for struct attribute 'dds_y'")
16673  *     result.dds_y = value
16674  *     try:             # <<<<<<<<<<<<<<
16675  *         value = obj['dds_z']
16676  *     except KeyError:
16677  */
16678     }
16679     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
16680     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
16681     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16682     goto __pyx_L153_try_end;
16683     __pyx_L148_error:;
16684     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
16685     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
16686     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
16687     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
16688 
16689     /* "FromPyStructUtility":108
16690  *     try:
16691  *         value = obj['dds_z']
16692  *     except KeyError:             # <<<<<<<<<<<<<<
16693  *         raise ValueError("No value specified for struct attribute 'dds_z'")
16694  *     result.dds_z = value
16695  */
16696     __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
16697     if (__pyx_t_6) {
16698       __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded", __pyx_clineno, __pyx_lineno, __pyx_filename);
16699       if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 108, __pyx_L150_except_error)
16700       __Pyx_GOTREF(__pyx_t_2);
16701       __Pyx_GOTREF(__pyx_t_7);
16702       __Pyx_GOTREF(__pyx_t_8);
16703 
16704       /* "FromPyStructUtility":109
16705  *         value = obj['dds_z']
16706  *     except KeyError:
16707  *         raise ValueError("No value specified for struct attribute 'dds_z'")             # <<<<<<<<<<<<<<
16708  *     result.dds_z = value
16709  *     return result
16710  */
16711       __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 109, __pyx_L150_except_error)
16712       __Pyx_GOTREF(__pyx_t_9);
16713       __Pyx_Raise(__pyx_t_9, 0, 0, 0);
16714       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16715       __PYX_ERR(1, 109, __pyx_L150_except_error)
16716     }
16717     goto __pyx_L150_except_error;
16718     __pyx_L150_except_error:;
16719 
16720     /* "FromPyStructUtility":106
16721  *         raise ValueError("No value specified for struct attribute 'dds_y'")
16722  *     result.dds_y = value
16723  *     try:             # <<<<<<<<<<<<<<
16724  *         value = obj['dds_z']
16725  *     except KeyError:
16726  */
16727     __Pyx_XGIVEREF(__pyx_t_3);
16728     __Pyx_XGIVEREF(__pyx_t_4);
16729     __Pyx_XGIVEREF(__pyx_t_5);
16730     __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
16731     goto __pyx_L1_error;
16732     __pyx_L153_try_end:;
16733   }
16734 
16735   /* "FromPyStructUtility":110
16736  *     except KeyError:
16737  *         raise ValueError("No value specified for struct attribute 'dds_z'")
16738  *     result.dds_z = value             # <<<<<<<<<<<<<<
16739  *     return result
16740  *
16741  */
16742   __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_12 == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(1, 110, __pyx_L1_error)
16743   __pyx_v_result.dds_z = __pyx_t_12;
16744 
16745   /* "FromPyStructUtility":111
16746  *         raise ValueError("No value specified for struct attribute 'dds_z'")
16747  *     result.dds_z = value
16748  *     return result             # <<<<<<<<<<<<<<
16749  *
16750  *
16751  */
16752   __pyx_r = __pyx_v_result;
16753   goto __pyx_L0;
16754 
16755   /* "FromPyStructUtility":11
16756  *
16757  * @cname("__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded")
16758  * cdef struct_type __pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded(obj) except *:             # <<<<<<<<<<<<<<
16759  *     cdef struct_type result
16760  *     if not PyMapping_Check(obj):
16761  */
16762 
16763   /* function exit code */
16764   __pyx_L1_error:;
16765   __Pyx_XDECREF(__pyx_t_2);
16766   __Pyx_XDECREF(__pyx_t_7);
16767   __Pyx_XDECREF(__pyx_t_8);
16768   __Pyx_XDECREF(__pyx_t_9);
16769   __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded", __pyx_clineno, __pyx_lineno, __pyx_filename);
16770   __Pyx_pretend_to_initialize(&__pyx_r);
16771   __pyx_L0:;
16772   __Pyx_XDECREF(__pyx_v_value);
16773   __Pyx_RefNannyFinishContext();
16774   return __pyx_r;
16775 }
16776 
16777 /* "View.MemoryView":122
16778  *         cdef bint dtype_is_object
16779  *
16780  *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,             # <<<<<<<<<<<<<<
16781  *                   mode="c", bint allocate_buffer=True):
16782  *
16783  */
16784 
16785 /* Python wrapper */
16786 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)16787 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16788   PyObject *__pyx_v_shape = 0;
16789   Py_ssize_t __pyx_v_itemsize;
16790   PyObject *__pyx_v_format = 0;
16791   PyObject *__pyx_v_mode = 0;
16792   int __pyx_v_allocate_buffer;
16793   int __pyx_r;
16794   __Pyx_RefNannyDeclarations
16795   __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
16796   {
16797     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};
16798     PyObject* values[5] = {0,0,0,0,0};
16799     values[3] = ((PyObject *)__pyx_n_s_c);
16800     if (unlikely(__pyx_kwds)) {
16801       Py_ssize_t kw_args;
16802       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16803       switch (pos_args) {
16804         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
16805         CYTHON_FALLTHROUGH;
16806         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
16807         CYTHON_FALLTHROUGH;
16808         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16809         CYTHON_FALLTHROUGH;
16810         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16811         CYTHON_FALLTHROUGH;
16812         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16813         CYTHON_FALLTHROUGH;
16814         case  0: break;
16815         default: goto __pyx_L5_argtuple_error;
16816       }
16817       kw_args = PyDict_Size(__pyx_kwds);
16818       switch (pos_args) {
16819         case  0:
16820         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
16821         else goto __pyx_L5_argtuple_error;
16822         CYTHON_FALLTHROUGH;
16823         case  1:
16824         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
16825         else {
16826           __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 122, __pyx_L3_error)
16827         }
16828         CYTHON_FALLTHROUGH;
16829         case  2:
16830         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
16831         else {
16832           __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 122, __pyx_L3_error)
16833         }
16834         CYTHON_FALLTHROUGH;
16835         case  3:
16836         if (kw_args > 0) {
16837           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
16838           if (value) { values[3] = value; kw_args--; }
16839         }
16840         CYTHON_FALLTHROUGH;
16841         case  4:
16842         if (kw_args > 0) {
16843           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
16844           if (value) { values[4] = value; kw_args--; }
16845         }
16846       }
16847       if (unlikely(kw_args > 0)) {
16848         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 122, __pyx_L3_error)
16849       }
16850     } else {
16851       switch (PyTuple_GET_SIZE(__pyx_args)) {
16852         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
16853         CYTHON_FALLTHROUGH;
16854         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
16855         CYTHON_FALLTHROUGH;
16856         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16857         values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16858         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16859         break;
16860         default: goto __pyx_L5_argtuple_error;
16861       }
16862     }
16863     __pyx_v_shape = ((PyObject*)values[0]);
16864     __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error)
16865     __pyx_v_format = values[2];
16866     __pyx_v_mode = values[3];
16867     if (values[4]) {
16868       __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 123, __pyx_L3_error)
16869     } else {
16870 
16871       /* "View.MemoryView":123
16872  *
16873  *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
16874  *                   mode="c", bint allocate_buffer=True):             # <<<<<<<<<<<<<<
16875  *
16876  *         cdef int idx
16877  */
16878       __pyx_v_allocate_buffer = ((int)1);
16879     }
16880   }
16881   goto __pyx_L4_argument_unpacking_done;
16882   __pyx_L5_argtuple_error:;
16883   __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 122, __pyx_L3_error)
16884   __pyx_L3_error:;
16885   __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16886   __Pyx_RefNannyFinishContext();
16887   return -1;
16888   __pyx_L4_argument_unpacking_done:;
16889   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 122, __pyx_L1_error)
16890   if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
16891     PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 122, __pyx_L1_error)
16892   }
16893   __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);
16894 
16895   /* "View.MemoryView":122
16896  *         cdef bint dtype_is_object
16897  *
16898  *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,             # <<<<<<<<<<<<<<
16899  *                   mode="c", bint allocate_buffer=True):
16900  *
16901  */
16902 
16903   /* function exit code */
16904   goto __pyx_L0;
16905   __pyx_L1_error:;
16906   __pyx_r = -1;
16907   __pyx_L0:;
16908   __Pyx_RefNannyFinishContext();
16909   return __pyx_r;
16910 }
16911 
__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)16912 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) {
16913   int __pyx_v_idx;
16914   Py_ssize_t __pyx_v_i;
16915   Py_ssize_t __pyx_v_dim;
16916   PyObject **__pyx_v_p;
16917   char __pyx_v_order;
16918   int __pyx_r;
16919   __Pyx_RefNannyDeclarations
16920   Py_ssize_t __pyx_t_1;
16921   int __pyx_t_2;
16922   PyObject *__pyx_t_3 = NULL;
16923   int __pyx_t_4;
16924   PyObject *__pyx_t_5 = NULL;
16925   PyObject *__pyx_t_6 = NULL;
16926   char *__pyx_t_7;
16927   int __pyx_t_8;
16928   Py_ssize_t __pyx_t_9;
16929   PyObject *__pyx_t_10 = NULL;
16930   Py_ssize_t __pyx_t_11;
16931   __Pyx_RefNannySetupContext("__cinit__", 0);
16932   __Pyx_INCREF(__pyx_v_format);
16933 
16934   /* "View.MemoryView":129
16935  *         cdef PyObject **p
16936  *
16937  *         self.ndim = <int> len(shape)             # <<<<<<<<<<<<<<
16938  *         self.itemsize = itemsize
16939  *
16940  */
16941   if (unlikely(__pyx_v_shape == Py_None)) {
16942     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
16943     __PYX_ERR(1, 129, __pyx_L1_error)
16944   }
16945   __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 129, __pyx_L1_error)
16946   __pyx_v_self->ndim = ((int)__pyx_t_1);
16947 
16948   /* "View.MemoryView":130
16949  *
16950  *         self.ndim = <int> len(shape)
16951  *         self.itemsize = itemsize             # <<<<<<<<<<<<<<
16952  *
16953  *         if not self.ndim:
16954  */
16955   __pyx_v_self->itemsize = __pyx_v_itemsize;
16956 
16957   /* "View.MemoryView":132
16958  *         self.itemsize = itemsize
16959  *
16960  *         if not self.ndim:             # <<<<<<<<<<<<<<
16961  *             raise ValueError("Empty shape tuple for cython.array")
16962  *
16963  */
16964   __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
16965   if (unlikely(__pyx_t_2)) {
16966 
16967     /* "View.MemoryView":133
16968  *
16969  *         if not self.ndim:
16970  *             raise ValueError("Empty shape tuple for cython.array")             # <<<<<<<<<<<<<<
16971  *
16972  *         if itemsize <= 0:
16973  */
16974     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 133, __pyx_L1_error)
16975     __Pyx_GOTREF(__pyx_t_3);
16976     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
16977     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16978     __PYX_ERR(1, 133, __pyx_L1_error)
16979 
16980     /* "View.MemoryView":132
16981  *         self.itemsize = itemsize
16982  *
16983  *         if not self.ndim:             # <<<<<<<<<<<<<<
16984  *             raise ValueError("Empty shape tuple for cython.array")
16985  *
16986  */
16987   }
16988 
16989   /* "View.MemoryView":135
16990  *             raise ValueError("Empty shape tuple for cython.array")
16991  *
16992  *         if itemsize <= 0:             # <<<<<<<<<<<<<<
16993  *             raise ValueError("itemsize <= 0 for cython.array")
16994  *
16995  */
16996   __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
16997   if (unlikely(__pyx_t_2)) {
16998 
16999     /* "View.MemoryView":136
17000  *
17001  *         if itemsize <= 0:
17002  *             raise ValueError("itemsize <= 0 for cython.array")             # <<<<<<<<<<<<<<
17003  *
17004  *         if not isinstance(format, bytes):
17005  */
17006     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 136, __pyx_L1_error)
17007     __Pyx_GOTREF(__pyx_t_3);
17008     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
17009     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17010     __PYX_ERR(1, 136, __pyx_L1_error)
17011 
17012     /* "View.MemoryView":135
17013  *             raise ValueError("Empty shape tuple for cython.array")
17014  *
17015  *         if itemsize <= 0:             # <<<<<<<<<<<<<<
17016  *             raise ValueError("itemsize <= 0 for cython.array")
17017  *
17018  */
17019   }
17020 
17021   /* "View.MemoryView":138
17022  *             raise ValueError("itemsize <= 0 for cython.array")
17023  *
17024  *         if not isinstance(format, bytes):             # <<<<<<<<<<<<<<
17025  *             format = format.encode('ASCII')
17026  *         self._format = format  # keep a reference to the byte string
17027  */
17028   __pyx_t_2 = PyBytes_Check(__pyx_v_format);
17029   __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
17030   if (__pyx_t_4) {
17031 
17032     /* "View.MemoryView":139
17033  *
17034  *         if not isinstance(format, bytes):
17035  *             format = format.encode('ASCII')             # <<<<<<<<<<<<<<
17036  *         self._format = format  # keep a reference to the byte string
17037  *         self.format = self._format
17038  */
17039     __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 139, __pyx_L1_error)
17040     __Pyx_GOTREF(__pyx_t_5);
17041     __pyx_t_6 = NULL;
17042     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
17043       __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
17044       if (likely(__pyx_t_6)) {
17045         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
17046         __Pyx_INCREF(__pyx_t_6);
17047         __Pyx_INCREF(function);
17048         __Pyx_DECREF_SET(__pyx_t_5, function);
17049       }
17050     }
17051     __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);
17052     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
17053     if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 139, __pyx_L1_error)
17054     __Pyx_GOTREF(__pyx_t_3);
17055     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17056     __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
17057     __pyx_t_3 = 0;
17058 
17059     /* "View.MemoryView":138
17060  *             raise ValueError("itemsize <= 0 for cython.array")
17061  *
17062  *         if not isinstance(format, bytes):             # <<<<<<<<<<<<<<
17063  *             format = format.encode('ASCII')
17064  *         self._format = format  # keep a reference to the byte string
17065  */
17066   }
17067 
17068   /* "View.MemoryView":140
17069  *         if not isinstance(format, bytes):
17070  *             format = format.encode('ASCII')
17071  *         self._format = format  # keep a reference to the byte string             # <<<<<<<<<<<<<<
17072  *         self.format = self._format
17073  *
17074  */
17075   if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 140, __pyx_L1_error)
17076   __pyx_t_3 = __pyx_v_format;
17077   __Pyx_INCREF(__pyx_t_3);
17078   __Pyx_GIVEREF(__pyx_t_3);
17079   __Pyx_GOTREF(__pyx_v_self->_format);
17080   __Pyx_DECREF(__pyx_v_self->_format);
17081   __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
17082   __pyx_t_3 = 0;
17083 
17084   /* "View.MemoryView":141
17085  *             format = format.encode('ASCII')
17086  *         self._format = format  # keep a reference to the byte string
17087  *         self.format = self._format             # <<<<<<<<<<<<<<
17088  *
17089  *
17090  */
17091   if (unlikely(__pyx_v_self->_format == Py_None)) {
17092     PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
17093     __PYX_ERR(1, 141, __pyx_L1_error)
17094   }
17095   __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 141, __pyx_L1_error)
17096   __pyx_v_self->format = __pyx_t_7;
17097 
17098   /* "View.MemoryView":144
17099  *
17100  *
17101  *         self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)             # <<<<<<<<<<<<<<
17102  *         self._strides = self._shape + self.ndim
17103  *
17104  */
17105   __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
17106 
17107   /* "View.MemoryView":145
17108  *
17109  *         self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
17110  *         self._strides = self._shape + self.ndim             # <<<<<<<<<<<<<<
17111  *
17112  *         if not self._shape:
17113  */
17114   __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
17115 
17116   /* "View.MemoryView":147
17117  *         self._strides = self._shape + self.ndim
17118  *
17119  *         if not self._shape:             # <<<<<<<<<<<<<<
17120  *             raise MemoryError("unable to allocate shape and strides.")
17121  *
17122  */
17123   __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
17124   if (unlikely(__pyx_t_4)) {
17125 
17126     /* "View.MemoryView":148
17127  *
17128  *         if not self._shape:
17129  *             raise MemoryError("unable to allocate shape and strides.")             # <<<<<<<<<<<<<<
17130  *
17131  *
17132  */
17133     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 148, __pyx_L1_error)
17134     __Pyx_GOTREF(__pyx_t_3);
17135     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
17136     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17137     __PYX_ERR(1, 148, __pyx_L1_error)
17138 
17139     /* "View.MemoryView":147
17140  *         self._strides = self._shape + self.ndim
17141  *
17142  *         if not self._shape:             # <<<<<<<<<<<<<<
17143  *             raise MemoryError("unable to allocate shape and strides.")
17144  *
17145  */
17146   }
17147 
17148   /* "View.MemoryView":151
17149  *
17150  *
17151  *         for idx, dim in enumerate(shape):             # <<<<<<<<<<<<<<
17152  *             if dim <= 0:
17153  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
17154  */
17155   __pyx_t_8 = 0;
17156   __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
17157   for (;;) {
17158     if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
17159     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
17160     __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(1, 151, __pyx_L1_error)
17161     #else
17162     __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 151, __pyx_L1_error)
17163     __Pyx_GOTREF(__pyx_t_5);
17164     #endif
17165     __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 151, __pyx_L1_error)
17166     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17167     __pyx_v_dim = __pyx_t_9;
17168     __pyx_v_idx = __pyx_t_8;
17169     __pyx_t_8 = (__pyx_t_8 + 1);
17170 
17171     /* "View.MemoryView":152
17172  *
17173  *         for idx, dim in enumerate(shape):
17174  *             if dim <= 0:             # <<<<<<<<<<<<<<
17175  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
17176  *             self._shape[idx] = dim
17177  */
17178     __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
17179     if (unlikely(__pyx_t_4)) {
17180 
17181       /* "View.MemoryView":153
17182  *         for idx, dim in enumerate(shape):
17183  *             if dim <= 0:
17184  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))             # <<<<<<<<<<<<<<
17185  *             self._shape[idx] = dim
17186  *
17187  */
17188       __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 153, __pyx_L1_error)
17189       __Pyx_GOTREF(__pyx_t_5);
17190       __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
17191       __Pyx_GOTREF(__pyx_t_6);
17192       __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
17193       __Pyx_GOTREF(__pyx_t_10);
17194       __Pyx_GIVEREF(__pyx_t_5);
17195       PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
17196       __Pyx_GIVEREF(__pyx_t_6);
17197       PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
17198       __pyx_t_5 = 0;
17199       __pyx_t_6 = 0;
17200       __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
17201       __Pyx_GOTREF(__pyx_t_6);
17202       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
17203       __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
17204       __Pyx_GOTREF(__pyx_t_10);
17205       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17206       __Pyx_Raise(__pyx_t_10, 0, 0, 0);
17207       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
17208       __PYX_ERR(1, 153, __pyx_L1_error)
17209 
17210       /* "View.MemoryView":152
17211  *
17212  *         for idx, dim in enumerate(shape):
17213  *             if dim <= 0:             # <<<<<<<<<<<<<<
17214  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
17215  *             self._shape[idx] = dim
17216  */
17217     }
17218 
17219     /* "View.MemoryView":154
17220  *             if dim <= 0:
17221  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
17222  *             self._shape[idx] = dim             # <<<<<<<<<<<<<<
17223  *
17224  *         cdef char order
17225  */
17226     (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
17227 
17228     /* "View.MemoryView":151
17229  *
17230  *
17231  *         for idx, dim in enumerate(shape):             # <<<<<<<<<<<<<<
17232  *             if dim <= 0:
17233  *                 raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
17234  */
17235   }
17236   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17237 
17238   /* "View.MemoryView":157
17239  *
17240  *         cdef char order
17241  *         if mode == 'fortran':             # <<<<<<<<<<<<<<
17242  *             order = b'F'
17243  *             self.mode = u'fortran'
17244  */
17245   __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 157, __pyx_L1_error)
17246   if (__pyx_t_4) {
17247 
17248     /* "View.MemoryView":158
17249  *         cdef char order
17250  *         if mode == 'fortran':
17251  *             order = b'F'             # <<<<<<<<<<<<<<
17252  *             self.mode = u'fortran'
17253  *         elif mode == 'c':
17254  */
17255     __pyx_v_order = 'F';
17256 
17257     /* "View.MemoryView":159
17258  *         if mode == 'fortran':
17259  *             order = b'F'
17260  *             self.mode = u'fortran'             # <<<<<<<<<<<<<<
17261  *         elif mode == 'c':
17262  *             order = b'C'
17263  */
17264     __Pyx_INCREF(__pyx_n_u_fortran);
17265     __Pyx_GIVEREF(__pyx_n_u_fortran);
17266     __Pyx_GOTREF(__pyx_v_self->mode);
17267     __Pyx_DECREF(__pyx_v_self->mode);
17268     __pyx_v_self->mode = __pyx_n_u_fortran;
17269 
17270     /* "View.MemoryView":157
17271  *
17272  *         cdef char order
17273  *         if mode == 'fortran':             # <<<<<<<<<<<<<<
17274  *             order = b'F'
17275  *             self.mode = u'fortran'
17276  */
17277     goto __pyx_L10;
17278   }
17279 
17280   /* "View.MemoryView":160
17281  *             order = b'F'
17282  *             self.mode = u'fortran'
17283  *         elif mode == 'c':             # <<<<<<<<<<<<<<
17284  *             order = b'C'
17285  *             self.mode = u'c'
17286  */
17287   __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 160, __pyx_L1_error)
17288   if (likely(__pyx_t_4)) {
17289 
17290     /* "View.MemoryView":161
17291  *             self.mode = u'fortran'
17292  *         elif mode == 'c':
17293  *             order = b'C'             # <<<<<<<<<<<<<<
17294  *             self.mode = u'c'
17295  *         else:
17296  */
17297     __pyx_v_order = 'C';
17298 
17299     /* "View.MemoryView":162
17300  *         elif mode == 'c':
17301  *             order = b'C'
17302  *             self.mode = u'c'             # <<<<<<<<<<<<<<
17303  *         else:
17304  *             raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
17305  */
17306     __Pyx_INCREF(__pyx_n_u_c);
17307     __Pyx_GIVEREF(__pyx_n_u_c);
17308     __Pyx_GOTREF(__pyx_v_self->mode);
17309     __Pyx_DECREF(__pyx_v_self->mode);
17310     __pyx_v_self->mode = __pyx_n_u_c;
17311 
17312     /* "View.MemoryView":160
17313  *             order = b'F'
17314  *             self.mode = u'fortran'
17315  *         elif mode == 'c':             # <<<<<<<<<<<<<<
17316  *             order = b'C'
17317  *             self.mode = u'c'
17318  */
17319     goto __pyx_L10;
17320   }
17321 
17322   /* "View.MemoryView":164
17323  *             self.mode = u'c'
17324  *         else:
17325  *             raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)             # <<<<<<<<<<<<<<
17326  *
17327  *         self.len = fill_contig_strides_array(self._shape, self._strides,
17328  */
17329   /*else*/ {
17330     __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 164, __pyx_L1_error)
17331     __Pyx_GOTREF(__pyx_t_3);
17332     __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 164, __pyx_L1_error)
17333     __Pyx_GOTREF(__pyx_t_10);
17334     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17335     __Pyx_Raise(__pyx_t_10, 0, 0, 0);
17336     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
17337     __PYX_ERR(1, 164, __pyx_L1_error)
17338   }
17339   __pyx_L10:;
17340 
17341   /* "View.MemoryView":166
17342  *             raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
17343  *
17344  *         self.len = fill_contig_strides_array(self._shape, self._strides,             # <<<<<<<<<<<<<<
17345  *                                              itemsize, self.ndim, order)
17346  *
17347  */
17348   __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);
17349 
17350   /* "View.MemoryView":169
17351  *                                              itemsize, self.ndim, order)
17352  *
17353  *         self.free_data = allocate_buffer             # <<<<<<<<<<<<<<
17354  *         self.dtype_is_object = format == b'O'
17355  *         if allocate_buffer:
17356  */
17357   __pyx_v_self->free_data = __pyx_v_allocate_buffer;
17358 
17359   /* "View.MemoryView":170
17360  *
17361  *         self.free_data = allocate_buffer
17362  *         self.dtype_is_object = format == b'O'             # <<<<<<<<<<<<<<
17363  *         if allocate_buffer:
17364  *
17365  */
17366   __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 170, __pyx_L1_error)
17367   __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 170, __pyx_L1_error)
17368   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
17369   __pyx_v_self->dtype_is_object = __pyx_t_4;
17370 
17371   /* "View.MemoryView":171
17372  *         self.free_data = allocate_buffer
17373  *         self.dtype_is_object = format == b'O'
17374  *         if allocate_buffer:             # <<<<<<<<<<<<<<
17375  *
17376  *
17377  */
17378   __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
17379   if (__pyx_t_4) {
17380 
17381     /* "View.MemoryView":174
17382  *
17383  *
17384  *             self.data = <char *>malloc(self.len)             # <<<<<<<<<<<<<<
17385  *             if not self.data:
17386  *                 raise MemoryError("unable to allocate array data.")
17387  */
17388     __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
17389 
17390     /* "View.MemoryView":175
17391  *
17392  *             self.data = <char *>malloc(self.len)
17393  *             if not self.data:             # <<<<<<<<<<<<<<
17394  *                 raise MemoryError("unable to allocate array data.")
17395  *
17396  */
17397     __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
17398     if (unlikely(__pyx_t_4)) {
17399 
17400       /* "View.MemoryView":176
17401  *             self.data = <char *>malloc(self.len)
17402  *             if not self.data:
17403  *                 raise MemoryError("unable to allocate array data.")             # <<<<<<<<<<<<<<
17404  *
17405  *             if self.dtype_is_object:
17406  */
17407       __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 176, __pyx_L1_error)
17408       __Pyx_GOTREF(__pyx_t_10);
17409       __Pyx_Raise(__pyx_t_10, 0, 0, 0);
17410       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
17411       __PYX_ERR(1, 176, __pyx_L1_error)
17412 
17413       /* "View.MemoryView":175
17414  *
17415  *             self.data = <char *>malloc(self.len)
17416  *             if not self.data:             # <<<<<<<<<<<<<<
17417  *                 raise MemoryError("unable to allocate array data.")
17418  *
17419  */
17420     }
17421 
17422     /* "View.MemoryView":178
17423  *                 raise MemoryError("unable to allocate array data.")
17424  *
17425  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
17426  *                 p = <PyObject **> self.data
17427  *                 for i in range(self.len / itemsize):
17428  */
17429     __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
17430     if (__pyx_t_4) {
17431 
17432       /* "View.MemoryView":179
17433  *
17434  *             if self.dtype_is_object:
17435  *                 p = <PyObject **> self.data             # <<<<<<<<<<<<<<
17436  *                 for i in range(self.len / itemsize):
17437  *                     p[i] = Py_None
17438  */
17439       __pyx_v_p = ((PyObject **)__pyx_v_self->data);
17440 
17441       /* "View.MemoryView":180
17442  *             if self.dtype_is_object:
17443  *                 p = <PyObject **> self.data
17444  *                 for i in range(self.len / itemsize):             # <<<<<<<<<<<<<<
17445  *                     p[i] = Py_None
17446  *                     Py_INCREF(Py_None)
17447  */
17448       if (unlikely(__pyx_v_itemsize == 0)) {
17449         PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
17450         __PYX_ERR(1, 180, __pyx_L1_error)
17451       }
17452       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))) {
17453         PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
17454         __PYX_ERR(1, 180, __pyx_L1_error)
17455       }
17456       __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
17457       __pyx_t_9 = __pyx_t_1;
17458       for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
17459         __pyx_v_i = __pyx_t_11;
17460 
17461         /* "View.MemoryView":181
17462  *                 p = <PyObject **> self.data
17463  *                 for i in range(self.len / itemsize):
17464  *                     p[i] = Py_None             # <<<<<<<<<<<<<<
17465  *                     Py_INCREF(Py_None)
17466  *
17467  */
17468         (__pyx_v_p[__pyx_v_i]) = Py_None;
17469 
17470         /* "View.MemoryView":182
17471  *                 for i in range(self.len / itemsize):
17472  *                     p[i] = Py_None
17473  *                     Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
17474  *
17475  *     @cname('getbuffer')
17476  */
17477         Py_INCREF(Py_None);
17478       }
17479 
17480       /* "View.MemoryView":178
17481  *                 raise MemoryError("unable to allocate array data.")
17482  *
17483  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
17484  *                 p = <PyObject **> self.data
17485  *                 for i in range(self.len / itemsize):
17486  */
17487     }
17488 
17489     /* "View.MemoryView":171
17490  *         self.free_data = allocate_buffer
17491  *         self.dtype_is_object = format == b'O'
17492  *         if allocate_buffer:             # <<<<<<<<<<<<<<
17493  *
17494  *
17495  */
17496   }
17497 
17498   /* "View.MemoryView":122
17499  *         cdef bint dtype_is_object
17500  *
17501  *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,             # <<<<<<<<<<<<<<
17502  *                   mode="c", bint allocate_buffer=True):
17503  *
17504  */
17505 
17506   /* function exit code */
17507   __pyx_r = 0;
17508   goto __pyx_L0;
17509   __pyx_L1_error:;
17510   __Pyx_XDECREF(__pyx_t_3);
17511   __Pyx_XDECREF(__pyx_t_5);
17512   __Pyx_XDECREF(__pyx_t_6);
17513   __Pyx_XDECREF(__pyx_t_10);
17514   __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17515   __pyx_r = -1;
17516   __pyx_L0:;
17517   __Pyx_XDECREF(__pyx_v_format);
17518   __Pyx_RefNannyFinishContext();
17519   return __pyx_r;
17520 }
17521 
17522 /* "View.MemoryView":185
17523  *
17524  *     @cname('getbuffer')
17525  *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
17526  *         cdef int bufmode = -1
17527  *         if self.mode == u"c":
17528  */
17529 
17530 /* Python wrapper */
17531 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)17532 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
17533   int __pyx_r;
17534   __Pyx_RefNannyDeclarations
17535   __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
17536   __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));
17537 
17538   /* function exit code */
17539   __Pyx_RefNannyFinishContext();
17540   return __pyx_r;
17541 }
17542 
__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)17543 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) {
17544   int __pyx_v_bufmode;
17545   int __pyx_r;
17546   __Pyx_RefNannyDeclarations
17547   int __pyx_t_1;
17548   int __pyx_t_2;
17549   PyObject *__pyx_t_3 = NULL;
17550   char *__pyx_t_4;
17551   Py_ssize_t __pyx_t_5;
17552   int __pyx_t_6;
17553   Py_ssize_t *__pyx_t_7;
17554   if (__pyx_v_info == NULL) {
17555     PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
17556     return -1;
17557   }
17558   __Pyx_RefNannySetupContext("__getbuffer__", 0);
17559   __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
17560   __Pyx_GIVEREF(__pyx_v_info->obj);
17561 
17562   /* "View.MemoryView":186
17563  *     @cname('getbuffer')
17564  *     def __getbuffer__(self, Py_buffer *info, int flags):
17565  *         cdef int bufmode = -1             # <<<<<<<<<<<<<<
17566  *         if self.mode == u"c":
17567  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
17568  */
17569   __pyx_v_bufmode = -1;
17570 
17571   /* "View.MemoryView":187
17572  *     def __getbuffer__(self, Py_buffer *info, int flags):
17573  *         cdef int bufmode = -1
17574  *         if self.mode == u"c":             # <<<<<<<<<<<<<<
17575  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
17576  *         elif self.mode == u"fortran":
17577  */
17578   __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 187, __pyx_L1_error)
17579   __pyx_t_2 = (__pyx_t_1 != 0);
17580   if (__pyx_t_2) {
17581 
17582     /* "View.MemoryView":188
17583  *         cdef int bufmode = -1
17584  *         if self.mode == u"c":
17585  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS             # <<<<<<<<<<<<<<
17586  *         elif self.mode == u"fortran":
17587  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
17588  */
17589     __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
17590 
17591     /* "View.MemoryView":187
17592  *     def __getbuffer__(self, Py_buffer *info, int flags):
17593  *         cdef int bufmode = -1
17594  *         if self.mode == u"c":             # <<<<<<<<<<<<<<
17595  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
17596  *         elif self.mode == u"fortran":
17597  */
17598     goto __pyx_L3;
17599   }
17600 
17601   /* "View.MemoryView":189
17602  *         if self.mode == u"c":
17603  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
17604  *         elif self.mode == u"fortran":             # <<<<<<<<<<<<<<
17605  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
17606  *         if not (flags & bufmode):
17607  */
17608   __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 189, __pyx_L1_error)
17609   __pyx_t_1 = (__pyx_t_2 != 0);
17610   if (__pyx_t_1) {
17611 
17612     /* "View.MemoryView":190
17613  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
17614  *         elif self.mode == u"fortran":
17615  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS             # <<<<<<<<<<<<<<
17616  *         if not (flags & bufmode):
17617  *             raise ValueError("Can only create a buffer that is contiguous in memory.")
17618  */
17619     __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
17620 
17621     /* "View.MemoryView":189
17622  *         if self.mode == u"c":
17623  *             bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
17624  *         elif self.mode == u"fortran":             # <<<<<<<<<<<<<<
17625  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
17626  *         if not (flags & bufmode):
17627  */
17628   }
17629   __pyx_L3:;
17630 
17631   /* "View.MemoryView":191
17632  *         elif self.mode == u"fortran":
17633  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
17634  *         if not (flags & bufmode):             # <<<<<<<<<<<<<<
17635  *             raise ValueError("Can only create a buffer that is contiguous in memory.")
17636  *         info.buf = self.data
17637  */
17638   __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
17639   if (unlikely(__pyx_t_1)) {
17640 
17641     /* "View.MemoryView":192
17642  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
17643  *         if not (flags & bufmode):
17644  *             raise ValueError("Can only create a buffer that is contiguous in memory.")             # <<<<<<<<<<<<<<
17645  *         info.buf = self.data
17646  *         info.len = self.len
17647  */
17648     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 192, __pyx_L1_error)
17649     __Pyx_GOTREF(__pyx_t_3);
17650     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
17651     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17652     __PYX_ERR(1, 192, __pyx_L1_error)
17653 
17654     /* "View.MemoryView":191
17655  *         elif self.mode == u"fortran":
17656  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
17657  *         if not (flags & bufmode):             # <<<<<<<<<<<<<<
17658  *             raise ValueError("Can only create a buffer that is contiguous in memory.")
17659  *         info.buf = self.data
17660  */
17661   }
17662 
17663   /* "View.MemoryView":193
17664  *         if not (flags & bufmode):
17665  *             raise ValueError("Can only create a buffer that is contiguous in memory.")
17666  *         info.buf = self.data             # <<<<<<<<<<<<<<
17667  *         info.len = self.len
17668  *         info.ndim = self.ndim
17669  */
17670   __pyx_t_4 = __pyx_v_self->data;
17671   __pyx_v_info->buf = __pyx_t_4;
17672 
17673   /* "View.MemoryView":194
17674  *             raise ValueError("Can only create a buffer that is contiguous in memory.")
17675  *         info.buf = self.data
17676  *         info.len = self.len             # <<<<<<<<<<<<<<
17677  *         info.ndim = self.ndim
17678  *         info.shape = self._shape
17679  */
17680   __pyx_t_5 = __pyx_v_self->len;
17681   __pyx_v_info->len = __pyx_t_5;
17682 
17683   /* "View.MemoryView":195
17684  *         info.buf = self.data
17685  *         info.len = self.len
17686  *         info.ndim = self.ndim             # <<<<<<<<<<<<<<
17687  *         info.shape = self._shape
17688  *         info.strides = self._strides
17689  */
17690   __pyx_t_6 = __pyx_v_self->ndim;
17691   __pyx_v_info->ndim = __pyx_t_6;
17692 
17693   /* "View.MemoryView":196
17694  *         info.len = self.len
17695  *         info.ndim = self.ndim
17696  *         info.shape = self._shape             # <<<<<<<<<<<<<<
17697  *         info.strides = self._strides
17698  *         info.suboffsets = NULL
17699  */
17700   __pyx_t_7 = __pyx_v_self->_shape;
17701   __pyx_v_info->shape = __pyx_t_7;
17702 
17703   /* "View.MemoryView":197
17704  *         info.ndim = self.ndim
17705  *         info.shape = self._shape
17706  *         info.strides = self._strides             # <<<<<<<<<<<<<<
17707  *         info.suboffsets = NULL
17708  *         info.itemsize = self.itemsize
17709  */
17710   __pyx_t_7 = __pyx_v_self->_strides;
17711   __pyx_v_info->strides = __pyx_t_7;
17712 
17713   /* "View.MemoryView":198
17714  *         info.shape = self._shape
17715  *         info.strides = self._strides
17716  *         info.suboffsets = NULL             # <<<<<<<<<<<<<<
17717  *         info.itemsize = self.itemsize
17718  *         info.readonly = 0
17719  */
17720   __pyx_v_info->suboffsets = NULL;
17721 
17722   /* "View.MemoryView":199
17723  *         info.strides = self._strides
17724  *         info.suboffsets = NULL
17725  *         info.itemsize = self.itemsize             # <<<<<<<<<<<<<<
17726  *         info.readonly = 0
17727  *
17728  */
17729   __pyx_t_5 = __pyx_v_self->itemsize;
17730   __pyx_v_info->itemsize = __pyx_t_5;
17731 
17732   /* "View.MemoryView":200
17733  *         info.suboffsets = NULL
17734  *         info.itemsize = self.itemsize
17735  *         info.readonly = 0             # <<<<<<<<<<<<<<
17736  *
17737  *         if flags & PyBUF_FORMAT:
17738  */
17739   __pyx_v_info->readonly = 0;
17740 
17741   /* "View.MemoryView":202
17742  *         info.readonly = 0
17743  *
17744  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
17745  *             info.format = self.format
17746  *         else:
17747  */
17748   __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
17749   if (__pyx_t_1) {
17750 
17751     /* "View.MemoryView":203
17752  *
17753  *         if flags & PyBUF_FORMAT:
17754  *             info.format = self.format             # <<<<<<<<<<<<<<
17755  *         else:
17756  *             info.format = NULL
17757  */
17758     __pyx_t_4 = __pyx_v_self->format;
17759     __pyx_v_info->format = __pyx_t_4;
17760 
17761     /* "View.MemoryView":202
17762  *         info.readonly = 0
17763  *
17764  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
17765  *             info.format = self.format
17766  *         else:
17767  */
17768     goto __pyx_L5;
17769   }
17770 
17771   /* "View.MemoryView":205
17772  *             info.format = self.format
17773  *         else:
17774  *             info.format = NULL             # <<<<<<<<<<<<<<
17775  *
17776  *         info.obj = self
17777  */
17778   /*else*/ {
17779     __pyx_v_info->format = NULL;
17780   }
17781   __pyx_L5:;
17782 
17783   /* "View.MemoryView":207
17784  *             info.format = NULL
17785  *
17786  *         info.obj = self             # <<<<<<<<<<<<<<
17787  *
17788  *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
17789  */
17790   __Pyx_INCREF(((PyObject *)__pyx_v_self));
17791   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
17792   __Pyx_GOTREF(__pyx_v_info->obj);
17793   __Pyx_DECREF(__pyx_v_info->obj);
17794   __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
17795 
17796   /* "View.MemoryView":185
17797  *
17798  *     @cname('getbuffer')
17799  *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
17800  *         cdef int bufmode = -1
17801  *         if self.mode == u"c":
17802  */
17803 
17804   /* function exit code */
17805   __pyx_r = 0;
17806   goto __pyx_L0;
17807   __pyx_L1_error:;
17808   __Pyx_XDECREF(__pyx_t_3);
17809   __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17810   __pyx_r = -1;
17811   if (__pyx_v_info->obj != NULL) {
17812     __Pyx_GOTREF(__pyx_v_info->obj);
17813     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
17814   }
17815   goto __pyx_L2;
17816   __pyx_L0:;
17817   if (__pyx_v_info->obj == Py_None) {
17818     __Pyx_GOTREF(__pyx_v_info->obj);
17819     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
17820   }
17821   __pyx_L2:;
17822   __Pyx_RefNannyFinishContext();
17823   return __pyx_r;
17824 }
17825 
17826 /* "View.MemoryView":211
17827  *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
17828  *
17829  *     def __dealloc__(array self):             # <<<<<<<<<<<<<<
17830  *         if self.callback_free_data != NULL:
17831  *             self.callback_free_data(self.data)
17832  */
17833 
17834 /* Python wrapper */
17835 static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
__pyx_array___dealloc__(PyObject * __pyx_v_self)17836 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
17837   __Pyx_RefNannyDeclarations
17838   __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
17839   __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
17840 
17841   /* function exit code */
17842   __Pyx_RefNannyFinishContext();
17843 }
17844 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj * __pyx_v_self)17845 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
17846   __Pyx_RefNannyDeclarations
17847   int __pyx_t_1;
17848   __Pyx_RefNannySetupContext("__dealloc__", 0);
17849 
17850   /* "View.MemoryView":212
17851  *
17852  *     def __dealloc__(array self):
17853  *         if self.callback_free_data != NULL:             # <<<<<<<<<<<<<<
17854  *             self.callback_free_data(self.data)
17855  *         elif self.free_data:
17856  */
17857   __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
17858   if (__pyx_t_1) {
17859 
17860     /* "View.MemoryView":213
17861  *     def __dealloc__(array self):
17862  *         if self.callback_free_data != NULL:
17863  *             self.callback_free_data(self.data)             # <<<<<<<<<<<<<<
17864  *         elif self.free_data:
17865  *             if self.dtype_is_object:
17866  */
17867     __pyx_v_self->callback_free_data(__pyx_v_self->data);
17868 
17869     /* "View.MemoryView":212
17870  *
17871  *     def __dealloc__(array self):
17872  *         if self.callback_free_data != NULL:             # <<<<<<<<<<<<<<
17873  *             self.callback_free_data(self.data)
17874  *         elif self.free_data:
17875  */
17876     goto __pyx_L3;
17877   }
17878 
17879   /* "View.MemoryView":214
17880  *         if self.callback_free_data != NULL:
17881  *             self.callback_free_data(self.data)
17882  *         elif self.free_data:             # <<<<<<<<<<<<<<
17883  *             if self.dtype_is_object:
17884  *                 refcount_objects_in_slice(self.data, self._shape,
17885  */
17886   __pyx_t_1 = (__pyx_v_self->free_data != 0);
17887   if (__pyx_t_1) {
17888 
17889     /* "View.MemoryView":215
17890  *             self.callback_free_data(self.data)
17891  *         elif self.free_data:
17892  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
17893  *                 refcount_objects_in_slice(self.data, self._shape,
17894  *                                           self._strides, self.ndim, False)
17895  */
17896     __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
17897     if (__pyx_t_1) {
17898 
17899       /* "View.MemoryView":216
17900  *         elif self.free_data:
17901  *             if self.dtype_is_object:
17902  *                 refcount_objects_in_slice(self.data, self._shape,             # <<<<<<<<<<<<<<
17903  *                                           self._strides, self.ndim, False)
17904  *             free(self.data)
17905  */
17906       __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
17907 
17908       /* "View.MemoryView":215
17909  *             self.callback_free_data(self.data)
17910  *         elif self.free_data:
17911  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
17912  *                 refcount_objects_in_slice(self.data, self._shape,
17913  *                                           self._strides, self.ndim, False)
17914  */
17915     }
17916 
17917     /* "View.MemoryView":218
17918  *                 refcount_objects_in_slice(self.data, self._shape,
17919  *                                           self._strides, self.ndim, False)
17920  *             free(self.data)             # <<<<<<<<<<<<<<
17921  *         PyObject_Free(self._shape)
17922  *
17923  */
17924     free(__pyx_v_self->data);
17925 
17926     /* "View.MemoryView":214
17927  *         if self.callback_free_data != NULL:
17928  *             self.callback_free_data(self.data)
17929  *         elif self.free_data:             # <<<<<<<<<<<<<<
17930  *             if self.dtype_is_object:
17931  *                 refcount_objects_in_slice(self.data, self._shape,
17932  */
17933   }
17934   __pyx_L3:;
17935 
17936   /* "View.MemoryView":219
17937  *                                           self._strides, self.ndim, False)
17938  *             free(self.data)
17939  *         PyObject_Free(self._shape)             # <<<<<<<<<<<<<<
17940  *
17941  *     @property
17942  */
17943   PyObject_Free(__pyx_v_self->_shape);
17944 
17945   /* "View.MemoryView":211
17946  *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
17947  *
17948  *     def __dealloc__(array self):             # <<<<<<<<<<<<<<
17949  *         if self.callback_free_data != NULL:
17950  *             self.callback_free_data(self.data)
17951  */
17952 
17953   /* function exit code */
17954   __Pyx_RefNannyFinishContext();
17955 }
17956 
17957 /* "View.MemoryView":222
17958  *
17959  *     @property
17960  *     def memview(self):             # <<<<<<<<<<<<<<
17961  *         return self.get_memview()
17962  *
17963  */
17964 
17965 /* Python wrapper */
17966 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)17967 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
17968   PyObject *__pyx_r = 0;
17969   __Pyx_RefNannyDeclarations
17970   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
17971   __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
17972 
17973   /* function exit code */
17974   __Pyx_RefNannyFinishContext();
17975   return __pyx_r;
17976 }
17977 
__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj * __pyx_v_self)17978 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
17979   PyObject *__pyx_r = NULL;
17980   __Pyx_RefNannyDeclarations
17981   PyObject *__pyx_t_1 = NULL;
17982   __Pyx_RefNannySetupContext("__get__", 0);
17983 
17984   /* "View.MemoryView":223
17985  *     @property
17986  *     def memview(self):
17987  *         return self.get_memview()             # <<<<<<<<<<<<<<
17988  *
17989  *     @cname('get_memview')
17990  */
17991   __Pyx_XDECREF(__pyx_r);
17992   __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 223, __pyx_L1_error)
17993   __Pyx_GOTREF(__pyx_t_1);
17994   __pyx_r = __pyx_t_1;
17995   __pyx_t_1 = 0;
17996   goto __pyx_L0;
17997 
17998   /* "View.MemoryView":222
17999  *
18000  *     @property
18001  *     def memview(self):             # <<<<<<<<<<<<<<
18002  *         return self.get_memview()
18003  *
18004  */
18005 
18006   /* function exit code */
18007   __pyx_L1_error:;
18008   __Pyx_XDECREF(__pyx_t_1);
18009   __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18010   __pyx_r = NULL;
18011   __pyx_L0:;
18012   __Pyx_XGIVEREF(__pyx_r);
18013   __Pyx_RefNannyFinishContext();
18014   return __pyx_r;
18015 }
18016 
18017 /* "View.MemoryView":226
18018  *
18019  *     @cname('get_memview')
18020  *     cdef get_memview(self):             # <<<<<<<<<<<<<<
18021  *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
18022  *         return  memoryview(self, flags, self.dtype_is_object)
18023  */
18024 
__pyx_array_get_memview(struct __pyx_array_obj * __pyx_v_self)18025 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
18026   int __pyx_v_flags;
18027   PyObject *__pyx_r = NULL;
18028   __Pyx_RefNannyDeclarations
18029   PyObject *__pyx_t_1 = NULL;
18030   PyObject *__pyx_t_2 = NULL;
18031   PyObject *__pyx_t_3 = NULL;
18032   __Pyx_RefNannySetupContext("get_memview", 0);
18033 
18034   /* "View.MemoryView":227
18035  *     @cname('get_memview')
18036  *     cdef get_memview(self):
18037  *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE             # <<<<<<<<<<<<<<
18038  *         return  memoryview(self, flags, self.dtype_is_object)
18039  *
18040  */
18041   __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
18042 
18043   /* "View.MemoryView":228
18044  *     cdef get_memview(self):
18045  *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
18046  *         return  memoryview(self, flags, self.dtype_is_object)             # <<<<<<<<<<<<<<
18047  *
18048  *     def __len__(self):
18049  */
18050   __Pyx_XDECREF(__pyx_r);
18051   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 228, __pyx_L1_error)
18052   __Pyx_GOTREF(__pyx_t_1);
18053   __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
18054   __Pyx_GOTREF(__pyx_t_2);
18055   __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 228, __pyx_L1_error)
18056   __Pyx_GOTREF(__pyx_t_3);
18057   __Pyx_INCREF(((PyObject *)__pyx_v_self));
18058   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
18059   PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
18060   __Pyx_GIVEREF(__pyx_t_1);
18061   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
18062   __Pyx_GIVEREF(__pyx_t_2);
18063   PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
18064   __pyx_t_1 = 0;
18065   __pyx_t_2 = 0;
18066   __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
18067   __Pyx_GOTREF(__pyx_t_2);
18068   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18069   __pyx_r = __pyx_t_2;
18070   __pyx_t_2 = 0;
18071   goto __pyx_L0;
18072 
18073   /* "View.MemoryView":226
18074  *
18075  *     @cname('get_memview')
18076  *     cdef get_memview(self):             # <<<<<<<<<<<<<<
18077  *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
18078  *         return  memoryview(self, flags, self.dtype_is_object)
18079  */
18080 
18081   /* function exit code */
18082   __pyx_L1_error:;
18083   __Pyx_XDECREF(__pyx_t_1);
18084   __Pyx_XDECREF(__pyx_t_2);
18085   __Pyx_XDECREF(__pyx_t_3);
18086   __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
18087   __pyx_r = 0;
18088   __pyx_L0:;
18089   __Pyx_XGIVEREF(__pyx_r);
18090   __Pyx_RefNannyFinishContext();
18091   return __pyx_r;
18092 }
18093 
18094 /* "View.MemoryView":230
18095  *         return  memoryview(self, flags, self.dtype_is_object)
18096  *
18097  *     def __len__(self):             # <<<<<<<<<<<<<<
18098  *         return self._shape[0]
18099  *
18100  */
18101 
18102 /* Python wrapper */
18103 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
__pyx_array___len__(PyObject * __pyx_v_self)18104 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
18105   Py_ssize_t __pyx_r;
18106   __Pyx_RefNannyDeclarations
18107   __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
18108   __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
18109 
18110   /* function exit code */
18111   __Pyx_RefNannyFinishContext();
18112   return __pyx_r;
18113 }
18114 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj * __pyx_v_self)18115 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
18116   Py_ssize_t __pyx_r;
18117   __Pyx_RefNannyDeclarations
18118   __Pyx_RefNannySetupContext("__len__", 0);
18119 
18120   /* "View.MemoryView":231
18121  *
18122  *     def __len__(self):
18123  *         return self._shape[0]             # <<<<<<<<<<<<<<
18124  *
18125  *     def __getattr__(self, attr):
18126  */
18127   __pyx_r = (__pyx_v_self->_shape[0]);
18128   goto __pyx_L0;
18129 
18130   /* "View.MemoryView":230
18131  *         return  memoryview(self, flags, self.dtype_is_object)
18132  *
18133  *     def __len__(self):             # <<<<<<<<<<<<<<
18134  *         return self._shape[0]
18135  *
18136  */
18137 
18138   /* function exit code */
18139   __pyx_L0:;
18140   __Pyx_RefNannyFinishContext();
18141   return __pyx_r;
18142 }
18143 
18144 /* "View.MemoryView":233
18145  *         return self._shape[0]
18146  *
18147  *     def __getattr__(self, attr):             # <<<<<<<<<<<<<<
18148  *         return getattr(self.memview, attr)
18149  *
18150  */
18151 
18152 /* Python wrapper */
18153 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)18154 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
18155   PyObject *__pyx_r = 0;
18156   __Pyx_RefNannyDeclarations
18157   __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
18158   __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
18159 
18160   /* function exit code */
18161   __Pyx_RefNannyFinishContext();
18162   return __pyx_r;
18163 }
18164 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj * __pyx_v_self,PyObject * __pyx_v_attr)18165 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
18166   PyObject *__pyx_r = NULL;
18167   __Pyx_RefNannyDeclarations
18168   PyObject *__pyx_t_1 = NULL;
18169   PyObject *__pyx_t_2 = NULL;
18170   __Pyx_RefNannySetupContext("__getattr__", 0);
18171 
18172   /* "View.MemoryView":234
18173  *
18174  *     def __getattr__(self, attr):
18175  *         return getattr(self.memview, attr)             # <<<<<<<<<<<<<<
18176  *
18177  *     def __getitem__(self, item):
18178  */
18179   __Pyx_XDECREF(__pyx_r);
18180   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 234, __pyx_L1_error)
18181   __Pyx_GOTREF(__pyx_t_1);
18182   __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 234, __pyx_L1_error)
18183   __Pyx_GOTREF(__pyx_t_2);
18184   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18185   __pyx_r = __pyx_t_2;
18186   __pyx_t_2 = 0;
18187   goto __pyx_L0;
18188 
18189   /* "View.MemoryView":233
18190  *         return self._shape[0]
18191  *
18192  *     def __getattr__(self, attr):             # <<<<<<<<<<<<<<
18193  *         return getattr(self.memview, attr)
18194  *
18195  */
18196 
18197   /* function exit code */
18198   __pyx_L1_error:;
18199   __Pyx_XDECREF(__pyx_t_1);
18200   __Pyx_XDECREF(__pyx_t_2);
18201   __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18202   __pyx_r = NULL;
18203   __pyx_L0:;
18204   __Pyx_XGIVEREF(__pyx_r);
18205   __Pyx_RefNannyFinishContext();
18206   return __pyx_r;
18207 }
18208 
18209 /* "View.MemoryView":236
18210  *         return getattr(self.memview, attr)
18211  *
18212  *     def __getitem__(self, item):             # <<<<<<<<<<<<<<
18213  *         return self.memview[item]
18214  *
18215  */
18216 
18217 /* Python wrapper */
18218 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)18219 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
18220   PyObject *__pyx_r = 0;
18221   __Pyx_RefNannyDeclarations
18222   __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
18223   __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
18224 
18225   /* function exit code */
18226   __Pyx_RefNannyFinishContext();
18227   return __pyx_r;
18228 }
18229 
__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj * __pyx_v_self,PyObject * __pyx_v_item)18230 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
18231   PyObject *__pyx_r = NULL;
18232   __Pyx_RefNannyDeclarations
18233   PyObject *__pyx_t_1 = NULL;
18234   PyObject *__pyx_t_2 = NULL;
18235   __Pyx_RefNannySetupContext("__getitem__", 0);
18236 
18237   /* "View.MemoryView":237
18238  *
18239  *     def __getitem__(self, item):
18240  *         return self.memview[item]             # <<<<<<<<<<<<<<
18241  *
18242  *     def __setitem__(self, item, value):
18243  */
18244   __Pyx_XDECREF(__pyx_r);
18245   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 237, __pyx_L1_error)
18246   __Pyx_GOTREF(__pyx_t_1);
18247   __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 237, __pyx_L1_error)
18248   __Pyx_GOTREF(__pyx_t_2);
18249   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18250   __pyx_r = __pyx_t_2;
18251   __pyx_t_2 = 0;
18252   goto __pyx_L0;
18253 
18254   /* "View.MemoryView":236
18255  *         return getattr(self.memview, attr)
18256  *
18257  *     def __getitem__(self, item):             # <<<<<<<<<<<<<<
18258  *         return self.memview[item]
18259  *
18260  */
18261 
18262   /* function exit code */
18263   __pyx_L1_error:;
18264   __Pyx_XDECREF(__pyx_t_1);
18265   __Pyx_XDECREF(__pyx_t_2);
18266   __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18267   __pyx_r = NULL;
18268   __pyx_L0:;
18269   __Pyx_XGIVEREF(__pyx_r);
18270   __Pyx_RefNannyFinishContext();
18271   return __pyx_r;
18272 }
18273 
18274 /* "View.MemoryView":239
18275  *         return self.memview[item]
18276  *
18277  *     def __setitem__(self, item, value):             # <<<<<<<<<<<<<<
18278  *         self.memview[item] = value
18279  *
18280  */
18281 
18282 /* Python wrapper */
18283 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)18284 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
18285   int __pyx_r;
18286   __Pyx_RefNannyDeclarations
18287   __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
18288   __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));
18289 
18290   /* function exit code */
18291   __Pyx_RefNannyFinishContext();
18292   return __pyx_r;
18293 }
18294 
__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)18295 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) {
18296   int __pyx_r;
18297   __Pyx_RefNannyDeclarations
18298   PyObject *__pyx_t_1 = NULL;
18299   __Pyx_RefNannySetupContext("__setitem__", 0);
18300 
18301   /* "View.MemoryView":240
18302  *
18303  *     def __setitem__(self, item, value):
18304  *         self.memview[item] = value             # <<<<<<<<<<<<<<
18305  *
18306  *
18307  */
18308   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 240, __pyx_L1_error)
18309   __Pyx_GOTREF(__pyx_t_1);
18310   if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 240, __pyx_L1_error)
18311   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18312 
18313   /* "View.MemoryView":239
18314  *         return self.memview[item]
18315  *
18316  *     def __setitem__(self, item, value):             # <<<<<<<<<<<<<<
18317  *         self.memview[item] = value
18318  *
18319  */
18320 
18321   /* function exit code */
18322   __pyx_r = 0;
18323   goto __pyx_L0;
18324   __pyx_L1_error:;
18325   __Pyx_XDECREF(__pyx_t_1);
18326   __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18327   __pyx_r = -1;
18328   __pyx_L0:;
18329   __Pyx_RefNannyFinishContext();
18330   return __pyx_r;
18331 }
18332 
18333 /* "(tree fragment)":1
18334  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
18335  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18336  * def __setstate_cython__(self, __pyx_state):
18337  */
18338 
18339 /* Python wrapper */
18340 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)18341 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
18342   PyObject *__pyx_r = 0;
18343   __Pyx_RefNannyDeclarations
18344   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
18345   __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
18346 
18347   /* function exit code */
18348   __Pyx_RefNannyFinishContext();
18349   return __pyx_r;
18350 }
18351 
__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj * __pyx_v_self)18352 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
18353   PyObject *__pyx_r = NULL;
18354   __Pyx_RefNannyDeclarations
18355   PyObject *__pyx_t_1 = NULL;
18356   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
18357 
18358   /* "(tree fragment)":2
18359  * def __reduce_cython__(self):
18360  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
18361  * def __setstate_cython__(self, __pyx_state):
18362  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18363  */
18364   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
18365   __Pyx_GOTREF(__pyx_t_1);
18366   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
18367   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18368   __PYX_ERR(1, 2, __pyx_L1_error)
18369 
18370   /* "(tree fragment)":1
18371  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
18372  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18373  * def __setstate_cython__(self, __pyx_state):
18374  */
18375 
18376   /* function exit code */
18377   __pyx_L1_error:;
18378   __Pyx_XDECREF(__pyx_t_1);
18379   __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18380   __pyx_r = NULL;
18381   __Pyx_XGIVEREF(__pyx_r);
18382   __Pyx_RefNannyFinishContext();
18383   return __pyx_r;
18384 }
18385 
18386 /* "(tree fragment)":3
18387  * def __reduce_cython__(self):
18388  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18389  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
18390  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18391  */
18392 
18393 /* Python wrapper */
18394 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)18395 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
18396   PyObject *__pyx_r = 0;
18397   __Pyx_RefNannyDeclarations
18398   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
18399   __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
18400 
18401   /* function exit code */
18402   __Pyx_RefNannyFinishContext();
18403   return __pyx_r;
18404 }
18405 
__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)18406 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) {
18407   PyObject *__pyx_r = NULL;
18408   __Pyx_RefNannyDeclarations
18409   PyObject *__pyx_t_1 = NULL;
18410   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
18411 
18412   /* "(tree fragment)":4
18413  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18414  * def __setstate_cython__(self, __pyx_state):
18415  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
18416  */
18417   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
18418   __Pyx_GOTREF(__pyx_t_1);
18419   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
18420   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18421   __PYX_ERR(1, 4, __pyx_L1_error)
18422 
18423   /* "(tree fragment)":3
18424  * def __reduce_cython__(self):
18425  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18426  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
18427  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
18428  */
18429 
18430   /* function exit code */
18431   __pyx_L1_error:;
18432   __Pyx_XDECREF(__pyx_t_1);
18433   __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18434   __pyx_r = NULL;
18435   __Pyx_XGIVEREF(__pyx_r);
18436   __Pyx_RefNannyFinishContext();
18437   return __pyx_r;
18438 }
18439 
18440 /* "View.MemoryView":244
18441  *
18442  * @cname("__pyx_array_new")
18443  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format,             # <<<<<<<<<<<<<<
18444  *                           char *mode, char *buf):
18445  *     cdef array result
18446  */
18447 
__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)18448 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) {
18449   struct __pyx_array_obj *__pyx_v_result = 0;
18450   struct __pyx_array_obj *__pyx_r = NULL;
18451   __Pyx_RefNannyDeclarations
18452   int __pyx_t_1;
18453   PyObject *__pyx_t_2 = NULL;
18454   PyObject *__pyx_t_3 = NULL;
18455   PyObject *__pyx_t_4 = NULL;
18456   PyObject *__pyx_t_5 = NULL;
18457   __Pyx_RefNannySetupContext("array_cwrapper", 0);
18458 
18459   /* "View.MemoryView":248
18460  *     cdef array result
18461  *
18462  *     if buf == NULL:             # <<<<<<<<<<<<<<
18463  *         result = array(shape, itemsize, format, mode.decode('ASCII'))
18464  *     else:
18465  */
18466   __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
18467   if (__pyx_t_1) {
18468 
18469     /* "View.MemoryView":249
18470  *
18471  *     if buf == NULL:
18472  *         result = array(shape, itemsize, format, mode.decode('ASCII'))             # <<<<<<<<<<<<<<
18473  *     else:
18474  *         result = array(shape, itemsize, format, mode.decode('ASCII'),
18475  */
18476     __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 249, __pyx_L1_error)
18477     __Pyx_GOTREF(__pyx_t_2);
18478     __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 249, __pyx_L1_error)
18479     __Pyx_GOTREF(__pyx_t_3);
18480     __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
18481     __Pyx_GOTREF(__pyx_t_4);
18482     __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 249, __pyx_L1_error)
18483     __Pyx_GOTREF(__pyx_t_5);
18484     __Pyx_INCREF(__pyx_v_shape);
18485     __Pyx_GIVEREF(__pyx_v_shape);
18486     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
18487     __Pyx_GIVEREF(__pyx_t_2);
18488     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
18489     __Pyx_GIVEREF(__pyx_t_3);
18490     PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
18491     __Pyx_GIVEREF(__pyx_t_4);
18492     PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
18493     __pyx_t_2 = 0;
18494     __pyx_t_3 = 0;
18495     __pyx_t_4 = 0;
18496     __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
18497     __Pyx_GOTREF(__pyx_t_4);
18498     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18499     __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
18500     __pyx_t_4 = 0;
18501 
18502     /* "View.MemoryView":248
18503  *     cdef array result
18504  *
18505  *     if buf == NULL:             # <<<<<<<<<<<<<<
18506  *         result = array(shape, itemsize, format, mode.decode('ASCII'))
18507  *     else:
18508  */
18509     goto __pyx_L3;
18510   }
18511 
18512   /* "View.MemoryView":251
18513  *         result = array(shape, itemsize, format, mode.decode('ASCII'))
18514  *     else:
18515  *         result = array(shape, itemsize, format, mode.decode('ASCII'),             # <<<<<<<<<<<<<<
18516  *                        allocate_buffer=False)
18517  *         result.data = buf
18518  */
18519   /*else*/ {
18520     __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 251, __pyx_L1_error)
18521     __Pyx_GOTREF(__pyx_t_4);
18522     __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
18523     __Pyx_GOTREF(__pyx_t_5);
18524     __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 251, __pyx_L1_error)
18525     __Pyx_GOTREF(__pyx_t_3);
18526     __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 251, __pyx_L1_error)
18527     __Pyx_GOTREF(__pyx_t_2);
18528     __Pyx_INCREF(__pyx_v_shape);
18529     __Pyx_GIVEREF(__pyx_v_shape);
18530     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
18531     __Pyx_GIVEREF(__pyx_t_4);
18532     PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
18533     __Pyx_GIVEREF(__pyx_t_5);
18534     PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
18535     __Pyx_GIVEREF(__pyx_t_3);
18536     PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
18537     __pyx_t_4 = 0;
18538     __pyx_t_5 = 0;
18539     __pyx_t_3 = 0;
18540 
18541     /* "View.MemoryView":252
18542  *     else:
18543  *         result = array(shape, itemsize, format, mode.decode('ASCII'),
18544  *                        allocate_buffer=False)             # <<<<<<<<<<<<<<
18545  *         result.data = buf
18546  *
18547  */
18548     __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error)
18549     __Pyx_GOTREF(__pyx_t_3);
18550     if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 252, __pyx_L1_error)
18551 
18552     /* "View.MemoryView":251
18553  *         result = array(shape, itemsize, format, mode.decode('ASCII'))
18554  *     else:
18555  *         result = array(shape, itemsize, format, mode.decode('ASCII'),             # <<<<<<<<<<<<<<
18556  *                        allocate_buffer=False)
18557  *         result.data = buf
18558  */
18559     __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
18560     __Pyx_GOTREF(__pyx_t_5);
18561     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18562     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18563     __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
18564     __pyx_t_5 = 0;
18565 
18566     /* "View.MemoryView":253
18567  *         result = array(shape, itemsize, format, mode.decode('ASCII'),
18568  *                        allocate_buffer=False)
18569  *         result.data = buf             # <<<<<<<<<<<<<<
18570  *
18571  *     return result
18572  */
18573     __pyx_v_result->data = __pyx_v_buf;
18574   }
18575   __pyx_L3:;
18576 
18577   /* "View.MemoryView":255
18578  *         result.data = buf
18579  *
18580  *     return result             # <<<<<<<<<<<<<<
18581  *
18582  *
18583  */
18584   __Pyx_XDECREF(((PyObject *)__pyx_r));
18585   __Pyx_INCREF(((PyObject *)__pyx_v_result));
18586   __pyx_r = __pyx_v_result;
18587   goto __pyx_L0;
18588 
18589   /* "View.MemoryView":244
18590  *
18591  * @cname("__pyx_array_new")
18592  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format,             # <<<<<<<<<<<<<<
18593  *                           char *mode, char *buf):
18594  *     cdef array result
18595  */
18596 
18597   /* function exit code */
18598   __pyx_L1_error:;
18599   __Pyx_XDECREF(__pyx_t_2);
18600   __Pyx_XDECREF(__pyx_t_3);
18601   __Pyx_XDECREF(__pyx_t_4);
18602   __Pyx_XDECREF(__pyx_t_5);
18603   __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
18604   __pyx_r = 0;
18605   __pyx_L0:;
18606   __Pyx_XDECREF((PyObject *)__pyx_v_result);
18607   __Pyx_XGIVEREF((PyObject *)__pyx_r);
18608   __Pyx_RefNannyFinishContext();
18609   return __pyx_r;
18610 }
18611 
18612 /* "View.MemoryView":281
18613  * cdef class Enum(object):
18614  *     cdef object name
18615  *     def __init__(self, name):             # <<<<<<<<<<<<<<
18616  *         self.name = name
18617  *     def __repr__(self):
18618  */
18619 
18620 /* Python wrapper */
18621 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)18622 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18623   PyObject *__pyx_v_name = 0;
18624   int __pyx_r;
18625   __Pyx_RefNannyDeclarations
18626   __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
18627   {
18628     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
18629     PyObject* values[1] = {0};
18630     if (unlikely(__pyx_kwds)) {
18631       Py_ssize_t kw_args;
18632       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
18633       switch (pos_args) {
18634         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18635         CYTHON_FALLTHROUGH;
18636         case  0: break;
18637         default: goto __pyx_L5_argtuple_error;
18638       }
18639       kw_args = PyDict_Size(__pyx_kwds);
18640       switch (pos_args) {
18641         case  0:
18642         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
18643         else goto __pyx_L5_argtuple_error;
18644       }
18645       if (unlikely(kw_args > 0)) {
18646         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 281, __pyx_L3_error)
18647       }
18648     } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
18649       goto __pyx_L5_argtuple_error;
18650     } else {
18651       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18652     }
18653     __pyx_v_name = values[0];
18654   }
18655   goto __pyx_L4_argument_unpacking_done;
18656   __pyx_L5_argtuple_error:;
18657   __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 281, __pyx_L3_error)
18658   __pyx_L3_error:;
18659   __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18660   __Pyx_RefNannyFinishContext();
18661   return -1;
18662   __pyx_L4_argument_unpacking_done:;
18663   __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
18664 
18665   /* function exit code */
18666   __Pyx_RefNannyFinishContext();
18667   return __pyx_r;
18668 }
18669 
__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj * __pyx_v_self,PyObject * __pyx_v_name)18670 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
18671   int __pyx_r;
18672   __Pyx_RefNannyDeclarations
18673   __Pyx_RefNannySetupContext("__init__", 0);
18674 
18675   /* "View.MemoryView":282
18676  *     cdef object name
18677  *     def __init__(self, name):
18678  *         self.name = name             # <<<<<<<<<<<<<<
18679  *     def __repr__(self):
18680  *         return self.name
18681  */
18682   __Pyx_INCREF(__pyx_v_name);
18683   __Pyx_GIVEREF(__pyx_v_name);
18684   __Pyx_GOTREF(__pyx_v_self->name);
18685   __Pyx_DECREF(__pyx_v_self->name);
18686   __pyx_v_self->name = __pyx_v_name;
18687 
18688   /* "View.MemoryView":281
18689  * cdef class Enum(object):
18690  *     cdef object name
18691  *     def __init__(self, name):             # <<<<<<<<<<<<<<
18692  *         self.name = name
18693  *     def __repr__(self):
18694  */
18695 
18696   /* function exit code */
18697   __pyx_r = 0;
18698   __Pyx_RefNannyFinishContext();
18699   return __pyx_r;
18700 }
18701 
18702 /* "View.MemoryView":283
18703  *     def __init__(self, name):
18704  *         self.name = name
18705  *     def __repr__(self):             # <<<<<<<<<<<<<<
18706  *         return self.name
18707  *
18708  */
18709 
18710 /* Python wrapper */
18711 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
__pyx_MemviewEnum___repr__(PyObject * __pyx_v_self)18712 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
18713   PyObject *__pyx_r = 0;
18714   __Pyx_RefNannyDeclarations
18715   __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
18716   __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
18717 
18718   /* function exit code */
18719   __Pyx_RefNannyFinishContext();
18720   return __pyx_r;
18721 }
18722 
__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj * __pyx_v_self)18723 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
18724   PyObject *__pyx_r = NULL;
18725   __Pyx_RefNannyDeclarations
18726   __Pyx_RefNannySetupContext("__repr__", 0);
18727 
18728   /* "View.MemoryView":284
18729  *         self.name = name
18730  *     def __repr__(self):
18731  *         return self.name             # <<<<<<<<<<<<<<
18732  *
18733  * cdef generic = Enum("<strided and direct or indirect>")
18734  */
18735   __Pyx_XDECREF(__pyx_r);
18736   __Pyx_INCREF(__pyx_v_self->name);
18737   __pyx_r = __pyx_v_self->name;
18738   goto __pyx_L0;
18739 
18740   /* "View.MemoryView":283
18741  *     def __init__(self, name):
18742  *         self.name = name
18743  *     def __repr__(self):             # <<<<<<<<<<<<<<
18744  *         return self.name
18745  *
18746  */
18747 
18748   /* function exit code */
18749   __pyx_L0:;
18750   __Pyx_XGIVEREF(__pyx_r);
18751   __Pyx_RefNannyFinishContext();
18752   return __pyx_r;
18753 }
18754 
18755 /* "(tree fragment)":1
18756  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
18757  *     cdef tuple state
18758  *     cdef object _dict
18759  */
18760 
18761 /* Python wrapper */
18762 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)18763 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
18764   PyObject *__pyx_r = 0;
18765   __Pyx_RefNannyDeclarations
18766   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
18767   __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
18768 
18769   /* function exit code */
18770   __Pyx_RefNannyFinishContext();
18771   return __pyx_r;
18772 }
18773 
__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj * __pyx_v_self)18774 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
18775   PyObject *__pyx_v_state = 0;
18776   PyObject *__pyx_v__dict = 0;
18777   int __pyx_v_use_setstate;
18778   PyObject *__pyx_r = NULL;
18779   __Pyx_RefNannyDeclarations
18780   PyObject *__pyx_t_1 = NULL;
18781   int __pyx_t_2;
18782   int __pyx_t_3;
18783   PyObject *__pyx_t_4 = NULL;
18784   PyObject *__pyx_t_5 = NULL;
18785   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
18786 
18787   /* "(tree fragment)":5
18788  *     cdef object _dict
18789  *     cdef bint use_setstate
18790  *     state = (self.name,)             # <<<<<<<<<<<<<<
18791  *     _dict = getattr(self, '__dict__', None)
18792  *     if _dict is not None:
18793  */
18794   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
18795   __Pyx_GOTREF(__pyx_t_1);
18796   __Pyx_INCREF(__pyx_v_self->name);
18797   __Pyx_GIVEREF(__pyx_v_self->name);
18798   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
18799   __pyx_v_state = ((PyObject*)__pyx_t_1);
18800   __pyx_t_1 = 0;
18801 
18802   /* "(tree fragment)":6
18803  *     cdef bint use_setstate
18804  *     state = (self.name,)
18805  *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
18806  *     if _dict is not None:
18807  *         state += (_dict,)
18808  */
18809   __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
18810   __Pyx_GOTREF(__pyx_t_1);
18811   __pyx_v__dict = __pyx_t_1;
18812   __pyx_t_1 = 0;
18813 
18814   /* "(tree fragment)":7
18815  *     state = (self.name,)
18816  *     _dict = getattr(self, '__dict__', None)
18817  *     if _dict is not None:             # <<<<<<<<<<<<<<
18818  *         state += (_dict,)
18819  *         use_setstate = True
18820  */
18821   __pyx_t_2 = (__pyx_v__dict != Py_None);
18822   __pyx_t_3 = (__pyx_t_2 != 0);
18823   if (__pyx_t_3) {
18824 
18825     /* "(tree fragment)":8
18826  *     _dict = getattr(self, '__dict__', None)
18827  *     if _dict is not None:
18828  *         state += (_dict,)             # <<<<<<<<<<<<<<
18829  *         use_setstate = True
18830  *     else:
18831  */
18832     __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
18833     __Pyx_GOTREF(__pyx_t_1);
18834     __Pyx_INCREF(__pyx_v__dict);
18835     __Pyx_GIVEREF(__pyx_v__dict);
18836     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
18837     __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
18838     __Pyx_GOTREF(__pyx_t_4);
18839     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18840     __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
18841     __pyx_t_4 = 0;
18842 
18843     /* "(tree fragment)":9
18844  *     if _dict is not None:
18845  *         state += (_dict,)
18846  *         use_setstate = True             # <<<<<<<<<<<<<<
18847  *     else:
18848  *         use_setstate = self.name is not None
18849  */
18850     __pyx_v_use_setstate = 1;
18851 
18852     /* "(tree fragment)":7
18853  *     state = (self.name,)
18854  *     _dict = getattr(self, '__dict__', None)
18855  *     if _dict is not None:             # <<<<<<<<<<<<<<
18856  *         state += (_dict,)
18857  *         use_setstate = True
18858  */
18859     goto __pyx_L3;
18860   }
18861 
18862   /* "(tree fragment)":11
18863  *         use_setstate = True
18864  *     else:
18865  *         use_setstate = self.name is not None             # <<<<<<<<<<<<<<
18866  *     if use_setstate:
18867  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
18868  */
18869   /*else*/ {
18870     __pyx_t_3 = (__pyx_v_self->name != Py_None);
18871     __pyx_v_use_setstate = __pyx_t_3;
18872   }
18873   __pyx_L3:;
18874 
18875   /* "(tree fragment)":12
18876  *     else:
18877  *         use_setstate = self.name is not None
18878  *     if use_setstate:             # <<<<<<<<<<<<<<
18879  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
18880  *     else:
18881  */
18882   __pyx_t_3 = (__pyx_v_use_setstate != 0);
18883   if (__pyx_t_3) {
18884 
18885     /* "(tree fragment)":13
18886  *         use_setstate = self.name is not None
18887  *     if use_setstate:
18888  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state             # <<<<<<<<<<<<<<
18889  *     else:
18890  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
18891  */
18892     __Pyx_XDECREF(__pyx_r);
18893     __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
18894     __Pyx_GOTREF(__pyx_t_4);
18895     __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
18896     __Pyx_GOTREF(__pyx_t_1);
18897     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
18898     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
18899     PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
18900     __Pyx_INCREF(__pyx_int_184977713);
18901     __Pyx_GIVEREF(__pyx_int_184977713);
18902     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
18903     __Pyx_INCREF(Py_None);
18904     __Pyx_GIVEREF(Py_None);
18905     PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
18906     __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
18907     __Pyx_GOTREF(__pyx_t_5);
18908     __Pyx_GIVEREF(__pyx_t_4);
18909     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
18910     __Pyx_GIVEREF(__pyx_t_1);
18911     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
18912     __Pyx_INCREF(__pyx_v_state);
18913     __Pyx_GIVEREF(__pyx_v_state);
18914     PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
18915     __pyx_t_4 = 0;
18916     __pyx_t_1 = 0;
18917     __pyx_r = __pyx_t_5;
18918     __pyx_t_5 = 0;
18919     goto __pyx_L0;
18920 
18921     /* "(tree fragment)":12
18922  *     else:
18923  *         use_setstate = self.name is not None
18924  *     if use_setstate:             # <<<<<<<<<<<<<<
18925  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
18926  *     else:
18927  */
18928   }
18929 
18930   /* "(tree fragment)":15
18931  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
18932  *     else:
18933  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)             # <<<<<<<<<<<<<<
18934  * def __setstate_cython__(self, __pyx_state):
18935  *     __pyx_unpickle_Enum__set_state(self, __pyx_state)
18936  */
18937   /*else*/ {
18938     __Pyx_XDECREF(__pyx_r);
18939     __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
18940     __Pyx_GOTREF(__pyx_t_5);
18941     __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
18942     __Pyx_GOTREF(__pyx_t_1);
18943     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
18944     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
18945     PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
18946     __Pyx_INCREF(__pyx_int_184977713);
18947     __Pyx_GIVEREF(__pyx_int_184977713);
18948     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
18949     __Pyx_INCREF(__pyx_v_state);
18950     __Pyx_GIVEREF(__pyx_v_state);
18951     PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
18952     __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
18953     __Pyx_GOTREF(__pyx_t_4);
18954     __Pyx_GIVEREF(__pyx_t_5);
18955     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
18956     __Pyx_GIVEREF(__pyx_t_1);
18957     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
18958     __pyx_t_5 = 0;
18959     __pyx_t_1 = 0;
18960     __pyx_r = __pyx_t_4;
18961     __pyx_t_4 = 0;
18962     goto __pyx_L0;
18963   }
18964 
18965   /* "(tree fragment)":1
18966  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
18967  *     cdef tuple state
18968  *     cdef object _dict
18969  */
18970 
18971   /* function exit code */
18972   __pyx_L1_error:;
18973   __Pyx_XDECREF(__pyx_t_1);
18974   __Pyx_XDECREF(__pyx_t_4);
18975   __Pyx_XDECREF(__pyx_t_5);
18976   __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18977   __pyx_r = NULL;
18978   __pyx_L0:;
18979   __Pyx_XDECREF(__pyx_v_state);
18980   __Pyx_XDECREF(__pyx_v__dict);
18981   __Pyx_XGIVEREF(__pyx_r);
18982   __Pyx_RefNannyFinishContext();
18983   return __pyx_r;
18984 }
18985 
18986 /* "(tree fragment)":16
18987  *     else:
18988  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
18989  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
18990  *     __pyx_unpickle_Enum__set_state(self, __pyx_state)
18991  */
18992 
18993 /* Python wrapper */
18994 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)18995 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
18996   PyObject *__pyx_r = 0;
18997   __Pyx_RefNannyDeclarations
18998   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
18999   __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
19000 
19001   /* function exit code */
19002   __Pyx_RefNannyFinishContext();
19003   return __pyx_r;
19004 }
19005 
__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj * __pyx_v_self,PyObject * __pyx_v___pyx_state)19006 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
19007   PyObject *__pyx_r = NULL;
19008   __Pyx_RefNannyDeclarations
19009   PyObject *__pyx_t_1 = NULL;
19010   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
19011 
19012   /* "(tree fragment)":17
19013  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
19014  * def __setstate_cython__(self, __pyx_state):
19015  *     __pyx_unpickle_Enum__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
19016  */
19017   if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
19018   __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
19019   __Pyx_GOTREF(__pyx_t_1);
19020   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19021 
19022   /* "(tree fragment)":16
19023  *     else:
19024  *         return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
19025  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
19026  *     __pyx_unpickle_Enum__set_state(self, __pyx_state)
19027  */
19028 
19029   /* function exit code */
19030   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19031   goto __pyx_L0;
19032   __pyx_L1_error:;
19033   __Pyx_XDECREF(__pyx_t_1);
19034   __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
19035   __pyx_r = NULL;
19036   __pyx_L0:;
19037   __Pyx_XGIVEREF(__pyx_r);
19038   __Pyx_RefNannyFinishContext();
19039   return __pyx_r;
19040 }
19041 
19042 /* "View.MemoryView":298
19043  *
19044  * @cname('__pyx_align_pointer')
19045  * cdef void *align_pointer(void *memory, size_t alignment) nogil:             # <<<<<<<<<<<<<<
19046  *     "Align pointer memory on a given boundary"
19047  *     cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
19048  */
19049 
__pyx_align_pointer(void * __pyx_v_memory,size_t __pyx_v_alignment)19050 static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
19051   Py_intptr_t __pyx_v_aligned_p;
19052   size_t __pyx_v_offset;
19053   void *__pyx_r;
19054   int __pyx_t_1;
19055 
19056   /* "View.MemoryView":300
19057  * cdef void *align_pointer(void *memory, size_t alignment) nogil:
19058  *     "Align pointer memory on a given boundary"
19059  *     cdef Py_intptr_t aligned_p = <Py_intptr_t> memory             # <<<<<<<<<<<<<<
19060  *     cdef size_t offset
19061  *
19062  */
19063   __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
19064 
19065   /* "View.MemoryView":304
19066  *
19067  *     with cython.cdivision(True):
19068  *         offset = aligned_p % alignment             # <<<<<<<<<<<<<<
19069  *
19070  *     if offset > 0:
19071  */
19072   __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
19073 
19074   /* "View.MemoryView":306
19075  *         offset = aligned_p % alignment
19076  *
19077  *     if offset > 0:             # <<<<<<<<<<<<<<
19078  *         aligned_p += alignment - offset
19079  *
19080  */
19081   __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
19082   if (__pyx_t_1) {
19083 
19084     /* "View.MemoryView":307
19085  *
19086  *     if offset > 0:
19087  *         aligned_p += alignment - offset             # <<<<<<<<<<<<<<
19088  *
19089  *     return <void *> aligned_p
19090  */
19091     __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
19092 
19093     /* "View.MemoryView":306
19094  *         offset = aligned_p % alignment
19095  *
19096  *     if offset > 0:             # <<<<<<<<<<<<<<
19097  *         aligned_p += alignment - offset
19098  *
19099  */
19100   }
19101 
19102   /* "View.MemoryView":309
19103  *         aligned_p += alignment - offset
19104  *
19105  *     return <void *> aligned_p             # <<<<<<<<<<<<<<
19106  *
19107  *
19108  */
19109   __pyx_r = ((void *)__pyx_v_aligned_p);
19110   goto __pyx_L0;
19111 
19112   /* "View.MemoryView":298
19113  *
19114  * @cname('__pyx_align_pointer')
19115  * cdef void *align_pointer(void *memory, size_t alignment) nogil:             # <<<<<<<<<<<<<<
19116  *     "Align pointer memory on a given boundary"
19117  *     cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
19118  */
19119 
19120   /* function exit code */
19121   __pyx_L0:;
19122   return __pyx_r;
19123 }
19124 
19125 /* "View.MemoryView":345
19126  *     cdef __Pyx_TypeInfo *typeinfo
19127  *
19128  *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):             # <<<<<<<<<<<<<<
19129  *         self.obj = obj
19130  *         self.flags = flags
19131  */
19132 
19133 /* Python wrapper */
19134 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)19135 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
19136   PyObject *__pyx_v_obj = 0;
19137   int __pyx_v_flags;
19138   int __pyx_v_dtype_is_object;
19139   int __pyx_r;
19140   __Pyx_RefNannyDeclarations
19141   __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
19142   {
19143     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
19144     PyObject* values[3] = {0,0,0};
19145     if (unlikely(__pyx_kwds)) {
19146       Py_ssize_t kw_args;
19147       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
19148       switch (pos_args) {
19149         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
19150         CYTHON_FALLTHROUGH;
19151         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19152         CYTHON_FALLTHROUGH;
19153         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19154         CYTHON_FALLTHROUGH;
19155         case  0: break;
19156         default: goto __pyx_L5_argtuple_error;
19157       }
19158       kw_args = PyDict_Size(__pyx_kwds);
19159       switch (pos_args) {
19160         case  0:
19161         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
19162         else goto __pyx_L5_argtuple_error;
19163         CYTHON_FALLTHROUGH;
19164         case  1:
19165         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
19166         else {
19167           __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 345, __pyx_L3_error)
19168         }
19169         CYTHON_FALLTHROUGH;
19170         case  2:
19171         if (kw_args > 0) {
19172           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
19173           if (value) { values[2] = value; kw_args--; }
19174         }
19175       }
19176       if (unlikely(kw_args > 0)) {
19177         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 345, __pyx_L3_error)
19178       }
19179     } else {
19180       switch (PyTuple_GET_SIZE(__pyx_args)) {
19181         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
19182         CYTHON_FALLTHROUGH;
19183         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19184         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19185         break;
19186         default: goto __pyx_L5_argtuple_error;
19187       }
19188     }
19189     __pyx_v_obj = values[0];
19190     __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
19191     if (values[2]) {
19192       __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
19193     } else {
19194       __pyx_v_dtype_is_object = ((int)0);
19195     }
19196   }
19197   goto __pyx_L4_argument_unpacking_done;
19198   __pyx_L5_argtuple_error:;
19199   __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 345, __pyx_L3_error)
19200   __pyx_L3_error:;
19201   __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
19202   __Pyx_RefNannyFinishContext();
19203   return -1;
19204   __pyx_L4_argument_unpacking_done:;
19205   __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);
19206 
19207   /* function exit code */
19208   __Pyx_RefNannyFinishContext();
19209   return __pyx_r;
19210 }
19211 
__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)19212 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) {
19213   int __pyx_r;
19214   __Pyx_RefNannyDeclarations
19215   int __pyx_t_1;
19216   int __pyx_t_2;
19217   int __pyx_t_3;
19218   int __pyx_t_4;
19219   __Pyx_RefNannySetupContext("__cinit__", 0);
19220 
19221   /* "View.MemoryView":346
19222  *
19223  *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
19224  *         self.obj = obj             # <<<<<<<<<<<<<<
19225  *         self.flags = flags
19226  *         if type(self) is memoryview or obj is not None:
19227  */
19228   __Pyx_INCREF(__pyx_v_obj);
19229   __Pyx_GIVEREF(__pyx_v_obj);
19230   __Pyx_GOTREF(__pyx_v_self->obj);
19231   __Pyx_DECREF(__pyx_v_self->obj);
19232   __pyx_v_self->obj = __pyx_v_obj;
19233 
19234   /* "View.MemoryView":347
19235  *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
19236  *         self.obj = obj
19237  *         self.flags = flags             # <<<<<<<<<<<<<<
19238  *         if type(self) is memoryview or obj is not None:
19239  *             __Pyx_GetBuffer(obj, &self.view, flags)
19240  */
19241   __pyx_v_self->flags = __pyx_v_flags;
19242 
19243   /* "View.MemoryView":348
19244  *         self.obj = obj
19245  *         self.flags = flags
19246  *         if type(self) is memoryview or obj is not None:             # <<<<<<<<<<<<<<
19247  *             __Pyx_GetBuffer(obj, &self.view, flags)
19248  *             if <PyObject *> self.view.obj == NULL:
19249  */
19250   __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
19251   __pyx_t_3 = (__pyx_t_2 != 0);
19252   if (!__pyx_t_3) {
19253   } else {
19254     __pyx_t_1 = __pyx_t_3;
19255     goto __pyx_L4_bool_binop_done;
19256   }
19257   __pyx_t_3 = (__pyx_v_obj != Py_None);
19258   __pyx_t_2 = (__pyx_t_3 != 0);
19259   __pyx_t_1 = __pyx_t_2;
19260   __pyx_L4_bool_binop_done:;
19261   if (__pyx_t_1) {
19262 
19263     /* "View.MemoryView":349
19264  *         self.flags = flags
19265  *         if type(self) is memoryview or obj is not None:
19266  *             __Pyx_GetBuffer(obj, &self.view, flags)             # <<<<<<<<<<<<<<
19267  *             if <PyObject *> self.view.obj == NULL:
19268  *                 (<__pyx_buffer *> &self.view).obj = Py_None
19269  */
19270     __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 349, __pyx_L1_error)
19271 
19272     /* "View.MemoryView":350
19273  *         if type(self) is memoryview or obj is not None:
19274  *             __Pyx_GetBuffer(obj, &self.view, flags)
19275  *             if <PyObject *> self.view.obj == NULL:             # <<<<<<<<<<<<<<
19276  *                 (<__pyx_buffer *> &self.view).obj = Py_None
19277  *                 Py_INCREF(Py_None)
19278  */
19279     __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
19280     if (__pyx_t_1) {
19281 
19282       /* "View.MemoryView":351
19283  *             __Pyx_GetBuffer(obj, &self.view, flags)
19284  *             if <PyObject *> self.view.obj == NULL:
19285  *                 (<__pyx_buffer *> &self.view).obj = Py_None             # <<<<<<<<<<<<<<
19286  *                 Py_INCREF(Py_None)
19287  *
19288  */
19289       ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
19290 
19291       /* "View.MemoryView":352
19292  *             if <PyObject *> self.view.obj == NULL:
19293  *                 (<__pyx_buffer *> &self.view).obj = Py_None
19294  *                 Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
19295  *
19296  *         global __pyx_memoryview_thread_locks_used
19297  */
19298       Py_INCREF(Py_None);
19299 
19300       /* "View.MemoryView":350
19301  *         if type(self) is memoryview or obj is not None:
19302  *             __Pyx_GetBuffer(obj, &self.view, flags)
19303  *             if <PyObject *> self.view.obj == NULL:             # <<<<<<<<<<<<<<
19304  *                 (<__pyx_buffer *> &self.view).obj = Py_None
19305  *                 Py_INCREF(Py_None)
19306  */
19307     }
19308 
19309     /* "View.MemoryView":348
19310  *         self.obj = obj
19311  *         self.flags = flags
19312  *         if type(self) is memoryview or obj is not None:             # <<<<<<<<<<<<<<
19313  *             __Pyx_GetBuffer(obj, &self.view, flags)
19314  *             if <PyObject *> self.view.obj == NULL:
19315  */
19316   }
19317 
19318   /* "View.MemoryView":355
19319  *
19320  *         global __pyx_memoryview_thread_locks_used
19321  *         if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:             # <<<<<<<<<<<<<<
19322  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
19323  *             __pyx_memoryview_thread_locks_used += 1
19324  */
19325   __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
19326   if (__pyx_t_1) {
19327 
19328     /* "View.MemoryView":356
19329  *         global __pyx_memoryview_thread_locks_used
19330  *         if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
19331  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]             # <<<<<<<<<<<<<<
19332  *             __pyx_memoryview_thread_locks_used += 1
19333  *         if self.lock is NULL:
19334  */
19335     __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
19336 
19337     /* "View.MemoryView":357
19338  *         if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
19339  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
19340  *             __pyx_memoryview_thread_locks_used += 1             # <<<<<<<<<<<<<<
19341  *         if self.lock is NULL:
19342  *             self.lock = PyThread_allocate_lock()
19343  */
19344     __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
19345 
19346     /* "View.MemoryView":355
19347  *
19348  *         global __pyx_memoryview_thread_locks_used
19349  *         if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:             # <<<<<<<<<<<<<<
19350  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
19351  *             __pyx_memoryview_thread_locks_used += 1
19352  */
19353   }
19354 
19355   /* "View.MemoryView":358
19356  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
19357  *             __pyx_memoryview_thread_locks_used += 1
19358  *         if self.lock is NULL:             # <<<<<<<<<<<<<<
19359  *             self.lock = PyThread_allocate_lock()
19360  *             if self.lock is NULL:
19361  */
19362   __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
19363   if (__pyx_t_1) {
19364 
19365     /* "View.MemoryView":359
19366  *             __pyx_memoryview_thread_locks_used += 1
19367  *         if self.lock is NULL:
19368  *             self.lock = PyThread_allocate_lock()             # <<<<<<<<<<<<<<
19369  *             if self.lock is NULL:
19370  *                 raise MemoryError
19371  */
19372     __pyx_v_self->lock = PyThread_allocate_lock();
19373 
19374     /* "View.MemoryView":360
19375  *         if self.lock is NULL:
19376  *             self.lock = PyThread_allocate_lock()
19377  *             if self.lock is NULL:             # <<<<<<<<<<<<<<
19378  *                 raise MemoryError
19379  *
19380  */
19381     __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
19382     if (unlikely(__pyx_t_1)) {
19383 
19384       /* "View.MemoryView":361
19385  *             self.lock = PyThread_allocate_lock()
19386  *             if self.lock is NULL:
19387  *                 raise MemoryError             # <<<<<<<<<<<<<<
19388  *
19389  *         if flags & PyBUF_FORMAT:
19390  */
19391       PyErr_NoMemory(); __PYX_ERR(1, 361, __pyx_L1_error)
19392 
19393       /* "View.MemoryView":360
19394  *         if self.lock is NULL:
19395  *             self.lock = PyThread_allocate_lock()
19396  *             if self.lock is NULL:             # <<<<<<<<<<<<<<
19397  *                 raise MemoryError
19398  *
19399  */
19400     }
19401 
19402     /* "View.MemoryView":358
19403  *             self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
19404  *             __pyx_memoryview_thread_locks_used += 1
19405  *         if self.lock is NULL:             # <<<<<<<<<<<<<<
19406  *             self.lock = PyThread_allocate_lock()
19407  *             if self.lock is NULL:
19408  */
19409   }
19410 
19411   /* "View.MemoryView":363
19412  *                 raise MemoryError
19413  *
19414  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
19415  *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
19416  *         else:
19417  */
19418   __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
19419   if (__pyx_t_1) {
19420 
19421     /* "View.MemoryView":364
19422  *
19423  *         if flags & PyBUF_FORMAT:
19424  *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')             # <<<<<<<<<<<<<<
19425  *         else:
19426  *             self.dtype_is_object = dtype_is_object
19427  */
19428     __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
19429     if (__pyx_t_2) {
19430     } else {
19431       __pyx_t_1 = __pyx_t_2;
19432       goto __pyx_L11_bool_binop_done;
19433     }
19434     __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
19435     __pyx_t_1 = __pyx_t_2;
19436     __pyx_L11_bool_binop_done:;
19437     __pyx_v_self->dtype_is_object = __pyx_t_1;
19438 
19439     /* "View.MemoryView":363
19440  *                 raise MemoryError
19441  *
19442  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
19443  *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
19444  *         else:
19445  */
19446     goto __pyx_L10;
19447   }
19448 
19449   /* "View.MemoryView":366
19450  *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
19451  *         else:
19452  *             self.dtype_is_object = dtype_is_object             # <<<<<<<<<<<<<<
19453  *
19454  *         self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
19455  */
19456   /*else*/ {
19457     __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
19458   }
19459   __pyx_L10:;
19460 
19461   /* "View.MemoryView":368
19462  *             self.dtype_is_object = dtype_is_object
19463  *
19464  *         self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(             # <<<<<<<<<<<<<<
19465  *                   <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
19466  *         self.typeinfo = NULL
19467  */
19468   __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));
19469 
19470   /* "View.MemoryView":370
19471  *         self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
19472  *                   <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
19473  *         self.typeinfo = NULL             # <<<<<<<<<<<<<<
19474  *
19475  *     def __dealloc__(memoryview self):
19476  */
19477   __pyx_v_self->typeinfo = NULL;
19478 
19479   /* "View.MemoryView":345
19480  *     cdef __Pyx_TypeInfo *typeinfo
19481  *
19482  *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):             # <<<<<<<<<<<<<<
19483  *         self.obj = obj
19484  *         self.flags = flags
19485  */
19486 
19487   /* function exit code */
19488   __pyx_r = 0;
19489   goto __pyx_L0;
19490   __pyx_L1_error:;
19491   __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
19492   __pyx_r = -1;
19493   __pyx_L0:;
19494   __Pyx_RefNannyFinishContext();
19495   return __pyx_r;
19496 }
19497 
19498 /* "View.MemoryView":372
19499  *         self.typeinfo = NULL
19500  *
19501  *     def __dealloc__(memoryview self):             # <<<<<<<<<<<<<<
19502  *         if self.obj is not None:
19503  *             __Pyx_ReleaseBuffer(&self.view)
19504  */
19505 
19506 /* Python wrapper */
19507 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
__pyx_memoryview___dealloc__(PyObject * __pyx_v_self)19508 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
19509   __Pyx_RefNannyDeclarations
19510   __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
19511   __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
19512 
19513   /* function exit code */
19514   __Pyx_RefNannyFinishContext();
19515 }
19516 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj * __pyx_v_self)19517 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
19518   int __pyx_v_i;
19519   __Pyx_RefNannyDeclarations
19520   int __pyx_t_1;
19521   int __pyx_t_2;
19522   int __pyx_t_3;
19523   int __pyx_t_4;
19524   int __pyx_t_5;
19525   PyThread_type_lock __pyx_t_6;
19526   PyThread_type_lock __pyx_t_7;
19527   __Pyx_RefNannySetupContext("__dealloc__", 0);
19528 
19529   /* "View.MemoryView":373
19530  *
19531  *     def __dealloc__(memoryview self):
19532  *         if self.obj is not None:             # <<<<<<<<<<<<<<
19533  *             __Pyx_ReleaseBuffer(&self.view)
19534  *
19535  */
19536   __pyx_t_1 = (__pyx_v_self->obj != Py_None);
19537   __pyx_t_2 = (__pyx_t_1 != 0);
19538   if (__pyx_t_2) {
19539 
19540     /* "View.MemoryView":374
19541  *     def __dealloc__(memoryview self):
19542  *         if self.obj is not None:
19543  *             __Pyx_ReleaseBuffer(&self.view)             # <<<<<<<<<<<<<<
19544  *
19545  *         cdef int i
19546  */
19547     __Pyx_ReleaseBuffer((&__pyx_v_self->view));
19548 
19549     /* "View.MemoryView":373
19550  *
19551  *     def __dealloc__(memoryview self):
19552  *         if self.obj is not None:             # <<<<<<<<<<<<<<
19553  *             __Pyx_ReleaseBuffer(&self.view)
19554  *
19555  */
19556   }
19557 
19558   /* "View.MemoryView":378
19559  *         cdef int i
19560  *         global __pyx_memoryview_thread_locks_used
19561  *         if self.lock != NULL:             # <<<<<<<<<<<<<<
19562  *             for i in range(__pyx_memoryview_thread_locks_used):
19563  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
19564  */
19565   __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
19566   if (__pyx_t_2) {
19567 
19568     /* "View.MemoryView":379
19569  *         global __pyx_memoryview_thread_locks_used
19570  *         if self.lock != NULL:
19571  *             for i in range(__pyx_memoryview_thread_locks_used):             # <<<<<<<<<<<<<<
19572  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
19573  *                     __pyx_memoryview_thread_locks_used -= 1
19574  */
19575     __pyx_t_3 = __pyx_memoryview_thread_locks_used;
19576     __pyx_t_4 = __pyx_t_3;
19577     for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
19578       __pyx_v_i = __pyx_t_5;
19579 
19580       /* "View.MemoryView":380
19581  *         if self.lock != NULL:
19582  *             for i in range(__pyx_memoryview_thread_locks_used):
19583  *                 if __pyx_memoryview_thread_locks[i] is self.lock:             # <<<<<<<<<<<<<<
19584  *                     __pyx_memoryview_thread_locks_used -= 1
19585  *                     if i != __pyx_memoryview_thread_locks_used:
19586  */
19587       __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
19588       if (__pyx_t_2) {
19589 
19590         /* "View.MemoryView":381
19591  *             for i in range(__pyx_memoryview_thread_locks_used):
19592  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
19593  *                     __pyx_memoryview_thread_locks_used -= 1             # <<<<<<<<<<<<<<
19594  *                     if i != __pyx_memoryview_thread_locks_used:
19595  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
19596  */
19597         __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
19598 
19599         /* "View.MemoryView":382
19600  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
19601  *                     __pyx_memoryview_thread_locks_used -= 1
19602  *                     if i != __pyx_memoryview_thread_locks_used:             # <<<<<<<<<<<<<<
19603  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
19604  *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
19605  */
19606         __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
19607         if (__pyx_t_2) {
19608 
19609           /* "View.MemoryView":384
19610  *                     if i != __pyx_memoryview_thread_locks_used:
19611  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
19612  *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])             # <<<<<<<<<<<<<<
19613  *                     break
19614  *             else:
19615  */
19616           __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
19617           __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
19618 
19619           /* "View.MemoryView":383
19620  *                     __pyx_memoryview_thread_locks_used -= 1
19621  *                     if i != __pyx_memoryview_thread_locks_used:
19622  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (             # <<<<<<<<<<<<<<
19623  *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
19624  *                     break
19625  */
19626           (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
19627           (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
19628 
19629           /* "View.MemoryView":382
19630  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
19631  *                     __pyx_memoryview_thread_locks_used -= 1
19632  *                     if i != __pyx_memoryview_thread_locks_used:             # <<<<<<<<<<<<<<
19633  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
19634  *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
19635  */
19636         }
19637 
19638         /* "View.MemoryView":385
19639  *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
19640  *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
19641  *                     break             # <<<<<<<<<<<<<<
19642  *             else:
19643  *                 PyThread_free_lock(self.lock)
19644  */
19645         goto __pyx_L6_break;
19646 
19647         /* "View.MemoryView":380
19648  *         if self.lock != NULL:
19649  *             for i in range(__pyx_memoryview_thread_locks_used):
19650  *                 if __pyx_memoryview_thread_locks[i] is self.lock:             # <<<<<<<<<<<<<<
19651  *                     __pyx_memoryview_thread_locks_used -= 1
19652  *                     if i != __pyx_memoryview_thread_locks_used:
19653  */
19654       }
19655     }
19656     /*else*/ {
19657 
19658       /* "View.MemoryView":387
19659  *                     break
19660  *             else:
19661  *                 PyThread_free_lock(self.lock)             # <<<<<<<<<<<<<<
19662  *
19663  *     cdef char *get_item_pointer(memoryview self, object index) except NULL:
19664  */
19665       PyThread_free_lock(__pyx_v_self->lock);
19666     }
19667     __pyx_L6_break:;
19668 
19669     /* "View.MemoryView":378
19670  *         cdef int i
19671  *         global __pyx_memoryview_thread_locks_used
19672  *         if self.lock != NULL:             # <<<<<<<<<<<<<<
19673  *             for i in range(__pyx_memoryview_thread_locks_used):
19674  *                 if __pyx_memoryview_thread_locks[i] is self.lock:
19675  */
19676   }
19677 
19678   /* "View.MemoryView":372
19679  *         self.typeinfo = NULL
19680  *
19681  *     def __dealloc__(memoryview self):             # <<<<<<<<<<<<<<
19682  *         if self.obj is not None:
19683  *             __Pyx_ReleaseBuffer(&self.view)
19684  */
19685 
19686   /* function exit code */
19687   __Pyx_RefNannyFinishContext();
19688 }
19689 
19690 /* "View.MemoryView":389
19691  *                 PyThread_free_lock(self.lock)
19692  *
19693  *     cdef char *get_item_pointer(memoryview self, object index) except NULL:             # <<<<<<<<<<<<<<
19694  *         cdef Py_ssize_t dim
19695  *         cdef char *itemp = <char *> self.view.buf
19696  */
19697 
__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_index)19698 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
19699   Py_ssize_t __pyx_v_dim;
19700   char *__pyx_v_itemp;
19701   PyObject *__pyx_v_idx = NULL;
19702   char *__pyx_r;
19703   __Pyx_RefNannyDeclarations
19704   Py_ssize_t __pyx_t_1;
19705   PyObject *__pyx_t_2 = NULL;
19706   Py_ssize_t __pyx_t_3;
19707   PyObject *(*__pyx_t_4)(PyObject *);
19708   PyObject *__pyx_t_5 = NULL;
19709   Py_ssize_t __pyx_t_6;
19710   char *__pyx_t_7;
19711   __Pyx_RefNannySetupContext("get_item_pointer", 0);
19712 
19713   /* "View.MemoryView":391
19714  *     cdef char *get_item_pointer(memoryview self, object index) except NULL:
19715  *         cdef Py_ssize_t dim
19716  *         cdef char *itemp = <char *> self.view.buf             # <<<<<<<<<<<<<<
19717  *
19718  *         for dim, idx in enumerate(index):
19719  */
19720   __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
19721 
19722   /* "View.MemoryView":393
19723  *         cdef char *itemp = <char *> self.view.buf
19724  *
19725  *         for dim, idx in enumerate(index):             # <<<<<<<<<<<<<<
19726  *             itemp = pybuffer_index(&self.view, itemp, idx, dim)
19727  *
19728  */
19729   __pyx_t_1 = 0;
19730   if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
19731     __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
19732     __pyx_t_4 = NULL;
19733   } else {
19734     __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 393, __pyx_L1_error)
19735     __Pyx_GOTREF(__pyx_t_2);
19736     __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 393, __pyx_L1_error)
19737   }
19738   for (;;) {
19739     if (likely(!__pyx_t_4)) {
19740       if (likely(PyList_CheckExact(__pyx_t_2))) {
19741         if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
19742         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
19743         __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 393, __pyx_L1_error)
19744         #else
19745         __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 393, __pyx_L1_error)
19746         __Pyx_GOTREF(__pyx_t_5);
19747         #endif
19748       } else {
19749         if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
19750         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
19751         __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 393, __pyx_L1_error)
19752         #else
19753         __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 393, __pyx_L1_error)
19754         __Pyx_GOTREF(__pyx_t_5);
19755         #endif
19756       }
19757     } else {
19758       __pyx_t_5 = __pyx_t_4(__pyx_t_2);
19759       if (unlikely(!__pyx_t_5)) {
19760         PyObject* exc_type = PyErr_Occurred();
19761         if (exc_type) {
19762           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
19763           else __PYX_ERR(1, 393, __pyx_L1_error)
19764         }
19765         break;
19766       }
19767       __Pyx_GOTREF(__pyx_t_5);
19768     }
19769     __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
19770     __pyx_t_5 = 0;
19771     __pyx_v_dim = __pyx_t_1;
19772     __pyx_t_1 = (__pyx_t_1 + 1);
19773 
19774     /* "View.MemoryView":394
19775  *
19776  *         for dim, idx in enumerate(index):
19777  *             itemp = pybuffer_index(&self.view, itemp, idx, dim)             # <<<<<<<<<<<<<<
19778  *
19779  *         return itemp
19780  */
19781     __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 394, __pyx_L1_error)
19782     __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(1, 394, __pyx_L1_error)
19783     __pyx_v_itemp = __pyx_t_7;
19784 
19785     /* "View.MemoryView":393
19786  *         cdef char *itemp = <char *> self.view.buf
19787  *
19788  *         for dim, idx in enumerate(index):             # <<<<<<<<<<<<<<
19789  *             itemp = pybuffer_index(&self.view, itemp, idx, dim)
19790  *
19791  */
19792   }
19793   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19794 
19795   /* "View.MemoryView":396
19796  *             itemp = pybuffer_index(&self.view, itemp, idx, dim)
19797  *
19798  *         return itemp             # <<<<<<<<<<<<<<
19799  *
19800  *
19801  */
19802   __pyx_r = __pyx_v_itemp;
19803   goto __pyx_L0;
19804 
19805   /* "View.MemoryView":389
19806  *                 PyThread_free_lock(self.lock)
19807  *
19808  *     cdef char *get_item_pointer(memoryview self, object index) except NULL:             # <<<<<<<<<<<<<<
19809  *         cdef Py_ssize_t dim
19810  *         cdef char *itemp = <char *> self.view.buf
19811  */
19812 
19813   /* function exit code */
19814   __pyx_L1_error:;
19815   __Pyx_XDECREF(__pyx_t_2);
19816   __Pyx_XDECREF(__pyx_t_5);
19817   __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
19818   __pyx_r = NULL;
19819   __pyx_L0:;
19820   __Pyx_XDECREF(__pyx_v_idx);
19821   __Pyx_RefNannyFinishContext();
19822   return __pyx_r;
19823 }
19824 
19825 /* "View.MemoryView":399
19826  *
19827  *
19828  *     def __getitem__(memoryview self, object index):             # <<<<<<<<<<<<<<
19829  *         if index is Ellipsis:
19830  *             return self
19831  */
19832 
19833 /* Python wrapper */
19834 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)19835 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
19836   PyObject *__pyx_r = 0;
19837   __Pyx_RefNannyDeclarations
19838   __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
19839   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
19840 
19841   /* function exit code */
19842   __Pyx_RefNannyFinishContext();
19843   return __pyx_r;
19844 }
19845 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_index)19846 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
19847   PyObject *__pyx_v_have_slices = NULL;
19848   PyObject *__pyx_v_indices = NULL;
19849   char *__pyx_v_itemp;
19850   PyObject *__pyx_r = NULL;
19851   __Pyx_RefNannyDeclarations
19852   int __pyx_t_1;
19853   int __pyx_t_2;
19854   PyObject *__pyx_t_3 = NULL;
19855   PyObject *__pyx_t_4 = NULL;
19856   PyObject *__pyx_t_5 = NULL;
19857   char *__pyx_t_6;
19858   __Pyx_RefNannySetupContext("__getitem__", 0);
19859 
19860   /* "View.MemoryView":400
19861  *
19862  *     def __getitem__(memoryview self, object index):
19863  *         if index is Ellipsis:             # <<<<<<<<<<<<<<
19864  *             return self
19865  *
19866  */
19867   __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
19868   __pyx_t_2 = (__pyx_t_1 != 0);
19869   if (__pyx_t_2) {
19870 
19871     /* "View.MemoryView":401
19872  *     def __getitem__(memoryview self, object index):
19873  *         if index is Ellipsis:
19874  *             return self             # <<<<<<<<<<<<<<
19875  *
19876  *         have_slices, indices = _unellipsify(index, self.view.ndim)
19877  */
19878     __Pyx_XDECREF(__pyx_r);
19879     __Pyx_INCREF(((PyObject *)__pyx_v_self));
19880     __pyx_r = ((PyObject *)__pyx_v_self);
19881     goto __pyx_L0;
19882 
19883     /* "View.MemoryView":400
19884  *
19885  *     def __getitem__(memoryview self, object index):
19886  *         if index is Ellipsis:             # <<<<<<<<<<<<<<
19887  *             return self
19888  *
19889  */
19890   }
19891 
19892   /* "View.MemoryView":403
19893  *             return self
19894  *
19895  *         have_slices, indices = _unellipsify(index, self.view.ndim)             # <<<<<<<<<<<<<<
19896  *
19897  *         cdef char *itemp
19898  */
19899   __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 403, __pyx_L1_error)
19900   __Pyx_GOTREF(__pyx_t_3);
19901   if (likely(__pyx_t_3 != Py_None)) {
19902     PyObject* sequence = __pyx_t_3;
19903     Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
19904     if (unlikely(size != 2)) {
19905       if (size > 2) __Pyx_RaiseTooManyValuesError(2);
19906       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
19907       __PYX_ERR(1, 403, __pyx_L1_error)
19908     }
19909     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
19910     __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
19911     __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
19912     __Pyx_INCREF(__pyx_t_4);
19913     __Pyx_INCREF(__pyx_t_5);
19914     #else
19915     __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 403, __pyx_L1_error)
19916     __Pyx_GOTREF(__pyx_t_4);
19917     __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 403, __pyx_L1_error)
19918     __Pyx_GOTREF(__pyx_t_5);
19919     #endif
19920     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19921   } else {
19922     __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 403, __pyx_L1_error)
19923   }
19924   __pyx_v_have_slices = __pyx_t_4;
19925   __pyx_t_4 = 0;
19926   __pyx_v_indices = __pyx_t_5;
19927   __pyx_t_5 = 0;
19928 
19929   /* "View.MemoryView":406
19930  *
19931  *         cdef char *itemp
19932  *         if have_slices:             # <<<<<<<<<<<<<<
19933  *             return memview_slice(self, indices)
19934  *         else:
19935  */
19936   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 406, __pyx_L1_error)
19937   if (__pyx_t_2) {
19938 
19939     /* "View.MemoryView":407
19940  *         cdef char *itemp
19941  *         if have_slices:
19942  *             return memview_slice(self, indices)             # <<<<<<<<<<<<<<
19943  *         else:
19944  *             itemp = self.get_item_pointer(indices)
19945  */
19946     __Pyx_XDECREF(__pyx_r);
19947     __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 407, __pyx_L1_error)
19948     __Pyx_GOTREF(__pyx_t_3);
19949     __pyx_r = __pyx_t_3;
19950     __pyx_t_3 = 0;
19951     goto __pyx_L0;
19952 
19953     /* "View.MemoryView":406
19954  *
19955  *         cdef char *itemp
19956  *         if have_slices:             # <<<<<<<<<<<<<<
19957  *             return memview_slice(self, indices)
19958  *         else:
19959  */
19960   }
19961 
19962   /* "View.MemoryView":409
19963  *             return memview_slice(self, indices)
19964  *         else:
19965  *             itemp = self.get_item_pointer(indices)             # <<<<<<<<<<<<<<
19966  *             return self.convert_item_to_object(itemp)
19967  *
19968  */
19969   /*else*/ {
19970     __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(1, 409, __pyx_L1_error)
19971     __pyx_v_itemp = __pyx_t_6;
19972 
19973     /* "View.MemoryView":410
19974  *         else:
19975  *             itemp = self.get_item_pointer(indices)
19976  *             return self.convert_item_to_object(itemp)             # <<<<<<<<<<<<<<
19977  *
19978  *     def __setitem__(memoryview self, object index, object value):
19979  */
19980     __Pyx_XDECREF(__pyx_r);
19981     __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 410, __pyx_L1_error)
19982     __Pyx_GOTREF(__pyx_t_3);
19983     __pyx_r = __pyx_t_3;
19984     __pyx_t_3 = 0;
19985     goto __pyx_L0;
19986   }
19987 
19988   /* "View.MemoryView":399
19989  *
19990  *
19991  *     def __getitem__(memoryview self, object index):             # <<<<<<<<<<<<<<
19992  *         if index is Ellipsis:
19993  *             return self
19994  */
19995 
19996   /* function exit code */
19997   __pyx_L1_error:;
19998   __Pyx_XDECREF(__pyx_t_3);
19999   __Pyx_XDECREF(__pyx_t_4);
20000   __Pyx_XDECREF(__pyx_t_5);
20001   __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
20002   __pyx_r = NULL;
20003   __pyx_L0:;
20004   __Pyx_XDECREF(__pyx_v_have_slices);
20005   __Pyx_XDECREF(__pyx_v_indices);
20006   __Pyx_XGIVEREF(__pyx_r);
20007   __Pyx_RefNannyFinishContext();
20008   return __pyx_r;
20009 }
20010 
20011 /* "View.MemoryView":412
20012  *             return self.convert_item_to_object(itemp)
20013  *
20014  *     def __setitem__(memoryview self, object index, object value):             # <<<<<<<<<<<<<<
20015  *         if self.view.readonly:
20016  *             raise TypeError("Cannot assign to read-only memoryview")
20017  */
20018 
20019 /* Python wrapper */
20020 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)20021 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
20022   int __pyx_r;
20023   __Pyx_RefNannyDeclarations
20024   __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
20025   __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));
20026 
20027   /* function exit code */
20028   __Pyx_RefNannyFinishContext();
20029   return __pyx_r;
20030 }
20031 
__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)20032 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) {
20033   PyObject *__pyx_v_have_slices = NULL;
20034   PyObject *__pyx_v_obj = NULL;
20035   int __pyx_r;
20036   __Pyx_RefNannyDeclarations
20037   int __pyx_t_1;
20038   PyObject *__pyx_t_2 = NULL;
20039   PyObject *__pyx_t_3 = NULL;
20040   PyObject *__pyx_t_4 = NULL;
20041   __Pyx_RefNannySetupContext("__setitem__", 0);
20042   __Pyx_INCREF(__pyx_v_index);
20043 
20044   /* "View.MemoryView":413
20045  *
20046  *     def __setitem__(memoryview self, object index, object value):
20047  *         if self.view.readonly:             # <<<<<<<<<<<<<<
20048  *             raise TypeError("Cannot assign to read-only memoryview")
20049  *
20050  */
20051   __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
20052   if (unlikely(__pyx_t_1)) {
20053 
20054     /* "View.MemoryView":414
20055  *     def __setitem__(memoryview self, object index, object value):
20056  *         if self.view.readonly:
20057  *             raise TypeError("Cannot assign to read-only memoryview")             # <<<<<<<<<<<<<<
20058  *
20059  *         have_slices, index = _unellipsify(index, self.view.ndim)
20060  */
20061     __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 414, __pyx_L1_error)
20062     __Pyx_GOTREF(__pyx_t_2);
20063     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
20064     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20065     __PYX_ERR(1, 414, __pyx_L1_error)
20066 
20067     /* "View.MemoryView":413
20068  *
20069  *     def __setitem__(memoryview self, object index, object value):
20070  *         if self.view.readonly:             # <<<<<<<<<<<<<<
20071  *             raise TypeError("Cannot assign to read-only memoryview")
20072  *
20073  */
20074   }
20075 
20076   /* "View.MemoryView":416
20077  *             raise TypeError("Cannot assign to read-only memoryview")
20078  *
20079  *         have_slices, index = _unellipsify(index, self.view.ndim)             # <<<<<<<<<<<<<<
20080  *
20081  *         if have_slices:
20082  */
20083   __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 416, __pyx_L1_error)
20084   __Pyx_GOTREF(__pyx_t_2);
20085   if (likely(__pyx_t_2 != Py_None)) {
20086     PyObject* sequence = __pyx_t_2;
20087     Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
20088     if (unlikely(size != 2)) {
20089       if (size > 2) __Pyx_RaiseTooManyValuesError(2);
20090       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
20091       __PYX_ERR(1, 416, __pyx_L1_error)
20092     }
20093     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
20094     __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
20095     __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
20096     __Pyx_INCREF(__pyx_t_3);
20097     __Pyx_INCREF(__pyx_t_4);
20098     #else
20099     __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 416, __pyx_L1_error)
20100     __Pyx_GOTREF(__pyx_t_3);
20101     __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 416, __pyx_L1_error)
20102     __Pyx_GOTREF(__pyx_t_4);
20103     #endif
20104     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20105   } else {
20106     __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 416, __pyx_L1_error)
20107   }
20108   __pyx_v_have_slices = __pyx_t_3;
20109   __pyx_t_3 = 0;
20110   __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
20111   __pyx_t_4 = 0;
20112 
20113   /* "View.MemoryView":418
20114  *         have_slices, index = _unellipsify(index, self.view.ndim)
20115  *
20116  *         if have_slices:             # <<<<<<<<<<<<<<
20117  *             obj = self.is_slice(value)
20118  *             if obj:
20119  */
20120   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 418, __pyx_L1_error)
20121   if (__pyx_t_1) {
20122 
20123     /* "View.MemoryView":419
20124  *
20125  *         if have_slices:
20126  *             obj = self.is_slice(value)             # <<<<<<<<<<<<<<
20127  *             if obj:
20128  *                 self.setitem_slice_assignment(self[index], obj)
20129  */
20130     __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 419, __pyx_L1_error)
20131     __Pyx_GOTREF(__pyx_t_2);
20132     __pyx_v_obj = __pyx_t_2;
20133     __pyx_t_2 = 0;
20134 
20135     /* "View.MemoryView":420
20136  *         if have_slices:
20137  *             obj = self.is_slice(value)
20138  *             if obj:             # <<<<<<<<<<<<<<
20139  *                 self.setitem_slice_assignment(self[index], obj)
20140  *             else:
20141  */
20142     __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 420, __pyx_L1_error)
20143     if (__pyx_t_1) {
20144 
20145       /* "View.MemoryView":421
20146  *             obj = self.is_slice(value)
20147  *             if obj:
20148  *                 self.setitem_slice_assignment(self[index], obj)             # <<<<<<<<<<<<<<
20149  *             else:
20150  *                 self.setitem_slice_assign_scalar(self[index], value)
20151  */
20152       __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 421, __pyx_L1_error)
20153       __Pyx_GOTREF(__pyx_t_2);
20154       __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 421, __pyx_L1_error)
20155       __Pyx_GOTREF(__pyx_t_4);
20156       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20157       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20158 
20159       /* "View.MemoryView":420
20160  *         if have_slices:
20161  *             obj = self.is_slice(value)
20162  *             if obj:             # <<<<<<<<<<<<<<
20163  *                 self.setitem_slice_assignment(self[index], obj)
20164  *             else:
20165  */
20166       goto __pyx_L5;
20167     }
20168 
20169     /* "View.MemoryView":423
20170  *                 self.setitem_slice_assignment(self[index], obj)
20171  *             else:
20172  *                 self.setitem_slice_assign_scalar(self[index], value)             # <<<<<<<<<<<<<<
20173  *         else:
20174  *             self.setitem_indexed(index, value)
20175  */
20176     /*else*/ {
20177       __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 423, __pyx_L1_error)
20178       __Pyx_GOTREF(__pyx_t_4);
20179       if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 423, __pyx_L1_error)
20180       __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 423, __pyx_L1_error)
20181       __Pyx_GOTREF(__pyx_t_2);
20182       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20183       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20184     }
20185     __pyx_L5:;
20186 
20187     /* "View.MemoryView":418
20188  *         have_slices, index = _unellipsify(index, self.view.ndim)
20189  *
20190  *         if have_slices:             # <<<<<<<<<<<<<<
20191  *             obj = self.is_slice(value)
20192  *             if obj:
20193  */
20194     goto __pyx_L4;
20195   }
20196 
20197   /* "View.MemoryView":425
20198  *                 self.setitem_slice_assign_scalar(self[index], value)
20199  *         else:
20200  *             self.setitem_indexed(index, value)             # <<<<<<<<<<<<<<
20201  *
20202  *     cdef is_slice(self, obj):
20203  */
20204   /*else*/ {
20205     __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 425, __pyx_L1_error)
20206     __Pyx_GOTREF(__pyx_t_2);
20207     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20208   }
20209   __pyx_L4:;
20210 
20211   /* "View.MemoryView":412
20212  *             return self.convert_item_to_object(itemp)
20213  *
20214  *     def __setitem__(memoryview self, object index, object value):             # <<<<<<<<<<<<<<
20215  *         if self.view.readonly:
20216  *             raise TypeError("Cannot assign to read-only memoryview")
20217  */
20218 
20219   /* function exit code */
20220   __pyx_r = 0;
20221   goto __pyx_L0;
20222   __pyx_L1_error:;
20223   __Pyx_XDECREF(__pyx_t_2);
20224   __Pyx_XDECREF(__pyx_t_3);
20225   __Pyx_XDECREF(__pyx_t_4);
20226   __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
20227   __pyx_r = -1;
20228   __pyx_L0:;
20229   __Pyx_XDECREF(__pyx_v_have_slices);
20230   __Pyx_XDECREF(__pyx_v_obj);
20231   __Pyx_XDECREF(__pyx_v_index);
20232   __Pyx_RefNannyFinishContext();
20233   return __pyx_r;
20234 }
20235 
20236 /* "View.MemoryView":427
20237  *             self.setitem_indexed(index, value)
20238  *
20239  *     cdef is_slice(self, obj):             # <<<<<<<<<<<<<<
20240  *         if not isinstance(obj, memoryview):
20241  *             try:
20242  */
20243 
__pyx_memoryview_is_slice(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_obj)20244 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
20245   PyObject *__pyx_r = NULL;
20246   __Pyx_RefNannyDeclarations
20247   int __pyx_t_1;
20248   int __pyx_t_2;
20249   PyObject *__pyx_t_3 = NULL;
20250   PyObject *__pyx_t_4 = NULL;
20251   PyObject *__pyx_t_5 = NULL;
20252   PyObject *__pyx_t_6 = NULL;
20253   PyObject *__pyx_t_7 = NULL;
20254   PyObject *__pyx_t_8 = NULL;
20255   int __pyx_t_9;
20256   __Pyx_RefNannySetupContext("is_slice", 0);
20257   __Pyx_INCREF(__pyx_v_obj);
20258 
20259   /* "View.MemoryView":428
20260  *
20261  *     cdef is_slice(self, obj):
20262  *         if not isinstance(obj, memoryview):             # <<<<<<<<<<<<<<
20263  *             try:
20264  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
20265  */
20266   __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
20267   __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
20268   if (__pyx_t_2) {
20269 
20270     /* "View.MemoryView":429
20271  *     cdef is_slice(self, obj):
20272  *         if not isinstance(obj, memoryview):
20273  *             try:             # <<<<<<<<<<<<<<
20274  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
20275  *                                  self.dtype_is_object)
20276  */
20277     {
20278       __Pyx_PyThreadState_declare
20279       __Pyx_PyThreadState_assign
20280       __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
20281       __Pyx_XGOTREF(__pyx_t_3);
20282       __Pyx_XGOTREF(__pyx_t_4);
20283       __Pyx_XGOTREF(__pyx_t_5);
20284       /*try:*/ {
20285 
20286         /* "View.MemoryView":430
20287  *         if not isinstance(obj, memoryview):
20288  *             try:
20289  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,             # <<<<<<<<<<<<<<
20290  *                                  self.dtype_is_object)
20291  *             except TypeError:
20292  */
20293         __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 430, __pyx_L4_error)
20294         __Pyx_GOTREF(__pyx_t_6);
20295 
20296         /* "View.MemoryView":431
20297  *             try:
20298  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
20299  *                                  self.dtype_is_object)             # <<<<<<<<<<<<<<
20300  *             except TypeError:
20301  *                 return None
20302  */
20303         __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 431, __pyx_L4_error)
20304         __Pyx_GOTREF(__pyx_t_7);
20305 
20306         /* "View.MemoryView":430
20307  *         if not isinstance(obj, memoryview):
20308  *             try:
20309  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,             # <<<<<<<<<<<<<<
20310  *                                  self.dtype_is_object)
20311  *             except TypeError:
20312  */
20313         __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 430, __pyx_L4_error)
20314         __Pyx_GOTREF(__pyx_t_8);
20315         __Pyx_INCREF(__pyx_v_obj);
20316         __Pyx_GIVEREF(__pyx_v_obj);
20317         PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
20318         __Pyx_GIVEREF(__pyx_t_6);
20319         PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
20320         __Pyx_GIVEREF(__pyx_t_7);
20321         PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
20322         __pyx_t_6 = 0;
20323         __pyx_t_7 = 0;
20324         __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 430, __pyx_L4_error)
20325         __Pyx_GOTREF(__pyx_t_7);
20326         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
20327         __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
20328         __pyx_t_7 = 0;
20329 
20330         /* "View.MemoryView":429
20331  *     cdef is_slice(self, obj):
20332  *         if not isinstance(obj, memoryview):
20333  *             try:             # <<<<<<<<<<<<<<
20334  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
20335  *                                  self.dtype_is_object)
20336  */
20337       }
20338       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
20339       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
20340       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20341       goto __pyx_L9_try_end;
20342       __pyx_L4_error:;
20343       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
20344       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
20345       __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
20346 
20347       /* "View.MemoryView":432
20348  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
20349  *                                  self.dtype_is_object)
20350  *             except TypeError:             # <<<<<<<<<<<<<<
20351  *                 return None
20352  *
20353  */
20354       __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
20355       if (__pyx_t_9) {
20356         __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
20357         if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 432, __pyx_L6_except_error)
20358         __Pyx_GOTREF(__pyx_t_7);
20359         __Pyx_GOTREF(__pyx_t_8);
20360         __Pyx_GOTREF(__pyx_t_6);
20361 
20362         /* "View.MemoryView":433
20363  *                                  self.dtype_is_object)
20364  *             except TypeError:
20365  *                 return None             # <<<<<<<<<<<<<<
20366  *
20367  *         return obj
20368  */
20369         __Pyx_XDECREF(__pyx_r);
20370         __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20371         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20372         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20373         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
20374         goto __pyx_L7_except_return;
20375       }
20376       goto __pyx_L6_except_error;
20377       __pyx_L6_except_error:;
20378 
20379       /* "View.MemoryView":429
20380  *     cdef is_slice(self, obj):
20381  *         if not isinstance(obj, memoryview):
20382  *             try:             # <<<<<<<<<<<<<<
20383  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
20384  *                                  self.dtype_is_object)
20385  */
20386       __Pyx_XGIVEREF(__pyx_t_3);
20387       __Pyx_XGIVEREF(__pyx_t_4);
20388       __Pyx_XGIVEREF(__pyx_t_5);
20389       __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
20390       goto __pyx_L1_error;
20391       __pyx_L7_except_return:;
20392       __Pyx_XGIVEREF(__pyx_t_3);
20393       __Pyx_XGIVEREF(__pyx_t_4);
20394       __Pyx_XGIVEREF(__pyx_t_5);
20395       __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
20396       goto __pyx_L0;
20397       __pyx_L9_try_end:;
20398     }
20399 
20400     /* "View.MemoryView":428
20401  *
20402  *     cdef is_slice(self, obj):
20403  *         if not isinstance(obj, memoryview):             # <<<<<<<<<<<<<<
20404  *             try:
20405  *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
20406  */
20407   }
20408 
20409   /* "View.MemoryView":435
20410  *                 return None
20411  *
20412  *         return obj             # <<<<<<<<<<<<<<
20413  *
20414  *     cdef setitem_slice_assignment(self, dst, src):
20415  */
20416   __Pyx_XDECREF(__pyx_r);
20417   __Pyx_INCREF(__pyx_v_obj);
20418   __pyx_r = __pyx_v_obj;
20419   goto __pyx_L0;
20420 
20421   /* "View.MemoryView":427
20422  *             self.setitem_indexed(index, value)
20423  *
20424  *     cdef is_slice(self, obj):             # <<<<<<<<<<<<<<
20425  *         if not isinstance(obj, memoryview):
20426  *             try:
20427  */
20428 
20429   /* function exit code */
20430   __pyx_L1_error:;
20431   __Pyx_XDECREF(__pyx_t_6);
20432   __Pyx_XDECREF(__pyx_t_7);
20433   __Pyx_XDECREF(__pyx_t_8);
20434   __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
20435   __pyx_r = 0;
20436   __pyx_L0:;
20437   __Pyx_XDECREF(__pyx_v_obj);
20438   __Pyx_XGIVEREF(__pyx_r);
20439   __Pyx_RefNannyFinishContext();
20440   return __pyx_r;
20441 }
20442 
20443 /* "View.MemoryView":437
20444  *         return obj
20445  *
20446  *     cdef setitem_slice_assignment(self, dst, src):             # <<<<<<<<<<<<<<
20447  *         cdef __Pyx_memviewslice dst_slice
20448  *         cdef __Pyx_memviewslice src_slice
20449  */
20450 
__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_dst,PyObject * __pyx_v_src)20451 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
20452   __Pyx_memviewslice __pyx_v_dst_slice;
20453   __Pyx_memviewslice __pyx_v_src_slice;
20454   PyObject *__pyx_r = NULL;
20455   __Pyx_RefNannyDeclarations
20456   PyObject *__pyx_t_1 = NULL;
20457   int __pyx_t_2;
20458   int __pyx_t_3;
20459   int __pyx_t_4;
20460   __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
20461 
20462   /* "View.MemoryView":441
20463  *         cdef __Pyx_memviewslice src_slice
20464  *
20465  *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],             # <<<<<<<<<<<<<<
20466  *                                  get_slice_from_memview(dst, &dst_slice)[0],
20467  *                                  src.ndim, dst.ndim, self.dtype_is_object)
20468  */
20469   if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 441, __pyx_L1_error)
20470 
20471   /* "View.MemoryView":442
20472  *
20473  *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
20474  *                                  get_slice_from_memview(dst, &dst_slice)[0],             # <<<<<<<<<<<<<<
20475  *                                  src.ndim, dst.ndim, self.dtype_is_object)
20476  *
20477  */
20478   if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 442, __pyx_L1_error)
20479 
20480   /* "View.MemoryView":443
20481  *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
20482  *                                  get_slice_from_memview(dst, &dst_slice)[0],
20483  *                                  src.ndim, dst.ndim, self.dtype_is_object)             # <<<<<<<<<<<<<<
20484  *
20485  *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):
20486  */
20487   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 443, __pyx_L1_error)
20488   __Pyx_GOTREF(__pyx_t_1);
20489   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 443, __pyx_L1_error)
20490   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20491   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 443, __pyx_L1_error)
20492   __Pyx_GOTREF(__pyx_t_1);
20493   __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 443, __pyx_L1_error)
20494   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20495 
20496   /* "View.MemoryView":441
20497  *         cdef __Pyx_memviewslice src_slice
20498  *
20499  *         memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],             # <<<<<<<<<<<<<<
20500  *                                  get_slice_from_memview(dst, &dst_slice)[0],
20501  *                                  src.ndim, dst.ndim, self.dtype_is_object)
20502  */
20503   __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 441, __pyx_L1_error)
20504 
20505   /* "View.MemoryView":437
20506  *         return obj
20507  *
20508  *     cdef setitem_slice_assignment(self, dst, src):             # <<<<<<<<<<<<<<
20509  *         cdef __Pyx_memviewslice dst_slice
20510  *         cdef __Pyx_memviewslice src_slice
20511  */
20512 
20513   /* function exit code */
20514   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20515   goto __pyx_L0;
20516   __pyx_L1_error:;
20517   __Pyx_XDECREF(__pyx_t_1);
20518   __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
20519   __pyx_r = 0;
20520   __pyx_L0:;
20521   __Pyx_XGIVEREF(__pyx_r);
20522   __Pyx_RefNannyFinishContext();
20523   return __pyx_r;
20524 }
20525 
20526 /* "View.MemoryView":445
20527  *                                  src.ndim, dst.ndim, self.dtype_is_object)
20528  *
20529  *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):             # <<<<<<<<<<<<<<
20530  *         cdef int array[128]
20531  *         cdef void *tmp = NULL
20532  */
20533 
__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj * __pyx_v_self,struct __pyx_memoryview_obj * __pyx_v_dst,PyObject * __pyx_v_value)20534 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) {
20535   int __pyx_v_array[0x80];
20536   void *__pyx_v_tmp;
20537   void *__pyx_v_item;
20538   __Pyx_memviewslice *__pyx_v_dst_slice;
20539   __Pyx_memviewslice __pyx_v_tmp_slice;
20540   PyObject *__pyx_r = NULL;
20541   __Pyx_RefNannyDeclarations
20542   int __pyx_t_1;
20543   PyObject *__pyx_t_2 = NULL;
20544   int __pyx_t_3;
20545   int __pyx_t_4;
20546   char const *__pyx_t_5;
20547   PyObject *__pyx_t_6 = NULL;
20548   PyObject *__pyx_t_7 = NULL;
20549   PyObject *__pyx_t_8 = NULL;
20550   PyObject *__pyx_t_9 = NULL;
20551   PyObject *__pyx_t_10 = NULL;
20552   PyObject *__pyx_t_11 = NULL;
20553   __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
20554 
20555   /* "View.MemoryView":447
20556  *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):
20557  *         cdef int array[128]
20558  *         cdef void *tmp = NULL             # <<<<<<<<<<<<<<
20559  *         cdef void *item
20560  *
20561  */
20562   __pyx_v_tmp = NULL;
20563 
20564   /* "View.MemoryView":452
20565  *         cdef __Pyx_memviewslice *dst_slice
20566  *         cdef __Pyx_memviewslice tmp_slice
20567  *         dst_slice = get_slice_from_memview(dst, &tmp_slice)             # <<<<<<<<<<<<<<
20568  *
20569  *         if <size_t>self.view.itemsize > sizeof(array):
20570  */
20571   __pyx_v_dst_slice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));
20572 
20573   /* "View.MemoryView":454
20574  *         dst_slice = get_slice_from_memview(dst, &tmp_slice)
20575  *
20576  *         if <size_t>self.view.itemsize > sizeof(array):             # <<<<<<<<<<<<<<
20577  *             tmp = PyMem_Malloc(self.view.itemsize)
20578  *             if tmp == NULL:
20579  */
20580   __pyx_t_1 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
20581   if (__pyx_t_1) {
20582 
20583     /* "View.MemoryView":455
20584  *
20585  *         if <size_t>self.view.itemsize > sizeof(array):
20586  *             tmp = PyMem_Malloc(self.view.itemsize)             # <<<<<<<<<<<<<<
20587  *             if tmp == NULL:
20588  *                 raise MemoryError
20589  */
20590     __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
20591 
20592     /* "View.MemoryView":456
20593  *         if <size_t>self.view.itemsize > sizeof(array):
20594  *             tmp = PyMem_Malloc(self.view.itemsize)
20595  *             if tmp == NULL:             # <<<<<<<<<<<<<<
20596  *                 raise MemoryError
20597  *             item = tmp
20598  */
20599     __pyx_t_1 = ((__pyx_v_tmp == NULL) != 0);
20600     if (unlikely(__pyx_t_1)) {
20601 
20602       /* "View.MemoryView":457
20603  *             tmp = PyMem_Malloc(self.view.itemsize)
20604  *             if tmp == NULL:
20605  *                 raise MemoryError             # <<<<<<<<<<<<<<
20606  *             item = tmp
20607  *         else:
20608  */
20609       PyErr_NoMemory(); __PYX_ERR(1, 457, __pyx_L1_error)
20610 
20611       /* "View.MemoryView":456
20612  *         if <size_t>self.view.itemsize > sizeof(array):
20613  *             tmp = PyMem_Malloc(self.view.itemsize)
20614  *             if tmp == NULL:             # <<<<<<<<<<<<<<
20615  *                 raise MemoryError
20616  *             item = tmp
20617  */
20618     }
20619 
20620     /* "View.MemoryView":458
20621  *             if tmp == NULL:
20622  *                 raise MemoryError
20623  *             item = tmp             # <<<<<<<<<<<<<<
20624  *         else:
20625  *             item = <void *> array
20626  */
20627     __pyx_v_item = __pyx_v_tmp;
20628 
20629     /* "View.MemoryView":454
20630  *         dst_slice = get_slice_from_memview(dst, &tmp_slice)
20631  *
20632  *         if <size_t>self.view.itemsize > sizeof(array):             # <<<<<<<<<<<<<<
20633  *             tmp = PyMem_Malloc(self.view.itemsize)
20634  *             if tmp == NULL:
20635  */
20636     goto __pyx_L3;
20637   }
20638 
20639   /* "View.MemoryView":460
20640  *             item = tmp
20641  *         else:
20642  *             item = <void *> array             # <<<<<<<<<<<<<<
20643  *
20644  *         try:
20645  */
20646   /*else*/ {
20647     __pyx_v_item = ((void *)__pyx_v_array);
20648   }
20649   __pyx_L3:;
20650 
20651   /* "View.MemoryView":462
20652  *             item = <void *> array
20653  *
20654  *         try:             # <<<<<<<<<<<<<<
20655  *             if self.dtype_is_object:
20656  *                 (<PyObject **> item)[0] = <PyObject *> value
20657  */
20658   /*try:*/ {
20659 
20660     /* "View.MemoryView":463
20661  *
20662  *         try:
20663  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
20664  *                 (<PyObject **> item)[0] = <PyObject *> value
20665  *             else:
20666  */
20667     __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
20668     if (__pyx_t_1) {
20669 
20670       /* "View.MemoryView":464
20671  *         try:
20672  *             if self.dtype_is_object:
20673  *                 (<PyObject **> item)[0] = <PyObject *> value             # <<<<<<<<<<<<<<
20674  *             else:
20675  *                 self.assign_item_from_object(<char *> item, value)
20676  */
20677       (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
20678 
20679       /* "View.MemoryView":463
20680  *
20681  *         try:
20682  *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
20683  *                 (<PyObject **> item)[0] = <PyObject *> value
20684  *             else:
20685  */
20686       goto __pyx_L8;
20687     }
20688 
20689     /* "View.MemoryView":466
20690  *                 (<PyObject **> item)[0] = <PyObject *> value
20691  *             else:
20692  *                 self.assign_item_from_object(<char *> item, value)             # <<<<<<<<<<<<<<
20693  *
20694  *
20695  */
20696     /*else*/ {
20697       __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 466, __pyx_L6_error)
20698       __Pyx_GOTREF(__pyx_t_2);
20699       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20700     }
20701     __pyx_L8:;
20702 
20703     /* "View.MemoryView":470
20704  *
20705  *
20706  *             if self.view.suboffsets != NULL:             # <<<<<<<<<<<<<<
20707  *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
20708  *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
20709  */
20710     __pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
20711     if (__pyx_t_1) {
20712 
20713       /* "View.MemoryView":471
20714  *
20715  *             if self.view.suboffsets != NULL:
20716  *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)             # <<<<<<<<<<<<<<
20717  *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
20718  *                                 item, self.dtype_is_object)
20719  */
20720       __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 471, __pyx_L6_error)
20721       __Pyx_GOTREF(__pyx_t_2);
20722       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20723 
20724       /* "View.MemoryView":470
20725  *
20726  *
20727  *             if self.view.suboffsets != NULL:             # <<<<<<<<<<<<<<
20728  *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
20729  *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
20730  */
20731     }
20732 
20733     /* "View.MemoryView":472
20734  *             if self.view.suboffsets != NULL:
20735  *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
20736  *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,             # <<<<<<<<<<<<<<
20737  *                                 item, self.dtype_is_object)
20738  *         finally:
20739  */
20740     __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);
20741   }
20742 
20743   /* "View.MemoryView":475
20744  *                                 item, self.dtype_is_object)
20745  *         finally:
20746  *             PyMem_Free(tmp)             # <<<<<<<<<<<<<<
20747  *
20748  *     cdef setitem_indexed(self, index, value):
20749  */
20750   /*finally:*/ {
20751     /*normal exit:*/{
20752       PyMem_Free(__pyx_v_tmp);
20753       goto __pyx_L7;
20754     }
20755     __pyx_L6_error:;
20756     /*exception exit:*/{
20757       __Pyx_PyThreadState_declare
20758       __Pyx_PyThreadState_assign
20759       __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
20760       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20761       if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
20762       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);
20763       __Pyx_XGOTREF(__pyx_t_6);
20764       __Pyx_XGOTREF(__pyx_t_7);
20765       __Pyx_XGOTREF(__pyx_t_8);
20766       __Pyx_XGOTREF(__pyx_t_9);
20767       __Pyx_XGOTREF(__pyx_t_10);
20768       __Pyx_XGOTREF(__pyx_t_11);
20769       __pyx_t_3 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename;
20770       {
20771         PyMem_Free(__pyx_v_tmp);
20772       }
20773       if (PY_MAJOR_VERSION >= 3) {
20774         __Pyx_XGIVEREF(__pyx_t_9);
20775         __Pyx_XGIVEREF(__pyx_t_10);
20776         __Pyx_XGIVEREF(__pyx_t_11);
20777         __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
20778       }
20779       __Pyx_XGIVEREF(__pyx_t_6);
20780       __Pyx_XGIVEREF(__pyx_t_7);
20781       __Pyx_XGIVEREF(__pyx_t_8);
20782       __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
20783       __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
20784       __pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5;
20785       goto __pyx_L1_error;
20786     }
20787     __pyx_L7:;
20788   }
20789 
20790   /* "View.MemoryView":445
20791  *                                  src.ndim, dst.ndim, self.dtype_is_object)
20792  *
20793  *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):             # <<<<<<<<<<<<<<
20794  *         cdef int array[128]
20795  *         cdef void *tmp = NULL
20796  */
20797 
20798   /* function exit code */
20799   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20800   goto __pyx_L0;
20801   __pyx_L1_error:;
20802   __Pyx_XDECREF(__pyx_t_2);
20803   __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
20804   __pyx_r = 0;
20805   __pyx_L0:;
20806   __Pyx_XGIVEREF(__pyx_r);
20807   __Pyx_RefNannyFinishContext();
20808   return __pyx_r;
20809 }
20810 
20811 /* "View.MemoryView":477
20812  *             PyMem_Free(tmp)
20813  *
20814  *     cdef setitem_indexed(self, index, value):             # <<<<<<<<<<<<<<
20815  *         cdef char *itemp = self.get_item_pointer(index)
20816  *         self.assign_item_from_object(itemp, value)
20817  */
20818 
__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj * __pyx_v_self,PyObject * __pyx_v_index,PyObject * __pyx_v_value)20819 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
20820   char *__pyx_v_itemp;
20821   PyObject *__pyx_r = NULL;
20822   __Pyx_RefNannyDeclarations
20823   char *__pyx_t_1;
20824   PyObject *__pyx_t_2 = NULL;
20825   __Pyx_RefNannySetupContext("setitem_indexed", 0);
20826 
20827   /* "View.MemoryView":478
20828  *
20829  *     cdef setitem_indexed(self, index, value):
20830  *         cdef char *itemp = self.get_item_pointer(index)             # <<<<<<<<<<<<<<
20831  *         self.assign_item_from_object(itemp, value)
20832  *
20833  */
20834   __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(1, 478, __pyx_L1_error)
20835   __pyx_v_itemp = __pyx_t_1;
20836 
20837   /* "View.MemoryView":479
20838  *     cdef setitem_indexed(self, index, value):
20839  *         cdef char *itemp = self.get_item_pointer(index)
20840  *         self.assign_item_from_object(itemp, value)             # <<<<<<<<<<<<<<
20841  *
20842  *     cdef convert_item_to_object(self, char *itemp):
20843  */
20844   __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 479, __pyx_L1_error)
20845   __Pyx_GOTREF(__pyx_t_2);
20846   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20847 
20848   /* "View.MemoryView":477
20849  *             PyMem_Free(tmp)
20850  *
20851  *     cdef setitem_indexed(self, index, value):             # <<<<<<<<<<<<<<
20852  *         cdef char *itemp = self.get_item_pointer(index)
20853  *         self.assign_item_from_object(itemp, value)
20854  */
20855 
20856   /* function exit code */
20857   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20858   goto __pyx_L0;
20859   __pyx_L1_error:;
20860   __Pyx_XDECREF(__pyx_t_2);
20861   __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
20862   __pyx_r = 0;
20863   __pyx_L0:;
20864   __Pyx_XGIVEREF(__pyx_r);
20865   __Pyx_RefNannyFinishContext();
20866   return __pyx_r;
20867 }
20868 
20869 /* "View.MemoryView":481
20870  *         self.assign_item_from_object(itemp, value)
20871  *
20872  *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
20873  *         """Only used if instantiated manually by the user, or if Cython doesn't
20874  *         know how to convert the type"""
20875  */
20876 
__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj * __pyx_v_self,char * __pyx_v_itemp)20877 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
20878   PyObject *__pyx_v_struct = NULL;
20879   PyObject *__pyx_v_bytesitem = 0;
20880   PyObject *__pyx_v_result = NULL;
20881   PyObject *__pyx_r = NULL;
20882   __Pyx_RefNannyDeclarations
20883   PyObject *__pyx_t_1 = NULL;
20884   PyObject *__pyx_t_2 = NULL;
20885   PyObject *__pyx_t_3 = NULL;
20886   PyObject *__pyx_t_4 = NULL;
20887   PyObject *__pyx_t_5 = NULL;
20888   PyObject *__pyx_t_6 = NULL;
20889   PyObject *__pyx_t_7 = NULL;
20890   int __pyx_t_8;
20891   PyObject *__pyx_t_9 = NULL;
20892   size_t __pyx_t_10;
20893   int __pyx_t_11;
20894   __Pyx_RefNannySetupContext("convert_item_to_object", 0);
20895 
20896   /* "View.MemoryView":484
20897  *         """Only used if instantiated manually by the user, or if Cython doesn't
20898  *         know how to convert the type"""
20899  *         import struct             # <<<<<<<<<<<<<<
20900  *         cdef bytes bytesitem
20901  *
20902  */
20903   __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 484, __pyx_L1_error)
20904   __Pyx_GOTREF(__pyx_t_1);
20905   __pyx_v_struct = __pyx_t_1;
20906   __pyx_t_1 = 0;
20907 
20908   /* "View.MemoryView":487
20909  *         cdef bytes bytesitem
20910  *
20911  *         bytesitem = itemp[:self.view.itemsize]             # <<<<<<<<<<<<<<
20912  *         try:
20913  *             result = struct.unpack(self.view.format, bytesitem)
20914  */
20915   __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 487, __pyx_L1_error)
20916   __Pyx_GOTREF(__pyx_t_1);
20917   __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
20918   __pyx_t_1 = 0;
20919 
20920   /* "View.MemoryView":488
20921  *
20922  *         bytesitem = itemp[:self.view.itemsize]
20923  *         try:             # <<<<<<<<<<<<<<
20924  *             result = struct.unpack(self.view.format, bytesitem)
20925  *         except struct.error:
20926  */
20927   {
20928     __Pyx_PyThreadState_declare
20929     __Pyx_PyThreadState_assign
20930     __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
20931     __Pyx_XGOTREF(__pyx_t_2);
20932     __Pyx_XGOTREF(__pyx_t_3);
20933     __Pyx_XGOTREF(__pyx_t_4);
20934     /*try:*/ {
20935 
20936       /* "View.MemoryView":489
20937  *         bytesitem = itemp[:self.view.itemsize]
20938  *         try:
20939  *             result = struct.unpack(self.view.format, bytesitem)             # <<<<<<<<<<<<<<
20940  *         except struct.error:
20941  *             raise ValueError("Unable to convert item to object")
20942  */
20943       __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 489, __pyx_L3_error)
20944       __Pyx_GOTREF(__pyx_t_5);
20945       __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 489, __pyx_L3_error)
20946       __Pyx_GOTREF(__pyx_t_6);
20947       __pyx_t_7 = NULL;
20948       __pyx_t_8 = 0;
20949       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
20950         __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
20951         if (likely(__pyx_t_7)) {
20952           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
20953           __Pyx_INCREF(__pyx_t_7);
20954           __Pyx_INCREF(function);
20955           __Pyx_DECREF_SET(__pyx_t_5, function);
20956           __pyx_t_8 = 1;
20957         }
20958       }
20959       #if CYTHON_FAST_PYCALL
20960       if (PyFunction_Check(__pyx_t_5)) {
20961         PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
20962         __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 489, __pyx_L3_error)
20963         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
20964         __Pyx_GOTREF(__pyx_t_1);
20965         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20966       } else
20967       #endif
20968       #if CYTHON_FAST_PYCCALL
20969       if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
20970         PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
20971         __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 489, __pyx_L3_error)
20972         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
20973         __Pyx_GOTREF(__pyx_t_1);
20974         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20975       } else
20976       #endif
20977       {
20978         __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 489, __pyx_L3_error)
20979         __Pyx_GOTREF(__pyx_t_9);
20980         if (__pyx_t_7) {
20981           __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
20982         }
20983         __Pyx_GIVEREF(__pyx_t_6);
20984         PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
20985         __Pyx_INCREF(__pyx_v_bytesitem);
20986         __Pyx_GIVEREF(__pyx_v_bytesitem);
20987         PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
20988         __pyx_t_6 = 0;
20989         __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 489, __pyx_L3_error)
20990         __Pyx_GOTREF(__pyx_t_1);
20991         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
20992       }
20993       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20994       __pyx_v_result = __pyx_t_1;
20995       __pyx_t_1 = 0;
20996 
20997       /* "View.MemoryView":488
20998  *
20999  *         bytesitem = itemp[:self.view.itemsize]
21000  *         try:             # <<<<<<<<<<<<<<
21001  *             result = struct.unpack(self.view.format, bytesitem)
21002  *         except struct.error:
21003  */
21004     }
21005 
21006     /* "View.MemoryView":493
21007  *             raise ValueError("Unable to convert item to object")
21008  *         else:
21009  *             if len(self.view.format) == 1:             # <<<<<<<<<<<<<<
21010  *                 return result[0]
21011  *             return result
21012  */
21013     /*else:*/ {
21014       __pyx_t_10 = strlen(__pyx_v_self->view.format);
21015       __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
21016       if (__pyx_t_11) {
21017 
21018         /* "View.MemoryView":494
21019  *         else:
21020  *             if len(self.view.format) == 1:
21021  *                 return result[0]             # <<<<<<<<<<<<<<
21022  *             return result
21023  *
21024  */
21025         __Pyx_XDECREF(__pyx_r);
21026         __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 494, __pyx_L5_except_error)
21027         __Pyx_GOTREF(__pyx_t_1);
21028         __pyx_r = __pyx_t_1;
21029         __pyx_t_1 = 0;
21030         goto __pyx_L6_except_return;
21031 
21032         /* "View.MemoryView":493
21033  *             raise ValueError("Unable to convert item to object")
21034  *         else:
21035  *             if len(self.view.format) == 1:             # <<<<<<<<<<<<<<
21036  *                 return result[0]
21037  *             return result
21038  */
21039       }
21040 
21041       /* "View.MemoryView":495
21042  *             if len(self.view.format) == 1:
21043  *                 return result[0]
21044  *             return result             # <<<<<<<<<<<<<<
21045  *
21046  *     cdef assign_item_from_object(self, char *itemp, object value):
21047  */
21048       __Pyx_XDECREF(__pyx_r);
21049       __Pyx_INCREF(__pyx_v_result);
21050       __pyx_r = __pyx_v_result;
21051       goto __pyx_L6_except_return;
21052     }
21053     __pyx_L3_error:;
21054     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
21055     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
21056     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
21057     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
21058     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
21059 
21060     /* "View.MemoryView":490
21061  *         try:
21062  *             result = struct.unpack(self.view.format, bytesitem)
21063  *         except struct.error:             # <<<<<<<<<<<<<<
21064  *             raise ValueError("Unable to convert item to object")
21065  *         else:
21066  */
21067     __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
21068     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 490, __pyx_L5_except_error)
21069     __Pyx_GOTREF(__pyx_t_6);
21070     __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
21071     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21072     __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
21073     __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
21074     if (__pyx_t_8) {
21075       __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
21076       if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 490, __pyx_L5_except_error)
21077       __Pyx_GOTREF(__pyx_t_9);
21078       __Pyx_GOTREF(__pyx_t_5);
21079       __Pyx_GOTREF(__pyx_t_1);
21080 
21081       /* "View.MemoryView":491
21082  *             result = struct.unpack(self.view.format, bytesitem)
21083  *         except struct.error:
21084  *             raise ValueError("Unable to convert item to object")             # <<<<<<<<<<<<<<
21085  *         else:
21086  *             if len(self.view.format) == 1:
21087  */
21088       __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 491, __pyx_L5_except_error)
21089       __Pyx_GOTREF(__pyx_t_6);
21090       __Pyx_Raise(__pyx_t_6, 0, 0, 0);
21091       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21092       __PYX_ERR(1, 491, __pyx_L5_except_error)
21093     }
21094     goto __pyx_L5_except_error;
21095     __pyx_L5_except_error:;
21096 
21097     /* "View.MemoryView":488
21098  *
21099  *         bytesitem = itemp[:self.view.itemsize]
21100  *         try:             # <<<<<<<<<<<<<<
21101  *             result = struct.unpack(self.view.format, bytesitem)
21102  *         except struct.error:
21103  */
21104     __Pyx_XGIVEREF(__pyx_t_2);
21105     __Pyx_XGIVEREF(__pyx_t_3);
21106     __Pyx_XGIVEREF(__pyx_t_4);
21107     __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
21108     goto __pyx_L1_error;
21109     __pyx_L6_except_return:;
21110     __Pyx_XGIVEREF(__pyx_t_2);
21111     __Pyx_XGIVEREF(__pyx_t_3);
21112     __Pyx_XGIVEREF(__pyx_t_4);
21113     __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
21114     goto __pyx_L0;
21115   }
21116 
21117   /* "View.MemoryView":481
21118  *         self.assign_item_from_object(itemp, value)
21119  *
21120  *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
21121  *         """Only used if instantiated manually by the user, or if Cython doesn't
21122  *         know how to convert the type"""
21123  */
21124 
21125   /* function exit code */
21126   __pyx_L1_error:;
21127   __Pyx_XDECREF(__pyx_t_1);
21128   __Pyx_XDECREF(__pyx_t_5);
21129   __Pyx_XDECREF(__pyx_t_6);
21130   __Pyx_XDECREF(__pyx_t_7);
21131   __Pyx_XDECREF(__pyx_t_9);
21132   __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
21133   __pyx_r = 0;
21134   __pyx_L0:;
21135   __Pyx_XDECREF(__pyx_v_struct);
21136   __Pyx_XDECREF(__pyx_v_bytesitem);
21137   __Pyx_XDECREF(__pyx_v_result);
21138   __Pyx_XGIVEREF(__pyx_r);
21139   __Pyx_RefNannyFinishContext();
21140   return __pyx_r;
21141 }
21142 
21143 /* "View.MemoryView":497
21144  *             return result
21145  *
21146  *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
21147  *         """Only used if instantiated manually by the user, or if Cython doesn't
21148  *         know how to convert the type"""
21149  */
21150 
__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj * __pyx_v_self,char * __pyx_v_itemp,PyObject * __pyx_v_value)21151 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
21152   PyObject *__pyx_v_struct = NULL;
21153   char __pyx_v_c;
21154   PyObject *__pyx_v_bytesvalue = 0;
21155   Py_ssize_t __pyx_v_i;
21156   PyObject *__pyx_r = NULL;
21157   __Pyx_RefNannyDeclarations
21158   PyObject *__pyx_t_1 = NULL;
21159   int __pyx_t_2;
21160   int __pyx_t_3;
21161   PyObject *__pyx_t_4 = NULL;
21162   PyObject *__pyx_t_5 = NULL;
21163   PyObject *__pyx_t_6 = NULL;
21164   int __pyx_t_7;
21165   PyObject *__pyx_t_8 = NULL;
21166   Py_ssize_t __pyx_t_9;
21167   PyObject *__pyx_t_10 = NULL;
21168   char *__pyx_t_11;
21169   char *__pyx_t_12;
21170   char *__pyx_t_13;
21171   char *__pyx_t_14;
21172   __Pyx_RefNannySetupContext("assign_item_from_object", 0);
21173 
21174   /* "View.MemoryView":500
21175  *         """Only used if instantiated manually by the user, or if Cython doesn't
21176  *         know how to convert the type"""
21177  *         import struct             # <<<<<<<<<<<<<<
21178  *         cdef char c
21179  *         cdef bytes bytesvalue
21180  */
21181   __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 500, __pyx_L1_error)
21182   __Pyx_GOTREF(__pyx_t_1);
21183   __pyx_v_struct = __pyx_t_1;
21184   __pyx_t_1 = 0;
21185 
21186   /* "View.MemoryView":505
21187  *         cdef Py_ssize_t i
21188  *
21189  *         if isinstance(value, tuple):             # <<<<<<<<<<<<<<
21190  *             bytesvalue = struct.pack(self.view.format, *value)
21191  *         else:
21192  */
21193   __pyx_t_2 = PyTuple_Check(__pyx_v_value);
21194   __pyx_t_3 = (__pyx_t_2 != 0);
21195   if (__pyx_t_3) {
21196 
21197     /* "View.MemoryView":506
21198  *
21199  *         if isinstance(value, tuple):
21200  *             bytesvalue = struct.pack(self.view.format, *value)             # <<<<<<<<<<<<<<
21201  *         else:
21202  *             bytesvalue = struct.pack(self.view.format, value)
21203  */
21204     __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 506, __pyx_L1_error)
21205     __Pyx_GOTREF(__pyx_t_1);
21206     __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 506, __pyx_L1_error)
21207     __Pyx_GOTREF(__pyx_t_4);
21208     __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 506, __pyx_L1_error)
21209     __Pyx_GOTREF(__pyx_t_5);
21210     __Pyx_GIVEREF(__pyx_t_4);
21211     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
21212     __pyx_t_4 = 0;
21213     __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 506, __pyx_L1_error)
21214     __Pyx_GOTREF(__pyx_t_4);
21215     __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 506, __pyx_L1_error)
21216     __Pyx_GOTREF(__pyx_t_6);
21217     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21218     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21219     __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 506, __pyx_L1_error)
21220     __Pyx_GOTREF(__pyx_t_4);
21221     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21222     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21223     if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 506, __pyx_L1_error)
21224     __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
21225     __pyx_t_4 = 0;
21226 
21227     /* "View.MemoryView":505
21228  *         cdef Py_ssize_t i
21229  *
21230  *         if isinstance(value, tuple):             # <<<<<<<<<<<<<<
21231  *             bytesvalue = struct.pack(self.view.format, *value)
21232  *         else:
21233  */
21234     goto __pyx_L3;
21235   }
21236 
21237   /* "View.MemoryView":508
21238  *             bytesvalue = struct.pack(self.view.format, *value)
21239  *         else:
21240  *             bytesvalue = struct.pack(self.view.format, value)             # <<<<<<<<<<<<<<
21241  *
21242  *         for i, c in enumerate(bytesvalue):
21243  */
21244   /*else*/ {
21245     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 508, __pyx_L1_error)
21246     __Pyx_GOTREF(__pyx_t_6);
21247     __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 508, __pyx_L1_error)
21248     __Pyx_GOTREF(__pyx_t_1);
21249     __pyx_t_5 = NULL;
21250     __pyx_t_7 = 0;
21251     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
21252       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
21253       if (likely(__pyx_t_5)) {
21254         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
21255         __Pyx_INCREF(__pyx_t_5);
21256         __Pyx_INCREF(function);
21257         __Pyx_DECREF_SET(__pyx_t_6, function);
21258         __pyx_t_7 = 1;
21259       }
21260     }
21261     #if CYTHON_FAST_PYCALL
21262     if (PyFunction_Check(__pyx_t_6)) {
21263       PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
21264       __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 508, __pyx_L1_error)
21265       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
21266       __Pyx_GOTREF(__pyx_t_4);
21267       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21268     } else
21269     #endif
21270     #if CYTHON_FAST_PYCCALL
21271     if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
21272       PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
21273       __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 508, __pyx_L1_error)
21274       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
21275       __Pyx_GOTREF(__pyx_t_4);
21276       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21277     } else
21278     #endif
21279     {
21280       __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 508, __pyx_L1_error)
21281       __Pyx_GOTREF(__pyx_t_8);
21282       if (__pyx_t_5) {
21283         __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
21284       }
21285       __Pyx_GIVEREF(__pyx_t_1);
21286       PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
21287       __Pyx_INCREF(__pyx_v_value);
21288       __Pyx_GIVEREF(__pyx_v_value);
21289       PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
21290       __pyx_t_1 = 0;
21291       __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 508, __pyx_L1_error)
21292       __Pyx_GOTREF(__pyx_t_4);
21293       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
21294     }
21295     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21296     if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 508, __pyx_L1_error)
21297     __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
21298     __pyx_t_4 = 0;
21299   }
21300   __pyx_L3:;
21301 
21302   /* "View.MemoryView":510
21303  *             bytesvalue = struct.pack(self.view.format, value)
21304  *
21305  *         for i, c in enumerate(bytesvalue):             # <<<<<<<<<<<<<<
21306  *             itemp[i] = c
21307  *
21308  */
21309   __pyx_t_9 = 0;
21310   if (unlikely(__pyx_v_bytesvalue == Py_None)) {
21311     PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
21312     __PYX_ERR(1, 510, __pyx_L1_error)
21313   }
21314   __Pyx_INCREF(__pyx_v_bytesvalue);
21315   __pyx_t_10 = __pyx_v_bytesvalue;
21316   __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
21317   __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
21318   for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
21319     __pyx_t_11 = __pyx_t_14;
21320     __pyx_v_c = (__pyx_t_11[0]);
21321 
21322     /* "View.MemoryView":511
21323  *
21324  *         for i, c in enumerate(bytesvalue):
21325  *             itemp[i] = c             # <<<<<<<<<<<<<<
21326  *
21327  *     @cname('getbuffer')
21328  */
21329     __pyx_v_i = __pyx_t_9;
21330 
21331     /* "View.MemoryView":510
21332  *             bytesvalue = struct.pack(self.view.format, value)
21333  *
21334  *         for i, c in enumerate(bytesvalue):             # <<<<<<<<<<<<<<
21335  *             itemp[i] = c
21336  *
21337  */
21338     __pyx_t_9 = (__pyx_t_9 + 1);
21339 
21340     /* "View.MemoryView":511
21341  *
21342  *         for i, c in enumerate(bytesvalue):
21343  *             itemp[i] = c             # <<<<<<<<<<<<<<
21344  *
21345  *     @cname('getbuffer')
21346  */
21347     (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
21348   }
21349   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21350 
21351   /* "View.MemoryView":497
21352  *             return result
21353  *
21354  *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
21355  *         """Only used if instantiated manually by the user, or if Cython doesn't
21356  *         know how to convert the type"""
21357  */
21358 
21359   /* function exit code */
21360   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21361   goto __pyx_L0;
21362   __pyx_L1_error:;
21363   __Pyx_XDECREF(__pyx_t_1);
21364   __Pyx_XDECREF(__pyx_t_4);
21365   __Pyx_XDECREF(__pyx_t_5);
21366   __Pyx_XDECREF(__pyx_t_6);
21367   __Pyx_XDECREF(__pyx_t_8);
21368   __Pyx_XDECREF(__pyx_t_10);
21369   __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
21370   __pyx_r = 0;
21371   __pyx_L0:;
21372   __Pyx_XDECREF(__pyx_v_struct);
21373   __Pyx_XDECREF(__pyx_v_bytesvalue);
21374   __Pyx_XGIVEREF(__pyx_r);
21375   __Pyx_RefNannyFinishContext();
21376   return __pyx_r;
21377 }
21378 
21379 /* "View.MemoryView":514
21380  *
21381  *     @cname('getbuffer')
21382  *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
21383  *         if flags & PyBUF_WRITABLE and self.view.readonly:
21384  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
21385  */
21386 
21387 /* Python wrapper */
21388 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)21389 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
21390   int __pyx_r;
21391   __Pyx_RefNannyDeclarations
21392   __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
21393   __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));
21394 
21395   /* function exit code */
21396   __Pyx_RefNannyFinishContext();
21397   return __pyx_r;
21398 }
21399 
__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)21400 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) {
21401   int __pyx_r;
21402   __Pyx_RefNannyDeclarations
21403   int __pyx_t_1;
21404   int __pyx_t_2;
21405   PyObject *__pyx_t_3 = NULL;
21406   Py_ssize_t *__pyx_t_4;
21407   char *__pyx_t_5;
21408   void *__pyx_t_6;
21409   int __pyx_t_7;
21410   Py_ssize_t __pyx_t_8;
21411   if (__pyx_v_info == NULL) {
21412     PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
21413     return -1;
21414   }
21415   __Pyx_RefNannySetupContext("__getbuffer__", 0);
21416   __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
21417   __Pyx_GIVEREF(__pyx_v_info->obj);
21418 
21419   /* "View.MemoryView":515
21420  *     @cname('getbuffer')
21421  *     def __getbuffer__(self, Py_buffer *info, int flags):
21422  *         if flags & PyBUF_WRITABLE and self.view.readonly:             # <<<<<<<<<<<<<<
21423  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
21424  *
21425  */
21426   __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
21427   if (__pyx_t_2) {
21428   } else {
21429     __pyx_t_1 = __pyx_t_2;
21430     goto __pyx_L4_bool_binop_done;
21431   }
21432   __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
21433   __pyx_t_1 = __pyx_t_2;
21434   __pyx_L4_bool_binop_done:;
21435   if (unlikely(__pyx_t_1)) {
21436 
21437     /* "View.MemoryView":516
21438  *     def __getbuffer__(self, Py_buffer *info, int flags):
21439  *         if flags & PyBUF_WRITABLE and self.view.readonly:
21440  *             raise ValueError("Cannot create writable memory view from read-only memoryview")             # <<<<<<<<<<<<<<
21441  *
21442  *         if flags & PyBUF_ND:
21443  */
21444     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 516, __pyx_L1_error)
21445     __Pyx_GOTREF(__pyx_t_3);
21446     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
21447     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21448     __PYX_ERR(1, 516, __pyx_L1_error)
21449 
21450     /* "View.MemoryView":515
21451  *     @cname('getbuffer')
21452  *     def __getbuffer__(self, Py_buffer *info, int flags):
21453  *         if flags & PyBUF_WRITABLE and self.view.readonly:             # <<<<<<<<<<<<<<
21454  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
21455  *
21456  */
21457   }
21458 
21459   /* "View.MemoryView":518
21460  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
21461  *
21462  *         if flags & PyBUF_ND:             # <<<<<<<<<<<<<<
21463  *             info.shape = self.view.shape
21464  *         else:
21465  */
21466   __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
21467   if (__pyx_t_1) {
21468 
21469     /* "View.MemoryView":519
21470  *
21471  *         if flags & PyBUF_ND:
21472  *             info.shape = self.view.shape             # <<<<<<<<<<<<<<
21473  *         else:
21474  *             info.shape = NULL
21475  */
21476     __pyx_t_4 = __pyx_v_self->view.shape;
21477     __pyx_v_info->shape = __pyx_t_4;
21478 
21479     /* "View.MemoryView":518
21480  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
21481  *
21482  *         if flags & PyBUF_ND:             # <<<<<<<<<<<<<<
21483  *             info.shape = self.view.shape
21484  *         else:
21485  */
21486     goto __pyx_L6;
21487   }
21488 
21489   /* "View.MemoryView":521
21490  *             info.shape = self.view.shape
21491  *         else:
21492  *             info.shape = NULL             # <<<<<<<<<<<<<<
21493  *
21494  *         if flags & PyBUF_STRIDES:
21495  */
21496   /*else*/ {
21497     __pyx_v_info->shape = NULL;
21498   }
21499   __pyx_L6:;
21500 
21501   /* "View.MemoryView":523
21502  *             info.shape = NULL
21503  *
21504  *         if flags & PyBUF_STRIDES:             # <<<<<<<<<<<<<<
21505  *             info.strides = self.view.strides
21506  *         else:
21507  */
21508   __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
21509   if (__pyx_t_1) {
21510 
21511     /* "View.MemoryView":524
21512  *
21513  *         if flags & PyBUF_STRIDES:
21514  *             info.strides = self.view.strides             # <<<<<<<<<<<<<<
21515  *         else:
21516  *             info.strides = NULL
21517  */
21518     __pyx_t_4 = __pyx_v_self->view.strides;
21519     __pyx_v_info->strides = __pyx_t_4;
21520 
21521     /* "View.MemoryView":523
21522  *             info.shape = NULL
21523  *
21524  *         if flags & PyBUF_STRIDES:             # <<<<<<<<<<<<<<
21525  *             info.strides = self.view.strides
21526  *         else:
21527  */
21528     goto __pyx_L7;
21529   }
21530 
21531   /* "View.MemoryView":526
21532  *             info.strides = self.view.strides
21533  *         else:
21534  *             info.strides = NULL             # <<<<<<<<<<<<<<
21535  *
21536  *         if flags & PyBUF_INDIRECT:
21537  */
21538   /*else*/ {
21539     __pyx_v_info->strides = NULL;
21540   }
21541   __pyx_L7:;
21542 
21543   /* "View.MemoryView":528
21544  *             info.strides = NULL
21545  *
21546  *         if flags & PyBUF_INDIRECT:             # <<<<<<<<<<<<<<
21547  *             info.suboffsets = self.view.suboffsets
21548  *         else:
21549  */
21550   __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
21551   if (__pyx_t_1) {
21552 
21553     /* "View.MemoryView":529
21554  *
21555  *         if flags & PyBUF_INDIRECT:
21556  *             info.suboffsets = self.view.suboffsets             # <<<<<<<<<<<<<<
21557  *         else:
21558  *             info.suboffsets = NULL
21559  */
21560     __pyx_t_4 = __pyx_v_self->view.suboffsets;
21561     __pyx_v_info->suboffsets = __pyx_t_4;
21562 
21563     /* "View.MemoryView":528
21564  *             info.strides = NULL
21565  *
21566  *         if flags & PyBUF_INDIRECT:             # <<<<<<<<<<<<<<
21567  *             info.suboffsets = self.view.suboffsets
21568  *         else:
21569  */
21570     goto __pyx_L8;
21571   }
21572 
21573   /* "View.MemoryView":531
21574  *             info.suboffsets = self.view.suboffsets
21575  *         else:
21576  *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
21577  *
21578  *         if flags & PyBUF_FORMAT:
21579  */
21580   /*else*/ {
21581     __pyx_v_info->suboffsets = NULL;
21582   }
21583   __pyx_L8:;
21584 
21585   /* "View.MemoryView":533
21586  *             info.suboffsets = NULL
21587  *
21588  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
21589  *             info.format = self.view.format
21590  *         else:
21591  */
21592   __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
21593   if (__pyx_t_1) {
21594 
21595     /* "View.MemoryView":534
21596  *
21597  *         if flags & PyBUF_FORMAT:
21598  *             info.format = self.view.format             # <<<<<<<<<<<<<<
21599  *         else:
21600  *             info.format = NULL
21601  */
21602     __pyx_t_5 = __pyx_v_self->view.format;
21603     __pyx_v_info->format = __pyx_t_5;
21604 
21605     /* "View.MemoryView":533
21606  *             info.suboffsets = NULL
21607  *
21608  *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
21609  *             info.format = self.view.format
21610  *         else:
21611  */
21612     goto __pyx_L9;
21613   }
21614 
21615   /* "View.MemoryView":536
21616  *             info.format = self.view.format
21617  *         else:
21618  *             info.format = NULL             # <<<<<<<<<<<<<<
21619  *
21620  *         info.buf = self.view.buf
21621  */
21622   /*else*/ {
21623     __pyx_v_info->format = NULL;
21624   }
21625   __pyx_L9:;
21626 
21627   /* "View.MemoryView":538
21628  *             info.format = NULL
21629  *
21630  *         info.buf = self.view.buf             # <<<<<<<<<<<<<<
21631  *         info.ndim = self.view.ndim
21632  *         info.itemsize = self.view.itemsize
21633  */
21634   __pyx_t_6 = __pyx_v_self->view.buf;
21635   __pyx_v_info->buf = __pyx_t_6;
21636 
21637   /* "View.MemoryView":539
21638  *
21639  *         info.buf = self.view.buf
21640  *         info.ndim = self.view.ndim             # <<<<<<<<<<<<<<
21641  *         info.itemsize = self.view.itemsize
21642  *         info.len = self.view.len
21643  */
21644   __pyx_t_7 = __pyx_v_self->view.ndim;
21645   __pyx_v_info->ndim = __pyx_t_7;
21646 
21647   /* "View.MemoryView":540
21648  *         info.buf = self.view.buf
21649  *         info.ndim = self.view.ndim
21650  *         info.itemsize = self.view.itemsize             # <<<<<<<<<<<<<<
21651  *         info.len = self.view.len
21652  *         info.readonly = self.view.readonly
21653  */
21654   __pyx_t_8 = __pyx_v_self->view.itemsize;
21655   __pyx_v_info->itemsize = __pyx_t_8;
21656 
21657   /* "View.MemoryView":541
21658  *         info.ndim = self.view.ndim
21659  *         info.itemsize = self.view.itemsize
21660  *         info.len = self.view.len             # <<<<<<<<<<<<<<
21661  *         info.readonly = self.view.readonly
21662  *         info.obj = self
21663  */
21664   __pyx_t_8 = __pyx_v_self->view.len;
21665   __pyx_v_info->len = __pyx_t_8;
21666 
21667   /* "View.MemoryView":542
21668  *         info.itemsize = self.view.itemsize
21669  *         info.len = self.view.len
21670  *         info.readonly = self.view.readonly             # <<<<<<<<<<<<<<
21671  *         info.obj = self
21672  *
21673  */
21674   __pyx_t_1 = __pyx_v_self->view.readonly;
21675   __pyx_v_info->readonly = __pyx_t_1;
21676 
21677   /* "View.MemoryView":543
21678  *         info.len = self.view.len
21679  *         info.readonly = self.view.readonly
21680  *         info.obj = self             # <<<<<<<<<<<<<<
21681  *
21682  *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
21683  */
21684   __Pyx_INCREF(((PyObject *)__pyx_v_self));
21685   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
21686   __Pyx_GOTREF(__pyx_v_info->obj);
21687   __Pyx_DECREF(__pyx_v_info->obj);
21688   __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
21689 
21690   /* "View.MemoryView":514
21691  *
21692  *     @cname('getbuffer')
21693  *     def __getbuffer__(self, Py_buffer *info, int flags):             # <<<<<<<<<<<<<<
21694  *         if flags & PyBUF_WRITABLE and self.view.readonly:
21695  *             raise ValueError("Cannot create writable memory view from read-only memoryview")
21696  */
21697 
21698   /* function exit code */
21699   __pyx_r = 0;
21700   goto __pyx_L0;
21701   __pyx_L1_error:;
21702   __Pyx_XDECREF(__pyx_t_3);
21703   __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21704   __pyx_r = -1;
21705   if (__pyx_v_info->obj != NULL) {
21706     __Pyx_GOTREF(__pyx_v_info->obj);
21707     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
21708   }
21709   goto __pyx_L2;
21710   __pyx_L0:;
21711   if (__pyx_v_info->obj == Py_None) {
21712     __Pyx_GOTREF(__pyx_v_info->obj);
21713     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
21714   }
21715   __pyx_L2:;
21716   __Pyx_RefNannyFinishContext();
21717   return __pyx_r;
21718 }
21719 
21720 /* "View.MemoryView":549
21721  *
21722  *     @property
21723  *     def T(self):             # <<<<<<<<<<<<<<
21724  *         cdef _memoryviewslice result = memoryview_copy(self)
21725  *         transpose_memslice(&result.from_slice)
21726  */
21727 
21728 /* Python wrapper */
21729 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)21730 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
21731   PyObject *__pyx_r = 0;
21732   __Pyx_RefNannyDeclarations
21733   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
21734   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
21735 
21736   /* function exit code */
21737   __Pyx_RefNannyFinishContext();
21738   return __pyx_r;
21739 }
21740 
__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj * __pyx_v_self)21741 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
21742   struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
21743   PyObject *__pyx_r = NULL;
21744   __Pyx_RefNannyDeclarations
21745   PyObject *__pyx_t_1 = NULL;
21746   int __pyx_t_2;
21747   __Pyx_RefNannySetupContext("__get__", 0);
21748 
21749   /* "View.MemoryView":550
21750  *     @property
21751  *     def T(self):
21752  *         cdef _memoryviewslice result = memoryview_copy(self)             # <<<<<<<<<<<<<<
21753  *         transpose_memslice(&result.from_slice)
21754  *         return result
21755  */
21756   __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 550, __pyx_L1_error)
21757   __Pyx_GOTREF(__pyx_t_1);
21758   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 550, __pyx_L1_error)
21759   __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
21760   __pyx_t_1 = 0;
21761 
21762   /* "View.MemoryView":551
21763  *     def T(self):
21764  *         cdef _memoryviewslice result = memoryview_copy(self)
21765  *         transpose_memslice(&result.from_slice)             # <<<<<<<<<<<<<<
21766  *         return result
21767  *
21768  */
21769   __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 551, __pyx_L1_error)
21770 
21771   /* "View.MemoryView":552
21772  *         cdef _memoryviewslice result = memoryview_copy(self)
21773  *         transpose_memslice(&result.from_slice)
21774  *         return result             # <<<<<<<<<<<<<<
21775  *
21776  *     @property
21777  */
21778   __Pyx_XDECREF(__pyx_r);
21779   __Pyx_INCREF(((PyObject *)__pyx_v_result));
21780   __pyx_r = ((PyObject *)__pyx_v_result);
21781   goto __pyx_L0;
21782 
21783   /* "View.MemoryView":549
21784  *
21785  *     @property
21786  *     def T(self):             # <<<<<<<<<<<<<<
21787  *         cdef _memoryviewslice result = memoryview_copy(self)
21788  *         transpose_memslice(&result.from_slice)
21789  */
21790 
21791   /* function exit code */
21792   __pyx_L1_error:;
21793   __Pyx_XDECREF(__pyx_t_1);
21794   __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21795   __pyx_r = NULL;
21796   __pyx_L0:;
21797   __Pyx_XDECREF((PyObject *)__pyx_v_result);
21798   __Pyx_XGIVEREF(__pyx_r);
21799   __Pyx_RefNannyFinishContext();
21800   return __pyx_r;
21801 }
21802 
21803 /* "View.MemoryView":555
21804  *
21805  *     @property
21806  *     def base(self):             # <<<<<<<<<<<<<<
21807  *         return self.obj
21808  *
21809  */
21810 
21811 /* Python wrapper */
21812 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)21813 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
21814   PyObject *__pyx_r = 0;
21815   __Pyx_RefNannyDeclarations
21816   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
21817   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
21818 
21819   /* function exit code */
21820   __Pyx_RefNannyFinishContext();
21821   return __pyx_r;
21822 }
21823 
__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj * __pyx_v_self)21824 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
21825   PyObject *__pyx_r = NULL;
21826   __Pyx_RefNannyDeclarations
21827   __Pyx_RefNannySetupContext("__get__", 0);
21828 
21829   /* "View.MemoryView":556
21830  *     @property
21831  *     def base(self):
21832  *         return self.obj             # <<<<<<<<<<<<<<
21833  *
21834  *     @property
21835  */
21836   __Pyx_XDECREF(__pyx_r);
21837   __Pyx_INCREF(__pyx_v_self->obj);
21838   __pyx_r = __pyx_v_self->obj;
21839   goto __pyx_L0;
21840 
21841   /* "View.MemoryView":555
21842  *
21843  *     @property
21844  *     def base(self):             # <<<<<<<<<<<<<<
21845  *         return self.obj
21846  *
21847  */
21848 
21849   /* function exit code */
21850   __pyx_L0:;
21851   __Pyx_XGIVEREF(__pyx_r);
21852   __Pyx_RefNannyFinishContext();
21853   return __pyx_r;
21854 }
21855 
21856 /* "View.MemoryView":559
21857  *
21858  *     @property
21859  *     def shape(self):             # <<<<<<<<<<<<<<
21860  *         return tuple([length for length in self.view.shape[:self.view.ndim]])
21861  *
21862  */
21863 
21864 /* Python wrapper */
21865 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)21866 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
21867   PyObject *__pyx_r = 0;
21868   __Pyx_RefNannyDeclarations
21869   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
21870   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
21871 
21872   /* function exit code */
21873   __Pyx_RefNannyFinishContext();
21874   return __pyx_r;
21875 }
21876 
__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj * __pyx_v_self)21877 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
21878   Py_ssize_t __pyx_v_length;
21879   PyObject *__pyx_r = NULL;
21880   __Pyx_RefNannyDeclarations
21881   PyObject *__pyx_t_1 = NULL;
21882   Py_ssize_t *__pyx_t_2;
21883   Py_ssize_t *__pyx_t_3;
21884   Py_ssize_t *__pyx_t_4;
21885   PyObject *__pyx_t_5 = NULL;
21886   __Pyx_RefNannySetupContext("__get__", 0);
21887 
21888   /* "View.MemoryView":560
21889  *     @property
21890  *     def shape(self):
21891  *         return tuple([length for length in self.view.shape[:self.view.ndim]])             # <<<<<<<<<<<<<<
21892  *
21893  *     @property
21894  */
21895   __Pyx_XDECREF(__pyx_r);
21896   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 560, __pyx_L1_error)
21897   __Pyx_GOTREF(__pyx_t_1);
21898   __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
21899   for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
21900     __pyx_t_2 = __pyx_t_4;
21901     __pyx_v_length = (__pyx_t_2[0]);
21902     __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 560, __pyx_L1_error)
21903     __Pyx_GOTREF(__pyx_t_5);
21904     if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 560, __pyx_L1_error)
21905     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21906   }
21907   __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 560, __pyx_L1_error)
21908   __Pyx_GOTREF(__pyx_t_5);
21909   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21910   __pyx_r = __pyx_t_5;
21911   __pyx_t_5 = 0;
21912   goto __pyx_L0;
21913 
21914   /* "View.MemoryView":559
21915  *
21916  *     @property
21917  *     def shape(self):             # <<<<<<<<<<<<<<
21918  *         return tuple([length for length in self.view.shape[:self.view.ndim]])
21919  *
21920  */
21921 
21922   /* function exit code */
21923   __pyx_L1_error:;
21924   __Pyx_XDECREF(__pyx_t_1);
21925   __Pyx_XDECREF(__pyx_t_5);
21926   __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21927   __pyx_r = NULL;
21928   __pyx_L0:;
21929   __Pyx_XGIVEREF(__pyx_r);
21930   __Pyx_RefNannyFinishContext();
21931   return __pyx_r;
21932 }
21933 
21934 /* "View.MemoryView":563
21935  *
21936  *     @property
21937  *     def strides(self):             # <<<<<<<<<<<<<<
21938  *         if self.view.strides == NULL:
21939  *
21940  */
21941 
21942 /* Python wrapper */
21943 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)21944 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
21945   PyObject *__pyx_r = 0;
21946   __Pyx_RefNannyDeclarations
21947   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
21948   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
21949 
21950   /* function exit code */
21951   __Pyx_RefNannyFinishContext();
21952   return __pyx_r;
21953 }
21954 
__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj * __pyx_v_self)21955 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
21956   Py_ssize_t __pyx_v_stride;
21957   PyObject *__pyx_r = NULL;
21958   __Pyx_RefNannyDeclarations
21959   int __pyx_t_1;
21960   PyObject *__pyx_t_2 = NULL;
21961   Py_ssize_t *__pyx_t_3;
21962   Py_ssize_t *__pyx_t_4;
21963   Py_ssize_t *__pyx_t_5;
21964   PyObject *__pyx_t_6 = NULL;
21965   __Pyx_RefNannySetupContext("__get__", 0);
21966 
21967   /* "View.MemoryView":564
21968  *     @property
21969  *     def strides(self):
21970  *         if self.view.strides == NULL:             # <<<<<<<<<<<<<<
21971  *
21972  *             raise ValueError("Buffer view does not expose strides")
21973  */
21974   __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
21975   if (unlikely(__pyx_t_1)) {
21976 
21977     /* "View.MemoryView":566
21978  *         if self.view.strides == NULL:
21979  *
21980  *             raise ValueError("Buffer view does not expose strides")             # <<<<<<<<<<<<<<
21981  *
21982  *         return tuple([stride for stride in self.view.strides[:self.view.ndim]])
21983  */
21984     __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 566, __pyx_L1_error)
21985     __Pyx_GOTREF(__pyx_t_2);
21986     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
21987     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21988     __PYX_ERR(1, 566, __pyx_L1_error)
21989 
21990     /* "View.MemoryView":564
21991  *     @property
21992  *     def strides(self):
21993  *         if self.view.strides == NULL:             # <<<<<<<<<<<<<<
21994  *
21995  *             raise ValueError("Buffer view does not expose strides")
21996  */
21997   }
21998 
21999   /* "View.MemoryView":568
22000  *             raise ValueError("Buffer view does not expose strides")
22001  *
22002  *         return tuple([stride for stride in self.view.strides[:self.view.ndim]])             # <<<<<<<<<<<<<<
22003  *
22004  *     @property
22005  */
22006   __Pyx_XDECREF(__pyx_r);
22007   __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 568, __pyx_L1_error)
22008   __Pyx_GOTREF(__pyx_t_2);
22009   __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
22010   for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
22011     __pyx_t_3 = __pyx_t_5;
22012     __pyx_v_stride = (__pyx_t_3[0]);
22013     __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 568, __pyx_L1_error)
22014     __Pyx_GOTREF(__pyx_t_6);
22015     if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 568, __pyx_L1_error)
22016     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22017   }
22018   __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 568, __pyx_L1_error)
22019   __Pyx_GOTREF(__pyx_t_6);
22020   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22021   __pyx_r = __pyx_t_6;
22022   __pyx_t_6 = 0;
22023   goto __pyx_L0;
22024 
22025   /* "View.MemoryView":563
22026  *
22027  *     @property
22028  *     def strides(self):             # <<<<<<<<<<<<<<
22029  *         if self.view.strides == NULL:
22030  *
22031  */
22032 
22033   /* function exit code */
22034   __pyx_L1_error:;
22035   __Pyx_XDECREF(__pyx_t_2);
22036   __Pyx_XDECREF(__pyx_t_6);
22037   __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22038   __pyx_r = NULL;
22039   __pyx_L0:;
22040   __Pyx_XGIVEREF(__pyx_r);
22041   __Pyx_RefNannyFinishContext();
22042   return __pyx_r;
22043 }
22044 
22045 /* "View.MemoryView":571
22046  *
22047  *     @property
22048  *     def suboffsets(self):             # <<<<<<<<<<<<<<
22049  *         if self.view.suboffsets == NULL:
22050  *             return (-1,) * self.view.ndim
22051  */
22052 
22053 /* Python wrapper */
22054 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)22055 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
22056   PyObject *__pyx_r = 0;
22057   __Pyx_RefNannyDeclarations
22058   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
22059   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
22060 
22061   /* function exit code */
22062   __Pyx_RefNannyFinishContext();
22063   return __pyx_r;
22064 }
22065 
__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj * __pyx_v_self)22066 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
22067   Py_ssize_t __pyx_v_suboffset;
22068   PyObject *__pyx_r = NULL;
22069   __Pyx_RefNannyDeclarations
22070   int __pyx_t_1;
22071   PyObject *__pyx_t_2 = NULL;
22072   PyObject *__pyx_t_3 = NULL;
22073   Py_ssize_t *__pyx_t_4;
22074   Py_ssize_t *__pyx_t_5;
22075   Py_ssize_t *__pyx_t_6;
22076   __Pyx_RefNannySetupContext("__get__", 0);
22077 
22078   /* "View.MemoryView":572
22079  *     @property
22080  *     def suboffsets(self):
22081  *         if self.view.suboffsets == NULL:             # <<<<<<<<<<<<<<
22082  *             return (-1,) * self.view.ndim
22083  *
22084  */
22085   __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
22086   if (__pyx_t_1) {
22087 
22088     /* "View.MemoryView":573
22089  *     def suboffsets(self):
22090  *         if self.view.suboffsets == NULL:
22091  *             return (-1,) * self.view.ndim             # <<<<<<<<<<<<<<
22092  *
22093  *         return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
22094  */
22095     __Pyx_XDECREF(__pyx_r);
22096     __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 573, __pyx_L1_error)
22097     __Pyx_GOTREF(__pyx_t_2);
22098     __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__44, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 573, __pyx_L1_error)
22099     __Pyx_GOTREF(__pyx_t_3);
22100     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22101     __pyx_r = __pyx_t_3;
22102     __pyx_t_3 = 0;
22103     goto __pyx_L0;
22104 
22105     /* "View.MemoryView":572
22106  *     @property
22107  *     def suboffsets(self):
22108  *         if self.view.suboffsets == NULL:             # <<<<<<<<<<<<<<
22109  *             return (-1,) * self.view.ndim
22110  *
22111  */
22112   }
22113 
22114   /* "View.MemoryView":575
22115  *             return (-1,) * self.view.ndim
22116  *
22117  *         return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])             # <<<<<<<<<<<<<<
22118  *
22119  *     @property
22120  */
22121   __Pyx_XDECREF(__pyx_r);
22122   __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 575, __pyx_L1_error)
22123   __Pyx_GOTREF(__pyx_t_3);
22124   __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
22125   for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
22126     __pyx_t_4 = __pyx_t_6;
22127     __pyx_v_suboffset = (__pyx_t_4[0]);
22128     __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 575, __pyx_L1_error)
22129     __Pyx_GOTREF(__pyx_t_2);
22130     if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 575, __pyx_L1_error)
22131     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22132   }
22133   __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 575, __pyx_L1_error)
22134   __Pyx_GOTREF(__pyx_t_2);
22135   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22136   __pyx_r = __pyx_t_2;
22137   __pyx_t_2 = 0;
22138   goto __pyx_L0;
22139 
22140   /* "View.MemoryView":571
22141  *
22142  *     @property
22143  *     def suboffsets(self):             # <<<<<<<<<<<<<<
22144  *         if self.view.suboffsets == NULL:
22145  *             return (-1,) * self.view.ndim
22146  */
22147 
22148   /* function exit code */
22149   __pyx_L1_error:;
22150   __Pyx_XDECREF(__pyx_t_2);
22151   __Pyx_XDECREF(__pyx_t_3);
22152   __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22153   __pyx_r = NULL;
22154   __pyx_L0:;
22155   __Pyx_XGIVEREF(__pyx_r);
22156   __Pyx_RefNannyFinishContext();
22157   return __pyx_r;
22158 }
22159 
22160 /* "View.MemoryView":578
22161  *
22162  *     @property
22163  *     def ndim(self):             # <<<<<<<<<<<<<<
22164  *         return self.view.ndim
22165  *
22166  */
22167 
22168 /* Python wrapper */
22169 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)22170 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
22171   PyObject *__pyx_r = 0;
22172   __Pyx_RefNannyDeclarations
22173   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
22174   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
22175 
22176   /* function exit code */
22177   __Pyx_RefNannyFinishContext();
22178   return __pyx_r;
22179 }
22180 
__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj * __pyx_v_self)22181 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
22182   PyObject *__pyx_r = NULL;
22183   __Pyx_RefNannyDeclarations
22184   PyObject *__pyx_t_1 = NULL;
22185   __Pyx_RefNannySetupContext("__get__", 0);
22186 
22187   /* "View.MemoryView":579
22188  *     @property
22189  *     def ndim(self):
22190  *         return self.view.ndim             # <<<<<<<<<<<<<<
22191  *
22192  *     @property
22193  */
22194   __Pyx_XDECREF(__pyx_r);
22195   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 579, __pyx_L1_error)
22196   __Pyx_GOTREF(__pyx_t_1);
22197   __pyx_r = __pyx_t_1;
22198   __pyx_t_1 = 0;
22199   goto __pyx_L0;
22200 
22201   /* "View.MemoryView":578
22202  *
22203  *     @property
22204  *     def ndim(self):             # <<<<<<<<<<<<<<
22205  *         return self.view.ndim
22206  *
22207  */
22208 
22209   /* function exit code */
22210   __pyx_L1_error:;
22211   __Pyx_XDECREF(__pyx_t_1);
22212   __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22213   __pyx_r = NULL;
22214   __pyx_L0:;
22215   __Pyx_XGIVEREF(__pyx_r);
22216   __Pyx_RefNannyFinishContext();
22217   return __pyx_r;
22218 }
22219 
22220 /* "View.MemoryView":582
22221  *
22222  *     @property
22223  *     def itemsize(self):             # <<<<<<<<<<<<<<
22224  *         return self.view.itemsize
22225  *
22226  */
22227 
22228 /* Python wrapper */
22229 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)22230 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
22231   PyObject *__pyx_r = 0;
22232   __Pyx_RefNannyDeclarations
22233   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
22234   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
22235 
22236   /* function exit code */
22237   __Pyx_RefNannyFinishContext();
22238   return __pyx_r;
22239 }
22240 
__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj * __pyx_v_self)22241 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
22242   PyObject *__pyx_r = NULL;
22243   __Pyx_RefNannyDeclarations
22244   PyObject *__pyx_t_1 = NULL;
22245   __Pyx_RefNannySetupContext("__get__", 0);
22246 
22247   /* "View.MemoryView":583
22248  *     @property
22249  *     def itemsize(self):
22250  *         return self.view.itemsize             # <<<<<<<<<<<<<<
22251  *
22252  *     @property
22253  */
22254   __Pyx_XDECREF(__pyx_r);
22255   __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 583, __pyx_L1_error)
22256   __Pyx_GOTREF(__pyx_t_1);
22257   __pyx_r = __pyx_t_1;
22258   __pyx_t_1 = 0;
22259   goto __pyx_L0;
22260 
22261   /* "View.MemoryView":582
22262  *
22263  *     @property
22264  *     def itemsize(self):             # <<<<<<<<<<<<<<
22265  *         return self.view.itemsize
22266  *
22267  */
22268 
22269   /* function exit code */
22270   __pyx_L1_error:;
22271   __Pyx_XDECREF(__pyx_t_1);
22272   __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22273   __pyx_r = NULL;
22274   __pyx_L0:;
22275   __Pyx_XGIVEREF(__pyx_r);
22276   __Pyx_RefNannyFinishContext();
22277   return __pyx_r;
22278 }
22279 
22280 /* "View.MemoryView":586
22281  *
22282  *     @property
22283  *     def nbytes(self):             # <<<<<<<<<<<<<<
22284  *         return self.size * self.view.itemsize
22285  *
22286  */
22287 
22288 /* Python wrapper */
22289 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)22290 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
22291   PyObject *__pyx_r = 0;
22292   __Pyx_RefNannyDeclarations
22293   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
22294   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
22295 
22296   /* function exit code */
22297   __Pyx_RefNannyFinishContext();
22298   return __pyx_r;
22299 }
22300 
__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj * __pyx_v_self)22301 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
22302   PyObject *__pyx_r = NULL;
22303   __Pyx_RefNannyDeclarations
22304   PyObject *__pyx_t_1 = NULL;
22305   PyObject *__pyx_t_2 = NULL;
22306   PyObject *__pyx_t_3 = NULL;
22307   __Pyx_RefNannySetupContext("__get__", 0);
22308 
22309   /* "View.MemoryView":587
22310  *     @property
22311  *     def nbytes(self):
22312  *         return self.size * self.view.itemsize             # <<<<<<<<<<<<<<
22313  *
22314  *     @property
22315  */
22316   __Pyx_XDECREF(__pyx_r);
22317   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 587, __pyx_L1_error)
22318   __Pyx_GOTREF(__pyx_t_1);
22319   __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 587, __pyx_L1_error)
22320   __Pyx_GOTREF(__pyx_t_2);
22321   __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 587, __pyx_L1_error)
22322   __Pyx_GOTREF(__pyx_t_3);
22323   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22324   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22325   __pyx_r = __pyx_t_3;
22326   __pyx_t_3 = 0;
22327   goto __pyx_L0;
22328 
22329   /* "View.MemoryView":586
22330  *
22331  *     @property
22332  *     def nbytes(self):             # <<<<<<<<<<<<<<
22333  *         return self.size * self.view.itemsize
22334  *
22335  */
22336 
22337   /* function exit code */
22338   __pyx_L1_error:;
22339   __Pyx_XDECREF(__pyx_t_1);
22340   __Pyx_XDECREF(__pyx_t_2);
22341   __Pyx_XDECREF(__pyx_t_3);
22342   __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22343   __pyx_r = NULL;
22344   __pyx_L0:;
22345   __Pyx_XGIVEREF(__pyx_r);
22346   __Pyx_RefNannyFinishContext();
22347   return __pyx_r;
22348 }
22349 
22350 /* "View.MemoryView":590
22351  *
22352  *     @property
22353  *     def size(self):             # <<<<<<<<<<<<<<
22354  *         if self._size is None:
22355  *             result = 1
22356  */
22357 
22358 /* Python wrapper */
22359 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)22360 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
22361   PyObject *__pyx_r = 0;
22362   __Pyx_RefNannyDeclarations
22363   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
22364   __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
22365 
22366   /* function exit code */
22367   __Pyx_RefNannyFinishContext();
22368   return __pyx_r;
22369 }
22370 
__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj * __pyx_v_self)22371 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
22372   PyObject *__pyx_v_result = NULL;
22373   PyObject *__pyx_v_length = NULL;
22374   PyObject *__pyx_r = NULL;
22375   __Pyx_RefNannyDeclarations
22376   int __pyx_t_1;
22377   int __pyx_t_2;
22378   Py_ssize_t *__pyx_t_3;
22379   Py_ssize_t *__pyx_t_4;
22380   Py_ssize_t *__pyx_t_5;
22381   PyObject *__pyx_t_6 = NULL;
22382   __Pyx_RefNannySetupContext("__get__", 0);
22383 
22384   /* "View.MemoryView":591
22385  *     @property
22386  *     def size(self):
22387  *         if self._size is None:             # <<<<<<<<<<<<<<
22388  *             result = 1
22389  *
22390  */
22391   __pyx_t_1 = (__pyx_v_self->_size == Py_None);
22392   __pyx_t_2 = (__pyx_t_1 != 0);
22393   if (__pyx_t_2) {
22394 
22395     /* "View.MemoryView":592
22396  *     def size(self):
22397  *         if self._size is None:
22398  *             result = 1             # <<<<<<<<<<<<<<
22399  *
22400  *             for length in self.view.shape[:self.view.ndim]:
22401  */
22402     __Pyx_INCREF(__pyx_int_1);
22403     __pyx_v_result = __pyx_int_1;
22404 
22405     /* "View.MemoryView":594
22406  *             result = 1
22407  *
22408  *             for length in self.view.shape[:self.view.ndim]:             # <<<<<<<<<<<<<<
22409  *                 result *= length
22410  *
22411  */
22412     __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
22413     for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
22414       __pyx_t_3 = __pyx_t_5;
22415       __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 594, __pyx_L1_error)
22416       __Pyx_GOTREF(__pyx_t_6);
22417       __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
22418       __pyx_t_6 = 0;
22419 
22420       /* "View.MemoryView":595
22421  *
22422  *             for length in self.view.shape[:self.view.ndim]:
22423  *                 result *= length             # <<<<<<<<<<<<<<
22424  *
22425  *             self._size = result
22426  */
22427       __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 595, __pyx_L1_error)
22428       __Pyx_GOTREF(__pyx_t_6);
22429       __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
22430       __pyx_t_6 = 0;
22431     }
22432 
22433     /* "View.MemoryView":597
22434  *                 result *= length
22435  *
22436  *             self._size = result             # <<<<<<<<<<<<<<
22437  *
22438  *         return self._size
22439  */
22440     __Pyx_INCREF(__pyx_v_result);
22441     __Pyx_GIVEREF(__pyx_v_result);
22442     __Pyx_GOTREF(__pyx_v_self->_size);
22443     __Pyx_DECREF(__pyx_v_self->_size);
22444     __pyx_v_self->_size = __pyx_v_result;
22445 
22446     /* "View.MemoryView":591
22447  *     @property
22448  *     def size(self):
22449  *         if self._size is None:             # <<<<<<<<<<<<<<
22450  *             result = 1
22451  *
22452  */
22453   }
22454 
22455   /* "View.MemoryView":599
22456  *             self._size = result
22457  *
22458  *         return self._size             # <<<<<<<<<<<<<<
22459  *
22460  *     def __len__(self):
22461  */
22462   __Pyx_XDECREF(__pyx_r);
22463   __Pyx_INCREF(__pyx_v_self->_size);
22464   __pyx_r = __pyx_v_self->_size;
22465   goto __pyx_L0;
22466 
22467   /* "View.MemoryView":590
22468  *
22469  *     @property
22470  *     def size(self):             # <<<<<<<<<<<<<<
22471  *         if self._size is None:
22472  *             result = 1
22473  */
22474 
22475   /* function exit code */
22476   __pyx_L1_error:;
22477   __Pyx_XDECREF(__pyx_t_6);
22478   __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22479   __pyx_r = NULL;
22480   __pyx_L0:;
22481   __Pyx_XDECREF(__pyx_v_result);
22482   __Pyx_XDECREF(__pyx_v_length);
22483   __Pyx_XGIVEREF(__pyx_r);
22484   __Pyx_RefNannyFinishContext();
22485   return __pyx_r;
22486 }
22487 
22488 /* "View.MemoryView":601
22489  *         return self._size
22490  *
22491  *     def __len__(self):             # <<<<<<<<<<<<<<
22492  *         if self.view.ndim >= 1:
22493  *             return self.view.shape[0]
22494  */
22495 
22496 /* Python wrapper */
22497 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
__pyx_memoryview___len__(PyObject * __pyx_v_self)22498 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
22499   Py_ssize_t __pyx_r;
22500   __Pyx_RefNannyDeclarations
22501   __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
22502   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
22503 
22504   /* function exit code */
22505   __Pyx_RefNannyFinishContext();
22506   return __pyx_r;
22507 }
22508 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj * __pyx_v_self)22509 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
22510   Py_ssize_t __pyx_r;
22511   __Pyx_RefNannyDeclarations
22512   int __pyx_t_1;
22513   __Pyx_RefNannySetupContext("__len__", 0);
22514 
22515   /* "View.MemoryView":602
22516  *
22517  *     def __len__(self):
22518  *         if self.view.ndim >= 1:             # <<<<<<<<<<<<<<
22519  *             return self.view.shape[0]
22520  *
22521  */
22522   __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
22523   if (__pyx_t_1) {
22524 
22525     /* "View.MemoryView":603
22526  *     def __len__(self):
22527  *         if self.view.ndim >= 1:
22528  *             return self.view.shape[0]             # <<<<<<<<<<<<<<
22529  *
22530  *         return 0
22531  */
22532     __pyx_r = (__pyx_v_self->view.shape[0]);
22533     goto __pyx_L0;
22534 
22535     /* "View.MemoryView":602
22536  *
22537  *     def __len__(self):
22538  *         if self.view.ndim >= 1:             # <<<<<<<<<<<<<<
22539  *             return self.view.shape[0]
22540  *
22541  */
22542   }
22543 
22544   /* "View.MemoryView":605
22545  *             return self.view.shape[0]
22546  *
22547  *         return 0             # <<<<<<<<<<<<<<
22548  *
22549  *     def __repr__(self):
22550  */
22551   __pyx_r = 0;
22552   goto __pyx_L0;
22553 
22554   /* "View.MemoryView":601
22555  *         return self._size
22556  *
22557  *     def __len__(self):             # <<<<<<<<<<<<<<
22558  *         if self.view.ndim >= 1:
22559  *             return self.view.shape[0]
22560  */
22561 
22562   /* function exit code */
22563   __pyx_L0:;
22564   __Pyx_RefNannyFinishContext();
22565   return __pyx_r;
22566 }
22567 
22568 /* "View.MemoryView":607
22569  *         return 0
22570  *
22571  *     def __repr__(self):             # <<<<<<<<<<<<<<
22572  *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
22573  *                                                id(self))
22574  */
22575 
22576 /* Python wrapper */
22577 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
__pyx_memoryview___repr__(PyObject * __pyx_v_self)22578 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
22579   PyObject *__pyx_r = 0;
22580   __Pyx_RefNannyDeclarations
22581   __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
22582   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
22583 
22584   /* function exit code */
22585   __Pyx_RefNannyFinishContext();
22586   return __pyx_r;
22587 }
22588 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj * __pyx_v_self)22589 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
22590   PyObject *__pyx_r = NULL;
22591   __Pyx_RefNannyDeclarations
22592   PyObject *__pyx_t_1 = NULL;
22593   PyObject *__pyx_t_2 = NULL;
22594   PyObject *__pyx_t_3 = NULL;
22595   __Pyx_RefNannySetupContext("__repr__", 0);
22596 
22597   /* "View.MemoryView":608
22598  *
22599  *     def __repr__(self):
22600  *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,             # <<<<<<<<<<<<<<
22601  *                                                id(self))
22602  *
22603  */
22604   __Pyx_XDECREF(__pyx_r);
22605   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 608, __pyx_L1_error)
22606   __Pyx_GOTREF(__pyx_t_1);
22607   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 608, __pyx_L1_error)
22608   __Pyx_GOTREF(__pyx_t_2);
22609   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22610   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 608, __pyx_L1_error)
22611   __Pyx_GOTREF(__pyx_t_1);
22612   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22613 
22614   /* "View.MemoryView":609
22615  *     def __repr__(self):
22616  *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
22617  *                                                id(self))             # <<<<<<<<<<<<<<
22618  *
22619  *     def __str__(self):
22620  */
22621   __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 609, __pyx_L1_error)
22622   __Pyx_GOTREF(__pyx_t_2);
22623 
22624   /* "View.MemoryView":608
22625  *
22626  *     def __repr__(self):
22627  *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,             # <<<<<<<<<<<<<<
22628  *                                                id(self))
22629  *
22630  */
22631   __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 608, __pyx_L1_error)
22632   __Pyx_GOTREF(__pyx_t_3);
22633   __Pyx_GIVEREF(__pyx_t_1);
22634   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
22635   __Pyx_GIVEREF(__pyx_t_2);
22636   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
22637   __pyx_t_1 = 0;
22638   __pyx_t_2 = 0;
22639   __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 608, __pyx_L1_error)
22640   __Pyx_GOTREF(__pyx_t_2);
22641   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22642   __pyx_r = __pyx_t_2;
22643   __pyx_t_2 = 0;
22644   goto __pyx_L0;
22645 
22646   /* "View.MemoryView":607
22647  *         return 0
22648  *
22649  *     def __repr__(self):             # <<<<<<<<<<<<<<
22650  *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
22651  *                                                id(self))
22652  */
22653 
22654   /* function exit code */
22655   __pyx_L1_error:;
22656   __Pyx_XDECREF(__pyx_t_1);
22657   __Pyx_XDECREF(__pyx_t_2);
22658   __Pyx_XDECREF(__pyx_t_3);
22659   __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22660   __pyx_r = NULL;
22661   __pyx_L0:;
22662   __Pyx_XGIVEREF(__pyx_r);
22663   __Pyx_RefNannyFinishContext();
22664   return __pyx_r;
22665 }
22666 
22667 /* "View.MemoryView":611
22668  *                                                id(self))
22669  *
22670  *     def __str__(self):             # <<<<<<<<<<<<<<
22671  *         return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
22672  *
22673  */
22674 
22675 /* Python wrapper */
22676 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
__pyx_memoryview___str__(PyObject * __pyx_v_self)22677 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
22678   PyObject *__pyx_r = 0;
22679   __Pyx_RefNannyDeclarations
22680   __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
22681   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
22682 
22683   /* function exit code */
22684   __Pyx_RefNannyFinishContext();
22685   return __pyx_r;
22686 }
22687 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj * __pyx_v_self)22688 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
22689   PyObject *__pyx_r = NULL;
22690   __Pyx_RefNannyDeclarations
22691   PyObject *__pyx_t_1 = NULL;
22692   PyObject *__pyx_t_2 = NULL;
22693   __Pyx_RefNannySetupContext("__str__", 0);
22694 
22695   /* "View.MemoryView":612
22696  *
22697  *     def __str__(self):
22698  *         return "<MemoryView of %r object>" % (self.base.__class__.__name__,)             # <<<<<<<<<<<<<<
22699  *
22700  *
22701  */
22702   __Pyx_XDECREF(__pyx_r);
22703   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
22704   __Pyx_GOTREF(__pyx_t_1);
22705   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
22706   __Pyx_GOTREF(__pyx_t_2);
22707   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22708   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
22709   __Pyx_GOTREF(__pyx_t_1);
22710   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22711   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
22712   __Pyx_GOTREF(__pyx_t_2);
22713   __Pyx_GIVEREF(__pyx_t_1);
22714   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
22715   __pyx_t_1 = 0;
22716   __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
22717   __Pyx_GOTREF(__pyx_t_1);
22718   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22719   __pyx_r = __pyx_t_1;
22720   __pyx_t_1 = 0;
22721   goto __pyx_L0;
22722 
22723   /* "View.MemoryView":611
22724  *                                                id(self))
22725  *
22726  *     def __str__(self):             # <<<<<<<<<<<<<<
22727  *         return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
22728  *
22729  */
22730 
22731   /* function exit code */
22732   __pyx_L1_error:;
22733   __Pyx_XDECREF(__pyx_t_1);
22734   __Pyx_XDECREF(__pyx_t_2);
22735   __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22736   __pyx_r = NULL;
22737   __pyx_L0:;
22738   __Pyx_XGIVEREF(__pyx_r);
22739   __Pyx_RefNannyFinishContext();
22740   return __pyx_r;
22741 }
22742 
22743 /* "View.MemoryView":615
22744  *
22745  *
22746  *     def is_c_contig(self):             # <<<<<<<<<<<<<<
22747  *         cdef __Pyx_memviewslice *mslice
22748  *         cdef __Pyx_memviewslice tmp
22749  */
22750 
22751 /* Python wrapper */
22752 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)22753 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
22754   PyObject *__pyx_r = 0;
22755   __Pyx_RefNannyDeclarations
22756   __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
22757   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
22758 
22759   /* function exit code */
22760   __Pyx_RefNannyFinishContext();
22761   return __pyx_r;
22762 }
22763 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj * __pyx_v_self)22764 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
22765   __Pyx_memviewslice *__pyx_v_mslice;
22766   __Pyx_memviewslice __pyx_v_tmp;
22767   PyObject *__pyx_r = NULL;
22768   __Pyx_RefNannyDeclarations
22769   PyObject *__pyx_t_1 = NULL;
22770   __Pyx_RefNannySetupContext("is_c_contig", 0);
22771 
22772   /* "View.MemoryView":618
22773  *         cdef __Pyx_memviewslice *mslice
22774  *         cdef __Pyx_memviewslice tmp
22775  *         mslice = get_slice_from_memview(self, &tmp)             # <<<<<<<<<<<<<<
22776  *         return slice_is_contig(mslice[0], 'C', self.view.ndim)
22777  *
22778  */
22779   __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
22780 
22781   /* "View.MemoryView":619
22782  *         cdef __Pyx_memviewslice tmp
22783  *         mslice = get_slice_from_memview(self, &tmp)
22784  *         return slice_is_contig(mslice[0], 'C', self.view.ndim)             # <<<<<<<<<<<<<<
22785  *
22786  *     def is_f_contig(self):
22787  */
22788   __Pyx_XDECREF(__pyx_r);
22789   __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 619, __pyx_L1_error)
22790   __Pyx_GOTREF(__pyx_t_1);
22791   __pyx_r = __pyx_t_1;
22792   __pyx_t_1 = 0;
22793   goto __pyx_L0;
22794 
22795   /* "View.MemoryView":615
22796  *
22797  *
22798  *     def is_c_contig(self):             # <<<<<<<<<<<<<<
22799  *         cdef __Pyx_memviewslice *mslice
22800  *         cdef __Pyx_memviewslice tmp
22801  */
22802 
22803   /* function exit code */
22804   __pyx_L1_error:;
22805   __Pyx_XDECREF(__pyx_t_1);
22806   __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
22807   __pyx_r = NULL;
22808   __pyx_L0:;
22809   __Pyx_XGIVEREF(__pyx_r);
22810   __Pyx_RefNannyFinishContext();
22811   return __pyx_r;
22812 }
22813 
22814 /* "View.MemoryView":621
22815  *         return slice_is_contig(mslice[0], 'C', self.view.ndim)
22816  *
22817  *     def is_f_contig(self):             # <<<<<<<<<<<<<<
22818  *         cdef __Pyx_memviewslice *mslice
22819  *         cdef __Pyx_memviewslice tmp
22820  */
22821 
22822 /* Python wrapper */
22823 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)22824 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
22825   PyObject *__pyx_r = 0;
22826   __Pyx_RefNannyDeclarations
22827   __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
22828   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
22829 
22830   /* function exit code */
22831   __Pyx_RefNannyFinishContext();
22832   return __pyx_r;
22833 }
22834 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj * __pyx_v_self)22835 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
22836   __Pyx_memviewslice *__pyx_v_mslice;
22837   __Pyx_memviewslice __pyx_v_tmp;
22838   PyObject *__pyx_r = NULL;
22839   __Pyx_RefNannyDeclarations
22840   PyObject *__pyx_t_1 = NULL;
22841   __Pyx_RefNannySetupContext("is_f_contig", 0);
22842 
22843   /* "View.MemoryView":624
22844  *         cdef __Pyx_memviewslice *mslice
22845  *         cdef __Pyx_memviewslice tmp
22846  *         mslice = get_slice_from_memview(self, &tmp)             # <<<<<<<<<<<<<<
22847  *         return slice_is_contig(mslice[0], 'F', self.view.ndim)
22848  *
22849  */
22850   __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
22851 
22852   /* "View.MemoryView":625
22853  *         cdef __Pyx_memviewslice tmp
22854  *         mslice = get_slice_from_memview(self, &tmp)
22855  *         return slice_is_contig(mslice[0], 'F', self.view.ndim)             # <<<<<<<<<<<<<<
22856  *
22857  *     def copy(self):
22858  */
22859   __Pyx_XDECREF(__pyx_r);
22860   __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 625, __pyx_L1_error)
22861   __Pyx_GOTREF(__pyx_t_1);
22862   __pyx_r = __pyx_t_1;
22863   __pyx_t_1 = 0;
22864   goto __pyx_L0;
22865 
22866   /* "View.MemoryView":621
22867  *         return slice_is_contig(mslice[0], 'C', self.view.ndim)
22868  *
22869  *     def is_f_contig(self):             # <<<<<<<<<<<<<<
22870  *         cdef __Pyx_memviewslice *mslice
22871  *         cdef __Pyx_memviewslice tmp
22872  */
22873 
22874   /* function exit code */
22875   __pyx_L1_error:;
22876   __Pyx_XDECREF(__pyx_t_1);
22877   __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
22878   __pyx_r = NULL;
22879   __pyx_L0:;
22880   __Pyx_XGIVEREF(__pyx_r);
22881   __Pyx_RefNannyFinishContext();
22882   return __pyx_r;
22883 }
22884 
22885 /* "View.MemoryView":627
22886  *         return slice_is_contig(mslice[0], 'F', self.view.ndim)
22887  *
22888  *     def copy(self):             # <<<<<<<<<<<<<<
22889  *         cdef __Pyx_memviewslice mslice
22890  *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
22891  */
22892 
22893 /* Python wrapper */
22894 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)22895 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
22896   PyObject *__pyx_r = 0;
22897   __Pyx_RefNannyDeclarations
22898   __Pyx_RefNannySetupContext("copy (wrapper)", 0);
22899   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
22900 
22901   /* function exit code */
22902   __Pyx_RefNannyFinishContext();
22903   return __pyx_r;
22904 }
22905 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj * __pyx_v_self)22906 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
22907   __Pyx_memviewslice __pyx_v_mslice;
22908   int __pyx_v_flags;
22909   PyObject *__pyx_r = NULL;
22910   __Pyx_RefNannyDeclarations
22911   __Pyx_memviewslice __pyx_t_1;
22912   PyObject *__pyx_t_2 = NULL;
22913   __Pyx_RefNannySetupContext("copy", 0);
22914 
22915   /* "View.MemoryView":629
22916  *     def copy(self):
22917  *         cdef __Pyx_memviewslice mslice
22918  *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS             # <<<<<<<<<<<<<<
22919  *
22920  *         slice_copy(self, &mslice)
22921  */
22922   __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
22923 
22924   /* "View.MemoryView":631
22925  *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
22926  *
22927  *         slice_copy(self, &mslice)             # <<<<<<<<<<<<<<
22928  *         mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
22929  *                                    self.view.itemsize,
22930  */
22931   __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
22932 
22933   /* "View.MemoryView":632
22934  *
22935  *         slice_copy(self, &mslice)
22936  *         mslice = slice_copy_contig(&mslice, "c", self.view.ndim,             # <<<<<<<<<<<<<<
22937  *                                    self.view.itemsize,
22938  *                                    flags|PyBUF_C_CONTIGUOUS,
22939  */
22940   __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 632, __pyx_L1_error)
22941   __pyx_v_mslice = __pyx_t_1;
22942 
22943   /* "View.MemoryView":637
22944  *                                    self.dtype_is_object)
22945  *
22946  *         return memoryview_copy_from_slice(self, &mslice)             # <<<<<<<<<<<<<<
22947  *
22948  *     def copy_fortran(self):
22949  */
22950   __Pyx_XDECREF(__pyx_r);
22951   __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 637, __pyx_L1_error)
22952   __Pyx_GOTREF(__pyx_t_2);
22953   __pyx_r = __pyx_t_2;
22954   __pyx_t_2 = 0;
22955   goto __pyx_L0;
22956 
22957   /* "View.MemoryView":627
22958  *         return slice_is_contig(mslice[0], 'F', self.view.ndim)
22959  *
22960  *     def copy(self):             # <<<<<<<<<<<<<<
22961  *         cdef __Pyx_memviewslice mslice
22962  *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
22963  */
22964 
22965   /* function exit code */
22966   __pyx_L1_error:;
22967   __Pyx_XDECREF(__pyx_t_2);
22968   __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
22969   __pyx_r = NULL;
22970   __pyx_L0:;
22971   __Pyx_XGIVEREF(__pyx_r);
22972   __Pyx_RefNannyFinishContext();
22973   return __pyx_r;
22974 }
22975 
22976 /* "View.MemoryView":639
22977  *         return memoryview_copy_from_slice(self, &mslice)
22978  *
22979  *     def copy_fortran(self):             # <<<<<<<<<<<<<<
22980  *         cdef __Pyx_memviewslice src, dst
22981  *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
22982  */
22983 
22984 /* Python wrapper */
22985 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)22986 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
22987   PyObject *__pyx_r = 0;
22988   __Pyx_RefNannyDeclarations
22989   __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
22990   __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
22991 
22992   /* function exit code */
22993   __Pyx_RefNannyFinishContext();
22994   return __pyx_r;
22995 }
22996 
__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj * __pyx_v_self)22997 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
22998   __Pyx_memviewslice __pyx_v_src;
22999   __Pyx_memviewslice __pyx_v_dst;
23000   int __pyx_v_flags;
23001   PyObject *__pyx_r = NULL;
23002   __Pyx_RefNannyDeclarations
23003   __Pyx_memviewslice __pyx_t_1;
23004   PyObject *__pyx_t_2 = NULL;
23005   __Pyx_RefNannySetupContext("copy_fortran", 0);
23006 
23007   /* "View.MemoryView":641
23008  *     def copy_fortran(self):
23009  *         cdef __Pyx_memviewslice src, dst
23010  *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS             # <<<<<<<<<<<<<<
23011  *
23012  *         slice_copy(self, &src)
23013  */
23014   __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
23015 
23016   /* "View.MemoryView":643
23017  *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
23018  *
23019  *         slice_copy(self, &src)             # <<<<<<<<<<<<<<
23020  *         dst = slice_copy_contig(&src, "fortran", self.view.ndim,
23021  *                                 self.view.itemsize,
23022  */
23023   __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
23024 
23025   /* "View.MemoryView":644
23026  *
23027  *         slice_copy(self, &src)
23028  *         dst = slice_copy_contig(&src, "fortran", self.view.ndim,             # <<<<<<<<<<<<<<
23029  *                                 self.view.itemsize,
23030  *                                 flags|PyBUF_F_CONTIGUOUS,
23031  */
23032   __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 644, __pyx_L1_error)
23033   __pyx_v_dst = __pyx_t_1;
23034 
23035   /* "View.MemoryView":649
23036  *                                 self.dtype_is_object)
23037  *
23038  *         return memoryview_copy_from_slice(self, &dst)             # <<<<<<<<<<<<<<
23039  *
23040  *
23041  */
23042   __Pyx_XDECREF(__pyx_r);
23043   __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 649, __pyx_L1_error)
23044   __Pyx_GOTREF(__pyx_t_2);
23045   __pyx_r = __pyx_t_2;
23046   __pyx_t_2 = 0;
23047   goto __pyx_L0;
23048 
23049   /* "View.MemoryView":639
23050  *         return memoryview_copy_from_slice(self, &mslice)
23051  *
23052  *     def copy_fortran(self):             # <<<<<<<<<<<<<<
23053  *         cdef __Pyx_memviewslice src, dst
23054  *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
23055  */
23056 
23057   /* function exit code */
23058   __pyx_L1_error:;
23059   __Pyx_XDECREF(__pyx_t_2);
23060   __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
23061   __pyx_r = NULL;
23062   __pyx_L0:;
23063   __Pyx_XGIVEREF(__pyx_r);
23064   __Pyx_RefNannyFinishContext();
23065   return __pyx_r;
23066 }
23067 
23068 /* "(tree fragment)":1
23069  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
23070  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23071  * def __setstate_cython__(self, __pyx_state):
23072  */
23073 
23074 /* Python wrapper */
23075 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)23076 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
23077   PyObject *__pyx_r = 0;
23078   __Pyx_RefNannyDeclarations
23079   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
23080   __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
23081 
23082   /* function exit code */
23083   __Pyx_RefNannyFinishContext();
23084   return __pyx_r;
23085 }
23086 
__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj * __pyx_v_self)23087 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
23088   PyObject *__pyx_r = NULL;
23089   __Pyx_RefNannyDeclarations
23090   PyObject *__pyx_t_1 = NULL;
23091   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
23092 
23093   /* "(tree fragment)":2
23094  * def __reduce_cython__(self):
23095  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
23096  * def __setstate_cython__(self, __pyx_state):
23097  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23098  */
23099   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
23100   __Pyx_GOTREF(__pyx_t_1);
23101   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
23102   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23103   __PYX_ERR(1, 2, __pyx_L1_error)
23104 
23105   /* "(tree fragment)":1
23106  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
23107  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23108  * def __setstate_cython__(self, __pyx_state):
23109  */
23110 
23111   /* function exit code */
23112   __pyx_L1_error:;
23113   __Pyx_XDECREF(__pyx_t_1);
23114   __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
23115   __pyx_r = NULL;
23116   __Pyx_XGIVEREF(__pyx_r);
23117   __Pyx_RefNannyFinishContext();
23118   return __pyx_r;
23119 }
23120 
23121 /* "(tree fragment)":3
23122  * def __reduce_cython__(self):
23123  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23124  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
23125  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23126  */
23127 
23128 /* Python wrapper */
23129 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)23130 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
23131   PyObject *__pyx_r = 0;
23132   __Pyx_RefNannyDeclarations
23133   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
23134   __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
23135 
23136   /* function exit code */
23137   __Pyx_RefNannyFinishContext();
23138   return __pyx_r;
23139 }
23140 
__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)23141 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) {
23142   PyObject *__pyx_r = NULL;
23143   __Pyx_RefNannyDeclarations
23144   PyObject *__pyx_t_1 = NULL;
23145   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
23146 
23147   /* "(tree fragment)":4
23148  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23149  * def __setstate_cython__(self, __pyx_state):
23150  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
23151  */
23152   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
23153   __Pyx_GOTREF(__pyx_t_1);
23154   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
23155   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23156   __PYX_ERR(1, 4, __pyx_L1_error)
23157 
23158   /* "(tree fragment)":3
23159  * def __reduce_cython__(self):
23160  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23161  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
23162  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
23163  */
23164 
23165   /* function exit code */
23166   __pyx_L1_error:;
23167   __Pyx_XDECREF(__pyx_t_1);
23168   __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
23169   __pyx_r = NULL;
23170   __Pyx_XGIVEREF(__pyx_r);
23171   __Pyx_RefNannyFinishContext();
23172   return __pyx_r;
23173 }
23174 
23175 /* "View.MemoryView":653
23176  *
23177  * @cname('__pyx_memoryview_new')
23178  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):             # <<<<<<<<<<<<<<
23179  *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
23180  *     result.typeinfo = typeinfo
23181  */
23182 
__pyx_memoryview_new(PyObject * __pyx_v_o,int __pyx_v_flags,int __pyx_v_dtype_is_object,__Pyx_TypeInfo * __pyx_v_typeinfo)23183 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
23184   struct __pyx_memoryview_obj *__pyx_v_result = 0;
23185   PyObject *__pyx_r = NULL;
23186   __Pyx_RefNannyDeclarations
23187   PyObject *__pyx_t_1 = NULL;
23188   PyObject *__pyx_t_2 = NULL;
23189   PyObject *__pyx_t_3 = NULL;
23190   __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
23191 
23192   /* "View.MemoryView":654
23193  * @cname('__pyx_memoryview_new')
23194  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
23195  *     cdef memoryview result = memoryview(o, flags, dtype_is_object)             # <<<<<<<<<<<<<<
23196  *     result.typeinfo = typeinfo
23197  *     return result
23198  */
23199   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 654, __pyx_L1_error)
23200   __Pyx_GOTREF(__pyx_t_1);
23201   __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 654, __pyx_L1_error)
23202   __Pyx_GOTREF(__pyx_t_2);
23203   __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 654, __pyx_L1_error)
23204   __Pyx_GOTREF(__pyx_t_3);
23205   __Pyx_INCREF(__pyx_v_o);
23206   __Pyx_GIVEREF(__pyx_v_o);
23207   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
23208   __Pyx_GIVEREF(__pyx_t_1);
23209   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
23210   __Pyx_GIVEREF(__pyx_t_2);
23211   PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
23212   __pyx_t_1 = 0;
23213   __pyx_t_2 = 0;
23214   __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 654, __pyx_L1_error)
23215   __Pyx_GOTREF(__pyx_t_2);
23216   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23217   __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
23218   __pyx_t_2 = 0;
23219 
23220   /* "View.MemoryView":655
23221  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
23222  *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
23223  *     result.typeinfo = typeinfo             # <<<<<<<<<<<<<<
23224  *     return result
23225  *
23226  */
23227   __pyx_v_result->typeinfo = __pyx_v_typeinfo;
23228 
23229   /* "View.MemoryView":656
23230  *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
23231  *     result.typeinfo = typeinfo
23232  *     return result             # <<<<<<<<<<<<<<
23233  *
23234  * @cname('__pyx_memoryview_check')
23235  */
23236   __Pyx_XDECREF(__pyx_r);
23237   __Pyx_INCREF(((PyObject *)__pyx_v_result));
23238   __pyx_r = ((PyObject *)__pyx_v_result);
23239   goto __pyx_L0;
23240 
23241   /* "View.MemoryView":653
23242  *
23243  * @cname('__pyx_memoryview_new')
23244  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):             # <<<<<<<<<<<<<<
23245  *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
23246  *     result.typeinfo = typeinfo
23247  */
23248 
23249   /* function exit code */
23250   __pyx_L1_error:;
23251   __Pyx_XDECREF(__pyx_t_1);
23252   __Pyx_XDECREF(__pyx_t_2);
23253   __Pyx_XDECREF(__pyx_t_3);
23254   __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
23255   __pyx_r = 0;
23256   __pyx_L0:;
23257   __Pyx_XDECREF((PyObject *)__pyx_v_result);
23258   __Pyx_XGIVEREF(__pyx_r);
23259   __Pyx_RefNannyFinishContext();
23260   return __pyx_r;
23261 }
23262 
23263 /* "View.MemoryView":659
23264  *
23265  * @cname('__pyx_memoryview_check')
23266  * cdef inline bint memoryview_check(object o):             # <<<<<<<<<<<<<<
23267  *     return isinstance(o, memoryview)
23268  *
23269  */
23270 
__pyx_memoryview_check(PyObject * __pyx_v_o)23271 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
23272   int __pyx_r;
23273   __Pyx_RefNannyDeclarations
23274   int __pyx_t_1;
23275   __Pyx_RefNannySetupContext("memoryview_check", 0);
23276 
23277   /* "View.MemoryView":660
23278  * @cname('__pyx_memoryview_check')
23279  * cdef inline bint memoryview_check(object o):
23280  *     return isinstance(o, memoryview)             # <<<<<<<<<<<<<<
23281  *
23282  * cdef tuple _unellipsify(object index, int ndim):
23283  */
23284   __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
23285   __pyx_r = __pyx_t_1;
23286   goto __pyx_L0;
23287 
23288   /* "View.MemoryView":659
23289  *
23290  * @cname('__pyx_memoryview_check')
23291  * cdef inline bint memoryview_check(object o):             # <<<<<<<<<<<<<<
23292  *     return isinstance(o, memoryview)
23293  *
23294  */
23295 
23296   /* function exit code */
23297   __pyx_L0:;
23298   __Pyx_RefNannyFinishContext();
23299   return __pyx_r;
23300 }
23301 
23302 /* "View.MemoryView":662
23303  *     return isinstance(o, memoryview)
23304  *
23305  * cdef tuple _unellipsify(object index, int ndim):             # <<<<<<<<<<<<<<
23306  *     """
23307  *     Replace all ellipses with full slices and fill incomplete indices with
23308  */
23309 
_unellipsify(PyObject * __pyx_v_index,int __pyx_v_ndim)23310 static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
23311   PyObject *__pyx_v_tup = NULL;
23312   PyObject *__pyx_v_result = NULL;
23313   int __pyx_v_have_slices;
23314   int __pyx_v_seen_ellipsis;
23315   CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
23316   PyObject *__pyx_v_item = NULL;
23317   Py_ssize_t __pyx_v_nslices;
23318   PyObject *__pyx_r = NULL;
23319   __Pyx_RefNannyDeclarations
23320   int __pyx_t_1;
23321   int __pyx_t_2;
23322   PyObject *__pyx_t_3 = NULL;
23323   PyObject *__pyx_t_4 = NULL;
23324   Py_ssize_t __pyx_t_5;
23325   PyObject *(*__pyx_t_6)(PyObject *);
23326   PyObject *__pyx_t_7 = NULL;
23327   Py_ssize_t __pyx_t_8;
23328   int __pyx_t_9;
23329   int __pyx_t_10;
23330   PyObject *__pyx_t_11 = NULL;
23331   __Pyx_RefNannySetupContext("_unellipsify", 0);
23332 
23333   /* "View.MemoryView":667
23334  *     full slices.
23335  *     """
23336  *     if not isinstance(index, tuple):             # <<<<<<<<<<<<<<
23337  *         tup = (index,)
23338  *     else:
23339  */
23340   __pyx_t_1 = PyTuple_Check(__pyx_v_index);
23341   __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
23342   if (__pyx_t_2) {
23343 
23344     /* "View.MemoryView":668
23345  *     """
23346  *     if not isinstance(index, tuple):
23347  *         tup = (index,)             # <<<<<<<<<<<<<<
23348  *     else:
23349  *         tup = index
23350  */
23351     __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 668, __pyx_L1_error)
23352     __Pyx_GOTREF(__pyx_t_3);
23353     __Pyx_INCREF(__pyx_v_index);
23354     __Pyx_GIVEREF(__pyx_v_index);
23355     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
23356     __pyx_v_tup = __pyx_t_3;
23357     __pyx_t_3 = 0;
23358 
23359     /* "View.MemoryView":667
23360  *     full slices.
23361  *     """
23362  *     if not isinstance(index, tuple):             # <<<<<<<<<<<<<<
23363  *         tup = (index,)
23364  *     else:
23365  */
23366     goto __pyx_L3;
23367   }
23368 
23369   /* "View.MemoryView":670
23370  *         tup = (index,)
23371  *     else:
23372  *         tup = index             # <<<<<<<<<<<<<<
23373  *
23374  *     result = []
23375  */
23376   /*else*/ {
23377     __Pyx_INCREF(__pyx_v_index);
23378     __pyx_v_tup = __pyx_v_index;
23379   }
23380   __pyx_L3:;
23381 
23382   /* "View.MemoryView":672
23383  *         tup = index
23384  *
23385  *     result = []             # <<<<<<<<<<<<<<
23386  *     have_slices = False
23387  *     seen_ellipsis = False
23388  */
23389   __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 672, __pyx_L1_error)
23390   __Pyx_GOTREF(__pyx_t_3);
23391   __pyx_v_result = ((PyObject*)__pyx_t_3);
23392   __pyx_t_3 = 0;
23393 
23394   /* "View.MemoryView":673
23395  *
23396  *     result = []
23397  *     have_slices = False             # <<<<<<<<<<<<<<
23398  *     seen_ellipsis = False
23399  *     for idx, item in enumerate(tup):
23400  */
23401   __pyx_v_have_slices = 0;
23402 
23403   /* "View.MemoryView":674
23404  *     result = []
23405  *     have_slices = False
23406  *     seen_ellipsis = False             # <<<<<<<<<<<<<<
23407  *     for idx, item in enumerate(tup):
23408  *         if item is Ellipsis:
23409  */
23410   __pyx_v_seen_ellipsis = 0;
23411 
23412   /* "View.MemoryView":675
23413  *     have_slices = False
23414  *     seen_ellipsis = False
23415  *     for idx, item in enumerate(tup):             # <<<<<<<<<<<<<<
23416  *         if item is Ellipsis:
23417  *             if not seen_ellipsis:
23418  */
23419   __Pyx_INCREF(__pyx_int_0);
23420   __pyx_t_3 = __pyx_int_0;
23421   if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
23422     __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
23423     __pyx_t_6 = NULL;
23424   } else {
23425     __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 675, __pyx_L1_error)
23426     __Pyx_GOTREF(__pyx_t_4);
23427     __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 675, __pyx_L1_error)
23428   }
23429   for (;;) {
23430     if (likely(!__pyx_t_6)) {
23431       if (likely(PyList_CheckExact(__pyx_t_4))) {
23432         if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
23433         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
23434         __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 675, __pyx_L1_error)
23435         #else
23436         __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __pyx_L1_error)
23437         __Pyx_GOTREF(__pyx_t_7);
23438         #endif
23439       } else {
23440         if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
23441         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
23442         __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 675, __pyx_L1_error)
23443         #else
23444         __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __pyx_L1_error)
23445         __Pyx_GOTREF(__pyx_t_7);
23446         #endif
23447       }
23448     } else {
23449       __pyx_t_7 = __pyx_t_6(__pyx_t_4);
23450       if (unlikely(!__pyx_t_7)) {
23451         PyObject* exc_type = PyErr_Occurred();
23452         if (exc_type) {
23453           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
23454           else __PYX_ERR(1, 675, __pyx_L1_error)
23455         }
23456         break;
23457       }
23458       __Pyx_GOTREF(__pyx_t_7);
23459     }
23460     __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
23461     __pyx_t_7 = 0;
23462     __Pyx_INCREF(__pyx_t_3);
23463     __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
23464     __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __pyx_L1_error)
23465     __Pyx_GOTREF(__pyx_t_7);
23466     __Pyx_DECREF(__pyx_t_3);
23467     __pyx_t_3 = __pyx_t_7;
23468     __pyx_t_7 = 0;
23469 
23470     /* "View.MemoryView":676
23471  *     seen_ellipsis = False
23472  *     for idx, item in enumerate(tup):
23473  *         if item is Ellipsis:             # <<<<<<<<<<<<<<
23474  *             if not seen_ellipsis:
23475  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
23476  */
23477     __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
23478     __pyx_t_1 = (__pyx_t_2 != 0);
23479     if (__pyx_t_1) {
23480 
23481       /* "View.MemoryView":677
23482  *     for idx, item in enumerate(tup):
23483  *         if item is Ellipsis:
23484  *             if not seen_ellipsis:             # <<<<<<<<<<<<<<
23485  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
23486  *                 seen_ellipsis = True
23487  */
23488       __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
23489       if (__pyx_t_1) {
23490 
23491         /* "View.MemoryView":678
23492  *         if item is Ellipsis:
23493  *             if not seen_ellipsis:
23494  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))             # <<<<<<<<<<<<<<
23495  *                 seen_ellipsis = True
23496  *             else:
23497  */
23498         __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 678, __pyx_L1_error)
23499         __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 678, __pyx_L1_error)
23500         __Pyx_GOTREF(__pyx_t_7);
23501         { Py_ssize_t __pyx_temp;
23502           for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
23503             __Pyx_INCREF(__pyx_slice_);
23504             __Pyx_GIVEREF(__pyx_slice_);
23505             PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice_);
23506           }
23507         }
23508         __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 678, __pyx_L1_error)
23509         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
23510 
23511         /* "View.MemoryView":679
23512  *             if not seen_ellipsis:
23513  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
23514  *                 seen_ellipsis = True             # <<<<<<<<<<<<<<
23515  *             else:
23516  *                 result.append(slice(None))
23517  */
23518         __pyx_v_seen_ellipsis = 1;
23519 
23520         /* "View.MemoryView":677
23521  *     for idx, item in enumerate(tup):
23522  *         if item is Ellipsis:
23523  *             if not seen_ellipsis:             # <<<<<<<<<<<<<<
23524  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
23525  *                 seen_ellipsis = True
23526  */
23527         goto __pyx_L7;
23528       }
23529 
23530       /* "View.MemoryView":681
23531  *                 seen_ellipsis = True
23532  *             else:
23533  *                 result.append(slice(None))             # <<<<<<<<<<<<<<
23534  *             have_slices = True
23535  *         else:
23536  */
23537       /*else*/ {
23538         __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice_); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 681, __pyx_L1_error)
23539       }
23540       __pyx_L7:;
23541 
23542       /* "View.MemoryView":682
23543  *             else:
23544  *                 result.append(slice(None))
23545  *             have_slices = True             # <<<<<<<<<<<<<<
23546  *         else:
23547  *             if not isinstance(item, slice) and not PyIndex_Check(item):
23548  */
23549       __pyx_v_have_slices = 1;
23550 
23551       /* "View.MemoryView":676
23552  *     seen_ellipsis = False
23553  *     for idx, item in enumerate(tup):
23554  *         if item is Ellipsis:             # <<<<<<<<<<<<<<
23555  *             if not seen_ellipsis:
23556  *                 result.extend([slice(None)] * (ndim - len(tup) + 1))
23557  */
23558       goto __pyx_L6;
23559     }
23560 
23561     /* "View.MemoryView":684
23562  *             have_slices = True
23563  *         else:
23564  *             if not isinstance(item, slice) and not PyIndex_Check(item):             # <<<<<<<<<<<<<<
23565  *                 raise TypeError("Cannot index with type '%s'" % type(item))
23566  *
23567  */
23568     /*else*/ {
23569       __pyx_t_2 = PySlice_Check(__pyx_v_item);
23570       __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
23571       if (__pyx_t_10) {
23572       } else {
23573         __pyx_t_1 = __pyx_t_10;
23574         goto __pyx_L9_bool_binop_done;
23575       }
23576       __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
23577       __pyx_t_1 = __pyx_t_10;
23578       __pyx_L9_bool_binop_done:;
23579       if (unlikely(__pyx_t_1)) {
23580 
23581         /* "View.MemoryView":685
23582  *         else:
23583  *             if not isinstance(item, slice) and not PyIndex_Check(item):
23584  *                 raise TypeError("Cannot index with type '%s'" % type(item))             # <<<<<<<<<<<<<<
23585  *
23586  *             have_slices = have_slices or isinstance(item, slice)
23587  */
23588         __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 685, __pyx_L1_error)
23589         __Pyx_GOTREF(__pyx_t_7);
23590         __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 685, __pyx_L1_error)
23591         __Pyx_GOTREF(__pyx_t_11);
23592         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
23593         __Pyx_Raise(__pyx_t_11, 0, 0, 0);
23594         __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
23595         __PYX_ERR(1, 685, __pyx_L1_error)
23596 
23597         /* "View.MemoryView":684
23598  *             have_slices = True
23599  *         else:
23600  *             if not isinstance(item, slice) and not PyIndex_Check(item):             # <<<<<<<<<<<<<<
23601  *                 raise TypeError("Cannot index with type '%s'" % type(item))
23602  *
23603  */
23604       }
23605 
23606       /* "View.MemoryView":687
23607  *                 raise TypeError("Cannot index with type '%s'" % type(item))
23608  *
23609  *             have_slices = have_slices or isinstance(item, slice)             # <<<<<<<<<<<<<<
23610  *             result.append(item)
23611  *
23612  */
23613       __pyx_t_10 = (__pyx_v_have_slices != 0);
23614       if (!__pyx_t_10) {
23615       } else {
23616         __pyx_t_1 = __pyx_t_10;
23617         goto __pyx_L11_bool_binop_done;
23618       }
23619       __pyx_t_10 = PySlice_Check(__pyx_v_item);
23620       __pyx_t_2 = (__pyx_t_10 != 0);
23621       __pyx_t_1 = __pyx_t_2;
23622       __pyx_L11_bool_binop_done:;
23623       __pyx_v_have_slices = __pyx_t_1;
23624 
23625       /* "View.MemoryView":688
23626  *
23627  *             have_slices = have_slices or isinstance(item, slice)
23628  *             result.append(item)             # <<<<<<<<<<<<<<
23629  *
23630  *     nslices = ndim - len(result)
23631  */
23632       __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 688, __pyx_L1_error)
23633     }
23634     __pyx_L6:;
23635 
23636     /* "View.MemoryView":675
23637  *     have_slices = False
23638  *     seen_ellipsis = False
23639  *     for idx, item in enumerate(tup):             # <<<<<<<<<<<<<<
23640  *         if item is Ellipsis:
23641  *             if not seen_ellipsis:
23642  */
23643   }
23644   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23645   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23646 
23647   /* "View.MemoryView":690
23648  *             result.append(item)
23649  *
23650  *     nslices = ndim - len(result)             # <<<<<<<<<<<<<<
23651  *     if nslices:
23652  *         result.extend([slice(None)] * nslices)
23653  */
23654   __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 690, __pyx_L1_error)
23655   __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
23656 
23657   /* "View.MemoryView":691
23658  *
23659  *     nslices = ndim - len(result)
23660  *     if nslices:             # <<<<<<<<<<<<<<
23661  *         result.extend([slice(None)] * nslices)
23662  *
23663  */
23664   __pyx_t_1 = (__pyx_v_nslices != 0);
23665   if (__pyx_t_1) {
23666 
23667     /* "View.MemoryView":692
23668  *     nslices = ndim - len(result)
23669  *     if nslices:
23670  *         result.extend([slice(None)] * nslices)             # <<<<<<<<<<<<<<
23671  *
23672  *     return have_slices or nslices, tuple(result)
23673  */
23674     __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 692, __pyx_L1_error)
23675     __Pyx_GOTREF(__pyx_t_3);
23676     { Py_ssize_t __pyx_temp;
23677       for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
23678         __Pyx_INCREF(__pyx_slice_);
23679         __Pyx_GIVEREF(__pyx_slice_);
23680         PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice_);
23681       }
23682     }
23683     __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 692, __pyx_L1_error)
23684     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23685 
23686     /* "View.MemoryView":691
23687  *
23688  *     nslices = ndim - len(result)
23689  *     if nslices:             # <<<<<<<<<<<<<<
23690  *         result.extend([slice(None)] * nslices)
23691  *
23692  */
23693   }
23694 
23695   /* "View.MemoryView":694
23696  *         result.extend([slice(None)] * nslices)
23697  *
23698  *     return have_slices or nslices, tuple(result)             # <<<<<<<<<<<<<<
23699  *
23700  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
23701  */
23702   __Pyx_XDECREF(__pyx_r);
23703   if (!__pyx_v_have_slices) {
23704   } else {
23705     __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 694, __pyx_L1_error)
23706     __Pyx_GOTREF(__pyx_t_4);
23707     __pyx_t_3 = __pyx_t_4;
23708     __pyx_t_4 = 0;
23709     goto __pyx_L14_bool_binop_done;
23710   }
23711   __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 694, __pyx_L1_error)
23712   __Pyx_GOTREF(__pyx_t_4);
23713   __pyx_t_3 = __pyx_t_4;
23714   __pyx_t_4 = 0;
23715   __pyx_L14_bool_binop_done:;
23716   __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 694, __pyx_L1_error)
23717   __Pyx_GOTREF(__pyx_t_4);
23718   __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 694, __pyx_L1_error)
23719   __Pyx_GOTREF(__pyx_t_11);
23720   __Pyx_GIVEREF(__pyx_t_3);
23721   PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
23722   __Pyx_GIVEREF(__pyx_t_4);
23723   PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
23724   __pyx_t_3 = 0;
23725   __pyx_t_4 = 0;
23726   __pyx_r = ((PyObject*)__pyx_t_11);
23727   __pyx_t_11 = 0;
23728   goto __pyx_L0;
23729 
23730   /* "View.MemoryView":662
23731  *     return isinstance(o, memoryview)
23732  *
23733  * cdef tuple _unellipsify(object index, int ndim):             # <<<<<<<<<<<<<<
23734  *     """
23735  *     Replace all ellipses with full slices and fill incomplete indices with
23736  */
23737 
23738   /* function exit code */
23739   __pyx_L1_error:;
23740   __Pyx_XDECREF(__pyx_t_3);
23741   __Pyx_XDECREF(__pyx_t_4);
23742   __Pyx_XDECREF(__pyx_t_7);
23743   __Pyx_XDECREF(__pyx_t_11);
23744   __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
23745   __pyx_r = 0;
23746   __pyx_L0:;
23747   __Pyx_XDECREF(__pyx_v_tup);
23748   __Pyx_XDECREF(__pyx_v_result);
23749   __Pyx_XDECREF(__pyx_v_idx);
23750   __Pyx_XDECREF(__pyx_v_item);
23751   __Pyx_XGIVEREF(__pyx_r);
23752   __Pyx_RefNannyFinishContext();
23753   return __pyx_r;
23754 }
23755 
23756 /* "View.MemoryView":696
23757  *     return have_slices or nslices, tuple(result)
23758  *
23759  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):             # <<<<<<<<<<<<<<
23760  *     for suboffset in suboffsets[:ndim]:
23761  *         if suboffset >= 0:
23762  */
23763 
assert_direct_dimensions(Py_ssize_t * __pyx_v_suboffsets,int __pyx_v_ndim)23764 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
23765   Py_ssize_t __pyx_v_suboffset;
23766   PyObject *__pyx_r = NULL;
23767   __Pyx_RefNannyDeclarations
23768   Py_ssize_t *__pyx_t_1;
23769   Py_ssize_t *__pyx_t_2;
23770   Py_ssize_t *__pyx_t_3;
23771   int __pyx_t_4;
23772   PyObject *__pyx_t_5 = NULL;
23773   __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
23774 
23775   /* "View.MemoryView":697
23776  *
23777  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
23778  *     for suboffset in suboffsets[:ndim]:             # <<<<<<<<<<<<<<
23779  *         if suboffset >= 0:
23780  *             raise ValueError("Indirect dimensions not supported")
23781  */
23782   __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
23783   for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
23784     __pyx_t_1 = __pyx_t_3;
23785     __pyx_v_suboffset = (__pyx_t_1[0]);
23786 
23787     /* "View.MemoryView":698
23788  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
23789  *     for suboffset in suboffsets[:ndim]:
23790  *         if suboffset >= 0:             # <<<<<<<<<<<<<<
23791  *             raise ValueError("Indirect dimensions not supported")
23792  *
23793  */
23794     __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
23795     if (unlikely(__pyx_t_4)) {
23796 
23797       /* "View.MemoryView":699
23798  *     for suboffset in suboffsets[:ndim]:
23799  *         if suboffset >= 0:
23800  *             raise ValueError("Indirect dimensions not supported")             # <<<<<<<<<<<<<<
23801  *
23802  *
23803  */
23804       __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 699, __pyx_L1_error)
23805       __Pyx_GOTREF(__pyx_t_5);
23806       __Pyx_Raise(__pyx_t_5, 0, 0, 0);
23807       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
23808       __PYX_ERR(1, 699, __pyx_L1_error)
23809 
23810       /* "View.MemoryView":698
23811  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
23812  *     for suboffset in suboffsets[:ndim]:
23813  *         if suboffset >= 0:             # <<<<<<<<<<<<<<
23814  *             raise ValueError("Indirect dimensions not supported")
23815  *
23816  */
23817     }
23818   }
23819 
23820   /* "View.MemoryView":696
23821  *     return have_slices or nslices, tuple(result)
23822  *
23823  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):             # <<<<<<<<<<<<<<
23824  *     for suboffset in suboffsets[:ndim]:
23825  *         if suboffset >= 0:
23826  */
23827 
23828   /* function exit code */
23829   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
23830   goto __pyx_L0;
23831   __pyx_L1_error:;
23832   __Pyx_XDECREF(__pyx_t_5);
23833   __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
23834   __pyx_r = 0;
23835   __pyx_L0:;
23836   __Pyx_XGIVEREF(__pyx_r);
23837   __Pyx_RefNannyFinishContext();
23838   return __pyx_r;
23839 }
23840 
23841 /* "View.MemoryView":706
23842  *
23843  * @cname('__pyx_memview_slice')
23844  * cdef memoryview memview_slice(memoryview memview, object indices):             # <<<<<<<<<<<<<<
23845  *     cdef int new_ndim = 0, suboffset_dim = -1, dim
23846  *     cdef bint negative_step
23847  */
23848 
__pyx_memview_slice(struct __pyx_memoryview_obj * __pyx_v_memview,PyObject * __pyx_v_indices)23849 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
23850   int __pyx_v_new_ndim;
23851   int __pyx_v_suboffset_dim;
23852   int __pyx_v_dim;
23853   __Pyx_memviewslice __pyx_v_src;
23854   __Pyx_memviewslice __pyx_v_dst;
23855   __Pyx_memviewslice *__pyx_v_p_src;
23856   struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
23857   __Pyx_memviewslice *__pyx_v_p_dst;
23858   int *__pyx_v_p_suboffset_dim;
23859   Py_ssize_t __pyx_v_start;
23860   Py_ssize_t __pyx_v_stop;
23861   Py_ssize_t __pyx_v_step;
23862   int __pyx_v_have_start;
23863   int __pyx_v_have_stop;
23864   int __pyx_v_have_step;
23865   PyObject *__pyx_v_index = NULL;
23866   struct __pyx_memoryview_obj *__pyx_r = NULL;
23867   __Pyx_RefNannyDeclarations
23868   int __pyx_t_1;
23869   int __pyx_t_2;
23870   PyObject *__pyx_t_3 = NULL;
23871   struct __pyx_memoryview_obj *__pyx_t_4;
23872   char *__pyx_t_5;
23873   int __pyx_t_6;
23874   Py_ssize_t __pyx_t_7;
23875   PyObject *(*__pyx_t_8)(PyObject *);
23876   PyObject *__pyx_t_9 = NULL;
23877   Py_ssize_t __pyx_t_10;
23878   int __pyx_t_11;
23879   Py_ssize_t __pyx_t_12;
23880   __Pyx_RefNannySetupContext("memview_slice", 0);
23881 
23882   /* "View.MemoryView":707
23883  * @cname('__pyx_memview_slice')
23884  * cdef memoryview memview_slice(memoryview memview, object indices):
23885  *     cdef int new_ndim = 0, suboffset_dim = -1, dim             # <<<<<<<<<<<<<<
23886  *     cdef bint negative_step
23887  *     cdef __Pyx_memviewslice src, dst
23888  */
23889   __pyx_v_new_ndim = 0;
23890   __pyx_v_suboffset_dim = -1;
23891 
23892   /* "View.MemoryView":714
23893  *
23894  *
23895  *     memset(&dst, 0, sizeof(dst))             # <<<<<<<<<<<<<<
23896  *
23897  *     cdef _memoryviewslice memviewsliceobj
23898  */
23899   (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
23900 
23901   /* "View.MemoryView":718
23902  *     cdef _memoryviewslice memviewsliceobj
23903  *
23904  *     assert memview.view.ndim > 0             # <<<<<<<<<<<<<<
23905  *
23906  *     if isinstance(memview, _memoryviewslice):
23907  */
23908   #ifndef CYTHON_WITHOUT_ASSERTIONS
23909   if (unlikely(!Py_OptimizeFlag)) {
23910     if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
23911       PyErr_SetNone(PyExc_AssertionError);
23912       __PYX_ERR(1, 718, __pyx_L1_error)
23913     }
23914   }
23915   #endif
23916 
23917   /* "View.MemoryView":720
23918  *     assert memview.view.ndim > 0
23919  *
23920  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
23921  *         memviewsliceobj = memview
23922  *         p_src = &memviewsliceobj.from_slice
23923  */
23924   __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
23925   __pyx_t_2 = (__pyx_t_1 != 0);
23926   if (__pyx_t_2) {
23927 
23928     /* "View.MemoryView":721
23929  *
23930  *     if isinstance(memview, _memoryviewslice):
23931  *         memviewsliceobj = memview             # <<<<<<<<<<<<<<
23932  *         p_src = &memviewsliceobj.from_slice
23933  *     else:
23934  */
23935     if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 721, __pyx_L1_error)
23936     __pyx_t_3 = ((PyObject *)__pyx_v_memview);
23937     __Pyx_INCREF(__pyx_t_3);
23938     __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
23939     __pyx_t_3 = 0;
23940 
23941     /* "View.MemoryView":722
23942  *     if isinstance(memview, _memoryviewslice):
23943  *         memviewsliceobj = memview
23944  *         p_src = &memviewsliceobj.from_slice             # <<<<<<<<<<<<<<
23945  *     else:
23946  *         slice_copy(memview, &src)
23947  */
23948     __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
23949 
23950     /* "View.MemoryView":720
23951  *     assert memview.view.ndim > 0
23952  *
23953  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
23954  *         memviewsliceobj = memview
23955  *         p_src = &memviewsliceobj.from_slice
23956  */
23957     goto __pyx_L3;
23958   }
23959 
23960   /* "View.MemoryView":724
23961  *         p_src = &memviewsliceobj.from_slice
23962  *     else:
23963  *         slice_copy(memview, &src)             # <<<<<<<<<<<<<<
23964  *         p_src = &src
23965  *
23966  */
23967   /*else*/ {
23968     __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
23969 
23970     /* "View.MemoryView":725
23971  *     else:
23972  *         slice_copy(memview, &src)
23973  *         p_src = &src             # <<<<<<<<<<<<<<
23974  *
23975  *
23976  */
23977     __pyx_v_p_src = (&__pyx_v_src);
23978   }
23979   __pyx_L3:;
23980 
23981   /* "View.MemoryView":731
23982  *
23983  *
23984  *     dst.memview = p_src.memview             # <<<<<<<<<<<<<<
23985  *     dst.data = p_src.data
23986  *
23987  */
23988   __pyx_t_4 = __pyx_v_p_src->memview;
23989   __pyx_v_dst.memview = __pyx_t_4;
23990 
23991   /* "View.MemoryView":732
23992  *
23993  *     dst.memview = p_src.memview
23994  *     dst.data = p_src.data             # <<<<<<<<<<<<<<
23995  *
23996  *
23997  */
23998   __pyx_t_5 = __pyx_v_p_src->data;
23999   __pyx_v_dst.data = __pyx_t_5;
24000 
24001   /* "View.MemoryView":737
24002  *
24003  *
24004  *     cdef __Pyx_memviewslice *p_dst = &dst             # <<<<<<<<<<<<<<
24005  *     cdef int *p_suboffset_dim = &suboffset_dim
24006  *     cdef Py_ssize_t start, stop, step
24007  */
24008   __pyx_v_p_dst = (&__pyx_v_dst);
24009 
24010   /* "View.MemoryView":738
24011  *
24012  *     cdef __Pyx_memviewslice *p_dst = &dst
24013  *     cdef int *p_suboffset_dim = &suboffset_dim             # <<<<<<<<<<<<<<
24014  *     cdef Py_ssize_t start, stop, step
24015  *     cdef bint have_start, have_stop, have_step
24016  */
24017   __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
24018 
24019   /* "View.MemoryView":742
24020  *     cdef bint have_start, have_stop, have_step
24021  *
24022  *     for dim, index in enumerate(indices):             # <<<<<<<<<<<<<<
24023  *         if PyIndex_Check(index):
24024  *             slice_memviewslice(
24025  */
24026   __pyx_t_6 = 0;
24027   if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
24028     __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
24029     __pyx_t_8 = NULL;
24030   } else {
24031     __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 742, __pyx_L1_error)
24032     __Pyx_GOTREF(__pyx_t_3);
24033     __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 742, __pyx_L1_error)
24034   }
24035   for (;;) {
24036     if (likely(!__pyx_t_8)) {
24037       if (likely(PyList_CheckExact(__pyx_t_3))) {
24038         if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
24039         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24040         __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 742, __pyx_L1_error)
24041         #else
24042         __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 742, __pyx_L1_error)
24043         __Pyx_GOTREF(__pyx_t_9);
24044         #endif
24045       } else {
24046         if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
24047         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24048         __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 742, __pyx_L1_error)
24049         #else
24050         __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 742, __pyx_L1_error)
24051         __Pyx_GOTREF(__pyx_t_9);
24052         #endif
24053       }
24054     } else {
24055       __pyx_t_9 = __pyx_t_8(__pyx_t_3);
24056       if (unlikely(!__pyx_t_9)) {
24057         PyObject* exc_type = PyErr_Occurred();
24058         if (exc_type) {
24059           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
24060           else __PYX_ERR(1, 742, __pyx_L1_error)
24061         }
24062         break;
24063       }
24064       __Pyx_GOTREF(__pyx_t_9);
24065     }
24066     __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
24067     __pyx_t_9 = 0;
24068     __pyx_v_dim = __pyx_t_6;
24069     __pyx_t_6 = (__pyx_t_6 + 1);
24070 
24071     /* "View.MemoryView":743
24072  *
24073  *     for dim, index in enumerate(indices):
24074  *         if PyIndex_Check(index):             # <<<<<<<<<<<<<<
24075  *             slice_memviewslice(
24076  *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
24077  */
24078     __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
24079     if (__pyx_t_2) {
24080 
24081       /* "View.MemoryView":747
24082  *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
24083  *                 dim, new_ndim, p_suboffset_dim,
24084  *                 index, 0, 0, # start, stop, step             # <<<<<<<<<<<<<<
24085  *                 0, 0, 0, # have_{start,stop,step}
24086  *                 False)
24087  */
24088       __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 747, __pyx_L1_error)
24089 
24090       /* "View.MemoryView":744
24091  *     for dim, index in enumerate(indices):
24092  *         if PyIndex_Check(index):
24093  *             slice_memviewslice(             # <<<<<<<<<<<<<<
24094  *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
24095  *                 dim, new_ndim, p_suboffset_dim,
24096  */
24097       __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 744, __pyx_L1_error)
24098 
24099       /* "View.MemoryView":743
24100  *
24101  *     for dim, index in enumerate(indices):
24102  *         if PyIndex_Check(index):             # <<<<<<<<<<<<<<
24103  *             slice_memviewslice(
24104  *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
24105  */
24106       goto __pyx_L6;
24107     }
24108 
24109     /* "View.MemoryView":750
24110  *                 0, 0, 0, # have_{start,stop,step}
24111  *                 False)
24112  *         elif index is None:             # <<<<<<<<<<<<<<
24113  *             p_dst.shape[new_ndim] = 1
24114  *             p_dst.strides[new_ndim] = 0
24115  */
24116     __pyx_t_2 = (__pyx_v_index == Py_None);
24117     __pyx_t_1 = (__pyx_t_2 != 0);
24118     if (__pyx_t_1) {
24119 
24120       /* "View.MemoryView":751
24121  *                 False)
24122  *         elif index is None:
24123  *             p_dst.shape[new_ndim] = 1             # <<<<<<<<<<<<<<
24124  *             p_dst.strides[new_ndim] = 0
24125  *             p_dst.suboffsets[new_ndim] = -1
24126  */
24127       (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
24128 
24129       /* "View.MemoryView":752
24130  *         elif index is None:
24131  *             p_dst.shape[new_ndim] = 1
24132  *             p_dst.strides[new_ndim] = 0             # <<<<<<<<<<<<<<
24133  *             p_dst.suboffsets[new_ndim] = -1
24134  *             new_ndim += 1
24135  */
24136       (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
24137 
24138       /* "View.MemoryView":753
24139  *             p_dst.shape[new_ndim] = 1
24140  *             p_dst.strides[new_ndim] = 0
24141  *             p_dst.suboffsets[new_ndim] = -1             # <<<<<<<<<<<<<<
24142  *             new_ndim += 1
24143  *         else:
24144  */
24145       (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
24146 
24147       /* "View.MemoryView":754
24148  *             p_dst.strides[new_ndim] = 0
24149  *             p_dst.suboffsets[new_ndim] = -1
24150  *             new_ndim += 1             # <<<<<<<<<<<<<<
24151  *         else:
24152  *             start = index.start or 0
24153  */
24154       __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
24155 
24156       /* "View.MemoryView":750
24157  *                 0, 0, 0, # have_{start,stop,step}
24158  *                 False)
24159  *         elif index is None:             # <<<<<<<<<<<<<<
24160  *             p_dst.shape[new_ndim] = 1
24161  *             p_dst.strides[new_ndim] = 0
24162  */
24163       goto __pyx_L6;
24164     }
24165 
24166     /* "View.MemoryView":756
24167  *             new_ndim += 1
24168  *         else:
24169  *             start = index.start or 0             # <<<<<<<<<<<<<<
24170  *             stop = index.stop or 0
24171  *             step = index.step or 0
24172  */
24173     /*else*/ {
24174       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 756, __pyx_L1_error)
24175       __Pyx_GOTREF(__pyx_t_9);
24176       __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 756, __pyx_L1_error)
24177       if (!__pyx_t_1) {
24178         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
24179       } else {
24180         __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 756, __pyx_L1_error)
24181         __pyx_t_10 = __pyx_t_12;
24182         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
24183         goto __pyx_L7_bool_binop_done;
24184       }
24185       __pyx_t_10 = 0;
24186       __pyx_L7_bool_binop_done:;
24187       __pyx_v_start = __pyx_t_10;
24188 
24189       /* "View.MemoryView":757
24190  *         else:
24191  *             start = index.start or 0
24192  *             stop = index.stop or 0             # <<<<<<<<<<<<<<
24193  *             step = index.step or 0
24194  *
24195  */
24196       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 757, __pyx_L1_error)
24197       __Pyx_GOTREF(__pyx_t_9);
24198       __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 757, __pyx_L1_error)
24199       if (!__pyx_t_1) {
24200         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
24201       } else {
24202         __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 757, __pyx_L1_error)
24203         __pyx_t_10 = __pyx_t_12;
24204         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
24205         goto __pyx_L9_bool_binop_done;
24206       }
24207       __pyx_t_10 = 0;
24208       __pyx_L9_bool_binop_done:;
24209       __pyx_v_stop = __pyx_t_10;
24210 
24211       /* "View.MemoryView":758
24212  *             start = index.start or 0
24213  *             stop = index.stop or 0
24214  *             step = index.step or 0             # <<<<<<<<<<<<<<
24215  *
24216  *             have_start = index.start is not None
24217  */
24218       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 758, __pyx_L1_error)
24219       __Pyx_GOTREF(__pyx_t_9);
24220       __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 758, __pyx_L1_error)
24221       if (!__pyx_t_1) {
24222         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
24223       } else {
24224         __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 758, __pyx_L1_error)
24225         __pyx_t_10 = __pyx_t_12;
24226         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
24227         goto __pyx_L11_bool_binop_done;
24228       }
24229       __pyx_t_10 = 0;
24230       __pyx_L11_bool_binop_done:;
24231       __pyx_v_step = __pyx_t_10;
24232 
24233       /* "View.MemoryView":760
24234  *             step = index.step or 0
24235  *
24236  *             have_start = index.start is not None             # <<<<<<<<<<<<<<
24237  *             have_stop = index.stop is not None
24238  *             have_step = index.step is not None
24239  */
24240       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 760, __pyx_L1_error)
24241       __Pyx_GOTREF(__pyx_t_9);
24242       __pyx_t_1 = (__pyx_t_9 != Py_None);
24243       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
24244       __pyx_v_have_start = __pyx_t_1;
24245 
24246       /* "View.MemoryView":761
24247  *
24248  *             have_start = index.start is not None
24249  *             have_stop = index.stop is not None             # <<<<<<<<<<<<<<
24250  *             have_step = index.step is not None
24251  *
24252  */
24253       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 761, __pyx_L1_error)
24254       __Pyx_GOTREF(__pyx_t_9);
24255       __pyx_t_1 = (__pyx_t_9 != Py_None);
24256       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
24257       __pyx_v_have_stop = __pyx_t_1;
24258 
24259       /* "View.MemoryView":762
24260  *             have_start = index.start is not None
24261  *             have_stop = index.stop is not None
24262  *             have_step = index.step is not None             # <<<<<<<<<<<<<<
24263  *
24264  *             slice_memviewslice(
24265  */
24266       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 762, __pyx_L1_error)
24267       __Pyx_GOTREF(__pyx_t_9);
24268       __pyx_t_1 = (__pyx_t_9 != Py_None);
24269       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
24270       __pyx_v_have_step = __pyx_t_1;
24271 
24272       /* "View.MemoryView":764
24273  *             have_step = index.step is not None
24274  *
24275  *             slice_memviewslice(             # <<<<<<<<<<<<<<
24276  *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
24277  *                 dim, new_ndim, p_suboffset_dim,
24278  */
24279       __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 764, __pyx_L1_error)
24280 
24281       /* "View.MemoryView":770
24282  *                 have_start, have_stop, have_step,
24283  *                 True)
24284  *             new_ndim += 1             # <<<<<<<<<<<<<<
24285  *
24286  *     if isinstance(memview, _memoryviewslice):
24287  */
24288       __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
24289     }
24290     __pyx_L6:;
24291 
24292     /* "View.MemoryView":742
24293  *     cdef bint have_start, have_stop, have_step
24294  *
24295  *     for dim, index in enumerate(indices):             # <<<<<<<<<<<<<<
24296  *         if PyIndex_Check(index):
24297  *             slice_memviewslice(
24298  */
24299   }
24300   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24301 
24302   /* "View.MemoryView":772
24303  *             new_ndim += 1
24304  *
24305  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
24306  *         return memoryview_fromslice(dst, new_ndim,
24307  *                                     memviewsliceobj.to_object_func,
24308  */
24309   __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
24310   __pyx_t_2 = (__pyx_t_1 != 0);
24311   if (__pyx_t_2) {
24312 
24313     /* "View.MemoryView":773
24314  *
24315  *     if isinstance(memview, _memoryviewslice):
24316  *         return memoryview_fromslice(dst, new_ndim,             # <<<<<<<<<<<<<<
24317  *                                     memviewsliceobj.to_object_func,
24318  *                                     memviewsliceobj.to_dtype_func,
24319  */
24320     __Pyx_XDECREF(((PyObject *)__pyx_r));
24321 
24322     /* "View.MemoryView":774
24323  *     if isinstance(memview, _memoryviewslice):
24324  *         return memoryview_fromslice(dst, new_ndim,
24325  *                                     memviewsliceobj.to_object_func,             # <<<<<<<<<<<<<<
24326  *                                     memviewsliceobj.to_dtype_func,
24327  *                                     memview.dtype_is_object)
24328  */
24329     if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 774, __pyx_L1_error) }
24330 
24331     /* "View.MemoryView":775
24332  *         return memoryview_fromslice(dst, new_ndim,
24333  *                                     memviewsliceobj.to_object_func,
24334  *                                     memviewsliceobj.to_dtype_func,             # <<<<<<<<<<<<<<
24335  *                                     memview.dtype_is_object)
24336  *     else:
24337  */
24338     if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 775, __pyx_L1_error) }
24339 
24340     /* "View.MemoryView":773
24341  *
24342  *     if isinstance(memview, _memoryviewslice):
24343  *         return memoryview_fromslice(dst, new_ndim,             # <<<<<<<<<<<<<<
24344  *                                     memviewsliceobj.to_object_func,
24345  *                                     memviewsliceobj.to_dtype_func,
24346  */
24347     __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 773, __pyx_L1_error)
24348     __Pyx_GOTREF(__pyx_t_3);
24349     if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 773, __pyx_L1_error)
24350     __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
24351     __pyx_t_3 = 0;
24352     goto __pyx_L0;
24353 
24354     /* "View.MemoryView":772
24355  *             new_ndim += 1
24356  *
24357  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
24358  *         return memoryview_fromslice(dst, new_ndim,
24359  *                                     memviewsliceobj.to_object_func,
24360  */
24361   }
24362 
24363   /* "View.MemoryView":778
24364  *                                     memview.dtype_is_object)
24365  *     else:
24366  *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,             # <<<<<<<<<<<<<<
24367  *                                     memview.dtype_is_object)
24368  *
24369  */
24370   /*else*/ {
24371     __Pyx_XDECREF(((PyObject *)__pyx_r));
24372 
24373     /* "View.MemoryView":779
24374  *     else:
24375  *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,
24376  *                                     memview.dtype_is_object)             # <<<<<<<<<<<<<<
24377  *
24378  *
24379  */
24380     __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 778, __pyx_L1_error)
24381     __Pyx_GOTREF(__pyx_t_3);
24382 
24383     /* "View.MemoryView":778
24384  *                                     memview.dtype_is_object)
24385  *     else:
24386  *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,             # <<<<<<<<<<<<<<
24387  *                                     memview.dtype_is_object)
24388  *
24389  */
24390     if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 778, __pyx_L1_error)
24391     __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
24392     __pyx_t_3 = 0;
24393     goto __pyx_L0;
24394   }
24395 
24396   /* "View.MemoryView":706
24397  *
24398  * @cname('__pyx_memview_slice')
24399  * cdef memoryview memview_slice(memoryview memview, object indices):             # <<<<<<<<<<<<<<
24400  *     cdef int new_ndim = 0, suboffset_dim = -1, dim
24401  *     cdef bint negative_step
24402  */
24403 
24404   /* function exit code */
24405   __pyx_L1_error:;
24406   __Pyx_XDECREF(__pyx_t_3);
24407   __Pyx_XDECREF(__pyx_t_9);
24408   __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
24409   __pyx_r = 0;
24410   __pyx_L0:;
24411   __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
24412   __Pyx_XDECREF(__pyx_v_index);
24413   __Pyx_XGIVEREF((PyObject *)__pyx_r);
24414   __Pyx_RefNannyFinishContext();
24415   return __pyx_r;
24416 }
24417 
24418 /* "View.MemoryView":803
24419  *
24420  * @cname('__pyx_memoryview_slice_memviewslice')
24421  * cdef int slice_memviewslice(             # <<<<<<<<<<<<<<
24422  *         __Pyx_memviewslice *dst,
24423  *         Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
24424  */
24425 
__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)24426 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) {
24427   Py_ssize_t __pyx_v_new_shape;
24428   int __pyx_v_negative_step;
24429   int __pyx_r;
24430   int __pyx_t_1;
24431   int __pyx_t_2;
24432   int __pyx_t_3;
24433 
24434   /* "View.MemoryView":823
24435  *     cdef bint negative_step
24436  *
24437  *     if not is_slice:             # <<<<<<<<<<<<<<
24438  *
24439  *         if start < 0:
24440  */
24441   __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
24442   if (__pyx_t_1) {
24443 
24444     /* "View.MemoryView":825
24445  *     if not is_slice:
24446  *
24447  *         if start < 0:             # <<<<<<<<<<<<<<
24448  *             start += shape
24449  *         if not 0 <= start < shape:
24450  */
24451     __pyx_t_1 = ((__pyx_v_start < 0) != 0);
24452     if (__pyx_t_1) {
24453 
24454       /* "View.MemoryView":826
24455  *
24456  *         if start < 0:
24457  *             start += shape             # <<<<<<<<<<<<<<
24458  *         if not 0 <= start < shape:
24459  *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
24460  */
24461       __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
24462 
24463       /* "View.MemoryView":825
24464  *     if not is_slice:
24465  *
24466  *         if start < 0:             # <<<<<<<<<<<<<<
24467  *             start += shape
24468  *         if not 0 <= start < shape:
24469  */
24470     }
24471 
24472     /* "View.MemoryView":827
24473  *         if start < 0:
24474  *             start += shape
24475  *         if not 0 <= start < shape:             # <<<<<<<<<<<<<<
24476  *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
24477  *     else:
24478  */
24479     __pyx_t_1 = (0 <= __pyx_v_start);
24480     if (__pyx_t_1) {
24481       __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
24482     }
24483     __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
24484     if (__pyx_t_2) {
24485 
24486       /* "View.MemoryView":828
24487  *             start += shape
24488  *         if not 0 <= start < shape:
24489  *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)             # <<<<<<<<<<<<<<
24490  *     else:
24491  *
24492  */
24493       __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 828, __pyx_L1_error)
24494 
24495       /* "View.MemoryView":827
24496  *         if start < 0:
24497  *             start += shape
24498  *         if not 0 <= start < shape:             # <<<<<<<<<<<<<<
24499  *             _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
24500  *     else:
24501  */
24502     }
24503 
24504     /* "View.MemoryView":823
24505  *     cdef bint negative_step
24506  *
24507  *     if not is_slice:             # <<<<<<<<<<<<<<
24508  *
24509  *         if start < 0:
24510  */
24511     goto __pyx_L3;
24512   }
24513 
24514   /* "View.MemoryView":831
24515  *     else:
24516  *
24517  *         negative_step = have_step != 0 and step < 0             # <<<<<<<<<<<<<<
24518  *
24519  *         if have_step and step == 0:
24520  */
24521   /*else*/ {
24522     __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
24523     if (__pyx_t_1) {
24524     } else {
24525       __pyx_t_2 = __pyx_t_1;
24526       goto __pyx_L6_bool_binop_done;
24527     }
24528     __pyx_t_1 = ((__pyx_v_step < 0) != 0);
24529     __pyx_t_2 = __pyx_t_1;
24530     __pyx_L6_bool_binop_done:;
24531     __pyx_v_negative_step = __pyx_t_2;
24532 
24533     /* "View.MemoryView":833
24534  *         negative_step = have_step != 0 and step < 0
24535  *
24536  *         if have_step and step == 0:             # <<<<<<<<<<<<<<
24537  *             _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
24538  *
24539  */
24540     __pyx_t_1 = (__pyx_v_have_step != 0);
24541     if (__pyx_t_1) {
24542     } else {
24543       __pyx_t_2 = __pyx_t_1;
24544       goto __pyx_L9_bool_binop_done;
24545     }
24546     __pyx_t_1 = ((__pyx_v_step == 0) != 0);
24547     __pyx_t_2 = __pyx_t_1;
24548     __pyx_L9_bool_binop_done:;
24549     if (__pyx_t_2) {
24550 
24551       /* "View.MemoryView":834
24552  *
24553  *         if have_step and step == 0:
24554  *             _err_dim(ValueError, "Step may not be zero (axis %d)", dim)             # <<<<<<<<<<<<<<
24555  *
24556  *
24557  */
24558       __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 834, __pyx_L1_error)
24559 
24560       /* "View.MemoryView":833
24561  *         negative_step = have_step != 0 and step < 0
24562  *
24563  *         if have_step and step == 0:             # <<<<<<<<<<<<<<
24564  *             _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
24565  *
24566  */
24567     }
24568 
24569     /* "View.MemoryView":837
24570  *
24571  *
24572  *         if have_start:             # <<<<<<<<<<<<<<
24573  *             if start < 0:
24574  *                 start += shape
24575  */
24576     __pyx_t_2 = (__pyx_v_have_start != 0);
24577     if (__pyx_t_2) {
24578 
24579       /* "View.MemoryView":838
24580  *
24581  *         if have_start:
24582  *             if start < 0:             # <<<<<<<<<<<<<<
24583  *                 start += shape
24584  *                 if start < 0:
24585  */
24586       __pyx_t_2 = ((__pyx_v_start < 0) != 0);
24587       if (__pyx_t_2) {
24588 
24589         /* "View.MemoryView":839
24590  *         if have_start:
24591  *             if start < 0:
24592  *                 start += shape             # <<<<<<<<<<<<<<
24593  *                 if start < 0:
24594  *                     start = 0
24595  */
24596         __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
24597 
24598         /* "View.MemoryView":840
24599  *             if start < 0:
24600  *                 start += shape
24601  *                 if start < 0:             # <<<<<<<<<<<<<<
24602  *                     start = 0
24603  *             elif start >= shape:
24604  */
24605         __pyx_t_2 = ((__pyx_v_start < 0) != 0);
24606         if (__pyx_t_2) {
24607 
24608           /* "View.MemoryView":841
24609  *                 start += shape
24610  *                 if start < 0:
24611  *                     start = 0             # <<<<<<<<<<<<<<
24612  *             elif start >= shape:
24613  *                 if negative_step:
24614  */
24615           __pyx_v_start = 0;
24616 
24617           /* "View.MemoryView":840
24618  *             if start < 0:
24619  *                 start += shape
24620  *                 if start < 0:             # <<<<<<<<<<<<<<
24621  *                     start = 0
24622  *             elif start >= shape:
24623  */
24624         }
24625 
24626         /* "View.MemoryView":838
24627  *
24628  *         if have_start:
24629  *             if start < 0:             # <<<<<<<<<<<<<<
24630  *                 start += shape
24631  *                 if start < 0:
24632  */
24633         goto __pyx_L12;
24634       }
24635 
24636       /* "View.MemoryView":842
24637  *                 if start < 0:
24638  *                     start = 0
24639  *             elif start >= shape:             # <<<<<<<<<<<<<<
24640  *                 if negative_step:
24641  *                     start = shape - 1
24642  */
24643       __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
24644       if (__pyx_t_2) {
24645 
24646         /* "View.MemoryView":843
24647  *                     start = 0
24648  *             elif start >= shape:
24649  *                 if negative_step:             # <<<<<<<<<<<<<<
24650  *                     start = shape - 1
24651  *                 else:
24652  */
24653         __pyx_t_2 = (__pyx_v_negative_step != 0);
24654         if (__pyx_t_2) {
24655 
24656           /* "View.MemoryView":844
24657  *             elif start >= shape:
24658  *                 if negative_step:
24659  *                     start = shape - 1             # <<<<<<<<<<<<<<
24660  *                 else:
24661  *                     start = shape
24662  */
24663           __pyx_v_start = (__pyx_v_shape - 1);
24664 
24665           /* "View.MemoryView":843
24666  *                     start = 0
24667  *             elif start >= shape:
24668  *                 if negative_step:             # <<<<<<<<<<<<<<
24669  *                     start = shape - 1
24670  *                 else:
24671  */
24672           goto __pyx_L14;
24673         }
24674 
24675         /* "View.MemoryView":846
24676  *                     start = shape - 1
24677  *                 else:
24678  *                     start = shape             # <<<<<<<<<<<<<<
24679  *         else:
24680  *             if negative_step:
24681  */
24682         /*else*/ {
24683           __pyx_v_start = __pyx_v_shape;
24684         }
24685         __pyx_L14:;
24686 
24687         /* "View.MemoryView":842
24688  *                 if start < 0:
24689  *                     start = 0
24690  *             elif start >= shape:             # <<<<<<<<<<<<<<
24691  *                 if negative_step:
24692  *                     start = shape - 1
24693  */
24694       }
24695       __pyx_L12:;
24696 
24697       /* "View.MemoryView":837
24698  *
24699  *
24700  *         if have_start:             # <<<<<<<<<<<<<<
24701  *             if start < 0:
24702  *                 start += shape
24703  */
24704       goto __pyx_L11;
24705     }
24706 
24707     /* "View.MemoryView":848
24708  *                     start = shape
24709  *         else:
24710  *             if negative_step:             # <<<<<<<<<<<<<<
24711  *                 start = shape - 1
24712  *             else:
24713  */
24714     /*else*/ {
24715       __pyx_t_2 = (__pyx_v_negative_step != 0);
24716       if (__pyx_t_2) {
24717 
24718         /* "View.MemoryView":849
24719  *         else:
24720  *             if negative_step:
24721  *                 start = shape - 1             # <<<<<<<<<<<<<<
24722  *             else:
24723  *                 start = 0
24724  */
24725         __pyx_v_start = (__pyx_v_shape - 1);
24726 
24727         /* "View.MemoryView":848
24728  *                     start = shape
24729  *         else:
24730  *             if negative_step:             # <<<<<<<<<<<<<<
24731  *                 start = shape - 1
24732  *             else:
24733  */
24734         goto __pyx_L15;
24735       }
24736 
24737       /* "View.MemoryView":851
24738  *                 start = shape - 1
24739  *             else:
24740  *                 start = 0             # <<<<<<<<<<<<<<
24741  *
24742  *         if have_stop:
24743  */
24744       /*else*/ {
24745         __pyx_v_start = 0;
24746       }
24747       __pyx_L15:;
24748     }
24749     __pyx_L11:;
24750 
24751     /* "View.MemoryView":853
24752  *                 start = 0
24753  *
24754  *         if have_stop:             # <<<<<<<<<<<<<<
24755  *             if stop < 0:
24756  *                 stop += shape
24757  */
24758     __pyx_t_2 = (__pyx_v_have_stop != 0);
24759     if (__pyx_t_2) {
24760 
24761       /* "View.MemoryView":854
24762  *
24763  *         if have_stop:
24764  *             if stop < 0:             # <<<<<<<<<<<<<<
24765  *                 stop += shape
24766  *                 if stop < 0:
24767  */
24768       __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
24769       if (__pyx_t_2) {
24770 
24771         /* "View.MemoryView":855
24772  *         if have_stop:
24773  *             if stop < 0:
24774  *                 stop += shape             # <<<<<<<<<<<<<<
24775  *                 if stop < 0:
24776  *                     stop = 0
24777  */
24778         __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
24779 
24780         /* "View.MemoryView":856
24781  *             if stop < 0:
24782  *                 stop += shape
24783  *                 if stop < 0:             # <<<<<<<<<<<<<<
24784  *                     stop = 0
24785  *             elif stop > shape:
24786  */
24787         __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
24788         if (__pyx_t_2) {
24789 
24790           /* "View.MemoryView":857
24791  *                 stop += shape
24792  *                 if stop < 0:
24793  *                     stop = 0             # <<<<<<<<<<<<<<
24794  *             elif stop > shape:
24795  *                 stop = shape
24796  */
24797           __pyx_v_stop = 0;
24798 
24799           /* "View.MemoryView":856
24800  *             if stop < 0:
24801  *                 stop += shape
24802  *                 if stop < 0:             # <<<<<<<<<<<<<<
24803  *                     stop = 0
24804  *             elif stop > shape:
24805  */
24806         }
24807 
24808         /* "View.MemoryView":854
24809  *
24810  *         if have_stop:
24811  *             if stop < 0:             # <<<<<<<<<<<<<<
24812  *                 stop += shape
24813  *                 if stop < 0:
24814  */
24815         goto __pyx_L17;
24816       }
24817 
24818       /* "View.MemoryView":858
24819  *                 if stop < 0:
24820  *                     stop = 0
24821  *             elif stop > shape:             # <<<<<<<<<<<<<<
24822  *                 stop = shape
24823  *         else:
24824  */
24825       __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
24826       if (__pyx_t_2) {
24827 
24828         /* "View.MemoryView":859
24829  *                     stop = 0
24830  *             elif stop > shape:
24831  *                 stop = shape             # <<<<<<<<<<<<<<
24832  *         else:
24833  *             if negative_step:
24834  */
24835         __pyx_v_stop = __pyx_v_shape;
24836 
24837         /* "View.MemoryView":858
24838  *                 if stop < 0:
24839  *                     stop = 0
24840  *             elif stop > shape:             # <<<<<<<<<<<<<<
24841  *                 stop = shape
24842  *         else:
24843  */
24844       }
24845       __pyx_L17:;
24846 
24847       /* "View.MemoryView":853
24848  *                 start = 0
24849  *
24850  *         if have_stop:             # <<<<<<<<<<<<<<
24851  *             if stop < 0:
24852  *                 stop += shape
24853  */
24854       goto __pyx_L16;
24855     }
24856 
24857     /* "View.MemoryView":861
24858  *                 stop = shape
24859  *         else:
24860  *             if negative_step:             # <<<<<<<<<<<<<<
24861  *                 stop = -1
24862  *             else:
24863  */
24864     /*else*/ {
24865       __pyx_t_2 = (__pyx_v_negative_step != 0);
24866       if (__pyx_t_2) {
24867 
24868         /* "View.MemoryView":862
24869  *         else:
24870  *             if negative_step:
24871  *                 stop = -1             # <<<<<<<<<<<<<<
24872  *             else:
24873  *                 stop = shape
24874  */
24875         __pyx_v_stop = -1L;
24876 
24877         /* "View.MemoryView":861
24878  *                 stop = shape
24879  *         else:
24880  *             if negative_step:             # <<<<<<<<<<<<<<
24881  *                 stop = -1
24882  *             else:
24883  */
24884         goto __pyx_L19;
24885       }
24886 
24887       /* "View.MemoryView":864
24888  *                 stop = -1
24889  *             else:
24890  *                 stop = shape             # <<<<<<<<<<<<<<
24891  *
24892  *         if not have_step:
24893  */
24894       /*else*/ {
24895         __pyx_v_stop = __pyx_v_shape;
24896       }
24897       __pyx_L19:;
24898     }
24899     __pyx_L16:;
24900 
24901     /* "View.MemoryView":866
24902  *                 stop = shape
24903  *
24904  *         if not have_step:             # <<<<<<<<<<<<<<
24905  *             step = 1
24906  *
24907  */
24908     __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
24909     if (__pyx_t_2) {
24910 
24911       /* "View.MemoryView":867
24912  *
24913  *         if not have_step:
24914  *             step = 1             # <<<<<<<<<<<<<<
24915  *
24916  *
24917  */
24918       __pyx_v_step = 1;
24919 
24920       /* "View.MemoryView":866
24921  *                 stop = shape
24922  *
24923  *         if not have_step:             # <<<<<<<<<<<<<<
24924  *             step = 1
24925  *
24926  */
24927     }
24928 
24929     /* "View.MemoryView":871
24930  *
24931  *         with cython.cdivision(True):
24932  *             new_shape = (stop - start) // step             # <<<<<<<<<<<<<<
24933  *
24934  *             if (stop - start) - step * new_shape:
24935  */
24936     __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
24937 
24938     /* "View.MemoryView":873
24939  *             new_shape = (stop - start) // step
24940  *
24941  *             if (stop - start) - step * new_shape:             # <<<<<<<<<<<<<<
24942  *                 new_shape += 1
24943  *
24944  */
24945     __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
24946     if (__pyx_t_2) {
24947 
24948       /* "View.MemoryView":874
24949  *
24950  *             if (stop - start) - step * new_shape:
24951  *                 new_shape += 1             # <<<<<<<<<<<<<<
24952  *
24953  *         if new_shape < 0:
24954  */
24955       __pyx_v_new_shape = (__pyx_v_new_shape + 1);
24956 
24957       /* "View.MemoryView":873
24958  *             new_shape = (stop - start) // step
24959  *
24960  *             if (stop - start) - step * new_shape:             # <<<<<<<<<<<<<<
24961  *                 new_shape += 1
24962  *
24963  */
24964     }
24965 
24966     /* "View.MemoryView":876
24967  *                 new_shape += 1
24968  *
24969  *         if new_shape < 0:             # <<<<<<<<<<<<<<
24970  *             new_shape = 0
24971  *
24972  */
24973     __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
24974     if (__pyx_t_2) {
24975 
24976       /* "View.MemoryView":877
24977  *
24978  *         if new_shape < 0:
24979  *             new_shape = 0             # <<<<<<<<<<<<<<
24980  *
24981  *
24982  */
24983       __pyx_v_new_shape = 0;
24984 
24985       /* "View.MemoryView":876
24986  *                 new_shape += 1
24987  *
24988  *         if new_shape < 0:             # <<<<<<<<<<<<<<
24989  *             new_shape = 0
24990  *
24991  */
24992     }
24993 
24994     /* "View.MemoryView":880
24995  *
24996  *
24997  *         dst.strides[new_ndim] = stride * step             # <<<<<<<<<<<<<<
24998  *         dst.shape[new_ndim] = new_shape
24999  *         dst.suboffsets[new_ndim] = suboffset
25000  */
25001     (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
25002 
25003     /* "View.MemoryView":881
25004  *
25005  *         dst.strides[new_ndim] = stride * step
25006  *         dst.shape[new_ndim] = new_shape             # <<<<<<<<<<<<<<
25007  *         dst.suboffsets[new_ndim] = suboffset
25008  *
25009  */
25010     (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
25011 
25012     /* "View.MemoryView":882
25013  *         dst.strides[new_ndim] = stride * step
25014  *         dst.shape[new_ndim] = new_shape
25015  *         dst.suboffsets[new_ndim] = suboffset             # <<<<<<<<<<<<<<
25016  *
25017  *
25018  */
25019     (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
25020   }
25021   __pyx_L3:;
25022 
25023   /* "View.MemoryView":885
25024  *
25025  *
25026  *     if suboffset_dim[0] < 0:             # <<<<<<<<<<<<<<
25027  *         dst.data += start * stride
25028  *     else:
25029  */
25030   __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
25031   if (__pyx_t_2) {
25032 
25033     /* "View.MemoryView":886
25034  *
25035  *     if suboffset_dim[0] < 0:
25036  *         dst.data += start * stride             # <<<<<<<<<<<<<<
25037  *     else:
25038  *         dst.suboffsets[suboffset_dim[0]] += start * stride
25039  */
25040     __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
25041 
25042     /* "View.MemoryView":885
25043  *
25044  *
25045  *     if suboffset_dim[0] < 0:             # <<<<<<<<<<<<<<
25046  *         dst.data += start * stride
25047  *     else:
25048  */
25049     goto __pyx_L23;
25050   }
25051 
25052   /* "View.MemoryView":888
25053  *         dst.data += start * stride
25054  *     else:
25055  *         dst.suboffsets[suboffset_dim[0]] += start * stride             # <<<<<<<<<<<<<<
25056  *
25057  *     if suboffset >= 0:
25058  */
25059   /*else*/ {
25060     __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
25061     (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
25062   }
25063   __pyx_L23:;
25064 
25065   /* "View.MemoryView":890
25066  *         dst.suboffsets[suboffset_dim[0]] += start * stride
25067  *
25068  *     if suboffset >= 0:             # <<<<<<<<<<<<<<
25069  *         if not is_slice:
25070  *             if new_ndim == 0:
25071  */
25072   __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
25073   if (__pyx_t_2) {
25074 
25075     /* "View.MemoryView":891
25076  *
25077  *     if suboffset >= 0:
25078  *         if not is_slice:             # <<<<<<<<<<<<<<
25079  *             if new_ndim == 0:
25080  *                 dst.data = (<char **> dst.data)[0] + suboffset
25081  */
25082     __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
25083     if (__pyx_t_2) {
25084 
25085       /* "View.MemoryView":892
25086  *     if suboffset >= 0:
25087  *         if not is_slice:
25088  *             if new_ndim == 0:             # <<<<<<<<<<<<<<
25089  *                 dst.data = (<char **> dst.data)[0] + suboffset
25090  *             else:
25091  */
25092       __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
25093       if (__pyx_t_2) {
25094 
25095         /* "View.MemoryView":893
25096  *         if not is_slice:
25097  *             if new_ndim == 0:
25098  *                 dst.data = (<char **> dst.data)[0] + suboffset             # <<<<<<<<<<<<<<
25099  *             else:
25100  *                 _err_dim(IndexError, "All dimensions preceding dimension %d "
25101  */
25102         __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
25103 
25104         /* "View.MemoryView":892
25105  *     if suboffset >= 0:
25106  *         if not is_slice:
25107  *             if new_ndim == 0:             # <<<<<<<<<<<<<<
25108  *                 dst.data = (<char **> dst.data)[0] + suboffset
25109  *             else:
25110  */
25111         goto __pyx_L26;
25112       }
25113 
25114       /* "View.MemoryView":895
25115  *                 dst.data = (<char **> dst.data)[0] + suboffset
25116  *             else:
25117  *                 _err_dim(IndexError, "All dimensions preceding dimension %d "             # <<<<<<<<<<<<<<
25118  *                                      "must be indexed and not sliced", dim)
25119  *         else:
25120  */
25121       /*else*/ {
25122 
25123         /* "View.MemoryView":896
25124  *             else:
25125  *                 _err_dim(IndexError, "All dimensions preceding dimension %d "
25126  *                                      "must be indexed and not sliced", dim)             # <<<<<<<<<<<<<<
25127  *         else:
25128  *             suboffset_dim[0] = new_ndim
25129  */
25130         __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 895, __pyx_L1_error)
25131       }
25132       __pyx_L26:;
25133 
25134       /* "View.MemoryView":891
25135  *
25136  *     if suboffset >= 0:
25137  *         if not is_slice:             # <<<<<<<<<<<<<<
25138  *             if new_ndim == 0:
25139  *                 dst.data = (<char **> dst.data)[0] + suboffset
25140  */
25141       goto __pyx_L25;
25142     }
25143 
25144     /* "View.MemoryView":898
25145  *                                      "must be indexed and not sliced", dim)
25146  *         else:
25147  *             suboffset_dim[0] = new_ndim             # <<<<<<<<<<<<<<
25148  *
25149  *     return 0
25150  */
25151     /*else*/ {
25152       (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
25153     }
25154     __pyx_L25:;
25155 
25156     /* "View.MemoryView":890
25157  *         dst.suboffsets[suboffset_dim[0]] += start * stride
25158  *
25159  *     if suboffset >= 0:             # <<<<<<<<<<<<<<
25160  *         if not is_slice:
25161  *             if new_ndim == 0:
25162  */
25163   }
25164 
25165   /* "View.MemoryView":900
25166  *             suboffset_dim[0] = new_ndim
25167  *
25168  *     return 0             # <<<<<<<<<<<<<<
25169  *
25170  *
25171  */
25172   __pyx_r = 0;
25173   goto __pyx_L0;
25174 
25175   /* "View.MemoryView":803
25176  *
25177  * @cname('__pyx_memoryview_slice_memviewslice')
25178  * cdef int slice_memviewslice(             # <<<<<<<<<<<<<<
25179  *         __Pyx_memviewslice *dst,
25180  *         Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
25181  */
25182 
25183   /* function exit code */
25184   __pyx_L1_error:;
25185   {
25186     #ifdef WITH_THREAD
25187     PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
25188     #endif
25189     __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
25190     #ifdef WITH_THREAD
25191     __Pyx_PyGILState_Release(__pyx_gilstate_save);
25192     #endif
25193   }
25194   __pyx_r = -1;
25195   __pyx_L0:;
25196   return __pyx_r;
25197 }
25198 
25199 /* "View.MemoryView":906
25200  *
25201  * @cname('__pyx_pybuffer_index')
25202  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,             # <<<<<<<<<<<<<<
25203  *                           Py_ssize_t dim) except NULL:
25204  *     cdef Py_ssize_t shape, stride, suboffset = -1
25205  */
25206 
__pyx_pybuffer_index(Py_buffer * __pyx_v_view,char * __pyx_v_bufp,Py_ssize_t __pyx_v_index,Py_ssize_t __pyx_v_dim)25207 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) {
25208   Py_ssize_t __pyx_v_shape;
25209   Py_ssize_t __pyx_v_stride;
25210   Py_ssize_t __pyx_v_suboffset;
25211   Py_ssize_t __pyx_v_itemsize;
25212   char *__pyx_v_resultp;
25213   char *__pyx_r;
25214   __Pyx_RefNannyDeclarations
25215   Py_ssize_t __pyx_t_1;
25216   int __pyx_t_2;
25217   PyObject *__pyx_t_3 = NULL;
25218   PyObject *__pyx_t_4 = NULL;
25219   __Pyx_RefNannySetupContext("pybuffer_index", 0);
25220 
25221   /* "View.MemoryView":908
25222  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
25223  *                           Py_ssize_t dim) except NULL:
25224  *     cdef Py_ssize_t shape, stride, suboffset = -1             # <<<<<<<<<<<<<<
25225  *     cdef Py_ssize_t itemsize = view.itemsize
25226  *     cdef char *resultp
25227  */
25228   __pyx_v_suboffset = -1L;
25229 
25230   /* "View.MemoryView":909
25231  *                           Py_ssize_t dim) except NULL:
25232  *     cdef Py_ssize_t shape, stride, suboffset = -1
25233  *     cdef Py_ssize_t itemsize = view.itemsize             # <<<<<<<<<<<<<<
25234  *     cdef char *resultp
25235  *
25236  */
25237   __pyx_t_1 = __pyx_v_view->itemsize;
25238   __pyx_v_itemsize = __pyx_t_1;
25239 
25240   /* "View.MemoryView":912
25241  *     cdef char *resultp
25242  *
25243  *     if view.ndim == 0:             # <<<<<<<<<<<<<<
25244  *         shape = view.len / itemsize
25245  *         stride = itemsize
25246  */
25247   __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
25248   if (__pyx_t_2) {
25249 
25250     /* "View.MemoryView":913
25251  *
25252  *     if view.ndim == 0:
25253  *         shape = view.len / itemsize             # <<<<<<<<<<<<<<
25254  *         stride = itemsize
25255  *     else:
25256  */
25257     if (unlikely(__pyx_v_itemsize == 0)) {
25258       PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
25259       __PYX_ERR(1, 913, __pyx_L1_error)
25260     }
25261     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))) {
25262       PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
25263       __PYX_ERR(1, 913, __pyx_L1_error)
25264     }
25265     __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
25266 
25267     /* "View.MemoryView":914
25268  *     if view.ndim == 0:
25269  *         shape = view.len / itemsize
25270  *         stride = itemsize             # <<<<<<<<<<<<<<
25271  *     else:
25272  *         shape = view.shape[dim]
25273  */
25274     __pyx_v_stride = __pyx_v_itemsize;
25275 
25276     /* "View.MemoryView":912
25277  *     cdef char *resultp
25278  *
25279  *     if view.ndim == 0:             # <<<<<<<<<<<<<<
25280  *         shape = view.len / itemsize
25281  *         stride = itemsize
25282  */
25283     goto __pyx_L3;
25284   }
25285 
25286   /* "View.MemoryView":916
25287  *         stride = itemsize
25288  *     else:
25289  *         shape = view.shape[dim]             # <<<<<<<<<<<<<<
25290  *         stride = view.strides[dim]
25291  *         if view.suboffsets != NULL:
25292  */
25293   /*else*/ {
25294     __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
25295 
25296     /* "View.MemoryView":917
25297  *     else:
25298  *         shape = view.shape[dim]
25299  *         stride = view.strides[dim]             # <<<<<<<<<<<<<<
25300  *         if view.suboffsets != NULL:
25301  *             suboffset = view.suboffsets[dim]
25302  */
25303     __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
25304 
25305     /* "View.MemoryView":918
25306  *         shape = view.shape[dim]
25307  *         stride = view.strides[dim]
25308  *         if view.suboffsets != NULL:             # <<<<<<<<<<<<<<
25309  *             suboffset = view.suboffsets[dim]
25310  *
25311  */
25312     __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
25313     if (__pyx_t_2) {
25314 
25315       /* "View.MemoryView":919
25316  *         stride = view.strides[dim]
25317  *         if view.suboffsets != NULL:
25318  *             suboffset = view.suboffsets[dim]             # <<<<<<<<<<<<<<
25319  *
25320  *     if index < 0:
25321  */
25322       __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
25323 
25324       /* "View.MemoryView":918
25325  *         shape = view.shape[dim]
25326  *         stride = view.strides[dim]
25327  *         if view.suboffsets != NULL:             # <<<<<<<<<<<<<<
25328  *             suboffset = view.suboffsets[dim]
25329  *
25330  */
25331     }
25332   }
25333   __pyx_L3:;
25334 
25335   /* "View.MemoryView":921
25336  *             suboffset = view.suboffsets[dim]
25337  *
25338  *     if index < 0:             # <<<<<<<<<<<<<<
25339  *         index += view.shape[dim]
25340  *         if index < 0:
25341  */
25342   __pyx_t_2 = ((__pyx_v_index < 0) != 0);
25343   if (__pyx_t_2) {
25344 
25345     /* "View.MemoryView":922
25346  *
25347  *     if index < 0:
25348  *         index += view.shape[dim]             # <<<<<<<<<<<<<<
25349  *         if index < 0:
25350  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
25351  */
25352     __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
25353 
25354     /* "View.MemoryView":923
25355  *     if index < 0:
25356  *         index += view.shape[dim]
25357  *         if index < 0:             # <<<<<<<<<<<<<<
25358  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
25359  *
25360  */
25361     __pyx_t_2 = ((__pyx_v_index < 0) != 0);
25362     if (unlikely(__pyx_t_2)) {
25363 
25364       /* "View.MemoryView":924
25365  *         index += view.shape[dim]
25366  *         if index < 0:
25367  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)             # <<<<<<<<<<<<<<
25368  *
25369  *     if index >= shape:
25370  */
25371       __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 924, __pyx_L1_error)
25372       __Pyx_GOTREF(__pyx_t_3);
25373       __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 924, __pyx_L1_error)
25374       __Pyx_GOTREF(__pyx_t_4);
25375       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25376       __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 924, __pyx_L1_error)
25377       __Pyx_GOTREF(__pyx_t_3);
25378       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25379       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
25380       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25381       __PYX_ERR(1, 924, __pyx_L1_error)
25382 
25383       /* "View.MemoryView":923
25384  *     if index < 0:
25385  *         index += view.shape[dim]
25386  *         if index < 0:             # <<<<<<<<<<<<<<
25387  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
25388  *
25389  */
25390     }
25391 
25392     /* "View.MemoryView":921
25393  *             suboffset = view.suboffsets[dim]
25394  *
25395  *     if index < 0:             # <<<<<<<<<<<<<<
25396  *         index += view.shape[dim]
25397  *         if index < 0:
25398  */
25399   }
25400 
25401   /* "View.MemoryView":926
25402  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
25403  *
25404  *     if index >= shape:             # <<<<<<<<<<<<<<
25405  *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
25406  *
25407  */
25408   __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
25409   if (unlikely(__pyx_t_2)) {
25410 
25411     /* "View.MemoryView":927
25412  *
25413  *     if index >= shape:
25414  *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)             # <<<<<<<<<<<<<<
25415  *
25416  *     resultp = bufp + index * stride
25417  */
25418     __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 927, __pyx_L1_error)
25419     __Pyx_GOTREF(__pyx_t_3);
25420     __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 927, __pyx_L1_error)
25421     __Pyx_GOTREF(__pyx_t_4);
25422     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25423     __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 927, __pyx_L1_error)
25424     __Pyx_GOTREF(__pyx_t_3);
25425     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25426     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
25427     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25428     __PYX_ERR(1, 927, __pyx_L1_error)
25429 
25430     /* "View.MemoryView":926
25431  *             raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
25432  *
25433  *     if index >= shape:             # <<<<<<<<<<<<<<
25434  *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
25435  *
25436  */
25437   }
25438 
25439   /* "View.MemoryView":929
25440  *         raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
25441  *
25442  *     resultp = bufp + index * stride             # <<<<<<<<<<<<<<
25443  *     if suboffset >= 0:
25444  *         resultp = (<char **> resultp)[0] + suboffset
25445  */
25446   __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
25447 
25448   /* "View.MemoryView":930
25449  *
25450  *     resultp = bufp + index * stride
25451  *     if suboffset >= 0:             # <<<<<<<<<<<<<<
25452  *         resultp = (<char **> resultp)[0] + suboffset
25453  *
25454  */
25455   __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
25456   if (__pyx_t_2) {
25457 
25458     /* "View.MemoryView":931
25459  *     resultp = bufp + index * stride
25460  *     if suboffset >= 0:
25461  *         resultp = (<char **> resultp)[0] + suboffset             # <<<<<<<<<<<<<<
25462  *
25463  *     return resultp
25464  */
25465     __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
25466 
25467     /* "View.MemoryView":930
25468  *
25469  *     resultp = bufp + index * stride
25470  *     if suboffset >= 0:             # <<<<<<<<<<<<<<
25471  *         resultp = (<char **> resultp)[0] + suboffset
25472  *
25473  */
25474   }
25475 
25476   /* "View.MemoryView":933
25477  *         resultp = (<char **> resultp)[0] + suboffset
25478  *
25479  *     return resultp             # <<<<<<<<<<<<<<
25480  *
25481  *
25482  */
25483   __pyx_r = __pyx_v_resultp;
25484   goto __pyx_L0;
25485 
25486   /* "View.MemoryView":906
25487  *
25488  * @cname('__pyx_pybuffer_index')
25489  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,             # <<<<<<<<<<<<<<
25490  *                           Py_ssize_t dim) except NULL:
25491  *     cdef Py_ssize_t shape, stride, suboffset = -1
25492  */
25493 
25494   /* function exit code */
25495   __pyx_L1_error:;
25496   __Pyx_XDECREF(__pyx_t_3);
25497   __Pyx_XDECREF(__pyx_t_4);
25498   __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
25499   __pyx_r = NULL;
25500   __pyx_L0:;
25501   __Pyx_RefNannyFinishContext();
25502   return __pyx_r;
25503 }
25504 
25505 /* "View.MemoryView":939
25506  *
25507  * @cname('__pyx_memslice_transpose')
25508  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:             # <<<<<<<<<<<<<<
25509  *     cdef int ndim = memslice.memview.view.ndim
25510  *
25511  */
25512 
__pyx_memslice_transpose(__Pyx_memviewslice * __pyx_v_memslice)25513 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
25514   int __pyx_v_ndim;
25515   Py_ssize_t *__pyx_v_shape;
25516   Py_ssize_t *__pyx_v_strides;
25517   int __pyx_v_i;
25518   int __pyx_v_j;
25519   int __pyx_r;
25520   int __pyx_t_1;
25521   Py_ssize_t *__pyx_t_2;
25522   long __pyx_t_3;
25523   long __pyx_t_4;
25524   Py_ssize_t __pyx_t_5;
25525   Py_ssize_t __pyx_t_6;
25526   int __pyx_t_7;
25527   int __pyx_t_8;
25528   int __pyx_t_9;
25529 
25530   /* "View.MemoryView":940
25531  * @cname('__pyx_memslice_transpose')
25532  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
25533  *     cdef int ndim = memslice.memview.view.ndim             # <<<<<<<<<<<<<<
25534  *
25535  *     cdef Py_ssize_t *shape = memslice.shape
25536  */
25537   __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
25538   __pyx_v_ndim = __pyx_t_1;
25539 
25540   /* "View.MemoryView":942
25541  *     cdef int ndim = memslice.memview.view.ndim
25542  *
25543  *     cdef Py_ssize_t *shape = memslice.shape             # <<<<<<<<<<<<<<
25544  *     cdef Py_ssize_t *strides = memslice.strides
25545  *
25546  */
25547   __pyx_t_2 = __pyx_v_memslice->shape;
25548   __pyx_v_shape = __pyx_t_2;
25549 
25550   /* "View.MemoryView":943
25551  *
25552  *     cdef Py_ssize_t *shape = memslice.shape
25553  *     cdef Py_ssize_t *strides = memslice.strides             # <<<<<<<<<<<<<<
25554  *
25555  *
25556  */
25557   __pyx_t_2 = __pyx_v_memslice->strides;
25558   __pyx_v_strides = __pyx_t_2;
25559 
25560   /* "View.MemoryView":947
25561  *
25562  *     cdef int i, j
25563  *     for i in range(ndim / 2):             # <<<<<<<<<<<<<<
25564  *         j = ndim - 1 - i
25565  *         strides[i], strides[j] = strides[j], strides[i]
25566  */
25567   __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
25568   __pyx_t_4 = __pyx_t_3;
25569   for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
25570     __pyx_v_i = __pyx_t_1;
25571 
25572     /* "View.MemoryView":948
25573  *     cdef int i, j
25574  *     for i in range(ndim / 2):
25575  *         j = ndim - 1 - i             # <<<<<<<<<<<<<<
25576  *         strides[i], strides[j] = strides[j], strides[i]
25577  *         shape[i], shape[j] = shape[j], shape[i]
25578  */
25579     __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
25580 
25581     /* "View.MemoryView":949
25582  *     for i in range(ndim / 2):
25583  *         j = ndim - 1 - i
25584  *         strides[i], strides[j] = strides[j], strides[i]             # <<<<<<<<<<<<<<
25585  *         shape[i], shape[j] = shape[j], shape[i]
25586  *
25587  */
25588     __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
25589     __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
25590     (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
25591     (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
25592 
25593     /* "View.MemoryView":950
25594  *         j = ndim - 1 - i
25595  *         strides[i], strides[j] = strides[j], strides[i]
25596  *         shape[i], shape[j] = shape[j], shape[i]             # <<<<<<<<<<<<<<
25597  *
25598  *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
25599  */
25600     __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
25601     __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
25602     (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
25603     (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
25604 
25605     /* "View.MemoryView":952
25606  *         shape[i], shape[j] = shape[j], shape[i]
25607  *
25608  *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:             # <<<<<<<<<<<<<<
25609  *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
25610  *
25611  */
25612     __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
25613     if (!__pyx_t_8) {
25614     } else {
25615       __pyx_t_7 = __pyx_t_8;
25616       goto __pyx_L6_bool_binop_done;
25617     }
25618     __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
25619     __pyx_t_7 = __pyx_t_8;
25620     __pyx_L6_bool_binop_done:;
25621     if (__pyx_t_7) {
25622 
25623       /* "View.MemoryView":953
25624  *
25625  *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
25626  *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")             # <<<<<<<<<<<<<<
25627  *
25628  *     return 1
25629  */
25630       __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 953, __pyx_L1_error)
25631 
25632       /* "View.MemoryView":952
25633  *         shape[i], shape[j] = shape[j], shape[i]
25634  *
25635  *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:             # <<<<<<<<<<<<<<
25636  *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
25637  *
25638  */
25639     }
25640   }
25641 
25642   /* "View.MemoryView":955
25643  *             _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
25644  *
25645  *     return 1             # <<<<<<<<<<<<<<
25646  *
25647  *
25648  */
25649   __pyx_r = 1;
25650   goto __pyx_L0;
25651 
25652   /* "View.MemoryView":939
25653  *
25654  * @cname('__pyx_memslice_transpose')
25655  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:             # <<<<<<<<<<<<<<
25656  *     cdef int ndim = memslice.memview.view.ndim
25657  *
25658  */
25659 
25660   /* function exit code */
25661   __pyx_L1_error:;
25662   {
25663     #ifdef WITH_THREAD
25664     PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
25665     #endif
25666     __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
25667     #ifdef WITH_THREAD
25668     __Pyx_PyGILState_Release(__pyx_gilstate_save);
25669     #endif
25670   }
25671   __pyx_r = 0;
25672   __pyx_L0:;
25673   return __pyx_r;
25674 }
25675 
25676 /* "View.MemoryView":972
25677  *     cdef int (*to_dtype_func)(char *, object) except 0
25678  *
25679  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
25680  *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
25681  *
25682  */
25683 
25684 /* Python wrapper */
25685 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
__pyx_memoryviewslice___dealloc__(PyObject * __pyx_v_self)25686 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
25687   __Pyx_RefNannyDeclarations
25688   __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
25689   __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
25690 
25691   /* function exit code */
25692   __Pyx_RefNannyFinishContext();
25693 }
25694 
__pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj * __pyx_v_self)25695 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
25696   __Pyx_RefNannyDeclarations
25697   __Pyx_RefNannySetupContext("__dealloc__", 0);
25698 
25699   /* "View.MemoryView":973
25700  *
25701  *     def __dealloc__(self):
25702  *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)             # <<<<<<<<<<<<<<
25703  *
25704  *     cdef convert_item_to_object(self, char *itemp):
25705  */
25706   __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
25707 
25708   /* "View.MemoryView":972
25709  *     cdef int (*to_dtype_func)(char *, object) except 0
25710  *
25711  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
25712  *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
25713  *
25714  */
25715 
25716   /* function exit code */
25717   __Pyx_RefNannyFinishContext();
25718 }
25719 
25720 /* "View.MemoryView":975
25721  *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
25722  *
25723  *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
25724  *         if self.to_object_func != NULL:
25725  *             return self.to_object_func(itemp)
25726  */
25727 
__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj * __pyx_v_self,char * __pyx_v_itemp)25728 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
25729   PyObject *__pyx_r = NULL;
25730   __Pyx_RefNannyDeclarations
25731   int __pyx_t_1;
25732   PyObject *__pyx_t_2 = NULL;
25733   __Pyx_RefNannySetupContext("convert_item_to_object", 0);
25734 
25735   /* "View.MemoryView":976
25736  *
25737  *     cdef convert_item_to_object(self, char *itemp):
25738  *         if self.to_object_func != NULL:             # <<<<<<<<<<<<<<
25739  *             return self.to_object_func(itemp)
25740  *         else:
25741  */
25742   __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
25743   if (__pyx_t_1) {
25744 
25745     /* "View.MemoryView":977
25746  *     cdef convert_item_to_object(self, char *itemp):
25747  *         if self.to_object_func != NULL:
25748  *             return self.to_object_func(itemp)             # <<<<<<<<<<<<<<
25749  *         else:
25750  *             return memoryview.convert_item_to_object(self, itemp)
25751  */
25752     __Pyx_XDECREF(__pyx_r);
25753     __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 977, __pyx_L1_error)
25754     __Pyx_GOTREF(__pyx_t_2);
25755     __pyx_r = __pyx_t_2;
25756     __pyx_t_2 = 0;
25757     goto __pyx_L0;
25758 
25759     /* "View.MemoryView":976
25760  *
25761  *     cdef convert_item_to_object(self, char *itemp):
25762  *         if self.to_object_func != NULL:             # <<<<<<<<<<<<<<
25763  *             return self.to_object_func(itemp)
25764  *         else:
25765  */
25766   }
25767 
25768   /* "View.MemoryView":979
25769  *             return self.to_object_func(itemp)
25770  *         else:
25771  *             return memoryview.convert_item_to_object(self, itemp)             # <<<<<<<<<<<<<<
25772  *
25773  *     cdef assign_item_from_object(self, char *itemp, object value):
25774  */
25775   /*else*/ {
25776     __Pyx_XDECREF(__pyx_r);
25777     __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 979, __pyx_L1_error)
25778     __Pyx_GOTREF(__pyx_t_2);
25779     __pyx_r = __pyx_t_2;
25780     __pyx_t_2 = 0;
25781     goto __pyx_L0;
25782   }
25783 
25784   /* "View.MemoryView":975
25785  *         __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
25786  *
25787  *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
25788  *         if self.to_object_func != NULL:
25789  *             return self.to_object_func(itemp)
25790  */
25791 
25792   /* function exit code */
25793   __pyx_L1_error:;
25794   __Pyx_XDECREF(__pyx_t_2);
25795   __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
25796   __pyx_r = 0;
25797   __pyx_L0:;
25798   __Pyx_XGIVEREF(__pyx_r);
25799   __Pyx_RefNannyFinishContext();
25800   return __pyx_r;
25801 }
25802 
25803 /* "View.MemoryView":981
25804  *             return memoryview.convert_item_to_object(self, itemp)
25805  *
25806  *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
25807  *         if self.to_dtype_func != NULL:
25808  *             self.to_dtype_func(itemp, value)
25809  */
25810 
__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj * __pyx_v_self,char * __pyx_v_itemp,PyObject * __pyx_v_value)25811 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
25812   PyObject *__pyx_r = NULL;
25813   __Pyx_RefNannyDeclarations
25814   int __pyx_t_1;
25815   int __pyx_t_2;
25816   PyObject *__pyx_t_3 = NULL;
25817   __Pyx_RefNannySetupContext("assign_item_from_object", 0);
25818 
25819   /* "View.MemoryView":982
25820  *
25821  *     cdef assign_item_from_object(self, char *itemp, object value):
25822  *         if self.to_dtype_func != NULL:             # <<<<<<<<<<<<<<
25823  *             self.to_dtype_func(itemp, value)
25824  *         else:
25825  */
25826   __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
25827   if (__pyx_t_1) {
25828 
25829     /* "View.MemoryView":983
25830  *     cdef assign_item_from_object(self, char *itemp, object value):
25831  *         if self.to_dtype_func != NULL:
25832  *             self.to_dtype_func(itemp, value)             # <<<<<<<<<<<<<<
25833  *         else:
25834  *             memoryview.assign_item_from_object(self, itemp, value)
25835  */
25836     __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 983, __pyx_L1_error)
25837 
25838     /* "View.MemoryView":982
25839  *
25840  *     cdef assign_item_from_object(self, char *itemp, object value):
25841  *         if self.to_dtype_func != NULL:             # <<<<<<<<<<<<<<
25842  *             self.to_dtype_func(itemp, value)
25843  *         else:
25844  */
25845     goto __pyx_L3;
25846   }
25847 
25848   /* "View.MemoryView":985
25849  *             self.to_dtype_func(itemp, value)
25850  *         else:
25851  *             memoryview.assign_item_from_object(self, itemp, value)             # <<<<<<<<<<<<<<
25852  *
25853  *     @property
25854  */
25855   /*else*/ {
25856     __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 985, __pyx_L1_error)
25857     __Pyx_GOTREF(__pyx_t_3);
25858     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25859   }
25860   __pyx_L3:;
25861 
25862   /* "View.MemoryView":981
25863  *             return memoryview.convert_item_to_object(self, itemp)
25864  *
25865  *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
25866  *         if self.to_dtype_func != NULL:
25867  *             self.to_dtype_func(itemp, value)
25868  */
25869 
25870   /* function exit code */
25871   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
25872   goto __pyx_L0;
25873   __pyx_L1_error:;
25874   __Pyx_XDECREF(__pyx_t_3);
25875   __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
25876   __pyx_r = 0;
25877   __pyx_L0:;
25878   __Pyx_XGIVEREF(__pyx_r);
25879   __Pyx_RefNannyFinishContext();
25880   return __pyx_r;
25881 }
25882 
25883 /* "View.MemoryView":988
25884  *
25885  *     @property
25886  *     def base(self):             # <<<<<<<<<<<<<<
25887  *         return self.from_object
25888  *
25889  */
25890 
25891 /* Python wrapper */
25892 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)25893 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
25894   PyObject *__pyx_r = 0;
25895   __Pyx_RefNannyDeclarations
25896   __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
25897   __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
25898 
25899   /* function exit code */
25900   __Pyx_RefNannyFinishContext();
25901   return __pyx_r;
25902 }
25903 
__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj * __pyx_v_self)25904 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
25905   PyObject *__pyx_r = NULL;
25906   __Pyx_RefNannyDeclarations
25907   __Pyx_RefNannySetupContext("__get__", 0);
25908 
25909   /* "View.MemoryView":989
25910  *     @property
25911  *     def base(self):
25912  *         return self.from_object             # <<<<<<<<<<<<<<
25913  *
25914  *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
25915  */
25916   __Pyx_XDECREF(__pyx_r);
25917   __Pyx_INCREF(__pyx_v_self->from_object);
25918   __pyx_r = __pyx_v_self->from_object;
25919   goto __pyx_L0;
25920 
25921   /* "View.MemoryView":988
25922  *
25923  *     @property
25924  *     def base(self):             # <<<<<<<<<<<<<<
25925  *         return self.from_object
25926  *
25927  */
25928 
25929   /* function exit code */
25930   __pyx_L0:;
25931   __Pyx_XGIVEREF(__pyx_r);
25932   __Pyx_RefNannyFinishContext();
25933   return __pyx_r;
25934 }
25935 
25936 /* "(tree fragment)":1
25937  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
25938  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
25939  * def __setstate_cython__(self, __pyx_state):
25940  */
25941 
25942 /* Python wrapper */
25943 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)25944 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
25945   PyObject *__pyx_r = 0;
25946   __Pyx_RefNannyDeclarations
25947   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
25948   __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
25949 
25950   /* function exit code */
25951   __Pyx_RefNannyFinishContext();
25952   return __pyx_r;
25953 }
25954 
__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj * __pyx_v_self)25955 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
25956   PyObject *__pyx_r = NULL;
25957   __Pyx_RefNannyDeclarations
25958   PyObject *__pyx_t_1 = NULL;
25959   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
25960 
25961   /* "(tree fragment)":2
25962  * def __reduce_cython__(self):
25963  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
25964  * def __setstate_cython__(self, __pyx_state):
25965  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
25966  */
25967   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
25968   __Pyx_GOTREF(__pyx_t_1);
25969   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
25970   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25971   __PYX_ERR(1, 2, __pyx_L1_error)
25972 
25973   /* "(tree fragment)":1
25974  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
25975  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
25976  * def __setstate_cython__(self, __pyx_state):
25977  */
25978 
25979   /* function exit code */
25980   __pyx_L1_error:;
25981   __Pyx_XDECREF(__pyx_t_1);
25982   __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
25983   __pyx_r = NULL;
25984   __Pyx_XGIVEREF(__pyx_r);
25985   __Pyx_RefNannyFinishContext();
25986   return __pyx_r;
25987 }
25988 
25989 /* "(tree fragment)":3
25990  * def __reduce_cython__(self):
25991  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
25992  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
25993  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
25994  */
25995 
25996 /* Python wrapper */
25997 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)25998 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
25999   PyObject *__pyx_r = 0;
26000   __Pyx_RefNannyDeclarations
26001   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
26002   __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
26003 
26004   /* function exit code */
26005   __Pyx_RefNannyFinishContext();
26006   return __pyx_r;
26007 }
26008 
__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)26009 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) {
26010   PyObject *__pyx_r = NULL;
26011   __Pyx_RefNannyDeclarations
26012   PyObject *__pyx_t_1 = NULL;
26013   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
26014 
26015   /* "(tree fragment)":4
26016  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
26017  * def __setstate_cython__(self, __pyx_state):
26018  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
26019  */
26020   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
26021   __Pyx_GOTREF(__pyx_t_1);
26022   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
26023   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26024   __PYX_ERR(1, 4, __pyx_L1_error)
26025 
26026   /* "(tree fragment)":3
26027  * def __reduce_cython__(self):
26028  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
26029  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
26030  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
26031  */
26032 
26033   /* function exit code */
26034   __pyx_L1_error:;
26035   __Pyx_XDECREF(__pyx_t_1);
26036   __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
26037   __pyx_r = NULL;
26038   __Pyx_XGIVEREF(__pyx_r);
26039   __Pyx_RefNannyFinishContext();
26040   return __pyx_r;
26041 }
26042 
26043 /* "View.MemoryView":995
26044  *
26045  * @cname('__pyx_memoryview_fromslice')
26046  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice,             # <<<<<<<<<<<<<<
26047  *                           int ndim,
26048  *                           object (*to_object_func)(char *),
26049  */
26050 
__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)26051 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) {
26052   struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
26053   Py_ssize_t __pyx_v_suboffset;
26054   PyObject *__pyx_v_length = NULL;
26055   PyObject *__pyx_r = NULL;
26056   __Pyx_RefNannyDeclarations
26057   int __pyx_t_1;
26058   PyObject *__pyx_t_2 = NULL;
26059   PyObject *__pyx_t_3 = NULL;
26060   __Pyx_TypeInfo *__pyx_t_4;
26061   Py_buffer __pyx_t_5;
26062   Py_ssize_t *__pyx_t_6;
26063   Py_ssize_t *__pyx_t_7;
26064   Py_ssize_t *__pyx_t_8;
26065   Py_ssize_t __pyx_t_9;
26066   __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
26067 
26068   /* "View.MemoryView":1003
26069  *     cdef _memoryviewslice result
26070  *
26071  *     if <PyObject *> memviewslice.memview == Py_None:             # <<<<<<<<<<<<<<
26072  *         return None
26073  *
26074  */
26075   __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
26076   if (__pyx_t_1) {
26077 
26078     /* "View.MemoryView":1004
26079  *
26080  *     if <PyObject *> memviewslice.memview == Py_None:
26081  *         return None             # <<<<<<<<<<<<<<
26082  *
26083  *
26084  */
26085     __Pyx_XDECREF(__pyx_r);
26086     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
26087     goto __pyx_L0;
26088 
26089     /* "View.MemoryView":1003
26090  *     cdef _memoryviewslice result
26091  *
26092  *     if <PyObject *> memviewslice.memview == Py_None:             # <<<<<<<<<<<<<<
26093  *         return None
26094  *
26095  */
26096   }
26097 
26098   /* "View.MemoryView":1009
26099  *
26100  *
26101  *     result = _memoryviewslice(None, 0, dtype_is_object)             # <<<<<<<<<<<<<<
26102  *
26103  *     result.from_slice = memviewslice
26104  */
26105   __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1009, __pyx_L1_error)
26106   __Pyx_GOTREF(__pyx_t_2);
26107   __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1009, __pyx_L1_error)
26108   __Pyx_GOTREF(__pyx_t_3);
26109   __Pyx_INCREF(Py_None);
26110   __Pyx_GIVEREF(Py_None);
26111   PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
26112   __Pyx_INCREF(__pyx_int_0);
26113   __Pyx_GIVEREF(__pyx_int_0);
26114   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
26115   __Pyx_GIVEREF(__pyx_t_2);
26116   PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
26117   __pyx_t_2 = 0;
26118   __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1009, __pyx_L1_error)
26119   __Pyx_GOTREF(__pyx_t_2);
26120   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26121   __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
26122   __pyx_t_2 = 0;
26123 
26124   /* "View.MemoryView":1011
26125  *     result = _memoryviewslice(None, 0, dtype_is_object)
26126  *
26127  *     result.from_slice = memviewslice             # <<<<<<<<<<<<<<
26128  *     __PYX_INC_MEMVIEW(&memviewslice, 1)
26129  *
26130  */
26131   __pyx_v_result->from_slice = __pyx_v_memviewslice;
26132 
26133   /* "View.MemoryView":1012
26134  *
26135  *     result.from_slice = memviewslice
26136  *     __PYX_INC_MEMVIEW(&memviewslice, 1)             # <<<<<<<<<<<<<<
26137  *
26138  *     result.from_object = (<memoryview> memviewslice.memview).base
26139  */
26140   __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
26141 
26142   /* "View.MemoryView":1014
26143  *     __PYX_INC_MEMVIEW(&memviewslice, 1)
26144  *
26145  *     result.from_object = (<memoryview> memviewslice.memview).base             # <<<<<<<<<<<<<<
26146  *     result.typeinfo = memviewslice.memview.typeinfo
26147  *
26148  */
26149   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1014, __pyx_L1_error)
26150   __Pyx_GOTREF(__pyx_t_2);
26151   __Pyx_GIVEREF(__pyx_t_2);
26152   __Pyx_GOTREF(__pyx_v_result->from_object);
26153   __Pyx_DECREF(__pyx_v_result->from_object);
26154   __pyx_v_result->from_object = __pyx_t_2;
26155   __pyx_t_2 = 0;
26156 
26157   /* "View.MemoryView":1015
26158  *
26159  *     result.from_object = (<memoryview> memviewslice.memview).base
26160  *     result.typeinfo = memviewslice.memview.typeinfo             # <<<<<<<<<<<<<<
26161  *
26162  *     result.view = memviewslice.memview.view
26163  */
26164   __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
26165   __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
26166 
26167   /* "View.MemoryView":1017
26168  *     result.typeinfo = memviewslice.memview.typeinfo
26169  *
26170  *     result.view = memviewslice.memview.view             # <<<<<<<<<<<<<<
26171  *     result.view.buf = <void *> memviewslice.data
26172  *     result.view.ndim = ndim
26173  */
26174   __pyx_t_5 = __pyx_v_memviewslice.memview->view;
26175   __pyx_v_result->__pyx_base.view = __pyx_t_5;
26176 
26177   /* "View.MemoryView":1018
26178  *
26179  *     result.view = memviewslice.memview.view
26180  *     result.view.buf = <void *> memviewslice.data             # <<<<<<<<<<<<<<
26181  *     result.view.ndim = ndim
26182  *     (<__pyx_buffer *> &result.view).obj = Py_None
26183  */
26184   __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
26185 
26186   /* "View.MemoryView":1019
26187  *     result.view = memviewslice.memview.view
26188  *     result.view.buf = <void *> memviewslice.data
26189  *     result.view.ndim = ndim             # <<<<<<<<<<<<<<
26190  *     (<__pyx_buffer *> &result.view).obj = Py_None
26191  *     Py_INCREF(Py_None)
26192  */
26193   __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
26194 
26195   /* "View.MemoryView":1020
26196  *     result.view.buf = <void *> memviewslice.data
26197  *     result.view.ndim = ndim
26198  *     (<__pyx_buffer *> &result.view).obj = Py_None             # <<<<<<<<<<<<<<
26199  *     Py_INCREF(Py_None)
26200  *
26201  */
26202   ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
26203 
26204   /* "View.MemoryView":1021
26205  *     result.view.ndim = ndim
26206  *     (<__pyx_buffer *> &result.view).obj = Py_None
26207  *     Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
26208  *
26209  *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
26210  */
26211   Py_INCREF(Py_None);
26212 
26213   /* "View.MemoryView":1023
26214  *     Py_INCREF(Py_None)
26215  *
26216  *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:             # <<<<<<<<<<<<<<
26217  *         result.flags = PyBUF_RECORDS
26218  *     else:
26219  */
26220   __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
26221   if (__pyx_t_1) {
26222 
26223     /* "View.MemoryView":1024
26224  *
26225  *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
26226  *         result.flags = PyBUF_RECORDS             # <<<<<<<<<<<<<<
26227  *     else:
26228  *         result.flags = PyBUF_RECORDS_RO
26229  */
26230     __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
26231 
26232     /* "View.MemoryView":1023
26233  *     Py_INCREF(Py_None)
26234  *
26235  *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:             # <<<<<<<<<<<<<<
26236  *         result.flags = PyBUF_RECORDS
26237  *     else:
26238  */
26239     goto __pyx_L4;
26240   }
26241 
26242   /* "View.MemoryView":1026
26243  *         result.flags = PyBUF_RECORDS
26244  *     else:
26245  *         result.flags = PyBUF_RECORDS_RO             # <<<<<<<<<<<<<<
26246  *
26247  *     result.view.shape = <Py_ssize_t *> result.from_slice.shape
26248  */
26249   /*else*/ {
26250     __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
26251   }
26252   __pyx_L4:;
26253 
26254   /* "View.MemoryView":1028
26255  *         result.flags = PyBUF_RECORDS_RO
26256  *
26257  *     result.view.shape = <Py_ssize_t *> result.from_slice.shape             # <<<<<<<<<<<<<<
26258  *     result.view.strides = <Py_ssize_t *> result.from_slice.strides
26259  *
26260  */
26261   __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
26262 
26263   /* "View.MemoryView":1029
26264  *
26265  *     result.view.shape = <Py_ssize_t *> result.from_slice.shape
26266  *     result.view.strides = <Py_ssize_t *> result.from_slice.strides             # <<<<<<<<<<<<<<
26267  *
26268  *
26269  */
26270   __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
26271 
26272   /* "View.MemoryView":1032
26273  *
26274  *
26275  *     result.view.suboffsets = NULL             # <<<<<<<<<<<<<<
26276  *     for suboffset in result.from_slice.suboffsets[:ndim]:
26277  *         if suboffset >= 0:
26278  */
26279   __pyx_v_result->__pyx_base.view.suboffsets = NULL;
26280 
26281   /* "View.MemoryView":1033
26282  *
26283  *     result.view.suboffsets = NULL
26284  *     for suboffset in result.from_slice.suboffsets[:ndim]:             # <<<<<<<<<<<<<<
26285  *         if suboffset >= 0:
26286  *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
26287  */
26288   __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
26289   for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
26290     __pyx_t_6 = __pyx_t_8;
26291     __pyx_v_suboffset = (__pyx_t_6[0]);
26292 
26293     /* "View.MemoryView":1034
26294  *     result.view.suboffsets = NULL
26295  *     for suboffset in result.from_slice.suboffsets[:ndim]:
26296  *         if suboffset >= 0:             # <<<<<<<<<<<<<<
26297  *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
26298  *             break
26299  */
26300     __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
26301     if (__pyx_t_1) {
26302 
26303       /* "View.MemoryView":1035
26304  *     for suboffset in result.from_slice.suboffsets[:ndim]:
26305  *         if suboffset >= 0:
26306  *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets             # <<<<<<<<<<<<<<
26307  *             break
26308  *
26309  */
26310       __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
26311 
26312       /* "View.MemoryView":1036
26313  *         if suboffset >= 0:
26314  *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
26315  *             break             # <<<<<<<<<<<<<<
26316  *
26317  *     result.view.len = result.view.itemsize
26318  */
26319       goto __pyx_L6_break;
26320 
26321       /* "View.MemoryView":1034
26322  *     result.view.suboffsets = NULL
26323  *     for suboffset in result.from_slice.suboffsets[:ndim]:
26324  *         if suboffset >= 0:             # <<<<<<<<<<<<<<
26325  *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
26326  *             break
26327  */
26328     }
26329   }
26330   __pyx_L6_break:;
26331 
26332   /* "View.MemoryView":1038
26333  *             break
26334  *
26335  *     result.view.len = result.view.itemsize             # <<<<<<<<<<<<<<
26336  *     for length in result.view.shape[:ndim]:
26337  *         result.view.len *= length
26338  */
26339   __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
26340   __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
26341 
26342   /* "View.MemoryView":1039
26343  *
26344  *     result.view.len = result.view.itemsize
26345  *     for length in result.view.shape[:ndim]:             # <<<<<<<<<<<<<<
26346  *         result.view.len *= length
26347  *
26348  */
26349   __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
26350   for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
26351     __pyx_t_6 = __pyx_t_8;
26352     __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1039, __pyx_L1_error)
26353     __Pyx_GOTREF(__pyx_t_2);
26354     __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
26355     __pyx_t_2 = 0;
26356 
26357     /* "View.MemoryView":1040
26358  *     result.view.len = result.view.itemsize
26359  *     for length in result.view.shape[:ndim]:
26360  *         result.view.len *= length             # <<<<<<<<<<<<<<
26361  *
26362  *     result.to_object_func = to_object_func
26363  */
26364     __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1040, __pyx_L1_error)
26365     __Pyx_GOTREF(__pyx_t_2);
26366     __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1040, __pyx_L1_error)
26367     __Pyx_GOTREF(__pyx_t_3);
26368     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26369     __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1040, __pyx_L1_error)
26370     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26371     __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
26372   }
26373 
26374   /* "View.MemoryView":1042
26375  *         result.view.len *= length
26376  *
26377  *     result.to_object_func = to_object_func             # <<<<<<<<<<<<<<
26378  *     result.to_dtype_func = to_dtype_func
26379  *
26380  */
26381   __pyx_v_result->to_object_func = __pyx_v_to_object_func;
26382 
26383   /* "View.MemoryView":1043
26384  *
26385  *     result.to_object_func = to_object_func
26386  *     result.to_dtype_func = to_dtype_func             # <<<<<<<<<<<<<<
26387  *
26388  *     return result
26389  */
26390   __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
26391 
26392   /* "View.MemoryView":1045
26393  *     result.to_dtype_func = to_dtype_func
26394  *
26395  *     return result             # <<<<<<<<<<<<<<
26396  *
26397  * @cname('__pyx_memoryview_get_slice_from_memoryview')
26398  */
26399   __Pyx_XDECREF(__pyx_r);
26400   __Pyx_INCREF(((PyObject *)__pyx_v_result));
26401   __pyx_r = ((PyObject *)__pyx_v_result);
26402   goto __pyx_L0;
26403 
26404   /* "View.MemoryView":995
26405  *
26406  * @cname('__pyx_memoryview_fromslice')
26407  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice,             # <<<<<<<<<<<<<<
26408  *                           int ndim,
26409  *                           object (*to_object_func)(char *),
26410  */
26411 
26412   /* function exit code */
26413   __pyx_L1_error:;
26414   __Pyx_XDECREF(__pyx_t_2);
26415   __Pyx_XDECREF(__pyx_t_3);
26416   __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
26417   __pyx_r = 0;
26418   __pyx_L0:;
26419   __Pyx_XDECREF((PyObject *)__pyx_v_result);
26420   __Pyx_XDECREF(__pyx_v_length);
26421   __Pyx_XGIVEREF(__pyx_r);
26422   __Pyx_RefNannyFinishContext();
26423   return __pyx_r;
26424 }
26425 
26426 /* "View.MemoryView":1048
26427  *
26428  * @cname('__pyx_memoryview_get_slice_from_memoryview')
26429  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview,             # <<<<<<<<<<<<<<
26430  *                                                    __Pyx_memviewslice *mslice):
26431  *     cdef _memoryviewslice obj
26432  */
26433 
__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj * __pyx_v_memview,__Pyx_memviewslice * __pyx_v_mslice)26434 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
26435   struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
26436   __Pyx_memviewslice *__pyx_r;
26437   __Pyx_RefNannyDeclarations
26438   int __pyx_t_1;
26439   int __pyx_t_2;
26440   PyObject *__pyx_t_3 = NULL;
26441   __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
26442 
26443   /* "View.MemoryView":1051
26444  *                                                    __Pyx_memviewslice *mslice):
26445  *     cdef _memoryviewslice obj
26446  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
26447  *         obj = memview
26448  *         return &obj.from_slice
26449  */
26450   __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
26451   __pyx_t_2 = (__pyx_t_1 != 0);
26452   if (__pyx_t_2) {
26453 
26454     /* "View.MemoryView":1052
26455  *     cdef _memoryviewslice obj
26456  *     if isinstance(memview, _memoryviewslice):
26457  *         obj = memview             # <<<<<<<<<<<<<<
26458  *         return &obj.from_slice
26459  *     else:
26460  */
26461     if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1052, __pyx_L1_error)
26462     __pyx_t_3 = ((PyObject *)__pyx_v_memview);
26463     __Pyx_INCREF(__pyx_t_3);
26464     __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
26465     __pyx_t_3 = 0;
26466 
26467     /* "View.MemoryView":1053
26468  *     if isinstance(memview, _memoryviewslice):
26469  *         obj = memview
26470  *         return &obj.from_slice             # <<<<<<<<<<<<<<
26471  *     else:
26472  *         slice_copy(memview, mslice)
26473  */
26474     __pyx_r = (&__pyx_v_obj->from_slice);
26475     goto __pyx_L0;
26476 
26477     /* "View.MemoryView":1051
26478  *                                                    __Pyx_memviewslice *mslice):
26479  *     cdef _memoryviewslice obj
26480  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
26481  *         obj = memview
26482  *         return &obj.from_slice
26483  */
26484   }
26485 
26486   /* "View.MemoryView":1055
26487  *         return &obj.from_slice
26488  *     else:
26489  *         slice_copy(memview, mslice)             # <<<<<<<<<<<<<<
26490  *         return mslice
26491  *
26492  */
26493   /*else*/ {
26494     __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
26495 
26496     /* "View.MemoryView":1056
26497  *     else:
26498  *         slice_copy(memview, mslice)
26499  *         return mslice             # <<<<<<<<<<<<<<
26500  *
26501  * @cname('__pyx_memoryview_slice_copy')
26502  */
26503     __pyx_r = __pyx_v_mslice;
26504     goto __pyx_L0;
26505   }
26506 
26507   /* "View.MemoryView":1048
26508  *
26509  * @cname('__pyx_memoryview_get_slice_from_memoryview')
26510  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview,             # <<<<<<<<<<<<<<
26511  *                                                    __Pyx_memviewslice *mslice):
26512  *     cdef _memoryviewslice obj
26513  */
26514 
26515   /* function exit code */
26516   __pyx_L1_error:;
26517   __Pyx_XDECREF(__pyx_t_3);
26518   __Pyx_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
26519   __pyx_r = 0;
26520   __pyx_L0:;
26521   __Pyx_XDECREF((PyObject *)__pyx_v_obj);
26522   __Pyx_RefNannyFinishContext();
26523   return __pyx_r;
26524 }
26525 
26526 /* "View.MemoryView":1059
26527  *
26528  * @cname('__pyx_memoryview_slice_copy')
26529  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst):             # <<<<<<<<<<<<<<
26530  *     cdef int dim
26531  *     cdef (Py_ssize_t*) shape, strides, suboffsets
26532  */
26533 
__pyx_memoryview_slice_copy(struct __pyx_memoryview_obj * __pyx_v_memview,__Pyx_memviewslice * __pyx_v_dst)26534 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
26535   int __pyx_v_dim;
26536   Py_ssize_t *__pyx_v_shape;
26537   Py_ssize_t *__pyx_v_strides;
26538   Py_ssize_t *__pyx_v_suboffsets;
26539   __Pyx_RefNannyDeclarations
26540   Py_ssize_t *__pyx_t_1;
26541   int __pyx_t_2;
26542   int __pyx_t_3;
26543   int __pyx_t_4;
26544   Py_ssize_t __pyx_t_5;
26545   __Pyx_RefNannySetupContext("slice_copy", 0);
26546 
26547   /* "View.MemoryView":1063
26548  *     cdef (Py_ssize_t*) shape, strides, suboffsets
26549  *
26550  *     shape = memview.view.shape             # <<<<<<<<<<<<<<
26551  *     strides = memview.view.strides
26552  *     suboffsets = memview.view.suboffsets
26553  */
26554   __pyx_t_1 = __pyx_v_memview->view.shape;
26555   __pyx_v_shape = __pyx_t_1;
26556 
26557   /* "View.MemoryView":1064
26558  *
26559  *     shape = memview.view.shape
26560  *     strides = memview.view.strides             # <<<<<<<<<<<<<<
26561  *     suboffsets = memview.view.suboffsets
26562  *
26563  */
26564   __pyx_t_1 = __pyx_v_memview->view.strides;
26565   __pyx_v_strides = __pyx_t_1;
26566 
26567   /* "View.MemoryView":1065
26568  *     shape = memview.view.shape
26569  *     strides = memview.view.strides
26570  *     suboffsets = memview.view.suboffsets             # <<<<<<<<<<<<<<
26571  *
26572  *     dst.memview = <__pyx_memoryview *> memview
26573  */
26574   __pyx_t_1 = __pyx_v_memview->view.suboffsets;
26575   __pyx_v_suboffsets = __pyx_t_1;
26576 
26577   /* "View.MemoryView":1067
26578  *     suboffsets = memview.view.suboffsets
26579  *
26580  *     dst.memview = <__pyx_memoryview *> memview             # <<<<<<<<<<<<<<
26581  *     dst.data = <char *> memview.view.buf
26582  *
26583  */
26584   __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
26585 
26586   /* "View.MemoryView":1068
26587  *
26588  *     dst.memview = <__pyx_memoryview *> memview
26589  *     dst.data = <char *> memview.view.buf             # <<<<<<<<<<<<<<
26590  *
26591  *     for dim in range(memview.view.ndim):
26592  */
26593   __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
26594 
26595   /* "View.MemoryView":1070
26596  *     dst.data = <char *> memview.view.buf
26597  *
26598  *     for dim in range(memview.view.ndim):             # <<<<<<<<<<<<<<
26599  *         dst.shape[dim] = shape[dim]
26600  *         dst.strides[dim] = strides[dim]
26601  */
26602   __pyx_t_2 = __pyx_v_memview->view.ndim;
26603   __pyx_t_3 = __pyx_t_2;
26604   for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
26605     __pyx_v_dim = __pyx_t_4;
26606 
26607     /* "View.MemoryView":1071
26608  *
26609  *     for dim in range(memview.view.ndim):
26610  *         dst.shape[dim] = shape[dim]             # <<<<<<<<<<<<<<
26611  *         dst.strides[dim] = strides[dim]
26612  *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
26613  */
26614     (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
26615 
26616     /* "View.MemoryView":1072
26617  *     for dim in range(memview.view.ndim):
26618  *         dst.shape[dim] = shape[dim]
26619  *         dst.strides[dim] = strides[dim]             # <<<<<<<<<<<<<<
26620  *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
26621  *
26622  */
26623     (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
26624 
26625     /* "View.MemoryView":1073
26626  *         dst.shape[dim] = shape[dim]
26627  *         dst.strides[dim] = strides[dim]
26628  *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1             # <<<<<<<<<<<<<<
26629  *
26630  * @cname('__pyx_memoryview_copy_object')
26631  */
26632     if ((__pyx_v_suboffsets != 0)) {
26633       __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
26634     } else {
26635       __pyx_t_5 = -1L;
26636     }
26637     (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
26638   }
26639 
26640   /* "View.MemoryView":1059
26641  *
26642  * @cname('__pyx_memoryview_slice_copy')
26643  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst):             # <<<<<<<<<<<<<<
26644  *     cdef int dim
26645  *     cdef (Py_ssize_t*) shape, strides, suboffsets
26646  */
26647 
26648   /* function exit code */
26649   __Pyx_RefNannyFinishContext();
26650 }
26651 
26652 /* "View.MemoryView":1076
26653  *
26654  * @cname('__pyx_memoryview_copy_object')
26655  * cdef memoryview_copy(memoryview memview):             # <<<<<<<<<<<<<<
26656  *     "Create a new memoryview object"
26657  *     cdef __Pyx_memviewslice memviewslice
26658  */
26659 
__pyx_memoryview_copy_object(struct __pyx_memoryview_obj * __pyx_v_memview)26660 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
26661   __Pyx_memviewslice __pyx_v_memviewslice;
26662   PyObject *__pyx_r = NULL;
26663   __Pyx_RefNannyDeclarations
26664   PyObject *__pyx_t_1 = NULL;
26665   __Pyx_RefNannySetupContext("memoryview_copy", 0);
26666 
26667   /* "View.MemoryView":1079
26668  *     "Create a new memoryview object"
26669  *     cdef __Pyx_memviewslice memviewslice
26670  *     slice_copy(memview, &memviewslice)             # <<<<<<<<<<<<<<
26671  *     return memoryview_copy_from_slice(memview, &memviewslice)
26672  *
26673  */
26674   __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
26675 
26676   /* "View.MemoryView":1080
26677  *     cdef __Pyx_memviewslice memviewslice
26678  *     slice_copy(memview, &memviewslice)
26679  *     return memoryview_copy_from_slice(memview, &memviewslice)             # <<<<<<<<<<<<<<
26680  *
26681  * @cname('__pyx_memoryview_copy_object_from_slice')
26682  */
26683   __Pyx_XDECREF(__pyx_r);
26684   __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1080, __pyx_L1_error)
26685   __Pyx_GOTREF(__pyx_t_1);
26686   __pyx_r = __pyx_t_1;
26687   __pyx_t_1 = 0;
26688   goto __pyx_L0;
26689 
26690   /* "View.MemoryView":1076
26691  *
26692  * @cname('__pyx_memoryview_copy_object')
26693  * cdef memoryview_copy(memoryview memview):             # <<<<<<<<<<<<<<
26694  *     "Create a new memoryview object"
26695  *     cdef __Pyx_memviewslice memviewslice
26696  */
26697 
26698   /* function exit code */
26699   __pyx_L1_error:;
26700   __Pyx_XDECREF(__pyx_t_1);
26701   __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
26702   __pyx_r = 0;
26703   __pyx_L0:;
26704   __Pyx_XGIVEREF(__pyx_r);
26705   __Pyx_RefNannyFinishContext();
26706   return __pyx_r;
26707 }
26708 
26709 /* "View.MemoryView":1083
26710  *
26711  * @cname('__pyx_memoryview_copy_object_from_slice')
26712  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice):             # <<<<<<<<<<<<<<
26713  *     """
26714  *     Create a new memoryview object from a given memoryview object and slice.
26715  */
26716 
__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj * __pyx_v_memview,__Pyx_memviewslice * __pyx_v_memviewslice)26717 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
26718   PyObject *(*__pyx_v_to_object_func)(char *);
26719   int (*__pyx_v_to_dtype_func)(char *, PyObject *);
26720   PyObject *__pyx_r = NULL;
26721   __Pyx_RefNannyDeclarations
26722   int __pyx_t_1;
26723   int __pyx_t_2;
26724   PyObject *(*__pyx_t_3)(char *);
26725   int (*__pyx_t_4)(char *, PyObject *);
26726   PyObject *__pyx_t_5 = NULL;
26727   __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
26728 
26729   /* "View.MemoryView":1090
26730  *     cdef int (*to_dtype_func)(char *, object) except 0
26731  *
26732  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
26733  *         to_object_func = (<_memoryviewslice> memview).to_object_func
26734  *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
26735  */
26736   __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
26737   __pyx_t_2 = (__pyx_t_1 != 0);
26738   if (__pyx_t_2) {
26739 
26740     /* "View.MemoryView":1091
26741  *
26742  *     if isinstance(memview, _memoryviewslice):
26743  *         to_object_func = (<_memoryviewslice> memview).to_object_func             # <<<<<<<<<<<<<<
26744  *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
26745  *     else:
26746  */
26747     __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
26748     __pyx_v_to_object_func = __pyx_t_3;
26749 
26750     /* "View.MemoryView":1092
26751  *     if isinstance(memview, _memoryviewslice):
26752  *         to_object_func = (<_memoryviewslice> memview).to_object_func
26753  *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func             # <<<<<<<<<<<<<<
26754  *     else:
26755  *         to_object_func = NULL
26756  */
26757     __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
26758     __pyx_v_to_dtype_func = __pyx_t_4;
26759 
26760     /* "View.MemoryView":1090
26761  *     cdef int (*to_dtype_func)(char *, object) except 0
26762  *
26763  *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
26764  *         to_object_func = (<_memoryviewslice> memview).to_object_func
26765  *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
26766  */
26767     goto __pyx_L3;
26768   }
26769 
26770   /* "View.MemoryView":1094
26771  *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
26772  *     else:
26773  *         to_object_func = NULL             # <<<<<<<<<<<<<<
26774  *         to_dtype_func = NULL
26775  *
26776  */
26777   /*else*/ {
26778     __pyx_v_to_object_func = NULL;
26779 
26780     /* "View.MemoryView":1095
26781  *     else:
26782  *         to_object_func = NULL
26783  *         to_dtype_func = NULL             # <<<<<<<<<<<<<<
26784  *
26785  *     return memoryview_fromslice(memviewslice[0], memview.view.ndim,
26786  */
26787     __pyx_v_to_dtype_func = NULL;
26788   }
26789   __pyx_L3:;
26790 
26791   /* "View.MemoryView":1097
26792  *         to_dtype_func = NULL
26793  *
26794  *     return memoryview_fromslice(memviewslice[0], memview.view.ndim,             # <<<<<<<<<<<<<<
26795  *                                 to_object_func, to_dtype_func,
26796  *                                 memview.dtype_is_object)
26797  */
26798   __Pyx_XDECREF(__pyx_r);
26799 
26800   /* "View.MemoryView":1099
26801  *     return memoryview_fromslice(memviewslice[0], memview.view.ndim,
26802  *                                 to_object_func, to_dtype_func,
26803  *                                 memview.dtype_is_object)             # <<<<<<<<<<<<<<
26804  *
26805  *
26806  */
26807   __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1097, __pyx_L1_error)
26808   __Pyx_GOTREF(__pyx_t_5);
26809   __pyx_r = __pyx_t_5;
26810   __pyx_t_5 = 0;
26811   goto __pyx_L0;
26812 
26813   /* "View.MemoryView":1083
26814  *
26815  * @cname('__pyx_memoryview_copy_object_from_slice')
26816  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice):             # <<<<<<<<<<<<<<
26817  *     """
26818  *     Create a new memoryview object from a given memoryview object and slice.
26819  */
26820 
26821   /* function exit code */
26822   __pyx_L1_error:;
26823   __Pyx_XDECREF(__pyx_t_5);
26824   __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
26825   __pyx_r = 0;
26826   __pyx_L0:;
26827   __Pyx_XGIVEREF(__pyx_r);
26828   __Pyx_RefNannyFinishContext();
26829   return __pyx_r;
26830 }
26831 
26832 /* "View.MemoryView":1105
26833  *
26834  *
26835  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:             # <<<<<<<<<<<<<<
26836  *     if arg < 0:
26837  *         return -arg
26838  */
26839 
abs_py_ssize_t(Py_ssize_t __pyx_v_arg)26840 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
26841   Py_ssize_t __pyx_r;
26842   int __pyx_t_1;
26843 
26844   /* "View.MemoryView":1106
26845  *
26846  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
26847  *     if arg < 0:             # <<<<<<<<<<<<<<
26848  *         return -arg
26849  *     else:
26850  */
26851   __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
26852   if (__pyx_t_1) {
26853 
26854     /* "View.MemoryView":1107
26855  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
26856  *     if arg < 0:
26857  *         return -arg             # <<<<<<<<<<<<<<
26858  *     else:
26859  *         return arg
26860  */
26861     __pyx_r = (-__pyx_v_arg);
26862     goto __pyx_L0;
26863 
26864     /* "View.MemoryView":1106
26865  *
26866  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
26867  *     if arg < 0:             # <<<<<<<<<<<<<<
26868  *         return -arg
26869  *     else:
26870  */
26871   }
26872 
26873   /* "View.MemoryView":1109
26874  *         return -arg
26875  *     else:
26876  *         return arg             # <<<<<<<<<<<<<<
26877  *
26878  * @cname('__pyx_get_best_slice_order')
26879  */
26880   /*else*/ {
26881     __pyx_r = __pyx_v_arg;
26882     goto __pyx_L0;
26883   }
26884 
26885   /* "View.MemoryView":1105
26886  *
26887  *
26888  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:             # <<<<<<<<<<<<<<
26889  *     if arg < 0:
26890  *         return -arg
26891  */
26892 
26893   /* function exit code */
26894   __pyx_L0:;
26895   return __pyx_r;
26896 }
26897 
26898 /* "View.MemoryView":1112
26899  *
26900  * @cname('__pyx_get_best_slice_order')
26901  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil:             # <<<<<<<<<<<<<<
26902  *     """
26903  *     Figure out the best memory access order for a given slice.
26904  */
26905 
__pyx_get_best_slice_order(__Pyx_memviewslice * __pyx_v_mslice,int __pyx_v_ndim)26906 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
26907   int __pyx_v_i;
26908   Py_ssize_t __pyx_v_c_stride;
26909   Py_ssize_t __pyx_v_f_stride;
26910   char __pyx_r;
26911   int __pyx_t_1;
26912   int __pyx_t_2;
26913   int __pyx_t_3;
26914   int __pyx_t_4;
26915 
26916   /* "View.MemoryView":1117
26917  *     """
26918  *     cdef int i
26919  *     cdef Py_ssize_t c_stride = 0             # <<<<<<<<<<<<<<
26920  *     cdef Py_ssize_t f_stride = 0
26921  *
26922  */
26923   __pyx_v_c_stride = 0;
26924 
26925   /* "View.MemoryView":1118
26926  *     cdef int i
26927  *     cdef Py_ssize_t c_stride = 0
26928  *     cdef Py_ssize_t f_stride = 0             # <<<<<<<<<<<<<<
26929  *
26930  *     for i in range(ndim - 1, -1, -1):
26931  */
26932   __pyx_v_f_stride = 0;
26933 
26934   /* "View.MemoryView":1120
26935  *     cdef Py_ssize_t f_stride = 0
26936  *
26937  *     for i in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
26938  *         if mslice.shape[i] > 1:
26939  *             c_stride = mslice.strides[i]
26940  */
26941   for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
26942     __pyx_v_i = __pyx_t_1;
26943 
26944     /* "View.MemoryView":1121
26945  *
26946  *     for i in range(ndim - 1, -1, -1):
26947  *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
26948  *             c_stride = mslice.strides[i]
26949  *             break
26950  */
26951     __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
26952     if (__pyx_t_2) {
26953 
26954       /* "View.MemoryView":1122
26955  *     for i in range(ndim - 1, -1, -1):
26956  *         if mslice.shape[i] > 1:
26957  *             c_stride = mslice.strides[i]             # <<<<<<<<<<<<<<
26958  *             break
26959  *
26960  */
26961       __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
26962 
26963       /* "View.MemoryView":1123
26964  *         if mslice.shape[i] > 1:
26965  *             c_stride = mslice.strides[i]
26966  *             break             # <<<<<<<<<<<<<<
26967  *
26968  *     for i in range(ndim):
26969  */
26970       goto __pyx_L4_break;
26971 
26972       /* "View.MemoryView":1121
26973  *
26974  *     for i in range(ndim - 1, -1, -1):
26975  *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
26976  *             c_stride = mslice.strides[i]
26977  *             break
26978  */
26979     }
26980   }
26981   __pyx_L4_break:;
26982 
26983   /* "View.MemoryView":1125
26984  *             break
26985  *
26986  *     for i in range(ndim):             # <<<<<<<<<<<<<<
26987  *         if mslice.shape[i] > 1:
26988  *             f_stride = mslice.strides[i]
26989  */
26990   __pyx_t_1 = __pyx_v_ndim;
26991   __pyx_t_3 = __pyx_t_1;
26992   for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
26993     __pyx_v_i = __pyx_t_4;
26994 
26995     /* "View.MemoryView":1126
26996  *
26997  *     for i in range(ndim):
26998  *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
26999  *             f_stride = mslice.strides[i]
27000  *             break
27001  */
27002     __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
27003     if (__pyx_t_2) {
27004 
27005       /* "View.MemoryView":1127
27006  *     for i in range(ndim):
27007  *         if mslice.shape[i] > 1:
27008  *             f_stride = mslice.strides[i]             # <<<<<<<<<<<<<<
27009  *             break
27010  *
27011  */
27012       __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
27013 
27014       /* "View.MemoryView":1128
27015  *         if mslice.shape[i] > 1:
27016  *             f_stride = mslice.strides[i]
27017  *             break             # <<<<<<<<<<<<<<
27018  *
27019  *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
27020  */
27021       goto __pyx_L7_break;
27022 
27023       /* "View.MemoryView":1126
27024  *
27025  *     for i in range(ndim):
27026  *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
27027  *             f_stride = mslice.strides[i]
27028  *             break
27029  */
27030     }
27031   }
27032   __pyx_L7_break:;
27033 
27034   /* "View.MemoryView":1130
27035  *             break
27036  *
27037  *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):             # <<<<<<<<<<<<<<
27038  *         return 'C'
27039  *     else:
27040  */
27041   __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
27042   if (__pyx_t_2) {
27043 
27044     /* "View.MemoryView":1131
27045  *
27046  *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
27047  *         return 'C'             # <<<<<<<<<<<<<<
27048  *     else:
27049  *         return 'F'
27050  */
27051     __pyx_r = 'C';
27052     goto __pyx_L0;
27053 
27054     /* "View.MemoryView":1130
27055  *             break
27056  *
27057  *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):             # <<<<<<<<<<<<<<
27058  *         return 'C'
27059  *     else:
27060  */
27061   }
27062 
27063   /* "View.MemoryView":1133
27064  *         return 'C'
27065  *     else:
27066  *         return 'F'             # <<<<<<<<<<<<<<
27067  *
27068  * @cython.cdivision(True)
27069  */
27070   /*else*/ {
27071     __pyx_r = 'F';
27072     goto __pyx_L0;
27073   }
27074 
27075   /* "View.MemoryView":1112
27076  *
27077  * @cname('__pyx_get_best_slice_order')
27078  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil:             # <<<<<<<<<<<<<<
27079  *     """
27080  *     Figure out the best memory access order for a given slice.
27081  */
27082 
27083   /* function exit code */
27084   __pyx_L0:;
27085   return __pyx_r;
27086 }
27087 
27088 /* "View.MemoryView":1136
27089  *
27090  * @cython.cdivision(True)
27091  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides,             # <<<<<<<<<<<<<<
27092  *                                    char *dst_data, Py_ssize_t *dst_strides,
27093  *                                    Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
27094  */
27095 
_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)27096 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) {
27097   CYTHON_UNUSED Py_ssize_t __pyx_v_i;
27098   CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
27099   Py_ssize_t __pyx_v_dst_extent;
27100   Py_ssize_t __pyx_v_src_stride;
27101   Py_ssize_t __pyx_v_dst_stride;
27102   int __pyx_t_1;
27103   int __pyx_t_2;
27104   int __pyx_t_3;
27105   Py_ssize_t __pyx_t_4;
27106   Py_ssize_t __pyx_t_5;
27107   Py_ssize_t __pyx_t_6;
27108 
27109   /* "View.MemoryView":1143
27110  *
27111  *     cdef Py_ssize_t i
27112  *     cdef Py_ssize_t src_extent = src_shape[0]             # <<<<<<<<<<<<<<
27113  *     cdef Py_ssize_t dst_extent = dst_shape[0]
27114  *     cdef Py_ssize_t src_stride = src_strides[0]
27115  */
27116   __pyx_v_src_extent = (__pyx_v_src_shape[0]);
27117 
27118   /* "View.MemoryView":1144
27119  *     cdef Py_ssize_t i
27120  *     cdef Py_ssize_t src_extent = src_shape[0]
27121  *     cdef Py_ssize_t dst_extent = dst_shape[0]             # <<<<<<<<<<<<<<
27122  *     cdef Py_ssize_t src_stride = src_strides[0]
27123  *     cdef Py_ssize_t dst_stride = dst_strides[0]
27124  */
27125   __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
27126 
27127   /* "View.MemoryView":1145
27128  *     cdef Py_ssize_t src_extent = src_shape[0]
27129  *     cdef Py_ssize_t dst_extent = dst_shape[0]
27130  *     cdef Py_ssize_t src_stride = src_strides[0]             # <<<<<<<<<<<<<<
27131  *     cdef Py_ssize_t dst_stride = dst_strides[0]
27132  *
27133  */
27134   __pyx_v_src_stride = (__pyx_v_src_strides[0]);
27135 
27136   /* "View.MemoryView":1146
27137  *     cdef Py_ssize_t dst_extent = dst_shape[0]
27138  *     cdef Py_ssize_t src_stride = src_strides[0]
27139  *     cdef Py_ssize_t dst_stride = dst_strides[0]             # <<<<<<<<<<<<<<
27140  *
27141  *     if ndim == 1:
27142  */
27143   __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
27144 
27145   /* "View.MemoryView":1148
27146  *     cdef Py_ssize_t dst_stride = dst_strides[0]
27147  *
27148  *     if ndim == 1:             # <<<<<<<<<<<<<<
27149  *        if (src_stride > 0 and dst_stride > 0 and
27150  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
27151  */
27152   __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
27153   if (__pyx_t_1) {
27154 
27155     /* "View.MemoryView":1149
27156  *
27157  *     if ndim == 1:
27158  *        if (src_stride > 0 and dst_stride > 0 and             # <<<<<<<<<<<<<<
27159  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
27160  *            memcpy(dst_data, src_data, itemsize * dst_extent)
27161  */
27162     __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
27163     if (__pyx_t_2) {
27164     } else {
27165       __pyx_t_1 = __pyx_t_2;
27166       goto __pyx_L5_bool_binop_done;
27167     }
27168     __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
27169     if (__pyx_t_2) {
27170     } else {
27171       __pyx_t_1 = __pyx_t_2;
27172       goto __pyx_L5_bool_binop_done;
27173     }
27174 
27175     /* "View.MemoryView":1150
27176  *     if ndim == 1:
27177  *        if (src_stride > 0 and dst_stride > 0 and
27178  *            <size_t> src_stride == itemsize == <size_t> dst_stride):             # <<<<<<<<<<<<<<
27179  *            memcpy(dst_data, src_data, itemsize * dst_extent)
27180  *        else:
27181  */
27182     __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
27183     if (__pyx_t_2) {
27184       __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
27185     }
27186     __pyx_t_3 = (__pyx_t_2 != 0);
27187     __pyx_t_1 = __pyx_t_3;
27188     __pyx_L5_bool_binop_done:;
27189 
27190     /* "View.MemoryView":1149
27191  *
27192  *     if ndim == 1:
27193  *        if (src_stride > 0 and dst_stride > 0 and             # <<<<<<<<<<<<<<
27194  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
27195  *            memcpy(dst_data, src_data, itemsize * dst_extent)
27196  */
27197     if (__pyx_t_1) {
27198 
27199       /* "View.MemoryView":1151
27200  *        if (src_stride > 0 and dst_stride > 0 and
27201  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
27202  *            memcpy(dst_data, src_data, itemsize * dst_extent)             # <<<<<<<<<<<<<<
27203  *        else:
27204  *            for i in range(dst_extent):
27205  */
27206       (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
27207 
27208       /* "View.MemoryView":1149
27209  *
27210  *     if ndim == 1:
27211  *        if (src_stride > 0 and dst_stride > 0 and             # <<<<<<<<<<<<<<
27212  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
27213  *            memcpy(dst_data, src_data, itemsize * dst_extent)
27214  */
27215       goto __pyx_L4;
27216     }
27217 
27218     /* "View.MemoryView":1153
27219  *            memcpy(dst_data, src_data, itemsize * dst_extent)
27220  *        else:
27221  *            for i in range(dst_extent):             # <<<<<<<<<<<<<<
27222  *                memcpy(dst_data, src_data, itemsize)
27223  *                src_data += src_stride
27224  */
27225     /*else*/ {
27226       __pyx_t_4 = __pyx_v_dst_extent;
27227       __pyx_t_5 = __pyx_t_4;
27228       for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
27229         __pyx_v_i = __pyx_t_6;
27230 
27231         /* "View.MemoryView":1154
27232  *        else:
27233  *            for i in range(dst_extent):
27234  *                memcpy(dst_data, src_data, itemsize)             # <<<<<<<<<<<<<<
27235  *                src_data += src_stride
27236  *                dst_data += dst_stride
27237  */
27238         (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
27239 
27240         /* "View.MemoryView":1155
27241  *            for i in range(dst_extent):
27242  *                memcpy(dst_data, src_data, itemsize)
27243  *                src_data += src_stride             # <<<<<<<<<<<<<<
27244  *                dst_data += dst_stride
27245  *     else:
27246  */
27247         __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
27248 
27249         /* "View.MemoryView":1156
27250  *                memcpy(dst_data, src_data, itemsize)
27251  *                src_data += src_stride
27252  *                dst_data += dst_stride             # <<<<<<<<<<<<<<
27253  *     else:
27254  *         for i in range(dst_extent):
27255  */
27256         __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
27257       }
27258     }
27259     __pyx_L4:;
27260 
27261     /* "View.MemoryView":1148
27262  *     cdef Py_ssize_t dst_stride = dst_strides[0]
27263  *
27264  *     if ndim == 1:             # <<<<<<<<<<<<<<
27265  *        if (src_stride > 0 and dst_stride > 0 and
27266  *            <size_t> src_stride == itemsize == <size_t> dst_stride):
27267  */
27268     goto __pyx_L3;
27269   }
27270 
27271   /* "View.MemoryView":1158
27272  *                dst_data += dst_stride
27273  *     else:
27274  *         for i in range(dst_extent):             # <<<<<<<<<<<<<<
27275  *             _copy_strided_to_strided(src_data, src_strides + 1,
27276  *                                      dst_data, dst_strides + 1,
27277  */
27278   /*else*/ {
27279     __pyx_t_4 = __pyx_v_dst_extent;
27280     __pyx_t_5 = __pyx_t_4;
27281     for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
27282       __pyx_v_i = __pyx_t_6;
27283 
27284       /* "View.MemoryView":1159
27285  *     else:
27286  *         for i in range(dst_extent):
27287  *             _copy_strided_to_strided(src_data, src_strides + 1,             # <<<<<<<<<<<<<<
27288  *                                      dst_data, dst_strides + 1,
27289  *                                      src_shape + 1, dst_shape + 1,
27290  */
27291       _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);
27292 
27293       /* "View.MemoryView":1163
27294  *                                      src_shape + 1, dst_shape + 1,
27295  *                                      ndim - 1, itemsize)
27296  *             src_data += src_stride             # <<<<<<<<<<<<<<
27297  *             dst_data += dst_stride
27298  *
27299  */
27300       __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
27301 
27302       /* "View.MemoryView":1164
27303  *                                      ndim - 1, itemsize)
27304  *             src_data += src_stride
27305  *             dst_data += dst_stride             # <<<<<<<<<<<<<<
27306  *
27307  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
27308  */
27309       __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
27310     }
27311   }
27312   __pyx_L3:;
27313 
27314   /* "View.MemoryView":1136
27315  *
27316  * @cython.cdivision(True)
27317  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides,             # <<<<<<<<<<<<<<
27318  *                                    char *dst_data, Py_ssize_t *dst_strides,
27319  *                                    Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
27320  */
27321 
27322   /* function exit code */
27323 }
27324 
27325 /* "View.MemoryView":1166
27326  *             dst_data += dst_stride
27327  *
27328  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
27329  *                                   __Pyx_memviewslice *dst,
27330  *                                   int ndim, size_t itemsize) nogil:
27331  */
27332 
copy_strided_to_strided(__Pyx_memviewslice * __pyx_v_src,__Pyx_memviewslice * __pyx_v_dst,int __pyx_v_ndim,size_t __pyx_v_itemsize)27333 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) {
27334 
27335   /* "View.MemoryView":1169
27336  *                                   __Pyx_memviewslice *dst,
27337  *                                   int ndim, size_t itemsize) nogil:
27338  *     _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides,             # <<<<<<<<<<<<<<
27339  *                              src.shape, dst.shape, ndim, itemsize)
27340  *
27341  */
27342   _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);
27343 
27344   /* "View.MemoryView":1166
27345  *             dst_data += dst_stride
27346  *
27347  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
27348  *                                   __Pyx_memviewslice *dst,
27349  *                                   int ndim, size_t itemsize) nogil:
27350  */
27351 
27352   /* function exit code */
27353 }
27354 
27355 /* "View.MemoryView":1173
27356  *
27357  * @cname('__pyx_memoryview_slice_get_size')
27358  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:             # <<<<<<<<<<<<<<
27359  *     "Return the size of the memory occupied by the slice in number of bytes"
27360  *     cdef int i
27361  */
27362 
__pyx_memoryview_slice_get_size(__Pyx_memviewslice * __pyx_v_src,int __pyx_v_ndim)27363 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
27364   int __pyx_v_i;
27365   Py_ssize_t __pyx_v_size;
27366   Py_ssize_t __pyx_r;
27367   Py_ssize_t __pyx_t_1;
27368   int __pyx_t_2;
27369   int __pyx_t_3;
27370   int __pyx_t_4;
27371 
27372   /* "View.MemoryView":1176
27373  *     "Return the size of the memory occupied by the slice in number of bytes"
27374  *     cdef int i
27375  *     cdef Py_ssize_t size = src.memview.view.itemsize             # <<<<<<<<<<<<<<
27376  *
27377  *     for i in range(ndim):
27378  */
27379   __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
27380   __pyx_v_size = __pyx_t_1;
27381 
27382   /* "View.MemoryView":1178
27383  *     cdef Py_ssize_t size = src.memview.view.itemsize
27384  *
27385  *     for i in range(ndim):             # <<<<<<<<<<<<<<
27386  *         size *= src.shape[i]
27387  *
27388  */
27389   __pyx_t_2 = __pyx_v_ndim;
27390   __pyx_t_3 = __pyx_t_2;
27391   for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
27392     __pyx_v_i = __pyx_t_4;
27393 
27394     /* "View.MemoryView":1179
27395  *
27396  *     for i in range(ndim):
27397  *         size *= src.shape[i]             # <<<<<<<<<<<<<<
27398  *
27399  *     return size
27400  */
27401     __pyx_v_size = (__pyx_v_size * (__pyx_v_src->shape[__pyx_v_i]));
27402   }
27403 
27404   /* "View.MemoryView":1181
27405  *         size *= src.shape[i]
27406  *
27407  *     return size             # <<<<<<<<<<<<<<
27408  *
27409  * @cname('__pyx_fill_contig_strides_array')
27410  */
27411   __pyx_r = __pyx_v_size;
27412   goto __pyx_L0;
27413 
27414   /* "View.MemoryView":1173
27415  *
27416  * @cname('__pyx_memoryview_slice_get_size')
27417  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:             # <<<<<<<<<<<<<<
27418  *     "Return the size of the memory occupied by the slice in number of bytes"
27419  *     cdef int i
27420  */
27421 
27422   /* function exit code */
27423   __pyx_L0:;
27424   return __pyx_r;
27425 }
27426 
27427 /* "View.MemoryView":1184
27428  *
27429  * @cname('__pyx_fill_contig_strides_array')
27430  * cdef Py_ssize_t fill_contig_strides_array(             # <<<<<<<<<<<<<<
27431  *                 Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
27432  *                 int ndim, char order) nogil:
27433  */
27434 
__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)27435 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) {
27436   int __pyx_v_idx;
27437   Py_ssize_t __pyx_r;
27438   int __pyx_t_1;
27439   int __pyx_t_2;
27440   int __pyx_t_3;
27441   int __pyx_t_4;
27442 
27443   /* "View.MemoryView":1193
27444  *     cdef int idx
27445  *
27446  *     if order == 'F':             # <<<<<<<<<<<<<<
27447  *         for idx in range(ndim):
27448  *             strides[idx] = stride
27449  */
27450   __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
27451   if (__pyx_t_1) {
27452 
27453     /* "View.MemoryView":1194
27454  *
27455  *     if order == 'F':
27456  *         for idx in range(ndim):             # <<<<<<<<<<<<<<
27457  *             strides[idx] = stride
27458  *             stride = stride * shape[idx]
27459  */
27460     __pyx_t_2 = __pyx_v_ndim;
27461     __pyx_t_3 = __pyx_t_2;
27462     for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
27463       __pyx_v_idx = __pyx_t_4;
27464 
27465       /* "View.MemoryView":1195
27466  *     if order == 'F':
27467  *         for idx in range(ndim):
27468  *             strides[idx] = stride             # <<<<<<<<<<<<<<
27469  *             stride = stride * shape[idx]
27470  *     else:
27471  */
27472       (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
27473 
27474       /* "View.MemoryView":1196
27475  *         for idx in range(ndim):
27476  *             strides[idx] = stride
27477  *             stride = stride * shape[idx]             # <<<<<<<<<<<<<<
27478  *     else:
27479  *         for idx in range(ndim - 1, -1, -1):
27480  */
27481       __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
27482     }
27483 
27484     /* "View.MemoryView":1193
27485  *     cdef int idx
27486  *
27487  *     if order == 'F':             # <<<<<<<<<<<<<<
27488  *         for idx in range(ndim):
27489  *             strides[idx] = stride
27490  */
27491     goto __pyx_L3;
27492   }
27493 
27494   /* "View.MemoryView":1198
27495  *             stride = stride * shape[idx]
27496  *     else:
27497  *         for idx in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
27498  *             strides[idx] = stride
27499  *             stride = stride * shape[idx]
27500  */
27501   /*else*/ {
27502     for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
27503       __pyx_v_idx = __pyx_t_2;
27504 
27505       /* "View.MemoryView":1199
27506  *     else:
27507  *         for idx in range(ndim - 1, -1, -1):
27508  *             strides[idx] = stride             # <<<<<<<<<<<<<<
27509  *             stride = stride * shape[idx]
27510  *
27511  */
27512       (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
27513 
27514       /* "View.MemoryView":1200
27515  *         for idx in range(ndim - 1, -1, -1):
27516  *             strides[idx] = stride
27517  *             stride = stride * shape[idx]             # <<<<<<<<<<<<<<
27518  *
27519  *     return stride
27520  */
27521       __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
27522     }
27523   }
27524   __pyx_L3:;
27525 
27526   /* "View.MemoryView":1202
27527  *             stride = stride * shape[idx]
27528  *
27529  *     return stride             # <<<<<<<<<<<<<<
27530  *
27531  * @cname('__pyx_memoryview_copy_data_to_temp')
27532  */
27533   __pyx_r = __pyx_v_stride;
27534   goto __pyx_L0;
27535 
27536   /* "View.MemoryView":1184
27537  *
27538  * @cname('__pyx_fill_contig_strides_array')
27539  * cdef Py_ssize_t fill_contig_strides_array(             # <<<<<<<<<<<<<<
27540  *                 Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
27541  *                 int ndim, char order) nogil:
27542  */
27543 
27544   /* function exit code */
27545   __pyx_L0:;
27546   return __pyx_r;
27547 }
27548 
27549 /* "View.MemoryView":1205
27550  *
27551  * @cname('__pyx_memoryview_copy_data_to_temp')
27552  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
27553  *                              __Pyx_memviewslice *tmpslice,
27554  *                              char order,
27555  */
27556 
__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice * __pyx_v_src,__Pyx_memviewslice * __pyx_v_tmpslice,char __pyx_v_order,int __pyx_v_ndim)27557 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) {
27558   int __pyx_v_i;
27559   void *__pyx_v_result;
27560   size_t __pyx_v_itemsize;
27561   size_t __pyx_v_size;
27562   void *__pyx_r;
27563   Py_ssize_t __pyx_t_1;
27564   int __pyx_t_2;
27565   int __pyx_t_3;
27566   struct __pyx_memoryview_obj *__pyx_t_4;
27567   int __pyx_t_5;
27568   int __pyx_t_6;
27569 
27570   /* "View.MemoryView":1216
27571  *     cdef void *result
27572  *
27573  *     cdef size_t itemsize = src.memview.view.itemsize             # <<<<<<<<<<<<<<
27574  *     cdef size_t size = slice_get_size(src, ndim)
27575  *
27576  */
27577   __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
27578   __pyx_v_itemsize = __pyx_t_1;
27579 
27580   /* "View.MemoryView":1217
27581  *
27582  *     cdef size_t itemsize = src.memview.view.itemsize
27583  *     cdef size_t size = slice_get_size(src, ndim)             # <<<<<<<<<<<<<<
27584  *
27585  *     result = malloc(size)
27586  */
27587   __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
27588 
27589   /* "View.MemoryView":1219
27590  *     cdef size_t size = slice_get_size(src, ndim)
27591  *
27592  *     result = malloc(size)             # <<<<<<<<<<<<<<
27593  *     if not result:
27594  *         _err(MemoryError, NULL)
27595  */
27596   __pyx_v_result = malloc(__pyx_v_size);
27597 
27598   /* "View.MemoryView":1220
27599  *
27600  *     result = malloc(size)
27601  *     if not result:             # <<<<<<<<<<<<<<
27602  *         _err(MemoryError, NULL)
27603  *
27604  */
27605   __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
27606   if (__pyx_t_2) {
27607 
27608     /* "View.MemoryView":1221
27609  *     result = malloc(size)
27610  *     if not result:
27611  *         _err(MemoryError, NULL)             # <<<<<<<<<<<<<<
27612  *
27613  *
27614  */
27615     __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1221, __pyx_L1_error)
27616 
27617     /* "View.MemoryView":1220
27618  *
27619  *     result = malloc(size)
27620  *     if not result:             # <<<<<<<<<<<<<<
27621  *         _err(MemoryError, NULL)
27622  *
27623  */
27624   }
27625 
27626   /* "View.MemoryView":1224
27627  *
27628  *
27629  *     tmpslice.data = <char *> result             # <<<<<<<<<<<<<<
27630  *     tmpslice.memview = src.memview
27631  *     for i in range(ndim):
27632  */
27633   __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
27634 
27635   /* "View.MemoryView":1225
27636  *
27637  *     tmpslice.data = <char *> result
27638  *     tmpslice.memview = src.memview             # <<<<<<<<<<<<<<
27639  *     for i in range(ndim):
27640  *         tmpslice.shape[i] = src.shape[i]
27641  */
27642   __pyx_t_4 = __pyx_v_src->memview;
27643   __pyx_v_tmpslice->memview = __pyx_t_4;
27644 
27645   /* "View.MemoryView":1226
27646  *     tmpslice.data = <char *> result
27647  *     tmpslice.memview = src.memview
27648  *     for i in range(ndim):             # <<<<<<<<<<<<<<
27649  *         tmpslice.shape[i] = src.shape[i]
27650  *         tmpslice.suboffsets[i] = -1
27651  */
27652   __pyx_t_3 = __pyx_v_ndim;
27653   __pyx_t_5 = __pyx_t_3;
27654   for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
27655     __pyx_v_i = __pyx_t_6;
27656 
27657     /* "View.MemoryView":1227
27658  *     tmpslice.memview = src.memview
27659  *     for i in range(ndim):
27660  *         tmpslice.shape[i] = src.shape[i]             # <<<<<<<<<<<<<<
27661  *         tmpslice.suboffsets[i] = -1
27662  *
27663  */
27664     (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
27665 
27666     /* "View.MemoryView":1228
27667  *     for i in range(ndim):
27668  *         tmpslice.shape[i] = src.shape[i]
27669  *         tmpslice.suboffsets[i] = -1             # <<<<<<<<<<<<<<
27670  *
27671  *     fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
27672  */
27673     (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
27674   }
27675 
27676   /* "View.MemoryView":1230
27677  *         tmpslice.suboffsets[i] = -1
27678  *
27679  *     fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,             # <<<<<<<<<<<<<<
27680  *                               ndim, order)
27681  *
27682  */
27683   (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));
27684 
27685   /* "View.MemoryView":1234
27686  *
27687  *
27688  *     for i in range(ndim):             # <<<<<<<<<<<<<<
27689  *         if tmpslice.shape[i] == 1:
27690  *             tmpslice.strides[i] = 0
27691  */
27692   __pyx_t_3 = __pyx_v_ndim;
27693   __pyx_t_5 = __pyx_t_3;
27694   for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
27695     __pyx_v_i = __pyx_t_6;
27696 
27697     /* "View.MemoryView":1235
27698  *
27699  *     for i in range(ndim):
27700  *         if tmpslice.shape[i] == 1:             # <<<<<<<<<<<<<<
27701  *             tmpslice.strides[i] = 0
27702  *
27703  */
27704     __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
27705     if (__pyx_t_2) {
27706 
27707       /* "View.MemoryView":1236
27708  *     for i in range(ndim):
27709  *         if tmpslice.shape[i] == 1:
27710  *             tmpslice.strides[i] = 0             # <<<<<<<<<<<<<<
27711  *
27712  *     if slice_is_contig(src[0], order, ndim):
27713  */
27714       (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
27715 
27716       /* "View.MemoryView":1235
27717  *
27718  *     for i in range(ndim):
27719  *         if tmpslice.shape[i] == 1:             # <<<<<<<<<<<<<<
27720  *             tmpslice.strides[i] = 0
27721  *
27722  */
27723     }
27724   }
27725 
27726   /* "View.MemoryView":1238
27727  *             tmpslice.strides[i] = 0
27728  *
27729  *     if slice_is_contig(src[0], order, ndim):             # <<<<<<<<<<<<<<
27730  *         memcpy(result, src.data, size)
27731  *     else:
27732  */
27733   __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
27734   if (__pyx_t_2) {
27735 
27736     /* "View.MemoryView":1239
27737  *
27738  *     if slice_is_contig(src[0], order, ndim):
27739  *         memcpy(result, src.data, size)             # <<<<<<<<<<<<<<
27740  *     else:
27741  *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)
27742  */
27743     (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
27744 
27745     /* "View.MemoryView":1238
27746  *             tmpslice.strides[i] = 0
27747  *
27748  *     if slice_is_contig(src[0], order, ndim):             # <<<<<<<<<<<<<<
27749  *         memcpy(result, src.data, size)
27750  *     else:
27751  */
27752     goto __pyx_L9;
27753   }
27754 
27755   /* "View.MemoryView":1241
27756  *         memcpy(result, src.data, size)
27757  *     else:
27758  *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)             # <<<<<<<<<<<<<<
27759  *
27760  *     return result
27761  */
27762   /*else*/ {
27763     copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
27764   }
27765   __pyx_L9:;
27766 
27767   /* "View.MemoryView":1243
27768  *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)
27769  *
27770  *     return result             # <<<<<<<<<<<<<<
27771  *
27772  *
27773  */
27774   __pyx_r = __pyx_v_result;
27775   goto __pyx_L0;
27776 
27777   /* "View.MemoryView":1205
27778  *
27779  * @cname('__pyx_memoryview_copy_data_to_temp')
27780  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
27781  *                              __Pyx_memviewslice *tmpslice,
27782  *                              char order,
27783  */
27784 
27785   /* function exit code */
27786   __pyx_L1_error:;
27787   {
27788     #ifdef WITH_THREAD
27789     PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
27790     #endif
27791     __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
27792     #ifdef WITH_THREAD
27793     __Pyx_PyGILState_Release(__pyx_gilstate_save);
27794     #endif
27795   }
27796   __pyx_r = NULL;
27797   __pyx_L0:;
27798   return __pyx_r;
27799 }
27800 
27801 /* "View.MemoryView":1248
27802  *
27803  * @cname('__pyx_memoryview_err_extents')
27804  * cdef int _err_extents(int i, Py_ssize_t extent1,             # <<<<<<<<<<<<<<
27805  *                              Py_ssize_t extent2) except -1 with gil:
27806  *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %
27807  */
27808 
__pyx_memoryview_err_extents(int __pyx_v_i,Py_ssize_t __pyx_v_extent1,Py_ssize_t __pyx_v_extent2)27809 static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
27810   int __pyx_r;
27811   __Pyx_RefNannyDeclarations
27812   PyObject *__pyx_t_1 = NULL;
27813   PyObject *__pyx_t_2 = NULL;
27814   PyObject *__pyx_t_3 = NULL;
27815   PyObject *__pyx_t_4 = NULL;
27816   #ifdef WITH_THREAD
27817   PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
27818   #endif
27819   __Pyx_RefNannySetupContext("_err_extents", 0);
27820 
27821   /* "View.MemoryView":1251
27822  *                              Py_ssize_t extent2) except -1 with gil:
27823  *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %
27824  *                                                         (i, extent1, extent2))             # <<<<<<<<<<<<<<
27825  *
27826  * @cname('__pyx_memoryview_err_dim')
27827  */
27828   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1251, __pyx_L1_error)
27829   __Pyx_GOTREF(__pyx_t_1);
27830   __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1251, __pyx_L1_error)
27831   __Pyx_GOTREF(__pyx_t_2);
27832   __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1251, __pyx_L1_error)
27833   __Pyx_GOTREF(__pyx_t_3);
27834   __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1251, __pyx_L1_error)
27835   __Pyx_GOTREF(__pyx_t_4);
27836   __Pyx_GIVEREF(__pyx_t_1);
27837   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
27838   __Pyx_GIVEREF(__pyx_t_2);
27839   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
27840   __Pyx_GIVEREF(__pyx_t_3);
27841   PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
27842   __pyx_t_1 = 0;
27843   __pyx_t_2 = 0;
27844   __pyx_t_3 = 0;
27845 
27846   /* "View.MemoryView":1250
27847  * cdef int _err_extents(int i, Py_ssize_t extent1,
27848  *                              Py_ssize_t extent2) except -1 with gil:
27849  *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %             # <<<<<<<<<<<<<<
27850  *                                                         (i, extent1, extent2))
27851  *
27852  */
27853   __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1250, __pyx_L1_error)
27854   __Pyx_GOTREF(__pyx_t_3);
27855   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27856   __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1250, __pyx_L1_error)
27857   __Pyx_GOTREF(__pyx_t_4);
27858   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27859   __Pyx_Raise(__pyx_t_4, 0, 0, 0);
27860   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27861   __PYX_ERR(1, 1250, __pyx_L1_error)
27862 
27863   /* "View.MemoryView":1248
27864  *
27865  * @cname('__pyx_memoryview_err_extents')
27866  * cdef int _err_extents(int i, Py_ssize_t extent1,             # <<<<<<<<<<<<<<
27867  *                              Py_ssize_t extent2) except -1 with gil:
27868  *     raise ValueError("got differing extents in dimension %d (got %d and %d)" %
27869  */
27870 
27871   /* function exit code */
27872   __pyx_L1_error:;
27873   __Pyx_XDECREF(__pyx_t_1);
27874   __Pyx_XDECREF(__pyx_t_2);
27875   __Pyx_XDECREF(__pyx_t_3);
27876   __Pyx_XDECREF(__pyx_t_4);
27877   __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
27878   __pyx_r = -1;
27879   __Pyx_RefNannyFinishContext();
27880   #ifdef WITH_THREAD
27881   __Pyx_PyGILState_Release(__pyx_gilstate_save);
27882   #endif
27883   return __pyx_r;
27884 }
27885 
27886 /* "View.MemoryView":1254
27887  *
27888  * @cname('__pyx_memoryview_err_dim')
27889  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:             # <<<<<<<<<<<<<<
27890  *     raise error(msg.decode('ascii') % dim)
27891  *
27892  */
27893 
__pyx_memoryview_err_dim(PyObject * __pyx_v_error,char * __pyx_v_msg,int __pyx_v_dim)27894 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
27895   int __pyx_r;
27896   __Pyx_RefNannyDeclarations
27897   PyObject *__pyx_t_1 = NULL;
27898   PyObject *__pyx_t_2 = NULL;
27899   PyObject *__pyx_t_3 = NULL;
27900   PyObject *__pyx_t_4 = NULL;
27901   #ifdef WITH_THREAD
27902   PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
27903   #endif
27904   __Pyx_RefNannySetupContext("_err_dim", 0);
27905   __Pyx_INCREF(__pyx_v_error);
27906 
27907   /* "View.MemoryView":1255
27908  * @cname('__pyx_memoryview_err_dim')
27909  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
27910  *     raise error(msg.decode('ascii') % dim)             # <<<<<<<<<<<<<<
27911  *
27912  * @cname('__pyx_memoryview_err')
27913  */
27914   __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1255, __pyx_L1_error)
27915   __Pyx_GOTREF(__pyx_t_2);
27916   __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1255, __pyx_L1_error)
27917   __Pyx_GOTREF(__pyx_t_3);
27918   __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1255, __pyx_L1_error)
27919   __Pyx_GOTREF(__pyx_t_4);
27920   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27921   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27922   __Pyx_INCREF(__pyx_v_error);
27923   __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
27924   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
27925     __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
27926     if (likely(__pyx_t_2)) {
27927       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
27928       __Pyx_INCREF(__pyx_t_2);
27929       __Pyx_INCREF(function);
27930       __Pyx_DECREF_SET(__pyx_t_3, function);
27931     }
27932   }
27933   __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);
27934   __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
27935   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27936   if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1255, __pyx_L1_error)
27937   __Pyx_GOTREF(__pyx_t_1);
27938   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27939   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
27940   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27941   __PYX_ERR(1, 1255, __pyx_L1_error)
27942 
27943   /* "View.MemoryView":1254
27944  *
27945  * @cname('__pyx_memoryview_err_dim')
27946  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:             # <<<<<<<<<<<<<<
27947  *     raise error(msg.decode('ascii') % dim)
27948  *
27949  */
27950 
27951   /* function exit code */
27952   __pyx_L1_error:;
27953   __Pyx_XDECREF(__pyx_t_1);
27954   __Pyx_XDECREF(__pyx_t_2);
27955   __Pyx_XDECREF(__pyx_t_3);
27956   __Pyx_XDECREF(__pyx_t_4);
27957   __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
27958   __pyx_r = -1;
27959   __Pyx_XDECREF(__pyx_v_error);
27960   __Pyx_RefNannyFinishContext();
27961   #ifdef WITH_THREAD
27962   __Pyx_PyGILState_Release(__pyx_gilstate_save);
27963   #endif
27964   return __pyx_r;
27965 }
27966 
27967 /* "View.MemoryView":1258
27968  *
27969  * @cname('__pyx_memoryview_err')
27970  * cdef int _err(object error, char *msg) except -1 with gil:             # <<<<<<<<<<<<<<
27971  *     if msg != NULL:
27972  *         raise error(msg.decode('ascii'))
27973  */
27974 
__pyx_memoryview_err(PyObject * __pyx_v_error,char * __pyx_v_msg)27975 static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
27976   int __pyx_r;
27977   __Pyx_RefNannyDeclarations
27978   int __pyx_t_1;
27979   PyObject *__pyx_t_2 = NULL;
27980   PyObject *__pyx_t_3 = NULL;
27981   PyObject *__pyx_t_4 = NULL;
27982   PyObject *__pyx_t_5 = NULL;
27983   #ifdef WITH_THREAD
27984   PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
27985   #endif
27986   __Pyx_RefNannySetupContext("_err", 0);
27987   __Pyx_INCREF(__pyx_v_error);
27988 
27989   /* "View.MemoryView":1259
27990  * @cname('__pyx_memoryview_err')
27991  * cdef int _err(object error, char *msg) except -1 with gil:
27992  *     if msg != NULL:             # <<<<<<<<<<<<<<
27993  *         raise error(msg.decode('ascii'))
27994  *     else:
27995  */
27996   __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
27997   if (unlikely(__pyx_t_1)) {
27998 
27999     /* "View.MemoryView":1260
28000  * cdef int _err(object error, char *msg) except -1 with gil:
28001  *     if msg != NULL:
28002  *         raise error(msg.decode('ascii'))             # <<<<<<<<<<<<<<
28003  *     else:
28004  *         raise error
28005  */
28006     __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1260, __pyx_L1_error)
28007     __Pyx_GOTREF(__pyx_t_3);
28008     __Pyx_INCREF(__pyx_v_error);
28009     __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
28010     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
28011       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
28012       if (likely(__pyx_t_5)) {
28013         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
28014         __Pyx_INCREF(__pyx_t_5);
28015         __Pyx_INCREF(function);
28016         __Pyx_DECREF_SET(__pyx_t_4, function);
28017       }
28018     }
28019     __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);
28020     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
28021     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28022     if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1260, __pyx_L1_error)
28023     __Pyx_GOTREF(__pyx_t_2);
28024     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28025     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
28026     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28027     __PYX_ERR(1, 1260, __pyx_L1_error)
28028 
28029     /* "View.MemoryView":1259
28030  * @cname('__pyx_memoryview_err')
28031  * cdef int _err(object error, char *msg) except -1 with gil:
28032  *     if msg != NULL:             # <<<<<<<<<<<<<<
28033  *         raise error(msg.decode('ascii'))
28034  *     else:
28035  */
28036   }
28037 
28038   /* "View.MemoryView":1262
28039  *         raise error(msg.decode('ascii'))
28040  *     else:
28041  *         raise error             # <<<<<<<<<<<<<<
28042  *
28043  * @cname('__pyx_memoryview_copy_contents')
28044  */
28045   /*else*/ {
28046     __Pyx_Raise(__pyx_v_error, 0, 0, 0);
28047     __PYX_ERR(1, 1262, __pyx_L1_error)
28048   }
28049 
28050   /* "View.MemoryView":1258
28051  *
28052  * @cname('__pyx_memoryview_err')
28053  * cdef int _err(object error, char *msg) except -1 with gil:             # <<<<<<<<<<<<<<
28054  *     if msg != NULL:
28055  *         raise error(msg.decode('ascii'))
28056  */
28057 
28058   /* function exit code */
28059   __pyx_L1_error:;
28060   __Pyx_XDECREF(__pyx_t_2);
28061   __Pyx_XDECREF(__pyx_t_3);
28062   __Pyx_XDECREF(__pyx_t_4);
28063   __Pyx_XDECREF(__pyx_t_5);
28064   __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
28065   __pyx_r = -1;
28066   __Pyx_XDECREF(__pyx_v_error);
28067   __Pyx_RefNannyFinishContext();
28068   #ifdef WITH_THREAD
28069   __Pyx_PyGILState_Release(__pyx_gilstate_save);
28070   #endif
28071   return __pyx_r;
28072 }
28073 
28074 /* "View.MemoryView":1265
28075  *
28076  * @cname('__pyx_memoryview_copy_contents')
28077  * cdef int memoryview_copy_contents(__Pyx_memviewslice src,             # <<<<<<<<<<<<<<
28078  *                                   __Pyx_memviewslice dst,
28079  *                                   int src_ndim, int dst_ndim,
28080  */
28081 
__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)28082 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) {
28083   void *__pyx_v_tmpdata;
28084   size_t __pyx_v_itemsize;
28085   int __pyx_v_i;
28086   char __pyx_v_order;
28087   int __pyx_v_broadcasting;
28088   int __pyx_v_direct_copy;
28089   __Pyx_memviewslice __pyx_v_tmp;
28090   int __pyx_v_ndim;
28091   int __pyx_r;
28092   Py_ssize_t __pyx_t_1;
28093   int __pyx_t_2;
28094   int __pyx_t_3;
28095   int __pyx_t_4;
28096   int __pyx_t_5;
28097   int __pyx_t_6;
28098   void *__pyx_t_7;
28099   int __pyx_t_8;
28100 
28101   /* "View.MemoryView":1273
28102  *     Check for overlapping memory and verify the shapes.
28103  *     """
28104  *     cdef void *tmpdata = NULL             # <<<<<<<<<<<<<<
28105  *     cdef size_t itemsize = src.memview.view.itemsize
28106  *     cdef int i
28107  */
28108   __pyx_v_tmpdata = NULL;
28109 
28110   /* "View.MemoryView":1274
28111  *     """
28112  *     cdef void *tmpdata = NULL
28113  *     cdef size_t itemsize = src.memview.view.itemsize             # <<<<<<<<<<<<<<
28114  *     cdef int i
28115  *     cdef char order = get_best_order(&src, src_ndim)
28116  */
28117   __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
28118   __pyx_v_itemsize = __pyx_t_1;
28119 
28120   /* "View.MemoryView":1276
28121  *     cdef size_t itemsize = src.memview.view.itemsize
28122  *     cdef int i
28123  *     cdef char order = get_best_order(&src, src_ndim)             # <<<<<<<<<<<<<<
28124  *     cdef bint broadcasting = False
28125  *     cdef bint direct_copy = False
28126  */
28127   __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
28128 
28129   /* "View.MemoryView":1277
28130  *     cdef int i
28131  *     cdef char order = get_best_order(&src, src_ndim)
28132  *     cdef bint broadcasting = False             # <<<<<<<<<<<<<<
28133  *     cdef bint direct_copy = False
28134  *     cdef __Pyx_memviewslice tmp
28135  */
28136   __pyx_v_broadcasting = 0;
28137 
28138   /* "View.MemoryView":1278
28139  *     cdef char order = get_best_order(&src, src_ndim)
28140  *     cdef bint broadcasting = False
28141  *     cdef bint direct_copy = False             # <<<<<<<<<<<<<<
28142  *     cdef __Pyx_memviewslice tmp
28143  *
28144  */
28145   __pyx_v_direct_copy = 0;
28146 
28147   /* "View.MemoryView":1281
28148  *     cdef __Pyx_memviewslice tmp
28149  *
28150  *     if src_ndim < dst_ndim:             # <<<<<<<<<<<<<<
28151  *         broadcast_leading(&src, src_ndim, dst_ndim)
28152  *     elif dst_ndim < src_ndim:
28153  */
28154   __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
28155   if (__pyx_t_2) {
28156 
28157     /* "View.MemoryView":1282
28158  *
28159  *     if src_ndim < dst_ndim:
28160  *         broadcast_leading(&src, src_ndim, dst_ndim)             # <<<<<<<<<<<<<<
28161  *     elif dst_ndim < src_ndim:
28162  *         broadcast_leading(&dst, dst_ndim, src_ndim)
28163  */
28164     __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
28165 
28166     /* "View.MemoryView":1281
28167  *     cdef __Pyx_memviewslice tmp
28168  *
28169  *     if src_ndim < dst_ndim:             # <<<<<<<<<<<<<<
28170  *         broadcast_leading(&src, src_ndim, dst_ndim)
28171  *     elif dst_ndim < src_ndim:
28172  */
28173     goto __pyx_L3;
28174   }
28175 
28176   /* "View.MemoryView":1283
28177  *     if src_ndim < dst_ndim:
28178  *         broadcast_leading(&src, src_ndim, dst_ndim)
28179  *     elif dst_ndim < src_ndim:             # <<<<<<<<<<<<<<
28180  *         broadcast_leading(&dst, dst_ndim, src_ndim)
28181  *
28182  */
28183   __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
28184   if (__pyx_t_2) {
28185 
28186     /* "View.MemoryView":1284
28187  *         broadcast_leading(&src, src_ndim, dst_ndim)
28188  *     elif dst_ndim < src_ndim:
28189  *         broadcast_leading(&dst, dst_ndim, src_ndim)             # <<<<<<<<<<<<<<
28190  *
28191  *     cdef int ndim = max(src_ndim, dst_ndim)
28192  */
28193     __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
28194 
28195     /* "View.MemoryView":1283
28196  *     if src_ndim < dst_ndim:
28197  *         broadcast_leading(&src, src_ndim, dst_ndim)
28198  *     elif dst_ndim < src_ndim:             # <<<<<<<<<<<<<<
28199  *         broadcast_leading(&dst, dst_ndim, src_ndim)
28200  *
28201  */
28202   }
28203   __pyx_L3:;
28204 
28205   /* "View.MemoryView":1286
28206  *         broadcast_leading(&dst, dst_ndim, src_ndim)
28207  *
28208  *     cdef int ndim = max(src_ndim, dst_ndim)             # <<<<<<<<<<<<<<
28209  *
28210  *     for i in range(ndim):
28211  */
28212   __pyx_t_3 = __pyx_v_dst_ndim;
28213   __pyx_t_4 = __pyx_v_src_ndim;
28214   if (((__pyx_t_3 > __pyx_t_4) != 0)) {
28215     __pyx_t_5 = __pyx_t_3;
28216   } else {
28217     __pyx_t_5 = __pyx_t_4;
28218   }
28219   __pyx_v_ndim = __pyx_t_5;
28220 
28221   /* "View.MemoryView":1288
28222  *     cdef int ndim = max(src_ndim, dst_ndim)
28223  *
28224  *     for i in range(ndim):             # <<<<<<<<<<<<<<
28225  *         if src.shape[i] != dst.shape[i]:
28226  *             if src.shape[i] == 1:
28227  */
28228   __pyx_t_5 = __pyx_v_ndim;
28229   __pyx_t_3 = __pyx_t_5;
28230   for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
28231     __pyx_v_i = __pyx_t_4;
28232 
28233     /* "View.MemoryView":1289
28234  *
28235  *     for i in range(ndim):
28236  *         if src.shape[i] != dst.shape[i]:             # <<<<<<<<<<<<<<
28237  *             if src.shape[i] == 1:
28238  *                 broadcasting = True
28239  */
28240     __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
28241     if (__pyx_t_2) {
28242 
28243       /* "View.MemoryView":1290
28244  *     for i in range(ndim):
28245  *         if src.shape[i] != dst.shape[i]:
28246  *             if src.shape[i] == 1:             # <<<<<<<<<<<<<<
28247  *                 broadcasting = True
28248  *                 src.strides[i] = 0
28249  */
28250       __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
28251       if (__pyx_t_2) {
28252 
28253         /* "View.MemoryView":1291
28254  *         if src.shape[i] != dst.shape[i]:
28255  *             if src.shape[i] == 1:
28256  *                 broadcasting = True             # <<<<<<<<<<<<<<
28257  *                 src.strides[i] = 0
28258  *             else:
28259  */
28260         __pyx_v_broadcasting = 1;
28261 
28262         /* "View.MemoryView":1292
28263  *             if src.shape[i] == 1:
28264  *                 broadcasting = True
28265  *                 src.strides[i] = 0             # <<<<<<<<<<<<<<
28266  *             else:
28267  *                 _err_extents(i, dst.shape[i], src.shape[i])
28268  */
28269         (__pyx_v_src.strides[__pyx_v_i]) = 0;
28270 
28271         /* "View.MemoryView":1290
28272  *     for i in range(ndim):
28273  *         if src.shape[i] != dst.shape[i]:
28274  *             if src.shape[i] == 1:             # <<<<<<<<<<<<<<
28275  *                 broadcasting = True
28276  *                 src.strides[i] = 0
28277  */
28278         goto __pyx_L7;
28279       }
28280 
28281       /* "View.MemoryView":1294
28282  *                 src.strides[i] = 0
28283  *             else:
28284  *                 _err_extents(i, dst.shape[i], src.shape[i])             # <<<<<<<<<<<<<<
28285  *
28286  *         if src.suboffsets[i] >= 0:
28287  */
28288       /*else*/ {
28289         __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1294, __pyx_L1_error)
28290       }
28291       __pyx_L7:;
28292 
28293       /* "View.MemoryView":1289
28294  *
28295  *     for i in range(ndim):
28296  *         if src.shape[i] != dst.shape[i]:             # <<<<<<<<<<<<<<
28297  *             if src.shape[i] == 1:
28298  *                 broadcasting = True
28299  */
28300     }
28301 
28302     /* "View.MemoryView":1296
28303  *                 _err_extents(i, dst.shape[i], src.shape[i])
28304  *
28305  *         if src.suboffsets[i] >= 0:             # <<<<<<<<<<<<<<
28306  *             _err_dim(ValueError, "Dimension %d is not direct", i)
28307  *
28308  */
28309     __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
28310     if (__pyx_t_2) {
28311 
28312       /* "View.MemoryView":1297
28313  *
28314  *         if src.suboffsets[i] >= 0:
28315  *             _err_dim(ValueError, "Dimension %d is not direct", i)             # <<<<<<<<<<<<<<
28316  *
28317  *     if slices_overlap(&src, &dst, ndim, itemsize):
28318  */
28319       __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1297, __pyx_L1_error)
28320 
28321       /* "View.MemoryView":1296
28322  *                 _err_extents(i, dst.shape[i], src.shape[i])
28323  *
28324  *         if src.suboffsets[i] >= 0:             # <<<<<<<<<<<<<<
28325  *             _err_dim(ValueError, "Dimension %d is not direct", i)
28326  *
28327  */
28328     }
28329   }
28330 
28331   /* "View.MemoryView":1299
28332  *             _err_dim(ValueError, "Dimension %d is not direct", i)
28333  *
28334  *     if slices_overlap(&src, &dst, ndim, itemsize):             # <<<<<<<<<<<<<<
28335  *
28336  *         if not slice_is_contig(src, order, ndim):
28337  */
28338   __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
28339   if (__pyx_t_2) {
28340 
28341     /* "View.MemoryView":1301
28342  *     if slices_overlap(&src, &dst, ndim, itemsize):
28343  *
28344  *         if not slice_is_contig(src, order, ndim):             # <<<<<<<<<<<<<<
28345  *             order = get_best_order(&dst, ndim)
28346  *
28347  */
28348     __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
28349     if (__pyx_t_2) {
28350 
28351       /* "View.MemoryView":1302
28352  *
28353  *         if not slice_is_contig(src, order, ndim):
28354  *             order = get_best_order(&dst, ndim)             # <<<<<<<<<<<<<<
28355  *
28356  *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
28357  */
28358       __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
28359 
28360       /* "View.MemoryView":1301
28361  *     if slices_overlap(&src, &dst, ndim, itemsize):
28362  *
28363  *         if not slice_is_contig(src, order, ndim):             # <<<<<<<<<<<<<<
28364  *             order = get_best_order(&dst, ndim)
28365  *
28366  */
28367     }
28368 
28369     /* "View.MemoryView":1304
28370  *             order = get_best_order(&dst, ndim)
28371  *
28372  *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)             # <<<<<<<<<<<<<<
28373  *         src = tmp
28374  *
28375  */
28376     __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(1, 1304, __pyx_L1_error)
28377     __pyx_v_tmpdata = __pyx_t_7;
28378 
28379     /* "View.MemoryView":1305
28380  *
28381  *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
28382  *         src = tmp             # <<<<<<<<<<<<<<
28383  *
28384  *     if not broadcasting:
28385  */
28386     __pyx_v_src = __pyx_v_tmp;
28387 
28388     /* "View.MemoryView":1299
28389  *             _err_dim(ValueError, "Dimension %d is not direct", i)
28390  *
28391  *     if slices_overlap(&src, &dst, ndim, itemsize):             # <<<<<<<<<<<<<<
28392  *
28393  *         if not slice_is_contig(src, order, ndim):
28394  */
28395   }
28396 
28397   /* "View.MemoryView":1307
28398  *         src = tmp
28399  *
28400  *     if not broadcasting:             # <<<<<<<<<<<<<<
28401  *
28402  *
28403  */
28404   __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
28405   if (__pyx_t_2) {
28406 
28407     /* "View.MemoryView":1310
28408  *
28409  *
28410  *         if slice_is_contig(src, 'C', ndim):             # <<<<<<<<<<<<<<
28411  *             direct_copy = slice_is_contig(dst, 'C', ndim)
28412  *         elif slice_is_contig(src, 'F', ndim):
28413  */
28414     __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
28415     if (__pyx_t_2) {
28416 
28417       /* "View.MemoryView":1311
28418  *
28419  *         if slice_is_contig(src, 'C', ndim):
28420  *             direct_copy = slice_is_contig(dst, 'C', ndim)             # <<<<<<<<<<<<<<
28421  *         elif slice_is_contig(src, 'F', ndim):
28422  *             direct_copy = slice_is_contig(dst, 'F', ndim)
28423  */
28424       __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
28425 
28426       /* "View.MemoryView":1310
28427  *
28428  *
28429  *         if slice_is_contig(src, 'C', ndim):             # <<<<<<<<<<<<<<
28430  *             direct_copy = slice_is_contig(dst, 'C', ndim)
28431  *         elif slice_is_contig(src, 'F', ndim):
28432  */
28433       goto __pyx_L12;
28434     }
28435 
28436     /* "View.MemoryView":1312
28437  *         if slice_is_contig(src, 'C', ndim):
28438  *             direct_copy = slice_is_contig(dst, 'C', ndim)
28439  *         elif slice_is_contig(src, 'F', ndim):             # <<<<<<<<<<<<<<
28440  *             direct_copy = slice_is_contig(dst, 'F', ndim)
28441  *
28442  */
28443     __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0);
28444     if (__pyx_t_2) {
28445 
28446       /* "View.MemoryView":1313
28447  *             direct_copy = slice_is_contig(dst, 'C', ndim)
28448  *         elif slice_is_contig(src, 'F', ndim):
28449  *             direct_copy = slice_is_contig(dst, 'F', ndim)             # <<<<<<<<<<<<<<
28450  *
28451  *         if direct_copy:
28452  */
28453       __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
28454 
28455       /* "View.MemoryView":1312
28456  *         if slice_is_contig(src, 'C', ndim):
28457  *             direct_copy = slice_is_contig(dst, 'C', ndim)
28458  *         elif slice_is_contig(src, 'F', ndim):             # <<<<<<<<<<<<<<
28459  *             direct_copy = slice_is_contig(dst, 'F', ndim)
28460  *
28461  */
28462     }
28463     __pyx_L12:;
28464 
28465     /* "View.MemoryView":1315
28466  *             direct_copy = slice_is_contig(dst, 'F', ndim)
28467  *
28468  *         if direct_copy:             # <<<<<<<<<<<<<<
28469  *
28470  *             refcount_copying(&dst, dtype_is_object, ndim, False)
28471  */
28472     __pyx_t_2 = (__pyx_v_direct_copy != 0);
28473     if (__pyx_t_2) {
28474 
28475       /* "View.MemoryView":1317
28476  *         if direct_copy:
28477  *
28478  *             refcount_copying(&dst, dtype_is_object, ndim, False)             # <<<<<<<<<<<<<<
28479  *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))
28480  *             refcount_copying(&dst, dtype_is_object, ndim, True)
28481  */
28482       __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
28483 
28484       /* "View.MemoryView":1318
28485  *
28486  *             refcount_copying(&dst, dtype_is_object, ndim, False)
28487  *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))             # <<<<<<<<<<<<<<
28488  *             refcount_copying(&dst, dtype_is_object, ndim, True)
28489  *             free(tmpdata)
28490  */
28491       (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
28492 
28493       /* "View.MemoryView":1319
28494  *             refcount_copying(&dst, dtype_is_object, ndim, False)
28495  *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))
28496  *             refcount_copying(&dst, dtype_is_object, ndim, True)             # <<<<<<<<<<<<<<
28497  *             free(tmpdata)
28498  *             return 0
28499  */
28500       __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
28501 
28502       /* "View.MemoryView":1320
28503  *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))
28504  *             refcount_copying(&dst, dtype_is_object, ndim, True)
28505  *             free(tmpdata)             # <<<<<<<<<<<<<<
28506  *             return 0
28507  *
28508  */
28509       free(__pyx_v_tmpdata);
28510 
28511       /* "View.MemoryView":1321
28512  *             refcount_copying(&dst, dtype_is_object, ndim, True)
28513  *             free(tmpdata)
28514  *             return 0             # <<<<<<<<<<<<<<
28515  *
28516  *     if order == 'F' == get_best_order(&dst, ndim):
28517  */
28518       __pyx_r = 0;
28519       goto __pyx_L0;
28520 
28521       /* "View.MemoryView":1315
28522  *             direct_copy = slice_is_contig(dst, 'F', ndim)
28523  *
28524  *         if direct_copy:             # <<<<<<<<<<<<<<
28525  *
28526  *             refcount_copying(&dst, dtype_is_object, ndim, False)
28527  */
28528     }
28529 
28530     /* "View.MemoryView":1307
28531  *         src = tmp
28532  *
28533  *     if not broadcasting:             # <<<<<<<<<<<<<<
28534  *
28535  *
28536  */
28537   }
28538 
28539   /* "View.MemoryView":1323
28540  *             return 0
28541  *
28542  *     if order == 'F' == get_best_order(&dst, ndim):             # <<<<<<<<<<<<<<
28543  *
28544  *
28545  */
28546   __pyx_t_2 = (__pyx_v_order == 'F');
28547   if (__pyx_t_2) {
28548     __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
28549   }
28550   __pyx_t_8 = (__pyx_t_2 != 0);
28551   if (__pyx_t_8) {
28552 
28553     /* "View.MemoryView":1326
28554  *
28555  *
28556  *         transpose_memslice(&src)             # <<<<<<<<<<<<<<
28557  *         transpose_memslice(&dst)
28558  *
28559  */
28560     __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1326, __pyx_L1_error)
28561 
28562     /* "View.MemoryView":1327
28563  *
28564  *         transpose_memslice(&src)
28565  *         transpose_memslice(&dst)             # <<<<<<<<<<<<<<
28566  *
28567  *     refcount_copying(&dst, dtype_is_object, ndim, False)
28568  */
28569     __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1327, __pyx_L1_error)
28570 
28571     /* "View.MemoryView":1323
28572  *             return 0
28573  *
28574  *     if order == 'F' == get_best_order(&dst, ndim):             # <<<<<<<<<<<<<<
28575  *
28576  *
28577  */
28578   }
28579 
28580   /* "View.MemoryView":1329
28581  *         transpose_memslice(&dst)
28582  *
28583  *     refcount_copying(&dst, dtype_is_object, ndim, False)             # <<<<<<<<<<<<<<
28584  *     copy_strided_to_strided(&src, &dst, ndim, itemsize)
28585  *     refcount_copying(&dst, dtype_is_object, ndim, True)
28586  */
28587   __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
28588 
28589   /* "View.MemoryView":1330
28590  *
28591  *     refcount_copying(&dst, dtype_is_object, ndim, False)
28592  *     copy_strided_to_strided(&src, &dst, ndim, itemsize)             # <<<<<<<<<<<<<<
28593  *     refcount_copying(&dst, dtype_is_object, ndim, True)
28594  *
28595  */
28596   copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
28597 
28598   /* "View.MemoryView":1331
28599  *     refcount_copying(&dst, dtype_is_object, ndim, False)
28600  *     copy_strided_to_strided(&src, &dst, ndim, itemsize)
28601  *     refcount_copying(&dst, dtype_is_object, ndim, True)             # <<<<<<<<<<<<<<
28602  *
28603  *     free(tmpdata)
28604  */
28605   __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
28606 
28607   /* "View.MemoryView":1333
28608  *     refcount_copying(&dst, dtype_is_object, ndim, True)
28609  *
28610  *     free(tmpdata)             # <<<<<<<<<<<<<<
28611  *     return 0
28612  *
28613  */
28614   free(__pyx_v_tmpdata);
28615 
28616   /* "View.MemoryView":1334
28617  *
28618  *     free(tmpdata)
28619  *     return 0             # <<<<<<<<<<<<<<
28620  *
28621  * @cname('__pyx_memoryview_broadcast_leading')
28622  */
28623   __pyx_r = 0;
28624   goto __pyx_L0;
28625 
28626   /* "View.MemoryView":1265
28627  *
28628  * @cname('__pyx_memoryview_copy_contents')
28629  * cdef int memoryview_copy_contents(__Pyx_memviewslice src,             # <<<<<<<<<<<<<<
28630  *                                   __Pyx_memviewslice dst,
28631  *                                   int src_ndim, int dst_ndim,
28632  */
28633 
28634   /* function exit code */
28635   __pyx_L1_error:;
28636   {
28637     #ifdef WITH_THREAD
28638     PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
28639     #endif
28640     __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
28641     #ifdef WITH_THREAD
28642     __Pyx_PyGILState_Release(__pyx_gilstate_save);
28643     #endif
28644   }
28645   __pyx_r = -1;
28646   __pyx_L0:;
28647   return __pyx_r;
28648 }
28649 
28650 /* "View.MemoryView":1337
28651  *
28652  * @cname('__pyx_memoryview_broadcast_leading')
28653  * cdef void broadcast_leading(__Pyx_memviewslice *mslice,             # <<<<<<<<<<<<<<
28654  *                             int ndim,
28655  *                             int ndim_other) nogil:
28656  */
28657 
__pyx_memoryview_broadcast_leading(__Pyx_memviewslice * __pyx_v_mslice,int __pyx_v_ndim,int __pyx_v_ndim_other)28658 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
28659   int __pyx_v_i;
28660   int __pyx_v_offset;
28661   int __pyx_t_1;
28662   int __pyx_t_2;
28663   int __pyx_t_3;
28664 
28665   /* "View.MemoryView":1341
28666  *                             int ndim_other) nogil:
28667  *     cdef int i
28668  *     cdef int offset = ndim_other - ndim             # <<<<<<<<<<<<<<
28669  *
28670  *     for i in range(ndim - 1, -1, -1):
28671  */
28672   __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
28673 
28674   /* "View.MemoryView":1343
28675  *     cdef int offset = ndim_other - ndim
28676  *
28677  *     for i in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
28678  *         mslice.shape[i + offset] = mslice.shape[i]
28679  *         mslice.strides[i + offset] = mslice.strides[i]
28680  */
28681   for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
28682     __pyx_v_i = __pyx_t_1;
28683 
28684     /* "View.MemoryView":1344
28685  *
28686  *     for i in range(ndim - 1, -1, -1):
28687  *         mslice.shape[i + offset] = mslice.shape[i]             # <<<<<<<<<<<<<<
28688  *         mslice.strides[i + offset] = mslice.strides[i]
28689  *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]
28690  */
28691     (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
28692 
28693     /* "View.MemoryView":1345
28694  *     for i in range(ndim - 1, -1, -1):
28695  *         mslice.shape[i + offset] = mslice.shape[i]
28696  *         mslice.strides[i + offset] = mslice.strides[i]             # <<<<<<<<<<<<<<
28697  *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]
28698  *
28699  */
28700     (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
28701 
28702     /* "View.MemoryView":1346
28703  *         mslice.shape[i + offset] = mslice.shape[i]
28704  *         mslice.strides[i + offset] = mslice.strides[i]
28705  *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]             # <<<<<<<<<<<<<<
28706  *
28707  *     for i in range(offset):
28708  */
28709     (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
28710   }
28711 
28712   /* "View.MemoryView":1348
28713  *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]
28714  *
28715  *     for i in range(offset):             # <<<<<<<<<<<<<<
28716  *         mslice.shape[i] = 1
28717  *         mslice.strides[i] = mslice.strides[0]
28718  */
28719   __pyx_t_1 = __pyx_v_offset;
28720   __pyx_t_2 = __pyx_t_1;
28721   for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
28722     __pyx_v_i = __pyx_t_3;
28723 
28724     /* "View.MemoryView":1349
28725  *
28726  *     for i in range(offset):
28727  *         mslice.shape[i] = 1             # <<<<<<<<<<<<<<
28728  *         mslice.strides[i] = mslice.strides[0]
28729  *         mslice.suboffsets[i] = -1
28730  */
28731     (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
28732 
28733     /* "View.MemoryView":1350
28734  *     for i in range(offset):
28735  *         mslice.shape[i] = 1
28736  *         mslice.strides[i] = mslice.strides[0]             # <<<<<<<<<<<<<<
28737  *         mslice.suboffsets[i] = -1
28738  *
28739  */
28740     (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
28741 
28742     /* "View.MemoryView":1351
28743  *         mslice.shape[i] = 1
28744  *         mslice.strides[i] = mslice.strides[0]
28745  *         mslice.suboffsets[i] = -1             # <<<<<<<<<<<<<<
28746  *
28747  *
28748  */
28749     (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
28750   }
28751 
28752   /* "View.MemoryView":1337
28753  *
28754  * @cname('__pyx_memoryview_broadcast_leading')
28755  * cdef void broadcast_leading(__Pyx_memviewslice *mslice,             # <<<<<<<<<<<<<<
28756  *                             int ndim,
28757  *                             int ndim_other) nogil:
28758  */
28759 
28760   /* function exit code */
28761 }
28762 
28763 /* "View.MemoryView":1359
28764  *
28765  * @cname('__pyx_memoryview_refcount_copying')
28766  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object,             # <<<<<<<<<<<<<<
28767  *                            int ndim, bint inc) nogil:
28768  *
28769  */
28770 
__pyx_memoryview_refcount_copying(__Pyx_memviewslice * __pyx_v_dst,int __pyx_v_dtype_is_object,int __pyx_v_ndim,int __pyx_v_inc)28771 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) {
28772   int __pyx_t_1;
28773 
28774   /* "View.MemoryView":1363
28775  *
28776  *
28777  *     if dtype_is_object:             # <<<<<<<<<<<<<<
28778  *         refcount_objects_in_slice_with_gil(dst.data, dst.shape,
28779  *                                            dst.strides, ndim, inc)
28780  */
28781   __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
28782   if (__pyx_t_1) {
28783 
28784     /* "View.MemoryView":1364
28785  *
28786  *     if dtype_is_object:
28787  *         refcount_objects_in_slice_with_gil(dst.data, dst.shape,             # <<<<<<<<<<<<<<
28788  *                                            dst.strides, ndim, inc)
28789  *
28790  */
28791     __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);
28792 
28793     /* "View.MemoryView":1363
28794  *
28795  *
28796  *     if dtype_is_object:             # <<<<<<<<<<<<<<
28797  *         refcount_objects_in_slice_with_gil(dst.data, dst.shape,
28798  *                                            dst.strides, ndim, inc)
28799  */
28800   }
28801 
28802   /* "View.MemoryView":1359
28803  *
28804  * @cname('__pyx_memoryview_refcount_copying')
28805  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object,             # <<<<<<<<<<<<<<
28806  *                            int ndim, bint inc) nogil:
28807  *
28808  */
28809 
28810   /* function exit code */
28811 }
28812 
28813 /* "View.MemoryView":1368
28814  *
28815  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
28816  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
28817  *                                              Py_ssize_t *strides, int ndim,
28818  *                                              bint inc) with gil:
28819  */
28820 
__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)28821 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) {
28822   __Pyx_RefNannyDeclarations
28823   #ifdef WITH_THREAD
28824   PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
28825   #endif
28826   __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
28827 
28828   /* "View.MemoryView":1371
28829  *                                              Py_ssize_t *strides, int ndim,
28830  *                                              bint inc) with gil:
28831  *     refcount_objects_in_slice(data, shape, strides, ndim, inc)             # <<<<<<<<<<<<<<
28832  *
28833  * @cname('__pyx_memoryview_refcount_objects_in_slice')
28834  */
28835   __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
28836 
28837   /* "View.MemoryView":1368
28838  *
28839  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
28840  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
28841  *                                              Py_ssize_t *strides, int ndim,
28842  *                                              bint inc) with gil:
28843  */
28844 
28845   /* function exit code */
28846   __Pyx_RefNannyFinishContext();
28847   #ifdef WITH_THREAD
28848   __Pyx_PyGILState_Release(__pyx_gilstate_save);
28849   #endif
28850 }
28851 
28852 /* "View.MemoryView":1374
28853  *
28854  * @cname('__pyx_memoryview_refcount_objects_in_slice')
28855  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
28856  *                                     Py_ssize_t *strides, int ndim, bint inc):
28857  *     cdef Py_ssize_t i
28858  */
28859 
__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)28860 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) {
28861   CYTHON_UNUSED Py_ssize_t __pyx_v_i;
28862   __Pyx_RefNannyDeclarations
28863   Py_ssize_t __pyx_t_1;
28864   Py_ssize_t __pyx_t_2;
28865   Py_ssize_t __pyx_t_3;
28866   int __pyx_t_4;
28867   __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
28868 
28869   /* "View.MemoryView":1378
28870  *     cdef Py_ssize_t i
28871  *
28872  *     for i in range(shape[0]):             # <<<<<<<<<<<<<<
28873  *         if ndim == 1:
28874  *             if inc:
28875  */
28876   __pyx_t_1 = (__pyx_v_shape[0]);
28877   __pyx_t_2 = __pyx_t_1;
28878   for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
28879     __pyx_v_i = __pyx_t_3;
28880 
28881     /* "View.MemoryView":1379
28882  *
28883  *     for i in range(shape[0]):
28884  *         if ndim == 1:             # <<<<<<<<<<<<<<
28885  *             if inc:
28886  *                 Py_INCREF((<PyObject **> data)[0])
28887  */
28888     __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
28889     if (__pyx_t_4) {
28890 
28891       /* "View.MemoryView":1380
28892  *     for i in range(shape[0]):
28893  *         if ndim == 1:
28894  *             if inc:             # <<<<<<<<<<<<<<
28895  *                 Py_INCREF((<PyObject **> data)[0])
28896  *             else:
28897  */
28898       __pyx_t_4 = (__pyx_v_inc != 0);
28899       if (__pyx_t_4) {
28900 
28901         /* "View.MemoryView":1381
28902  *         if ndim == 1:
28903  *             if inc:
28904  *                 Py_INCREF((<PyObject **> data)[0])             # <<<<<<<<<<<<<<
28905  *             else:
28906  *                 Py_DECREF((<PyObject **> data)[0])
28907  */
28908         Py_INCREF((((PyObject **)__pyx_v_data)[0]));
28909 
28910         /* "View.MemoryView":1380
28911  *     for i in range(shape[0]):
28912  *         if ndim == 1:
28913  *             if inc:             # <<<<<<<<<<<<<<
28914  *                 Py_INCREF((<PyObject **> data)[0])
28915  *             else:
28916  */
28917         goto __pyx_L6;
28918       }
28919 
28920       /* "View.MemoryView":1383
28921  *                 Py_INCREF((<PyObject **> data)[0])
28922  *             else:
28923  *                 Py_DECREF((<PyObject **> data)[0])             # <<<<<<<<<<<<<<
28924  *         else:
28925  *             refcount_objects_in_slice(data, shape + 1, strides + 1,
28926  */
28927       /*else*/ {
28928         Py_DECREF((((PyObject **)__pyx_v_data)[0]));
28929       }
28930       __pyx_L6:;
28931 
28932       /* "View.MemoryView":1379
28933  *
28934  *     for i in range(shape[0]):
28935  *         if ndim == 1:             # <<<<<<<<<<<<<<
28936  *             if inc:
28937  *                 Py_INCREF((<PyObject **> data)[0])
28938  */
28939       goto __pyx_L5;
28940     }
28941 
28942     /* "View.MemoryView":1385
28943  *                 Py_DECREF((<PyObject **> data)[0])
28944  *         else:
28945  *             refcount_objects_in_slice(data, shape + 1, strides + 1,             # <<<<<<<<<<<<<<
28946  *                                       ndim - 1, inc)
28947  *
28948  */
28949     /*else*/ {
28950 
28951       /* "View.MemoryView":1386
28952  *         else:
28953  *             refcount_objects_in_slice(data, shape + 1, strides + 1,
28954  *                                       ndim - 1, inc)             # <<<<<<<<<<<<<<
28955  *
28956  *         data += strides[0]
28957  */
28958       __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
28959     }
28960     __pyx_L5:;
28961 
28962     /* "View.MemoryView":1388
28963  *                                       ndim - 1, inc)
28964  *
28965  *         data += strides[0]             # <<<<<<<<<<<<<<
28966  *
28967  *
28968  */
28969     __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
28970   }
28971 
28972   /* "View.MemoryView":1374
28973  *
28974  * @cname('__pyx_memoryview_refcount_objects_in_slice')
28975  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
28976  *                                     Py_ssize_t *strides, int ndim, bint inc):
28977  *     cdef Py_ssize_t i
28978  */
28979 
28980   /* function exit code */
28981   __Pyx_RefNannyFinishContext();
28982 }
28983 
28984 /* "View.MemoryView":1394
28985  *
28986  * @cname('__pyx_memoryview_slice_assign_scalar')
28987  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim,             # <<<<<<<<<<<<<<
28988  *                               size_t itemsize, void *item,
28989  *                               bint dtype_is_object) nogil:
28990  */
28991 
__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)28992 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) {
28993 
28994   /* "View.MemoryView":1397
28995  *                               size_t itemsize, void *item,
28996  *                               bint dtype_is_object) nogil:
28997  *     refcount_copying(dst, dtype_is_object, ndim, False)             # <<<<<<<<<<<<<<
28998  *     _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
28999  *                          itemsize, item)
29000  */
29001   __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
29002 
29003   /* "View.MemoryView":1398
29004  *                               bint dtype_is_object) nogil:
29005  *     refcount_copying(dst, dtype_is_object, ndim, False)
29006  *     _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,             # <<<<<<<<<<<<<<
29007  *                          itemsize, item)
29008  *     refcount_copying(dst, dtype_is_object, ndim, True)
29009  */
29010   __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);
29011 
29012   /* "View.MemoryView":1400
29013  *     _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
29014  *                          itemsize, item)
29015  *     refcount_copying(dst, dtype_is_object, ndim, True)             # <<<<<<<<<<<<<<
29016  *
29017  *
29018  */
29019   __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
29020 
29021   /* "View.MemoryView":1394
29022  *
29023  * @cname('__pyx_memoryview_slice_assign_scalar')
29024  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim,             # <<<<<<<<<<<<<<
29025  *                               size_t itemsize, void *item,
29026  *                               bint dtype_is_object) nogil:
29027  */
29028 
29029   /* function exit code */
29030 }
29031 
29032 /* "View.MemoryView":1404
29033  *
29034  * @cname('__pyx_memoryview__slice_assign_scalar')
29035  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
29036  *                               Py_ssize_t *strides, int ndim,
29037  *                               size_t itemsize, void *item) nogil:
29038  */
29039 
__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)29040 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) {
29041   CYTHON_UNUSED Py_ssize_t __pyx_v_i;
29042   Py_ssize_t __pyx_v_stride;
29043   Py_ssize_t __pyx_v_extent;
29044   int __pyx_t_1;
29045   Py_ssize_t __pyx_t_2;
29046   Py_ssize_t __pyx_t_3;
29047   Py_ssize_t __pyx_t_4;
29048 
29049   /* "View.MemoryView":1408
29050  *                               size_t itemsize, void *item) nogil:
29051  *     cdef Py_ssize_t i
29052  *     cdef Py_ssize_t stride = strides[0]             # <<<<<<<<<<<<<<
29053  *     cdef Py_ssize_t extent = shape[0]
29054  *
29055  */
29056   __pyx_v_stride = (__pyx_v_strides[0]);
29057 
29058   /* "View.MemoryView":1409
29059  *     cdef Py_ssize_t i
29060  *     cdef Py_ssize_t stride = strides[0]
29061  *     cdef Py_ssize_t extent = shape[0]             # <<<<<<<<<<<<<<
29062  *
29063  *     if ndim == 1:
29064  */
29065   __pyx_v_extent = (__pyx_v_shape[0]);
29066 
29067   /* "View.MemoryView":1411
29068  *     cdef Py_ssize_t extent = shape[0]
29069  *
29070  *     if ndim == 1:             # <<<<<<<<<<<<<<
29071  *         for i in range(extent):
29072  *             memcpy(data, item, itemsize)
29073  */
29074   __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
29075   if (__pyx_t_1) {
29076 
29077     /* "View.MemoryView":1412
29078  *
29079  *     if ndim == 1:
29080  *         for i in range(extent):             # <<<<<<<<<<<<<<
29081  *             memcpy(data, item, itemsize)
29082  *             data += stride
29083  */
29084     __pyx_t_2 = __pyx_v_extent;
29085     __pyx_t_3 = __pyx_t_2;
29086     for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
29087       __pyx_v_i = __pyx_t_4;
29088 
29089       /* "View.MemoryView":1413
29090  *     if ndim == 1:
29091  *         for i in range(extent):
29092  *             memcpy(data, item, itemsize)             # <<<<<<<<<<<<<<
29093  *             data += stride
29094  *     else:
29095  */
29096       (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
29097 
29098       /* "View.MemoryView":1414
29099  *         for i in range(extent):
29100  *             memcpy(data, item, itemsize)
29101  *             data += stride             # <<<<<<<<<<<<<<
29102  *     else:
29103  *         for i in range(extent):
29104  */
29105       __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
29106     }
29107 
29108     /* "View.MemoryView":1411
29109  *     cdef Py_ssize_t extent = shape[0]
29110  *
29111  *     if ndim == 1:             # <<<<<<<<<<<<<<
29112  *         for i in range(extent):
29113  *             memcpy(data, item, itemsize)
29114  */
29115     goto __pyx_L3;
29116   }
29117 
29118   /* "View.MemoryView":1416
29119  *             data += stride
29120  *     else:
29121  *         for i in range(extent):             # <<<<<<<<<<<<<<
29122  *             _slice_assign_scalar(data, shape + 1, strides + 1,
29123  *                                 ndim - 1, itemsize, item)
29124  */
29125   /*else*/ {
29126     __pyx_t_2 = __pyx_v_extent;
29127     __pyx_t_3 = __pyx_t_2;
29128     for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
29129       __pyx_v_i = __pyx_t_4;
29130 
29131       /* "View.MemoryView":1417
29132  *     else:
29133  *         for i in range(extent):
29134  *             _slice_assign_scalar(data, shape + 1, strides + 1,             # <<<<<<<<<<<<<<
29135  *                                 ndim - 1, itemsize, item)
29136  *             data += stride
29137  */
29138       __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);
29139 
29140       /* "View.MemoryView":1419
29141  *             _slice_assign_scalar(data, shape + 1, strides + 1,
29142  *                                 ndim - 1, itemsize, item)
29143  *             data += stride             # <<<<<<<<<<<<<<
29144  *
29145  *
29146  */
29147       __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
29148     }
29149   }
29150   __pyx_L3:;
29151 
29152   /* "View.MemoryView":1404
29153  *
29154  * @cname('__pyx_memoryview__slice_assign_scalar')
29155  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
29156  *                               Py_ssize_t *strides, int ndim,
29157  *                               size_t itemsize, void *item) nogil:
29158  */
29159 
29160   /* function exit code */
29161 }
29162 
29163 /* "(tree fragment)":1
29164  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
29165  *     cdef object __pyx_PickleError
29166  *     cdef object __pyx_result
29167  */
29168 
29169 /* Python wrapper */
29170 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
29171 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)29172 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
29173   PyObject *__pyx_v___pyx_type = 0;
29174   long __pyx_v___pyx_checksum;
29175   PyObject *__pyx_v___pyx_state = 0;
29176   PyObject *__pyx_r = 0;
29177   __Pyx_RefNannyDeclarations
29178   __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
29179   {
29180     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
29181     PyObject* values[3] = {0,0,0};
29182     if (unlikely(__pyx_kwds)) {
29183       Py_ssize_t kw_args;
29184       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
29185       switch (pos_args) {
29186         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
29187         CYTHON_FALLTHROUGH;
29188         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
29189         CYTHON_FALLTHROUGH;
29190         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
29191         CYTHON_FALLTHROUGH;
29192         case  0: break;
29193         default: goto __pyx_L5_argtuple_error;
29194       }
29195       kw_args = PyDict_Size(__pyx_kwds);
29196       switch (pos_args) {
29197         case  0:
29198         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
29199         else goto __pyx_L5_argtuple_error;
29200         CYTHON_FALLTHROUGH;
29201         case  1:
29202         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
29203         else {
29204           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
29205         }
29206         CYTHON_FALLTHROUGH;
29207         case  2:
29208         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
29209         else {
29210           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
29211         }
29212       }
29213       if (unlikely(kw_args > 0)) {
29214         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
29215       }
29216     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
29217       goto __pyx_L5_argtuple_error;
29218     } else {
29219       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
29220       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
29221       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
29222     }
29223     __pyx_v___pyx_type = values[0];
29224     __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
29225     __pyx_v___pyx_state = values[2];
29226   }
29227   goto __pyx_L4_argument_unpacking_done;
29228   __pyx_L5_argtuple_error:;
29229   __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
29230   __pyx_L3_error:;
29231   __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
29232   __Pyx_RefNannyFinishContext();
29233   return NULL;
29234   __pyx_L4_argument_unpacking_done:;
29235   __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
29236 
29237   /* function exit code */
29238   __Pyx_RefNannyFinishContext();
29239   return __pyx_r;
29240 }
29241 
__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)29242 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) {
29243   PyObject *__pyx_v___pyx_PickleError = 0;
29244   PyObject *__pyx_v___pyx_result = 0;
29245   PyObject *__pyx_r = NULL;
29246   __Pyx_RefNannyDeclarations
29247   int __pyx_t_1;
29248   PyObject *__pyx_t_2 = NULL;
29249   PyObject *__pyx_t_3 = NULL;
29250   PyObject *__pyx_t_4 = NULL;
29251   PyObject *__pyx_t_5 = NULL;
29252   int __pyx_t_6;
29253   __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);
29254 
29255   /* "(tree fragment)":4
29256  *     cdef object __pyx_PickleError
29257  *     cdef object __pyx_result
29258  *     if __pyx_checksum != 0xb068931:             # <<<<<<<<<<<<<<
29259  *         from pickle import PickleError as __pyx_PickleError
29260  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
29261  */
29262   __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0);
29263   if (__pyx_t_1) {
29264 
29265     /* "(tree fragment)":5
29266  *     cdef object __pyx_result
29267  *     if __pyx_checksum != 0xb068931:
29268  *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
29269  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
29270  *     __pyx_result = Enum.__new__(__pyx_type)
29271  */
29272     __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
29273     __Pyx_GOTREF(__pyx_t_2);
29274     __Pyx_INCREF(__pyx_n_s_PickleError);
29275     __Pyx_GIVEREF(__pyx_n_s_PickleError);
29276     PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
29277     __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
29278     __Pyx_GOTREF(__pyx_t_3);
29279     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29280     __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
29281     __Pyx_GOTREF(__pyx_t_2);
29282     __Pyx_INCREF(__pyx_t_2);
29283     __pyx_v___pyx_PickleError = __pyx_t_2;
29284     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29285     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
29286 
29287     /* "(tree fragment)":6
29288  *     if __pyx_checksum != 0xb068931:
29289  *         from pickle import PickleError as __pyx_PickleError
29290  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)             # <<<<<<<<<<<<<<
29291  *     __pyx_result = Enum.__new__(__pyx_type)
29292  *     if __pyx_state is not None:
29293  */
29294     __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
29295     __Pyx_GOTREF(__pyx_t_2);
29296     __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
29297     __Pyx_GOTREF(__pyx_t_4);
29298     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29299     __Pyx_INCREF(__pyx_v___pyx_PickleError);
29300     __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
29301     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
29302       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
29303       if (likely(__pyx_t_5)) {
29304         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
29305         __Pyx_INCREF(__pyx_t_5);
29306         __Pyx_INCREF(function);
29307         __Pyx_DECREF_SET(__pyx_t_2, function);
29308       }
29309     }
29310     __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);
29311     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
29312     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29313     if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
29314     __Pyx_GOTREF(__pyx_t_3);
29315     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29316     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
29317     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
29318     __PYX_ERR(1, 6, __pyx_L1_error)
29319 
29320     /* "(tree fragment)":4
29321  *     cdef object __pyx_PickleError
29322  *     cdef object __pyx_result
29323  *     if __pyx_checksum != 0xb068931:             # <<<<<<<<<<<<<<
29324  *         from pickle import PickleError as __pyx_PickleError
29325  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
29326  */
29327   }
29328 
29329   /* "(tree fragment)":7
29330  *         from pickle import PickleError as __pyx_PickleError
29331  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
29332  *     __pyx_result = Enum.__new__(__pyx_type)             # <<<<<<<<<<<<<<
29333  *     if __pyx_state is not None:
29334  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
29335  */
29336   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
29337   __Pyx_GOTREF(__pyx_t_2);
29338   __pyx_t_4 = NULL;
29339   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
29340     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
29341     if (likely(__pyx_t_4)) {
29342       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
29343       __Pyx_INCREF(__pyx_t_4);
29344       __Pyx_INCREF(function);
29345       __Pyx_DECREF_SET(__pyx_t_2, function);
29346     }
29347   }
29348   __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);
29349   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
29350   if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
29351   __Pyx_GOTREF(__pyx_t_3);
29352   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29353   __pyx_v___pyx_result = __pyx_t_3;
29354   __pyx_t_3 = 0;
29355 
29356   /* "(tree fragment)":8
29357  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
29358  *     __pyx_result = Enum.__new__(__pyx_type)
29359  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
29360  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
29361  *     return __pyx_result
29362  */
29363   __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
29364   __pyx_t_6 = (__pyx_t_1 != 0);
29365   if (__pyx_t_6) {
29366 
29367     /* "(tree fragment)":9
29368  *     __pyx_result = Enum.__new__(__pyx_type)
29369  *     if __pyx_state is not None:
29370  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
29371  *     return __pyx_result
29372  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
29373  */
29374     if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
29375     __pyx_t_3 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
29376     __Pyx_GOTREF(__pyx_t_3);
29377     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
29378 
29379     /* "(tree fragment)":8
29380  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
29381  *     __pyx_result = Enum.__new__(__pyx_type)
29382  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
29383  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
29384  *     return __pyx_result
29385  */
29386   }
29387 
29388   /* "(tree fragment)":10
29389  *     if __pyx_state is not None:
29390  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
29391  *     return __pyx_result             # <<<<<<<<<<<<<<
29392  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
29393  *     __pyx_result.name = __pyx_state[0]
29394  */
29395   __Pyx_XDECREF(__pyx_r);
29396   __Pyx_INCREF(__pyx_v___pyx_result);
29397   __pyx_r = __pyx_v___pyx_result;
29398   goto __pyx_L0;
29399 
29400   /* "(tree fragment)":1
29401  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
29402  *     cdef object __pyx_PickleError
29403  *     cdef object __pyx_result
29404  */
29405 
29406   /* function exit code */
29407   __pyx_L1_error:;
29408   __Pyx_XDECREF(__pyx_t_2);
29409   __Pyx_XDECREF(__pyx_t_3);
29410   __Pyx_XDECREF(__pyx_t_4);
29411   __Pyx_XDECREF(__pyx_t_5);
29412   __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
29413   __pyx_r = NULL;
29414   __pyx_L0:;
29415   __Pyx_XDECREF(__pyx_v___pyx_PickleError);
29416   __Pyx_XDECREF(__pyx_v___pyx_result);
29417   __Pyx_XGIVEREF(__pyx_r);
29418   __Pyx_RefNannyFinishContext();
29419   return __pyx_r;
29420 }
29421 
29422 /* "(tree fragment)":11
29423  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
29424  *     return __pyx_result
29425  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
29426  *     __pyx_result.name = __pyx_state[0]
29427  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
29428  */
29429 
__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj * __pyx_v___pyx_result,PyObject * __pyx_v___pyx_state)29430 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
29431   PyObject *__pyx_r = NULL;
29432   __Pyx_RefNannyDeclarations
29433   PyObject *__pyx_t_1 = NULL;
29434   int __pyx_t_2;
29435   Py_ssize_t __pyx_t_3;
29436   int __pyx_t_4;
29437   int __pyx_t_5;
29438   PyObject *__pyx_t_6 = NULL;
29439   PyObject *__pyx_t_7 = NULL;
29440   PyObject *__pyx_t_8 = NULL;
29441   __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);
29442 
29443   /* "(tree fragment)":12
29444  *     return __pyx_result
29445  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
29446  *     __pyx_result.name = __pyx_state[0]             # <<<<<<<<<<<<<<
29447  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
29448  *         __pyx_result.__dict__.update(__pyx_state[1])
29449  */
29450   if (unlikely(__pyx_v___pyx_state == Py_None)) {
29451     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
29452     __PYX_ERR(1, 12, __pyx_L1_error)
29453   }
29454   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
29455   __Pyx_GOTREF(__pyx_t_1);
29456   __Pyx_GIVEREF(__pyx_t_1);
29457   __Pyx_GOTREF(__pyx_v___pyx_result->name);
29458   __Pyx_DECREF(__pyx_v___pyx_result->name);
29459   __pyx_v___pyx_result->name = __pyx_t_1;
29460   __pyx_t_1 = 0;
29461 
29462   /* "(tree fragment)":13
29463  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
29464  *     __pyx_result.name = __pyx_state[0]
29465  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
29466  *         __pyx_result.__dict__.update(__pyx_state[1])
29467  */
29468   if (unlikely(__pyx_v___pyx_state == Py_None)) {
29469     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
29470     __PYX_ERR(1, 13, __pyx_L1_error)
29471   }
29472   __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
29473   __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
29474   if (__pyx_t_4) {
29475   } else {
29476     __pyx_t_2 = __pyx_t_4;
29477     goto __pyx_L4_bool_binop_done;
29478   }
29479   __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
29480   __pyx_t_5 = (__pyx_t_4 != 0);
29481   __pyx_t_2 = __pyx_t_5;
29482   __pyx_L4_bool_binop_done:;
29483   if (__pyx_t_2) {
29484 
29485     /* "(tree fragment)":14
29486  *     __pyx_result.name = __pyx_state[0]
29487  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
29488  *         __pyx_result.__dict__.update(__pyx_state[1])             # <<<<<<<<<<<<<<
29489  */
29490     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
29491     __Pyx_GOTREF(__pyx_t_6);
29492     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
29493     __Pyx_GOTREF(__pyx_t_7);
29494     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
29495     if (unlikely(__pyx_v___pyx_state == Py_None)) {
29496       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
29497       __PYX_ERR(1, 14, __pyx_L1_error)
29498     }
29499     __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
29500     __Pyx_GOTREF(__pyx_t_6);
29501     __pyx_t_8 = NULL;
29502     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
29503       __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
29504       if (likely(__pyx_t_8)) {
29505         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
29506         __Pyx_INCREF(__pyx_t_8);
29507         __Pyx_INCREF(function);
29508         __Pyx_DECREF_SET(__pyx_t_7, function);
29509       }
29510     }
29511     __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);
29512     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
29513     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
29514     if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
29515     __Pyx_GOTREF(__pyx_t_1);
29516     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
29517     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29518 
29519     /* "(tree fragment)":13
29520  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
29521  *     __pyx_result.name = __pyx_state[0]
29522  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
29523  *         __pyx_result.__dict__.update(__pyx_state[1])
29524  */
29525   }
29526 
29527   /* "(tree fragment)":11
29528  *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
29529  *     return __pyx_result
29530  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
29531  *     __pyx_result.name = __pyx_state[0]
29532  *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
29533  */
29534 
29535   /* function exit code */
29536   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
29537   goto __pyx_L0;
29538   __pyx_L1_error:;
29539   __Pyx_XDECREF(__pyx_t_1);
29540   __Pyx_XDECREF(__pyx_t_6);
29541   __Pyx_XDECREF(__pyx_t_7);
29542   __Pyx_XDECREF(__pyx_t_8);
29543   __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
29544   __pyx_r = 0;
29545   __pyx_L0:;
29546   __Pyx_XGIVEREF(__pyx_r);
29547   __Pyx_RefNannyFinishContext();
29548   return __pyx_r;
29549 }
29550 
29551 /* "BufferFormatFromTypeInfo":1460
29552  *
29553  * @cname('__pyx_format_from_typeinfo')
29554  * cdef bytes format_from_typeinfo(__Pyx_TypeInfo *type):             # <<<<<<<<<<<<<<
29555  *     cdef __Pyx_StructField *field
29556  *     cdef __pyx_typeinfo_string fmt
29557  */
29558 
__pyx_format_from_typeinfo(__Pyx_TypeInfo * __pyx_v_type)29559 static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo *__pyx_v_type) {
29560   __Pyx_StructField *__pyx_v_field;
29561   struct __pyx_typeinfo_string __pyx_v_fmt;
29562   PyObject *__pyx_v_part = 0;
29563   PyObject *__pyx_v_result = 0;
29564   PyObject *__pyx_v_alignment = NULL;
29565   PyObject *__pyx_v_parts = NULL;
29566   PyObject *__pyx_v_extents = NULL;
29567   int __pyx_v_i;
29568   PyObject *__pyx_r = NULL;
29569   __Pyx_RefNannyDeclarations
29570   int __pyx_t_1;
29571   int __pyx_t_2;
29572   PyObject *__pyx_t_3 = NULL;
29573   __Pyx_StructField *__pyx_t_4;
29574   PyObject *__pyx_t_5 = NULL;
29575   PyObject *__pyx_t_6 = NULL;
29576   int __pyx_t_7;
29577   int __pyx_t_8;
29578   int __pyx_t_9;
29579   int __pyx_t_10;
29580   __Pyx_RefNannySetupContext("format_from_typeinfo", 0);
29581 
29582   /* "BufferFormatFromTypeInfo":1465
29583  *     cdef bytes part, result
29584  *
29585  *     if type.typegroup == 'S':             # <<<<<<<<<<<<<<
29586  *         assert type.fields != NULL and type.fields.type != NULL
29587  *
29588  */
29589   __pyx_t_1 = ((__pyx_v_type->typegroup == 'S') != 0);
29590   if (__pyx_t_1) {
29591 
29592     /* "BufferFormatFromTypeInfo":1466
29593  *
29594  *     if type.typegroup == 'S':
29595  *         assert type.fields != NULL and type.fields.type != NULL             # <<<<<<<<<<<<<<
29596  *
29597  *         if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT:
29598  */
29599     #ifndef CYTHON_WITHOUT_ASSERTIONS
29600     if (unlikely(!Py_OptimizeFlag)) {
29601       __pyx_t_2 = ((__pyx_v_type->fields != NULL) != 0);
29602       if (__pyx_t_2) {
29603       } else {
29604         __pyx_t_1 = __pyx_t_2;
29605         goto __pyx_L4_bool_binop_done;
29606       }
29607       __pyx_t_2 = ((__pyx_v_type->fields->type != NULL) != 0);
29608       __pyx_t_1 = __pyx_t_2;
29609       __pyx_L4_bool_binop_done:;
29610       if (unlikely(!__pyx_t_1)) {
29611         PyErr_SetNone(PyExc_AssertionError);
29612         __PYX_ERR(1, 1466, __pyx_L1_error)
29613       }
29614     }
29615     #endif
29616 
29617     /* "BufferFormatFromTypeInfo":1468
29618  *         assert type.fields != NULL and type.fields.type != NULL
29619  *
29620  *         if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT:             # <<<<<<<<<<<<<<
29621  *             alignment = b'^'
29622  *         else:
29623  */
29624     __pyx_t_1 = ((__pyx_v_type->flags & __PYX_BUF_FLAGS_PACKED_STRUCT) != 0);
29625     if (__pyx_t_1) {
29626 
29627       /* "BufferFormatFromTypeInfo":1469
29628  *
29629  *         if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT:
29630  *             alignment = b'^'             # <<<<<<<<<<<<<<
29631  *         else:
29632  *             alignment = b''
29633  */
29634       __Pyx_INCREF(__pyx_kp_b__50);
29635       __pyx_v_alignment = __pyx_kp_b__50;
29636 
29637       /* "BufferFormatFromTypeInfo":1468
29638  *         assert type.fields != NULL and type.fields.type != NULL
29639  *
29640  *         if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT:             # <<<<<<<<<<<<<<
29641  *             alignment = b'^'
29642  *         else:
29643  */
29644       goto __pyx_L6;
29645     }
29646 
29647     /* "BufferFormatFromTypeInfo":1471
29648  *             alignment = b'^'
29649  *         else:
29650  *             alignment = b''             # <<<<<<<<<<<<<<
29651  *
29652  *         parts = [b"T{"]
29653  */
29654     /*else*/ {
29655       __Pyx_INCREF(__pyx_kp_b__51);
29656       __pyx_v_alignment = __pyx_kp_b__51;
29657     }
29658     __pyx_L6:;
29659 
29660     /* "BufferFormatFromTypeInfo":1473
29661  *             alignment = b''
29662  *
29663  *         parts = [b"T{"]             # <<<<<<<<<<<<<<
29664  *         field = type.fields
29665  *
29666  */
29667     __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1473, __pyx_L1_error)
29668     __Pyx_GOTREF(__pyx_t_3);
29669     __Pyx_INCREF(__pyx_kp_b_T);
29670     __Pyx_GIVEREF(__pyx_kp_b_T);
29671     PyList_SET_ITEM(__pyx_t_3, 0, __pyx_kp_b_T);
29672     __pyx_v_parts = ((PyObject*)__pyx_t_3);
29673     __pyx_t_3 = 0;
29674 
29675     /* "BufferFormatFromTypeInfo":1474
29676  *
29677  *         parts = [b"T{"]
29678  *         field = type.fields             # <<<<<<<<<<<<<<
29679  *
29680  *         while field.type:
29681  */
29682     __pyx_t_4 = __pyx_v_type->fields;
29683     __pyx_v_field = __pyx_t_4;
29684 
29685     /* "BufferFormatFromTypeInfo":1476
29686  *         field = type.fields
29687  *
29688  *         while field.type:             # <<<<<<<<<<<<<<
29689  *             part = format_from_typeinfo(field.type)
29690  *             parts.append(part + b':' + field.name + b':')
29691  */
29692     while (1) {
29693       __pyx_t_1 = (__pyx_v_field->type != 0);
29694       if (!__pyx_t_1) break;
29695 
29696       /* "BufferFormatFromTypeInfo":1477
29697  *
29698  *         while field.type:
29699  *             part = format_from_typeinfo(field.type)             # <<<<<<<<<<<<<<
29700  *             parts.append(part + b':' + field.name + b':')
29701  *             field += 1
29702  */
29703       __pyx_t_3 = __pyx_format_from_typeinfo(__pyx_v_field->type); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1477, __pyx_L1_error)
29704       __Pyx_GOTREF(__pyx_t_3);
29705       __Pyx_XDECREF_SET(__pyx_v_part, ((PyObject*)__pyx_t_3));
29706       __pyx_t_3 = 0;
29707 
29708       /* "BufferFormatFromTypeInfo":1478
29709  *         while field.type:
29710  *             part = format_from_typeinfo(field.type)
29711  *             parts.append(part + b':' + field.name + b':')             # <<<<<<<<<<<<<<
29712  *             field += 1
29713  *
29714  */
29715       __pyx_t_3 = PyNumber_Add(__pyx_v_part, __pyx_kp_b__52); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1478, __pyx_L1_error)
29716       __Pyx_GOTREF(__pyx_t_3);
29717       __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_field->name); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1478, __pyx_L1_error)
29718       __Pyx_GOTREF(__pyx_t_5);
29719       __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1478, __pyx_L1_error)
29720       __Pyx_GOTREF(__pyx_t_6);
29721       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
29722       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
29723       __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_kp_b__52); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1478, __pyx_L1_error)
29724       __Pyx_GOTREF(__pyx_t_5);
29725       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
29726       __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_parts, __pyx_t_5); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(1, 1478, __pyx_L1_error)
29727       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
29728 
29729       /* "BufferFormatFromTypeInfo":1479
29730  *             part = format_from_typeinfo(field.type)
29731  *             parts.append(part + b':' + field.name + b':')
29732  *             field += 1             # <<<<<<<<<<<<<<
29733  *
29734  *         result = alignment.join(parts) + b'}'
29735  */
29736       __pyx_v_field = (__pyx_v_field + 1);
29737     }
29738 
29739     /* "BufferFormatFromTypeInfo":1481
29740  *             field += 1
29741  *
29742  *         result = alignment.join(parts) + b'}'             # <<<<<<<<<<<<<<
29743  *     else:
29744  *         fmt = __Pyx_TypeInfoToFormat(type)
29745  */
29746     __pyx_t_5 = __Pyx_PyBytes_Join(__pyx_v_alignment, __pyx_v_parts); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1481, __pyx_L1_error)
29747     __Pyx_GOTREF(__pyx_t_5);
29748     __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_kp_b__53); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1481, __pyx_L1_error)
29749     __Pyx_GOTREF(__pyx_t_6);
29750     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
29751     if (!(likely(PyBytes_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(1, 1481, __pyx_L1_error)
29752     __pyx_v_result = ((PyObject*)__pyx_t_6);
29753     __pyx_t_6 = 0;
29754 
29755     /* "BufferFormatFromTypeInfo":1465
29756  *     cdef bytes part, result
29757  *
29758  *     if type.typegroup == 'S':             # <<<<<<<<<<<<<<
29759  *         assert type.fields != NULL and type.fields.type != NULL
29760  *
29761  */
29762     goto __pyx_L3;
29763   }
29764 
29765   /* "BufferFormatFromTypeInfo":1483
29766  *         result = alignment.join(parts) + b'}'
29767  *     else:
29768  *         fmt = __Pyx_TypeInfoToFormat(type)             # <<<<<<<<<<<<<<
29769  *         if type.arraysize[0]:
29770  *             extents = [unicode(type.arraysize[i]) for i in range(type.ndim)]
29771  */
29772   /*else*/ {
29773     __pyx_v_fmt = __Pyx_TypeInfoToFormat(__pyx_v_type);
29774 
29775     /* "BufferFormatFromTypeInfo":1484
29776  *     else:
29777  *         fmt = __Pyx_TypeInfoToFormat(type)
29778  *         if type.arraysize[0]:             # <<<<<<<<<<<<<<
29779  *             extents = [unicode(type.arraysize[i]) for i in range(type.ndim)]
29780  *             result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string
29781  */
29782     __pyx_t_1 = ((__pyx_v_type->arraysize[0]) != 0);
29783     if (__pyx_t_1) {
29784 
29785       /* "BufferFormatFromTypeInfo":1485
29786  *         fmt = __Pyx_TypeInfoToFormat(type)
29787  *         if type.arraysize[0]:
29788  *             extents = [unicode(type.arraysize[i]) for i in range(type.ndim)]             # <<<<<<<<<<<<<<
29789  *             result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string
29790  *         else:
29791  */
29792       __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1485, __pyx_L1_error)
29793       __Pyx_GOTREF(__pyx_t_6);
29794       __pyx_t_8 = __pyx_v_type->ndim;
29795       __pyx_t_9 = __pyx_t_8;
29796       for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
29797         __pyx_v_i = __pyx_t_10;
29798         __pyx_t_5 = __Pyx_PyInt_FromSize_t((__pyx_v_type->arraysize[__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1485, __pyx_L1_error)
29799         __Pyx_GOTREF(__pyx_t_5);
29800         __pyx_t_3 = __Pyx_PyObject_Unicode(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1485, __pyx_L1_error)
29801         __Pyx_GOTREF(__pyx_t_3);
29802         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
29803         if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_3))) __PYX_ERR(1, 1485, __pyx_L1_error)
29804         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
29805       }
29806       __pyx_v_extents = ((PyObject*)__pyx_t_6);
29807       __pyx_t_6 = 0;
29808 
29809       /* "BufferFormatFromTypeInfo":1486
29810  *         if type.arraysize[0]:
29811  *             extents = [unicode(type.arraysize[i]) for i in range(type.ndim)]
29812  *             result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string             # <<<<<<<<<<<<<<
29813  *         else:
29814  *             result = fmt.string
29815  */
29816       __pyx_t_6 = PyUnicode_Join(__pyx_kp_u__54, __pyx_v_extents); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1486, __pyx_L1_error)
29817       __Pyx_GOTREF(__pyx_t_6);
29818       __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_s, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1486, __pyx_L1_error)
29819       __Pyx_GOTREF(__pyx_t_3);
29820       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
29821       __pyx_t_6 = PyUnicode_AsASCIIString(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1486, __pyx_L1_error)
29822       __Pyx_GOTREF(__pyx_t_6);
29823       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
29824       __pyx_t_3 = __Pyx_PyObject_FromString(__pyx_v_fmt.string); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1486, __pyx_L1_error)
29825       __Pyx_GOTREF(__pyx_t_3);
29826       __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1486, __pyx_L1_error)
29827       __Pyx_GOTREF(__pyx_t_5);
29828       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
29829       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
29830       if (!(likely(PyBytes_CheckExact(__pyx_t_5))||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(1, 1486, __pyx_L1_error)
29831       __pyx_v_result = ((PyObject*)__pyx_t_5);
29832       __pyx_t_5 = 0;
29833 
29834       /* "BufferFormatFromTypeInfo":1484
29835  *     else:
29836  *         fmt = __Pyx_TypeInfoToFormat(type)
29837  *         if type.arraysize[0]:             # <<<<<<<<<<<<<<
29838  *             extents = [unicode(type.arraysize[i]) for i in range(type.ndim)]
29839  *             result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string
29840  */
29841       goto __pyx_L9;
29842     }
29843 
29844     /* "BufferFormatFromTypeInfo":1488
29845  *             result = (u"(%s)" % u','.join(extents)).encode('ascii') + fmt.string
29846  *         else:
29847  *             result = fmt.string             # <<<<<<<<<<<<<<
29848  *
29849  *     return result
29850  */
29851     /*else*/ {
29852       __pyx_t_5 = __Pyx_PyObject_FromString(__pyx_v_fmt.string); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1488, __pyx_L1_error)
29853       __Pyx_GOTREF(__pyx_t_5);
29854       __pyx_v_result = ((PyObject*)__pyx_t_5);
29855       __pyx_t_5 = 0;
29856     }
29857     __pyx_L9:;
29858   }
29859   __pyx_L3:;
29860 
29861   /* "BufferFormatFromTypeInfo":1490
29862  *             result = fmt.string
29863  *
29864  *     return result             # <<<<<<<<<<<<<<
29865  */
29866   __Pyx_XDECREF(__pyx_r);
29867   __Pyx_INCREF(__pyx_v_result);
29868   __pyx_r = __pyx_v_result;
29869   goto __pyx_L0;
29870 
29871   /* "BufferFormatFromTypeInfo":1460
29872  *
29873  * @cname('__pyx_format_from_typeinfo')
29874  * cdef bytes format_from_typeinfo(__Pyx_TypeInfo *type):             # <<<<<<<<<<<<<<
29875  *     cdef __Pyx_StructField *field
29876  *     cdef __pyx_typeinfo_string fmt
29877  */
29878 
29879   /* function exit code */
29880   __pyx_L1_error:;
29881   __Pyx_XDECREF(__pyx_t_3);
29882   __Pyx_XDECREF(__pyx_t_5);
29883   __Pyx_XDECREF(__pyx_t_6);
29884   __Pyx_AddTraceback("BufferFormatFromTypeInfo.format_from_typeinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
29885   __pyx_r = 0;
29886   __pyx_L0:;
29887   __Pyx_XDECREF(__pyx_v_part);
29888   __Pyx_XDECREF(__pyx_v_result);
29889   __Pyx_XDECREF(__pyx_v_alignment);
29890   __Pyx_XDECREF(__pyx_v_parts);
29891   __Pyx_XDECREF(__pyx_v_extents);
29892   __Pyx_XGIVEREF(__pyx_r);
29893   __Pyx_RefNannyFinishContext();
29894   return __pyx_r;
29895 }
29896 static struct __pyx_vtabstruct_2yt_8geometry_14grid_container_GridTree __pyx_vtable_2yt_8geometry_14grid_container_GridTree;
29897 
__pyx_tp_new_2yt_8geometry_14grid_container_GridTree(PyTypeObject * t,PyObject * a,PyObject * k)29898 static PyObject *__pyx_tp_new_2yt_8geometry_14grid_container_GridTree(PyTypeObject *t, PyObject *a, PyObject *k) {
29899   struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *p;
29900   PyObject *o;
29901   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
29902     o = (*t->tp_alloc)(t, 0);
29903   } else {
29904     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
29905   }
29906   if (unlikely(!o)) return 0;
29907   p = ((struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *)o);
29908   p->__pyx_vtab = __pyx_vtabptr_2yt_8geometry_14grid_container_GridTree;
29909   p->mask = ((struct __pyx_obj_2yt_9utilities_3lib_8bitarray_bitarray *)Py_None); Py_INCREF(Py_None);
29910   if (unlikely(__pyx_pw_2yt_8geometry_14grid_container_8GridTree_1__cinit__(o, a, k) < 0)) goto bad;
29911   return o;
29912   bad:
29913   Py_DECREF(o); o = 0;
29914   return NULL;
29915 }
29916 
__pyx_tp_dealloc_2yt_8geometry_14grid_container_GridTree(PyObject * o)29917 static void __pyx_tp_dealloc_2yt_8geometry_14grid_container_GridTree(PyObject *o) {
29918   struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *p = (struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *)o;
29919   #if CYTHON_USE_TP_FINALIZE
29920   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
29921     if (PyObject_CallFinalizerFromDealloc(o)) return;
29922   }
29923   #endif
29924   PyObject_GC_UnTrack(o);
29925   Py_CLEAR(p->mask);
29926   (*Py_TYPE(o)->tp_free)(o);
29927 }
29928 
__pyx_tp_traverse_2yt_8geometry_14grid_container_GridTree(PyObject * o,visitproc v,void * a)29929 static int __pyx_tp_traverse_2yt_8geometry_14grid_container_GridTree(PyObject *o, visitproc v, void *a) {
29930   int e;
29931   struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *p = (struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *)o;
29932   if (p->mask) {
29933     e = (*v)(((PyObject *)p->mask), a); if (e) return e;
29934   }
29935   return 0;
29936 }
29937 
__pyx_tp_clear_2yt_8geometry_14grid_container_GridTree(PyObject * o)29938 static int __pyx_tp_clear_2yt_8geometry_14grid_container_GridTree(PyObject *o) {
29939   PyObject* tmp;
29940   struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *p = (struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *)o;
29941   tmp = ((PyObject*)p->mask);
29942   p->mask = ((struct __pyx_obj_2yt_9utilities_3lib_8bitarray_bitarray *)Py_None); Py_INCREF(Py_None);
29943   Py_XDECREF(tmp);
29944   return 0;
29945 }
29946 
__pyx_getprop_2yt_8geometry_14grid_container_8GridTree_grid_arrays(PyObject * o,CYTHON_UNUSED void * x)29947 static PyObject *__pyx_getprop_2yt_8geometry_14grid_container_8GridTree_grid_arrays(PyObject *o, CYTHON_UNUSED void *x) {
29948   return __pyx_pw_2yt_8geometry_14grid_container_8GridTree_11grid_arrays_1__get__(o);
29949 }
29950 
__pyx_getprop_2yt_8geometry_14grid_container_8GridTree_mask(PyObject * o,CYTHON_UNUSED void * x)29951 static PyObject *__pyx_getprop_2yt_8geometry_14grid_container_8GridTree_mask(PyObject *o, CYTHON_UNUSED void *x) {
29952   return __pyx_pw_2yt_8geometry_14grid_container_8GridTree_4mask_1__get__(o);
29953 }
29954 
__pyx_setprop_2yt_8geometry_14grid_container_8GridTree_mask(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)29955 static int __pyx_setprop_2yt_8geometry_14grid_container_8GridTree_mask(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
29956   if (v) {
29957     return __pyx_pw_2yt_8geometry_14grid_container_8GridTree_4mask_3__set__(o, v);
29958   }
29959   else {
29960     return __pyx_pw_2yt_8geometry_14grid_container_8GridTree_4mask_5__del__(o);
29961   }
29962 }
29963 
29964 static PyMethodDef __pyx_methods_2yt_8geometry_14grid_container_GridTree[] = {
29965   {"return_tree_info", (PyCFunction)__pyx_pw_2yt_8geometry_14grid_container_8GridTree_8return_tree_info, METH_NOARGS, 0},
29966   {"count", (PyCFunction)__pyx_pw_2yt_8geometry_14grid_container_8GridTree_10count, METH_O, 0},
29967   {"select_icoords", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2yt_8geometry_14grid_container_8GridTree_12select_icoords, METH_VARARGS|METH_KEYWORDS, 0},
29968   {"select_ires", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2yt_8geometry_14grid_container_8GridTree_14select_ires, METH_VARARGS|METH_KEYWORDS, 0},
29969   {"select_fcoords", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2yt_8geometry_14grid_container_8GridTree_16select_fcoords, METH_VARARGS|METH_KEYWORDS, 0},
29970   {"select_fwidth", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_2yt_8geometry_14grid_container_8GridTree_18select_fwidth, METH_VARARGS|METH_KEYWORDS, 0},
29971   {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_14grid_container_8GridTree_20__reduce_cython__, METH_NOARGS, 0},
29972   {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_14grid_container_8GridTree_22__setstate_cython__, METH_O, 0},
29973   {0, 0, 0, 0}
29974 };
29975 
29976 static struct PyGetSetDef __pyx_getsets_2yt_8geometry_14grid_container_GridTree[] = {
29977   {(char *)"grid_arrays", __pyx_getprop_2yt_8geometry_14grid_container_8GridTree_grid_arrays, 0, (char *)0, 0},
29978   {(char *)"mask", __pyx_getprop_2yt_8geometry_14grid_container_8GridTree_mask, __pyx_setprop_2yt_8geometry_14grid_container_8GridTree_mask, (char *)0, 0},
29979   {0, 0, 0, 0, 0}
29980 };
29981 
29982 static PyTypeObject __pyx_type_2yt_8geometry_14grid_container_GridTree = {
29983   PyVarObject_HEAD_INIT(0, 0)
29984   "yt.geometry.grid_container.GridTree", /*tp_name*/
29985   sizeof(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree), /*tp_basicsize*/
29986   0, /*tp_itemsize*/
29987   __pyx_tp_dealloc_2yt_8geometry_14grid_container_GridTree, /*tp_dealloc*/
29988   0, /*tp_print*/
29989   0, /*tp_getattr*/
29990   0, /*tp_setattr*/
29991   #if PY_MAJOR_VERSION < 3
29992   0, /*tp_compare*/
29993   #endif
29994   #if PY_MAJOR_VERSION >= 3
29995   0, /*tp_as_async*/
29996   #endif
29997   0, /*tp_repr*/
29998   0, /*tp_as_number*/
29999   0, /*tp_as_sequence*/
30000   0, /*tp_as_mapping*/
30001   0, /*tp_hash*/
30002   0, /*tp_call*/
30003   0, /*tp_str*/
30004   0, /*tp_getattro*/
30005   0, /*tp_setattro*/
30006   0, /*tp_as_buffer*/
30007   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
30008   0, /*tp_doc*/
30009   __pyx_tp_traverse_2yt_8geometry_14grid_container_GridTree, /*tp_traverse*/
30010   __pyx_tp_clear_2yt_8geometry_14grid_container_GridTree, /*tp_clear*/
30011   0, /*tp_richcompare*/
30012   0, /*tp_weaklistoffset*/
30013   __pyx_pw_2yt_8geometry_14grid_container_8GridTree_5__iter__, /*tp_iter*/
30014   0, /*tp_iternext*/
30015   __pyx_methods_2yt_8geometry_14grid_container_GridTree, /*tp_methods*/
30016   0, /*tp_members*/
30017   __pyx_getsets_2yt_8geometry_14grid_container_GridTree, /*tp_getset*/
30018   0, /*tp_base*/
30019   0, /*tp_dict*/
30020   0, /*tp_descr_get*/
30021   0, /*tp_descr_set*/
30022   0, /*tp_dictoffset*/
30023   __pyx_pw_2yt_8geometry_14grid_container_8GridTree_3__init__, /*tp_init*/
30024   0, /*tp_alloc*/
30025   __pyx_tp_new_2yt_8geometry_14grid_container_GridTree, /*tp_new*/
30026   0, /*tp_free*/
30027   0, /*tp_is_gc*/
30028   0, /*tp_bases*/
30029   0, /*tp_mro*/
30030   0, /*tp_cache*/
30031   0, /*tp_subclasses*/
30032   0, /*tp_weaklist*/
30033   0, /*tp_del*/
30034   0, /*tp_version_tag*/
30035   #if PY_VERSION_HEX >= 0x030400a1
30036   0, /*tp_finalize*/
30037   #endif
30038   #if PY_VERSION_HEX >= 0x030800b1
30039   0, /*tp_vectorcall*/
30040   #endif
30041 };
30042 static struct __pyx_vtabstruct_2yt_8geometry_14grid_container_MatchPointsToGrids __pyx_vtable_2yt_8geometry_14grid_container_MatchPointsToGrids;
30043 
__pyx_tp_new_2yt_8geometry_14grid_container_MatchPointsToGrids(PyTypeObject * t,PyObject * a,PyObject * k)30044 static PyObject *__pyx_tp_new_2yt_8geometry_14grid_container_MatchPointsToGrids(PyTypeObject *t, PyObject *a, PyObject *k) {
30045   struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *p;
30046   PyObject *o;
30047   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
30048     o = (*t->tp_alloc)(t, 0);
30049   } else {
30050     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
30051   }
30052   if (unlikely(!o)) return 0;
30053   p = ((struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *)o);
30054   p->__pyx_vtab = __pyx_vtabptr_2yt_8geometry_14grid_container_MatchPointsToGrids;
30055   p->tree = ((struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *)Py_None); Py_INCREF(Py_None);
30056   if (unlikely(__pyx_pw_2yt_8geometry_14grid_container_18MatchPointsToGrids_1__cinit__(o, a, k) < 0)) goto bad;
30057   return o;
30058   bad:
30059   Py_DECREF(o); o = 0;
30060   return NULL;
30061 }
30062 
__pyx_tp_dealloc_2yt_8geometry_14grid_container_MatchPointsToGrids(PyObject * o)30063 static void __pyx_tp_dealloc_2yt_8geometry_14grid_container_MatchPointsToGrids(PyObject *o) {
30064   struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *p = (struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *)o;
30065   #if CYTHON_USE_TP_FINALIZE
30066   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
30067     if (PyObject_CallFinalizerFromDealloc(o)) return;
30068   }
30069   #endif
30070   PyObject_GC_UnTrack(o);
30071   Py_CLEAR(p->tree);
30072   (*Py_TYPE(o)->tp_free)(o);
30073 }
30074 
__pyx_tp_traverse_2yt_8geometry_14grid_container_MatchPointsToGrids(PyObject * o,visitproc v,void * a)30075 static int __pyx_tp_traverse_2yt_8geometry_14grid_container_MatchPointsToGrids(PyObject *o, visitproc v, void *a) {
30076   int e;
30077   struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *p = (struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *)o;
30078   if (p->tree) {
30079     e = (*v)(((PyObject *)p->tree), a); if (e) return e;
30080   }
30081   return 0;
30082 }
30083 
__pyx_tp_clear_2yt_8geometry_14grid_container_MatchPointsToGrids(PyObject * o)30084 static int __pyx_tp_clear_2yt_8geometry_14grid_container_MatchPointsToGrids(PyObject *o) {
30085   PyObject* tmp;
30086   struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *p = (struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *)o;
30087   tmp = ((PyObject*)p->tree);
30088   p->tree = ((struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *)Py_None); Py_INCREF(Py_None);
30089   Py_XDECREF(tmp);
30090   return 0;
30091 }
30092 
30093 static PyMethodDef __pyx_methods_2yt_8geometry_14grid_container_MatchPointsToGrids[] = {
30094   {"find_points_in_tree", (PyCFunction)__pyx_pw_2yt_8geometry_14grid_container_18MatchPointsToGrids_3find_points_in_tree, METH_NOARGS, 0},
30095   {"__reduce_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_14grid_container_18MatchPointsToGrids_5__reduce_cython__, METH_NOARGS, 0},
30096   {"__setstate_cython__", (PyCFunction)__pyx_pw_2yt_8geometry_14grid_container_18MatchPointsToGrids_7__setstate_cython__, METH_O, 0},
30097   {0, 0, 0, 0}
30098 };
30099 
30100 static PyTypeObject __pyx_type_2yt_8geometry_14grid_container_MatchPointsToGrids = {
30101   PyVarObject_HEAD_INIT(0, 0)
30102   "yt.geometry.grid_container.MatchPointsToGrids", /*tp_name*/
30103   sizeof(struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids), /*tp_basicsize*/
30104   0, /*tp_itemsize*/
30105   __pyx_tp_dealloc_2yt_8geometry_14grid_container_MatchPointsToGrids, /*tp_dealloc*/
30106   0, /*tp_print*/
30107   0, /*tp_getattr*/
30108   0, /*tp_setattr*/
30109   #if PY_MAJOR_VERSION < 3
30110   0, /*tp_compare*/
30111   #endif
30112   #if PY_MAJOR_VERSION >= 3
30113   0, /*tp_as_async*/
30114   #endif
30115   0, /*tp_repr*/
30116   0, /*tp_as_number*/
30117   0, /*tp_as_sequence*/
30118   0, /*tp_as_mapping*/
30119   0, /*tp_hash*/
30120   0, /*tp_call*/
30121   0, /*tp_str*/
30122   0, /*tp_getattro*/
30123   0, /*tp_setattro*/
30124   0, /*tp_as_buffer*/
30125   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
30126   0, /*tp_doc*/
30127   __pyx_tp_traverse_2yt_8geometry_14grid_container_MatchPointsToGrids, /*tp_traverse*/
30128   __pyx_tp_clear_2yt_8geometry_14grid_container_MatchPointsToGrids, /*tp_clear*/
30129   0, /*tp_richcompare*/
30130   0, /*tp_weaklistoffset*/
30131   0, /*tp_iter*/
30132   0, /*tp_iternext*/
30133   __pyx_methods_2yt_8geometry_14grid_container_MatchPointsToGrids, /*tp_methods*/
30134   0, /*tp_members*/
30135   0, /*tp_getset*/
30136   0, /*tp_base*/
30137   0, /*tp_dict*/
30138   0, /*tp_descr_get*/
30139   0, /*tp_descr_set*/
30140   0, /*tp_dictoffset*/
30141   0, /*tp_init*/
30142   0, /*tp_alloc*/
30143   __pyx_tp_new_2yt_8geometry_14grid_container_MatchPointsToGrids, /*tp_new*/
30144   0, /*tp_free*/
30145   0, /*tp_is_gc*/
30146   0, /*tp_bases*/
30147   0, /*tp_mro*/
30148   0, /*tp_cache*/
30149   0, /*tp_subclasses*/
30150   0, /*tp_weaklist*/
30151   0, /*tp_del*/
30152   0, /*tp_version_tag*/
30153   #if PY_VERSION_HEX >= 0x030400a1
30154   0, /*tp_finalize*/
30155   #endif
30156   #if PY_VERSION_HEX >= 0x030800b1
30157   0, /*tp_vectorcall*/
30158   #endif
30159 };
30160 
30161 static struct __pyx_obj_2yt_8geometry_14grid_container___pyx_scope_struct____iter__ *__pyx_freelist_2yt_8geometry_14grid_container___pyx_scope_struct____iter__[8];
30162 static int __pyx_freecount_2yt_8geometry_14grid_container___pyx_scope_struct____iter__ = 0;
30163 
__pyx_tp_new_2yt_8geometry_14grid_container___pyx_scope_struct____iter__(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)30164 static PyObject *__pyx_tp_new_2yt_8geometry_14grid_container___pyx_scope_struct____iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
30165   PyObject *o;
30166   if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_2yt_8geometry_14grid_container___pyx_scope_struct____iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_2yt_8geometry_14grid_container___pyx_scope_struct____iter__)))) {
30167     o = (PyObject*)__pyx_freelist_2yt_8geometry_14grid_container___pyx_scope_struct____iter__[--__pyx_freecount_2yt_8geometry_14grid_container___pyx_scope_struct____iter__];
30168     memset(o, 0, sizeof(struct __pyx_obj_2yt_8geometry_14grid_container___pyx_scope_struct____iter__));
30169     (void) PyObject_INIT(o, t);
30170     PyObject_GC_Track(o);
30171   } else {
30172     o = (*t->tp_alloc)(t, 0);
30173     if (unlikely(!o)) return 0;
30174   }
30175   return o;
30176 }
30177 
__pyx_tp_dealloc_2yt_8geometry_14grid_container___pyx_scope_struct____iter__(PyObject * o)30178 static void __pyx_tp_dealloc_2yt_8geometry_14grid_container___pyx_scope_struct____iter__(PyObject *o) {
30179   struct __pyx_obj_2yt_8geometry_14grid_container___pyx_scope_struct____iter__ *p = (struct __pyx_obj_2yt_8geometry_14grid_container___pyx_scope_struct____iter__ *)o;
30180   PyObject_GC_UnTrack(o);
30181   Py_CLEAR(p->__pyx_v_self);
30182   if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_2yt_8geometry_14grid_container___pyx_scope_struct____iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_2yt_8geometry_14grid_container___pyx_scope_struct____iter__)))) {
30183     __pyx_freelist_2yt_8geometry_14grid_container___pyx_scope_struct____iter__[__pyx_freecount_2yt_8geometry_14grid_container___pyx_scope_struct____iter__++] = ((struct __pyx_obj_2yt_8geometry_14grid_container___pyx_scope_struct____iter__ *)o);
30184   } else {
30185     (*Py_TYPE(o)->tp_free)(o);
30186   }
30187 }
30188 
__pyx_tp_traverse_2yt_8geometry_14grid_container___pyx_scope_struct____iter__(PyObject * o,visitproc v,void * a)30189 static int __pyx_tp_traverse_2yt_8geometry_14grid_container___pyx_scope_struct____iter__(PyObject *o, visitproc v, void *a) {
30190   int e;
30191   struct __pyx_obj_2yt_8geometry_14grid_container___pyx_scope_struct____iter__ *p = (struct __pyx_obj_2yt_8geometry_14grid_container___pyx_scope_struct____iter__ *)o;
30192   if (p->__pyx_v_self) {
30193     e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
30194   }
30195   return 0;
30196 }
30197 
30198 static PyTypeObject __pyx_type_2yt_8geometry_14grid_container___pyx_scope_struct____iter__ = {
30199   PyVarObject_HEAD_INIT(0, 0)
30200   "yt.geometry.grid_container.__pyx_scope_struct____iter__", /*tp_name*/
30201   sizeof(struct __pyx_obj_2yt_8geometry_14grid_container___pyx_scope_struct____iter__), /*tp_basicsize*/
30202   0, /*tp_itemsize*/
30203   __pyx_tp_dealloc_2yt_8geometry_14grid_container___pyx_scope_struct____iter__, /*tp_dealloc*/
30204   0, /*tp_print*/
30205   0, /*tp_getattr*/
30206   0, /*tp_setattr*/
30207   #if PY_MAJOR_VERSION < 3
30208   0, /*tp_compare*/
30209   #endif
30210   #if PY_MAJOR_VERSION >= 3
30211   0, /*tp_as_async*/
30212   #endif
30213   0, /*tp_repr*/
30214   0, /*tp_as_number*/
30215   0, /*tp_as_sequence*/
30216   0, /*tp_as_mapping*/
30217   0, /*tp_hash*/
30218   0, /*tp_call*/
30219   0, /*tp_str*/
30220   0, /*tp_getattro*/
30221   0, /*tp_setattro*/
30222   0, /*tp_as_buffer*/
30223   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
30224   0, /*tp_doc*/
30225   __pyx_tp_traverse_2yt_8geometry_14grid_container___pyx_scope_struct____iter__, /*tp_traverse*/
30226   0, /*tp_clear*/
30227   0, /*tp_richcompare*/
30228   0, /*tp_weaklistoffset*/
30229   0, /*tp_iter*/
30230   0, /*tp_iternext*/
30231   0, /*tp_methods*/
30232   0, /*tp_members*/
30233   0, /*tp_getset*/
30234   0, /*tp_base*/
30235   0, /*tp_dict*/
30236   0, /*tp_descr_get*/
30237   0, /*tp_descr_set*/
30238   0, /*tp_dictoffset*/
30239   0, /*tp_init*/
30240   0, /*tp_alloc*/
30241   __pyx_tp_new_2yt_8geometry_14grid_container___pyx_scope_struct____iter__, /*tp_new*/
30242   0, /*tp_free*/
30243   0, /*tp_is_gc*/
30244   0, /*tp_bases*/
30245   0, /*tp_mro*/
30246   0, /*tp_cache*/
30247   0, /*tp_subclasses*/
30248   0, /*tp_weaklist*/
30249   0, /*tp_del*/
30250   0, /*tp_version_tag*/
30251   #if PY_VERSION_HEX >= 0x030400a1
30252   0, /*tp_finalize*/
30253   #endif
30254   #if PY_VERSION_HEX >= 0x030800b1
30255   0, /*tp_vectorcall*/
30256   #endif
30257 };
30258 static struct __pyx_vtabstruct_array __pyx_vtable_array;
30259 
__pyx_tp_new_array(PyTypeObject * t,PyObject * a,PyObject * k)30260 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
30261   struct __pyx_array_obj *p;
30262   PyObject *o;
30263   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
30264     o = (*t->tp_alloc)(t, 0);
30265   } else {
30266     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
30267   }
30268   if (unlikely(!o)) return 0;
30269   p = ((struct __pyx_array_obj *)o);
30270   p->__pyx_vtab = __pyx_vtabptr_array;
30271   p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
30272   p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
30273   if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
30274   return o;
30275   bad:
30276   Py_DECREF(o); o = 0;
30277   return NULL;
30278 }
30279 
__pyx_tp_dealloc_array(PyObject * o)30280 static void __pyx_tp_dealloc_array(PyObject *o) {
30281   struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
30282   #if CYTHON_USE_TP_FINALIZE
30283   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))) {
30284     if (PyObject_CallFinalizerFromDealloc(o)) return;
30285   }
30286   #endif
30287   {
30288     PyObject *etype, *eval, *etb;
30289     PyErr_Fetch(&etype, &eval, &etb);
30290     ++Py_REFCNT(o);
30291     __pyx_array___dealloc__(o);
30292     --Py_REFCNT(o);
30293     PyErr_Restore(etype, eval, etb);
30294   }
30295   Py_CLEAR(p->mode);
30296   Py_CLEAR(p->_format);
30297   (*Py_TYPE(o)->tp_free)(o);
30298 }
__pyx_sq_item_array(PyObject * o,Py_ssize_t i)30299 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
30300   PyObject *r;
30301   PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
30302   r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
30303   Py_DECREF(x);
30304   return r;
30305 }
30306 
__pyx_mp_ass_subscript_array(PyObject * o,PyObject * i,PyObject * v)30307 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
30308   if (v) {
30309     return __pyx_array___setitem__(o, i, v);
30310   }
30311   else {
30312     PyErr_Format(PyExc_NotImplementedError,
30313       "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
30314     return -1;
30315   }
30316 }
30317 
__pyx_tp_getattro_array(PyObject * o,PyObject * n)30318 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
30319   PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
30320   if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
30321     PyErr_Clear();
30322     v = __pyx_array___getattr__(o, n);
30323   }
30324   return v;
30325 }
30326 
__pyx_getprop___pyx_array_memview(PyObject * o,CYTHON_UNUSED void * x)30327 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
30328   return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
30329 }
30330 
30331 static PyMethodDef __pyx_methods_array[] = {
30332   {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
30333   {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
30334   {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
30335   {0, 0, 0, 0}
30336 };
30337 
30338 static struct PyGetSetDef __pyx_getsets_array[] = {
30339   {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
30340   {0, 0, 0, 0, 0}
30341 };
30342 
30343 static PySequenceMethods __pyx_tp_as_sequence_array = {
30344   __pyx_array___len__, /*sq_length*/
30345   0, /*sq_concat*/
30346   0, /*sq_repeat*/
30347   __pyx_sq_item_array, /*sq_item*/
30348   0, /*sq_slice*/
30349   0, /*sq_ass_item*/
30350   0, /*sq_ass_slice*/
30351   0, /*sq_contains*/
30352   0, /*sq_inplace_concat*/
30353   0, /*sq_inplace_repeat*/
30354 };
30355 
30356 static PyMappingMethods __pyx_tp_as_mapping_array = {
30357   __pyx_array___len__, /*mp_length*/
30358   __pyx_array___getitem__, /*mp_subscript*/
30359   __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
30360 };
30361 
30362 static PyBufferProcs __pyx_tp_as_buffer_array = {
30363   #if PY_MAJOR_VERSION < 3
30364   0, /*bf_getreadbuffer*/
30365   #endif
30366   #if PY_MAJOR_VERSION < 3
30367   0, /*bf_getwritebuffer*/
30368   #endif
30369   #if PY_MAJOR_VERSION < 3
30370   0, /*bf_getsegcount*/
30371   #endif
30372   #if PY_MAJOR_VERSION < 3
30373   0, /*bf_getcharbuffer*/
30374   #endif
30375   __pyx_array_getbuffer, /*bf_getbuffer*/
30376   0, /*bf_releasebuffer*/
30377 };
30378 
30379 static PyTypeObject __pyx_type___pyx_array = {
30380   PyVarObject_HEAD_INIT(0, 0)
30381   "yt.geometry.grid_container.array", /*tp_name*/
30382   sizeof(struct __pyx_array_obj), /*tp_basicsize*/
30383   0, /*tp_itemsize*/
30384   __pyx_tp_dealloc_array, /*tp_dealloc*/
30385   0, /*tp_print*/
30386   0, /*tp_getattr*/
30387   0, /*tp_setattr*/
30388   #if PY_MAJOR_VERSION < 3
30389   0, /*tp_compare*/
30390   #endif
30391   #if PY_MAJOR_VERSION >= 3
30392   0, /*tp_as_async*/
30393   #endif
30394   0, /*tp_repr*/
30395   0, /*tp_as_number*/
30396   &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
30397   &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
30398   0, /*tp_hash*/
30399   0, /*tp_call*/
30400   0, /*tp_str*/
30401   __pyx_tp_getattro_array, /*tp_getattro*/
30402   0, /*tp_setattro*/
30403   &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
30404   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
30405   0, /*tp_doc*/
30406   0, /*tp_traverse*/
30407   0, /*tp_clear*/
30408   0, /*tp_richcompare*/
30409   0, /*tp_weaklistoffset*/
30410   0, /*tp_iter*/
30411   0, /*tp_iternext*/
30412   __pyx_methods_array, /*tp_methods*/
30413   0, /*tp_members*/
30414   __pyx_getsets_array, /*tp_getset*/
30415   0, /*tp_base*/
30416   0, /*tp_dict*/
30417   0, /*tp_descr_get*/
30418   0, /*tp_descr_set*/
30419   0, /*tp_dictoffset*/
30420   0, /*tp_init*/
30421   0, /*tp_alloc*/
30422   __pyx_tp_new_array, /*tp_new*/
30423   0, /*tp_free*/
30424   0, /*tp_is_gc*/
30425   0, /*tp_bases*/
30426   0, /*tp_mro*/
30427   0, /*tp_cache*/
30428   0, /*tp_subclasses*/
30429   0, /*tp_weaklist*/
30430   0, /*tp_del*/
30431   0, /*tp_version_tag*/
30432   #if PY_VERSION_HEX >= 0x030400a1
30433   0, /*tp_finalize*/
30434   #endif
30435   #if PY_VERSION_HEX >= 0x030800b1
30436   0, /*tp_vectorcall*/
30437   #endif
30438 };
30439 
__pyx_tp_new_Enum(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)30440 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
30441   struct __pyx_MemviewEnum_obj *p;
30442   PyObject *o;
30443   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
30444     o = (*t->tp_alloc)(t, 0);
30445   } else {
30446     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
30447   }
30448   if (unlikely(!o)) return 0;
30449   p = ((struct __pyx_MemviewEnum_obj *)o);
30450   p->name = Py_None; Py_INCREF(Py_None);
30451   return o;
30452 }
30453 
__pyx_tp_dealloc_Enum(PyObject * o)30454 static void __pyx_tp_dealloc_Enum(PyObject *o) {
30455   struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
30456   #if CYTHON_USE_TP_FINALIZE
30457   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
30458     if (PyObject_CallFinalizerFromDealloc(o)) return;
30459   }
30460   #endif
30461   PyObject_GC_UnTrack(o);
30462   Py_CLEAR(p->name);
30463   (*Py_TYPE(o)->tp_free)(o);
30464 }
30465 
__pyx_tp_traverse_Enum(PyObject * o,visitproc v,void * a)30466 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
30467   int e;
30468   struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
30469   if (p->name) {
30470     e = (*v)(p->name, a); if (e) return e;
30471   }
30472   return 0;
30473 }
30474 
__pyx_tp_clear_Enum(PyObject * o)30475 static int __pyx_tp_clear_Enum(PyObject *o) {
30476   PyObject* tmp;
30477   struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
30478   tmp = ((PyObject*)p->name);
30479   p->name = Py_None; Py_INCREF(Py_None);
30480   Py_XDECREF(tmp);
30481   return 0;
30482 }
30483 
30484 static PyMethodDef __pyx_methods_Enum[] = {
30485   {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
30486   {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
30487   {0, 0, 0, 0}
30488 };
30489 
30490 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
30491   PyVarObject_HEAD_INIT(0, 0)
30492   "yt.geometry.grid_container.Enum", /*tp_name*/
30493   sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
30494   0, /*tp_itemsize*/
30495   __pyx_tp_dealloc_Enum, /*tp_dealloc*/
30496   0, /*tp_print*/
30497   0, /*tp_getattr*/
30498   0, /*tp_setattr*/
30499   #if PY_MAJOR_VERSION < 3
30500   0, /*tp_compare*/
30501   #endif
30502   #if PY_MAJOR_VERSION >= 3
30503   0, /*tp_as_async*/
30504   #endif
30505   __pyx_MemviewEnum___repr__, /*tp_repr*/
30506   0, /*tp_as_number*/
30507   0, /*tp_as_sequence*/
30508   0, /*tp_as_mapping*/
30509   0, /*tp_hash*/
30510   0, /*tp_call*/
30511   0, /*tp_str*/
30512   0, /*tp_getattro*/
30513   0, /*tp_setattro*/
30514   0, /*tp_as_buffer*/
30515   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
30516   0, /*tp_doc*/
30517   __pyx_tp_traverse_Enum, /*tp_traverse*/
30518   __pyx_tp_clear_Enum, /*tp_clear*/
30519   0, /*tp_richcompare*/
30520   0, /*tp_weaklistoffset*/
30521   0, /*tp_iter*/
30522   0, /*tp_iternext*/
30523   __pyx_methods_Enum, /*tp_methods*/
30524   0, /*tp_members*/
30525   0, /*tp_getset*/
30526   0, /*tp_base*/
30527   0, /*tp_dict*/
30528   0, /*tp_descr_get*/
30529   0, /*tp_descr_set*/
30530   0, /*tp_dictoffset*/
30531   __pyx_MemviewEnum___init__, /*tp_init*/
30532   0, /*tp_alloc*/
30533   __pyx_tp_new_Enum, /*tp_new*/
30534   0, /*tp_free*/
30535   0, /*tp_is_gc*/
30536   0, /*tp_bases*/
30537   0, /*tp_mro*/
30538   0, /*tp_cache*/
30539   0, /*tp_subclasses*/
30540   0, /*tp_weaklist*/
30541   0, /*tp_del*/
30542   0, /*tp_version_tag*/
30543   #if PY_VERSION_HEX >= 0x030400a1
30544   0, /*tp_finalize*/
30545   #endif
30546   #if PY_VERSION_HEX >= 0x030800b1
30547   0, /*tp_vectorcall*/
30548   #endif
30549 };
30550 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
30551 
__pyx_tp_new_memoryview(PyTypeObject * t,PyObject * a,PyObject * k)30552 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
30553   struct __pyx_memoryview_obj *p;
30554   PyObject *o;
30555   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
30556     o = (*t->tp_alloc)(t, 0);
30557   } else {
30558     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
30559   }
30560   if (unlikely(!o)) return 0;
30561   p = ((struct __pyx_memoryview_obj *)o);
30562   p->__pyx_vtab = __pyx_vtabptr_memoryview;
30563   p->obj = Py_None; Py_INCREF(Py_None);
30564   p->_size = Py_None; Py_INCREF(Py_None);
30565   p->_array_interface = Py_None; Py_INCREF(Py_None);
30566   p->view.obj = NULL;
30567   if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
30568   return o;
30569   bad:
30570   Py_DECREF(o); o = 0;
30571   return NULL;
30572 }
30573 
__pyx_tp_dealloc_memoryview(PyObject * o)30574 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
30575   struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
30576   #if CYTHON_USE_TP_FINALIZE
30577   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
30578     if (PyObject_CallFinalizerFromDealloc(o)) return;
30579   }
30580   #endif
30581   PyObject_GC_UnTrack(o);
30582   {
30583     PyObject *etype, *eval, *etb;
30584     PyErr_Fetch(&etype, &eval, &etb);
30585     ++Py_REFCNT(o);
30586     __pyx_memoryview___dealloc__(o);
30587     --Py_REFCNT(o);
30588     PyErr_Restore(etype, eval, etb);
30589   }
30590   Py_CLEAR(p->obj);
30591   Py_CLEAR(p->_size);
30592   Py_CLEAR(p->_array_interface);
30593   (*Py_TYPE(o)->tp_free)(o);
30594 }
30595 
__pyx_tp_traverse_memoryview(PyObject * o,visitproc v,void * a)30596 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
30597   int e;
30598   struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
30599   if (p->obj) {
30600     e = (*v)(p->obj, a); if (e) return e;
30601   }
30602   if (p->_size) {
30603     e = (*v)(p->_size, a); if (e) return e;
30604   }
30605   if (p->_array_interface) {
30606     e = (*v)(p->_array_interface, a); if (e) return e;
30607   }
30608   if (p->view.obj) {
30609     e = (*v)(p->view.obj, a); if (e) return e;
30610   }
30611   return 0;
30612 }
30613 
__pyx_tp_clear_memoryview(PyObject * o)30614 static int __pyx_tp_clear_memoryview(PyObject *o) {
30615   PyObject* tmp;
30616   struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
30617   tmp = ((PyObject*)p->obj);
30618   p->obj = Py_None; Py_INCREF(Py_None);
30619   Py_XDECREF(tmp);
30620   tmp = ((PyObject*)p->_size);
30621   p->_size = Py_None; Py_INCREF(Py_None);
30622   Py_XDECREF(tmp);
30623   tmp = ((PyObject*)p->_array_interface);
30624   p->_array_interface = Py_None; Py_INCREF(Py_None);
30625   Py_XDECREF(tmp);
30626   Py_CLEAR(p->view.obj);
30627   return 0;
30628 }
__pyx_sq_item_memoryview(PyObject * o,Py_ssize_t i)30629 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
30630   PyObject *r;
30631   PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
30632   r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
30633   Py_DECREF(x);
30634   return r;
30635 }
30636 
__pyx_mp_ass_subscript_memoryview(PyObject * o,PyObject * i,PyObject * v)30637 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
30638   if (v) {
30639     return __pyx_memoryview___setitem__(o, i, v);
30640   }
30641   else {
30642     PyErr_Format(PyExc_NotImplementedError,
30643       "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
30644     return -1;
30645   }
30646 }
30647 
__pyx_getprop___pyx_memoryview_T(PyObject * o,CYTHON_UNUSED void * x)30648 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
30649   return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
30650 }
30651 
__pyx_getprop___pyx_memoryview_base(PyObject * o,CYTHON_UNUSED void * x)30652 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
30653   return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
30654 }
30655 
__pyx_getprop___pyx_memoryview_shape(PyObject * o,CYTHON_UNUSED void * x)30656 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
30657   return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
30658 }
30659 
__pyx_getprop___pyx_memoryview_strides(PyObject * o,CYTHON_UNUSED void * x)30660 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
30661   return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
30662 }
30663 
__pyx_getprop___pyx_memoryview_suboffsets(PyObject * o,CYTHON_UNUSED void * x)30664 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
30665   return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
30666 }
30667 
__pyx_getprop___pyx_memoryview_ndim(PyObject * o,CYTHON_UNUSED void * x)30668 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
30669   return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
30670 }
30671 
__pyx_getprop___pyx_memoryview_itemsize(PyObject * o,CYTHON_UNUSED void * x)30672 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
30673   return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
30674 }
30675 
__pyx_getprop___pyx_memoryview_nbytes(PyObject * o,CYTHON_UNUSED void * x)30676 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
30677   return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
30678 }
30679 
__pyx_getprop___pyx_memoryview_size(PyObject * o,CYTHON_UNUSED void * x)30680 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
30681   return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
30682 }
30683 
30684 static PyMethodDef __pyx_methods_memoryview[] = {
30685   {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
30686   {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
30687   {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
30688   {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
30689   {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
30690   {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
30691   {0, 0, 0, 0}
30692 };
30693 
30694 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
30695   {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
30696   {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
30697   {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
30698   {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
30699   {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
30700   {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
30701   {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
30702   {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
30703   {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
30704   {0, 0, 0, 0, 0}
30705 };
30706 
30707 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
30708   __pyx_memoryview___len__, /*sq_length*/
30709   0, /*sq_concat*/
30710   0, /*sq_repeat*/
30711   __pyx_sq_item_memoryview, /*sq_item*/
30712   0, /*sq_slice*/
30713   0, /*sq_ass_item*/
30714   0, /*sq_ass_slice*/
30715   0, /*sq_contains*/
30716   0, /*sq_inplace_concat*/
30717   0, /*sq_inplace_repeat*/
30718 };
30719 
30720 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
30721   __pyx_memoryview___len__, /*mp_length*/
30722   __pyx_memoryview___getitem__, /*mp_subscript*/
30723   __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
30724 };
30725 
30726 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
30727   #if PY_MAJOR_VERSION < 3
30728   0, /*bf_getreadbuffer*/
30729   #endif
30730   #if PY_MAJOR_VERSION < 3
30731   0, /*bf_getwritebuffer*/
30732   #endif
30733   #if PY_MAJOR_VERSION < 3
30734   0, /*bf_getsegcount*/
30735   #endif
30736   #if PY_MAJOR_VERSION < 3
30737   0, /*bf_getcharbuffer*/
30738   #endif
30739   __pyx_memoryview_getbuffer, /*bf_getbuffer*/
30740   0, /*bf_releasebuffer*/
30741 };
30742 
30743 static PyTypeObject __pyx_type___pyx_memoryview = {
30744   PyVarObject_HEAD_INIT(0, 0)
30745   "yt.geometry.grid_container.memoryview", /*tp_name*/
30746   sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
30747   0, /*tp_itemsize*/
30748   __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
30749   0, /*tp_print*/
30750   0, /*tp_getattr*/
30751   0, /*tp_setattr*/
30752   #if PY_MAJOR_VERSION < 3
30753   0, /*tp_compare*/
30754   #endif
30755   #if PY_MAJOR_VERSION >= 3
30756   0, /*tp_as_async*/
30757   #endif
30758   __pyx_memoryview___repr__, /*tp_repr*/
30759   0, /*tp_as_number*/
30760   &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
30761   &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
30762   0, /*tp_hash*/
30763   0, /*tp_call*/
30764   __pyx_memoryview___str__, /*tp_str*/
30765   0, /*tp_getattro*/
30766   0, /*tp_setattro*/
30767   &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
30768   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
30769   0, /*tp_doc*/
30770   __pyx_tp_traverse_memoryview, /*tp_traverse*/
30771   __pyx_tp_clear_memoryview, /*tp_clear*/
30772   0, /*tp_richcompare*/
30773   0, /*tp_weaklistoffset*/
30774   0, /*tp_iter*/
30775   0, /*tp_iternext*/
30776   __pyx_methods_memoryview, /*tp_methods*/
30777   0, /*tp_members*/
30778   __pyx_getsets_memoryview, /*tp_getset*/
30779   0, /*tp_base*/
30780   0, /*tp_dict*/
30781   0, /*tp_descr_get*/
30782   0, /*tp_descr_set*/
30783   0, /*tp_dictoffset*/
30784   0, /*tp_init*/
30785   0, /*tp_alloc*/
30786   __pyx_tp_new_memoryview, /*tp_new*/
30787   0, /*tp_free*/
30788   0, /*tp_is_gc*/
30789   0, /*tp_bases*/
30790   0, /*tp_mro*/
30791   0, /*tp_cache*/
30792   0, /*tp_subclasses*/
30793   0, /*tp_weaklist*/
30794   0, /*tp_del*/
30795   0, /*tp_version_tag*/
30796   #if PY_VERSION_HEX >= 0x030400a1
30797   0, /*tp_finalize*/
30798   #endif
30799   #if PY_VERSION_HEX >= 0x030800b1
30800   0, /*tp_vectorcall*/
30801   #endif
30802 };
30803 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
30804 
__pyx_tp_new__memoryviewslice(PyTypeObject * t,PyObject * a,PyObject * k)30805 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
30806   struct __pyx_memoryviewslice_obj *p;
30807   PyObject *o = __pyx_tp_new_memoryview(t, a, k);
30808   if (unlikely(!o)) return 0;
30809   p = ((struct __pyx_memoryviewslice_obj *)o);
30810   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
30811   p->from_object = Py_None; Py_INCREF(Py_None);
30812   p->from_slice.memview = NULL;
30813   return o;
30814 }
30815 
__pyx_tp_dealloc__memoryviewslice(PyObject * o)30816 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
30817   struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
30818   #if CYTHON_USE_TP_FINALIZE
30819   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
30820     if (PyObject_CallFinalizerFromDealloc(o)) return;
30821   }
30822   #endif
30823   PyObject_GC_UnTrack(o);
30824   {
30825     PyObject *etype, *eval, *etb;
30826     PyErr_Fetch(&etype, &eval, &etb);
30827     ++Py_REFCNT(o);
30828     __pyx_memoryviewslice___dealloc__(o);
30829     --Py_REFCNT(o);
30830     PyErr_Restore(etype, eval, etb);
30831   }
30832   Py_CLEAR(p->from_object);
30833   PyObject_GC_Track(o);
30834   __pyx_tp_dealloc_memoryview(o);
30835 }
30836 
__pyx_tp_traverse__memoryviewslice(PyObject * o,visitproc v,void * a)30837 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
30838   int e;
30839   struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
30840   e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
30841   if (p->from_object) {
30842     e = (*v)(p->from_object, a); if (e) return e;
30843   }
30844   return 0;
30845 }
30846 
__pyx_tp_clear__memoryviewslice(PyObject * o)30847 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
30848   PyObject* tmp;
30849   struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
30850   __pyx_tp_clear_memoryview(o);
30851   tmp = ((PyObject*)p->from_object);
30852   p->from_object = Py_None; Py_INCREF(Py_None);
30853   Py_XDECREF(tmp);
30854   __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
30855   return 0;
30856 }
30857 
__pyx_getprop___pyx_memoryviewslice_base(PyObject * o,CYTHON_UNUSED void * x)30858 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
30859   return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
30860 }
30861 
30862 static PyMethodDef __pyx_methods__memoryviewslice[] = {
30863   {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
30864   {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
30865   {0, 0, 0, 0}
30866 };
30867 
30868 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
30869   {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
30870   {0, 0, 0, 0, 0}
30871 };
30872 
30873 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
30874   PyVarObject_HEAD_INIT(0, 0)
30875   "yt.geometry.grid_container._memoryviewslice", /*tp_name*/
30876   sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
30877   0, /*tp_itemsize*/
30878   __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
30879   0, /*tp_print*/
30880   0, /*tp_getattr*/
30881   0, /*tp_setattr*/
30882   #if PY_MAJOR_VERSION < 3
30883   0, /*tp_compare*/
30884   #endif
30885   #if PY_MAJOR_VERSION >= 3
30886   0, /*tp_as_async*/
30887   #endif
30888   #if CYTHON_COMPILING_IN_PYPY
30889   __pyx_memoryview___repr__, /*tp_repr*/
30890   #else
30891   0, /*tp_repr*/
30892   #endif
30893   0, /*tp_as_number*/
30894   0, /*tp_as_sequence*/
30895   0, /*tp_as_mapping*/
30896   0, /*tp_hash*/
30897   0, /*tp_call*/
30898   #if CYTHON_COMPILING_IN_PYPY
30899   __pyx_memoryview___str__, /*tp_str*/
30900   #else
30901   0, /*tp_str*/
30902   #endif
30903   0, /*tp_getattro*/
30904   0, /*tp_setattro*/
30905   0, /*tp_as_buffer*/
30906   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
30907   "Internal class for passing memoryview slices to Python", /*tp_doc*/
30908   __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
30909   __pyx_tp_clear__memoryviewslice, /*tp_clear*/
30910   0, /*tp_richcompare*/
30911   0, /*tp_weaklistoffset*/
30912   0, /*tp_iter*/
30913   0, /*tp_iternext*/
30914   __pyx_methods__memoryviewslice, /*tp_methods*/
30915   0, /*tp_members*/
30916   __pyx_getsets__memoryviewslice, /*tp_getset*/
30917   0, /*tp_base*/
30918   0, /*tp_dict*/
30919   0, /*tp_descr_get*/
30920   0, /*tp_descr_set*/
30921   0, /*tp_dictoffset*/
30922   0, /*tp_init*/
30923   0, /*tp_alloc*/
30924   __pyx_tp_new__memoryviewslice, /*tp_new*/
30925   0, /*tp_free*/
30926   0, /*tp_is_gc*/
30927   0, /*tp_bases*/
30928   0, /*tp_mro*/
30929   0, /*tp_cache*/
30930   0, /*tp_subclasses*/
30931   0, /*tp_weaklist*/
30932   0, /*tp_del*/
30933   0, /*tp_version_tag*/
30934   #if PY_VERSION_HEX >= 0x030400a1
30935   0, /*tp_finalize*/
30936   #endif
30937   #if PY_VERSION_HEX >= 0x030800b1
30938   0, /*tp_vectorcall*/
30939   #endif
30940 };
30941 
30942 static PyMethodDef __pyx_methods[] = {
30943   {0, 0, 0, 0}
30944 };
30945 
30946 #if PY_MAJOR_VERSION >= 3
30947 #if CYTHON_PEP489_MULTI_PHASE_INIT
30948 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
30949 static int __pyx_pymod_exec_grid_container(PyObject* module); /*proto*/
30950 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
30951   {Py_mod_create, (void*)__pyx_pymod_create},
30952   {Py_mod_exec, (void*)__pyx_pymod_exec_grid_container},
30953   {0, NULL}
30954 };
30955 #endif
30956 
30957 static struct PyModuleDef __pyx_moduledef = {
30958     PyModuleDef_HEAD_INIT,
30959     "grid_container",
30960     __pyx_k_Matching_points_on_the_grid_to, /* m_doc */
30961   #if CYTHON_PEP489_MULTI_PHASE_INIT
30962     0, /* m_size */
30963   #else
30964     -1, /* m_size */
30965   #endif
30966     __pyx_methods /* m_methods */,
30967   #if CYTHON_PEP489_MULTI_PHASE_INIT
30968     __pyx_moduledef_slots, /* m_slots */
30969   #else
30970     NULL, /* m_reload */
30971   #endif
30972     NULL, /* m_traverse */
30973     NULL, /* m_clear */
30974     NULL /* m_free */
30975 };
30976 #endif
30977 #ifndef CYTHON_SMALL_CODE
30978 #if defined(__clang__)
30979     #define CYTHON_SMALL_CODE
30980 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
30981     #define CYTHON_SMALL_CODE __attribute__((cold))
30982 #else
30983     #define CYTHON_SMALL_CODE
30984 #endif
30985 #endif
30986 
30987 static __Pyx_StringTabEntry __pyx_string_tab[] = {
30988   {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
30989   {&__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},
30990   {&__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},
30991   {&__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},
30992   {&__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},
30993   {&__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},
30994   {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
30995   {&__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},
30996   {&__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},
30997   {&__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},
30998   {&__pyx_n_s_GridTree, __pyx_k_GridTree, sizeof(__pyx_k_GridTree), 0, 0, 1, 1},
30999   {&__pyx_n_s_GridTree___iter, __pyx_k_GridTree___iter, sizeof(__pyx_k_GridTree___iter), 0, 0, 1, 1},
31000   {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
31001   {&__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},
31002   {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
31003   {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
31004   {&__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},
31005   {&__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},
31006   {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1},
31007   {&__pyx_n_s_MatchPointsToGrids, __pyx_k_MatchPointsToGrids, sizeof(__pyx_k_MatchPointsToGrids), 0, 0, 1, 1},
31008   {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
31009   {&__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},
31010   {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
31011   {&__pyx_kp_s_No_value_specified_for_struct_at, __pyx_k_No_value_specified_for_struct_at, sizeof(__pyx_k_No_value_specified_for_struct_at), 0, 0, 1, 0},
31012   {&__pyx_kp_s_No_value_specified_for_struct_at_10, __pyx_k_No_value_specified_for_struct_at_10, sizeof(__pyx_k_No_value_specified_for_struct_at_10), 0, 0, 1, 0},
31013   {&__pyx_kp_s_No_value_specified_for_struct_at_11, __pyx_k_No_value_specified_for_struct_at_11, sizeof(__pyx_k_No_value_specified_for_struct_at_11), 0, 0, 1, 0},
31014   {&__pyx_kp_s_No_value_specified_for_struct_at_12, __pyx_k_No_value_specified_for_struct_at_12, sizeof(__pyx_k_No_value_specified_for_struct_at_12), 0, 0, 1, 0},
31015   {&__pyx_kp_s_No_value_specified_for_struct_at_13, __pyx_k_No_value_specified_for_struct_at_13, sizeof(__pyx_k_No_value_specified_for_struct_at_13), 0, 0, 1, 0},
31016   {&__pyx_kp_s_No_value_specified_for_struct_at_14, __pyx_k_No_value_specified_for_struct_at_14, sizeof(__pyx_k_No_value_specified_for_struct_at_14), 0, 0, 1, 0},
31017   {&__pyx_kp_s_No_value_specified_for_struct_at_15, __pyx_k_No_value_specified_for_struct_at_15, sizeof(__pyx_k_No_value_specified_for_struct_at_15), 0, 0, 1, 0},
31018   {&__pyx_kp_s_No_value_specified_for_struct_at_16, __pyx_k_No_value_specified_for_struct_at_16, sizeof(__pyx_k_No_value_specified_for_struct_at_16), 0, 0, 1, 0},
31019   {&__pyx_kp_s_No_value_specified_for_struct_at_17, __pyx_k_No_value_specified_for_struct_at_17, sizeof(__pyx_k_No_value_specified_for_struct_at_17), 0, 0, 1, 0},
31020   {&__pyx_kp_s_No_value_specified_for_struct_at_18, __pyx_k_No_value_specified_for_struct_at_18, sizeof(__pyx_k_No_value_specified_for_struct_at_18), 0, 0, 1, 0},
31021   {&__pyx_kp_s_No_value_specified_for_struct_at_19, __pyx_k_No_value_specified_for_struct_at_19, sizeof(__pyx_k_No_value_specified_for_struct_at_19), 0, 0, 1, 0},
31022   {&__pyx_kp_s_No_value_specified_for_struct_at_2, __pyx_k_No_value_specified_for_struct_at_2, sizeof(__pyx_k_No_value_specified_for_struct_at_2), 0, 0, 1, 0},
31023   {&__pyx_kp_s_No_value_specified_for_struct_at_3, __pyx_k_No_value_specified_for_struct_at_3, sizeof(__pyx_k_No_value_specified_for_struct_at_3), 0, 0, 1, 0},
31024   {&__pyx_kp_s_No_value_specified_for_struct_at_4, __pyx_k_No_value_specified_for_struct_at_4, sizeof(__pyx_k_No_value_specified_for_struct_at_4), 0, 0, 1, 0},
31025   {&__pyx_kp_s_No_value_specified_for_struct_at_5, __pyx_k_No_value_specified_for_struct_at_5, sizeof(__pyx_k_No_value_specified_for_struct_at_5), 0, 0, 1, 0},
31026   {&__pyx_kp_s_No_value_specified_for_struct_at_6, __pyx_k_No_value_specified_for_struct_at_6, sizeof(__pyx_k_No_value_specified_for_struct_at_6), 0, 0, 1, 0},
31027   {&__pyx_kp_s_No_value_specified_for_struct_at_7, __pyx_k_No_value_specified_for_struct_at_7, sizeof(__pyx_k_No_value_specified_for_struct_at_7), 0, 0, 1, 0},
31028   {&__pyx_kp_s_No_value_specified_for_struct_at_8, __pyx_k_No_value_specified_for_struct_at_8, sizeof(__pyx_k_No_value_specified_for_struct_at_8), 0, 0, 1, 0},
31029   {&__pyx_kp_s_No_value_specified_for_struct_at_9, __pyx_k_No_value_specified_for_struct_at_9, sizeof(__pyx_k_No_value_specified_for_struct_at_9), 0, 0, 1, 0},
31030   {&__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},
31031   {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
31032   {&__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},
31033   {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
31034   {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
31035   {&__pyx_kp_b_T, __pyx_k_T, sizeof(__pyx_k_T), 0, 0, 0, 0},
31036   {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
31037   {&__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},
31038   {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
31039   {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
31040   {&__pyx_kp_b__50, __pyx_k__50, sizeof(__pyx_k__50), 0, 0, 0, 0},
31041   {&__pyx_kp_b__51, __pyx_k__51, sizeof(__pyx_k__51), 0, 0, 0, 0},
31042   {&__pyx_kp_b__52, __pyx_k__52, sizeof(__pyx_k__52), 0, 0, 0, 0},
31043   {&__pyx_kp_b__53, __pyx_k__53, sizeof(__pyx_k__53), 0, 0, 0, 0},
31044   {&__pyx_kp_u__54, __pyx_k__54, sizeof(__pyx_k__54), 0, 1, 0, 0},
31045   {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
31046   {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
31047   {&__pyx_n_s_asarray, __pyx_k_asarray, sizeof(__pyx_k_asarray), 0, 0, 1, 1},
31048   {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
31049   {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
31050   {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
31051   {&__pyx_n_s_char, __pyx_k_char, sizeof(__pyx_k_char), 0, 0, 1, 1},
31052   {&__pyx_n_s_children_pointers, __pyx_k_children_pointers, sizeof(__pyx_k_children_pointers), 0, 0, 1, 1},
31053   {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
31054   {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
31055   {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
31056   {&__pyx_n_s_code_length, __pyx_k_code_length, sizeof(__pyx_k_code_length), 0, 0, 1, 1},
31057   {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
31058   {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
31059   {&__pyx_n_s_convert_to_units, __pyx_k_convert_to_units, sizeof(__pyx_k_convert_to_units), 0, 0, 1, 1},
31060   {&__pyx_n_s_dds_x, __pyx_k_dds_x, sizeof(__pyx_k_dds_x), 0, 0, 1, 1},
31061   {&__pyx_n_s_dds_y, __pyx_k_dds_y, sizeof(__pyx_k_dds_y), 0, 0, 1, 1},
31062   {&__pyx_n_s_dds_z, __pyx_k_dds_z, sizeof(__pyx_k_dds_z), 0, 0, 1, 1},
31063   {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
31064   {&__pyx_n_s_dimensions, __pyx_k_dimensions, sizeof(__pyx_k_dimensions), 0, 0, 1, 1},
31065   {&__pyx_n_s_dims_x, __pyx_k_dims_x, sizeof(__pyx_k_dims_x), 0, 0, 1, 1},
31066   {&__pyx_n_s_dims_y, __pyx_k_dims_y, sizeof(__pyx_k_dims_y), 0, 0, 1, 1},
31067   {&__pyx_n_s_dims_z, __pyx_k_dims_z, sizeof(__pyx_k_dims_z), 0, 0, 1, 1},
31068   {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
31069   {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
31070   {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1},
31071   {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
31072   {&__pyx_n_s_endswith, __pyx_k_endswith, sizeof(__pyx_k_endswith), 0, 0, 1, 1},
31073   {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
31074   {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
31075   {&__pyx_n_s_fields, __pyx_k_fields, sizeof(__pyx_k_fields), 0, 0, 1, 1},
31076   {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
31077   {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1},
31078   {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
31079   {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
31080   {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
31081   {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
31082   {&__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},
31083   {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
31084   {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
31085   {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1},
31086   {&__pyx_n_s_int, __pyx_k_int, sizeof(__pyx_k_int), 0, 0, 1, 1},
31087   {&__pyx_n_s_int64, __pyx_k_int64, sizeof(__pyx_k_int64), 0, 0, 1, 1},
31088   {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
31089   {&__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},
31090   {&__pyx_n_s_iter, __pyx_k_iter, sizeof(__pyx_k_iter), 0, 0, 1, 1},
31091   {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1},
31092   {&__pyx_n_s_left_edge, __pyx_k_left_edge, sizeof(__pyx_k_left_edge), 0, 0, 1, 1},
31093   {&__pyx_n_s_left_edge_x, __pyx_k_left_edge_x, sizeof(__pyx_k_left_edge_x), 0, 0, 1, 1},
31094   {&__pyx_n_s_left_edge_y, __pyx_k_left_edge_y, sizeof(__pyx_k_left_edge_y), 0, 0, 1, 1},
31095   {&__pyx_n_s_left_edge_z, __pyx_k_left_edge_z, sizeof(__pyx_k_left_edge_z), 0, 0, 1, 1},
31096   {&__pyx_n_s_level, __pyx_k_level, sizeof(__pyx_k_level), 0, 0, 1, 1},
31097   {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
31098   {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
31099   {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
31100   {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
31101   {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
31102   {&__pyx_n_s_names, __pyx_k_names, sizeof(__pyx_k_names), 0, 0, 1, 1},
31103   {&__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},
31104   {&__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},
31105   {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
31106   {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
31107   {&__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},
31108   {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
31109   {&__pyx_n_s_num_children, __pyx_k_num_children, sizeof(__pyx_k_num_children), 0, 0, 1, 1},
31110   {&__pyx_n_s_num_grids, __pyx_k_num_grids, sizeof(__pyx_k_num_grids), 0, 0, 1, 1},
31111   {&__pyx_n_s_num_points, __pyx_k_num_points, sizeof(__pyx_k_num_points), 0, 0, 1, 1},
31112   {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
31113   {&__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},
31114   {&__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},
31115   {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
31116   {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
31117   {&__pyx_n_s_parent_ind, __pyx_k_parent_ind, sizeof(__pyx_k_parent_ind), 0, 0, 1, 1},
31118   {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
31119   {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
31120   {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
31121   {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
31122   {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
31123   {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
31124   {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
31125   {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
31126   {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
31127   {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
31128   {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
31129   {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
31130   {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
31131   {&__pyx_n_s_right_edge, __pyx_k_right_edge, sizeof(__pyx_k_right_edge), 0, 0, 1, 1},
31132   {&__pyx_n_s_right_edge_x, __pyx_k_right_edge_x, sizeof(__pyx_k_right_edge_x), 0, 0, 1, 1},
31133   {&__pyx_n_s_right_edge_y, __pyx_k_right_edge_y, sizeof(__pyx_k_right_edge_y), 0, 0, 1, 1},
31134   {&__pyx_n_s_right_edge_z, __pyx_k_right_edge_z, sizeof(__pyx_k_right_edge_z), 0, 0, 1, 1},
31135   {&__pyx_kp_u_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 1, 0, 0},
31136   {&__pyx_n_s_selector, __pyx_k_selector, sizeof(__pyx_k_selector), 0, 0, 1, 1},
31137   {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1},
31138   {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
31139   {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
31140   {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
31141   {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
31142   {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
31143   {&__pyx_n_s_start_index_x, __pyx_k_start_index_x, sizeof(__pyx_k_start_index_x), 0, 0, 1, 1},
31144   {&__pyx_n_s_start_index_y, __pyx_k_start_index_y, sizeof(__pyx_k_start_index_y), 0, 0, 1, 1},
31145   {&__pyx_n_s_start_index_z, __pyx_k_start_index_z, sizeof(__pyx_k_start_index_z), 0, 0, 1, 1},
31146   {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
31147   {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
31148   {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
31149   {&__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},
31150   {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
31151   {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
31152   {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
31153   {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
31154   {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1},
31155   {&__pyx_n_s_tree, __pyx_k_tree, sizeof(__pyx_k_tree), 0, 0, 1, 1},
31156   {&__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},
31157   {&__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},
31158   {&__pyx_n_s_units, __pyx_k_units, sizeof(__pyx_k_units), 0, 0, 1, 1},
31159   {&__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},
31160   {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
31161   {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
31162   {&__pyx_n_s_view, __pyx_k_view, sizeof(__pyx_k_view), 0, 0, 1, 1},
31163   {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
31164   {&__pyx_n_s_x_2, __pyx_k_x_2, sizeof(__pyx_k_x_2), 0, 0, 1, 1},
31165   {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1},
31166   {&__pyx_n_s_y_2, __pyx_k_y_2, sizeof(__pyx_k_y_2), 0, 0, 1, 1},
31167   {&__pyx_n_s_yt_geometry_grid_container, __pyx_k_yt_geometry_grid_container, sizeof(__pyx_k_yt_geometry_grid_container), 0, 0, 1, 1},
31168   {&__pyx_n_s_z, __pyx_k_z, sizeof(__pyx_k_z), 0, 0, 1, 1},
31169   {&__pyx_n_s_z_2, __pyx_k_z_2, sizeof(__pyx_k_z_2), 0, 0, 1, 1},
31170   {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
31171   {0, 0, 0, 0, 0, 0, 0}
31172 };
__Pyx_InitCachedBuiltins(void)31173 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
31174   __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 32, __pyx_L1_error)
31175   __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 95, __pyx_L1_error)
31176   __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
31177   __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(3, 272, __pyx_L1_error)
31178   __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(3, 1038, __pyx_L1_error)
31179   __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(1, 18, __pyx_L1_error)
31180   __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 148, __pyx_L1_error)
31181   __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 151, __pyx_L1_error)
31182   __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 400, __pyx_L1_error)
31183   __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 609, __pyx_L1_error)
31184   __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 828, __pyx_L1_error)
31185   return 0;
31186   __pyx_L1_error:;
31187   return -1;
31188 }
31189 
__Pyx_InitCachedConstants(void)31190 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
31191   __Pyx_RefNannyDeclarations
31192   __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
31193 
31194   /* "yt/geometry/grid_container.pyx":75
31195  *
31196  *         for i in range(num_grids):
31197  *             self.grids[i] = Grid_initialize(left_edge[i,:],             # <<<<<<<<<<<<<<
31198  *                                             right_edge[i,:],
31199  *                                             dimensions[i,:],
31200  */
31201   __pyx_slice_ = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice_)) __PYX_ERR(0, 75, __pyx_L1_error)
31202   __Pyx_GOTREF(__pyx_slice_);
31203   __Pyx_GIVEREF(__pyx_slice_);
31204 
31205   /* "yt/geometry/grid_container.pyx":141
31206  *             if name.endswith("_x"):
31207  *                 f = (d.char, 3)
31208  *                 n = name[:-2]             # <<<<<<<<<<<<<<
31209  *             elif name.endswith("_y") or name.endswith("_z"):
31210  *                 continue
31211  */
31212   __pyx_slice__2 = PySlice_New(Py_None, __pyx_int_neg_2, Py_None); if (unlikely(!__pyx_slice__2)) __PYX_ERR(0, 141, __pyx_L1_error)
31213   __Pyx_GOTREF(__pyx_slice__2);
31214   __Pyx_GIVEREF(__pyx_slice__2);
31215 
31216   /* "(tree fragment)":2
31217  * def __reduce_cython__(self):
31218  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
31219  * def __setstate_cython__(self, __pyx_state):
31220  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
31221  */
31222   __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 2, __pyx_L1_error)
31223   __Pyx_GOTREF(__pyx_tuple__3);
31224   __Pyx_GIVEREF(__pyx_tuple__3);
31225 
31226   /* "(tree fragment)":4
31227  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
31228  * def __setstate_cython__(self, __pyx_state):
31229  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
31230  */
31231   __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 4, __pyx_L1_error)
31232   __Pyx_GOTREF(__pyx_tuple__4);
31233   __Pyx_GIVEREF(__pyx_tuple__4);
31234 
31235   /* "(tree fragment)":2
31236  * def __reduce_cython__(self):
31237  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
31238  * def __setstate_cython__(self, __pyx_state):
31239  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
31240  */
31241   __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 2, __pyx_L1_error)
31242   __Pyx_GOTREF(__pyx_tuple__5);
31243   __Pyx_GIVEREF(__pyx_tuple__5);
31244 
31245   /* "(tree fragment)":4
31246  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
31247  * def __setstate_cython__(self, __pyx_state):
31248  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
31249  */
31250   __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 4, __pyx_L1_error)
31251   __Pyx_GOTREF(__pyx_tuple__6);
31252   __Pyx_GIVEREF(__pyx_tuple__6);
31253 
31254   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272
31255  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
31256  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
31257  *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
31258  *
31259  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
31260  */
31261   __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(3, 272, __pyx_L1_error)
31262   __Pyx_GOTREF(__pyx_tuple__7);
31263   __Pyx_GIVEREF(__pyx_tuple__7);
31264 
31265   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276
31266  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
31267  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
31268  *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
31269  *
31270  *             info.buf = PyArray_DATA(self)
31271  */
31272   __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(3, 276, __pyx_L1_error)
31273   __Pyx_GOTREF(__pyx_tuple__8);
31274   __Pyx_GIVEREF(__pyx_tuple__8);
31275 
31276   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":306
31277  *                 if ((descr.byteorder == c'>' and little_endian) or
31278  *                     (descr.byteorder == c'<' and not little_endian)):
31279  *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
31280  *                 if   t == NPY_BYTE:        f = "b"
31281  *                 elif t == NPY_UBYTE:       f = "B"
31282  */
31283   __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(3, 306, __pyx_L1_error)
31284   __Pyx_GOTREF(__pyx_tuple__9);
31285   __Pyx_GIVEREF(__pyx_tuple__9);
31286 
31287   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856
31288  *
31289  *         if (end - f) - <int>(new_offset - offset[0]) < 15:
31290  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
31291  *
31292  *         if ((child.byteorder == c'>' and little_endian) or
31293  */
31294   __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(3, 856, __pyx_L1_error)
31295   __Pyx_GOTREF(__pyx_tuple__10);
31296   __Pyx_GIVEREF(__pyx_tuple__10);
31297 
31298   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":880
31299  *             t = child.type_num
31300  *             if end - f < 5:
31301  *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
31302  *
31303  *             # Until ticket #99 is fixed, use integers to avoid warnings
31304  */
31305   __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(3, 880, __pyx_L1_error)
31306   __Pyx_GOTREF(__pyx_tuple__11);
31307   __Pyx_GIVEREF(__pyx_tuple__11);
31308 
31309   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1038
31310  *         _import_array()
31311  *     except Exception:
31312  *         raise ImportError("numpy.core.multiarray failed to import")             # <<<<<<<<<<<<<<
31313  *
31314  * cdef inline int import_umath() except -1:
31315  */
31316   __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(3, 1038, __pyx_L1_error)
31317   __Pyx_GOTREF(__pyx_tuple__12);
31318   __Pyx_GIVEREF(__pyx_tuple__12);
31319 
31320   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1044
31321  *         _import_umath()
31322  *     except Exception:
31323  *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
31324  *
31325  * cdef inline int import_ufunc() except -1:
31326  */
31327   __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(3, 1044, __pyx_L1_error)
31328   __Pyx_GOTREF(__pyx_tuple__13);
31329   __Pyx_GIVEREF(__pyx_tuple__13);
31330 
31331   /* "FromPyStructUtility":19
31332  *         value = obj['num_children']
31333  *     except KeyError:
31334  *         raise ValueError("No value specified for struct attribute 'num_children'")             # <<<<<<<<<<<<<<
31335  *     result.num_children = value
31336  *     try:
31337  */
31338   __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 19, __pyx_L1_error)
31339   __Pyx_GOTREF(__pyx_tuple__14);
31340   __Pyx_GIVEREF(__pyx_tuple__14);
31341 
31342   /* "FromPyStructUtility":24
31343  *         value = obj['level']
31344  *     except KeyError:
31345  *         raise ValueError("No value specified for struct attribute 'level'")             # <<<<<<<<<<<<<<
31346  *     result.level = value
31347  *     try:
31348  */
31349   __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_2); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 24, __pyx_L1_error)
31350   __Pyx_GOTREF(__pyx_tuple__15);
31351   __Pyx_GIVEREF(__pyx_tuple__15);
31352 
31353   /* "FromPyStructUtility":29
31354  *         value = obj['index']
31355  *     except KeyError:
31356  *         raise ValueError("No value specified for struct attribute 'index'")             # <<<<<<<<<<<<<<
31357  *     result.index = value
31358  *     try:
31359  */
31360   __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_3); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 29, __pyx_L1_error)
31361   __Pyx_GOTREF(__pyx_tuple__16);
31362   __Pyx_GIVEREF(__pyx_tuple__16);
31363 
31364   /* "FromPyStructUtility":34
31365  *         value = obj['left_edge_x']
31366  *     except KeyError:
31367  *         raise ValueError("No value specified for struct attribute 'left_edge_x'")             # <<<<<<<<<<<<<<
31368  *     result.left_edge_x = value
31369  *     try:
31370  */
31371   __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_4); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 34, __pyx_L1_error)
31372   __Pyx_GOTREF(__pyx_tuple__17);
31373   __Pyx_GIVEREF(__pyx_tuple__17);
31374 
31375   /* "FromPyStructUtility":39
31376  *         value = obj['left_edge_y']
31377  *     except KeyError:
31378  *         raise ValueError("No value specified for struct attribute 'left_edge_y'")             # <<<<<<<<<<<<<<
31379  *     result.left_edge_y = value
31380  *     try:
31381  */
31382   __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_5); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 39, __pyx_L1_error)
31383   __Pyx_GOTREF(__pyx_tuple__18);
31384   __Pyx_GIVEREF(__pyx_tuple__18);
31385 
31386   /* "FromPyStructUtility":44
31387  *         value = obj['left_edge_z']
31388  *     except KeyError:
31389  *         raise ValueError("No value specified for struct attribute 'left_edge_z'")             # <<<<<<<<<<<<<<
31390  *     result.left_edge_z = value
31391  *     try:
31392  */
31393   __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_6); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 44, __pyx_L1_error)
31394   __Pyx_GOTREF(__pyx_tuple__19);
31395   __Pyx_GIVEREF(__pyx_tuple__19);
31396 
31397   /* "FromPyStructUtility":49
31398  *         value = obj['right_edge_x']
31399  *     except KeyError:
31400  *         raise ValueError("No value specified for struct attribute 'right_edge_x'")             # <<<<<<<<<<<<<<
31401  *     result.right_edge_x = value
31402  *     try:
31403  */
31404   __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_7); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 49, __pyx_L1_error)
31405   __Pyx_GOTREF(__pyx_tuple__20);
31406   __Pyx_GIVEREF(__pyx_tuple__20);
31407 
31408   /* "FromPyStructUtility":54
31409  *         value = obj['right_edge_y']
31410  *     except KeyError:
31411  *         raise ValueError("No value specified for struct attribute 'right_edge_y'")             # <<<<<<<<<<<<<<
31412  *     result.right_edge_y = value
31413  *     try:
31414  */
31415   __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_8); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 54, __pyx_L1_error)
31416   __Pyx_GOTREF(__pyx_tuple__21);
31417   __Pyx_GIVEREF(__pyx_tuple__21);
31418 
31419   /* "FromPyStructUtility":59
31420  *         value = obj['right_edge_z']
31421  *     except KeyError:
31422  *         raise ValueError("No value specified for struct attribute 'right_edge_z'")             # <<<<<<<<<<<<<<
31423  *     result.right_edge_z = value
31424  *     try:
31425  */
31426   __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_9); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 59, __pyx_L1_error)
31427   __Pyx_GOTREF(__pyx_tuple__22);
31428   __Pyx_GIVEREF(__pyx_tuple__22);
31429 
31430   /* "FromPyStructUtility":64
31431  *         value = obj['children_pointers']
31432  *     except KeyError:
31433  *         raise ValueError("No value specified for struct attribute 'children_pointers'")             # <<<<<<<<<<<<<<
31434  *     result.children_pointers = value
31435  *     try:
31436  */
31437   __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_10); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 64, __pyx_L1_error)
31438   __Pyx_GOTREF(__pyx_tuple__23);
31439   __Pyx_GIVEREF(__pyx_tuple__23);
31440 
31441   /* "FromPyStructUtility":69
31442  *         value = obj['start_index_x']
31443  *     except KeyError:
31444  *         raise ValueError("No value specified for struct attribute 'start_index_x'")             # <<<<<<<<<<<<<<
31445  *     result.start_index_x = value
31446  *     try:
31447  */
31448   __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_11); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 69, __pyx_L1_error)
31449   __Pyx_GOTREF(__pyx_tuple__24);
31450   __Pyx_GIVEREF(__pyx_tuple__24);
31451 
31452   /* "FromPyStructUtility":74
31453  *         value = obj['start_index_y']
31454  *     except KeyError:
31455  *         raise ValueError("No value specified for struct attribute 'start_index_y'")             # <<<<<<<<<<<<<<
31456  *     result.start_index_y = value
31457  *     try:
31458  */
31459   __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_12); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 74, __pyx_L1_error)
31460   __Pyx_GOTREF(__pyx_tuple__25);
31461   __Pyx_GIVEREF(__pyx_tuple__25);
31462 
31463   /* "FromPyStructUtility":79
31464  *         value = obj['start_index_z']
31465  *     except KeyError:
31466  *         raise ValueError("No value specified for struct attribute 'start_index_z'")             # <<<<<<<<<<<<<<
31467  *     result.start_index_z = value
31468  *     try:
31469  */
31470   __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_13); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 79, __pyx_L1_error)
31471   __Pyx_GOTREF(__pyx_tuple__26);
31472   __Pyx_GIVEREF(__pyx_tuple__26);
31473 
31474   /* "FromPyStructUtility":84
31475  *         value = obj['dims_x']
31476  *     except KeyError:
31477  *         raise ValueError("No value specified for struct attribute 'dims_x'")             # <<<<<<<<<<<<<<
31478  *     result.dims_x = value
31479  *     try:
31480  */
31481   __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_14); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 84, __pyx_L1_error)
31482   __Pyx_GOTREF(__pyx_tuple__27);
31483   __Pyx_GIVEREF(__pyx_tuple__27);
31484 
31485   /* "FromPyStructUtility":89
31486  *         value = obj['dims_y']
31487  *     except KeyError:
31488  *         raise ValueError("No value specified for struct attribute 'dims_y'")             # <<<<<<<<<<<<<<
31489  *     result.dims_y = value
31490  *     try:
31491  */
31492   __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_15); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 89, __pyx_L1_error)
31493   __Pyx_GOTREF(__pyx_tuple__28);
31494   __Pyx_GIVEREF(__pyx_tuple__28);
31495 
31496   /* "FromPyStructUtility":94
31497  *         value = obj['dims_z']
31498  *     except KeyError:
31499  *         raise ValueError("No value specified for struct attribute 'dims_z'")             # <<<<<<<<<<<<<<
31500  *     result.dims_z = value
31501  *     try:
31502  */
31503   __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_16); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 94, __pyx_L1_error)
31504   __Pyx_GOTREF(__pyx_tuple__29);
31505   __Pyx_GIVEREF(__pyx_tuple__29);
31506 
31507   /* "FromPyStructUtility":99
31508  *         value = obj['dds_x']
31509  *     except KeyError:
31510  *         raise ValueError("No value specified for struct attribute 'dds_x'")             # <<<<<<<<<<<<<<
31511  *     result.dds_x = value
31512  *     try:
31513  */
31514   __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_17); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 99, __pyx_L1_error)
31515   __Pyx_GOTREF(__pyx_tuple__30);
31516   __Pyx_GIVEREF(__pyx_tuple__30);
31517 
31518   /* "FromPyStructUtility":104
31519  *         value = obj['dds_y']
31520  *     except KeyError:
31521  *         raise ValueError("No value specified for struct attribute 'dds_y'")             # <<<<<<<<<<<<<<
31522  *     result.dds_y = value
31523  *     try:
31524  */
31525   __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_18); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 104, __pyx_L1_error)
31526   __Pyx_GOTREF(__pyx_tuple__31);
31527   __Pyx_GIVEREF(__pyx_tuple__31);
31528 
31529   /* "FromPyStructUtility":109
31530  *         value = obj['dds_z']
31531  *     except KeyError:
31532  *         raise ValueError("No value specified for struct attribute 'dds_z'")             # <<<<<<<<<<<<<<
31533  *     result.dds_z = value
31534  *     return result
31535  */
31536   __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_19); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 109, __pyx_L1_error)
31537   __Pyx_GOTREF(__pyx_tuple__32);
31538   __Pyx_GIVEREF(__pyx_tuple__32);
31539 
31540   /* "View.MemoryView":133
31541  *
31542  *         if not self.ndim:
31543  *             raise ValueError("Empty shape tuple for cython.array")             # <<<<<<<<<<<<<<
31544  *
31545  *         if itemsize <= 0:
31546  */
31547   __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 133, __pyx_L1_error)
31548   __Pyx_GOTREF(__pyx_tuple__33);
31549   __Pyx_GIVEREF(__pyx_tuple__33);
31550 
31551   /* "View.MemoryView":136
31552  *
31553  *         if itemsize <= 0:
31554  *             raise ValueError("itemsize <= 0 for cython.array")             # <<<<<<<<<<<<<<
31555  *
31556  *         if not isinstance(format, bytes):
31557  */
31558   __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 136, __pyx_L1_error)
31559   __Pyx_GOTREF(__pyx_tuple__34);
31560   __Pyx_GIVEREF(__pyx_tuple__34);
31561 
31562   /* "View.MemoryView":148
31563  *
31564  *         if not self._shape:
31565  *             raise MemoryError("unable to allocate shape and strides.")             # <<<<<<<<<<<<<<
31566  *
31567  *
31568  */
31569   __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(1, 148, __pyx_L1_error)
31570   __Pyx_GOTREF(__pyx_tuple__35);
31571   __Pyx_GIVEREF(__pyx_tuple__35);
31572 
31573   /* "View.MemoryView":176
31574  *             self.data = <char *>malloc(self.len)
31575  *             if not self.data:
31576  *                 raise MemoryError("unable to allocate array data.")             # <<<<<<<<<<<<<<
31577  *
31578  *             if self.dtype_is_object:
31579  */
31580   __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(1, 176, __pyx_L1_error)
31581   __Pyx_GOTREF(__pyx_tuple__36);
31582   __Pyx_GIVEREF(__pyx_tuple__36);
31583 
31584   /* "View.MemoryView":192
31585  *             bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
31586  *         if not (flags & bufmode):
31587  *             raise ValueError("Can only create a buffer that is contiguous in memory.")             # <<<<<<<<<<<<<<
31588  *         info.buf = self.data
31589  *         info.len = self.len
31590  */
31591   __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(1, 192, __pyx_L1_error)
31592   __Pyx_GOTREF(__pyx_tuple__37);
31593   __Pyx_GIVEREF(__pyx_tuple__37);
31594 
31595   /* "(tree fragment)":2
31596  * def __reduce_cython__(self):
31597  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
31598  * def __setstate_cython__(self, __pyx_state):
31599  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
31600  */
31601   __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(1, 2, __pyx_L1_error)
31602   __Pyx_GOTREF(__pyx_tuple__38);
31603   __Pyx_GIVEREF(__pyx_tuple__38);
31604 
31605   /* "(tree fragment)":4
31606  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
31607  * def __setstate_cython__(self, __pyx_state):
31608  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
31609  */
31610   __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(1, 4, __pyx_L1_error)
31611   __Pyx_GOTREF(__pyx_tuple__39);
31612   __Pyx_GIVEREF(__pyx_tuple__39);
31613 
31614   /* "View.MemoryView":414
31615  *     def __setitem__(memoryview self, object index, object value):
31616  *         if self.view.readonly:
31617  *             raise TypeError("Cannot assign to read-only memoryview")             # <<<<<<<<<<<<<<
31618  *
31619  *         have_slices, index = _unellipsify(index, self.view.ndim)
31620  */
31621   __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(1, 414, __pyx_L1_error)
31622   __Pyx_GOTREF(__pyx_tuple__40);
31623   __Pyx_GIVEREF(__pyx_tuple__40);
31624 
31625   /* "View.MemoryView":491
31626  *             result = struct.unpack(self.view.format, bytesitem)
31627  *         except struct.error:
31628  *             raise ValueError("Unable to convert item to object")             # <<<<<<<<<<<<<<
31629  *         else:
31630  *             if len(self.view.format) == 1:
31631  */
31632   __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(1, 491, __pyx_L1_error)
31633   __Pyx_GOTREF(__pyx_tuple__41);
31634   __Pyx_GIVEREF(__pyx_tuple__41);
31635 
31636   /* "View.MemoryView":516
31637  *     def __getbuffer__(self, Py_buffer *info, int flags):
31638  *         if flags & PyBUF_WRITABLE and self.view.readonly:
31639  *             raise ValueError("Cannot create writable memory view from read-only memoryview")             # <<<<<<<<<<<<<<
31640  *
31641  *         if flags & PyBUF_ND:
31642  */
31643   __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(1, 516, __pyx_L1_error)
31644   __Pyx_GOTREF(__pyx_tuple__42);
31645   __Pyx_GIVEREF(__pyx_tuple__42);
31646 
31647   /* "View.MemoryView":566
31648  *         if self.view.strides == NULL:
31649  *
31650  *             raise ValueError("Buffer view does not expose strides")             # <<<<<<<<<<<<<<
31651  *
31652  *         return tuple([stride for stride in self.view.strides[:self.view.ndim]])
31653  */
31654   __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(1, 566, __pyx_L1_error)
31655   __Pyx_GOTREF(__pyx_tuple__43);
31656   __Pyx_GIVEREF(__pyx_tuple__43);
31657 
31658   /* "View.MemoryView":573
31659  *     def suboffsets(self):
31660  *         if self.view.suboffsets == NULL:
31661  *             return (-1,) * self.view.ndim             # <<<<<<<<<<<<<<
31662  *
31663  *         return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
31664  */
31665   __pyx_tuple__44 = PyTuple_New(1); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(1, 573, __pyx_L1_error)
31666   __Pyx_GOTREF(__pyx_tuple__44);
31667   __Pyx_INCREF(__pyx_int_neg_1);
31668   __Pyx_GIVEREF(__pyx_int_neg_1);
31669   PyTuple_SET_ITEM(__pyx_tuple__44, 0, __pyx_int_neg_1);
31670   __Pyx_GIVEREF(__pyx_tuple__44);
31671 
31672   /* "(tree fragment)":2
31673  * def __reduce_cython__(self):
31674  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
31675  * def __setstate_cython__(self, __pyx_state):
31676  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
31677  */
31678   __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(1, 2, __pyx_L1_error)
31679   __Pyx_GOTREF(__pyx_tuple__45);
31680   __Pyx_GIVEREF(__pyx_tuple__45);
31681 
31682   /* "(tree fragment)":4
31683  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
31684  * def __setstate_cython__(self, __pyx_state):
31685  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
31686  */
31687   __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(1, 4, __pyx_L1_error)
31688   __Pyx_GOTREF(__pyx_tuple__46);
31689   __Pyx_GIVEREF(__pyx_tuple__46);
31690 
31691   /* "View.MemoryView":699
31692  *     for suboffset in suboffsets[:ndim]:
31693  *         if suboffset >= 0:
31694  *             raise ValueError("Indirect dimensions not supported")             # <<<<<<<<<<<<<<
31695  *
31696  *
31697  */
31698   __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(1, 699, __pyx_L1_error)
31699   __Pyx_GOTREF(__pyx_tuple__47);
31700   __Pyx_GIVEREF(__pyx_tuple__47);
31701 
31702   /* "(tree fragment)":2
31703  * def __reduce_cython__(self):
31704  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
31705  * def __setstate_cython__(self, __pyx_state):
31706  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
31707  */
31708   __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(1, 2, __pyx_L1_error)
31709   __Pyx_GOTREF(__pyx_tuple__48);
31710   __Pyx_GIVEREF(__pyx_tuple__48);
31711 
31712   /* "(tree fragment)":4
31713  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
31714  * def __setstate_cython__(self, __pyx_state):
31715  *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
31716  */
31717   __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(1, 4, __pyx_L1_error)
31718   __Pyx_GOTREF(__pyx_tuple__49);
31719   __Pyx_GIVEREF(__pyx_tuple__49);
31720 
31721   /* "View.MemoryView":286
31722  *         return self.name
31723  *
31724  * cdef generic = Enum("<strided and direct or indirect>")             # <<<<<<<<<<<<<<
31725  * cdef strided = Enum("<strided and direct>") # default
31726  * cdef indirect = Enum("<strided and indirect>")
31727  */
31728   __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(1, 286, __pyx_L1_error)
31729   __Pyx_GOTREF(__pyx_tuple__55);
31730   __Pyx_GIVEREF(__pyx_tuple__55);
31731 
31732   /* "View.MemoryView":287
31733  *
31734  * cdef generic = Enum("<strided and direct or indirect>")
31735  * cdef strided = Enum("<strided and direct>") # default             # <<<<<<<<<<<<<<
31736  * cdef indirect = Enum("<strided and indirect>")
31737  *
31738  */
31739   __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(1, 287, __pyx_L1_error)
31740   __Pyx_GOTREF(__pyx_tuple__56);
31741   __Pyx_GIVEREF(__pyx_tuple__56);
31742 
31743   /* "View.MemoryView":288
31744  * cdef generic = Enum("<strided and direct or indirect>")
31745  * cdef strided = Enum("<strided and direct>") # default
31746  * cdef indirect = Enum("<strided and indirect>")             # <<<<<<<<<<<<<<
31747  *
31748  *
31749  */
31750   __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(1, 288, __pyx_L1_error)
31751   __Pyx_GOTREF(__pyx_tuple__57);
31752   __Pyx_GIVEREF(__pyx_tuple__57);
31753 
31754   /* "View.MemoryView":291
31755  *
31756  *
31757  * cdef contiguous = Enum("<contiguous and direct>")             # <<<<<<<<<<<<<<
31758  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
31759  *
31760  */
31761   __pyx_tuple__58 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(1, 291, __pyx_L1_error)
31762   __Pyx_GOTREF(__pyx_tuple__58);
31763   __Pyx_GIVEREF(__pyx_tuple__58);
31764 
31765   /* "View.MemoryView":292
31766  *
31767  * cdef contiguous = Enum("<contiguous and direct>")
31768  * cdef indirect_contiguous = Enum("<contiguous and indirect>")             # <<<<<<<<<<<<<<
31769  *
31770  *
31771  */
31772   __pyx_tuple__59 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(1, 292, __pyx_L1_error)
31773   __Pyx_GOTREF(__pyx_tuple__59);
31774   __Pyx_GIVEREF(__pyx_tuple__59);
31775 
31776   /* "(tree fragment)":1
31777  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
31778  *     cdef object __pyx_PickleError
31779  *     cdef object __pyx_result
31780  */
31781   __pyx_tuple__60 = 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__60)) __PYX_ERR(1, 1, __pyx_L1_error)
31782   __Pyx_GOTREF(__pyx_tuple__60);
31783   __Pyx_GIVEREF(__pyx_tuple__60);
31784   __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(1, 1, __pyx_L1_error)
31785   __Pyx_RefNannyFinishContext();
31786   return 0;
31787   __pyx_L1_error:;
31788   __Pyx_RefNannyFinishContext();
31789   return -1;
31790 }
31791 
__Pyx_InitGlobals(void)31792 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
31793   if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
31794   __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
31795   __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
31796   __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
31797   __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
31798   __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
31799   __pyx_int_neg_2 = PyInt_FromLong(-2); if (unlikely(!__pyx_int_neg_2)) __PYX_ERR(0, 1, __pyx_L1_error)
31800   return 0;
31801   __pyx_L1_error:;
31802   return -1;
31803 }
31804 
31805 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
31806 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
31807 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
31808 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
31809 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
31810 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
31811 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
31812 
__Pyx_modinit_global_init_code(void)31813 static int __Pyx_modinit_global_init_code(void) {
31814   __Pyx_RefNannyDeclarations
31815   __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
31816   /*--- Global init code ---*/
31817   generic = Py_None; Py_INCREF(Py_None);
31818   strided = Py_None; Py_INCREF(Py_None);
31819   indirect = Py_None; Py_INCREF(Py_None);
31820   contiguous = Py_None; Py_INCREF(Py_None);
31821   indirect_contiguous = Py_None; Py_INCREF(Py_None);
31822   __Pyx_RefNannyFinishContext();
31823   return 0;
31824 }
31825 
__Pyx_modinit_variable_export_code(void)31826 static int __Pyx_modinit_variable_export_code(void) {
31827   __Pyx_RefNannyDeclarations
31828   __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
31829   /*--- Variable export code ---*/
31830   __Pyx_RefNannyFinishContext();
31831   return 0;
31832 }
31833 
__Pyx_modinit_function_export_code(void)31834 static int __Pyx_modinit_function_export_code(void) {
31835   __Pyx_RefNannyDeclarations
31836   __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
31837   /*--- Function export code ---*/
31838   __Pyx_RefNannyFinishContext();
31839   return 0;
31840 }
31841 
__Pyx_modinit_type_init_code(void)31842 static int __Pyx_modinit_type_init_code(void) {
31843   __Pyx_RefNannyDeclarations
31844   __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
31845   /*--- Type init code ---*/
31846   __pyx_vtabptr_2yt_8geometry_14grid_container_GridTree = &__pyx_vtable_2yt_8geometry_14grid_container_GridTree;
31847   __pyx_vtable_2yt_8geometry_14grid_container_GridTree.setup_data = (void (*)(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *, struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *))__pyx_f_2yt_8geometry_14grid_container_8GridTree_setup_data;
31848   __pyx_vtable_2yt_8geometry_14grid_container_GridTree.visit_grids = (void (*)(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *, struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *, __pyx_t_2yt_8geometry_13grid_visitors_grid_visitor_function *, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *))__pyx_f_2yt_8geometry_14grid_container_8GridTree_visit_grids;
31849   __pyx_vtable_2yt_8geometry_14grid_container_GridTree.recursively_visit_grid = (void (*)(struct __pyx_obj_2yt_8geometry_14grid_container_GridTree *, struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *, __pyx_t_2yt_8geometry_13grid_visitors_grid_visitor_function *, struct __pyx_obj_2yt_8geometry_18selection_routines_SelectorObject *, struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode *, struct __pyx_opt_args_2yt_8geometry_14grid_container_8GridTree_recursively_visit_grid *__pyx_optional_args))__pyx_f_2yt_8geometry_14grid_container_8GridTree_recursively_visit_grid;
31850   if (PyType_Ready(&__pyx_type_2yt_8geometry_14grid_container_GridTree) < 0) __PYX_ERR(0, 49, __pyx_L1_error)
31851   #if PY_VERSION_HEX < 0x030800B1
31852   __pyx_type_2yt_8geometry_14grid_container_GridTree.tp_print = 0;
31853   #endif
31854   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2yt_8geometry_14grid_container_GridTree.tp_dictoffset && __pyx_type_2yt_8geometry_14grid_container_GridTree.tp_getattro == PyObject_GenericGetAttr)) {
31855     __pyx_type_2yt_8geometry_14grid_container_GridTree.tp_getattro = __Pyx_PyObject_GenericGetAttr;
31856   }
31857   if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_14grid_container_GridTree.tp_dict, __pyx_vtabptr_2yt_8geometry_14grid_container_GridTree) < 0) __PYX_ERR(0, 49, __pyx_L1_error)
31858   if (PyObject_SetAttr(__pyx_m, __pyx_n_s_GridTree, (PyObject *)&__pyx_type_2yt_8geometry_14grid_container_GridTree) < 0) __PYX_ERR(0, 49, __pyx_L1_error)
31859   if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_14grid_container_GridTree) < 0) __PYX_ERR(0, 49, __pyx_L1_error)
31860   __pyx_ptype_2yt_8geometry_14grid_container_GridTree = &__pyx_type_2yt_8geometry_14grid_container_GridTree;
31861   __pyx_vtabptr_2yt_8geometry_14grid_container_MatchPointsToGrids = &__pyx_vtable_2yt_8geometry_14grid_container_MatchPointsToGrids;
31862   __pyx_vtable_2yt_8geometry_14grid_container_MatchPointsToGrids.check_position = (__pyx_t_5numpy_uint8_t (*)(struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *, __pyx_t_5numpy_int64_t, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode *))__pyx_f_2yt_8geometry_14grid_container_18MatchPointsToGrids_check_position;
31863   __pyx_vtable_2yt_8geometry_14grid_container_MatchPointsToGrids.is_in_grid = (__pyx_t_5numpy_uint8_t (*)(struct __pyx_obj_2yt_8geometry_14grid_container_MatchPointsToGrids *, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, __pyx_t_5numpy_float64_t, struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode *))__pyx_f_2yt_8geometry_14grid_container_18MatchPointsToGrids_is_in_grid;
31864   if (PyType_Ready(&__pyx_type_2yt_8geometry_14grid_container_MatchPointsToGrids) < 0) __PYX_ERR(0, 269, __pyx_L1_error)
31865   #if PY_VERSION_HEX < 0x030800B1
31866   __pyx_type_2yt_8geometry_14grid_container_MatchPointsToGrids.tp_print = 0;
31867   #endif
31868   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2yt_8geometry_14grid_container_MatchPointsToGrids.tp_dictoffset && __pyx_type_2yt_8geometry_14grid_container_MatchPointsToGrids.tp_getattro == PyObject_GenericGetAttr)) {
31869     __pyx_type_2yt_8geometry_14grid_container_MatchPointsToGrids.tp_getattro = __Pyx_PyObject_GenericGetAttr;
31870   }
31871   if (__Pyx_SetVtable(__pyx_type_2yt_8geometry_14grid_container_MatchPointsToGrids.tp_dict, __pyx_vtabptr_2yt_8geometry_14grid_container_MatchPointsToGrids) < 0) __PYX_ERR(0, 269, __pyx_L1_error)
31872   if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MatchPointsToGrids, (PyObject *)&__pyx_type_2yt_8geometry_14grid_container_MatchPointsToGrids) < 0) __PYX_ERR(0, 269, __pyx_L1_error)
31873   if (__Pyx_setup_reduce((PyObject*)&__pyx_type_2yt_8geometry_14grid_container_MatchPointsToGrids) < 0) __PYX_ERR(0, 269, __pyx_L1_error)
31874   __pyx_ptype_2yt_8geometry_14grid_container_MatchPointsToGrids = &__pyx_type_2yt_8geometry_14grid_container_MatchPointsToGrids;
31875   if (PyType_Ready(&__pyx_type_2yt_8geometry_14grid_container___pyx_scope_struct____iter__) < 0) __PYX_ERR(0, 102, __pyx_L1_error)
31876   #if PY_VERSION_HEX < 0x030800B1
31877   __pyx_type_2yt_8geometry_14grid_container___pyx_scope_struct____iter__.tp_print = 0;
31878   #endif
31879   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_2yt_8geometry_14grid_container___pyx_scope_struct____iter__.tp_dictoffset && __pyx_type_2yt_8geometry_14grid_container___pyx_scope_struct____iter__.tp_getattro == PyObject_GenericGetAttr)) {
31880     __pyx_type_2yt_8geometry_14grid_container___pyx_scope_struct____iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
31881   }
31882   __pyx_ptype_2yt_8geometry_14grid_container___pyx_scope_struct____iter__ = &__pyx_type_2yt_8geometry_14grid_container___pyx_scope_struct____iter__;
31883   __pyx_vtabptr_array = &__pyx_vtable_array;
31884   __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
31885   if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
31886   #if PY_VERSION_HEX < 0x030800B1
31887   __pyx_type___pyx_array.tp_print = 0;
31888   #endif
31889   if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
31890   if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
31891   __pyx_array_type = &__pyx_type___pyx_array;
31892   if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
31893   #if PY_VERSION_HEX < 0x030800B1
31894   __pyx_type___pyx_MemviewEnum.tp_print = 0;
31895   #endif
31896   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
31897     __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
31898   }
31899   if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
31900   __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
31901   __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
31902   __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
31903   __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
31904   __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
31905   __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
31906   __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
31907   __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
31908   __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
31909   if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
31910   #if PY_VERSION_HEX < 0x030800B1
31911   __pyx_type___pyx_memoryview.tp_print = 0;
31912   #endif
31913   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
31914     __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
31915   }
31916   if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
31917   if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
31918   __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
31919   __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
31920   __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
31921   __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
31922   __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
31923   __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
31924   if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 961, __pyx_L1_error)
31925   #if PY_VERSION_HEX < 0x030800B1
31926   __pyx_type___pyx_memoryviewslice.tp_print = 0;
31927   #endif
31928   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
31929     __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
31930   }
31931   if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 961, __pyx_L1_error)
31932   if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 961, __pyx_L1_error)
31933   __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
31934   __Pyx_RefNannyFinishContext();
31935   return 0;
31936   __pyx_L1_error:;
31937   __Pyx_RefNannyFinishContext();
31938   return -1;
31939 }
31940 
__Pyx_modinit_type_import_code(void)31941 static int __Pyx_modinit_type_import_code(void) {
31942   __Pyx_RefNannyDeclarations
31943   PyObject *__pyx_t_1 = NULL;
31944   __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
31945   /*--- Type import code ---*/
31946   __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 9, __pyx_L1_error)
31947   __Pyx_GOTREF(__pyx_t_1);
31948   __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
31949   #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
31950   sizeof(PyTypeObject),
31951   #else
31952   sizeof(PyHeapTypeObject),
31953   #endif
31954   __Pyx_ImportType_CheckSize_Warn);
31955    if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(6, 9, __pyx_L1_error)
31956   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
31957   __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 206, __pyx_L1_error)
31958   __Pyx_GOTREF(__pyx_t_1);
31959   __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
31960    if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(3, 206, __pyx_L1_error)
31961   __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Warn);
31962    if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(3, 229, __pyx_L1_error)
31963   __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Warn);
31964    if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(3, 233, __pyx_L1_error)
31965   __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
31966    if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(3, 242, __pyx_L1_error)
31967   __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Warn);
31968    if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(3, 918, __pyx_L1_error)
31969   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
31970   __pyx_t_1 = PyImport_ImportModule("yt.geometry.oct_visitors"); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 33, __pyx_L1_error)
31971   __Pyx_GOTREF(__pyx_t_1);
31972   __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);
31973    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_OctVisitor) __PYX_ERR(7, 33, __pyx_L1_error)
31974   __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(7, 33, __pyx_L1_error)
31975   __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);
31976    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalOcts) __PYX_ERR(7, 59, __pyx_L1_error)
31977   __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(7, 59, __pyx_L1_error)
31978   __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);
31979    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_CountTotalCells) __PYX_ERR(7, 62, __pyx_L1_error)
31980   __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(7, 62, __pyx_L1_error)
31981   __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);
31982    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_MarkOcts) __PYX_ERR(7, 65, __pyx_L1_error)
31983   __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(7, 65, __pyx_L1_error)
31984   __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);
31985    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_MaskOcts) __PYX_ERR(7, 69, __pyx_L1_error)
31986   __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(7, 69, __pyx_L1_error)
31987   __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);
31988    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_IndexOcts) __PYX_ERR(7, 72, __pyx_L1_error)
31989   __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(7, 72, __pyx_L1_error)
31990   __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);
31991    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_MaskedIndexOcts) __PYX_ERR(7, 75, __pyx_L1_error)
31992   __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(7, 75, __pyx_L1_error)
31993   __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);
31994    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_IndexMaskMapOcts) __PYX_ERR(7, 79, __pyx_L1_error)
31995   __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(7, 79, __pyx_L1_error)
31996   __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);
31997    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_ICoordsOcts) __PYX_ERR(7, 85, __pyx_L1_error)
31998   __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(7, 85, __pyx_L1_error)
31999   __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);
32000    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_IResOcts) __PYX_ERR(7, 88, __pyx_L1_error)
32001   __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(7, 88, __pyx_L1_error)
32002   __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);
32003    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_FCoordsOcts) __PYX_ERR(7, 91, __pyx_L1_error)
32004   __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(7, 91, __pyx_L1_error)
32005   __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);
32006    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_FWidthOcts) __PYX_ERR(7, 94, __pyx_L1_error)
32007   __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(7, 94, __pyx_L1_error)
32008   __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);
32009    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_CopyArrayI64) __PYX_ERR(7, 97, __pyx_L1_error)
32010   __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(7, 97, __pyx_L1_error)
32011   __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);
32012    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_CopyArrayF64) __PYX_ERR(7, 101, __pyx_L1_error)
32013   __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(7, 101, __pyx_L1_error)
32014   __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);
32015    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_CopyFileIndArrayI8) __PYX_ERR(7, 105, __pyx_L1_error)
32016   __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(7, 105, __pyx_L1_error)
32017   __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);
32018    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_IdentifyOcts) __PYX_ERR(7, 110, __pyx_L1_error)
32019   __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(7, 110, __pyx_L1_error)
32020   __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);
32021    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_AssignDomainInd) __PYX_ERR(7, 113, __pyx_L1_error)
32022   __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(7, 113, __pyx_L1_error)
32023   __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);
32024    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_FillFileIndicesO) __PYX_ERR(7, 116, __pyx_L1_error)
32025   __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(7, 116, __pyx_L1_error)
32026   __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);
32027    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_FillFileIndicesR) __PYX_ERR(7, 121, __pyx_L1_error)
32028   __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(7, 121, __pyx_L1_error)
32029   __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);
32030    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_CountByDomain) __PYX_ERR(7, 126, __pyx_L1_error)
32031   __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(7, 126, __pyx_L1_error)
32032   __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);
32033    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_StoreOctree) __PYX_ERR(7, 129, __pyx_L1_error)
32034   __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(7, 129, __pyx_L1_error)
32035   __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);
32036    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_LoadOctree) __PYX_ERR(7, 132, __pyx_L1_error)
32037   __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(7, 132, __pyx_L1_error)
32038   __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);
32039    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_MortonIndexOcts) __PYX_ERR(7, 138, __pyx_L1_error)
32040   __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(7, 138, __pyx_L1_error)
32041   __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);
32042    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_StoreIndex) __PYX_ERR(7, 149, __pyx_L1_error)
32043   __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(7, 149, __pyx_L1_error)
32044   __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);
32045    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_BaseNeighbourVisitor) __PYX_ERR(7, 153, __pyx_L1_error)
32046   __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(7, 153, __pyx_L1_error)
32047   __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);
32048    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_NeighbourCellIndexVisitor) __PYX_ERR(7, 169, __pyx_L1_error)
32049   __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(7, 169, __pyx_L1_error)
32050   __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);
32051    if (!__pyx_ptype_2yt_8geometry_12oct_visitors_NeighbourCellVisitor) __PYX_ERR(7, 173, __pyx_L1_error)
32052   __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(7, 173, __pyx_L1_error)
32053   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32054   __pyx_t_1 = PyImport_ImportModule("yt.utilities.lib.allocation_container"); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 20, __pyx_L1_error)
32055   __Pyx_GOTREF(__pyx_t_1);
32056   __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);
32057    if (!__pyx_ptype_2yt_9utilities_3lib_20allocation_container_ObjectPool) __PYX_ERR(8, 20, __pyx_L1_error)
32058   __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)
32059   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32060   __pyx_t_1 = PyImport_ImportModule("yt.geometry.oct_container"); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 47, __pyx_L1_error)
32061   __Pyx_GOTREF(__pyx_t_1);
32062   __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);
32063    if (!__pyx_ptype_2yt_8geometry_13oct_container_OctObjectPool) __PYX_ERR(9, 47, __pyx_L1_error)
32064   __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)
32065   __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);
32066    if (!__pyx_ptype_2yt_8geometry_13oct_container_OctreeContainer) __PYX_ERR(9, 55, __pyx_L1_error)
32067   __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)
32068   __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);
32069    if (!__pyx_ptype_2yt_8geometry_13oct_container_SparseOctreeContainer) __PYX_ERR(9, 85, __pyx_L1_error)
32070   __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)
32071   __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);
32072    if (!__pyx_ptype_2yt_8geometry_13oct_container_RAMSESOctreeContainer) __PYX_ERR(9, 93, __pyx_L1_error)
32073   __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)
32074   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32075   __pyx_t_1 = PyImport_ImportModule("yt.geometry.selection_routines"); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 24, __pyx_L1_error)
32076   __Pyx_GOTREF(__pyx_t_1);
32077   __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);
32078    if (!__pyx_ptype_2yt_8geometry_18selection_routines_SelectorObject) __PYX_ERR(10, 24, __pyx_L1_error)
32079   __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(10, 24, __pyx_L1_error)
32080   __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);
32081    if (!__pyx_ptype_2yt_8geometry_18selection_routines_AlwaysSelector) __PYX_ERR(10, 70, __pyx_L1_error)
32082   __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(10, 70, __pyx_L1_error)
32083   __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);
32084    if (!__pyx_ptype_2yt_8geometry_18selection_routines_OctreeSubsetSelector) __PYX_ERR(10, 73, __pyx_L1_error)
32085   __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(10, 73, __pyx_L1_error)
32086   __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);
32087    if (!__pyx_ptype_2yt_8geometry_18selection_routines_BooleanSelector) __PYX_ERR(10, 77, __pyx_L1_error)
32088   __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(10, 77, __pyx_L1_error)
32089   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32090   __pyx_t_1 = PyImport_ImportModule("yt.utilities.lib.bitarray"); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 28, __pyx_L1_error)
32091   __Pyx_GOTREF(__pyx_t_1);
32092   __pyx_ptype_2yt_9utilities_3lib_8bitarray_bitarray = __Pyx_ImportType(__pyx_t_1, "yt.utilities.lib.bitarray", "bitarray", sizeof(struct __pyx_obj_2yt_9utilities_3lib_8bitarray_bitarray), __Pyx_ImportType_CheckSize_Warn);
32093    if (!__pyx_ptype_2yt_9utilities_3lib_8bitarray_bitarray) __PYX_ERR(11, 28, __pyx_L1_error)
32094   __pyx_vtabptr_2yt_9utilities_3lib_8bitarray_bitarray = (struct __pyx_vtabstruct_2yt_9utilities_3lib_8bitarray_bitarray*)__Pyx_GetVtable(__pyx_ptype_2yt_9utilities_3lib_8bitarray_bitarray->tp_dict); if (unlikely(!__pyx_vtabptr_2yt_9utilities_3lib_8bitarray_bitarray)) __PYX_ERR(11, 28, __pyx_L1_error)
32095   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32096   __Pyx_RefNannyFinishContext();
32097   return 0;
32098   __pyx_L1_error:;
32099   __Pyx_XDECREF(__pyx_t_1);
32100   __Pyx_RefNannyFinishContext();
32101   return -1;
32102 }
32103 
__Pyx_modinit_variable_import_code(void)32104 static int __Pyx_modinit_variable_import_code(void) {
32105   __Pyx_RefNannyDeclarations
32106   PyObject *__pyx_t_1 = NULL;
32107   __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
32108   /*--- Variable import code ---*/
32109   __pyx_t_1 = PyImport_ImportModule("yt.geometry.oct_container"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
32110   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)
32111   Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32112   __Pyx_RefNannyFinishContext();
32113   return 0;
32114   __pyx_L1_error:;
32115   __Pyx_XDECREF(__pyx_t_1);
32116   __Pyx_RefNannyFinishContext();
32117   return -1;
32118 }
32119 
__Pyx_modinit_function_import_code(void)32120 static int __Pyx_modinit_function_import_code(void) {
32121   __Pyx_RefNannyDeclarations
32122   PyObject *__pyx_t_1 = NULL;
32123   __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
32124   /*--- Function import code ---*/
32125   __pyx_t_1 = PyImport_ImportModule("yt.geometry.grid_visitors"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
32126   if (__Pyx_ImportFunction(__pyx_t_1, "free_tuples", (void (**)(void))&__pyx_f_2yt_8geometry_13grid_visitors_free_tuples, "void (struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
32127   if (__Pyx_ImportFunction(__pyx_t_1, "setup_tuples", (void (**)(void))&__pyx_f_2yt_8geometry_13grid_visitors_setup_tuples, "void (struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
32128   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)
32129   if (__Pyx_ImportFunction(__pyx_t_1, "count_cells", (void (**)(void))&__pyx_f_2yt_8geometry_13grid_visitors_count_cells, "void (struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *, __pyx_t_5numpy_uint8_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
32130   if (__Pyx_ImportFunction(__pyx_t_1, "mask_cells", (void (**)(void))&__pyx_f_2yt_8geometry_13grid_visitors_mask_cells, "void (struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *, __pyx_t_5numpy_uint8_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
32131   if (__Pyx_ImportFunction(__pyx_t_1, "icoords_cells", (void (**)(void))&__pyx_f_2yt_8geometry_13grid_visitors_icoords_cells, "void (struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *, __pyx_t_5numpy_uint8_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
32132   if (__Pyx_ImportFunction(__pyx_t_1, "ires_cells", (void (**)(void))&__pyx_f_2yt_8geometry_13grid_visitors_ires_cells, "void (struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *, __pyx_t_5numpy_uint8_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
32133   if (__Pyx_ImportFunction(__pyx_t_1, "fcoords_cells", (void (**)(void))&__pyx_f_2yt_8geometry_13grid_visitors_fcoords_cells, "void (struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *, __pyx_t_5numpy_uint8_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
32134   if (__Pyx_ImportFunction(__pyx_t_1, "fwidth_cells", (void (**)(void))&__pyx_f_2yt_8geometry_13grid_visitors_fwidth_cells, "void (struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *, __pyx_t_5numpy_uint8_t)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
32135   Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32136   __Pyx_RefNannyFinishContext();
32137   return 0;
32138   __pyx_L1_error:;
32139   __Pyx_XDECREF(__pyx_t_1);
32140   __Pyx_RefNannyFinishContext();
32141   return -1;
32142 }
32143 
32144 
32145 #if PY_MAJOR_VERSION < 3
32146 #ifdef CYTHON_NO_PYINIT_EXPORT
32147 #define __Pyx_PyMODINIT_FUNC void
32148 #else
32149 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
32150 #endif
32151 #else
32152 #ifdef CYTHON_NO_PYINIT_EXPORT
32153 #define __Pyx_PyMODINIT_FUNC PyObject *
32154 #else
32155 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
32156 #endif
32157 #endif
32158 
32159 
32160 #if PY_MAJOR_VERSION < 3
32161 __Pyx_PyMODINIT_FUNC initgrid_container(void) CYTHON_SMALL_CODE; /*proto*/
initgrid_container(void)32162 __Pyx_PyMODINIT_FUNC initgrid_container(void)
32163 #else
32164 __Pyx_PyMODINIT_FUNC PyInit_grid_container(void) CYTHON_SMALL_CODE; /*proto*/
32165 __Pyx_PyMODINIT_FUNC PyInit_grid_container(void)
32166 #if CYTHON_PEP489_MULTI_PHASE_INIT
32167 {
32168   return PyModuleDef_Init(&__pyx_moduledef);
32169 }
32170 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
32171     #if PY_VERSION_HEX >= 0x030700A1
32172     static PY_INT64_T main_interpreter_id = -1;
32173     PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
32174     if (main_interpreter_id == -1) {
32175         main_interpreter_id = current_id;
32176         return (unlikely(current_id == -1)) ? -1 : 0;
32177     } else if (unlikely(main_interpreter_id != current_id))
32178     #else
32179     static PyInterpreterState *main_interpreter = NULL;
32180     PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
32181     if (!main_interpreter) {
32182         main_interpreter = current_interpreter;
32183     } else if (unlikely(main_interpreter != current_interpreter))
32184     #endif
32185     {
32186         PyErr_SetString(
32187             PyExc_ImportError,
32188             "Interpreter change detected - this module can only be loaded into one interpreter per process.");
32189         return -1;
32190     }
32191     return 0;
32192 }
32193 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) {
32194     PyObject *value = PyObject_GetAttrString(spec, from_name);
32195     int result = 0;
32196     if (likely(value)) {
32197         if (allow_none || value != Py_None) {
32198             result = PyDict_SetItemString(moddict, to_name, value);
32199         }
32200         Py_DECREF(value);
32201     } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
32202         PyErr_Clear();
32203     } else {
32204         result = -1;
32205     }
32206     return result;
32207 }
32208 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
32209     PyObject *module = NULL, *moddict, *modname;
32210     if (__Pyx_check_single_interpreter())
32211         return NULL;
32212     if (__pyx_m)
32213         return __Pyx_NewRef(__pyx_m);
32214     modname = PyObject_GetAttrString(spec, "name");
32215     if (unlikely(!modname)) goto bad;
32216     module = PyModule_NewObject(modname);
32217     Py_DECREF(modname);
32218     if (unlikely(!module)) goto bad;
32219     moddict = PyModule_GetDict(module);
32220     if (unlikely(!moddict)) goto bad;
32221     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
32222     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
32223     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
32224     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
32225     return module;
32226 bad:
32227     Py_XDECREF(module);
32228     return NULL;
32229 }
32230 
32231 
32232 static CYTHON_SMALL_CODE int __pyx_pymod_exec_grid_container(PyObject *__pyx_pyinit_module)
32233 #endif
32234 #endif
32235 {
32236   PyObject *__pyx_t_1 = NULL;
32237   static PyThread_type_lock __pyx_t_2[8];
32238   __Pyx_RefNannyDeclarations
32239   #if CYTHON_PEP489_MULTI_PHASE_INIT
32240   if (__pyx_m) {
32241     if (__pyx_m == __pyx_pyinit_module) return 0;
32242     PyErr_SetString(PyExc_RuntimeError, "Module 'grid_container' has already been imported. Re-initialisation is not supported.");
32243     return -1;
32244   }
32245   #elif PY_MAJOR_VERSION >= 3
32246   if (__pyx_m) return __Pyx_NewRef(__pyx_m);
32247   #endif
32248   #if CYTHON_REFNANNY
32249 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
32250 if (!__Pyx_RefNanny) {
32251   PyErr_Clear();
32252   __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
32253   if (!__Pyx_RefNanny)
32254       Py_FatalError("failed to import 'refnanny' module");
32255 }
32256 #endif
32257   __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_grid_container(void)", 0);
32258   if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
32259   #ifdef __Pxy_PyFrame_Initialize_Offsets
32260   __Pxy_PyFrame_Initialize_Offsets();
32261   #endif
32262   __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
32263   __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
32264   __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
32265   #ifdef __Pyx_CyFunction_USED
32266   if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
32267   #endif
32268   #ifdef __Pyx_FusedFunction_USED
32269   if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
32270   #endif
32271   #ifdef __Pyx_Coroutine_USED
32272   if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
32273   #endif
32274   #ifdef __Pyx_Generator_USED
32275   if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
32276   #endif
32277   #ifdef __Pyx_AsyncGen_USED
32278   if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
32279   #endif
32280   #ifdef __Pyx_StopAsyncIteration_USED
32281   if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
32282   #endif
32283   /*--- Library function declarations ---*/
32284   /*--- Threads initialization code ---*/
32285   #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
32286   #ifdef WITH_THREAD /* Python build with threading support? */
32287   PyEval_InitThreads();
32288   #endif
32289   #endif
32290   /*--- Module creation code ---*/
32291   #if CYTHON_PEP489_MULTI_PHASE_INIT
32292   __pyx_m = __pyx_pyinit_module;
32293   Py_INCREF(__pyx_m);
32294   #else
32295   #if PY_MAJOR_VERSION < 3
32296   __pyx_m = Py_InitModule4("grid_container", __pyx_methods, __pyx_k_Matching_points_on_the_grid_to, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
32297   #else
32298   __pyx_m = PyModule_Create(&__pyx_moduledef);
32299   #endif
32300   if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
32301   #endif
32302   __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
32303   Py_INCREF(__pyx_d);
32304   __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
32305   Py_INCREF(__pyx_b);
32306   __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
32307   Py_INCREF(__pyx_cython_runtime);
32308   if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
32309   /*--- Initialize various global constants etc. ---*/
32310   if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
32311   #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
32312   if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
32313   #endif
32314   if (__pyx_module_is_main_yt__geometry__grid_container) {
32315     if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
32316   }
32317   #if PY_MAJOR_VERSION >= 3
32318   {
32319     PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
32320     if (!PyDict_GetItemString(modules, "yt.geometry.grid_container")) {
32321       if (unlikely(PyDict_SetItemString(modules, "yt.geometry.grid_container", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
32322     }
32323   }
32324   #endif
32325   /*--- Builtin init code ---*/
32326   if (__Pyx_InitCachedBuiltins() < 0) goto __pyx_L1_error;
32327   /*--- Constants init code ---*/
32328   if (__Pyx_InitCachedConstants() < 0) goto __pyx_L1_error;
32329   /*--- Global type/function init code ---*/
32330   (void)__Pyx_modinit_global_init_code();
32331   (void)__Pyx_modinit_variable_export_code();
32332   (void)__Pyx_modinit_function_export_code();
32333   if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error;
32334   if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error;
32335   if (unlikely(__Pyx_modinit_variable_import_code() != 0)) goto __pyx_L1_error;
32336   if (unlikely(__Pyx_modinit_function_import_code() != 0)) goto __pyx_L1_error;
32337   /*--- Execution code ---*/
32338   #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
32339   if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
32340   #endif
32341 
32342   /* "yt/geometry/grid_container.pyx":11
32343  *
32344  *
32345  * import numpy as np             # <<<<<<<<<<<<<<
32346  *
32347  * cimport cython
32348  */
32349   __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
32350   __Pyx_GOTREF(__pyx_t_1);
32351   if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
32352   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32353 
32354   /* "yt/geometry/grid_container.pyx":1
32355  * # distutils: include_dirs = LIB_DIR             # <<<<<<<<<<<<<<
32356  * # distutils: libraries = STD_LIBS
32357  * """
32358  */
32359   __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
32360   __Pyx_GOTREF(__pyx_t_1);
32361   if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
32362   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32363 
32364   /* "View.MemoryView":209
32365  *         info.obj = self
32366  *
32367  *     __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")             # <<<<<<<<<<<<<<
32368  *
32369  *     def __dealloc__(array self):
32370  */
32371   __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 209, __pyx_L1_error)
32372   __Pyx_GOTREF(__pyx_t_1);
32373   if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 209, __pyx_L1_error)
32374   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32375   PyType_Modified(__pyx_array_type);
32376 
32377   /* "View.MemoryView":286
32378  *         return self.name
32379  *
32380  * cdef generic = Enum("<strided and direct or indirect>")             # <<<<<<<<<<<<<<
32381  * cdef strided = Enum("<strided and direct>") # default
32382  * cdef indirect = Enum("<strided and indirect>")
32383  */
32384   __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 286, __pyx_L1_error)
32385   __Pyx_GOTREF(__pyx_t_1);
32386   __Pyx_XGOTREF(generic);
32387   __Pyx_DECREF_SET(generic, __pyx_t_1);
32388   __Pyx_GIVEREF(__pyx_t_1);
32389   __pyx_t_1 = 0;
32390 
32391   /* "View.MemoryView":287
32392  *
32393  * cdef generic = Enum("<strided and direct or indirect>")
32394  * cdef strided = Enum("<strided and direct>") # default             # <<<<<<<<<<<<<<
32395  * cdef indirect = Enum("<strided and indirect>")
32396  *
32397  */
32398   __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 287, __pyx_L1_error)
32399   __Pyx_GOTREF(__pyx_t_1);
32400   __Pyx_XGOTREF(strided);
32401   __Pyx_DECREF_SET(strided, __pyx_t_1);
32402   __Pyx_GIVEREF(__pyx_t_1);
32403   __pyx_t_1 = 0;
32404 
32405   /* "View.MemoryView":288
32406  * cdef generic = Enum("<strided and direct or indirect>")
32407  * cdef strided = Enum("<strided and direct>") # default
32408  * cdef indirect = Enum("<strided and indirect>")             # <<<<<<<<<<<<<<
32409  *
32410  *
32411  */
32412   __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 288, __pyx_L1_error)
32413   __Pyx_GOTREF(__pyx_t_1);
32414   __Pyx_XGOTREF(indirect);
32415   __Pyx_DECREF_SET(indirect, __pyx_t_1);
32416   __Pyx_GIVEREF(__pyx_t_1);
32417   __pyx_t_1 = 0;
32418 
32419   /* "View.MemoryView":291
32420  *
32421  *
32422  * cdef contiguous = Enum("<contiguous and direct>")             # <<<<<<<<<<<<<<
32423  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
32424  *
32425  */
32426   __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 291, __pyx_L1_error)
32427   __Pyx_GOTREF(__pyx_t_1);
32428   __Pyx_XGOTREF(contiguous);
32429   __Pyx_DECREF_SET(contiguous, __pyx_t_1);
32430   __Pyx_GIVEREF(__pyx_t_1);
32431   __pyx_t_1 = 0;
32432 
32433   /* "View.MemoryView":292
32434  *
32435  * cdef contiguous = Enum("<contiguous and direct>")
32436  * cdef indirect_contiguous = Enum("<contiguous and indirect>")             # <<<<<<<<<<<<<<
32437  *
32438  *
32439  */
32440   __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 292, __pyx_L1_error)
32441   __Pyx_GOTREF(__pyx_t_1);
32442   __Pyx_XGOTREF(indirect_contiguous);
32443   __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1);
32444   __Pyx_GIVEREF(__pyx_t_1);
32445   __pyx_t_1 = 0;
32446 
32447   /* "View.MemoryView":316
32448  *
32449  * DEF THREAD_LOCKS_PREALLOCATED = 8
32450  * cdef int __pyx_memoryview_thread_locks_used = 0             # <<<<<<<<<<<<<<
32451  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
32452  *     PyThread_allocate_lock(),
32453  */
32454   __pyx_memoryview_thread_locks_used = 0;
32455 
32456   /* "View.MemoryView":317
32457  * DEF THREAD_LOCKS_PREALLOCATED = 8
32458  * cdef int __pyx_memoryview_thread_locks_used = 0
32459  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [             # <<<<<<<<<<<<<<
32460  *     PyThread_allocate_lock(),
32461  *     PyThread_allocate_lock(),
32462  */
32463   __pyx_t_2[0] = PyThread_allocate_lock();
32464   __pyx_t_2[1] = PyThread_allocate_lock();
32465   __pyx_t_2[2] = PyThread_allocate_lock();
32466   __pyx_t_2[3] = PyThread_allocate_lock();
32467   __pyx_t_2[4] = PyThread_allocate_lock();
32468   __pyx_t_2[5] = PyThread_allocate_lock();
32469   __pyx_t_2[6] = PyThread_allocate_lock();
32470   __pyx_t_2[7] = PyThread_allocate_lock();
32471   memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_2, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
32472 
32473   /* "View.MemoryView":545
32474  *         info.obj = self
32475  *
32476  *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")             # <<<<<<<<<<<<<<
32477  *
32478  *
32479  */
32480   __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 545, __pyx_L1_error)
32481   __Pyx_GOTREF(__pyx_t_1);
32482   if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 545, __pyx_L1_error)
32483   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32484   PyType_Modified(__pyx_memoryview_type);
32485 
32486   /* "View.MemoryView":991
32487  *         return self.from_object
32488  *
32489  *     __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")             # <<<<<<<<<<<<<<
32490  *
32491  *
32492  */
32493   __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 991, __pyx_L1_error)
32494   __Pyx_GOTREF(__pyx_t_1);
32495   if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 991, __pyx_L1_error)
32496   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32497   PyType_Modified(__pyx_memoryviewslice_type);
32498 
32499   /* "(tree fragment)":1
32500  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
32501  *     cdef object __pyx_PickleError
32502  *     cdef object __pyx_result
32503  */
32504   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
32505   __Pyx_GOTREF(__pyx_t_1);
32506   if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
32507   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32508 
32509   /* "BufferFormatFromTypeInfo":1460
32510  *
32511  * @cname('__pyx_format_from_typeinfo')
32512  * cdef bytes format_from_typeinfo(__Pyx_TypeInfo *type):             # <<<<<<<<<<<<<<
32513  *     cdef __Pyx_StructField *field
32514  *     cdef __pyx_typeinfo_string fmt
32515  */
32516 
32517   /*--- Wrapped vars code ---*/
32518 
32519   goto __pyx_L0;
32520   __pyx_L1_error:;
32521   __Pyx_XDECREF(__pyx_t_1);
32522   if (__pyx_m) {
32523     if (__pyx_d) {
32524       __Pyx_AddTraceback("init yt.geometry.grid_container", __pyx_clineno, __pyx_lineno, __pyx_filename);
32525     }
32526     Py_CLEAR(__pyx_m);
32527   } else if (!PyErr_Occurred()) {
32528     PyErr_SetString(PyExc_ImportError, "init yt.geometry.grid_container");
32529   }
32530   __pyx_L0:;
32531   __Pyx_RefNannyFinishContext();
32532   #if CYTHON_PEP489_MULTI_PHASE_INIT
32533   return (__pyx_m != NULL) ? 0 : -1;
32534   #elif PY_MAJOR_VERSION >= 3
32535   return __pyx_m;
32536   #else
32537   return;
32538   #endif
32539 }
32540 
32541 /* --- Runtime support code --- */
32542 /* Refnanny */
32543 #if CYTHON_REFNANNY
__Pyx_RefNannyImportAPI(const char * modname)32544 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
32545     PyObject *m = NULL, *p = NULL;
32546     void *r = NULL;
32547     m = PyImport_ImportModule(modname);
32548     if (!m) goto end;
32549     p = PyObject_GetAttrString(m, "RefNannyAPI");
32550     if (!p) goto end;
32551     r = PyLong_AsVoidPtr(p);
32552 end:
32553     Py_XDECREF(p);
32554     Py_XDECREF(m);
32555     return (__Pyx_RefNannyAPIStruct *)r;
32556 }
32557 #endif
32558 
32559 /* PyObjectGetAttrStr */
32560 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetAttrStr(PyObject * obj,PyObject * attr_name)32561 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
32562     PyTypeObject* tp = Py_TYPE(obj);
32563     if (likely(tp->tp_getattro))
32564         return tp->tp_getattro(obj, attr_name);
32565 #if PY_MAJOR_VERSION < 3
32566     if (likely(tp->tp_getattr))
32567         return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
32568 #endif
32569     return PyObject_GetAttr(obj, attr_name);
32570 }
32571 #endif
32572 
32573 /* GetBuiltinName */
__Pyx_GetBuiltinName(PyObject * name)32574 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
32575     PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
32576     if (unlikely(!result)) {
32577         PyErr_Format(PyExc_NameError,
32578 #if PY_MAJOR_VERSION >= 3
32579             "name '%U' is not defined", name);
32580 #else
32581             "name '%.200s' is not defined", PyString_AS_STRING(name));
32582 #endif
32583     }
32584     return result;
32585 }
32586 
32587 /* IsLittleEndian */
__Pyx_Is_Little_Endian(void)32588 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
32589 {
32590   union {
32591     uint32_t u32;
32592     uint8_t u8[4];
32593   } S;
32594   S.u32 = 0x01020304;
32595   return S.u8[0] == 4;
32596 }
32597 
32598 /* BufferFormatCheck */
__Pyx_BufFmt_Init(__Pyx_BufFmt_Context * ctx,__Pyx_BufFmt_StackElem * stack,__Pyx_TypeInfo * type)32599 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
32600                               __Pyx_BufFmt_StackElem* stack,
32601                               __Pyx_TypeInfo* type) {
32602   stack[0].field = &ctx->root;
32603   stack[0].parent_offset = 0;
32604   ctx->root.type = type;
32605   ctx->root.name = "buffer dtype";
32606   ctx->root.offset = 0;
32607   ctx->head = stack;
32608   ctx->head->field = &ctx->root;
32609   ctx->fmt_offset = 0;
32610   ctx->head->parent_offset = 0;
32611   ctx->new_packmode = '@';
32612   ctx->enc_packmode = '@';
32613   ctx->new_count = 1;
32614   ctx->enc_count = 0;
32615   ctx->enc_type = 0;
32616   ctx->is_complex = 0;
32617   ctx->is_valid_array = 0;
32618   ctx->struct_alignment = 0;
32619   while (type->typegroup == 'S') {
32620     ++ctx->head;
32621     ctx->head->field = type->fields;
32622     ctx->head->parent_offset = 0;
32623     type = type->fields->type;
32624   }
32625 }
__Pyx_BufFmt_ParseNumber(const char ** ts)32626 static int __Pyx_BufFmt_ParseNumber(const char** ts) {
32627     int count;
32628     const char* t = *ts;
32629     if (*t < '0' || *t > '9') {
32630       return -1;
32631     } else {
32632         count = *t++ - '0';
32633         while (*t >= '0' && *t <= '9') {
32634             count *= 10;
32635             count += *t++ - '0';
32636         }
32637     }
32638     *ts = t;
32639     return count;
32640 }
__Pyx_BufFmt_ExpectNumber(const char ** ts)32641 static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
32642     int number = __Pyx_BufFmt_ParseNumber(ts);
32643     if (number == -1)
32644         PyErr_Format(PyExc_ValueError,\
32645                      "Does not understand character buffer dtype format string ('%c')", **ts);
32646     return number;
32647 }
__Pyx_BufFmt_RaiseUnexpectedChar(char ch)32648 static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
32649   PyErr_Format(PyExc_ValueError,
32650                "Unexpected format string character: '%c'", ch);
32651 }
__Pyx_BufFmt_DescribeTypeChar(char ch,int is_complex)32652 static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
32653   switch (ch) {
32654     case 'c': return "'char'";
32655     case 'b': return "'signed char'";
32656     case 'B': return "'unsigned char'";
32657     case 'h': return "'short'";
32658     case 'H': return "'unsigned short'";
32659     case 'i': return "'int'";
32660     case 'I': return "'unsigned int'";
32661     case 'l': return "'long'";
32662     case 'L': return "'unsigned long'";
32663     case 'q': return "'long long'";
32664     case 'Q': return "'unsigned long long'";
32665     case 'f': return (is_complex ? "'complex float'" : "'float'");
32666     case 'd': return (is_complex ? "'complex double'" : "'double'");
32667     case 'g': return (is_complex ? "'complex long double'" : "'long double'");
32668     case 'T': return "a struct";
32669     case 'O': return "Python object";
32670     case 'P': return "a pointer";
32671     case 's': case 'p': return "a string";
32672     case 0: return "end";
32673     default: return "unparseable format string";
32674   }
32675 }
__Pyx_BufFmt_TypeCharToStandardSize(char ch,int is_complex)32676 static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
32677   switch (ch) {
32678     case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
32679     case 'h': case 'H': return 2;
32680     case 'i': case 'I': case 'l': case 'L': return 4;
32681     case 'q': case 'Q': return 8;
32682     case 'f': return (is_complex ? 8 : 4);
32683     case 'd': return (is_complex ? 16 : 8);
32684     case 'g': {
32685       PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
32686       return 0;
32687     }
32688     case 'O': case 'P': return sizeof(void*);
32689     default:
32690       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
32691       return 0;
32692     }
32693 }
__Pyx_BufFmt_TypeCharToNativeSize(char ch,int is_complex)32694 static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
32695   switch (ch) {
32696     case 'c': case 'b': case 'B': case 's': case 'p': return 1;
32697     case 'h': case 'H': return sizeof(short);
32698     case 'i': case 'I': return sizeof(int);
32699     case 'l': case 'L': return sizeof(long);
32700     #ifdef HAVE_LONG_LONG
32701     case 'q': case 'Q': return sizeof(PY_LONG_LONG);
32702     #endif
32703     case 'f': return sizeof(float) * (is_complex ? 2 : 1);
32704     case 'd': return sizeof(double) * (is_complex ? 2 : 1);
32705     case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
32706     case 'O': case 'P': return sizeof(void*);
32707     default: {
32708       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
32709       return 0;
32710     }
32711   }
32712 }
32713 typedef struct { char c; short x; } __Pyx_st_short;
32714 typedef struct { char c; int x; } __Pyx_st_int;
32715 typedef struct { char c; long x; } __Pyx_st_long;
32716 typedef struct { char c; float x; } __Pyx_st_float;
32717 typedef struct { char c; double x; } __Pyx_st_double;
32718 typedef struct { char c; long double x; } __Pyx_st_longdouble;
32719 typedef struct { char c; void *x; } __Pyx_st_void_p;
32720 #ifdef HAVE_LONG_LONG
32721 typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
32722 #endif
__Pyx_BufFmt_TypeCharToAlignment(char ch,CYTHON_UNUSED int is_complex)32723 static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
32724   switch (ch) {
32725     case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
32726     case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
32727     case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
32728     case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
32729 #ifdef HAVE_LONG_LONG
32730     case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
32731 #endif
32732     case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
32733     case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
32734     case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
32735     case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
32736     default:
32737       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
32738       return 0;
32739     }
32740 }
32741 /* These are for computing the padding at the end of the struct to align
32742    on the first member of the struct. This will probably the same as above,
32743    but we don't have any guarantees.
32744  */
32745 typedef struct { short x; char c; } __Pyx_pad_short;
32746 typedef struct { int x; char c; } __Pyx_pad_int;
32747 typedef struct { long x; char c; } __Pyx_pad_long;
32748 typedef struct { float x; char c; } __Pyx_pad_float;
32749 typedef struct { double x; char c; } __Pyx_pad_double;
32750 typedef struct { long double x; char c; } __Pyx_pad_longdouble;
32751 typedef struct { void *x; char c; } __Pyx_pad_void_p;
32752 #ifdef HAVE_LONG_LONG
32753 typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
32754 #endif
__Pyx_BufFmt_TypeCharToPadding(char ch,CYTHON_UNUSED int is_complex)32755 static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
32756   switch (ch) {
32757     case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
32758     case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
32759     case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
32760     case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
32761 #ifdef HAVE_LONG_LONG
32762     case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
32763 #endif
32764     case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
32765     case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
32766     case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
32767     case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
32768     default:
32769       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
32770       return 0;
32771     }
32772 }
__Pyx_BufFmt_TypeCharToGroup(char ch,int is_complex)32773 static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
32774   switch (ch) {
32775     case 'c':
32776         return 'H';
32777     case 'b': case 'h': case 'i':
32778     case 'l': case 'q': case 's': case 'p':
32779         return 'I';
32780     case 'B': case 'H': case 'I': case 'L': case 'Q':
32781         return 'U';
32782     case 'f': case 'd': case 'g':
32783         return (is_complex ? 'C' : 'R');
32784     case 'O':
32785         return 'O';
32786     case 'P':
32787         return 'P';
32788     default: {
32789       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
32790       return 0;
32791     }
32792   }
32793 }
__Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context * ctx)32794 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
32795   if (ctx->head == NULL || ctx->head->field == &ctx->root) {
32796     const char* expected;
32797     const char* quote;
32798     if (ctx->head == NULL) {
32799       expected = "end";
32800       quote = "";
32801     } else {
32802       expected = ctx->head->field->type->name;
32803       quote = "'";
32804     }
32805     PyErr_Format(PyExc_ValueError,
32806                  "Buffer dtype mismatch, expected %s%s%s but got %s",
32807                  quote, expected, quote,
32808                  __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
32809   } else {
32810     __Pyx_StructField* field = ctx->head->field;
32811     __Pyx_StructField* parent = (ctx->head - 1)->field;
32812     PyErr_Format(PyExc_ValueError,
32813                  "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
32814                  field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
32815                  parent->type->name, field->name);
32816   }
32817 }
__Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context * ctx)32818 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
32819   char group;
32820   size_t size, offset, arraysize = 1;
32821   if (ctx->enc_type == 0) return 0;
32822   if (ctx->head->field->type->arraysize[0]) {
32823     int i, ndim = 0;
32824     if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
32825         ctx->is_valid_array = ctx->head->field->type->ndim == 1;
32826         ndim = 1;
32827         if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
32828             PyErr_Format(PyExc_ValueError,
32829                          "Expected a dimension of size %zu, got %zu",
32830                          ctx->head->field->type->arraysize[0], ctx->enc_count);
32831             return -1;
32832         }
32833     }
32834     if (!ctx->is_valid_array) {
32835       PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
32836                    ctx->head->field->type->ndim, ndim);
32837       return -1;
32838     }
32839     for (i = 0; i < ctx->head->field->type->ndim; i++) {
32840       arraysize *= ctx->head->field->type->arraysize[i];
32841     }
32842     ctx->is_valid_array = 0;
32843     ctx->enc_count = 1;
32844   }
32845   group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
32846   do {
32847     __Pyx_StructField* field = ctx->head->field;
32848     __Pyx_TypeInfo* type = field->type;
32849     if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
32850       size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
32851     } else {
32852       size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
32853     }
32854     if (ctx->enc_packmode == '@') {
32855       size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
32856       size_t align_mod_offset;
32857       if (align_at == 0) return -1;
32858       align_mod_offset = ctx->fmt_offset % align_at;
32859       if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
32860       if (ctx->struct_alignment == 0)
32861           ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
32862                                                                  ctx->is_complex);
32863     }
32864     if (type->size != size || type->typegroup != group) {
32865       if (type->typegroup == 'C' && type->fields != NULL) {
32866         size_t parent_offset = ctx->head->parent_offset + field->offset;
32867         ++ctx->head;
32868         ctx->head->field = type->fields;
32869         ctx->head->parent_offset = parent_offset;
32870         continue;
32871       }
32872       if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
32873       } else {
32874           __Pyx_BufFmt_RaiseExpected(ctx);
32875           return -1;
32876       }
32877     }
32878     offset = ctx->head->parent_offset + field->offset;
32879     if (ctx->fmt_offset != offset) {
32880       PyErr_Format(PyExc_ValueError,
32881                    "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
32882                    (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
32883       return -1;
32884     }
32885     ctx->fmt_offset += size;
32886     if (arraysize)
32887       ctx->fmt_offset += (arraysize - 1) * size;
32888     --ctx->enc_count;
32889     while (1) {
32890       if (field == &ctx->root) {
32891         ctx->head = NULL;
32892         if (ctx->enc_count != 0) {
32893           __Pyx_BufFmt_RaiseExpected(ctx);
32894           return -1;
32895         }
32896         break;
32897       }
32898       ctx->head->field = ++field;
32899       if (field->type == NULL) {
32900         --ctx->head;
32901         field = ctx->head->field;
32902         continue;
32903       } else if (field->type->typegroup == 'S') {
32904         size_t parent_offset = ctx->head->parent_offset + field->offset;
32905         if (field->type->fields->type == NULL) continue;
32906         field = field->type->fields;
32907         ++ctx->head;
32908         ctx->head->field = field;
32909         ctx->head->parent_offset = parent_offset;
32910         break;
32911       } else {
32912         break;
32913       }
32914     }
32915   } while (ctx->enc_count);
32916   ctx->enc_type = 0;
32917   ctx->is_complex = 0;
32918   return 0;
32919 }
32920 static PyObject *
__pyx_buffmt_parse_array(__Pyx_BufFmt_Context * ctx,const char ** tsp)32921 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
32922 {
32923     const char *ts = *tsp;
32924     int i = 0, number;
32925     int ndim = ctx->head->field->type->ndim;
32926 ;
32927     ++ts;
32928     if (ctx->new_count != 1) {
32929         PyErr_SetString(PyExc_ValueError,
32930                         "Cannot handle repeated arrays in format string");
32931         return NULL;
32932     }
32933     if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
32934     while (*ts && *ts != ')') {
32935         switch (*ts) {
32936             case ' ': case '\f': case '\r': case '\n': case '\t': case '\v':  continue;
32937             default:  break;
32938         }
32939         number = __Pyx_BufFmt_ExpectNumber(&ts);
32940         if (number == -1) return NULL;
32941         if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
32942             return PyErr_Format(PyExc_ValueError,
32943                         "Expected a dimension of size %zu, got %d",
32944                         ctx->head->field->type->arraysize[i], number);
32945         if (*ts != ',' && *ts != ')')
32946             return PyErr_Format(PyExc_ValueError,
32947                                 "Expected a comma in format string, got '%c'", *ts);
32948         if (*ts == ',') ts++;
32949         i++;
32950     }
32951     if (i != ndim)
32952         return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
32953                             ctx->head->field->type->ndim, i);
32954     if (!*ts) {
32955         PyErr_SetString(PyExc_ValueError,
32956                         "Unexpected end of format string, expected ')'");
32957         return NULL;
32958     }
32959     ctx->is_valid_array = 1;
32960     ctx->new_count = 1;
32961     *tsp = ++ts;
32962     return Py_None;
32963 }
__Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context * ctx,const char * ts)32964 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
32965   int got_Z = 0;
32966   while (1) {
32967     switch(*ts) {
32968       case 0:
32969         if (ctx->enc_type != 0 && ctx->head == NULL) {
32970           __Pyx_BufFmt_RaiseExpected(ctx);
32971           return NULL;
32972         }
32973         if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
32974         if (ctx->head != NULL) {
32975           __Pyx_BufFmt_RaiseExpected(ctx);
32976           return NULL;
32977         }
32978         return ts;
32979       case ' ':
32980       case '\r':
32981       case '\n':
32982         ++ts;
32983         break;
32984       case '<':
32985         if (!__Pyx_Is_Little_Endian()) {
32986           PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
32987           return NULL;
32988         }
32989         ctx->new_packmode = '=';
32990         ++ts;
32991         break;
32992       case '>':
32993       case '!':
32994         if (__Pyx_Is_Little_Endian()) {
32995           PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
32996           return NULL;
32997         }
32998         ctx->new_packmode = '=';
32999         ++ts;
33000         break;
33001       case '=':
33002       case '@':
33003       case '^':
33004         ctx->new_packmode = *ts++;
33005         break;
33006       case 'T':
33007         {
33008           const char* ts_after_sub;
33009           size_t i, struct_count = ctx->new_count;
33010           size_t struct_alignment = ctx->struct_alignment;
33011           ctx->new_count = 1;
33012           ++ts;
33013           if (*ts != '{') {
33014             PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
33015             return NULL;
33016           }
33017           if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
33018           ctx->enc_type = 0;
33019           ctx->enc_count = 0;
33020           ctx->struct_alignment = 0;
33021           ++ts;
33022           ts_after_sub = ts;
33023           for (i = 0; i != struct_count; ++i) {
33024             ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
33025             if (!ts_after_sub) return NULL;
33026           }
33027           ts = ts_after_sub;
33028           if (struct_alignment) ctx->struct_alignment = struct_alignment;
33029         }
33030         break;
33031       case '}':
33032         {
33033           size_t alignment = ctx->struct_alignment;
33034           ++ts;
33035           if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
33036           ctx->enc_type = 0;
33037           if (alignment && ctx->fmt_offset % alignment) {
33038             ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
33039           }
33040         }
33041         return ts;
33042       case 'x':
33043         if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
33044         ctx->fmt_offset += ctx->new_count;
33045         ctx->new_count = 1;
33046         ctx->enc_count = 0;
33047         ctx->enc_type = 0;
33048         ctx->enc_packmode = ctx->new_packmode;
33049         ++ts;
33050         break;
33051       case 'Z':
33052         got_Z = 1;
33053         ++ts;
33054         if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
33055           __Pyx_BufFmt_RaiseUnexpectedChar('Z');
33056           return NULL;
33057         }
33058         CYTHON_FALLTHROUGH;
33059       case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
33060       case 'l': case 'L': case 'q': case 'Q':
33061       case 'f': case 'd': case 'g':
33062       case 'O': case 'p':
33063         if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
33064             ctx->enc_packmode == ctx->new_packmode) {
33065           ctx->enc_count += ctx->new_count;
33066           ctx->new_count = 1;
33067           got_Z = 0;
33068           ++ts;
33069           break;
33070         }
33071         CYTHON_FALLTHROUGH;
33072       case 's':
33073         if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
33074         ctx->enc_count = ctx->new_count;
33075         ctx->enc_packmode = ctx->new_packmode;
33076         ctx->enc_type = *ts;
33077         ctx->is_complex = got_Z;
33078         ++ts;
33079         ctx->new_count = 1;
33080         got_Z = 0;
33081         break;
33082       case ':':
33083         ++ts;
33084         while(*ts != ':') ++ts;
33085         ++ts;
33086         break;
33087       case '(':
33088         if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
33089         break;
33090       default:
33091         {
33092           int number = __Pyx_BufFmt_ExpectNumber(&ts);
33093           if (number == -1) return NULL;
33094           ctx->new_count = (size_t)number;
33095         }
33096     }
33097   }
33098 }
33099 
33100 /* BufferGetAndValidate */
__Pyx_SafeReleaseBuffer(Py_buffer * info)33101   static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
33102   if (unlikely(info->buf == NULL)) return;
33103   if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
33104   __Pyx_ReleaseBuffer(info);
33105 }
__Pyx_ZeroBuffer(Py_buffer * buf)33106 static void __Pyx_ZeroBuffer(Py_buffer* buf) {
33107   buf->buf = NULL;
33108   buf->obj = NULL;
33109   buf->strides = __Pyx_zeros;
33110   buf->shape = __Pyx_zeros;
33111   buf->suboffsets = __Pyx_minusones;
33112 }
__Pyx__GetBufferAndValidate(Py_buffer * buf,PyObject * obj,__Pyx_TypeInfo * dtype,int flags,int nd,int cast,__Pyx_BufFmt_StackElem * stack)33113 static int __Pyx__GetBufferAndValidate(
33114         Py_buffer* buf, PyObject* obj,  __Pyx_TypeInfo* dtype, int flags,
33115         int nd, int cast, __Pyx_BufFmt_StackElem* stack)
33116 {
33117   buf->buf = NULL;
33118   if (unlikely(__Pyx_GetBuffer(obj, buf, flags) == -1)) {
33119     __Pyx_ZeroBuffer(buf);
33120     return -1;
33121   }
33122   if (unlikely(buf->ndim != nd)) {
33123     PyErr_Format(PyExc_ValueError,
33124                  "Buffer has wrong number of dimensions (expected %d, got %d)",
33125                  nd, buf->ndim);
33126     goto fail;
33127   }
33128   if (!cast) {
33129     __Pyx_BufFmt_Context ctx;
33130     __Pyx_BufFmt_Init(&ctx, stack, dtype);
33131     if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
33132   }
33133   if (unlikely((size_t)buf->itemsize != dtype->size)) {
33134     PyErr_Format(PyExc_ValueError,
33135       "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)",
33136       buf->itemsize, (buf->itemsize > 1) ? "s" : "",
33137       dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : "");
33138     goto fail;
33139   }
33140   if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
33141   return 0;
33142 fail:;
33143   __Pyx_SafeReleaseBuffer(buf);
33144   return -1;
33145 }
33146 
33147 /* PyErrFetchRestore */
33148   #if CYTHON_FAST_THREAD_STATE
__Pyx_ErrRestoreInState(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)33149 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
33150     PyObject *tmp_type, *tmp_value, *tmp_tb;
33151     tmp_type = tstate->curexc_type;
33152     tmp_value = tstate->curexc_value;
33153     tmp_tb = tstate->curexc_traceback;
33154     tstate->curexc_type = type;
33155     tstate->curexc_value = value;
33156     tstate->curexc_traceback = tb;
33157     Py_XDECREF(tmp_type);
33158     Py_XDECREF(tmp_value);
33159     Py_XDECREF(tmp_tb);
33160 }
__Pyx_ErrFetchInState(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)33161 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
33162     *type = tstate->curexc_type;
33163     *value = tstate->curexc_value;
33164     *tb = tstate->curexc_traceback;
33165     tstate->curexc_type = 0;
33166     tstate->curexc_value = 0;
33167     tstate->curexc_traceback = 0;
33168 }
33169 #endif
33170 
33171 /* WriteUnraisableException */
__Pyx_WriteUnraisable(const char * name,CYTHON_UNUSED int clineno,CYTHON_UNUSED int lineno,CYTHON_UNUSED const char * filename,int full_traceback,CYTHON_UNUSED int nogil)33172   static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
33173                                   CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
33174                                   int full_traceback, CYTHON_UNUSED int nogil) {
33175     PyObject *old_exc, *old_val, *old_tb;
33176     PyObject *ctx;
33177     __Pyx_PyThreadState_declare
33178 #ifdef WITH_THREAD
33179     PyGILState_STATE state;
33180     if (nogil)
33181         state = PyGILState_Ensure();
33182 #ifdef _MSC_VER
33183     else state = (PyGILState_STATE)-1;
33184 #endif
33185 #endif
33186     __Pyx_PyThreadState_assign
33187     __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
33188     if (full_traceback) {
33189         Py_XINCREF(old_exc);
33190         Py_XINCREF(old_val);
33191         Py_XINCREF(old_tb);
33192         __Pyx_ErrRestore(old_exc, old_val, old_tb);
33193         PyErr_PrintEx(1);
33194     }
33195     #if PY_MAJOR_VERSION < 3
33196     ctx = PyString_FromString(name);
33197     #else
33198     ctx = PyUnicode_FromString(name);
33199     #endif
33200     __Pyx_ErrRestore(old_exc, old_val, old_tb);
33201     if (!ctx) {
33202         PyErr_WriteUnraisable(Py_None);
33203     } else {
33204         PyErr_WriteUnraisable(ctx);
33205         Py_DECREF(ctx);
33206     }
33207 #ifdef WITH_THREAD
33208     if (nogil)
33209         PyGILState_Release(state);
33210 #endif
33211 }
33212 
33213 /* RaiseArgTupleInvalid */
__Pyx_RaiseArgtupleInvalid(const char * func_name,int exact,Py_ssize_t num_min,Py_ssize_t num_max,Py_ssize_t num_found)33214   static void __Pyx_RaiseArgtupleInvalid(
33215     const char* func_name,
33216     int exact,
33217     Py_ssize_t num_min,
33218     Py_ssize_t num_max,
33219     Py_ssize_t num_found)
33220 {
33221     Py_ssize_t num_expected;
33222     const char *more_or_less;
33223     if (num_found < num_min) {
33224         num_expected = num_min;
33225         more_or_less = "at least";
33226     } else {
33227         num_expected = num_max;
33228         more_or_less = "at most";
33229     }
33230     if (exact) {
33231         more_or_less = "exactly";
33232     }
33233     PyErr_Format(PyExc_TypeError,
33234                  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
33235                  func_name, more_or_less, num_expected,
33236                  (num_expected == 1) ? "" : "s", num_found);
33237 }
33238 
33239 /* RaiseDoubleKeywords */
__Pyx_RaiseDoubleKeywordsError(const char * func_name,PyObject * kw_name)33240   static void __Pyx_RaiseDoubleKeywordsError(
33241     const char* func_name,
33242     PyObject* kw_name)
33243 {
33244     PyErr_Format(PyExc_TypeError,
33245         #if PY_MAJOR_VERSION >= 3
33246         "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
33247         #else
33248         "%s() got multiple values for keyword argument '%s'", func_name,
33249         PyString_AsString(kw_name));
33250         #endif
33251 }
33252 
33253 /* ParseKeywords */
__Pyx_ParseOptionalKeywords(PyObject * kwds,PyObject ** argnames[],PyObject * kwds2,PyObject * values[],Py_ssize_t num_pos_args,const char * function_name)33254   static int __Pyx_ParseOptionalKeywords(
33255     PyObject *kwds,
33256     PyObject **argnames[],
33257     PyObject *kwds2,
33258     PyObject *values[],
33259     Py_ssize_t num_pos_args,
33260     const char* function_name)
33261 {
33262     PyObject *key = 0, *value = 0;
33263     Py_ssize_t pos = 0;
33264     PyObject*** name;
33265     PyObject*** first_kw_arg = argnames + num_pos_args;
33266     while (PyDict_Next(kwds, &pos, &key, &value)) {
33267         name = first_kw_arg;
33268         while (*name && (**name != key)) name++;
33269         if (*name) {
33270             values[name-argnames] = value;
33271             continue;
33272         }
33273         name = first_kw_arg;
33274         #if PY_MAJOR_VERSION < 3
33275         if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
33276             while (*name) {
33277                 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
33278                         && _PyString_Eq(**name, key)) {
33279                     values[name-argnames] = value;
33280                     break;
33281                 }
33282                 name++;
33283             }
33284             if (*name) continue;
33285             else {
33286                 PyObject*** argname = argnames;
33287                 while (argname != first_kw_arg) {
33288                     if ((**argname == key) || (
33289                             (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
33290                              && _PyString_Eq(**argname, key))) {
33291                         goto arg_passed_twice;
33292                     }
33293                     argname++;
33294                 }
33295             }
33296         } else
33297         #endif
33298         if (likely(PyUnicode_Check(key))) {
33299             while (*name) {
33300                 int cmp = (**name == key) ? 0 :
33301                 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
33302                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
33303                 #endif
33304                     PyUnicode_Compare(**name, key);
33305                 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
33306                 if (cmp == 0) {
33307                     values[name-argnames] = value;
33308                     break;
33309                 }
33310                 name++;
33311             }
33312             if (*name) continue;
33313             else {
33314                 PyObject*** argname = argnames;
33315                 while (argname != first_kw_arg) {
33316                     int cmp = (**argname == key) ? 0 :
33317                     #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
33318                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
33319                     #endif
33320                         PyUnicode_Compare(**argname, key);
33321                     if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
33322                     if (cmp == 0) goto arg_passed_twice;
33323                     argname++;
33324                 }
33325             }
33326         } else
33327             goto invalid_keyword_type;
33328         if (kwds2) {
33329             if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
33330         } else {
33331             goto invalid_keyword;
33332         }
33333     }
33334     return 0;
33335 arg_passed_twice:
33336     __Pyx_RaiseDoubleKeywordsError(function_name, key);
33337     goto bad;
33338 invalid_keyword_type:
33339     PyErr_Format(PyExc_TypeError,
33340         "%.200s() keywords must be strings", function_name);
33341     goto bad;
33342 invalid_keyword:
33343     PyErr_Format(PyExc_TypeError,
33344     #if PY_MAJOR_VERSION < 3
33345         "%.200s() got an unexpected keyword argument '%.200s'",
33346         function_name, PyString_AsString(key));
33347     #else
33348         "%s() got an unexpected keyword argument '%U'",
33349         function_name, key);
33350     #endif
33351 bad:
33352     return -1;
33353 }
33354 
33355 /* ArgTypeTest */
__Pyx__ArgTypeTest(PyObject * obj,PyTypeObject * type,const char * name,int exact)33356   static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
33357 {
33358     if (unlikely(!type)) {
33359         PyErr_SetString(PyExc_SystemError, "Missing type object");
33360         return 0;
33361     }
33362     else if (exact) {
33363         #if PY_MAJOR_VERSION == 2
33364         if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
33365         #endif
33366     }
33367     else {
33368         if (likely(__Pyx_TypeCheck(obj, type))) return 1;
33369     }
33370     PyErr_Format(PyExc_TypeError,
33371         "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
33372         name, type->tp_name, Py_TYPE(obj)->tp_name);
33373     return 0;
33374 }
33375 
33376 /* PyDictVersioning */
33377   #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
__Pyx_get_tp_dict_version(PyObject * obj)33378 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
33379     PyObject *dict = Py_TYPE(obj)->tp_dict;
33380     return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
33381 }
__Pyx_get_object_dict_version(PyObject * obj)33382 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
33383     PyObject **dictptr = NULL;
33384     Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
33385     if (offset) {
33386 #if CYTHON_COMPILING_IN_CPYTHON
33387         dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
33388 #else
33389         dictptr = _PyObject_GetDictPtr(obj);
33390 #endif
33391     }
33392     return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
33393 }
__Pyx_object_dict_version_matches(PyObject * obj,PY_UINT64_T tp_dict_version,PY_UINT64_T obj_dict_version)33394 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
33395     PyObject *dict = Py_TYPE(obj)->tp_dict;
33396     if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
33397         return 0;
33398     return obj_dict_version == __Pyx_get_object_dict_version(obj);
33399 }
33400 #endif
33401 
33402 /* GetModuleGlobalName */
33403   #if CYTHON_USE_DICT_VERSIONS
__Pyx__GetModuleGlobalName(PyObject * name,PY_UINT64_T * dict_version,PyObject ** dict_cached_value)33404 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
33405 #else
33406 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
33407 #endif
33408 {
33409     PyObject *result;
33410 #if !CYTHON_AVOID_BORROWED_REFS
33411 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
33412     result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
33413     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
33414     if (likely(result)) {
33415         return __Pyx_NewRef(result);
33416     } else if (unlikely(PyErr_Occurred())) {
33417         return NULL;
33418     }
33419 #else
33420     result = PyDict_GetItem(__pyx_d, name);
33421     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
33422     if (likely(result)) {
33423         return __Pyx_NewRef(result);
33424     }
33425 #endif
33426 #else
33427     result = PyObject_GetItem(__pyx_d, name);
33428     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
33429     if (likely(result)) {
33430         return __Pyx_NewRef(result);
33431     }
33432     PyErr_Clear();
33433 #endif
33434     return __Pyx_GetBuiltinName(name);
33435 }
33436 
33437 /* PyObjectCall */
33438   #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_Call(PyObject * func,PyObject * arg,PyObject * kw)33439 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
33440     PyObject *result;
33441     ternaryfunc call = func->ob_type->tp_call;
33442     if (unlikely(!call))
33443         return PyObject_Call(func, arg, kw);
33444     if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
33445         return NULL;
33446     result = (*call)(func, arg, kw);
33447     Py_LeaveRecursiveCall();
33448     if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
33449         PyErr_SetString(
33450             PyExc_SystemError,
33451             "NULL result without error in PyObject_Call");
33452     }
33453     return result;
33454 }
33455 #endif
33456 
33457 /* ExtTypeTest */
__Pyx_TypeTest(PyObject * obj,PyTypeObject * type)33458   static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
33459     if (unlikely(!type)) {
33460         PyErr_SetString(PyExc_SystemError, "Missing type object");
33461         return 0;
33462     }
33463     if (likely(__Pyx_TypeCheck(obj, type)))
33464         return 1;
33465     PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
33466                  Py_TYPE(obj)->tp_name, type->tp_name);
33467     return 0;
33468 }
33469 
33470 /* BufferFallbackError */
__Pyx_RaiseBufferFallbackError(void)33471   static void __Pyx_RaiseBufferFallbackError(void) {
33472   PyErr_SetString(PyExc_ValueError,
33473      "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!");
33474 }
33475 
33476 /* GetItemInt */
__Pyx_GetItemInt_Generic(PyObject * o,PyObject * j)33477   static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
33478     PyObject *r;
33479     if (!j) return NULL;
33480     r = PyObject_GetItem(o, j);
33481     Py_DECREF(j);
33482     return r;
33483 }
__Pyx_GetItemInt_List_Fast(PyObject * o,Py_ssize_t i,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)33484 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
33485                                                               CYTHON_NCP_UNUSED int wraparound,
33486                                                               CYTHON_NCP_UNUSED int boundscheck) {
33487 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
33488     Py_ssize_t wrapped_i = i;
33489     if (wraparound & unlikely(i < 0)) {
33490         wrapped_i += PyList_GET_SIZE(o);
33491     }
33492     if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
33493         PyObject *r = PyList_GET_ITEM(o, wrapped_i);
33494         Py_INCREF(r);
33495         return r;
33496     }
33497     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
33498 #else
33499     return PySequence_GetItem(o, i);
33500 #endif
33501 }
__Pyx_GetItemInt_Tuple_Fast(PyObject * o,Py_ssize_t i,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)33502 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
33503                                                               CYTHON_NCP_UNUSED int wraparound,
33504                                                               CYTHON_NCP_UNUSED int boundscheck) {
33505 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
33506     Py_ssize_t wrapped_i = i;
33507     if (wraparound & unlikely(i < 0)) {
33508         wrapped_i += PyTuple_GET_SIZE(o);
33509     }
33510     if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
33511         PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
33512         Py_INCREF(r);
33513         return r;
33514     }
33515     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
33516 #else
33517     return PySequence_GetItem(o, i);
33518 #endif
33519 }
__Pyx_GetItemInt_Fast(PyObject * o,Py_ssize_t i,int is_list,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)33520 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
33521                                                      CYTHON_NCP_UNUSED int wraparound,
33522                                                      CYTHON_NCP_UNUSED int boundscheck) {
33523 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
33524     if (is_list || PyList_CheckExact(o)) {
33525         Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
33526         if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
33527             PyObject *r = PyList_GET_ITEM(o, n);
33528             Py_INCREF(r);
33529             return r;
33530         }
33531     }
33532     else if (PyTuple_CheckExact(o)) {
33533         Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
33534         if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
33535             PyObject *r = PyTuple_GET_ITEM(o, n);
33536             Py_INCREF(r);
33537             return r;
33538         }
33539     } else {
33540         PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
33541         if (likely(m && m->sq_item)) {
33542             if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
33543                 Py_ssize_t l = m->sq_length(o);
33544                 if (likely(l >= 0)) {
33545                     i += l;
33546                 } else {
33547                     if (!PyErr_ExceptionMatches(PyExc_OverflowError))
33548                         return NULL;
33549                     PyErr_Clear();
33550                 }
33551             }
33552             return m->sq_item(o, i);
33553         }
33554     }
33555 #else
33556     if (is_list || PySequence_Check(o)) {
33557         return PySequence_GetItem(o, i);
33558     }
33559 #endif
33560     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
33561 }
33562 
33563 /* ObjectGetItem */
33564   #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetIndex(PyObject * obj,PyObject * index)33565 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
33566     PyObject *runerr;
33567     Py_ssize_t key_value;
33568     PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
33569     if (unlikely(!(m && m->sq_item))) {
33570         PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
33571         return NULL;
33572     }
33573     key_value = __Pyx_PyIndex_AsSsize_t(index);
33574     if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
33575         return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
33576     }
33577     if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
33578         PyErr_Clear();
33579         PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
33580     }
33581     return NULL;
33582 }
__Pyx_PyObject_GetItem(PyObject * obj,PyObject * key)33583 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
33584     PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
33585     if (likely(m && m->mp_subscript)) {
33586         return m->mp_subscript(obj, key);
33587     }
33588     return __Pyx_PyObject_GetIndex(obj, key);
33589 }
33590 #endif
33591 
33592 /* RaiseException */
33593   #if PY_MAJOR_VERSION < 3
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,CYTHON_UNUSED PyObject * cause)33594 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
33595                         CYTHON_UNUSED PyObject *cause) {
33596     __Pyx_PyThreadState_declare
33597     Py_XINCREF(type);
33598     if (!value || value == Py_None)
33599         value = NULL;
33600     else
33601         Py_INCREF(value);
33602     if (!tb || tb == Py_None)
33603         tb = NULL;
33604     else {
33605         Py_INCREF(tb);
33606         if (!PyTraceBack_Check(tb)) {
33607             PyErr_SetString(PyExc_TypeError,
33608                 "raise: arg 3 must be a traceback or None");
33609             goto raise_error;
33610         }
33611     }
33612     if (PyType_Check(type)) {
33613 #if CYTHON_COMPILING_IN_PYPY
33614         if (!value) {
33615             Py_INCREF(Py_None);
33616             value = Py_None;
33617         }
33618 #endif
33619         PyErr_NormalizeException(&type, &value, &tb);
33620     } else {
33621         if (value) {
33622             PyErr_SetString(PyExc_TypeError,
33623                 "instance exception may not have a separate value");
33624             goto raise_error;
33625         }
33626         value = type;
33627         type = (PyObject*) Py_TYPE(type);
33628         Py_INCREF(type);
33629         if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
33630             PyErr_SetString(PyExc_TypeError,
33631                 "raise: exception class must be a subclass of BaseException");
33632             goto raise_error;
33633         }
33634     }
33635     __Pyx_PyThreadState_assign
33636     __Pyx_ErrRestore(type, value, tb);
33637     return;
33638 raise_error:
33639     Py_XDECREF(value);
33640     Py_XDECREF(type);
33641     Py_XDECREF(tb);
33642     return;
33643 }
33644 #else
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,PyObject * cause)33645 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
33646     PyObject* owned_instance = NULL;
33647     if (tb == Py_None) {
33648         tb = 0;
33649     } else if (tb && !PyTraceBack_Check(tb)) {
33650         PyErr_SetString(PyExc_TypeError,
33651             "raise: arg 3 must be a traceback or None");
33652         goto bad;
33653     }
33654     if (value == Py_None)
33655         value = 0;
33656     if (PyExceptionInstance_Check(type)) {
33657         if (value) {
33658             PyErr_SetString(PyExc_TypeError,
33659                 "instance exception may not have a separate value");
33660             goto bad;
33661         }
33662         value = type;
33663         type = (PyObject*) Py_TYPE(value);
33664     } else if (PyExceptionClass_Check(type)) {
33665         PyObject *instance_class = NULL;
33666         if (value && PyExceptionInstance_Check(value)) {
33667             instance_class = (PyObject*) Py_TYPE(value);
33668             if (instance_class != type) {
33669                 int is_subclass = PyObject_IsSubclass(instance_class, type);
33670                 if (!is_subclass) {
33671                     instance_class = NULL;
33672                 } else if (unlikely(is_subclass == -1)) {
33673                     goto bad;
33674                 } else {
33675                     type = instance_class;
33676                 }
33677             }
33678         }
33679         if (!instance_class) {
33680             PyObject *args;
33681             if (!value)
33682                 args = PyTuple_New(0);
33683             else if (PyTuple_Check(value)) {
33684                 Py_INCREF(value);
33685                 args = value;
33686             } else
33687                 args = PyTuple_Pack(1, value);
33688             if (!args)
33689                 goto bad;
33690             owned_instance = PyObject_Call(type, args, NULL);
33691             Py_DECREF(args);
33692             if (!owned_instance)
33693                 goto bad;
33694             value = owned_instance;
33695             if (!PyExceptionInstance_Check(value)) {
33696                 PyErr_Format(PyExc_TypeError,
33697                              "calling %R should have returned an instance of "
33698                              "BaseException, not %R",
33699                              type, Py_TYPE(value));
33700                 goto bad;
33701             }
33702         }
33703     } else {
33704         PyErr_SetString(PyExc_TypeError,
33705             "raise: exception class must be a subclass of BaseException");
33706         goto bad;
33707     }
33708     if (cause) {
33709         PyObject *fixed_cause;
33710         if (cause == Py_None) {
33711             fixed_cause = NULL;
33712         } else if (PyExceptionClass_Check(cause)) {
33713             fixed_cause = PyObject_CallObject(cause, NULL);
33714             if (fixed_cause == NULL)
33715                 goto bad;
33716         } else if (PyExceptionInstance_Check(cause)) {
33717             fixed_cause = cause;
33718             Py_INCREF(fixed_cause);
33719         } else {
33720             PyErr_SetString(PyExc_TypeError,
33721                             "exception causes must derive from "
33722                             "BaseException");
33723             goto bad;
33724         }
33725         PyException_SetCause(value, fixed_cause);
33726     }
33727     PyErr_SetObject(type, value);
33728     if (tb) {
33729 #if CYTHON_COMPILING_IN_PYPY
33730         PyObject *tmp_type, *tmp_value, *tmp_tb;
33731         PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
33732         Py_INCREF(tb);
33733         PyErr_Restore(tmp_type, tmp_value, tb);
33734         Py_XDECREF(tmp_tb);
33735 #else
33736         PyThreadState *tstate = __Pyx_PyThreadState_Current;
33737         PyObject* tmp_tb = tstate->curexc_traceback;
33738         if (tb != tmp_tb) {
33739             Py_INCREF(tb);
33740             tstate->curexc_traceback = tb;
33741             Py_XDECREF(tmp_tb);
33742         }
33743 #endif
33744     }
33745 bad:
33746     Py_XDECREF(owned_instance);
33747     return;
33748 }
33749 #endif
33750 
33751 /* KeywordStringCheck */
__Pyx_CheckKeywordStrings(PyObject * kwdict,const char * function_name,int kw_allowed)33752   static int __Pyx_CheckKeywordStrings(
33753     PyObject *kwdict,
33754     const char* function_name,
33755     int kw_allowed)
33756 {
33757     PyObject* key = 0;
33758     Py_ssize_t pos = 0;
33759 #if CYTHON_COMPILING_IN_PYPY
33760     if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
33761         goto invalid_keyword;
33762     return 1;
33763 #else
33764     while (PyDict_Next(kwdict, &pos, &key, 0)) {
33765         #if PY_MAJOR_VERSION < 3
33766         if (unlikely(!PyString_Check(key)))
33767         #endif
33768             if (unlikely(!PyUnicode_Check(key)))
33769                 goto invalid_keyword_type;
33770     }
33771     if ((!kw_allowed) && unlikely(key))
33772         goto invalid_keyword;
33773     return 1;
33774 invalid_keyword_type:
33775     PyErr_Format(PyExc_TypeError,
33776         "%.200s() keywords must be strings", function_name);
33777     return 0;
33778 #endif
33779 invalid_keyword:
33780     PyErr_Format(PyExc_TypeError,
33781     #if PY_MAJOR_VERSION < 3
33782         "%.200s() got an unexpected keyword argument '%.200s'",
33783         function_name, PyString_AsString(key));
33784     #else
33785         "%s() got an unexpected keyword argument '%U'",
33786         function_name, key);
33787     #endif
33788     return 0;
33789 }
33790 
33791 /* PyCFunctionFastCall */
33792   #if CYTHON_FAST_PYCCALL
__Pyx_PyCFunction_FastCall(PyObject * func_obj,PyObject ** args,Py_ssize_t nargs)33793 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
33794     PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
33795     PyCFunction meth = PyCFunction_GET_FUNCTION(func);
33796     PyObject *self = PyCFunction_GET_SELF(func);
33797     int flags = PyCFunction_GET_FLAGS(func);
33798     assert(PyCFunction_Check(func));
33799     assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
33800     assert(nargs >= 0);
33801     assert(nargs == 0 || args != NULL);
33802     /* _PyCFunction_FastCallDict() must not be called with an exception set,
33803        because it may clear it (directly or indirectly) and so the
33804        caller loses its exception */
33805     assert(!PyErr_Occurred());
33806     if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
33807         return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
33808     } else {
33809         return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
33810     }
33811 }
33812 #endif
33813 
33814 /* PyFunctionFastCall */
33815   #if CYTHON_FAST_PYCALL
__Pyx_PyFunction_FastCallNoKw(PyCodeObject * co,PyObject ** args,Py_ssize_t na,PyObject * globals)33816 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
33817                                                PyObject *globals) {
33818     PyFrameObject *f;
33819     PyThreadState *tstate = __Pyx_PyThreadState_Current;
33820     PyObject **fastlocals;
33821     Py_ssize_t i;
33822     PyObject *result;
33823     assert(globals != NULL);
33824     /* XXX Perhaps we should create a specialized
33825        PyFrame_New() that doesn't take locals, but does
33826        take builtins without sanity checking them.
33827        */
33828     assert(tstate != NULL);
33829     f = PyFrame_New(tstate, co, globals, NULL);
33830     if (f == NULL) {
33831         return NULL;
33832     }
33833     fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
33834     for (i = 0; i < na; i++) {
33835         Py_INCREF(*args);
33836         fastlocals[i] = *args++;
33837     }
33838     result = PyEval_EvalFrameEx(f,0);
33839     ++tstate->recursion_depth;
33840     Py_DECREF(f);
33841     --tstate->recursion_depth;
33842     return result;
33843 }
33844 #if 1 || PY_VERSION_HEX < 0x030600B1
__Pyx_PyFunction_FastCallDict(PyObject * func,PyObject ** args,Py_ssize_t nargs,PyObject * kwargs)33845 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
33846     PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
33847     PyObject *globals = PyFunction_GET_GLOBALS(func);
33848     PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
33849     PyObject *closure;
33850 #if PY_MAJOR_VERSION >= 3
33851     PyObject *kwdefs;
33852 #endif
33853     PyObject *kwtuple, **k;
33854     PyObject **d;
33855     Py_ssize_t nd;
33856     Py_ssize_t nk;
33857     PyObject *result;
33858     assert(kwargs == NULL || PyDict_Check(kwargs));
33859     nk = kwargs ? PyDict_Size(kwargs) : 0;
33860     if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
33861         return NULL;
33862     }
33863     if (
33864 #if PY_MAJOR_VERSION >= 3
33865             co->co_kwonlyargcount == 0 &&
33866 #endif
33867             likely(kwargs == NULL || nk == 0) &&
33868             co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
33869         if (argdefs == NULL && co->co_argcount == nargs) {
33870             result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
33871             goto done;
33872         }
33873         else if (nargs == 0 && argdefs != NULL
33874                  && co->co_argcount == Py_SIZE(argdefs)) {
33875             /* function called with no arguments, but all parameters have
33876                a default value: use default values as arguments .*/
33877             args = &PyTuple_GET_ITEM(argdefs, 0);
33878             result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
33879             goto done;
33880         }
33881     }
33882     if (kwargs != NULL) {
33883         Py_ssize_t pos, i;
33884         kwtuple = PyTuple_New(2 * nk);
33885         if (kwtuple == NULL) {
33886             result = NULL;
33887             goto done;
33888         }
33889         k = &PyTuple_GET_ITEM(kwtuple, 0);
33890         pos = i = 0;
33891         while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
33892             Py_INCREF(k[i]);
33893             Py_INCREF(k[i+1]);
33894             i += 2;
33895         }
33896         nk = i / 2;
33897     }
33898     else {
33899         kwtuple = NULL;
33900         k = NULL;
33901     }
33902     closure = PyFunction_GET_CLOSURE(func);
33903 #if PY_MAJOR_VERSION >= 3
33904     kwdefs = PyFunction_GET_KW_DEFAULTS(func);
33905 #endif
33906     if (argdefs != NULL) {
33907         d = &PyTuple_GET_ITEM(argdefs, 0);
33908         nd = Py_SIZE(argdefs);
33909     }
33910     else {
33911         d = NULL;
33912         nd = 0;
33913     }
33914 #if PY_MAJOR_VERSION >= 3
33915     result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
33916                                args, (int)nargs,
33917                                k, (int)nk,
33918                                d, (int)nd, kwdefs, closure);
33919 #else
33920     result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
33921                                args, (int)nargs,
33922                                k, (int)nk,
33923                                d, (int)nd, closure);
33924 #endif
33925     Py_XDECREF(kwtuple);
33926 done:
33927     Py_LeaveRecursiveCall();
33928     return result;
33929 }
33930 #endif
33931 #endif
33932 
33933 /* PyObjectCall2Args */
__Pyx_PyObject_Call2Args(PyObject * function,PyObject * arg1,PyObject * arg2)33934   static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
33935     PyObject *args, *result = NULL;
33936     #if CYTHON_FAST_PYCALL
33937     if (PyFunction_Check(function)) {
33938         PyObject *args[2] = {arg1, arg2};
33939         return __Pyx_PyFunction_FastCall(function, args, 2);
33940     }
33941     #endif
33942     #if CYTHON_FAST_PYCCALL
33943     if (__Pyx_PyFastCFunction_Check(function)) {
33944         PyObject *args[2] = {arg1, arg2};
33945         return __Pyx_PyCFunction_FastCall(function, args, 2);
33946     }
33947     #endif
33948     args = PyTuple_New(2);
33949     if (unlikely(!args)) goto done;
33950     Py_INCREF(arg1);
33951     PyTuple_SET_ITEM(args, 0, arg1);
33952     Py_INCREF(arg2);
33953     PyTuple_SET_ITEM(args, 1, arg2);
33954     Py_INCREF(function);
33955     result = __Pyx_PyObject_Call(function, args, NULL);
33956     Py_DECREF(args);
33957     Py_DECREF(function);
33958 done:
33959     return result;
33960 }
33961 
33962 /* PyObjectCallMethO */
33963   #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_CallMethO(PyObject * func,PyObject * arg)33964 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
33965     PyObject *self, *result;
33966     PyCFunction cfunc;
33967     cfunc = PyCFunction_GET_FUNCTION(func);
33968     self = PyCFunction_GET_SELF(func);
33969     if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
33970         return NULL;
33971     result = cfunc(self, arg);
33972     Py_LeaveRecursiveCall();
33973     if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
33974         PyErr_SetString(
33975             PyExc_SystemError,
33976             "NULL result without error in PyObject_Call");
33977     }
33978     return result;
33979 }
33980 #endif
33981 
33982 /* PyObjectCallOneArg */
33983   #if CYTHON_COMPILING_IN_CPYTHON
__Pyx__PyObject_CallOneArg(PyObject * func,PyObject * arg)33984 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
33985     PyObject *result;
33986     PyObject *args = PyTuple_New(1);
33987     if (unlikely(!args)) return NULL;
33988     Py_INCREF(arg);
33989     PyTuple_SET_ITEM(args, 0, arg);
33990     result = __Pyx_PyObject_Call(func, args, NULL);
33991     Py_DECREF(args);
33992     return result;
33993 }
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)33994 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
33995 #if CYTHON_FAST_PYCALL
33996     if (PyFunction_Check(func)) {
33997         return __Pyx_PyFunction_FastCall(func, &arg, 1);
33998     }
33999 #endif
34000     if (likely(PyCFunction_Check(func))) {
34001         if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
34002             return __Pyx_PyObject_CallMethO(func, arg);
34003 #if CYTHON_FAST_PYCCALL
34004         } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
34005             return __Pyx_PyCFunction_FastCall(func, &arg, 1);
34006 #endif
34007         }
34008     }
34009     return __Pyx__PyObject_CallOneArg(func, arg);
34010 }
34011 #else
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)34012 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
34013     PyObject *result;
34014     PyObject *args = PyTuple_Pack(1, arg);
34015     if (unlikely(!args)) return NULL;
34016     result = __Pyx_PyObject_Call(func, args, NULL);
34017     Py_DECREF(args);
34018     return result;
34019 }
34020 #endif
34021 
34022 /* RaiseTooManyValuesToUnpack */
__Pyx_RaiseTooManyValuesError(Py_ssize_t expected)34023   static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
34024     PyErr_Format(PyExc_ValueError,
34025                  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
34026 }
34027 
34028 /* RaiseNeedMoreValuesToUnpack */
__Pyx_RaiseNeedMoreValuesError(Py_ssize_t index)34029   static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
34030     PyErr_Format(PyExc_ValueError,
34031                  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
34032                  index, (index == 1) ? "" : "s");
34033 }
34034 
34035 /* IterFinish */
__Pyx_IterFinish(void)34036   static CYTHON_INLINE int __Pyx_IterFinish(void) {
34037 #if CYTHON_FAST_THREAD_STATE
34038     PyThreadState *tstate = __Pyx_PyThreadState_Current;
34039     PyObject* exc_type = tstate->curexc_type;
34040     if (unlikely(exc_type)) {
34041         if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
34042             PyObject *exc_value, *exc_tb;
34043             exc_value = tstate->curexc_value;
34044             exc_tb = tstate->curexc_traceback;
34045             tstate->curexc_type = 0;
34046             tstate->curexc_value = 0;
34047             tstate->curexc_traceback = 0;
34048             Py_DECREF(exc_type);
34049             Py_XDECREF(exc_value);
34050             Py_XDECREF(exc_tb);
34051             return 0;
34052         } else {
34053             return -1;
34054         }
34055     }
34056     return 0;
34057 #else
34058     if (unlikely(PyErr_Occurred())) {
34059         if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
34060             PyErr_Clear();
34061             return 0;
34062         } else {
34063             return -1;
34064         }
34065     }
34066     return 0;
34067 #endif
34068 }
34069 
34070 /* UnpackItemEndCheck */
__Pyx_IternextUnpackEndCheck(PyObject * retval,Py_ssize_t expected)34071   static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
34072     if (unlikely(retval)) {
34073         Py_DECREF(retval);
34074         __Pyx_RaiseTooManyValuesError(expected);
34075         return -1;
34076     } else {
34077         return __Pyx_IterFinish();
34078     }
34079     return 0;
34080 }
34081 
34082 /* SliceObject */
__Pyx_PyObject_GetSlice(PyObject * obj,Py_ssize_t cstart,Py_ssize_t cstop,PyObject ** _py_start,PyObject ** _py_stop,PyObject ** _py_slice,int has_cstart,int has_cstop,CYTHON_UNUSED int wraparound)34083   static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
34084         Py_ssize_t cstart, Py_ssize_t cstop,
34085         PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
34086         int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
34087 #if CYTHON_USE_TYPE_SLOTS
34088     PyMappingMethods* mp;
34089 #if PY_MAJOR_VERSION < 3
34090     PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
34091     if (likely(ms && ms->sq_slice)) {
34092         if (!has_cstart) {
34093             if (_py_start && (*_py_start != Py_None)) {
34094                 cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
34095                 if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
34096             } else
34097                 cstart = 0;
34098         }
34099         if (!has_cstop) {
34100             if (_py_stop && (*_py_stop != Py_None)) {
34101                 cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
34102                 if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
34103             } else
34104                 cstop = PY_SSIZE_T_MAX;
34105         }
34106         if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
34107             Py_ssize_t l = ms->sq_length(obj);
34108             if (likely(l >= 0)) {
34109                 if (cstop < 0) {
34110                     cstop += l;
34111                     if (cstop < 0) cstop = 0;
34112                 }
34113                 if (cstart < 0) {
34114                     cstart += l;
34115                     if (cstart < 0) cstart = 0;
34116                 }
34117             } else {
34118                 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
34119                     goto bad;
34120                 PyErr_Clear();
34121             }
34122         }
34123         return ms->sq_slice(obj, cstart, cstop);
34124     }
34125 #endif
34126     mp = Py_TYPE(obj)->tp_as_mapping;
34127     if (likely(mp && mp->mp_subscript))
34128 #endif
34129     {
34130         PyObject* result;
34131         PyObject *py_slice, *py_start, *py_stop;
34132         if (_py_slice) {
34133             py_slice = *_py_slice;
34134         } else {
34135             PyObject* owned_start = NULL;
34136             PyObject* owned_stop = NULL;
34137             if (_py_start) {
34138                 py_start = *_py_start;
34139             } else {
34140                 if (has_cstart) {
34141                     owned_start = py_start = PyInt_FromSsize_t(cstart);
34142                     if (unlikely(!py_start)) goto bad;
34143                 } else
34144                     py_start = Py_None;
34145             }
34146             if (_py_stop) {
34147                 py_stop = *_py_stop;
34148             } else {
34149                 if (has_cstop) {
34150                     owned_stop = py_stop = PyInt_FromSsize_t(cstop);
34151                     if (unlikely(!py_stop)) {
34152                         Py_XDECREF(owned_start);
34153                         goto bad;
34154                     }
34155                 } else
34156                     py_stop = Py_None;
34157             }
34158             py_slice = PySlice_New(py_start, py_stop, Py_None);
34159             Py_XDECREF(owned_start);
34160             Py_XDECREF(owned_stop);
34161             if (unlikely(!py_slice)) goto bad;
34162         }
34163 #if CYTHON_USE_TYPE_SLOTS
34164         result = mp->mp_subscript(obj, py_slice);
34165 #else
34166         result = PyObject_GetItem(obj, py_slice);
34167 #endif
34168         if (!_py_slice) {
34169             Py_DECREF(py_slice);
34170         }
34171         return result;
34172     }
34173     PyErr_Format(PyExc_TypeError,
34174         "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
34175 bad:
34176     return NULL;
34177 }
34178 
34179 /* MemviewSliceInit */
34180   static int
__Pyx_init_memviewslice(struct __pyx_memoryview_obj * memview,int ndim,__Pyx_memviewslice * memviewslice,int memview_is_new_reference)34181 __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
34182                         int ndim,
34183                         __Pyx_memviewslice *memviewslice,
34184                         int memview_is_new_reference)
34185 {
34186     __Pyx_RefNannyDeclarations
34187     int i, retval=-1;
34188     Py_buffer *buf = &memview->view;
34189     __Pyx_RefNannySetupContext("init_memviewslice", 0);
34190     if (memviewslice->memview || memviewslice->data) {
34191         PyErr_SetString(PyExc_ValueError,
34192             "memviewslice is already initialized!");
34193         goto fail;
34194     }
34195     if (buf->strides) {
34196         for (i = 0; i < ndim; i++) {
34197             memviewslice->strides[i] = buf->strides[i];
34198         }
34199     } else {
34200         Py_ssize_t stride = buf->itemsize;
34201         for (i = ndim - 1; i >= 0; i--) {
34202             memviewslice->strides[i] = stride;
34203             stride *= buf->shape[i];
34204         }
34205     }
34206     for (i = 0; i < ndim; i++) {
34207         memviewslice->shape[i]   = buf->shape[i];
34208         if (buf->suboffsets) {
34209             memviewslice->suboffsets[i] = buf->suboffsets[i];
34210         } else {
34211             memviewslice->suboffsets[i] = -1;
34212         }
34213     }
34214     memviewslice->memview = memview;
34215     memviewslice->data = (char *)buf->buf;
34216     if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
34217         Py_INCREF(memview);
34218     }
34219     retval = 0;
34220     goto no_fail;
34221 fail:
34222     memviewslice->memview = 0;
34223     memviewslice->data = 0;
34224     retval = -1;
34225 no_fail:
34226     __Pyx_RefNannyFinishContext();
34227     return retval;
34228 }
34229 #ifndef Py_NO_RETURN
34230 #define Py_NO_RETURN
34231 #endif
__pyx_fatalerror(const char * fmt,...)34232 static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
34233     va_list vargs;
34234     char msg[200];
34235 #ifdef HAVE_STDARG_PROTOTYPES
34236     va_start(vargs, fmt);
34237 #else
34238     va_start(vargs);
34239 #endif
34240     vsnprintf(msg, 200, fmt, vargs);
34241     va_end(vargs);
34242     Py_FatalError(msg);
34243 }
34244 static CYTHON_INLINE int
__pyx_add_acquisition_count_locked(__pyx_atomic_int * acquisition_count,PyThread_type_lock lock)34245 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
34246                                    PyThread_type_lock lock)
34247 {
34248     int result;
34249     PyThread_acquire_lock(lock, 1);
34250     result = (*acquisition_count)++;
34251     PyThread_release_lock(lock);
34252     return result;
34253 }
34254 static CYTHON_INLINE int
__pyx_sub_acquisition_count_locked(__pyx_atomic_int * acquisition_count,PyThread_type_lock lock)34255 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
34256                                    PyThread_type_lock lock)
34257 {
34258     int result;
34259     PyThread_acquire_lock(lock, 1);
34260     result = (*acquisition_count)--;
34261     PyThread_release_lock(lock);
34262     return result;
34263 }
34264 static CYTHON_INLINE void
__Pyx_INC_MEMVIEW(__Pyx_memviewslice * memslice,int have_gil,int lineno)34265 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
34266 {
34267     int first_time;
34268     struct __pyx_memoryview_obj *memview = memslice->memview;
34269     if (!memview || (PyObject *) memview == Py_None)
34270         return;
34271     if (__pyx_get_slice_count(memview) < 0)
34272         __pyx_fatalerror("Acquisition count is %d (line %d)",
34273                          __pyx_get_slice_count(memview), lineno);
34274     first_time = __pyx_add_acquisition_count(memview) == 0;
34275     if (first_time) {
34276         if (have_gil) {
34277             Py_INCREF((PyObject *) memview);
34278         } else {
34279             PyGILState_STATE _gilstate = PyGILState_Ensure();
34280             Py_INCREF((PyObject *) memview);
34281             PyGILState_Release(_gilstate);
34282         }
34283     }
34284 }
__Pyx_XDEC_MEMVIEW(__Pyx_memviewslice * memslice,int have_gil,int lineno)34285 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
34286                                              int have_gil, int lineno) {
34287     int last_time;
34288     struct __pyx_memoryview_obj *memview = memslice->memview;
34289     if (!memview ) {
34290         return;
34291     } else if ((PyObject *) memview == Py_None) {
34292         memslice->memview = NULL;
34293         return;
34294     }
34295     if (__pyx_get_slice_count(memview) <= 0)
34296         __pyx_fatalerror("Acquisition count is %d (line %d)",
34297                          __pyx_get_slice_count(memview), lineno);
34298     last_time = __pyx_sub_acquisition_count(memview) == 1;
34299     memslice->data = NULL;
34300     if (last_time) {
34301         if (have_gil) {
34302             Py_CLEAR(memslice->memview);
34303         } else {
34304             PyGILState_STATE _gilstate = PyGILState_Ensure();
34305             Py_CLEAR(memslice->memview);
34306             PyGILState_Release(_gilstate);
34307         }
34308     } else {
34309         memslice->memview = NULL;
34310     }
34311 }
34312 
34313 /* DictGetItem */
34314   #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
__Pyx_PyDict_GetItem(PyObject * d,PyObject * key)34315 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
34316     PyObject *value;
34317     value = PyDict_GetItemWithError(d, key);
34318     if (unlikely(!value)) {
34319         if (!PyErr_Occurred()) {
34320             if (unlikely(PyTuple_Check(key))) {
34321                 PyObject* args = PyTuple_Pack(1, key);
34322                 if (likely(args)) {
34323                     PyErr_SetObject(PyExc_KeyError, args);
34324                     Py_DECREF(args);
34325                 }
34326             } else {
34327                 PyErr_SetObject(PyExc_KeyError, key);
34328             }
34329         }
34330         return NULL;
34331     }
34332     Py_INCREF(value);
34333     return value;
34334 }
34335 #endif
34336 
34337 /* RaiseNoneIterError */
__Pyx_RaiseNoneNotIterableError(void)34338   static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
34339     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
34340 }
34341 
34342 /* GetTopmostException */
34343   #if CYTHON_USE_EXC_INFO_STACK
34344 static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState * tstate)34345 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
34346 {
34347     _PyErr_StackItem *exc_info = tstate->exc_info;
34348     while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
34349            exc_info->previous_item != NULL)
34350     {
34351         exc_info = exc_info->previous_item;
34352     }
34353     return exc_info;
34354 }
34355 #endif
34356 
34357 /* SaveResetException */
34358   #if CYTHON_FAST_THREAD_STATE
__Pyx__ExceptionSave(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)34359 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
34360     #if CYTHON_USE_EXC_INFO_STACK
34361     _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
34362     *type = exc_info->exc_type;
34363     *value = exc_info->exc_value;
34364     *tb = exc_info->exc_traceback;
34365     #else
34366     *type = tstate->exc_type;
34367     *value = tstate->exc_value;
34368     *tb = tstate->exc_traceback;
34369     #endif
34370     Py_XINCREF(*type);
34371     Py_XINCREF(*value);
34372     Py_XINCREF(*tb);
34373 }
__Pyx__ExceptionReset(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)34374 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
34375     PyObject *tmp_type, *tmp_value, *tmp_tb;
34376     #if CYTHON_USE_EXC_INFO_STACK
34377     _PyErr_StackItem *exc_info = tstate->exc_info;
34378     tmp_type = exc_info->exc_type;
34379     tmp_value = exc_info->exc_value;
34380     tmp_tb = exc_info->exc_traceback;
34381     exc_info->exc_type = type;
34382     exc_info->exc_value = value;
34383     exc_info->exc_traceback = tb;
34384     #else
34385     tmp_type = tstate->exc_type;
34386     tmp_value = tstate->exc_value;
34387     tmp_tb = tstate->exc_traceback;
34388     tstate->exc_type = type;
34389     tstate->exc_value = value;
34390     tstate->exc_traceback = tb;
34391     #endif
34392     Py_XDECREF(tmp_type);
34393     Py_XDECREF(tmp_value);
34394     Py_XDECREF(tmp_tb);
34395 }
34396 #endif
34397 
34398 /* PyErrExceptionMatches */
34399   #if CYTHON_FAST_THREAD_STATE
__Pyx_PyErr_ExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)34400 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
34401     Py_ssize_t i, n;
34402     n = PyTuple_GET_SIZE(tuple);
34403 #if PY_MAJOR_VERSION >= 3
34404     for (i=0; i<n; i++) {
34405         if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
34406     }
34407 #endif
34408     for (i=0; i<n; i++) {
34409         if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
34410     }
34411     return 0;
34412 }
__Pyx_PyErr_ExceptionMatchesInState(PyThreadState * tstate,PyObject * err)34413 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
34414     PyObject *exc_type = tstate->curexc_type;
34415     if (exc_type == err) return 1;
34416     if (unlikely(!exc_type)) return 0;
34417     if (unlikely(PyTuple_Check(err)))
34418         return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
34419     return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
34420 }
34421 #endif
34422 
34423 /* GetException */
34424   #if CYTHON_FAST_THREAD_STATE
__Pyx__GetException(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)34425 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
34426 #else
34427 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
34428 #endif
34429 {
34430     PyObject *local_type, *local_value, *local_tb;
34431 #if CYTHON_FAST_THREAD_STATE
34432     PyObject *tmp_type, *tmp_value, *tmp_tb;
34433     local_type = tstate->curexc_type;
34434     local_value = tstate->curexc_value;
34435     local_tb = tstate->curexc_traceback;
34436     tstate->curexc_type = 0;
34437     tstate->curexc_value = 0;
34438     tstate->curexc_traceback = 0;
34439 #else
34440     PyErr_Fetch(&local_type, &local_value, &local_tb);
34441 #endif
34442     PyErr_NormalizeException(&local_type, &local_value, &local_tb);
34443 #if CYTHON_FAST_THREAD_STATE
34444     if (unlikely(tstate->curexc_type))
34445 #else
34446     if (unlikely(PyErr_Occurred()))
34447 #endif
34448         goto bad;
34449     #if PY_MAJOR_VERSION >= 3
34450     if (local_tb) {
34451         if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
34452             goto bad;
34453     }
34454     #endif
34455     Py_XINCREF(local_tb);
34456     Py_XINCREF(local_type);
34457     Py_XINCREF(local_value);
34458     *type = local_type;
34459     *value = local_value;
34460     *tb = local_tb;
34461 #if CYTHON_FAST_THREAD_STATE
34462     #if CYTHON_USE_EXC_INFO_STACK
34463     {
34464         _PyErr_StackItem *exc_info = tstate->exc_info;
34465         tmp_type = exc_info->exc_type;
34466         tmp_value = exc_info->exc_value;
34467         tmp_tb = exc_info->exc_traceback;
34468         exc_info->exc_type = local_type;
34469         exc_info->exc_value = local_value;
34470         exc_info->exc_traceback = local_tb;
34471     }
34472     #else
34473     tmp_type = tstate->exc_type;
34474     tmp_value = tstate->exc_value;
34475     tmp_tb = tstate->exc_traceback;
34476     tstate->exc_type = local_type;
34477     tstate->exc_value = local_value;
34478     tstate->exc_traceback = local_tb;
34479     #endif
34480     Py_XDECREF(tmp_type);
34481     Py_XDECREF(tmp_value);
34482     Py_XDECREF(tmp_tb);
34483 #else
34484     PyErr_SetExcInfo(local_type, local_value, local_tb);
34485 #endif
34486     return 0;
34487 bad:
34488     *type = 0;
34489     *value = 0;
34490     *tb = 0;
34491     Py_XDECREF(local_type);
34492     Py_XDECREF(local_value);
34493     Py_XDECREF(local_tb);
34494     return -1;
34495 }
34496 
34497 /* GetAttr */
__Pyx_GetAttr(PyObject * o,PyObject * n)34498   static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
34499 #if CYTHON_USE_TYPE_SLOTS
34500 #if PY_MAJOR_VERSION >= 3
34501     if (likely(PyUnicode_Check(n)))
34502 #else
34503     if (likely(PyString_Check(n)))
34504 #endif
34505         return __Pyx_PyObject_GetAttrStr(o, n);
34506 #endif
34507     return PyObject_GetAttr(o, n);
34508 }
34509 
34510 /* HasAttr */
__Pyx_HasAttr(PyObject * o,PyObject * n)34511   static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
34512     PyObject *r;
34513     if (unlikely(!__Pyx_PyBaseString_Check(n))) {
34514         PyErr_SetString(PyExc_TypeError,
34515                         "hasattr(): attribute name must be string");
34516         return -1;
34517     }
34518     r = __Pyx_GetAttr(o, n);
34519     if (unlikely(!r)) {
34520         PyErr_Clear();
34521         return 0;
34522     } else {
34523         Py_DECREF(r);
34524         return 1;
34525     }
34526 }
34527 
34528 /* BytesEquals */
__Pyx_PyBytes_Equals(PyObject * s1,PyObject * s2,int equals)34529   static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
34530 #if CYTHON_COMPILING_IN_PYPY
34531     return PyObject_RichCompareBool(s1, s2, equals);
34532 #else
34533     if (s1 == s2) {
34534         return (equals == Py_EQ);
34535     } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
34536         const char *ps1, *ps2;
34537         Py_ssize_t length = PyBytes_GET_SIZE(s1);
34538         if (length != PyBytes_GET_SIZE(s2))
34539             return (equals == Py_NE);
34540         ps1 = PyBytes_AS_STRING(s1);
34541         ps2 = PyBytes_AS_STRING(s2);
34542         if (ps1[0] != ps2[0]) {
34543             return (equals == Py_NE);
34544         } else if (length == 1) {
34545             return (equals == Py_EQ);
34546         } else {
34547             int result;
34548 #if CYTHON_USE_UNICODE_INTERNALS
34549             Py_hash_t hash1, hash2;
34550             hash1 = ((PyBytesObject*)s1)->ob_shash;
34551             hash2 = ((PyBytesObject*)s2)->ob_shash;
34552             if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
34553                 return (equals == Py_NE);
34554             }
34555 #endif
34556             result = memcmp(ps1, ps2, (size_t)length);
34557             return (equals == Py_EQ) ? (result == 0) : (result != 0);
34558         }
34559     } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
34560         return (equals == Py_NE);
34561     } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
34562         return (equals == Py_NE);
34563     } else {
34564         int result;
34565         PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
34566         if (!py_result)
34567             return -1;
34568         result = __Pyx_PyObject_IsTrue(py_result);
34569         Py_DECREF(py_result);
34570         return result;
34571     }
34572 #endif
34573 }
34574 
34575 /* UnicodeEquals */
__Pyx_PyUnicode_Equals(PyObject * s1,PyObject * s2,int equals)34576   static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
34577 #if CYTHON_COMPILING_IN_PYPY
34578     return PyObject_RichCompareBool(s1, s2, equals);
34579 #else
34580 #if PY_MAJOR_VERSION < 3
34581     PyObject* owned_ref = NULL;
34582 #endif
34583     int s1_is_unicode, s2_is_unicode;
34584     if (s1 == s2) {
34585         goto return_eq;
34586     }
34587     s1_is_unicode = PyUnicode_CheckExact(s1);
34588     s2_is_unicode = PyUnicode_CheckExact(s2);
34589 #if PY_MAJOR_VERSION < 3
34590     if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
34591         owned_ref = PyUnicode_FromObject(s2);
34592         if (unlikely(!owned_ref))
34593             return -1;
34594         s2 = owned_ref;
34595         s2_is_unicode = 1;
34596     } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
34597         owned_ref = PyUnicode_FromObject(s1);
34598         if (unlikely(!owned_ref))
34599             return -1;
34600         s1 = owned_ref;
34601         s1_is_unicode = 1;
34602     } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
34603         return __Pyx_PyBytes_Equals(s1, s2, equals);
34604     }
34605 #endif
34606     if (s1_is_unicode & s2_is_unicode) {
34607         Py_ssize_t length;
34608         int kind;
34609         void *data1, *data2;
34610         if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
34611             return -1;
34612         length = __Pyx_PyUnicode_GET_LENGTH(s1);
34613         if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
34614             goto return_ne;
34615         }
34616 #if CYTHON_USE_UNICODE_INTERNALS
34617         {
34618             Py_hash_t hash1, hash2;
34619         #if CYTHON_PEP393_ENABLED
34620             hash1 = ((PyASCIIObject*)s1)->hash;
34621             hash2 = ((PyASCIIObject*)s2)->hash;
34622         #else
34623             hash1 = ((PyUnicodeObject*)s1)->hash;
34624             hash2 = ((PyUnicodeObject*)s2)->hash;
34625         #endif
34626             if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
34627                 goto return_ne;
34628             }
34629         }
34630 #endif
34631         kind = __Pyx_PyUnicode_KIND(s1);
34632         if (kind != __Pyx_PyUnicode_KIND(s2)) {
34633             goto return_ne;
34634         }
34635         data1 = __Pyx_PyUnicode_DATA(s1);
34636         data2 = __Pyx_PyUnicode_DATA(s2);
34637         if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
34638             goto return_ne;
34639         } else if (length == 1) {
34640             goto return_eq;
34641         } else {
34642             int result = memcmp(data1, data2, (size_t)(length * kind));
34643             #if PY_MAJOR_VERSION < 3
34644             Py_XDECREF(owned_ref);
34645             #endif
34646             return (equals == Py_EQ) ? (result == 0) : (result != 0);
34647         }
34648     } else if ((s1 == Py_None) & s2_is_unicode) {
34649         goto return_ne;
34650     } else if ((s2 == Py_None) & s1_is_unicode) {
34651         goto return_ne;
34652     } else {
34653         int result;
34654         PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
34655         #if PY_MAJOR_VERSION < 3
34656         Py_XDECREF(owned_ref);
34657         #endif
34658         if (!py_result)
34659             return -1;
34660         result = __Pyx_PyObject_IsTrue(py_result);
34661         Py_DECREF(py_result);
34662         return result;
34663     }
34664 return_eq:
34665     #if PY_MAJOR_VERSION < 3
34666     Py_XDECREF(owned_ref);
34667     #endif
34668     return (equals == Py_EQ);
34669 return_ne:
34670     #if PY_MAJOR_VERSION < 3
34671     Py_XDECREF(owned_ref);
34672     #endif
34673     return (equals == Py_NE);
34674 #endif
34675 }
34676 
34677 /* BufferIndexError */
__Pyx_RaiseBufferIndexError(int axis)34678   static void __Pyx_RaiseBufferIndexError(int axis) {
34679   PyErr_Format(PyExc_IndexError,
34680      "Out of bounds on buffer access (axis %d)", axis);
34681 }
34682 
34683 /* None */
__Pyx_div_Py_ssize_t(Py_ssize_t a,Py_ssize_t b)34684   static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
34685     Py_ssize_t q = a / b;
34686     Py_ssize_t r = a - q*b;
34687     q -= ((r != 0) & ((r ^ b) < 0));
34688     return q;
34689 }
34690 
34691 /* decode_c_string */
__Pyx_decode_c_string(const char * cstring,Py_ssize_t start,Py_ssize_t stop,const char * encoding,const char * errors,PyObject * (* decode_func)(const char * s,Py_ssize_t size,const char * errors))34692   static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
34693          const char* cstring, Py_ssize_t start, Py_ssize_t stop,
34694          const char* encoding, const char* errors,
34695          PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
34696     Py_ssize_t length;
34697     if (unlikely((start < 0) | (stop < 0))) {
34698         size_t slen = strlen(cstring);
34699         if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
34700             PyErr_SetString(PyExc_OverflowError,
34701                             "c-string too long to convert to Python");
34702             return NULL;
34703         }
34704         length = (Py_ssize_t) slen;
34705         if (start < 0) {
34706             start += length;
34707             if (start < 0)
34708                 start = 0;
34709         }
34710         if (stop < 0)
34711             stop += length;
34712     }
34713     length = stop - start;
34714     if (unlikely(length <= 0))
34715         return PyUnicode_FromUnicode(NULL, 0);
34716     cstring += start;
34717     if (decode_func) {
34718         return decode_func(cstring, length, errors);
34719     } else {
34720         return PyUnicode_Decode(cstring, length, encoding, errors);
34721     }
34722 }
34723 
34724 /* GetAttr3 */
__Pyx_GetAttr3Default(PyObject * d)34725   static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
34726     __Pyx_PyThreadState_declare
34727     __Pyx_PyThreadState_assign
34728     if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
34729         return NULL;
34730     __Pyx_PyErr_Clear();
34731     Py_INCREF(d);
34732     return d;
34733 }
__Pyx_GetAttr3(PyObject * o,PyObject * n,PyObject * d)34734 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
34735     PyObject *r = __Pyx_GetAttr(o, n);
34736     return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
34737 }
34738 
34739 /* SwapException */
34740   #if CYTHON_FAST_THREAD_STATE
__Pyx__ExceptionSwap(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)34741 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
34742     PyObject *tmp_type, *tmp_value, *tmp_tb;
34743     #if CYTHON_USE_EXC_INFO_STACK
34744     _PyErr_StackItem *exc_info = tstate->exc_info;
34745     tmp_type = exc_info->exc_type;
34746     tmp_value = exc_info->exc_value;
34747     tmp_tb = exc_info->exc_traceback;
34748     exc_info->exc_type = *type;
34749     exc_info->exc_value = *value;
34750     exc_info->exc_traceback = *tb;
34751     #else
34752     tmp_type = tstate->exc_type;
34753     tmp_value = tstate->exc_value;
34754     tmp_tb = tstate->exc_traceback;
34755     tstate->exc_type = *type;
34756     tstate->exc_value = *value;
34757     tstate->exc_traceback = *tb;
34758     #endif
34759     *type = tmp_type;
34760     *value = tmp_value;
34761     *tb = tmp_tb;
34762 }
34763 #else
__Pyx_ExceptionSwap(PyObject ** type,PyObject ** value,PyObject ** tb)34764 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
34765     PyObject *tmp_type, *tmp_value, *tmp_tb;
34766     PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
34767     PyErr_SetExcInfo(*type, *value, *tb);
34768     *type = tmp_type;
34769     *value = tmp_value;
34770     *tb = tmp_tb;
34771 }
34772 #endif
34773 
34774 /* Import */
__Pyx_Import(PyObject * name,PyObject * from_list,int level)34775   static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
34776     PyObject *empty_list = 0;
34777     PyObject *module = 0;
34778     PyObject *global_dict = 0;
34779     PyObject *empty_dict = 0;
34780     PyObject *list;
34781     #if PY_MAJOR_VERSION < 3
34782     PyObject *py_import;
34783     py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
34784     if (!py_import)
34785         goto bad;
34786     #endif
34787     if (from_list)
34788         list = from_list;
34789     else {
34790         empty_list = PyList_New(0);
34791         if (!empty_list)
34792             goto bad;
34793         list = empty_list;
34794     }
34795     global_dict = PyModule_GetDict(__pyx_m);
34796     if (!global_dict)
34797         goto bad;
34798     empty_dict = PyDict_New();
34799     if (!empty_dict)
34800         goto bad;
34801     {
34802         #if PY_MAJOR_VERSION >= 3
34803         if (level == -1) {
34804             if (strchr(__Pyx_MODULE_NAME, '.')) {
34805                 module = PyImport_ImportModuleLevelObject(
34806                     name, global_dict, empty_dict, list, 1);
34807                 if (!module) {
34808                     if (!PyErr_ExceptionMatches(PyExc_ImportError))
34809                         goto bad;
34810                     PyErr_Clear();
34811                 }
34812             }
34813             level = 0;
34814         }
34815         #endif
34816         if (!module) {
34817             #if PY_MAJOR_VERSION < 3
34818             PyObject *py_level = PyInt_FromLong(level);
34819             if (!py_level)
34820                 goto bad;
34821             module = PyObject_CallFunctionObjArgs(py_import,
34822                 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
34823             Py_DECREF(py_level);
34824             #else
34825             module = PyImport_ImportModuleLevelObject(
34826                 name, global_dict, empty_dict, list, level);
34827             #endif
34828         }
34829     }
34830 bad:
34831     #if PY_MAJOR_VERSION < 3
34832     Py_XDECREF(py_import);
34833     #endif
34834     Py_XDECREF(empty_list);
34835     Py_XDECREF(empty_dict);
34836     return module;
34837 }
34838 
34839 /* FastTypeChecks */
34840   #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_InBases(PyTypeObject * a,PyTypeObject * b)34841 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
34842     while (a) {
34843         a = a->tp_base;
34844         if (a == b)
34845             return 1;
34846     }
34847     return b == &PyBaseObject_Type;
34848 }
__Pyx_IsSubtype(PyTypeObject * a,PyTypeObject * b)34849 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
34850     PyObject *mro;
34851     if (a == b) return 1;
34852     mro = a->tp_mro;
34853     if (likely(mro)) {
34854         Py_ssize_t i, n;
34855         n = PyTuple_GET_SIZE(mro);
34856         for (i = 0; i < n; i++) {
34857             if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
34858                 return 1;
34859         }
34860         return 0;
34861     }
34862     return __Pyx_InBases(a, b);
34863 }
34864 #if PY_MAJOR_VERSION == 2
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)34865 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
34866     PyObject *exception, *value, *tb;
34867     int res;
34868     __Pyx_PyThreadState_declare
34869     __Pyx_PyThreadState_assign
34870     __Pyx_ErrFetch(&exception, &value, &tb);
34871     res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
34872     if (unlikely(res == -1)) {
34873         PyErr_WriteUnraisable(err);
34874         res = 0;
34875     }
34876     if (!res) {
34877         res = PyObject_IsSubclass(err, exc_type2);
34878         if (unlikely(res == -1)) {
34879             PyErr_WriteUnraisable(err);
34880             res = 0;
34881         }
34882     }
34883     __Pyx_ErrRestore(exception, value, tb);
34884     return res;
34885 }
34886 #else
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)34887 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
34888     int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
34889     if (!res) {
34890         res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
34891     }
34892     return res;
34893 }
34894 #endif
__Pyx_PyErr_GivenExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)34895 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
34896     Py_ssize_t i, n;
34897     assert(PyExceptionClass_Check(exc_type));
34898     n = PyTuple_GET_SIZE(tuple);
34899 #if PY_MAJOR_VERSION >= 3
34900     for (i=0; i<n; i++) {
34901         if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
34902     }
34903 #endif
34904     for (i=0; i<n; i++) {
34905         PyObject *t = PyTuple_GET_ITEM(tuple, i);
34906         #if PY_MAJOR_VERSION < 3
34907         if (likely(exc_type == t)) return 1;
34908         #endif
34909         if (likely(PyExceptionClass_Check(t))) {
34910             if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
34911         } else {
34912         }
34913     }
34914     return 0;
34915 }
__Pyx_PyErr_GivenExceptionMatches(PyObject * err,PyObject * exc_type)34916 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
34917     if (likely(err == exc_type)) return 1;
34918     if (likely(PyExceptionClass_Check(err))) {
34919         if (likely(PyExceptionClass_Check(exc_type))) {
34920             return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
34921         } else if (likely(PyTuple_Check(exc_type))) {
34922             return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
34923         } else {
34924         }
34925     }
34926     return PyErr_GivenExceptionMatches(err, exc_type);
34927 }
__Pyx_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)34928 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
34929     assert(PyExceptionClass_Check(exc_type1));
34930     assert(PyExceptionClass_Check(exc_type2));
34931     if (likely(err == exc_type1 || err == exc_type2)) return 1;
34932     if (likely(PyExceptionClass_Check(err))) {
34933         return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
34934     }
34935     return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
34936 }
34937 #endif
34938 
34939 /* PyIntBinop */
34940   #if !CYTHON_COMPILING_IN_PYPY
__Pyx_PyInt_AddObjC(PyObject * op1,PyObject * op2,CYTHON_UNUSED long intval,int inplace,int zerodivision_check)34941 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
34942     (void)inplace;
34943     (void)zerodivision_check;
34944     #if PY_MAJOR_VERSION < 3
34945     if (likely(PyInt_CheckExact(op1))) {
34946         const long b = intval;
34947         long x;
34948         long a = PyInt_AS_LONG(op1);
34949             x = (long)((unsigned long)a + b);
34950             if (likely((x^a) >= 0 || (x^b) >= 0))
34951                 return PyInt_FromLong(x);
34952             return PyLong_Type.tp_as_number->nb_add(op1, op2);
34953     }
34954     #endif
34955     #if CYTHON_USE_PYLONG_INTERNALS
34956     if (likely(PyLong_CheckExact(op1))) {
34957         const long b = intval;
34958         long a, x;
34959 #ifdef HAVE_LONG_LONG
34960         const PY_LONG_LONG llb = intval;
34961         PY_LONG_LONG lla, llx;
34962 #endif
34963         const digit* digits = ((PyLongObject*)op1)->ob_digit;
34964         const Py_ssize_t size = Py_SIZE(op1);
34965         if (likely(__Pyx_sst_abs(size) <= 1)) {
34966             a = likely(size) ? digits[0] : 0;
34967             if (size == -1) a = -a;
34968         } else {
34969             switch (size) {
34970                 case -2:
34971                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
34972                         a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
34973                         break;
34974 #ifdef HAVE_LONG_LONG
34975                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
34976                         lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
34977                         goto long_long;
34978 #endif
34979                     }
34980                     CYTHON_FALLTHROUGH;
34981                 case 2:
34982                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
34983                         a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
34984                         break;
34985 #ifdef HAVE_LONG_LONG
34986                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
34987                         lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
34988                         goto long_long;
34989 #endif
34990                     }
34991                     CYTHON_FALLTHROUGH;
34992                 case -3:
34993                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
34994                         a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
34995                         break;
34996 #ifdef HAVE_LONG_LONG
34997                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
34998                         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]));
34999                         goto long_long;
35000 #endif
35001                     }
35002                     CYTHON_FALLTHROUGH;
35003                 case 3:
35004                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
35005                         a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
35006                         break;
35007 #ifdef HAVE_LONG_LONG
35008                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
35009                         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]));
35010                         goto long_long;
35011 #endif
35012                     }
35013                     CYTHON_FALLTHROUGH;
35014                 case -4:
35015                     if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
35016                         a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
35017                         break;
35018 #ifdef HAVE_LONG_LONG
35019                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
35020                         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]));
35021                         goto long_long;
35022 #endif
35023                     }
35024                     CYTHON_FALLTHROUGH;
35025                 case 4:
35026                     if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
35027                         a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
35028                         break;
35029 #ifdef HAVE_LONG_LONG
35030                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
35031                         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]));
35032                         goto long_long;
35033 #endif
35034                     }
35035                     CYTHON_FALLTHROUGH;
35036                 default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
35037             }
35038         }
35039                 x = a + b;
35040             return PyLong_FromLong(x);
35041 #ifdef HAVE_LONG_LONG
35042         long_long:
35043                 llx = lla + llb;
35044             return PyLong_FromLongLong(llx);
35045 #endif
35046 
35047 
35048     }
35049     #endif
35050     if (PyFloat_CheckExact(op1)) {
35051         const long b = intval;
35052         double a = PyFloat_AS_DOUBLE(op1);
35053             double result;
35054             PyFPE_START_PROTECT("add", return NULL)
35055             result = ((double)a) + (double)b;
35056             PyFPE_END_PROTECT(result)
35057             return PyFloat_FromDouble(result);
35058     }
35059     return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
35060 }
35061 #endif
35062 
35063 /* None */
__Pyx_RaiseUnboundLocalError(const char * varname)35064   static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
35065     PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
35066 }
35067 
35068 /* None */
__Pyx_div_long(long a,long b)35069   static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
35070     long q = a / b;
35071     long r = a - q*b;
35072     q -= ((r != 0) & ((r ^ b) < 0));
35073     return q;
35074 }
35075 
35076 /* ImportFrom */
__Pyx_ImportFrom(PyObject * module,PyObject * name)35077   static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
35078     PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
35079     if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
35080         PyErr_Format(PyExc_ImportError,
35081         #if PY_MAJOR_VERSION < 3
35082             "cannot import name %.230s", PyString_AS_STRING(name));
35083         #else
35084             "cannot import name %S", name);
35085         #endif
35086     }
35087     return value;
35088 }
35089 
35090 /* StringJoin */
35091   #if !CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyBytes_Join(PyObject * sep,PyObject * values)35092 static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) {
35093     return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL);
35094 }
35095 #endif
35096 
35097 /* PyObject_GenericGetAttrNoDict */
35098   #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
__Pyx_RaiseGenericGetAttributeError(PyTypeObject * tp,PyObject * attr_name)35099 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
35100     PyErr_Format(PyExc_AttributeError,
35101 #if PY_MAJOR_VERSION >= 3
35102                  "'%.50s' object has no attribute '%U'",
35103                  tp->tp_name, attr_name);
35104 #else
35105                  "'%.50s' object has no attribute '%.400s'",
35106                  tp->tp_name, PyString_AS_STRING(attr_name));
35107 #endif
35108     return NULL;
35109 }
__Pyx_PyObject_GenericGetAttrNoDict(PyObject * obj,PyObject * attr_name)35110 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
35111     PyObject *descr;
35112     PyTypeObject *tp = Py_TYPE(obj);
35113     if (unlikely(!PyString_Check(attr_name))) {
35114         return PyObject_GenericGetAttr(obj, attr_name);
35115     }
35116     assert(!tp->tp_dictoffset);
35117     descr = _PyType_Lookup(tp, attr_name);
35118     if (unlikely(!descr)) {
35119         return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
35120     }
35121     Py_INCREF(descr);
35122     #if PY_MAJOR_VERSION < 3
35123     if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
35124     #endif
35125     {
35126         descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
35127         if (unlikely(f)) {
35128             PyObject *res = f(descr, obj, (PyObject *)tp);
35129             Py_DECREF(descr);
35130             return res;
35131         }
35132     }
35133     return descr;
35134 }
35135 #endif
35136 
35137 /* PyObject_GenericGetAttr */
35138   #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
__Pyx_PyObject_GenericGetAttr(PyObject * obj,PyObject * attr_name)35139 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
35140     if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
35141         return PyObject_GenericGetAttr(obj, attr_name);
35142     }
35143     return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
35144 }
35145 #endif
35146 
35147 /* SetVTable */
__Pyx_SetVtable(PyObject * dict,void * vtable)35148   static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
35149 #if PY_VERSION_HEX >= 0x02070000
35150     PyObject *ob = PyCapsule_New(vtable, 0, 0);
35151 #else
35152     PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
35153 #endif
35154     if (!ob)
35155         goto bad;
35156     if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
35157         goto bad;
35158     Py_DECREF(ob);
35159     return 0;
35160 bad:
35161     Py_XDECREF(ob);
35162     return -1;
35163 }
35164 
35165 /* SetupReduce */
__Pyx_setup_reduce_is_named(PyObject * meth,PyObject * name)35166   static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
35167   int ret;
35168   PyObject *name_attr;
35169   name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
35170   if (likely(name_attr)) {
35171       ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
35172   } else {
35173       ret = -1;
35174   }
35175   if (unlikely(ret < 0)) {
35176       PyErr_Clear();
35177       ret = 0;
35178   }
35179   Py_XDECREF(name_attr);
35180   return ret;
35181 }
__Pyx_setup_reduce(PyObject * type_obj)35182 static int __Pyx_setup_reduce(PyObject* type_obj) {
35183     int ret = 0;
35184     PyObject *object_reduce = NULL;
35185     PyObject *object_reduce_ex = NULL;
35186     PyObject *reduce = NULL;
35187     PyObject *reduce_ex = NULL;
35188     PyObject *reduce_cython = NULL;
35189     PyObject *setstate = NULL;
35190     PyObject *setstate_cython = NULL;
35191 #if CYTHON_USE_PYTYPE_LOOKUP
35192     if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto GOOD;
35193 #else
35194     if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto GOOD;
35195 #endif
35196 #if CYTHON_USE_PYTYPE_LOOKUP
35197     object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
35198 #else
35199     object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
35200 #endif
35201     reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto BAD;
35202     if (reduce_ex == object_reduce_ex) {
35203 #if CYTHON_USE_PYTYPE_LOOKUP
35204         object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
35205 #else
35206         object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
35207 #endif
35208         reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto BAD;
35209         if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
35210             reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto BAD;
35211             ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto BAD;
35212             ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto BAD;
35213             setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
35214             if (!setstate) PyErr_Clear();
35215             if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
35216                 setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto BAD;
35217                 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto BAD;
35218                 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto BAD;
35219             }
35220             PyType_Modified((PyTypeObject*)type_obj);
35221         }
35222     }
35223     goto GOOD;
35224 BAD:
35225     if (!PyErr_Occurred())
35226         PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
35227     ret = -1;
35228 GOOD:
35229 #if !CYTHON_USE_PYTYPE_LOOKUP
35230     Py_XDECREF(object_reduce);
35231     Py_XDECREF(object_reduce_ex);
35232 #endif
35233     Py_XDECREF(reduce);
35234     Py_XDECREF(reduce_ex);
35235     Py_XDECREF(reduce_cython);
35236     Py_XDECREF(setstate);
35237     Py_XDECREF(setstate_cython);
35238     return ret;
35239 }
35240 
35241 /* TypeImport */
35242   #ifndef __PYX_HAVE_RT_ImportType
35243 #define __PYX_HAVE_RT_ImportType
__Pyx_ImportType(PyObject * module,const char * module_name,const char * class_name,size_t size,enum __Pyx_ImportType_CheckSize check_size)35244 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
35245     size_t size, enum __Pyx_ImportType_CheckSize check_size)
35246 {
35247     PyObject *result = 0;
35248     char warning[200];
35249     Py_ssize_t basicsize;
35250 #ifdef Py_LIMITED_API
35251     PyObject *py_basicsize;
35252 #endif
35253     result = PyObject_GetAttrString(module, class_name);
35254     if (!result)
35255         goto bad;
35256     if (!PyType_Check(result)) {
35257         PyErr_Format(PyExc_TypeError,
35258             "%.200s.%.200s is not a type object",
35259             module_name, class_name);
35260         goto bad;
35261     }
35262 #ifndef Py_LIMITED_API
35263     basicsize = ((PyTypeObject *)result)->tp_basicsize;
35264 #else
35265     py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
35266     if (!py_basicsize)
35267         goto bad;
35268     basicsize = PyLong_AsSsize_t(py_basicsize);
35269     Py_DECREF(py_basicsize);
35270     py_basicsize = 0;
35271     if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
35272         goto bad;
35273 #endif
35274     if ((size_t)basicsize < size) {
35275         PyErr_Format(PyExc_ValueError,
35276             "%.200s.%.200s size changed, may indicate binary incompatibility. "
35277             "Expected %zd from C header, got %zd from PyObject",
35278             module_name, class_name, size, basicsize);
35279         goto bad;
35280     }
35281     if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
35282         PyErr_Format(PyExc_ValueError,
35283             "%.200s.%.200s size changed, may indicate binary incompatibility. "
35284             "Expected %zd from C header, got %zd from PyObject",
35285             module_name, class_name, size, basicsize);
35286         goto bad;
35287     }
35288     else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
35289         PyOS_snprintf(warning, sizeof(warning),
35290             "%s.%s size changed, may indicate binary incompatibility. "
35291             "Expected %zd from C header, got %zd from PyObject",
35292             module_name, class_name, size, basicsize);
35293         if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
35294     }
35295     return (PyTypeObject *)result;
35296 bad:
35297     Py_XDECREF(result);
35298     return NULL;
35299 }
35300 #endif
35301 
35302 /* GetVTable */
__Pyx_GetVtable(PyObject * dict)35303   static void* __Pyx_GetVtable(PyObject *dict) {
35304     void* ptr;
35305     PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable);
35306     if (!ob)
35307         goto bad;
35308 #if PY_VERSION_HEX >= 0x02070000
35309     ptr = PyCapsule_GetPointer(ob, 0);
35310 #else
35311     ptr = PyCObject_AsVoidPtr(ob);
35312 #endif
35313     if (!ptr && !PyErr_Occurred())
35314         PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
35315     Py_DECREF(ob);
35316     return ptr;
35317 bad:
35318     Py_XDECREF(ob);
35319     return NULL;
35320 }
35321 
35322 /* CLineInTraceback */
35323   #ifndef CYTHON_CLINE_IN_TRACEBACK
__Pyx_CLineForTraceback(PyThreadState * tstate,int c_line)35324 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
35325     PyObject *use_cline;
35326     PyObject *ptype, *pvalue, *ptraceback;
35327 #if CYTHON_COMPILING_IN_CPYTHON
35328     PyObject **cython_runtime_dict;
35329 #endif
35330     if (unlikely(!__pyx_cython_runtime)) {
35331         return c_line;
35332     }
35333     __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
35334 #if CYTHON_COMPILING_IN_CPYTHON
35335     cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
35336     if (likely(cython_runtime_dict)) {
35337         __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
35338             use_cline, *cython_runtime_dict,
35339             __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
35340     } else
35341 #endif
35342     {
35343       PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
35344       if (use_cline_obj) {
35345         use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
35346         Py_DECREF(use_cline_obj);
35347       } else {
35348         PyErr_Clear();
35349         use_cline = NULL;
35350       }
35351     }
35352     if (!use_cline) {
35353         c_line = 0;
35354         PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
35355     }
35356     else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
35357         c_line = 0;
35358     }
35359     __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
35360     return c_line;
35361 }
35362 #endif
35363 
35364 /* CodeObjectCache */
__pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry * entries,int count,int code_line)35365   static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
35366     int start = 0, mid = 0, end = count - 1;
35367     if (end >= 0 && code_line > entries[end].code_line) {
35368         return count;
35369     }
35370     while (start < end) {
35371         mid = start + (end - start) / 2;
35372         if (code_line < entries[mid].code_line) {
35373             end = mid;
35374         } else if (code_line > entries[mid].code_line) {
35375              start = mid + 1;
35376         } else {
35377             return mid;
35378         }
35379     }
35380     if (code_line <= entries[mid].code_line) {
35381         return mid;
35382     } else {
35383         return mid + 1;
35384     }
35385 }
__pyx_find_code_object(int code_line)35386 static PyCodeObject *__pyx_find_code_object(int code_line) {
35387     PyCodeObject* code_object;
35388     int pos;
35389     if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
35390         return NULL;
35391     }
35392     pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
35393     if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
35394         return NULL;
35395     }
35396     code_object = __pyx_code_cache.entries[pos].code_object;
35397     Py_INCREF(code_object);
35398     return code_object;
35399 }
__pyx_insert_code_object(int code_line,PyCodeObject * code_object)35400 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
35401     int pos, i;
35402     __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
35403     if (unlikely(!code_line)) {
35404         return;
35405     }
35406     if (unlikely(!entries)) {
35407         entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
35408         if (likely(entries)) {
35409             __pyx_code_cache.entries = entries;
35410             __pyx_code_cache.max_count = 64;
35411             __pyx_code_cache.count = 1;
35412             entries[0].code_line = code_line;
35413             entries[0].code_object = code_object;
35414             Py_INCREF(code_object);
35415         }
35416         return;
35417     }
35418     pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
35419     if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
35420         PyCodeObject* tmp = entries[pos].code_object;
35421         entries[pos].code_object = code_object;
35422         Py_DECREF(tmp);
35423         return;
35424     }
35425     if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
35426         int new_max = __pyx_code_cache.max_count + 64;
35427         entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
35428             __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
35429         if (unlikely(!entries)) {
35430             return;
35431         }
35432         __pyx_code_cache.entries = entries;
35433         __pyx_code_cache.max_count = new_max;
35434     }
35435     for (i=__pyx_code_cache.count; i>pos; i--) {
35436         entries[i] = entries[i-1];
35437     }
35438     entries[pos].code_line = code_line;
35439     entries[pos].code_object = code_object;
35440     __pyx_code_cache.count++;
35441     Py_INCREF(code_object);
35442 }
35443 
35444 /* AddTraceback */
35445   #include "compile.h"
35446 #include "frameobject.h"
35447 #include "traceback.h"
__Pyx_CreateCodeObjectForTraceback(const char * funcname,int c_line,int py_line,const char * filename)35448 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
35449             const char *funcname, int c_line,
35450             int py_line, const char *filename) {
35451     PyCodeObject *py_code = 0;
35452     PyObject *py_srcfile = 0;
35453     PyObject *py_funcname = 0;
35454     #if PY_MAJOR_VERSION < 3
35455     py_srcfile = PyString_FromString(filename);
35456     #else
35457     py_srcfile = PyUnicode_FromString(filename);
35458     #endif
35459     if (!py_srcfile) goto bad;
35460     if (c_line) {
35461         #if PY_MAJOR_VERSION < 3
35462         py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
35463         #else
35464         py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
35465         #endif
35466     }
35467     else {
35468         #if PY_MAJOR_VERSION < 3
35469         py_funcname = PyString_FromString(funcname);
35470         #else
35471         py_funcname = PyUnicode_FromString(funcname);
35472         #endif
35473     }
35474     if (!py_funcname) goto bad;
35475     py_code = __Pyx_PyCode_New(
35476         0,
35477         0,
35478         0,
35479         0,
35480         0,
35481         __pyx_empty_bytes, /*PyObject *code,*/
35482         __pyx_empty_tuple, /*PyObject *consts,*/
35483         __pyx_empty_tuple, /*PyObject *names,*/
35484         __pyx_empty_tuple, /*PyObject *varnames,*/
35485         __pyx_empty_tuple, /*PyObject *freevars,*/
35486         __pyx_empty_tuple, /*PyObject *cellvars,*/
35487         py_srcfile,   /*PyObject *filename,*/
35488         py_funcname,  /*PyObject *name,*/
35489         py_line,
35490         __pyx_empty_bytes  /*PyObject *lnotab*/
35491     );
35492     Py_DECREF(py_srcfile);
35493     Py_DECREF(py_funcname);
35494     return py_code;
35495 bad:
35496     Py_XDECREF(py_srcfile);
35497     Py_XDECREF(py_funcname);
35498     return NULL;
35499 }
__Pyx_AddTraceback(const char * funcname,int c_line,int py_line,const char * filename)35500 static void __Pyx_AddTraceback(const char *funcname, int c_line,
35501                                int py_line, const char *filename) {
35502     PyCodeObject *py_code = 0;
35503     PyFrameObject *py_frame = 0;
35504     PyThreadState *tstate = __Pyx_PyThreadState_Current;
35505     if (c_line) {
35506         c_line = __Pyx_CLineForTraceback(tstate, c_line);
35507     }
35508     py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
35509     if (!py_code) {
35510         py_code = __Pyx_CreateCodeObjectForTraceback(
35511             funcname, c_line, py_line, filename);
35512         if (!py_code) goto bad;
35513         __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
35514     }
35515     py_frame = PyFrame_New(
35516         tstate,            /*PyThreadState *tstate,*/
35517         py_code,           /*PyCodeObject *code,*/
35518         __pyx_d,    /*PyObject *globals,*/
35519         0                  /*PyObject *locals*/
35520     );
35521     if (!py_frame) goto bad;
35522     __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
35523     PyTraceBack_Here(py_frame);
35524 bad:
35525     Py_XDECREF(py_code);
35526     Py_XDECREF(py_frame);
35527 }
35528 
35529 #if PY_MAJOR_VERSION < 3
__Pyx_GetBuffer(PyObject * obj,Py_buffer * view,int flags)35530 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
35531     if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
35532         if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
35533         if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
35534         if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
35535     PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
35536     return -1;
35537 }
__Pyx_ReleaseBuffer(Py_buffer * view)35538 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
35539     PyObject *obj = view->obj;
35540     if (!obj) return;
35541     if (PyObject_CheckBuffer(obj)) {
35542         PyBuffer_Release(view);
35543         return;
35544     }
35545     if ((0)) {}
35546         else if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view);
35547     view->obj = NULL;
35548     Py_DECREF(obj);
35549 }
35550 #endif
35551 
35552 
35553   /* MemviewSliceIsContig */
35554   static int
__pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs,char order,int ndim)35555 __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
35556 {
35557     int i, index, step, start;
35558     Py_ssize_t itemsize = mvs.memview->view.itemsize;
35559     if (order == 'F') {
35560         step = 1;
35561         start = 0;
35562     } else {
35563         step = -1;
35564         start = ndim - 1;
35565     }
35566     for (i = 0; i < ndim; i++) {
35567         index = start + step * i;
35568         if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
35569             return 0;
35570         itemsize *= mvs.shape[index];
35571     }
35572     return 1;
35573 }
35574 
35575 /* OverlappingSlices */
35576   static void
__pyx_get_array_memory_extents(__Pyx_memviewslice * slice,void ** out_start,void ** out_end,int ndim,size_t itemsize)35577 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
35578                                void **out_start, void **out_end,
35579                                int ndim, size_t itemsize)
35580 {
35581     char *start, *end;
35582     int i;
35583     start = end = slice->data;
35584     for (i = 0; i < ndim; i++) {
35585         Py_ssize_t stride = slice->strides[i];
35586         Py_ssize_t extent = slice->shape[i];
35587         if (extent == 0) {
35588             *out_start = *out_end = start;
35589             return;
35590         } else {
35591             if (stride > 0)
35592                 end += stride * (extent - 1);
35593             else
35594                 start += stride * (extent - 1);
35595         }
35596     }
35597     *out_start = start;
35598     *out_end = end + itemsize;
35599 }
35600 static int
__pyx_slices_overlap(__Pyx_memviewslice * slice1,__Pyx_memviewslice * slice2,int ndim,size_t itemsize)35601 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
35602                      __Pyx_memviewslice *slice2,
35603                      int ndim, size_t itemsize)
35604 {
35605     void *start1, *end1, *start2, *end2;
35606     __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
35607     __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
35608     return (start1 < end2) && (start2 < end1);
35609 }
35610 
35611 /* Capsule */
35612   static CYTHON_INLINE PyObject *
__pyx_capsule_create(void * p,CYTHON_UNUSED const char * sig)35613 __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
35614 {
35615     PyObject *cobj;
35616 #if PY_VERSION_HEX >= 0x02070000
35617     cobj = PyCapsule_New(p, sig, NULL);
35618 #else
35619     cobj = PyCObject_FromVoidPtr(p, NULL);
35620 #endif
35621     return cobj;
35622 }
35623 
35624 /* CIntFromPyVerify */
35625   #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
35626     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
35627 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
35628     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
35629 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
35630     {\
35631         func_type value = func_value;\
35632         if (sizeof(target_type) < sizeof(func_type)) {\
35633             if (unlikely(value != (func_type) (target_type) value)) {\
35634                 func_type zero = 0;\
35635                 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
35636                     return (target_type) -1;\
35637                 if (is_unsigned && unlikely(value < zero))\
35638                     goto raise_neg_overflow;\
35639                 else\
35640                     goto raise_overflow;\
35641             }\
35642         }\
35643         return (target_type) value;\
35644     }
35645 
35646 /* CIntToPy */
__Pyx_PyInt_From_int(int value)35647   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
35648     const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
35649     const int is_unsigned = neg_one > const_zero;
35650     if (is_unsigned) {
35651         if (sizeof(int) < sizeof(long)) {
35652             return PyInt_FromLong((long) value);
35653         } else if (sizeof(int) <= sizeof(unsigned long)) {
35654             return PyLong_FromUnsignedLong((unsigned long) value);
35655 #ifdef HAVE_LONG_LONG
35656         } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
35657             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
35658 #endif
35659         }
35660     } else {
35661         if (sizeof(int) <= sizeof(long)) {
35662             return PyInt_FromLong((long) value);
35663 #ifdef HAVE_LONG_LONG
35664         } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
35665             return PyLong_FromLongLong((PY_LONG_LONG) value);
35666 #endif
35667         }
35668     }
35669     {
35670         int one = 1; int little = (int)*(unsigned char *)&one;
35671         unsigned char *bytes = (unsigned char *)&value;
35672         return _PyLong_FromByteArray(bytes, sizeof(int),
35673                                      little, !is_unsigned);
35674     }
35675 }
35676 
35677 /* CIntToPy */
__Pyx_PyInt_From_npy_int32(npy_int32 value)35678   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value) {
35679     const npy_int32 neg_one = (npy_int32) ((npy_int32) 0 - (npy_int32) 1), const_zero = (npy_int32) 0;
35680     const int is_unsigned = neg_one > const_zero;
35681     if (is_unsigned) {
35682         if (sizeof(npy_int32) < sizeof(long)) {
35683             return PyInt_FromLong((long) value);
35684         } else if (sizeof(npy_int32) <= sizeof(unsigned long)) {
35685             return PyLong_FromUnsignedLong((unsigned long) value);
35686 #ifdef HAVE_LONG_LONG
35687         } else if (sizeof(npy_int32) <= sizeof(unsigned PY_LONG_LONG)) {
35688             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
35689 #endif
35690         }
35691     } else {
35692         if (sizeof(npy_int32) <= sizeof(long)) {
35693             return PyInt_FromLong((long) value);
35694 #ifdef HAVE_LONG_LONG
35695         } else if (sizeof(npy_int32) <= sizeof(PY_LONG_LONG)) {
35696             return PyLong_FromLongLong((PY_LONG_LONG) value);
35697 #endif
35698         }
35699     }
35700     {
35701         int one = 1; int little = (int)*(unsigned char *)&one;
35702         unsigned char *bytes = (unsigned char *)&value;
35703         return _PyLong_FromByteArray(bytes, sizeof(npy_int32),
35704                                      little, !is_unsigned);
35705     }
35706 }
35707 
35708 /* CIntToPy */
__Pyx_PyInt_From_npy_int64(npy_int64 value)35709   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value) {
35710     const npy_int64 neg_one = (npy_int64) ((npy_int64) 0 - (npy_int64) 1), const_zero = (npy_int64) 0;
35711     const int is_unsigned = neg_one > const_zero;
35712     if (is_unsigned) {
35713         if (sizeof(npy_int64) < sizeof(long)) {
35714             return PyInt_FromLong((long) value);
35715         } else if (sizeof(npy_int64) <= sizeof(unsigned long)) {
35716             return PyLong_FromUnsignedLong((unsigned long) value);
35717 #ifdef HAVE_LONG_LONG
35718         } else if (sizeof(npy_int64) <= sizeof(unsigned PY_LONG_LONG)) {
35719             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
35720 #endif
35721         }
35722     } else {
35723         if (sizeof(npy_int64) <= sizeof(long)) {
35724             return PyInt_FromLong((long) value);
35725 #ifdef HAVE_LONG_LONG
35726         } else if (sizeof(npy_int64) <= sizeof(PY_LONG_LONG)) {
35727             return PyLong_FromLongLong((PY_LONG_LONG) value);
35728 #endif
35729         }
35730     }
35731     {
35732         int one = 1; int little = (int)*(unsigned char *)&one;
35733         unsigned char *bytes = (unsigned char *)&value;
35734         return _PyLong_FromByteArray(bytes, sizeof(npy_int64),
35735                                      little, !is_unsigned);
35736     }
35737 }
35738 
35739 /* CIntToPy */
__Pyx_PyInt_From_npy_long(npy_long value)35740   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_long(npy_long value) {
35741     const npy_long neg_one = (npy_long) ((npy_long) 0 - (npy_long) 1), const_zero = (npy_long) 0;
35742     const int is_unsigned = neg_one > const_zero;
35743     if (is_unsigned) {
35744         if (sizeof(npy_long) < sizeof(long)) {
35745             return PyInt_FromLong((long) value);
35746         } else if (sizeof(npy_long) <= sizeof(unsigned long)) {
35747             return PyLong_FromUnsignedLong((unsigned long) value);
35748 #ifdef HAVE_LONG_LONG
35749         } else if (sizeof(npy_long) <= sizeof(unsigned PY_LONG_LONG)) {
35750             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
35751 #endif
35752         }
35753     } else {
35754         if (sizeof(npy_long) <= sizeof(long)) {
35755             return PyInt_FromLong((long) value);
35756 #ifdef HAVE_LONG_LONG
35757         } else if (sizeof(npy_long) <= sizeof(PY_LONG_LONG)) {
35758             return PyLong_FromLongLong((PY_LONG_LONG) value);
35759 #endif
35760         }
35761     }
35762     {
35763         int one = 1; int little = (int)*(unsigned char *)&one;
35764         unsigned char *bytes = (unsigned char *)&value;
35765         return _PyLong_FromByteArray(bytes, sizeof(npy_long),
35766                                      little, !is_unsigned);
35767     }
35768 }
35769 
__pyx_convert__to_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded(struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded s)35770 static PyObject* __pyx_convert__to_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded(struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded s) {
35771     PyObject* res;
35772     PyObject* member;
35773     res = __Pyx_PyDict_NewPresized(19); if (unlikely(!res)) return NULL;
35774     member = __Pyx_PyInt_From_npy_int32(s.num_children); if (unlikely(!member)) goto bad;
35775     if (unlikely(PyDict_SetItem(res, __pyx_n_s_num_children, member) < 0)) goto bad;
35776     Py_DECREF(member);
35777     member = __Pyx_PyInt_From_npy_int32(s.level); if (unlikely(!member)) goto bad;
35778     if (unlikely(PyDict_SetItem(res, __pyx_n_s_level, member) < 0)) goto bad;
35779     Py_DECREF(member);
35780     member = __Pyx_PyInt_From_npy_int64(s.index); if (unlikely(!member)) goto bad;
35781     if (unlikely(PyDict_SetItem(res, __pyx_n_s_index, member) < 0)) goto bad;
35782     Py_DECREF(member);
35783     member = PyFloat_FromDouble(s.left_edge_x); if (unlikely(!member)) goto bad;
35784     if (unlikely(PyDict_SetItem(res, __pyx_n_s_left_edge_x, member) < 0)) goto bad;
35785     Py_DECREF(member);
35786     member = PyFloat_FromDouble(s.left_edge_y); if (unlikely(!member)) goto bad;
35787     if (unlikely(PyDict_SetItem(res, __pyx_n_s_left_edge_y, member) < 0)) goto bad;
35788     Py_DECREF(member);
35789     member = PyFloat_FromDouble(s.left_edge_z); if (unlikely(!member)) goto bad;
35790     if (unlikely(PyDict_SetItem(res, __pyx_n_s_left_edge_z, member) < 0)) goto bad;
35791     Py_DECREF(member);
35792     member = PyFloat_FromDouble(s.right_edge_x); if (unlikely(!member)) goto bad;
35793     if (unlikely(PyDict_SetItem(res, __pyx_n_s_right_edge_x, member) < 0)) goto bad;
35794     Py_DECREF(member);
35795     member = PyFloat_FromDouble(s.right_edge_y); if (unlikely(!member)) goto bad;
35796     if (unlikely(PyDict_SetItem(res, __pyx_n_s_right_edge_y, member) < 0)) goto bad;
35797     Py_DECREF(member);
35798     member = PyFloat_FromDouble(s.right_edge_z); if (unlikely(!member)) goto bad;
35799     if (unlikely(PyDict_SetItem(res, __pyx_n_s_right_edge_z, member) < 0)) goto bad;
35800     Py_DECREF(member);
35801     member = __Pyx_PyInt_From_npy_long(s.children_pointers); if (unlikely(!member)) goto bad;
35802     if (unlikely(PyDict_SetItem(res, __pyx_n_s_children_pointers, member) < 0)) goto bad;
35803     Py_DECREF(member);
35804     member = __Pyx_PyInt_From_npy_int64(s.start_index_x); if (unlikely(!member)) goto bad;
35805     if (unlikely(PyDict_SetItem(res, __pyx_n_s_start_index_x, member) < 0)) goto bad;
35806     Py_DECREF(member);
35807     member = __Pyx_PyInt_From_npy_int64(s.start_index_y); if (unlikely(!member)) goto bad;
35808     if (unlikely(PyDict_SetItem(res, __pyx_n_s_start_index_y, member) < 0)) goto bad;
35809     Py_DECREF(member);
35810     member = __Pyx_PyInt_From_npy_int64(s.start_index_z); if (unlikely(!member)) goto bad;
35811     if (unlikely(PyDict_SetItem(res, __pyx_n_s_start_index_z, member) < 0)) goto bad;
35812     Py_DECREF(member);
35813     member = __Pyx_PyInt_From_npy_int32(s.dims_x); if (unlikely(!member)) goto bad;
35814     if (unlikely(PyDict_SetItem(res, __pyx_n_s_dims_x, member) < 0)) goto bad;
35815     Py_DECREF(member);
35816     member = __Pyx_PyInt_From_npy_int32(s.dims_y); if (unlikely(!member)) goto bad;
35817     if (unlikely(PyDict_SetItem(res, __pyx_n_s_dims_y, member) < 0)) goto bad;
35818     Py_DECREF(member);
35819     member = __Pyx_PyInt_From_npy_int32(s.dims_z); if (unlikely(!member)) goto bad;
35820     if (unlikely(PyDict_SetItem(res, __pyx_n_s_dims_z, member) < 0)) goto bad;
35821     Py_DECREF(member);
35822     member = PyFloat_FromDouble(s.dds_x); if (unlikely(!member)) goto bad;
35823     if (unlikely(PyDict_SetItem(res, __pyx_n_s_dds_x, member) < 0)) goto bad;
35824     Py_DECREF(member);
35825     member = PyFloat_FromDouble(s.dds_y); if (unlikely(!member)) goto bad;
35826     if (unlikely(PyDict_SetItem(res, __pyx_n_s_dds_y, member) < 0)) goto bad;
35827     Py_DECREF(member);
35828     member = PyFloat_FromDouble(s.dds_z); if (unlikely(!member)) goto bad;
35829     if (unlikely(PyDict_SetItem(res, __pyx_n_s_dds_z, member) < 0)) goto bad;
35830     Py_DECREF(member);
35831     return res;
35832     bad:
35833     Py_XDECREF(member);
35834     Py_DECREF(res);
35835     return NULL;
35836   }
35837   /* MemviewDtypeToObject */
__pyx_memview_get_nn_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded(const char * itemp)35838   static CYTHON_INLINE PyObject *__pyx_memview_get_nn_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded(const char *itemp) {
35839     return (PyObject *) __pyx_convert__to_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded(*(struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded *) itemp);
35840 }
__pyx_memview_set_nn_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded(const char * itemp,PyObject * obj)35841 static CYTHON_INLINE int __pyx_memview_set_nn_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded(const char *itemp, PyObject *obj) {
35842     struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded value = __pyx_convert__from_py_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded(obj);
35843     if (PyErr_Occurred())
35844         return 0;
35845     *(struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded *) itemp = value;
35846     return 1;
35847 }
35848 
35849 /* CIntToPy */
__Pyx_PyInt_From_npy_uint64(npy_uint64 value)35850   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint64(npy_uint64 value) {
35851     const npy_uint64 neg_one = (npy_uint64) ((npy_uint64) 0 - (npy_uint64) 1), const_zero = (npy_uint64) 0;
35852     const int is_unsigned = neg_one > const_zero;
35853     if (is_unsigned) {
35854         if (sizeof(npy_uint64) < sizeof(long)) {
35855             return PyInt_FromLong((long) value);
35856         } else if (sizeof(npy_uint64) <= sizeof(unsigned long)) {
35857             return PyLong_FromUnsignedLong((unsigned long) value);
35858 #ifdef HAVE_LONG_LONG
35859         } else if (sizeof(npy_uint64) <= sizeof(unsigned PY_LONG_LONG)) {
35860             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
35861 #endif
35862         }
35863     } else {
35864         if (sizeof(npy_uint64) <= sizeof(long)) {
35865             return PyInt_FromLong((long) value);
35866 #ifdef HAVE_LONG_LONG
35867         } else if (sizeof(npy_uint64) <= sizeof(PY_LONG_LONG)) {
35868             return PyLong_FromLongLong((PY_LONG_LONG) value);
35869 #endif
35870         }
35871     }
35872     {
35873         int one = 1; int little = (int)*(unsigned char *)&one;
35874         unsigned char *bytes = (unsigned char *)&value;
35875         return _PyLong_FromByteArray(bytes, sizeof(npy_uint64),
35876                                      little, !is_unsigned);
35877     }
35878 }
35879 
35880 /* Declarations */
35881   #if CYTHON_CCOMPLEX
35882   #ifdef __cplusplus
__pyx_t_float_complex_from_parts(float x,float y)35883     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
35884       return ::std::complex< float >(x, y);
35885     }
35886   #else
__pyx_t_float_complex_from_parts(float x,float y)35887     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
35888       return x + y*(__pyx_t_float_complex)_Complex_I;
35889     }
35890   #endif
35891 #else
__pyx_t_float_complex_from_parts(float x,float y)35892     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
35893       __pyx_t_float_complex z;
35894       z.real = x;
35895       z.imag = y;
35896       return z;
35897     }
35898 #endif
35899 
35900 /* Arithmetic */
35901   #if CYTHON_CCOMPLEX
35902 #else
__Pyx_c_eq_float(__pyx_t_float_complex a,__pyx_t_float_complex b)35903     static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
35904        return (a.real == b.real) && (a.imag == b.imag);
35905     }
__Pyx_c_sum_float(__pyx_t_float_complex a,__pyx_t_float_complex b)35906     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
35907         __pyx_t_float_complex z;
35908         z.real = a.real + b.real;
35909         z.imag = a.imag + b.imag;
35910         return z;
35911     }
__Pyx_c_diff_float(__pyx_t_float_complex a,__pyx_t_float_complex b)35912     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
35913         __pyx_t_float_complex z;
35914         z.real = a.real - b.real;
35915         z.imag = a.imag - b.imag;
35916         return z;
35917     }
__Pyx_c_prod_float(__pyx_t_float_complex a,__pyx_t_float_complex b)35918     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
35919         __pyx_t_float_complex z;
35920         z.real = a.real * b.real - a.imag * b.imag;
35921         z.imag = a.real * b.imag + a.imag * b.real;
35922         return z;
35923     }
35924     #if 1
__Pyx_c_quot_float(__pyx_t_float_complex a,__pyx_t_float_complex b)35925     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
35926         if (b.imag == 0) {
35927             return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
35928         } else if (fabsf(b.real) >= fabsf(b.imag)) {
35929             if (b.real == 0 && b.imag == 0) {
35930                 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
35931             } else {
35932                 float r = b.imag / b.real;
35933                 float s = (float)(1.0) / (b.real + b.imag * r);
35934                 return __pyx_t_float_complex_from_parts(
35935                     (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
35936             }
35937         } else {
35938             float r = b.real / b.imag;
35939             float s = (float)(1.0) / (b.imag + b.real * r);
35940             return __pyx_t_float_complex_from_parts(
35941                 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
35942         }
35943     }
35944     #else
__Pyx_c_quot_float(__pyx_t_float_complex a,__pyx_t_float_complex b)35945     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
35946         if (b.imag == 0) {
35947             return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
35948         } else {
35949             float denom = b.real * b.real + b.imag * b.imag;
35950             return __pyx_t_float_complex_from_parts(
35951                 (a.real * b.real + a.imag * b.imag) / denom,
35952                 (a.imag * b.real - a.real * b.imag) / denom);
35953         }
35954     }
35955     #endif
__Pyx_c_neg_float(__pyx_t_float_complex a)35956     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
35957         __pyx_t_float_complex z;
35958         z.real = -a.real;
35959         z.imag = -a.imag;
35960         return z;
35961     }
__Pyx_c_is_zero_float(__pyx_t_float_complex a)35962     static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
35963        return (a.real == 0) && (a.imag == 0);
35964     }
__Pyx_c_conj_float(__pyx_t_float_complex a)35965     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
35966         __pyx_t_float_complex z;
35967         z.real =  a.real;
35968         z.imag = -a.imag;
35969         return z;
35970     }
35971     #if 1
__Pyx_c_abs_float(__pyx_t_float_complex z)35972         static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
35973           #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
35974             return sqrtf(z.real*z.real + z.imag*z.imag);
35975           #else
35976             return hypotf(z.real, z.imag);
35977           #endif
35978         }
__Pyx_c_pow_float(__pyx_t_float_complex a,__pyx_t_float_complex b)35979         static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
35980             __pyx_t_float_complex z;
35981             float r, lnr, theta, z_r, z_theta;
35982             if (b.imag == 0 && b.real == (int)b.real) {
35983                 if (b.real < 0) {
35984                     float denom = a.real * a.real + a.imag * a.imag;
35985                     a.real = a.real / denom;
35986                     a.imag = -a.imag / denom;
35987                     b.real = -b.real;
35988                 }
35989                 switch ((int)b.real) {
35990                     case 0:
35991                         z.real = 1;
35992                         z.imag = 0;
35993                         return z;
35994                     case 1:
35995                         return a;
35996                     case 2:
35997                         z = __Pyx_c_prod_float(a, a);
35998                         return __Pyx_c_prod_float(a, a);
35999                     case 3:
36000                         z = __Pyx_c_prod_float(a, a);
36001                         return __Pyx_c_prod_float(z, a);
36002                     case 4:
36003                         z = __Pyx_c_prod_float(a, a);
36004                         return __Pyx_c_prod_float(z, z);
36005                 }
36006             }
36007             if (a.imag == 0) {
36008                 if (a.real == 0) {
36009                     return a;
36010                 } else if (b.imag == 0) {
36011                     z.real = powf(a.real, b.real);
36012                     z.imag = 0;
36013                     return z;
36014                 } else if (a.real > 0) {
36015                     r = a.real;
36016                     theta = 0;
36017                 } else {
36018                     r = -a.real;
36019                     theta = atan2f(0.0, -1.0);
36020                 }
36021             } else {
36022                 r = __Pyx_c_abs_float(a);
36023                 theta = atan2f(a.imag, a.real);
36024             }
36025             lnr = logf(r);
36026             z_r = expf(lnr * b.real - theta * b.imag);
36027             z_theta = theta * b.real + lnr * b.imag;
36028             z.real = z_r * cosf(z_theta);
36029             z.imag = z_r * sinf(z_theta);
36030             return z;
36031         }
36032     #endif
36033 #endif
36034 
36035 /* Declarations */
36036   #if CYTHON_CCOMPLEX
36037   #ifdef __cplusplus
__pyx_t_double_complex_from_parts(double x,double y)36038     static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
36039       return ::std::complex< double >(x, y);
36040     }
36041   #else
__pyx_t_double_complex_from_parts(double x,double y)36042     static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
36043       return x + y*(__pyx_t_double_complex)_Complex_I;
36044     }
36045   #endif
36046 #else
__pyx_t_double_complex_from_parts(double x,double y)36047     static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
36048       __pyx_t_double_complex z;
36049       z.real = x;
36050       z.imag = y;
36051       return z;
36052     }
36053 #endif
36054 
36055 /* Arithmetic */
36056   #if CYTHON_CCOMPLEX
36057 #else
__Pyx_c_eq_double(__pyx_t_double_complex a,__pyx_t_double_complex b)36058     static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
36059        return (a.real == b.real) && (a.imag == b.imag);
36060     }
__Pyx_c_sum_double(__pyx_t_double_complex a,__pyx_t_double_complex b)36061     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
36062         __pyx_t_double_complex z;
36063         z.real = a.real + b.real;
36064         z.imag = a.imag + b.imag;
36065         return z;
36066     }
__Pyx_c_diff_double(__pyx_t_double_complex a,__pyx_t_double_complex b)36067     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
36068         __pyx_t_double_complex z;
36069         z.real = a.real - b.real;
36070         z.imag = a.imag - b.imag;
36071         return z;
36072     }
__Pyx_c_prod_double(__pyx_t_double_complex a,__pyx_t_double_complex b)36073     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
36074         __pyx_t_double_complex z;
36075         z.real = a.real * b.real - a.imag * b.imag;
36076         z.imag = a.real * b.imag + a.imag * b.real;
36077         return z;
36078     }
36079     #if 1
__Pyx_c_quot_double(__pyx_t_double_complex a,__pyx_t_double_complex b)36080     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
36081         if (b.imag == 0) {
36082             return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
36083         } else if (fabs(b.real) >= fabs(b.imag)) {
36084             if (b.real == 0 && b.imag == 0) {
36085                 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
36086             } else {
36087                 double r = b.imag / b.real;
36088                 double s = (double)(1.0) / (b.real + b.imag * r);
36089                 return __pyx_t_double_complex_from_parts(
36090                     (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
36091             }
36092         } else {
36093             double r = b.real / b.imag;
36094             double s = (double)(1.0) / (b.imag + b.real * r);
36095             return __pyx_t_double_complex_from_parts(
36096                 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
36097         }
36098     }
36099     #else
__Pyx_c_quot_double(__pyx_t_double_complex a,__pyx_t_double_complex b)36100     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
36101         if (b.imag == 0) {
36102             return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
36103         } else {
36104             double denom = b.real * b.real + b.imag * b.imag;
36105             return __pyx_t_double_complex_from_parts(
36106                 (a.real * b.real + a.imag * b.imag) / denom,
36107                 (a.imag * b.real - a.real * b.imag) / denom);
36108         }
36109     }
36110     #endif
__Pyx_c_neg_double(__pyx_t_double_complex a)36111     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
36112         __pyx_t_double_complex z;
36113         z.real = -a.real;
36114         z.imag = -a.imag;
36115         return z;
36116     }
__Pyx_c_is_zero_double(__pyx_t_double_complex a)36117     static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
36118        return (a.real == 0) && (a.imag == 0);
36119     }
__Pyx_c_conj_double(__pyx_t_double_complex a)36120     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
36121         __pyx_t_double_complex z;
36122         z.real =  a.real;
36123         z.imag = -a.imag;
36124         return z;
36125     }
36126     #if 1
__Pyx_c_abs_double(__pyx_t_double_complex z)36127         static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
36128           #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
36129             return sqrt(z.real*z.real + z.imag*z.imag);
36130           #else
36131             return hypot(z.real, z.imag);
36132           #endif
36133         }
__Pyx_c_pow_double(__pyx_t_double_complex a,__pyx_t_double_complex b)36134         static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
36135             __pyx_t_double_complex z;
36136             double r, lnr, theta, z_r, z_theta;
36137             if (b.imag == 0 && b.real == (int)b.real) {
36138                 if (b.real < 0) {
36139                     double denom = a.real * a.real + a.imag * a.imag;
36140                     a.real = a.real / denom;
36141                     a.imag = -a.imag / denom;
36142                     b.real = -b.real;
36143                 }
36144                 switch ((int)b.real) {
36145                     case 0:
36146                         z.real = 1;
36147                         z.imag = 0;
36148                         return z;
36149                     case 1:
36150                         return a;
36151                     case 2:
36152                         z = __Pyx_c_prod_double(a, a);
36153                         return __Pyx_c_prod_double(a, a);
36154                     case 3:
36155                         z = __Pyx_c_prod_double(a, a);
36156                         return __Pyx_c_prod_double(z, a);
36157                     case 4:
36158                         z = __Pyx_c_prod_double(a, a);
36159                         return __Pyx_c_prod_double(z, z);
36160                 }
36161             }
36162             if (a.imag == 0) {
36163                 if (a.real == 0) {
36164                     return a;
36165                 } else if (b.imag == 0) {
36166                     z.real = pow(a.real, b.real);
36167                     z.imag = 0;
36168                     return z;
36169                 } else if (a.real > 0) {
36170                     r = a.real;
36171                     theta = 0;
36172                 } else {
36173                     r = -a.real;
36174                     theta = atan2(0.0, -1.0);
36175                 }
36176             } else {
36177                 r = __Pyx_c_abs_double(a);
36178                 theta = atan2(a.imag, a.real);
36179             }
36180             lnr = log(r);
36181             z_r = exp(lnr * b.real - theta * b.imag);
36182             z_theta = theta * b.real + lnr * b.imag;
36183             z.real = z_r * cos(z_theta);
36184             z.imag = z_r * sin(z_theta);
36185             return z;
36186         }
36187     #endif
36188 #endif
36189 
36190 /* CIntToPy */
__Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value)36191   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) {
36192     const enum NPY_TYPES neg_one = (enum NPY_TYPES) ((enum NPY_TYPES) 0 - (enum NPY_TYPES) 1), const_zero = (enum NPY_TYPES) 0;
36193     const int is_unsigned = neg_one > const_zero;
36194     if (is_unsigned) {
36195         if (sizeof(enum NPY_TYPES) < sizeof(long)) {
36196             return PyInt_FromLong((long) value);
36197         } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) {
36198             return PyLong_FromUnsignedLong((unsigned long) value);
36199 #ifdef HAVE_LONG_LONG
36200         } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) {
36201             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
36202 #endif
36203         }
36204     } else {
36205         if (sizeof(enum NPY_TYPES) <= sizeof(long)) {
36206             return PyInt_FromLong((long) value);
36207 #ifdef HAVE_LONG_LONG
36208         } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) {
36209             return PyLong_FromLongLong((PY_LONG_LONG) value);
36210 #endif
36211         }
36212     }
36213     {
36214         int one = 1; int little = (int)*(unsigned char *)&one;
36215         unsigned char *bytes = (unsigned char *)&value;
36216         return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES),
36217                                      little, !is_unsigned);
36218     }
36219 }
36220 
36221 /* MemviewSliceCopyTemplate */
36222   static __Pyx_memviewslice
__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice * from_mvs,const char * mode,int ndim,size_t sizeof_dtype,int contig_flag,int dtype_is_object)36223 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
36224                                  const char *mode, int ndim,
36225                                  size_t sizeof_dtype, int contig_flag,
36226                                  int dtype_is_object)
36227 {
36228     __Pyx_RefNannyDeclarations
36229     int i;
36230     __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
36231     struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
36232     Py_buffer *buf = &from_memview->view;
36233     PyObject *shape_tuple = NULL;
36234     PyObject *temp_int = NULL;
36235     struct __pyx_array_obj *array_obj = NULL;
36236     struct __pyx_memoryview_obj *memview_obj = NULL;
36237     __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
36238     for (i = 0; i < ndim; i++) {
36239         if (from_mvs->suboffsets[i] >= 0) {
36240             PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
36241                                            "indirect dimensions (axis %d)", i);
36242             goto fail;
36243         }
36244     }
36245     shape_tuple = PyTuple_New(ndim);
36246     if (unlikely(!shape_tuple)) {
36247         goto fail;
36248     }
36249     __Pyx_GOTREF(shape_tuple);
36250     for(i = 0; i < ndim; i++) {
36251         temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
36252         if(unlikely(!temp_int)) {
36253             goto fail;
36254         } else {
36255             PyTuple_SET_ITEM(shape_tuple, i, temp_int);
36256             temp_int = NULL;
36257         }
36258     }
36259     array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
36260     if (unlikely(!array_obj)) {
36261         goto fail;
36262     }
36263     __Pyx_GOTREF(array_obj);
36264     memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
36265                                     (PyObject *) array_obj, contig_flag,
36266                                     dtype_is_object,
36267                                     from_mvs->memview->typeinfo);
36268     if (unlikely(!memview_obj))
36269         goto fail;
36270     if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
36271         goto fail;
36272     if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
36273                                                 dtype_is_object) < 0))
36274         goto fail;
36275     goto no_fail;
36276 fail:
36277     __Pyx_XDECREF(new_mvs.memview);
36278     new_mvs.memview = NULL;
36279     new_mvs.data = NULL;
36280 no_fail:
36281     __Pyx_XDECREF(shape_tuple);
36282     __Pyx_XDECREF(temp_int);
36283     __Pyx_XDECREF(array_obj);
36284     __Pyx_RefNannyFinishContext();
36285     return new_mvs;
36286 }
36287 
36288 /* TypeInfoToFormat */
__Pyx_TypeInfoToFormat(__Pyx_TypeInfo * type)36289   static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(__Pyx_TypeInfo *type) {
36290     struct __pyx_typeinfo_string result = { {0} };
36291     char *buf = (char *) result.string;
36292     size_t size = type->size;
36293     switch (type->typegroup) {
36294         case 'H':
36295             *buf = 'c';
36296             break;
36297         case 'I':
36298         case 'U':
36299             if (size == 1)
36300                 *buf = (type->is_unsigned) ? 'B' : 'b';
36301             else if (size == 2)
36302                 *buf = (type->is_unsigned) ? 'H' : 'h';
36303             else if (size == 4)
36304                 *buf = (type->is_unsigned) ? 'I' : 'i';
36305             else if (size == 8)
36306                 *buf = (type->is_unsigned) ? 'Q' : 'q';
36307             break;
36308         case 'P':
36309             *buf = 'P';
36310             break;
36311         case 'C':
36312          {
36313             __Pyx_TypeInfo complex_type = *type;
36314             complex_type.typegroup = 'R';
36315             complex_type.size /= 2;
36316             *buf++ = 'Z';
36317             *buf = __Pyx_TypeInfoToFormat(&complex_type).string[0];
36318             break;
36319          }
36320         case 'R':
36321             if (size == 4)
36322                 *buf = 'f';
36323             else if (size == 8)
36324                 *buf = 'd';
36325             else
36326                 *buf = 'g';
36327             break;
36328     }
36329     return result;
36330 }
36331 
36332 /* CIntFromPy */
__Pyx_PyInt_As_int(PyObject * x)36333   static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
36334     const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
36335     const int is_unsigned = neg_one > const_zero;
36336 #if PY_MAJOR_VERSION < 3
36337     if (likely(PyInt_Check(x))) {
36338         if (sizeof(int) < sizeof(long)) {
36339             __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
36340         } else {
36341             long val = PyInt_AS_LONG(x);
36342             if (is_unsigned && unlikely(val < 0)) {
36343                 goto raise_neg_overflow;
36344             }
36345             return (int) val;
36346         }
36347     } else
36348 #endif
36349     if (likely(PyLong_Check(x))) {
36350         if (is_unsigned) {
36351 #if CYTHON_USE_PYLONG_INTERNALS
36352             const digit* digits = ((PyLongObject*)x)->ob_digit;
36353             switch (Py_SIZE(x)) {
36354                 case  0: return (int) 0;
36355                 case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
36356                 case 2:
36357                     if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
36358                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
36359                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36360                         } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
36361                             return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
36362                         }
36363                     }
36364                     break;
36365                 case 3:
36366                     if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
36367                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
36368                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36369                         } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
36370                             return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
36371                         }
36372                     }
36373                     break;
36374                 case 4:
36375                     if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
36376                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
36377                             __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])))
36378                         } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
36379                             return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
36380                         }
36381                     }
36382                     break;
36383             }
36384 #endif
36385 #if CYTHON_COMPILING_IN_CPYTHON
36386             if (unlikely(Py_SIZE(x) < 0)) {
36387                 goto raise_neg_overflow;
36388             }
36389 #else
36390             {
36391                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
36392                 if (unlikely(result < 0))
36393                     return (int) -1;
36394                 if (unlikely(result == 1))
36395                     goto raise_neg_overflow;
36396             }
36397 #endif
36398             if (sizeof(int) <= sizeof(unsigned long)) {
36399                 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
36400 #ifdef HAVE_LONG_LONG
36401             } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
36402                 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
36403 #endif
36404             }
36405         } else {
36406 #if CYTHON_USE_PYLONG_INTERNALS
36407             const digit* digits = ((PyLongObject*)x)->ob_digit;
36408             switch (Py_SIZE(x)) {
36409                 case  0: return (int) 0;
36410                 case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
36411                 case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
36412                 case -2:
36413                     if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
36414                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
36415                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36416                         } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
36417                             return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
36418                         }
36419                     }
36420                     break;
36421                 case 2:
36422                     if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
36423                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
36424                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36425                         } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
36426                             return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
36427                         }
36428                     }
36429                     break;
36430                 case -3:
36431                     if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
36432                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
36433                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36434                         } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
36435                             return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
36436                         }
36437                     }
36438                     break;
36439                 case 3:
36440                     if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
36441                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
36442                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36443                         } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
36444                             return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
36445                         }
36446                     }
36447                     break;
36448                 case -4:
36449                     if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
36450                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
36451                             __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])))
36452                         } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
36453                             return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
36454                         }
36455                     }
36456                     break;
36457                 case 4:
36458                     if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
36459                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
36460                             __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])))
36461                         } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
36462                             return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
36463                         }
36464                     }
36465                     break;
36466             }
36467 #endif
36468             if (sizeof(int) <= sizeof(long)) {
36469                 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
36470 #ifdef HAVE_LONG_LONG
36471             } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
36472                 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
36473 #endif
36474             }
36475         }
36476         {
36477 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
36478             PyErr_SetString(PyExc_RuntimeError,
36479                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
36480 #else
36481             int val;
36482             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
36483  #if PY_MAJOR_VERSION < 3
36484             if (likely(v) && !PyLong_Check(v)) {
36485                 PyObject *tmp = v;
36486                 v = PyNumber_Long(tmp);
36487                 Py_DECREF(tmp);
36488             }
36489  #endif
36490             if (likely(v)) {
36491                 int one = 1; int is_little = (int)*(unsigned char *)&one;
36492                 unsigned char *bytes = (unsigned char *)&val;
36493                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
36494                                               bytes, sizeof(val),
36495                                               is_little, !is_unsigned);
36496                 Py_DECREF(v);
36497                 if (likely(!ret))
36498                     return val;
36499             }
36500 #endif
36501             return (int) -1;
36502         }
36503     } else {
36504         int val;
36505         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
36506         if (!tmp) return (int) -1;
36507         val = __Pyx_PyInt_As_int(tmp);
36508         Py_DECREF(tmp);
36509         return val;
36510     }
36511 raise_overflow:
36512     PyErr_SetString(PyExc_OverflowError,
36513         "value too large to convert to int");
36514     return (int) -1;
36515 raise_neg_overflow:
36516     PyErr_SetString(PyExc_OverflowError,
36517         "can't convert negative value to int");
36518     return (int) -1;
36519 }
36520 
36521 /* CIntFromPy */
__Pyx_PyInt_As_npy_uint64(PyObject * x)36522   static CYTHON_INLINE npy_uint64 __Pyx_PyInt_As_npy_uint64(PyObject *x) {
36523     const npy_uint64 neg_one = (npy_uint64) ((npy_uint64) 0 - (npy_uint64) 1), const_zero = (npy_uint64) 0;
36524     const int is_unsigned = neg_one > const_zero;
36525 #if PY_MAJOR_VERSION < 3
36526     if (likely(PyInt_Check(x))) {
36527         if (sizeof(npy_uint64) < sizeof(long)) {
36528             __PYX_VERIFY_RETURN_INT(npy_uint64, long, PyInt_AS_LONG(x))
36529         } else {
36530             long val = PyInt_AS_LONG(x);
36531             if (is_unsigned && unlikely(val < 0)) {
36532                 goto raise_neg_overflow;
36533             }
36534             return (npy_uint64) val;
36535         }
36536     } else
36537 #endif
36538     if (likely(PyLong_Check(x))) {
36539         if (is_unsigned) {
36540 #if CYTHON_USE_PYLONG_INTERNALS
36541             const digit* digits = ((PyLongObject*)x)->ob_digit;
36542             switch (Py_SIZE(x)) {
36543                 case  0: return (npy_uint64) 0;
36544                 case  1: __PYX_VERIFY_RETURN_INT(npy_uint64, digit, digits[0])
36545                 case 2:
36546                     if (8 * sizeof(npy_uint64) > 1 * PyLong_SHIFT) {
36547                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
36548                             __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36549                         } else if (8 * sizeof(npy_uint64) >= 2 * PyLong_SHIFT) {
36550                             return (npy_uint64) (((((npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]));
36551                         }
36552                     }
36553                     break;
36554                 case 3:
36555                     if (8 * sizeof(npy_uint64) > 2 * PyLong_SHIFT) {
36556                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
36557                             __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36558                         } else if (8 * sizeof(npy_uint64) >= 3 * PyLong_SHIFT) {
36559                             return (npy_uint64) (((((((npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0]));
36560                         }
36561                     }
36562                     break;
36563                 case 4:
36564                     if (8 * sizeof(npy_uint64) > 3 * PyLong_SHIFT) {
36565                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
36566                             __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])))
36567                         } else if (8 * sizeof(npy_uint64) >= 4 * PyLong_SHIFT) {
36568                             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]));
36569                         }
36570                     }
36571                     break;
36572             }
36573 #endif
36574 #if CYTHON_COMPILING_IN_CPYTHON
36575             if (unlikely(Py_SIZE(x) < 0)) {
36576                 goto raise_neg_overflow;
36577             }
36578 #else
36579             {
36580                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
36581                 if (unlikely(result < 0))
36582                     return (npy_uint64) -1;
36583                 if (unlikely(result == 1))
36584                     goto raise_neg_overflow;
36585             }
36586 #endif
36587             if (sizeof(npy_uint64) <= sizeof(unsigned long)) {
36588                 __PYX_VERIFY_RETURN_INT_EXC(npy_uint64, unsigned long, PyLong_AsUnsignedLong(x))
36589 #ifdef HAVE_LONG_LONG
36590             } else if (sizeof(npy_uint64) <= sizeof(unsigned PY_LONG_LONG)) {
36591                 __PYX_VERIFY_RETURN_INT_EXC(npy_uint64, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
36592 #endif
36593             }
36594         } else {
36595 #if CYTHON_USE_PYLONG_INTERNALS
36596             const digit* digits = ((PyLongObject*)x)->ob_digit;
36597             switch (Py_SIZE(x)) {
36598                 case  0: return (npy_uint64) 0;
36599                 case -1: __PYX_VERIFY_RETURN_INT(npy_uint64, sdigit, (sdigit) (-(sdigit)digits[0]))
36600                 case  1: __PYX_VERIFY_RETURN_INT(npy_uint64,  digit, +digits[0])
36601                 case -2:
36602                     if (8 * sizeof(npy_uint64) - 1 > 1 * PyLong_SHIFT) {
36603                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
36604                             __PYX_VERIFY_RETURN_INT(npy_uint64, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36605                         } else if (8 * sizeof(npy_uint64) - 1 > 2 * PyLong_SHIFT) {
36606                             return (npy_uint64) (((npy_uint64)-1)*(((((npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0])));
36607                         }
36608                     }
36609                     break;
36610                 case 2:
36611                     if (8 * sizeof(npy_uint64) > 1 * PyLong_SHIFT) {
36612                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
36613                             __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36614                         } else if (8 * sizeof(npy_uint64) - 1 > 2 * PyLong_SHIFT) {
36615                             return (npy_uint64) ((((((npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0])));
36616                         }
36617                     }
36618                     break;
36619                 case -3:
36620                     if (8 * sizeof(npy_uint64) - 1 > 2 * PyLong_SHIFT) {
36621                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
36622                             __PYX_VERIFY_RETURN_INT(npy_uint64, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36623                         } else if (8 * sizeof(npy_uint64) - 1 > 3 * PyLong_SHIFT) {
36624                             return (npy_uint64) (((npy_uint64)-1)*(((((((npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0])));
36625                         }
36626                     }
36627                     break;
36628                 case 3:
36629                     if (8 * sizeof(npy_uint64) > 2 * PyLong_SHIFT) {
36630                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
36631                             __PYX_VERIFY_RETURN_INT(npy_uint64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36632                         } else if (8 * sizeof(npy_uint64) - 1 > 3 * PyLong_SHIFT) {
36633                             return (npy_uint64) ((((((((npy_uint64)digits[2]) << PyLong_SHIFT) | (npy_uint64)digits[1]) << PyLong_SHIFT) | (npy_uint64)digits[0])));
36634                         }
36635                     }
36636                     break;
36637                 case -4:
36638                     if (8 * sizeof(npy_uint64) - 1 > 3 * PyLong_SHIFT) {
36639                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
36640                             __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])))
36641                         } else if (8 * sizeof(npy_uint64) - 1 > 4 * PyLong_SHIFT) {
36642                             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])));
36643                         }
36644                     }
36645                     break;
36646                 case 4:
36647                     if (8 * sizeof(npy_uint64) > 3 * PyLong_SHIFT) {
36648                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
36649                             __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])))
36650                         } else if (8 * sizeof(npy_uint64) - 1 > 4 * PyLong_SHIFT) {
36651                             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])));
36652                         }
36653                     }
36654                     break;
36655             }
36656 #endif
36657             if (sizeof(npy_uint64) <= sizeof(long)) {
36658                 __PYX_VERIFY_RETURN_INT_EXC(npy_uint64, long, PyLong_AsLong(x))
36659 #ifdef HAVE_LONG_LONG
36660             } else if (sizeof(npy_uint64) <= sizeof(PY_LONG_LONG)) {
36661                 __PYX_VERIFY_RETURN_INT_EXC(npy_uint64, PY_LONG_LONG, PyLong_AsLongLong(x))
36662 #endif
36663             }
36664         }
36665         {
36666 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
36667             PyErr_SetString(PyExc_RuntimeError,
36668                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
36669 #else
36670             npy_uint64 val;
36671             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
36672  #if PY_MAJOR_VERSION < 3
36673             if (likely(v) && !PyLong_Check(v)) {
36674                 PyObject *tmp = v;
36675                 v = PyNumber_Long(tmp);
36676                 Py_DECREF(tmp);
36677             }
36678  #endif
36679             if (likely(v)) {
36680                 int one = 1; int is_little = (int)*(unsigned char *)&one;
36681                 unsigned char *bytes = (unsigned char *)&val;
36682                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
36683                                               bytes, sizeof(val),
36684                                               is_little, !is_unsigned);
36685                 Py_DECREF(v);
36686                 if (likely(!ret))
36687                     return val;
36688             }
36689 #endif
36690             return (npy_uint64) -1;
36691         }
36692     } else {
36693         npy_uint64 val;
36694         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
36695         if (!tmp) return (npy_uint64) -1;
36696         val = __Pyx_PyInt_As_npy_uint64(tmp);
36697         Py_DECREF(tmp);
36698         return val;
36699     }
36700 raise_overflow:
36701     PyErr_SetString(PyExc_OverflowError,
36702         "value too large to convert to npy_uint64");
36703     return (npy_uint64) -1;
36704 raise_neg_overflow:
36705     PyErr_SetString(PyExc_OverflowError,
36706         "can't convert negative value to npy_uint64");
36707     return (npy_uint64) -1;
36708 }
36709 
36710 /* CIntFromPy */
__Pyx_PyInt_As_npy_int32(PyObject * x)36711   static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) {
36712     const npy_int32 neg_one = (npy_int32) ((npy_int32) 0 - (npy_int32) 1), const_zero = (npy_int32) 0;
36713     const int is_unsigned = neg_one > const_zero;
36714 #if PY_MAJOR_VERSION < 3
36715     if (likely(PyInt_Check(x))) {
36716         if (sizeof(npy_int32) < sizeof(long)) {
36717             __PYX_VERIFY_RETURN_INT(npy_int32, long, PyInt_AS_LONG(x))
36718         } else {
36719             long val = PyInt_AS_LONG(x);
36720             if (is_unsigned && unlikely(val < 0)) {
36721                 goto raise_neg_overflow;
36722             }
36723             return (npy_int32) val;
36724         }
36725     } else
36726 #endif
36727     if (likely(PyLong_Check(x))) {
36728         if (is_unsigned) {
36729 #if CYTHON_USE_PYLONG_INTERNALS
36730             const digit* digits = ((PyLongObject*)x)->ob_digit;
36731             switch (Py_SIZE(x)) {
36732                 case  0: return (npy_int32) 0;
36733                 case  1: __PYX_VERIFY_RETURN_INT(npy_int32, digit, digits[0])
36734                 case 2:
36735                     if (8 * sizeof(npy_int32) > 1 * PyLong_SHIFT) {
36736                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
36737                             __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36738                         } else if (8 * sizeof(npy_int32) >= 2 * PyLong_SHIFT) {
36739                             return (npy_int32) (((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
36740                         }
36741                     }
36742                     break;
36743                 case 3:
36744                     if (8 * sizeof(npy_int32) > 2 * PyLong_SHIFT) {
36745                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
36746                             __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36747                         } else if (8 * sizeof(npy_int32) >= 3 * PyLong_SHIFT) {
36748                             return (npy_int32) (((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
36749                         }
36750                     }
36751                     break;
36752                 case 4:
36753                     if (8 * sizeof(npy_int32) > 3 * PyLong_SHIFT) {
36754                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
36755                             __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36756                         } else if (8 * sizeof(npy_int32) >= 4 * PyLong_SHIFT) {
36757                             return (npy_int32) (((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
36758                         }
36759                     }
36760                     break;
36761             }
36762 #endif
36763 #if CYTHON_COMPILING_IN_CPYTHON
36764             if (unlikely(Py_SIZE(x) < 0)) {
36765                 goto raise_neg_overflow;
36766             }
36767 #else
36768             {
36769                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
36770                 if (unlikely(result < 0))
36771                     return (npy_int32) -1;
36772                 if (unlikely(result == 1))
36773                     goto raise_neg_overflow;
36774             }
36775 #endif
36776             if (sizeof(npy_int32) <= sizeof(unsigned long)) {
36777                 __PYX_VERIFY_RETURN_INT_EXC(npy_int32, unsigned long, PyLong_AsUnsignedLong(x))
36778 #ifdef HAVE_LONG_LONG
36779             } else if (sizeof(npy_int32) <= sizeof(unsigned PY_LONG_LONG)) {
36780                 __PYX_VERIFY_RETURN_INT_EXC(npy_int32, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
36781 #endif
36782             }
36783         } else {
36784 #if CYTHON_USE_PYLONG_INTERNALS
36785             const digit* digits = ((PyLongObject*)x)->ob_digit;
36786             switch (Py_SIZE(x)) {
36787                 case  0: return (npy_int32) 0;
36788                 case -1: __PYX_VERIFY_RETURN_INT(npy_int32, sdigit, (sdigit) (-(sdigit)digits[0]))
36789                 case  1: __PYX_VERIFY_RETURN_INT(npy_int32,  digit, +digits[0])
36790                 case -2:
36791                     if (8 * sizeof(npy_int32) - 1 > 1 * PyLong_SHIFT) {
36792                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
36793                             __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36794                         } else if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) {
36795                             return (npy_int32) (((npy_int32)-1)*(((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
36796                         }
36797                     }
36798                     break;
36799                 case 2:
36800                     if (8 * sizeof(npy_int32) > 1 * PyLong_SHIFT) {
36801                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
36802                             __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36803                         } else if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) {
36804                             return (npy_int32) ((((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
36805                         }
36806                     }
36807                     break;
36808                 case -3:
36809                     if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) {
36810                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
36811                             __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36812                         } else if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) {
36813                             return (npy_int32) (((npy_int32)-1)*(((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
36814                         }
36815                     }
36816                     break;
36817                 case 3:
36818                     if (8 * sizeof(npy_int32) > 2 * PyLong_SHIFT) {
36819                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
36820                             __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36821                         } else if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) {
36822                             return (npy_int32) ((((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
36823                         }
36824                     }
36825                     break;
36826                 case -4:
36827                     if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) {
36828                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
36829                             __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36830                         } else if (8 * sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT) {
36831                             return (npy_int32) (((npy_int32)-1)*(((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
36832                         }
36833                     }
36834                     break;
36835                 case 4:
36836                     if (8 * sizeof(npy_int32) > 3 * PyLong_SHIFT) {
36837                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
36838                             __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36839                         } else if (8 * sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT) {
36840                             return (npy_int32) ((((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
36841                         }
36842                     }
36843                     break;
36844             }
36845 #endif
36846             if (sizeof(npy_int32) <= sizeof(long)) {
36847                 __PYX_VERIFY_RETURN_INT_EXC(npy_int32, long, PyLong_AsLong(x))
36848 #ifdef HAVE_LONG_LONG
36849             } else if (sizeof(npy_int32) <= sizeof(PY_LONG_LONG)) {
36850                 __PYX_VERIFY_RETURN_INT_EXC(npy_int32, PY_LONG_LONG, PyLong_AsLongLong(x))
36851 #endif
36852             }
36853         }
36854         {
36855 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
36856             PyErr_SetString(PyExc_RuntimeError,
36857                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
36858 #else
36859             npy_int32 val;
36860             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
36861  #if PY_MAJOR_VERSION < 3
36862             if (likely(v) && !PyLong_Check(v)) {
36863                 PyObject *tmp = v;
36864                 v = PyNumber_Long(tmp);
36865                 Py_DECREF(tmp);
36866             }
36867  #endif
36868             if (likely(v)) {
36869                 int one = 1; int is_little = (int)*(unsigned char *)&one;
36870                 unsigned char *bytes = (unsigned char *)&val;
36871                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
36872                                               bytes, sizeof(val),
36873                                               is_little, !is_unsigned);
36874                 Py_DECREF(v);
36875                 if (likely(!ret))
36876                     return val;
36877             }
36878 #endif
36879             return (npy_int32) -1;
36880         }
36881     } else {
36882         npy_int32 val;
36883         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
36884         if (!tmp) return (npy_int32) -1;
36885         val = __Pyx_PyInt_As_npy_int32(tmp);
36886         Py_DECREF(tmp);
36887         return val;
36888     }
36889 raise_overflow:
36890     PyErr_SetString(PyExc_OverflowError,
36891         "value too large to convert to npy_int32");
36892     return (npy_int32) -1;
36893 raise_neg_overflow:
36894     PyErr_SetString(PyExc_OverflowError,
36895         "can't convert negative value to npy_int32");
36896     return (npy_int32) -1;
36897 }
36898 
36899 /* CIntFromPy */
__Pyx_PyInt_As_npy_int64(PyObject * x)36900   static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *x) {
36901     const npy_int64 neg_one = (npy_int64) ((npy_int64) 0 - (npy_int64) 1), const_zero = (npy_int64) 0;
36902     const int is_unsigned = neg_one > const_zero;
36903 #if PY_MAJOR_VERSION < 3
36904     if (likely(PyInt_Check(x))) {
36905         if (sizeof(npy_int64) < sizeof(long)) {
36906             __PYX_VERIFY_RETURN_INT(npy_int64, long, PyInt_AS_LONG(x))
36907         } else {
36908             long val = PyInt_AS_LONG(x);
36909             if (is_unsigned && unlikely(val < 0)) {
36910                 goto raise_neg_overflow;
36911             }
36912             return (npy_int64) val;
36913         }
36914     } else
36915 #endif
36916     if (likely(PyLong_Check(x))) {
36917         if (is_unsigned) {
36918 #if CYTHON_USE_PYLONG_INTERNALS
36919             const digit* digits = ((PyLongObject*)x)->ob_digit;
36920             switch (Py_SIZE(x)) {
36921                 case  0: return (npy_int64) 0;
36922                 case  1: __PYX_VERIFY_RETURN_INT(npy_int64, digit, digits[0])
36923                 case 2:
36924                     if (8 * sizeof(npy_int64) > 1 * PyLong_SHIFT) {
36925                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
36926                             __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36927                         } else if (8 * sizeof(npy_int64) >= 2 * PyLong_SHIFT) {
36928                             return (npy_int64) (((((npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]));
36929                         }
36930                     }
36931                     break;
36932                 case 3:
36933                     if (8 * sizeof(npy_int64) > 2 * PyLong_SHIFT) {
36934                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
36935                             __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36936                         } else if (8 * sizeof(npy_int64) >= 3 * PyLong_SHIFT) {
36937                             return (npy_int64) (((((((npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]));
36938                         }
36939                     }
36940                     break;
36941                 case 4:
36942                     if (8 * sizeof(npy_int64) > 3 * PyLong_SHIFT) {
36943                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
36944                             __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])))
36945                         } else if (8 * sizeof(npy_int64) >= 4 * PyLong_SHIFT) {
36946                             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]));
36947                         }
36948                     }
36949                     break;
36950             }
36951 #endif
36952 #if CYTHON_COMPILING_IN_CPYTHON
36953             if (unlikely(Py_SIZE(x) < 0)) {
36954                 goto raise_neg_overflow;
36955             }
36956 #else
36957             {
36958                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
36959                 if (unlikely(result < 0))
36960                     return (npy_int64) -1;
36961                 if (unlikely(result == 1))
36962                     goto raise_neg_overflow;
36963             }
36964 #endif
36965             if (sizeof(npy_int64) <= sizeof(unsigned long)) {
36966                 __PYX_VERIFY_RETURN_INT_EXC(npy_int64, unsigned long, PyLong_AsUnsignedLong(x))
36967 #ifdef HAVE_LONG_LONG
36968             } else if (sizeof(npy_int64) <= sizeof(unsigned PY_LONG_LONG)) {
36969                 __PYX_VERIFY_RETURN_INT_EXC(npy_int64, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
36970 #endif
36971             }
36972         } else {
36973 #if CYTHON_USE_PYLONG_INTERNALS
36974             const digit* digits = ((PyLongObject*)x)->ob_digit;
36975             switch (Py_SIZE(x)) {
36976                 case  0: return (npy_int64) 0;
36977                 case -1: __PYX_VERIFY_RETURN_INT(npy_int64, sdigit, (sdigit) (-(sdigit)digits[0]))
36978                 case  1: __PYX_VERIFY_RETURN_INT(npy_int64,  digit, +digits[0])
36979                 case -2:
36980                     if (8 * sizeof(npy_int64) - 1 > 1 * PyLong_SHIFT) {
36981                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
36982                             __PYX_VERIFY_RETURN_INT(npy_int64, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36983                         } else if (8 * sizeof(npy_int64) - 1 > 2 * PyLong_SHIFT) {
36984                             return (npy_int64) (((npy_int64)-1)*(((((npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
36985                         }
36986                     }
36987                     break;
36988                 case 2:
36989                     if (8 * sizeof(npy_int64) > 1 * PyLong_SHIFT) {
36990                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
36991                             __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
36992                         } else if (8 * sizeof(npy_int64) - 1 > 2 * PyLong_SHIFT) {
36993                             return (npy_int64) ((((((npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
36994                         }
36995                     }
36996                     break;
36997                 case -3:
36998                     if (8 * sizeof(npy_int64) - 1 > 2 * PyLong_SHIFT) {
36999                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
37000                             __PYX_VERIFY_RETURN_INT(npy_int64, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37001                         } else if (8 * sizeof(npy_int64) - 1 > 3 * PyLong_SHIFT) {
37002                             return (npy_int64) (((npy_int64)-1)*(((((((npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
37003                         }
37004                     }
37005                     break;
37006                 case 3:
37007                     if (8 * sizeof(npy_int64) > 2 * PyLong_SHIFT) {
37008                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
37009                             __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37010                         } else if (8 * sizeof(npy_int64) - 1 > 3 * PyLong_SHIFT) {
37011                             return (npy_int64) ((((((((npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
37012                         }
37013                     }
37014                     break;
37015                 case -4:
37016                     if (8 * sizeof(npy_int64) - 1 > 3 * PyLong_SHIFT) {
37017                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
37018                             __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])))
37019                         } else if (8 * sizeof(npy_int64) - 1 > 4 * PyLong_SHIFT) {
37020                             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])));
37021                         }
37022                     }
37023                     break;
37024                 case 4:
37025                     if (8 * sizeof(npy_int64) > 3 * PyLong_SHIFT) {
37026                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
37027                             __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])))
37028                         } else if (8 * sizeof(npy_int64) - 1 > 4 * PyLong_SHIFT) {
37029                             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])));
37030                         }
37031                     }
37032                     break;
37033             }
37034 #endif
37035             if (sizeof(npy_int64) <= sizeof(long)) {
37036                 __PYX_VERIFY_RETURN_INT_EXC(npy_int64, long, PyLong_AsLong(x))
37037 #ifdef HAVE_LONG_LONG
37038             } else if (sizeof(npy_int64) <= sizeof(PY_LONG_LONG)) {
37039                 __PYX_VERIFY_RETURN_INT_EXC(npy_int64, PY_LONG_LONG, PyLong_AsLongLong(x))
37040 #endif
37041             }
37042         }
37043         {
37044 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
37045             PyErr_SetString(PyExc_RuntimeError,
37046                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
37047 #else
37048             npy_int64 val;
37049             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
37050  #if PY_MAJOR_VERSION < 3
37051             if (likely(v) && !PyLong_Check(v)) {
37052                 PyObject *tmp = v;
37053                 v = PyNumber_Long(tmp);
37054                 Py_DECREF(tmp);
37055             }
37056  #endif
37057             if (likely(v)) {
37058                 int one = 1; int is_little = (int)*(unsigned char *)&one;
37059                 unsigned char *bytes = (unsigned char *)&val;
37060                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
37061                                               bytes, sizeof(val),
37062                                               is_little, !is_unsigned);
37063                 Py_DECREF(v);
37064                 if (likely(!ret))
37065                     return val;
37066             }
37067 #endif
37068             return (npy_int64) -1;
37069         }
37070     } else {
37071         npy_int64 val;
37072         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
37073         if (!tmp) return (npy_int64) -1;
37074         val = __Pyx_PyInt_As_npy_int64(tmp);
37075         Py_DECREF(tmp);
37076         return val;
37077     }
37078 raise_overflow:
37079     PyErr_SetString(PyExc_OverflowError,
37080         "value too large to convert to npy_int64");
37081     return (npy_int64) -1;
37082 raise_neg_overflow:
37083     PyErr_SetString(PyExc_OverflowError,
37084         "can't convert negative value to npy_int64");
37085     return (npy_int64) -1;
37086 }
37087 
37088 /* CIntFromPy */
__Pyx_PyInt_As_npy_long(PyObject * x)37089   static CYTHON_INLINE npy_long __Pyx_PyInt_As_npy_long(PyObject *x) {
37090     const npy_long neg_one = (npy_long) ((npy_long) 0 - (npy_long) 1), const_zero = (npy_long) 0;
37091     const int is_unsigned = neg_one > const_zero;
37092 #if PY_MAJOR_VERSION < 3
37093     if (likely(PyInt_Check(x))) {
37094         if (sizeof(npy_long) < sizeof(long)) {
37095             __PYX_VERIFY_RETURN_INT(npy_long, long, PyInt_AS_LONG(x))
37096         } else {
37097             long val = PyInt_AS_LONG(x);
37098             if (is_unsigned && unlikely(val < 0)) {
37099                 goto raise_neg_overflow;
37100             }
37101             return (npy_long) val;
37102         }
37103     } else
37104 #endif
37105     if (likely(PyLong_Check(x))) {
37106         if (is_unsigned) {
37107 #if CYTHON_USE_PYLONG_INTERNALS
37108             const digit* digits = ((PyLongObject*)x)->ob_digit;
37109             switch (Py_SIZE(x)) {
37110                 case  0: return (npy_long) 0;
37111                 case  1: __PYX_VERIFY_RETURN_INT(npy_long, digit, digits[0])
37112                 case 2:
37113                     if (8 * sizeof(npy_long) > 1 * PyLong_SHIFT) {
37114                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
37115                             __PYX_VERIFY_RETURN_INT(npy_long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37116                         } else if (8 * sizeof(npy_long) >= 2 * PyLong_SHIFT) {
37117                             return (npy_long) (((((npy_long)digits[1]) << PyLong_SHIFT) | (npy_long)digits[0]));
37118                         }
37119                     }
37120                     break;
37121                 case 3:
37122                     if (8 * sizeof(npy_long) > 2 * PyLong_SHIFT) {
37123                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
37124                             __PYX_VERIFY_RETURN_INT(npy_long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37125                         } else if (8 * sizeof(npy_long) >= 3 * PyLong_SHIFT) {
37126                             return (npy_long) (((((((npy_long)digits[2]) << PyLong_SHIFT) | (npy_long)digits[1]) << PyLong_SHIFT) | (npy_long)digits[0]));
37127                         }
37128                     }
37129                     break;
37130                 case 4:
37131                     if (8 * sizeof(npy_long) > 3 * PyLong_SHIFT) {
37132                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
37133                             __PYX_VERIFY_RETURN_INT(npy_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])))
37134                         } else if (8 * sizeof(npy_long) >= 4 * PyLong_SHIFT) {
37135                             return (npy_long) (((((((((npy_long)digits[3]) << PyLong_SHIFT) | (npy_long)digits[2]) << PyLong_SHIFT) | (npy_long)digits[1]) << PyLong_SHIFT) | (npy_long)digits[0]));
37136                         }
37137                     }
37138                     break;
37139             }
37140 #endif
37141 #if CYTHON_COMPILING_IN_CPYTHON
37142             if (unlikely(Py_SIZE(x) < 0)) {
37143                 goto raise_neg_overflow;
37144             }
37145 #else
37146             {
37147                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
37148                 if (unlikely(result < 0))
37149                     return (npy_long) -1;
37150                 if (unlikely(result == 1))
37151                     goto raise_neg_overflow;
37152             }
37153 #endif
37154             if (sizeof(npy_long) <= sizeof(unsigned long)) {
37155                 __PYX_VERIFY_RETURN_INT_EXC(npy_long, unsigned long, PyLong_AsUnsignedLong(x))
37156 #ifdef HAVE_LONG_LONG
37157             } else if (sizeof(npy_long) <= sizeof(unsigned PY_LONG_LONG)) {
37158                 __PYX_VERIFY_RETURN_INT_EXC(npy_long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
37159 #endif
37160             }
37161         } else {
37162 #if CYTHON_USE_PYLONG_INTERNALS
37163             const digit* digits = ((PyLongObject*)x)->ob_digit;
37164             switch (Py_SIZE(x)) {
37165                 case  0: return (npy_long) 0;
37166                 case -1: __PYX_VERIFY_RETURN_INT(npy_long, sdigit, (sdigit) (-(sdigit)digits[0]))
37167                 case  1: __PYX_VERIFY_RETURN_INT(npy_long,  digit, +digits[0])
37168                 case -2:
37169                     if (8 * sizeof(npy_long) - 1 > 1 * PyLong_SHIFT) {
37170                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
37171                             __PYX_VERIFY_RETURN_INT(npy_long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37172                         } else if (8 * sizeof(npy_long) - 1 > 2 * PyLong_SHIFT) {
37173                             return (npy_long) (((npy_long)-1)*(((((npy_long)digits[1]) << PyLong_SHIFT) | (npy_long)digits[0])));
37174                         }
37175                     }
37176                     break;
37177                 case 2:
37178                     if (8 * sizeof(npy_long) > 1 * PyLong_SHIFT) {
37179                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
37180                             __PYX_VERIFY_RETURN_INT(npy_long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37181                         } else if (8 * sizeof(npy_long) - 1 > 2 * PyLong_SHIFT) {
37182                             return (npy_long) ((((((npy_long)digits[1]) << PyLong_SHIFT) | (npy_long)digits[0])));
37183                         }
37184                     }
37185                     break;
37186                 case -3:
37187                     if (8 * sizeof(npy_long) - 1 > 2 * PyLong_SHIFT) {
37188                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
37189                             __PYX_VERIFY_RETURN_INT(npy_long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37190                         } else if (8 * sizeof(npy_long) - 1 > 3 * PyLong_SHIFT) {
37191                             return (npy_long) (((npy_long)-1)*(((((((npy_long)digits[2]) << PyLong_SHIFT) | (npy_long)digits[1]) << PyLong_SHIFT) | (npy_long)digits[0])));
37192                         }
37193                     }
37194                     break;
37195                 case 3:
37196                     if (8 * sizeof(npy_long) > 2 * PyLong_SHIFT) {
37197                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
37198                             __PYX_VERIFY_RETURN_INT(npy_long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37199                         } else if (8 * sizeof(npy_long) - 1 > 3 * PyLong_SHIFT) {
37200                             return (npy_long) ((((((((npy_long)digits[2]) << PyLong_SHIFT) | (npy_long)digits[1]) << PyLong_SHIFT) | (npy_long)digits[0])));
37201                         }
37202                     }
37203                     break;
37204                 case -4:
37205                     if (8 * sizeof(npy_long) - 1 > 3 * PyLong_SHIFT) {
37206                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
37207                             __PYX_VERIFY_RETURN_INT(npy_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])))
37208                         } else if (8 * sizeof(npy_long) - 1 > 4 * PyLong_SHIFT) {
37209                             return (npy_long) (((npy_long)-1)*(((((((((npy_long)digits[3]) << PyLong_SHIFT) | (npy_long)digits[2]) << PyLong_SHIFT) | (npy_long)digits[1]) << PyLong_SHIFT) | (npy_long)digits[0])));
37210                         }
37211                     }
37212                     break;
37213                 case 4:
37214                     if (8 * sizeof(npy_long) > 3 * PyLong_SHIFT) {
37215                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
37216                             __PYX_VERIFY_RETURN_INT(npy_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])))
37217                         } else if (8 * sizeof(npy_long) - 1 > 4 * PyLong_SHIFT) {
37218                             return (npy_long) ((((((((((npy_long)digits[3]) << PyLong_SHIFT) | (npy_long)digits[2]) << PyLong_SHIFT) | (npy_long)digits[1]) << PyLong_SHIFT) | (npy_long)digits[0])));
37219                         }
37220                     }
37221                     break;
37222             }
37223 #endif
37224             if (sizeof(npy_long) <= sizeof(long)) {
37225                 __PYX_VERIFY_RETURN_INT_EXC(npy_long, long, PyLong_AsLong(x))
37226 #ifdef HAVE_LONG_LONG
37227             } else if (sizeof(npy_long) <= sizeof(PY_LONG_LONG)) {
37228                 __PYX_VERIFY_RETURN_INT_EXC(npy_long, PY_LONG_LONG, PyLong_AsLongLong(x))
37229 #endif
37230             }
37231         }
37232         {
37233 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
37234             PyErr_SetString(PyExc_RuntimeError,
37235                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
37236 #else
37237             npy_long val;
37238             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
37239  #if PY_MAJOR_VERSION < 3
37240             if (likely(v) && !PyLong_Check(v)) {
37241                 PyObject *tmp = v;
37242                 v = PyNumber_Long(tmp);
37243                 Py_DECREF(tmp);
37244             }
37245  #endif
37246             if (likely(v)) {
37247                 int one = 1; int is_little = (int)*(unsigned char *)&one;
37248                 unsigned char *bytes = (unsigned char *)&val;
37249                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
37250                                               bytes, sizeof(val),
37251                                               is_little, !is_unsigned);
37252                 Py_DECREF(v);
37253                 if (likely(!ret))
37254                     return val;
37255             }
37256 #endif
37257             return (npy_long) -1;
37258         }
37259     } else {
37260         npy_long val;
37261         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
37262         if (!tmp) return (npy_long) -1;
37263         val = __Pyx_PyInt_As_npy_long(tmp);
37264         Py_DECREF(tmp);
37265         return val;
37266     }
37267 raise_overflow:
37268     PyErr_SetString(PyExc_OverflowError,
37269         "value too large to convert to npy_long");
37270     return (npy_long) -1;
37271 raise_neg_overflow:
37272     PyErr_SetString(PyExc_OverflowError,
37273         "can't convert negative value to npy_long");
37274     return (npy_long) -1;
37275 }
37276 
37277 /* CIntFromPy */
__Pyx_PyInt_As_npy_uint32(PyObject * x)37278   static CYTHON_INLINE npy_uint32 __Pyx_PyInt_As_npy_uint32(PyObject *x) {
37279     const npy_uint32 neg_one = (npy_uint32) ((npy_uint32) 0 - (npy_uint32) 1), const_zero = (npy_uint32) 0;
37280     const int is_unsigned = neg_one > const_zero;
37281 #if PY_MAJOR_VERSION < 3
37282     if (likely(PyInt_Check(x))) {
37283         if (sizeof(npy_uint32) < sizeof(long)) {
37284             __PYX_VERIFY_RETURN_INT(npy_uint32, long, PyInt_AS_LONG(x))
37285         } else {
37286             long val = PyInt_AS_LONG(x);
37287             if (is_unsigned && unlikely(val < 0)) {
37288                 goto raise_neg_overflow;
37289             }
37290             return (npy_uint32) val;
37291         }
37292     } else
37293 #endif
37294     if (likely(PyLong_Check(x))) {
37295         if (is_unsigned) {
37296 #if CYTHON_USE_PYLONG_INTERNALS
37297             const digit* digits = ((PyLongObject*)x)->ob_digit;
37298             switch (Py_SIZE(x)) {
37299                 case  0: return (npy_uint32) 0;
37300                 case  1: __PYX_VERIFY_RETURN_INT(npy_uint32, digit, digits[0])
37301                 case 2:
37302                     if (8 * sizeof(npy_uint32) > 1 * PyLong_SHIFT) {
37303                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
37304                             __PYX_VERIFY_RETURN_INT(npy_uint32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37305                         } else if (8 * sizeof(npy_uint32) >= 2 * PyLong_SHIFT) {
37306                             return (npy_uint32) (((((npy_uint32)digits[1]) << PyLong_SHIFT) | (npy_uint32)digits[0]));
37307                         }
37308                     }
37309                     break;
37310                 case 3:
37311                     if (8 * sizeof(npy_uint32) > 2 * PyLong_SHIFT) {
37312                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
37313                             __PYX_VERIFY_RETURN_INT(npy_uint32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37314                         } else if (8 * sizeof(npy_uint32) >= 3 * PyLong_SHIFT) {
37315                             return (npy_uint32) (((((((npy_uint32)digits[2]) << PyLong_SHIFT) | (npy_uint32)digits[1]) << PyLong_SHIFT) | (npy_uint32)digits[0]));
37316                         }
37317                     }
37318                     break;
37319                 case 4:
37320                     if (8 * sizeof(npy_uint32) > 3 * PyLong_SHIFT) {
37321                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
37322                             __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])))
37323                         } else if (8 * sizeof(npy_uint32) >= 4 * PyLong_SHIFT) {
37324                             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]));
37325                         }
37326                     }
37327                     break;
37328             }
37329 #endif
37330 #if CYTHON_COMPILING_IN_CPYTHON
37331             if (unlikely(Py_SIZE(x) < 0)) {
37332                 goto raise_neg_overflow;
37333             }
37334 #else
37335             {
37336                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
37337                 if (unlikely(result < 0))
37338                     return (npy_uint32) -1;
37339                 if (unlikely(result == 1))
37340                     goto raise_neg_overflow;
37341             }
37342 #endif
37343             if (sizeof(npy_uint32) <= sizeof(unsigned long)) {
37344                 __PYX_VERIFY_RETURN_INT_EXC(npy_uint32, unsigned long, PyLong_AsUnsignedLong(x))
37345 #ifdef HAVE_LONG_LONG
37346             } else if (sizeof(npy_uint32) <= sizeof(unsigned PY_LONG_LONG)) {
37347                 __PYX_VERIFY_RETURN_INT_EXC(npy_uint32, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
37348 #endif
37349             }
37350         } else {
37351 #if CYTHON_USE_PYLONG_INTERNALS
37352             const digit* digits = ((PyLongObject*)x)->ob_digit;
37353             switch (Py_SIZE(x)) {
37354                 case  0: return (npy_uint32) 0;
37355                 case -1: __PYX_VERIFY_RETURN_INT(npy_uint32, sdigit, (sdigit) (-(sdigit)digits[0]))
37356                 case  1: __PYX_VERIFY_RETURN_INT(npy_uint32,  digit, +digits[0])
37357                 case -2:
37358                     if (8 * sizeof(npy_uint32) - 1 > 1 * PyLong_SHIFT) {
37359                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
37360                             __PYX_VERIFY_RETURN_INT(npy_uint32, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37361                         } else if (8 * sizeof(npy_uint32) - 1 > 2 * PyLong_SHIFT) {
37362                             return (npy_uint32) (((npy_uint32)-1)*(((((npy_uint32)digits[1]) << PyLong_SHIFT) | (npy_uint32)digits[0])));
37363                         }
37364                     }
37365                     break;
37366                 case 2:
37367                     if (8 * sizeof(npy_uint32) > 1 * PyLong_SHIFT) {
37368                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
37369                             __PYX_VERIFY_RETURN_INT(npy_uint32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37370                         } else if (8 * sizeof(npy_uint32) - 1 > 2 * PyLong_SHIFT) {
37371                             return (npy_uint32) ((((((npy_uint32)digits[1]) << PyLong_SHIFT) | (npy_uint32)digits[0])));
37372                         }
37373                     }
37374                     break;
37375                 case -3:
37376                     if (8 * sizeof(npy_uint32) - 1 > 2 * PyLong_SHIFT) {
37377                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
37378                             __PYX_VERIFY_RETURN_INT(npy_uint32, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37379                         } else if (8 * sizeof(npy_uint32) - 1 > 3 * PyLong_SHIFT) {
37380                             return (npy_uint32) (((npy_uint32)-1)*(((((((npy_uint32)digits[2]) << PyLong_SHIFT) | (npy_uint32)digits[1]) << PyLong_SHIFT) | (npy_uint32)digits[0])));
37381                         }
37382                     }
37383                     break;
37384                 case 3:
37385                     if (8 * sizeof(npy_uint32) > 2 * PyLong_SHIFT) {
37386                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
37387                             __PYX_VERIFY_RETURN_INT(npy_uint32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37388                         } else if (8 * sizeof(npy_uint32) - 1 > 3 * PyLong_SHIFT) {
37389                             return (npy_uint32) ((((((((npy_uint32)digits[2]) << PyLong_SHIFT) | (npy_uint32)digits[1]) << PyLong_SHIFT) | (npy_uint32)digits[0])));
37390                         }
37391                     }
37392                     break;
37393                 case -4:
37394                     if (8 * sizeof(npy_uint32) - 1 > 3 * PyLong_SHIFT) {
37395                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
37396                             __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])))
37397                         } else if (8 * sizeof(npy_uint32) - 1 > 4 * PyLong_SHIFT) {
37398                             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])));
37399                         }
37400                     }
37401                     break;
37402                 case 4:
37403                     if (8 * sizeof(npy_uint32) > 3 * PyLong_SHIFT) {
37404                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
37405                             __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])))
37406                         } else if (8 * sizeof(npy_uint32) - 1 > 4 * PyLong_SHIFT) {
37407                             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])));
37408                         }
37409                     }
37410                     break;
37411             }
37412 #endif
37413             if (sizeof(npy_uint32) <= sizeof(long)) {
37414                 __PYX_VERIFY_RETURN_INT_EXC(npy_uint32, long, PyLong_AsLong(x))
37415 #ifdef HAVE_LONG_LONG
37416             } else if (sizeof(npy_uint32) <= sizeof(PY_LONG_LONG)) {
37417                 __PYX_VERIFY_RETURN_INT_EXC(npy_uint32, PY_LONG_LONG, PyLong_AsLongLong(x))
37418 #endif
37419             }
37420         }
37421         {
37422 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
37423             PyErr_SetString(PyExc_RuntimeError,
37424                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
37425 #else
37426             npy_uint32 val;
37427             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
37428  #if PY_MAJOR_VERSION < 3
37429             if (likely(v) && !PyLong_Check(v)) {
37430                 PyObject *tmp = v;
37431                 v = PyNumber_Long(tmp);
37432                 Py_DECREF(tmp);
37433             }
37434  #endif
37435             if (likely(v)) {
37436                 int one = 1; int is_little = (int)*(unsigned char *)&one;
37437                 unsigned char *bytes = (unsigned char *)&val;
37438                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
37439                                               bytes, sizeof(val),
37440                                               is_little, !is_unsigned);
37441                 Py_DECREF(v);
37442                 if (likely(!ret))
37443                     return val;
37444             }
37445 #endif
37446             return (npy_uint32) -1;
37447         }
37448     } else {
37449         npy_uint32 val;
37450         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
37451         if (!tmp) return (npy_uint32) -1;
37452         val = __Pyx_PyInt_As_npy_uint32(tmp);
37453         Py_DECREF(tmp);
37454         return val;
37455     }
37456 raise_overflow:
37457     PyErr_SetString(PyExc_OverflowError,
37458         "value too large to convert to npy_uint32");
37459     return (npy_uint32) -1;
37460 raise_neg_overflow:
37461     PyErr_SetString(PyExc_OverflowError,
37462         "can't convert negative value to npy_uint32");
37463     return (npy_uint32) -1;
37464 }
37465 
37466 /* CIntFromPy */
__Pyx_PyInt_As_long(PyObject * x)37467   static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
37468     const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
37469     const int is_unsigned = neg_one > const_zero;
37470 #if PY_MAJOR_VERSION < 3
37471     if (likely(PyInt_Check(x))) {
37472         if (sizeof(long) < sizeof(long)) {
37473             __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
37474         } else {
37475             long val = PyInt_AS_LONG(x);
37476             if (is_unsigned && unlikely(val < 0)) {
37477                 goto raise_neg_overflow;
37478             }
37479             return (long) val;
37480         }
37481     } else
37482 #endif
37483     if (likely(PyLong_Check(x))) {
37484         if (is_unsigned) {
37485 #if CYTHON_USE_PYLONG_INTERNALS
37486             const digit* digits = ((PyLongObject*)x)->ob_digit;
37487             switch (Py_SIZE(x)) {
37488                 case  0: return (long) 0;
37489                 case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
37490                 case 2:
37491                     if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
37492                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
37493                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37494                         } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
37495                             return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
37496                         }
37497                     }
37498                     break;
37499                 case 3:
37500                     if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
37501                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
37502                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37503                         } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
37504                             return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
37505                         }
37506                     }
37507                     break;
37508                 case 4:
37509                     if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
37510                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
37511                             __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])))
37512                         } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
37513                             return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
37514                         }
37515                     }
37516                     break;
37517             }
37518 #endif
37519 #if CYTHON_COMPILING_IN_CPYTHON
37520             if (unlikely(Py_SIZE(x) < 0)) {
37521                 goto raise_neg_overflow;
37522             }
37523 #else
37524             {
37525                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
37526                 if (unlikely(result < 0))
37527                     return (long) -1;
37528                 if (unlikely(result == 1))
37529                     goto raise_neg_overflow;
37530             }
37531 #endif
37532             if (sizeof(long) <= sizeof(unsigned long)) {
37533                 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
37534 #ifdef HAVE_LONG_LONG
37535             } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
37536                 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
37537 #endif
37538             }
37539         } else {
37540 #if CYTHON_USE_PYLONG_INTERNALS
37541             const digit* digits = ((PyLongObject*)x)->ob_digit;
37542             switch (Py_SIZE(x)) {
37543                 case  0: return (long) 0;
37544                 case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
37545                 case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
37546                 case -2:
37547                     if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
37548                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
37549                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37550                         } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
37551                             return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
37552                         }
37553                     }
37554                     break;
37555                 case 2:
37556                     if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
37557                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
37558                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37559                         } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
37560                             return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
37561                         }
37562                     }
37563                     break;
37564                 case -3:
37565                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
37566                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
37567                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37568                         } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
37569                             return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
37570                         }
37571                     }
37572                     break;
37573                 case 3:
37574                     if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
37575                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
37576                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37577                         } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
37578                             return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
37579                         }
37580                     }
37581                     break;
37582                 case -4:
37583                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
37584                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
37585                             __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])))
37586                         } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
37587                             return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
37588                         }
37589                     }
37590                     break;
37591                 case 4:
37592                     if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
37593                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
37594                             __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])))
37595                         } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
37596                             return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
37597                         }
37598                     }
37599                     break;
37600             }
37601 #endif
37602             if (sizeof(long) <= sizeof(long)) {
37603                 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
37604 #ifdef HAVE_LONG_LONG
37605             } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
37606                 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
37607 #endif
37608             }
37609         }
37610         {
37611 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
37612             PyErr_SetString(PyExc_RuntimeError,
37613                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
37614 #else
37615             long val;
37616             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
37617  #if PY_MAJOR_VERSION < 3
37618             if (likely(v) && !PyLong_Check(v)) {
37619                 PyObject *tmp = v;
37620                 v = PyNumber_Long(tmp);
37621                 Py_DECREF(tmp);
37622             }
37623  #endif
37624             if (likely(v)) {
37625                 int one = 1; int is_little = (int)*(unsigned char *)&one;
37626                 unsigned char *bytes = (unsigned char *)&val;
37627                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
37628                                               bytes, sizeof(val),
37629                                               is_little, !is_unsigned);
37630                 Py_DECREF(v);
37631                 if (likely(!ret))
37632                     return val;
37633             }
37634 #endif
37635             return (long) -1;
37636         }
37637     } else {
37638         long val;
37639         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
37640         if (!tmp) return (long) -1;
37641         val = __Pyx_PyInt_As_long(tmp);
37642         Py_DECREF(tmp);
37643         return val;
37644     }
37645 raise_overflow:
37646     PyErr_SetString(PyExc_OverflowError,
37647         "value too large to convert to long");
37648     return (long) -1;
37649 raise_neg_overflow:
37650     PyErr_SetString(PyExc_OverflowError,
37651         "can't convert negative value to long");
37652     return (long) -1;
37653 }
37654 
37655 /* CIntToPy */
__Pyx_PyInt_From_long(long value)37656   static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
37657     const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
37658     const int is_unsigned = neg_one > const_zero;
37659     if (is_unsigned) {
37660         if (sizeof(long) < sizeof(long)) {
37661             return PyInt_FromLong((long) value);
37662         } else if (sizeof(long) <= sizeof(unsigned long)) {
37663             return PyLong_FromUnsignedLong((unsigned long) value);
37664 #ifdef HAVE_LONG_LONG
37665         } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
37666             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
37667 #endif
37668         }
37669     } else {
37670         if (sizeof(long) <= sizeof(long)) {
37671             return PyInt_FromLong((long) value);
37672 #ifdef HAVE_LONG_LONG
37673         } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
37674             return PyLong_FromLongLong((PY_LONG_LONG) value);
37675 #endif
37676         }
37677     }
37678     {
37679         int one = 1; int little = (int)*(unsigned char *)&one;
37680         unsigned char *bytes = (unsigned char *)&value;
37681         return _PyLong_FromByteArray(bytes, sizeof(long),
37682                                      little, !is_unsigned);
37683     }
37684 }
37685 
37686 /* CIntFromPy */
__Pyx_PyInt_As_char(PyObject * x)37687   static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
37688     const char neg_one = (char) ((char) 0 - (char) 1), const_zero = (char) 0;
37689     const int is_unsigned = neg_one > const_zero;
37690 #if PY_MAJOR_VERSION < 3
37691     if (likely(PyInt_Check(x))) {
37692         if (sizeof(char) < sizeof(long)) {
37693             __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
37694         } else {
37695             long val = PyInt_AS_LONG(x);
37696             if (is_unsigned && unlikely(val < 0)) {
37697                 goto raise_neg_overflow;
37698             }
37699             return (char) val;
37700         }
37701     } else
37702 #endif
37703     if (likely(PyLong_Check(x))) {
37704         if (is_unsigned) {
37705 #if CYTHON_USE_PYLONG_INTERNALS
37706             const digit* digits = ((PyLongObject*)x)->ob_digit;
37707             switch (Py_SIZE(x)) {
37708                 case  0: return (char) 0;
37709                 case  1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
37710                 case 2:
37711                     if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
37712                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
37713                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37714                         } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
37715                             return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
37716                         }
37717                     }
37718                     break;
37719                 case 3:
37720                     if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
37721                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
37722                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37723                         } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
37724                             return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
37725                         }
37726                     }
37727                     break;
37728                 case 4:
37729                     if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
37730                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
37731                             __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])))
37732                         } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
37733                             return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
37734                         }
37735                     }
37736                     break;
37737             }
37738 #endif
37739 #if CYTHON_COMPILING_IN_CPYTHON
37740             if (unlikely(Py_SIZE(x) < 0)) {
37741                 goto raise_neg_overflow;
37742             }
37743 #else
37744             {
37745                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
37746                 if (unlikely(result < 0))
37747                     return (char) -1;
37748                 if (unlikely(result == 1))
37749                     goto raise_neg_overflow;
37750             }
37751 #endif
37752             if (sizeof(char) <= sizeof(unsigned long)) {
37753                 __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
37754 #ifdef HAVE_LONG_LONG
37755             } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
37756                 __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
37757 #endif
37758             }
37759         } else {
37760 #if CYTHON_USE_PYLONG_INTERNALS
37761             const digit* digits = ((PyLongObject*)x)->ob_digit;
37762             switch (Py_SIZE(x)) {
37763                 case  0: return (char) 0;
37764                 case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
37765                 case  1: __PYX_VERIFY_RETURN_INT(char,  digit, +digits[0])
37766                 case -2:
37767                     if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
37768                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
37769                             __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37770                         } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
37771                             return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
37772                         }
37773                     }
37774                     break;
37775                 case 2:
37776                     if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
37777                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
37778                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37779                         } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
37780                             return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
37781                         }
37782                     }
37783                     break;
37784                 case -3:
37785                     if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
37786                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
37787                             __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37788                         } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
37789                             return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
37790                         }
37791                     }
37792                     break;
37793                 case 3:
37794                     if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
37795                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
37796                             __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37797                         } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
37798                             return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
37799                         }
37800                     }
37801                     break;
37802                 case -4:
37803                     if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
37804                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
37805                             __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])))
37806                         } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
37807                             return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
37808                         }
37809                     }
37810                     break;
37811                 case 4:
37812                     if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
37813                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
37814                             __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])))
37815                         } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
37816                             return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
37817                         }
37818                     }
37819                     break;
37820             }
37821 #endif
37822             if (sizeof(char) <= sizeof(long)) {
37823                 __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
37824 #ifdef HAVE_LONG_LONG
37825             } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
37826                 __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
37827 #endif
37828             }
37829         }
37830         {
37831 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
37832             PyErr_SetString(PyExc_RuntimeError,
37833                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
37834 #else
37835             char val;
37836             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
37837  #if PY_MAJOR_VERSION < 3
37838             if (likely(v) && !PyLong_Check(v)) {
37839                 PyObject *tmp = v;
37840                 v = PyNumber_Long(tmp);
37841                 Py_DECREF(tmp);
37842             }
37843  #endif
37844             if (likely(v)) {
37845                 int one = 1; int is_little = (int)*(unsigned char *)&one;
37846                 unsigned char *bytes = (unsigned char *)&val;
37847                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
37848                                               bytes, sizeof(val),
37849                                               is_little, !is_unsigned);
37850                 Py_DECREF(v);
37851                 if (likely(!ret))
37852                     return val;
37853             }
37854 #endif
37855             return (char) -1;
37856         }
37857     } else {
37858         char val;
37859         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
37860         if (!tmp) return (char) -1;
37861         val = __Pyx_PyInt_As_char(tmp);
37862         Py_DECREF(tmp);
37863         return val;
37864     }
37865 raise_overflow:
37866     PyErr_SetString(PyExc_OverflowError,
37867         "value too large to convert to char");
37868     return (char) -1;
37869 raise_neg_overflow:
37870     PyErr_SetString(PyExc_OverflowError,
37871         "can't convert negative value to char");
37872     return (char) -1;
37873 }
37874 
37875 /* FetchCommonType */
__Pyx_FetchCommonType(PyTypeObject * type)37876   static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
37877     PyObject* fake_module;
37878     PyTypeObject* cached_type = NULL;
37879     fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
37880     if (!fake_module) return NULL;
37881     Py_INCREF(fake_module);
37882     cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
37883     if (cached_type) {
37884         if (!PyType_Check((PyObject*)cached_type)) {
37885             PyErr_Format(PyExc_TypeError,
37886                 "Shared Cython type %.200s is not a type object",
37887                 type->tp_name);
37888             goto bad;
37889         }
37890         if (cached_type->tp_basicsize != type->tp_basicsize) {
37891             PyErr_Format(PyExc_TypeError,
37892                 "Shared Cython type %.200s has the wrong size, try recompiling",
37893                 type->tp_name);
37894             goto bad;
37895         }
37896     } else {
37897         if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
37898         PyErr_Clear();
37899         if (PyType_Ready(type) < 0) goto bad;
37900         if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
37901             goto bad;
37902         Py_INCREF(type);
37903         cached_type = type;
37904     }
37905 done:
37906     Py_DECREF(fake_module);
37907     return cached_type;
37908 bad:
37909     Py_XDECREF(cached_type);
37910     cached_type = NULL;
37911     goto done;
37912 }
37913 
37914 /* PyObjectGetMethod */
__Pyx_PyObject_GetMethod(PyObject * obj,PyObject * name,PyObject ** method)37915   static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
37916     PyObject *attr;
37917 #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
37918     PyTypeObject *tp = Py_TYPE(obj);
37919     PyObject *descr;
37920     descrgetfunc f = NULL;
37921     PyObject **dictptr, *dict;
37922     int meth_found = 0;
37923     assert (*method == NULL);
37924     if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
37925         attr = __Pyx_PyObject_GetAttrStr(obj, name);
37926         goto try_unpack;
37927     }
37928     if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
37929         return 0;
37930     }
37931     descr = _PyType_Lookup(tp, name);
37932     if (likely(descr != NULL)) {
37933         Py_INCREF(descr);
37934 #if PY_MAJOR_VERSION >= 3
37935         #ifdef __Pyx_CyFunction_USED
37936         if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
37937         #else
37938         if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type)))
37939         #endif
37940 #else
37941         #ifdef __Pyx_CyFunction_USED
37942         if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
37943         #else
37944         if (likely(PyFunction_Check(descr)))
37945         #endif
37946 #endif
37947         {
37948             meth_found = 1;
37949         } else {
37950             f = Py_TYPE(descr)->tp_descr_get;
37951             if (f != NULL && PyDescr_IsData(descr)) {
37952                 attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
37953                 Py_DECREF(descr);
37954                 goto try_unpack;
37955             }
37956         }
37957     }
37958     dictptr = _PyObject_GetDictPtr(obj);
37959     if (dictptr != NULL && (dict = *dictptr) != NULL) {
37960         Py_INCREF(dict);
37961         attr = __Pyx_PyDict_GetItemStr(dict, name);
37962         if (attr != NULL) {
37963             Py_INCREF(attr);
37964             Py_DECREF(dict);
37965             Py_XDECREF(descr);
37966             goto try_unpack;
37967         }
37968         Py_DECREF(dict);
37969     }
37970     if (meth_found) {
37971         *method = descr;
37972         return 1;
37973     }
37974     if (f != NULL) {
37975         attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
37976         Py_DECREF(descr);
37977         goto try_unpack;
37978     }
37979     if (descr != NULL) {
37980         *method = descr;
37981         return 0;
37982     }
37983     PyErr_Format(PyExc_AttributeError,
37984 #if PY_MAJOR_VERSION >= 3
37985                  "'%.50s' object has no attribute '%U'",
37986                  tp->tp_name, name);
37987 #else
37988                  "'%.50s' object has no attribute '%.400s'",
37989                  tp->tp_name, PyString_AS_STRING(name));
37990 #endif
37991     return 0;
37992 #else
37993     attr = __Pyx_PyObject_GetAttrStr(obj, name);
37994     goto try_unpack;
37995 #endif
37996 try_unpack:
37997 #if CYTHON_UNPACK_METHODS
37998     if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
37999         PyObject *function = PyMethod_GET_FUNCTION(attr);
38000         Py_INCREF(function);
38001         Py_DECREF(attr);
38002         *method = function;
38003         return 1;
38004     }
38005 #endif
38006     *method = attr;
38007     return 0;
38008 }
38009 
38010 /* PyObjectCallMethod1 */
__Pyx__PyObject_CallMethod1(PyObject * method,PyObject * arg)38011   static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
38012     PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
38013     Py_DECREF(method);
38014     return result;
38015 }
__Pyx_PyObject_CallMethod1(PyObject * obj,PyObject * method_name,PyObject * arg)38016 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
38017     PyObject *method = NULL, *result;
38018     int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
38019     if (likely(is_method)) {
38020         result = __Pyx_PyObject_Call2Args(method, obj, arg);
38021         Py_DECREF(method);
38022         return result;
38023     }
38024     if (unlikely(!method)) return NULL;
38025     return __Pyx__PyObject_CallMethod1(method, arg);
38026 }
38027 
38028 /* CoroutineBase */
38029   #include <structmember.h>
38030 #include <frameobject.h>
38031 #define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
__Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState * __pyx_tstate,PyObject ** pvalue)38032 static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject **pvalue) {
38033     PyObject *et, *ev, *tb;
38034     PyObject *value = NULL;
38035     __Pyx_ErrFetch(&et, &ev, &tb);
38036     if (!et) {
38037         Py_XDECREF(tb);
38038         Py_XDECREF(ev);
38039         Py_INCREF(Py_None);
38040         *pvalue = Py_None;
38041         return 0;
38042     }
38043     if (likely(et == PyExc_StopIteration)) {
38044         if (!ev) {
38045             Py_INCREF(Py_None);
38046             value = Py_None;
38047         }
38048 #if PY_VERSION_HEX >= 0x030300A0
38049         else if (Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) {
38050             value = ((PyStopIterationObject *)ev)->value;
38051             Py_INCREF(value);
38052             Py_DECREF(ev);
38053         }
38054 #endif
38055         else if (unlikely(PyTuple_Check(ev))) {
38056             if (PyTuple_GET_SIZE(ev) >= 1) {
38057 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
38058                 value = PyTuple_GET_ITEM(ev, 0);
38059                 Py_INCREF(value);
38060 #else
38061                 value = PySequence_ITEM(ev, 0);
38062 #endif
38063             } else {
38064                 Py_INCREF(Py_None);
38065                 value = Py_None;
38066             }
38067             Py_DECREF(ev);
38068         }
38069         else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
38070             value = ev;
38071         }
38072         if (likely(value)) {
38073             Py_XDECREF(tb);
38074             Py_DECREF(et);
38075             *pvalue = value;
38076             return 0;
38077         }
38078     } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
38079         __Pyx_ErrRestore(et, ev, tb);
38080         return -1;
38081     }
38082     PyErr_NormalizeException(&et, &ev, &tb);
38083     if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
38084         __Pyx_ErrRestore(et, ev, tb);
38085         return -1;
38086     }
38087     Py_XDECREF(tb);
38088     Py_DECREF(et);
38089 #if PY_VERSION_HEX >= 0x030300A0
38090     value = ((PyStopIterationObject *)ev)->value;
38091     Py_INCREF(value);
38092     Py_DECREF(ev);
38093 #else
38094     {
38095         PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args);
38096         Py_DECREF(ev);
38097         if (likely(args)) {
38098             value = PySequence_GetItem(args, 0);
38099             Py_DECREF(args);
38100         }
38101         if (unlikely(!value)) {
38102             __Pyx_ErrRestore(NULL, NULL, NULL);
38103             Py_INCREF(Py_None);
38104             value = Py_None;
38105         }
38106     }
38107 #endif
38108     *pvalue = value;
38109     return 0;
38110 }
38111 static CYTHON_INLINE
__Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct * exc_state)38112 void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) {
38113     PyObject *t, *v, *tb;
38114     t = exc_state->exc_type;
38115     v = exc_state->exc_value;
38116     tb = exc_state->exc_traceback;
38117     exc_state->exc_type = NULL;
38118     exc_state->exc_value = NULL;
38119     exc_state->exc_traceback = NULL;
38120     Py_XDECREF(t);
38121     Py_XDECREF(v);
38122     Py_XDECREF(tb);
38123 }
38124 #define __Pyx_Coroutine_AlreadyRunningError(gen)  (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL)
__Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject * gen)38125 static void __Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject *gen) {
38126     const char *msg;
38127     if ((0)) {
38128     #ifdef __Pyx_Coroutine_USED
38129     } else if (__Pyx_Coroutine_Check((PyObject*)gen)) {
38130         msg = "coroutine already executing";
38131     #endif
38132     #ifdef __Pyx_AsyncGen_USED
38133     } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
38134         msg = "async generator already executing";
38135     #endif
38136     } else {
38137         msg = "generator already executing";
38138     }
38139     PyErr_SetString(PyExc_ValueError, msg);
38140 }
38141 #define __Pyx_Coroutine_NotStartedError(gen)  (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL)
__Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject * gen)38142 static void __Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject *gen) {
38143     const char *msg;
38144     if ((0)) {
38145     #ifdef __Pyx_Coroutine_USED
38146     } else if (__Pyx_Coroutine_Check(gen)) {
38147         msg = "can't send non-None value to a just-started coroutine";
38148     #endif
38149     #ifdef __Pyx_AsyncGen_USED
38150     } else if (__Pyx_AsyncGen_CheckExact(gen)) {
38151         msg = "can't send non-None value to a just-started async generator";
38152     #endif
38153     } else {
38154         msg = "can't send non-None value to a just-started generator";
38155     }
38156     PyErr_SetString(PyExc_TypeError, msg);
38157 }
38158 #define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing)  (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL)
__Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject * gen,PyObject * value,CYTHON_UNUSED int closing)38159 static void __Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject *gen, PyObject *value, CYTHON_UNUSED int closing) {
38160     #ifdef __Pyx_Coroutine_USED
38161     if (!closing && __Pyx_Coroutine_Check(gen)) {
38162         PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine");
38163     } else
38164     #endif
38165     if (value) {
38166         #ifdef __Pyx_AsyncGen_USED
38167         if (__Pyx_AsyncGen_CheckExact(gen))
38168             PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration);
38169         else
38170         #endif
38171         PyErr_SetNone(PyExc_StopIteration);
38172     }
38173 }
38174 static
__Pyx_Coroutine_SendEx(__pyx_CoroutineObject * self,PyObject * value,int closing)38175 PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) {
38176     __Pyx_PyThreadState_declare
38177     PyThreadState *tstate;
38178     __Pyx_ExcInfoStruct *exc_state;
38179     PyObject *retval;
38180     assert(!self->is_running);
38181     if (unlikely(self->resume_label == 0)) {
38182         if (unlikely(value && value != Py_None)) {
38183             return __Pyx_Coroutine_NotStartedError((PyObject*)self);
38184         }
38185     }
38186     if (unlikely(self->resume_label == -1)) {
38187         return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing);
38188     }
38189 #if CYTHON_FAST_THREAD_STATE
38190     __Pyx_PyThreadState_assign
38191     tstate = __pyx_tstate;
38192 #else
38193     tstate = __Pyx_PyThreadState_Current;
38194 #endif
38195     exc_state = &self->gi_exc_state;
38196     if (exc_state->exc_type) {
38197         #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
38198         #else
38199         if (exc_state->exc_traceback) {
38200             PyTracebackObject *tb = (PyTracebackObject *) exc_state->exc_traceback;
38201             PyFrameObject *f = tb->tb_frame;
38202             Py_XINCREF(tstate->frame);
38203             assert(f->f_back == NULL);
38204             f->f_back = tstate->frame;
38205         }
38206         #endif
38207     }
38208 #if CYTHON_USE_EXC_INFO_STACK
38209     exc_state->previous_item = tstate->exc_info;
38210     tstate->exc_info = exc_state;
38211 #else
38212     if (exc_state->exc_type) {
38213         __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
38214     } else {
38215         __Pyx_Coroutine_ExceptionClear(exc_state);
38216         __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
38217     }
38218 #endif
38219     self->is_running = 1;
38220     retval = self->body((PyObject *) self, tstate, value);
38221     self->is_running = 0;
38222 #if CYTHON_USE_EXC_INFO_STACK
38223     exc_state = &self->gi_exc_state;
38224     tstate->exc_info = exc_state->previous_item;
38225     exc_state->previous_item = NULL;
38226     __Pyx_Coroutine_ResetFrameBackpointer(exc_state);
38227 #endif
38228     return retval;
38229 }
__Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct * exc_state)38230 static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) {
38231     PyObject *exc_tb = exc_state->exc_traceback;
38232     if (likely(exc_tb)) {
38233 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
38234 #else
38235         PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
38236         PyFrameObject *f = tb->tb_frame;
38237         Py_CLEAR(f->f_back);
38238 #endif
38239     }
38240 }
38241 static CYTHON_INLINE
__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject * gen,PyObject * retval)38242 PyObject *__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject* gen, PyObject *retval) {
38243     if (unlikely(!retval)) {
38244         __Pyx_PyThreadState_declare
38245         __Pyx_PyThreadState_assign
38246         if (!__Pyx_PyErr_Occurred()) {
38247             PyObject *exc = PyExc_StopIteration;
38248             #ifdef __Pyx_AsyncGen_USED
38249             if (__Pyx_AsyncGen_CheckExact(gen))
38250                 exc = __Pyx_PyExc_StopAsyncIteration;
38251             #endif
38252             __Pyx_PyErr_SetNone(exc);
38253         }
38254     }
38255     return retval;
38256 }
38257 static CYTHON_INLINE
__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject * gen)38258 PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
38259     PyObject *ret;
38260     PyObject *val = NULL;
38261     __Pyx_Coroutine_Undelegate(gen);
38262     __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
38263     ret = __Pyx_Coroutine_SendEx(gen, val, 0);
38264     Py_XDECREF(val);
38265     return ret;
38266 }
__Pyx_Coroutine_Send(PyObject * self,PyObject * value)38267 static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
38268     PyObject *retval;
38269     __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
38270     PyObject *yf = gen->yieldfrom;
38271     if (unlikely(gen->is_running))
38272         return __Pyx_Coroutine_AlreadyRunningError(gen);
38273     if (yf) {
38274         PyObject *ret;
38275         gen->is_running = 1;
38276         #ifdef __Pyx_Generator_USED
38277         if (__Pyx_Generator_CheckExact(yf)) {
38278             ret = __Pyx_Coroutine_Send(yf, value);
38279         } else
38280         #endif
38281         #ifdef __Pyx_Coroutine_USED
38282         if (__Pyx_Coroutine_Check(yf)) {
38283             ret = __Pyx_Coroutine_Send(yf, value);
38284         } else
38285         #endif
38286         #ifdef __Pyx_AsyncGen_USED
38287         if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
38288             ret = __Pyx_async_gen_asend_send(yf, value);
38289         } else
38290         #endif
38291         #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
38292         if (PyGen_CheckExact(yf)) {
38293             ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
38294         } else
38295         #endif
38296         #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
38297         if (PyCoro_CheckExact(yf)) {
38298             ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
38299         } else
38300         #endif
38301         {
38302             if (value == Py_None)
38303                 ret = Py_TYPE(yf)->tp_iternext(yf);
38304             else
38305                 ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
38306         }
38307         gen->is_running = 0;
38308         if (likely(ret)) {
38309             return ret;
38310         }
38311         retval = __Pyx_Coroutine_FinishDelegation(gen);
38312     } else {
38313         retval = __Pyx_Coroutine_SendEx(gen, value, 0);
38314     }
38315     return __Pyx_Coroutine_MethodReturn(self, retval);
38316 }
__Pyx_Coroutine_CloseIter(__pyx_CoroutineObject * gen,PyObject * yf)38317 static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
38318     PyObject *retval = NULL;
38319     int err = 0;
38320     #ifdef __Pyx_Generator_USED
38321     if (__Pyx_Generator_CheckExact(yf)) {
38322         retval = __Pyx_Coroutine_Close(yf);
38323         if (!retval)
38324             return -1;
38325     } else
38326     #endif
38327     #ifdef __Pyx_Coroutine_USED
38328     if (__Pyx_Coroutine_Check(yf)) {
38329         retval = __Pyx_Coroutine_Close(yf);
38330         if (!retval)
38331             return -1;
38332     } else
38333     if (__Pyx_CoroutineAwait_CheckExact(yf)) {
38334         retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL);
38335         if (!retval)
38336             return -1;
38337     } else
38338     #endif
38339     #ifdef __Pyx_AsyncGen_USED
38340     if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
38341         retval = __Pyx_async_gen_asend_close(yf, NULL);
38342     } else
38343     if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
38344         retval = __Pyx_async_gen_athrow_close(yf, NULL);
38345     } else
38346     #endif
38347     {
38348         PyObject *meth;
38349         gen->is_running = 1;
38350         meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close);
38351         if (unlikely(!meth)) {
38352             if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
38353                 PyErr_WriteUnraisable(yf);
38354             }
38355             PyErr_Clear();
38356         } else {
38357             retval = PyObject_CallFunction(meth, NULL);
38358             Py_DECREF(meth);
38359             if (!retval)
38360                 err = -1;
38361         }
38362         gen->is_running = 0;
38363     }
38364     Py_XDECREF(retval);
38365     return err;
38366 }
__Pyx_Generator_Next(PyObject * self)38367 static PyObject *__Pyx_Generator_Next(PyObject *self) {
38368     __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
38369     PyObject *yf = gen->yieldfrom;
38370     if (unlikely(gen->is_running))
38371         return __Pyx_Coroutine_AlreadyRunningError(gen);
38372     if (yf) {
38373         PyObject *ret;
38374         gen->is_running = 1;
38375         #ifdef __Pyx_Generator_USED
38376         if (__Pyx_Generator_CheckExact(yf)) {
38377             ret = __Pyx_Generator_Next(yf);
38378         } else
38379         #endif
38380         #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
38381         if (PyGen_CheckExact(yf)) {
38382             ret = _PyGen_Send((PyGenObject*)yf, NULL);
38383         } else
38384         #endif
38385         #ifdef __Pyx_Coroutine_USED
38386         if (__Pyx_Coroutine_Check(yf)) {
38387             ret = __Pyx_Coroutine_Send(yf, Py_None);
38388         } else
38389         #endif
38390             ret = Py_TYPE(yf)->tp_iternext(yf);
38391         gen->is_running = 0;
38392         if (likely(ret)) {
38393             return ret;
38394         }
38395         return __Pyx_Coroutine_FinishDelegation(gen);
38396     }
38397     return __Pyx_Coroutine_SendEx(gen, Py_None, 0);
38398 }
__Pyx_Coroutine_Close_Method(PyObject * self,CYTHON_UNUSED PyObject * arg)38399 static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, CYTHON_UNUSED PyObject *arg) {
38400     return __Pyx_Coroutine_Close(self);
38401 }
__Pyx_Coroutine_Close(PyObject * self)38402 static PyObject *__Pyx_Coroutine_Close(PyObject *self) {
38403     __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
38404     PyObject *retval, *raised_exception;
38405     PyObject *yf = gen->yieldfrom;
38406     int err = 0;
38407     if (unlikely(gen->is_running))
38408         return __Pyx_Coroutine_AlreadyRunningError(gen);
38409     if (yf) {
38410         Py_INCREF(yf);
38411         err = __Pyx_Coroutine_CloseIter(gen, yf);
38412         __Pyx_Coroutine_Undelegate(gen);
38413         Py_DECREF(yf);
38414     }
38415     if (err == 0)
38416         PyErr_SetNone(PyExc_GeneratorExit);
38417     retval = __Pyx_Coroutine_SendEx(gen, NULL, 1);
38418     if (unlikely(retval)) {
38419         const char *msg;
38420         Py_DECREF(retval);
38421         if ((0)) {
38422         #ifdef __Pyx_Coroutine_USED
38423         } else if (__Pyx_Coroutine_Check(self)) {
38424             msg = "coroutine ignored GeneratorExit";
38425         #endif
38426         #ifdef __Pyx_AsyncGen_USED
38427         } else if (__Pyx_AsyncGen_CheckExact(self)) {
38428 #if PY_VERSION_HEX < 0x03060000
38429             msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)";
38430 #else
38431             msg = "async generator ignored GeneratorExit";
38432 #endif
38433         #endif
38434         } else {
38435             msg = "generator ignored GeneratorExit";
38436         }
38437         PyErr_SetString(PyExc_RuntimeError, msg);
38438         return NULL;
38439     }
38440     raised_exception = PyErr_Occurred();
38441     if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) {
38442         if (raised_exception) PyErr_Clear();
38443         Py_INCREF(Py_None);
38444         return Py_None;
38445     }
38446     return NULL;
38447 }
__Pyx__Coroutine_Throw(PyObject * self,PyObject * typ,PyObject * val,PyObject * tb,PyObject * args,int close_on_genexit)38448 static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb,
38449                                         PyObject *args, int close_on_genexit) {
38450     __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
38451     PyObject *yf = gen->yieldfrom;
38452     if (unlikely(gen->is_running))
38453         return __Pyx_Coroutine_AlreadyRunningError(gen);
38454     if (yf) {
38455         PyObject *ret;
38456         Py_INCREF(yf);
38457         if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
38458             int err = __Pyx_Coroutine_CloseIter(gen, yf);
38459             Py_DECREF(yf);
38460             __Pyx_Coroutine_Undelegate(gen);
38461             if (err < 0)
38462                 return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
38463             goto throw_here;
38464         }
38465         gen->is_running = 1;
38466         if (0
38467         #ifdef __Pyx_Generator_USED
38468             || __Pyx_Generator_CheckExact(yf)
38469         #endif
38470         #ifdef __Pyx_Coroutine_USED
38471             || __Pyx_Coroutine_Check(yf)
38472         #endif
38473             ) {
38474             ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
38475         #ifdef __Pyx_Coroutine_USED
38476         } else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
38477             ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
38478         #endif
38479         } else {
38480             PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw);
38481             if (unlikely(!meth)) {
38482                 Py_DECREF(yf);
38483                 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
38484                     gen->is_running = 0;
38485                     return NULL;
38486                 }
38487                 PyErr_Clear();
38488                 __Pyx_Coroutine_Undelegate(gen);
38489                 gen->is_running = 0;
38490                 goto throw_here;
38491             }
38492             if (likely(args)) {
38493                 ret = PyObject_CallObject(meth, args);
38494             } else {
38495                 ret = PyObject_CallFunctionObjArgs(meth, typ, val, tb, NULL);
38496             }
38497             Py_DECREF(meth);
38498         }
38499         gen->is_running = 0;
38500         Py_DECREF(yf);
38501         if (!ret) {
38502             ret = __Pyx_Coroutine_FinishDelegation(gen);
38503         }
38504         return __Pyx_Coroutine_MethodReturn(self, ret);
38505     }
38506 throw_here:
38507     __Pyx_Raise(typ, val, tb, NULL);
38508     return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
38509 }
__Pyx_Coroutine_Throw(PyObject * self,PyObject * args)38510 static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
38511     PyObject *typ;
38512     PyObject *val = NULL;
38513     PyObject *tb = NULL;
38514     if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))
38515         return NULL;
38516     return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1);
38517 }
__Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct * exc_state,visitproc visit,void * arg)38518 static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) {
38519     Py_VISIT(exc_state->exc_type);
38520     Py_VISIT(exc_state->exc_value);
38521     Py_VISIT(exc_state->exc_traceback);
38522     return 0;
38523 }
__Pyx_Coroutine_traverse(__pyx_CoroutineObject * gen,visitproc visit,void * arg)38524 static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) {
38525     Py_VISIT(gen->closure);
38526     Py_VISIT(gen->classobj);
38527     Py_VISIT(gen->yieldfrom);
38528     return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg);
38529 }
__Pyx_Coroutine_clear(PyObject * self)38530 static int __Pyx_Coroutine_clear(PyObject *self) {
38531     __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
38532     Py_CLEAR(gen->closure);
38533     Py_CLEAR(gen->classobj);
38534     Py_CLEAR(gen->yieldfrom);
38535     __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state);
38536 #ifdef __Pyx_AsyncGen_USED
38537     if (__Pyx_AsyncGen_CheckExact(self)) {
38538         Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
38539     }
38540 #endif
38541     Py_CLEAR(gen->gi_code);
38542     Py_CLEAR(gen->gi_name);
38543     Py_CLEAR(gen->gi_qualname);
38544     Py_CLEAR(gen->gi_modulename);
38545     return 0;
38546 }
__Pyx_Coroutine_dealloc(PyObject * self)38547 static void __Pyx_Coroutine_dealloc(PyObject *self) {
38548     __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
38549     PyObject_GC_UnTrack(gen);
38550     if (gen->gi_weakreflist != NULL)
38551         PyObject_ClearWeakRefs(self);
38552     if (gen->resume_label >= 0) {
38553         PyObject_GC_Track(self);
38554 #if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE
38555         if (PyObject_CallFinalizerFromDealloc(self))
38556 #else
38557         Py_TYPE(gen)->tp_del(self);
38558         if (self->ob_refcnt > 0)
38559 #endif
38560         {
38561             return;
38562         }
38563         PyObject_GC_UnTrack(self);
38564     }
38565 #ifdef __Pyx_AsyncGen_USED
38566     if (__Pyx_AsyncGen_CheckExact(self)) {
38567         /* We have to handle this case for asynchronous generators
38568            right here, because this code has to be between UNTRACK
38569            and GC_Del. */
38570         Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer);
38571     }
38572 #endif
38573     __Pyx_Coroutine_clear(self);
38574     PyObject_GC_Del(gen);
38575 }
__Pyx_Coroutine_del(PyObject * self)38576 static void __Pyx_Coroutine_del(PyObject *self) {
38577     PyObject *error_type, *error_value, *error_traceback;
38578     __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
38579     __Pyx_PyThreadState_declare
38580     if (gen->resume_label < 0) {
38581         return;
38582     }
38583 #if !CYTHON_USE_TP_FINALIZE
38584     assert(self->ob_refcnt == 0);
38585     self->ob_refcnt = 1;
38586 #endif
38587     __Pyx_PyThreadState_assign
38588     __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
38589 #ifdef __Pyx_AsyncGen_USED
38590     if (__Pyx_AsyncGen_CheckExact(self)) {
38591         __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self;
38592         PyObject *finalizer = agen->ag_finalizer;
38593         if (finalizer && !agen->ag_closed) {
38594             PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self);
38595             if (unlikely(!res)) {
38596                 PyErr_WriteUnraisable(self);
38597             } else {
38598                 Py_DECREF(res);
38599             }
38600             __Pyx_ErrRestore(error_type, error_value, error_traceback);
38601             return;
38602         }
38603     }
38604 #endif
38605     if (unlikely(gen->resume_label == 0 && !error_value)) {
38606 #ifdef __Pyx_Coroutine_USED
38607 #ifdef __Pyx_Generator_USED
38608     if (!__Pyx_Generator_CheckExact(self))
38609 #endif
38610         {
38611         PyObject_GC_UnTrack(self);
38612 #if PY_MAJOR_VERSION >= 3  || defined(PyErr_WarnFormat)
38613         if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
38614             PyErr_WriteUnraisable(self);
38615 #else
38616         {PyObject *msg;
38617         char *cmsg;
38618         #if CYTHON_COMPILING_IN_PYPY
38619         msg = NULL;
38620         cmsg = (char*) "coroutine was never awaited";
38621         #else
38622         char *cname;
38623         PyObject *qualname;
38624         qualname = gen->gi_qualname;
38625         cname = PyString_AS_STRING(qualname);
38626         msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname);
38627         if (unlikely(!msg)) {
38628             PyErr_Clear();
38629             cmsg = (char*) "coroutine was never awaited";
38630         } else {
38631             cmsg = PyString_AS_STRING(msg);
38632         }
38633         #endif
38634         if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0))
38635             PyErr_WriteUnraisable(self);
38636         Py_XDECREF(msg);}
38637 #endif
38638         PyObject_GC_Track(self);
38639         }
38640 #endif
38641     } else {
38642         PyObject *res = __Pyx_Coroutine_Close(self);
38643         if (unlikely(!res)) {
38644             if (PyErr_Occurred())
38645                 PyErr_WriteUnraisable(self);
38646         } else {
38647             Py_DECREF(res);
38648         }
38649     }
38650     __Pyx_ErrRestore(error_type, error_value, error_traceback);
38651 #if !CYTHON_USE_TP_FINALIZE
38652     assert(self->ob_refcnt > 0);
38653     if (--self->ob_refcnt == 0) {
38654         return;
38655     }
38656     {
38657         Py_ssize_t refcnt = self->ob_refcnt;
38658         _Py_NewReference(self);
38659         self->ob_refcnt = refcnt;
38660     }
38661 #if CYTHON_COMPILING_IN_CPYTHON
38662     assert(PyType_IS_GC(self->ob_type) &&
38663            _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
38664     _Py_DEC_REFTOTAL;
38665 #endif
38666 #ifdef COUNT_ALLOCS
38667     --Py_TYPE(self)->tp_frees;
38668     --Py_TYPE(self)->tp_allocs;
38669 #endif
38670 #endif
38671 }
38672 static PyObject *
__Pyx_Coroutine_get_name(__pyx_CoroutineObject * self,CYTHON_UNUSED void * context)38673 __Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
38674 {
38675     PyObject *name = self->gi_name;
38676     if (unlikely(!name)) name = Py_None;
38677     Py_INCREF(name);
38678     return name;
38679 }
38680 static int
__Pyx_Coroutine_set_name(__pyx_CoroutineObject * self,PyObject * value,CYTHON_UNUSED void * context)38681 __Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context)
38682 {
38683     PyObject *tmp;
38684 #if PY_MAJOR_VERSION >= 3
38685     if (unlikely(value == NULL || !PyUnicode_Check(value)))
38686 #else
38687     if (unlikely(value == NULL || !PyString_Check(value)))
38688 #endif
38689     {
38690         PyErr_SetString(PyExc_TypeError,
38691                         "__name__ must be set to a string object");
38692         return -1;
38693     }
38694     tmp = self->gi_name;
38695     Py_INCREF(value);
38696     self->gi_name = value;
38697     Py_XDECREF(tmp);
38698     return 0;
38699 }
38700 static PyObject *
__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject * self,CYTHON_UNUSED void * context)38701 __Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
38702 {
38703     PyObject *name = self->gi_qualname;
38704     if (unlikely(!name)) name = Py_None;
38705     Py_INCREF(name);
38706     return name;
38707 }
38708 static int
__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject * self,PyObject * value,CYTHON_UNUSED void * context)38709 __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context)
38710 {
38711     PyObject *tmp;
38712 #if PY_MAJOR_VERSION >= 3
38713     if (unlikely(value == NULL || !PyUnicode_Check(value)))
38714 #else
38715     if (unlikely(value == NULL || !PyString_Check(value)))
38716 #endif
38717     {
38718         PyErr_SetString(PyExc_TypeError,
38719                         "__qualname__ must be set to a string object");
38720         return -1;
38721     }
38722     tmp = self->gi_qualname;
38723     Py_INCREF(value);
38724     self->gi_qualname = value;
38725     Py_XDECREF(tmp);
38726     return 0;
38727 }
__Pyx__Coroutine_New(PyTypeObject * type,__pyx_coroutine_body_t body,PyObject * code,PyObject * closure,PyObject * name,PyObject * qualname,PyObject * module_name)38728 static __pyx_CoroutineObject *__Pyx__Coroutine_New(
38729             PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
38730             PyObject *name, PyObject *qualname, PyObject *module_name) {
38731     __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
38732     if (unlikely(!gen))
38733         return NULL;
38734     return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name);
38735 }
__Pyx__Coroutine_NewInit(__pyx_CoroutineObject * gen,__pyx_coroutine_body_t body,PyObject * code,PyObject * closure,PyObject * name,PyObject * qualname,PyObject * module_name)38736 static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
38737             __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
38738             PyObject *name, PyObject *qualname, PyObject *module_name) {
38739     gen->body = body;
38740     gen->closure = closure;
38741     Py_XINCREF(closure);
38742     gen->is_running = 0;
38743     gen->resume_label = 0;
38744     gen->classobj = NULL;
38745     gen->yieldfrom = NULL;
38746     gen->gi_exc_state.exc_type = NULL;
38747     gen->gi_exc_state.exc_value = NULL;
38748     gen->gi_exc_state.exc_traceback = NULL;
38749 #if CYTHON_USE_EXC_INFO_STACK
38750     gen->gi_exc_state.previous_item = NULL;
38751 #endif
38752     gen->gi_weakreflist = NULL;
38753     Py_XINCREF(qualname);
38754     gen->gi_qualname = qualname;
38755     Py_XINCREF(name);
38756     gen->gi_name = name;
38757     Py_XINCREF(module_name);
38758     gen->gi_modulename = module_name;
38759     Py_XINCREF(code);
38760     gen->gi_code = code;
38761     PyObject_GC_Track(gen);
38762     return gen;
38763 }
38764 
38765 /* PatchModuleWithCoroutine */
__Pyx_Coroutine_patch_module(PyObject * module,const char * py_code)38766   static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) {
38767 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
38768     int result;
38769     PyObject *globals, *result_obj;
38770     globals = PyDict_New();  if (unlikely(!globals)) goto ignore;
38771     result = PyDict_SetItemString(globals, "_cython_coroutine_type",
38772     #ifdef __Pyx_Coroutine_USED
38773         (PyObject*)__pyx_CoroutineType);
38774     #else
38775         Py_None);
38776     #endif
38777     if (unlikely(result < 0)) goto ignore;
38778     result = PyDict_SetItemString(globals, "_cython_generator_type",
38779     #ifdef __Pyx_Generator_USED
38780         (PyObject*)__pyx_GeneratorType);
38781     #else
38782         Py_None);
38783     #endif
38784     if (unlikely(result < 0)) goto ignore;
38785     if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore;
38786     if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore;
38787     result_obj = PyRun_String(py_code, Py_file_input, globals, globals);
38788     if (unlikely(!result_obj)) goto ignore;
38789     Py_DECREF(result_obj);
38790     Py_DECREF(globals);
38791     return module;
38792 ignore:
38793     Py_XDECREF(globals);
38794     PyErr_WriteUnraisable(module);
38795     if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) {
38796         Py_DECREF(module);
38797         module = NULL;
38798     }
38799 #else
38800     py_code++;
38801 #endif
38802     return module;
38803 }
38804 
38805 /* PatchGeneratorABC */
38806   #ifndef CYTHON_REGISTER_ABCS
38807 #define CYTHON_REGISTER_ABCS 1
38808 #endif
38809 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
38810 static PyObject* __Pyx_patch_abc_module(PyObject *module);
__Pyx_patch_abc_module(PyObject * module)38811 static PyObject* __Pyx_patch_abc_module(PyObject *module) {
38812     module = __Pyx_Coroutine_patch_module(
38813         module, ""
38814 "if _cython_generator_type is not None:\n"
38815 "    try: Generator = _module.Generator\n"
38816 "    except AttributeError: pass\n"
38817 "    else: Generator.register(_cython_generator_type)\n"
38818 "if _cython_coroutine_type is not None:\n"
38819 "    try: Coroutine = _module.Coroutine\n"
38820 "    except AttributeError: pass\n"
38821 "    else: Coroutine.register(_cython_coroutine_type)\n"
38822     );
38823     return module;
38824 }
38825 #endif
__Pyx_patch_abc(void)38826 static int __Pyx_patch_abc(void) {
38827 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
38828     static int abc_patched = 0;
38829     if (CYTHON_REGISTER_ABCS && !abc_patched) {
38830         PyObject *module;
38831         module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections");
38832         if (!module) {
38833             PyErr_WriteUnraisable(NULL);
38834             if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
38835                     ((PY_MAJOR_VERSION >= 3) ?
38836                         "Cython module failed to register with collections.abc module" :
38837                         "Cython module failed to register with collections module"), 1) < 0)) {
38838                 return -1;
38839             }
38840         } else {
38841             module = __Pyx_patch_abc_module(module);
38842             abc_patched = 1;
38843             if (unlikely(!module))
38844                 return -1;
38845             Py_DECREF(module);
38846         }
38847         module = PyImport_ImportModule("backports_abc");
38848         if (module) {
38849             module = __Pyx_patch_abc_module(module);
38850             Py_XDECREF(module);
38851         }
38852         if (!module) {
38853             PyErr_Clear();
38854         }
38855     }
38856 #else
38857     if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL);
38858 #endif
38859     return 0;
38860 }
38861 
38862 /* Generator */
38863   static PyMethodDef __pyx_Generator_methods[] = {
38864     {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
38865      (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
38866     {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
38867      (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
38868     {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS,
38869      (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")},
38870     {0, 0, 0, 0}
38871 };
38872 static PyMemberDef __pyx_Generator_memberlist[] = {
38873     {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL},
38874     {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
38875      (char*) PyDoc_STR("object being iterated by 'yield from', or None")},
38876     {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
38877     {0, 0, 0, 0, 0}
38878 };
38879 static PyGetSetDef __pyx_Generator_getsets[] = {
38880     {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
38881      (char*) PyDoc_STR("name of the generator"), 0},
38882     {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
38883      (char*) PyDoc_STR("qualified name of the generator"), 0},
38884     {0, 0, 0, 0, 0}
38885 };
38886 static PyTypeObject __pyx_GeneratorType_type = {
38887     PyVarObject_HEAD_INIT(0, 0)
38888     "generator",
38889     sizeof(__pyx_CoroutineObject),
38890     0,
38891     (destructor) __Pyx_Coroutine_dealloc,
38892     0,
38893     0,
38894     0,
38895     0,
38896     0,
38897     0,
38898     0,
38899     0,
38900     0,
38901     0,
38902     0,
38903     0,
38904     0,
38905     0,
38906     Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
38907     0,
38908     (traverseproc) __Pyx_Coroutine_traverse,
38909     0,
38910     0,
38911     offsetof(__pyx_CoroutineObject, gi_weakreflist),
38912     0,
38913     (iternextfunc) __Pyx_Generator_Next,
38914     __pyx_Generator_methods,
38915     __pyx_Generator_memberlist,
38916     __pyx_Generator_getsets,
38917     0,
38918     0,
38919     0,
38920     0,
38921     0,
38922     0,
38923     0,
38924     0,
38925     0,
38926     0,
38927     0,
38928     0,
38929     0,
38930     0,
38931     0,
38932 #if CYTHON_USE_TP_FINALIZE
38933     0,
38934 #else
38935     __Pyx_Coroutine_del,
38936 #endif
38937     0,
38938 #if CYTHON_USE_TP_FINALIZE
38939     __Pyx_Coroutine_del,
38940 #elif PY_VERSION_HEX >= 0x030400a1
38941     0,
38942 #endif
38943 #if PY_VERSION_HEX >= 0x030800b1
38944     0,
38945 #endif
38946 };
__pyx_Generator_init(void)38947 static int __pyx_Generator_init(void) {
38948     __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
38949     __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
38950     __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
38951     if (unlikely(!__pyx_GeneratorType)) {
38952         return -1;
38953     }
38954     return 0;
38955 }
38956 
38957 /* TypeInfoCompare */
38958   static int
__pyx_typeinfo_cmp(__Pyx_TypeInfo * a,__Pyx_TypeInfo * b)38959 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
38960 {
38961     int i;
38962     if (!a || !b)
38963         return 0;
38964     if (a == b)
38965         return 1;
38966     if (a->size != b->size || a->typegroup != b->typegroup ||
38967             a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
38968         if (a->typegroup == 'H' || b->typegroup == 'H') {
38969             return a->size == b->size;
38970         } else {
38971             return 0;
38972         }
38973     }
38974     if (a->ndim) {
38975         for (i = 0; i < a->ndim; i++)
38976             if (a->arraysize[i] != b->arraysize[i])
38977                 return 0;
38978     }
38979     if (a->typegroup == 'S') {
38980         if (a->flags != b->flags)
38981             return 0;
38982         if (a->fields || b->fields) {
38983             if (!(a->fields && b->fields))
38984                 return 0;
38985             for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
38986                 __Pyx_StructField *field_a = a->fields + i;
38987                 __Pyx_StructField *field_b = b->fields + i;
38988                 if (field_a->offset != field_b->offset ||
38989                     !__pyx_typeinfo_cmp(field_a->type, field_b->type))
38990                     return 0;
38991             }
38992             return !a->fields[i].type && !b->fields[i].type;
38993         }
38994     }
38995     return 1;
38996 }
38997 
38998 /* MemviewSliceValidateAndInit */
38999   static int
__pyx_check_strides(Py_buffer * buf,int dim,int ndim,int spec)39000 __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
39001 {
39002     if (buf->shape[dim] <= 1)
39003         return 1;
39004     if (buf->strides) {
39005         if (spec & __Pyx_MEMVIEW_CONTIG) {
39006             if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
39007                 if (buf->strides[dim] != sizeof(void *)) {
39008                     PyErr_Format(PyExc_ValueError,
39009                                  "Buffer is not indirectly contiguous "
39010                                  "in dimension %d.", dim);
39011                     goto fail;
39012                 }
39013             } else if (buf->strides[dim] != buf->itemsize) {
39014                 PyErr_SetString(PyExc_ValueError,
39015                                 "Buffer and memoryview are not contiguous "
39016                                 "in the same dimension.");
39017                 goto fail;
39018             }
39019         }
39020         if (spec & __Pyx_MEMVIEW_FOLLOW) {
39021             Py_ssize_t stride = buf->strides[dim];
39022             if (stride < 0)
39023                 stride = -stride;
39024             if (stride < buf->itemsize) {
39025                 PyErr_SetString(PyExc_ValueError,
39026                                 "Buffer and memoryview are not contiguous "
39027                                 "in the same dimension.");
39028                 goto fail;
39029             }
39030         }
39031     } else {
39032         if (spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1) {
39033             PyErr_Format(PyExc_ValueError,
39034                          "C-contiguous buffer is not contiguous in "
39035                          "dimension %d", dim);
39036             goto fail;
39037         } else if (spec & (__Pyx_MEMVIEW_PTR)) {
39038             PyErr_Format(PyExc_ValueError,
39039                          "C-contiguous buffer is not indirect in "
39040                          "dimension %d", dim);
39041             goto fail;
39042         } else if (buf->suboffsets) {
39043             PyErr_SetString(PyExc_ValueError,
39044                             "Buffer exposes suboffsets but no strides");
39045             goto fail;
39046         }
39047     }
39048     return 1;
39049 fail:
39050     return 0;
39051 }
39052 static int
__pyx_check_suboffsets(Py_buffer * buf,int dim,CYTHON_UNUSED int ndim,int spec)39053 __pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec)
39054 {
39055     if (spec & __Pyx_MEMVIEW_DIRECT) {
39056         if (buf->suboffsets && buf->suboffsets[dim] >= 0) {
39057             PyErr_Format(PyExc_ValueError,
39058                          "Buffer not compatible with direct access "
39059                          "in dimension %d.", dim);
39060             goto fail;
39061         }
39062     }
39063     if (spec & __Pyx_MEMVIEW_PTR) {
39064         if (!buf->suboffsets || (buf->suboffsets[dim] < 0)) {
39065             PyErr_Format(PyExc_ValueError,
39066                          "Buffer is not indirectly accessible "
39067                          "in dimension %d.", dim);
39068             goto fail;
39069         }
39070     }
39071     return 1;
39072 fail:
39073     return 0;
39074 }
39075 static int
__pyx_verify_contig(Py_buffer * buf,int ndim,int c_or_f_flag)39076 __pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
39077 {
39078     int i;
39079     if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
39080         Py_ssize_t stride = 1;
39081         for (i = 0; i < ndim; i++) {
39082             if (stride * buf->itemsize != buf->strides[i] &&
39083                     buf->shape[i] > 1)
39084             {
39085                 PyErr_SetString(PyExc_ValueError,
39086                     "Buffer not fortran contiguous.");
39087                 goto fail;
39088             }
39089             stride = stride * buf->shape[i];
39090         }
39091     } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
39092         Py_ssize_t stride = 1;
39093         for (i = ndim - 1; i >- 1; i--) {
39094             if (stride * buf->itemsize != buf->strides[i] &&
39095                     buf->shape[i] > 1) {
39096                 PyErr_SetString(PyExc_ValueError,
39097                     "Buffer not C contiguous.");
39098                 goto fail;
39099             }
39100             stride = stride * buf->shape[i];
39101         }
39102     }
39103     return 1;
39104 fail:
39105     return 0;
39106 }
__Pyx_ValidateAndInit_memviewslice(int * axes_specs,int c_or_f_flag,int buf_flags,int ndim,__Pyx_TypeInfo * dtype,__Pyx_BufFmt_StackElem stack[],__Pyx_memviewslice * memviewslice,PyObject * original_obj)39107 static int __Pyx_ValidateAndInit_memviewslice(
39108                 int *axes_specs,
39109                 int c_or_f_flag,
39110                 int buf_flags,
39111                 int ndim,
39112                 __Pyx_TypeInfo *dtype,
39113                 __Pyx_BufFmt_StackElem stack[],
39114                 __Pyx_memviewslice *memviewslice,
39115                 PyObject *original_obj)
39116 {
39117     struct __pyx_memoryview_obj *memview, *new_memview;
39118     __Pyx_RefNannyDeclarations
39119     Py_buffer *buf;
39120     int i, spec = 0, retval = -1;
39121     __Pyx_BufFmt_Context ctx;
39122     int from_memoryview = __pyx_memoryview_check(original_obj);
39123     __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
39124     if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
39125                                                             original_obj)->typeinfo)) {
39126         memview = (struct __pyx_memoryview_obj *) original_obj;
39127         new_memview = NULL;
39128     } else {
39129         memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
39130                                             original_obj, buf_flags, 0, dtype);
39131         new_memview = memview;
39132         if (unlikely(!memview))
39133             goto fail;
39134     }
39135     buf = &memview->view;
39136     if (buf->ndim != ndim) {
39137         PyErr_Format(PyExc_ValueError,
39138                 "Buffer has wrong number of dimensions (expected %d, got %d)",
39139                 ndim, buf->ndim);
39140         goto fail;
39141     }
39142     if (new_memview) {
39143         __Pyx_BufFmt_Init(&ctx, stack, dtype);
39144         if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
39145     }
39146     if ((unsigned) buf->itemsize != dtype->size) {
39147         PyErr_Format(PyExc_ValueError,
39148                      "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
39149                      "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
39150                      buf->itemsize,
39151                      (buf->itemsize > 1) ? "s" : "",
39152                      dtype->name,
39153                      dtype->size,
39154                      (dtype->size > 1) ? "s" : "");
39155         goto fail;
39156     }
39157     for (i = 0; i < ndim; i++) {
39158         spec = axes_specs[i];
39159         if (!__pyx_check_strides(buf, i, ndim, spec))
39160             goto fail;
39161         if (!__pyx_check_suboffsets(buf, i, ndim, spec))
39162             goto fail;
39163     }
39164     if (buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag))
39165         goto fail;
39166     if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
39167                                          new_memview != NULL) == -1)) {
39168         goto fail;
39169     }
39170     retval = 0;
39171     goto no_fail;
39172 fail:
39173     Py_XDECREF(new_memview);
39174     retval = -1;
39175 no_fail:
39176     __Pyx_RefNannyFinishContext();
39177     return retval;
39178 }
39179 
39180 /* ObjectToMemviewSlice */
__Pyx_PyObject_to_MemoryviewSlice_ds_nn_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded(PyObject * obj,int writable_flag)39181   static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded(PyObject *obj, int writable_flag) {
39182     __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
39183     __Pyx_BufFmt_StackElem stack[2];
39184     int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
39185     int retcode;
39186     if (obj == Py_None) {
39187         result.memview = (struct __pyx_memoryview_obj *) Py_None;
39188         return result;
39189     }
39190     retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
39191                                                  PyBUF_RECORDS_RO | writable_flag, 1,
39192                                                  &__Pyx_TypeInfo_nn_struct____pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded, stack,
39193                                                  &result, obj);
39194     if (unlikely(retcode == -1))
39195         goto __pyx_fail;
39196     return result;
39197 __pyx_fail:
39198     result.memview = NULL;
39199     result.data = NULL;
39200     return result;
39201 }
39202 
39203 /* CheckBinaryVersion */
__Pyx_check_binary_version(void)39204   static int __Pyx_check_binary_version(void) {
39205     char ctversion[4], rtversion[4];
39206     PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
39207     PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
39208     if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
39209         char message[200];
39210         PyOS_snprintf(message, sizeof(message),
39211                       "compiletime version %s of module '%.100s' "
39212                       "does not match runtime version %s",
39213                       ctversion, __Pyx_MODULE_NAME, rtversion);
39214         return PyErr_WarnEx(NULL, message, 1);
39215     }
39216     return 0;
39217 }
39218 
39219 /* VoidPtrImport */
39220   #ifndef __PYX_HAVE_RT_ImportVoidPtr
39221 #define __PYX_HAVE_RT_ImportVoidPtr
__Pyx_ImportVoidPtr(PyObject * module,const char * name,void ** p,const char * sig)39222 static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig) {
39223     PyObject *d = 0;
39224     PyObject *cobj = 0;
39225     d = PyObject_GetAttrString(module, (char *)"__pyx_capi__");
39226     if (!d)
39227         goto bad;
39228     cobj = PyDict_GetItemString(d, name);
39229     if (!cobj) {
39230         PyErr_Format(PyExc_ImportError,
39231             "%.200s does not export expected C variable %.200s",
39232                 PyModule_GetName(module), name);
39233         goto bad;
39234     }
39235 #if PY_VERSION_HEX >= 0x02070000
39236     if (!PyCapsule_IsValid(cobj, sig)) {
39237         PyErr_Format(PyExc_TypeError,
39238             "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
39239              PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj));
39240         goto bad;
39241     }
39242     *p = PyCapsule_GetPointer(cobj, sig);
39243 #else
39244     {const char *desc, *s1, *s2;
39245     desc = (const char *)PyCObject_GetDesc(cobj);
39246     if (!desc)
39247         goto bad;
39248     s1 = desc; s2 = sig;
39249     while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; }
39250     if (*s1 != *s2) {
39251         PyErr_Format(PyExc_TypeError,
39252             "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
39253              PyModule_GetName(module), name, sig, desc);
39254         goto bad;
39255     }
39256     *p = PyCObject_AsVoidPtr(cobj);}
39257 #endif
39258     if (!(*p))
39259         goto bad;
39260     Py_DECREF(d);
39261     return 0;
39262 bad:
39263     Py_XDECREF(d);
39264     return -1;
39265 }
39266 #endif
39267 
39268 /* FunctionImport */
39269   #ifndef __PYX_HAVE_RT_ImportFunction
39270 #define __PYX_HAVE_RT_ImportFunction
__Pyx_ImportFunction(PyObject * module,const char * funcname,void (** f)(void),const char * sig)39271 static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {
39272     PyObject *d = 0;
39273     PyObject *cobj = 0;
39274     union {
39275         void (*fp)(void);
39276         void *p;
39277     } tmp;
39278     d = PyObject_GetAttrString(module, (char *)"__pyx_capi__");
39279     if (!d)
39280         goto bad;
39281     cobj = PyDict_GetItemString(d, funcname);
39282     if (!cobj) {
39283         PyErr_Format(PyExc_ImportError,
39284             "%.200s does not export expected C function %.200s",
39285                 PyModule_GetName(module), funcname);
39286         goto bad;
39287     }
39288 #if PY_VERSION_HEX >= 0x02070000
39289     if (!PyCapsule_IsValid(cobj, sig)) {
39290         PyErr_Format(PyExc_TypeError,
39291             "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
39292              PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj));
39293         goto bad;
39294     }
39295     tmp.p = PyCapsule_GetPointer(cobj, sig);
39296 #else
39297     {const char *desc, *s1, *s2;
39298     desc = (const char *)PyCObject_GetDesc(cobj);
39299     if (!desc)
39300         goto bad;
39301     s1 = desc; s2 = sig;
39302     while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; }
39303     if (*s1 != *s2) {
39304         PyErr_Format(PyExc_TypeError,
39305             "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
39306              PyModule_GetName(module), funcname, sig, desc);
39307         goto bad;
39308     }
39309     tmp.p = PyCObject_AsVoidPtr(cobj);}
39310 #endif
39311     *f = tmp.fp;
39312     if (!(*f))
39313         goto bad;
39314     Py_DECREF(d);
39315     return 0;
39316 bad:
39317     Py_XDECREF(d);
39318     return -1;
39319 }
39320 #endif
39321 
39322 /* InitStrings */
__Pyx_InitStrings(__Pyx_StringTabEntry * t)39323   static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
39324     while (t->p) {
39325         #if PY_MAJOR_VERSION < 3
39326         if (t->is_unicode) {
39327             *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
39328         } else if (t->intern) {
39329             *t->p = PyString_InternFromString(t->s);
39330         } else {
39331             *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
39332         }
39333         #else
39334         if (t->is_unicode | t->is_str) {
39335             if (t->intern) {
39336                 *t->p = PyUnicode_InternFromString(t->s);
39337             } else if (t->encoding) {
39338                 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
39339             } else {
39340                 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
39341             }
39342         } else {
39343             *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
39344         }
39345         #endif
39346         if (!*t->p)
39347             return -1;
39348         if (PyObject_Hash(*t->p) == -1)
39349             return -1;
39350         ++t;
39351     }
39352     return 0;
39353 }
39354 
__Pyx_PyUnicode_FromString(const char * c_str)39355 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
39356     return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
39357 }
__Pyx_PyObject_AsString(PyObject * o)39358 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
39359     Py_ssize_t ignore;
39360     return __Pyx_PyObject_AsStringAndSize(o, &ignore);
39361 }
39362 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
39363 #if !CYTHON_PEP393_ENABLED
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)39364 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
39365     char* defenc_c;
39366     PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
39367     if (!defenc) return NULL;
39368     defenc_c = PyBytes_AS_STRING(defenc);
39369 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
39370     {
39371         char* end = defenc_c + PyBytes_GET_SIZE(defenc);
39372         char* c;
39373         for (c = defenc_c; c < end; c++) {
39374             if ((unsigned char) (*c) >= 128) {
39375                 PyUnicode_AsASCIIString(o);
39376                 return NULL;
39377             }
39378         }
39379     }
39380 #endif
39381     *length = PyBytes_GET_SIZE(defenc);
39382     return defenc_c;
39383 }
39384 #else
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)39385 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
39386     if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
39387 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
39388     if (likely(PyUnicode_IS_ASCII(o))) {
39389         *length = PyUnicode_GET_LENGTH(o);
39390         return PyUnicode_AsUTF8(o);
39391     } else {
39392         PyUnicode_AsASCIIString(o);
39393         return NULL;
39394     }
39395 #else
39396     return PyUnicode_AsUTF8AndSize(o, length);
39397 #endif
39398 }
39399 #endif
39400 #endif
__Pyx_PyObject_AsStringAndSize(PyObject * o,Py_ssize_t * length)39401 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
39402 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
39403     if (
39404 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
39405             __Pyx_sys_getdefaultencoding_not_ascii &&
39406 #endif
39407             PyUnicode_Check(o)) {
39408         return __Pyx_PyUnicode_AsStringAndSize(o, length);
39409     } else
39410 #endif
39411 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
39412     if (PyByteArray_Check(o)) {
39413         *length = PyByteArray_GET_SIZE(o);
39414         return PyByteArray_AS_STRING(o);
39415     } else
39416 #endif
39417     {
39418         char* result;
39419         int r = PyBytes_AsStringAndSize(o, &result, length);
39420         if (unlikely(r < 0)) {
39421             return NULL;
39422         } else {
39423             return result;
39424         }
39425     }
39426 }
__Pyx_PyObject_IsTrue(PyObject * x)39427 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
39428    int is_true = x == Py_True;
39429    if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
39430    else return PyObject_IsTrue(x);
39431 }
__Pyx_PyObject_IsTrueAndDecref(PyObject * x)39432 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
39433     int retval;
39434     if (unlikely(!x)) return -1;
39435     retval = __Pyx_PyObject_IsTrue(x);
39436     Py_DECREF(x);
39437     return retval;
39438 }
__Pyx_PyNumber_IntOrLongWrongResultType(PyObject * result,const char * type_name)39439 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
39440 #if PY_MAJOR_VERSION >= 3
39441     if (PyLong_Check(result)) {
39442         if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
39443                 "__int__ returned non-int (type %.200s).  "
39444                 "The ability to return an instance of a strict subclass of int "
39445                 "is deprecated, and may be removed in a future version of Python.",
39446                 Py_TYPE(result)->tp_name)) {
39447             Py_DECREF(result);
39448             return NULL;
39449         }
39450         return result;
39451     }
39452 #endif
39453     PyErr_Format(PyExc_TypeError,
39454                  "__%.4s__ returned non-%.4s (type %.200s)",
39455                  type_name, type_name, Py_TYPE(result)->tp_name);
39456     Py_DECREF(result);
39457     return NULL;
39458 }
__Pyx_PyNumber_IntOrLong(PyObject * x)39459 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
39460 #if CYTHON_USE_TYPE_SLOTS
39461   PyNumberMethods *m;
39462 #endif
39463   const char *name = NULL;
39464   PyObject *res = NULL;
39465 #if PY_MAJOR_VERSION < 3
39466   if (likely(PyInt_Check(x) || PyLong_Check(x)))
39467 #else
39468   if (likely(PyLong_Check(x)))
39469 #endif
39470     return __Pyx_NewRef(x);
39471 #if CYTHON_USE_TYPE_SLOTS
39472   m = Py_TYPE(x)->tp_as_number;
39473   #if PY_MAJOR_VERSION < 3
39474   if (m && m->nb_int) {
39475     name = "int";
39476     res = m->nb_int(x);
39477   }
39478   else if (m && m->nb_long) {
39479     name = "long";
39480     res = m->nb_long(x);
39481   }
39482   #else
39483   if (likely(m && m->nb_int)) {
39484     name = "int";
39485     res = m->nb_int(x);
39486   }
39487   #endif
39488 #else
39489   if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
39490     res = PyNumber_Int(x);
39491   }
39492 #endif
39493   if (likely(res)) {
39494 #if PY_MAJOR_VERSION < 3
39495     if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
39496 #else
39497     if (unlikely(!PyLong_CheckExact(res))) {
39498 #endif
39499         return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
39500     }
39501   }
39502   else if (!PyErr_Occurred()) {
39503     PyErr_SetString(PyExc_TypeError,
39504                     "an integer is required");
39505   }
39506   return res;
39507 }
39508 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
39509   Py_ssize_t ival;
39510   PyObject *x;
39511 #if PY_MAJOR_VERSION < 3
39512   if (likely(PyInt_CheckExact(b))) {
39513     if (sizeof(Py_ssize_t) >= sizeof(long))
39514         return PyInt_AS_LONG(b);
39515     else
39516         return PyInt_AsSsize_t(b);
39517   }
39518 #endif
39519   if (likely(PyLong_CheckExact(b))) {
39520     #if CYTHON_USE_PYLONG_INTERNALS
39521     const digit* digits = ((PyLongObject*)b)->ob_digit;
39522     const Py_ssize_t size = Py_SIZE(b);
39523     if (likely(__Pyx_sst_abs(size) <= 1)) {
39524         ival = likely(size) ? digits[0] : 0;
39525         if (size == -1) ival = -ival;
39526         return ival;
39527     } else {
39528       switch (size) {
39529          case 2:
39530            if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
39531              return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
39532            }
39533            break;
39534          case -2:
39535            if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
39536              return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
39537            }
39538            break;
39539          case 3:
39540            if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
39541              return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
39542            }
39543            break;
39544          case -3:
39545            if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
39546              return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
39547            }
39548            break;
39549          case 4:
39550            if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
39551              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]));
39552            }
39553            break;
39554          case -4:
39555            if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
39556              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]));
39557            }
39558            break;
39559       }
39560     }
39561     #endif
39562     return PyLong_AsSsize_t(b);
39563   }
39564   x = PyNumber_Index(b);
39565   if (!x) return -1;
39566   ival = PyInt_AsSsize_t(x);
39567   Py_DECREF(x);
39568   return ival;
39569 }
39570 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
39571   return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
39572 }
39573 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
39574     return PyInt_FromSize_t(ival);
39575 }
39576 
39577 
39578 #endif /* Py_PYTHON_H */
39579