3#ifndef PY_SSIZE_T_CLEAN
4#define PY_SSIZE_T_CLEAN
6#if defined(CYTHON_LIMITED_API) && 0
8 #if CYTHON_LIMITED_API+0 > 0x03030000
9 #define Py_LIMITED_API CYTHON_LIMITED_API
11 #define Py_LIMITED_API 0x03030000
18 #error Python headers needed to compile C extensions, please install development version of Python.
19#elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
20 #error Cython requires Python 2.7+ or Python 3.3+.
22#if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API
23#define __PYX_EXTRA_ABI_MODULE_NAME "limited"
25#define __PYX_EXTRA_ABI_MODULE_NAME ""
27#define CYTHON_ABI "3_0_11" __PYX_EXTRA_ABI_MODULE_NAME
28#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
29#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."
30#define CYTHON_HEX_VERSION 0x03000BF0
31#define CYTHON_FUTURE_DIVISION 1
34 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
36#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS)
48 #define DL_IMPORT(t) t
51 #define DL_EXPORT(t) t
55 #define HAVE_LONG_LONG
58 #define PY_LONG_LONG LONG_LONG
61 #define Py_HUGE_VAL HUGE_VAL
63#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX
64#if defined(GRAALVM_PYTHON)
67 #define CYTHON_COMPILING_IN_PYPY 0
68 #define CYTHON_COMPILING_IN_CPYTHON 0
69 #define CYTHON_COMPILING_IN_LIMITED_API 0
70 #define CYTHON_COMPILING_IN_GRAAL 1
71 #define CYTHON_COMPILING_IN_NOGIL 0
72 #undef CYTHON_USE_TYPE_SLOTS
73 #define CYTHON_USE_TYPE_SLOTS 0
74 #undef CYTHON_USE_TYPE_SPECS
75 #define CYTHON_USE_TYPE_SPECS 0
76 #undef CYTHON_USE_PYTYPE_LOOKUP
77 #define CYTHON_USE_PYTYPE_LOOKUP 0
78 #if PY_VERSION_HEX < 0x03050000
79 #undef CYTHON_USE_ASYNC_SLOTS
80 #define CYTHON_USE_ASYNC_SLOTS 0
81 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
82 #define CYTHON_USE_ASYNC_SLOTS 1
84 #undef CYTHON_USE_PYLIST_INTERNALS
85 #define CYTHON_USE_PYLIST_INTERNALS 0
86 #undef CYTHON_USE_UNICODE_INTERNALS
87 #define CYTHON_USE_UNICODE_INTERNALS 0
88 #undef CYTHON_USE_UNICODE_WRITER
89 #define CYTHON_USE_UNICODE_WRITER 0
90 #undef CYTHON_USE_PYLONG_INTERNALS
91 #define CYTHON_USE_PYLONG_INTERNALS 0
92 #undef CYTHON_AVOID_BORROWED_REFS
93 #define CYTHON_AVOID_BORROWED_REFS 1
94 #undef CYTHON_ASSUME_SAFE_MACROS
95 #define CYTHON_ASSUME_SAFE_MACROS 0
96 #undef CYTHON_UNPACK_METHODS
97 #define CYTHON_UNPACK_METHODS 0
98 #undef CYTHON_FAST_THREAD_STATE
99 #define CYTHON_FAST_THREAD_STATE 0
100 #undef CYTHON_FAST_GIL
101 #define CYTHON_FAST_GIL 0
102 #undef CYTHON_METH_FASTCALL
103 #define CYTHON_METH_FASTCALL 0
104 #undef CYTHON_FAST_PYCALL
105 #define CYTHON_FAST_PYCALL 0
106 #ifndef CYTHON_PEP487_INIT_SUBCLASS
107 #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3)
109 #undef CYTHON_PEP489_MULTI_PHASE_INIT
110 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
111 #undef CYTHON_USE_MODULE_STATE
112 #define CYTHON_USE_MODULE_STATE 0
113 #undef CYTHON_USE_TP_FINALIZE
114 #define CYTHON_USE_TP_FINALIZE 0
115 #undef CYTHON_USE_DICT_VERSIONS
116 #define CYTHON_USE_DICT_VERSIONS 0
117 #undef CYTHON_USE_EXC_INFO_STACK
118 #define CYTHON_USE_EXC_INFO_STACK 0
119 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
120 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
122 #undef CYTHON_USE_FREELISTS
123 #define CYTHON_USE_FREELISTS 0
124#elif defined(PYPY_VERSION)
125 #define CYTHON_COMPILING_IN_PYPY 1
126 #define CYTHON_COMPILING_IN_CPYTHON 0
127 #define CYTHON_COMPILING_IN_LIMITED_API 0
128 #define CYTHON_COMPILING_IN_GRAAL 0
129 #define CYTHON_COMPILING_IN_NOGIL 0
130 #undef CYTHON_USE_TYPE_SLOTS
131 #define CYTHON_USE_TYPE_SLOTS 0
132 #ifndef CYTHON_USE_TYPE_SPECS
133 #define CYTHON_USE_TYPE_SPECS 0
135 #undef CYTHON_USE_PYTYPE_LOOKUP
136 #define CYTHON_USE_PYTYPE_LOOKUP 0
137 #if PY_VERSION_HEX < 0x03050000
138 #undef CYTHON_USE_ASYNC_SLOTS
139 #define CYTHON_USE_ASYNC_SLOTS 0
140 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
141 #define CYTHON_USE_ASYNC_SLOTS 1
143 #undef CYTHON_USE_PYLIST_INTERNALS
144 #define CYTHON_USE_PYLIST_INTERNALS 0
145 #undef CYTHON_USE_UNICODE_INTERNALS
146 #define CYTHON_USE_UNICODE_INTERNALS 0
147 #undef CYTHON_USE_UNICODE_WRITER
148 #define CYTHON_USE_UNICODE_WRITER 0
149 #undef CYTHON_USE_PYLONG_INTERNALS
150 #define CYTHON_USE_PYLONG_INTERNALS 0
151 #undef CYTHON_AVOID_BORROWED_REFS
152 #define CYTHON_AVOID_BORROWED_REFS 1
153 #undef CYTHON_ASSUME_SAFE_MACROS
154 #define CYTHON_ASSUME_SAFE_MACROS 0
155 #undef CYTHON_UNPACK_METHODS
156 #define CYTHON_UNPACK_METHODS 0
157 #undef CYTHON_FAST_THREAD_STATE
158 #define CYTHON_FAST_THREAD_STATE 0
159 #undef CYTHON_FAST_GIL
160 #define CYTHON_FAST_GIL 0
161 #undef CYTHON_METH_FASTCALL
162 #define CYTHON_METH_FASTCALL 0
163 #undef CYTHON_FAST_PYCALL
164 #define CYTHON_FAST_PYCALL 0
165 #ifndef CYTHON_PEP487_INIT_SUBCLASS
166 #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3)
168 #if PY_VERSION_HEX < 0x03090000
169 #undef CYTHON_PEP489_MULTI_PHASE_INIT
170 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
171 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
172 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
174 #undef CYTHON_USE_MODULE_STATE
175 #define CYTHON_USE_MODULE_STATE 0
176 #undef CYTHON_USE_TP_FINALIZE
177 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00)
178 #undef CYTHON_USE_DICT_VERSIONS
179 #define CYTHON_USE_DICT_VERSIONS 0
180 #undef CYTHON_USE_EXC_INFO_STACK
181 #define CYTHON_USE_EXC_INFO_STACK 0
182 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
183 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
185 #undef CYTHON_USE_FREELISTS
186 #define CYTHON_USE_FREELISTS 0
187#elif defined(CYTHON_LIMITED_API)
188 #ifdef Py_LIMITED_API
189 #undef __PYX_LIMITED_VERSION_HEX
190 #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API
192 #define CYTHON_COMPILING_IN_PYPY 0
193 #define CYTHON_COMPILING_IN_CPYTHON 0
194 #define CYTHON_COMPILING_IN_LIMITED_API 1
195 #define CYTHON_COMPILING_IN_GRAAL 0
196 #define CYTHON_COMPILING_IN_NOGIL 0
197 #undef CYTHON_CLINE_IN_TRACEBACK
198 #define CYTHON_CLINE_IN_TRACEBACK 0
199 #undef CYTHON_USE_TYPE_SLOTS
200 #define CYTHON_USE_TYPE_SLOTS 0
201 #undef CYTHON_USE_TYPE_SPECS
202 #define CYTHON_USE_TYPE_SPECS 1
203 #undef CYTHON_USE_PYTYPE_LOOKUP
204 #define CYTHON_USE_PYTYPE_LOOKUP 0
205 #undef CYTHON_USE_ASYNC_SLOTS
206 #define CYTHON_USE_ASYNC_SLOTS 0
207 #undef CYTHON_USE_PYLIST_INTERNALS
208 #define CYTHON_USE_PYLIST_INTERNALS 0
209 #undef CYTHON_USE_UNICODE_INTERNALS
210 #define CYTHON_USE_UNICODE_INTERNALS 0
211 #ifndef CYTHON_USE_UNICODE_WRITER
212 #define CYTHON_USE_UNICODE_WRITER 0
214 #undef CYTHON_USE_PYLONG_INTERNALS
215 #define CYTHON_USE_PYLONG_INTERNALS 0
216 #ifndef CYTHON_AVOID_BORROWED_REFS
217 #define CYTHON_AVOID_BORROWED_REFS 0
219 #undef CYTHON_ASSUME_SAFE_MACROS
220 #define CYTHON_ASSUME_SAFE_MACROS 0
221 #undef CYTHON_UNPACK_METHODS
222 #define CYTHON_UNPACK_METHODS 0
223 #undef CYTHON_FAST_THREAD_STATE
224 #define CYTHON_FAST_THREAD_STATE 0
225 #undef CYTHON_FAST_GIL
226 #define CYTHON_FAST_GIL 0
227 #undef CYTHON_METH_FASTCALL
228 #define CYTHON_METH_FASTCALL 0
229 #undef CYTHON_FAST_PYCALL
230 #define CYTHON_FAST_PYCALL 0
231 #ifndef CYTHON_PEP487_INIT_SUBCLASS
232 #define CYTHON_PEP487_INIT_SUBCLASS 1
234 #undef CYTHON_PEP489_MULTI_PHASE_INIT
235 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
236 #undef CYTHON_USE_MODULE_STATE
237 #define CYTHON_USE_MODULE_STATE 1
238 #ifndef CYTHON_USE_TP_FINALIZE
239 #define CYTHON_USE_TP_FINALIZE 0
241 #undef CYTHON_USE_DICT_VERSIONS
242 #define CYTHON_USE_DICT_VERSIONS 0
243 #undef CYTHON_USE_EXC_INFO_STACK
244 #define CYTHON_USE_EXC_INFO_STACK 0
245 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
246 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
248 #undef CYTHON_USE_FREELISTS
249 #define CYTHON_USE_FREELISTS 0
250#elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL)
251 #define CYTHON_COMPILING_IN_PYPY 0
252 #define CYTHON_COMPILING_IN_CPYTHON 0
253 #define CYTHON_COMPILING_IN_LIMITED_API 0
254 #define CYTHON_COMPILING_IN_GRAAL 0
255 #define CYTHON_COMPILING_IN_NOGIL 1
256 #ifndef CYTHON_USE_TYPE_SLOTS
257 #define CYTHON_USE_TYPE_SLOTS 1
259 #ifndef CYTHON_USE_TYPE_SPECS
260 #define CYTHON_USE_TYPE_SPECS 0
262 #undef CYTHON_USE_PYTYPE_LOOKUP
263 #define CYTHON_USE_PYTYPE_LOOKUP 0
264 #ifndef CYTHON_USE_ASYNC_SLOTS
265 #define CYTHON_USE_ASYNC_SLOTS 1
267 #ifndef CYTHON_USE_PYLONG_INTERNALS
268 #define CYTHON_USE_PYLONG_INTERNALS 0
270 #undef CYTHON_USE_PYLIST_INTERNALS
271 #define CYTHON_USE_PYLIST_INTERNALS 0
272 #ifndef CYTHON_USE_UNICODE_INTERNALS
273 #define CYTHON_USE_UNICODE_INTERNALS 1
275 #undef CYTHON_USE_UNICODE_WRITER
276 #define CYTHON_USE_UNICODE_WRITER 0
277 #ifndef CYTHON_AVOID_BORROWED_REFS
278 #define CYTHON_AVOID_BORROWED_REFS 0
280 #ifndef CYTHON_ASSUME_SAFE_MACROS
281 #define CYTHON_ASSUME_SAFE_MACROS 1
283 #ifndef CYTHON_UNPACK_METHODS
284 #define CYTHON_UNPACK_METHODS 1
286 #undef CYTHON_FAST_THREAD_STATE
287 #define CYTHON_FAST_THREAD_STATE 0
288 #undef CYTHON_FAST_GIL
289 #define CYTHON_FAST_GIL 0
290 #ifndef CYTHON_METH_FASTCALL
291 #define CYTHON_METH_FASTCALL 1
293 #undef CYTHON_FAST_PYCALL
294 #define CYTHON_FAST_PYCALL 0
295 #ifndef CYTHON_PEP487_INIT_SUBCLASS
296 #define CYTHON_PEP487_INIT_SUBCLASS 1
298 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
299 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
301 #ifndef CYTHON_USE_MODULE_STATE
302 #define CYTHON_USE_MODULE_STATE 0
304 #ifndef CYTHON_USE_TP_FINALIZE
305 #define CYTHON_USE_TP_FINALIZE 1
307 #undef CYTHON_USE_DICT_VERSIONS
308 #define CYTHON_USE_DICT_VERSIONS 0
309 #undef CYTHON_USE_EXC_INFO_STACK
310 #define CYTHON_USE_EXC_INFO_STACK 0
311 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
312 #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
314 #ifndef CYTHON_USE_FREELISTS
315 #define CYTHON_USE_FREELISTS 0
318 #define CYTHON_COMPILING_IN_PYPY 0
319 #define CYTHON_COMPILING_IN_CPYTHON 1
320 #define CYTHON_COMPILING_IN_LIMITED_API 0
321 #define CYTHON_COMPILING_IN_GRAAL 0
322 #define CYTHON_COMPILING_IN_NOGIL 0
323 #ifndef CYTHON_USE_TYPE_SLOTS
324 #define CYTHON_USE_TYPE_SLOTS 1
326 #ifndef CYTHON_USE_TYPE_SPECS
327 #define CYTHON_USE_TYPE_SPECS 0
329 #ifndef CYTHON_USE_PYTYPE_LOOKUP
330 #define CYTHON_USE_PYTYPE_LOOKUP 1
332 #if PY_MAJOR_VERSION < 3
333 #undef CYTHON_USE_ASYNC_SLOTS
334 #define CYTHON_USE_ASYNC_SLOTS 0
335 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
336 #define CYTHON_USE_ASYNC_SLOTS 1
338 #ifndef CYTHON_USE_PYLONG_INTERNALS
339 #define CYTHON_USE_PYLONG_INTERNALS 1
341 #ifndef CYTHON_USE_PYLIST_INTERNALS
342 #define CYTHON_USE_PYLIST_INTERNALS 1
344 #ifndef CYTHON_USE_UNICODE_INTERNALS
345 #define CYTHON_USE_UNICODE_INTERNALS 1
347 #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
348 #undef CYTHON_USE_UNICODE_WRITER
349 #define CYTHON_USE_UNICODE_WRITER 0
350 #elif !defined(CYTHON_USE_UNICODE_WRITER)
351 #define CYTHON_USE_UNICODE_WRITER 1
353 #ifndef CYTHON_AVOID_BORROWED_REFS
354 #define CYTHON_AVOID_BORROWED_REFS 0
356 #ifndef CYTHON_ASSUME_SAFE_MACROS
357 #define CYTHON_ASSUME_SAFE_MACROS 1
359 #ifndef CYTHON_UNPACK_METHODS
360 #define CYTHON_UNPACK_METHODS 1
362 #ifndef CYTHON_FAST_THREAD_STATE
363 #define CYTHON_FAST_THREAD_STATE 1
365 #ifndef CYTHON_FAST_GIL
366 #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6)
368 #ifndef CYTHON_METH_FASTCALL
369 #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1)
371 #ifndef CYTHON_FAST_PYCALL
372 #define CYTHON_FAST_PYCALL 1
374 #ifndef CYTHON_PEP487_INIT_SUBCLASS
375 #define CYTHON_PEP487_INIT_SUBCLASS 1
377 #if PY_VERSION_HEX < 0x03050000
378 #undef CYTHON_PEP489_MULTI_PHASE_INIT
379 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
380 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
381 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
383 #ifndef CYTHON_USE_MODULE_STATE
384 #define CYTHON_USE_MODULE_STATE 0
386 #if PY_VERSION_HEX < 0x030400a1
387 #undef CYTHON_USE_TP_FINALIZE
388 #define CYTHON_USE_TP_FINALIZE 0
389 #elif !defined(CYTHON_USE_TP_FINALIZE)
390 #define CYTHON_USE_TP_FINALIZE 1
392 #if PY_VERSION_HEX < 0x030600B1
393 #undef CYTHON_USE_DICT_VERSIONS
394 #define CYTHON_USE_DICT_VERSIONS 0
395 #elif !defined(CYTHON_USE_DICT_VERSIONS)
396 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5)
398 #if PY_VERSION_HEX < 0x030700A3
399 #undef CYTHON_USE_EXC_INFO_STACK
400 #define CYTHON_USE_EXC_INFO_STACK 0
401 #elif !defined(CYTHON_USE_EXC_INFO_STACK)
402 #define CYTHON_USE_EXC_INFO_STACK 1
404 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
405 #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
407 #ifndef CYTHON_USE_FREELISTS
408 #define CYTHON_USE_FREELISTS 1
411#if !defined(CYTHON_FAST_PYCCALL)
412#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
414#if !defined(CYTHON_VECTORCALL)
415#define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1)
417#define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1)
418#if CYTHON_USE_PYLONG_INTERNALS
419 #if PY_MAJOR_VERSION < 3
420 #include "longintrepr.h"
426 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P ==
sizeof(
void*)) };
429#ifndef __has_attribute
430 #define __has_attribute(x) 0
432#ifndef __has_cpp_attribute
433 #define __has_cpp_attribute(x) 0
435#ifndef CYTHON_RESTRICT
436 #if defined(__GNUC__)
437 #define CYTHON_RESTRICT __restrict__
438 #elif defined(_MSC_VER) && _MSC_VER >= 1400
439 #define CYTHON_RESTRICT __restrict
440 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
441 #define CYTHON_RESTRICT restrict
443 #define CYTHON_RESTRICT
447 #if defined(__cplusplus)
450 #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
451 #if __has_cpp_attribute(maybe_unused)
452 #define CYTHON_UNUSED [[maybe_unused]]
458# if defined(__GNUC__)
459# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
460# define CYTHON_UNUSED __attribute__ ((__unused__))
462# define CYTHON_UNUSED
464# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
465# define CYTHON_UNUSED __attribute__ ((__unused__))
467# define CYTHON_UNUSED
470#ifndef CYTHON_UNUSED_VAR
471# if defined(__cplusplus)
472 template<
class T>
void CYTHON_UNUSED_VAR(
const T& ) { }
474# define CYTHON_UNUSED_VAR(x) (void)(x)
477#ifndef CYTHON_MAYBE_UNUSED_VAR
478 #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
480#ifndef CYTHON_NCP_UNUSED
481# if CYTHON_COMPILING_IN_CPYTHON
482# define CYTHON_NCP_UNUSED
484# define CYTHON_NCP_UNUSED CYTHON_UNUSED
487#ifndef CYTHON_USE_CPP_STD_MOVE
488 #if defined(__cplusplus) && (\
489 __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600))
490 #define CYTHON_USE_CPP_STD_MOVE 1
492 #define CYTHON_USE_CPP_STD_MOVE 0
495#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
497 #ifndef _MSC_STDINT_H_
499 typedef unsigned char uint8_t;
500 typedef unsigned short uint16_t;
501 typedef unsigned int uint32_t;
503 typedef unsigned __int8 uint8_t;
504 typedef unsigned __int16 uint16_t;
505 typedef unsigned __int32 uint32_t;
510 typedef unsigned long long __pyx_uintptr_t;
512 typedef unsigned int __pyx_uintptr_t;
516 typedef unsigned __int64 __pyx_uintptr_t;
518 typedef unsigned __int32 __pyx_uintptr_t;
523 typedef uintptr_t __pyx_uintptr_t;
525#ifndef CYTHON_FALLTHROUGH
526 #if defined(__cplusplus)
529 #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
530 #if __has_cpp_attribute(fallthrough)
531 #define CYTHON_FALLTHROUGH [[fallthrough]]
534 #ifndef CYTHON_FALLTHROUGH
535 #if __has_cpp_attribute(clang::fallthrough)
536 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
537 #elif __has_cpp_attribute(gnu::fallthrough)
538 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
542 #ifndef CYTHON_FALLTHROUGH
543 #if __has_attribute(fallthrough)
544 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
546 #define CYTHON_FALLTHROUGH
549 #if defined(__clang__) && defined(__apple_build_version__)
550 #if __apple_build_version__ < 7000000
551 #undef CYTHON_FALLTHROUGH
552 #define CYTHON_FALLTHROUGH
557 template <
typename T>
558 struct __PYX_IS_UNSIGNED_IMPL {
static const bool value = T(0) < T(-1);};
559 #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::value)
561 #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
563#if CYTHON_COMPILING_IN_PYPY == 1
564 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000)
566 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000)
568#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))
571 #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
574 #if defined(__clang__)
575 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
577 #define CYTHON_INLINE inline
581void __Pyx_call_destructor(T& x) {
585class __Pyx_FakeReference {
587 __Pyx_FakeReference() : ptr(NULL) { }
588 __Pyx_FakeReference(
const T& ref) : ptr(const_cast<T*>(&ref)) { }
589 T *operator->() {
return ptr; }
590 T *operator&() {
return ptr; }
591 operator T&() {
return *ptr; }
592 template<
typename U>
bool operator ==(
const U& other)
const {
return *ptr == other; }
593 template<
typename U>
bool operator !=(
const U& other)
const {
return *ptr != other; }
594 template<
typename U>
bool operator==(
const __Pyx_FakeReference<U>& other)
const {
return *ptr == *other.ptr; }
595 template<
typename U>
bool operator!=(
const __Pyx_FakeReference<U>& other)
const {
return *ptr != *other.ptr; }
600#define __PYX_BUILD_PY_SSIZE_T "n"
601#define CYTHON_FORMAT_SSIZE_T "z"
602#if PY_MAJOR_VERSION < 3
603 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
604 #define __Pyx_DefaultClassType PyClass_Type
605 #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
606 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
608 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
609 #define __Pyx_DefaultClassType PyType_Type
610#if CYTHON_COMPILING_IN_LIMITED_API
611 static CYTHON_INLINE PyObject* __Pyx_PyCode_New(
int a,
int p,
int k,
int l,
int s,
int f,
612 PyObject *code, PyObject *c, PyObject* n, PyObject *v,
613 PyObject *fv, PyObject *cell, PyObject* fn,
614 PyObject *name,
int fline, PyObject *lnos) {
615 PyObject *exception_table = NULL;
616 PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
617 #if __PYX_LIMITED_VERSION_HEX < 0x030B0000
618 PyObject *version_info;
619 PyObject *py_minor_version = NULL;
621 long minor_version = 0;
622 PyObject *type, *value, *traceback;
623 PyErr_Fetch(&type, &value, &traceback);
624 #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000
627 if (!(version_info = PySys_GetObject(
"version_info")))
goto end;
628 if (!(py_minor_version = PySequence_GetItem(version_info, 1)))
goto end;
629 minor_version = PyLong_AsLong(py_minor_version);
630 Py_DECREF(py_minor_version);
631 if (minor_version == -1 && PyErr_Occurred())
goto end;
633 if (!(types_module = PyImport_ImportModule(
"types")))
goto end;
634 if (!(code_type = PyObject_GetAttrString(types_module,
"CodeType")))
goto end;
635 if (minor_version <= 7) {
637 result = PyObject_CallFunction(code_type,
"iiiiiOOOOOOiOO", a, k, l, s, f, code,
638 c, n, v, fn, name, fline, lnos, fv, cell);
639 }
else if (minor_version <= 10) {
640 result = PyObject_CallFunction(code_type,
"iiiiiiOOOOOOiOO", a,p, k, l, s, f, code,
641 c, n, v, fn, name, fline, lnos, fv, cell);
643 if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0)))
goto end;
644 result = PyObject_CallFunction(code_type,
"iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code,
645 c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell);
648 Py_XDECREF(code_type);
649 Py_XDECREF(exception_table);
650 Py_XDECREF(types_module);
652 PyErr_Restore(type, value, traceback);
657 #define CO_OPTIMIZED 0x0001
660 #define CO_NEWLOCALS 0x0002
663 #define CO_VARARGS 0x0004
665 #ifndef CO_VARKEYWORDS
666 #define CO_VARKEYWORDS 0x0008
668 #ifndef CO_ASYNC_GENERATOR
669 #define CO_ASYNC_GENERATOR 0x0200
672 #define CO_GENERATOR 0x0020
675 #define CO_COROUTINE 0x0080
677#elif PY_VERSION_HEX >= 0x030B0000
678 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(
int a,
int p,
int k,
int l,
int s,
int f,
679 PyObject *code, PyObject *c, PyObject* n, PyObject *v,
680 PyObject *fv, PyObject *cell, PyObject* fn,
681 PyObject *name,
int fline, PyObject *lnos) {
682 PyCodeObject *result;
683 PyObject *empty_bytes = PyBytes_FromStringAndSize(
"", 0);
684 if (!empty_bytes)
return NULL;
686 #if PY_VERSION_HEX >= 0x030C0000
687 PyUnstable_Code_NewWithPosOnlyArgs
689 PyCode_NewWithPosOnlyArgs
691 (a, p, k, l, s, f, code, c, n, v, fv, cell, fn,
name,
name, fline, lnos, empty_bytes);
692 Py_DECREF(empty_bytes);
695#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY
696 #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
697 PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
699 #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
700 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
703#if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE)
704 #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type)
706 #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type))
708#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is)
709 #define __Pyx_Py_Is(x, y) Py_Is(x, y)
711 #define __Pyx_Py_Is(x, y) ((x) == (y))
713#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
714 #define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
716 #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
718#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
719 #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
721 #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
723#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
724 #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
726 #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
728#define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj))
729#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY
730 #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
732 #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
735 #define CO_COROUTINE 0x80
737#ifndef CO_ASYNC_GENERATOR
738 #define CO_ASYNC_GENERATOR 0x200
740#ifndef Py_TPFLAGS_CHECKTYPES
741 #define Py_TPFLAGS_CHECKTYPES 0
743#ifndef Py_TPFLAGS_HAVE_INDEX
744 #define Py_TPFLAGS_HAVE_INDEX 0
746#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
747 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
749#ifndef Py_TPFLAGS_HAVE_FINALIZE
750 #define Py_TPFLAGS_HAVE_FINALIZE 0
752#ifndef Py_TPFLAGS_SEQUENCE
753 #define Py_TPFLAGS_SEQUENCE 0
755#ifndef Py_TPFLAGS_MAPPING
756 #define Py_TPFLAGS_MAPPING 0
758#ifndef METH_STACKLESS
759 #define METH_STACKLESS 0
761#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
762 #ifndef METH_FASTCALL
763 #define METH_FASTCALL 0x80
765 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *
const *args, Py_ssize_t nargs);
766 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *
const *args,
767 Py_ssize_t nargs, PyObject *kwnames);
769 #if PY_VERSION_HEX >= 0x030d00A4
770 # define __Pyx_PyCFunctionFast PyCFunctionFast
771 # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
773 # define __Pyx_PyCFunctionFast _PyCFunctionFast
774 # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
777#if CYTHON_METH_FASTCALL
778 #define __Pyx_METH_FASTCALL METH_FASTCALL
779 #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
780 #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
782 #define __Pyx_METH_FASTCALL METH_VARARGS
783 #define __Pyx_PyCFunction_FastCall PyCFunction
784 #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
787 #define __pyx_vectorcallfunc vectorcallfunc
788 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET
789 #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n))
790#elif CYTHON_BACKPORT_VECTORCALL
791 typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *
const *args,
792 size_t nargsf, PyObject *kwnames);
793 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1))
794 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET))
796 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0
797 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n))
799#if PY_MAJOR_VERSION >= 0x030900B1
800#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func)
802#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func)
804#define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func)
805#if CYTHON_COMPILING_IN_CPYTHON
806#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth)
807#elif !CYTHON_COMPILING_IN_LIMITED_API
808#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func)
810#if CYTHON_COMPILING_IN_CPYTHON
811#define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags)
812static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) {
813 return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self;
816static CYTHON_INLINE
int __Pyx__IsSameCFunction(PyObject *func,
void *cfunc) {
817#if CYTHON_COMPILING_IN_LIMITED_API
818 return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
820 return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
823#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc)
824#if __PYX_LIMITED_VERSION_HEX < 0x030900B1
825 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b))
826 typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *
const *, size_t, PyObject *);
828 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b)
829 #define __Pyx_PyCMethod PyCMethod
832 #define METH_METHOD 0x200
834#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
835 #define PyObject_Malloc(s) PyMem_Malloc(s)
836 #define PyObject_Free(p) PyMem_Free(p)
837 #define PyObject_Realloc(p) PyMem_Realloc(p)
839#if CYTHON_COMPILING_IN_LIMITED_API
840 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
841 #define __Pyx_PyFrame_SetLineNumber(frame, lineno)
843 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
844 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
846#if CYTHON_COMPILING_IN_LIMITED_API
847 #define __Pyx_PyThreadState_Current PyThreadState_Get()
848#elif !CYTHON_FAST_THREAD_STATE
849 #define __Pyx_PyThreadState_Current PyThreadState_GET()
850#elif PY_VERSION_HEX >= 0x030d00A1
851 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
852#elif PY_VERSION_HEX >= 0x03060000
853 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
854#elif PY_VERSION_HEX >= 0x03000000
855 #define __Pyx_PyThreadState_Current PyThreadState_GET()
857 #define __Pyx_PyThreadState_Current _PyThreadState_Current
859#if CYTHON_COMPILING_IN_LIMITED_API
860static CYTHON_INLINE
void *__Pyx_PyModule_GetState(PyObject *op)
863 result = PyModule_GetState(op);
865 Py_FatalError(
"Couldn't find the module state");
869#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype)
870#if CYTHON_COMPILING_IN_LIMITED_API
871 #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name))
873 #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name)
875#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
877#define Py_tss_NEEDS_INIT 0
879static CYTHON_INLINE
int PyThread_tss_create(Py_tss_t *key) {
880 *key = PyThread_create_key();
883static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(
void) {
884 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(
sizeof(Py_tss_t));
885 *key = Py_tss_NEEDS_INIT;
888static CYTHON_INLINE
void PyThread_tss_free(Py_tss_t *key) {
891static CYTHON_INLINE
int PyThread_tss_is_created(Py_tss_t *key) {
892 return *key != Py_tss_NEEDS_INIT;
894static CYTHON_INLINE
void PyThread_tss_delete(Py_tss_t *key) {
895 PyThread_delete_key(*key);
896 *key = Py_tss_NEEDS_INIT;
898static CYTHON_INLINE
int PyThread_tss_set(Py_tss_t *key,
void *value) {
899 return PyThread_set_key_value(*key, value);
901static CYTHON_INLINE
void * PyThread_tss_get(Py_tss_t *key) {
902 return PyThread_get_key_value(*key);
905#if PY_MAJOR_VERSION < 3
906 #if CYTHON_COMPILING_IN_PYPY
907 #if PYPY_VERSION_NUM < 0x07030600
908 #if defined(__cplusplus) && __cplusplus >= 201402L
909 [[deprecated(
"`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]]
910 #elif defined(__GNUC__) || defined(__clang__)
911 __attribute__ ((__deprecated__(
"`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")))
912 #elif defined(_MSC_VER)
913 __declspec(deprecated(
"`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))
915 static CYTHON_INLINE
int PyGILState_Check(
void) {
921 static CYTHON_INLINE
int PyGILState_Check(
void) {
922 PyThreadState * tstate = _PyThreadState_Current;
923 return tstate && (tstate == PyGILState_GetThisThreadState());
927#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized)
928#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
930#define __Pyx_PyDict_NewPresized(n) PyDict_New()
932#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
933 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
934 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
936 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
937 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
939#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS
940#define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
941static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
942 PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
943 if (res == NULL) PyErr_Clear();
946#elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000)
947#define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError
948#define __Pyx_PyDict_GetItemStr PyDict_GetItem
950static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
951#if CYTHON_COMPILING_IN_PYPY
952 return PyDict_GetItem(dict, name);
955 PyDictObject *mp = (PyDictObject*) dict;
956 long hash = ((PyStringObject *) name)->ob_shash;
958 ep = (mp->ma_lookup)(mp, name, hash);
965#define __Pyx_PyDict_GetItemStr PyDict_GetItem
967#if CYTHON_USE_TYPE_SLOTS
968 #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags)
969 #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
970 #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext)
972 #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp))
973 #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature)
974 #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next
976#if CYTHON_COMPILING_IN_LIMITED_API
977 #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v)
979 #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v)
981#if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000
982#define __Pyx_PyHeapTypeObject_GC_Del(obj) {\
983 PyTypeObject *type = Py_TYPE((PyObject*)obj);\
984 assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
985 PyObject_GC_Del(obj);\
989#define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj)
991#if CYTHON_COMPILING_IN_LIMITED_API
992 #define CYTHON_PEP393_ENABLED 1
993 #define __Pyx_PyUnicode_READY(op) (0)
994 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u)
995 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
996 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U)
997 #define __Pyx_PyUnicode_KIND(u) ((void)u, (0))
998 #define __Pyx_PyUnicode_DATA(u) ((void*)u)
999 #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
1000 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u))
1001#elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
1002 #define CYTHON_PEP393_ENABLED 1
1003 #if PY_VERSION_HEX >= 0x030C0000
1004 #define __Pyx_PyUnicode_READY(op) (0)
1006 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
1007 0 : _PyUnicode_Ready((PyObject *)(op)))
1009 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
1010 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
1011 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
1012 #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u))
1013 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
1014 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
1015 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch)
1016 #if PY_VERSION_HEX >= 0x030C0000
1017 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
1019 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
1020 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
1022 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
1026 #define CYTHON_PEP393_ENABLED 0
1027 #define PyUnicode_1BYTE_KIND 1
1028 #define PyUnicode_2BYTE_KIND 2
1029 #define PyUnicode_4BYTE_KIND 4
1030 #define __Pyx_PyUnicode_READY(op) (0)
1031 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
1032 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
1033 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U)
1034 #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE))
1035 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
1036 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
1037 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch)
1038 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
1040#if CYTHON_COMPILING_IN_PYPY
1041 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
1042 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
1044 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
1045 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
1046 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
1048#if CYTHON_COMPILING_IN_PYPY
1049 #if !defined(PyUnicode_DecodeUnicodeEscape)
1050 #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors)
1052 #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500)
1053 #undef PyUnicode_Contains
1054 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
1056 #if !defined(PyByteArray_Check)
1057 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
1059 #if !defined(PyObject_Format)
1060 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
1063#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))
1064#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
1065#if PY_MAJOR_VERSION >= 3
1066 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
1068 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
1070#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
1071 #define PyObject_ASCII(o) PyObject_Repr(o)
1073#if PY_MAJOR_VERSION >= 3
1074 #define PyBaseString_Type PyUnicode_Type
1075 #define PyStringObject PyUnicodeObject
1076 #define PyString_Type PyUnicode_Type
1077 #define PyString_Check PyUnicode_Check
1078 #define PyString_CheckExact PyUnicode_CheckExact
1079#ifndef PyObject_Unicode
1080 #define PyObject_Unicode PyObject_Str
1083#if PY_MAJOR_VERSION >= 3
1084 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
1085 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
1087 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
1088 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
1090#if CYTHON_COMPILING_IN_CPYTHON
1091 #define __Pyx_PySequence_ListKeepNew(obj)\
1092 (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
1094 #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj)
1096#ifndef PySet_CheckExact
1097 #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type)
1099#if PY_VERSION_HEX >= 0x030900A4
1100 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
1101 #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
1103 #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
1104 #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
1106#if CYTHON_ASSUME_SAFE_MACROS
1107 #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i)
1108 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
1109 #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0))
1110 #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
1111 #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o)
1112 #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o)
1113 #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o)
1114 #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
1115 #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
1117 #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i)
1118 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
1119 #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v)
1120 #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
1121 #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o)
1122 #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o)
1123 #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o)
1124 #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
1125 #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
1127#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
1128 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
1130 static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(
const char *name) {
1131 PyObject *
module = PyImport_AddModule(name);
1136#if PY_MAJOR_VERSION >= 3
1137 #define PyIntObject PyLongObject
1138 #define PyInt_Type PyLong_Type
1139 #define PyInt_Check(op) PyLong_Check(op)
1140 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
1141 #define __Pyx_Py3Int_Check(op) PyLong_Check(op)
1142 #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op)
1143 #define PyInt_FromString PyLong_FromString
1144 #define PyInt_FromUnicode PyLong_FromUnicode
1145 #define PyInt_FromLong PyLong_FromLong
1146 #define PyInt_FromSize_t PyLong_FromSize_t
1147 #define PyInt_FromSsize_t PyLong_FromSsize_t
1148 #define PyInt_AsLong PyLong_AsLong
1149 #define PyInt_AS_LONG PyLong_AS_LONG
1150 #define PyInt_AsSsize_t PyLong_AsSsize_t
1151 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
1152 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
1153 #define PyNumber_Int PyNumber_Long
1155 #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op))
1156 #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op))
1158#if PY_MAJOR_VERSION >= 3
1159 #define PyBoolObject PyLongObject
1161#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
1162 #ifndef PyUnicode_InternFromString
1163 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
1166#if PY_VERSION_HEX < 0x030200A4
1167 typedef long Py_hash_t;
1168 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
1169 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
1171 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
1172 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
1174#if CYTHON_USE_ASYNC_SLOTS
1175 #if PY_VERSION_HEX >= 0x030500B1
1176 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
1177 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
1179 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
1182 #define __Pyx_PyType_AsAsync(obj) NULL
1184#ifndef __Pyx_PyAsyncMethodsStruct
1189 } __Pyx_PyAsyncMethodsStruct;
1192#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
1193 #if !defined(_USE_MATH_DEFINES)
1194 #define _USE_MATH_DEFINES
1199#define __PYX_NAN() ((float) NAN)
1201static CYTHON_INLINE
float __PYX_NAN() {
1203 memset(&value, 0xFF,
sizeof(value));
1207#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
1208#define __Pyx_truncl trunc
1210#define __Pyx_truncl truncl
1213#define __PYX_MARK_ERR_POS(f_index, lineno) \
1214 { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
1215#define __PYX_ERR(f_index, lineno, Ln_error) \
1216 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
1218#ifdef CYTHON_EXTERN_C
1219 #undef __PYX_EXTERN_C
1220 #define __PYX_EXTERN_C CYTHON_EXTERN_C
1221#elif defined(__PYX_EXTERN_C)
1223 #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.")
1225 #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.
1228 #define __PYX_EXTERN_C extern "C++"
1231#define __PYX_HAVE__pyinfile
1232#define __PYX_HAVE_API__pyinfile
1245#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
1246#define CYTHON_WITHOUT_ASSERTIONS
1249typedef struct {PyObject **p;
const char *s;
const Py_ssize_t n;
const char* encoding;
1250 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
1252#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
1253#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
1254#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
1255#define __PYX_DEFAULT_STRING_ENCODING ""
1256#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
1257#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
1258#define __Pyx_uchar_cast(c) ((unsigned char)c)
1259#define __Pyx_long_cast(x) ((long)x)
1260#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
1261 (sizeof(type) < sizeof(Py_ssize_t)) ||\
1262 (sizeof(type) > sizeof(Py_ssize_t) &&\
1263 likely(v < (type)PY_SSIZE_T_MAX ||\
1264 v == (type)PY_SSIZE_T_MAX) &&\
1265 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
1266 v == (type)PY_SSIZE_T_MIN))) ||\
1267 (sizeof(type) == sizeof(Py_ssize_t) &&\
1268 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
1269 v == (type)PY_SSIZE_T_MAX))) )
1270static CYTHON_INLINE
int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
1271 return (
size_t) i < (size_t) limit;
1273#if defined (__cplusplus) && __cplusplus >= 201103L
1275 #define __Pyx_sst_abs(value) std::abs(value)
1276#elif SIZEOF_INT >= SIZEOF_SIZE_T
1277 #define __Pyx_sst_abs(value) abs(value)
1278#elif SIZEOF_LONG >= SIZEOF_SIZE_T
1279 #define __Pyx_sst_abs(value) labs(value)
1280#elif defined (_MSC_VER)
1281 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
1282#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
1283 #define __Pyx_sst_abs(value) llabs(value)
1284#elif defined (__GNUC__)
1285 #define __Pyx_sst_abs(value) __builtin_llabs(value)
1287 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
1289static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(
const char *s);
1290static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
1291static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
1292static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(
const char*);
1293#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
1294#define __Pyx_PyBytes_FromString PyBytes_FromString
1295#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
1296static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
1297#if PY_MAJOR_VERSION < 3
1298 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
1299 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
1301 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
1302 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
1304#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
1305#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
1306#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
1307#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
1308#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
1309#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
1310#define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1311#define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1312#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1313#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
1314#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
1315#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
1316#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
1317#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
1318#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
1319#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
1320#define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o)
1321#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
1322#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
1323#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
1324static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
1325static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
1326static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
1327static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
1328#define __Pyx_PySequence_Tuple(obj)\
1329 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
1330static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
1331static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
1332static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
1333#if CYTHON_ASSUME_SAFE_MACROS
1334#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
1336#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
1338#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
1339#if PY_MAJOR_VERSION >= 3
1340#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
1342#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
1344#if CYTHON_USE_PYLONG_INTERNALS
1345 #if PY_VERSION_HEX >= 0x030C00A7
1346 #ifndef _PyLong_SIGN_MASK
1347 #define _PyLong_SIGN_MASK 3
1349 #ifndef _PyLong_NON_SIZE_BITS
1350 #define _PyLong_NON_SIZE_BITS 3
1352 #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK)
1353 #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0)
1354 #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x))
1355 #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1)
1356 #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0)
1357 #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0])
1358 #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
1359 #define __Pyx_PyLong_SignedDigitCount(x)\
1360 ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
1361 #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
1362 #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x)
1363 #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x)
1365 #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
1366 #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
1368 typedef Py_ssize_t __Pyx_compact_pylong;
1369 typedef size_t __Pyx_compact_upylong;
1371 #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0)
1372 #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0)
1373 #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0)
1374 #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0)
1375 #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
1376 #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x))
1377 #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x)
1378 #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
1379 #define __Pyx_PyLong_CompactValue(x)\
1380 ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
1381 typedef sdigit __Pyx_compact_pylong;
1382 typedef digit __Pyx_compact_upylong;
1384 #if PY_VERSION_HEX >= 0x030C00A5
1385 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit)
1387 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit)
1390#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1392static int __Pyx_sys_getdefaultencoding_not_ascii;
1393static int __Pyx_init_sys_getdefaultencoding_params(
void) {
1395 PyObject* default_encoding = NULL;
1396 PyObject* ascii_chars_u = NULL;
1397 PyObject* ascii_chars_b = NULL;
1398 const char* default_encoding_c;
1399 sys = PyImport_ImportModule(
"sys");
1401 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
1403 if (!default_encoding)
goto bad;
1404 default_encoding_c = PyBytes_AsString(default_encoding);
1405 if (!default_encoding_c)
goto bad;
1406 if (strcmp(default_encoding_c,
"ascii") == 0) {
1407 __Pyx_sys_getdefaultencoding_not_ascii = 0;
1409 char ascii_chars[128];
1411 for (c = 0; c < 128; c++) {
1412 ascii_chars[c] = (char) c;
1414 __Pyx_sys_getdefaultencoding_not_ascii = 1;
1415 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
1416 if (!ascii_chars_u)
goto bad;
1417 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
1418 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
1421 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
1422 default_encoding_c);
1425 Py_DECREF(ascii_chars_u);
1426 Py_DECREF(ascii_chars_b);
1428 Py_DECREF(default_encoding);
1431 Py_XDECREF(default_encoding);
1432 Py_XDECREF(ascii_chars_u);
1433 Py_XDECREF(ascii_chars_b);
1437#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
1438#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
1440#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
1441#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
1443static char* __PYX_DEFAULT_STRING_ENCODING;
1444static int __Pyx_init_sys_getdefaultencoding_params(
void) {
1446 PyObject* default_encoding = NULL;
1447 char* default_encoding_c;
1448 sys = PyImport_ImportModule(
"sys");
1450 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
1452 if (!default_encoding)
goto bad;
1453 default_encoding_c = PyBytes_AsString(default_encoding);
1454 if (!default_encoding_c)
goto bad;
1455 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c) + 1);
1456 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
1457 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
1458 Py_DECREF(default_encoding);
1461 Py_XDECREF(default_encoding);
1469#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
1470 #define likely(x) __builtin_expect(!!(x), 1)
1471 #define unlikely(x) __builtin_expect(!!(x), 0)
1473 #define likely(x) (x)
1474 #define unlikely(x) (x)
1476static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
1478#if !CYTHON_USE_MODULE_STATE
1479static PyObject *__pyx_m = NULL;
1481static int __pyx_lineno;
1482static int __pyx_clineno = 0;
1483static const char * __pyx_cfilenm = __FILE__;
1484static const char *__pyx_filename;
1488static const char *__pyx_f[] = {
1495#ifndef __PYX_FORCE_INIT_THREADS
1496 #define __PYX_FORCE_INIT_THREADS 0
1508#ifndef CYTHON_REFNANNY
1509 #define CYTHON_REFNANNY 0
1513 void (*INCREF)(
void*, PyObject*, Py_ssize_t);
1514 void (*DECREF)(
void*, PyObject*, Py_ssize_t);
1515 void (*GOTREF)(
void*, PyObject*, Py_ssize_t);
1516 void (*GIVEREF)(
void*, PyObject*, Py_ssize_t);
1517 void* (*SetupContext)(
const char*, Py_ssize_t,
const char*);
1518 void (*FinishContext)(
void**);
1519 } __Pyx_RefNannyAPIStruct;
1520 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1521 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1522 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1524 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1526 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1527 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
1528 PyGILState_Release(__pyx_gilstate_save);\
1530 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
1532 #define __Pyx_RefNannyFinishContextNogil() {\
1533 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1534 __Pyx_RefNannyFinishContext();\
1535 PyGILState_Release(__pyx_gilstate_save);\
1538 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1539 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__))
1540 #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext()
1542 #define __Pyx_RefNannyFinishContextNogil() {\
1543 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1544 __Pyx_RefNannyFinishContext();\
1545 PyGILState_Release(__pyx_gilstate_save);\
1547 #define __Pyx_RefNannyFinishContext()\
1548 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1549 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
1550 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
1551 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
1552 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
1553 #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0)
1554 #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0)
1555 #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0)
1556 #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0)
1558 #define __Pyx_RefNannyDeclarations
1559 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1560 #define __Pyx_RefNannyFinishContextNogil()
1561 #define __Pyx_RefNannyFinishContext()
1562 #define __Pyx_INCREF(r) Py_INCREF(r)
1563 #define __Pyx_DECREF(r) Py_DECREF(r)
1564 #define __Pyx_GOTREF(r)
1565 #define __Pyx_GIVEREF(r)
1566 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1567 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1568 #define __Pyx_XGOTREF(r)
1569 #define __Pyx_XGIVEREF(r)
1571#define __Pyx_Py_XDECREF_SET(r, v) do {\
1572 PyObject *tmp = (PyObject *) r;\
1573 r = v; Py_XDECREF(tmp);\
1575#define __Pyx_XDECREF_SET(r, v) do {\
1576 PyObject *tmp = (PyObject *) r;\
1577 r = v; __Pyx_XDECREF(tmp);\
1579#define __Pyx_DECREF_SET(r, v) do {\
1580 PyObject *tmp = (PyObject *) r;\
1581 r = v; __Pyx_DECREF(tmp);\
1583#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1584#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1587#if CYTHON_FAST_THREAD_STATE
1588#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1589static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1591#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1595#if CYTHON_FAST_THREAD_STATE
1596#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1597#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1598#if PY_VERSION_HEX >= 0x030C00A6
1599#define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL)
1600#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL)
1602#define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL)
1603#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type)
1606#define __Pyx_PyThreadState_declare
1607#define __Pyx_PyThreadState_assign
1608#define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL)
1609#define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred()
1613#if CYTHON_FAST_THREAD_STATE
1614#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1615#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1616#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1617#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1618#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1619static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1620static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1621#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6
1622#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1624#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1627#define __Pyx_PyErr_Clear() PyErr_Clear()
1628#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1629#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1630#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1631#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1632#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1633#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1634#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1638#if CYTHON_USE_TYPE_SLOTS
1639static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1641#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1645static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
1648static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1651#if CYTHON_FAST_PYCALL
1652#if !CYTHON_VECTORCALL
1653#define __Pyx_PyFunction_FastCall(func, args, nargs)\
1654 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1655static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1657#define __Pyx_BUILD_ASSERT_EXPR(cond)\
1658 (sizeof(char [1 - 2*!(cond)]) - 1)
1659#ifndef Py_MEMBER_SIZE
1660#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1662#if !CYTHON_VECTORCALL
1663#if PY_VERSION_HEX >= 0x03080000
1664 #include "frameobject.h"
1665#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API
1666 #ifndef Py_BUILD_CORE
1667 #define Py_BUILD_CORE 1
1669 #include "internal/pycore_frame.h"
1671 #define __Pxy_PyFrame_Initialize_Offsets()
1672 #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus)
1674 static size_t __pyx_pyframe_localsplus_offset = 0;
1675 #include "frameobject.h"
1676 #define __Pxy_PyFrame_Initialize_Offsets()\
1677 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1678 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1679 #define __Pyx_PyFrame_GetLocalsplus(frame)\
1680 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1686#if CYTHON_COMPILING_IN_CPYTHON
1687static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1689#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1693#if CYTHON_COMPILING_IN_CPYTHON
1694static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1698#define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL)
1699static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args,
size_t nargs, PyObject *kwargs);
1702#if CYTHON_USE_CPP_STD_MOVE
1704 #define __PYX_STD_MOVE_IF_SUPPORTED(x) std::move(x)
1706 #define __PYX_STD_MOVE_IF_SUPPORTED(x) x
1710static PyObject* __Pyx_PyExec3(PyObject*, PyObject*, PyObject*);
1711static CYTHON_INLINE PyObject* __Pyx_PyExec2(PyObject*, PyObject*);
1714static CYTHON_INLINE
int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict,
int eq) {
1715 int result = PyDict_Contains(dict, item);
1716 return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
1720#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
1721static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
1722#define __Pyx_PyObject_Dict_GetItem(obj, name)\
1723 (likely(PyDict_CheckExact(obj)) ?\
1724 __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
1726#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
1727#define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
1731static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1734#if CYTHON_USE_TYPE_SLOTS && PY_MAJOR_VERSION >= 3
1735#define __Pyx_PyCallable_Check(obj) (Py_TYPE(obj)->tp_call != NULL)
1737#define __Pyx_PyCallable_Check(obj) PyCallable_Check(obj)
1744static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
1747static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1750static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple);
1751#if PY_MAJOR_VERSION >= 3
1752static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple);
1756#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1757#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1758#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1759#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1760 (version_var) = __PYX_GET_DICT_VERSION(dict);\
1761 (cache_var) = (value);
1762#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1763 static PY_UINT64_T __pyx_dict_version = 0;\
1764 static PyObject *__pyx_dict_cached_value = NULL;\
1765 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1766 (VAR) = __pyx_dict_cached_value;\
1768 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1769 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1772static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1773static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1774static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1776#define __PYX_GET_DICT_VERSION(dict) (0)
1777#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1778#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1782#if CYTHON_USE_DICT_VERSIONS
1783#define __Pyx_GetModuleGlobalName(var, name) do {\
1784 static PY_UINT64_T __pyx_dict_version = 0;\
1785 static PyObject *__pyx_dict_cached_value = NULL;\
1786 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1787 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1788 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1790#define __Pyx_GetModuleGlobalNameUncached(var, name) do {\
1791 PY_UINT64_T __pyx_dict_version;\
1792 PyObject *__pyx_dict_cached_value;\
1793 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1795static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1797#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1798#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1799static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1803#ifndef __PYX_HAVE_RT_ImportType_proto_3_0_11
1804#define __PYX_HAVE_RT_ImportType_proto_3_0_11
1805#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
1806#include <stdalign.h>
1808#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
1809#define __PYX_GET_STRUCT_ALIGNMENT_3_0_11(s) alignof(s)
1811#define __PYX_GET_STRUCT_ALIGNMENT_3_0_11(s) sizeof(void*)
1813enum __Pyx_ImportType_CheckSize_3_0_11 {
1814 __Pyx_ImportType_CheckSize_Error_3_0_11 = 0,
1815 __Pyx_ImportType_CheckSize_Warn_3_0_11 = 1,
1816 __Pyx_ImportType_CheckSize_Ignore_3_0_11 = 2
1818static PyTypeObject *__Pyx_ImportType_3_0_11(PyObject* module,
const char *module_name,
const char *class_name,
size_t size,
size_t alignment,
enum __Pyx_ImportType_CheckSize_3_0_11 check_size);
1822#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
1823static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1827#if CYTHON_FAST_THREAD_STATE
1828#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1829static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1830#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1831static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1833#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1834#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1838#if CYTHON_FAST_THREAD_STATE
1839#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1840static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1842static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1846#ifdef CYTHON_CLINE_IN_TRACEBACK
1847#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1849static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
1853#if !CYTHON_COMPILING_IN_LIMITED_API
1855 PyCodeObject* code_object;
1857} __Pyx_CodeObjectCacheEntry;
1858struct __Pyx_CodeObjectCache {
1861 __Pyx_CodeObjectCacheEntry* entries;
1863static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1864static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
1865static PyCodeObject *__pyx_find_code_object(
int code_line);
1866static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
1870static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
1871 int py_line,
const char *filename);
1874#ifndef __Pyx_CppExn2PyErr
1879static void __Pyx_CppExn2PyErr() {
1881 if (PyErr_Occurred())
1885 }
catch (
const std::bad_alloc& exn) {
1886 PyErr_SetString(PyExc_MemoryError, exn.what());
1887 }
catch (
const std::bad_cast& exn) {
1888 PyErr_SetString(PyExc_TypeError, exn.what());
1889 }
catch (
const std::bad_typeid& exn) {
1890 PyErr_SetString(PyExc_TypeError, exn.what());
1891 }
catch (
const std::domain_error& exn) {
1892 PyErr_SetString(PyExc_ValueError, exn.what());
1893 }
catch (
const std::invalid_argument& exn) {
1894 PyErr_SetString(PyExc_ValueError, exn.what());
1895 }
catch (
const std::ios_base::failure& exn) {
1896 PyErr_SetString(PyExc_IOError, exn.what());
1897 }
catch (
const std::out_of_range& exn) {
1898 PyErr_SetString(PyExc_IndexError, exn.what());
1899 }
catch (
const std::overflow_error& exn) {
1900 PyErr_SetString(PyExc_OverflowError, exn.what());
1901 }
catch (
const std::range_error& exn) {
1902 PyErr_SetString(PyExc_ArithmeticError, exn.what());
1903 }
catch (
const std::underflow_error& exn) {
1904 PyErr_SetString(PyExc_ArithmeticError, exn.what());
1905 }
catch (
const std::exception& exn) {
1906 PyErr_SetString(PyExc_RuntimeError, exn.what());
1910 PyErr_SetString(PyExc_RuntimeError,
"Unknown exception");
1916#if CYTHON_COMPILING_IN_LIMITED_API
1917typedef PyObject *__Pyx_TypeName;
1918#define __Pyx_FMT_TYPENAME "%U"
1919static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp);
1920#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
1922typedef const char *__Pyx_TypeName;
1923#define __Pyx_FMT_TYPENAME "%.200s"
1924#define __Pyx_PyType_GetName(tp) ((tp)->tp_name)
1925#define __Pyx_DECREF_TypeName(obj)
1929#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
1930#define __Pyx_HAS_GCC_DIAGNOSTIC
1934static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
1937static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
1940static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
1943#if CYTHON_COMPILING_IN_CPYTHON
1944#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1945#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2)
1946static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1947static CYTHON_INLINE
int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b);
1948static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1949static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1951#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1952#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2))
1953#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1954#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1956#define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
1957#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1960static unsigned long __Pyx_get_runtime_version(
void);
1961static int __Pyx_check_binary_version(
unsigned long ct_version,
unsigned long rt_version,
int allow_newer);
1964static int __Pyx_ExportFunction(
const char *name,
void (*f)(
void),
const char *sig);
1967static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1988static std::string __pyx_f_8pyinfile_str_py_to_cpp(PyObject *);
1989static PyObject *__pyx_f_8pyinfile_std_string_to_py(std::string);
1992static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string(std::string
const &);
1993static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(std::string
const &);
1994static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string(std::string
const &);
1995static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(std::string
const &);
1996static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string(std::string
const &);
1999#define __Pyx_MODULE_NAME "pyinfile"
2000extern int __pyx_module_is_main_pyinfile;
2001int __pyx_module_is_main_pyinfile = 0;
2005static PyObject *__pyx_builtin_ImportError;
2006static PyObject *__pyx_builtin_RuntimeError;
2008static const char __pyx_k_[] =
"\n";
2009static const char __pyx_k__4[] =
".";
2010static const char __pyx_k__5[] =
"*";
2011static const char __pyx_k__7[] =
"?";
2012static const char __pyx_k_json[] =
"json";
2013static const char __pyx_k_main[] =
"__main__";
2014static const char __pyx_k_name[] =
"__name__";
2015static const char __pyx_k_spec[] =
"__spec__";
2016static const char __pyx_k_test[] =
"__test__";
2017static const char __pyx_k_dumps[] =
"dumps";
2018static const char __pyx_k_loads[] =
"loads";
2019static const char __pyx_k_decode[] =
"decode";
2020static const char __pyx_k_encode[] =
"encode";
2021static const char __pyx_k_import[] =
"__import__";
2022static const char __pyx_k_indent[] =
"indent";
2023static const char __pyx_k_pprint[] =
"pprint";
2024static const char __pyx_k_Mapping[] =
"Mapping";
2025static const char __pyx_k_pformat[] =
"pformat";
2026static const char __pyx_k_builtins[] =
"__builtins__";
2027static const char __pyx_k_endswith[] =
"endswith";
2028static const char __pyx_k_pprintpp[] =
"pprintpp";
2029static const char __pyx_k_sort_keys[] =
"sort_keys";
2030static const char __pyx_k_SIMULATION[] =
"SIMULATION";
2031static const char __pyx_k_Simulation[] =
"Simulation";
2032static const char __pyx_k_simulation[] =
"simulation";
2033static const char __pyx_k_ImportError[] =
"ImportError";
2034static const char __pyx_k_RuntimeError[] =
"RuntimeError";
2035static const char __pyx_k_SIMULATION_2[] =
"SIMULATION = ";
2036static const char __pyx_k_initializing[] =
"_initializing";
2037static const char __pyx_k_collections_abc[] =
"collections.abc";
2038static const char __pyx_k_cline_in_traceback[] =
"cline_in_traceback";
2039static const char __pyx_k_Cyclus_Python_input_file_tools[] =
"Cyclus Python input file tools.";
2040static const char __pyx_k_simulation_not_found_in_python_f[] =
"simulation not found in python file.";
2041static const char __pyx_k_top_level_simulation_object_does[] =
"top-level simulation object does not have proper type.";
2048 PyObject *__pyx_cython_runtime;
2049 PyObject *__pyx_empty_tuple;
2050 PyObject *__pyx_empty_bytes;
2051 PyObject *__pyx_empty_unicode;
2052 #ifdef __Pyx_CyFunction_USED
2053 PyTypeObject *__pyx_CyFunctionType;
2055 #ifdef __Pyx_FusedFunction_USED
2056 PyTypeObject *__pyx_FusedFunctionType;
2058 #ifdef __Pyx_Generator_USED
2059 PyTypeObject *__pyx_GeneratorType;
2061 #ifdef __Pyx_IterableCoroutine_USED
2062 PyTypeObject *__pyx_IterableCoroutineType;
2064 #ifdef __Pyx_Coroutine_USED
2065 PyTypeObject *__pyx_CoroutineAwaitType;
2067 #ifdef __Pyx_Coroutine_USED
2068 PyTypeObject *__pyx_CoroutineType;
2070 #if CYTHON_USE_MODULE_STATE
2072 #if CYTHON_USE_MODULE_STATE
2074 #if CYTHON_USE_MODULE_STATE
2076 #if CYTHON_USE_MODULE_STATE
2078 #if CYTHON_USE_MODULE_STATE
2080 PyTypeObject *__pyx_ptype_7cpython_4type_type;
2081 #if CYTHON_USE_MODULE_STATE
2083 #if CYTHON_USE_MODULE_STATE
2085 #if CYTHON_USE_MODULE_STATE
2087 #if CYTHON_USE_MODULE_STATE
2089 PyObject *__pyx_kp_u_;
2090 PyObject *__pyx_n_s_ImportError;
2091 PyObject *__pyx_n_s_Mapping;
2092 PyObject *__pyx_n_s_RuntimeError;
2093 PyObject *__pyx_n_u_SIMULATION;
2094 PyObject *__pyx_kp_u_SIMULATION_2;
2095 PyObject *__pyx_n_u_Simulation;
2096 PyObject *__pyx_kp_u__4;
2097 PyObject *__pyx_n_s__5;
2098 PyObject *__pyx_n_s__7;
2099 PyObject *__pyx_n_s_builtins;
2100 PyObject *__pyx_n_s_cline_in_traceback;
2101 PyObject *__pyx_n_s_collections_abc;
2102 PyObject *__pyx_n_s_decode;
2103 PyObject *__pyx_n_s_dumps;
2104 PyObject *__pyx_n_s_encode;
2105 PyObject *__pyx_n_s_endswith;
2106 PyObject *__pyx_n_s_import;
2107 PyObject *__pyx_n_s_indent;
2108 PyObject *__pyx_n_s_initializing;
2109 PyObject *__pyx_n_s_json;
2110 PyObject *__pyx_n_s_loads;
2111 PyObject *__pyx_n_s_main;
2112 PyObject *__pyx_n_s_name;
2113 PyObject *__pyx_n_s_pformat;
2114 PyObject *__pyx_n_s_pprint;
2115 PyObject *__pyx_n_s_pprintpp;
2116 PyObject *__pyx_n_u_simulation;
2117 PyObject *__pyx_kp_u_simulation_not_found_in_python_f;
2118 PyObject *__pyx_n_s_sort_keys;
2119 PyObject *__pyx_n_s_spec;
2120 PyObject *__pyx_n_s_test;
2121 PyObject *__pyx_kp_u_top_level_simulation_object_does;
2122 PyObject *__pyx_int_1;
2123 PyObject *__pyx_tuple__2;
2124 PyObject *__pyx_tuple__3;
2125 PyObject *__pyx_tuple__6;
2128#if CYTHON_USE_MODULE_STATE
2131 extern struct PyModuleDef __pyx_moduledef;
2134static struct PyModuleDef __pyx_moduledef;
2137#define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o))
2139#define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef)))
2141#define __pyx_m (PyState_FindModule(&__pyx_moduledef))
2143static __pyx_mstate __pyx_mstate_global_static =
2149static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static;
2152#if CYTHON_USE_MODULE_STATE
2153static int __pyx_m_clear(PyObject *m) {
2154 __pyx_mstate *clear_module_state = __pyx_mstate(m);
2155 if (!clear_module_state)
return 0;
2156 Py_CLEAR(clear_module_state->__pyx_d);
2157 Py_CLEAR(clear_module_state->__pyx_b);
2158 Py_CLEAR(clear_module_state->__pyx_cython_runtime);
2159 Py_CLEAR(clear_module_state->__pyx_empty_tuple);
2160 Py_CLEAR(clear_module_state->__pyx_empty_bytes);
2161 Py_CLEAR(clear_module_state->__pyx_empty_unicode);
2162 #ifdef __Pyx_CyFunction_USED
2163 Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
2165 #ifdef __Pyx_FusedFunction_USED
2166 Py_CLEAR(clear_module_state->__pyx_FusedFunctionType);
2168 Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type);
2169 Py_CLEAR(clear_module_state->__pyx_kp_u_);
2170 Py_CLEAR(clear_module_state->__pyx_n_s_ImportError);
2171 Py_CLEAR(clear_module_state->__pyx_n_s_Mapping);
2172 Py_CLEAR(clear_module_state->__pyx_n_s_RuntimeError);
2173 Py_CLEAR(clear_module_state->__pyx_n_u_SIMULATION);
2174 Py_CLEAR(clear_module_state->__pyx_kp_u_SIMULATION_2);
2175 Py_CLEAR(clear_module_state->__pyx_n_u_Simulation);
2176 Py_CLEAR(clear_module_state->__pyx_kp_u__4);
2177 Py_CLEAR(clear_module_state->__pyx_n_s__5);
2178 Py_CLEAR(clear_module_state->__pyx_n_s__7);
2179 Py_CLEAR(clear_module_state->__pyx_n_s_builtins);
2180 Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback);
2181 Py_CLEAR(clear_module_state->__pyx_n_s_collections_abc);
2182 Py_CLEAR(clear_module_state->__pyx_n_s_decode);
2183 Py_CLEAR(clear_module_state->__pyx_n_s_dumps);
2184 Py_CLEAR(clear_module_state->__pyx_n_s_encode);
2185 Py_CLEAR(clear_module_state->__pyx_n_s_endswith);
2186 Py_CLEAR(clear_module_state->__pyx_n_s_import);
2187 Py_CLEAR(clear_module_state->__pyx_n_s_indent);
2188 Py_CLEAR(clear_module_state->__pyx_n_s_initializing);
2189 Py_CLEAR(clear_module_state->__pyx_n_s_json);
2190 Py_CLEAR(clear_module_state->__pyx_n_s_loads);
2191 Py_CLEAR(clear_module_state->__pyx_n_s_main);
2192 Py_CLEAR(clear_module_state->__pyx_n_s_name);
2193 Py_CLEAR(clear_module_state->__pyx_n_s_pformat);
2194 Py_CLEAR(clear_module_state->__pyx_n_s_pprint);
2195 Py_CLEAR(clear_module_state->__pyx_n_s_pprintpp);
2196 Py_CLEAR(clear_module_state->__pyx_n_u_simulation);
2197 Py_CLEAR(clear_module_state->__pyx_kp_u_simulation_not_found_in_python_f);
2198 Py_CLEAR(clear_module_state->__pyx_n_s_sort_keys);
2199 Py_CLEAR(clear_module_state->__pyx_n_s_spec);
2200 Py_CLEAR(clear_module_state->__pyx_n_s_test);
2201 Py_CLEAR(clear_module_state->__pyx_kp_u_top_level_simulation_object_does);
2202 Py_CLEAR(clear_module_state->__pyx_int_1);
2203 Py_CLEAR(clear_module_state->__pyx_tuple__2);
2204 Py_CLEAR(clear_module_state->__pyx_tuple__3);
2205 Py_CLEAR(clear_module_state->__pyx_tuple__6);
2210#if CYTHON_USE_MODULE_STATE
2211static int __pyx_m_traverse(PyObject *m, visitproc visit,
void *arg) {
2212 __pyx_mstate *traverse_module_state = __pyx_mstate(m);
2213 if (!traverse_module_state)
return 0;
2214 Py_VISIT(traverse_module_state->__pyx_d);
2215 Py_VISIT(traverse_module_state->__pyx_b);
2216 Py_VISIT(traverse_module_state->__pyx_cython_runtime);
2217 Py_VISIT(traverse_module_state->__pyx_empty_tuple);
2218 Py_VISIT(traverse_module_state->__pyx_empty_bytes);
2219 Py_VISIT(traverse_module_state->__pyx_empty_unicode);
2220 #ifdef __Pyx_CyFunction_USED
2221 Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
2223 #ifdef __Pyx_FusedFunction_USED
2224 Py_VISIT(traverse_module_state->__pyx_FusedFunctionType);
2226 Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type);
2227 Py_VISIT(traverse_module_state->__pyx_kp_u_);
2228 Py_VISIT(traverse_module_state->__pyx_n_s_ImportError);
2229 Py_VISIT(traverse_module_state->__pyx_n_s_Mapping);
2230 Py_VISIT(traverse_module_state->__pyx_n_s_RuntimeError);
2231 Py_VISIT(traverse_module_state->__pyx_n_u_SIMULATION);
2232 Py_VISIT(traverse_module_state->__pyx_kp_u_SIMULATION_2);
2233 Py_VISIT(traverse_module_state->__pyx_n_u_Simulation);
2234 Py_VISIT(traverse_module_state->__pyx_kp_u__4);
2235 Py_VISIT(traverse_module_state->__pyx_n_s__5);
2236 Py_VISIT(traverse_module_state->__pyx_n_s__7);
2237 Py_VISIT(traverse_module_state->__pyx_n_s_builtins);
2238 Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback);
2239 Py_VISIT(traverse_module_state->__pyx_n_s_collections_abc);
2240 Py_VISIT(traverse_module_state->__pyx_n_s_decode);
2241 Py_VISIT(traverse_module_state->__pyx_n_s_dumps);
2242 Py_VISIT(traverse_module_state->__pyx_n_s_encode);
2243 Py_VISIT(traverse_module_state->__pyx_n_s_endswith);
2244 Py_VISIT(traverse_module_state->__pyx_n_s_import);
2245 Py_VISIT(traverse_module_state->__pyx_n_s_indent);
2246 Py_VISIT(traverse_module_state->__pyx_n_s_initializing);
2247 Py_VISIT(traverse_module_state->__pyx_n_s_json);
2248 Py_VISIT(traverse_module_state->__pyx_n_s_loads);
2249 Py_VISIT(traverse_module_state->__pyx_n_s_main);
2250 Py_VISIT(traverse_module_state->__pyx_n_s_name);
2251 Py_VISIT(traverse_module_state->__pyx_n_s_pformat);
2252 Py_VISIT(traverse_module_state->__pyx_n_s_pprint);
2253 Py_VISIT(traverse_module_state->__pyx_n_s_pprintpp);
2254 Py_VISIT(traverse_module_state->__pyx_n_u_simulation);
2255 Py_VISIT(traverse_module_state->__pyx_kp_u_simulation_not_found_in_python_f);
2256 Py_VISIT(traverse_module_state->__pyx_n_s_sort_keys);
2257 Py_VISIT(traverse_module_state->__pyx_n_s_spec);
2258 Py_VISIT(traverse_module_state->__pyx_n_s_test);
2259 Py_VISIT(traverse_module_state->__pyx_kp_u_top_level_simulation_object_does);
2260 Py_VISIT(traverse_module_state->__pyx_int_1);
2261 Py_VISIT(traverse_module_state->__pyx_tuple__2);
2262 Py_VISIT(traverse_module_state->__pyx_tuple__3);
2263 Py_VISIT(traverse_module_state->__pyx_tuple__6);
2268#define __pyx_d __pyx_mstate_global->__pyx_d
2269#define __pyx_b __pyx_mstate_global->__pyx_b
2270#define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime
2271#define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple
2272#define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes
2273#define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode
2274#ifdef __Pyx_CyFunction_USED
2275#define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType
2277#ifdef __Pyx_FusedFunction_USED
2278#define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType
2280#ifdef __Pyx_Generator_USED
2281#define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType
2283#ifdef __Pyx_IterableCoroutine_USED
2284#define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType
2286#ifdef __Pyx_Coroutine_USED
2287#define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType
2289#ifdef __Pyx_Coroutine_USED
2290#define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType
2292#if CYTHON_USE_MODULE_STATE
2294#if CYTHON_USE_MODULE_STATE
2296#if CYTHON_USE_MODULE_STATE
2298#if CYTHON_USE_MODULE_STATE
2300#if CYTHON_USE_MODULE_STATE
2302#define __pyx_ptype_7cpython_4type_type __pyx_mstate_global->__pyx_ptype_7cpython_4type_type
2303#if CYTHON_USE_MODULE_STATE
2305#if CYTHON_USE_MODULE_STATE
2307#if CYTHON_USE_MODULE_STATE
2309#if CYTHON_USE_MODULE_STATE
2311#define __pyx_kp_u_ __pyx_mstate_global->__pyx_kp_u_
2312#define __pyx_n_s_ImportError __pyx_mstate_global->__pyx_n_s_ImportError
2313#define __pyx_n_s_Mapping __pyx_mstate_global->__pyx_n_s_Mapping
2314#define __pyx_n_s_RuntimeError __pyx_mstate_global->__pyx_n_s_RuntimeError
2315#define __pyx_n_u_SIMULATION __pyx_mstate_global->__pyx_n_u_SIMULATION
2316#define __pyx_kp_u_SIMULATION_2 __pyx_mstate_global->__pyx_kp_u_SIMULATION_2
2317#define __pyx_n_u_Simulation __pyx_mstate_global->__pyx_n_u_Simulation
2318#define __pyx_kp_u__4 __pyx_mstate_global->__pyx_kp_u__4
2319#define __pyx_n_s__5 __pyx_mstate_global->__pyx_n_s__5
2320#define __pyx_n_s__7 __pyx_mstate_global->__pyx_n_s__7
2321#define __pyx_n_s_builtins __pyx_mstate_global->__pyx_n_s_builtins
2322#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback
2323#define __pyx_n_s_collections_abc __pyx_mstate_global->__pyx_n_s_collections_abc
2324#define __pyx_n_s_decode __pyx_mstate_global->__pyx_n_s_decode
2325#define __pyx_n_s_dumps __pyx_mstate_global->__pyx_n_s_dumps
2326#define __pyx_n_s_encode __pyx_mstate_global->__pyx_n_s_encode
2327#define __pyx_n_s_endswith __pyx_mstate_global->__pyx_n_s_endswith
2328#define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import
2329#define __pyx_n_s_indent __pyx_mstate_global->__pyx_n_s_indent
2330#define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing
2331#define __pyx_n_s_json __pyx_mstate_global->__pyx_n_s_json
2332#define __pyx_n_s_loads __pyx_mstate_global->__pyx_n_s_loads
2333#define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main
2334#define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name
2335#define __pyx_n_s_pformat __pyx_mstate_global->__pyx_n_s_pformat
2336#define __pyx_n_s_pprint __pyx_mstate_global->__pyx_n_s_pprint
2337#define __pyx_n_s_pprintpp __pyx_mstate_global->__pyx_n_s_pprintpp
2338#define __pyx_n_u_simulation __pyx_mstate_global->__pyx_n_u_simulation
2339#define __pyx_kp_u_simulation_not_found_in_python_f __pyx_mstate_global->__pyx_kp_u_simulation_not_found_in_python_f
2340#define __pyx_n_s_sort_keys __pyx_mstate_global->__pyx_n_s_sort_keys
2341#define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec
2342#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test
2343#define __pyx_kp_u_top_level_simulation_object_does __pyx_mstate_global->__pyx_kp_u_top_level_simulation_object_does
2344#define __pyx_int_1 __pyx_mstate_global->__pyx_int_1
2345#define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2
2346#define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3
2347#define __pyx_tuple__6 __pyx_mstate_global->__pyx_tuple__6
2358static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string(std::string
const &__pyx_v_s) {
2359 PyObject *__pyx_r = NULL;
2360 __Pyx_RefNannyDeclarations
2361 PyObject *__pyx_t_1 = NULL;
2362 int __pyx_lineno = 0;
2363 const char *__pyx_filename = NULL;
2364 int __pyx_clineno = 0;
2365 __Pyx_RefNannySetupContext(
"__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string", 1);
2374 __Pyx_XDECREF(__pyx_r);
2375 __pyx_t_1 = __Pyx_PyObject_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size());
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 32, __pyx_L1_error)
2376 __Pyx_GOTREF(__pyx_t_1);
2377 __pyx_r = __pyx_t_1;
2391 __Pyx_XDECREF(__pyx_t_1);
2392 __Pyx_AddTraceback(
"string.to_py.__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
2395 __Pyx_XGIVEREF(__pyx_r);
2396 __Pyx_RefNannyFinishContext();
2408static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(std::string
const &__pyx_v_s) {
2409 PyObject *__pyx_r = NULL;
2410 __Pyx_RefNannyDeclarations
2411 PyObject *__pyx_t_1 = NULL;
2412 int __pyx_lineno = 0;
2413 const char *__pyx_filename = NULL;
2414 int __pyx_clineno = 0;
2415 __Pyx_RefNannySetupContext(
"__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string", 1);
2424 __Pyx_XDECREF(__pyx_r);
2425 __pyx_t_1 = __Pyx_PyUnicode_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size());
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 38, __pyx_L1_error)
2426 __Pyx_GOTREF(__pyx_t_1);
2427 __pyx_r = __pyx_t_1;
2441 __Pyx_XDECREF(__pyx_t_1);
2442 __Pyx_AddTraceback(
"string.to_py.__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
2445 __Pyx_XGIVEREF(__pyx_r);
2446 __Pyx_RefNannyFinishContext();
2458static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string(std::string
const &__pyx_v_s) {
2459 PyObject *__pyx_r = NULL;
2460 __Pyx_RefNannyDeclarations
2461 PyObject *__pyx_t_1 = NULL;
2462 int __pyx_lineno = 0;
2463 const char *__pyx_filename = NULL;
2464 int __pyx_clineno = 0;
2465 __Pyx_RefNannySetupContext(
"__pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string", 1);
2474 __Pyx_XDECREF(__pyx_r);
2475 __pyx_t_1 = __Pyx_PyStr_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size());
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 44, __pyx_L1_error)
2476 __Pyx_GOTREF(__pyx_t_1);
2477 __pyx_r = __pyx_t_1;
2491 __Pyx_XDECREF(__pyx_t_1);
2492 __Pyx_AddTraceback(
"string.to_py.__pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
2495 __Pyx_XGIVEREF(__pyx_r);
2496 __Pyx_RefNannyFinishContext();
2508static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(std::string
const &__pyx_v_s) {
2509 PyObject *__pyx_r = NULL;
2510 __Pyx_RefNannyDeclarations
2511 PyObject *__pyx_t_1 = NULL;
2512 int __pyx_lineno = 0;
2513 const char *__pyx_filename = NULL;
2514 int __pyx_clineno = 0;
2515 __Pyx_RefNannySetupContext(
"__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string", 1);
2524 __Pyx_XDECREF(__pyx_r);
2525 __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size());
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 50, __pyx_L1_error)
2526 __Pyx_GOTREF(__pyx_t_1);
2527 __pyx_r = __pyx_t_1;
2541 __Pyx_XDECREF(__pyx_t_1);
2542 __Pyx_AddTraceback(
"string.to_py.__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
2545 __Pyx_XGIVEREF(__pyx_r);
2546 __Pyx_RefNannyFinishContext();
2558static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string(std::string
const &__pyx_v_s) {
2559 PyObject *__pyx_r = NULL;
2560 __Pyx_RefNannyDeclarations
2561 PyObject *__pyx_t_1 = NULL;
2562 int __pyx_lineno = 0;
2563 const char *__pyx_filename = NULL;
2564 int __pyx_clineno = 0;
2565 __Pyx_RefNannySetupContext(
"__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string", 1);
2573 __Pyx_XDECREF(__pyx_r);
2574 __pyx_t_1 = __Pyx_PyByteArray_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size());
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 56, __pyx_L1_error)
2575 __Pyx_GOTREF(__pyx_t_1);
2576 __pyx_r = __pyx_t_1;
2590 __Pyx_XDECREF(__pyx_t_1);
2591 __Pyx_AddTraceback(
"string.to_py.__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
2594 __Pyx_XGIVEREF(__pyx_r);
2595 __Pyx_RefNannyFinishContext();
2607static PyObject *__pyx_f_8pyinfile_std_string_to_py(std::string __pyx_v_x) {
2608 PyObject *__pyx_v_pyx = NULL;
2609 PyObject *__pyx_r = NULL;
2610 __Pyx_RefNannyDeclarations
2611 PyObject *__pyx_t_1 = NULL;
2612 PyObject *__pyx_t_2 = NULL;
2613 PyObject *__pyx_t_3 = NULL;
2614 unsigned int __pyx_t_4;
2615 int __pyx_lineno = 0;
2616 const char *__pyx_filename = NULL;
2617 int __pyx_clineno = 0;
2618 __Pyx_RefNannySetupContext(
"std_string_to_py", 1);
2627 __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_x);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
2628 __Pyx_GOTREF(__pyx_t_1);
2629 __pyx_v_pyx = __pyx_t_1;
2639 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_pyx, __pyx_n_s_decode);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error)
2640 __Pyx_GOTREF(__pyx_t_2);
2643 #if CYTHON_UNPACK_METHODS
2644 if (likely(PyMethod_Check(__pyx_t_2))) {
2645 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
2646 if (likely(__pyx_t_3)) {
2647 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
2648 __Pyx_INCREF(__pyx_t_3);
2649 __Pyx_INCREF(function);
2650 __Pyx_DECREF_SET(__pyx_t_2, function);
2656 PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
2657 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
2658 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
2659 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error)
2660 __Pyx_GOTREF(__pyx_t_1);
2661 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2663 __Pyx_DECREF_SET(__pyx_v_pyx, __pyx_t_1);
2673 __Pyx_XDECREF(__pyx_r);
2674 __Pyx_INCREF(__pyx_v_pyx);
2675 __pyx_r = __pyx_v_pyx;
2688 __Pyx_XDECREF(__pyx_t_1);
2689 __Pyx_XDECREF(__pyx_t_2);
2690 __Pyx_XDECREF(__pyx_t_3);
2691 __Pyx_AddTraceback(
"pyinfile.std_string_to_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
2694 __Pyx_XDECREF(__pyx_v_pyx);
2695 __Pyx_XGIVEREF(__pyx_r);
2696 __Pyx_RefNannyFinishContext();
2708static std::string __pyx_f_8pyinfile_str_py_to_cpp(PyObject *__pyx_v_x) {
2709 std::string __pyx_v_s;
2710 std::string __pyx_r;
2711 __Pyx_RefNannyDeclarations
2712 PyObject *__pyx_t_1 = NULL;
2713 PyObject *__pyx_t_2 = NULL;
2714 PyObject *__pyx_t_3 = NULL;
2715 unsigned int __pyx_t_4;
2716 char const *__pyx_t_5;
2717 std::string __pyx_t_6;
2718 int __pyx_lineno = 0;
2719 const char *__pyx_filename = NULL;
2720 int __pyx_clineno = 0;
2721 __Pyx_RefNannySetupContext(
"str_py_to_cpp", 0);
2722 __Pyx_INCREF(__pyx_v_x);
2731 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_encode);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error)
2732 __Pyx_GOTREF(__pyx_t_2);
2735 #if CYTHON_UNPACK_METHODS
2736 if (likely(PyMethod_Check(__pyx_t_2))) {
2737 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
2738 if (likely(__pyx_t_3)) {
2739 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
2740 __Pyx_INCREF(__pyx_t_3);
2741 __Pyx_INCREF(function);
2742 __Pyx_DECREF_SET(__pyx_t_2, function);
2748 PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
2749 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
2750 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
2751 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
2752 __Pyx_GOTREF(__pyx_t_1);
2753 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2755 __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_1);
2765 __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_x);
if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 21, __pyx_L1_error)
2767 __pyx_t_6 = std::string(((
char const *)__pyx_t_5));
2769 __Pyx_CppExn2PyErr();
2770 __PYX_ERR(0, 21, __pyx_L1_error)
2772 __pyx_v_s = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_6);
2781 __pyx_r = __pyx_v_s;
2794 __Pyx_XDECREF(__pyx_t_1);
2795 __Pyx_XDECREF(__pyx_t_2);
2796 __Pyx_XDECREF(__pyx_t_3);
2797 __Pyx_AddTraceback(
"pyinfile.str_py_to_cpp", __pyx_clineno, __pyx_lineno, __pyx_filename);
2798 __Pyx_pretend_to_initialize(&__pyx_r);
2800 __Pyx_XDECREF(__pyx_v_x);
2801 __Pyx_RefNannyFinishContext();
2814 PyObject *__pyx_v_infile = NULL;
2815 PyObject *__pyx_v_ctx = 0;
2816 PyObject *__pyx_v_names = NULL;
2817 PyObject *__pyx_v_name = NULL;
2818 PyObject *__pyx_v_sim = NULL;
2819 PyObject *__pyx_v_Mapping = NULL;
2820 PyObject *__pyx_v_json = NULL;
2821 std::string __pyx_v_cpp_rtn;
2822 std::string __pyx_r;
2823 __Pyx_RefNannyDeclarations
2824 PyObject *__pyx_t_1 = NULL;
2825 PyObject *__pyx_t_2 = NULL;
2826 PyObject *__pyx_t_3 = NULL;
2827 unsigned int __pyx_t_4;
2830 Py_ssize_t __pyx_t_7;
2831 PyObject *__pyx_t_8 = NULL;
2833 std::string __pyx_t_10;
2834 int __pyx_lineno = 0;
2835 const char *__pyx_filename = NULL;
2836 int __pyx_clineno = 0;
2837 __Pyx_RefNannySetupContext(
"py_to_json", 1);
2846 __pyx_t_1 = __pyx_f_8pyinfile_std_string_to_py(__pyx_v_cpp_infile);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error)
2847 __Pyx_GOTREF(__pyx_t_1);
2848 __pyx_v_infile = __pyx_t_1;
2858 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_infile, __pyx_n_s_endswith);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
2859 __Pyx_GOTREF(__pyx_t_2);
2862 #if CYTHON_UNPACK_METHODS
2863 if (likely(PyMethod_Check(__pyx_t_2))) {
2864 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
2865 if (likely(__pyx_t_3)) {
2866 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
2867 __Pyx_INCREF(__pyx_t_3);
2868 __Pyx_INCREF(function);
2869 __Pyx_DECREF_SET(__pyx_t_2, function);
2875 PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_};
2876 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
2877 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
2878 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
2879 __Pyx_GOTREF(__pyx_t_1);
2880 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2882 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1);
if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 28, __pyx_L1_error)
2883 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2884 __pyx_t_6 = (!__pyx_t_5);
2894 __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_infile, __pyx_kp_u_);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
2895 __Pyx_GOTREF(__pyx_t_1);
2896 __Pyx_DECREF_SET(__pyx_v_infile, __pyx_t_1);
2915 __pyx_t_1 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error)
2916 __Pyx_GOTREF(__pyx_t_1);
2917 __pyx_v_ctx = ((PyObject*)__pyx_t_1);
2927 __pyx_t_1 = __Pyx_PyExec3(__pyx_v_infile, __pyx_v_ctx, __pyx_v_ctx);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error)
2928 __Pyx_GOTREF(__pyx_t_1);
2929 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2938 __Pyx_INCREF(__pyx_tuple__2);
2939 __pyx_v_names = __pyx_tuple__2;
2948 __pyx_t_1 = __pyx_v_names; __Pyx_INCREF(__pyx_t_1);
2952 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
2953 #if !CYTHON_ASSUME_SAFE_MACROS
2954 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 33, __pyx_L1_error)
2956 if (__pyx_t_7 >= __pyx_temp)
break;
2958 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
2959 __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++;
if (unlikely((0 < 0))) __PYX_ERR(0, 33, __pyx_L1_error)
2961 __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error)
2962 __Pyx_GOTREF(__pyx_t_2);
2964 __Pyx_XDECREF_SET(__pyx_v_name, ((PyObject*)__pyx_t_2));
2974 __pyx_t_6 = (__Pyx_PyDict_ContainsTF(__pyx_v_name, __pyx_v_ctx, Py_EQ));
if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 34, __pyx_L1_error)
2984 __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_ctx, __pyx_v_name);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error)
2985 __Pyx_GOTREF(__pyx_t_2);
2986 __pyx_v_sim = __pyx_t_2;
2996 goto __pyx_L5_break;
3015 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3016 goto __pyx_L7_for_else;
3018 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3019 goto __pyx_L8_for_end;
3030 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__3, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error)
3031 __Pyx_GOTREF(__pyx_t_1);
3032 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3033 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3034 __PYX_ERR(0, 38, __pyx_L1_error)
3045 __pyx_t_6 = __Pyx_PyCallable_Check(__pyx_v_sim);
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(0, 39, __pyx_L1_error)
3055 __Pyx_INCREF(__pyx_v_sim);
3056 __pyx_t_2 = __pyx_v_sim; __pyx_t_3 = NULL;
3058 #if CYTHON_UNPACK_METHODS
3059 if (unlikely(PyMethod_Check(__pyx_t_2))) {
3060 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
3061 if (likely(__pyx_t_3)) {
3062 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3063 __Pyx_INCREF(__pyx_t_3);
3064 __Pyx_INCREF(function);
3065 __Pyx_DECREF_SET(__pyx_t_2, function);
3071 PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
3072 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
3073 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3074 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error)
3075 __Pyx_GOTREF(__pyx_t_1);
3076 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3078 __Pyx_DECREF_SET(__pyx_v_sim, __pyx_t_1);
3097 __pyx_t_1 = PyList_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error)
3098 __Pyx_GOTREF(__pyx_t_1);
3099 __Pyx_INCREF(__pyx_n_s_Mapping);
3100 __Pyx_GIVEREF(__pyx_n_s_Mapping);
3101 if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Mapping)) __PYX_ERR(0, 41, __pyx_L1_error);
3102 __pyx_t_2 = __Pyx_Import(__pyx_n_s_collections_abc, __pyx_t_1, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error)
3103 __Pyx_GOTREF(__pyx_t_2);
3104 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3105 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Mapping);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error)
3106 __Pyx_GOTREF(__pyx_t_1);
3107 __Pyx_INCREF(__pyx_t_1);
3108 __pyx_v_Mapping = __pyx_t_1;
3109 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3110 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3119 __pyx_t_6 = PyUnicode_Check(__pyx_v_sim);
3131 __pyx_t_6 = PyBytes_Check(__pyx_v_sim);
3141 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_sim, __pyx_n_s_decode);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error)
3142 __Pyx_GOTREF(__pyx_t_1);
3145 #if CYTHON_UNPACK_METHODS
3146 if (likely(PyMethod_Check(__pyx_t_1))) {
3147 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
3148 if (likely(__pyx_t_3)) {
3149 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
3150 __Pyx_INCREF(__pyx_t_3);
3151 __Pyx_INCREF(function);
3152 __Pyx_DECREF_SET(__pyx_t_1, function);
3158 PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
3159 __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
3160 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3161 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error)
3162 __Pyx_GOTREF(__pyx_t_2);
3163 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3165 __Pyx_DECREF_SET(__pyx_v_sim, __pyx_t_2);
3185 __pyx_t_6 = PyObject_IsInstance(__pyx_v_sim, __pyx_v_Mapping);
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(0, 46, __pyx_L1_error)
3186 if (likely(__pyx_t_6)) {
3195 __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_json, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error)
3196 __Pyx_GOTREF(__pyx_t_2);
3197 __pyx_v_json = __pyx_t_2;
3207 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_json, __pyx_n_s_dumps);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error)
3208 __Pyx_GOTREF(__pyx_t_2);
3209 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error)
3210 __Pyx_GOTREF(__pyx_t_1);
3211 __Pyx_INCREF(__pyx_v_sim);
3212 __Pyx_GIVEREF(__pyx_v_sim);
3213 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_sim)) __PYX_ERR(0, 48, __pyx_L1_error);
3214 __pyx_t_3 = __Pyx_PyDict_NewPresized(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 48, __pyx_L1_error)
3215 __Pyx_GOTREF(__pyx_t_3);
3216 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_sort_keys, Py_True) < 0) __PYX_ERR(0, 48, __pyx_L1_error)
3217 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_indent, __pyx_int_1) < 0) __PYX_ERR(0, 48, __pyx_L1_error)
3218 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 48, __pyx_L1_error)
3219 __Pyx_GOTREF(__pyx_t_8);
3220 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3221 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3222 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3223 __Pyx_DECREF_SET(__pyx_v_sim, __pyx_t_8);
3244 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 50, __pyx_L1_error)
3245 __Pyx_GOTREF(__pyx_t_8);
3246 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
3247 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3248 __PYX_ERR(0, 50, __pyx_L1_error)
3259 __pyx_t_9 = PyErr_CheckSignals();
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(0, 51, __pyx_L1_error)
3268 __pyx_t_10 = __pyx_f_8pyinfile_str_py_to_cpp(__pyx_v_sim);
if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 52, __pyx_L1_error)
3269 __pyx_v_cpp_rtn = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_10);
3278 __pyx_r = __pyx_v_cpp_rtn;
3291 __Pyx_XDECREF(__pyx_t_1);
3292 __Pyx_XDECREF(__pyx_t_2);
3293 __Pyx_XDECREF(__pyx_t_3);
3294 __Pyx_XDECREF(__pyx_t_8);
3295 __Pyx_AddTraceback(
"pyinfile.py_to_json", __pyx_clineno, __pyx_lineno, __pyx_filename);
3296 __Pyx_pretend_to_initialize(&__pyx_r);
3298 __Pyx_XDECREF(__pyx_v_infile);
3299 __Pyx_XDECREF(__pyx_v_ctx);
3300 __Pyx_XDECREF(__pyx_v_names);
3301 __Pyx_XDECREF(__pyx_v_name);
3302 __Pyx_XDECREF(__pyx_v_sim);
3303 __Pyx_XDECREF(__pyx_v_Mapping);
3304 __Pyx_XDECREF(__pyx_v_json);
3305 __Pyx_RefNannyFinishContext();
3318 PyObject *__pyx_v_infile = NULL;
3319 PyObject *__pyx_v_json = NULL;
3320 PyObject *__pyx_v_sim = NULL;
3321 PyObject *__pyx_v_s = NULL;
3322 std::string __pyx_v_cpp_rtn;
3323 std::string __pyx_r;
3324 __Pyx_RefNannyDeclarations
3325 PyObject *__pyx_t_1 = NULL;
3326 PyObject *__pyx_t_2 = NULL;
3327 PyObject *__pyx_t_3 = NULL;
3328 unsigned int __pyx_t_4;
3330 PyObject *__pyx_t_6 = NULL;
3331 std::string __pyx_t_7;
3332 int __pyx_lineno = 0;
3333 const char *__pyx_filename = NULL;
3334 int __pyx_clineno = 0;
3335 __Pyx_RefNannySetupContext(
"json_to_py", 1);
3344 __pyx_t_1 = __pyx_f_8pyinfile_std_string_to_py(__pyx_v_cpp_infile);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error)
3345 __Pyx_GOTREF(__pyx_t_1);
3346 __pyx_v_infile = __pyx_t_1;
3356 __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_json, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 59, __pyx_L1_error)
3357 __Pyx_GOTREF(__pyx_t_1);
3358 __pyx_v_json = __pyx_t_1;
3368 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_json, __pyx_n_s_loads);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L1_error)
3369 __Pyx_GOTREF(__pyx_t_2);
3372 #if CYTHON_UNPACK_METHODS
3373 if (likely(PyMethod_Check(__pyx_t_2))) {
3374 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
3375 if (likely(__pyx_t_3)) {
3376 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3377 __Pyx_INCREF(__pyx_t_3);
3378 __Pyx_INCREF(function);
3379 __Pyx_DECREF_SET(__pyx_t_2, function);
3385 PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_infile};
3386 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
3387 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3388 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error)
3389 __Pyx_GOTREF(__pyx_t_1);
3390 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3392 __pyx_v_sim = __pyx_t_1;
3402 __pyx_t_5 = PyErr_CheckSignals();
if (unlikely(__pyx_t_5 == ((
int)-1))) __PYX_ERR(0, 61, __pyx_L1_error)
3411 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pformat);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error)
3412 __Pyx_GOTREF(__pyx_t_1);
3413 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error)
3414 __Pyx_GOTREF(__pyx_t_2);
3415 __Pyx_INCREF(__pyx_v_sim);
3416 __Pyx_GIVEREF(__pyx_v_sim);
3417 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_sim)) __PYX_ERR(0, 62, __pyx_L1_error);
3418 __pyx_t_3 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 62, __pyx_L1_error)
3419 __Pyx_GOTREF(__pyx_t_3);
3420 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_indent, __pyx_int_1) < 0) __PYX_ERR(0, 62, __pyx_L1_error)
3421 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 62, __pyx_L1_error)
3422 __Pyx_GOTREF(__pyx_t_6);
3423 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3424 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3425 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3426 __pyx_t_3 = PyNumber_Add(__pyx_kp_u_SIMULATION_2, __pyx_t_6);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 62, __pyx_L1_error)
3427 __Pyx_GOTREF(__pyx_t_3);
3428 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3429 __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_kp_u_);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 62, __pyx_L1_error)
3430 __Pyx_GOTREF(__pyx_t_6);
3431 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3432 __pyx_v_s = __pyx_t_6;
3441 __pyx_t_7 = __pyx_f_8pyinfile_str_py_to_cpp(__pyx_v_s);
if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L1_error)
3442 __pyx_v_cpp_rtn = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_7);
3449 __pyx_r = __pyx_v_cpp_rtn;
3462 __Pyx_XDECREF(__pyx_t_1);
3463 __Pyx_XDECREF(__pyx_t_2);
3464 __Pyx_XDECREF(__pyx_t_3);
3465 __Pyx_XDECREF(__pyx_t_6);
3466 __Pyx_AddTraceback(
"pyinfile.json_to_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
3467 __Pyx_pretend_to_initialize(&__pyx_r);
3469 __Pyx_XDECREF(__pyx_v_infile);
3470 __Pyx_XDECREF(__pyx_v_json);
3471 __Pyx_XDECREF(__pyx_v_sim);
3472 __Pyx_XDECREF(__pyx_v_s);
3473 __Pyx_RefNannyFinishContext();
3477static PyMethodDef __pyx_methods[] = {
3480#ifndef CYTHON_SMALL_CODE
3481#if defined(__clang__)
3482 #define CYTHON_SMALL_CODE
3483#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
3484 #define CYTHON_SMALL_CODE __attribute__((cold))
3486 #define CYTHON_SMALL_CODE
3491static int __Pyx_CreateStringTabAndInitStrings(
void) {
3492 __Pyx_StringTabEntry __pyx_string_tab[] = {
3493 {&__pyx_kp_u_, __pyx_k_,
sizeof(__pyx_k_), 0, 1, 0, 0},
3494 {&__pyx_n_s_ImportError, __pyx_k_ImportError,
sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
3495 {&__pyx_n_s_Mapping, __pyx_k_Mapping,
sizeof(__pyx_k_Mapping), 0, 0, 1, 1},
3496 {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError,
sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
3497 {&__pyx_n_u_SIMULATION, __pyx_k_SIMULATION,
sizeof(__pyx_k_SIMULATION), 0, 1, 0, 1},
3498 {&__pyx_kp_u_SIMULATION_2, __pyx_k_SIMULATION_2,
sizeof(__pyx_k_SIMULATION_2), 0, 1, 0, 0},
3499 {&__pyx_n_u_Simulation, __pyx_k_Simulation,
sizeof(__pyx_k_Simulation), 0, 1, 0, 1},
3500 {&__pyx_kp_u__4, __pyx_k__4,
sizeof(__pyx_k__4), 0, 1, 0, 0},
3501 {&__pyx_n_s__5, __pyx_k__5,
sizeof(__pyx_k__5), 0, 0, 1, 1},
3502 {&__pyx_n_s__7, __pyx_k__7,
sizeof(__pyx_k__7), 0, 0, 1, 1},
3503 {&__pyx_n_s_builtins, __pyx_k_builtins,
sizeof(__pyx_k_builtins), 0, 0, 1, 1},
3504 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback,
sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
3505 {&__pyx_n_s_collections_abc, __pyx_k_collections_abc,
sizeof(__pyx_k_collections_abc), 0, 0, 1, 1},
3506 {&__pyx_n_s_decode, __pyx_k_decode,
sizeof(__pyx_k_decode), 0, 0, 1, 1},
3507 {&__pyx_n_s_dumps, __pyx_k_dumps,
sizeof(__pyx_k_dumps), 0, 0, 1, 1},
3508 {&__pyx_n_s_encode, __pyx_k_encode,
sizeof(__pyx_k_encode), 0, 0, 1, 1},
3509 {&__pyx_n_s_endswith, __pyx_k_endswith,
sizeof(__pyx_k_endswith), 0, 0, 1, 1},
3510 {&__pyx_n_s_import, __pyx_k_import,
sizeof(__pyx_k_import), 0, 0, 1, 1},
3511 {&__pyx_n_s_indent, __pyx_k_indent,
sizeof(__pyx_k_indent), 0, 0, 1, 1},
3512 {&__pyx_n_s_initializing, __pyx_k_initializing,
sizeof(__pyx_k_initializing), 0, 0, 1, 1},
3513 {&__pyx_n_s_json, __pyx_k_json,
sizeof(__pyx_k_json), 0, 0, 1, 1},
3514 {&__pyx_n_s_loads, __pyx_k_loads,
sizeof(__pyx_k_loads), 0, 0, 1, 1},
3515 {&__pyx_n_s_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 0, 1, 1},
3516 {&__pyx_n_s_name, __pyx_k_name,
sizeof(__pyx_k_name), 0, 0, 1, 1},
3517 {&__pyx_n_s_pformat, __pyx_k_pformat,
sizeof(__pyx_k_pformat), 0, 0, 1, 1},
3518 {&__pyx_n_s_pprint, __pyx_k_pprint,
sizeof(__pyx_k_pprint), 0, 0, 1, 1},
3519 {&__pyx_n_s_pprintpp, __pyx_k_pprintpp,
sizeof(__pyx_k_pprintpp), 0, 0, 1, 1},
3520 {&__pyx_n_u_simulation, __pyx_k_simulation,
sizeof(__pyx_k_simulation), 0, 1, 0, 1},
3521 {&__pyx_kp_u_simulation_not_found_in_python_f, __pyx_k_simulation_not_found_in_python_f,
sizeof(__pyx_k_simulation_not_found_in_python_f), 0, 1, 0, 0},
3522 {&__pyx_n_s_sort_keys, __pyx_k_sort_keys,
sizeof(__pyx_k_sort_keys), 0, 0, 1, 1},
3523 {&__pyx_n_s_spec, __pyx_k_spec,
sizeof(__pyx_k_spec), 0, 0, 1, 1},
3524 {&__pyx_n_s_test, __pyx_k_test,
sizeof(__pyx_k_test), 0, 0, 1, 1},
3525 {&__pyx_kp_u_top_level_simulation_object_does, __pyx_k_top_level_simulation_object_does,
sizeof(__pyx_k_top_level_simulation_object_does), 0, 1, 0, 0},
3526 {0, 0, 0, 0, 0, 0, 0}
3528 return __Pyx_InitStrings(__pyx_string_tab);
3531static CYTHON_SMALL_CODE
int __Pyx_InitCachedBuiltins(
void) {
3532 __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError);
if (!__pyx_builtin_ImportError) __PYX_ERR(0, 8, __pyx_L1_error)
3533 __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError);
if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 38, __pyx_L1_error)
3540static CYTHON_SMALL_CODE
int __Pyx_InitCachedConstants(
void) {
3541 __Pyx_RefNannyDeclarations
3542 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
3551 __pyx_tuple__2 = PyTuple_Pack(3, __pyx_n_u_simulation, __pyx_n_u_SIMULATION, __pyx_n_u_Simulation);
if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 32, __pyx_L1_error)
3552 __Pyx_GOTREF(__pyx_tuple__2);
3553 __Pyx_GIVEREF(__pyx_tuple__2);
3562 __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_simulation_not_found_in_python_f);
if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 38, __pyx_L1_error)
3563 __Pyx_GOTREF(__pyx_tuple__3);
3564 __Pyx_GIVEREF(__pyx_tuple__3);
3573 __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_top_level_simulation_object_does);
if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 50, __pyx_L1_error)
3574 __Pyx_GOTREF(__pyx_tuple__6);
3575 __Pyx_GIVEREF(__pyx_tuple__6);
3576 __Pyx_RefNannyFinishContext();
3579 __Pyx_RefNannyFinishContext();
3584static CYTHON_SMALL_CODE
int __Pyx_InitConstants(
void) {
3585 if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error);
3586 __pyx_int_1 = PyInt_FromLong(1);
if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
3593static CYTHON_SMALL_CODE
int __Pyx_InitGlobals(
void) {
3598static CYTHON_SMALL_CODE
int __Pyx_modinit_global_init_code(
void);
3599static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_export_code(
void);
3600static CYTHON_SMALL_CODE
int __Pyx_modinit_function_export_code(
void);
3601static CYTHON_SMALL_CODE
int __Pyx_modinit_type_init_code(
void);
3602static CYTHON_SMALL_CODE
int __Pyx_modinit_type_import_code(
void);
3603static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_import_code(
void);
3604static CYTHON_SMALL_CODE
int __Pyx_modinit_function_import_code(
void);
3606static int __Pyx_modinit_global_init_code(
void) {
3607 __Pyx_RefNannyDeclarations
3608 __Pyx_RefNannySetupContext(
"__Pyx_modinit_global_init_code", 0);
3610 __Pyx_RefNannyFinishContext();
3614static int __Pyx_modinit_variable_export_code(
void) {
3615 __Pyx_RefNannyDeclarations
3616 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_export_code", 0);
3618 __Pyx_RefNannyFinishContext();
3622static int __Pyx_modinit_function_export_code(
void) {
3623 __Pyx_RefNannyDeclarations
3624 int __pyx_lineno = 0;
3625 const char *__pyx_filename = NULL;
3626 int __pyx_clineno = 0;
3627 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_export_code", 0);
3629 if (__Pyx_ExportFunction(
"str_py_to_cpp", (
void (*)(
void))__pyx_f_8pyinfile_str_py_to_cpp,
"std::string (PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3630 if (__Pyx_ExportFunction(
"std_string_to_py", (
void (*)(
void))__pyx_f_8pyinfile_std_string_to_py,
"PyObject *(std::string)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3631 if (__Pyx_ExportFunction(
"py_to_json", (
void (*)(
void))
CyclusPyToJson,
"std::string (std::string)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3632 if (__Pyx_ExportFunction(
"json_to_py", (
void (*)(
void))
CyclusJsonToPy,
"std::string (std::string)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3633 __Pyx_RefNannyFinishContext();
3636 __Pyx_RefNannyFinishContext();
3640static int __Pyx_modinit_type_init_code(
void) {
3641 __Pyx_RefNannyDeclarations
3642 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_init_code", 0);
3644 __Pyx_RefNannyFinishContext();
3648static int __Pyx_modinit_type_import_code(
void) {
3649 __Pyx_RefNannyDeclarations
3650 PyObject *__pyx_t_1 = NULL;
3651 int __pyx_lineno = 0;
3652 const char *__pyx_filename = NULL;
3653 int __pyx_clineno = 0;
3654 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_import_code", 0);
3656 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error)
3657 __Pyx_GOTREF(__pyx_t_1);
3658 __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_11(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME,
"type",
3659 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
3660 sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyTypeObject),
3661 #elif CYTHON_COMPILING_IN_LIMITED_API
3662 sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyTypeObject),
3664 sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyHeapTypeObject),
3666 __Pyx_ImportType_CheckSize_Warn_3_0_11);
if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error)
3667 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3668 __Pyx_RefNannyFinishContext();
3671 __Pyx_XDECREF(__pyx_t_1);
3672 __Pyx_RefNannyFinishContext();
3676static int __Pyx_modinit_variable_import_code(
void) {
3677 __Pyx_RefNannyDeclarations
3678 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_import_code", 0);
3680 __Pyx_RefNannyFinishContext();
3684static int __Pyx_modinit_function_import_code(
void) {
3685 __Pyx_RefNannyDeclarations
3686 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_import_code", 0);
3688 __Pyx_RefNannyFinishContext();
3693#if PY_MAJOR_VERSION >= 3
3694#if CYTHON_PEP489_MULTI_PHASE_INIT
3695static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
3696static int __pyx_pymod_exec_pyinfile(PyObject* module);
3697static PyModuleDef_Slot __pyx_moduledef_slots[] = {
3698 {Py_mod_create, (
void*)__pyx_pymod_create},
3699 {Py_mod_exec, (
void*)__pyx_pymod_exec_pyinfile},
3706 struct PyModuleDef __pyx_moduledef =
3708 static struct PyModuleDef __pyx_moduledef =
3711 PyModuleDef_HEAD_INIT,
3713 __pyx_k_Cyclus_Python_input_file_tools,
3714 #if CYTHON_PEP489_MULTI_PHASE_INIT
3716 #elif CYTHON_USE_MODULE_STATE
3717 sizeof(__pyx_mstate),
3722 #
if CYTHON_PEP489_MULTI_PHASE_INIT
3723 __pyx_moduledef_slots,
3727 #
if CYTHON_USE_MODULE_STATE
3742#ifndef CYTHON_NO_PYINIT_EXPORT
3743#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
3744#elif PY_MAJOR_VERSION < 3
3746#define __Pyx_PyMODINIT_FUNC extern "C" void
3748#define __Pyx_PyMODINIT_FUNC void
3752#define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
3754#define __Pyx_PyMODINIT_FUNC PyObject *
3759#if PY_MAJOR_VERSION < 3
3760__Pyx_PyMODINIT_FUNC
initpyinfile(
void) CYTHON_SMALL_CODE;
3763__Pyx_PyMODINIT_FUNC PyInit_pyinfile(
void) CYTHON_SMALL_CODE;
3764__Pyx_PyMODINIT_FUNC PyInit_pyinfile(
void)
3765#if CYTHON_PEP489_MULTI_PHASE_INIT
3767 return PyModuleDef_Init(&__pyx_moduledef);
3769static CYTHON_SMALL_CODE
int __Pyx_check_single_interpreter(
void) {
3770 #if PY_VERSION_HEX >= 0x030700A1
3771 static PY_INT64_T main_interpreter_id = -1;
3772 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
3773 if (main_interpreter_id == -1) {
3774 main_interpreter_id = current_id;
3775 return (unlikely(current_id == -1)) ? -1 : 0;
3776 }
else if (unlikely(main_interpreter_id != current_id))
3778 static PyInterpreterState *main_interpreter = NULL;
3779 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
3780 if (!main_interpreter) {
3781 main_interpreter = current_interpreter;
3782 }
else if (unlikely(main_interpreter != current_interpreter))
3787 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
3792#if CYTHON_COMPILING_IN_LIMITED_API
3793static CYTHON_SMALL_CODE
int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module,
const char* from_name,
const char* to_name,
int allow_none)
3795static CYTHON_SMALL_CODE
int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict,
const char* from_name,
const char* to_name,
int allow_none)
3798 PyObject *value = PyObject_GetAttrString(spec, from_name);
3800 if (likely(value)) {
3801 if (allow_none || value != Py_None) {
3802#if CYTHON_COMPILING_IN_LIMITED_API
3803 result = PyModule_AddObject(module, to_name, value);
3805 result = PyDict_SetItemString(moddict, to_name, value);
3809 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
3816static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) {
3817 PyObject *
module = NULL, *moddict, *modname;
3818 CYTHON_UNUSED_VAR(def);
3819 if (__Pyx_check_single_interpreter())
3822 return __Pyx_NewRef(__pyx_m);
3823 modname = PyObject_GetAttrString(spec,
"name");
3824 if (unlikely(!modname))
goto bad;
3825 module = PyModule_NewObject(modname);
3827 if (unlikely(!module))
goto bad;
3828#if CYTHON_COMPILING_IN_LIMITED_API
3831 moddict = PyModule_GetDict(module);
3832 if (unlikely(!moddict))
goto bad;
3834 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__", 1) < 0))
goto bad;
3835 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__", 1) < 0))
goto bad;
3836 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__", 1) < 0))
goto bad;
3837 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__", 0) < 0))
goto bad;
3845static CYTHON_SMALL_CODE
int __pyx_pymod_exec_pyinfile(PyObject *__pyx_pyinit_module)
3849 int stringtab_initialized = 0;
3850 #if CYTHON_USE_MODULE_STATE
3851 int pystate_addmodule_run = 0;
3853 PyObject *__pyx_t_1 = NULL;
3854 PyObject *__pyx_t_2 = NULL;
3855 PyObject *__pyx_t_3 = NULL;
3856 PyObject *__pyx_t_4 = NULL;
3857 PyObject *__pyx_t_5 = NULL;
3859 PyObject *__pyx_t_7 = NULL;
3860 PyObject *__pyx_t_8 = NULL;
3861 PyObject *__pyx_t_9 = NULL;
3862 int __pyx_lineno = 0;
3863 const char *__pyx_filename = NULL;
3864 int __pyx_clineno = 0;
3865 __Pyx_RefNannyDeclarations
3866 #if CYTHON_PEP489_MULTI_PHASE_INIT
3868 if (__pyx_m == __pyx_pyinit_module)
return 0;
3869 PyErr_SetString(PyExc_RuntimeError,
"Module 'pyinfile' has already been imported. Re-initialisation is not supported.");
3872 #elif PY_MAJOR_VERSION >= 3
3873 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
3876 #if CYTHON_PEP489_MULTI_PHASE_INIT
3877 __pyx_m = __pyx_pyinit_module;
3880 #if PY_MAJOR_VERSION < 3
3881 __pyx_m = Py_InitModule4(
"pyinfile", __pyx_methods, __pyx_k_Cyclus_Python_input_file_tools, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
3882 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
3883 #elif CYTHON_USE_MODULE_STATE
3884 __pyx_t_1 = PyModule_Create(&__pyx_moduledef);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
3886 int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef);
3888 if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
3889 pystate_addmodule_run = 1;
3892 __pyx_m = PyModule_Create(&__pyx_moduledef);
3893 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
3896 CYTHON_UNUSED_VAR(__pyx_t_1);
3897 __pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
3899 __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
3900 __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((
const char *)
"cython_runtime");
if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
3901 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3903__Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
3904if (!__Pyx_RefNanny) {
3906 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
3907 if (!__Pyx_RefNanny)
3908 Py_FatalError(
"failed to import 'refnanny' module");
3911 __Pyx_RefNannySetupContext(
"__Pyx_PyMODINIT_FUNC PyInit_pyinfile(void)", 0);
3912 if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3913 #ifdef __Pxy_PyFrame_Initialize_Offsets
3914 __Pxy_PyFrame_Initialize_Offsets();
3916 __pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
3917 __pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
3918 __pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
3919 #ifdef __Pyx_CyFunction_USED
3920 if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3922 #ifdef __Pyx_FusedFunction_USED
3923 if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3925 #ifdef __Pyx_Coroutine_USED
3926 if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3928 #ifdef __Pyx_Generator_USED
3929 if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3931 #ifdef __Pyx_AsyncGen_USED
3932 if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3934 #ifdef __Pyx_StopAsyncIteration_USED
3935 if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3939 #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
3940 PyEval_InitThreads();
3943 if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3944 stringtab_initialized = 1;
3945 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3946 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
3947 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3949 if (__pyx_module_is_main_pyinfile) {
3950 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3952 #if PY_MAJOR_VERSION >= 3
3954 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
3955 if (!PyDict_GetItemString(modules,
"pyinfile")) {
3956 if (unlikely((PyDict_SetItemString(modules,
"pyinfile", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
3961 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3963 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3965 (void)__Pyx_modinit_global_init_code();
3966 (void)__Pyx_modinit_variable_export_code();
3967 if (unlikely((__Pyx_modinit_function_export_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
3968 (void)__Pyx_modinit_type_init_code();
3969 if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
3970 (void)__Pyx_modinit_variable_import_code();
3971 (void)__Pyx_modinit_function_import_code();
3973 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
3974 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3985 __Pyx_PyThreadState_declare
3986 __Pyx_PyThreadState_assign
3987 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
3988 __Pyx_XGOTREF(__pyx_t_1);
3989 __Pyx_XGOTREF(__pyx_t_2);
3990 __Pyx_XGOTREF(__pyx_t_3);
4000 __pyx_t_4 = PyList_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7, __pyx_L2_error)
4001 __Pyx_GOTREF(__pyx_t_4);
4002 __Pyx_INCREF(__pyx_n_s_pformat);
4003 __Pyx_GIVEREF(__pyx_n_s_pformat);
4004 if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_pformat)) __PYX_ERR(0, 7, __pyx_L2_error);
4005 __pyx_t_5 = __Pyx_Import(__pyx_n_s_pprintpp, __pyx_t_4, 0);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 7, __pyx_L2_error)
4006 __Pyx_GOTREF(__pyx_t_5);
4007 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4008 __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_pformat);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7, __pyx_L2_error)
4009 __Pyx_GOTREF(__pyx_t_4);
4010 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pformat, __pyx_t_4) < 0) __PYX_ERR(0, 7, __pyx_L2_error)
4011 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4012 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4022 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
4023 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4024 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4025 goto __pyx_L7_try_end;
4027 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4028 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4037 __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
4039 __Pyx_AddTraceback(
"pyinfile", __pyx_clineno, __pyx_lineno, __pyx_filename);
4040 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) __PYX_ERR(0, 8, __pyx_L4_except_error)
4041 __Pyx_XGOTREF(__pyx_t_5);
4042 __Pyx_XGOTREF(__pyx_t_4);
4043 __Pyx_XGOTREF(__pyx_t_7);
4052 __pyx_t_8 = PyList_New(1);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 9, __pyx_L4_except_error)
4053 __Pyx_GOTREF(__pyx_t_8);
4054 __Pyx_INCREF(__pyx_n_s_pformat);
4055 __Pyx_GIVEREF(__pyx_n_s_pformat);
4056 if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_n_s_pformat)) __PYX_ERR(0, 9, __pyx_L4_except_error);
4057 __pyx_t_9 = __Pyx_Import(__pyx_n_s_pprint, __pyx_t_8, 0);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 9, __pyx_L4_except_error)
4058 __Pyx_GOTREF(__pyx_t_9);
4059 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4060 __pyx_t_8 = __Pyx_ImportFrom(__pyx_t_9, __pyx_n_s_pformat);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 9, __pyx_L4_except_error)
4061 __Pyx_GOTREF(__pyx_t_8);
4062 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pformat, __pyx_t_8) < 0) __PYX_ERR(0, 9, __pyx_L4_except_error)
4063 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4064 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4065 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4066 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4067 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
4068 goto __pyx_L3_exception_handled;
4070 goto __pyx_L4_except_error;
4079 __pyx_L4_except_error:;
4080 __Pyx_XGIVEREF(__pyx_t_1);
4081 __Pyx_XGIVEREF(__pyx_t_2);
4082 __Pyx_XGIVEREF(__pyx_t_3);
4083 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
4084 goto __pyx_L1_error;
4085 __pyx_L3_exception_handled:;
4086 __Pyx_XGIVEREF(__pyx_t_1);
4087 __Pyx_XGIVEREF(__pyx_t_2);
4088 __Pyx_XGIVEREF(__pyx_t_3);
4089 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
4098 __pyx_t_7 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1, __pyx_L1_error)
4099 __Pyx_GOTREF(__pyx_t_7);
4100 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_7) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4101 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4107 __Pyx_XDECREF(__pyx_t_4);
4108 __Pyx_XDECREF(__pyx_t_5);
4109 __Pyx_XDECREF(__pyx_t_7);
4110 __Pyx_XDECREF(__pyx_t_8);
4111 __Pyx_XDECREF(__pyx_t_9);
4113 if (__pyx_d && stringtab_initialized) {
4114 __Pyx_AddTraceback(
"init pyinfile", __pyx_clineno, __pyx_lineno, __pyx_filename);
4116 #if !CYTHON_USE_MODULE_STATE
4120 if (pystate_addmodule_run) {
4121 PyObject *tp, *value, *tb;
4122 PyErr_Fetch(&tp, &value, &tb);
4123 PyState_RemoveModule(&__pyx_moduledef);
4124 PyErr_Restore(tp, value, tb);
4127 }
else if (!PyErr_Occurred()) {
4128 PyErr_SetString(PyExc_ImportError,
"init pyinfile");
4131 __Pyx_RefNannyFinishContext();
4132 #if CYTHON_PEP489_MULTI_PHASE_INIT
4133 return (__pyx_m != NULL) ? 0 : -1;
4134 #elif PY_MAJOR_VERSION >= 3
4145#pragma warning( push )
4150#pragma warning( disable : 4127 )
4160static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
4161 PyObject *m = NULL, *p = NULL;
4163 m = PyImport_ImportModule(modname);
4165 p = PyObject_GetAttrString(m,
"RefNannyAPI");
4167 r = PyLong_AsVoidPtr(p);
4171 return (__Pyx_RefNannyAPIStruct *)r;
4176#if CYTHON_FAST_THREAD_STATE
4177static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
4179 n = PyTuple_GET_SIZE(tuple);
4180#if PY_MAJOR_VERSION >= 3
4181 for (i=0; i<n; i++) {
4182 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
4185 for (i=0; i<n; i++) {
4186 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i)))
return 1;
4190static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
4193#if PY_VERSION_HEX >= 0x030C00A6
4194 PyObject *current_exception = tstate->current_exception;
4195 if (unlikely(!current_exception))
return 0;
4196 exc_type = (PyObject*) Py_TYPE(current_exception);
4197 if (exc_type == err)
return 1;
4199 exc_type = tstate->curexc_type;
4200 if (exc_type == err)
return 1;
4201 if (unlikely(!exc_type))
return 0;
4203 #if CYTHON_AVOID_BORROWED_REFS
4204 Py_INCREF(exc_type);
4206 if (unlikely(PyTuple_Check(err))) {
4207 result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
4209 result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
4211 #if CYTHON_AVOID_BORROWED_REFS
4212 Py_DECREF(exc_type);
4219#if CYTHON_FAST_THREAD_STATE
4220static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
4221#if PY_VERSION_HEX >= 0x030C00A6
4222 PyObject *tmp_value;
4223 assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
4225 #if CYTHON_COMPILING_IN_CPYTHON
4226 if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
4228 PyException_SetTraceback(value, tb);
4230 tmp_value = tstate->current_exception;
4231 tstate->current_exception = value;
4232 Py_XDECREF(tmp_value);
4236 PyObject *tmp_type, *tmp_value, *tmp_tb;
4237 tmp_type = tstate->curexc_type;
4238 tmp_value = tstate->curexc_value;
4239 tmp_tb = tstate->curexc_traceback;
4240 tstate->curexc_type = type;
4241 tstate->curexc_value = value;
4242 tstate->curexc_traceback = tb;
4243 Py_XDECREF(tmp_type);
4244 Py_XDECREF(tmp_value);
4248static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
4249#if PY_VERSION_HEX >= 0x030C00A6
4250 PyObject* exc_value;
4251 exc_value = tstate->current_exception;
4252 tstate->current_exception = 0;
4257 *type = (PyObject*) Py_TYPE(exc_value);
4259 #if CYTHON_COMPILING_IN_CPYTHON
4260 *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
4263 *tb = PyException_GetTraceback(exc_value);
4267 *type = tstate->curexc_type;
4268 *value = tstate->curexc_value;
4269 *tb = tstate->curexc_traceback;
4270 tstate->curexc_type = 0;
4271 tstate->curexc_value = 0;
4272 tstate->curexc_traceback = 0;
4278#if CYTHON_USE_TYPE_SLOTS
4279static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
4280 PyTypeObject* tp = Py_TYPE(obj);
4281 if (likely(tp->tp_getattro))
4282 return tp->tp_getattro(obj, attr_name);
4283#if PY_MAJOR_VERSION < 3
4284 if (likely(tp->tp_getattr))
4285 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
4287 return PyObject_GetAttr(obj, attr_name);
4292#if __PYX_LIMITED_VERSION_HEX < 0x030d00A1
4293static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(
void) {
4294 __Pyx_PyThreadState_declare
4295 __Pyx_PyThreadState_assign
4296 if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
4297 __Pyx_PyErr_Clear();
4300static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
4302#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
4303 (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
4306#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
4307 PyTypeObject* tp = Py_TYPE(obj);
4308 if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
4309 return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
4312 result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
4313 if (unlikely(!result)) {
4314 __Pyx_PyObject_GetAttrStr_ClearAttributeError();
4321static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
4322 PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name);
4323 if (unlikely(!result) && !PyErr_Occurred()) {
4324 PyErr_Format(PyExc_NameError,
4325#
if PY_MAJOR_VERSION >= 3
4326 "name '%U' is not defined", name);
4328 "name '%.200s' is not defined", PyString_AS_STRING(name));
4335#if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL
4336static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
4337 PyObject *globals) {
4339 PyThreadState *tstate = __Pyx_PyThreadState_Current;
4340 PyObject **fastlocals;
4343 assert(globals != NULL);
4348 assert(tstate != NULL);
4349 f = PyFrame_New(tstate, co, globals, NULL);
4353 fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
4354 for (i = 0; i < na; i++) {
4356 fastlocals[i] = *args++;
4358 result = PyEval_EvalFrameEx(f,0);
4359 ++tstate->recursion_depth;
4361 --tstate->recursion_depth;
4364static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
4365 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
4366 PyObject *globals = PyFunction_GET_GLOBALS(func);
4367 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
4369#if PY_MAJOR_VERSION >= 3
4372 PyObject *kwtuple, **k;
4377 assert(kwargs == NULL || PyDict_Check(kwargs));
4378 nk = kwargs ? PyDict_Size(kwargs) : 0;
4379 #if PY_MAJOR_VERSION < 3
4380 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object"))) {
4384 if (unlikely(Py_EnterRecursiveCall(
" while calling a Python object"))) {
4389#
if PY_MAJOR_VERSION >= 3
4390 co->co_kwonlyargcount == 0 &&
4392 likely(kwargs == NULL || nk == 0) &&
4393 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
4394 if (argdefs == NULL && co->co_argcount == nargs) {
4395 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
4398 else if (nargs == 0 && argdefs != NULL
4399 && co->co_argcount == Py_SIZE(argdefs)) {
4402 args = &PyTuple_GET_ITEM(argdefs, 0);
4403 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
4407 if (kwargs != NULL) {
4409 kwtuple = PyTuple_New(2 * nk);
4410 if (kwtuple == NULL) {
4414 k = &PyTuple_GET_ITEM(kwtuple, 0);
4416 while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
4427 closure = PyFunction_GET_CLOSURE(func);
4428#if PY_MAJOR_VERSION >= 3
4429 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
4431 if (argdefs != NULL) {
4432 d = &PyTuple_GET_ITEM(argdefs, 0);
4433 nd = Py_SIZE(argdefs);
4439#if PY_MAJOR_VERSION >= 3
4440 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
4443 d, (
int)nd, kwdefs, closure);
4445 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
4448 d, (
int)nd, closure);
4450 Py_XDECREF(kwtuple);
4452 Py_LeaveRecursiveCall();
4458#if CYTHON_COMPILING_IN_CPYTHON
4459static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
4461 ternaryfunc call = Py_TYPE(func)->tp_call;
4462 if (unlikely(!call))
4463 return PyObject_Call(func, arg, kw);
4464 #if PY_MAJOR_VERSION < 3
4465 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
4468 if (unlikely(Py_EnterRecursiveCall(
" while calling a Python object")))
4471 result = (*call)(func, arg, kw);
4472 Py_LeaveRecursiveCall();
4473 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
4476 "NULL result without error in PyObject_Call");
4483#if CYTHON_COMPILING_IN_CPYTHON
4484static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
4485 PyObject *self, *result;
4487 cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
4488 self = __Pyx_CyOrPyCFunction_GET_SELF(func);
4489 #if PY_MAJOR_VERSION < 3
4490 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
4493 if (unlikely(Py_EnterRecursiveCall(
" while calling a Python object")))
4496 result = cfunc(self, arg);
4497 Py_LeaveRecursiveCall();
4498 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
4501 "NULL result without error in PyObject_Call");
4508#if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API
4509static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args,
size_t nargs, PyObject *kwargs) {
4510 PyObject *argstuple;
4511 PyObject *result = 0;
4513 argstuple = PyTuple_New((Py_ssize_t)nargs);
4514 if (unlikely(!argstuple))
return NULL;
4515 for (i = 0; i < nargs; i++) {
4517 if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0)
goto bad;
4519 result = __Pyx_PyObject_Call(func, argstuple, kwargs);
4521 Py_DECREF(argstuple);
4525static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args,
size_t _nargs, PyObject *kwargs) {
4526 Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs);
4527#if CYTHON_COMPILING_IN_CPYTHON
4528 if (nargs == 0 && kwargs == NULL) {
4529 if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS))
4530 return __Pyx_PyObject_CallMethO(func, NULL);
4532 else if (nargs == 1 && kwargs == NULL) {
4533 if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O))
4534 return __Pyx_PyObject_CallMethO(func, args[0]);
4537 #if PY_VERSION_HEX < 0x030800B1
4538 #if CYTHON_FAST_PYCCALL
4539 if (PyCFunction_Check(func)) {
4541 return _PyCFunction_FastCallDict(func, args, nargs, kwargs);
4543 return _PyCFunction_FastCallKeywords(func, args, nargs, NULL);
4546 #if PY_VERSION_HEX >= 0x030700A1
4547 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) {
4548 return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL);
4552 #if CYTHON_FAST_PYCALL
4553 if (PyFunction_Check(func)) {
4554 return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs);
4558 if (kwargs == NULL) {
4559 #if CYTHON_VECTORCALL
4560 #if PY_VERSION_HEX < 0x03090000
4561 vectorcallfunc f = _PyVectorcall_Function(func);
4563 vectorcallfunc f = PyVectorcall_Function(func);
4566 return f(func, args, (
size_t)nargs, NULL);
4568 #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL
4569 if (__Pyx_CyFunction_CheckExact(func)) {
4570 __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func);
4571 if (f)
return f(func, args, (
size_t)nargs, NULL);
4576 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs);
4578 #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API
4579 return PyObject_VectorcallDict(func, args, (
size_t)nargs, kwargs);
4581 return __Pyx_PyObject_FastCall_fallback(func, args, (
size_t)nargs, kwargs);
4586static CYTHON_INLINE PyObject* __Pyx_PyExec2(PyObject* o, PyObject* globals) {
4587 return __Pyx_PyExec3(o, globals, NULL);
4589static PyObject* __Pyx_PyExec3(PyObject* o, PyObject* globals, PyObject* locals) {
4593 if (!globals || globals == Py_None) {
4595 }
else if (unlikely(!PyDict_Check(globals))) {
4596 __Pyx_TypeName globals_type_name =
4597 __Pyx_PyType_GetName(Py_TYPE(globals));
4598 PyErr_Format(PyExc_TypeError,
4599 "exec() arg 2 must be a dict, not " __Pyx_FMT_TYPENAME,
4601 __Pyx_DECREF_TypeName(globals_type_name);
4604 if (!locals || locals == Py_None) {
4607 if (__Pyx_PyDict_GetItemStr(globals, __pyx_n_s_builtins) == NULL) {
4608 if (unlikely(PyDict_SetItem(globals, __pyx_n_s_builtins, PyEval_GetBuiltins()) < 0))
4611 if (PyCode_Check(o)) {
4612 if (unlikely(__Pyx_PyCode_HasFreeVars((PyCodeObject *)o))) {
4613 PyErr_SetString(PyExc_TypeError,
4614 "code object passed to exec() may not contain free variables");
4617 #if PY_VERSION_HEX < 0x030200B1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400)
4618 result = PyEval_EvalCode((PyCodeObject *)o, globals, locals);
4620 result = PyEval_EvalCode(o, globals, locals);
4625#if PY_VERSION_HEX >= 0x030800A3
4626 cf.cf_feature_version = PY_MINOR_VERSION;
4628 if (PyUnicode_Check(o)) {
4629 cf.cf_flags = PyCF_SOURCE_IS_UTF8;
4630 s = PyUnicode_AsUTF8String(o);
4631 if (unlikely(!s))
goto bad;
4633 #if PY_MAJOR_VERSION >= 3
4634 }
else if (unlikely(!PyBytes_Check(o))) {
4636 }
else if (unlikely(!PyString_Check(o))) {
4638 __Pyx_TypeName o_type_name = __Pyx_PyType_GetName(Py_TYPE(o));
4639 PyErr_Format(PyExc_TypeError,
4640 "exec: arg 1 must be string, bytes or code object, got " __Pyx_FMT_TYPENAME,
4642 __Pyx_DECREF_TypeName(o_type_name);
4645 #if PY_MAJOR_VERSION >= 3
4646 code = PyBytes_AS_STRING(o);
4648 code = PyString_AS_STRING(o);
4650 if (PyEval_MergeCompilerFlags(&cf)) {
4651 result = PyRun_StringFlags(code, Py_file_input, globals, locals, &cf);
4653 result = PyRun_String(code, Py_file_input, globals, locals);
4664#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
4665static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
4667 value = PyDict_GetItemWithError(d, key);
4668 if (unlikely(!value)) {
4669 if (!PyErr_Occurred()) {
4670 if (unlikely(PyTuple_Check(key))) {
4671 PyObject* args = PyTuple_Pack(1, key);
4673 PyErr_SetObject(PyExc_KeyError, args);
4677 PyErr_SetObject(PyExc_KeyError, key);
4688#if PY_MAJOR_VERSION < 3
4689static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
4690 __Pyx_PyThreadState_declare
4691 CYTHON_UNUSED_VAR(cause);
4693 if (!value || value == Py_None)
4697 if (!tb || tb == Py_None)
4701 if (!PyTraceBack_Check(tb)) {
4702 PyErr_SetString(PyExc_TypeError,
4703 "raise: arg 3 must be a traceback or None");
4707 if (PyType_Check(type)) {
4708#if CYTHON_COMPILING_IN_PYPY
4714 PyErr_NormalizeException(&type, &value, &tb);
4717 PyErr_SetString(PyExc_TypeError,
4718 "instance exception may not have a separate value");
4722 type = (PyObject*) Py_TYPE(type);
4724 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
4725 PyErr_SetString(PyExc_TypeError,
4726 "raise: exception class must be a subclass of BaseException");
4730 __Pyx_PyThreadState_assign
4731 __Pyx_ErrRestore(type, value, tb);
4740static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
4741 PyObject* owned_instance = NULL;
4742 if (tb == Py_None) {
4744 }
else if (tb && !PyTraceBack_Check(tb)) {
4745 PyErr_SetString(PyExc_TypeError,
4746 "raise: arg 3 must be a traceback or None");
4749 if (value == Py_None)
4751 if (PyExceptionInstance_Check(type)) {
4753 PyErr_SetString(PyExc_TypeError,
4754 "instance exception may not have a separate value");
4758 type = (PyObject*) Py_TYPE(value);
4759 }
else if (PyExceptionClass_Check(type)) {
4760 PyObject *instance_class = NULL;
4761 if (value && PyExceptionInstance_Check(value)) {
4762 instance_class = (PyObject*) Py_TYPE(value);
4763 if (instance_class != type) {
4764 int is_subclass = PyObject_IsSubclass(instance_class, type);
4766 instance_class = NULL;
4767 }
else if (unlikely(is_subclass == -1)) {
4770 type = instance_class;
4774 if (!instance_class) {
4777 args = PyTuple_New(0);
4778 else if (PyTuple_Check(value)) {
4782 args = PyTuple_Pack(1, value);
4785 owned_instance = PyObject_Call(type, args, NULL);
4787 if (!owned_instance)
4789 value = owned_instance;
4790 if (!PyExceptionInstance_Check(value)) {
4791 PyErr_Format(PyExc_TypeError,
4792 "calling %R should have returned an instance of "
4793 "BaseException, not %R",
4794 type, Py_TYPE(value));
4799 PyErr_SetString(PyExc_TypeError,
4800 "raise: exception class must be a subclass of BaseException");
4804 PyObject *fixed_cause;
4805 if (cause == Py_None) {
4807 }
else if (PyExceptionClass_Check(cause)) {
4808 fixed_cause = PyObject_CallObject(cause, NULL);
4809 if (fixed_cause == NULL)
4811 }
else if (PyExceptionInstance_Check(cause)) {
4812 fixed_cause = cause;
4813 Py_INCREF(fixed_cause);
4815 PyErr_SetString(PyExc_TypeError,
4816 "exception causes must derive from "
4820 PyException_SetCause(value, fixed_cause);
4822 PyErr_SetObject(type, value);
4824 #if PY_VERSION_HEX >= 0x030C00A6
4825 PyException_SetTraceback(value, tb);
4826 #elif CYTHON_FAST_THREAD_STATE
4827 PyThreadState *tstate = __Pyx_PyThreadState_Current;
4828 PyObject* tmp_tb = tstate->curexc_traceback;
4831 tstate->curexc_traceback = tb;
4835 PyObject *tmp_type, *tmp_value, *tmp_tb;
4836 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
4838 PyErr_Restore(tmp_type, tmp_value, tb);
4843 Py_XDECREF(owned_instance);
4849static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level) {
4850 PyObject *
module = 0;
4851 PyObject *empty_dict = 0;
4852 PyObject *empty_list = 0;
4853 #if PY_MAJOR_VERSION < 3
4854 PyObject *py_import;
4855 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
4856 if (unlikely(!py_import))
4859 empty_list = PyList_New(0);
4860 if (unlikely(!empty_list))
4862 from_list = empty_list;
4865 empty_dict = PyDict_New();
4866 if (unlikely(!empty_dict))
4869 #if PY_MAJOR_VERSION >= 3
4871 if (strchr(__Pyx_MODULE_NAME,
'.') != NULL) {
4872 module = PyImport_ImportModuleLevelObject(
4873 name, __pyx_d, empty_dict, from_list, 1);
4874 if (unlikely(!module)) {
4875 if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError)))
4884 #if PY_MAJOR_VERSION < 3
4885 PyObject *py_level = PyInt_FromLong(level);
4886 if (unlikely(!py_level))
4888 module = PyObject_CallFunctionObjArgs(py_import,
4889 name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL);
4890 Py_DECREF(py_level);
4892 module = PyImport_ImportModuleLevelObject(
4893 name, __pyx_d, empty_dict, from_list, level);
4898 Py_XDECREF(empty_dict);
4899 Py_XDECREF(empty_list);
4900 #if PY_MAJOR_VERSION < 3
4901 Py_XDECREF(py_import);
4907static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
4908 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
4909 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
4910 const char* module_name_str = 0;
4911 PyObject* module_name = 0;
4912 PyObject* module_dot = 0;
4913 PyObject* full_name = 0;
4915 module_name_str = PyModule_GetName(module);
4916 if (unlikely(!module_name_str)) {
goto modbad; }
4917 module_name = PyUnicode_FromString(module_name_str);
4918 if (unlikely(!module_name)) {
goto modbad; }
4919 module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__4);
4920 if (unlikely(!module_dot)) {
goto modbad; }
4921 full_name = PyUnicode_Concat(module_dot, name);
4922 if (unlikely(!full_name)) {
goto modbad; }
4923 #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400)
4925 PyObject *modules = PyImport_GetModuleDict();
4926 if (unlikely(!modules))
4928 value = PyObject_GetItem(modules, full_name);
4931 value = PyImport_GetModule(full_name);
4934 Py_XDECREF(full_name);
4935 Py_XDECREF(module_dot);
4936 Py_XDECREF(module_name);
4938 if (unlikely(!value)) {
4939 PyErr_Format(PyExc_ImportError,
4940 #
if PY_MAJOR_VERSION < 3
4941 "cannot import name %.230s", PyString_AS_STRING(name));
4943 "cannot import name %S",
name);
4950#if PY_MAJOR_VERSION >= 3
4951static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) {
4952 PyObject *partial_name = NULL, *slice = NULL, *sep = NULL;
4953 if (unlikely(PyErr_Occurred())) {
4956 if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) {
4957 partial_name =
name;
4959 slice = PySequence_GetSlice(parts_tuple, 0, count);
4960 if (unlikely(!slice))
4962 sep = PyUnicode_FromStringAndSize(
".", 1);
4965 partial_name = PyUnicode_Join(sep, slice);
4968#
if PY_MAJOR_VERSION < 3
4970 "No module named '%s'", PyString_AS_STRING(partial_name));
4972#if PY_VERSION_HEX >= 0x030600B1
4973 PyExc_ModuleNotFoundError,
4977 "No module named '%U'", partial_name);
4982 Py_XDECREF(partial_name);
4986#if PY_MAJOR_VERSION >= 3
4987static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) {
4988 PyObject *imported_module;
4989#if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400)
4990 PyObject *modules = PyImport_GetModuleDict();
4991 if (unlikely(!modules))
4993 imported_module = __Pyx_PyDict_GetItemStr(modules, name);
4994 Py_XINCREF(imported_module);
4996 imported_module = PyImport_GetModule(name);
4998 return imported_module;
5001#if PY_MAJOR_VERSION >= 3
5002static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) {
5003 Py_ssize_t i, nparts;
5004 nparts = PyTuple_GET_SIZE(parts_tuple);
5005 for (i=1; i < nparts &&
module; i++) {
5006 PyObject *part, *submodule;
5007#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5008 part = PyTuple_GET_ITEM(parts_tuple, i);
5010 part = PySequence_ITEM(parts_tuple, i);
5012 submodule = __Pyx_PyObject_GetAttrStrNoError(module, part);
5013#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
5019 if (unlikely(!module)) {
5020 return __Pyx__ImportDottedModule_Error(name, parts_tuple, i);
5025static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) {
5026#if PY_MAJOR_VERSION < 3
5027 PyObject *module, *from_list, *star = __pyx_n_s__5;
5028 CYTHON_UNUSED_VAR(parts_tuple);
5029 from_list = PyList_New(1);
5030 if (unlikely(!from_list))
5033 PyList_SET_ITEM(from_list, 0, star);
5034 module = __Pyx_Import(name, from_list, 0);
5035 Py_DECREF(from_list);
5038 PyObject *imported_module;
5039 PyObject *
module = __Pyx_Import(name, NULL, 0);
5040 if (!parts_tuple || unlikely(!module))
5042 imported_module = __Pyx__ImportDottedModule_Lookup(name);
5043 if (likely(imported_module)) {
5045 return imported_module;
5048 return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple);
5051static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) {
5052#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1
5053 PyObject *
module = __Pyx__ImportDottedModule_Lookup(name);
5054 if (likely(module)) {
5055 PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec);
5057 PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing);
5058 if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) {
5064 if (likely(!spec)) {
5070 }
else if (PyErr_Occurred()) {
5074 return __Pyx__ImportDottedModule(name, parts_tuple);
5078#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
5079static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
5080 PyObject *dict = Py_TYPE(obj)->tp_dict;
5081 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
5083static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
5084 PyObject **dictptr = NULL;
5085 Py_ssize_t
offset = Py_TYPE(obj)->tp_dictoffset;
5087#if CYTHON_COMPILING_IN_CPYTHON
5088 dictptr = (likely(offset > 0)) ? (PyObject **) ((
char *)obj + offset) : _PyObject_GetDictPtr(obj);
5090 dictptr = _PyObject_GetDictPtr(obj);
5093 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
5095static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
5096 PyObject *dict = Py_TYPE(obj)->tp_dict;
5097 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
5099 return obj_dict_version == __Pyx_get_object_dict_version(obj);
5104#if CYTHON_USE_DICT_VERSIONS
5105static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
5107static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
5111#if !CYTHON_AVOID_BORROWED_REFS
5112#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000
5113 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
5114 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
5115 if (likely(result)) {
5116 return __Pyx_NewRef(result);
5117 }
else if (unlikely(PyErr_Occurred())) {
5120#elif CYTHON_COMPILING_IN_LIMITED_API
5121 if (unlikely(!__pyx_m)) {
5124 result = PyObject_GetAttr(__pyx_m, name);
5125 if (likely(result)) {
5129 result = PyDict_GetItem(__pyx_d, name);
5130 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
5131 if (likely(result)) {
5132 return __Pyx_NewRef(result);
5136 result = PyObject_GetItem(__pyx_d, name);
5137 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
5138 if (likely(result)) {
5139 return __Pyx_NewRef(result);
5143 return __Pyx_GetBuiltinName(name);
5147#ifndef __PYX_HAVE_RT_ImportType_3_0_11
5148#define __PYX_HAVE_RT_ImportType_3_0_11
5149static PyTypeObject *__Pyx_ImportType_3_0_11(PyObject *module,
const char *module_name,
const char *class_name,
5150 size_t size,
size_t alignment,
enum __Pyx_ImportType_CheckSize_3_0_11 check_size)
5152 PyObject *result = 0;
5154 Py_ssize_t basicsize;
5155 Py_ssize_t itemsize;
5156#if CYTHON_COMPILING_IN_LIMITED_API
5157 PyObject *py_basicsize;
5158 PyObject *py_itemsize;
5160 result = PyObject_GetAttrString(module, class_name);
5163 if (!PyType_Check(result)) {
5164 PyErr_Format(PyExc_TypeError,
5165 "%.200s.%.200s is not a type object",
5166 module_name, class_name);
5169#if !CYTHON_COMPILING_IN_LIMITED_API
5170 basicsize = ((PyTypeObject *)result)->tp_basicsize;
5171 itemsize = ((PyTypeObject *)result)->tp_itemsize;
5173 py_basicsize = PyObject_GetAttrString(result,
"__basicsize__");
5176 basicsize = PyLong_AsSsize_t(py_basicsize);
5177 Py_DECREF(py_basicsize);
5179 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
5181 py_itemsize = PyObject_GetAttrString(result,
"__itemsize__");
5184 itemsize = PyLong_AsSsize_t(py_itemsize);
5185 Py_DECREF(py_itemsize);
5187 if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
5191 if (size % alignment) {
5192 alignment = size % alignment;
5194 if (itemsize < (Py_ssize_t)alignment)
5195 itemsize = (Py_ssize_t)alignment;
5197 if ((
size_t)(basicsize + itemsize) < size) {
5198 PyErr_Format(PyExc_ValueError,
5199 "%.200s.%.200s size changed, may indicate binary incompatibility. "
5200 "Expected %zd from C header, got %zd from PyObject",
5201 module_name, class_name, size, basicsize+itemsize);
5204 if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_11 &&
5205 ((
size_t)basicsize > size || (
size_t)(basicsize + itemsize) < size)) {
5206 PyErr_Format(PyExc_ValueError,
5207 "%.200s.%.200s size changed, may indicate binary incompatibility. "
5208 "Expected %zd from C header, got %zd-%zd from PyObject",
5209 module_name, class_name, size, basicsize, basicsize+itemsize);
5212 else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_11 && (
size_t)basicsize > size) {
5213 PyOS_snprintf(warning,
sizeof(warning),
5214 "%s.%s size changed, may indicate binary incompatibility. "
5215 "Expected %zd from C header, got %zd from PyObject",
5216 module_name, class_name, size, basicsize);
5217 if (PyErr_WarnEx(NULL, warning, 0) < 0)
goto bad;
5219 return (PyTypeObject *)result;
5227#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
5228static _PyErr_StackItem *
5229__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
5231 _PyErr_StackItem *exc_info = tstate->exc_info;
5232 while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) &&
5233 exc_info->previous_item != NULL)
5235 exc_info = exc_info->previous_item;
5242#if CYTHON_FAST_THREAD_STATE
5243static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
5244 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
5245 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
5246 PyObject *exc_value = exc_info->exc_value;
5247 if (exc_value == NULL || exc_value == Py_None) {
5254 *type = (PyObject*) Py_TYPE(exc_value);
5256 *tb = PyException_GetTraceback(exc_value);
5258 #elif CYTHON_USE_EXC_INFO_STACK
5259 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
5260 *type = exc_info->exc_type;
5261 *value = exc_info->exc_value;
5262 *tb = exc_info->exc_traceback;
5267 *type = tstate->exc_type;
5268 *value = tstate->exc_value;
5269 *tb = tstate->exc_traceback;
5275static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
5276 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
5277 _PyErr_StackItem *exc_info = tstate->exc_info;
5278 PyObject *tmp_value = exc_info->exc_value;
5279 exc_info->exc_value = value;
5280 Py_XDECREF(tmp_value);
5284 PyObject *tmp_type, *tmp_value, *tmp_tb;
5285 #if CYTHON_USE_EXC_INFO_STACK
5286 _PyErr_StackItem *exc_info = tstate->exc_info;
5287 tmp_type = exc_info->exc_type;
5288 tmp_value = exc_info->exc_value;
5289 tmp_tb = exc_info->exc_traceback;
5290 exc_info->exc_type = type;
5291 exc_info->exc_value = value;
5292 exc_info->exc_traceback = tb;
5294 tmp_type = tstate->exc_type;
5295 tmp_value = tstate->exc_value;
5296 tmp_tb = tstate->exc_traceback;
5297 tstate->exc_type = type;
5298 tstate->exc_value = value;
5299 tstate->exc_traceback = tb;
5301 Py_XDECREF(tmp_type);
5302 Py_XDECREF(tmp_value);
5309#if CYTHON_FAST_THREAD_STATE
5310static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
5312static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
5315 PyObject *local_type = NULL, *local_value, *local_tb = NULL;
5316#if CYTHON_FAST_THREAD_STATE
5317 PyObject *tmp_type, *tmp_value, *tmp_tb;
5318 #if PY_VERSION_HEX >= 0x030C00A6
5319 local_value = tstate->current_exception;
5320 tstate->current_exception = 0;
5321 if (likely(local_value)) {
5322 local_type = (PyObject*) Py_TYPE(local_value);
5323 Py_INCREF(local_type);
5324 local_tb = PyException_GetTraceback(local_value);
5327 local_type = tstate->curexc_type;
5328 local_value = tstate->curexc_value;
5329 local_tb = tstate->curexc_traceback;
5330 tstate->curexc_type = 0;
5331 tstate->curexc_value = 0;
5332 tstate->curexc_traceback = 0;
5335 PyErr_Fetch(&local_type, &local_value, &local_tb);
5337 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
5338#if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6
5339 if (unlikely(tstate->current_exception))
5340#elif CYTHON_FAST_THREAD_STATE
5341 if (unlikely(tstate->curexc_type))
5343 if (unlikely(PyErr_Occurred()))
5346 #if PY_MAJOR_VERSION >= 3
5348 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
5352 Py_XINCREF(local_tb);
5353 Py_XINCREF(local_type);
5354 Py_XINCREF(local_value);
5356 *value = local_value;
5358#if CYTHON_FAST_THREAD_STATE
5359 #if CYTHON_USE_EXC_INFO_STACK
5361 _PyErr_StackItem *exc_info = tstate->exc_info;
5362 #if PY_VERSION_HEX >= 0x030B00a4
5363 tmp_value = exc_info->exc_value;
5364 exc_info->exc_value = local_value;
5367 Py_XDECREF(local_type);
5368 Py_XDECREF(local_tb);
5370 tmp_type = exc_info->exc_type;
5371 tmp_value = exc_info->exc_value;
5372 tmp_tb = exc_info->exc_traceback;
5373 exc_info->exc_type = local_type;
5374 exc_info->exc_value = local_value;
5375 exc_info->exc_traceback = local_tb;
5379 tmp_type = tstate->exc_type;
5380 tmp_value = tstate->exc_value;
5381 tmp_tb = tstate->exc_traceback;
5382 tstate->exc_type = local_type;
5383 tstate->exc_value = local_value;
5384 tstate->exc_traceback = local_tb;
5386 Py_XDECREF(tmp_type);
5387 Py_XDECREF(tmp_value);
5390 PyErr_SetExcInfo(local_type, local_value, local_tb);
5397 Py_XDECREF(local_type);
5398 Py_XDECREF(local_value);
5399 Py_XDECREF(local_tb);
5404#ifndef CYTHON_CLINE_IN_TRACEBACK
5405static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line) {
5406 PyObject *use_cline;
5407 PyObject *ptype, *pvalue, *ptraceback;
5408#if CYTHON_COMPILING_IN_CPYTHON
5409 PyObject **cython_runtime_dict;
5411 CYTHON_MAYBE_UNUSED_VAR(tstate);
5412 if (unlikely(!__pyx_cython_runtime)) {
5415 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
5416#if CYTHON_COMPILING_IN_CPYTHON
5417 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
5418 if (likely(cython_runtime_dict)) {
5419 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
5420 use_cline, *cython_runtime_dict,
5421 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
5425 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
5426 if (use_cline_obj) {
5427 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
5428 Py_DECREF(use_cline_obj);
5436 (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
5438 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
5441 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
5447#if !CYTHON_COMPILING_IN_LIMITED_API
5448static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
5449 int start = 0, mid = 0,
end = count - 1;
5450 if (end >= 0 && code_line > entries[end].code_line) {
5453 while (start < end) {
5454 mid = start + (
end - start) / 2;
5455 if (code_line < entries[mid].code_line) {
5457 }
else if (code_line > entries[mid].code_line) {
5463 if (code_line <= entries[mid].code_line) {
5469static PyCodeObject *__pyx_find_code_object(
int code_line) {
5470 PyCodeObject* code_object;
5472 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
5475 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
5476 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
5479 code_object = __pyx_code_cache.entries[pos].code_object;
5480 Py_INCREF(code_object);
5483static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
5485 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
5486 if (unlikely(!code_line)) {
5489 if (unlikely(!entries)) {
5490 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
5491 if (likely(entries)) {
5492 __pyx_code_cache.entries = entries;
5493 __pyx_code_cache.max_count = 64;
5494 __pyx_code_cache.count = 1;
5495 entries[0].code_line = code_line;
5496 entries[0].code_object = code_object;
5497 Py_INCREF(code_object);
5501 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
5502 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
5503 PyCodeObject* tmp = entries[pos].code_object;
5504 entries[pos].code_object = code_object;
5508 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
5509 int new_max = __pyx_code_cache.max_count + 64;
5510 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
5511 __pyx_code_cache.entries, ((
size_t)new_max) *
sizeof(__Pyx_CodeObjectCacheEntry));
5512 if (unlikely(!entries)) {
5515 __pyx_code_cache.entries = entries;
5516 __pyx_code_cache.max_count = new_max;
5518 for (i=__pyx_code_cache.count; i>pos; i--) {
5519 entries[i] = entries[i-1];
5521 entries[pos].code_line = code_line;
5522 entries[pos].code_object = code_object;
5523 __pyx_code_cache.count++;
5524 Py_INCREF(code_object);
5530#include "frameobject.h"
5531#include "traceback.h"
5532#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API
5533 #ifndef Py_BUILD_CORE
5534 #define Py_BUILD_CORE 1
5536 #include "internal/pycore_frame.h"
5538#if CYTHON_COMPILING_IN_LIMITED_API
5539static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
5540 PyObject *firstlineno, PyObject *name) {
5541 PyObject *replace = NULL;
5542 if (unlikely(PyDict_SetItemString(scratch_dict,
"co_firstlineno", firstlineno)))
return NULL;
5543 if (unlikely(PyDict_SetItemString(scratch_dict,
"co_name", name)))
return NULL;
5544 replace = PyObject_GetAttrString(code,
"replace");
5545 if (likely(replace)) {
5547 result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict);
5552 #if __PYX_LIMITED_VERSION_HEX < 0x030780000
5554 PyObject *compiled = NULL, *result = NULL;
5555 if (unlikely(PyDict_SetItemString(scratch_dict,
"code", code)))
return NULL;
5556 if (unlikely(PyDict_SetItemString(scratch_dict,
"type", (PyObject*)(&PyType_Type))))
return NULL;
5557 compiled = Py_CompileString(
5558 "out = type(code)(\n"
5559 " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n"
5560 " code.co_flags, code.co_code, code.co_consts, code.co_names,\n"
5561 " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n"
5562 " code.co_lnotab)\n",
"<dummy>", Py_file_input);
5563 if (!compiled)
return NULL;
5564 result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict);
5565 Py_DECREF(compiled);
5566 if (!result) PyErr_Print();
5568 result = PyDict_GetItemString(scratch_dict,
"out");
5569 if (result) Py_INCREF(result);
5576static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
5577 int py_line,
const char *filename) {
5578 PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
5579 PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
5580 PyObject *exc_type, *exc_value, *exc_traceback;
5583 (void) __pyx_cfilenm;
5584 (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
5586 PyErr_Fetch(&exc_type, &exc_value, &exc_traceback);
5587 code_object = Py_CompileString(
"_getframe()", filename, Py_eval_input);
5588 if (unlikely(!code_object))
goto bad;
5589 py_py_line = PyLong_FromLong(py_line);
5590 if (unlikely(!py_py_line))
goto bad;
5591 py_funcname = PyUnicode_FromString(funcname);
5592 if (unlikely(!py_funcname))
goto bad;
5593 dict = PyDict_New();
5594 if (unlikely(!dict))
goto bad;
5596 PyObject *old_code_object = code_object;
5597 code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
5598 Py_DECREF(old_code_object);
5600 if (unlikely(!code_object))
goto bad;
5601 getframe = PySys_GetObject(
"_getframe");
5602 if (unlikely(!getframe))
goto bad;
5603 if (unlikely(PyDict_SetItemString(dict,
"_getframe", getframe)))
goto bad;
5604 frame = PyEval_EvalCode(code_object, dict, dict);
5605 if (unlikely(!frame) || frame == Py_None)
goto bad;
5608 PyErr_Restore(exc_type, exc_value, exc_traceback);
5609 Py_XDECREF(code_object);
5610 Py_XDECREF(py_py_line);
5611 Py_XDECREF(py_funcname);
5613 Py_XDECREF(replace);
5616 (
struct _frame*)frame);
5621static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
5622 const char *funcname,
int c_line,
5623 int py_line,
const char *filename) {
5624 PyCodeObject *py_code = NULL;
5625 PyObject *py_funcname = NULL;
5626 #if PY_MAJOR_VERSION < 3
5627 PyObject *py_srcfile = NULL;
5628 py_srcfile = PyString_FromString(filename);
5629 if (!py_srcfile)
goto bad;
5632 #if PY_MAJOR_VERSION < 3
5633 py_funcname = PyString_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
5634 if (!py_funcname)
goto bad;
5636 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
5637 if (!py_funcname)
goto bad;
5638 funcname = PyUnicode_AsUTF8(py_funcname);
5639 if (!funcname)
goto bad;
5643 #if PY_MAJOR_VERSION < 3
5644 py_funcname = PyString_FromString(funcname);
5645 if (!py_funcname)
goto bad;
5648 #if PY_MAJOR_VERSION < 3
5649 py_code = __Pyx_PyCode_New(
5667 Py_DECREF(py_srcfile);
5669 py_code = PyCode_NewEmpty(filename, funcname, py_line);
5671 Py_XDECREF(py_funcname);
5674 Py_XDECREF(py_funcname);
5675 #if PY_MAJOR_VERSION < 3
5676 Py_XDECREF(py_srcfile);
5680static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
5681 int py_line,
const char *filename) {
5682 PyCodeObject *py_code = 0;
5683 PyFrameObject *py_frame = 0;
5684 PyThreadState *tstate = __Pyx_PyThreadState_Current;
5685 PyObject *ptype, *pvalue, *ptraceback;
5687 c_line = __Pyx_CLineForTraceback(tstate, c_line);
5689 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
5691 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
5692 py_code = __Pyx_CreateCodeObjectForTraceback(
5693 funcname, c_line, py_line, filename);
5699 Py_XDECREF(ptraceback);
5702 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
5703 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
5705 py_frame = PyFrame_New(
5711 if (!py_frame)
goto bad;
5712 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
5713 PyTraceBack_Here(py_frame);
5715 Py_XDECREF(py_code);
5716 Py_XDECREF(py_frame);
5721#if CYTHON_COMPILING_IN_LIMITED_API
5722static __Pyx_TypeName
5723__Pyx_PyType_GetName(PyTypeObject* tp)
5725 PyObject *
name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
5727 if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) {
5730 name = __Pyx_NewRef(__pyx_n_s__7);
5737static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value) {
5738#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
5739#pragma GCC diagnostic push
5740#pragma GCC diagnostic ignored "-Wconversion"
5742 const long neg_one = (long) -1, const_zero = (
long) 0;
5743#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
5744#pragma GCC diagnostic pop
5746 const int is_unsigned = neg_one > const_zero;
5748 if (
sizeof(
long) <
sizeof(long)) {
5749 return PyInt_FromLong((
long) value);
5750 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
5751 return PyLong_FromUnsignedLong((
unsigned long) value);
5752#ifdef HAVE_LONG_LONG
5753 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
5754 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
5758 if (
sizeof(
long) <=
sizeof(
long)) {
5759 return PyInt_FromLong((
long) value);
5760#ifdef HAVE_LONG_LONG
5761 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
5762 return PyLong_FromLongLong((PY_LONG_LONG) value);
5767 unsigned char *bytes = (
unsigned char *)&value;
5768#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
5770 return PyLong_FromUnsignedNativeBytes(bytes,
sizeof(value), -1);
5772 return PyLong_FromNativeBytes(bytes,
sizeof(value), -1);
5774#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
5775 int one = 1;
int little = (int)*(
unsigned char *)&one;
5776 return _PyLong_FromByteArray(bytes,
sizeof(
long),
5777 little, !is_unsigned);
5779 int one = 1;
int little = (int)*(
unsigned char *)&one;
5780 PyObject *from_bytes, *result = NULL;
5781 PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
5782 from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type,
"from_bytes");
5783 if (!from_bytes)
return NULL;
5784 py_bytes = PyBytes_FromStringAndSize((
char*)bytes,
sizeof(
long));
5785 if (!py_bytes)
goto limited_bad;
5786 order_str = PyUnicode_FromString(little ?
"little" :
"big");
5787 if (!order_str)
goto limited_bad;
5788 arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
5789 if (!arg_tuple)
goto limited_bad;
5791 kwds = PyDict_New();
5792 if (!kwds)
goto limited_bad;
5793 if (PyDict_SetItemString(kwds,
"signed", __Pyx_NewRef(Py_True)))
goto limited_bad;
5795 result = PyObject_Call(from_bytes, arg_tuple, kwds);
5798 Py_XDECREF(arg_tuple);
5799 Py_XDECREF(order_str);
5800 Py_XDECREF(py_bytes);
5801 Py_XDECREF(from_bytes);
5808#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
5809 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
5810#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
5811 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
5812#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
5814 func_type value = func_value;\
5815 if (sizeof(target_type) < sizeof(func_type)) {\
5816 if (unlikely(value != (func_type) (target_type) value)) {\
5817 func_type zero = 0;\
5818 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
5819 return (target_type) -1;\
5820 if (is_unsigned && unlikely(value < zero))\
5821 goto raise_neg_overflow;\
5823 goto raise_overflow;\
5826 return (target_type) value;\
5830static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *x) {
5831#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
5832#pragma GCC diagnostic push
5833#pragma GCC diagnostic ignored "-Wconversion"
5835 const long neg_one = (long) -1, const_zero = (
long) 0;
5836#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
5837#pragma GCC diagnostic pop
5839 const int is_unsigned = neg_one > const_zero;
5840#if PY_MAJOR_VERSION < 3
5841 if (likely(PyInt_Check(x))) {
5842 if ((
sizeof(
long) <
sizeof(
long))) {
5843 __PYX_VERIFY_RETURN_INT(
long,
long, PyInt_AS_LONG(x))
5845 long val = PyInt_AS_LONG(x);
5846 if (is_unsigned && unlikely(val < 0)) {
5847 goto raise_neg_overflow;
5853 if (unlikely(!PyLong_Check(x))) {
5855 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
5856 if (!tmp)
return (
long) -1;
5857 val = __Pyx_PyInt_As_long(tmp);
5862#if CYTHON_USE_PYLONG_INTERNALS
5863 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
5864 goto raise_neg_overflow;
5865 }
else if (__Pyx_PyLong_IsCompact(x)) {
5866 __PYX_VERIFY_RETURN_INT(
long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
5868 const digit* digits = __Pyx_PyLong_Digits(x);
5869 assert(__Pyx_PyLong_DigitCount(x) > 1);
5870 switch (__Pyx_PyLong_DigitCount(x)) {
5872 if ((8 *
sizeof(
long) > 1 * PyLong_SHIFT)) {
5873 if ((8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT)) {
5874 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
5875 }
else if ((8 *
sizeof(
long) >= 2 * PyLong_SHIFT)) {
5876 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
5881 if ((8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
5882 if ((8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT)) {
5883 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
5884 }
else if ((8 *
sizeof(
long) >= 3 * PyLong_SHIFT)) {
5885 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
5890 if ((8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
5891 if ((8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT)) {
5892 __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])))
5893 }
else if ((8 *
sizeof(
long) >= 4 * PyLong_SHIFT)) {
5894 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
5901#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
5902 if (unlikely(Py_SIZE(x) < 0)) {
5903 goto raise_neg_overflow;
5907 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
5908 if (unlikely(result < 0))
5910 if (unlikely(result == 1))
5911 goto raise_neg_overflow;
5914 if ((
sizeof(
long) <=
sizeof(
unsigned long))) {
5915 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
5916#ifdef HAVE_LONG_LONG
5917 }
else if ((
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG))) {
5918 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
5922#if CYTHON_USE_PYLONG_INTERNALS
5923 if (__Pyx_PyLong_IsCompact(x)) {
5924 __PYX_VERIFY_RETURN_INT(
long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
5926 const digit* digits = __Pyx_PyLong_Digits(x);
5927 assert(__Pyx_PyLong_DigitCount(x) > 1);
5928 switch (__Pyx_PyLong_SignedDigitCount(x)) {
5930 if ((8 *
sizeof(
long) - 1 > 1 * PyLong_SHIFT)) {
5931 if ((8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT)) {
5932 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
5933 }
else if ((8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT)) {
5934 return (
long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
5939 if ((8 *
sizeof(
long) > 1 * PyLong_SHIFT)) {
5940 if ((8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT)) {
5941 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
5942 }
else if ((8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT)) {
5943 return (
long) ((((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
5948 if ((8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT)) {
5949 if ((8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT)) {
5950 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
5951 }
else if ((8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT)) {
5952 return (
long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
5957 if ((8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
5958 if ((8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT)) {
5959 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
5960 }
else if ((8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT)) {
5961 return (
long) ((((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
5966 if ((8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT)) {
5967 if ((8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT)) {
5968 __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])))
5969 }
else if ((8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT)) {
5970 return (
long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
5975 if ((8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
5976 if ((8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT)) {
5977 __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])))
5978 }
else if ((8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT)) {
5979 return (
long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
5986 if ((
sizeof(
long) <=
sizeof(long))) {
5987 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
5988#ifdef HAVE_LONG_LONG
5989 }
else if ((
sizeof(
long) <=
sizeof(PY_LONG_LONG))) {
5990 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
5997#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
5998 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
5999 x, &val,
sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
6000 if (unlikely(bytes_copied == -1)) {
6001 }
else if (unlikely(bytes_copied > (Py_ssize_t)
sizeof(val))) {
6002 goto raise_overflow;
6006#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
6007 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
6008 unsigned char *bytes = (
unsigned char *)&val;
6009 ret = _PyLong_AsByteArray((PyLongObject *)x,
6011 is_little, !is_unsigned);
6014 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
6015 int bits, remaining_bits, is_negative = 0;
6016 int chunk_size = (
sizeof(long) < 8) ? 30 : 62;
6017 if (likely(PyLong_CheckExact(x))) {
6018 v = __Pyx_NewRef(x);
6020 v = PyNumber_Long(x);
6021 if (unlikely(!v))
return (
long) -1;
6022 assert(PyLong_CheckExact(v));
6025 int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
6026 if (unlikely(result < 0)) {
6030 is_negative = result == 1;
6032 if (is_unsigned && unlikely(is_negative)) {
6034 goto raise_neg_overflow;
6035 }
else if (is_negative) {
6036 stepval = PyNumber_Invert(v);
6038 if (unlikely(!stepval))
6045 mask = PyLong_FromLong((1L << chunk_size) - 1);
if (unlikely(!mask))
goto done;
6046 shift = PyLong_FromLong(chunk_size);
if (unlikely(!shift))
goto done;
6047 for (bits = 0; bits < (int)
sizeof(
long) * 8 - chunk_size; bits += chunk_size) {
6048 PyObject *tmp, *digit;
6050 digit = PyNumber_And(stepval, mask);
6051 if (unlikely(!digit))
goto done;
6052 idigit = PyLong_AsLong(digit);
6054 if (unlikely(idigit < 0))
goto done;
6055 val |= ((long) idigit) << bits;
6056 tmp = PyNumber_Rshift(stepval, shift);
6057 if (unlikely(!tmp))
goto done;
6058 Py_DECREF(stepval); stepval = tmp;
6060 Py_DECREF(shift); shift = NULL;
6061 Py_DECREF(mask); mask = NULL;
6063 long idigit = PyLong_AsLong(stepval);
6064 if (unlikely(idigit < 0))
goto done;
6065 remaining_bits = ((int)
sizeof(
long) * 8) - bits - (is_unsigned ? 0 : 1);
6066 if (unlikely(idigit >= (1L << remaining_bits)))
6067 goto raise_overflow;
6068 val |= ((long) idigit) << bits;
6071 if (unlikely(val & (((
long) 1) << (
sizeof(
long) * 8 - 1))))
6072 goto raise_overflow;
6080 Py_XDECREF(stepval);
6087 PyErr_SetString(PyExc_OverflowError,
6088 "value too large to convert to long");
6091 PyErr_SetString(PyExc_OverflowError,
6092 "can't convert negative value to long");
6097static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *x) {
6098#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
6099#pragma GCC diagnostic push
6100#pragma GCC diagnostic ignored "-Wconversion"
6102 const int neg_one = (int) -1, const_zero = (
int) 0;
6103#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
6104#pragma GCC diagnostic pop
6106 const int is_unsigned = neg_one > const_zero;
6107#if PY_MAJOR_VERSION < 3
6108 if (likely(PyInt_Check(x))) {
6109 if ((
sizeof(
int) <
sizeof(
long))) {
6110 __PYX_VERIFY_RETURN_INT(
int,
long, PyInt_AS_LONG(x))
6112 long val = PyInt_AS_LONG(x);
6113 if (is_unsigned && unlikely(val < 0)) {
6114 goto raise_neg_overflow;
6120 if (unlikely(!PyLong_Check(x))) {
6122 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
6123 if (!tmp)
return (
int) -1;
6124 val = __Pyx_PyInt_As_int(tmp);
6129#if CYTHON_USE_PYLONG_INTERNALS
6130 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
6131 goto raise_neg_overflow;
6132 }
else if (__Pyx_PyLong_IsCompact(x)) {
6133 __PYX_VERIFY_RETURN_INT(
int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
6135 const digit* digits = __Pyx_PyLong_Digits(x);
6136 assert(__Pyx_PyLong_DigitCount(x) > 1);
6137 switch (__Pyx_PyLong_DigitCount(x)) {
6139 if ((8 *
sizeof(
int) > 1 * PyLong_SHIFT)) {
6140 if ((8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT)) {
6141 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
6142 }
else if ((8 *
sizeof(
int) >= 2 * PyLong_SHIFT)) {
6143 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
6148 if ((8 *
sizeof(
int) > 2 * PyLong_SHIFT)) {
6149 if ((8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT)) {
6150 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
6151 }
else if ((8 *
sizeof(
int) >= 3 * PyLong_SHIFT)) {
6152 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
6157 if ((8 *
sizeof(
int) > 3 * PyLong_SHIFT)) {
6158 if ((8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT)) {
6159 __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])))
6160 }
else if ((8 *
sizeof(
int) >= 4 * PyLong_SHIFT)) {
6161 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
6168#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
6169 if (unlikely(Py_SIZE(x) < 0)) {
6170 goto raise_neg_overflow;
6174 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
6175 if (unlikely(result < 0))
6177 if (unlikely(result == 1))
6178 goto raise_neg_overflow;
6181 if ((
sizeof(
int) <=
sizeof(
unsigned long))) {
6182 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
6183#ifdef HAVE_LONG_LONG
6184 }
else if ((
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG))) {
6185 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
6189#if CYTHON_USE_PYLONG_INTERNALS
6190 if (__Pyx_PyLong_IsCompact(x)) {
6191 __PYX_VERIFY_RETURN_INT(
int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
6193 const digit* digits = __Pyx_PyLong_Digits(x);
6194 assert(__Pyx_PyLong_DigitCount(x) > 1);
6195 switch (__Pyx_PyLong_SignedDigitCount(x)) {
6197 if ((8 *
sizeof(
int) - 1 > 1 * PyLong_SHIFT)) {
6198 if ((8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT)) {
6199 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
6200 }
else if ((8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT)) {
6201 return (
int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
6206 if ((8 *
sizeof(
int) > 1 * PyLong_SHIFT)) {
6207 if ((8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT)) {
6208 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
6209 }
else if ((8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT)) {
6210 return (
int) ((((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
6215 if ((8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT)) {
6216 if ((8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT)) {
6217 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
6218 }
else if ((8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT)) {
6219 return (
int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
6224 if ((8 *
sizeof(
int) > 2 * PyLong_SHIFT)) {
6225 if ((8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT)) {
6226 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
6227 }
else if ((8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT)) {
6228 return (
int) ((((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
6233 if ((8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT)) {
6234 if ((8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT)) {
6235 __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])))
6236 }
else if ((8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT)) {
6237 return (
int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
6242 if ((8 *
sizeof(
int) > 3 * PyLong_SHIFT)) {
6243 if ((8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT)) {
6244 __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])))
6245 }
else if ((8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT)) {
6246 return (
int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
6253 if ((
sizeof(
int) <=
sizeof(long))) {
6254 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
6255#ifdef HAVE_LONG_LONG
6256 }
else if ((
sizeof(
int) <=
sizeof(PY_LONG_LONG))) {
6257 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
6264#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
6265 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
6266 x, &val,
sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
6267 if (unlikely(bytes_copied == -1)) {
6268 }
else if (unlikely(bytes_copied > (Py_ssize_t)
sizeof(val))) {
6269 goto raise_overflow;
6273#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
6274 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
6275 unsigned char *bytes = (
unsigned char *)&val;
6276 ret = _PyLong_AsByteArray((PyLongObject *)x,
6278 is_little, !is_unsigned);
6281 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
6282 int bits, remaining_bits, is_negative = 0;
6283 int chunk_size = (
sizeof(long) < 8) ? 30 : 62;
6284 if (likely(PyLong_CheckExact(x))) {
6285 v = __Pyx_NewRef(x);
6287 v = PyNumber_Long(x);
6288 if (unlikely(!v))
return (
int) -1;
6289 assert(PyLong_CheckExact(v));
6292 int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
6293 if (unlikely(result < 0)) {
6297 is_negative = result == 1;
6299 if (is_unsigned && unlikely(is_negative)) {
6301 goto raise_neg_overflow;
6302 }
else if (is_negative) {
6303 stepval = PyNumber_Invert(v);
6305 if (unlikely(!stepval))
6312 mask = PyLong_FromLong((1L << chunk_size) - 1);
if (unlikely(!mask))
goto done;
6313 shift = PyLong_FromLong(chunk_size);
if (unlikely(!shift))
goto done;
6314 for (bits = 0; bits < (int)
sizeof(
int) * 8 - chunk_size; bits += chunk_size) {
6315 PyObject *tmp, *digit;
6317 digit = PyNumber_And(stepval, mask);
6318 if (unlikely(!digit))
goto done;
6319 idigit = PyLong_AsLong(digit);
6321 if (unlikely(idigit < 0))
goto done;
6322 val |= ((int) idigit) << bits;
6323 tmp = PyNumber_Rshift(stepval, shift);
6324 if (unlikely(!tmp))
goto done;
6325 Py_DECREF(stepval); stepval = tmp;
6327 Py_DECREF(shift); shift = NULL;
6328 Py_DECREF(mask); mask = NULL;
6330 long idigit = PyLong_AsLong(stepval);
6331 if (unlikely(idigit < 0))
goto done;
6332 remaining_bits = ((int)
sizeof(
int) * 8) - bits - (is_unsigned ? 0 : 1);
6333 if (unlikely(idigit >= (1L << remaining_bits)))
6334 goto raise_overflow;
6335 val |= ((int) idigit) << bits;
6338 if (unlikely(val & (((
int) 1) << (
sizeof(
int) * 8 - 1))))
6339 goto raise_overflow;
6347 Py_XDECREF(stepval);
6354 PyErr_SetString(PyExc_OverflowError,
6355 "value too large to convert to int");
6358 PyErr_SetString(PyExc_OverflowError,
6359 "can't convert negative value to int");
6364#if CYTHON_COMPILING_IN_CPYTHON
6365static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
6367 a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
6371 return b == &PyBaseObject_Type;
6373static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
6375 if (a == b)
return 1;
6379 n = PyTuple_GET_SIZE(mro);
6380 for (i = 0; i < n; i++) {
6381 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
6386 return __Pyx_InBases(a, b);
6388static CYTHON_INLINE
int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
6390 if (cls == a || cls == b)
return 1;
6394 n = PyTuple_GET_SIZE(mro);
6395 for (i = 0; i < n; i++) {
6396 PyObject *base = PyTuple_GET_ITEM(mro, i);
6397 if (base == (PyObject *)a || base == (PyObject *)b)
6402 return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
6404#if PY_MAJOR_VERSION == 2
6405static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
6406 PyObject *exception, *value, *tb;
6408 __Pyx_PyThreadState_declare
6409 __Pyx_PyThreadState_assign
6410 __Pyx_ErrFetch(&exception, &value, &tb);
6411 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
6412 if (unlikely(res == -1)) {
6413 PyErr_WriteUnraisable(err);
6417 res = PyObject_IsSubclass(err, exc_type2);
6418 if (unlikely(res == -1)) {
6419 PyErr_WriteUnraisable(err);
6423 __Pyx_ErrRestore(exception, value, tb);
6427static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
6429 return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
6431 return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
6435static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
6437 assert(PyExceptionClass_Check(exc_type));
6438 n = PyTuple_GET_SIZE(tuple);
6439#if PY_MAJOR_VERSION >= 3
6440 for (i=0; i<n; i++) {
6441 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
6444 for (i=0; i<n; i++) {
6445 PyObject *t = PyTuple_GET_ITEM(tuple, i);
6446 #if PY_MAJOR_VERSION < 3
6447 if (likely(exc_type == t))
return 1;
6449 if (likely(PyExceptionClass_Check(t))) {
6450 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
6456static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
6457 if (likely(err == exc_type))
return 1;
6458 if (likely(PyExceptionClass_Check(err))) {
6459 if (likely(PyExceptionClass_Check(exc_type))) {
6460 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
6461 }
else if (likely(PyTuple_Check(exc_type))) {
6462 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
6466 return PyErr_GivenExceptionMatches(err, exc_type);
6468static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
6469 assert(PyExceptionClass_Check(exc_type1));
6470 assert(PyExceptionClass_Check(exc_type2));
6471 if (likely(err == exc_type1 || err == exc_type2))
return 1;
6472 if (likely(PyExceptionClass_Check(err))) {
6473 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
6475 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
6480static unsigned long __Pyx_get_runtime_version(
void) {
6481#if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4
6482 return Py_Version & ~0xFFUL;
6484 const char* rt_version = Py_GetVersion();
6485 unsigned long version = 0;
6486 unsigned long factor = 0x01000000UL;
6487 unsigned int digit = 0;
6490 while (
'0' <= rt_version[i] && rt_version[i] <=
'9') {
6491 digit = digit * 10 + (
unsigned int) (rt_version[i] -
'0');
6494 version += factor * digit;
6495 if (rt_version[i] !=
'.')
6504static int __Pyx_check_binary_version(
unsigned long ct_version,
unsigned long rt_version,
int allow_newer) {
6505 const unsigned long MAJOR_MINOR = 0xFFFF0000UL;
6506 if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR))
6508 if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
6512 PyOS_snprintf(message,
sizeof(message),
6513 "compile time Python version %d.%d "
6514 "of module '%.100s' "
6516 "runtime version %d.%d",
6517 (
int) (ct_version >> 24), (
int) ((ct_version >> 16) & 0xFF),
6519 (allow_newer) ?
"was newer than" :
"does not match",
6520 (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF)
6522 return PyErr_WarnEx(NULL, message, 1);
6527static int __Pyx_ExportFunction(
const char *name,
void (*f)(
void),
const char *sig) {
6534 d = PyObject_GetAttrString(__pyx_m, (
char *)
"__pyx_capi__");
6541 if (PyModule_AddObject(__pyx_m, (
char *)
"__pyx_capi__", d) < 0)
6545 cobj = PyCapsule_New(tmp.p, sig, 0);
6548 if (PyDict_SetItemString(d, name, cobj) < 0)
6560#if PY_MAJOR_VERSION >= 3
6561static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) {
6562 if (t.is_unicode | t.is_str) {
6564 *str = PyUnicode_InternFromString(t.s);
6565 }
else if (t.encoding) {
6566 *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL);
6568 *str = PyUnicode_FromStringAndSize(t.s, t.n - 1);
6571 *str = PyBytes_FromStringAndSize(t.s, t.n - 1);
6575 if (PyObject_Hash(*str) == -1)
6580static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
6582 #if PY_MAJOR_VERSION >= 3
6583 __Pyx_InitString(*t, t->p);
6585 if (t->is_unicode) {
6586 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
6587 }
else if (t->intern) {
6588 *t->p = PyString_InternFromString(t->s);
6590 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
6594 if (PyObject_Hash(*t->p) == -1)
6603static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(
const char *s) {
6604 size_t len = strlen(s);
6605 if (unlikely(len > (
size_t) PY_SSIZE_T_MAX)) {
6606 PyErr_SetString(PyExc_OverflowError,
"byte string is too long");
6609 return (Py_ssize_t) len;
6611static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
6612 Py_ssize_t len = __Pyx_ssize_strlen(c_str);
6613 if (unlikely(len < 0))
return NULL;
6614 return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
6616static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(
const char* c_str) {
6617 Py_ssize_t len = __Pyx_ssize_strlen(c_str);
6618 if (unlikely(len < 0))
return NULL;
6619 return PyByteArray_FromStringAndSize(c_str, len);
6621static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
6623 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
6625#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
6626#if !CYTHON_PEP393_ENABLED
6627static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
6629 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
6630 if (!defenc)
return NULL;
6631 defenc_c = PyBytes_AS_STRING(defenc);
6632#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
6634 char*
end = defenc_c + PyBytes_GET_SIZE(defenc);
6636 for (c = defenc_c; c <
end; c++) {
6637 if ((
unsigned char) (*c) >= 128) {
6638 PyUnicode_AsASCIIString(o);
6644 *length = PyBytes_GET_SIZE(defenc);
6648static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
6649 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
6650#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
6651 if (likely(PyUnicode_IS_ASCII(o))) {
6652 *length = PyUnicode_GET_LENGTH(o);
6653 return PyUnicode_AsUTF8(o);
6655 PyUnicode_AsASCIIString(o);
6659 return PyUnicode_AsUTF8AndSize(o, length);
6664static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
6665#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
6667#
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
6668 __Pyx_sys_getdefaultencoding_not_ascii &&
6670 PyUnicode_Check(o)) {
6671 return __Pyx_PyUnicode_AsStringAndSize(o, length);
6674#if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
6675 if (PyByteArray_Check(o)) {
6676 *length = PyByteArray_GET_SIZE(o);
6677 return PyByteArray_AS_STRING(o);
6682 int r = PyBytes_AsStringAndSize(o, &result, length);
6683 if (unlikely(r < 0)) {
6690static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
6691 int is_true = x == Py_True;
6692 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
6693 else return PyObject_IsTrue(x);
6695static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
6697 if (unlikely(!x))
return -1;
6698 retval = __Pyx_PyObject_IsTrue(x);
6702static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result,
const char* type_name) {
6703 __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result));
6704#if PY_MAJOR_VERSION >= 3
6705 if (PyLong_Check(result)) {
6706 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
6707 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME
"). "
6708 "The ability to return an instance of a strict subclass of int is deprecated, "
6709 "and may be removed in a future version of Python.",
6710 result_type_name)) {
6711 __Pyx_DECREF_TypeName(result_type_name);
6715 __Pyx_DECREF_TypeName(result_type_name);
6719 PyErr_Format(PyExc_TypeError,
6720 "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME
")",
6721 type_name, type_name, result_type_name);
6722 __Pyx_DECREF_TypeName(result_type_name);
6726static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
6727#if CYTHON_USE_TYPE_SLOTS
6730 const char *
name = NULL;
6731 PyObject *res = NULL;
6732#if PY_MAJOR_VERSION < 3
6733 if (likely(PyInt_Check(x) || PyLong_Check(x)))
6735 if (likely(PyLong_Check(x)))
6737 return __Pyx_NewRef(x);
6738#if CYTHON_USE_TYPE_SLOTS
6739 m = Py_TYPE(x)->tp_as_number;
6740 #if PY_MAJOR_VERSION < 3
6741 if (m && m->nb_int) {
6745 else if (m && m->nb_long) {
6747 res = m->nb_long(x);
6750 if (likely(m && m->nb_int)) {
6756 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
6757 res = PyNumber_Int(x);
6761#if PY_MAJOR_VERSION < 3
6762 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
6764 if (unlikely(!PyLong_CheckExact(res))) {
6766 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
6769 else if (!PyErr_Occurred()) {
6770 PyErr_SetString(PyExc_TypeError,
6771 "an integer is required");
6775static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
6778#if PY_MAJOR_VERSION < 3
6779 if (likely(PyInt_CheckExact(b))) {
6780 if (
sizeof(Py_ssize_t) >=
sizeof(
long))
6781 return PyInt_AS_LONG(b);
6783 return PyInt_AsSsize_t(b);
6786 if (likely(PyLong_CheckExact(b))) {
6787 #if CYTHON_USE_PYLONG_INTERNALS
6788 if (likely(__Pyx_PyLong_IsCompact(b))) {
6789 return __Pyx_PyLong_CompactValue(b);
6791 const digit* digits = __Pyx_PyLong_Digits(b);
6792 const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b);
6795 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
6796 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
6800 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
6801 return -(Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
6805 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
6806 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
6810 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
6811 return -(Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
6815 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
6816 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]));
6820 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
6821 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]));
6827 return PyLong_AsSsize_t(b);
6829 x = PyNumber_Index(b);
6831 ival = PyInt_AsSsize_t(x);
6835static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
6836 if (
sizeof(Py_hash_t) ==
sizeof(Py_ssize_t)) {
6837 return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
6838#if PY_MAJOR_VERSION < 3
6839 }
else if (likely(PyInt_CheckExact(o))) {
6840 return PyInt_AS_LONG(o);
6845 x = PyNumber_Index(o);
6847 ival = PyInt_AsLong(x);
6852static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
6853 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
6855static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t ival) {
6856 return PyInt_FromSize_t(ival);
6862#pragma warning( pop )
bool operator==(const CapacityConstraint< T > &lhs, const CapacityConstraint< T > &rhs)
CapacityConstraint-CapacityConstraint equality operator.
enable_if< has_const_iterator< T >::value, typenameT::const_iterator >::type end(const T &c)
std::string name(int nuc)
int offset(int dz, int da, int ds=0)
A helper function to compute nuclide id offsets from z-, a-, and s- deltas.
unsigned int hash(std::string s)
double b(int nuc)
Computes the scattering length [cm] from the coherent and incoherent components.
void warning(std::string s)
Prints a warning message.
__PYX_EXTERN_C std::string CyclusPyToJson(std::string)
__PYX_EXTERN_C std::string CyclusJsonToPy(std::string)
PyMODINIT_FUNC initpyinfile(void)