1 /* Generated by Cython 0.29.12 */
2 
3 /* BEGIN: Cython Metadata
4 {
5     "distutils": {
6         "depends": [],
7         "include_dirs": [
8             "yt/utilities/lib/"
9         ],
10         "libraries": [
11             "m"
12         ],
13         "name": "yt.geometry.grid_visitors",
14         "sources": [
15             "yt/geometry/grid_visitors.pyx"
16         ]
17     },
18     "module_name": "yt.geometry.grid_visitors"
19 }
20 END: Cython Metadata */
21 
22 #define PY_SSIZE_T_CLEAN
23 #include "Python.h"
24 #ifndef Py_PYTHON_H
25     #error Python headers needed to compile C extensions, please install development version of Python.
26 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
27     #error Cython requires Python 2.6+ or Python 3.3+.
28 #else
29 #define CYTHON_ABI "0_29_12"
30 #define CYTHON_HEX_VERSION 0x001D0CF0
31 #define CYTHON_FUTURE_DIVISION 0
32 #include <stddef.h>
33 #ifndef offsetof
34   #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
35 #endif
36 #if !defined(WIN32) && !defined(MS_WINDOWS)
37   #ifndef __stdcall
38     #define __stdcall
39   #endif
40   #ifndef __cdecl
41     #define __cdecl
42   #endif
43   #ifndef __fastcall
44     #define __fastcall
45   #endif
46 #endif
47 #ifndef DL_IMPORT
48   #define DL_IMPORT(t) t
49 #endif
50 #ifndef DL_EXPORT
51   #define DL_EXPORT(t) t
52 #endif
53 #define __PYX_COMMA ,
54 #ifndef HAVE_LONG_LONG
55   #if PY_VERSION_HEX >= 0x02070000
56     #define HAVE_LONG_LONG
57   #endif
58 #endif
59 #ifndef PY_LONG_LONG
60   #define PY_LONG_LONG LONG_LONG
61 #endif
62 #ifndef Py_HUGE_VAL
63   #define Py_HUGE_VAL HUGE_VAL
64 #endif
65 #ifdef PYPY_VERSION
66   #define CYTHON_COMPILING_IN_PYPY 1
67   #define CYTHON_COMPILING_IN_PYSTON 0
68   #define CYTHON_COMPILING_IN_CPYTHON 0
69   #undef CYTHON_USE_TYPE_SLOTS
70   #define CYTHON_USE_TYPE_SLOTS 0
71   #undef CYTHON_USE_PYTYPE_LOOKUP
72   #define CYTHON_USE_PYTYPE_LOOKUP 0
73   #if PY_VERSION_HEX < 0x03050000
74     #undef CYTHON_USE_ASYNC_SLOTS
75     #define CYTHON_USE_ASYNC_SLOTS 0
76   #elif !defined(CYTHON_USE_ASYNC_SLOTS)
77     #define CYTHON_USE_ASYNC_SLOTS 1
78   #endif
79   #undef CYTHON_USE_PYLIST_INTERNALS
80   #define CYTHON_USE_PYLIST_INTERNALS 0
81   #undef CYTHON_USE_UNICODE_INTERNALS
82   #define CYTHON_USE_UNICODE_INTERNALS 0
83   #undef CYTHON_USE_UNICODE_WRITER
84   #define CYTHON_USE_UNICODE_WRITER 0
85   #undef CYTHON_USE_PYLONG_INTERNALS
86   #define CYTHON_USE_PYLONG_INTERNALS 0
87   #undef CYTHON_AVOID_BORROWED_REFS
88   #define CYTHON_AVOID_BORROWED_REFS 1
89   #undef CYTHON_ASSUME_SAFE_MACROS
90   #define CYTHON_ASSUME_SAFE_MACROS 0
91   #undef CYTHON_UNPACK_METHODS
92   #define CYTHON_UNPACK_METHODS 0
93   #undef CYTHON_FAST_THREAD_STATE
94   #define CYTHON_FAST_THREAD_STATE 0
95   #undef CYTHON_FAST_PYCALL
96   #define CYTHON_FAST_PYCALL 0
97   #undef CYTHON_PEP489_MULTI_PHASE_INIT
98   #define CYTHON_PEP489_MULTI_PHASE_INIT 0
99   #undef CYTHON_USE_TP_FINALIZE
100   #define CYTHON_USE_TP_FINALIZE 0
101   #undef CYTHON_USE_DICT_VERSIONS
102   #define CYTHON_USE_DICT_VERSIONS 0
103   #undef CYTHON_USE_EXC_INFO_STACK
104   #define CYTHON_USE_EXC_INFO_STACK 0
105 #elif defined(PYSTON_VERSION)
106   #define CYTHON_COMPILING_IN_PYPY 0
107   #define CYTHON_COMPILING_IN_PYSTON 1
108   #define CYTHON_COMPILING_IN_CPYTHON 0
109   #ifndef CYTHON_USE_TYPE_SLOTS
110     #define CYTHON_USE_TYPE_SLOTS 1
111   #endif
112   #undef CYTHON_USE_PYTYPE_LOOKUP
113   #define CYTHON_USE_PYTYPE_LOOKUP 0
114   #undef CYTHON_USE_ASYNC_SLOTS
115   #define CYTHON_USE_ASYNC_SLOTS 0
116   #undef CYTHON_USE_PYLIST_INTERNALS
117   #define CYTHON_USE_PYLIST_INTERNALS 0
118   #ifndef CYTHON_USE_UNICODE_INTERNALS
119     #define CYTHON_USE_UNICODE_INTERNALS 1
120   #endif
121   #undef CYTHON_USE_UNICODE_WRITER
122   #define CYTHON_USE_UNICODE_WRITER 0
123   #undef CYTHON_USE_PYLONG_INTERNALS
124   #define CYTHON_USE_PYLONG_INTERNALS 0
125   #ifndef CYTHON_AVOID_BORROWED_REFS
126     #define CYTHON_AVOID_BORROWED_REFS 0
127   #endif
128   #ifndef CYTHON_ASSUME_SAFE_MACROS
129     #define CYTHON_ASSUME_SAFE_MACROS 1
130   #endif
131   #ifndef CYTHON_UNPACK_METHODS
132     #define CYTHON_UNPACK_METHODS 1
133   #endif
134   #undef CYTHON_FAST_THREAD_STATE
135   #define CYTHON_FAST_THREAD_STATE 0
136   #undef CYTHON_FAST_PYCALL
137   #define CYTHON_FAST_PYCALL 0
138   #undef CYTHON_PEP489_MULTI_PHASE_INIT
139   #define CYTHON_PEP489_MULTI_PHASE_INIT 0
140   #undef CYTHON_USE_TP_FINALIZE
141   #define CYTHON_USE_TP_FINALIZE 0
142   #undef CYTHON_USE_DICT_VERSIONS
143   #define CYTHON_USE_DICT_VERSIONS 0
144   #undef CYTHON_USE_EXC_INFO_STACK
145   #define CYTHON_USE_EXC_INFO_STACK 0
146 #else
147   #define CYTHON_COMPILING_IN_PYPY 0
148   #define CYTHON_COMPILING_IN_PYSTON 0
149   #define CYTHON_COMPILING_IN_CPYTHON 1
150   #ifndef CYTHON_USE_TYPE_SLOTS
151     #define CYTHON_USE_TYPE_SLOTS 1
152   #endif
153   #if PY_VERSION_HEX < 0x02070000
154     #undef CYTHON_USE_PYTYPE_LOOKUP
155     #define CYTHON_USE_PYTYPE_LOOKUP 0
156   #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
157     #define CYTHON_USE_PYTYPE_LOOKUP 1
158   #endif
159   #if PY_MAJOR_VERSION < 3
160     #undef CYTHON_USE_ASYNC_SLOTS
161     #define CYTHON_USE_ASYNC_SLOTS 0
162   #elif !defined(CYTHON_USE_ASYNC_SLOTS)
163     #define CYTHON_USE_ASYNC_SLOTS 1
164   #endif
165   #if PY_VERSION_HEX < 0x02070000
166     #undef CYTHON_USE_PYLONG_INTERNALS
167     #define CYTHON_USE_PYLONG_INTERNALS 0
168   #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
169     #define CYTHON_USE_PYLONG_INTERNALS 1
170   #endif
171   #ifndef CYTHON_USE_PYLIST_INTERNALS
172     #define CYTHON_USE_PYLIST_INTERNALS 1
173   #endif
174   #ifndef CYTHON_USE_UNICODE_INTERNALS
175     #define CYTHON_USE_UNICODE_INTERNALS 1
176   #endif
177   #if PY_VERSION_HEX < 0x030300F0
178     #undef CYTHON_USE_UNICODE_WRITER
179     #define CYTHON_USE_UNICODE_WRITER 0
180   #elif !defined(CYTHON_USE_UNICODE_WRITER)
181     #define CYTHON_USE_UNICODE_WRITER 1
182   #endif
183   #ifndef CYTHON_AVOID_BORROWED_REFS
184     #define CYTHON_AVOID_BORROWED_REFS 0
185   #endif
186   #ifndef CYTHON_ASSUME_SAFE_MACROS
187     #define CYTHON_ASSUME_SAFE_MACROS 1
188   #endif
189   #ifndef CYTHON_UNPACK_METHODS
190     #define CYTHON_UNPACK_METHODS 1
191   #endif
192   #ifndef CYTHON_FAST_THREAD_STATE
193     #define CYTHON_FAST_THREAD_STATE 1
194   #endif
195   #ifndef CYTHON_FAST_PYCALL
196     #define CYTHON_FAST_PYCALL 1
197   #endif
198   #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
199     #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
200   #endif
201   #ifndef CYTHON_USE_TP_FINALIZE
202     #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
203   #endif
204   #ifndef CYTHON_USE_DICT_VERSIONS
205     #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
206   #endif
207   #ifndef CYTHON_USE_EXC_INFO_STACK
208     #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
209   #endif
210 #endif
211 #if !defined(CYTHON_FAST_PYCCALL)
212 #define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
213 #endif
214 #if CYTHON_USE_PYLONG_INTERNALS
215   #include "longintrepr.h"
216   #undef SHIFT
217   #undef BASE
218   #undef MASK
219   #ifdef SIZEOF_VOID_P
220     enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
221   #endif
222 #endif
223 #ifndef __has_attribute
224   #define __has_attribute(x) 0
225 #endif
226 #ifndef __has_cpp_attribute
227   #define __has_cpp_attribute(x) 0
228 #endif
229 #ifndef CYTHON_RESTRICT
230   #if defined(__GNUC__)
231     #define CYTHON_RESTRICT __restrict__
232   #elif defined(_MSC_VER) && _MSC_VER >= 1400
233     #define CYTHON_RESTRICT __restrict
234   #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
235     #define CYTHON_RESTRICT restrict
236   #else
237     #define CYTHON_RESTRICT
238   #endif
239 #endif
240 #ifndef CYTHON_UNUSED
241 # if defined(__GNUC__)
242 #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
243 #     define CYTHON_UNUSED __attribute__ ((__unused__))
244 #   else
245 #     define CYTHON_UNUSED
246 #   endif
247 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
248 #   define CYTHON_UNUSED __attribute__ ((__unused__))
249 # else
250 #   define CYTHON_UNUSED
251 # endif
252 #endif
253 #ifndef CYTHON_MAYBE_UNUSED_VAR
254 #  if defined(__cplusplus)
CYTHON_MAYBE_UNUSED_VAR(const T &)255      template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
256 #  else
257 #    define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
258 #  endif
259 #endif
260 #ifndef CYTHON_NCP_UNUSED
261 # if CYTHON_COMPILING_IN_CPYTHON
262 #  define CYTHON_NCP_UNUSED
263 # else
264 #  define CYTHON_NCP_UNUSED CYTHON_UNUSED
265 # endif
266 #endif
267 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
268 #ifdef _MSC_VER
269     #ifndef _MSC_STDINT_H_
270         #if _MSC_VER < 1300
271            typedef unsigned char     uint8_t;
272            typedef unsigned int      uint32_t;
273         #else
274            typedef unsigned __int8   uint8_t;
275            typedef unsigned __int32  uint32_t;
276         #endif
277     #endif
278 #else
279    #include <stdint.h>
280 #endif
281 #ifndef CYTHON_FALLTHROUGH
282   #if defined(__cplusplus) && __cplusplus >= 201103L
283     #if __has_cpp_attribute(fallthrough)
284       #define CYTHON_FALLTHROUGH [[fallthrough]]
285     #elif __has_cpp_attribute(clang::fallthrough)
286       #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
287     #elif __has_cpp_attribute(gnu::fallthrough)
288       #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
289     #endif
290   #endif
291   #ifndef CYTHON_FALLTHROUGH
292     #if __has_attribute(fallthrough)
293       #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
294     #else
295       #define CYTHON_FALLTHROUGH
296     #endif
297   #endif
298   #if defined(__clang__ ) && defined(__apple_build_version__)
299     #if __apple_build_version__ < 7000000
300       #undef  CYTHON_FALLTHROUGH
301       #define CYTHON_FALLTHROUGH
302     #endif
303   #endif
304 #endif
305 
306 #ifndef CYTHON_INLINE
307   #if defined(__clang__)
308     #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
309   #elif defined(__GNUC__)
310     #define CYTHON_INLINE __inline__
311   #elif defined(_MSC_VER)
312     #define CYTHON_INLINE __inline
313   #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
314     #define CYTHON_INLINE inline
315   #else
316     #define CYTHON_INLINE
317   #endif
318 #endif
319 
320 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
321   #define Py_OptimizeFlag 0
322 #endif
323 #define __PYX_BUILD_PY_SSIZE_T "n"
324 #define CYTHON_FORMAT_SSIZE_T "z"
325 #if PY_MAJOR_VERSION < 3
326   #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
327   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
328           PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
329   #define __Pyx_DefaultClassType PyClass_Type
330 #else
331   #define __Pyx_BUILTIN_MODULE_NAME "builtins"
332 #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
333   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
334           PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
335 #else
336   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
337           PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
338 #endif
339   #define __Pyx_DefaultClassType PyType_Type
340 #endif
341 #ifndef Py_TPFLAGS_CHECKTYPES
342   #define Py_TPFLAGS_CHECKTYPES 0
343 #endif
344 #ifndef Py_TPFLAGS_HAVE_INDEX
345   #define Py_TPFLAGS_HAVE_INDEX 0
346 #endif
347 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
348   #define Py_TPFLAGS_HAVE_NEWBUFFER 0
349 #endif
350 #ifndef Py_TPFLAGS_HAVE_FINALIZE
351   #define Py_TPFLAGS_HAVE_FINALIZE 0
352 #endif
353 #ifndef METH_STACKLESS
354   #define METH_STACKLESS 0
355 #endif
356 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
357   #ifndef METH_FASTCALL
358      #define METH_FASTCALL 0x80
359   #endif
360   typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
361   typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
362                                                           Py_ssize_t nargs, PyObject *kwnames);
363 #else
364   #define __Pyx_PyCFunctionFast _PyCFunctionFast
365   #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
366 #endif
367 #if CYTHON_FAST_PYCCALL
368 #define __Pyx_PyFastCFunction_Check(func)\
369     ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
370 #else
371 #define __Pyx_PyFastCFunction_Check(func) 0
372 #endif
373 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
374   #define PyObject_Malloc(s)   PyMem_Malloc(s)
375   #define PyObject_Free(p)     PyMem_Free(p)
376   #define PyObject_Realloc(p)  PyMem_Realloc(p)
377 #endif
378 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
379   #define PyMem_RawMalloc(n)           PyMem_Malloc(n)
380   #define PyMem_RawRealloc(p, n)       PyMem_Realloc(p, n)
381   #define PyMem_RawFree(p)             PyMem_Free(p)
382 #endif
383 #if CYTHON_COMPILING_IN_PYSTON
384   #define __Pyx_PyCode_HasFreeVars(co)  PyCode_HasFreeVars(co)
385   #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
386 #else
387   #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
388   #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
389 #endif
390 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
391   #define __Pyx_PyThreadState_Current PyThreadState_GET()
392 #elif PY_VERSION_HEX >= 0x03060000
393   #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
394 #elif PY_VERSION_HEX >= 0x03000000
395   #define __Pyx_PyThreadState_Current PyThreadState_GET()
396 #else
397   #define __Pyx_PyThreadState_Current _PyThreadState_Current
398 #endif
399 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
400 #include "pythread.h"
401 #define Py_tss_NEEDS_INIT 0
402 typedef int Py_tss_t;
PyThread_tss_create(Py_tss_t * key)403 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
404   *key = PyThread_create_key();
405   return 0;
406 }
PyThread_tss_alloc(void)407 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
408   Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
409   *key = Py_tss_NEEDS_INIT;
410   return key;
411 }
PyThread_tss_free(Py_tss_t * key)412 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
413   PyObject_Free(key);
414 }
PyThread_tss_is_created(Py_tss_t * key)415 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
416   return *key != Py_tss_NEEDS_INIT;
417 }
PyThread_tss_delete(Py_tss_t * key)418 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
419   PyThread_delete_key(*key);
420   *key = Py_tss_NEEDS_INIT;
421 }
PyThread_tss_set(Py_tss_t * key,void * value)422 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
423   return PyThread_set_key_value(*key, value);
424 }
PyThread_tss_get(Py_tss_t * key)425 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
426   return PyThread_get_key_value(*key);
427 }
428 #endif
429 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
430 #define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
431 #else
432 #define __Pyx_PyDict_NewPresized(n)  PyDict_New()
433 #endif
434 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
435   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
436   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
437 #else
438   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
439   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
440 #endif
441 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
442 #define __Pyx_PyDict_GetItemStr(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
443 #else
444 #define __Pyx_PyDict_GetItemStr(dict, name)  PyDict_GetItem(dict, name)
445 #endif
446 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
447   #define CYTHON_PEP393_ENABLED 1
448   #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
449                                               0 : _PyUnicode_Ready((PyObject *)(op)))
450   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
451   #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
452   #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
453   #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
454   #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
455   #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
456   #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, ch)
457   #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
458 #else
459   #define CYTHON_PEP393_ENABLED 0
460   #define PyUnicode_1BYTE_KIND  1
461   #define PyUnicode_2BYTE_KIND  2
462   #define PyUnicode_4BYTE_KIND  4
463   #define __Pyx_PyUnicode_READY(op)       (0)
464   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
465   #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
466   #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
467   #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
468   #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
469   #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
470   #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
471   #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_SIZE(u))
472 #endif
473 #if CYTHON_COMPILING_IN_PYPY
474   #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
475   #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
476 #else
477   #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
478   #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
479       PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
480 #endif
481 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
482   #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
483 #endif
484 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
485   #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
486 #endif
487 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
488   #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
489 #endif
490 #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))
491 #define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
492 #if PY_MAJOR_VERSION >= 3
493   #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
494 #else
495   #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
496 #endif
497 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
498   #define PyObject_ASCII(o)            PyObject_Repr(o)
499 #endif
500 #if PY_MAJOR_VERSION >= 3
501   #define PyBaseString_Type            PyUnicode_Type
502   #define PyStringObject               PyUnicodeObject
503   #define PyString_Type                PyUnicode_Type
504   #define PyString_Check               PyUnicode_Check
505   #define PyString_CheckExact          PyUnicode_CheckExact
506   #define PyObject_Unicode             PyObject_Str
507 #endif
508 #if PY_MAJOR_VERSION >= 3
509   #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
510   #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
511 #else
512   #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
513   #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
514 #endif
515 #ifndef PySet_CheckExact
516   #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
517 #endif
518 #if CYTHON_ASSUME_SAFE_MACROS
519   #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
520 #else
521   #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
522 #endif
523 #if PY_MAJOR_VERSION >= 3
524   #define PyIntObject                  PyLongObject
525   #define PyInt_Type                   PyLong_Type
526   #define PyInt_Check(op)              PyLong_Check(op)
527   #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
528   #define PyInt_FromString             PyLong_FromString
529   #define PyInt_FromUnicode            PyLong_FromUnicode
530   #define PyInt_FromLong               PyLong_FromLong
531   #define PyInt_FromSize_t             PyLong_FromSize_t
532   #define PyInt_FromSsize_t            PyLong_FromSsize_t
533   #define PyInt_AsLong                 PyLong_AsLong
534   #define PyInt_AS_LONG                PyLong_AS_LONG
535   #define PyInt_AsSsize_t              PyLong_AsSsize_t
536   #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
537   #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
538   #define PyNumber_Int                 PyNumber_Long
539 #endif
540 #if PY_MAJOR_VERSION >= 3
541   #define PyBoolObject                 PyLongObject
542 #endif
543 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
544   #ifndef PyUnicode_InternFromString
545     #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
546   #endif
547 #endif
548 #if PY_VERSION_HEX < 0x030200A4
549   typedef long Py_hash_t;
550   #define __Pyx_PyInt_FromHash_t PyInt_FromLong
551   #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
552 #else
553   #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
554   #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
555 #endif
556 #if PY_MAJOR_VERSION >= 3
557   #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
558 #else
559   #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
560 #endif
561 #if CYTHON_USE_ASYNC_SLOTS
562   #if PY_VERSION_HEX >= 0x030500B1
563     #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
564     #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
565   #else
566     #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
567   #endif
568 #else
569   #define __Pyx_PyType_AsAsync(obj) NULL
570 #endif
571 #ifndef __Pyx_PyAsyncMethodsStruct
572     typedef struct {
573         unaryfunc am_await;
574         unaryfunc am_aiter;
575         unaryfunc am_anext;
576     } __Pyx_PyAsyncMethodsStruct;
577 #endif
578 
579 #if defined(WIN32) || defined(MS_WINDOWS)
580   #define _USE_MATH_DEFINES
581 #endif
582 #include <math.h>
583 #ifdef NAN
584 #define __PYX_NAN() ((float) NAN)
585 #else
__PYX_NAN()586 static CYTHON_INLINE float __PYX_NAN() {
587   float value;
588   memset(&value, 0xFF, sizeof(value));
589   return value;
590 }
591 #endif
592 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
593 #define __Pyx_truncl trunc
594 #else
595 #define __Pyx_truncl truncl
596 #endif
597 
598 
599 #define __PYX_ERR(f_index, lineno, Ln_error) \
600 { \
601   __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
602 }
603 
604 #ifndef __PYX_EXTERN_C
605   #ifdef __cplusplus
606     #define __PYX_EXTERN_C extern "C"
607   #else
608     #define __PYX_EXTERN_C extern
609   #endif
610 #endif
611 
612 #define __PYX_HAVE__yt__geometry__grid_visitors
613 #define __PYX_HAVE_API__yt__geometry__grid_visitors
614 /* Early includes */
615 #include <string.h>
616 #include <stdio.h>
617 #include "numpy/arrayobject.h"
618 #include "numpy/ufuncobject.h"
619 #include <stdlib.h>
620 #ifdef _OPENMP
621 #include <omp.h>
622 #endif /* _OPENMP */
623 
624 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
625 #define CYTHON_WITHOUT_ASSERTIONS
626 #endif
627 
628 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
629                 const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
630 
631 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
632 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
633 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
634 #define __PYX_DEFAULT_STRING_ENCODING ""
635 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
636 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
637 #define __Pyx_uchar_cast(c) ((unsigned char)c)
638 #define __Pyx_long_cast(x) ((long)x)
639 #define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
640     (sizeof(type) < sizeof(Py_ssize_t))  ||\
641     (sizeof(type) > sizeof(Py_ssize_t) &&\
642           likely(v < (type)PY_SSIZE_T_MAX ||\
643                  v == (type)PY_SSIZE_T_MAX)  &&\
644           (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
645                                 v == (type)PY_SSIZE_T_MIN)))  ||\
646     (sizeof(type) == sizeof(Py_ssize_t) &&\
647           (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
648                                v == (type)PY_SSIZE_T_MAX)))  )
__Pyx_is_valid_index(Py_ssize_t i,Py_ssize_t limit)649 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
650     return (size_t) i < (size_t) limit;
651 }
652 #if defined (__cplusplus) && __cplusplus >= 201103L
653     #include <cstdlib>
654     #define __Pyx_sst_abs(value) std::abs(value)
655 #elif SIZEOF_INT >= SIZEOF_SIZE_T
656     #define __Pyx_sst_abs(value) abs(value)
657 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
658     #define __Pyx_sst_abs(value) labs(value)
659 #elif defined (_MSC_VER)
660     #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
661 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
662     #define __Pyx_sst_abs(value) llabs(value)
663 #elif defined (__GNUC__)
664     #define __Pyx_sst_abs(value) __builtin_llabs(value)
665 #else
666     #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
667 #endif
668 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
669 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
670 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
671 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
672 #define __Pyx_PyBytes_FromString        PyBytes_FromString
673 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
674 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
675 #if PY_MAJOR_VERSION < 3
676     #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
677     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
678 #else
679     #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
680     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
681 #endif
682 #define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AS_STRING(s))
683 #define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AS_STRING(s))
684 #define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AS_STRING(s))
685 #define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AS_STRING(s))
686 #define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AS_STRING(s))
687 #define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AS_STRING(s))
688 #define __Pyx_PyObject_AsWritableString(s)    ((char*) __Pyx_PyObject_AsString(s))
689 #define __Pyx_PyObject_AsWritableSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
690 #define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
691 #define __Pyx_PyObject_AsSString(s)    ((const signed char*) __Pyx_PyObject_AsString(s))
692 #define __Pyx_PyObject_AsUString(s)    ((const unsigned char*) __Pyx_PyObject_AsString(s))
693 #define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
694 #define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
695 #define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
696 #define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
697 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
__Pyx_Py_UNICODE_strlen(const Py_UNICODE * u)698 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
699     const Py_UNICODE *u_end = u;
700     while (*u_end++) ;
701     return (size_t)(u_end - u - 1);
702 }
703 #define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
704 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
705 #define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
706 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
707 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
708 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
709 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
710 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
711 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
712 #define __Pyx_PySequence_Tuple(obj)\
713     (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
714 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
715 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
716 #if CYTHON_ASSUME_SAFE_MACROS
717 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
718 #else
719 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
720 #endif
721 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
722 #if PY_MAJOR_VERSION >= 3
723 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
724 #else
725 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
726 #endif
727 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
728 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
729 static int __Pyx_sys_getdefaultencoding_not_ascii;
__Pyx_init_sys_getdefaultencoding_params(void)730 static int __Pyx_init_sys_getdefaultencoding_params(void) {
731     PyObject* sys;
732     PyObject* default_encoding = NULL;
733     PyObject* ascii_chars_u = NULL;
734     PyObject* ascii_chars_b = NULL;
735     const char* default_encoding_c;
736     sys = PyImport_ImportModule("sys");
737     if (!sys) goto bad;
738     default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
739     Py_DECREF(sys);
740     if (!default_encoding) goto bad;
741     default_encoding_c = PyBytes_AsString(default_encoding);
742     if (!default_encoding_c) goto bad;
743     if (strcmp(default_encoding_c, "ascii") == 0) {
744         __Pyx_sys_getdefaultencoding_not_ascii = 0;
745     } else {
746         char ascii_chars[128];
747         int c;
748         for (c = 0; c < 128; c++) {
749             ascii_chars[c] = c;
750         }
751         __Pyx_sys_getdefaultencoding_not_ascii = 1;
752         ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
753         if (!ascii_chars_u) goto bad;
754         ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
755         if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
756             PyErr_Format(
757                 PyExc_ValueError,
758                 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
759                 default_encoding_c);
760             goto bad;
761         }
762         Py_DECREF(ascii_chars_u);
763         Py_DECREF(ascii_chars_b);
764     }
765     Py_DECREF(default_encoding);
766     return 0;
767 bad:
768     Py_XDECREF(default_encoding);
769     Py_XDECREF(ascii_chars_u);
770     Py_XDECREF(ascii_chars_b);
771     return -1;
772 }
773 #endif
774 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
775 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
776 #else
777 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
778 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
779 static char* __PYX_DEFAULT_STRING_ENCODING;
__Pyx_init_sys_getdefaultencoding_params(void)780 static int __Pyx_init_sys_getdefaultencoding_params(void) {
781     PyObject* sys;
782     PyObject* default_encoding = NULL;
783     char* default_encoding_c;
784     sys = PyImport_ImportModule("sys");
785     if (!sys) goto bad;
786     default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
787     Py_DECREF(sys);
788     if (!default_encoding) goto bad;
789     default_encoding_c = PyBytes_AsString(default_encoding);
790     if (!default_encoding_c) goto bad;
791     __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
792     if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
793     strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
794     Py_DECREF(default_encoding);
795     return 0;
796 bad:
797     Py_XDECREF(default_encoding);
798     return -1;
799 }
800 #endif
801 #endif
802 
803 
804 /* Test for GCC > 2.95 */
805 #if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
806   #define likely(x)   __builtin_expect(!!(x), 1)
807   #define unlikely(x) __builtin_expect(!!(x), 0)
808 #else /* !__GNUC__ or GCC < 2.95 */
809   #define likely(x)   (x)
810   #define unlikely(x) (x)
811 #endif /* __GNUC__ */
__Pyx_pretend_to_initialize(void * ptr)812 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
813 
814 static PyObject *__pyx_m = NULL;
815 static PyObject *__pyx_d;
816 static PyObject *__pyx_b;
817 static PyObject *__pyx_cython_runtime = NULL;
818 static PyObject *__pyx_empty_tuple;
819 static PyObject *__pyx_empty_bytes;
820 static PyObject *__pyx_empty_unicode;
821 static int __pyx_lineno;
822 static int __pyx_clineno = 0;
823 static const char * __pyx_cfilenm= __FILE__;
824 static const char *__pyx_filename;
825 
826 /* Header.proto */
827 #if !defined(CYTHON_CCOMPLEX)
828   #if defined(__cplusplus)
829     #define CYTHON_CCOMPLEX 1
830   #elif defined(_Complex_I)
831     #define CYTHON_CCOMPLEX 1
832   #else
833     #define CYTHON_CCOMPLEX 0
834   #endif
835 #endif
836 #if CYTHON_CCOMPLEX
837   #ifdef __cplusplus
838     #include <complex>
839   #else
840     #include <complex.h>
841   #endif
842 #endif
843 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
844   #undef _Complex_I
845   #define _Complex_I 1.0fj
846 #endif
847 
848 
849 static const char *__pyx_f[] = {
850   "yt/geometry/grid_visitors.pyx",
851   "__init__.pxd",
852   "yt/utilities/lib/fp_utils.pxd",
853   "type.pxd",
854   "yt/utilities/lib/bitarray.pxd",
855 };
856 
857 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":776
858  * # in Cython to enable them only on the right systems.
859  *
860  * ctypedef npy_int8       int8_t             # <<<<<<<<<<<<<<
861  * ctypedef npy_int16      int16_t
862  * ctypedef npy_int32      int32_t
863  */
864 typedef npy_int8 __pyx_t_5numpy_int8_t;
865 
866 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":777
867  *
868  * ctypedef npy_int8       int8_t
869  * ctypedef npy_int16      int16_t             # <<<<<<<<<<<<<<
870  * ctypedef npy_int32      int32_t
871  * ctypedef npy_int64      int64_t
872  */
873 typedef npy_int16 __pyx_t_5numpy_int16_t;
874 
875 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778
876  * ctypedef npy_int8       int8_t
877  * ctypedef npy_int16      int16_t
878  * ctypedef npy_int32      int32_t             # <<<<<<<<<<<<<<
879  * ctypedef npy_int64      int64_t
880  * #ctypedef npy_int96      int96_t
881  */
882 typedef npy_int32 __pyx_t_5numpy_int32_t;
883 
884 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":779
885  * ctypedef npy_int16      int16_t
886  * ctypedef npy_int32      int32_t
887  * ctypedef npy_int64      int64_t             # <<<<<<<<<<<<<<
888  * #ctypedef npy_int96      int96_t
889  * #ctypedef npy_int128     int128_t
890  */
891 typedef npy_int64 __pyx_t_5numpy_int64_t;
892 
893 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":783
894  * #ctypedef npy_int128     int128_t
895  *
896  * ctypedef npy_uint8      uint8_t             # <<<<<<<<<<<<<<
897  * ctypedef npy_uint16     uint16_t
898  * ctypedef npy_uint32     uint32_t
899  */
900 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
901 
902 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784
903  *
904  * ctypedef npy_uint8      uint8_t
905  * ctypedef npy_uint16     uint16_t             # <<<<<<<<<<<<<<
906  * ctypedef npy_uint32     uint32_t
907  * ctypedef npy_uint64     uint64_t
908  */
909 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
910 
911 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":785
912  * ctypedef npy_uint8      uint8_t
913  * ctypedef npy_uint16     uint16_t
914  * ctypedef npy_uint32     uint32_t             # <<<<<<<<<<<<<<
915  * ctypedef npy_uint64     uint64_t
916  * #ctypedef npy_uint96     uint96_t
917  */
918 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
919 
920 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":786
921  * ctypedef npy_uint16     uint16_t
922  * ctypedef npy_uint32     uint32_t
923  * ctypedef npy_uint64     uint64_t             # <<<<<<<<<<<<<<
924  * #ctypedef npy_uint96     uint96_t
925  * #ctypedef npy_uint128    uint128_t
926  */
927 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
928 
929 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790
930  * #ctypedef npy_uint128    uint128_t
931  *
932  * ctypedef npy_float32    float32_t             # <<<<<<<<<<<<<<
933  * ctypedef npy_float64    float64_t
934  * #ctypedef npy_float80    float80_t
935  */
936 typedef npy_float32 __pyx_t_5numpy_float32_t;
937 
938 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791
939  *
940  * ctypedef npy_float32    float32_t
941  * ctypedef npy_float64    float64_t             # <<<<<<<<<<<<<<
942  * #ctypedef npy_float80    float80_t
943  * #ctypedef npy_float128   float128_t
944  */
945 typedef npy_float64 __pyx_t_5numpy_float64_t;
946 
947 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":800
948  * # The int types are mapped a bit surprising --
949  * # numpy.int corresponds to 'l' and numpy.long to 'q'
950  * ctypedef npy_long       int_t             # <<<<<<<<<<<<<<
951  * ctypedef npy_longlong   long_t
952  * ctypedef npy_longlong   longlong_t
953  */
954 typedef npy_long __pyx_t_5numpy_int_t;
955 
956 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":801
957  * # numpy.int corresponds to 'l' and numpy.long to 'q'
958  * ctypedef npy_long       int_t
959  * ctypedef npy_longlong   long_t             # <<<<<<<<<<<<<<
960  * ctypedef npy_longlong   longlong_t
961  *
962  */
963 typedef npy_longlong __pyx_t_5numpy_long_t;
964 
965 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":802
966  * ctypedef npy_long       int_t
967  * ctypedef npy_longlong   long_t
968  * ctypedef npy_longlong   longlong_t             # <<<<<<<<<<<<<<
969  *
970  * ctypedef npy_ulong      uint_t
971  */
972 typedef npy_longlong __pyx_t_5numpy_longlong_t;
973 
974 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":804
975  * ctypedef npy_longlong   longlong_t
976  *
977  * ctypedef npy_ulong      uint_t             # <<<<<<<<<<<<<<
978  * ctypedef npy_ulonglong  ulong_t
979  * ctypedef npy_ulonglong  ulonglong_t
980  */
981 typedef npy_ulong __pyx_t_5numpy_uint_t;
982 
983 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805
984  *
985  * ctypedef npy_ulong      uint_t
986  * ctypedef npy_ulonglong  ulong_t             # <<<<<<<<<<<<<<
987  * ctypedef npy_ulonglong  ulonglong_t
988  *
989  */
990 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
991 
992 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":806
993  * ctypedef npy_ulong      uint_t
994  * ctypedef npy_ulonglong  ulong_t
995  * ctypedef npy_ulonglong  ulonglong_t             # <<<<<<<<<<<<<<
996  *
997  * ctypedef npy_intp       intp_t
998  */
999 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1000 
1001 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":808
1002  * ctypedef npy_ulonglong  ulonglong_t
1003  *
1004  * ctypedef npy_intp       intp_t             # <<<<<<<<<<<<<<
1005  * ctypedef npy_uintp      uintp_t
1006  *
1007  */
1008 typedef npy_intp __pyx_t_5numpy_intp_t;
1009 
1010 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809
1011  *
1012  * ctypedef npy_intp       intp_t
1013  * ctypedef npy_uintp      uintp_t             # <<<<<<<<<<<<<<
1014  *
1015  * ctypedef npy_double     float_t
1016  */
1017 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1018 
1019 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":811
1020  * ctypedef npy_uintp      uintp_t
1021  *
1022  * ctypedef npy_double     float_t             # <<<<<<<<<<<<<<
1023  * ctypedef npy_double     double_t
1024  * ctypedef npy_longdouble longdouble_t
1025  */
1026 typedef npy_double __pyx_t_5numpy_float_t;
1027 
1028 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812
1029  *
1030  * ctypedef npy_double     float_t
1031  * ctypedef npy_double     double_t             # <<<<<<<<<<<<<<
1032  * ctypedef npy_longdouble longdouble_t
1033  *
1034  */
1035 typedef npy_double __pyx_t_5numpy_double_t;
1036 
1037 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":813
1038  * ctypedef npy_double     float_t
1039  * ctypedef npy_double     double_t
1040  * ctypedef npy_longdouble longdouble_t             # <<<<<<<<<<<<<<
1041  *
1042  * ctypedef npy_cfloat      cfloat_t
1043  */
1044 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1045 /* Declarations.proto */
1046 #if CYTHON_CCOMPLEX
1047   #ifdef __cplusplus
1048     typedef ::std::complex< float > __pyx_t_float_complex;
1049   #else
1050     typedef float _Complex __pyx_t_float_complex;
1051   #endif
1052 #else
1053     typedef struct { float real, imag; } __pyx_t_float_complex;
1054 #endif
1055 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1056 
1057 /* Declarations.proto */
1058 #if CYTHON_CCOMPLEX
1059   #ifdef __cplusplus
1060     typedef ::std::complex< double > __pyx_t_double_complex;
1061   #else
1062     typedef double _Complex __pyx_t_double_complex;
1063   #endif
1064 #else
1065     typedef struct { double real, imag; } __pyx_t_double_complex;
1066 #endif
1067 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1068 
1069 
1070 /*--- Type declarations ---*/
1071 struct __pyx_obj_2yt_9utilities_3lib_8bitarray_bitarray;
1072 
1073 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":815
1074  * ctypedef npy_longdouble longdouble_t
1075  *
1076  * ctypedef npy_cfloat      cfloat_t             # <<<<<<<<<<<<<<
1077  * ctypedef npy_cdouble     cdouble_t
1078  * ctypedef npy_clongdouble clongdouble_t
1079  */
1080 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1081 
1082 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":816
1083  *
1084  * ctypedef npy_cfloat      cfloat_t
1085  * ctypedef npy_cdouble     cdouble_t             # <<<<<<<<<<<<<<
1086  * ctypedef npy_clongdouble clongdouble_t
1087  *
1088  */
1089 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1090 
1091 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":817
1092  * ctypedef npy_cfloat      cfloat_t
1093  * ctypedef npy_cdouble     cdouble_t
1094  * ctypedef npy_clongdouble clongdouble_t             # <<<<<<<<<<<<<<
1095  *
1096  * ctypedef npy_cdouble     complex_t
1097  */
1098 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1099 
1100 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":819
1101  * ctypedef npy_clongdouble clongdouble_t
1102  *
1103  * ctypedef npy_cdouble     complex_t             # <<<<<<<<<<<<<<
1104  *
1105  * cdef inline object PyArray_MultiIterNew1(a):
1106  */
1107 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1108 struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode;
1109 struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded;
1110 struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData;
1111 
1112 /* "yt/geometry/grid_visitors.pxd":13
1113  *
1114  *
1115  * cdef struct GridTreeNode:             # <<<<<<<<<<<<<<
1116  *     np.int32_t num_children
1117  *     np.int32_t level
1118  */
1119 struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode {
1120   __pyx_t_5numpy_int32_t num_children;
1121   __pyx_t_5numpy_int32_t level;
1122   __pyx_t_5numpy_int64_t index;
1123   __pyx_t_5numpy_float64_t left_edge[3];
1124   __pyx_t_5numpy_float64_t right_edge[3];
1125   struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode **children;
1126   __pyx_t_5numpy_int64_t start_index[3];
1127   __pyx_t_5numpy_int32_t dims[3];
1128   __pyx_t_5numpy_float64_t dds[3];
1129 };
1130 
1131 /* "yt/geometry/grid_visitors.pxd":24
1132  *     np.float64_t dds[3]
1133  *
1134  * cdef struct GridTreeNodePadded:             # <<<<<<<<<<<<<<
1135  *     np.int32_t num_children
1136  *     np.int32_t level
1137  */
1138 struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNodePadded {
1139   __pyx_t_5numpy_int32_t num_children;
1140   __pyx_t_5numpy_int32_t level;
1141   __pyx_t_5numpy_int64_t index;
1142   __pyx_t_5numpy_float64_t left_edge_x;
1143   __pyx_t_5numpy_float64_t left_edge_y;
1144   __pyx_t_5numpy_float64_t left_edge_z;
1145   __pyx_t_5numpy_float64_t right_edge_x;
1146   __pyx_t_5numpy_float64_t right_edge_y;
1147   __pyx_t_5numpy_float64_t right_edge_z;
1148   __pyx_t_5numpy_int_t children_pointers;
1149   __pyx_t_5numpy_int64_t start_index_x;
1150   __pyx_t_5numpy_int64_t start_index_y;
1151   __pyx_t_5numpy_int64_t start_index_z;
1152   __pyx_t_5numpy_int32_t dims_x;
1153   __pyx_t_5numpy_int32_t dims_y;
1154   __pyx_t_5numpy_int32_t dims_z;
1155   __pyx_t_5numpy_float64_t dds_x;
1156   __pyx_t_5numpy_float64_t dds_y;
1157   __pyx_t_5numpy_float64_t dds_z;
1158 };
1159 
1160 /* "yt/geometry/grid_visitors.pxd":45
1161  *     np.float64_t dds_z
1162  *
1163  * cdef struct GridVisitorData:             # <<<<<<<<<<<<<<
1164  *     GridTreeNode *grid
1165  *     np.uint64_t index
1166  */
1167 struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData {
1168   struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode *grid;
1169   __pyx_t_5numpy_uint64_t index;
1170   __pyx_t_5numpy_uint64_t global_index;
1171   __pyx_t_5numpy_int64_t pos[3];
1172   int n_tuples;
1173   int **child_tuples;
1174   void *array;
1175   int ref_factor;
1176 };
1177 
1178 /* "yt/geometry/grid_visitors.pxd":61
1179  * cdef np.uint8_t check_child_masked(GridVisitorData *data) nogil
1180  *
1181  * ctypedef void grid_visitor_function(GridVisitorData *data,             # <<<<<<<<<<<<<<
1182  *                                          np.uint8_t selected) nogil
1183  * # This is similar in spirit to the way oct visitor functions work.  However,
1184  */
1185 typedef void __pyx_t_2yt_8geometry_13grid_visitors_grid_visitor_function(struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *, __pyx_t_5numpy_uint8_t);
1186 
1187 /* "yt/utilities/lib/bitarray.pxd":28
1188  *     return 1
1189  *
1190  * cdef class bitarray:             # <<<<<<<<<<<<<<
1191  *     cdef np.uint8_t *buf
1192  *     cdef np.uint64_t size
1193  */
1194 struct __pyx_obj_2yt_9utilities_3lib_8bitarray_bitarray {
1195   PyObject_HEAD
1196   struct __pyx_vtabstruct_2yt_9utilities_3lib_8bitarray_bitarray *__pyx_vtab;
1197   __pyx_t_5numpy_uint8_t *buf;
1198   __pyx_t_5numpy_uint64_t size;
1199   __pyx_t_5numpy_uint64_t buf_size;
1200   PyObject *ibuf;
1201 };
1202 
1203 
1204 
1205 struct __pyx_vtabstruct_2yt_9utilities_3lib_8bitarray_bitarray {
1206   void (*_set_value)(struct __pyx_obj_2yt_9utilities_3lib_8bitarray_bitarray *, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_uint8_t);
1207   __pyx_t_5numpy_uint8_t (*_query_value)(struct __pyx_obj_2yt_9utilities_3lib_8bitarray_bitarray *, __pyx_t_5numpy_uint64_t);
1208 };
1209 static struct __pyx_vtabstruct_2yt_9utilities_3lib_8bitarray_bitarray *__pyx_vtabptr_2yt_9utilities_3lib_8bitarray_bitarray;
1210 
1211 /* --- Runtime support code (head) --- */
1212 /* Refnanny.proto */
1213 #ifndef CYTHON_REFNANNY
1214   #define CYTHON_REFNANNY 0
1215 #endif
1216 #if CYTHON_REFNANNY
1217   typedef struct {
1218     void (*INCREF)(void*, PyObject*, int);
1219     void (*DECREF)(void*, PyObject*, int);
1220     void (*GOTREF)(void*, PyObject*, int);
1221     void (*GIVEREF)(void*, PyObject*, int);
1222     void* (*SetupContext)(const char*, int, const char*);
1223     void (*FinishContext)(void**);
1224   } __Pyx_RefNannyAPIStruct;
1225   static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1226   static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1227   #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1228 #ifdef WITH_THREAD
1229   #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1230           if (acquire_gil) {\
1231               PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1232               __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1233               PyGILState_Release(__pyx_gilstate_save);\
1234           } else {\
1235               __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1236           }
1237 #else
1238   #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1239           __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1240 #endif
1241   #define __Pyx_RefNannyFinishContext()\
1242           __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1243   #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1244   #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1245   #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1246   #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1247   #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1248   #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1249   #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1250   #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1251 #else
1252   #define __Pyx_RefNannyDeclarations
1253   #define __Pyx_RefNannySetupContext(name, acquire_gil)
1254   #define __Pyx_RefNannyFinishContext()
1255   #define __Pyx_INCREF(r) Py_INCREF(r)
1256   #define __Pyx_DECREF(r) Py_DECREF(r)
1257   #define __Pyx_GOTREF(r)
1258   #define __Pyx_GIVEREF(r)
1259   #define __Pyx_XINCREF(r) Py_XINCREF(r)
1260   #define __Pyx_XDECREF(r) Py_XDECREF(r)
1261   #define __Pyx_XGOTREF(r)
1262   #define __Pyx_XGIVEREF(r)
1263 #endif
1264 #define __Pyx_XDECREF_SET(r, v) do {\
1265         PyObject *tmp = (PyObject *) r;\
1266         r = v; __Pyx_XDECREF(tmp);\
1267     } while (0)
1268 #define __Pyx_DECREF_SET(r, v) do {\
1269         PyObject *tmp = (PyObject *) r;\
1270         r = v; __Pyx_DECREF(tmp);\
1271     } while (0)
1272 #define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1273 #define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1274 
1275 /* PyObjectGetAttrStr.proto */
1276 #if CYTHON_USE_TYPE_SLOTS
1277 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1278 #else
1279 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1280 #endif
1281 
1282 /* GetBuiltinName.proto */
1283 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1284 
1285 /* PyObjectCall.proto */
1286 #if CYTHON_COMPILING_IN_CPYTHON
1287 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1288 #else
1289 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1290 #endif
1291 
1292 /* PyThreadStateGet.proto */
1293 #if CYTHON_FAST_THREAD_STATE
1294 #define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
1295 #define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
1296 #define __Pyx_PyErr_Occurred()  __pyx_tstate->curexc_type
1297 #else
1298 #define __Pyx_PyThreadState_declare
1299 #define __Pyx_PyThreadState_assign
1300 #define __Pyx_PyErr_Occurred()  PyErr_Occurred()
1301 #endif
1302 
1303 /* PyErrFetchRestore.proto */
1304 #if CYTHON_FAST_THREAD_STATE
1305 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1306 #define __Pyx_ErrRestoreWithState(type, value, tb)  __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1307 #define __Pyx_ErrFetchWithState(type, value, tb)    __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1308 #define __Pyx_ErrRestore(type, value, tb)  __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1309 #define __Pyx_ErrFetch(type, value, tb)    __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1310 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1311 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1312 #if CYTHON_COMPILING_IN_CPYTHON
1313 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1314 #else
1315 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1316 #endif
1317 #else
1318 #define __Pyx_PyErr_Clear() PyErr_Clear()
1319 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1320 #define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
1321 #define __Pyx_ErrFetchWithState(type, value, tb)  PyErr_Fetch(type, value, tb)
1322 #define __Pyx_ErrRestoreInState(tstate, type, value, tb)  PyErr_Restore(type, value, tb)
1323 #define __Pyx_ErrFetchInState(tstate, type, value, tb)  PyErr_Fetch(type, value, tb)
1324 #define __Pyx_ErrRestore(type, value, tb)  PyErr_Restore(type, value, tb)
1325 #define __Pyx_ErrFetch(type, value, tb)  PyErr_Fetch(type, value, tb)
1326 #endif
1327 
1328 /* RaiseException.proto */
1329 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1330 
1331 /* PyCFunctionFastCall.proto */
1332 #if CYTHON_FAST_PYCCALL
1333 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1334 #else
1335 #define __Pyx_PyCFunction_FastCall(func, args, nargs)  (assert(0), NULL)
1336 #endif
1337 
1338 /* PyFunctionFastCall.proto */
1339 #if CYTHON_FAST_PYCALL
1340 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1341     __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1342 #if 1 || PY_VERSION_HEX < 0x030600B1
1343 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1344 #else
1345 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1346 #endif
1347 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1348     (sizeof(char [1 - 2*!(cond)]) - 1)
1349 #ifndef Py_MEMBER_SIZE
1350 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1351 #endif
1352   static size_t __pyx_pyframe_localsplus_offset = 0;
1353   #include "frameobject.h"
1354   #define __Pxy_PyFrame_Initialize_Offsets()\
1355     ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1356      (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1357   #define __Pyx_PyFrame_GetLocalsplus(frame)\
1358     (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1359 #endif
1360 
1361 /* PyObjectCallMethO.proto */
1362 #if CYTHON_COMPILING_IN_CPYTHON
1363 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1364 #endif
1365 
1366 /* PyObjectCallOneArg.proto */
1367 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1368 
1369 /* DictGetItem.proto */
1370 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
1371 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
1372 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
1373     (likely(PyDict_CheckExact(obj)) ?\
1374      __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
1375 #else
1376 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
1377 #define __Pyx_PyObject_Dict_GetItem(obj, name)  PyObject_GetItem(obj, name)
1378 #endif
1379 
1380 /* RaiseTooManyValuesToUnpack.proto */
1381 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1382 
1383 /* RaiseNeedMoreValuesToUnpack.proto */
1384 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1385 
1386 /* RaiseNoneIterError.proto */
1387 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
1388 
1389 /* ExtTypeTest.proto */
1390 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1391 
1392 /* GetTopmostException.proto */
1393 #if CYTHON_USE_EXC_INFO_STACK
1394 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1395 #endif
1396 
1397 /* SaveResetException.proto */
1398 #if CYTHON_FAST_THREAD_STATE
1399 #define __Pyx_ExceptionSave(type, value, tb)  __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1400 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1401 #define __Pyx_ExceptionReset(type, value, tb)  __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1402 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1403 #else
1404 #define __Pyx_ExceptionSave(type, value, tb)   PyErr_GetExcInfo(type, value, tb)
1405 #define __Pyx_ExceptionReset(type, value, tb)  PyErr_SetExcInfo(type, value, tb)
1406 #endif
1407 
1408 /* PyErrExceptionMatches.proto */
1409 #if CYTHON_FAST_THREAD_STATE
1410 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1411 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1412 #else
1413 #define __Pyx_PyErr_ExceptionMatches(err)  PyErr_ExceptionMatches(err)
1414 #endif
1415 
1416 /* GetException.proto */
1417 #if CYTHON_FAST_THREAD_STATE
1418 #define __Pyx_GetException(type, value, tb)  __Pyx__GetException(__pyx_tstate, type, value, tb)
1419 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1420 #else
1421 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1422 #endif
1423 
1424 /* GetAttr.proto */
1425 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1426 
1427 /* HasAttr.proto */
1428 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
1429 
1430 /* IncludeStringH.proto */
1431 #include <string.h>
1432 
1433 /* BytesEquals.proto */
1434 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
1435 
1436 /* UnicodeEquals.proto */
1437 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
1438 
1439 /* StrEquals.proto */
1440 #if PY_MAJOR_VERSION >= 3
1441 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
1442 #else
1443 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
1444 #endif
1445 
1446 /* PyObjectCall2Args.proto */
1447 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
1448 
1449 /* TypeImport.proto */
1450 #ifndef __PYX_HAVE_RT_ImportType_proto
1451 #define __PYX_HAVE_RT_ImportType_proto
1452 enum __Pyx_ImportType_CheckSize {
1453    __Pyx_ImportType_CheckSize_Error = 0,
1454    __Pyx_ImportType_CheckSize_Warn = 1,
1455    __Pyx_ImportType_CheckSize_Ignore = 2
1456 };
1457 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
1458 #endif
1459 
1460 /* GetVTable.proto */
1461 static void* __Pyx_GetVtable(PyObject *dict);
1462 
1463 /* PyDictVersioning.proto */
1464 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1465 #define __PYX_DICT_VERSION_INIT  ((PY_UINT64_T) -1)
1466 #define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
1467 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1468     (version_var) = __PYX_GET_DICT_VERSION(dict);\
1469     (cache_var) = (value);
1470 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1471     static PY_UINT64_T __pyx_dict_version = 0;\
1472     static PyObject *__pyx_dict_cached_value = NULL;\
1473     if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1474         (VAR) = __pyx_dict_cached_value;\
1475     } else {\
1476         (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1477         __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1478     }\
1479 }
1480 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1481 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1482 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1483 #else
1484 #define __PYX_GET_DICT_VERSION(dict)  (0)
1485 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1486 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP)  (VAR) = (LOOKUP);
1487 #endif
1488 
1489 /* CLineInTraceback.proto */
1490 #ifdef CYTHON_CLINE_IN_TRACEBACK
1491 #define __Pyx_CLineForTraceback(tstate, c_line)  (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1492 #else
1493 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1494 #endif
1495 
1496 /* CodeObjectCache.proto */
1497 typedef struct {
1498     PyCodeObject* code_object;
1499     int code_line;
1500 } __Pyx_CodeObjectCacheEntry;
1501 struct __Pyx_CodeObjectCache {
1502     int count;
1503     int max_count;
1504     __Pyx_CodeObjectCacheEntry* entries;
1505 };
1506 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1507 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
1508 static PyCodeObject *__pyx_find_code_object(int code_line);
1509 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
1510 
1511 /* AddTraceback.proto */
1512 static void __Pyx_AddTraceback(const char *funcname, int c_line,
1513                                int py_line, const char *filename);
1514 
1515 /* CIntToPy.proto */
1516 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
1517 
1518 /* CIntToPy.proto */
1519 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value);
1520 
1521 /* RealImag.proto */
1522 #if CYTHON_CCOMPLEX
1523   #ifdef __cplusplus
1524     #define __Pyx_CREAL(z) ((z).real())
1525     #define __Pyx_CIMAG(z) ((z).imag())
1526   #else
1527     #define __Pyx_CREAL(z) (__real__(z))
1528     #define __Pyx_CIMAG(z) (__imag__(z))
1529   #endif
1530 #else
1531     #define __Pyx_CREAL(z) ((z).real)
1532     #define __Pyx_CIMAG(z) ((z).imag)
1533 #endif
1534 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
1535         && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
1536     #define __Pyx_SET_CREAL(z,x) ((z).real(x))
1537     #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
1538 #else
1539     #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
1540     #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
1541 #endif
1542 
1543 /* Arithmetic.proto */
1544 #if CYTHON_CCOMPLEX
1545     #define __Pyx_c_eq_float(a, b)   ((a)==(b))
1546     #define __Pyx_c_sum_float(a, b)  ((a)+(b))
1547     #define __Pyx_c_diff_float(a, b) ((a)-(b))
1548     #define __Pyx_c_prod_float(a, b) ((a)*(b))
1549     #define __Pyx_c_quot_float(a, b) ((a)/(b))
1550     #define __Pyx_c_neg_float(a)     (-(a))
1551   #ifdef __cplusplus
1552     #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
1553     #define __Pyx_c_conj_float(z)    (::std::conj(z))
1554     #if 1
1555         #define __Pyx_c_abs_float(z)     (::std::abs(z))
1556         #define __Pyx_c_pow_float(a, b)  (::std::pow(a, b))
1557     #endif
1558   #else
1559     #define __Pyx_c_is_zero_float(z) ((z)==0)
1560     #define __Pyx_c_conj_float(z)    (conjf(z))
1561     #if 1
1562         #define __Pyx_c_abs_float(z)     (cabsf(z))
1563         #define __Pyx_c_pow_float(a, b)  (cpowf(a, b))
1564     #endif
1565  #endif
1566 #else
1567     static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
1568     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
1569     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
1570     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
1571     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
1572     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
1573     static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
1574     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
1575     #if 1
1576         static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
1577         static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
1578     #endif
1579 #endif
1580 
1581 /* Arithmetic.proto */
1582 #if CYTHON_CCOMPLEX
1583     #define __Pyx_c_eq_double(a, b)   ((a)==(b))
1584     #define __Pyx_c_sum_double(a, b)  ((a)+(b))
1585     #define __Pyx_c_diff_double(a, b) ((a)-(b))
1586     #define __Pyx_c_prod_double(a, b) ((a)*(b))
1587     #define __Pyx_c_quot_double(a, b) ((a)/(b))
1588     #define __Pyx_c_neg_double(a)     (-(a))
1589   #ifdef __cplusplus
1590     #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
1591     #define __Pyx_c_conj_double(z)    (::std::conj(z))
1592     #if 1
1593         #define __Pyx_c_abs_double(z)     (::std::abs(z))
1594         #define __Pyx_c_pow_double(a, b)  (::std::pow(a, b))
1595     #endif
1596   #else
1597     #define __Pyx_c_is_zero_double(z) ((z)==0)
1598     #define __Pyx_c_conj_double(z)    (conj(z))
1599     #if 1
1600         #define __Pyx_c_abs_double(z)     (cabs(z))
1601         #define __Pyx_c_pow_double(a, b)  (cpow(a, b))
1602     #endif
1603  #endif
1604 #else
1605     static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
1606     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
1607     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
1608     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
1609     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
1610     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
1611     static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
1612     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
1613     #if 1
1614         static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
1615         static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
1616     #endif
1617 #endif
1618 
1619 /* CIntToPy.proto */
1620 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value);
1621 
1622 /* CIntFromPy.proto */
1623 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
1624 
1625 /* CIntToPy.proto */
1626 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
1627 
1628 /* CIntFromPy.proto */
1629 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
1630 
1631 /* FastTypeChecks.proto */
1632 #if CYTHON_COMPILING_IN_CPYTHON
1633 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1634 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1635 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1636 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1637 #else
1638 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1639 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1640 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1641 #endif
1642 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1643 
1644 /* CheckBinaryVersion.proto */
1645 static int __Pyx_check_binary_version(void);
1646 
1647 /* FunctionExport.proto */
1648 static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig);
1649 
1650 /* InitStrings.proto */
1651 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1652 
1653 
1654 /* Module declarations from 'cpython.buffer' */
1655 
1656 /* Module declarations from 'libc.string' */
1657 
1658 /* Module declarations from 'libc.stdio' */
1659 
1660 /* Module declarations from '__builtin__' */
1661 
1662 /* Module declarations from 'cpython.type' */
1663 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
1664 
1665 /* Module declarations from 'cpython' */
1666 
1667 /* Module declarations from 'cpython.object' */
1668 
1669 /* Module declarations from 'cpython.ref' */
1670 
1671 /* Module declarations from 'cpython.mem' */
1672 
1673 /* Module declarations from 'numpy' */
1674 
1675 /* Module declarations from 'numpy' */
1676 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
1677 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
1678 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
1679 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
1680 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
1681 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
1682 
1683 /* Module declarations from 'cython' */
1684 
1685 /* Module declarations from 'libc.stdlib' */
1686 
1687 /* Module declarations from 'yt.utilities.lib.bitarray' */
1688 static PyTypeObject *__pyx_ptype_2yt_9utilities_3lib_8bitarray_bitarray = 0;
1689 static CYTHON_INLINE void __pyx_f_2yt_9utilities_3lib_8bitarray_ba_set_value(__pyx_t_5numpy_uint8_t *, __pyx_t_5numpy_uint64_t, __pyx_t_5numpy_uint8_t); /*proto*/
1690 static CYTHON_INLINE __pyx_t_5numpy_uint8_t __pyx_f_2yt_9utilities_3lib_8bitarray_ba_get_value(__pyx_t_5numpy_uint8_t *, __pyx_t_5numpy_uint64_t); /*proto*/
1691 
1692 /* Module declarations from 'yt.utilities.lib.fp_utils' */
1693 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*/
1694 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*/
1695 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*/
1696 
1697 /* Module declarations from 'yt.geometry.grid_visitors' */
1698 static void __pyx_f_2yt_8geometry_13grid_visitors_free_tuples(struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *); /*proto*/
1699 #define __Pyx_MODULE_NAME "yt.geometry.grid_visitors"
1700 extern int __pyx_module_is_main_yt__geometry__grid_visitors;
1701 int __pyx_module_is_main_yt__geometry__grid_visitors = 0;
1702 
1703 /* Implementation of 'yt.geometry.grid_visitors' */
1704 static PyObject *__pyx_builtin_range;
1705 static PyObject *__pyx_builtin_ValueError;
1706 static PyObject *__pyx_builtin_RuntimeError;
1707 static PyObject *__pyx_builtin_ImportError;
1708 static const char __pyx_k_main[] = "__main__";
1709 static const char __pyx_k_name[] = "__name__";
1710 static const char __pyx_k_test[] = "__test__";
1711 static const char __pyx_k_range[] = "range";
1712 static const char __pyx_k_units[] = "units";
1713 static const char __pyx_k_ValueError[] = "ValueError";
1714 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
1715 static const char __pyx_k_ImportError[] = "ImportError";
1716 static const char __pyx_k_code_length[] = "code_length";
1717 static const char __pyx_k_RuntimeError[] = "RuntimeError";
1718 static const char __pyx_k_convert_to_units[] = "convert_to_units";
1719 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
1720 static const char __pyx_k_Grid_visitor_functions[] = "\nGrid visitor functions\n\n\n\n\n";
1721 static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
1722 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
1723 static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
1724 static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
1725 static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
1726 static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
1727 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
1728 static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
1729 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
1730 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
1731 static PyObject *__pyx_n_s_ImportError;
1732 static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
1733 static PyObject *__pyx_n_s_RuntimeError;
1734 static PyObject *__pyx_n_s_ValueError;
1735 static PyObject *__pyx_n_s_cline_in_traceback;
1736 static PyObject *__pyx_n_s_code_length;
1737 static PyObject *__pyx_n_s_convert_to_units;
1738 static PyObject *__pyx_n_s_main;
1739 static PyObject *__pyx_n_s_name;
1740 static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
1741 static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
1742 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
1743 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
1744 static PyObject *__pyx_n_s_pyx_vtable;
1745 static PyObject *__pyx_n_s_range;
1746 static PyObject *__pyx_n_s_test;
1747 static PyObject *__pyx_n_s_units;
1748 static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
1749 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
1750 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
1751 static PyObject *__pyx_tuple_;
1752 static PyObject *__pyx_tuple__2;
1753 static PyObject *__pyx_tuple__3;
1754 static PyObject *__pyx_tuple__4;
1755 static PyObject *__pyx_tuple__5;
1756 static PyObject *__pyx_tuple__6;
1757 static PyObject *__pyx_tuple__7;
1758 /* Late includes */
1759 
1760 /* "yt/geometry/grid_visitors.pyx":20
1761  *
1762  *
1763  * cdef void free_tuples(GridVisitorData *data) nogil:             # <<<<<<<<<<<<<<
1764  *     # This wipes out the tuples, which is necessary since they are
1765  *     # heap-allocated
1766  */
1767 
__pyx_f_2yt_8geometry_13grid_visitors_free_tuples(struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData * __pyx_v_data)1768 static void __pyx_f_2yt_8geometry_13grid_visitors_free_tuples(struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *__pyx_v_data) {
1769   int __pyx_v_i;
1770   int __pyx_t_1;
1771   int __pyx_t_2;
1772   int __pyx_t_3;
1773   int __pyx_t_4;
1774 
1775   /* "yt/geometry/grid_visitors.pyx":24
1776  *     # heap-allocated
1777  *     cdef int i
1778  *     if data.child_tuples == NULL: return             # <<<<<<<<<<<<<<
1779  *     for i in range(data.n_tuples):
1780  *         free(data.child_tuples[i])
1781  */
1782   __pyx_t_1 = ((__pyx_v_data->child_tuples == NULL) != 0);
1783   if (__pyx_t_1) {
1784     goto __pyx_L0;
1785   }
1786 
1787   /* "yt/geometry/grid_visitors.pyx":25
1788  *     cdef int i
1789  *     if data.child_tuples == NULL: return
1790  *     for i in range(data.n_tuples):             # <<<<<<<<<<<<<<
1791  *         free(data.child_tuples[i])
1792  *     free(data.child_tuples)
1793  */
1794   __pyx_t_2 = __pyx_v_data->n_tuples;
1795   __pyx_t_3 = __pyx_t_2;
1796   for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
1797     __pyx_v_i = __pyx_t_4;
1798 
1799     /* "yt/geometry/grid_visitors.pyx":26
1800  *     if data.child_tuples == NULL: return
1801  *     for i in range(data.n_tuples):
1802  *         free(data.child_tuples[i])             # <<<<<<<<<<<<<<
1803  *     free(data.child_tuples)
1804  *     data.child_tuples = NULL
1805  */
1806     free((__pyx_v_data->child_tuples[__pyx_v_i]));
1807   }
1808 
1809   /* "yt/geometry/grid_visitors.pyx":27
1810  *     for i in range(data.n_tuples):
1811  *         free(data.child_tuples[i])
1812  *     free(data.child_tuples)             # <<<<<<<<<<<<<<
1813  *     data.child_tuples = NULL
1814  *     data.n_tuples = 0
1815  */
1816   free(__pyx_v_data->child_tuples);
1817 
1818   /* "yt/geometry/grid_visitors.pyx":28
1819  *         free(data.child_tuples[i])
1820  *     free(data.child_tuples)
1821  *     data.child_tuples = NULL             # <<<<<<<<<<<<<<
1822  *     data.n_tuples = 0
1823  *
1824  */
1825   __pyx_v_data->child_tuples = NULL;
1826 
1827   /* "yt/geometry/grid_visitors.pyx":29
1828  *     free(data.child_tuples)
1829  *     data.child_tuples = NULL
1830  *     data.n_tuples = 0             # <<<<<<<<<<<<<<
1831  *
1832  * @cython.boundscheck(False)
1833  */
1834   __pyx_v_data->n_tuples = 0;
1835 
1836   /* "yt/geometry/grid_visitors.pyx":20
1837  *
1838  *
1839  * cdef void free_tuples(GridVisitorData *data) nogil:             # <<<<<<<<<<<<<<
1840  *     # This wipes out the tuples, which is necessary since they are
1841  *     # heap-allocated
1842  */
1843 
1844   /* function exit code */
1845   __pyx_L0:;
1846 }
1847 
1848 /* "yt/geometry/grid_visitors.pyx":34
1849  * @cython.wraparound(False)
1850  * @cython.cdivision(True)
1851  * cdef void setup_tuples(GridVisitorData *data) nogil:             # <<<<<<<<<<<<<<
1852  *     # This sets up child-mask tuples.  Rather than a single mask that covers
1853  *     # everything, we instead allocate pairs of integers that are start/stop
1854  */
1855 
__pyx_f_2yt_8geometry_13grid_visitors_setup_tuples(struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData * __pyx_v_data)1856 static void __pyx_f_2yt_8geometry_13grid_visitors_setup_tuples(struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *__pyx_v_data) {
1857   int __pyx_v_i;
1858   int __pyx_v_j;
1859   __pyx_t_5numpy_int64_t __pyx_v_si;
1860   __pyx_t_5numpy_int64_t __pyx_v_ei;
1861   struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode *__pyx_v_g;
1862   struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode *__pyx_v_c;
1863   struct __pyx_t_2yt_8geometry_13grid_visitors_GridTreeNode *__pyx_t_1;
1864   __pyx_t_5numpy_int32_t __pyx_t_2;
1865   __pyx_t_5numpy_int32_t __pyx_t_3;
1866   int __pyx_t_4;
1867   int __pyx_t_5;
1868 
1869   /* "yt/geometry/grid_visitors.pyx":44
1870  *     cdef GridTreeNode *g
1871  *     cdef GridTreeNode *c
1872  *     free_tuples(data)             # <<<<<<<<<<<<<<
1873  *     g = data.grid
1874  *     data.child_tuples = <int**> malloc(sizeof(int*) * g.num_children)
1875  */
1876   __pyx_f_2yt_8geometry_13grid_visitors_free_tuples(__pyx_v_data);
1877 
1878   /* "yt/geometry/grid_visitors.pyx":45
1879  *     cdef GridTreeNode *c
1880  *     free_tuples(data)
1881  *     g = data.grid             # <<<<<<<<<<<<<<
1882  *     data.child_tuples = <int**> malloc(sizeof(int*) * g.num_children)
1883  *     for i in range(g.num_children):
1884  */
1885   __pyx_t_1 = __pyx_v_data->grid;
1886   __pyx_v_g = __pyx_t_1;
1887 
1888   /* "yt/geometry/grid_visitors.pyx":46
1889  *     free_tuples(data)
1890  *     g = data.grid
1891  *     data.child_tuples = <int**> malloc(sizeof(int*) * g.num_children)             # <<<<<<<<<<<<<<
1892  *     for i in range(g.num_children):
1893  *         c = g.children[i]
1894  */
1895   __pyx_v_data->child_tuples = ((int **)malloc(((sizeof(int *)) * __pyx_v_g->num_children)));
1896 
1897   /* "yt/geometry/grid_visitors.pyx":47
1898  *     g = data.grid
1899  *     data.child_tuples = <int**> malloc(sizeof(int*) * g.num_children)
1900  *     for i in range(g.num_children):             # <<<<<<<<<<<<<<
1901  *         c = g.children[i]
1902  *         data.child_tuples[i] = <int *>malloc(sizeof(int) * 6)
1903  */
1904   __pyx_t_2 = __pyx_v_g->num_children;
1905   __pyx_t_3 = __pyx_t_2;
1906   for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
1907     __pyx_v_i = __pyx_t_4;
1908 
1909     /* "yt/geometry/grid_visitors.pyx":48
1910  *     data.child_tuples = <int**> malloc(sizeof(int*) * g.num_children)
1911  *     for i in range(g.num_children):
1912  *         c = g.children[i]             # <<<<<<<<<<<<<<
1913  *         data.child_tuples[i] = <int *>malloc(sizeof(int) * 6)
1914  *         # Now we fill them in
1915  */
1916     __pyx_v_c = (__pyx_v_g->children[__pyx_v_i]);
1917 
1918     /* "yt/geometry/grid_visitors.pyx":49
1919  *     for i in range(g.num_children):
1920  *         c = g.children[i]
1921  *         data.child_tuples[i] = <int *>malloc(sizeof(int) * 6)             # <<<<<<<<<<<<<<
1922  *         # Now we fill them in
1923  *         for j in range(3):
1924  */
1925     (__pyx_v_data->child_tuples[__pyx_v_i]) = ((int *)malloc(((sizeof(int)) * 6)));
1926 
1927     /* "yt/geometry/grid_visitors.pyx":51
1928  *         data.child_tuples[i] = <int *>malloc(sizeof(int) * 6)
1929  *         # Now we fill them in
1930  *         for j in range(3):             # <<<<<<<<<<<<<<
1931  *             si = (c.start_index[j] / data.ref_factor) - g.start_index[j]
1932  *             ei = si + c.dims[j]/data.ref_factor - 1
1933  */
1934     for (__pyx_t_5 = 0; __pyx_t_5 < 3; __pyx_t_5+=1) {
1935       __pyx_v_j = __pyx_t_5;
1936 
1937       /* "yt/geometry/grid_visitors.pyx":52
1938  *         # Now we fill them in
1939  *         for j in range(3):
1940  *             si = (c.start_index[j] / data.ref_factor) - g.start_index[j]             # <<<<<<<<<<<<<<
1941  *             ei = si + c.dims[j]/data.ref_factor - 1
1942  *             data.child_tuples[i][j*2+0] = iclip(si, 0, g.dims[j] - 1)
1943  */
1944       __pyx_v_si = (((__pyx_v_c->start_index[__pyx_v_j]) / __pyx_v_data->ref_factor) - (__pyx_v_g->start_index[__pyx_v_j]));
1945 
1946       /* "yt/geometry/grid_visitors.pyx":53
1947  *         for j in range(3):
1948  *             si = (c.start_index[j] / data.ref_factor) - g.start_index[j]
1949  *             ei = si + c.dims[j]/data.ref_factor - 1             # <<<<<<<<<<<<<<
1950  *             data.child_tuples[i][j*2+0] = iclip(si, 0, g.dims[j] - 1)
1951  *             data.child_tuples[i][j*2+1] = iclip(ei, 0, g.dims[j] - 1)
1952  */
1953       __pyx_v_ei = ((__pyx_v_si + ((__pyx_v_c->dims[__pyx_v_j]) / __pyx_v_data->ref_factor)) - 1);
1954 
1955       /* "yt/geometry/grid_visitors.pyx":54
1956  *             si = (c.start_index[j] / data.ref_factor) - g.start_index[j]
1957  *             ei = si + c.dims[j]/data.ref_factor - 1
1958  *             data.child_tuples[i][j*2+0] = iclip(si, 0, g.dims[j] - 1)             # <<<<<<<<<<<<<<
1959  *             data.child_tuples[i][j*2+1] = iclip(ei, 0, g.dims[j] - 1)
1960  *     data.n_tuples = g.num_children
1961  */
1962       ((__pyx_v_data->child_tuples[__pyx_v_i])[((__pyx_v_j * 2) + 0)]) = __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_v_si, 0, ((__pyx_v_g->dims[__pyx_v_j]) - 1));
1963 
1964       /* "yt/geometry/grid_visitors.pyx":55
1965  *             ei = si + c.dims[j]/data.ref_factor - 1
1966  *             data.child_tuples[i][j*2+0] = iclip(si, 0, g.dims[j] - 1)
1967  *             data.child_tuples[i][j*2+1] = iclip(ei, 0, g.dims[j] - 1)             # <<<<<<<<<<<<<<
1968  *     data.n_tuples = g.num_children
1969  *
1970  */
1971       ((__pyx_v_data->child_tuples[__pyx_v_i])[((__pyx_v_j * 2) + 1)]) = __pyx_f_2yt_9utilities_3lib_8fp_utils_iclip(__pyx_v_ei, 0, ((__pyx_v_g->dims[__pyx_v_j]) - 1));
1972     }
1973   }
1974 
1975   /* "yt/geometry/grid_visitors.pyx":56
1976  *             data.child_tuples[i][j*2+0] = iclip(si, 0, g.dims[j] - 1)
1977  *             data.child_tuples[i][j*2+1] = iclip(ei, 0, g.dims[j] - 1)
1978  *     data.n_tuples = g.num_children             # <<<<<<<<<<<<<<
1979  *
1980  * @cython.boundscheck(False)
1981  */
1982   __pyx_t_2 = __pyx_v_g->num_children;
1983   __pyx_v_data->n_tuples = __pyx_t_2;
1984 
1985   /* "yt/geometry/grid_visitors.pyx":34
1986  * @cython.wraparound(False)
1987  * @cython.cdivision(True)
1988  * cdef void setup_tuples(GridVisitorData *data) nogil:             # <<<<<<<<<<<<<<
1989  *     # This sets up child-mask tuples.  Rather than a single mask that covers
1990  *     # everything, we instead allocate pairs of integers that are start/stop
1991  */
1992 
1993   /* function exit code */
1994 }
1995 
1996 /* "yt/geometry/grid_visitors.pyx":61
1997  * @cython.wraparound(False)
1998  * @cython.cdivision(True)
1999  * cdef np.uint8_t check_child_masked(GridVisitorData *data) nogil:             # <<<<<<<<<<<<<<
2000  *     # This simply checks if we're inside any of the tuples.  Probably not the
2001  *     # most efficient way, but the GVD* passed in has a position affiliated with
2002  */
2003 
__pyx_f_2yt_8geometry_13grid_visitors_check_child_masked(struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData * __pyx_v_data)2004 static __pyx_t_5numpy_uint8_t __pyx_f_2yt_8geometry_13grid_visitors_check_child_masked(struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *__pyx_v_data) {
2005   int __pyx_v_i;
2006   int __pyx_v_j;
2007   int __pyx_v_k;
2008   int *__pyx_v_tup;
2009   __pyx_t_5numpy_uint8_t __pyx_r;
2010   int __pyx_t_1;
2011   int __pyx_t_2;
2012   int __pyx_t_3;
2013   int __pyx_t_4;
2014   int __pyx_t_5;
2015   int __pyx_t_6;
2016 
2017   /* "yt/geometry/grid_visitors.pyx":67
2018  *     cdef int i, j, k
2019  *     cdef int *tup
2020  *     for i in range(data.n_tuples):             # <<<<<<<<<<<<<<
2021  *         # k is if we're inside a given child tuple.  We check each one
2022  *         # individually, and invalidate if we're outside.
2023  */
2024   __pyx_t_1 = __pyx_v_data->n_tuples;
2025   __pyx_t_2 = __pyx_t_1;
2026   for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
2027     __pyx_v_i = __pyx_t_3;
2028 
2029     /* "yt/geometry/grid_visitors.pyx":70
2030  *         # k is if we're inside a given child tuple.  We check each one
2031  *         # individually, and invalidate if we're outside.
2032  *         k = 1             # <<<<<<<<<<<<<<
2033  *         tup = data.child_tuples[i]
2034  *         for j in range(3):
2035  */
2036     __pyx_v_k = 1;
2037 
2038     /* "yt/geometry/grid_visitors.pyx":71
2039  *         # individually, and invalidate if we're outside.
2040  *         k = 1
2041  *         tup = data.child_tuples[i]             # <<<<<<<<<<<<<<
2042  *         for j in range(3):
2043  *             # Check if pos is outside in any of the three dimensions
2044  */
2045     __pyx_v_tup = (__pyx_v_data->child_tuples[__pyx_v_i]);
2046 
2047     /* "yt/geometry/grid_visitors.pyx":72
2048  *         k = 1
2049  *         tup = data.child_tuples[i]
2050  *         for j in range(3):             # <<<<<<<<<<<<<<
2051  *             # Check if pos is outside in any of the three dimensions
2052  *             if data.pos[j] < tup[j*2+0] or data.pos[j] > tup[j*2+1]:
2053  */
2054     for (__pyx_t_4 = 0; __pyx_t_4 < 3; __pyx_t_4+=1) {
2055       __pyx_v_j = __pyx_t_4;
2056 
2057       /* "yt/geometry/grid_visitors.pyx":74
2058  *         for j in range(3):
2059  *             # Check if pos is outside in any of the three dimensions
2060  *             if data.pos[j] < tup[j*2+0] or data.pos[j] > tup[j*2+1]:             # <<<<<<<<<<<<<<
2061  *                 k = 0
2062  *                 break
2063  */
2064       __pyx_t_6 = (((__pyx_v_data->pos[__pyx_v_j]) < (__pyx_v_tup[((__pyx_v_j * 2) + 0)])) != 0);
2065       if (!__pyx_t_6) {
2066       } else {
2067         __pyx_t_5 = __pyx_t_6;
2068         goto __pyx_L8_bool_binop_done;
2069       }
2070       __pyx_t_6 = (((__pyx_v_data->pos[__pyx_v_j]) > (__pyx_v_tup[((__pyx_v_j * 2) + 1)])) != 0);
2071       __pyx_t_5 = __pyx_t_6;
2072       __pyx_L8_bool_binop_done:;
2073       if (__pyx_t_5) {
2074 
2075         /* "yt/geometry/grid_visitors.pyx":75
2076  *             # Check if pos is outside in any of the three dimensions
2077  *             if data.pos[j] < tup[j*2+0] or data.pos[j] > tup[j*2+1]:
2078  *                 k = 0             # <<<<<<<<<<<<<<
2079  *                 break
2080  *         if k == 1: return 1 # Return 1 for child masked
2081  */
2082         __pyx_v_k = 0;
2083 
2084         /* "yt/geometry/grid_visitors.pyx":76
2085  *             if data.pos[j] < tup[j*2+0] or data.pos[j] > tup[j*2+1]:
2086  *                 k = 0
2087  *                 break             # <<<<<<<<<<<<<<
2088  *         if k == 1: return 1 # Return 1 for child masked
2089  *     return 0 # Only return 0 if it doesn't match any of the children
2090  */
2091         goto __pyx_L6_break;
2092 
2093         /* "yt/geometry/grid_visitors.pyx":74
2094  *         for j in range(3):
2095  *             # Check if pos is outside in any of the three dimensions
2096  *             if data.pos[j] < tup[j*2+0] or data.pos[j] > tup[j*2+1]:             # <<<<<<<<<<<<<<
2097  *                 k = 0
2098  *                 break
2099  */
2100       }
2101     }
2102     __pyx_L6_break:;
2103 
2104     /* "yt/geometry/grid_visitors.pyx":77
2105  *                 k = 0
2106  *                 break
2107  *         if k == 1: return 1 # Return 1 for child masked             # <<<<<<<<<<<<<<
2108  *     return 0 # Only return 0 if it doesn't match any of the children
2109  *
2110  */
2111     __pyx_t_5 = ((__pyx_v_k == 1) != 0);
2112     if (__pyx_t_5) {
2113       __pyx_r = 1;
2114       goto __pyx_L0;
2115     }
2116   }
2117 
2118   /* "yt/geometry/grid_visitors.pyx":78
2119  *                 break
2120  *         if k == 1: return 1 # Return 1 for child masked
2121  *     return 0 # Only return 0 if it doesn't match any of the children             # <<<<<<<<<<<<<<
2122  *
2123  * @cython.boundscheck(False)
2124  */
2125   __pyx_r = 0;
2126   goto __pyx_L0;
2127 
2128   /* "yt/geometry/grid_visitors.pyx":61
2129  * @cython.wraparound(False)
2130  * @cython.cdivision(True)
2131  * cdef np.uint8_t check_child_masked(GridVisitorData *data) nogil:             # <<<<<<<<<<<<<<
2132  *     # This simply checks if we're inside any of the tuples.  Probably not the
2133  *     # most efficient way, but the GVD* passed in has a position affiliated with
2134  */
2135 
2136   /* function exit code */
2137   __pyx_L0:;
2138   return __pyx_r;
2139 }
2140 
2141 /* "yt/geometry/grid_visitors.pyx":83
2142  * @cython.wraparound(False)
2143  * @cython.cdivision(True)
2144  * cdef void count_cells(GridVisitorData *data, np.uint8_t selected) nogil:             # <<<<<<<<<<<<<<
2145  *     # Simply increment for each one, if we've selected it.
2146  *     if selected == 0: return
2147  */
2148 
__pyx_f_2yt_8geometry_13grid_visitors_count_cells(struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData * __pyx_v_data,__pyx_t_5numpy_uint8_t __pyx_v_selected)2149 static void __pyx_f_2yt_8geometry_13grid_visitors_count_cells(struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *__pyx_v_data, __pyx_t_5numpy_uint8_t __pyx_v_selected) {
2150   __pyx_t_5numpy_uint64_t *__pyx_v_count;
2151   int __pyx_t_1;
2152   long __pyx_t_2;
2153 
2154   /* "yt/geometry/grid_visitors.pyx":85
2155  * cdef void count_cells(GridVisitorData *data, np.uint8_t selected) nogil:
2156  *     # Simply increment for each one, if we've selected it.
2157  *     if selected == 0: return             # <<<<<<<<<<<<<<
2158  *     cdef np.uint64_t *count = <np.uint64_t*> data.array
2159  *     count[0] += 1
2160  */
2161   __pyx_t_1 = ((__pyx_v_selected == 0) != 0);
2162   if (__pyx_t_1) {
2163     goto __pyx_L0;
2164   }
2165 
2166   /* "yt/geometry/grid_visitors.pyx":86
2167  *     # Simply increment for each one, if we've selected it.
2168  *     if selected == 0: return
2169  *     cdef np.uint64_t *count = <np.uint64_t*> data.array             # <<<<<<<<<<<<<<
2170  *     count[0] += 1
2171  *
2172  */
2173   __pyx_v_count = ((__pyx_t_5numpy_uint64_t *)__pyx_v_data->array);
2174 
2175   /* "yt/geometry/grid_visitors.pyx":87
2176  *     if selected == 0: return
2177  *     cdef np.uint64_t *count = <np.uint64_t*> data.array
2178  *     count[0] += 1             # <<<<<<<<<<<<<<
2179  *
2180  * @cython.boundscheck(False)
2181  */
2182   __pyx_t_2 = 0;
2183   (__pyx_v_count[__pyx_t_2]) = ((__pyx_v_count[__pyx_t_2]) + 1);
2184 
2185   /* "yt/geometry/grid_visitors.pyx":83
2186  * @cython.wraparound(False)
2187  * @cython.cdivision(True)
2188  * cdef void count_cells(GridVisitorData *data, np.uint8_t selected) nogil:             # <<<<<<<<<<<<<<
2189  *     # Simply increment for each one, if we've selected it.
2190  *     if selected == 0: return
2191  */
2192 
2193   /* function exit code */
2194   __pyx_L0:;
2195 }
2196 
2197 /* "yt/geometry/grid_visitors.pyx":92
2198  * @cython.wraparound(False)
2199  * @cython.cdivision(True)
2200  * cdef void mask_cells(GridVisitorData *data, np.uint8_t selected) nogil:             # <<<<<<<<<<<<<<
2201  *     # Set our bitarray -- we're creating a mask -- if we are selected.
2202  *     if selected == 0: return
2203  */
2204 
__pyx_f_2yt_8geometry_13grid_visitors_mask_cells(struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData * __pyx_v_data,__pyx_t_5numpy_uint8_t __pyx_v_selected)2205 static void __pyx_f_2yt_8geometry_13grid_visitors_mask_cells(struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *__pyx_v_data, __pyx_t_5numpy_uint8_t __pyx_v_selected) {
2206   __pyx_t_5numpy_uint8_t *__pyx_v_mask;
2207   int __pyx_t_1;
2208 
2209   /* "yt/geometry/grid_visitors.pyx":94
2210  * cdef void mask_cells(GridVisitorData *data, np.uint8_t selected) nogil:
2211  *     # Set our bitarray -- we're creating a mask -- if we are selected.
2212  *     if selected == 0: return             # <<<<<<<<<<<<<<
2213  *     cdef np.uint8_t *mask = <np.uint8_t*> data.array
2214  *     ba_set_value(mask, data.global_index, 1)
2215  */
2216   __pyx_t_1 = ((__pyx_v_selected == 0) != 0);
2217   if (__pyx_t_1) {
2218     goto __pyx_L0;
2219   }
2220 
2221   /* "yt/geometry/grid_visitors.pyx":95
2222  *     # Set our bitarray -- we're creating a mask -- if we are selected.
2223  *     if selected == 0: return
2224  *     cdef np.uint8_t *mask = <np.uint8_t*> data.array             # <<<<<<<<<<<<<<
2225  *     ba_set_value(mask, data.global_index, 1)
2226  *     # No need to increment anything.
2227  */
2228   __pyx_v_mask = ((__pyx_t_5numpy_uint8_t *)__pyx_v_data->array);
2229 
2230   /* "yt/geometry/grid_visitors.pyx":96
2231  *     if selected == 0: return
2232  *     cdef np.uint8_t *mask = <np.uint8_t*> data.array
2233  *     ba_set_value(mask, data.global_index, 1)             # <<<<<<<<<<<<<<
2234  *     # No need to increment anything.
2235  *
2236  */
2237   __pyx_f_2yt_9utilities_3lib_8bitarray_ba_set_value(__pyx_v_mask, __pyx_v_data->global_index, 1);
2238 
2239   /* "yt/geometry/grid_visitors.pyx":92
2240  * @cython.wraparound(False)
2241  * @cython.cdivision(True)
2242  * cdef void mask_cells(GridVisitorData *data, np.uint8_t selected) nogil:             # <<<<<<<<<<<<<<
2243  *     # Set our bitarray -- we're creating a mask -- if we are selected.
2244  *     if selected == 0: return
2245  */
2246 
2247   /* function exit code */
2248   __pyx_L0:;
2249 }
2250 
2251 /* "yt/geometry/grid_visitors.pyx":102
2252  * @cython.wraparound(False)
2253  * @cython.cdivision(True)
2254  * cdef void icoords_cells(GridVisitorData *data, np.uint8_t selected) nogil:             # <<<<<<<<<<<<<<
2255  *     # Nice and easy icoord setter.
2256  *     if selected == 0: return
2257  */
2258 
__pyx_f_2yt_8geometry_13grid_visitors_icoords_cells(struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData * __pyx_v_data,__pyx_t_5numpy_uint8_t __pyx_v_selected)2259 static void __pyx_f_2yt_8geometry_13grid_visitors_icoords_cells(struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *__pyx_v_data, __pyx_t_5numpy_uint8_t __pyx_v_selected) {
2260   int __pyx_v_i;
2261   __pyx_t_5numpy_int64_t *__pyx_v_icoords;
2262   int __pyx_t_1;
2263   int __pyx_t_2;
2264 
2265   /* "yt/geometry/grid_visitors.pyx":104
2266  * cdef void icoords_cells(GridVisitorData *data, np.uint8_t selected) nogil:
2267  *     # Nice and easy icoord setter.
2268  *     if selected == 0: return             # <<<<<<<<<<<<<<
2269  *     cdef int i
2270  *     cdef np.int64_t *icoords = <np.int64_t*> data.array
2271  */
2272   __pyx_t_1 = ((__pyx_v_selected == 0) != 0);
2273   if (__pyx_t_1) {
2274     goto __pyx_L0;
2275   }
2276 
2277   /* "yt/geometry/grid_visitors.pyx":106
2278  *     if selected == 0: return
2279  *     cdef int i
2280  *     cdef np.int64_t *icoords = <np.int64_t*> data.array             # <<<<<<<<<<<<<<
2281  *     for i in range(3):
2282  *         icoords[data.index * 3 + i] = data.pos[i] + data.grid.start_index[i]
2283  */
2284   __pyx_v_icoords = ((__pyx_t_5numpy_int64_t *)__pyx_v_data->array);
2285 
2286   /* "yt/geometry/grid_visitors.pyx":107
2287  *     cdef int i
2288  *     cdef np.int64_t *icoords = <np.int64_t*> data.array
2289  *     for i in range(3):             # <<<<<<<<<<<<<<
2290  *         icoords[data.index * 3 + i] = data.pos[i] + data.grid.start_index[i]
2291  *     data.index += 1
2292  */
2293   for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) {
2294     __pyx_v_i = __pyx_t_2;
2295 
2296     /* "yt/geometry/grid_visitors.pyx":108
2297  *     cdef np.int64_t *icoords = <np.int64_t*> data.array
2298  *     for i in range(3):
2299  *         icoords[data.index * 3 + i] = data.pos[i] + data.grid.start_index[i]             # <<<<<<<<<<<<<<
2300  *     data.index += 1
2301  *
2302  */
2303     (__pyx_v_icoords[((__pyx_v_data->index * 3) + __pyx_v_i)]) = ((__pyx_v_data->pos[__pyx_v_i]) + (__pyx_v_data->grid->start_index[__pyx_v_i]));
2304   }
2305 
2306   /* "yt/geometry/grid_visitors.pyx":109
2307  *     for i in range(3):
2308  *         icoords[data.index * 3 + i] = data.pos[i] + data.grid.start_index[i]
2309  *     data.index += 1             # <<<<<<<<<<<<<<
2310  *
2311  * @cython.boundscheck(False)
2312  */
2313   __pyx_v_data->index = (__pyx_v_data->index + 1);
2314 
2315   /* "yt/geometry/grid_visitors.pyx":102
2316  * @cython.wraparound(False)
2317  * @cython.cdivision(True)
2318  * cdef void icoords_cells(GridVisitorData *data, np.uint8_t selected) nogil:             # <<<<<<<<<<<<<<
2319  *     # Nice and easy icoord setter.
2320  *     if selected == 0: return
2321  */
2322 
2323   /* function exit code */
2324   __pyx_L0:;
2325 }
2326 
2327 /* "yt/geometry/grid_visitors.pyx":114
2328  * @cython.wraparound(False)
2329  * @cython.cdivision(True)
2330  * cdef void ires_cells(GridVisitorData *data, np.uint8_t selected) nogil:             # <<<<<<<<<<<<<<
2331  *     # Fill with the level value.
2332  *     if selected == 0: return
2333  */
2334 
__pyx_f_2yt_8geometry_13grid_visitors_ires_cells(struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData * __pyx_v_data,__pyx_t_5numpy_uint8_t __pyx_v_selected)2335 static void __pyx_f_2yt_8geometry_13grid_visitors_ires_cells(struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *__pyx_v_data, __pyx_t_5numpy_uint8_t __pyx_v_selected) {
2336   __pyx_t_5numpy_int64_t *__pyx_v_ires;
2337   int __pyx_t_1;
2338   __pyx_t_5numpy_int32_t __pyx_t_2;
2339 
2340   /* "yt/geometry/grid_visitors.pyx":116
2341  * cdef void ires_cells(GridVisitorData *data, np.uint8_t selected) nogil:
2342  *     # Fill with the level value.
2343  *     if selected == 0: return             # <<<<<<<<<<<<<<
2344  *     cdef np.int64_t *ires = <np.int64_t*> data.array
2345  *     ires[data.index] = data.grid.level
2346  */
2347   __pyx_t_1 = ((__pyx_v_selected == 0) != 0);
2348   if (__pyx_t_1) {
2349     goto __pyx_L0;
2350   }
2351 
2352   /* "yt/geometry/grid_visitors.pyx":117
2353  *     # Fill with the level value.
2354  *     if selected == 0: return
2355  *     cdef np.int64_t *ires = <np.int64_t*> data.array             # <<<<<<<<<<<<<<
2356  *     ires[data.index] = data.grid.level
2357  *     data.index += 1
2358  */
2359   __pyx_v_ires = ((__pyx_t_5numpy_int64_t *)__pyx_v_data->array);
2360 
2361   /* "yt/geometry/grid_visitors.pyx":118
2362  *     if selected == 0: return
2363  *     cdef np.int64_t *ires = <np.int64_t*> data.array
2364  *     ires[data.index] = data.grid.level             # <<<<<<<<<<<<<<
2365  *     data.index += 1
2366  *
2367  */
2368   __pyx_t_2 = __pyx_v_data->grid->level;
2369   (__pyx_v_ires[__pyx_v_data->index]) = __pyx_t_2;
2370 
2371   /* "yt/geometry/grid_visitors.pyx":119
2372  *     cdef np.int64_t *ires = <np.int64_t*> data.array
2373  *     ires[data.index] = data.grid.level
2374  *     data.index += 1             # <<<<<<<<<<<<<<
2375  *
2376  * @cython.boundscheck(False)
2377  */
2378   __pyx_v_data->index = (__pyx_v_data->index + 1);
2379 
2380   /* "yt/geometry/grid_visitors.pyx":114
2381  * @cython.wraparound(False)
2382  * @cython.cdivision(True)
2383  * cdef void ires_cells(GridVisitorData *data, np.uint8_t selected) nogil:             # <<<<<<<<<<<<<<
2384  *     # Fill with the level value.
2385  *     if selected == 0: return
2386  */
2387 
2388   /* function exit code */
2389   __pyx_L0:;
2390 }
2391 
2392 /* "yt/geometry/grid_visitors.pyx":124
2393  * @cython.wraparound(False)
2394  * @cython.cdivision(True)
2395  * cdef void fwidth_cells(GridVisitorData *data, np.uint8_t selected) nogil:             # <<<<<<<<<<<<<<
2396  *     # Fill with our dds.
2397  *     if selected == 0: return
2398  */
2399 
__pyx_f_2yt_8geometry_13grid_visitors_fwidth_cells(struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData * __pyx_v_data,__pyx_t_5numpy_uint8_t __pyx_v_selected)2400 static void __pyx_f_2yt_8geometry_13grid_visitors_fwidth_cells(struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *__pyx_v_data, __pyx_t_5numpy_uint8_t __pyx_v_selected) {
2401   int __pyx_v_i;
2402   __pyx_t_5numpy_float64_t *__pyx_v_fwidth;
2403   int __pyx_t_1;
2404   int __pyx_t_2;
2405 
2406   /* "yt/geometry/grid_visitors.pyx":126
2407  * cdef void fwidth_cells(GridVisitorData *data, np.uint8_t selected) nogil:
2408  *     # Fill with our dds.
2409  *     if selected == 0: return             # <<<<<<<<<<<<<<
2410  *     cdef int i
2411  *     cdef np.float64_t *fwidth = <np.float64_t*> data.array
2412  */
2413   __pyx_t_1 = ((__pyx_v_selected == 0) != 0);
2414   if (__pyx_t_1) {
2415     goto __pyx_L0;
2416   }
2417 
2418   /* "yt/geometry/grid_visitors.pyx":128
2419  *     if selected == 0: return
2420  *     cdef int i
2421  *     cdef np.float64_t *fwidth = <np.float64_t*> data.array             # <<<<<<<<<<<<<<
2422  *     for i in range(3):
2423  *         fwidth[data.index * 3 + i] = data.grid.dds[i]
2424  */
2425   __pyx_v_fwidth = ((__pyx_t_5numpy_float64_t *)__pyx_v_data->array);
2426 
2427   /* "yt/geometry/grid_visitors.pyx":129
2428  *     cdef int i
2429  *     cdef np.float64_t *fwidth = <np.float64_t*> data.array
2430  *     for i in range(3):             # <<<<<<<<<<<<<<
2431  *         fwidth[data.index * 3 + i] = data.grid.dds[i]
2432  *     data.index += 1
2433  */
2434   for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) {
2435     __pyx_v_i = __pyx_t_2;
2436 
2437     /* "yt/geometry/grid_visitors.pyx":130
2438  *     cdef np.float64_t *fwidth = <np.float64_t*> data.array
2439  *     for i in range(3):
2440  *         fwidth[data.index * 3 + i] = data.grid.dds[i]             # <<<<<<<<<<<<<<
2441  *     data.index += 1
2442  *
2443  */
2444     (__pyx_v_fwidth[((__pyx_v_data->index * 3) + __pyx_v_i)]) = (__pyx_v_data->grid->dds[__pyx_v_i]);
2445   }
2446 
2447   /* "yt/geometry/grid_visitors.pyx":131
2448  *     for i in range(3):
2449  *         fwidth[data.index * 3 + i] = data.grid.dds[i]
2450  *     data.index += 1             # <<<<<<<<<<<<<<
2451  *
2452  * @cython.boundscheck(False)
2453  */
2454   __pyx_v_data->index = (__pyx_v_data->index + 1);
2455 
2456   /* "yt/geometry/grid_visitors.pyx":124
2457  * @cython.wraparound(False)
2458  * @cython.cdivision(True)
2459  * cdef void fwidth_cells(GridVisitorData *data, np.uint8_t selected) nogil:             # <<<<<<<<<<<<<<
2460  *     # Fill with our dds.
2461  *     if selected == 0: return
2462  */
2463 
2464   /* function exit code */
2465   __pyx_L0:;
2466 }
2467 
2468 /* "yt/geometry/grid_visitors.pyx":136
2469  * @cython.wraparound(False)
2470  * @cython.cdivision(True)
2471  * cdef void fcoords_cells(GridVisitorData *data, np.uint8_t selected) nogil:             # <<<<<<<<<<<<<<
2472  *     # Simple cell-centered position filling.
2473  *     if selected == 0: return
2474  */
2475 
__pyx_f_2yt_8geometry_13grid_visitors_fcoords_cells(struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData * __pyx_v_data,__pyx_t_5numpy_uint8_t __pyx_v_selected)2476 static void __pyx_f_2yt_8geometry_13grid_visitors_fcoords_cells(struct __pyx_t_2yt_8geometry_13grid_visitors_GridVisitorData *__pyx_v_data, __pyx_t_5numpy_uint8_t __pyx_v_selected) {
2477   int __pyx_v_i;
2478   __pyx_t_5numpy_float64_t *__pyx_v_fcoords;
2479   int __pyx_t_1;
2480   int __pyx_t_2;
2481 
2482   /* "yt/geometry/grid_visitors.pyx":138
2483  * cdef void fcoords_cells(GridVisitorData *data, np.uint8_t selected) nogil:
2484  *     # Simple cell-centered position filling.
2485  *     if selected == 0: return             # <<<<<<<<<<<<<<
2486  *     cdef int i
2487  *     cdef np.float64_t *fcoords = <np.float64_t*> data.array
2488  */
2489   __pyx_t_1 = ((__pyx_v_selected == 0) != 0);
2490   if (__pyx_t_1) {
2491     goto __pyx_L0;
2492   }
2493 
2494   /* "yt/geometry/grid_visitors.pyx":140
2495  *     if selected == 0: return
2496  *     cdef int i
2497  *     cdef np.float64_t *fcoords = <np.float64_t*> data.array             # <<<<<<<<<<<<<<
2498  *     for i in range(3):
2499  *         fcoords[data.index * 3 + i] = data.grid.left_edge[i] + \
2500  */
2501   __pyx_v_fcoords = ((__pyx_t_5numpy_float64_t *)__pyx_v_data->array);
2502 
2503   /* "yt/geometry/grid_visitors.pyx":141
2504  *     cdef int i
2505  *     cdef np.float64_t *fcoords = <np.float64_t*> data.array
2506  *     for i in range(3):             # <<<<<<<<<<<<<<
2507  *         fcoords[data.index * 3 + i] = data.grid.left_edge[i] + \
2508  *             (0.5 + data.pos[i])*data.grid.dds[i]
2509  */
2510   for (__pyx_t_2 = 0; __pyx_t_2 < 3; __pyx_t_2+=1) {
2511     __pyx_v_i = __pyx_t_2;
2512 
2513     /* "yt/geometry/grid_visitors.pyx":142
2514  *     cdef np.float64_t *fcoords = <np.float64_t*> data.array
2515  *     for i in range(3):
2516  *         fcoords[data.index * 3 + i] = data.grid.left_edge[i] + \             # <<<<<<<<<<<<<<
2517  *             (0.5 + data.pos[i])*data.grid.dds[i]
2518  *     data.index += 1
2519  */
2520     (__pyx_v_fcoords[((__pyx_v_data->index * 3) + __pyx_v_i)]) = ((__pyx_v_data->grid->left_edge[__pyx_v_i]) + ((0.5 + (__pyx_v_data->pos[__pyx_v_i])) * (__pyx_v_data->grid->dds[__pyx_v_i])));
2521   }
2522 
2523   /* "yt/geometry/grid_visitors.pyx":144
2524  *         fcoords[data.index * 3 + i] = data.grid.left_edge[i] + \
2525  *             (0.5 + data.pos[i])*data.grid.dds[i]
2526  *     data.index += 1             # <<<<<<<<<<<<<<
2527  */
2528   __pyx_v_data->index = (__pyx_v_data->index + 1);
2529 
2530   /* "yt/geometry/grid_visitors.pyx":136
2531  * @cython.wraparound(False)
2532  * @cython.cdivision(True)
2533  * cdef void fcoords_cells(GridVisitorData *data, np.uint8_t selected) nogil:             # <<<<<<<<<<<<<<
2534  *     # Simple cell-centered position filling.
2535  *     if selected == 0: return
2536  */
2537 
2538   /* function exit code */
2539   __pyx_L0:;
2540 }
2541 
2542 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":258
2543  *         # experimental exception made for __getbuffer__ and __releasebuffer__
2544  *         # -- the details of this may change.
2545  *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
2546  *             # This implementation of getbuffer is geared towards Cython
2547  *             # requirements, and does not yet fulfill the PEP.
2548  */
2549 
2550 /* Python wrapper */
2551 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)2552 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
2553   int __pyx_r;
2554   __Pyx_RefNannyDeclarations
2555   __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
2556   __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
2557 
2558   /* function exit code */
2559   __Pyx_RefNannyFinishContext();
2560   return __pyx_r;
2561 }
2562 
__pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject * __pyx_v_self,Py_buffer * __pyx_v_info,int __pyx_v_flags)2563 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
2564   int __pyx_v_i;
2565   int __pyx_v_ndim;
2566   int __pyx_v_endian_detector;
2567   int __pyx_v_little_endian;
2568   int __pyx_v_t;
2569   char *__pyx_v_f;
2570   PyArray_Descr *__pyx_v_descr = 0;
2571   int __pyx_v_offset;
2572   int __pyx_r;
2573   __Pyx_RefNannyDeclarations
2574   int __pyx_t_1;
2575   int __pyx_t_2;
2576   PyObject *__pyx_t_3 = NULL;
2577   int __pyx_t_4;
2578   int __pyx_t_5;
2579   int __pyx_t_6;
2580   PyArray_Descr *__pyx_t_7;
2581   PyObject *__pyx_t_8 = NULL;
2582   char *__pyx_t_9;
2583   if (__pyx_v_info == NULL) {
2584     PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
2585     return -1;
2586   }
2587   __Pyx_RefNannySetupContext("__getbuffer__", 0);
2588   __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
2589   __Pyx_GIVEREF(__pyx_v_info->obj);
2590 
2591   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":265
2592  *
2593  *             cdef int i, ndim
2594  *             cdef int endian_detector = 1             # <<<<<<<<<<<<<<
2595  *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
2596  *
2597  */
2598   __pyx_v_endian_detector = 1;
2599 
2600   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":266
2601  *             cdef int i, ndim
2602  *             cdef int endian_detector = 1
2603  *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
2604  *
2605  *             ndim = PyArray_NDIM(self)
2606  */
2607   __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
2608 
2609   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":268
2610  *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
2611  *
2612  *             ndim = PyArray_NDIM(self)             # <<<<<<<<<<<<<<
2613  *
2614  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
2615  */
2616   __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
2617 
2618   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270
2619  *             ndim = PyArray_NDIM(self)
2620  *
2621  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
2622  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
2623  *                 raise ValueError(u"ndarray is not C contiguous")
2624  */
2625   __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
2626   if (__pyx_t_2) {
2627   } else {
2628     __pyx_t_1 = __pyx_t_2;
2629     goto __pyx_L4_bool_binop_done;
2630   }
2631 
2632   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":271
2633  *
2634  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
2635  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):             # <<<<<<<<<<<<<<
2636  *                 raise ValueError(u"ndarray is not C contiguous")
2637  *
2638  */
2639   __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_C_CONTIGUOUS) != 0)) != 0);
2640   __pyx_t_1 = __pyx_t_2;
2641   __pyx_L4_bool_binop_done:;
2642 
2643   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270
2644  *             ndim = PyArray_NDIM(self)
2645  *
2646  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
2647  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
2648  *                 raise ValueError(u"ndarray is not C contiguous")
2649  */
2650   if (unlikely(__pyx_t_1)) {
2651 
2652     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272
2653  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
2654  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
2655  *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
2656  *
2657  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
2658  */
2659     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 272, __pyx_L1_error)
2660     __Pyx_GOTREF(__pyx_t_3);
2661     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
2662     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2663     __PYX_ERR(1, 272, __pyx_L1_error)
2664 
2665     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270
2666  *             ndim = PyArray_NDIM(self)
2667  *
2668  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
2669  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
2670  *                 raise ValueError(u"ndarray is not C contiguous")
2671  */
2672   }
2673 
2674   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274
2675  *                 raise ValueError(u"ndarray is not C contiguous")
2676  *
2677  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
2678  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
2679  *                 raise ValueError(u"ndarray is not Fortran contiguous")
2680  */
2681   __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
2682   if (__pyx_t_2) {
2683   } else {
2684     __pyx_t_1 = __pyx_t_2;
2685     goto __pyx_L7_bool_binop_done;
2686   }
2687 
2688   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":275
2689  *
2690  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
2691  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):             # <<<<<<<<<<<<<<
2692  *                 raise ValueError(u"ndarray is not Fortran contiguous")
2693  *
2694  */
2695   __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_F_CONTIGUOUS) != 0)) != 0);
2696   __pyx_t_1 = __pyx_t_2;
2697   __pyx_L7_bool_binop_done:;
2698 
2699   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274
2700  *                 raise ValueError(u"ndarray is not C contiguous")
2701  *
2702  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
2703  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
2704  *                 raise ValueError(u"ndarray is not Fortran contiguous")
2705  */
2706   if (unlikely(__pyx_t_1)) {
2707 
2708     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276
2709  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
2710  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
2711  *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
2712  *
2713  *             info.buf = PyArray_DATA(self)
2714  */
2715     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 276, __pyx_L1_error)
2716     __Pyx_GOTREF(__pyx_t_3);
2717     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
2718     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2719     __PYX_ERR(1, 276, __pyx_L1_error)
2720 
2721     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274
2722  *                 raise ValueError(u"ndarray is not C contiguous")
2723  *
2724  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
2725  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
2726  *                 raise ValueError(u"ndarray is not Fortran contiguous")
2727  */
2728   }
2729 
2730   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":278
2731  *                 raise ValueError(u"ndarray is not Fortran contiguous")
2732  *
2733  *             info.buf = PyArray_DATA(self)             # <<<<<<<<<<<<<<
2734  *             info.ndim = ndim
2735  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
2736  */
2737   __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
2738 
2739   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":279
2740  *
2741  *             info.buf = PyArray_DATA(self)
2742  *             info.ndim = ndim             # <<<<<<<<<<<<<<
2743  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
2744  *                 # Allocate new buffer for strides and shape info.
2745  */
2746   __pyx_v_info->ndim = __pyx_v_ndim;
2747 
2748   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280
2749  *             info.buf = PyArray_DATA(self)
2750  *             info.ndim = ndim
2751  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
2752  *                 # Allocate new buffer for strides and shape info.
2753  *                 # This is allocated as one block, strides first.
2754  */
2755   __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
2756   if (__pyx_t_1) {
2757 
2758     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":283
2759  *                 # Allocate new buffer for strides and shape info.
2760  *                 # This is allocated as one block, strides first.
2761  *                 info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)             # <<<<<<<<<<<<<<
2762  *                 info.shape = info.strides + ndim
2763  *                 for i in range(ndim):
2764  */
2765     __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim))));
2766 
2767     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":284
2768  *                 # This is allocated as one block, strides first.
2769  *                 info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
2770  *                 info.shape = info.strides + ndim             # <<<<<<<<<<<<<<
2771  *                 for i in range(ndim):
2772  *                     info.strides[i] = PyArray_STRIDES(self)[i]
2773  */
2774     __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
2775 
2776     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":285
2777  *                 info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
2778  *                 info.shape = info.strides + ndim
2779  *                 for i in range(ndim):             # <<<<<<<<<<<<<<
2780  *                     info.strides[i] = PyArray_STRIDES(self)[i]
2781  *                     info.shape[i] = PyArray_DIMS(self)[i]
2782  */
2783     __pyx_t_4 = __pyx_v_ndim;
2784     __pyx_t_5 = __pyx_t_4;
2785     for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
2786       __pyx_v_i = __pyx_t_6;
2787 
2788       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":286
2789  *                 info.shape = info.strides + ndim
2790  *                 for i in range(ndim):
2791  *                     info.strides[i] = PyArray_STRIDES(self)[i]             # <<<<<<<<<<<<<<
2792  *                     info.shape[i] = PyArray_DIMS(self)[i]
2793  *             else:
2794  */
2795       (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
2796 
2797       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":287
2798  *                 for i in range(ndim):
2799  *                     info.strides[i] = PyArray_STRIDES(self)[i]
2800  *                     info.shape[i] = PyArray_DIMS(self)[i]             # <<<<<<<<<<<<<<
2801  *             else:
2802  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
2803  */
2804       (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
2805     }
2806 
2807     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280
2808  *             info.buf = PyArray_DATA(self)
2809  *             info.ndim = ndim
2810  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
2811  *                 # Allocate new buffer for strides and shape info.
2812  *                 # This is allocated as one block, strides first.
2813  */
2814     goto __pyx_L9;
2815   }
2816 
2817   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":289
2818  *                     info.shape[i] = PyArray_DIMS(self)[i]
2819  *             else:
2820  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)             # <<<<<<<<<<<<<<
2821  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
2822  *             info.suboffsets = NULL
2823  */
2824   /*else*/ {
2825     __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
2826 
2827     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":290
2828  *             else:
2829  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
2830  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)             # <<<<<<<<<<<<<<
2831  *             info.suboffsets = NULL
2832  *             info.itemsize = PyArray_ITEMSIZE(self)
2833  */
2834     __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
2835   }
2836   __pyx_L9:;
2837 
2838   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":291
2839  *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
2840  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
2841  *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
2842  *             info.itemsize = PyArray_ITEMSIZE(self)
2843  *             info.readonly = not PyArray_ISWRITEABLE(self)
2844  */
2845   __pyx_v_info->suboffsets = NULL;
2846 
2847   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":292
2848  *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
2849  *             info.suboffsets = NULL
2850  *             info.itemsize = PyArray_ITEMSIZE(self)             # <<<<<<<<<<<<<<
2851  *             info.readonly = not PyArray_ISWRITEABLE(self)
2852  *
2853  */
2854   __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
2855 
2856   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":293
2857  *             info.suboffsets = NULL
2858  *             info.itemsize = PyArray_ITEMSIZE(self)
2859  *             info.readonly = not PyArray_ISWRITEABLE(self)             # <<<<<<<<<<<<<<
2860  *
2861  *             cdef int t
2862  */
2863   __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
2864 
2865   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":296
2866  *
2867  *             cdef int t
2868  *             cdef char* f = NULL             # <<<<<<<<<<<<<<
2869  *             cdef dtype descr = <dtype>PyArray_DESCR(self)
2870  *             cdef int offset
2871  */
2872   __pyx_v_f = NULL;
2873 
2874   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297
2875  *             cdef int t
2876  *             cdef char* f = NULL
2877  *             cdef dtype descr = <dtype>PyArray_DESCR(self)             # <<<<<<<<<<<<<<
2878  *             cdef int offset
2879  *
2880  */
2881   __pyx_t_7 = PyArray_DESCR(__pyx_v_self);
2882   __pyx_t_3 = ((PyObject *)__pyx_t_7);
2883   __Pyx_INCREF(__pyx_t_3);
2884   __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
2885   __pyx_t_3 = 0;
2886 
2887   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":300
2888  *             cdef int offset
2889  *
2890  *             info.obj = self             # <<<<<<<<<<<<<<
2891  *
2892  *             if not PyDataType_HASFIELDS(descr):
2893  */
2894   __Pyx_INCREF(((PyObject *)__pyx_v_self));
2895   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
2896   __Pyx_GOTREF(__pyx_v_info->obj);
2897   __Pyx_DECREF(__pyx_v_info->obj);
2898   __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
2899 
2900   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":302
2901  *             info.obj = self
2902  *
2903  *             if not PyDataType_HASFIELDS(descr):             # <<<<<<<<<<<<<<
2904  *                 t = descr.type_num
2905  *                 if ((descr.byteorder == c'>' and little_endian) or
2906  */
2907   __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0);
2908   if (__pyx_t_1) {
2909 
2910     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":303
2911  *
2912  *             if not PyDataType_HASFIELDS(descr):
2913  *                 t = descr.type_num             # <<<<<<<<<<<<<<
2914  *                 if ((descr.byteorder == c'>' and little_endian) or
2915  *                     (descr.byteorder == c'<' and not little_endian)):
2916  */
2917     __pyx_t_4 = __pyx_v_descr->type_num;
2918     __pyx_v_t = __pyx_t_4;
2919 
2920     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304
2921  *             if not PyDataType_HASFIELDS(descr):
2922  *                 t = descr.type_num
2923  *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
2924  *                     (descr.byteorder == c'<' and not little_endian)):
2925  *                     raise ValueError(u"Non-native byte order not supported")
2926  */
2927     __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0);
2928     if (!__pyx_t_2) {
2929       goto __pyx_L15_next_or;
2930     } else {
2931     }
2932     __pyx_t_2 = (__pyx_v_little_endian != 0);
2933     if (!__pyx_t_2) {
2934     } else {
2935       __pyx_t_1 = __pyx_t_2;
2936       goto __pyx_L14_bool_binop_done;
2937     }
2938     __pyx_L15_next_or:;
2939 
2940     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":305
2941  *                 t = descr.type_num
2942  *                 if ((descr.byteorder == c'>' and little_endian) or
2943  *                     (descr.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
2944  *                     raise ValueError(u"Non-native byte order not supported")
2945  *                 if   t == NPY_BYTE:        f = "b"
2946  */
2947     __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0);
2948     if (__pyx_t_2) {
2949     } else {
2950       __pyx_t_1 = __pyx_t_2;
2951       goto __pyx_L14_bool_binop_done;
2952     }
2953     __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
2954     __pyx_t_1 = __pyx_t_2;
2955     __pyx_L14_bool_binop_done:;
2956 
2957     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304
2958  *             if not PyDataType_HASFIELDS(descr):
2959  *                 t = descr.type_num
2960  *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
2961  *                     (descr.byteorder == c'<' and not little_endian)):
2962  *                     raise ValueError(u"Non-native byte order not supported")
2963  */
2964     if (unlikely(__pyx_t_1)) {
2965 
2966       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":306
2967  *                 if ((descr.byteorder == c'>' and little_endian) or
2968  *                     (descr.byteorder == c'<' and not little_endian)):
2969  *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
2970  *                 if   t == NPY_BYTE:        f = "b"
2971  *                 elif t == NPY_UBYTE:       f = "B"
2972  */
2973       __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 306, __pyx_L1_error)
2974       __Pyx_GOTREF(__pyx_t_3);
2975       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
2976       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2977       __PYX_ERR(1, 306, __pyx_L1_error)
2978 
2979       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304
2980  *             if not PyDataType_HASFIELDS(descr):
2981  *                 t = descr.type_num
2982  *                 if ((descr.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
2983  *                     (descr.byteorder == c'<' and not little_endian)):
2984  *                     raise ValueError(u"Non-native byte order not supported")
2985  */
2986     }
2987 
2988     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":307
2989  *                     (descr.byteorder == c'<' and not little_endian)):
2990  *                     raise ValueError(u"Non-native byte order not supported")
2991  *                 if   t == NPY_BYTE:        f = "b"             # <<<<<<<<<<<<<<
2992  *                 elif t == NPY_UBYTE:       f = "B"
2993  *                 elif t == NPY_SHORT:       f = "h"
2994  */
2995     switch (__pyx_v_t) {
2996       case NPY_BYTE:
2997       __pyx_v_f = ((char *)"b");
2998       break;
2999       case NPY_UBYTE:
3000 
3001       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":308
3002  *                     raise ValueError(u"Non-native byte order not supported")
3003  *                 if   t == NPY_BYTE:        f = "b"
3004  *                 elif t == NPY_UBYTE:       f = "B"             # <<<<<<<<<<<<<<
3005  *                 elif t == NPY_SHORT:       f = "h"
3006  *                 elif t == NPY_USHORT:      f = "H"
3007  */
3008       __pyx_v_f = ((char *)"B");
3009       break;
3010       case NPY_SHORT:
3011 
3012       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":309
3013  *                 if   t == NPY_BYTE:        f = "b"
3014  *                 elif t == NPY_UBYTE:       f = "B"
3015  *                 elif t == NPY_SHORT:       f = "h"             # <<<<<<<<<<<<<<
3016  *                 elif t == NPY_USHORT:      f = "H"
3017  *                 elif t == NPY_INT:         f = "i"
3018  */
3019       __pyx_v_f = ((char *)"h");
3020       break;
3021       case NPY_USHORT:
3022 
3023       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":310
3024  *                 elif t == NPY_UBYTE:       f = "B"
3025  *                 elif t == NPY_SHORT:       f = "h"
3026  *                 elif t == NPY_USHORT:      f = "H"             # <<<<<<<<<<<<<<
3027  *                 elif t == NPY_INT:         f = "i"
3028  *                 elif t == NPY_UINT:        f = "I"
3029  */
3030       __pyx_v_f = ((char *)"H");
3031       break;
3032       case NPY_INT:
3033 
3034       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":311
3035  *                 elif t == NPY_SHORT:       f = "h"
3036  *                 elif t == NPY_USHORT:      f = "H"
3037  *                 elif t == NPY_INT:         f = "i"             # <<<<<<<<<<<<<<
3038  *                 elif t == NPY_UINT:        f = "I"
3039  *                 elif t == NPY_LONG:        f = "l"
3040  */
3041       __pyx_v_f = ((char *)"i");
3042       break;
3043       case NPY_UINT:
3044 
3045       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":312
3046  *                 elif t == NPY_USHORT:      f = "H"
3047  *                 elif t == NPY_INT:         f = "i"
3048  *                 elif t == NPY_UINT:        f = "I"             # <<<<<<<<<<<<<<
3049  *                 elif t == NPY_LONG:        f = "l"
3050  *                 elif t == NPY_ULONG:       f = "L"
3051  */
3052       __pyx_v_f = ((char *)"I");
3053       break;
3054       case NPY_LONG:
3055 
3056       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":313
3057  *                 elif t == NPY_INT:         f = "i"
3058  *                 elif t == NPY_UINT:        f = "I"
3059  *                 elif t == NPY_LONG:        f = "l"             # <<<<<<<<<<<<<<
3060  *                 elif t == NPY_ULONG:       f = "L"
3061  *                 elif t == NPY_LONGLONG:    f = "q"
3062  */
3063       __pyx_v_f = ((char *)"l");
3064       break;
3065       case NPY_ULONG:
3066 
3067       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":314
3068  *                 elif t == NPY_UINT:        f = "I"
3069  *                 elif t == NPY_LONG:        f = "l"
3070  *                 elif t == NPY_ULONG:       f = "L"             # <<<<<<<<<<<<<<
3071  *                 elif t == NPY_LONGLONG:    f = "q"
3072  *                 elif t == NPY_ULONGLONG:   f = "Q"
3073  */
3074       __pyx_v_f = ((char *)"L");
3075       break;
3076       case NPY_LONGLONG:
3077 
3078       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":315
3079  *                 elif t == NPY_LONG:        f = "l"
3080  *                 elif t == NPY_ULONG:       f = "L"
3081  *                 elif t == NPY_LONGLONG:    f = "q"             # <<<<<<<<<<<<<<
3082  *                 elif t == NPY_ULONGLONG:   f = "Q"
3083  *                 elif t == NPY_FLOAT:       f = "f"
3084  */
3085       __pyx_v_f = ((char *)"q");
3086       break;
3087       case NPY_ULONGLONG:
3088 
3089       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":316
3090  *                 elif t == NPY_ULONG:       f = "L"
3091  *                 elif t == NPY_LONGLONG:    f = "q"
3092  *                 elif t == NPY_ULONGLONG:   f = "Q"             # <<<<<<<<<<<<<<
3093  *                 elif t == NPY_FLOAT:       f = "f"
3094  *                 elif t == NPY_DOUBLE:      f = "d"
3095  */
3096       __pyx_v_f = ((char *)"Q");
3097       break;
3098       case NPY_FLOAT:
3099 
3100       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":317
3101  *                 elif t == NPY_LONGLONG:    f = "q"
3102  *                 elif t == NPY_ULONGLONG:   f = "Q"
3103  *                 elif t == NPY_FLOAT:       f = "f"             # <<<<<<<<<<<<<<
3104  *                 elif t == NPY_DOUBLE:      f = "d"
3105  *                 elif t == NPY_LONGDOUBLE:  f = "g"
3106  */
3107       __pyx_v_f = ((char *)"f");
3108       break;
3109       case NPY_DOUBLE:
3110 
3111       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":318
3112  *                 elif t == NPY_ULONGLONG:   f = "Q"
3113  *                 elif t == NPY_FLOAT:       f = "f"
3114  *                 elif t == NPY_DOUBLE:      f = "d"             # <<<<<<<<<<<<<<
3115  *                 elif t == NPY_LONGDOUBLE:  f = "g"
3116  *                 elif t == NPY_CFLOAT:      f = "Zf"
3117  */
3118       __pyx_v_f = ((char *)"d");
3119       break;
3120       case NPY_LONGDOUBLE:
3121 
3122       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":319
3123  *                 elif t == NPY_FLOAT:       f = "f"
3124  *                 elif t == NPY_DOUBLE:      f = "d"
3125  *                 elif t == NPY_LONGDOUBLE:  f = "g"             # <<<<<<<<<<<<<<
3126  *                 elif t == NPY_CFLOAT:      f = "Zf"
3127  *                 elif t == NPY_CDOUBLE:     f = "Zd"
3128  */
3129       __pyx_v_f = ((char *)"g");
3130       break;
3131       case NPY_CFLOAT:
3132 
3133       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":320
3134  *                 elif t == NPY_DOUBLE:      f = "d"
3135  *                 elif t == NPY_LONGDOUBLE:  f = "g"
3136  *                 elif t == NPY_CFLOAT:      f = "Zf"             # <<<<<<<<<<<<<<
3137  *                 elif t == NPY_CDOUBLE:     f = "Zd"
3138  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
3139  */
3140       __pyx_v_f = ((char *)"Zf");
3141       break;
3142       case NPY_CDOUBLE:
3143 
3144       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":321
3145  *                 elif t == NPY_LONGDOUBLE:  f = "g"
3146  *                 elif t == NPY_CFLOAT:      f = "Zf"
3147  *                 elif t == NPY_CDOUBLE:     f = "Zd"             # <<<<<<<<<<<<<<
3148  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
3149  *                 elif t == NPY_OBJECT:      f = "O"
3150  */
3151       __pyx_v_f = ((char *)"Zd");
3152       break;
3153       case NPY_CLONGDOUBLE:
3154 
3155       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":322
3156  *                 elif t == NPY_CFLOAT:      f = "Zf"
3157  *                 elif t == NPY_CDOUBLE:     f = "Zd"
3158  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"             # <<<<<<<<<<<<<<
3159  *                 elif t == NPY_OBJECT:      f = "O"
3160  *                 else:
3161  */
3162       __pyx_v_f = ((char *)"Zg");
3163       break;
3164       case NPY_OBJECT:
3165 
3166       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":323
3167  *                 elif t == NPY_CDOUBLE:     f = "Zd"
3168  *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
3169  *                 elif t == NPY_OBJECT:      f = "O"             # <<<<<<<<<<<<<<
3170  *                 else:
3171  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
3172  */
3173       __pyx_v_f = ((char *)"O");
3174       break;
3175       default:
3176 
3177       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":325
3178  *                 elif t == NPY_OBJECT:      f = "O"
3179  *                 else:
3180  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
3181  *                 info.format = f
3182  *                 return
3183  */
3184       __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 325, __pyx_L1_error)
3185       __Pyx_GOTREF(__pyx_t_3);
3186       __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 325, __pyx_L1_error)
3187       __Pyx_GOTREF(__pyx_t_8);
3188       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3189       __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 325, __pyx_L1_error)
3190       __Pyx_GOTREF(__pyx_t_3);
3191       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3192       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
3193       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3194       __PYX_ERR(1, 325, __pyx_L1_error)
3195       break;
3196     }
3197 
3198     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":326
3199  *                 else:
3200  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
3201  *                 info.format = f             # <<<<<<<<<<<<<<
3202  *                 return
3203  *             else:
3204  */
3205     __pyx_v_info->format = __pyx_v_f;
3206 
3207     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":327
3208  *                     raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
3209  *                 info.format = f
3210  *                 return             # <<<<<<<<<<<<<<
3211  *             else:
3212  *                 info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
3213  */
3214     __pyx_r = 0;
3215     goto __pyx_L0;
3216 
3217     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":302
3218  *             info.obj = self
3219  *
3220  *             if not PyDataType_HASFIELDS(descr):             # <<<<<<<<<<<<<<
3221  *                 t = descr.type_num
3222  *                 if ((descr.byteorder == c'>' and little_endian) or
3223  */
3224   }
3225 
3226   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":329
3227  *                 return
3228  *             else:
3229  *                 info.format = <char*>PyObject_Malloc(_buffer_format_string_len)             # <<<<<<<<<<<<<<
3230  *                 info.format[0] = c'^' # Native data types, manual alignment
3231  *                 offset = 0
3232  */
3233   /*else*/ {
3234     __pyx_v_info->format = ((char *)PyObject_Malloc(0xFF));
3235 
3236     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":330
3237  *             else:
3238  *                 info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
3239  *                 info.format[0] = c'^' # Native data types, manual alignment             # <<<<<<<<<<<<<<
3240  *                 offset = 0
3241  *                 f = _util_dtypestring(descr, info.format + 1,
3242  */
3243     (__pyx_v_info->format[0]) = '^';
3244 
3245     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":331
3246  *                 info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
3247  *                 info.format[0] = c'^' # Native data types, manual alignment
3248  *                 offset = 0             # <<<<<<<<<<<<<<
3249  *                 f = _util_dtypestring(descr, info.format + 1,
3250  *                                       info.format + _buffer_format_string_len,
3251  */
3252     __pyx_v_offset = 0;
3253 
3254     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":332
3255  *                 info.format[0] = c'^' # Native data types, manual alignment
3256  *                 offset = 0
3257  *                 f = _util_dtypestring(descr, info.format + 1,             # <<<<<<<<<<<<<<
3258  *                                       info.format + _buffer_format_string_len,
3259  *                                       &offset)
3260  */
3261     __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(1, 332, __pyx_L1_error)
3262     __pyx_v_f = __pyx_t_9;
3263 
3264     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":335
3265  *                                       info.format + _buffer_format_string_len,
3266  *                                       &offset)
3267  *                 f[0] = c'\0' # Terminate format string             # <<<<<<<<<<<<<<
3268  *
3269  *         def __releasebuffer__(ndarray self, Py_buffer* info):
3270  */
3271     (__pyx_v_f[0]) = '\x00';
3272   }
3273 
3274   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":258
3275  *         # experimental exception made for __getbuffer__ and __releasebuffer__
3276  *         # -- the details of this may change.
3277  *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
3278  *             # This implementation of getbuffer is geared towards Cython
3279  *             # requirements, and does not yet fulfill the PEP.
3280  */
3281 
3282   /* function exit code */
3283   __pyx_r = 0;
3284   goto __pyx_L0;
3285   __pyx_L1_error:;
3286   __Pyx_XDECREF(__pyx_t_3);
3287   __Pyx_XDECREF(__pyx_t_8);
3288   __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3289   __pyx_r = -1;
3290   if (__pyx_v_info->obj != NULL) {
3291     __Pyx_GOTREF(__pyx_v_info->obj);
3292     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
3293   }
3294   goto __pyx_L2;
3295   __pyx_L0:;
3296   if (__pyx_v_info->obj == Py_None) {
3297     __Pyx_GOTREF(__pyx_v_info->obj);
3298     __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
3299   }
3300   __pyx_L2:;
3301   __Pyx_XDECREF((PyObject *)__pyx_v_descr);
3302   __Pyx_RefNannyFinishContext();
3303   return __pyx_r;
3304 }
3305 
3306 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":337
3307  *                 f[0] = c'\0' # Terminate format string
3308  *
3309  *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
3310  *             if PyArray_HASFIELDS(self):
3311  *                 PyObject_Free(info.format)
3312  */
3313 
3314 /* Python wrapper */
3315 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)3316 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
3317   __Pyx_RefNannyDeclarations
3318   __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
3319   __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
3320 
3321   /* function exit code */
3322   __Pyx_RefNannyFinishContext();
3323 }
3324 
__pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject * __pyx_v_self,Py_buffer * __pyx_v_info)3325 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
3326   __Pyx_RefNannyDeclarations
3327   int __pyx_t_1;
3328   __Pyx_RefNannySetupContext("__releasebuffer__", 0);
3329 
3330   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":338
3331  *
3332  *         def __releasebuffer__(ndarray self, Py_buffer* info):
3333  *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
3334  *                 PyObject_Free(info.format)
3335  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
3336  */
3337   __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
3338   if (__pyx_t_1) {
3339 
3340     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":339
3341  *         def __releasebuffer__(ndarray self, Py_buffer* info):
3342  *             if PyArray_HASFIELDS(self):
3343  *                 PyObject_Free(info.format)             # <<<<<<<<<<<<<<
3344  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
3345  *                 PyObject_Free(info.strides)
3346  */
3347     PyObject_Free(__pyx_v_info->format);
3348 
3349     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":338
3350  *
3351  *         def __releasebuffer__(ndarray self, Py_buffer* info):
3352  *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
3353  *                 PyObject_Free(info.format)
3354  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
3355  */
3356   }
3357 
3358   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":340
3359  *             if PyArray_HASFIELDS(self):
3360  *                 PyObject_Free(info.format)
3361  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
3362  *                 PyObject_Free(info.strides)
3363  *                 # info.shape was stored after info.strides in the same block
3364  */
3365   __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
3366   if (__pyx_t_1) {
3367 
3368     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":341
3369  *                 PyObject_Free(info.format)
3370  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
3371  *                 PyObject_Free(info.strides)             # <<<<<<<<<<<<<<
3372  *                 # info.shape was stored after info.strides in the same block
3373  *
3374  */
3375     PyObject_Free(__pyx_v_info->strides);
3376 
3377     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":340
3378  *             if PyArray_HASFIELDS(self):
3379  *                 PyObject_Free(info.format)
3380  *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
3381  *                 PyObject_Free(info.strides)
3382  *                 # info.shape was stored after info.strides in the same block
3383  */
3384   }
3385 
3386   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":337
3387  *                 f[0] = c'\0' # Terminate format string
3388  *
3389  *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
3390  *             if PyArray_HASFIELDS(self):
3391  *                 PyObject_Free(info.format)
3392  */
3393 
3394   /* function exit code */
3395   __Pyx_RefNannyFinishContext();
3396 }
3397 
3398 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":821
3399  * ctypedef npy_cdouble     complex_t
3400  *
3401  * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
3402  *     return PyArray_MultiIterNew(1, <void*>a)
3403  *
3404  */
3405 
__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject * __pyx_v_a)3406 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
3407   PyObject *__pyx_r = NULL;
3408   __Pyx_RefNannyDeclarations
3409   PyObject *__pyx_t_1 = NULL;
3410   __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
3411 
3412   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":822
3413  *
3414  * cdef inline object PyArray_MultiIterNew1(a):
3415  *     return PyArray_MultiIterNew(1, <void*>a)             # <<<<<<<<<<<<<<
3416  *
3417  * cdef inline object PyArray_MultiIterNew2(a, b):
3418  */
3419   __Pyx_XDECREF(__pyx_r);
3420   __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 822, __pyx_L1_error)
3421   __Pyx_GOTREF(__pyx_t_1);
3422   __pyx_r = __pyx_t_1;
3423   __pyx_t_1 = 0;
3424   goto __pyx_L0;
3425 
3426   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":821
3427  * ctypedef npy_cdouble     complex_t
3428  *
3429  * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
3430  *     return PyArray_MultiIterNew(1, <void*>a)
3431  *
3432  */
3433 
3434   /* function exit code */
3435   __pyx_L1_error:;
3436   __Pyx_XDECREF(__pyx_t_1);
3437   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
3438   __pyx_r = 0;
3439   __pyx_L0:;
3440   __Pyx_XGIVEREF(__pyx_r);
3441   __Pyx_RefNannyFinishContext();
3442   return __pyx_r;
3443 }
3444 
3445 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824
3446  *     return PyArray_MultiIterNew(1, <void*>a)
3447  *
3448  * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
3449  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
3450  *
3451  */
3452 
__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject * __pyx_v_a,PyObject * __pyx_v_b)3453 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
3454   PyObject *__pyx_r = NULL;
3455   __Pyx_RefNannyDeclarations
3456   PyObject *__pyx_t_1 = NULL;
3457   __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
3458 
3459   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":825
3460  *
3461  * cdef inline object PyArray_MultiIterNew2(a, b):
3462  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)             # <<<<<<<<<<<<<<
3463  *
3464  * cdef inline object PyArray_MultiIterNew3(a, b, c):
3465  */
3466   __Pyx_XDECREF(__pyx_r);
3467   __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 825, __pyx_L1_error)
3468   __Pyx_GOTREF(__pyx_t_1);
3469   __pyx_r = __pyx_t_1;
3470   __pyx_t_1 = 0;
3471   goto __pyx_L0;
3472 
3473   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824
3474  *     return PyArray_MultiIterNew(1, <void*>a)
3475  *
3476  * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
3477  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
3478  *
3479  */
3480 
3481   /* function exit code */
3482   __pyx_L1_error:;
3483   __Pyx_XDECREF(__pyx_t_1);
3484   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
3485   __pyx_r = 0;
3486   __pyx_L0:;
3487   __Pyx_XGIVEREF(__pyx_r);
3488   __Pyx_RefNannyFinishContext();
3489   return __pyx_r;
3490 }
3491 
3492 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827
3493  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
3494  *
3495  * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
3496  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
3497  *
3498  */
3499 
__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject * __pyx_v_a,PyObject * __pyx_v_b,PyObject * __pyx_v_c)3500 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
3501   PyObject *__pyx_r = NULL;
3502   __Pyx_RefNannyDeclarations
3503   PyObject *__pyx_t_1 = NULL;
3504   __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
3505 
3506   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":828
3507  *
3508  * cdef inline object PyArray_MultiIterNew3(a, b, c):
3509  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)             # <<<<<<<<<<<<<<
3510  *
3511  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
3512  */
3513   __Pyx_XDECREF(__pyx_r);
3514   __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 828, __pyx_L1_error)
3515   __Pyx_GOTREF(__pyx_t_1);
3516   __pyx_r = __pyx_t_1;
3517   __pyx_t_1 = 0;
3518   goto __pyx_L0;
3519 
3520   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827
3521  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
3522  *
3523  * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
3524  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
3525  *
3526  */
3527 
3528   /* function exit code */
3529   __pyx_L1_error:;
3530   __Pyx_XDECREF(__pyx_t_1);
3531   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
3532   __pyx_r = 0;
3533   __pyx_L0:;
3534   __Pyx_XGIVEREF(__pyx_r);
3535   __Pyx_RefNannyFinishContext();
3536   return __pyx_r;
3537 }
3538 
3539 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":830
3540  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
3541  *
3542  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
3543  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
3544  *
3545  */
3546 
__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject * __pyx_v_a,PyObject * __pyx_v_b,PyObject * __pyx_v_c,PyObject * __pyx_v_d)3547 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) {
3548   PyObject *__pyx_r = NULL;
3549   __Pyx_RefNannyDeclarations
3550   PyObject *__pyx_t_1 = NULL;
3551   __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
3552 
3553   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831
3554  *
3555  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
3556  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)             # <<<<<<<<<<<<<<
3557  *
3558  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
3559  */
3560   __Pyx_XDECREF(__pyx_r);
3561   __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 831, __pyx_L1_error)
3562   __Pyx_GOTREF(__pyx_t_1);
3563   __pyx_r = __pyx_t_1;
3564   __pyx_t_1 = 0;
3565   goto __pyx_L0;
3566 
3567   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":830
3568  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
3569  *
3570  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
3571  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
3572  *
3573  */
3574 
3575   /* function exit code */
3576   __pyx_L1_error:;
3577   __Pyx_XDECREF(__pyx_t_1);
3578   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
3579   __pyx_r = 0;
3580   __pyx_L0:;
3581   __Pyx_XGIVEREF(__pyx_r);
3582   __Pyx_RefNannyFinishContext();
3583   return __pyx_r;
3584 }
3585 
3586 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833
3587  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
3588  *
3589  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
3590  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
3591  *
3592  */
3593 
__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)3594 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) {
3595   PyObject *__pyx_r = NULL;
3596   __Pyx_RefNannyDeclarations
3597   PyObject *__pyx_t_1 = NULL;
3598   __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
3599 
3600   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834
3601  *
3602  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
3603  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)             # <<<<<<<<<<<<<<
3604  *
3605  * cdef inline tuple PyDataType_SHAPE(dtype d):
3606  */
3607   __Pyx_XDECREF(__pyx_r);
3608   __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 834, __pyx_L1_error)
3609   __Pyx_GOTREF(__pyx_t_1);
3610   __pyx_r = __pyx_t_1;
3611   __pyx_t_1 = 0;
3612   goto __pyx_L0;
3613 
3614   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833
3615  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
3616  *
3617  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
3618  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
3619  *
3620  */
3621 
3622   /* function exit code */
3623   __pyx_L1_error:;
3624   __Pyx_XDECREF(__pyx_t_1);
3625   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
3626   __pyx_r = 0;
3627   __pyx_L0:;
3628   __Pyx_XGIVEREF(__pyx_r);
3629   __Pyx_RefNannyFinishContext();
3630   return __pyx_r;
3631 }
3632 
3633 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":836
3634  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
3635  *
3636  * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
3637  *     if PyDataType_HASSUBARRAY(d):
3638  *         return <tuple>d.subarray.shape
3639  */
3640 
__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr * __pyx_v_d)3641 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
3642   PyObject *__pyx_r = NULL;
3643   __Pyx_RefNannyDeclarations
3644   int __pyx_t_1;
3645   __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
3646 
3647   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837
3648  *
3649  * cdef inline tuple PyDataType_SHAPE(dtype d):
3650  *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
3651  *         return <tuple>d.subarray.shape
3652  *     else:
3653  */
3654   __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
3655   if (__pyx_t_1) {
3656 
3657     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":838
3658  * cdef inline tuple PyDataType_SHAPE(dtype d):
3659  *     if PyDataType_HASSUBARRAY(d):
3660  *         return <tuple>d.subarray.shape             # <<<<<<<<<<<<<<
3661  *     else:
3662  *         return ()
3663  */
3664     __Pyx_XDECREF(__pyx_r);
3665     __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
3666     __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
3667     goto __pyx_L0;
3668 
3669     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837
3670  *
3671  * cdef inline tuple PyDataType_SHAPE(dtype d):
3672  *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
3673  *         return <tuple>d.subarray.shape
3674  *     else:
3675  */
3676   }
3677 
3678   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":840
3679  *         return <tuple>d.subarray.shape
3680  *     else:
3681  *         return ()             # <<<<<<<<<<<<<<
3682  *
3683  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
3684  */
3685   /*else*/ {
3686     __Pyx_XDECREF(__pyx_r);
3687     __Pyx_INCREF(__pyx_empty_tuple);
3688     __pyx_r = __pyx_empty_tuple;
3689     goto __pyx_L0;
3690   }
3691 
3692   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":836
3693  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
3694  *
3695  * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
3696  *     if PyDataType_HASSUBARRAY(d):
3697  *         return <tuple>d.subarray.shape
3698  */
3699 
3700   /* function exit code */
3701   __pyx_L0:;
3702   __Pyx_XGIVEREF(__pyx_r);
3703   __Pyx_RefNannyFinishContext();
3704   return __pyx_r;
3705 }
3706 
3707 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842
3708  *         return ()
3709  *
3710  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
3711  *     # Recursive utility function used in __getbuffer__ to get format
3712  *     # string. The new location in the format string is returned.
3713  */
3714 
__pyx_f_5numpy__util_dtypestring(PyArray_Descr * __pyx_v_descr,char * __pyx_v_f,char * __pyx_v_end,int * __pyx_v_offset)3715 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) {
3716   PyArray_Descr *__pyx_v_child = 0;
3717   int __pyx_v_endian_detector;
3718   int __pyx_v_little_endian;
3719   PyObject *__pyx_v_fields = 0;
3720   PyObject *__pyx_v_childname = NULL;
3721   PyObject *__pyx_v_new_offset = NULL;
3722   PyObject *__pyx_v_t = NULL;
3723   char *__pyx_r;
3724   __Pyx_RefNannyDeclarations
3725   PyObject *__pyx_t_1 = NULL;
3726   Py_ssize_t __pyx_t_2;
3727   PyObject *__pyx_t_3 = NULL;
3728   PyObject *__pyx_t_4 = NULL;
3729   int __pyx_t_5;
3730   int __pyx_t_6;
3731   int __pyx_t_7;
3732   long __pyx_t_8;
3733   char *__pyx_t_9;
3734   __Pyx_RefNannySetupContext("_util_dtypestring", 0);
3735 
3736   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":847
3737  *
3738  *     cdef dtype child
3739  *     cdef int endian_detector = 1             # <<<<<<<<<<<<<<
3740  *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
3741  *     cdef tuple fields
3742  */
3743   __pyx_v_endian_detector = 1;
3744 
3745   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":848
3746  *     cdef dtype child
3747  *     cdef int endian_detector = 1
3748  *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
3749  *     cdef tuple fields
3750  *
3751  */
3752   __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
3753 
3754   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851
3755  *     cdef tuple fields
3756  *
3757  *     for childname in descr.names:             # <<<<<<<<<<<<<<
3758  *         fields = descr.fields[childname]
3759  *         child, new_offset = fields
3760  */
3761   if (unlikely(__pyx_v_descr->names == Py_None)) {
3762     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
3763     __PYX_ERR(1, 851, __pyx_L1_error)
3764   }
3765   __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
3766   for (;;) {
3767     if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
3768     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3769     __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 851, __pyx_L1_error)
3770     #else
3771     __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 851, __pyx_L1_error)
3772     __Pyx_GOTREF(__pyx_t_3);
3773     #endif
3774     __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
3775     __pyx_t_3 = 0;
3776 
3777     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":852
3778  *
3779  *     for childname in descr.names:
3780  *         fields = descr.fields[childname]             # <<<<<<<<<<<<<<
3781  *         child, new_offset = fields
3782  *
3783  */
3784     if (unlikely(__pyx_v_descr->fields == Py_None)) {
3785       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
3786       __PYX_ERR(1, 852, __pyx_L1_error)
3787     }
3788     __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 852, __pyx_L1_error)
3789     __Pyx_GOTREF(__pyx_t_3);
3790     if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 852, __pyx_L1_error)
3791     __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
3792     __pyx_t_3 = 0;
3793 
3794     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":853
3795  *     for childname in descr.names:
3796  *         fields = descr.fields[childname]
3797  *         child, new_offset = fields             # <<<<<<<<<<<<<<
3798  *
3799  *         if (end - f) - <int>(new_offset - offset[0]) < 15:
3800  */
3801     if (likely(__pyx_v_fields != Py_None)) {
3802       PyObject* sequence = __pyx_v_fields;
3803       Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
3804       if (unlikely(size != 2)) {
3805         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
3806         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
3807         __PYX_ERR(1, 853, __pyx_L1_error)
3808       }
3809       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3810       __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
3811       __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
3812       __Pyx_INCREF(__pyx_t_3);
3813       __Pyx_INCREF(__pyx_t_4);
3814       #else
3815       __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 853, __pyx_L1_error)
3816       __Pyx_GOTREF(__pyx_t_3);
3817       __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 853, __pyx_L1_error)
3818       __Pyx_GOTREF(__pyx_t_4);
3819       #endif
3820     } else {
3821       __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 853, __pyx_L1_error)
3822     }
3823     if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 853, __pyx_L1_error)
3824     __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
3825     __pyx_t_3 = 0;
3826     __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
3827     __pyx_t_4 = 0;
3828 
3829     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855
3830  *         child, new_offset = fields
3831  *
3832  *         if (end - f) - <int>(new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
3833  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
3834  *
3835  */
3836     __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 855, __pyx_L1_error)
3837     __Pyx_GOTREF(__pyx_t_4);
3838     __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 855, __pyx_L1_error)
3839     __Pyx_GOTREF(__pyx_t_3);
3840     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3841     __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 855, __pyx_L1_error)
3842     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3843     __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
3844     if (unlikely(__pyx_t_6)) {
3845 
3846       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856
3847  *
3848  *         if (end - f) - <int>(new_offset - offset[0]) < 15:
3849  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
3850  *
3851  *         if ((child.byteorder == c'>' and little_endian) or
3852  */
3853       __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 856, __pyx_L1_error)
3854       __Pyx_GOTREF(__pyx_t_3);
3855       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
3856       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3857       __PYX_ERR(1, 856, __pyx_L1_error)
3858 
3859       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855
3860  *         child, new_offset = fields
3861  *
3862  *         if (end - f) - <int>(new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
3863  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
3864  *
3865  */
3866     }
3867 
3868     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858
3869  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
3870  *
3871  *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
3872  *             (child.byteorder == c'<' and not little_endian)):
3873  *             raise ValueError(u"Non-native byte order not supported")
3874  */
3875     __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
3876     if (!__pyx_t_7) {
3877       goto __pyx_L8_next_or;
3878     } else {
3879     }
3880     __pyx_t_7 = (__pyx_v_little_endian != 0);
3881     if (!__pyx_t_7) {
3882     } else {
3883       __pyx_t_6 = __pyx_t_7;
3884       goto __pyx_L7_bool_binop_done;
3885     }
3886     __pyx_L8_next_or:;
3887 
3888     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":859
3889  *
3890  *         if ((child.byteorder == c'>' and little_endian) or
3891  *             (child.byteorder == c'<' and not little_endian)):             # <<<<<<<<<<<<<<
3892  *             raise ValueError(u"Non-native byte order not supported")
3893  *             # One could encode it in the format string and have Cython
3894  */
3895     __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
3896     if (__pyx_t_7) {
3897     } else {
3898       __pyx_t_6 = __pyx_t_7;
3899       goto __pyx_L7_bool_binop_done;
3900     }
3901     __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
3902     __pyx_t_6 = __pyx_t_7;
3903     __pyx_L7_bool_binop_done:;
3904 
3905     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858
3906  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
3907  *
3908  *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
3909  *             (child.byteorder == c'<' and not little_endian)):
3910  *             raise ValueError(u"Non-native byte order not supported")
3911  */
3912     if (unlikely(__pyx_t_6)) {
3913 
3914       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":860
3915  *         if ((child.byteorder == c'>' and little_endian) or
3916  *             (child.byteorder == c'<' and not little_endian)):
3917  *             raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
3918  *             # One could encode it in the format string and have Cython
3919  *             # complain instead, BUT: < and > in format strings also imply
3920  */
3921       __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 860, __pyx_L1_error)
3922       __Pyx_GOTREF(__pyx_t_3);
3923       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
3924       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3925       __PYX_ERR(1, 860, __pyx_L1_error)
3926 
3927       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858
3928  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
3929  *
3930  *         if ((child.byteorder == c'>' and little_endian) or             # <<<<<<<<<<<<<<
3931  *             (child.byteorder == c'<' and not little_endian)):
3932  *             raise ValueError(u"Non-native byte order not supported")
3933  */
3934     }
3935 
3936     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":870
3937  *
3938  *         # Output padding bytes
3939  *         while offset[0] < new_offset:             # <<<<<<<<<<<<<<
3940  *             f[0] = 120 # "x"; pad byte
3941  *             f += 1
3942  */
3943     while (1) {
3944       __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 870, __pyx_L1_error)
3945       __Pyx_GOTREF(__pyx_t_3);
3946       __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 870, __pyx_L1_error)
3947       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3948       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 870, __pyx_L1_error)
3949       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3950       if (!__pyx_t_6) break;
3951 
3952       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":871
3953  *         # Output padding bytes
3954  *         while offset[0] < new_offset:
3955  *             f[0] = 120 # "x"; pad byte             # <<<<<<<<<<<<<<
3956  *             f += 1
3957  *             offset[0] += 1
3958  */
3959       (__pyx_v_f[0]) = 0x78;
3960 
3961       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":872
3962  *         while offset[0] < new_offset:
3963  *             f[0] = 120 # "x"; pad byte
3964  *             f += 1             # <<<<<<<<<<<<<<
3965  *             offset[0] += 1
3966  *
3967  */
3968       __pyx_v_f = (__pyx_v_f + 1);
3969 
3970       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":873
3971  *             f[0] = 120 # "x"; pad byte
3972  *             f += 1
3973  *             offset[0] += 1             # <<<<<<<<<<<<<<
3974  *
3975  *         offset[0] += child.itemsize
3976  */
3977       __pyx_t_8 = 0;
3978       (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
3979     }
3980 
3981     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":875
3982  *             offset[0] += 1
3983  *
3984  *         offset[0] += child.itemsize             # <<<<<<<<<<<<<<
3985  *
3986  *         if not PyDataType_HASFIELDS(child):
3987  */
3988     __pyx_t_8 = 0;
3989     (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
3990 
3991     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":877
3992  *         offset[0] += child.itemsize
3993  *
3994  *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
3995  *             t = child.type_num
3996  *             if end - f < 5:
3997  */
3998     __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
3999     if (__pyx_t_6) {
4000 
4001       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":878
4002  *
4003  *         if not PyDataType_HASFIELDS(child):
4004  *             t = child.type_num             # <<<<<<<<<<<<<<
4005  *             if end - f < 5:
4006  *                 raise RuntimeError(u"Format string allocated too short.")
4007  */
4008       __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 878, __pyx_L1_error)
4009       __Pyx_GOTREF(__pyx_t_4);
4010       __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
4011       __pyx_t_4 = 0;
4012 
4013       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":879
4014  *         if not PyDataType_HASFIELDS(child):
4015  *             t = child.type_num
4016  *             if end - f < 5:             # <<<<<<<<<<<<<<
4017  *                 raise RuntimeError(u"Format string allocated too short.")
4018  *
4019  */
4020       __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
4021       if (unlikely(__pyx_t_6)) {
4022 
4023         /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":880
4024  *             t = child.type_num
4025  *             if end - f < 5:
4026  *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
4027  *
4028  *             # Until ticket #99 is fixed, use integers to avoid warnings
4029  */
4030         __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 880, __pyx_L1_error)
4031         __Pyx_GOTREF(__pyx_t_4);
4032         __Pyx_Raise(__pyx_t_4, 0, 0, 0);
4033         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4034         __PYX_ERR(1, 880, __pyx_L1_error)
4035 
4036         /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":879
4037  *         if not PyDataType_HASFIELDS(child):
4038  *             t = child.type_num
4039  *             if end - f < 5:             # <<<<<<<<<<<<<<
4040  *                 raise RuntimeError(u"Format string allocated too short.")
4041  *
4042  */
4043       }
4044 
4045       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":883
4046  *
4047  *             # Until ticket #99 is fixed, use integers to avoid warnings
4048  *             if   t == NPY_BYTE:        f[0] =  98 #"b"             # <<<<<<<<<<<<<<
4049  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
4050  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
4051  */
4052       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 883, __pyx_L1_error)
4053       __Pyx_GOTREF(__pyx_t_4);
4054       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 883, __pyx_L1_error)
4055       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4056       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 883, __pyx_L1_error)
4057       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4058       if (__pyx_t_6) {
4059         (__pyx_v_f[0]) = 98;
4060         goto __pyx_L15;
4061       }
4062 
4063       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":884
4064  *             # Until ticket #99 is fixed, use integers to avoid warnings
4065  *             if   t == NPY_BYTE:        f[0] =  98 #"b"
4066  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"             # <<<<<<<<<<<<<<
4067  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
4068  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
4069  */
4070       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 884, __pyx_L1_error)
4071       __Pyx_GOTREF(__pyx_t_3);
4072       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 884, __pyx_L1_error)
4073       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4074       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 884, __pyx_L1_error)
4075       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4076       if (__pyx_t_6) {
4077         (__pyx_v_f[0]) = 66;
4078         goto __pyx_L15;
4079       }
4080 
4081       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":885
4082  *             if   t == NPY_BYTE:        f[0] =  98 #"b"
4083  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
4084  *             elif t == NPY_SHORT:       f[0] = 104 #"h"             # <<<<<<<<<<<<<<
4085  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
4086  *             elif t == NPY_INT:         f[0] = 105 #"i"
4087  */
4088       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 885, __pyx_L1_error)
4089       __Pyx_GOTREF(__pyx_t_4);
4090       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 885, __pyx_L1_error)
4091       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4092       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 885, __pyx_L1_error)
4093       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4094       if (__pyx_t_6) {
4095         (__pyx_v_f[0]) = 0x68;
4096         goto __pyx_L15;
4097       }
4098 
4099       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":886
4100  *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
4101  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
4102  *             elif t == NPY_USHORT:      f[0] =  72 #"H"             # <<<<<<<<<<<<<<
4103  *             elif t == NPY_INT:         f[0] = 105 #"i"
4104  *             elif t == NPY_UINT:        f[0] =  73 #"I"
4105  */
4106       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 886, __pyx_L1_error)
4107       __Pyx_GOTREF(__pyx_t_3);
4108       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 886, __pyx_L1_error)
4109       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4110       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 886, __pyx_L1_error)
4111       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4112       if (__pyx_t_6) {
4113         (__pyx_v_f[0]) = 72;
4114         goto __pyx_L15;
4115       }
4116 
4117       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":887
4118  *             elif t == NPY_SHORT:       f[0] = 104 #"h"
4119  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
4120  *             elif t == NPY_INT:         f[0] = 105 #"i"             # <<<<<<<<<<<<<<
4121  *             elif t == NPY_UINT:        f[0] =  73 #"I"
4122  *             elif t == NPY_LONG:        f[0] = 108 #"l"
4123  */
4124       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 887, __pyx_L1_error)
4125       __Pyx_GOTREF(__pyx_t_4);
4126       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 887, __pyx_L1_error)
4127       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4128       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 887, __pyx_L1_error)
4129       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4130       if (__pyx_t_6) {
4131         (__pyx_v_f[0]) = 0x69;
4132         goto __pyx_L15;
4133       }
4134 
4135       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":888
4136  *             elif t == NPY_USHORT:      f[0] =  72 #"H"
4137  *             elif t == NPY_INT:         f[0] = 105 #"i"
4138  *             elif t == NPY_UINT:        f[0] =  73 #"I"             # <<<<<<<<<<<<<<
4139  *             elif t == NPY_LONG:        f[0] = 108 #"l"
4140  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
4141  */
4142       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 888, __pyx_L1_error)
4143       __Pyx_GOTREF(__pyx_t_3);
4144       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 888, __pyx_L1_error)
4145       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4146       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 888, __pyx_L1_error)
4147       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4148       if (__pyx_t_6) {
4149         (__pyx_v_f[0]) = 73;
4150         goto __pyx_L15;
4151       }
4152 
4153       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":889
4154  *             elif t == NPY_INT:         f[0] = 105 #"i"
4155  *             elif t == NPY_UINT:        f[0] =  73 #"I"
4156  *             elif t == NPY_LONG:        f[0] = 108 #"l"             # <<<<<<<<<<<<<<
4157  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
4158  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
4159  */
4160       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 889, __pyx_L1_error)
4161       __Pyx_GOTREF(__pyx_t_4);
4162       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 889, __pyx_L1_error)
4163       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4164       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 889, __pyx_L1_error)
4165       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4166       if (__pyx_t_6) {
4167         (__pyx_v_f[0]) = 0x6C;
4168         goto __pyx_L15;
4169       }
4170 
4171       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":890
4172  *             elif t == NPY_UINT:        f[0] =  73 #"I"
4173  *             elif t == NPY_LONG:        f[0] = 108 #"l"
4174  *             elif t == NPY_ULONG:       f[0] = 76  #"L"             # <<<<<<<<<<<<<<
4175  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
4176  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
4177  */
4178       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 890, __pyx_L1_error)
4179       __Pyx_GOTREF(__pyx_t_3);
4180       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 890, __pyx_L1_error)
4181       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4182       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 890, __pyx_L1_error)
4183       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4184       if (__pyx_t_6) {
4185         (__pyx_v_f[0]) = 76;
4186         goto __pyx_L15;
4187       }
4188 
4189       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":891
4190  *             elif t == NPY_LONG:        f[0] = 108 #"l"
4191  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
4192  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"             # <<<<<<<<<<<<<<
4193  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
4194  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
4195  */
4196       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 891, __pyx_L1_error)
4197       __Pyx_GOTREF(__pyx_t_4);
4198       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 891, __pyx_L1_error)
4199       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4200       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 891, __pyx_L1_error)
4201       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4202       if (__pyx_t_6) {
4203         (__pyx_v_f[0]) = 0x71;
4204         goto __pyx_L15;
4205       }
4206 
4207       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":892
4208  *             elif t == NPY_ULONG:       f[0] = 76  #"L"
4209  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
4210  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"             # <<<<<<<<<<<<<<
4211  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
4212  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
4213  */
4214       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 892, __pyx_L1_error)
4215       __Pyx_GOTREF(__pyx_t_3);
4216       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 892, __pyx_L1_error)
4217       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4218       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 892, __pyx_L1_error)
4219       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4220       if (__pyx_t_6) {
4221         (__pyx_v_f[0]) = 81;
4222         goto __pyx_L15;
4223       }
4224 
4225       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":893
4226  *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
4227  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
4228  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"             # <<<<<<<<<<<<<<
4229  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
4230  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
4231  */
4232       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 893, __pyx_L1_error)
4233       __Pyx_GOTREF(__pyx_t_4);
4234       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 893, __pyx_L1_error)
4235       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4236       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 893, __pyx_L1_error)
4237       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4238       if (__pyx_t_6) {
4239         (__pyx_v_f[0]) = 0x66;
4240         goto __pyx_L15;
4241       }
4242 
4243       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":894
4244  *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
4245  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
4246  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"             # <<<<<<<<<<<<<<
4247  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
4248  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
4249  */
4250       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 894, __pyx_L1_error)
4251       __Pyx_GOTREF(__pyx_t_3);
4252       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 894, __pyx_L1_error)
4253       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4254       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 894, __pyx_L1_error)
4255       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4256       if (__pyx_t_6) {
4257         (__pyx_v_f[0]) = 0x64;
4258         goto __pyx_L15;
4259       }
4260 
4261       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":895
4262  *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
4263  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
4264  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"             # <<<<<<<<<<<<<<
4265  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
4266  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
4267  */
4268       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 895, __pyx_L1_error)
4269       __Pyx_GOTREF(__pyx_t_4);
4270       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 895, __pyx_L1_error)
4271       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4272       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 895, __pyx_L1_error)
4273       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4274       if (__pyx_t_6) {
4275         (__pyx_v_f[0]) = 0x67;
4276         goto __pyx_L15;
4277       }
4278 
4279       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":896
4280  *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
4281  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
4282  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf             # <<<<<<<<<<<<<<
4283  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
4284  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
4285  */
4286       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 896, __pyx_L1_error)
4287       __Pyx_GOTREF(__pyx_t_3);
4288       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 896, __pyx_L1_error)
4289       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4290       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 896, __pyx_L1_error)
4291       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4292       if (__pyx_t_6) {
4293         (__pyx_v_f[0]) = 90;
4294         (__pyx_v_f[1]) = 0x66;
4295         __pyx_v_f = (__pyx_v_f + 1);
4296         goto __pyx_L15;
4297       }
4298 
4299       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":897
4300  *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
4301  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
4302  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd             # <<<<<<<<<<<<<<
4303  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
4304  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
4305  */
4306       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 897, __pyx_L1_error)
4307       __Pyx_GOTREF(__pyx_t_4);
4308       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 897, __pyx_L1_error)
4309       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4310       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 897, __pyx_L1_error)
4311       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4312       if (__pyx_t_6) {
4313         (__pyx_v_f[0]) = 90;
4314         (__pyx_v_f[1]) = 0x64;
4315         __pyx_v_f = (__pyx_v_f + 1);
4316         goto __pyx_L15;
4317       }
4318 
4319       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":898
4320  *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
4321  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
4322  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg             # <<<<<<<<<<<<<<
4323  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
4324  *             else:
4325  */
4326       __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 898, __pyx_L1_error)
4327       __Pyx_GOTREF(__pyx_t_3);
4328       __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 898, __pyx_L1_error)
4329       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4330       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 898, __pyx_L1_error)
4331       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4332       if (__pyx_t_6) {
4333         (__pyx_v_f[0]) = 90;
4334         (__pyx_v_f[1]) = 0x67;
4335         __pyx_v_f = (__pyx_v_f + 1);
4336         goto __pyx_L15;
4337       }
4338 
4339       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":899
4340  *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
4341  *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
4342  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"             # <<<<<<<<<<<<<<
4343  *             else:
4344  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
4345  */
4346       __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 899, __pyx_L1_error)
4347       __Pyx_GOTREF(__pyx_t_4);
4348       __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 899, __pyx_L1_error)
4349       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4350       __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 899, __pyx_L1_error)
4351       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4352       if (likely(__pyx_t_6)) {
4353         (__pyx_v_f[0]) = 79;
4354         goto __pyx_L15;
4355       }
4356 
4357       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":901
4358  *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
4359  *             else:
4360  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
4361  *             f += 1
4362  *         else:
4363  */
4364       /*else*/ {
4365         __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 901, __pyx_L1_error)
4366         __Pyx_GOTREF(__pyx_t_3);
4367         __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 901, __pyx_L1_error)
4368         __Pyx_GOTREF(__pyx_t_4);
4369         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4370         __Pyx_Raise(__pyx_t_4, 0, 0, 0);
4371         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4372         __PYX_ERR(1, 901, __pyx_L1_error)
4373       }
4374       __pyx_L15:;
4375 
4376       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":902
4377  *             else:
4378  *                 raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
4379  *             f += 1             # <<<<<<<<<<<<<<
4380  *         else:
4381  *             # Cython ignores struct boundary information ("T{...}"),
4382  */
4383       __pyx_v_f = (__pyx_v_f + 1);
4384 
4385       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":877
4386  *         offset[0] += child.itemsize
4387  *
4388  *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
4389  *             t = child.type_num
4390  *             if end - f < 5:
4391  */
4392       goto __pyx_L13;
4393     }
4394 
4395     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":906
4396  *             # Cython ignores struct boundary information ("T{...}"),
4397  *             # so don't output it
4398  *             f = _util_dtypestring(child, f, end, offset)             # <<<<<<<<<<<<<<
4399  *     return f
4400  *
4401  */
4402     /*else*/ {
4403       __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(1, 906, __pyx_L1_error)
4404       __pyx_v_f = __pyx_t_9;
4405     }
4406     __pyx_L13:;
4407 
4408     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851
4409  *     cdef tuple fields
4410  *
4411  *     for childname in descr.names:             # <<<<<<<<<<<<<<
4412  *         fields = descr.fields[childname]
4413  *         child, new_offset = fields
4414  */
4415   }
4416   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4417 
4418   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":907
4419  *             # so don't output it
4420  *             f = _util_dtypestring(child, f, end, offset)
4421  *     return f             # <<<<<<<<<<<<<<
4422  *
4423  *
4424  */
4425   __pyx_r = __pyx_v_f;
4426   goto __pyx_L0;
4427 
4428   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842
4429  *         return ()
4430  *
4431  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
4432  *     # Recursive utility function used in __getbuffer__ to get format
4433  *     # string. The new location in the format string is returned.
4434  */
4435 
4436   /* function exit code */
4437   __pyx_L1_error:;
4438   __Pyx_XDECREF(__pyx_t_1);
4439   __Pyx_XDECREF(__pyx_t_3);
4440   __Pyx_XDECREF(__pyx_t_4);
4441   __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
4442   __pyx_r = NULL;
4443   __pyx_L0:;
4444   __Pyx_XDECREF((PyObject *)__pyx_v_child);
4445   __Pyx_XDECREF(__pyx_v_fields);
4446   __Pyx_XDECREF(__pyx_v_childname);
4447   __Pyx_XDECREF(__pyx_v_new_offset);
4448   __Pyx_XDECREF(__pyx_v_t);
4449   __Pyx_RefNannyFinishContext();
4450   return __pyx_r;
4451 }
4452 
4453 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1022
4454  *     int _import_umath() except -1
4455  *
4456  * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
4457  *     Py_INCREF(base) # important to do this before stealing the reference below!
4458  *     PyArray_SetBaseObject(arr, base)
4459  */
4460 
__pyx_f_5numpy_set_array_base(PyArrayObject * __pyx_v_arr,PyObject * __pyx_v_base)4461 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
4462   __Pyx_RefNannyDeclarations
4463   __Pyx_RefNannySetupContext("set_array_base", 0);
4464 
4465   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1023
4466  *
4467  * cdef inline void set_array_base(ndarray arr, object base):
4468  *     Py_INCREF(base) # important to do this before stealing the reference below!             # <<<<<<<<<<<<<<
4469  *     PyArray_SetBaseObject(arr, base)
4470  *
4471  */
4472   Py_INCREF(__pyx_v_base);
4473 
4474   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1024
4475  * cdef inline void set_array_base(ndarray arr, object base):
4476  *     Py_INCREF(base) # important to do this before stealing the reference below!
4477  *     PyArray_SetBaseObject(arr, base)             # <<<<<<<<<<<<<<
4478  *
4479  * cdef inline object get_array_base(ndarray arr):
4480  */
4481   (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
4482 
4483   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1022
4484  *     int _import_umath() except -1
4485  *
4486  * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
4487  *     Py_INCREF(base) # important to do this before stealing the reference below!
4488  *     PyArray_SetBaseObject(arr, base)
4489  */
4490 
4491   /* function exit code */
4492   __Pyx_RefNannyFinishContext();
4493 }
4494 
4495 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1026
4496  *     PyArray_SetBaseObject(arr, base)
4497  *
4498  * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
4499  *     base = PyArray_BASE(arr)
4500  *     if base is NULL:
4501  */
4502 
__pyx_f_5numpy_get_array_base(PyArrayObject * __pyx_v_arr)4503 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
4504   PyObject *__pyx_v_base;
4505   PyObject *__pyx_r = NULL;
4506   __Pyx_RefNannyDeclarations
4507   int __pyx_t_1;
4508   __Pyx_RefNannySetupContext("get_array_base", 0);
4509 
4510   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1027
4511  *
4512  * cdef inline object get_array_base(ndarray arr):
4513  *     base = PyArray_BASE(arr)             # <<<<<<<<<<<<<<
4514  *     if base is NULL:
4515  *         return None
4516  */
4517   __pyx_v_base = PyArray_BASE(__pyx_v_arr);
4518 
4519   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1028
4520  * cdef inline object get_array_base(ndarray arr):
4521  *     base = PyArray_BASE(arr)
4522  *     if base is NULL:             # <<<<<<<<<<<<<<
4523  *         return None
4524  *     return <object>base
4525  */
4526   __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
4527   if (__pyx_t_1) {
4528 
4529     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1029
4530  *     base = PyArray_BASE(arr)
4531  *     if base is NULL:
4532  *         return None             # <<<<<<<<<<<<<<
4533  *     return <object>base
4534  *
4535  */
4536     __Pyx_XDECREF(__pyx_r);
4537     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4538     goto __pyx_L0;
4539 
4540     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1028
4541  * cdef inline object get_array_base(ndarray arr):
4542  *     base = PyArray_BASE(arr)
4543  *     if base is NULL:             # <<<<<<<<<<<<<<
4544  *         return None
4545  *     return <object>base
4546  */
4547   }
4548 
4549   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1030
4550  *     if base is NULL:
4551  *         return None
4552  *     return <object>base             # <<<<<<<<<<<<<<
4553  *
4554  * # Versions of the import_* functions which are more suitable for
4555  */
4556   __Pyx_XDECREF(__pyx_r);
4557   __Pyx_INCREF(((PyObject *)__pyx_v_base));
4558   __pyx_r = ((PyObject *)__pyx_v_base);
4559   goto __pyx_L0;
4560 
4561   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1026
4562  *     PyArray_SetBaseObject(arr, base)
4563  *
4564  * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
4565  *     base = PyArray_BASE(arr)
4566  *     if base is NULL:
4567  */
4568 
4569   /* function exit code */
4570   __pyx_L0:;
4571   __Pyx_XGIVEREF(__pyx_r);
4572   __Pyx_RefNannyFinishContext();
4573   return __pyx_r;
4574 }
4575 
4576 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1034
4577  * # Versions of the import_* functions which are more suitable for
4578  * # Cython code.
4579  * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
4580  *     try:
4581  *         _import_array()
4582  */
4583 
__pyx_f_5numpy_import_array(void)4584 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
4585   int __pyx_r;
4586   __Pyx_RefNannyDeclarations
4587   PyObject *__pyx_t_1 = NULL;
4588   PyObject *__pyx_t_2 = NULL;
4589   PyObject *__pyx_t_3 = NULL;
4590   int __pyx_t_4;
4591   PyObject *__pyx_t_5 = NULL;
4592   PyObject *__pyx_t_6 = NULL;
4593   PyObject *__pyx_t_7 = NULL;
4594   PyObject *__pyx_t_8 = NULL;
4595   __Pyx_RefNannySetupContext("import_array", 0);
4596 
4597   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035
4598  * # Cython code.
4599  * cdef inline int import_array() except -1:
4600  *     try:             # <<<<<<<<<<<<<<
4601  *         _import_array()
4602  *     except Exception:
4603  */
4604   {
4605     __Pyx_PyThreadState_declare
4606     __Pyx_PyThreadState_assign
4607     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
4608     __Pyx_XGOTREF(__pyx_t_1);
4609     __Pyx_XGOTREF(__pyx_t_2);
4610     __Pyx_XGOTREF(__pyx_t_3);
4611     /*try:*/ {
4612 
4613       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1036
4614  * cdef inline int import_array() except -1:
4615  *     try:
4616  *         _import_array()             # <<<<<<<<<<<<<<
4617  *     except Exception:
4618  *         raise ImportError("numpy.core.multiarray failed to import")
4619  */
4620       __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1036, __pyx_L3_error)
4621 
4622       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035
4623  * # Cython code.
4624  * cdef inline int import_array() except -1:
4625  *     try:             # <<<<<<<<<<<<<<
4626  *         _import_array()
4627  *     except Exception:
4628  */
4629     }
4630     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
4631     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4632     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4633     goto __pyx_L8_try_end;
4634     __pyx_L3_error:;
4635 
4636     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1037
4637  *     try:
4638  *         _import_array()
4639  *     except Exception:             # <<<<<<<<<<<<<<
4640  *         raise ImportError("numpy.core.multiarray failed to import")
4641  *
4642  */
4643     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
4644     if (__pyx_t_4) {
4645       __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
4646       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1037, __pyx_L5_except_error)
4647       __Pyx_GOTREF(__pyx_t_5);
4648       __Pyx_GOTREF(__pyx_t_6);
4649       __Pyx_GOTREF(__pyx_t_7);
4650 
4651       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1038
4652  *         _import_array()
4653  *     except Exception:
4654  *         raise ImportError("numpy.core.multiarray failed to import")             # <<<<<<<<<<<<<<
4655  *
4656  * cdef inline int import_umath() except -1:
4657  */
4658       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1038, __pyx_L5_except_error)
4659       __Pyx_GOTREF(__pyx_t_8);
4660       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
4661       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4662       __PYX_ERR(1, 1038, __pyx_L5_except_error)
4663     }
4664     goto __pyx_L5_except_error;
4665     __pyx_L5_except_error:;
4666 
4667     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035
4668  * # Cython code.
4669  * cdef inline int import_array() except -1:
4670  *     try:             # <<<<<<<<<<<<<<
4671  *         _import_array()
4672  *     except Exception:
4673  */
4674     __Pyx_XGIVEREF(__pyx_t_1);
4675     __Pyx_XGIVEREF(__pyx_t_2);
4676     __Pyx_XGIVEREF(__pyx_t_3);
4677     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
4678     goto __pyx_L1_error;
4679     __pyx_L8_try_end:;
4680   }
4681 
4682   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1034
4683  * # Versions of the import_* functions which are more suitable for
4684  * # Cython code.
4685  * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
4686  *     try:
4687  *         _import_array()
4688  */
4689 
4690   /* function exit code */
4691   __pyx_r = 0;
4692   goto __pyx_L0;
4693   __pyx_L1_error:;
4694   __Pyx_XDECREF(__pyx_t_5);
4695   __Pyx_XDECREF(__pyx_t_6);
4696   __Pyx_XDECREF(__pyx_t_7);
4697   __Pyx_XDECREF(__pyx_t_8);
4698   __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
4699   __pyx_r = -1;
4700   __pyx_L0:;
4701   __Pyx_RefNannyFinishContext();
4702   return __pyx_r;
4703 }
4704 
4705 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1040
4706  *         raise ImportError("numpy.core.multiarray failed to import")
4707  *
4708  * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
4709  *     try:
4710  *         _import_umath()
4711  */
4712 
__pyx_f_5numpy_import_umath(void)4713 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
4714   int __pyx_r;
4715   __Pyx_RefNannyDeclarations
4716   PyObject *__pyx_t_1 = NULL;
4717   PyObject *__pyx_t_2 = NULL;
4718   PyObject *__pyx_t_3 = NULL;
4719   int __pyx_t_4;
4720   PyObject *__pyx_t_5 = NULL;
4721   PyObject *__pyx_t_6 = NULL;
4722   PyObject *__pyx_t_7 = NULL;
4723   PyObject *__pyx_t_8 = NULL;
4724   __Pyx_RefNannySetupContext("import_umath", 0);
4725 
4726   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041
4727  *
4728  * cdef inline int import_umath() except -1:
4729  *     try:             # <<<<<<<<<<<<<<
4730  *         _import_umath()
4731  *     except Exception:
4732  */
4733   {
4734     __Pyx_PyThreadState_declare
4735     __Pyx_PyThreadState_assign
4736     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
4737     __Pyx_XGOTREF(__pyx_t_1);
4738     __Pyx_XGOTREF(__pyx_t_2);
4739     __Pyx_XGOTREF(__pyx_t_3);
4740     /*try:*/ {
4741 
4742       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1042
4743  * cdef inline int import_umath() except -1:
4744  *     try:
4745  *         _import_umath()             # <<<<<<<<<<<<<<
4746  *     except Exception:
4747  *         raise ImportError("numpy.core.umath failed to import")
4748  */
4749       __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1042, __pyx_L3_error)
4750 
4751       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041
4752  *
4753  * cdef inline int import_umath() except -1:
4754  *     try:             # <<<<<<<<<<<<<<
4755  *         _import_umath()
4756  *     except Exception:
4757  */
4758     }
4759     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
4760     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4761     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4762     goto __pyx_L8_try_end;
4763     __pyx_L3_error:;
4764 
4765     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1043
4766  *     try:
4767  *         _import_umath()
4768  *     except Exception:             # <<<<<<<<<<<<<<
4769  *         raise ImportError("numpy.core.umath failed to import")
4770  *
4771  */
4772     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
4773     if (__pyx_t_4) {
4774       __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
4775       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1043, __pyx_L5_except_error)
4776       __Pyx_GOTREF(__pyx_t_5);
4777       __Pyx_GOTREF(__pyx_t_6);
4778       __Pyx_GOTREF(__pyx_t_7);
4779 
4780       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1044
4781  *         _import_umath()
4782  *     except Exception:
4783  *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
4784  *
4785  * cdef inline int import_ufunc() except -1:
4786  */
4787       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1044, __pyx_L5_except_error)
4788       __Pyx_GOTREF(__pyx_t_8);
4789       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
4790       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4791       __PYX_ERR(1, 1044, __pyx_L5_except_error)
4792     }
4793     goto __pyx_L5_except_error;
4794     __pyx_L5_except_error:;
4795 
4796     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041
4797  *
4798  * cdef inline int import_umath() except -1:
4799  *     try:             # <<<<<<<<<<<<<<
4800  *         _import_umath()
4801  *     except Exception:
4802  */
4803     __Pyx_XGIVEREF(__pyx_t_1);
4804     __Pyx_XGIVEREF(__pyx_t_2);
4805     __Pyx_XGIVEREF(__pyx_t_3);
4806     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
4807     goto __pyx_L1_error;
4808     __pyx_L8_try_end:;
4809   }
4810 
4811   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1040
4812  *         raise ImportError("numpy.core.multiarray failed to import")
4813  *
4814  * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
4815  *     try:
4816  *         _import_umath()
4817  */
4818 
4819   /* function exit code */
4820   __pyx_r = 0;
4821   goto __pyx_L0;
4822   __pyx_L1_error:;
4823   __Pyx_XDECREF(__pyx_t_5);
4824   __Pyx_XDECREF(__pyx_t_6);
4825   __Pyx_XDECREF(__pyx_t_7);
4826   __Pyx_XDECREF(__pyx_t_8);
4827   __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
4828   __pyx_r = -1;
4829   __pyx_L0:;
4830   __Pyx_RefNannyFinishContext();
4831   return __pyx_r;
4832 }
4833 
4834 /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1046
4835  *         raise ImportError("numpy.core.umath failed to import")
4836  *
4837  * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
4838  *     try:
4839  *         _import_umath()
4840  */
4841 
__pyx_f_5numpy_import_ufunc(void)4842 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
4843   int __pyx_r;
4844   __Pyx_RefNannyDeclarations
4845   PyObject *__pyx_t_1 = NULL;
4846   PyObject *__pyx_t_2 = NULL;
4847   PyObject *__pyx_t_3 = NULL;
4848   int __pyx_t_4;
4849   PyObject *__pyx_t_5 = NULL;
4850   PyObject *__pyx_t_6 = NULL;
4851   PyObject *__pyx_t_7 = NULL;
4852   PyObject *__pyx_t_8 = NULL;
4853   __Pyx_RefNannySetupContext("import_ufunc", 0);
4854 
4855   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047
4856  *
4857  * cdef inline int import_ufunc() except -1:
4858  *     try:             # <<<<<<<<<<<<<<
4859  *         _import_umath()
4860  *     except Exception:
4861  */
4862   {
4863     __Pyx_PyThreadState_declare
4864     __Pyx_PyThreadState_assign
4865     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
4866     __Pyx_XGOTREF(__pyx_t_1);
4867     __Pyx_XGOTREF(__pyx_t_2);
4868     __Pyx_XGOTREF(__pyx_t_3);
4869     /*try:*/ {
4870 
4871       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1048
4872  * cdef inline int import_ufunc() except -1:
4873  *     try:
4874  *         _import_umath()             # <<<<<<<<<<<<<<
4875  *     except Exception:
4876  *         raise ImportError("numpy.core.umath failed to import")
4877  */
4878       __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1048, __pyx_L3_error)
4879 
4880       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047
4881  *
4882  * cdef inline int import_ufunc() except -1:
4883  *     try:             # <<<<<<<<<<<<<<
4884  *         _import_umath()
4885  *     except Exception:
4886  */
4887     }
4888     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
4889     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4890     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4891     goto __pyx_L8_try_end;
4892     __pyx_L3_error:;
4893 
4894     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1049
4895  *     try:
4896  *         _import_umath()
4897  *     except Exception:             # <<<<<<<<<<<<<<
4898  *         raise ImportError("numpy.core.umath failed to import")
4899  */
4900     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
4901     if (__pyx_t_4) {
4902       __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
4903       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1049, __pyx_L5_except_error)
4904       __Pyx_GOTREF(__pyx_t_5);
4905       __Pyx_GOTREF(__pyx_t_6);
4906       __Pyx_GOTREF(__pyx_t_7);
4907 
4908       /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1050
4909  *         _import_umath()
4910  *     except Exception:
4911  *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
4912  */
4913       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1050, __pyx_L5_except_error)
4914       __Pyx_GOTREF(__pyx_t_8);
4915       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
4916       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4917       __PYX_ERR(1, 1050, __pyx_L5_except_error)
4918     }
4919     goto __pyx_L5_except_error;
4920     __pyx_L5_except_error:;
4921 
4922     /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047
4923  *
4924  * cdef inline int import_ufunc() except -1:
4925  *     try:             # <<<<<<<<<<<<<<
4926  *         _import_umath()
4927  *     except Exception:
4928  */
4929     __Pyx_XGIVEREF(__pyx_t_1);
4930     __Pyx_XGIVEREF(__pyx_t_2);
4931     __Pyx_XGIVEREF(__pyx_t_3);
4932     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
4933     goto __pyx_L1_error;
4934     __pyx_L8_try_end:;
4935   }
4936 
4937   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1046
4938  *         raise ImportError("numpy.core.umath failed to import")
4939  *
4940  * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
4941  *     try:
4942  *         _import_umath()
4943  */
4944 
4945   /* function exit code */
4946   __pyx_r = 0;
4947   goto __pyx_L0;
4948   __pyx_L1_error:;
4949   __Pyx_XDECREF(__pyx_t_5);
4950   __Pyx_XDECREF(__pyx_t_6);
4951   __Pyx_XDECREF(__pyx_t_7);
4952   __Pyx_XDECREF(__pyx_t_8);
4953   __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
4954   __pyx_r = -1;
4955   __pyx_L0:;
4956   __Pyx_RefNannyFinishContext();
4957   return __pyx_r;
4958 }
4959 
4960 /* "yt/utilities/lib/bitarray.pxd":15
4961  *
4962  *
4963  * cdef inline void ba_set_value(np.uint8_t *buf, np.uint64_t ind,             # <<<<<<<<<<<<<<
4964  *                               np.uint8_t val) nogil:
4965  *     # This assumes 8 bit buffer
4966  */
4967 
__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)4968 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) {
4969   int __pyx_t_1;
4970   __pyx_t_5numpy_uint64_t __pyx_t_2;
4971 
4972   /* "yt/utilities/lib/bitarray.pxd":18
4973  *                               np.uint8_t val) nogil:
4974  *     # This assumes 8 bit buffer
4975  *     if val > 0:             # <<<<<<<<<<<<<<
4976  *         buf[ind >> 3] |= (1 << (ind & 7))
4977  *     else:
4978  */
4979   __pyx_t_1 = ((__pyx_v_val > 0) != 0);
4980   if (__pyx_t_1) {
4981 
4982     /* "yt/utilities/lib/bitarray.pxd":19
4983  *     # This assumes 8 bit buffer
4984  *     if val > 0:
4985  *         buf[ind >> 3] |= (1 << (ind & 7))             # <<<<<<<<<<<<<<
4986  *     else:
4987  *         buf[ind >> 3] &= ~(1 << (ind & 7))
4988  */
4989     __pyx_t_2 = (__pyx_v_ind >> 3);
4990     (__pyx_v_buf[__pyx_t_2]) = ((__pyx_v_buf[__pyx_t_2]) | (1 << (__pyx_v_ind & 7)));
4991 
4992     /* "yt/utilities/lib/bitarray.pxd":18
4993  *                               np.uint8_t val) nogil:
4994  *     # This assumes 8 bit buffer
4995  *     if val > 0:             # <<<<<<<<<<<<<<
4996  *         buf[ind >> 3] |= (1 << (ind & 7))
4997  *     else:
4998  */
4999     goto __pyx_L3;
5000   }
5001 
5002   /* "yt/utilities/lib/bitarray.pxd":21
5003  *         buf[ind >> 3] |= (1 << (ind & 7))
5004  *     else:
5005  *         buf[ind >> 3] &= ~(1 << (ind & 7))             # <<<<<<<<<<<<<<
5006  *
5007  * cdef inline np.uint8_t ba_get_value(np.uint8_t *buf, np.uint64_t ind) nogil:
5008  */
5009   /*else*/ {
5010     __pyx_t_2 = (__pyx_v_ind >> 3);
5011     (__pyx_v_buf[__pyx_t_2]) = ((__pyx_v_buf[__pyx_t_2]) & (~(1 << (__pyx_v_ind & 7))));
5012   }
5013   __pyx_L3:;
5014 
5015   /* "yt/utilities/lib/bitarray.pxd":15
5016  *
5017  *
5018  * cdef inline void ba_set_value(np.uint8_t *buf, np.uint64_t ind,             # <<<<<<<<<<<<<<
5019  *                               np.uint8_t val) nogil:
5020  *     # This assumes 8 bit buffer
5021  */
5022 
5023   /* function exit code */
5024 }
5025 
5026 /* "yt/utilities/lib/bitarray.pxd":23
5027  *         buf[ind >> 3] &= ~(1 << (ind & 7))
5028  *
5029  * cdef inline np.uint8_t ba_get_value(np.uint8_t *buf, np.uint64_t ind) nogil:             # <<<<<<<<<<<<<<
5030  *     cdef np.uint8_t rv = (buf[ind >> 3] & (1 << (ind & 7)))
5031  *     if rv == 0: return 0
5032  */
5033 
__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)5034 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) {
5035   __pyx_t_5numpy_uint8_t __pyx_v_rv;
5036   __pyx_t_5numpy_uint8_t __pyx_r;
5037   int __pyx_t_1;
5038 
5039   /* "yt/utilities/lib/bitarray.pxd":24
5040  *
5041  * cdef inline np.uint8_t ba_get_value(np.uint8_t *buf, np.uint64_t ind) nogil:
5042  *     cdef np.uint8_t rv = (buf[ind >> 3] & (1 << (ind & 7)))             # <<<<<<<<<<<<<<
5043  *     if rv == 0: return 0
5044  *     return 1
5045  */
5046   __pyx_v_rv = ((__pyx_v_buf[(__pyx_v_ind >> 3)]) & (1 << (__pyx_v_ind & 7)));
5047 
5048   /* "yt/utilities/lib/bitarray.pxd":25
5049  * cdef inline np.uint8_t ba_get_value(np.uint8_t *buf, np.uint64_t ind) nogil:
5050  *     cdef np.uint8_t rv = (buf[ind >> 3] & (1 << (ind & 7)))
5051  *     if rv == 0: return 0             # <<<<<<<<<<<<<<
5052  *     return 1
5053  *
5054  */
5055   __pyx_t_1 = ((__pyx_v_rv == 0) != 0);
5056   if (__pyx_t_1) {
5057     __pyx_r = 0;
5058     goto __pyx_L0;
5059   }
5060 
5061   /* "yt/utilities/lib/bitarray.pxd":26
5062  *     cdef np.uint8_t rv = (buf[ind >> 3] & (1 << (ind & 7)))
5063  *     if rv == 0: return 0
5064  *     return 1             # <<<<<<<<<<<<<<
5065  *
5066  * cdef class bitarray:
5067  */
5068   __pyx_r = 1;
5069   goto __pyx_L0;
5070 
5071   /* "yt/utilities/lib/bitarray.pxd":23
5072  *         buf[ind >> 3] &= ~(1 << (ind & 7))
5073  *
5074  * cdef inline np.uint8_t ba_get_value(np.uint8_t *buf, np.uint64_t ind) nogil:             # <<<<<<<<<<<<<<
5075  *     cdef np.uint8_t rv = (buf[ind >> 3] & (1 << (ind & 7)))
5076  *     if rv == 0: return 0
5077  */
5078 
5079   /* function exit code */
5080   __pyx_L0:;
5081   return __pyx_r;
5082 }
5083 
5084 /* "yt/utilities/lib/fp_utils.pxd":13
5085  *
5086  *
5087  * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil:             # <<<<<<<<<<<<<<
5088  *     if i0 > i1: return i0
5089  *     return i1
5090  */
5091 
__pyx_f_2yt_9utilities_3lib_8fp_utils_imax(__pyx_t_5numpy_int64_t __pyx_v_i0,__pyx_t_5numpy_int64_t __pyx_v_i1)5092 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) {
5093   __pyx_t_5numpy_int64_t __pyx_r;
5094   int __pyx_t_1;
5095 
5096   /* "yt/utilities/lib/fp_utils.pxd":14
5097  *
5098  * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil:
5099  *     if i0 > i1: return i0             # <<<<<<<<<<<<<<
5100  *     return i1
5101  *
5102  */
5103   __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0);
5104   if (__pyx_t_1) {
5105     __pyx_r = __pyx_v_i0;
5106     goto __pyx_L0;
5107   }
5108 
5109   /* "yt/utilities/lib/fp_utils.pxd":15
5110  * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil:
5111  *     if i0 > i1: return i0
5112  *     return i1             # <<<<<<<<<<<<<<
5113  *
5114  * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil:
5115  */
5116   __pyx_r = __pyx_v_i1;
5117   goto __pyx_L0;
5118 
5119   /* "yt/utilities/lib/fp_utils.pxd":13
5120  *
5121  *
5122  * cdef inline np.int64_t imax(np.int64_t i0, np.int64_t i1) nogil:             # <<<<<<<<<<<<<<
5123  *     if i0 > i1: return i0
5124  *     return i1
5125  */
5126 
5127   /* function exit code */
5128   __pyx_L0:;
5129   return __pyx_r;
5130 }
5131 
5132 /* "yt/utilities/lib/fp_utils.pxd":17
5133  *     return i1
5134  *
5135  * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil:             # <<<<<<<<<<<<<<
5136  *     if f0 > f1: return f0
5137  *     return f1
5138  */
5139 
__pyx_f_2yt_9utilities_3lib_8fp_utils_fmax(__pyx_t_5numpy_float64_t __pyx_v_f0,__pyx_t_5numpy_float64_t __pyx_v_f1)5140 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) {
5141   __pyx_t_5numpy_float64_t __pyx_r;
5142   int __pyx_t_1;
5143 
5144   /* "yt/utilities/lib/fp_utils.pxd":18
5145  *
5146  * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil:
5147  *     if f0 > f1: return f0             # <<<<<<<<<<<<<<
5148  *     return f1
5149  *
5150  */
5151   __pyx_t_1 = ((__pyx_v_f0 > __pyx_v_f1) != 0);
5152   if (__pyx_t_1) {
5153     __pyx_r = __pyx_v_f0;
5154     goto __pyx_L0;
5155   }
5156 
5157   /* "yt/utilities/lib/fp_utils.pxd":19
5158  * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil:
5159  *     if f0 > f1: return f0
5160  *     return f1             # <<<<<<<<<<<<<<
5161  *
5162  * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil:
5163  */
5164   __pyx_r = __pyx_v_f1;
5165   goto __pyx_L0;
5166 
5167   /* "yt/utilities/lib/fp_utils.pxd":17
5168  *     return i1
5169  *
5170  * cdef inline np.float64_t fmax(np.float64_t f0, np.float64_t f1) nogil:             # <<<<<<<<<<<<<<
5171  *     if f0 > f1: return f0
5172  *     return f1
5173  */
5174 
5175   /* function exit code */
5176   __pyx_L0:;
5177   return __pyx_r;
5178 }
5179 
5180 /* "yt/utilities/lib/fp_utils.pxd":21
5181  *     return f1
5182  *
5183  * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil:             # <<<<<<<<<<<<<<
5184  *     if i0 < i1: return i0
5185  *     return i1
5186  */
5187 
__pyx_f_2yt_9utilities_3lib_8fp_utils_imin(__pyx_t_5numpy_int64_t __pyx_v_i0,__pyx_t_5numpy_int64_t __pyx_v_i1)5188 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) {
5189   __pyx_t_5numpy_int64_t __pyx_r;
5190   int __pyx_t_1;
5191 
5192   /* "yt/utilities/lib/fp_utils.pxd":22
5193  *
5194  * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil:
5195  *     if i0 < i1: return i0             # <<<<<<<<<<<<<<
5196  *     return i1
5197  *
5198  */
5199   __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0);
5200   if (__pyx_t_1) {
5201     __pyx_r = __pyx_v_i0;
5202     goto __pyx_L0;
5203   }
5204 
5205   /* "yt/utilities/lib/fp_utils.pxd":23
5206  * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil:
5207  *     if i0 < i1: return i0
5208  *     return i1             # <<<<<<<<<<<<<<
5209  *
5210  * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil:
5211  */
5212   __pyx_r = __pyx_v_i1;
5213   goto __pyx_L0;
5214 
5215   /* "yt/utilities/lib/fp_utils.pxd":21
5216  *     return f1
5217  *
5218  * cdef inline np.int64_t imin(np.int64_t i0, np.int64_t i1) nogil:             # <<<<<<<<<<<<<<
5219  *     if i0 < i1: return i0
5220  *     return i1
5221  */
5222 
5223   /* function exit code */
5224   __pyx_L0:;
5225   return __pyx_r;
5226 }
5227 
5228 /* "yt/utilities/lib/fp_utils.pxd":25
5229  *     return i1
5230  *
5231  * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil:             # <<<<<<<<<<<<<<
5232  *     if f0 < f1: return f0
5233  *     return f1
5234  */
5235 
__pyx_f_2yt_9utilities_3lib_8fp_utils_fmin(__pyx_t_5numpy_float64_t __pyx_v_f0,__pyx_t_5numpy_float64_t __pyx_v_f1)5236 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) {
5237   __pyx_t_5numpy_float64_t __pyx_r;
5238   int __pyx_t_1;
5239 
5240   /* "yt/utilities/lib/fp_utils.pxd":26
5241  *
5242  * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil:
5243  *     if f0 < f1: return f0             # <<<<<<<<<<<<<<
5244  *     return f1
5245  *
5246  */
5247   __pyx_t_1 = ((__pyx_v_f0 < __pyx_v_f1) != 0);
5248   if (__pyx_t_1) {
5249     __pyx_r = __pyx_v_f0;
5250     goto __pyx_L0;
5251   }
5252 
5253   /* "yt/utilities/lib/fp_utils.pxd":27
5254  * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil:
5255  *     if f0 < f1: return f0
5256  *     return f1             # <<<<<<<<<<<<<<
5257  *
5258  * cdef inline np.float64_t fabs(np.float64_t f0) nogil:
5259  */
5260   __pyx_r = __pyx_v_f1;
5261   goto __pyx_L0;
5262 
5263   /* "yt/utilities/lib/fp_utils.pxd":25
5264  *     return i1
5265  *
5266  * cdef inline np.float64_t fmin(np.float64_t f0, np.float64_t f1) nogil:             # <<<<<<<<<<<<<<
5267  *     if f0 < f1: return f0
5268  *     return f1
5269  */
5270 
5271   /* function exit code */
5272   __pyx_L0:;
5273   return __pyx_r;
5274 }
5275 
5276 /* "yt/utilities/lib/fp_utils.pxd":29
5277  *     return f1
5278  *
5279  * cdef inline np.float64_t fabs(np.float64_t f0) nogil:             # <<<<<<<<<<<<<<
5280  *     if f0 < 0.0: return -f0
5281  *     return f0
5282  */
5283 
__pyx_f_2yt_9utilities_3lib_8fp_utils_fabs(__pyx_t_5numpy_float64_t __pyx_v_f0)5284 static CYTHON_INLINE __pyx_t_5numpy_float64_t __pyx_f_2yt_9utilities_3lib_8fp_utils_fabs(__pyx_t_5numpy_float64_t __pyx_v_f0) {
5285   __pyx_t_5numpy_float64_t __pyx_r;
5286   int __pyx_t_1;
5287 
5288   /* "yt/utilities/lib/fp_utils.pxd":30
5289  *
5290  * cdef inline np.float64_t fabs(np.float64_t f0) nogil:
5291  *     if f0 < 0.0: return -f0             # <<<<<<<<<<<<<<
5292  *     return f0
5293  *
5294  */
5295   __pyx_t_1 = ((__pyx_v_f0 < 0.0) != 0);
5296   if (__pyx_t_1) {
5297     __pyx_r = (-__pyx_v_f0);
5298     goto __pyx_L0;
5299   }
5300 
5301   /* "yt/utilities/lib/fp_utils.pxd":31
5302  * cdef inline np.float64_t fabs(np.float64_t f0) nogil:
5303  *     if f0 < 0.0: return -f0
5304  *     return f0             # <<<<<<<<<<<<<<
5305  *
5306  * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:
5307  */
5308   __pyx_r = __pyx_v_f0;
5309   goto __pyx_L0;
5310 
5311   /* "yt/utilities/lib/fp_utils.pxd":29
5312  *     return f1
5313  *
5314  * cdef inline np.float64_t fabs(np.float64_t f0) nogil:             # <<<<<<<<<<<<<<
5315  *     if f0 < 0.0: return -f0
5316  *     return f0
5317  */
5318 
5319   /* function exit code */
5320   __pyx_L0:;
5321   return __pyx_r;
5322 }
5323 
5324 /* "yt/utilities/lib/fp_utils.pxd":33
5325  *     return f0
5326  *
5327  * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:             # <<<<<<<<<<<<<<
5328  *     if i < a: return a
5329  *     if i > b: return b
5330  */
5331 
__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)5332 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) {
5333   __pyx_t_5numpy_int64_t __pyx_r;
5334   int __pyx_t_1;
5335 
5336   /* "yt/utilities/lib/fp_utils.pxd":34
5337  *
5338  * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:
5339  *     if i < a: return a             # <<<<<<<<<<<<<<
5340  *     if i > b: return b
5341  *     return i
5342  */
5343   __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0);
5344   if (__pyx_t_1) {
5345     __pyx_r = __pyx_v_a;
5346     goto __pyx_L0;
5347   }
5348 
5349   /* "yt/utilities/lib/fp_utils.pxd":35
5350  * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:
5351  *     if i < a: return a
5352  *     if i > b: return b             # <<<<<<<<<<<<<<
5353  *     return i
5354  *
5355  */
5356   __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0);
5357   if (__pyx_t_1) {
5358     __pyx_r = __pyx_v_b;
5359     goto __pyx_L0;
5360   }
5361 
5362   /* "yt/utilities/lib/fp_utils.pxd":36
5363  *     if i < a: return a
5364  *     if i > b: return b
5365  *     return i             # <<<<<<<<<<<<<<
5366  *
5367  * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:
5368  */
5369   __pyx_r = __pyx_v_i;
5370   goto __pyx_L0;
5371 
5372   /* "yt/utilities/lib/fp_utils.pxd":33
5373  *     return f0
5374  *
5375  * cdef inline np.int64_t iclip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:             # <<<<<<<<<<<<<<
5376  *     if i < a: return a
5377  *     if i > b: return b
5378  */
5379 
5380   /* function exit code */
5381   __pyx_L0:;
5382   return __pyx_r;
5383 }
5384 
5385 /* "yt/utilities/lib/fp_utils.pxd":38
5386  *     return i
5387  *
5388  * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:             # <<<<<<<<<<<<<<
5389  *     if i < a: return a
5390  *     if i > b: return b
5391  */
5392 
__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)5393 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) {
5394   __pyx_t_5numpy_int64_t __pyx_r;
5395   int __pyx_t_1;
5396 
5397   /* "yt/utilities/lib/fp_utils.pxd":39
5398  *
5399  * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:
5400  *     if i < a: return a             # <<<<<<<<<<<<<<
5401  *     if i > b: return b
5402  *     return i
5403  */
5404   __pyx_t_1 = ((__pyx_v_i < __pyx_v_a) != 0);
5405   if (__pyx_t_1) {
5406     __pyx_r = __pyx_v_a;
5407     goto __pyx_L0;
5408   }
5409 
5410   /* "yt/utilities/lib/fp_utils.pxd":40
5411  * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:
5412  *     if i < a: return a
5413  *     if i > b: return b             # <<<<<<<<<<<<<<
5414  *     return i
5415  *
5416  */
5417   __pyx_t_1 = ((__pyx_v_i > __pyx_v_b) != 0);
5418   if (__pyx_t_1) {
5419     __pyx_r = __pyx_v_b;
5420     goto __pyx_L0;
5421   }
5422 
5423   /* "yt/utilities/lib/fp_utils.pxd":41
5424  *     if i < a: return a
5425  *     if i > b: return b
5426  *     return i             # <<<<<<<<<<<<<<
5427  *
5428  * cdef inline np.float64_t fclip(np.float64_t f,
5429  */
5430   __pyx_r = __pyx_v_i;
5431   goto __pyx_L0;
5432 
5433   /* "yt/utilities/lib/fp_utils.pxd":38
5434  *     return i
5435  *
5436  * cdef inline np.int64_t i64clip(np.int64_t i, np.int64_t a, np.int64_t b) nogil:             # <<<<<<<<<<<<<<
5437  *     if i < a: return a
5438  *     if i > b: return b
5439  */
5440 
5441   /* function exit code */
5442   __pyx_L0:;
5443   return __pyx_r;
5444 }
5445 
5446 /* "yt/utilities/lib/fp_utils.pxd":43
5447  *     return i
5448  *
5449  * cdef inline np.float64_t fclip(np.float64_t f,             # <<<<<<<<<<<<<<
5450  *                       np.float64_t a, np.float64_t b) nogil:
5451  *     return fmin(fmax(f, a), b)
5452  */
5453 
__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)5454 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) {
5455   __pyx_t_5numpy_float64_t __pyx_r;
5456 
5457   /* "yt/utilities/lib/fp_utils.pxd":45
5458  * cdef inline np.float64_t fclip(np.float64_t f,
5459  *                       np.float64_t a, np.float64_t b) nogil:
5460  *     return fmin(fmax(f, a), b)             # <<<<<<<<<<<<<<
5461  *
5462  * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil:
5463  */
5464   __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);
5465   goto __pyx_L0;
5466 
5467   /* "yt/utilities/lib/fp_utils.pxd":43
5468  *     return i
5469  *
5470  * cdef inline np.float64_t fclip(np.float64_t f,             # <<<<<<<<<<<<<<
5471  *                       np.float64_t a, np.float64_t b) nogil:
5472  *     return fmin(fmax(f, a), b)
5473  */
5474 
5475   /* function exit code */
5476   __pyx_L0:;
5477   return __pyx_r;
5478 }
5479 
5480 /* "yt/utilities/lib/fp_utils.pxd":47
5481  *     return fmin(fmax(f, a), b)
5482  *
5483  * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil:             # <<<<<<<<<<<<<<
5484  *     if i0 > i1: return i0
5485  *     return i1
5486  */
5487 
__pyx_f_2yt_9utilities_3lib_8fp_utils_i64max(__pyx_t_5numpy_int64_t __pyx_v_i0,__pyx_t_5numpy_int64_t __pyx_v_i1)5488 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) {
5489   __pyx_t_5numpy_int64_t __pyx_r;
5490   int __pyx_t_1;
5491 
5492   /* "yt/utilities/lib/fp_utils.pxd":48
5493  *
5494  * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil:
5495  *     if i0 > i1: return i0             # <<<<<<<<<<<<<<
5496  *     return i1
5497  *
5498  */
5499   __pyx_t_1 = ((__pyx_v_i0 > __pyx_v_i1) != 0);
5500   if (__pyx_t_1) {
5501     __pyx_r = __pyx_v_i0;
5502     goto __pyx_L0;
5503   }
5504 
5505   /* "yt/utilities/lib/fp_utils.pxd":49
5506  * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil:
5507  *     if i0 > i1: return i0
5508  *     return i1             # <<<<<<<<<<<<<<
5509  *
5510  * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil:
5511  */
5512   __pyx_r = __pyx_v_i1;
5513   goto __pyx_L0;
5514 
5515   /* "yt/utilities/lib/fp_utils.pxd":47
5516  *     return fmin(fmax(f, a), b)
5517  *
5518  * cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil:             # <<<<<<<<<<<<<<
5519  *     if i0 > i1: return i0
5520  *     return i1
5521  */
5522 
5523   /* function exit code */
5524   __pyx_L0:;
5525   return __pyx_r;
5526 }
5527 
5528 /* "yt/utilities/lib/fp_utils.pxd":51
5529  *     return i1
5530  *
5531  * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil:             # <<<<<<<<<<<<<<
5532  *     if i0 < i1: return i0
5533  *     return i1
5534  */
5535 
__pyx_f_2yt_9utilities_3lib_8fp_utils_i64min(__pyx_t_5numpy_int64_t __pyx_v_i0,__pyx_t_5numpy_int64_t __pyx_v_i1)5536 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) {
5537   __pyx_t_5numpy_int64_t __pyx_r;
5538   int __pyx_t_1;
5539 
5540   /* "yt/utilities/lib/fp_utils.pxd":52
5541  *
5542  * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil:
5543  *     if i0 < i1: return i0             # <<<<<<<<<<<<<<
5544  *     return i1
5545  *
5546  */
5547   __pyx_t_1 = ((__pyx_v_i0 < __pyx_v_i1) != 0);
5548   if (__pyx_t_1) {
5549     __pyx_r = __pyx_v_i0;
5550     goto __pyx_L0;
5551   }
5552 
5553   /* "yt/utilities/lib/fp_utils.pxd":53
5554  * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil:
5555  *     if i0 < i1: return i0
5556  *     return i1             # <<<<<<<<<<<<<<
5557  *
5558  * cdef inline _ensure_code(arr):
5559  */
5560   __pyx_r = __pyx_v_i1;
5561   goto __pyx_L0;
5562 
5563   /* "yt/utilities/lib/fp_utils.pxd":51
5564  *     return i1
5565  *
5566  * cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil:             # <<<<<<<<<<<<<<
5567  *     if i0 < i1: return i0
5568  *     return i1
5569  */
5570 
5571   /* function exit code */
5572   __pyx_L0:;
5573   return __pyx_r;
5574 }
5575 
5576 /* "yt/utilities/lib/fp_utils.pxd":55
5577  *     return i1
5578  *
5579  * cdef inline _ensure_code(arr):             # <<<<<<<<<<<<<<
5580  *     if hasattr(arr, "units"):
5581  *         if "code_length" == str(arr.units):
5582  */
5583 
__pyx_f_2yt_9utilities_3lib_8fp_utils__ensure_code(PyObject * __pyx_v_arr)5584 static CYTHON_INLINE PyObject *__pyx_f_2yt_9utilities_3lib_8fp_utils__ensure_code(PyObject *__pyx_v_arr) {
5585   PyObject *__pyx_r = NULL;
5586   __Pyx_RefNannyDeclarations
5587   int __pyx_t_1;
5588   int __pyx_t_2;
5589   PyObject *__pyx_t_3 = NULL;
5590   PyObject *__pyx_t_4 = NULL;
5591   PyObject *__pyx_t_5 = NULL;
5592   __Pyx_RefNannySetupContext("_ensure_code", 0);
5593 
5594   /* "yt/utilities/lib/fp_utils.pxd":56
5595  *
5596  * cdef inline _ensure_code(arr):
5597  *     if hasattr(arr, "units"):             # <<<<<<<<<<<<<<
5598  *         if "code_length" == str(arr.units):
5599  *             return arr
5600  */
5601   __pyx_t_1 = __Pyx_HasAttr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 56, __pyx_L1_error)
5602   __pyx_t_2 = (__pyx_t_1 != 0);
5603   if (__pyx_t_2) {
5604 
5605     /* "yt/utilities/lib/fp_utils.pxd":57
5606  * cdef inline _ensure_code(arr):
5607  *     if hasattr(arr, "units"):
5608  *         if "code_length" == str(arr.units):             # <<<<<<<<<<<<<<
5609  *             return arr
5610  *         arr.convert_to_units("code_length")
5611  */
5612     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 57, __pyx_L1_error)
5613     __Pyx_GOTREF(__pyx_t_3);
5614     __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 57, __pyx_L1_error)
5615     __Pyx_GOTREF(__pyx_t_4);
5616     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5617     __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_n_s_code_length, __pyx_t_4, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 57, __pyx_L1_error)
5618     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5619     if (__pyx_t_2) {
5620 
5621       /* "yt/utilities/lib/fp_utils.pxd":58
5622  *     if hasattr(arr, "units"):
5623  *         if "code_length" == str(arr.units):
5624  *             return arr             # <<<<<<<<<<<<<<
5625  *         arr.convert_to_units("code_length")
5626  *     return arr
5627  */
5628       __Pyx_XDECREF(__pyx_r);
5629       __Pyx_INCREF(__pyx_v_arr);
5630       __pyx_r = __pyx_v_arr;
5631       goto __pyx_L0;
5632 
5633       /* "yt/utilities/lib/fp_utils.pxd":57
5634  * cdef inline _ensure_code(arr):
5635  *     if hasattr(arr, "units"):
5636  *         if "code_length" == str(arr.units):             # <<<<<<<<<<<<<<
5637  *             return arr
5638  *         arr.convert_to_units("code_length")
5639  */
5640     }
5641 
5642     /* "yt/utilities/lib/fp_utils.pxd":59
5643  *         if "code_length" == str(arr.units):
5644  *             return arr
5645  *         arr.convert_to_units("code_length")             # <<<<<<<<<<<<<<
5646  *     return arr
5647  */
5648     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_convert_to_units); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 59, __pyx_L1_error)
5649     __Pyx_GOTREF(__pyx_t_3);
5650     __pyx_t_5 = NULL;
5651     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
5652       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
5653       if (likely(__pyx_t_5)) {
5654         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
5655         __Pyx_INCREF(__pyx_t_5);
5656         __Pyx_INCREF(function);
5657         __Pyx_DECREF_SET(__pyx_t_3, function);
5658       }
5659     }
5660     __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);
5661     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
5662     if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 59, __pyx_L1_error)
5663     __Pyx_GOTREF(__pyx_t_4);
5664     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5665     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5666 
5667     /* "yt/utilities/lib/fp_utils.pxd":56
5668  *
5669  * cdef inline _ensure_code(arr):
5670  *     if hasattr(arr, "units"):             # <<<<<<<<<<<<<<
5671  *         if "code_length" == str(arr.units):
5672  *             return arr
5673  */
5674   }
5675 
5676   /* "yt/utilities/lib/fp_utils.pxd":60
5677  *             return arr
5678  *         arr.convert_to_units("code_length")
5679  *     return arr             # <<<<<<<<<<<<<<
5680  */
5681   __Pyx_XDECREF(__pyx_r);
5682   __Pyx_INCREF(__pyx_v_arr);
5683   __pyx_r = __pyx_v_arr;
5684   goto __pyx_L0;
5685 
5686   /* "yt/utilities/lib/fp_utils.pxd":55
5687  *     return i1
5688  *
5689  * cdef inline _ensure_code(arr):             # <<<<<<<<<<<<<<
5690  *     if hasattr(arr, "units"):
5691  *         if "code_length" == str(arr.units):
5692  */
5693 
5694   /* function exit code */
5695   __pyx_L1_error:;
5696   __Pyx_XDECREF(__pyx_t_3);
5697   __Pyx_XDECREF(__pyx_t_4);
5698   __Pyx_XDECREF(__pyx_t_5);
5699   __Pyx_AddTraceback("yt.utilities.lib.fp_utils._ensure_code", __pyx_clineno, __pyx_lineno, __pyx_filename);
5700   __pyx_r = 0;
5701   __pyx_L0:;
5702   __Pyx_XGIVEREF(__pyx_r);
5703   __Pyx_RefNannyFinishContext();
5704   return __pyx_r;
5705 }
5706 
5707 static PyMethodDef __pyx_methods[] = {
5708   {0, 0, 0, 0}
5709 };
5710 
5711 #if PY_MAJOR_VERSION >= 3
5712 #if CYTHON_PEP489_MULTI_PHASE_INIT
5713 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
5714 static int __pyx_pymod_exec_grid_visitors(PyObject* module); /*proto*/
5715 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
5716   {Py_mod_create, (void*)__pyx_pymod_create},
5717   {Py_mod_exec, (void*)__pyx_pymod_exec_grid_visitors},
5718   {0, NULL}
5719 };
5720 #endif
5721 
5722 static struct PyModuleDef __pyx_moduledef = {
5723     PyModuleDef_HEAD_INIT,
5724     "grid_visitors",
5725     __pyx_k_Grid_visitor_functions, /* m_doc */
5726   #if CYTHON_PEP489_MULTI_PHASE_INIT
5727     0, /* m_size */
5728   #else
5729     -1, /* m_size */
5730   #endif
5731     __pyx_methods /* m_methods */,
5732   #if CYTHON_PEP489_MULTI_PHASE_INIT
5733     __pyx_moduledef_slots, /* m_slots */
5734   #else
5735     NULL, /* m_reload */
5736   #endif
5737     NULL, /* m_traverse */
5738     NULL, /* m_clear */
5739     NULL /* m_free */
5740 };
5741 #endif
5742 #ifndef CYTHON_SMALL_CODE
5743 #if defined(__clang__)
5744     #define CYTHON_SMALL_CODE
5745 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
5746     #define CYTHON_SMALL_CODE __attribute__((cold))
5747 #else
5748     #define CYTHON_SMALL_CODE
5749 #endif
5750 #endif
5751 
5752 static __Pyx_StringTabEntry __pyx_string_tab[] = {
5753   {&__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},
5754   {&__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},
5755   {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
5756   {&__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},
5757   {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
5758   {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
5759   {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
5760   {&__pyx_n_s_code_length, __pyx_k_code_length, sizeof(__pyx_k_code_length), 0, 0, 1, 1},
5761   {&__pyx_n_s_convert_to_units, __pyx_k_convert_to_units, sizeof(__pyx_k_convert_to_units), 0, 0, 1, 1},
5762   {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
5763   {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
5764   {&__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},
5765   {&__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},
5766   {&__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},
5767   {&__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},
5768   {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
5769   {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
5770   {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
5771   {&__pyx_n_s_units, __pyx_k_units, sizeof(__pyx_k_units), 0, 0, 1, 1},
5772   {&__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},
5773   {0, 0, 0, 0, 0, 0, 0}
5774 };
__Pyx_InitCachedBuiltins(void)5775 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
5776   __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 25, __pyx_L1_error)
5777   __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 272, __pyx_L1_error)
5778   __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 856, __pyx_L1_error)
5779   __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 1038, __pyx_L1_error)
5780   return 0;
5781   __pyx_L1_error:;
5782   return -1;
5783 }
5784 
__Pyx_InitCachedConstants(void)5785 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
5786   __Pyx_RefNannyDeclarations
5787   __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
5788 
5789   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272
5790  *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
5791  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
5792  *                 raise ValueError(u"ndarray is not C contiguous")             # <<<<<<<<<<<<<<
5793  *
5794  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
5795  */
5796   __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 272, __pyx_L1_error)
5797   __Pyx_GOTREF(__pyx_tuple_);
5798   __Pyx_GIVEREF(__pyx_tuple_);
5799 
5800   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276
5801  *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
5802  *                 and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
5803  *                 raise ValueError(u"ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
5804  *
5805  *             info.buf = PyArray_DATA(self)
5806  */
5807   __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 276, __pyx_L1_error)
5808   __Pyx_GOTREF(__pyx_tuple__2);
5809   __Pyx_GIVEREF(__pyx_tuple__2);
5810 
5811   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":306
5812  *                 if ((descr.byteorder == c'>' and little_endian) or
5813  *                     (descr.byteorder == c'<' and not little_endian)):
5814  *                     raise ValueError(u"Non-native byte order not supported")             # <<<<<<<<<<<<<<
5815  *                 if   t == NPY_BYTE:        f = "b"
5816  *                 elif t == NPY_UBYTE:       f = "B"
5817  */
5818   __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 306, __pyx_L1_error)
5819   __Pyx_GOTREF(__pyx_tuple__3);
5820   __Pyx_GIVEREF(__pyx_tuple__3);
5821 
5822   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856
5823  *
5824  *         if (end - f) - <int>(new_offset - offset[0]) < 15:
5825  *             raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
5826  *
5827  *         if ((child.byteorder == c'>' and little_endian) or
5828  */
5829   __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 856, __pyx_L1_error)
5830   __Pyx_GOTREF(__pyx_tuple__4);
5831   __Pyx_GIVEREF(__pyx_tuple__4);
5832 
5833   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":880
5834  *             t = child.type_num
5835  *             if end - f < 5:
5836  *                 raise RuntimeError(u"Format string allocated too short.")             # <<<<<<<<<<<<<<
5837  *
5838  *             # Until ticket #99 is fixed, use integers to avoid warnings
5839  */
5840   __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 880, __pyx_L1_error)
5841   __Pyx_GOTREF(__pyx_tuple__5);
5842   __Pyx_GIVEREF(__pyx_tuple__5);
5843 
5844   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1038
5845  *         _import_array()
5846  *     except Exception:
5847  *         raise ImportError("numpy.core.multiarray failed to import")             # <<<<<<<<<<<<<<
5848  *
5849  * cdef inline int import_umath() except -1:
5850  */
5851   __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 1038, __pyx_L1_error)
5852   __Pyx_GOTREF(__pyx_tuple__6);
5853   __Pyx_GIVEREF(__pyx_tuple__6);
5854 
5855   /* "../../../.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1044
5856  *         _import_umath()
5857  *     except Exception:
5858  *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
5859  *
5860  * cdef inline int import_ufunc() except -1:
5861  */
5862   __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 1044, __pyx_L1_error)
5863   __Pyx_GOTREF(__pyx_tuple__7);
5864   __Pyx_GIVEREF(__pyx_tuple__7);
5865   __Pyx_RefNannyFinishContext();
5866   return 0;
5867   __pyx_L1_error:;
5868   __Pyx_RefNannyFinishContext();
5869   return -1;
5870 }
5871 
__Pyx_InitGlobals(void)5872 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
5873   if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
5874   return 0;
5875   __pyx_L1_error:;
5876   return -1;
5877 }
5878 
5879 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
5880 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
5881 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
5882 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
5883 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
5884 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
5885 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
5886 
__Pyx_modinit_global_init_code(void)5887 static int __Pyx_modinit_global_init_code(void) {
5888   __Pyx_RefNannyDeclarations
5889   __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
5890   /*--- Global init code ---*/
5891   __Pyx_RefNannyFinishContext();
5892   return 0;
5893 }
5894 
__Pyx_modinit_variable_export_code(void)5895 static int __Pyx_modinit_variable_export_code(void) {
5896   __Pyx_RefNannyDeclarations
5897   __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
5898   /*--- Variable export code ---*/
5899   __Pyx_RefNannyFinishContext();
5900   return 0;
5901 }
5902 
__Pyx_modinit_function_export_code(void)5903 static int __Pyx_modinit_function_export_code(void) {
5904   __Pyx_RefNannyDeclarations
5905   __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
5906   /*--- Function export code ---*/
5907   if (__Pyx_ExportFunction("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)
5908   if (__Pyx_ExportFunction("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)
5909   if (__Pyx_ExportFunction("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)
5910   if (__Pyx_ExportFunction("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)
5911   if (__Pyx_ExportFunction("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)
5912   if (__Pyx_ExportFunction("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)
5913   if (__Pyx_ExportFunction("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)
5914   if (__Pyx_ExportFunction("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)
5915   if (__Pyx_ExportFunction("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)
5916   __Pyx_RefNannyFinishContext();
5917   return 0;
5918   __pyx_L1_error:;
5919   __Pyx_RefNannyFinishContext();
5920   return -1;
5921 }
5922 
__Pyx_modinit_type_init_code(void)5923 static int __Pyx_modinit_type_init_code(void) {
5924   __Pyx_RefNannyDeclarations
5925   __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
5926   /*--- Type init code ---*/
5927   __Pyx_RefNannyFinishContext();
5928   return 0;
5929 }
5930 
__Pyx_modinit_type_import_code(void)5931 static int __Pyx_modinit_type_import_code(void) {
5932   __Pyx_RefNannyDeclarations
5933   PyObject *__pyx_t_1 = NULL;
5934   __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
5935   /*--- Type import code ---*/
5936   __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
5937   __Pyx_GOTREF(__pyx_t_1);
5938   __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
5939   #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
5940   sizeof(PyTypeObject),
5941   #else
5942   sizeof(PyHeapTypeObject),
5943   #endif
5944   __Pyx_ImportType_CheckSize_Warn);
5945    if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
5946   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5947   __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 206, __pyx_L1_error)
5948   __Pyx_GOTREF(__pyx_t_1);
5949   __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
5950    if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 206, __pyx_L1_error)
5951   __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Warn);
5952    if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 229, __pyx_L1_error)
5953   __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Warn);
5954    if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 233, __pyx_L1_error)
5955   __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
5956    if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 242, __pyx_L1_error)
5957   __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Warn);
5958    if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 918, __pyx_L1_error)
5959   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5960   __pyx_t_1 = PyImport_ImportModule("yt.utilities.lib.bitarray"); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 28, __pyx_L1_error)
5961   __Pyx_GOTREF(__pyx_t_1);
5962   __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);
5963    if (!__pyx_ptype_2yt_9utilities_3lib_8bitarray_bitarray) __PYX_ERR(4, 28, __pyx_L1_error)
5964   __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(4, 28, __pyx_L1_error)
5965   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5966   __Pyx_RefNannyFinishContext();
5967   return 0;
5968   __pyx_L1_error:;
5969   __Pyx_XDECREF(__pyx_t_1);
5970   __Pyx_RefNannyFinishContext();
5971   return -1;
5972 }
5973 
__Pyx_modinit_variable_import_code(void)5974 static int __Pyx_modinit_variable_import_code(void) {
5975   __Pyx_RefNannyDeclarations
5976   __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
5977   /*--- Variable import code ---*/
5978   __Pyx_RefNannyFinishContext();
5979   return 0;
5980 }
5981 
__Pyx_modinit_function_import_code(void)5982 static int __Pyx_modinit_function_import_code(void) {
5983   __Pyx_RefNannyDeclarations
5984   __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
5985   /*--- Function import code ---*/
5986   __Pyx_RefNannyFinishContext();
5987   return 0;
5988 }
5989 
5990 
5991 #if PY_MAJOR_VERSION < 3
5992 #ifdef CYTHON_NO_PYINIT_EXPORT
5993 #define __Pyx_PyMODINIT_FUNC void
5994 #else
5995 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
5996 #endif
5997 #else
5998 #ifdef CYTHON_NO_PYINIT_EXPORT
5999 #define __Pyx_PyMODINIT_FUNC PyObject *
6000 #else
6001 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
6002 #endif
6003 #endif
6004 
6005 
6006 #if PY_MAJOR_VERSION < 3
6007 __Pyx_PyMODINIT_FUNC initgrid_visitors(void) CYTHON_SMALL_CODE; /*proto*/
initgrid_visitors(void)6008 __Pyx_PyMODINIT_FUNC initgrid_visitors(void)
6009 #else
6010 __Pyx_PyMODINIT_FUNC PyInit_grid_visitors(void) CYTHON_SMALL_CODE; /*proto*/
6011 __Pyx_PyMODINIT_FUNC PyInit_grid_visitors(void)
6012 #if CYTHON_PEP489_MULTI_PHASE_INIT
6013 {
6014   return PyModuleDef_Init(&__pyx_moduledef);
6015 }
6016 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
6017     #if PY_VERSION_HEX >= 0x030700A1
6018     static PY_INT64_T main_interpreter_id = -1;
6019     PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
6020     if (main_interpreter_id == -1) {
6021         main_interpreter_id = current_id;
6022         return (unlikely(current_id == -1)) ? -1 : 0;
6023     } else if (unlikely(main_interpreter_id != current_id))
6024     #else
6025     static PyInterpreterState *main_interpreter = NULL;
6026     PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
6027     if (!main_interpreter) {
6028         main_interpreter = current_interpreter;
6029     } else if (unlikely(main_interpreter != current_interpreter))
6030     #endif
6031     {
6032         PyErr_SetString(
6033             PyExc_ImportError,
6034             "Interpreter change detected - this module can only be loaded into one interpreter per process.");
6035         return -1;
6036     }
6037     return 0;
6038 }
6039 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) {
6040     PyObject *value = PyObject_GetAttrString(spec, from_name);
6041     int result = 0;
6042     if (likely(value)) {
6043         if (allow_none || value != Py_None) {
6044             result = PyDict_SetItemString(moddict, to_name, value);
6045         }
6046         Py_DECREF(value);
6047     } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
6048         PyErr_Clear();
6049     } else {
6050         result = -1;
6051     }
6052     return result;
6053 }
6054 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
6055     PyObject *module = NULL, *moddict, *modname;
6056     if (__Pyx_check_single_interpreter())
6057         return NULL;
6058     if (__pyx_m)
6059         return __Pyx_NewRef(__pyx_m);
6060     modname = PyObject_GetAttrString(spec, "name");
6061     if (unlikely(!modname)) goto bad;
6062     module = PyModule_NewObject(modname);
6063     Py_DECREF(modname);
6064     if (unlikely(!module)) goto bad;
6065     moddict = PyModule_GetDict(module);
6066     if (unlikely(!moddict)) goto bad;
6067     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
6068     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
6069     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
6070     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
6071     return module;
6072 bad:
6073     Py_XDECREF(module);
6074     return NULL;
6075 }
6076 
6077 
6078 static CYTHON_SMALL_CODE int __pyx_pymod_exec_grid_visitors(PyObject *__pyx_pyinit_module)
6079 #endif
6080 #endif
6081 {
6082   PyObject *__pyx_t_1 = NULL;
6083   __Pyx_RefNannyDeclarations
6084   #if CYTHON_PEP489_MULTI_PHASE_INIT
6085   if (__pyx_m) {
6086     if (__pyx_m == __pyx_pyinit_module) return 0;
6087     PyErr_SetString(PyExc_RuntimeError, "Module 'grid_visitors' has already been imported. Re-initialisation is not supported.");
6088     return -1;
6089   }
6090   #elif PY_MAJOR_VERSION >= 3
6091   if (__pyx_m) return __Pyx_NewRef(__pyx_m);
6092   #endif
6093   #if CYTHON_REFNANNY
6094 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
6095 if (!__Pyx_RefNanny) {
6096   PyErr_Clear();
6097   __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
6098   if (!__Pyx_RefNanny)
6099       Py_FatalError("failed to import 'refnanny' module");
6100 }
6101 #endif
6102   __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_grid_visitors(void)", 0);
6103   if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6104   #ifdef __Pxy_PyFrame_Initialize_Offsets
6105   __Pxy_PyFrame_Initialize_Offsets();
6106   #endif
6107   __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
6108   __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
6109   __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
6110   #ifdef __Pyx_CyFunction_USED
6111   if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6112   #endif
6113   #ifdef __Pyx_FusedFunction_USED
6114   if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6115   #endif
6116   #ifdef __Pyx_Coroutine_USED
6117   if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6118   #endif
6119   #ifdef __Pyx_Generator_USED
6120   if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6121   #endif
6122   #ifdef __Pyx_AsyncGen_USED
6123   if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6124   #endif
6125   #ifdef __Pyx_StopAsyncIteration_USED
6126   if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6127   #endif
6128   /*--- Library function declarations ---*/
6129   /*--- Threads initialization code ---*/
6130   #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
6131   #ifdef WITH_THREAD /* Python build with threading support? */
6132   PyEval_InitThreads();
6133   #endif
6134   #endif
6135   /*--- Module creation code ---*/
6136   #if CYTHON_PEP489_MULTI_PHASE_INIT
6137   __pyx_m = __pyx_pyinit_module;
6138   Py_INCREF(__pyx_m);
6139   #else
6140   #if PY_MAJOR_VERSION < 3
6141   __pyx_m = Py_InitModule4("grid_visitors", __pyx_methods, __pyx_k_Grid_visitor_functions, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
6142   #else
6143   __pyx_m = PyModule_Create(&__pyx_moduledef);
6144   #endif
6145   if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
6146   #endif
6147   __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
6148   Py_INCREF(__pyx_d);
6149   __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
6150   Py_INCREF(__pyx_b);
6151   __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
6152   Py_INCREF(__pyx_cython_runtime);
6153   if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
6154   /*--- Initialize various global constants etc. ---*/
6155   if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6156   #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
6157   if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6158   #endif
6159   if (__pyx_module_is_main_yt__geometry__grid_visitors) {
6160     if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6161   }
6162   #if PY_MAJOR_VERSION >= 3
6163   {
6164     PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
6165     if (!PyDict_GetItemString(modules, "yt.geometry.grid_visitors")) {
6166       if (unlikely(PyDict_SetItemString(modules, "yt.geometry.grid_visitors", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
6167     }
6168   }
6169   #endif
6170   /*--- Builtin init code ---*/
6171   if (__Pyx_InitCachedBuiltins() < 0) goto __pyx_L1_error;
6172   /*--- Constants init code ---*/
6173   if (__Pyx_InitCachedConstants() < 0) goto __pyx_L1_error;
6174   /*--- Global type/function init code ---*/
6175   (void)__Pyx_modinit_global_init_code();
6176   (void)__Pyx_modinit_variable_export_code();
6177   if (unlikely(__Pyx_modinit_function_export_code() != 0)) goto __pyx_L1_error;
6178   (void)__Pyx_modinit_type_init_code();
6179   if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error;
6180   (void)__Pyx_modinit_variable_import_code();
6181   (void)__Pyx_modinit_function_import_code();
6182   /*--- Execution code ---*/
6183   #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
6184   if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6185   #endif
6186 
6187   /* "yt/geometry/grid_visitors.pyx":1
6188  * # distutils: include_dirs = LIB_DIR             # <<<<<<<<<<<<<<
6189  * # distutils: libraries = STD_LIBS
6190  * """
6191  */
6192   __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
6193   __Pyx_GOTREF(__pyx_t_1);
6194   if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6195   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6196 
6197   /* "yt/utilities/lib/fp_utils.pxd":55
6198  *     return i1
6199  *
6200  * cdef inline _ensure_code(arr):             # <<<<<<<<<<<<<<
6201  *     if hasattr(arr, "units"):
6202  *         if "code_length" == str(arr.units):
6203  */
6204 
6205   /*--- Wrapped vars code ---*/
6206 
6207   goto __pyx_L0;
6208   __pyx_L1_error:;
6209   __Pyx_XDECREF(__pyx_t_1);
6210   if (__pyx_m) {
6211     if (__pyx_d) {
6212       __Pyx_AddTraceback("init yt.geometry.grid_visitors", __pyx_clineno, __pyx_lineno, __pyx_filename);
6213     }
6214     Py_CLEAR(__pyx_m);
6215   } else if (!PyErr_Occurred()) {
6216     PyErr_SetString(PyExc_ImportError, "init yt.geometry.grid_visitors");
6217   }
6218   __pyx_L0:;
6219   __Pyx_RefNannyFinishContext();
6220   #if CYTHON_PEP489_MULTI_PHASE_INIT
6221   return (__pyx_m != NULL) ? 0 : -1;
6222   #elif PY_MAJOR_VERSION >= 3
6223   return __pyx_m;
6224   #else
6225   return;
6226   #endif
6227 }
6228 
6229 /* --- Runtime support code --- */
6230 /* Refnanny */
6231 #if CYTHON_REFNANNY
__Pyx_RefNannyImportAPI(const char * modname)6232 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
6233     PyObject *m = NULL, *p = NULL;
6234     void *r = NULL;
6235     m = PyImport_ImportModule(modname);
6236     if (!m) goto end;
6237     p = PyObject_GetAttrString(m, "RefNannyAPI");
6238     if (!p) goto end;
6239     r = PyLong_AsVoidPtr(p);
6240 end:
6241     Py_XDECREF(p);
6242     Py_XDECREF(m);
6243     return (__Pyx_RefNannyAPIStruct *)r;
6244 }
6245 #endif
6246 
6247 /* PyObjectGetAttrStr */
6248 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetAttrStr(PyObject * obj,PyObject * attr_name)6249 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
6250     PyTypeObject* tp = Py_TYPE(obj);
6251     if (likely(tp->tp_getattro))
6252         return tp->tp_getattro(obj, attr_name);
6253 #if PY_MAJOR_VERSION < 3
6254     if (likely(tp->tp_getattr))
6255         return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
6256 #endif
6257     return PyObject_GetAttr(obj, attr_name);
6258 }
6259 #endif
6260 
6261 /* GetBuiltinName */
__Pyx_GetBuiltinName(PyObject * name)6262 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
6263     PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
6264     if (unlikely(!result)) {
6265         PyErr_Format(PyExc_NameError,
6266 #if PY_MAJOR_VERSION >= 3
6267             "name '%U' is not defined", name);
6268 #else
6269             "name '%.200s' is not defined", PyString_AS_STRING(name));
6270 #endif
6271     }
6272     return result;
6273 }
6274 
6275 /* PyObjectCall */
6276 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_Call(PyObject * func,PyObject * arg,PyObject * kw)6277 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
6278     PyObject *result;
6279     ternaryfunc call = func->ob_type->tp_call;
6280     if (unlikely(!call))
6281         return PyObject_Call(func, arg, kw);
6282     if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
6283         return NULL;
6284     result = (*call)(func, arg, kw);
6285     Py_LeaveRecursiveCall();
6286     if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
6287         PyErr_SetString(
6288             PyExc_SystemError,
6289             "NULL result without error in PyObject_Call");
6290     }
6291     return result;
6292 }
6293 #endif
6294 
6295 /* PyErrFetchRestore */
6296 #if CYTHON_FAST_THREAD_STATE
__Pyx_ErrRestoreInState(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)6297 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
6298     PyObject *tmp_type, *tmp_value, *tmp_tb;
6299     tmp_type = tstate->curexc_type;
6300     tmp_value = tstate->curexc_value;
6301     tmp_tb = tstate->curexc_traceback;
6302     tstate->curexc_type = type;
6303     tstate->curexc_value = value;
6304     tstate->curexc_traceback = tb;
6305     Py_XDECREF(tmp_type);
6306     Py_XDECREF(tmp_value);
6307     Py_XDECREF(tmp_tb);
6308 }
__Pyx_ErrFetchInState(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)6309 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
6310     *type = tstate->curexc_type;
6311     *value = tstate->curexc_value;
6312     *tb = tstate->curexc_traceback;
6313     tstate->curexc_type = 0;
6314     tstate->curexc_value = 0;
6315     tstate->curexc_traceback = 0;
6316 }
6317 #endif
6318 
6319 /* RaiseException */
6320 #if PY_MAJOR_VERSION < 3
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,CYTHON_UNUSED PyObject * cause)6321 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
6322                         CYTHON_UNUSED PyObject *cause) {
6323     __Pyx_PyThreadState_declare
6324     Py_XINCREF(type);
6325     if (!value || value == Py_None)
6326         value = NULL;
6327     else
6328         Py_INCREF(value);
6329     if (!tb || tb == Py_None)
6330         tb = NULL;
6331     else {
6332         Py_INCREF(tb);
6333         if (!PyTraceBack_Check(tb)) {
6334             PyErr_SetString(PyExc_TypeError,
6335                 "raise: arg 3 must be a traceback or None");
6336             goto raise_error;
6337         }
6338     }
6339     if (PyType_Check(type)) {
6340 #if CYTHON_COMPILING_IN_PYPY
6341         if (!value) {
6342             Py_INCREF(Py_None);
6343             value = Py_None;
6344         }
6345 #endif
6346         PyErr_NormalizeException(&type, &value, &tb);
6347     } else {
6348         if (value) {
6349             PyErr_SetString(PyExc_TypeError,
6350                 "instance exception may not have a separate value");
6351             goto raise_error;
6352         }
6353         value = type;
6354         type = (PyObject*) Py_TYPE(type);
6355         Py_INCREF(type);
6356         if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
6357             PyErr_SetString(PyExc_TypeError,
6358                 "raise: exception class must be a subclass of BaseException");
6359             goto raise_error;
6360         }
6361     }
6362     __Pyx_PyThreadState_assign
6363     __Pyx_ErrRestore(type, value, tb);
6364     return;
6365 raise_error:
6366     Py_XDECREF(value);
6367     Py_XDECREF(type);
6368     Py_XDECREF(tb);
6369     return;
6370 }
6371 #else
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,PyObject * cause)6372 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
6373     PyObject* owned_instance = NULL;
6374     if (tb == Py_None) {
6375         tb = 0;
6376     } else if (tb && !PyTraceBack_Check(tb)) {
6377         PyErr_SetString(PyExc_TypeError,
6378             "raise: arg 3 must be a traceback or None");
6379         goto bad;
6380     }
6381     if (value == Py_None)
6382         value = 0;
6383     if (PyExceptionInstance_Check(type)) {
6384         if (value) {
6385             PyErr_SetString(PyExc_TypeError,
6386                 "instance exception may not have a separate value");
6387             goto bad;
6388         }
6389         value = type;
6390         type = (PyObject*) Py_TYPE(value);
6391     } else if (PyExceptionClass_Check(type)) {
6392         PyObject *instance_class = NULL;
6393         if (value && PyExceptionInstance_Check(value)) {
6394             instance_class = (PyObject*) Py_TYPE(value);
6395             if (instance_class != type) {
6396                 int is_subclass = PyObject_IsSubclass(instance_class, type);
6397                 if (!is_subclass) {
6398                     instance_class = NULL;
6399                 } else if (unlikely(is_subclass == -1)) {
6400                     goto bad;
6401                 } else {
6402                     type = instance_class;
6403                 }
6404             }
6405         }
6406         if (!instance_class) {
6407             PyObject *args;
6408             if (!value)
6409                 args = PyTuple_New(0);
6410             else if (PyTuple_Check(value)) {
6411                 Py_INCREF(value);
6412                 args = value;
6413             } else
6414                 args = PyTuple_Pack(1, value);
6415             if (!args)
6416                 goto bad;
6417             owned_instance = PyObject_Call(type, args, NULL);
6418             Py_DECREF(args);
6419             if (!owned_instance)
6420                 goto bad;
6421             value = owned_instance;
6422             if (!PyExceptionInstance_Check(value)) {
6423                 PyErr_Format(PyExc_TypeError,
6424                              "calling %R should have returned an instance of "
6425                              "BaseException, not %R",
6426                              type, Py_TYPE(value));
6427                 goto bad;
6428             }
6429         }
6430     } else {
6431         PyErr_SetString(PyExc_TypeError,
6432             "raise: exception class must be a subclass of BaseException");
6433         goto bad;
6434     }
6435     if (cause) {
6436         PyObject *fixed_cause;
6437         if (cause == Py_None) {
6438             fixed_cause = NULL;
6439         } else if (PyExceptionClass_Check(cause)) {
6440             fixed_cause = PyObject_CallObject(cause, NULL);
6441             if (fixed_cause == NULL)
6442                 goto bad;
6443         } else if (PyExceptionInstance_Check(cause)) {
6444             fixed_cause = cause;
6445             Py_INCREF(fixed_cause);
6446         } else {
6447             PyErr_SetString(PyExc_TypeError,
6448                             "exception causes must derive from "
6449                             "BaseException");
6450             goto bad;
6451         }
6452         PyException_SetCause(value, fixed_cause);
6453     }
6454     PyErr_SetObject(type, value);
6455     if (tb) {
6456 #if CYTHON_COMPILING_IN_PYPY
6457         PyObject *tmp_type, *tmp_value, *tmp_tb;
6458         PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
6459         Py_INCREF(tb);
6460         PyErr_Restore(tmp_type, tmp_value, tb);
6461         Py_XDECREF(tmp_tb);
6462 #else
6463         PyThreadState *tstate = __Pyx_PyThreadState_Current;
6464         PyObject* tmp_tb = tstate->curexc_traceback;
6465         if (tb != tmp_tb) {
6466             Py_INCREF(tb);
6467             tstate->curexc_traceback = tb;
6468             Py_XDECREF(tmp_tb);
6469         }
6470 #endif
6471     }
6472 bad:
6473     Py_XDECREF(owned_instance);
6474     return;
6475 }
6476 #endif
6477 
6478 /* PyCFunctionFastCall */
6479 #if CYTHON_FAST_PYCCALL
__Pyx_PyCFunction_FastCall(PyObject * func_obj,PyObject ** args,Py_ssize_t nargs)6480 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
6481     PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
6482     PyCFunction meth = PyCFunction_GET_FUNCTION(func);
6483     PyObject *self = PyCFunction_GET_SELF(func);
6484     int flags = PyCFunction_GET_FLAGS(func);
6485     assert(PyCFunction_Check(func));
6486     assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
6487     assert(nargs >= 0);
6488     assert(nargs == 0 || args != NULL);
6489     /* _PyCFunction_FastCallDict() must not be called with an exception set,
6490        because it may clear it (directly or indirectly) and so the
6491        caller loses its exception */
6492     assert(!PyErr_Occurred());
6493     if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
6494         return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
6495     } else {
6496         return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
6497     }
6498 }
6499 #endif
6500 
6501 /* PyFunctionFastCall */
6502 #if CYTHON_FAST_PYCALL
__Pyx_PyFunction_FastCallNoKw(PyCodeObject * co,PyObject ** args,Py_ssize_t na,PyObject * globals)6503 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
6504                                                PyObject *globals) {
6505     PyFrameObject *f;
6506     PyThreadState *tstate = __Pyx_PyThreadState_Current;
6507     PyObject **fastlocals;
6508     Py_ssize_t i;
6509     PyObject *result;
6510     assert(globals != NULL);
6511     /* XXX Perhaps we should create a specialized
6512        PyFrame_New() that doesn't take locals, but does
6513        take builtins without sanity checking them.
6514        */
6515     assert(tstate != NULL);
6516     f = PyFrame_New(tstate, co, globals, NULL);
6517     if (f == NULL) {
6518         return NULL;
6519     }
6520     fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
6521     for (i = 0; i < na; i++) {
6522         Py_INCREF(*args);
6523         fastlocals[i] = *args++;
6524     }
6525     result = PyEval_EvalFrameEx(f,0);
6526     ++tstate->recursion_depth;
6527     Py_DECREF(f);
6528     --tstate->recursion_depth;
6529     return result;
6530 }
6531 #if 1 || PY_VERSION_HEX < 0x030600B1
__Pyx_PyFunction_FastCallDict(PyObject * func,PyObject ** args,Py_ssize_t nargs,PyObject * kwargs)6532 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
6533     PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
6534     PyObject *globals = PyFunction_GET_GLOBALS(func);
6535     PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
6536     PyObject *closure;
6537 #if PY_MAJOR_VERSION >= 3
6538     PyObject *kwdefs;
6539 #endif
6540     PyObject *kwtuple, **k;
6541     PyObject **d;
6542     Py_ssize_t nd;
6543     Py_ssize_t nk;
6544     PyObject *result;
6545     assert(kwargs == NULL || PyDict_Check(kwargs));
6546     nk = kwargs ? PyDict_Size(kwargs) : 0;
6547     if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
6548         return NULL;
6549     }
6550     if (
6551 #if PY_MAJOR_VERSION >= 3
6552             co->co_kwonlyargcount == 0 &&
6553 #endif
6554             likely(kwargs == NULL || nk == 0) &&
6555             co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
6556         if (argdefs == NULL && co->co_argcount == nargs) {
6557             result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
6558             goto done;
6559         }
6560         else if (nargs == 0 && argdefs != NULL
6561                  && co->co_argcount == Py_SIZE(argdefs)) {
6562             /* function called with no arguments, but all parameters have
6563                a default value: use default values as arguments .*/
6564             args = &PyTuple_GET_ITEM(argdefs, 0);
6565             result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
6566             goto done;
6567         }
6568     }
6569     if (kwargs != NULL) {
6570         Py_ssize_t pos, i;
6571         kwtuple = PyTuple_New(2 * nk);
6572         if (kwtuple == NULL) {
6573             result = NULL;
6574             goto done;
6575         }
6576         k = &PyTuple_GET_ITEM(kwtuple, 0);
6577         pos = i = 0;
6578         while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
6579             Py_INCREF(k[i]);
6580             Py_INCREF(k[i+1]);
6581             i += 2;
6582         }
6583         nk = i / 2;
6584     }
6585     else {
6586         kwtuple = NULL;
6587         k = NULL;
6588     }
6589     closure = PyFunction_GET_CLOSURE(func);
6590 #if PY_MAJOR_VERSION >= 3
6591     kwdefs = PyFunction_GET_KW_DEFAULTS(func);
6592 #endif
6593     if (argdefs != NULL) {
6594         d = &PyTuple_GET_ITEM(argdefs, 0);
6595         nd = Py_SIZE(argdefs);
6596     }
6597     else {
6598         d = NULL;
6599         nd = 0;
6600     }
6601 #if PY_MAJOR_VERSION >= 3
6602     result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
6603                                args, (int)nargs,
6604                                k, (int)nk,
6605                                d, (int)nd, kwdefs, closure);
6606 #else
6607     result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
6608                                args, (int)nargs,
6609                                k, (int)nk,
6610                                d, (int)nd, closure);
6611 #endif
6612     Py_XDECREF(kwtuple);
6613 done:
6614     Py_LeaveRecursiveCall();
6615     return result;
6616 }
6617 #endif
6618 #endif
6619 
6620 /* PyObjectCallMethO */
6621 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_CallMethO(PyObject * func,PyObject * arg)6622 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
6623     PyObject *self, *result;
6624     PyCFunction cfunc;
6625     cfunc = PyCFunction_GET_FUNCTION(func);
6626     self = PyCFunction_GET_SELF(func);
6627     if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
6628         return NULL;
6629     result = cfunc(self, arg);
6630     Py_LeaveRecursiveCall();
6631     if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
6632         PyErr_SetString(
6633             PyExc_SystemError,
6634             "NULL result without error in PyObject_Call");
6635     }
6636     return result;
6637 }
6638 #endif
6639 
6640 /* PyObjectCallOneArg */
6641 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx__PyObject_CallOneArg(PyObject * func,PyObject * arg)6642 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
6643     PyObject *result;
6644     PyObject *args = PyTuple_New(1);
6645     if (unlikely(!args)) return NULL;
6646     Py_INCREF(arg);
6647     PyTuple_SET_ITEM(args, 0, arg);
6648     result = __Pyx_PyObject_Call(func, args, NULL);
6649     Py_DECREF(args);
6650     return result;
6651 }
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)6652 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
6653 #if CYTHON_FAST_PYCALL
6654     if (PyFunction_Check(func)) {
6655         return __Pyx_PyFunction_FastCall(func, &arg, 1);
6656     }
6657 #endif
6658     if (likely(PyCFunction_Check(func))) {
6659         if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
6660             return __Pyx_PyObject_CallMethO(func, arg);
6661 #if CYTHON_FAST_PYCCALL
6662         } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
6663             return __Pyx_PyCFunction_FastCall(func, &arg, 1);
6664 #endif
6665         }
6666     }
6667     return __Pyx__PyObject_CallOneArg(func, arg);
6668 }
6669 #else
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)6670 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
6671     PyObject *result;
6672     PyObject *args = PyTuple_Pack(1, arg);
6673     if (unlikely(!args)) return NULL;
6674     result = __Pyx_PyObject_Call(func, args, NULL);
6675     Py_DECREF(args);
6676     return result;
6677 }
6678 #endif
6679 
6680 /* DictGetItem */
6681 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
__Pyx_PyDict_GetItem(PyObject * d,PyObject * key)6682 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
6683     PyObject *value;
6684     value = PyDict_GetItemWithError(d, key);
6685     if (unlikely(!value)) {
6686         if (!PyErr_Occurred()) {
6687             if (unlikely(PyTuple_Check(key))) {
6688                 PyObject* args = PyTuple_Pack(1, key);
6689                 if (likely(args)) {
6690                     PyErr_SetObject(PyExc_KeyError, args);
6691                     Py_DECREF(args);
6692                 }
6693             } else {
6694                 PyErr_SetObject(PyExc_KeyError, key);
6695             }
6696         }
6697         return NULL;
6698     }
6699     Py_INCREF(value);
6700     return value;
6701 }
6702 #endif
6703 
6704 /* RaiseTooManyValuesToUnpack */
__Pyx_RaiseTooManyValuesError(Py_ssize_t expected)6705 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
6706     PyErr_Format(PyExc_ValueError,
6707                  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
6708 }
6709 
6710 /* RaiseNeedMoreValuesToUnpack */
__Pyx_RaiseNeedMoreValuesError(Py_ssize_t index)6711 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
6712     PyErr_Format(PyExc_ValueError,
6713                  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
6714                  index, (index == 1) ? "" : "s");
6715 }
6716 
6717 /* RaiseNoneIterError */
__Pyx_RaiseNoneNotIterableError(void)6718 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
6719     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
6720 }
6721 
6722 /* ExtTypeTest */
__Pyx_TypeTest(PyObject * obj,PyTypeObject * type)6723 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
6724     if (unlikely(!type)) {
6725         PyErr_SetString(PyExc_SystemError, "Missing type object");
6726         return 0;
6727     }
6728     if (likely(__Pyx_TypeCheck(obj, type)))
6729         return 1;
6730     PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
6731                  Py_TYPE(obj)->tp_name, type->tp_name);
6732     return 0;
6733 }
6734 
6735 /* GetTopmostException */
6736 #if CYTHON_USE_EXC_INFO_STACK
6737 static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState * tstate)6738 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
6739 {
6740     _PyErr_StackItem *exc_info = tstate->exc_info;
6741     while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
6742            exc_info->previous_item != NULL)
6743     {
6744         exc_info = exc_info->previous_item;
6745     }
6746     return exc_info;
6747 }
6748 #endif
6749 
6750 /* SaveResetException */
6751 #if CYTHON_FAST_THREAD_STATE
__Pyx__ExceptionSave(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)6752 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
6753     #if CYTHON_USE_EXC_INFO_STACK
6754     _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
6755     *type = exc_info->exc_type;
6756     *value = exc_info->exc_value;
6757     *tb = exc_info->exc_traceback;
6758     #else
6759     *type = tstate->exc_type;
6760     *value = tstate->exc_value;
6761     *tb = tstate->exc_traceback;
6762     #endif
6763     Py_XINCREF(*type);
6764     Py_XINCREF(*value);
6765     Py_XINCREF(*tb);
6766 }
__Pyx__ExceptionReset(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)6767 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
6768     PyObject *tmp_type, *tmp_value, *tmp_tb;
6769     #if CYTHON_USE_EXC_INFO_STACK
6770     _PyErr_StackItem *exc_info = tstate->exc_info;
6771     tmp_type = exc_info->exc_type;
6772     tmp_value = exc_info->exc_value;
6773     tmp_tb = exc_info->exc_traceback;
6774     exc_info->exc_type = type;
6775     exc_info->exc_value = value;
6776     exc_info->exc_traceback = tb;
6777     #else
6778     tmp_type = tstate->exc_type;
6779     tmp_value = tstate->exc_value;
6780     tmp_tb = tstate->exc_traceback;
6781     tstate->exc_type = type;
6782     tstate->exc_value = value;
6783     tstate->exc_traceback = tb;
6784     #endif
6785     Py_XDECREF(tmp_type);
6786     Py_XDECREF(tmp_value);
6787     Py_XDECREF(tmp_tb);
6788 }
6789 #endif
6790 
6791 /* PyErrExceptionMatches */
6792 #if CYTHON_FAST_THREAD_STATE
__Pyx_PyErr_ExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)6793 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
6794     Py_ssize_t i, n;
6795     n = PyTuple_GET_SIZE(tuple);
6796 #if PY_MAJOR_VERSION >= 3
6797     for (i=0; i<n; i++) {
6798         if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
6799     }
6800 #endif
6801     for (i=0; i<n; i++) {
6802         if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
6803     }
6804     return 0;
6805 }
__Pyx_PyErr_ExceptionMatchesInState(PyThreadState * tstate,PyObject * err)6806 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
6807     PyObject *exc_type = tstate->curexc_type;
6808     if (exc_type == err) return 1;
6809     if (unlikely(!exc_type)) return 0;
6810     if (unlikely(PyTuple_Check(err)))
6811         return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
6812     return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
6813 }
6814 #endif
6815 
6816 /* GetException */
6817 #if CYTHON_FAST_THREAD_STATE
__Pyx__GetException(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)6818 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
6819 #else
6820 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
6821 #endif
6822 {
6823     PyObject *local_type, *local_value, *local_tb;
6824 #if CYTHON_FAST_THREAD_STATE
6825     PyObject *tmp_type, *tmp_value, *tmp_tb;
6826     local_type = tstate->curexc_type;
6827     local_value = tstate->curexc_value;
6828     local_tb = tstate->curexc_traceback;
6829     tstate->curexc_type = 0;
6830     tstate->curexc_value = 0;
6831     tstate->curexc_traceback = 0;
6832 #else
6833     PyErr_Fetch(&local_type, &local_value, &local_tb);
6834 #endif
6835     PyErr_NormalizeException(&local_type, &local_value, &local_tb);
6836 #if CYTHON_FAST_THREAD_STATE
6837     if (unlikely(tstate->curexc_type))
6838 #else
6839     if (unlikely(PyErr_Occurred()))
6840 #endif
6841         goto bad;
6842     #if PY_MAJOR_VERSION >= 3
6843     if (local_tb) {
6844         if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
6845             goto bad;
6846     }
6847     #endif
6848     Py_XINCREF(local_tb);
6849     Py_XINCREF(local_type);
6850     Py_XINCREF(local_value);
6851     *type = local_type;
6852     *value = local_value;
6853     *tb = local_tb;
6854 #if CYTHON_FAST_THREAD_STATE
6855     #if CYTHON_USE_EXC_INFO_STACK
6856     {
6857         _PyErr_StackItem *exc_info = tstate->exc_info;
6858         tmp_type = exc_info->exc_type;
6859         tmp_value = exc_info->exc_value;
6860         tmp_tb = exc_info->exc_traceback;
6861         exc_info->exc_type = local_type;
6862         exc_info->exc_value = local_value;
6863         exc_info->exc_traceback = local_tb;
6864     }
6865     #else
6866     tmp_type = tstate->exc_type;
6867     tmp_value = tstate->exc_value;
6868     tmp_tb = tstate->exc_traceback;
6869     tstate->exc_type = local_type;
6870     tstate->exc_value = local_value;
6871     tstate->exc_traceback = local_tb;
6872     #endif
6873     Py_XDECREF(tmp_type);
6874     Py_XDECREF(tmp_value);
6875     Py_XDECREF(tmp_tb);
6876 #else
6877     PyErr_SetExcInfo(local_type, local_value, local_tb);
6878 #endif
6879     return 0;
6880 bad:
6881     *type = 0;
6882     *value = 0;
6883     *tb = 0;
6884     Py_XDECREF(local_type);
6885     Py_XDECREF(local_value);
6886     Py_XDECREF(local_tb);
6887     return -1;
6888 }
6889 
6890 /* GetAttr */
__Pyx_GetAttr(PyObject * o,PyObject * n)6891 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
6892 #if CYTHON_USE_TYPE_SLOTS
6893 #if PY_MAJOR_VERSION >= 3
6894     if (likely(PyUnicode_Check(n)))
6895 #else
6896     if (likely(PyString_Check(n)))
6897 #endif
6898         return __Pyx_PyObject_GetAttrStr(o, n);
6899 #endif
6900     return PyObject_GetAttr(o, n);
6901 }
6902 
6903 /* HasAttr */
__Pyx_HasAttr(PyObject * o,PyObject * n)6904 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
6905     PyObject *r;
6906     if (unlikely(!__Pyx_PyBaseString_Check(n))) {
6907         PyErr_SetString(PyExc_TypeError,
6908                         "hasattr(): attribute name must be string");
6909         return -1;
6910     }
6911     r = __Pyx_GetAttr(o, n);
6912     if (unlikely(!r)) {
6913         PyErr_Clear();
6914         return 0;
6915     } else {
6916         Py_DECREF(r);
6917         return 1;
6918     }
6919 }
6920 
6921 /* BytesEquals */
__Pyx_PyBytes_Equals(PyObject * s1,PyObject * s2,int equals)6922 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
6923 #if CYTHON_COMPILING_IN_PYPY
6924     return PyObject_RichCompareBool(s1, s2, equals);
6925 #else
6926     if (s1 == s2) {
6927         return (equals == Py_EQ);
6928     } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
6929         const char *ps1, *ps2;
6930         Py_ssize_t length = PyBytes_GET_SIZE(s1);
6931         if (length != PyBytes_GET_SIZE(s2))
6932             return (equals == Py_NE);
6933         ps1 = PyBytes_AS_STRING(s1);
6934         ps2 = PyBytes_AS_STRING(s2);
6935         if (ps1[0] != ps2[0]) {
6936             return (equals == Py_NE);
6937         } else if (length == 1) {
6938             return (equals == Py_EQ);
6939         } else {
6940             int result;
6941 #if CYTHON_USE_UNICODE_INTERNALS
6942             Py_hash_t hash1, hash2;
6943             hash1 = ((PyBytesObject*)s1)->ob_shash;
6944             hash2 = ((PyBytesObject*)s2)->ob_shash;
6945             if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
6946                 return (equals == Py_NE);
6947             }
6948 #endif
6949             result = memcmp(ps1, ps2, (size_t)length);
6950             return (equals == Py_EQ) ? (result == 0) : (result != 0);
6951         }
6952     } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
6953         return (equals == Py_NE);
6954     } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
6955         return (equals == Py_NE);
6956     } else {
6957         int result;
6958         PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
6959         if (!py_result)
6960             return -1;
6961         result = __Pyx_PyObject_IsTrue(py_result);
6962         Py_DECREF(py_result);
6963         return result;
6964     }
6965 #endif
6966 }
6967 
6968 /* UnicodeEquals */
__Pyx_PyUnicode_Equals(PyObject * s1,PyObject * s2,int equals)6969 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
6970 #if CYTHON_COMPILING_IN_PYPY
6971     return PyObject_RichCompareBool(s1, s2, equals);
6972 #else
6973 #if PY_MAJOR_VERSION < 3
6974     PyObject* owned_ref = NULL;
6975 #endif
6976     int s1_is_unicode, s2_is_unicode;
6977     if (s1 == s2) {
6978         goto return_eq;
6979     }
6980     s1_is_unicode = PyUnicode_CheckExact(s1);
6981     s2_is_unicode = PyUnicode_CheckExact(s2);
6982 #if PY_MAJOR_VERSION < 3
6983     if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
6984         owned_ref = PyUnicode_FromObject(s2);
6985         if (unlikely(!owned_ref))
6986             return -1;
6987         s2 = owned_ref;
6988         s2_is_unicode = 1;
6989     } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
6990         owned_ref = PyUnicode_FromObject(s1);
6991         if (unlikely(!owned_ref))
6992             return -1;
6993         s1 = owned_ref;
6994         s1_is_unicode = 1;
6995     } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
6996         return __Pyx_PyBytes_Equals(s1, s2, equals);
6997     }
6998 #endif
6999     if (s1_is_unicode & s2_is_unicode) {
7000         Py_ssize_t length;
7001         int kind;
7002         void *data1, *data2;
7003         if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
7004             return -1;
7005         length = __Pyx_PyUnicode_GET_LENGTH(s1);
7006         if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
7007             goto return_ne;
7008         }
7009 #if CYTHON_USE_UNICODE_INTERNALS
7010         {
7011             Py_hash_t hash1, hash2;
7012         #if CYTHON_PEP393_ENABLED
7013             hash1 = ((PyASCIIObject*)s1)->hash;
7014             hash2 = ((PyASCIIObject*)s2)->hash;
7015         #else
7016             hash1 = ((PyUnicodeObject*)s1)->hash;
7017             hash2 = ((PyUnicodeObject*)s2)->hash;
7018         #endif
7019             if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
7020                 goto return_ne;
7021             }
7022         }
7023 #endif
7024         kind = __Pyx_PyUnicode_KIND(s1);
7025         if (kind != __Pyx_PyUnicode_KIND(s2)) {
7026             goto return_ne;
7027         }
7028         data1 = __Pyx_PyUnicode_DATA(s1);
7029         data2 = __Pyx_PyUnicode_DATA(s2);
7030         if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
7031             goto return_ne;
7032         } else if (length == 1) {
7033             goto return_eq;
7034         } else {
7035             int result = memcmp(data1, data2, (size_t)(length * kind));
7036             #if PY_MAJOR_VERSION < 3
7037             Py_XDECREF(owned_ref);
7038             #endif
7039             return (equals == Py_EQ) ? (result == 0) : (result != 0);
7040         }
7041     } else if ((s1 == Py_None) & s2_is_unicode) {
7042         goto return_ne;
7043     } else if ((s2 == Py_None) & s1_is_unicode) {
7044         goto return_ne;
7045     } else {
7046         int result;
7047         PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
7048         #if PY_MAJOR_VERSION < 3
7049         Py_XDECREF(owned_ref);
7050         #endif
7051         if (!py_result)
7052             return -1;
7053         result = __Pyx_PyObject_IsTrue(py_result);
7054         Py_DECREF(py_result);
7055         return result;
7056     }
7057 return_eq:
7058     #if PY_MAJOR_VERSION < 3
7059     Py_XDECREF(owned_ref);
7060     #endif
7061     return (equals == Py_EQ);
7062 return_ne:
7063     #if PY_MAJOR_VERSION < 3
7064     Py_XDECREF(owned_ref);
7065     #endif
7066     return (equals == Py_NE);
7067 #endif
7068 }
7069 
7070 /* PyObjectCall2Args */
__Pyx_PyObject_Call2Args(PyObject * function,PyObject * arg1,PyObject * arg2)7071 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
7072     PyObject *args, *result = NULL;
7073     #if CYTHON_FAST_PYCALL
7074     if (PyFunction_Check(function)) {
7075         PyObject *args[2] = {arg1, arg2};
7076         return __Pyx_PyFunction_FastCall(function, args, 2);
7077     }
7078     #endif
7079     #if CYTHON_FAST_PYCCALL
7080     if (__Pyx_PyFastCFunction_Check(function)) {
7081         PyObject *args[2] = {arg1, arg2};
7082         return __Pyx_PyCFunction_FastCall(function, args, 2);
7083     }
7084     #endif
7085     args = PyTuple_New(2);
7086     if (unlikely(!args)) goto done;
7087     Py_INCREF(arg1);
7088     PyTuple_SET_ITEM(args, 0, arg1);
7089     Py_INCREF(arg2);
7090     PyTuple_SET_ITEM(args, 1, arg2);
7091     Py_INCREF(function);
7092     result = __Pyx_PyObject_Call(function, args, NULL);
7093     Py_DECREF(args);
7094     Py_DECREF(function);
7095 done:
7096     return result;
7097 }
7098 
7099 /* TypeImport */
7100 #ifndef __PYX_HAVE_RT_ImportType
7101 #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)7102 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
7103     size_t size, enum __Pyx_ImportType_CheckSize check_size)
7104 {
7105     PyObject *result = 0;
7106     char warning[200];
7107     Py_ssize_t basicsize;
7108 #ifdef Py_LIMITED_API
7109     PyObject *py_basicsize;
7110 #endif
7111     result = PyObject_GetAttrString(module, class_name);
7112     if (!result)
7113         goto bad;
7114     if (!PyType_Check(result)) {
7115         PyErr_Format(PyExc_TypeError,
7116             "%.200s.%.200s is not a type object",
7117             module_name, class_name);
7118         goto bad;
7119     }
7120 #ifndef Py_LIMITED_API
7121     basicsize = ((PyTypeObject *)result)->tp_basicsize;
7122 #else
7123     py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
7124     if (!py_basicsize)
7125         goto bad;
7126     basicsize = PyLong_AsSsize_t(py_basicsize);
7127     Py_DECREF(py_basicsize);
7128     py_basicsize = 0;
7129     if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
7130         goto bad;
7131 #endif
7132     if ((size_t)basicsize < size) {
7133         PyErr_Format(PyExc_ValueError,
7134             "%.200s.%.200s size changed, may indicate binary incompatibility. "
7135             "Expected %zd from C header, got %zd from PyObject",
7136             module_name, class_name, size, basicsize);
7137         goto bad;
7138     }
7139     if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
7140         PyErr_Format(PyExc_ValueError,
7141             "%.200s.%.200s size changed, may indicate binary incompatibility. "
7142             "Expected %zd from C header, got %zd from PyObject",
7143             module_name, class_name, size, basicsize);
7144         goto bad;
7145     }
7146     else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
7147         PyOS_snprintf(warning, sizeof(warning),
7148             "%s.%s size changed, may indicate binary incompatibility. "
7149             "Expected %zd from C header, got %zd from PyObject",
7150             module_name, class_name, size, basicsize);
7151         if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
7152     }
7153     return (PyTypeObject *)result;
7154 bad:
7155     Py_XDECREF(result);
7156     return NULL;
7157 }
7158 #endif
7159 
7160 /* GetVTable */
__Pyx_GetVtable(PyObject * dict)7161 static void* __Pyx_GetVtable(PyObject *dict) {
7162     void* ptr;
7163     PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable);
7164     if (!ob)
7165         goto bad;
7166 #if PY_VERSION_HEX >= 0x02070000
7167     ptr = PyCapsule_GetPointer(ob, 0);
7168 #else
7169     ptr = PyCObject_AsVoidPtr(ob);
7170 #endif
7171     if (!ptr && !PyErr_Occurred())
7172         PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
7173     Py_DECREF(ob);
7174     return ptr;
7175 bad:
7176     Py_XDECREF(ob);
7177     return NULL;
7178 }
7179 
7180 /* PyDictVersioning */
7181 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
__Pyx_get_tp_dict_version(PyObject * obj)7182 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
7183     PyObject *dict = Py_TYPE(obj)->tp_dict;
7184     return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
7185 }
__Pyx_get_object_dict_version(PyObject * obj)7186 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
7187     PyObject **dictptr = NULL;
7188     Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
7189     if (offset) {
7190 #if CYTHON_COMPILING_IN_CPYTHON
7191         dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
7192 #else
7193         dictptr = _PyObject_GetDictPtr(obj);
7194 #endif
7195     }
7196     return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
7197 }
__Pyx_object_dict_version_matches(PyObject * obj,PY_UINT64_T tp_dict_version,PY_UINT64_T obj_dict_version)7198 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
7199     PyObject *dict = Py_TYPE(obj)->tp_dict;
7200     if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
7201         return 0;
7202     return obj_dict_version == __Pyx_get_object_dict_version(obj);
7203 }
7204 #endif
7205 
7206 /* CLineInTraceback */
7207 #ifndef CYTHON_CLINE_IN_TRACEBACK
__Pyx_CLineForTraceback(PyThreadState * tstate,int c_line)7208 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
7209     PyObject *use_cline;
7210     PyObject *ptype, *pvalue, *ptraceback;
7211 #if CYTHON_COMPILING_IN_CPYTHON
7212     PyObject **cython_runtime_dict;
7213 #endif
7214     if (unlikely(!__pyx_cython_runtime)) {
7215         return c_line;
7216     }
7217     __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
7218 #if CYTHON_COMPILING_IN_CPYTHON
7219     cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
7220     if (likely(cython_runtime_dict)) {
7221         __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
7222             use_cline, *cython_runtime_dict,
7223             __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
7224     } else
7225 #endif
7226     {
7227       PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
7228       if (use_cline_obj) {
7229         use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
7230         Py_DECREF(use_cline_obj);
7231       } else {
7232         PyErr_Clear();
7233         use_cline = NULL;
7234       }
7235     }
7236     if (!use_cline) {
7237         c_line = 0;
7238         PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
7239     }
7240     else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
7241         c_line = 0;
7242     }
7243     __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
7244     return c_line;
7245 }
7246 #endif
7247 
7248 /* CodeObjectCache */
__pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry * entries,int count,int code_line)7249 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
7250     int start = 0, mid = 0, end = count - 1;
7251     if (end >= 0 && code_line > entries[end].code_line) {
7252         return count;
7253     }
7254     while (start < end) {
7255         mid = start + (end - start) / 2;
7256         if (code_line < entries[mid].code_line) {
7257             end = mid;
7258         } else if (code_line > entries[mid].code_line) {
7259              start = mid + 1;
7260         } else {
7261             return mid;
7262         }
7263     }
7264     if (code_line <= entries[mid].code_line) {
7265         return mid;
7266     } else {
7267         return mid + 1;
7268     }
7269 }
__pyx_find_code_object(int code_line)7270 static PyCodeObject *__pyx_find_code_object(int code_line) {
7271     PyCodeObject* code_object;
7272     int pos;
7273     if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
7274         return NULL;
7275     }
7276     pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
7277     if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
7278         return NULL;
7279     }
7280     code_object = __pyx_code_cache.entries[pos].code_object;
7281     Py_INCREF(code_object);
7282     return code_object;
7283 }
__pyx_insert_code_object(int code_line,PyCodeObject * code_object)7284 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
7285     int pos, i;
7286     __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
7287     if (unlikely(!code_line)) {
7288         return;
7289     }
7290     if (unlikely(!entries)) {
7291         entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
7292         if (likely(entries)) {
7293             __pyx_code_cache.entries = entries;
7294             __pyx_code_cache.max_count = 64;
7295             __pyx_code_cache.count = 1;
7296             entries[0].code_line = code_line;
7297             entries[0].code_object = code_object;
7298             Py_INCREF(code_object);
7299         }
7300         return;
7301     }
7302     pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
7303     if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
7304         PyCodeObject* tmp = entries[pos].code_object;
7305         entries[pos].code_object = code_object;
7306         Py_DECREF(tmp);
7307         return;
7308     }
7309     if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
7310         int new_max = __pyx_code_cache.max_count + 64;
7311         entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
7312             __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
7313         if (unlikely(!entries)) {
7314             return;
7315         }
7316         __pyx_code_cache.entries = entries;
7317         __pyx_code_cache.max_count = new_max;
7318     }
7319     for (i=__pyx_code_cache.count; i>pos; i--) {
7320         entries[i] = entries[i-1];
7321     }
7322     entries[pos].code_line = code_line;
7323     entries[pos].code_object = code_object;
7324     __pyx_code_cache.count++;
7325     Py_INCREF(code_object);
7326 }
7327 
7328 /* AddTraceback */
7329 #include "compile.h"
7330 #include "frameobject.h"
7331 #include "traceback.h"
__Pyx_CreateCodeObjectForTraceback(const char * funcname,int c_line,int py_line,const char * filename)7332 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
7333             const char *funcname, int c_line,
7334             int py_line, const char *filename) {
7335     PyCodeObject *py_code = 0;
7336     PyObject *py_srcfile = 0;
7337     PyObject *py_funcname = 0;
7338     #if PY_MAJOR_VERSION < 3
7339     py_srcfile = PyString_FromString(filename);
7340     #else
7341     py_srcfile = PyUnicode_FromString(filename);
7342     #endif
7343     if (!py_srcfile) goto bad;
7344     if (c_line) {
7345         #if PY_MAJOR_VERSION < 3
7346         py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
7347         #else
7348         py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
7349         #endif
7350     }
7351     else {
7352         #if PY_MAJOR_VERSION < 3
7353         py_funcname = PyString_FromString(funcname);
7354         #else
7355         py_funcname = PyUnicode_FromString(funcname);
7356         #endif
7357     }
7358     if (!py_funcname) goto bad;
7359     py_code = __Pyx_PyCode_New(
7360         0,
7361         0,
7362         0,
7363         0,
7364         0,
7365         __pyx_empty_bytes, /*PyObject *code,*/
7366         __pyx_empty_tuple, /*PyObject *consts,*/
7367         __pyx_empty_tuple, /*PyObject *names,*/
7368         __pyx_empty_tuple, /*PyObject *varnames,*/
7369         __pyx_empty_tuple, /*PyObject *freevars,*/
7370         __pyx_empty_tuple, /*PyObject *cellvars,*/
7371         py_srcfile,   /*PyObject *filename,*/
7372         py_funcname,  /*PyObject *name,*/
7373         py_line,
7374         __pyx_empty_bytes  /*PyObject *lnotab*/
7375     );
7376     Py_DECREF(py_srcfile);
7377     Py_DECREF(py_funcname);
7378     return py_code;
7379 bad:
7380     Py_XDECREF(py_srcfile);
7381     Py_XDECREF(py_funcname);
7382     return NULL;
7383 }
__Pyx_AddTraceback(const char * funcname,int c_line,int py_line,const char * filename)7384 static void __Pyx_AddTraceback(const char *funcname, int c_line,
7385                                int py_line, const char *filename) {
7386     PyCodeObject *py_code = 0;
7387     PyFrameObject *py_frame = 0;
7388     PyThreadState *tstate = __Pyx_PyThreadState_Current;
7389     if (c_line) {
7390         c_line = __Pyx_CLineForTraceback(tstate, c_line);
7391     }
7392     py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
7393     if (!py_code) {
7394         py_code = __Pyx_CreateCodeObjectForTraceback(
7395             funcname, c_line, py_line, filename);
7396         if (!py_code) goto bad;
7397         __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
7398     }
7399     py_frame = PyFrame_New(
7400         tstate,            /*PyThreadState *tstate,*/
7401         py_code,           /*PyCodeObject *code,*/
7402         __pyx_d,    /*PyObject *globals,*/
7403         0                  /*PyObject *locals*/
7404     );
7405     if (!py_frame) goto bad;
7406     __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
7407     PyTraceBack_Here(py_frame);
7408 bad:
7409     Py_XDECREF(py_code);
7410     Py_XDECREF(py_frame);
7411 }
7412 
7413 /* CIntToPy */
__Pyx_PyInt_From_int(int value)7414 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
7415     const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
7416     const int is_unsigned = neg_one > const_zero;
7417     if (is_unsigned) {
7418         if (sizeof(int) < sizeof(long)) {
7419             return PyInt_FromLong((long) value);
7420         } else if (sizeof(int) <= sizeof(unsigned long)) {
7421             return PyLong_FromUnsignedLong((unsigned long) value);
7422 #ifdef HAVE_LONG_LONG
7423         } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
7424             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
7425 #endif
7426         }
7427     } else {
7428         if (sizeof(int) <= sizeof(long)) {
7429             return PyInt_FromLong((long) value);
7430 #ifdef HAVE_LONG_LONG
7431         } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
7432             return PyLong_FromLongLong((PY_LONG_LONG) value);
7433 #endif
7434         }
7435     }
7436     {
7437         int one = 1; int little = (int)*(unsigned char *)&one;
7438         unsigned char *bytes = (unsigned char *)&value;
7439         return _PyLong_FromByteArray(bytes, sizeof(int),
7440                                      little, !is_unsigned);
7441     }
7442 }
7443 
7444 /* CIntFromPyVerify */
7445 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
7446     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
7447 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
7448     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
7449 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
7450     {\
7451         func_type value = func_value;\
7452         if (sizeof(target_type) < sizeof(func_type)) {\
7453             if (unlikely(value != (func_type) (target_type) value)) {\
7454                 func_type zero = 0;\
7455                 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
7456                     return (target_type) -1;\
7457                 if (is_unsigned && unlikely(value < zero))\
7458                     goto raise_neg_overflow;\
7459                 else\
7460                     goto raise_overflow;\
7461             }\
7462         }\
7463         return (target_type) value;\
7464     }
7465 
7466 /* CIntToPy */
__Pyx_PyInt_From_npy_int32(npy_int32 value)7467 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value) {
7468     const npy_int32 neg_one = (npy_int32) ((npy_int32) 0 - (npy_int32) 1), const_zero = (npy_int32) 0;
7469     const int is_unsigned = neg_one > const_zero;
7470     if (is_unsigned) {
7471         if (sizeof(npy_int32) < sizeof(long)) {
7472             return PyInt_FromLong((long) value);
7473         } else if (sizeof(npy_int32) <= sizeof(unsigned long)) {
7474             return PyLong_FromUnsignedLong((unsigned long) value);
7475 #ifdef HAVE_LONG_LONG
7476         } else if (sizeof(npy_int32) <= sizeof(unsigned PY_LONG_LONG)) {
7477             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
7478 #endif
7479         }
7480     } else {
7481         if (sizeof(npy_int32) <= sizeof(long)) {
7482             return PyInt_FromLong((long) value);
7483 #ifdef HAVE_LONG_LONG
7484         } else if (sizeof(npy_int32) <= sizeof(PY_LONG_LONG)) {
7485             return PyLong_FromLongLong((PY_LONG_LONG) value);
7486 #endif
7487         }
7488     }
7489     {
7490         int one = 1; int little = (int)*(unsigned char *)&one;
7491         unsigned char *bytes = (unsigned char *)&value;
7492         return _PyLong_FromByteArray(bytes, sizeof(npy_int32),
7493                                      little, !is_unsigned);
7494     }
7495 }
7496 
7497 /* Declarations */
7498 #if CYTHON_CCOMPLEX
7499   #ifdef __cplusplus
__pyx_t_float_complex_from_parts(float x,float y)7500     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
7501       return ::std::complex< float >(x, y);
7502     }
7503   #else
__pyx_t_float_complex_from_parts(float x,float y)7504     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
7505       return x + y*(__pyx_t_float_complex)_Complex_I;
7506     }
7507   #endif
7508 #else
__pyx_t_float_complex_from_parts(float x,float y)7509     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
7510       __pyx_t_float_complex z;
7511       z.real = x;
7512       z.imag = y;
7513       return z;
7514     }
7515 #endif
7516 
7517 /* Arithmetic */
7518 #if CYTHON_CCOMPLEX
7519 #else
__Pyx_c_eq_float(__pyx_t_float_complex a,__pyx_t_float_complex b)7520     static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
7521        return (a.real == b.real) && (a.imag == b.imag);
7522     }
__Pyx_c_sum_float(__pyx_t_float_complex a,__pyx_t_float_complex b)7523     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
7524         __pyx_t_float_complex z;
7525         z.real = a.real + b.real;
7526         z.imag = a.imag + b.imag;
7527         return z;
7528     }
__Pyx_c_diff_float(__pyx_t_float_complex a,__pyx_t_float_complex b)7529     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
7530         __pyx_t_float_complex z;
7531         z.real = a.real - b.real;
7532         z.imag = a.imag - b.imag;
7533         return z;
7534     }
__Pyx_c_prod_float(__pyx_t_float_complex a,__pyx_t_float_complex b)7535     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
7536         __pyx_t_float_complex z;
7537         z.real = a.real * b.real - a.imag * b.imag;
7538         z.imag = a.real * b.imag + a.imag * b.real;
7539         return z;
7540     }
7541     #if 1
__Pyx_c_quot_float(__pyx_t_float_complex a,__pyx_t_float_complex b)7542     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
7543         if (b.imag == 0) {
7544             return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
7545         } else if (fabsf(b.real) >= fabsf(b.imag)) {
7546             if (b.real == 0 && b.imag == 0) {
7547                 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
7548             } else {
7549                 float r = b.imag / b.real;
7550                 float s = (float)(1.0) / (b.real + b.imag * r);
7551                 return __pyx_t_float_complex_from_parts(
7552                     (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
7553             }
7554         } else {
7555             float r = b.real / b.imag;
7556             float s = (float)(1.0) / (b.imag + b.real * r);
7557             return __pyx_t_float_complex_from_parts(
7558                 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
7559         }
7560     }
7561     #else
__Pyx_c_quot_float(__pyx_t_float_complex a,__pyx_t_float_complex b)7562     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
7563         if (b.imag == 0) {
7564             return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
7565         } else {
7566             float denom = b.real * b.real + b.imag * b.imag;
7567             return __pyx_t_float_complex_from_parts(
7568                 (a.real * b.real + a.imag * b.imag) / denom,
7569                 (a.imag * b.real - a.real * b.imag) / denom);
7570         }
7571     }
7572     #endif
__Pyx_c_neg_float(__pyx_t_float_complex a)7573     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
7574         __pyx_t_float_complex z;
7575         z.real = -a.real;
7576         z.imag = -a.imag;
7577         return z;
7578     }
__Pyx_c_is_zero_float(__pyx_t_float_complex a)7579     static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
7580        return (a.real == 0) && (a.imag == 0);
7581     }
__Pyx_c_conj_float(__pyx_t_float_complex a)7582     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
7583         __pyx_t_float_complex z;
7584         z.real =  a.real;
7585         z.imag = -a.imag;
7586         return z;
7587     }
7588     #if 1
__Pyx_c_abs_float(__pyx_t_float_complex z)7589         static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
7590           #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
7591             return sqrtf(z.real*z.real + z.imag*z.imag);
7592           #else
7593             return hypotf(z.real, z.imag);
7594           #endif
7595         }
__Pyx_c_pow_float(__pyx_t_float_complex a,__pyx_t_float_complex b)7596         static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
7597             __pyx_t_float_complex z;
7598             float r, lnr, theta, z_r, z_theta;
7599             if (b.imag == 0 && b.real == (int)b.real) {
7600                 if (b.real < 0) {
7601                     float denom = a.real * a.real + a.imag * a.imag;
7602                     a.real = a.real / denom;
7603                     a.imag = -a.imag / denom;
7604                     b.real = -b.real;
7605                 }
7606                 switch ((int)b.real) {
7607                     case 0:
7608                         z.real = 1;
7609                         z.imag = 0;
7610                         return z;
7611                     case 1:
7612                         return a;
7613                     case 2:
7614                         z = __Pyx_c_prod_float(a, a);
7615                         return __Pyx_c_prod_float(a, a);
7616                     case 3:
7617                         z = __Pyx_c_prod_float(a, a);
7618                         return __Pyx_c_prod_float(z, a);
7619                     case 4:
7620                         z = __Pyx_c_prod_float(a, a);
7621                         return __Pyx_c_prod_float(z, z);
7622                 }
7623             }
7624             if (a.imag == 0) {
7625                 if (a.real == 0) {
7626                     return a;
7627                 } else if (b.imag == 0) {
7628                     z.real = powf(a.real, b.real);
7629                     z.imag = 0;
7630                     return z;
7631                 } else if (a.real > 0) {
7632                     r = a.real;
7633                     theta = 0;
7634                 } else {
7635                     r = -a.real;
7636                     theta = atan2f(0.0, -1.0);
7637                 }
7638             } else {
7639                 r = __Pyx_c_abs_float(a);
7640                 theta = atan2f(a.imag, a.real);
7641             }
7642             lnr = logf(r);
7643             z_r = expf(lnr * b.real - theta * b.imag);
7644             z_theta = theta * b.real + lnr * b.imag;
7645             z.real = z_r * cosf(z_theta);
7646             z.imag = z_r * sinf(z_theta);
7647             return z;
7648         }
7649     #endif
7650 #endif
7651 
7652 /* Declarations */
7653 #if CYTHON_CCOMPLEX
7654   #ifdef __cplusplus
__pyx_t_double_complex_from_parts(double x,double y)7655     static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
7656       return ::std::complex< double >(x, y);
7657     }
7658   #else
__pyx_t_double_complex_from_parts(double x,double y)7659     static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
7660       return x + y*(__pyx_t_double_complex)_Complex_I;
7661     }
7662   #endif
7663 #else
__pyx_t_double_complex_from_parts(double x,double y)7664     static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
7665       __pyx_t_double_complex z;
7666       z.real = x;
7667       z.imag = y;
7668       return z;
7669     }
7670 #endif
7671 
7672 /* Arithmetic */
7673 #if CYTHON_CCOMPLEX
7674 #else
__Pyx_c_eq_double(__pyx_t_double_complex a,__pyx_t_double_complex b)7675     static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
7676        return (a.real == b.real) && (a.imag == b.imag);
7677     }
__Pyx_c_sum_double(__pyx_t_double_complex a,__pyx_t_double_complex b)7678     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
7679         __pyx_t_double_complex z;
7680         z.real = a.real + b.real;
7681         z.imag = a.imag + b.imag;
7682         return z;
7683     }
__Pyx_c_diff_double(__pyx_t_double_complex a,__pyx_t_double_complex b)7684     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
7685         __pyx_t_double_complex z;
7686         z.real = a.real - b.real;
7687         z.imag = a.imag - b.imag;
7688         return z;
7689     }
__Pyx_c_prod_double(__pyx_t_double_complex a,__pyx_t_double_complex b)7690     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
7691         __pyx_t_double_complex z;
7692         z.real = a.real * b.real - a.imag * b.imag;
7693         z.imag = a.real * b.imag + a.imag * b.real;
7694         return z;
7695     }
7696     #if 1
__Pyx_c_quot_double(__pyx_t_double_complex a,__pyx_t_double_complex b)7697     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
7698         if (b.imag == 0) {
7699             return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
7700         } else if (fabs(b.real) >= fabs(b.imag)) {
7701             if (b.real == 0 && b.imag == 0) {
7702                 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
7703             } else {
7704                 double r = b.imag / b.real;
7705                 double s = (double)(1.0) / (b.real + b.imag * r);
7706                 return __pyx_t_double_complex_from_parts(
7707                     (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
7708             }
7709         } else {
7710             double r = b.real / b.imag;
7711             double s = (double)(1.0) / (b.imag + b.real * r);
7712             return __pyx_t_double_complex_from_parts(
7713                 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
7714         }
7715     }
7716     #else
__Pyx_c_quot_double(__pyx_t_double_complex a,__pyx_t_double_complex b)7717     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
7718         if (b.imag == 0) {
7719             return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
7720         } else {
7721             double denom = b.real * b.real + b.imag * b.imag;
7722             return __pyx_t_double_complex_from_parts(
7723                 (a.real * b.real + a.imag * b.imag) / denom,
7724                 (a.imag * b.real - a.real * b.imag) / denom);
7725         }
7726     }
7727     #endif
__Pyx_c_neg_double(__pyx_t_double_complex a)7728     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
7729         __pyx_t_double_complex z;
7730         z.real = -a.real;
7731         z.imag = -a.imag;
7732         return z;
7733     }
__Pyx_c_is_zero_double(__pyx_t_double_complex a)7734     static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
7735        return (a.real == 0) && (a.imag == 0);
7736     }
__Pyx_c_conj_double(__pyx_t_double_complex a)7737     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
7738         __pyx_t_double_complex z;
7739         z.real =  a.real;
7740         z.imag = -a.imag;
7741         return z;
7742     }
7743     #if 1
__Pyx_c_abs_double(__pyx_t_double_complex z)7744         static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
7745           #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
7746             return sqrt(z.real*z.real + z.imag*z.imag);
7747           #else
7748             return hypot(z.real, z.imag);
7749           #endif
7750         }
__Pyx_c_pow_double(__pyx_t_double_complex a,__pyx_t_double_complex b)7751         static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
7752             __pyx_t_double_complex z;
7753             double r, lnr, theta, z_r, z_theta;
7754             if (b.imag == 0 && b.real == (int)b.real) {
7755                 if (b.real < 0) {
7756                     double denom = a.real * a.real + a.imag * a.imag;
7757                     a.real = a.real / denom;
7758                     a.imag = -a.imag / denom;
7759                     b.real = -b.real;
7760                 }
7761                 switch ((int)b.real) {
7762                     case 0:
7763                         z.real = 1;
7764                         z.imag = 0;
7765                         return z;
7766                     case 1:
7767                         return a;
7768                     case 2:
7769                         z = __Pyx_c_prod_double(a, a);
7770                         return __Pyx_c_prod_double(a, a);
7771                     case 3:
7772                         z = __Pyx_c_prod_double(a, a);
7773                         return __Pyx_c_prod_double(z, a);
7774                     case 4:
7775                         z = __Pyx_c_prod_double(a, a);
7776                         return __Pyx_c_prod_double(z, z);
7777                 }
7778             }
7779             if (a.imag == 0) {
7780                 if (a.real == 0) {
7781                     return a;
7782                 } else if (b.imag == 0) {
7783                     z.real = pow(a.real, b.real);
7784                     z.imag = 0;
7785                     return z;
7786                 } else if (a.real > 0) {
7787                     r = a.real;
7788                     theta = 0;
7789                 } else {
7790                     r = -a.real;
7791                     theta = atan2(0.0, -1.0);
7792                 }
7793             } else {
7794                 r = __Pyx_c_abs_double(a);
7795                 theta = atan2(a.imag, a.real);
7796             }
7797             lnr = log(r);
7798             z_r = exp(lnr * b.real - theta * b.imag);
7799             z_theta = theta * b.real + lnr * b.imag;
7800             z.real = z_r * cos(z_theta);
7801             z.imag = z_r * sin(z_theta);
7802             return z;
7803         }
7804     #endif
7805 #endif
7806 
7807 /* CIntToPy */
__Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value)7808 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) {
7809     const enum NPY_TYPES neg_one = (enum NPY_TYPES) ((enum NPY_TYPES) 0 - (enum NPY_TYPES) 1), const_zero = (enum NPY_TYPES) 0;
7810     const int is_unsigned = neg_one > const_zero;
7811     if (is_unsigned) {
7812         if (sizeof(enum NPY_TYPES) < sizeof(long)) {
7813             return PyInt_FromLong((long) value);
7814         } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) {
7815             return PyLong_FromUnsignedLong((unsigned long) value);
7816 #ifdef HAVE_LONG_LONG
7817         } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) {
7818             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
7819 #endif
7820         }
7821     } else {
7822         if (sizeof(enum NPY_TYPES) <= sizeof(long)) {
7823             return PyInt_FromLong((long) value);
7824 #ifdef HAVE_LONG_LONG
7825         } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) {
7826             return PyLong_FromLongLong((PY_LONG_LONG) value);
7827 #endif
7828         }
7829     }
7830     {
7831         int one = 1; int little = (int)*(unsigned char *)&one;
7832         unsigned char *bytes = (unsigned char *)&value;
7833         return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES),
7834                                      little, !is_unsigned);
7835     }
7836 }
7837 
7838 /* CIntFromPy */
__Pyx_PyInt_As_int(PyObject * x)7839 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
7840     const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
7841     const int is_unsigned = neg_one > const_zero;
7842 #if PY_MAJOR_VERSION < 3
7843     if (likely(PyInt_Check(x))) {
7844         if (sizeof(int) < sizeof(long)) {
7845             __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
7846         } else {
7847             long val = PyInt_AS_LONG(x);
7848             if (is_unsigned && unlikely(val < 0)) {
7849                 goto raise_neg_overflow;
7850             }
7851             return (int) val;
7852         }
7853     } else
7854 #endif
7855     if (likely(PyLong_Check(x))) {
7856         if (is_unsigned) {
7857 #if CYTHON_USE_PYLONG_INTERNALS
7858             const digit* digits = ((PyLongObject*)x)->ob_digit;
7859             switch (Py_SIZE(x)) {
7860                 case  0: return (int) 0;
7861                 case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
7862                 case 2:
7863                     if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
7864                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
7865                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
7866                         } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
7867                             return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
7868                         }
7869                     }
7870                     break;
7871                 case 3:
7872                     if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
7873                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
7874                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
7875                         } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
7876                             return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
7877                         }
7878                     }
7879                     break;
7880                 case 4:
7881                     if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
7882                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
7883                             __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])))
7884                         } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
7885                             return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
7886                         }
7887                     }
7888                     break;
7889             }
7890 #endif
7891 #if CYTHON_COMPILING_IN_CPYTHON
7892             if (unlikely(Py_SIZE(x) < 0)) {
7893                 goto raise_neg_overflow;
7894             }
7895 #else
7896             {
7897                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
7898                 if (unlikely(result < 0))
7899                     return (int) -1;
7900                 if (unlikely(result == 1))
7901                     goto raise_neg_overflow;
7902             }
7903 #endif
7904             if (sizeof(int) <= sizeof(unsigned long)) {
7905                 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
7906 #ifdef HAVE_LONG_LONG
7907             } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
7908                 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
7909 #endif
7910             }
7911         } else {
7912 #if CYTHON_USE_PYLONG_INTERNALS
7913             const digit* digits = ((PyLongObject*)x)->ob_digit;
7914             switch (Py_SIZE(x)) {
7915                 case  0: return (int) 0;
7916                 case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
7917                 case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
7918                 case -2:
7919                     if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
7920                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
7921                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
7922                         } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
7923                             return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
7924                         }
7925                     }
7926                     break;
7927                 case 2:
7928                     if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
7929                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
7930                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
7931                         } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
7932                             return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
7933                         }
7934                     }
7935                     break;
7936                 case -3:
7937                     if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
7938                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
7939                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
7940                         } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
7941                             return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
7942                         }
7943                     }
7944                     break;
7945                 case 3:
7946                     if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
7947                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
7948                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
7949                         } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
7950                             return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
7951                         }
7952                     }
7953                     break;
7954                 case -4:
7955                     if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
7956                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
7957                             __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])))
7958                         } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
7959                             return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
7960                         }
7961                     }
7962                     break;
7963                 case 4:
7964                     if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
7965                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
7966                             __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])))
7967                         } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
7968                             return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
7969                         }
7970                     }
7971                     break;
7972             }
7973 #endif
7974             if (sizeof(int) <= sizeof(long)) {
7975                 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
7976 #ifdef HAVE_LONG_LONG
7977             } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
7978                 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
7979 #endif
7980             }
7981         }
7982         {
7983 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
7984             PyErr_SetString(PyExc_RuntimeError,
7985                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
7986 #else
7987             int val;
7988             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
7989  #if PY_MAJOR_VERSION < 3
7990             if (likely(v) && !PyLong_Check(v)) {
7991                 PyObject *tmp = v;
7992                 v = PyNumber_Long(tmp);
7993                 Py_DECREF(tmp);
7994             }
7995  #endif
7996             if (likely(v)) {
7997                 int one = 1; int is_little = (int)*(unsigned char *)&one;
7998                 unsigned char *bytes = (unsigned char *)&val;
7999                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
8000                                               bytes, sizeof(val),
8001                                               is_little, !is_unsigned);
8002                 Py_DECREF(v);
8003                 if (likely(!ret))
8004                     return val;
8005             }
8006 #endif
8007             return (int) -1;
8008         }
8009     } else {
8010         int val;
8011         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
8012         if (!tmp) return (int) -1;
8013         val = __Pyx_PyInt_As_int(tmp);
8014         Py_DECREF(tmp);
8015         return val;
8016     }
8017 raise_overflow:
8018     PyErr_SetString(PyExc_OverflowError,
8019         "value too large to convert to int");
8020     return (int) -1;
8021 raise_neg_overflow:
8022     PyErr_SetString(PyExc_OverflowError,
8023         "can't convert negative value to int");
8024     return (int) -1;
8025 }
8026 
8027 /* CIntToPy */
__Pyx_PyInt_From_long(long value)8028 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
8029     const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
8030     const int is_unsigned = neg_one > const_zero;
8031     if (is_unsigned) {
8032         if (sizeof(long) < sizeof(long)) {
8033             return PyInt_FromLong((long) value);
8034         } else if (sizeof(long) <= sizeof(unsigned long)) {
8035             return PyLong_FromUnsignedLong((unsigned long) value);
8036 #ifdef HAVE_LONG_LONG
8037         } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
8038             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
8039 #endif
8040         }
8041     } else {
8042         if (sizeof(long) <= sizeof(long)) {
8043             return PyInt_FromLong((long) value);
8044 #ifdef HAVE_LONG_LONG
8045         } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
8046             return PyLong_FromLongLong((PY_LONG_LONG) value);
8047 #endif
8048         }
8049     }
8050     {
8051         int one = 1; int little = (int)*(unsigned char *)&one;
8052         unsigned char *bytes = (unsigned char *)&value;
8053         return _PyLong_FromByteArray(bytes, sizeof(long),
8054                                      little, !is_unsigned);
8055     }
8056 }
8057 
8058 /* CIntFromPy */
__Pyx_PyInt_As_long(PyObject * x)8059 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
8060     const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
8061     const int is_unsigned = neg_one > const_zero;
8062 #if PY_MAJOR_VERSION < 3
8063     if (likely(PyInt_Check(x))) {
8064         if (sizeof(long) < sizeof(long)) {
8065             __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
8066         } else {
8067             long val = PyInt_AS_LONG(x);
8068             if (is_unsigned && unlikely(val < 0)) {
8069                 goto raise_neg_overflow;
8070             }
8071             return (long) val;
8072         }
8073     } else
8074 #endif
8075     if (likely(PyLong_Check(x))) {
8076         if (is_unsigned) {
8077 #if CYTHON_USE_PYLONG_INTERNALS
8078             const digit* digits = ((PyLongObject*)x)->ob_digit;
8079             switch (Py_SIZE(x)) {
8080                 case  0: return (long) 0;
8081                 case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
8082                 case 2:
8083                     if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
8084                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
8085                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
8086                         } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
8087                             return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
8088                         }
8089                     }
8090                     break;
8091                 case 3:
8092                     if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
8093                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
8094                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
8095                         } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
8096                             return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
8097                         }
8098                     }
8099                     break;
8100                 case 4:
8101                     if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
8102                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
8103                             __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])))
8104                         } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
8105                             return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
8106                         }
8107                     }
8108                     break;
8109             }
8110 #endif
8111 #if CYTHON_COMPILING_IN_CPYTHON
8112             if (unlikely(Py_SIZE(x) < 0)) {
8113                 goto raise_neg_overflow;
8114             }
8115 #else
8116             {
8117                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
8118                 if (unlikely(result < 0))
8119                     return (long) -1;
8120                 if (unlikely(result == 1))
8121                     goto raise_neg_overflow;
8122             }
8123 #endif
8124             if (sizeof(long) <= sizeof(unsigned long)) {
8125                 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
8126 #ifdef HAVE_LONG_LONG
8127             } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
8128                 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
8129 #endif
8130             }
8131         } else {
8132 #if CYTHON_USE_PYLONG_INTERNALS
8133             const digit* digits = ((PyLongObject*)x)->ob_digit;
8134             switch (Py_SIZE(x)) {
8135                 case  0: return (long) 0;
8136                 case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
8137                 case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
8138                 case -2:
8139                     if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
8140                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
8141                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
8142                         } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
8143                             return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
8144                         }
8145                     }
8146                     break;
8147                 case 2:
8148                     if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
8149                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
8150                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
8151                         } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
8152                             return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
8153                         }
8154                     }
8155                     break;
8156                 case -3:
8157                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
8158                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
8159                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
8160                         } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
8161                             return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
8162                         }
8163                     }
8164                     break;
8165                 case 3:
8166                     if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
8167                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
8168                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
8169                         } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
8170                             return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
8171                         }
8172                     }
8173                     break;
8174                 case -4:
8175                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
8176                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
8177                             __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])))
8178                         } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
8179                             return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
8180                         }
8181                     }
8182                     break;
8183                 case 4:
8184                     if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
8185                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
8186                             __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])))
8187                         } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
8188                             return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
8189                         }
8190                     }
8191                     break;
8192             }
8193 #endif
8194             if (sizeof(long) <= sizeof(long)) {
8195                 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
8196 #ifdef HAVE_LONG_LONG
8197             } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
8198                 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
8199 #endif
8200             }
8201         }
8202         {
8203 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
8204             PyErr_SetString(PyExc_RuntimeError,
8205                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
8206 #else
8207             long val;
8208             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
8209  #if PY_MAJOR_VERSION < 3
8210             if (likely(v) && !PyLong_Check(v)) {
8211                 PyObject *tmp = v;
8212                 v = PyNumber_Long(tmp);
8213                 Py_DECREF(tmp);
8214             }
8215  #endif
8216             if (likely(v)) {
8217                 int one = 1; int is_little = (int)*(unsigned char *)&one;
8218                 unsigned char *bytes = (unsigned char *)&val;
8219                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
8220                                               bytes, sizeof(val),
8221                                               is_little, !is_unsigned);
8222                 Py_DECREF(v);
8223                 if (likely(!ret))
8224                     return val;
8225             }
8226 #endif
8227             return (long) -1;
8228         }
8229     } else {
8230         long val;
8231         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
8232         if (!tmp) return (long) -1;
8233         val = __Pyx_PyInt_As_long(tmp);
8234         Py_DECREF(tmp);
8235         return val;
8236     }
8237 raise_overflow:
8238     PyErr_SetString(PyExc_OverflowError,
8239         "value too large to convert to long");
8240     return (long) -1;
8241 raise_neg_overflow:
8242     PyErr_SetString(PyExc_OverflowError,
8243         "can't convert negative value to long");
8244     return (long) -1;
8245 }
8246 
8247 /* FastTypeChecks */
8248 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_InBases(PyTypeObject * a,PyTypeObject * b)8249 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
8250     while (a) {
8251         a = a->tp_base;
8252         if (a == b)
8253             return 1;
8254     }
8255     return b == &PyBaseObject_Type;
8256 }
__Pyx_IsSubtype(PyTypeObject * a,PyTypeObject * b)8257 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
8258     PyObject *mro;
8259     if (a == b) return 1;
8260     mro = a->tp_mro;
8261     if (likely(mro)) {
8262         Py_ssize_t i, n;
8263         n = PyTuple_GET_SIZE(mro);
8264         for (i = 0; i < n; i++) {
8265             if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
8266                 return 1;
8267         }
8268         return 0;
8269     }
8270     return __Pyx_InBases(a, b);
8271 }
8272 #if PY_MAJOR_VERSION == 2
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)8273 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
8274     PyObject *exception, *value, *tb;
8275     int res;
8276     __Pyx_PyThreadState_declare
8277     __Pyx_PyThreadState_assign
8278     __Pyx_ErrFetch(&exception, &value, &tb);
8279     res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
8280     if (unlikely(res == -1)) {
8281         PyErr_WriteUnraisable(err);
8282         res = 0;
8283     }
8284     if (!res) {
8285         res = PyObject_IsSubclass(err, exc_type2);
8286         if (unlikely(res == -1)) {
8287             PyErr_WriteUnraisable(err);
8288             res = 0;
8289         }
8290     }
8291     __Pyx_ErrRestore(exception, value, tb);
8292     return res;
8293 }
8294 #else
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)8295 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
8296     int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
8297     if (!res) {
8298         res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
8299     }
8300     return res;
8301 }
8302 #endif
__Pyx_PyErr_GivenExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)8303 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
8304     Py_ssize_t i, n;
8305     assert(PyExceptionClass_Check(exc_type));
8306     n = PyTuple_GET_SIZE(tuple);
8307 #if PY_MAJOR_VERSION >= 3
8308     for (i=0; i<n; i++) {
8309         if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
8310     }
8311 #endif
8312     for (i=0; i<n; i++) {
8313         PyObject *t = PyTuple_GET_ITEM(tuple, i);
8314         #if PY_MAJOR_VERSION < 3
8315         if (likely(exc_type == t)) return 1;
8316         #endif
8317         if (likely(PyExceptionClass_Check(t))) {
8318             if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
8319         } else {
8320         }
8321     }
8322     return 0;
8323 }
__Pyx_PyErr_GivenExceptionMatches(PyObject * err,PyObject * exc_type)8324 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
8325     if (likely(err == exc_type)) return 1;
8326     if (likely(PyExceptionClass_Check(err))) {
8327         if (likely(PyExceptionClass_Check(exc_type))) {
8328             return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
8329         } else if (likely(PyTuple_Check(exc_type))) {
8330             return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
8331         } else {
8332         }
8333     }
8334     return PyErr_GivenExceptionMatches(err, exc_type);
8335 }
__Pyx_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)8336 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
8337     assert(PyExceptionClass_Check(exc_type1));
8338     assert(PyExceptionClass_Check(exc_type2));
8339     if (likely(err == exc_type1 || err == exc_type2)) return 1;
8340     if (likely(PyExceptionClass_Check(err))) {
8341         return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
8342     }
8343     return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
8344 }
8345 #endif
8346 
8347 /* CheckBinaryVersion */
__Pyx_check_binary_version(void)8348 static int __Pyx_check_binary_version(void) {
8349     char ctversion[4], rtversion[4];
8350     PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
8351     PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
8352     if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
8353         char message[200];
8354         PyOS_snprintf(message, sizeof(message),
8355                       "compiletime version %s of module '%.100s' "
8356                       "does not match runtime version %s",
8357                       ctversion, __Pyx_MODULE_NAME, rtversion);
8358         return PyErr_WarnEx(NULL, message, 1);
8359     }
8360     return 0;
8361 }
8362 
8363 /* FunctionExport */
__Pyx_ExportFunction(const char * name,void (* f)(void),const char * sig)8364 static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) {
8365     PyObject *d = 0;
8366     PyObject *cobj = 0;
8367     union {
8368         void (*fp)(void);
8369         void *p;
8370     } tmp;
8371     d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__");
8372     if (!d) {
8373         PyErr_Clear();
8374         d = PyDict_New();
8375         if (!d)
8376             goto bad;
8377         Py_INCREF(d);
8378         if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0)
8379             goto bad;
8380     }
8381     tmp.fp = f;
8382 #if PY_VERSION_HEX >= 0x02070000
8383     cobj = PyCapsule_New(tmp.p, sig, 0);
8384 #else
8385     cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0);
8386 #endif
8387     if (!cobj)
8388         goto bad;
8389     if (PyDict_SetItemString(d, name, cobj) < 0)
8390         goto bad;
8391     Py_DECREF(cobj);
8392     Py_DECREF(d);
8393     return 0;
8394 bad:
8395     Py_XDECREF(cobj);
8396     Py_XDECREF(d);
8397     return -1;
8398 }
8399 
8400 /* InitStrings */
__Pyx_InitStrings(__Pyx_StringTabEntry * t)8401 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
8402     while (t->p) {
8403         #if PY_MAJOR_VERSION < 3
8404         if (t->is_unicode) {
8405             *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
8406         } else if (t->intern) {
8407             *t->p = PyString_InternFromString(t->s);
8408         } else {
8409             *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
8410         }
8411         #else
8412         if (t->is_unicode | t->is_str) {
8413             if (t->intern) {
8414                 *t->p = PyUnicode_InternFromString(t->s);
8415             } else if (t->encoding) {
8416                 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
8417             } else {
8418                 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
8419             }
8420         } else {
8421             *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
8422         }
8423         #endif
8424         if (!*t->p)
8425             return -1;
8426         if (PyObject_Hash(*t->p) == -1)
8427             return -1;
8428         ++t;
8429     }
8430     return 0;
8431 }
8432 
__Pyx_PyUnicode_FromString(const char * c_str)8433 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
8434     return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
8435 }
__Pyx_PyObject_AsString(PyObject * o)8436 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
8437     Py_ssize_t ignore;
8438     return __Pyx_PyObject_AsStringAndSize(o, &ignore);
8439 }
8440 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
8441 #if !CYTHON_PEP393_ENABLED
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)8442 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
8443     char* defenc_c;
8444     PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
8445     if (!defenc) return NULL;
8446     defenc_c = PyBytes_AS_STRING(defenc);
8447 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
8448     {
8449         char* end = defenc_c + PyBytes_GET_SIZE(defenc);
8450         char* c;
8451         for (c = defenc_c; c < end; c++) {
8452             if ((unsigned char) (*c) >= 128) {
8453                 PyUnicode_AsASCIIString(o);
8454                 return NULL;
8455             }
8456         }
8457     }
8458 #endif
8459     *length = PyBytes_GET_SIZE(defenc);
8460     return defenc_c;
8461 }
8462 #else
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)8463 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
8464     if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
8465 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
8466     if (likely(PyUnicode_IS_ASCII(o))) {
8467         *length = PyUnicode_GET_LENGTH(o);
8468         return PyUnicode_AsUTF8(o);
8469     } else {
8470         PyUnicode_AsASCIIString(o);
8471         return NULL;
8472     }
8473 #else
8474     return PyUnicode_AsUTF8AndSize(o, length);
8475 #endif
8476 }
8477 #endif
8478 #endif
__Pyx_PyObject_AsStringAndSize(PyObject * o,Py_ssize_t * length)8479 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
8480 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
8481     if (
8482 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
8483             __Pyx_sys_getdefaultencoding_not_ascii &&
8484 #endif
8485             PyUnicode_Check(o)) {
8486         return __Pyx_PyUnicode_AsStringAndSize(o, length);
8487     } else
8488 #endif
8489 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
8490     if (PyByteArray_Check(o)) {
8491         *length = PyByteArray_GET_SIZE(o);
8492         return PyByteArray_AS_STRING(o);
8493     } else
8494 #endif
8495     {
8496         char* result;
8497         int r = PyBytes_AsStringAndSize(o, &result, length);
8498         if (unlikely(r < 0)) {
8499             return NULL;
8500         } else {
8501             return result;
8502         }
8503     }
8504 }
__Pyx_PyObject_IsTrue(PyObject * x)8505 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
8506    int is_true = x == Py_True;
8507    if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
8508    else return PyObject_IsTrue(x);
8509 }
__Pyx_PyObject_IsTrueAndDecref(PyObject * x)8510 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
8511     int retval;
8512     if (unlikely(!x)) return -1;
8513     retval = __Pyx_PyObject_IsTrue(x);
8514     Py_DECREF(x);
8515     return retval;
8516 }
__Pyx_PyNumber_IntOrLongWrongResultType(PyObject * result,const char * type_name)8517 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
8518 #if PY_MAJOR_VERSION >= 3
8519     if (PyLong_Check(result)) {
8520         if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
8521                 "__int__ returned non-int (type %.200s).  "
8522                 "The ability to return an instance of a strict subclass of int "
8523                 "is deprecated, and may be removed in a future version of Python.",
8524                 Py_TYPE(result)->tp_name)) {
8525             Py_DECREF(result);
8526             return NULL;
8527         }
8528         return result;
8529     }
8530 #endif
8531     PyErr_Format(PyExc_TypeError,
8532                  "__%.4s__ returned non-%.4s (type %.200s)",
8533                  type_name, type_name, Py_TYPE(result)->tp_name);
8534     Py_DECREF(result);
8535     return NULL;
8536 }
__Pyx_PyNumber_IntOrLong(PyObject * x)8537 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
8538 #if CYTHON_USE_TYPE_SLOTS
8539   PyNumberMethods *m;
8540 #endif
8541   const char *name = NULL;
8542   PyObject *res = NULL;
8543 #if PY_MAJOR_VERSION < 3
8544   if (likely(PyInt_Check(x) || PyLong_Check(x)))
8545 #else
8546   if (likely(PyLong_Check(x)))
8547 #endif
8548     return __Pyx_NewRef(x);
8549 #if CYTHON_USE_TYPE_SLOTS
8550   m = Py_TYPE(x)->tp_as_number;
8551   #if PY_MAJOR_VERSION < 3
8552   if (m && m->nb_int) {
8553     name = "int";
8554     res = m->nb_int(x);
8555   }
8556   else if (m && m->nb_long) {
8557     name = "long";
8558     res = m->nb_long(x);
8559   }
8560   #else
8561   if (likely(m && m->nb_int)) {
8562     name = "int";
8563     res = m->nb_int(x);
8564   }
8565   #endif
8566 #else
8567   if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
8568     res = PyNumber_Int(x);
8569   }
8570 #endif
8571   if (likely(res)) {
8572 #if PY_MAJOR_VERSION < 3
8573     if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
8574 #else
8575     if (unlikely(!PyLong_CheckExact(res))) {
8576 #endif
8577         return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
8578     }
8579   }
8580   else if (!PyErr_Occurred()) {
8581     PyErr_SetString(PyExc_TypeError,
8582                     "an integer is required");
8583   }
8584   return res;
8585 }
8586 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
8587   Py_ssize_t ival;
8588   PyObject *x;
8589 #if PY_MAJOR_VERSION < 3
8590   if (likely(PyInt_CheckExact(b))) {
8591     if (sizeof(Py_ssize_t) >= sizeof(long))
8592         return PyInt_AS_LONG(b);
8593     else
8594         return PyInt_AsSsize_t(b);
8595   }
8596 #endif
8597   if (likely(PyLong_CheckExact(b))) {
8598     #if CYTHON_USE_PYLONG_INTERNALS
8599     const digit* digits = ((PyLongObject*)b)->ob_digit;
8600     const Py_ssize_t size = Py_SIZE(b);
8601     if (likely(__Pyx_sst_abs(size) <= 1)) {
8602         ival = likely(size) ? digits[0] : 0;
8603         if (size == -1) ival = -ival;
8604         return ival;
8605     } else {
8606       switch (size) {
8607          case 2:
8608            if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
8609              return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
8610            }
8611            break;
8612          case -2:
8613            if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
8614              return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
8615            }
8616            break;
8617          case 3:
8618            if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
8619              return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
8620            }
8621            break;
8622          case -3:
8623            if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
8624              return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
8625            }
8626            break;
8627          case 4:
8628            if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
8629              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]));
8630            }
8631            break;
8632          case -4:
8633            if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
8634              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]));
8635            }
8636            break;
8637       }
8638     }
8639     #endif
8640     return PyLong_AsSsize_t(b);
8641   }
8642   x = PyNumber_Index(b);
8643   if (!x) return -1;
8644   ival = PyInt_AsSsize_t(x);
8645   Py_DECREF(x);
8646   return ival;
8647 }
8648 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
8649   return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
8650 }
8651 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
8652     return PyInt_FromSize_t(ival);
8653 }
8654 
8655 
8656 #endif /* Py_PYTHON_H */
8657