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