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