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__pymodule
1232#define __PYX_HAVE_API__pymodule
1252#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
1253#define CYTHON_WITHOUT_ASSERTIONS
1256typedef struct {PyObject **p;
const char *s;
const Py_ssize_t n;
const char* encoding;
1257 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
1259#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
1260#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
1261#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
1262#define __PYX_DEFAULT_STRING_ENCODING ""
1263#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
1264#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
1265#define __Pyx_uchar_cast(c) ((unsigned char)c)
1266#define __Pyx_long_cast(x) ((long)x)
1267#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
1268 (sizeof(type) < sizeof(Py_ssize_t)) ||\
1269 (sizeof(type) > sizeof(Py_ssize_t) &&\
1270 likely(v < (type)PY_SSIZE_T_MAX ||\
1271 v == (type)PY_SSIZE_T_MAX) &&\
1272 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
1273 v == (type)PY_SSIZE_T_MIN))) ||\
1274 (sizeof(type) == sizeof(Py_ssize_t) &&\
1275 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
1276 v == (type)PY_SSIZE_T_MAX))) )
1277static CYTHON_INLINE
int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
1278 return (
size_t) i < (size_t) limit;
1280#if defined (__cplusplus) && __cplusplus >= 201103L
1282 #define __Pyx_sst_abs(value) std::abs(value)
1283#elif SIZEOF_INT >= SIZEOF_SIZE_T
1284 #define __Pyx_sst_abs(value) abs(value)
1285#elif SIZEOF_LONG >= SIZEOF_SIZE_T
1286 #define __Pyx_sst_abs(value) labs(value)
1287#elif defined (_MSC_VER)
1288 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
1289#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
1290 #define __Pyx_sst_abs(value) llabs(value)
1291#elif defined (__GNUC__)
1292 #define __Pyx_sst_abs(value) __builtin_llabs(value)
1294 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
1296static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(
const char *s);
1297static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
1298static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
1299static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(
const char*);
1300#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
1301#define __Pyx_PyBytes_FromString PyBytes_FromString
1302#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
1303static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
1304#if PY_MAJOR_VERSION < 3
1305 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
1306 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
1308 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
1309 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
1311#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
1312#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
1313#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
1314#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
1315#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
1316#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
1317#define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1318#define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1319#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1320#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
1321#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
1322#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
1323#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
1324#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
1325#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
1326#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
1327#define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o)
1328#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
1329#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
1330#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
1331static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
1332static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
1333static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
1334static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
1335#define __Pyx_PySequence_Tuple(obj)\
1336 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
1337static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
1338static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
1339static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
1340#if CYTHON_ASSUME_SAFE_MACROS
1341#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
1343#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
1345#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
1346#if PY_MAJOR_VERSION >= 3
1347#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
1349#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
1351#if CYTHON_USE_PYLONG_INTERNALS
1352 #if PY_VERSION_HEX >= 0x030C00A7
1353 #ifndef _PyLong_SIGN_MASK
1354 #define _PyLong_SIGN_MASK 3
1356 #ifndef _PyLong_NON_SIZE_BITS
1357 #define _PyLong_NON_SIZE_BITS 3
1359 #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK)
1360 #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0)
1361 #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x))
1362 #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1)
1363 #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0)
1364 #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0])
1365 #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
1366 #define __Pyx_PyLong_SignedDigitCount(x)\
1367 ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
1368 #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
1369 #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x)
1370 #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x)
1372 #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
1373 #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
1375 typedef Py_ssize_t __Pyx_compact_pylong;
1376 typedef size_t __Pyx_compact_upylong;
1378 #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0)
1379 #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0)
1380 #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0)
1381 #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0)
1382 #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
1383 #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x))
1384 #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x)
1385 #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
1386 #define __Pyx_PyLong_CompactValue(x)\
1387 ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
1388 typedef sdigit __Pyx_compact_pylong;
1389 typedef digit __Pyx_compact_upylong;
1391 #if PY_VERSION_HEX >= 0x030C00A5
1392 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit)
1394 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit)
1397#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1399static int __Pyx_sys_getdefaultencoding_not_ascii;
1400static int __Pyx_init_sys_getdefaultencoding_params(
void) {
1402 PyObject* default_encoding = NULL;
1403 PyObject* ascii_chars_u = NULL;
1404 PyObject* ascii_chars_b = NULL;
1405 const char* default_encoding_c;
1406 sys = PyImport_ImportModule(
"sys");
1408 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
1410 if (!default_encoding)
goto bad;
1411 default_encoding_c = PyBytes_AsString(default_encoding);
1412 if (!default_encoding_c)
goto bad;
1413 if (strcmp(default_encoding_c,
"ascii") == 0) {
1414 __Pyx_sys_getdefaultencoding_not_ascii = 0;
1416 char ascii_chars[128];
1418 for (c = 0; c < 128; c++) {
1419 ascii_chars[c] = (char) c;
1421 __Pyx_sys_getdefaultencoding_not_ascii = 1;
1422 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
1423 if (!ascii_chars_u)
goto bad;
1424 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
1425 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
1428 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
1429 default_encoding_c);
1432 Py_DECREF(ascii_chars_u);
1433 Py_DECREF(ascii_chars_b);
1435 Py_DECREF(default_encoding);
1438 Py_XDECREF(default_encoding);
1439 Py_XDECREF(ascii_chars_u);
1440 Py_XDECREF(ascii_chars_b);
1444#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
1445#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
1447#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
1448#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
1450static char* __PYX_DEFAULT_STRING_ENCODING;
1451static int __Pyx_init_sys_getdefaultencoding_params(
void) {
1453 PyObject* default_encoding = NULL;
1454 char* default_encoding_c;
1455 sys = PyImport_ImportModule(
"sys");
1457 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
1459 if (!default_encoding)
goto bad;
1460 default_encoding_c = PyBytes_AsString(default_encoding);
1461 if (!default_encoding_c)
goto bad;
1462 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c) + 1);
1463 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
1464 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
1465 Py_DECREF(default_encoding);
1468 Py_XDECREF(default_encoding);
1476#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
1477 #define likely(x) __builtin_expect(!!(x), 1)
1478 #define unlikely(x) __builtin_expect(!!(x), 0)
1480 #define likely(x) (x)
1481 #define unlikely(x) (x)
1483static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
1485#if !CYTHON_USE_MODULE_STATE
1486static PyObject *__pyx_m = NULL;
1488static int __pyx_lineno;
1489static int __pyx_clineno = 0;
1490static const char * __pyx_cfilenm = __FILE__;
1491static const char *__pyx_filename;
1495static const char *__pyx_f[] = {
1502#ifndef __PYX_FORCE_INIT_THREADS
1503 #define __PYX_FORCE_INIT_THREADS 0
1551#ifndef CYTHON_REFNANNY
1552 #define CYTHON_REFNANNY 0
1556 void (*INCREF)(
void*, PyObject*, Py_ssize_t);
1557 void (*DECREF)(
void*, PyObject*, Py_ssize_t);
1558 void (*GOTREF)(
void*, PyObject*, Py_ssize_t);
1559 void (*GIVEREF)(
void*, PyObject*, Py_ssize_t);
1560 void* (*SetupContext)(
const char*, Py_ssize_t,
const char*);
1561 void (*FinishContext)(
void**);
1562 } __Pyx_RefNannyAPIStruct;
1563 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1564 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1565 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1567 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1569 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1570 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
1571 PyGILState_Release(__pyx_gilstate_save);\
1573 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
1575 #define __Pyx_RefNannyFinishContextNogil() {\
1576 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1577 __Pyx_RefNannyFinishContext();\
1578 PyGILState_Release(__pyx_gilstate_save);\
1581 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1582 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__))
1583 #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext()
1585 #define __Pyx_RefNannyFinishContextNogil() {\
1586 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1587 __Pyx_RefNannyFinishContext();\
1588 PyGILState_Release(__pyx_gilstate_save);\
1590 #define __Pyx_RefNannyFinishContext()\
1591 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1592 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
1593 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
1594 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
1595 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
1596 #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0)
1597 #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0)
1598 #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0)
1599 #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0)
1601 #define __Pyx_RefNannyDeclarations
1602 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1603 #define __Pyx_RefNannyFinishContextNogil()
1604 #define __Pyx_RefNannyFinishContext()
1605 #define __Pyx_INCREF(r) Py_INCREF(r)
1606 #define __Pyx_DECREF(r) Py_DECREF(r)
1607 #define __Pyx_GOTREF(r)
1608 #define __Pyx_GIVEREF(r)
1609 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1610 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1611 #define __Pyx_XGOTREF(r)
1612 #define __Pyx_XGIVEREF(r)
1614#define __Pyx_Py_XDECREF_SET(r, v) do {\
1615 PyObject *tmp = (PyObject *) r;\
1616 r = v; Py_XDECREF(tmp);\
1618#define __Pyx_XDECREF_SET(r, v) do {\
1619 PyObject *tmp = (PyObject *) r;\
1620 r = v; __Pyx_XDECREF(tmp);\
1622#define __Pyx_DECREF_SET(r, v) do {\
1623 PyObject *tmp = (PyObject *) r;\
1624 r = v; __Pyx_DECREF(tmp);\
1626#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1627#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1630#if CYTHON_FAST_THREAD_STATE
1631#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1632static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1634#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1638#if CYTHON_FAST_THREAD_STATE
1639#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1640#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1641#if PY_VERSION_HEX >= 0x030C00A6
1642#define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL)
1643#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL)
1645#define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL)
1646#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type)
1649#define __Pyx_PyThreadState_declare
1650#define __Pyx_PyThreadState_assign
1651#define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL)
1652#define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred()
1656#if CYTHON_FAST_THREAD_STATE
1657#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1658#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1659#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1660#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1661#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1662static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1663static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1664#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6
1665#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1667#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1670#define __Pyx_PyErr_Clear() PyErr_Clear()
1671#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1672#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1673#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1674#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1675#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1676#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1677#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1681#if CYTHON_USE_TYPE_SLOTS
1682static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1684#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1688static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
1691static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1694#if CYTHON_FAST_PYCALL
1695#if !CYTHON_VECTORCALL
1696#define __Pyx_PyFunction_FastCall(func, args, nargs)\
1697 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1698static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1700#define __Pyx_BUILD_ASSERT_EXPR(cond)\
1701 (sizeof(char [1 - 2*!(cond)]) - 1)
1702#ifndef Py_MEMBER_SIZE
1703#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1705#if !CYTHON_VECTORCALL
1706#if PY_VERSION_HEX >= 0x03080000
1707 #include "frameobject.h"
1708#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API
1709 #ifndef Py_BUILD_CORE
1710 #define Py_BUILD_CORE 1
1712 #include "internal/pycore_frame.h"
1714 #define __Pxy_PyFrame_Initialize_Offsets()
1715 #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus)
1717 static size_t __pyx_pyframe_localsplus_offset = 0;
1718 #include "frameobject.h"
1719 #define __Pxy_PyFrame_Initialize_Offsets()\
1720 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1721 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1722 #define __Pyx_PyFrame_GetLocalsplus(frame)\
1723 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1729#if CYTHON_COMPILING_IN_CPYTHON
1730static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1732#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1736#if CYTHON_COMPILING_IN_CPYTHON
1737static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1741#define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL)
1742static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args,
size_t nargs, PyObject *kwargs);
1745#if CYTHON_USE_CPP_STD_MOVE
1747 #define __PYX_STD_MOVE_IF_SUPPORTED(x) std::move(x)
1749 #define __PYX_STD_MOVE_IF_SUPPORTED(x) x
1753#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1754#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1755#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1756#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1757 (version_var) = __PYX_GET_DICT_VERSION(dict);\
1758 (cache_var) = (value);
1759#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1760 static PY_UINT64_T __pyx_dict_version = 0;\
1761 static PyObject *__pyx_dict_cached_value = NULL;\
1762 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1763 (VAR) = __pyx_dict_cached_value;\
1765 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1766 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1769static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1770static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1771static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1773#define __PYX_GET_DICT_VERSION(dict) (0)
1774#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1775#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1779#if CYTHON_USE_DICT_VERSIONS
1780#define __Pyx_GetModuleGlobalName(var, name) do {\
1781 static PY_UINT64_T __pyx_dict_version = 0;\
1782 static PyObject *__pyx_dict_cached_value = NULL;\
1783 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1784 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1785 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1787#define __Pyx_GetModuleGlobalNameUncached(var, name) do {\
1788 PY_UINT64_T __pyx_dict_version;\
1789 PyObject *__pyx_dict_cached_value;\
1790 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1792static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1794#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1795#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1796static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1800#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
1801static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1805#if CYTHON_FAST_THREAD_STATE
1806#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1807static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1808#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1809static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1811#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1812#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1816#if CYTHON_FAST_THREAD_STATE
1817#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1818static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1820static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1824static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1827static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1830static CYTHON_INLINE
int __Pyx_IterFinish(
void);
1833static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
1839static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals);
1842static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals);
1845#ifndef __PYX_HAVE_RT_ImportType_proto_3_0_11
1846#define __PYX_HAVE_RT_ImportType_proto_3_0_11
1847#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
1848#include <stdalign.h>
1850#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
1851#define __PYX_GET_STRUCT_ALIGNMENT_3_0_11(s) alignof(s)
1853#define __PYX_GET_STRUCT_ALIGNMENT_3_0_11(s) sizeof(void*)
1855enum __Pyx_ImportType_CheckSize_3_0_11 {
1856 __Pyx_ImportType_CheckSize_Error_3_0_11 = 0,
1857 __Pyx_ImportType_CheckSize_Warn_3_0_11 = 1,
1858 __Pyx_ImportType_CheckSize_Ignore_3_0_11 = 2
1860static 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);
1864static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
1867static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1870static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple);
1871#if PY_MAJOR_VERSION >= 3
1872static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple);
1876#ifdef CYTHON_CLINE_IN_TRACEBACK
1877#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1879static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
1883#if !CYTHON_COMPILING_IN_LIMITED_API
1885 PyCodeObject* code_object;
1887} __Pyx_CodeObjectCacheEntry;
1888struct __Pyx_CodeObjectCache {
1891 __Pyx_CodeObjectCacheEntry* entries;
1893static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1894static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
1895static PyCodeObject *__pyx_find_code_object(
int code_line);
1896static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
1900static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
1901 int py_line,
const char *filename);
1904#ifndef __Pyx_CppExn2PyErr
1909static void __Pyx_CppExn2PyErr() {
1911 if (PyErr_Occurred())
1915 }
catch (
const std::bad_alloc& exn) {
1916 PyErr_SetString(PyExc_MemoryError, exn.what());
1917 }
catch (
const std::bad_cast& exn) {
1918 PyErr_SetString(PyExc_TypeError, exn.what());
1919 }
catch (
const std::bad_typeid& exn) {
1920 PyErr_SetString(PyExc_TypeError, exn.what());
1921 }
catch (
const std::domain_error& exn) {
1922 PyErr_SetString(PyExc_ValueError, exn.what());
1923 }
catch (
const std::invalid_argument& exn) {
1924 PyErr_SetString(PyExc_ValueError, exn.what());
1925 }
catch (
const std::ios_base::failure& exn) {
1926 PyErr_SetString(PyExc_IOError, exn.what());
1927 }
catch (
const std::out_of_range& exn) {
1928 PyErr_SetString(PyExc_IndexError, exn.what());
1929 }
catch (
const std::overflow_error& exn) {
1930 PyErr_SetString(PyExc_OverflowError, exn.what());
1931 }
catch (
const std::range_error& exn) {
1932 PyErr_SetString(PyExc_ArithmeticError, exn.what());
1933 }
catch (
const std::underflow_error& exn) {
1934 PyErr_SetString(PyExc_ArithmeticError, exn.what());
1935 }
catch (
const std::exception& exn) {
1936 PyErr_SetString(PyExc_RuntimeError, exn.what());
1940 PyErr_SetString(PyExc_RuntimeError,
"Unknown exception");
1946#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
1947#define __Pyx_HAS_GCC_DIAGNOSTIC
1951static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
1954#if CYTHON_COMPILING_IN_LIMITED_API
1955typedef PyObject *__Pyx_TypeName;
1956#define __Pyx_FMT_TYPENAME "%U"
1957static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp);
1958#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
1960typedef const char *__Pyx_TypeName;
1961#define __Pyx_FMT_TYPENAME "%.200s"
1962#define __Pyx_PyType_GetName(tp) ((tp)->tp_name)
1963#define __Pyx_DECREF_TypeName(obj)
1967static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
1970static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
1973static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
1976#if CYTHON_COMPILING_IN_CPYTHON
1977#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1978#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2)
1979static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1980static CYTHON_INLINE
int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b);
1981static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1982static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1984#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1985#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2))
1986#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1987#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1989#define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
1990#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1993static unsigned long __Pyx_get_runtime_version(
void);
1994static int __Pyx_check_binary_version(
unsigned long ct_version,
unsigned long rt_version,
int allow_newer);
1997static int __Pyx_ExportFunction(
const char *name,
void (*f)(
void),
const char *sig);
2000static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2029static std::string __pyx_f_8pymodule_str_py_to_cpp(PyObject *);
2030static PyObject *__pyx_f_8pymodule_std_string_to_py(std::string);
2037static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string(std::string
const &);
2038static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(std::string
const &);
2039static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string(std::string
const &);
2040static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(std::string
const &);
2041static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string(std::string
const &);
2044#define __Pyx_MODULE_NAME "pymodule"
2045extern int __pyx_module_is_main_pymodule;
2046int __pyx_module_is_main_pymodule = 0;
2050static PyObject *__pyx_builtin_ImportError;
2052static const char __pyx_k_[] =
".";
2053static const char __pyx_k__3[] =
"*";
2054static const char __pyx_k__5[] =
"?";
2055static const char __pyx_k_py[] =
"<py>";
2056static const char __pyx_k_ts[] =
"ts";
2057static const char __pyx_k_lib[] =
"lib";
2058static const char __pyx_k_Inst[] =
"Inst";
2059static const char __pyx_k_file[] =
"__file__";
2060static const char __pyx_k_main[] =
"__main__";
2061static const char __pyx_k_name[] =
"__name__";
2062static const char __pyx_k_spec[] =
"__spec__";
2063static const char __pyx_k_test[] =
"__test__";
2064static const char __pyx_k_Region[] =
"Region";
2065static const char __pyx_k_cyclib[] =
"cyclib";
2066static const char __pyx_k_cyclus[] =
"cyclus";
2067static const char __pyx_k_decode[] =
"decode";
2068static const char __pyx_k_encode[] =
"encode";
2069static const char __pyx_k_import[] =
"__import__";
2070static const char __pyx_k_Facility[] =
"Facility";
2071static const char __pyx_k_del_agent[] =
"_del_agent";
2072static const char __pyx_k_importlib[] =
"importlib";
2073static const char __pyx_k_cyclus_lib[] =
"cyclus.lib";
2074static const char __pyx_k_typesystem[] =
"typesystem";
2075static const char __pyx_k_ImportError[] =
"ImportError";
2076static const char __pyx_k_initializing[] =
"_initializing";
2077static const char __pyx_k_import_module[] =
"import_module";
2078static const char __pyx_k_make_py_agent[] =
"make_py_agent";
2079static const char __pyx_k_call_listeners[] =
"call_listeners";
2080static const char __pyx_k_init_from_agent[] =
"init_from_agent";
2081static const char __pyx_k_clear_agent_refs[] =
"_clear_agent_refs";
2082static const char __pyx_k_capsule_any_to_py[] =
"capsule_any_to_py";
2083static const char __pyx_k_cyclus_typesystem[] =
"cyclus.typesystem";
2084static const char __pyx_k_cline_in_traceback[] =
"cline_in_traceback";
2085static const char __pyx_k_capsule_agent_to_py[] =
"capsule_agent_to_py";
2086static const char __pyx_k_Cyclus_Python_module_loading_too[] =
"Cyclus Python module loading tools.";
2093 PyObject *__pyx_cython_runtime;
2094 PyObject *__pyx_empty_tuple;
2095 PyObject *__pyx_empty_bytes;
2096 PyObject *__pyx_empty_unicode;
2097 #ifdef __Pyx_CyFunction_USED
2098 PyTypeObject *__pyx_CyFunctionType;
2100 #ifdef __Pyx_FusedFunction_USED
2101 PyTypeObject *__pyx_FusedFunctionType;
2103 #ifdef __Pyx_Generator_USED
2104 PyTypeObject *__pyx_GeneratorType;
2106 #ifdef __Pyx_IterableCoroutine_USED
2107 PyTypeObject *__pyx_IterableCoroutineType;
2109 #ifdef __Pyx_Coroutine_USED
2110 PyTypeObject *__pyx_CoroutineAwaitType;
2112 #ifdef __Pyx_Coroutine_USED
2113 PyTypeObject *__pyx_CoroutineType;
2115 #if CYTHON_USE_MODULE_STATE
2117 #if CYTHON_USE_MODULE_STATE
2119 #if CYTHON_USE_MODULE_STATE
2121 #if CYTHON_USE_MODULE_STATE
2123 #if CYTHON_USE_MODULE_STATE
2125 #if CYTHON_USE_MODULE_STATE
2127 #if CYTHON_USE_MODULE_STATE
2129 #if CYTHON_USE_MODULE_STATE
2131 #if CYTHON_USE_MODULE_STATE
2133 PyTypeObject *__pyx_ptype_7cpython_4type_type;
2134 #if CYTHON_USE_MODULE_STATE
2136 #if CYTHON_USE_MODULE_STATE
2138 #if CYTHON_USE_MODULE_STATE
2140 #if CYTHON_USE_MODULE_STATE
2142 PyObject *__pyx_kp_u_;
2143 PyObject *__pyx_n_u_Facility;
2144 PyObject *__pyx_n_s_ImportError;
2145 PyObject *__pyx_n_u_Inst;
2146 PyObject *__pyx_n_u_Region;
2147 PyObject *__pyx_n_s__3;
2148 PyObject *__pyx_n_s__5;
2149 PyObject *__pyx_n_s_call_listeners;
2150 PyObject *__pyx_n_s_capsule_agent_to_py;
2151 PyObject *__pyx_n_s_capsule_any_to_py;
2152 PyObject *__pyx_n_s_clear_agent_refs;
2153 PyObject *__pyx_n_s_cline_in_traceback;
2154 PyObject *__pyx_n_s_cyclib;
2155 PyObject *__pyx_n_s_cyclus;
2156 PyObject *__pyx_n_s_cyclus_lib;
2157 PyObject *__pyx_n_s_cyclus_typesystem;
2158 PyObject *__pyx_n_s_decode;
2159 PyObject *__pyx_n_s_del_agent;
2160 PyObject *__pyx_n_s_encode;
2161 PyObject *__pyx_n_s_file;
2162 PyObject *__pyx_n_s_import;
2163 PyObject *__pyx_n_s_import_module;
2164 PyObject *__pyx_n_s_importlib;
2165 PyObject *__pyx_n_s_init_from_agent;
2166 PyObject *__pyx_n_s_initializing;
2167 PyObject *__pyx_n_s_lib;
2168 PyObject *__pyx_n_s_main;
2169 PyObject *__pyx_n_s_make_py_agent;
2170 PyObject *__pyx_n_s_name;
2171 PyObject *__pyx_kp_u_py;
2172 PyObject *__pyx_n_s_spec;
2173 PyObject *__pyx_n_s_test;
2174 PyObject *__pyx_n_s_ts;
2175 PyObject *__pyx_n_s_typesystem;
2176 PyObject *__pyx_tuple__2;
2177 PyObject *__pyx_tuple__4;
2180#if CYTHON_USE_MODULE_STATE
2183 extern struct PyModuleDef __pyx_moduledef;
2186static struct PyModuleDef __pyx_moduledef;
2189#define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o))
2191#define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef)))
2193#define __pyx_m (PyState_FindModule(&__pyx_moduledef))
2195static __pyx_mstate __pyx_mstate_global_static =
2201static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static;
2204#if CYTHON_USE_MODULE_STATE
2205static int __pyx_m_clear(PyObject *m) {
2206 __pyx_mstate *clear_module_state = __pyx_mstate(m);
2207 if (!clear_module_state)
return 0;
2208 Py_CLEAR(clear_module_state->__pyx_d);
2209 Py_CLEAR(clear_module_state->__pyx_b);
2210 Py_CLEAR(clear_module_state->__pyx_cython_runtime);
2211 Py_CLEAR(clear_module_state->__pyx_empty_tuple);
2212 Py_CLEAR(clear_module_state->__pyx_empty_bytes);
2213 Py_CLEAR(clear_module_state->__pyx_empty_unicode);
2214 #ifdef __Pyx_CyFunction_USED
2215 Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
2217 #ifdef __Pyx_FusedFunction_USED
2218 Py_CLEAR(clear_module_state->__pyx_FusedFunctionType);
2220 Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type);
2221 Py_CLEAR(clear_module_state->__pyx_kp_u_);
2222 Py_CLEAR(clear_module_state->__pyx_n_u_Facility);
2223 Py_CLEAR(clear_module_state->__pyx_n_s_ImportError);
2224 Py_CLEAR(clear_module_state->__pyx_n_u_Inst);
2225 Py_CLEAR(clear_module_state->__pyx_n_u_Region);
2226 Py_CLEAR(clear_module_state->__pyx_n_s__3);
2227 Py_CLEAR(clear_module_state->__pyx_n_s__5);
2228 Py_CLEAR(clear_module_state->__pyx_n_s_call_listeners);
2229 Py_CLEAR(clear_module_state->__pyx_n_s_capsule_agent_to_py);
2230 Py_CLEAR(clear_module_state->__pyx_n_s_capsule_any_to_py);
2231 Py_CLEAR(clear_module_state->__pyx_n_s_clear_agent_refs);
2232 Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback);
2233 Py_CLEAR(clear_module_state->__pyx_n_s_cyclib);
2234 Py_CLEAR(clear_module_state->__pyx_n_s_cyclus);
2235 Py_CLEAR(clear_module_state->__pyx_n_s_cyclus_lib);
2236 Py_CLEAR(clear_module_state->__pyx_n_s_cyclus_typesystem);
2237 Py_CLEAR(clear_module_state->__pyx_n_s_decode);
2238 Py_CLEAR(clear_module_state->__pyx_n_s_del_agent);
2239 Py_CLEAR(clear_module_state->__pyx_n_s_encode);
2240 Py_CLEAR(clear_module_state->__pyx_n_s_file);
2241 Py_CLEAR(clear_module_state->__pyx_n_s_import);
2242 Py_CLEAR(clear_module_state->__pyx_n_s_import_module);
2243 Py_CLEAR(clear_module_state->__pyx_n_s_importlib);
2244 Py_CLEAR(clear_module_state->__pyx_n_s_init_from_agent);
2245 Py_CLEAR(clear_module_state->__pyx_n_s_initializing);
2246 Py_CLEAR(clear_module_state->__pyx_n_s_lib);
2247 Py_CLEAR(clear_module_state->__pyx_n_s_main);
2248 Py_CLEAR(clear_module_state->__pyx_n_s_make_py_agent);
2249 Py_CLEAR(clear_module_state->__pyx_n_s_name);
2250 Py_CLEAR(clear_module_state->__pyx_kp_u_py);
2251 Py_CLEAR(clear_module_state->__pyx_n_s_spec);
2252 Py_CLEAR(clear_module_state->__pyx_n_s_test);
2253 Py_CLEAR(clear_module_state->__pyx_n_s_ts);
2254 Py_CLEAR(clear_module_state->__pyx_n_s_typesystem);
2255 Py_CLEAR(clear_module_state->__pyx_tuple__2);
2256 Py_CLEAR(clear_module_state->__pyx_tuple__4);
2261#if CYTHON_USE_MODULE_STATE
2262static int __pyx_m_traverse(PyObject *m, visitproc visit,
void *arg) {
2263 __pyx_mstate *traverse_module_state = __pyx_mstate(m);
2264 if (!traverse_module_state)
return 0;
2265 Py_VISIT(traverse_module_state->__pyx_d);
2266 Py_VISIT(traverse_module_state->__pyx_b);
2267 Py_VISIT(traverse_module_state->__pyx_cython_runtime);
2268 Py_VISIT(traverse_module_state->__pyx_empty_tuple);
2269 Py_VISIT(traverse_module_state->__pyx_empty_bytes);
2270 Py_VISIT(traverse_module_state->__pyx_empty_unicode);
2271 #ifdef __Pyx_CyFunction_USED
2272 Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
2274 #ifdef __Pyx_FusedFunction_USED
2275 Py_VISIT(traverse_module_state->__pyx_FusedFunctionType);
2277 Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type);
2278 Py_VISIT(traverse_module_state->__pyx_kp_u_);
2279 Py_VISIT(traverse_module_state->__pyx_n_u_Facility);
2280 Py_VISIT(traverse_module_state->__pyx_n_s_ImportError);
2281 Py_VISIT(traverse_module_state->__pyx_n_u_Inst);
2282 Py_VISIT(traverse_module_state->__pyx_n_u_Region);
2283 Py_VISIT(traverse_module_state->__pyx_n_s__3);
2284 Py_VISIT(traverse_module_state->__pyx_n_s__5);
2285 Py_VISIT(traverse_module_state->__pyx_n_s_call_listeners);
2286 Py_VISIT(traverse_module_state->__pyx_n_s_capsule_agent_to_py);
2287 Py_VISIT(traverse_module_state->__pyx_n_s_capsule_any_to_py);
2288 Py_VISIT(traverse_module_state->__pyx_n_s_clear_agent_refs);
2289 Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback);
2290 Py_VISIT(traverse_module_state->__pyx_n_s_cyclib);
2291 Py_VISIT(traverse_module_state->__pyx_n_s_cyclus);
2292 Py_VISIT(traverse_module_state->__pyx_n_s_cyclus_lib);
2293 Py_VISIT(traverse_module_state->__pyx_n_s_cyclus_typesystem);
2294 Py_VISIT(traverse_module_state->__pyx_n_s_decode);
2295 Py_VISIT(traverse_module_state->__pyx_n_s_del_agent);
2296 Py_VISIT(traverse_module_state->__pyx_n_s_encode);
2297 Py_VISIT(traverse_module_state->__pyx_n_s_file);
2298 Py_VISIT(traverse_module_state->__pyx_n_s_import);
2299 Py_VISIT(traverse_module_state->__pyx_n_s_import_module);
2300 Py_VISIT(traverse_module_state->__pyx_n_s_importlib);
2301 Py_VISIT(traverse_module_state->__pyx_n_s_init_from_agent);
2302 Py_VISIT(traverse_module_state->__pyx_n_s_initializing);
2303 Py_VISIT(traverse_module_state->__pyx_n_s_lib);
2304 Py_VISIT(traverse_module_state->__pyx_n_s_main);
2305 Py_VISIT(traverse_module_state->__pyx_n_s_make_py_agent);
2306 Py_VISIT(traverse_module_state->__pyx_n_s_name);
2307 Py_VISIT(traverse_module_state->__pyx_kp_u_py);
2308 Py_VISIT(traverse_module_state->__pyx_n_s_spec);
2309 Py_VISIT(traverse_module_state->__pyx_n_s_test);
2310 Py_VISIT(traverse_module_state->__pyx_n_s_ts);
2311 Py_VISIT(traverse_module_state->__pyx_n_s_typesystem);
2312 Py_VISIT(traverse_module_state->__pyx_tuple__2);
2313 Py_VISIT(traverse_module_state->__pyx_tuple__4);
2318#define __pyx_d __pyx_mstate_global->__pyx_d
2319#define __pyx_b __pyx_mstate_global->__pyx_b
2320#define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime
2321#define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple
2322#define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes
2323#define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode
2324#ifdef __Pyx_CyFunction_USED
2325#define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType
2327#ifdef __Pyx_FusedFunction_USED
2328#define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType
2330#ifdef __Pyx_Generator_USED
2331#define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType
2333#ifdef __Pyx_IterableCoroutine_USED
2334#define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType
2336#ifdef __Pyx_Coroutine_USED
2337#define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType
2339#ifdef __Pyx_Coroutine_USED
2340#define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType
2342#if CYTHON_USE_MODULE_STATE
2344#if CYTHON_USE_MODULE_STATE
2346#if CYTHON_USE_MODULE_STATE
2348#if CYTHON_USE_MODULE_STATE
2350#if CYTHON_USE_MODULE_STATE
2352#if CYTHON_USE_MODULE_STATE
2354#if CYTHON_USE_MODULE_STATE
2356#if CYTHON_USE_MODULE_STATE
2358#if CYTHON_USE_MODULE_STATE
2360#define __pyx_ptype_7cpython_4type_type __pyx_mstate_global->__pyx_ptype_7cpython_4type_type
2361#if CYTHON_USE_MODULE_STATE
2363#if CYTHON_USE_MODULE_STATE
2365#if CYTHON_USE_MODULE_STATE
2367#if CYTHON_USE_MODULE_STATE
2369#define __pyx_kp_u_ __pyx_mstate_global->__pyx_kp_u_
2370#define __pyx_n_u_Facility __pyx_mstate_global->__pyx_n_u_Facility
2371#define __pyx_n_s_ImportError __pyx_mstate_global->__pyx_n_s_ImportError
2372#define __pyx_n_u_Inst __pyx_mstate_global->__pyx_n_u_Inst
2373#define __pyx_n_u_Region __pyx_mstate_global->__pyx_n_u_Region
2374#define __pyx_n_s__3 __pyx_mstate_global->__pyx_n_s__3
2375#define __pyx_n_s__5 __pyx_mstate_global->__pyx_n_s__5
2376#define __pyx_n_s_call_listeners __pyx_mstate_global->__pyx_n_s_call_listeners
2377#define __pyx_n_s_capsule_agent_to_py __pyx_mstate_global->__pyx_n_s_capsule_agent_to_py
2378#define __pyx_n_s_capsule_any_to_py __pyx_mstate_global->__pyx_n_s_capsule_any_to_py
2379#define __pyx_n_s_clear_agent_refs __pyx_mstate_global->__pyx_n_s_clear_agent_refs
2380#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback
2381#define __pyx_n_s_cyclib __pyx_mstate_global->__pyx_n_s_cyclib
2382#define __pyx_n_s_cyclus __pyx_mstate_global->__pyx_n_s_cyclus
2383#define __pyx_n_s_cyclus_lib __pyx_mstate_global->__pyx_n_s_cyclus_lib
2384#define __pyx_n_s_cyclus_typesystem __pyx_mstate_global->__pyx_n_s_cyclus_typesystem
2385#define __pyx_n_s_decode __pyx_mstate_global->__pyx_n_s_decode
2386#define __pyx_n_s_del_agent __pyx_mstate_global->__pyx_n_s_del_agent
2387#define __pyx_n_s_encode __pyx_mstate_global->__pyx_n_s_encode
2388#define __pyx_n_s_file __pyx_mstate_global->__pyx_n_s_file
2389#define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import
2390#define __pyx_n_s_import_module __pyx_mstate_global->__pyx_n_s_import_module
2391#define __pyx_n_s_importlib __pyx_mstate_global->__pyx_n_s_importlib
2392#define __pyx_n_s_init_from_agent __pyx_mstate_global->__pyx_n_s_init_from_agent
2393#define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing
2394#define __pyx_n_s_lib __pyx_mstate_global->__pyx_n_s_lib
2395#define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main
2396#define __pyx_n_s_make_py_agent __pyx_mstate_global->__pyx_n_s_make_py_agent
2397#define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name
2398#define __pyx_kp_u_py __pyx_mstate_global->__pyx_kp_u_py
2399#define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec
2400#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test
2401#define __pyx_n_s_ts __pyx_mstate_global->__pyx_n_s_ts
2402#define __pyx_n_s_typesystem __pyx_mstate_global->__pyx_n_s_typesystem
2403#define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2
2404#define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4
2415static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string(std::string
const &__pyx_v_s) {
2416 PyObject *__pyx_r = NULL;
2417 __Pyx_RefNannyDeclarations
2418 PyObject *__pyx_t_1 = NULL;
2419 int __pyx_lineno = 0;
2420 const char *__pyx_filename = NULL;
2421 int __pyx_clineno = 0;
2422 __Pyx_RefNannySetupContext(
"__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string", 1);
2431 __Pyx_XDECREF(__pyx_r);
2432 __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)
2433 __Pyx_GOTREF(__pyx_t_1);
2434 __pyx_r = __pyx_t_1;
2448 __Pyx_XDECREF(__pyx_t_1);
2449 __Pyx_AddTraceback(
"string.to_py.__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
2452 __Pyx_XGIVEREF(__pyx_r);
2453 __Pyx_RefNannyFinishContext();
2465static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(std::string
const &__pyx_v_s) {
2466 PyObject *__pyx_r = NULL;
2467 __Pyx_RefNannyDeclarations
2468 PyObject *__pyx_t_1 = NULL;
2469 int __pyx_lineno = 0;
2470 const char *__pyx_filename = NULL;
2471 int __pyx_clineno = 0;
2472 __Pyx_RefNannySetupContext(
"__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string", 1);
2481 __Pyx_XDECREF(__pyx_r);
2482 __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)
2483 __Pyx_GOTREF(__pyx_t_1);
2484 __pyx_r = __pyx_t_1;
2498 __Pyx_XDECREF(__pyx_t_1);
2499 __Pyx_AddTraceback(
"string.to_py.__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
2502 __Pyx_XGIVEREF(__pyx_r);
2503 __Pyx_RefNannyFinishContext();
2515static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string(std::string
const &__pyx_v_s) {
2516 PyObject *__pyx_r = NULL;
2517 __Pyx_RefNannyDeclarations
2518 PyObject *__pyx_t_1 = NULL;
2519 int __pyx_lineno = 0;
2520 const char *__pyx_filename = NULL;
2521 int __pyx_clineno = 0;
2522 __Pyx_RefNannySetupContext(
"__pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string", 1);
2531 __Pyx_XDECREF(__pyx_r);
2532 __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)
2533 __Pyx_GOTREF(__pyx_t_1);
2534 __pyx_r = __pyx_t_1;
2548 __Pyx_XDECREF(__pyx_t_1);
2549 __Pyx_AddTraceback(
"string.to_py.__pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
2552 __Pyx_XGIVEREF(__pyx_r);
2553 __Pyx_RefNannyFinishContext();
2565static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(std::string
const &__pyx_v_s) {
2566 PyObject *__pyx_r = NULL;
2567 __Pyx_RefNannyDeclarations
2568 PyObject *__pyx_t_1 = NULL;
2569 int __pyx_lineno = 0;
2570 const char *__pyx_filename = NULL;
2571 int __pyx_clineno = 0;
2572 __Pyx_RefNannySetupContext(
"__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string", 1);
2581 __Pyx_XDECREF(__pyx_r);
2582 __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)
2583 __Pyx_GOTREF(__pyx_t_1);
2584 __pyx_r = __pyx_t_1;
2598 __Pyx_XDECREF(__pyx_t_1);
2599 __Pyx_AddTraceback(
"string.to_py.__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
2602 __Pyx_XGIVEREF(__pyx_r);
2603 __Pyx_RefNannyFinishContext();
2615static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string(std::string
const &__pyx_v_s) {
2616 PyObject *__pyx_r = NULL;
2617 __Pyx_RefNannyDeclarations
2618 PyObject *__pyx_t_1 = NULL;
2619 int __pyx_lineno = 0;
2620 const char *__pyx_filename = NULL;
2621 int __pyx_clineno = 0;
2622 __Pyx_RefNannySetupContext(
"__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string", 1);
2630 __Pyx_XDECREF(__pyx_r);
2631 __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)
2632 __Pyx_GOTREF(__pyx_t_1);
2633 __pyx_r = __pyx_t_1;
2647 __Pyx_XDECREF(__pyx_t_1);
2648 __Pyx_AddTraceback(
"string.to_py.__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
2651 __Pyx_XGIVEREF(__pyx_r);
2652 __Pyx_RefNannyFinishContext();
2664static PyObject *__pyx_f_8pymodule_std_string_to_py(std::string __pyx_v_x) {
2665 PyObject *__pyx_v_pyx = NULL;
2666 PyObject *__pyx_r = NULL;
2667 __Pyx_RefNannyDeclarations
2668 PyObject *__pyx_t_1 = NULL;
2669 PyObject *__pyx_t_2 = NULL;
2670 PyObject *__pyx_t_3 = NULL;
2671 unsigned int __pyx_t_4;
2672 int __pyx_lineno = 0;
2673 const char *__pyx_filename = NULL;
2674 int __pyx_clineno = 0;
2675 __Pyx_RefNannySetupContext(
"std_string_to_py", 1);
2684 __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, 14, __pyx_L1_error)
2685 __Pyx_GOTREF(__pyx_t_1);
2686 __pyx_v_pyx = __pyx_t_1;
2696 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_pyx, __pyx_n_s_decode);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error)
2697 __Pyx_GOTREF(__pyx_t_2);
2700 #if CYTHON_UNPACK_METHODS
2701 if (likely(PyMethod_Check(__pyx_t_2))) {
2702 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
2703 if (likely(__pyx_t_3)) {
2704 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
2705 __Pyx_INCREF(__pyx_t_3);
2706 __Pyx_INCREF(function);
2707 __Pyx_DECREF_SET(__pyx_t_2, function);
2713 PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
2714 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
2715 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
2716 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
2717 __Pyx_GOTREF(__pyx_t_1);
2718 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2720 __Pyx_DECREF_SET(__pyx_v_pyx, __pyx_t_1);
2730 __Pyx_XDECREF(__pyx_r);
2731 __Pyx_INCREF(__pyx_v_pyx);
2732 __pyx_r = __pyx_v_pyx;
2745 __Pyx_XDECREF(__pyx_t_1);
2746 __Pyx_XDECREF(__pyx_t_2);
2747 __Pyx_XDECREF(__pyx_t_3);
2748 __Pyx_AddTraceback(
"pymodule.std_string_to_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
2751 __Pyx_XDECREF(__pyx_v_pyx);
2752 __Pyx_XGIVEREF(__pyx_r);
2753 __Pyx_RefNannyFinishContext();
2765static std::string __pyx_f_8pymodule_str_py_to_cpp(PyObject *__pyx_v_x) {
2766 std::string __pyx_v_s;
2767 std::string __pyx_r;
2768 __Pyx_RefNannyDeclarations
2769 PyObject *__pyx_t_1 = NULL;
2770 PyObject *__pyx_t_2 = NULL;
2771 PyObject *__pyx_t_3 = NULL;
2772 unsigned int __pyx_t_4;
2773 char const *__pyx_t_5;
2774 std::string __pyx_t_6;
2775 int __pyx_lineno = 0;
2776 const char *__pyx_filename = NULL;
2777 int __pyx_clineno = 0;
2778 __Pyx_RefNannySetupContext(
"str_py_to_cpp", 0);
2779 __Pyx_INCREF(__pyx_v_x);
2788 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_encode);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error)
2789 __Pyx_GOTREF(__pyx_t_2);
2792 #if CYTHON_UNPACK_METHODS
2793 if (likely(PyMethod_Check(__pyx_t_2))) {
2794 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
2795 if (likely(__pyx_t_3)) {
2796 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
2797 __Pyx_INCREF(__pyx_t_3);
2798 __Pyx_INCREF(function);
2799 __Pyx_DECREF_SET(__pyx_t_2, function);
2805 PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
2806 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
2807 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
2808 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
2809 __Pyx_GOTREF(__pyx_t_1);
2810 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2812 __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_1);
2822 __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_x);
if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(0, 22, __pyx_L1_error)
2824 __pyx_t_6 = std::string(((
char const *)__pyx_t_5));
2826 __Pyx_CppExn2PyErr();
2827 __PYX_ERR(0, 22, __pyx_L1_error)
2829 __pyx_v_s = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_6);
2838 __pyx_r = __pyx_v_s;
2851 __Pyx_XDECREF(__pyx_t_1);
2852 __Pyx_XDECREF(__pyx_t_2);
2853 __Pyx_XDECREF(__pyx_t_3);
2854 __Pyx_AddTraceback(
"pymodule.str_py_to_cpp", __pyx_clineno, __pyx_lineno, __pyx_filename);
2855 __Pyx_pretend_to_initialize(&__pyx_r);
2857 __Pyx_XDECREF(__pyx_v_x);
2858 __Pyx_RefNannyFinishContext();
2871 PyObject *__pyx_v_lib = NULL;
2872 PyObject *__pyx_v_mod = NULL;
2873 std::string __pyx_v_rtn;
2874 std::string __pyx_r;
2875 __Pyx_RefNannyDeclarations
2876 PyObject *__pyx_t_1 = NULL;
2877 PyObject *__pyx_t_2 = NULL;
2878 PyObject *__pyx_t_3 = NULL;
2879 PyObject *__pyx_t_4 = NULL;
2880 PyObject *__pyx_t_5 = NULL;
2881 PyObject *__pyx_t_6 = NULL;
2882 unsigned int __pyx_t_7;
2884 std::string __pyx_t_9;
2885 int __pyx_lineno = 0;
2886 const char *__pyx_filename = NULL;
2887 int __pyx_clineno = 0;
2888 __Pyx_RefNannySetupContext(
"py_find_module", 1);
2897 __pyx_t_1 = __pyx_f_8pymodule_std_string_to_py(__pyx_v_cpp_lib);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
2898 __Pyx_GOTREF(__pyx_t_1);
2899 __pyx_v_lib = __pyx_t_1;
2910 __Pyx_PyThreadState_declare
2911 __Pyx_PyThreadState_assign
2912 __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
2913 __Pyx_XGOTREF(__pyx_t_2);
2914 __Pyx_XGOTREF(__pyx_t_3);
2915 __Pyx_XGOTREF(__pyx_t_4);
2925 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_import_module);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 30, __pyx_L3_error)
2926 __Pyx_GOTREF(__pyx_t_5);
2929 #if CYTHON_UNPACK_METHODS
2930 if (unlikely(PyMethod_Check(__pyx_t_5))) {
2931 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
2932 if (likely(__pyx_t_6)) {
2933 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
2934 __Pyx_INCREF(__pyx_t_6);
2935 __Pyx_INCREF(function);
2936 __Pyx_DECREF_SET(__pyx_t_5, function);
2942 PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_lib};
2943 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
2944 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
2945 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L3_error)
2946 __Pyx_GOTREF(__pyx_t_1);
2947 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2949 __pyx_v_mod = __pyx_t_1;
2960 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
2961 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
2962 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
2963 goto __pyx_L8_try_end;
2965 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
2966 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
2967 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
2976 __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
2978 __Pyx_AddTraceback(
"pymodule.py_find_module", __pyx_clineno, __pyx_lineno, __pyx_filename);
2979 if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(0, 31, __pyx_L5_except_error)
2980 __Pyx_XGOTREF(__pyx_t_1);
2981 __Pyx_XGOTREF(__pyx_t_5);
2982 __Pyx_XGOTREF(__pyx_t_6);
2992 __pyx_t_9 = std::string(((
char const *)
""));
2994 __Pyx_CppExn2PyErr();
2995 __PYX_ERR(0, 32, __pyx_L5_except_error)
2997 __pyx_r = __pyx_t_9;
2998 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2999 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3000 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3001 goto __pyx_L6_except_return;
3003 goto __pyx_L5_except_error;
3012 __pyx_L5_except_error:;
3013 __Pyx_XGIVEREF(__pyx_t_2);
3014 __Pyx_XGIVEREF(__pyx_t_3);
3015 __Pyx_XGIVEREF(__pyx_t_4);
3016 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
3017 goto __pyx_L1_error;
3018 __pyx_L6_except_return:;
3019 __Pyx_XGIVEREF(__pyx_t_2);
3020 __Pyx_XGIVEREF(__pyx_t_3);
3021 __Pyx_XGIVEREF(__pyx_t_4);
3022 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
3034 __pyx_t_8 = PyErr_CheckSignals();
if (unlikely(__pyx_t_8 == ((
int)-1))) __PYX_ERR(0, 33, __pyx_L1_error)
3043 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_mod, __pyx_n_s_file);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 34, __pyx_L1_error)
3044 __Pyx_GOTREF(__pyx_t_6);
3045 __pyx_t_5 = PyNumber_Add(__pyx_kp_u_py, __pyx_t_6);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 34, __pyx_L1_error)
3046 __Pyx_GOTREF(__pyx_t_5);
3047 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3048 __pyx_t_9 = __pyx_f_8pymodule_str_py_to_cpp(__pyx_t_5);
if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 34, __pyx_L1_error)
3049 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3050 __pyx_v_rtn = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_9);
3059 __pyx_r = __pyx_v_rtn;
3072 __Pyx_XDECREF(__pyx_t_1);
3073 __Pyx_XDECREF(__pyx_t_5);
3074 __Pyx_XDECREF(__pyx_t_6);
3075 __Pyx_AddTraceback(
"pymodule.py_find_module", __pyx_clineno, __pyx_lineno, __pyx_filename);
3076 __Pyx_pretend_to_initialize(&__pyx_r);
3078 __Pyx_XDECREF(__pyx_v_lib);
3079 __Pyx_XDECREF(__pyx_v_mod);
3080 __Pyx_RefNannyFinishContext();
3093 PyObject *__pyx_v_libname = NULL;
3094 PyObject *__pyx_v_agentname = NULL;
3095 PyObject *__pyx_v_ctx = NULL;
3096 PyObject *__pyx_v_a = NULL;
3097 PyObject *__pyx_v_kind = NULL;
3098 void *__pyx_v_avoid;
3101 __Pyx_RefNannyDeclarations
3102 PyObject *__pyx_t_1 = NULL;
3103 PyObject *__pyx_t_2 = NULL;
3104 PyObject *__pyx_t_3 = NULL;
3105 unsigned int __pyx_t_4;
3106 PyObject *__pyx_t_5 = NULL;
3107 PyObject *(*__pyx_t_6)(PyObject *);
3110 __pyx_t_8pymodule_agent_ptr __pyx_t_9;
3112 int __pyx_lineno = 0;
3113 const char *__pyx_filename = NULL;
3114 int __pyx_clineno = 0;
3115 __Pyx_RefNannySetupContext(
"make_py_agent", 1);
3124 __pyx_t_1 = __pyx_f_8pymodule_std_string_to_py(__pyx_v_cpp_lib);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error)
3125 __Pyx_GOTREF(__pyx_t_1);
3126 __pyx_v_libname = __pyx_t_1;
3136 __pyx_t_1 = __pyx_f_8pymodule_std_string_to_py(__pyx_v_cpp_agent);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
3137 __Pyx_GOTREF(__pyx_t_1);
3138 __pyx_v_agentname = __pyx_t_1;
3148 __pyx_t_1 = PyCapsule_New(__pyx_v_cpp_ctx, ((
char *)((
char *)
"ctx")), NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error)
3149 __Pyx_GOTREF(__pyx_t_1);
3150 __pyx_v_ctx = __pyx_t_1;
3160 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_cyclib);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error)
3161 __Pyx_GOTREF(__pyx_t_2);
3162 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_make_py_agent);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 45, __pyx_L1_error)
3163 __Pyx_GOTREF(__pyx_t_3);
3164 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3167 #if CYTHON_UNPACK_METHODS
3168 if (unlikely(PyMethod_Check(__pyx_t_3))) {
3169 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
3170 if (likely(__pyx_t_2)) {
3171 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3172 __Pyx_INCREF(__pyx_t_2);
3173 __Pyx_INCREF(function);
3174 __Pyx_DECREF_SET(__pyx_t_3, function);
3180 PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_libname, __pyx_v_agentname, __pyx_v_ctx};
3181 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 3+__pyx_t_4);
3182 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3183 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error)
3184 __Pyx_GOTREF(__pyx_t_1);
3185 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3187 if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
3188 PyObject* sequence = __pyx_t_1;
3189 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
3190 if (unlikely(size != 2)) {
3191 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
3192 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
3193 __PYX_ERR(0, 45, __pyx_L1_error)
3195 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3196 if (likely(PyTuple_CheckExact(sequence))) {
3197 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
3198 __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
3200 __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
3201 __pyx_t_2 = PyList_GET_ITEM(sequence, 1);
3203 __Pyx_INCREF(__pyx_t_3);
3204 __Pyx_INCREF(__pyx_t_2);
3206 __pyx_t_3 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 45, __pyx_L1_error)
3207 __Pyx_GOTREF(__pyx_t_3);
3208 __pyx_t_2 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error)
3209 __Pyx_GOTREF(__pyx_t_2);
3211 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3213 Py_ssize_t index = -1;
3214 __pyx_t_5 = PyObject_GetIter(__pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 45, __pyx_L1_error)
3215 __Pyx_GOTREF(__pyx_t_5);
3216 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3217 __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5);
3218 index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_5);
if (unlikely(!__pyx_t_3))
goto __pyx_L3_unpacking_failed;
3219 __Pyx_GOTREF(__pyx_t_3);
3220 index = 1; __pyx_t_2 = __pyx_t_6(__pyx_t_5);
if (unlikely(!__pyx_t_2))
goto __pyx_L3_unpacking_failed;
3221 __Pyx_GOTREF(__pyx_t_2);
3222 if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
3224 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3225 goto __pyx_L4_unpacking_done;
3226 __pyx_L3_unpacking_failed:;
3227 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3229 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
3230 __PYX_ERR(0, 45, __pyx_L1_error)
3231 __pyx_L4_unpacking_done:;
3233 __pyx_v_a = __pyx_t_3;
3235 __pyx_v_kind = __pyx_t_2;
3245 __pyx_t_7 = PyCapsule_GetPointer(__pyx_v_a, ((
char *)((
char *)
"agent")));
if (unlikely(__pyx_t_7 == ((
void *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 46, __pyx_L1_error)
3246 __pyx_v_avoid = __pyx_t_7;
3255 __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_kind, __pyx_n_u_Region, Py_EQ));
if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 48, __pyx_L1_error)
3266 __pyx_t_9 =
dynamic_cast<__pyx_t_8pymodule_agent_ptr
>(
reinterpret_cast<__pyx_t_8pymodule_region_ptr
>(__pyx_v_avoid));
3268 __Pyx_CppExn2PyErr();
3269 __PYX_ERR(0, 49, __pyx_L1_error)
3271 __pyx_v_rtn = __pyx_t_9;
3290 __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_kind, __pyx_n_u_Inst, Py_EQ));
if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 50, __pyx_L1_error)
3301 __pyx_t_9 =
dynamic_cast<__pyx_t_8pymodule_agent_ptr
>(
reinterpret_cast<__pyx_t_8pymodule_institution_ptr
>(__pyx_v_avoid));
3303 __Pyx_CppExn2PyErr();
3304 __PYX_ERR(0, 51, __pyx_L1_error)
3306 __pyx_v_rtn = __pyx_t_9;
3325 __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_kind, __pyx_n_u_Facility, Py_EQ));
if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 52, __pyx_L1_error)
3336 __pyx_t_9 =
dynamic_cast<__pyx_t_8pymodule_agent_ptr
>(
reinterpret_cast<__pyx_t_8pymodule_facility_ptr
>(__pyx_v_avoid));
3338 __Pyx_CppExn2PyErr();
3339 __PYX_ERR(0, 53, __pyx_L1_error)
3341 __pyx_v_rtn = __pyx_t_9;
3362 __pyx_t_9 =
dynamic_cast<__pyx_t_8pymodule_agent_ptr
>(
reinterpret_cast<__pyx_t_8pymodule_agent_ptr
>(__pyx_v_avoid));
3364 __Pyx_CppExn2PyErr();
3365 __PYX_ERR(0, 55, __pyx_L1_error)
3367 __pyx_v_rtn = __pyx_t_9;
3378 __pyx_t_10 = PyErr_CheckSignals();
if (unlikely(__pyx_t_10 == ((
int)-1))) __PYX_ERR(0, 56, __pyx_L1_error)
3387 __pyx_r = __pyx_v_rtn;
3400 __Pyx_XDECREF(__pyx_t_1);
3401 __Pyx_XDECREF(__pyx_t_2);
3402 __Pyx_XDECREF(__pyx_t_3);
3403 __Pyx_XDECREF(__pyx_t_5);
3404 __Pyx_AddTraceback(
"pymodule.make_py_agent", __pyx_clineno, __pyx_lineno, __pyx_filename);
3407 __Pyx_XDECREF(__pyx_v_libname);
3408 __Pyx_XDECREF(__pyx_v_agentname);
3409 __Pyx_XDECREF(__pyx_v_ctx);
3410 __Pyx_XDECREF(__pyx_v_a);
3411 __Pyx_XDECREF(__pyx_v_kind);
3412 __Pyx_RefNannyFinishContext();
3425 PyObject *__pyx_v_ctx = NULL;
3426 PyObject *__pyx_v_src = NULL;
3427 PyObject *__pyx_v_dst = NULL;
3428 PyObject *__pyx_v_py_src = NULL;
3429 PyObject *__pyx_v_py_dst = NULL;
3430 __Pyx_RefNannyDeclarations
3431 PyObject *__pyx_t_1 = NULL;
3432 PyObject *__pyx_t_2 = NULL;
3433 PyObject *__pyx_t_3 = NULL;
3434 unsigned int __pyx_t_4;
3436 int __pyx_lineno = 0;
3437 const char *__pyx_filename = NULL;
3438 int __pyx_clineno = 0;
3439 __Pyx_RefNannySetupContext(
"init_from_py_agent", 1);
3448 __pyx_t_1 = PyCapsule_New(__pyx_v_cpp_ctx, ((
char *)((
char *)
"ctx")), NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error)
3449 __Pyx_GOTREF(__pyx_t_1);
3450 __pyx_v_ctx = __pyx_t_1;
3460 __pyx_t_1 = PyCapsule_New(__pyx_v_cpp_src, ((
char *)((
char *)
"agent")), NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error)
3461 __Pyx_GOTREF(__pyx_t_1);
3462 __pyx_v_src = __pyx_t_1;
3472 __pyx_t_1 = PyCapsule_New(__pyx_v_cpp_dst, ((
char *)((
char *)
"agent")), NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error)
3473 __Pyx_GOTREF(__pyx_t_1);
3474 __pyx_v_dst = __pyx_t_1;
3484 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_cyclib);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error)
3485 __Pyx_GOTREF(__pyx_t_2);
3486 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_capsule_agent_to_py);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 69, __pyx_L1_error)
3487 __Pyx_GOTREF(__pyx_t_3);
3488 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3491 #if CYTHON_UNPACK_METHODS
3492 if (unlikely(PyMethod_Check(__pyx_t_3))) {
3493 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
3494 if (likely(__pyx_t_2)) {
3495 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3496 __Pyx_INCREF(__pyx_t_2);
3497 __Pyx_INCREF(function);
3498 __Pyx_DECREF_SET(__pyx_t_3, function);
3504 PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_src, __pyx_v_ctx};
3505 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
3506 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3507 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error)
3508 __Pyx_GOTREF(__pyx_t_1);
3509 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3511 __pyx_v_py_src = __pyx_t_1;
3521 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_cyclib);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L1_error)
3522 __Pyx_GOTREF(__pyx_t_3);
3523 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_capsule_agent_to_py);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error)
3524 __Pyx_GOTREF(__pyx_t_2);
3525 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3528 #if CYTHON_UNPACK_METHODS
3529 if (unlikely(PyMethod_Check(__pyx_t_2))) {
3530 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
3531 if (likely(__pyx_t_3)) {
3532 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3533 __Pyx_INCREF(__pyx_t_3);
3534 __Pyx_INCREF(function);
3535 __Pyx_DECREF_SET(__pyx_t_2, function);
3541 PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_dst, __pyx_v_ctx};
3542 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
3543 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3544 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error)
3545 __Pyx_GOTREF(__pyx_t_1);
3546 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3548 __pyx_v_py_dst = __pyx_t_1;
3558 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_py_dst, __pyx_n_s_init_from_agent);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error)
3559 __Pyx_GOTREF(__pyx_t_2);
3562 #if CYTHON_UNPACK_METHODS
3563 if (likely(PyMethod_Check(__pyx_t_2))) {
3564 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
3565 if (likely(__pyx_t_3)) {
3566 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3567 __Pyx_INCREF(__pyx_t_3);
3568 __Pyx_INCREF(function);
3569 __Pyx_DECREF_SET(__pyx_t_2, function);
3575 PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_py_src};
3576 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
3577 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3578 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error)
3579 __Pyx_GOTREF(__pyx_t_1);
3580 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3582 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3591 __pyx_t_5 = PyErr_CheckSignals();
if (unlikely(__pyx_t_5 == ((
int)-1))) __PYX_ERR(0, 72, __pyx_L1_error)
3604 __Pyx_XDECREF(__pyx_t_1);
3605 __Pyx_XDECREF(__pyx_t_2);
3606 __Pyx_XDECREF(__pyx_t_3);
3607 __Pyx_AddTraceback(
"pymodule.init_from_py_agent", __pyx_clineno, __pyx_lineno, __pyx_filename);
3609 __Pyx_XDECREF(__pyx_v_ctx);
3610 __Pyx_XDECREF(__pyx_v_src);
3611 __Pyx_XDECREF(__pyx_v_dst);
3612 __Pyx_XDECREF(__pyx_v_py_src);
3613 __Pyx_XDECREF(__pyx_v_py_dst);
3614 __Pyx_RefNannyFinishContext();
3626 __Pyx_RefNannyDeclarations
3627 PyObject *__pyx_t_1 = NULL;
3628 PyObject *__pyx_t_2 = NULL;
3629 PyObject *__pyx_t_3 = NULL;
3630 unsigned int __pyx_t_4;
3632 int __pyx_lineno = 0;
3633 const char *__pyx_filename = NULL;
3634 int __pyx_clineno = 0;
3635 __Pyx_RefNannySetupContext(
"clear_pyagent_refs", 1);
3644 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_cyclib);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 77, __pyx_L1_error)
3645 __Pyx_GOTREF(__pyx_t_2);
3646 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_clear_agent_refs);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 77, __pyx_L1_error)
3647 __Pyx_GOTREF(__pyx_t_3);
3648 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3651 #if CYTHON_UNPACK_METHODS
3652 if (unlikely(PyMethod_Check(__pyx_t_3))) {
3653 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
3654 if (likely(__pyx_t_2)) {
3655 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3656 __Pyx_INCREF(__pyx_t_2);
3657 __Pyx_INCREF(function);
3658 __Pyx_DECREF_SET(__pyx_t_3, function);
3664 PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
3665 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
3666 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3667 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error)
3668 __Pyx_GOTREF(__pyx_t_1);
3669 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3671 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3680 __pyx_t_5 = PyErr_CheckSignals();
if (unlikely(__pyx_t_5 == ((
int)-1))) __PYX_ERR(0, 78, __pyx_L1_error)
3693 __Pyx_XDECREF(__pyx_t_1);
3694 __Pyx_XDECREF(__pyx_t_2);
3695 __Pyx_XDECREF(__pyx_t_3);
3696 __Pyx_AddTraceback(
"pymodule.clear_pyagent_refs", __pyx_clineno, __pyx_lineno, __pyx_filename);
3698 __Pyx_RefNannyFinishContext();
3710 __Pyx_RefNannyDeclarations
3711 PyObject *__pyx_t_1 = NULL;
3712 PyObject *__pyx_t_2 = NULL;
3713 PyObject *__pyx_t_3 = NULL;
3714 PyObject *__pyx_t_4 = NULL;
3715 unsigned int __pyx_t_5;
3717 int __pyx_lineno = 0;
3718 const char *__pyx_filename = NULL;
3719 int __pyx_clineno = 0;
3720 __Pyx_RefNannySetupContext(
"py_del_agent", 1);
3729 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_cyclib);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error)
3730 __Pyx_GOTREF(__pyx_t_2);
3731 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_del_agent);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 83, __pyx_L1_error)
3732 __Pyx_GOTREF(__pyx_t_3);
3733 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3734 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_i);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error)
3735 __Pyx_GOTREF(__pyx_t_2);
3738 #if CYTHON_UNPACK_METHODS
3739 if (unlikely(PyMethod_Check(__pyx_t_3))) {
3740 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
3741 if (likely(__pyx_t_4)) {
3742 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3743 __Pyx_INCREF(__pyx_t_4);
3744 __Pyx_INCREF(function);
3745 __Pyx_DECREF_SET(__pyx_t_3, function);
3751 PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2};
3752 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
3753 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3754 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3755 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error)
3756 __Pyx_GOTREF(__pyx_t_1);
3757 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3759 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3768 __pyx_t_6 = PyErr_CheckSignals();
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(0, 84, __pyx_L1_error)
3781 __Pyx_XDECREF(__pyx_t_1);
3782 __Pyx_XDECREF(__pyx_t_2);
3783 __Pyx_XDECREF(__pyx_t_3);
3784 __Pyx_XDECREF(__pyx_t_4);
3785 __Pyx_AddTraceback(
"pymodule.py_del_agent", __pyx_clineno, __pyx_lineno, __pyx_filename);
3787 __Pyx_RefNannyFinishContext();
3799 PyObject *__pyx_v_ctx = NULL;
3800 PyObject *__pyx_v_agent = NULL;
3801 PyObject *__pyx_v_value = NULL;
3802 PyObject *__pyx_v_py_tsname = NULL;
3803 PyObject *__pyx_v_py_agent = NULL;
3804 PyObject *__pyx_v_py_value = NULL;
3805 __Pyx_RefNannyDeclarations
3806 PyObject *__pyx_t_1 = NULL;
3807 PyObject *__pyx_t_2 = NULL;
3808 PyObject *__pyx_t_3 = NULL;
3809 unsigned int __pyx_t_4;
3810 PyObject *__pyx_t_5 = NULL;
3812 int __pyx_lineno = 0;
3813 const char *__pyx_filename = NULL;
3814 int __pyx_clineno = 0;
3815 __Pyx_RefNannySetupContext(
"py_call_listeners", 1);
3824 __pyx_t_1 = PyCapsule_New(__pyx_v_cpp_ctx, ((
char *)((
char *)
"ctx")), NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error)
3825 __Pyx_GOTREF(__pyx_t_1);
3826 __pyx_v_ctx = __pyx_t_1;
3836 __pyx_t_1 = PyCapsule_New(__pyx_v_cpp_agent, ((
char *)((
char *)
"agent")), NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error)
3837 __Pyx_GOTREF(__pyx_t_1);
3838 __pyx_v_agent = __pyx_t_1;
3848 __pyx_t_1 = PyCapsule_New((&__pyx_v_cpp_value), ((
char *)((
char *)
"value")), NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error)
3849 __Pyx_GOTREF(__pyx_t_1);
3850 __pyx_v_value = __pyx_t_1;
3860 __pyx_t_1 = __pyx_f_8pymodule_std_string_to_py(__pyx_v_cpp_tsname);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error)
3861 __Pyx_GOTREF(__pyx_t_1);
3862 __pyx_v_py_tsname = __pyx_t_1;
3872 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_cyclib);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L1_error)
3873 __Pyx_GOTREF(__pyx_t_2);
3874 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_capsule_agent_to_py);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error)
3875 __Pyx_GOTREF(__pyx_t_3);
3876 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3879 #if CYTHON_UNPACK_METHODS
3880 if (unlikely(PyMethod_Check(__pyx_t_3))) {
3881 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
3882 if (likely(__pyx_t_2)) {
3883 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3884 __Pyx_INCREF(__pyx_t_2);
3885 __Pyx_INCREF(function);
3886 __Pyx_DECREF_SET(__pyx_t_3, function);
3892 PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_agent, __pyx_v_ctx};
3893 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
3894 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3895 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error)
3896 __Pyx_GOTREF(__pyx_t_1);
3897 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3899 __pyx_v_py_agent = __pyx_t_1;
3909 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ts);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error)
3910 __Pyx_GOTREF(__pyx_t_3);
3911 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_capsule_any_to_py);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error)
3912 __Pyx_GOTREF(__pyx_t_2);
3913 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3916 #if CYTHON_UNPACK_METHODS
3917 if (unlikely(PyMethod_Check(__pyx_t_2))) {
3918 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
3919 if (likely(__pyx_t_3)) {
3920 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3921 __Pyx_INCREF(__pyx_t_3);
3922 __Pyx_INCREF(function);
3923 __Pyx_DECREF_SET(__pyx_t_2, function);
3929 PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_value};
3930 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
3931 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3932 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error)
3933 __Pyx_GOTREF(__pyx_t_1);
3934 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3936 __pyx_v_py_value = __pyx_t_1;
3945 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_cyclib);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
3946 __Pyx_GOTREF(__pyx_t_2);
3947 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_call_listeners);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 97, __pyx_L1_error)
3948 __Pyx_GOTREF(__pyx_t_3);
3949 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3950 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_time);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
3951 __Pyx_GOTREF(__pyx_t_2);
3954 #if CYTHON_UNPACK_METHODS
3955 if (unlikely(PyMethod_Check(__pyx_t_3))) {
3956 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3957 if (likely(__pyx_t_5)) {
3958 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3959 __Pyx_INCREF(__pyx_t_5);
3960 __Pyx_INCREF(function);
3961 __Pyx_DECREF_SET(__pyx_t_3, function);
3967 PyObject *__pyx_callargs[5] = {__pyx_t_5, __pyx_v_py_tsname, __pyx_v_py_agent, __pyx_t_2, __pyx_v_py_value};
3968 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4);
3969 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3970 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3971 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
3972 __Pyx_GOTREF(__pyx_t_1);
3973 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3975 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3982 __pyx_t_6 = PyErr_CheckSignals();
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(0, 98, __pyx_L1_error)
3995 __Pyx_XDECREF(__pyx_t_1);
3996 __Pyx_XDECREF(__pyx_t_2);
3997 __Pyx_XDECREF(__pyx_t_3);
3998 __Pyx_XDECREF(__pyx_t_5);
3999 __Pyx_AddTraceback(
"pymodule.py_call_listeners", __pyx_clineno, __pyx_lineno, __pyx_filename);
4001 __Pyx_XDECREF(__pyx_v_ctx);
4002 __Pyx_XDECREF(__pyx_v_agent);
4003 __Pyx_XDECREF(__pyx_v_value);
4004 __Pyx_XDECREF(__pyx_v_py_tsname);
4005 __Pyx_XDECREF(__pyx_v_py_agent);
4006 __Pyx_XDECREF(__pyx_v_py_value);
4007 __Pyx_RefNannyFinishContext();
4010static PyMethodDef __pyx_methods[] = {
4013#ifndef CYTHON_SMALL_CODE
4014#if defined(__clang__)
4015 #define CYTHON_SMALL_CODE
4016#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
4017 #define CYTHON_SMALL_CODE __attribute__((cold))
4019 #define CYTHON_SMALL_CODE
4024static int __Pyx_CreateStringTabAndInitStrings(
void) {
4025 __Pyx_StringTabEntry __pyx_string_tab[] = {
4026 {&__pyx_kp_u_, __pyx_k_,
sizeof(__pyx_k_), 0, 1, 0, 0},
4027 {&__pyx_n_u_Facility, __pyx_k_Facility,
sizeof(__pyx_k_Facility), 0, 1, 0, 1},
4028 {&__pyx_n_s_ImportError, __pyx_k_ImportError,
sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
4029 {&__pyx_n_u_Inst, __pyx_k_Inst,
sizeof(__pyx_k_Inst), 0, 1, 0, 1},
4030 {&__pyx_n_u_Region, __pyx_k_Region,
sizeof(__pyx_k_Region), 0, 1, 0, 1},
4031 {&__pyx_n_s__3, __pyx_k__3,
sizeof(__pyx_k__3), 0, 0, 1, 1},
4032 {&__pyx_n_s__5, __pyx_k__5,
sizeof(__pyx_k__5), 0, 0, 1, 1},
4033 {&__pyx_n_s_call_listeners, __pyx_k_call_listeners,
sizeof(__pyx_k_call_listeners), 0, 0, 1, 1},
4034 {&__pyx_n_s_capsule_agent_to_py, __pyx_k_capsule_agent_to_py,
sizeof(__pyx_k_capsule_agent_to_py), 0, 0, 1, 1},
4035 {&__pyx_n_s_capsule_any_to_py, __pyx_k_capsule_any_to_py,
sizeof(__pyx_k_capsule_any_to_py), 0, 0, 1, 1},
4036 {&__pyx_n_s_clear_agent_refs, __pyx_k_clear_agent_refs,
sizeof(__pyx_k_clear_agent_refs), 0, 0, 1, 1},
4037 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback,
sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
4038 {&__pyx_n_s_cyclib, __pyx_k_cyclib,
sizeof(__pyx_k_cyclib), 0, 0, 1, 1},
4039 {&__pyx_n_s_cyclus, __pyx_k_cyclus,
sizeof(__pyx_k_cyclus), 0, 0, 1, 1},
4040 {&__pyx_n_s_cyclus_lib, __pyx_k_cyclus_lib,
sizeof(__pyx_k_cyclus_lib), 0, 0, 1, 1},
4041 {&__pyx_n_s_cyclus_typesystem, __pyx_k_cyclus_typesystem,
sizeof(__pyx_k_cyclus_typesystem), 0, 0, 1, 1},
4042 {&__pyx_n_s_decode, __pyx_k_decode,
sizeof(__pyx_k_decode), 0, 0, 1, 1},
4043 {&__pyx_n_s_del_agent, __pyx_k_del_agent,
sizeof(__pyx_k_del_agent), 0, 0, 1, 1},
4044 {&__pyx_n_s_encode, __pyx_k_encode,
sizeof(__pyx_k_encode), 0, 0, 1, 1},
4045 {&__pyx_n_s_file, __pyx_k_file,
sizeof(__pyx_k_file), 0, 0, 1, 1},
4046 {&__pyx_n_s_import, __pyx_k_import,
sizeof(__pyx_k_import), 0, 0, 1, 1},
4047 {&__pyx_n_s_import_module, __pyx_k_import_module,
sizeof(__pyx_k_import_module), 0, 0, 1, 1},
4048 {&__pyx_n_s_importlib, __pyx_k_importlib,
sizeof(__pyx_k_importlib), 0, 0, 1, 1},
4049 {&__pyx_n_s_init_from_agent, __pyx_k_init_from_agent,
sizeof(__pyx_k_init_from_agent), 0, 0, 1, 1},
4050 {&__pyx_n_s_initializing, __pyx_k_initializing,
sizeof(__pyx_k_initializing), 0, 0, 1, 1},
4051 {&__pyx_n_s_lib, __pyx_k_lib,
sizeof(__pyx_k_lib), 0, 0, 1, 1},
4052 {&__pyx_n_s_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 0, 1, 1},
4053 {&__pyx_n_s_make_py_agent, __pyx_k_make_py_agent,
sizeof(__pyx_k_make_py_agent), 0, 0, 1, 1},
4054 {&__pyx_n_s_name, __pyx_k_name,
sizeof(__pyx_k_name), 0, 0, 1, 1},
4055 {&__pyx_kp_u_py, __pyx_k_py,
sizeof(__pyx_k_py), 0, 1, 0, 0},
4056 {&__pyx_n_s_spec, __pyx_k_spec,
sizeof(__pyx_k_spec), 0, 0, 1, 1},
4057 {&__pyx_n_s_test, __pyx_k_test,
sizeof(__pyx_k_test), 0, 0, 1, 1},
4058 {&__pyx_n_s_ts, __pyx_k_ts,
sizeof(__pyx_k_ts), 0, 0, 1, 1},
4059 {&__pyx_n_s_typesystem, __pyx_k_typesystem,
sizeof(__pyx_k_typesystem), 0, 0, 1, 1},
4060 {0, 0, 0, 0, 0, 0, 0}
4062 return __Pyx_InitStrings(__pyx_string_tab);
4065static CYTHON_SMALL_CODE
int __Pyx_InitCachedBuiltins(
void) {
4066 __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError);
if (!__pyx_builtin_ImportError) __PYX_ERR(0, 31, __pyx_L1_error)
4073static CYTHON_SMALL_CODE
int __Pyx_InitCachedConstants(
void) {
4074 __Pyx_RefNannyDeclarations
4075 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
4084 __pyx_tuple__2 = PyTuple_Pack(2, __pyx_n_s_cyclus, __pyx_n_s_lib);
if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 10, __pyx_L1_error)
4085 __Pyx_GOTREF(__pyx_tuple__2);
4086 __Pyx_GIVEREF(__pyx_tuple__2);
4095 __pyx_tuple__4 = PyTuple_Pack(2, __pyx_n_s_cyclus, __pyx_n_s_typesystem);
if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 11, __pyx_L1_error)
4096 __Pyx_GOTREF(__pyx_tuple__4);
4097 __Pyx_GIVEREF(__pyx_tuple__4);
4098 __Pyx_RefNannyFinishContext();
4101 __Pyx_RefNannyFinishContext();
4106static CYTHON_SMALL_CODE
int __Pyx_InitConstants(
void) {
4107 if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error);
4114static CYTHON_SMALL_CODE
int __Pyx_InitGlobals(
void) {
4119static CYTHON_SMALL_CODE
int __Pyx_modinit_global_init_code(
void);
4120static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_export_code(
void);
4121static CYTHON_SMALL_CODE
int __Pyx_modinit_function_export_code(
void);
4122static CYTHON_SMALL_CODE
int __Pyx_modinit_type_init_code(
void);
4123static CYTHON_SMALL_CODE
int __Pyx_modinit_type_import_code(
void);
4124static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_import_code(
void);
4125static CYTHON_SMALL_CODE
int __Pyx_modinit_function_import_code(
void);
4127static int __Pyx_modinit_global_init_code(
void) {
4128 __Pyx_RefNannyDeclarations
4129 __Pyx_RefNannySetupContext(
"__Pyx_modinit_global_init_code", 0);
4131 __Pyx_RefNannyFinishContext();
4135static int __Pyx_modinit_variable_export_code(
void) {
4136 __Pyx_RefNannyDeclarations
4137 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_export_code", 0);
4139 __Pyx_RefNannyFinishContext();
4143static int __Pyx_modinit_function_export_code(
void) {
4144 __Pyx_RefNannyDeclarations
4145 int __pyx_lineno = 0;
4146 const char *__pyx_filename = NULL;
4147 int __pyx_clineno = 0;
4148 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_export_code", 0);
4150 if (__Pyx_ExportFunction(
"str_py_to_cpp", (
void (*)(
void))__pyx_f_8pymodule_str_py_to_cpp,
"std::string (PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4151 if (__Pyx_ExportFunction(
"std_string_to_py", (
void (*)(
void))__pyx_f_8pymodule_std_string_to_py,
"PyObject *(std::string)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4152 if (__Pyx_ExportFunction(
"py_find_module", (
void (*)(
void))
CyclusPyFindModule,
"std::string (std::string)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4153 if (__Pyx_ExportFunction(
"make_py_agent", (
void (*)(
void))
CyclusMakePyAgent,
"cyclus::Agent *(std::string, std::string, void *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4154 if (__Pyx_ExportFunction(
"init_from_py_agent", (
void (*)(
void))
CyclusInitFromPyAgent,
"void (cyclus::Agent *, cyclus::Agent *, void *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4155 if (__Pyx_ExportFunction(
"clear_pyagent_refs", (
void (*)(
void))
CyclusClearPyAgentRefs,
"void (void)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4156 if (__Pyx_ExportFunction(
"py_del_agent", (
void (*)(
void))
CyclusPyDelAgent,
"void (int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4157 if (__Pyx_ExportFunction(
"py_call_listeners", (
void (*)(
void))
CyclusPyCallListeners,
"void (std::string, cyclus::Agent *, void *, int, boost::spirit::hold_any)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4158 __Pyx_RefNannyFinishContext();
4161 __Pyx_RefNannyFinishContext();
4165static int __Pyx_modinit_type_init_code(
void) {
4166 __Pyx_RefNannyDeclarations
4167 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_init_code", 0);
4169 __Pyx_RefNannyFinishContext();
4173static int __Pyx_modinit_type_import_code(
void) {
4174 __Pyx_RefNannyDeclarations
4175 PyObject *__pyx_t_1 = NULL;
4176 int __pyx_lineno = 0;
4177 const char *__pyx_filename = NULL;
4178 int __pyx_clineno = 0;
4179 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_import_code", 0);
4181 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error)
4182 __Pyx_GOTREF(__pyx_t_1);
4183 __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_11(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME,
"type",
4184 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
4185 sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyTypeObject),
4186 #elif CYTHON_COMPILING_IN_LIMITED_API
4187 sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyTypeObject),
4189 sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyHeapTypeObject),
4191 __Pyx_ImportType_CheckSize_Warn_3_0_11);
if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error)
4192 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4193 __Pyx_RefNannyFinishContext();
4196 __Pyx_XDECREF(__pyx_t_1);
4197 __Pyx_RefNannyFinishContext();
4201static int __Pyx_modinit_variable_import_code(
void) {
4202 __Pyx_RefNannyDeclarations
4203 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_import_code", 0);
4205 __Pyx_RefNannyFinishContext();
4209static int __Pyx_modinit_function_import_code(
void) {
4210 __Pyx_RefNannyDeclarations
4211 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_import_code", 0);
4213 __Pyx_RefNannyFinishContext();
4218#if PY_MAJOR_VERSION >= 3
4219#if CYTHON_PEP489_MULTI_PHASE_INIT
4220static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
4221static int __pyx_pymod_exec_pymodule(PyObject* module);
4222static PyModuleDef_Slot __pyx_moduledef_slots[] = {
4223 {Py_mod_create, (
void*)__pyx_pymod_create},
4224 {Py_mod_exec, (
void*)__pyx_pymod_exec_pymodule},
4231 struct PyModuleDef __pyx_moduledef =
4233 static struct PyModuleDef __pyx_moduledef =
4236 PyModuleDef_HEAD_INIT,
4238 __pyx_k_Cyclus_Python_module_loading_too,
4239 #if CYTHON_PEP489_MULTI_PHASE_INIT
4241 #elif CYTHON_USE_MODULE_STATE
4242 sizeof(__pyx_mstate),
4247 #
if CYTHON_PEP489_MULTI_PHASE_INIT
4248 __pyx_moduledef_slots,
4252 #
if CYTHON_USE_MODULE_STATE
4267#ifndef CYTHON_NO_PYINIT_EXPORT
4268#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
4269#elif PY_MAJOR_VERSION < 3
4271#define __Pyx_PyMODINIT_FUNC extern "C" void
4273#define __Pyx_PyMODINIT_FUNC void
4277#define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
4279#define __Pyx_PyMODINIT_FUNC PyObject *
4284#if PY_MAJOR_VERSION < 3
4285__Pyx_PyMODINIT_FUNC
initpymodule(
void) CYTHON_SMALL_CODE;
4288__Pyx_PyMODINIT_FUNC PyInit_pymodule(
void) CYTHON_SMALL_CODE;
4289__Pyx_PyMODINIT_FUNC PyInit_pymodule(
void)
4290#if CYTHON_PEP489_MULTI_PHASE_INIT
4292 return PyModuleDef_Init(&__pyx_moduledef);
4294static CYTHON_SMALL_CODE
int __Pyx_check_single_interpreter(
void) {
4295 #if PY_VERSION_HEX >= 0x030700A1
4296 static PY_INT64_T main_interpreter_id = -1;
4297 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
4298 if (main_interpreter_id == -1) {
4299 main_interpreter_id = current_id;
4300 return (unlikely(current_id == -1)) ? -1 : 0;
4301 }
else if (unlikely(main_interpreter_id != current_id))
4303 static PyInterpreterState *main_interpreter = NULL;
4304 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
4305 if (!main_interpreter) {
4306 main_interpreter = current_interpreter;
4307 }
else if (unlikely(main_interpreter != current_interpreter))
4312 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
4317#if CYTHON_COMPILING_IN_LIMITED_API
4318static CYTHON_SMALL_CODE
int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module,
const char* from_name,
const char* to_name,
int allow_none)
4320static CYTHON_SMALL_CODE
int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict,
const char* from_name,
const char* to_name,
int allow_none)
4323 PyObject *value = PyObject_GetAttrString(spec, from_name);
4325 if (likely(value)) {
4326 if (allow_none || value != Py_None) {
4327#if CYTHON_COMPILING_IN_LIMITED_API
4328 result = PyModule_AddObject(module, to_name, value);
4330 result = PyDict_SetItemString(moddict, to_name, value);
4334 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
4341static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) {
4342 PyObject *
module = NULL, *moddict, *modname;
4343 CYTHON_UNUSED_VAR(def);
4344 if (__Pyx_check_single_interpreter())
4347 return __Pyx_NewRef(__pyx_m);
4348 modname = PyObject_GetAttrString(spec,
"name");
4349 if (unlikely(!modname))
goto bad;
4350 module = PyModule_NewObject(modname);
4352 if (unlikely(!module))
goto bad;
4353#if CYTHON_COMPILING_IN_LIMITED_API
4356 moddict = PyModule_GetDict(module);
4357 if (unlikely(!moddict))
goto bad;
4359 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__", 1) < 0))
goto bad;
4360 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__", 1) < 0))
goto bad;
4361 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__", 1) < 0))
goto bad;
4362 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__", 0) < 0))
goto bad;
4370static CYTHON_SMALL_CODE
int __pyx_pymod_exec_pymodule(PyObject *__pyx_pyinit_module)
4374 int stringtab_initialized = 0;
4375 #if CYTHON_USE_MODULE_STATE
4376 int pystate_addmodule_run = 0;
4378 PyObject *__pyx_t_1 = NULL;
4379 PyObject *__pyx_t_2 = NULL;
4380 PyObject *__pyx_t_3 = NULL;
4381 int __pyx_lineno = 0;
4382 const char *__pyx_filename = NULL;
4383 int __pyx_clineno = 0;
4384 __Pyx_RefNannyDeclarations
4385 #if CYTHON_PEP489_MULTI_PHASE_INIT
4387 if (__pyx_m == __pyx_pyinit_module)
return 0;
4388 PyErr_SetString(PyExc_RuntimeError,
"Module 'pymodule' has already been imported. Re-initialisation is not supported.");
4391 #elif PY_MAJOR_VERSION >= 3
4392 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
4395 #if CYTHON_PEP489_MULTI_PHASE_INIT
4396 __pyx_m = __pyx_pyinit_module;
4399 #if PY_MAJOR_VERSION < 3
4400 __pyx_m = Py_InitModule4(
"pymodule", __pyx_methods, __pyx_k_Cyclus_Python_module_loading_too, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
4401 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
4402 #elif CYTHON_USE_MODULE_STATE
4403 __pyx_t_1 = PyModule_Create(&__pyx_moduledef);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
4405 int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef);
4407 if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
4408 pystate_addmodule_run = 1;
4411 __pyx_m = PyModule_Create(&__pyx_moduledef);
4412 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
4415 CYTHON_UNUSED_VAR(__pyx_t_1);
4416 __pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
4418 __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
4419 __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((
const char *)
"cython_runtime");
if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
4420 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4422__Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
4423if (!__Pyx_RefNanny) {
4425 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
4426 if (!__Pyx_RefNanny)
4427 Py_FatalError(
"failed to import 'refnanny' module");
4430 __Pyx_RefNannySetupContext(
"__Pyx_PyMODINIT_FUNC PyInit_pymodule(void)", 0);
4431 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)
4432 #ifdef __Pxy_PyFrame_Initialize_Offsets
4433 __Pxy_PyFrame_Initialize_Offsets();
4435 __pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
4436 __pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
4437 __pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
4438 #ifdef __Pyx_CyFunction_USED
4439 if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4441 #ifdef __Pyx_FusedFunction_USED
4442 if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4444 #ifdef __Pyx_Coroutine_USED
4445 if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4447 #ifdef __Pyx_Generator_USED
4448 if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4450 #ifdef __Pyx_AsyncGen_USED
4451 if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4453 #ifdef __Pyx_StopAsyncIteration_USED
4454 if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4458 #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
4459 PyEval_InitThreads();
4462 if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4463 stringtab_initialized = 1;
4464 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4465 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
4466 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4468 if (__pyx_module_is_main_pymodule) {
4469 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4471 #if PY_MAJOR_VERSION >= 3
4473 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
4474 if (!PyDict_GetItemString(modules,
"pymodule")) {
4475 if (unlikely((PyDict_SetItemString(modules,
"pymodule", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
4480 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4482 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4484 (void)__Pyx_modinit_global_init_code();
4485 (void)__Pyx_modinit_variable_export_code();
4486 if (unlikely((__Pyx_modinit_function_export_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
4487 (void)__Pyx_modinit_type_init_code();
4488 if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
4489 (void)__Pyx_modinit_variable_import_code();
4490 (void)__Pyx_modinit_function_import_code();
4492 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
4493 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4503 __pyx_t_2 = PyList_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error)
4504 __Pyx_GOTREF(__pyx_t_2);
4505 __Pyx_INCREF(__pyx_n_s_import_module);
4506 __Pyx_GIVEREF(__pyx_n_s_import_module);
4507 if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_import_module)) __PYX_ERR(0, 8, __pyx_L1_error);
4508 __pyx_t_3 = __Pyx_Import(__pyx_n_s_importlib, __pyx_t_2, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 8, __pyx_L1_error)
4509 __Pyx_GOTREF(__pyx_t_3);
4510 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4511 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_import_module);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error)
4512 __Pyx_GOTREF(__pyx_t_2);
4513 if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_module, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error)
4514 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4515 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4524 __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_cyclus_lib, __pyx_tuple__2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10, __pyx_L1_error)
4525 __Pyx_GOTREF(__pyx_t_3);
4526 if (PyDict_SetItem(__pyx_d, __pyx_n_s_cyclib, __pyx_t_3) < 0) __PYX_ERR(0, 10, __pyx_L1_error)
4527 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4536 __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_cyclus_typesystem, __pyx_tuple__4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 11, __pyx_L1_error)
4537 __Pyx_GOTREF(__pyx_t_3);
4538 if (PyDict_SetItem(__pyx_d, __pyx_n_s_ts, __pyx_t_3) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
4539 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4546 __pyx_t_3 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error)
4547 __Pyx_GOTREF(__pyx_t_3);
4548 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4549 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4555 __Pyx_XDECREF(__pyx_t_2);
4556 __Pyx_XDECREF(__pyx_t_3);
4558 if (__pyx_d && stringtab_initialized) {
4559 __Pyx_AddTraceback(
"init pymodule", __pyx_clineno, __pyx_lineno, __pyx_filename);
4561 #if !CYTHON_USE_MODULE_STATE
4565 if (pystate_addmodule_run) {
4566 PyObject *tp, *value, *tb;
4567 PyErr_Fetch(&tp, &value, &tb);
4568 PyState_RemoveModule(&__pyx_moduledef);
4569 PyErr_Restore(tp, value, tb);
4572 }
else if (!PyErr_Occurred()) {
4573 PyErr_SetString(PyExc_ImportError,
"init pymodule");
4576 __Pyx_RefNannyFinishContext();
4577 #if CYTHON_PEP489_MULTI_PHASE_INIT
4578 return (__pyx_m != NULL) ? 0 : -1;
4579 #elif PY_MAJOR_VERSION >= 3
4590#pragma warning( push )
4595#pragma warning( disable : 4127 )
4605static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
4606 PyObject *m = NULL, *p = NULL;
4608 m = PyImport_ImportModule(modname);
4610 p = PyObject_GetAttrString(m,
"RefNannyAPI");
4612 r = PyLong_AsVoidPtr(p);
4616 return (__Pyx_RefNannyAPIStruct *)r;
4621#if CYTHON_FAST_THREAD_STATE
4622static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
4624 n = PyTuple_GET_SIZE(tuple);
4625#if PY_MAJOR_VERSION >= 3
4626 for (i=0; i<n; i++) {
4627 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
4630 for (i=0; i<n; i++) {
4631 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i)))
return 1;
4635static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
4638#if PY_VERSION_HEX >= 0x030C00A6
4639 PyObject *current_exception = tstate->current_exception;
4640 if (unlikely(!current_exception))
return 0;
4641 exc_type = (PyObject*) Py_TYPE(current_exception);
4642 if (exc_type == err)
return 1;
4644 exc_type = tstate->curexc_type;
4645 if (exc_type == err)
return 1;
4646 if (unlikely(!exc_type))
return 0;
4648 #if CYTHON_AVOID_BORROWED_REFS
4649 Py_INCREF(exc_type);
4651 if (unlikely(PyTuple_Check(err))) {
4652 result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
4654 result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
4656 #if CYTHON_AVOID_BORROWED_REFS
4657 Py_DECREF(exc_type);
4664#if CYTHON_FAST_THREAD_STATE
4665static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
4666#if PY_VERSION_HEX >= 0x030C00A6
4667 PyObject *tmp_value;
4668 assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
4670 #if CYTHON_COMPILING_IN_CPYTHON
4671 if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
4673 PyException_SetTraceback(value, tb);
4675 tmp_value = tstate->current_exception;
4676 tstate->current_exception = value;
4677 Py_XDECREF(tmp_value);
4681 PyObject *tmp_type, *tmp_value, *tmp_tb;
4682 tmp_type = tstate->curexc_type;
4683 tmp_value = tstate->curexc_value;
4684 tmp_tb = tstate->curexc_traceback;
4685 tstate->curexc_type = type;
4686 tstate->curexc_value = value;
4687 tstate->curexc_traceback = tb;
4688 Py_XDECREF(tmp_type);
4689 Py_XDECREF(tmp_value);
4693static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
4694#if PY_VERSION_HEX >= 0x030C00A6
4695 PyObject* exc_value;
4696 exc_value = tstate->current_exception;
4697 tstate->current_exception = 0;
4702 *type = (PyObject*) Py_TYPE(exc_value);
4704 #if CYTHON_COMPILING_IN_CPYTHON
4705 *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
4708 *tb = PyException_GetTraceback(exc_value);
4712 *type = tstate->curexc_type;
4713 *value = tstate->curexc_value;
4714 *tb = tstate->curexc_traceback;
4715 tstate->curexc_type = 0;
4716 tstate->curexc_value = 0;
4717 tstate->curexc_traceback = 0;
4723#if CYTHON_USE_TYPE_SLOTS
4724static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
4725 PyTypeObject* tp = Py_TYPE(obj);
4726 if (likely(tp->tp_getattro))
4727 return tp->tp_getattro(obj, attr_name);
4728#if PY_MAJOR_VERSION < 3
4729 if (likely(tp->tp_getattr))
4730 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
4732 return PyObject_GetAttr(obj, attr_name);
4737#if __PYX_LIMITED_VERSION_HEX < 0x030d00A1
4738static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(
void) {
4739 __Pyx_PyThreadState_declare
4740 __Pyx_PyThreadState_assign
4741 if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
4742 __Pyx_PyErr_Clear();
4745static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
4747#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
4748 (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
4751#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
4752 PyTypeObject* tp = Py_TYPE(obj);
4753 if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
4754 return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
4757 result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
4758 if (unlikely(!result)) {
4759 __Pyx_PyObject_GetAttrStr_ClearAttributeError();
4766static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
4767 PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name);
4768 if (unlikely(!result) && !PyErr_Occurred()) {
4769 PyErr_Format(PyExc_NameError,
4770#
if PY_MAJOR_VERSION >= 3
4771 "name '%U' is not defined", name);
4773 "name '%.200s' is not defined", PyString_AS_STRING(name));
4780#if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL
4781static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
4782 PyObject *globals) {
4784 PyThreadState *tstate = __Pyx_PyThreadState_Current;
4785 PyObject **fastlocals;
4788 assert(globals != NULL);
4793 assert(tstate != NULL);
4794 f = PyFrame_New(tstate, co, globals, NULL);
4798 fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
4799 for (i = 0; i < na; i++) {
4801 fastlocals[i] = *args++;
4803 result = PyEval_EvalFrameEx(f,0);
4804 ++tstate->recursion_depth;
4806 --tstate->recursion_depth;
4809static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
4810 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
4811 PyObject *globals = PyFunction_GET_GLOBALS(func);
4812 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
4814#if PY_MAJOR_VERSION >= 3
4817 PyObject *kwtuple, **k;
4822 assert(kwargs == NULL || PyDict_Check(kwargs));
4823 nk = kwargs ? PyDict_Size(kwargs) : 0;
4824 #if PY_MAJOR_VERSION < 3
4825 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object"))) {
4829 if (unlikely(Py_EnterRecursiveCall(
" while calling a Python object"))) {
4834#
if PY_MAJOR_VERSION >= 3
4835 co->co_kwonlyargcount == 0 &&
4837 likely(kwargs == NULL || nk == 0) &&
4838 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
4839 if (argdefs == NULL && co->co_argcount == nargs) {
4840 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
4843 else if (nargs == 0 && argdefs != NULL
4844 && co->co_argcount == Py_SIZE(argdefs)) {
4847 args = &PyTuple_GET_ITEM(argdefs, 0);
4848 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
4852 if (kwargs != NULL) {
4854 kwtuple = PyTuple_New(2 * nk);
4855 if (kwtuple == NULL) {
4859 k = &PyTuple_GET_ITEM(kwtuple, 0);
4861 while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
4872 closure = PyFunction_GET_CLOSURE(func);
4873#if PY_MAJOR_VERSION >= 3
4874 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
4876 if (argdefs != NULL) {
4877 d = &PyTuple_GET_ITEM(argdefs, 0);
4878 nd = Py_SIZE(argdefs);
4884#if PY_MAJOR_VERSION >= 3
4885 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
4888 d, (
int)nd, kwdefs, closure);
4890 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
4893 d, (
int)nd, closure);
4895 Py_XDECREF(kwtuple);
4897 Py_LeaveRecursiveCall();
4903#if CYTHON_COMPILING_IN_CPYTHON
4904static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
4906 ternaryfunc call = Py_TYPE(func)->tp_call;
4907 if (unlikely(!call))
4908 return PyObject_Call(func, arg, kw);
4909 #if PY_MAJOR_VERSION < 3
4910 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
4913 if (unlikely(Py_EnterRecursiveCall(
" while calling a Python object")))
4916 result = (*call)(func, arg, kw);
4917 Py_LeaveRecursiveCall();
4918 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
4921 "NULL result without error in PyObject_Call");
4928#if CYTHON_COMPILING_IN_CPYTHON
4929static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
4930 PyObject *self, *result;
4932 cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
4933 self = __Pyx_CyOrPyCFunction_GET_SELF(func);
4934 #if PY_MAJOR_VERSION < 3
4935 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
4938 if (unlikely(Py_EnterRecursiveCall(
" while calling a Python object")))
4941 result = cfunc(self, arg);
4942 Py_LeaveRecursiveCall();
4943 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
4946 "NULL result without error in PyObject_Call");
4953#if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API
4954static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args,
size_t nargs, PyObject *kwargs) {
4955 PyObject *argstuple;
4956 PyObject *result = 0;
4958 argstuple = PyTuple_New((Py_ssize_t)nargs);
4959 if (unlikely(!argstuple))
return NULL;
4960 for (i = 0; i < nargs; i++) {
4962 if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0)
goto bad;
4964 result = __Pyx_PyObject_Call(func, argstuple, kwargs);
4966 Py_DECREF(argstuple);
4970static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args,
size_t _nargs, PyObject *kwargs) {
4971 Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs);
4972#if CYTHON_COMPILING_IN_CPYTHON
4973 if (nargs == 0 && kwargs == NULL) {
4974 if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS))
4975 return __Pyx_PyObject_CallMethO(func, NULL);
4977 else if (nargs == 1 && kwargs == NULL) {
4978 if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O))
4979 return __Pyx_PyObject_CallMethO(func, args[0]);
4982 #if PY_VERSION_HEX < 0x030800B1
4983 #if CYTHON_FAST_PYCCALL
4984 if (PyCFunction_Check(func)) {
4986 return _PyCFunction_FastCallDict(func, args, nargs, kwargs);
4988 return _PyCFunction_FastCallKeywords(func, args, nargs, NULL);
4991 #if PY_VERSION_HEX >= 0x030700A1
4992 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) {
4993 return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL);
4997 #if CYTHON_FAST_PYCALL
4998 if (PyFunction_Check(func)) {
4999 return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs);
5003 if (kwargs == NULL) {
5004 #if CYTHON_VECTORCALL
5005 #if PY_VERSION_HEX < 0x03090000
5006 vectorcallfunc f = _PyVectorcall_Function(func);
5008 vectorcallfunc f = PyVectorcall_Function(func);
5011 return f(func, args, (
size_t)nargs, NULL);
5013 #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL
5014 if (__Pyx_CyFunction_CheckExact(func)) {
5015 __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func);
5016 if (f)
return f(func, args, (
size_t)nargs, NULL);
5021 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs);
5023 #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API
5024 return PyObject_VectorcallDict(func, args, (
size_t)nargs, kwargs);
5026 return __Pyx_PyObject_FastCall_fallback(func, args, (
size_t)nargs, kwargs);
5031#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
5032static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
5033 PyObject *dict = Py_TYPE(obj)->tp_dict;
5034 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
5036static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
5037 PyObject **dictptr = NULL;
5038 Py_ssize_t
offset = Py_TYPE(obj)->tp_dictoffset;
5040#if CYTHON_COMPILING_IN_CPYTHON
5041 dictptr = (likely(offset > 0)) ? (PyObject **) ((
char *)obj + offset) : _PyObject_GetDictPtr(obj);
5043 dictptr = _PyObject_GetDictPtr(obj);
5046 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
5048static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
5049 PyObject *dict = Py_TYPE(obj)->tp_dict;
5050 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
5052 return obj_dict_version == __Pyx_get_object_dict_version(obj);
5057#if CYTHON_USE_DICT_VERSIONS
5058static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
5060static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
5064#if !CYTHON_AVOID_BORROWED_REFS
5065#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000
5066 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
5067 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
5068 if (likely(result)) {
5069 return __Pyx_NewRef(result);
5070 }
else if (unlikely(PyErr_Occurred())) {
5073#elif CYTHON_COMPILING_IN_LIMITED_API
5074 if (unlikely(!__pyx_m)) {
5077 result = PyObject_GetAttr(__pyx_m, name);
5078 if (likely(result)) {
5082 result = PyDict_GetItem(__pyx_d, name);
5083 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
5084 if (likely(result)) {
5085 return __Pyx_NewRef(result);
5089 result = PyObject_GetItem(__pyx_d, name);
5090 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
5091 if (likely(result)) {
5092 return __Pyx_NewRef(result);
5096 return __Pyx_GetBuiltinName(name);
5100#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
5101static _PyErr_StackItem *
5102__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
5104 _PyErr_StackItem *exc_info = tstate->exc_info;
5105 while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) &&
5106 exc_info->previous_item != NULL)
5108 exc_info = exc_info->previous_item;
5115#if CYTHON_FAST_THREAD_STATE
5116static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
5117 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
5118 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
5119 PyObject *exc_value = exc_info->exc_value;
5120 if (exc_value == NULL || exc_value == Py_None) {
5127 *type = (PyObject*) Py_TYPE(exc_value);
5129 *tb = PyException_GetTraceback(exc_value);
5131 #elif CYTHON_USE_EXC_INFO_STACK
5132 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
5133 *type = exc_info->exc_type;
5134 *value = exc_info->exc_value;
5135 *tb = exc_info->exc_traceback;
5140 *type = tstate->exc_type;
5141 *value = tstate->exc_value;
5142 *tb = tstate->exc_traceback;
5148static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
5149 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
5150 _PyErr_StackItem *exc_info = tstate->exc_info;
5151 PyObject *tmp_value = exc_info->exc_value;
5152 exc_info->exc_value = value;
5153 Py_XDECREF(tmp_value);
5157 PyObject *tmp_type, *tmp_value, *tmp_tb;
5158 #if CYTHON_USE_EXC_INFO_STACK
5159 _PyErr_StackItem *exc_info = tstate->exc_info;
5160 tmp_type = exc_info->exc_type;
5161 tmp_value = exc_info->exc_value;
5162 tmp_tb = exc_info->exc_traceback;
5163 exc_info->exc_type = type;
5164 exc_info->exc_value = value;
5165 exc_info->exc_traceback = tb;
5167 tmp_type = tstate->exc_type;
5168 tmp_value = tstate->exc_value;
5169 tmp_tb = tstate->exc_traceback;
5170 tstate->exc_type = type;
5171 tstate->exc_value = value;
5172 tstate->exc_traceback = tb;
5174 Py_XDECREF(tmp_type);
5175 Py_XDECREF(tmp_value);
5182#if CYTHON_FAST_THREAD_STATE
5183static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
5185static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
5188 PyObject *local_type = NULL, *local_value, *local_tb = NULL;
5189#if CYTHON_FAST_THREAD_STATE
5190 PyObject *tmp_type, *tmp_value, *tmp_tb;
5191 #if PY_VERSION_HEX >= 0x030C00A6
5192 local_value = tstate->current_exception;
5193 tstate->current_exception = 0;
5194 if (likely(local_value)) {
5195 local_type = (PyObject*) Py_TYPE(local_value);
5196 Py_INCREF(local_type);
5197 local_tb = PyException_GetTraceback(local_value);
5200 local_type = tstate->curexc_type;
5201 local_value = tstate->curexc_value;
5202 local_tb = tstate->curexc_traceback;
5203 tstate->curexc_type = 0;
5204 tstate->curexc_value = 0;
5205 tstate->curexc_traceback = 0;
5208 PyErr_Fetch(&local_type, &local_value, &local_tb);
5210 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
5211#if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6
5212 if (unlikely(tstate->current_exception))
5213#elif CYTHON_FAST_THREAD_STATE
5214 if (unlikely(tstate->curexc_type))
5216 if (unlikely(PyErr_Occurred()))
5219 #if PY_MAJOR_VERSION >= 3
5221 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
5225 Py_XINCREF(local_tb);
5226 Py_XINCREF(local_type);
5227 Py_XINCREF(local_value);
5229 *value = local_value;
5231#if CYTHON_FAST_THREAD_STATE
5232 #if CYTHON_USE_EXC_INFO_STACK
5234 _PyErr_StackItem *exc_info = tstate->exc_info;
5235 #if PY_VERSION_HEX >= 0x030B00a4
5236 tmp_value = exc_info->exc_value;
5237 exc_info->exc_value = local_value;
5240 Py_XDECREF(local_type);
5241 Py_XDECREF(local_tb);
5243 tmp_type = exc_info->exc_type;
5244 tmp_value = exc_info->exc_value;
5245 tmp_tb = exc_info->exc_traceback;
5246 exc_info->exc_type = local_type;
5247 exc_info->exc_value = local_value;
5248 exc_info->exc_traceback = local_tb;
5252 tmp_type = tstate->exc_type;
5253 tmp_value = tstate->exc_value;
5254 tmp_tb = tstate->exc_traceback;
5255 tstate->exc_type = local_type;
5256 tstate->exc_value = local_value;
5257 tstate->exc_traceback = local_tb;
5259 Py_XDECREF(tmp_type);
5260 Py_XDECREF(tmp_value);
5263 PyErr_SetExcInfo(local_type, local_value, local_tb);
5270 Py_XDECREF(local_type);
5271 Py_XDECREF(local_value);
5272 Py_XDECREF(local_tb);
5277static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
5278 PyErr_Format(PyExc_ValueError,
5279 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T
"d)", expected);
5283static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
5284 PyErr_Format(PyExc_ValueError,
5285 "need more than %" CYTHON_FORMAT_SSIZE_T
"d value%.1s to unpack",
5286 index, (index == 1) ?
"" :
"s");
5290static CYTHON_INLINE
int __Pyx_IterFinish(
void) {
5292 __Pyx_PyThreadState_declare
5293 __Pyx_PyThreadState_assign
5294 exc_type = __Pyx_PyErr_CurrentExceptionType();
5295 if (unlikely(exc_type)) {
5296 if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))
5298 __Pyx_PyErr_Clear();
5305static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
5306 if (unlikely(retval)) {
5308 __Pyx_RaiseTooManyValuesError(expected);
5311 return __Pyx_IterFinish();
5315static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals) {
5316#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
5317 return PyObject_RichCompareBool(s1, s2, equals);
5320 return (equals == Py_EQ);
5321 }
else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
5322 const char *ps1, *ps2;
5323 Py_ssize_t length = PyBytes_GET_SIZE(s1);
5324 if (length != PyBytes_GET_SIZE(s2))
5325 return (equals == Py_NE);
5326 ps1 = PyBytes_AS_STRING(s1);
5327 ps2 = PyBytes_AS_STRING(s2);
5328 if (ps1[0] != ps2[0]) {
5329 return (equals == Py_NE);
5330 }
else if (length == 1) {
5331 return (equals == Py_EQ);
5334#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
5335 Py_hash_t hash1, hash2;
5336 hash1 = ((PyBytesObject*)s1)->ob_shash;
5337 hash2 = ((PyBytesObject*)s2)->ob_shash;
5338 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
5339 return (equals == Py_NE);
5342 result = memcmp(ps1, ps2, (
size_t)length);
5343 return (equals == Py_EQ) ? (result == 0) : (result != 0);
5345 }
else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
5346 return (equals == Py_NE);
5347 }
else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
5348 return (equals == Py_NE);
5351 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
5354 result = __Pyx_PyObject_IsTrue(py_result);
5355 Py_DECREF(py_result);
5362static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals) {
5363#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
5364 return PyObject_RichCompareBool(s1, s2, equals);
5366#if PY_MAJOR_VERSION < 3
5367 PyObject* owned_ref = NULL;
5369 int s1_is_unicode, s2_is_unicode;
5373 s1_is_unicode = PyUnicode_CheckExact(s1);
5374 s2_is_unicode = PyUnicode_CheckExact(s2);
5375#if PY_MAJOR_VERSION < 3
5376 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
5377 owned_ref = PyUnicode_FromObject(s2);
5378 if (unlikely(!owned_ref))
5382 }
else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
5383 owned_ref = PyUnicode_FromObject(s1);
5384 if (unlikely(!owned_ref))
5388 }
else if (((!s2_is_unicode) & (!s1_is_unicode))) {
5389 return __Pyx_PyBytes_Equals(s1, s2, equals);
5392 if (s1_is_unicode & s2_is_unicode) {
5395 void *data1, *data2;
5396 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
5398 length = __Pyx_PyUnicode_GET_LENGTH(s1);
5399 if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
5402#if CYTHON_USE_UNICODE_INTERNALS
5404 Py_hash_t hash1, hash2;
5405 #if CYTHON_PEP393_ENABLED
5406 hash1 = ((PyASCIIObject*)s1)->hash;
5407 hash2 = ((PyASCIIObject*)s2)->hash;
5409 hash1 = ((PyUnicodeObject*)s1)->hash;
5410 hash2 = ((PyUnicodeObject*)s2)->hash;
5412 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
5417 kind = __Pyx_PyUnicode_KIND(s1);
5418 if (kind != __Pyx_PyUnicode_KIND(s2)) {
5421 data1 = __Pyx_PyUnicode_DATA(s1);
5422 data2 = __Pyx_PyUnicode_DATA(s2);
5423 if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
5425 }
else if (length == 1) {
5428 int result = memcmp(data1, data2, (
size_t)(length * kind));
5429 #if PY_MAJOR_VERSION < 3
5430 Py_XDECREF(owned_ref);
5432 return (equals == Py_EQ) ? (result == 0) : (result != 0);
5434 }
else if ((s1 == Py_None) & s2_is_unicode) {
5436 }
else if ((s2 == Py_None) & s1_is_unicode) {
5440 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
5441 #if PY_MAJOR_VERSION < 3
5442 Py_XDECREF(owned_ref);
5446 result = __Pyx_PyObject_IsTrue(py_result);
5447 Py_DECREF(py_result);
5451 #if PY_MAJOR_VERSION < 3
5452 Py_XDECREF(owned_ref);
5454 return (equals == Py_EQ);
5456 #if PY_MAJOR_VERSION < 3
5457 Py_XDECREF(owned_ref);
5459 return (equals == Py_NE);
5464#ifndef __PYX_HAVE_RT_ImportType_3_0_11
5465#define __PYX_HAVE_RT_ImportType_3_0_11
5466static PyTypeObject *__Pyx_ImportType_3_0_11(PyObject *module,
const char *module_name,
const char *class_name,
5467 size_t size,
size_t alignment,
enum __Pyx_ImportType_CheckSize_3_0_11 check_size)
5469 PyObject *result = 0;
5471 Py_ssize_t basicsize;
5472 Py_ssize_t itemsize;
5473#if CYTHON_COMPILING_IN_LIMITED_API
5474 PyObject *py_basicsize;
5475 PyObject *py_itemsize;
5477 result = PyObject_GetAttrString(module, class_name);
5480 if (!PyType_Check(result)) {
5481 PyErr_Format(PyExc_TypeError,
5482 "%.200s.%.200s is not a type object",
5483 module_name, class_name);
5486#if !CYTHON_COMPILING_IN_LIMITED_API
5487 basicsize = ((PyTypeObject *)result)->tp_basicsize;
5488 itemsize = ((PyTypeObject *)result)->tp_itemsize;
5490 py_basicsize = PyObject_GetAttrString(result,
"__basicsize__");
5493 basicsize = PyLong_AsSsize_t(py_basicsize);
5494 Py_DECREF(py_basicsize);
5496 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
5498 py_itemsize = PyObject_GetAttrString(result,
"__itemsize__");
5501 itemsize = PyLong_AsSsize_t(py_itemsize);
5502 Py_DECREF(py_itemsize);
5504 if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
5508 if (size % alignment) {
5509 alignment = size % alignment;
5511 if (itemsize < (Py_ssize_t)alignment)
5512 itemsize = (Py_ssize_t)alignment;
5514 if ((
size_t)(basicsize + itemsize) < size) {
5515 PyErr_Format(PyExc_ValueError,
5516 "%.200s.%.200s size changed, may indicate binary incompatibility. "
5517 "Expected %zd from C header, got %zd from PyObject",
5518 module_name, class_name, size, basicsize+itemsize);
5521 if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_11 &&
5522 ((
size_t)basicsize > size || (
size_t)(basicsize + itemsize) < size)) {
5523 PyErr_Format(PyExc_ValueError,
5524 "%.200s.%.200s size changed, may indicate binary incompatibility. "
5525 "Expected %zd from C header, got %zd-%zd from PyObject",
5526 module_name, class_name, size, basicsize, basicsize+itemsize);
5529 else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_11 && (
size_t)basicsize > size) {
5530 PyOS_snprintf(warning,
sizeof(warning),
5531 "%s.%s size changed, may indicate binary incompatibility. "
5532 "Expected %zd from C header, got %zd from PyObject",
5533 module_name, class_name, size, basicsize);
5534 if (PyErr_WarnEx(NULL, warning, 0) < 0)
goto bad;
5536 return (PyTypeObject *)result;
5544static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level) {
5545 PyObject *
module = 0;
5546 PyObject *empty_dict = 0;
5547 PyObject *empty_list = 0;
5548 #if PY_MAJOR_VERSION < 3
5549 PyObject *py_import;
5550 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
5551 if (unlikely(!py_import))
5554 empty_list = PyList_New(0);
5555 if (unlikely(!empty_list))
5557 from_list = empty_list;
5560 empty_dict = PyDict_New();
5561 if (unlikely(!empty_dict))
5564 #if PY_MAJOR_VERSION >= 3
5566 if (strchr(__Pyx_MODULE_NAME,
'.') != NULL) {
5567 module = PyImport_ImportModuleLevelObject(
5568 name, __pyx_d, empty_dict, from_list, 1);
5569 if (unlikely(!module)) {
5570 if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError)))
5579 #if PY_MAJOR_VERSION < 3
5580 PyObject *py_level = PyInt_FromLong(level);
5581 if (unlikely(!py_level))
5583 module = PyObject_CallFunctionObjArgs(py_import,
5584 name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL);
5585 Py_DECREF(py_level);
5587 module = PyImport_ImportModuleLevelObject(
5588 name, __pyx_d, empty_dict, from_list, level);
5593 Py_XDECREF(empty_dict);
5594 Py_XDECREF(empty_list);
5595 #if PY_MAJOR_VERSION < 3
5596 Py_XDECREF(py_import);
5602static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
5603 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
5604 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
5605 const char* module_name_str = 0;
5606 PyObject* module_name = 0;
5607 PyObject* module_dot = 0;
5608 PyObject* full_name = 0;
5610 module_name_str = PyModule_GetName(module);
5611 if (unlikely(!module_name_str)) {
goto modbad; }
5612 module_name = PyUnicode_FromString(module_name_str);
5613 if (unlikely(!module_name)) {
goto modbad; }
5614 module_dot = PyUnicode_Concat(module_name, __pyx_kp_u_);
5615 if (unlikely(!module_dot)) {
goto modbad; }
5616 full_name = PyUnicode_Concat(module_dot, name);
5617 if (unlikely(!full_name)) {
goto modbad; }
5618 #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400)
5620 PyObject *modules = PyImport_GetModuleDict();
5621 if (unlikely(!modules))
5623 value = PyObject_GetItem(modules, full_name);
5626 value = PyImport_GetModule(full_name);
5629 Py_XDECREF(full_name);
5630 Py_XDECREF(module_dot);
5631 Py_XDECREF(module_name);
5633 if (unlikely(!value)) {
5634 PyErr_Format(PyExc_ImportError,
5635 #
if PY_MAJOR_VERSION < 3
5636 "cannot import name %.230s", PyString_AS_STRING(name));
5638 "cannot import name %S",
name);
5645#if PY_MAJOR_VERSION >= 3
5646static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) {
5647 PyObject *partial_name = NULL, *slice = NULL, *sep = NULL;
5648 if (unlikely(PyErr_Occurred())) {
5651 if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) {
5652 partial_name =
name;
5654 slice = PySequence_GetSlice(parts_tuple, 0, count);
5655 if (unlikely(!slice))
5657 sep = PyUnicode_FromStringAndSize(
".", 1);
5660 partial_name = PyUnicode_Join(sep, slice);
5663#
if PY_MAJOR_VERSION < 3
5665 "No module named '%s'", PyString_AS_STRING(partial_name));
5667#if PY_VERSION_HEX >= 0x030600B1
5668 PyExc_ModuleNotFoundError,
5672 "No module named '%U'", partial_name);
5677 Py_XDECREF(partial_name);
5681#if PY_MAJOR_VERSION >= 3
5682static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) {
5683 PyObject *imported_module;
5684#if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400)
5685 PyObject *modules = PyImport_GetModuleDict();
5686 if (unlikely(!modules))
5688 imported_module = __Pyx_PyDict_GetItemStr(modules, name);
5689 Py_XINCREF(imported_module);
5691 imported_module = PyImport_GetModule(name);
5693 return imported_module;
5696#if PY_MAJOR_VERSION >= 3
5697static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) {
5698 Py_ssize_t i, nparts;
5699 nparts = PyTuple_GET_SIZE(parts_tuple);
5700 for (i=1; i < nparts &&
module; i++) {
5701 PyObject *part, *submodule;
5702#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5703 part = PyTuple_GET_ITEM(parts_tuple, i);
5705 part = PySequence_ITEM(parts_tuple, i);
5707 submodule = __Pyx_PyObject_GetAttrStrNoError(module, part);
5708#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
5714 if (unlikely(!module)) {
5715 return __Pyx__ImportDottedModule_Error(name, parts_tuple, i);
5720static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) {
5721#if PY_MAJOR_VERSION < 3
5722 PyObject *module, *from_list, *star = __pyx_n_s__3;
5723 CYTHON_UNUSED_VAR(parts_tuple);
5724 from_list = PyList_New(1);
5725 if (unlikely(!from_list))
5728 PyList_SET_ITEM(from_list, 0, star);
5729 module = __Pyx_Import(name, from_list, 0);
5730 Py_DECREF(from_list);
5733 PyObject *imported_module;
5734 PyObject *
module = __Pyx_Import(name, NULL, 0);
5735 if (!parts_tuple || unlikely(!module))
5737 imported_module = __Pyx__ImportDottedModule_Lookup(name);
5738 if (likely(imported_module)) {
5740 return imported_module;
5743 return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple);
5746static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) {
5747#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1
5748 PyObject *
module = __Pyx__ImportDottedModule_Lookup(name);
5749 if (likely(module)) {
5750 PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec);
5752 PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing);
5753 if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) {
5759 if (likely(!spec)) {
5765 }
else if (PyErr_Occurred()) {
5769 return __Pyx__ImportDottedModule(name, parts_tuple);
5773#ifndef CYTHON_CLINE_IN_TRACEBACK
5774static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line) {
5775 PyObject *use_cline;
5776 PyObject *ptype, *pvalue, *ptraceback;
5777#if CYTHON_COMPILING_IN_CPYTHON
5778 PyObject **cython_runtime_dict;
5780 CYTHON_MAYBE_UNUSED_VAR(tstate);
5781 if (unlikely(!__pyx_cython_runtime)) {
5784 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
5785#if CYTHON_COMPILING_IN_CPYTHON
5786 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
5787 if (likely(cython_runtime_dict)) {
5788 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
5789 use_cline, *cython_runtime_dict,
5790 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
5794 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
5795 if (use_cline_obj) {
5796 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
5797 Py_DECREF(use_cline_obj);
5805 (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
5807 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
5810 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
5816#if !CYTHON_COMPILING_IN_LIMITED_API
5817static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
5818 int start = 0, mid = 0,
end = count - 1;
5819 if (end >= 0 && code_line > entries[end].code_line) {
5822 while (start < end) {
5823 mid = start + (
end - start) / 2;
5824 if (code_line < entries[mid].code_line) {
5826 }
else if (code_line > entries[mid].code_line) {
5832 if (code_line <= entries[mid].code_line) {
5838static PyCodeObject *__pyx_find_code_object(
int code_line) {
5839 PyCodeObject* code_object;
5841 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
5844 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
5845 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
5848 code_object = __pyx_code_cache.entries[pos].code_object;
5849 Py_INCREF(code_object);
5852static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
5854 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
5855 if (unlikely(!code_line)) {
5858 if (unlikely(!entries)) {
5859 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
5860 if (likely(entries)) {
5861 __pyx_code_cache.entries = entries;
5862 __pyx_code_cache.max_count = 64;
5863 __pyx_code_cache.count = 1;
5864 entries[0].code_line = code_line;
5865 entries[0].code_object = code_object;
5866 Py_INCREF(code_object);
5870 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
5871 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
5872 PyCodeObject* tmp = entries[pos].code_object;
5873 entries[pos].code_object = code_object;
5877 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
5878 int new_max = __pyx_code_cache.max_count + 64;
5879 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
5880 __pyx_code_cache.entries, ((
size_t)new_max) *
sizeof(__Pyx_CodeObjectCacheEntry));
5881 if (unlikely(!entries)) {
5884 __pyx_code_cache.entries = entries;
5885 __pyx_code_cache.max_count = new_max;
5887 for (i=__pyx_code_cache.count; i>pos; i--) {
5888 entries[i] = entries[i-1];
5890 entries[pos].code_line = code_line;
5891 entries[pos].code_object = code_object;
5892 __pyx_code_cache.count++;
5893 Py_INCREF(code_object);
5899#include "frameobject.h"
5900#include "traceback.h"
5901#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API
5902 #ifndef Py_BUILD_CORE
5903 #define Py_BUILD_CORE 1
5905 #include "internal/pycore_frame.h"
5907#if CYTHON_COMPILING_IN_LIMITED_API
5908static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
5909 PyObject *firstlineno, PyObject *name) {
5910 PyObject *replace = NULL;
5911 if (unlikely(PyDict_SetItemString(scratch_dict,
"co_firstlineno", firstlineno)))
return NULL;
5912 if (unlikely(PyDict_SetItemString(scratch_dict,
"co_name", name)))
return NULL;
5913 replace = PyObject_GetAttrString(code,
"replace");
5914 if (likely(replace)) {
5916 result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict);
5921 #if __PYX_LIMITED_VERSION_HEX < 0x030780000
5923 PyObject *compiled = NULL, *result = NULL;
5924 if (unlikely(PyDict_SetItemString(scratch_dict,
"code", code)))
return NULL;
5925 if (unlikely(PyDict_SetItemString(scratch_dict,
"type", (PyObject*)(&PyType_Type))))
return NULL;
5926 compiled = Py_CompileString(
5927 "out = type(code)(\n"
5928 " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n"
5929 " code.co_flags, code.co_code, code.co_consts, code.co_names,\n"
5930 " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n"
5931 " code.co_lnotab)\n",
"<dummy>", Py_file_input);
5932 if (!compiled)
return NULL;
5933 result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict);
5934 Py_DECREF(compiled);
5935 if (!result) PyErr_Print();
5937 result = PyDict_GetItemString(scratch_dict,
"out");
5938 if (result) Py_INCREF(result);
5945static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
5946 int py_line,
const char *filename) {
5947 PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
5948 PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
5949 PyObject *exc_type, *exc_value, *exc_traceback;
5952 (void) __pyx_cfilenm;
5953 (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
5955 PyErr_Fetch(&exc_type, &exc_value, &exc_traceback);
5956 code_object = Py_CompileString(
"_getframe()", filename, Py_eval_input);
5957 if (unlikely(!code_object))
goto bad;
5958 py_py_line = PyLong_FromLong(py_line);
5959 if (unlikely(!py_py_line))
goto bad;
5960 py_funcname = PyUnicode_FromString(funcname);
5961 if (unlikely(!py_funcname))
goto bad;
5962 dict = PyDict_New();
5963 if (unlikely(!dict))
goto bad;
5965 PyObject *old_code_object = code_object;
5966 code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
5967 Py_DECREF(old_code_object);
5969 if (unlikely(!code_object))
goto bad;
5970 getframe = PySys_GetObject(
"_getframe");
5971 if (unlikely(!getframe))
goto bad;
5972 if (unlikely(PyDict_SetItemString(dict,
"_getframe", getframe)))
goto bad;
5973 frame = PyEval_EvalCode(code_object, dict, dict);
5974 if (unlikely(!frame) || frame == Py_None)
goto bad;
5977 PyErr_Restore(exc_type, exc_value, exc_traceback);
5978 Py_XDECREF(code_object);
5979 Py_XDECREF(py_py_line);
5980 Py_XDECREF(py_funcname);
5982 Py_XDECREF(replace);
5985 (
struct _frame*)frame);
5990static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
5991 const char *funcname,
int c_line,
5992 int py_line,
const char *filename) {
5993 PyCodeObject *py_code = NULL;
5994 PyObject *py_funcname = NULL;
5995 #if PY_MAJOR_VERSION < 3
5996 PyObject *py_srcfile = NULL;
5997 py_srcfile = PyString_FromString(filename);
5998 if (!py_srcfile)
goto bad;
6001 #if PY_MAJOR_VERSION < 3
6002 py_funcname = PyString_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
6003 if (!py_funcname)
goto bad;
6005 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
6006 if (!py_funcname)
goto bad;
6007 funcname = PyUnicode_AsUTF8(py_funcname);
6008 if (!funcname)
goto bad;
6012 #if PY_MAJOR_VERSION < 3
6013 py_funcname = PyString_FromString(funcname);
6014 if (!py_funcname)
goto bad;
6017 #if PY_MAJOR_VERSION < 3
6018 py_code = __Pyx_PyCode_New(
6036 Py_DECREF(py_srcfile);
6038 py_code = PyCode_NewEmpty(filename, funcname, py_line);
6040 Py_XDECREF(py_funcname);
6043 Py_XDECREF(py_funcname);
6044 #if PY_MAJOR_VERSION < 3
6045 Py_XDECREF(py_srcfile);
6049static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
6050 int py_line,
const char *filename) {
6051 PyCodeObject *py_code = 0;
6052 PyFrameObject *py_frame = 0;
6053 PyThreadState *tstate = __Pyx_PyThreadState_Current;
6054 PyObject *ptype, *pvalue, *ptraceback;
6056 c_line = __Pyx_CLineForTraceback(tstate, c_line);
6058 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
6060 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
6061 py_code = __Pyx_CreateCodeObjectForTraceback(
6062 funcname, c_line, py_line, filename);
6068 Py_XDECREF(ptraceback);
6071 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
6072 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
6074 py_frame = PyFrame_New(
6080 if (!py_frame)
goto bad;
6081 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
6082 PyTraceBack_Here(py_frame);
6084 Py_XDECREF(py_code);
6085 Py_XDECREF(py_frame);
6090static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value) {
6091#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
6092#pragma GCC diagnostic push
6093#pragma GCC diagnostic ignored "-Wconversion"
6095 const int neg_one = (int) -1, const_zero = (
int) 0;
6096#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
6097#pragma GCC diagnostic pop
6099 const int is_unsigned = neg_one > const_zero;
6101 if (
sizeof(
int) <
sizeof(long)) {
6102 return PyInt_FromLong((
long) value);
6103 }
else if (
sizeof(
int) <=
sizeof(
unsigned long)) {
6104 return PyLong_FromUnsignedLong((
unsigned long) value);
6105#ifdef HAVE_LONG_LONG
6106 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
6107 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
6111 if (
sizeof(
int) <=
sizeof(
long)) {
6112 return PyInt_FromLong((
long) value);
6113#ifdef HAVE_LONG_LONG
6114 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
6115 return PyLong_FromLongLong((PY_LONG_LONG) value);
6120 unsigned char *bytes = (
unsigned char *)&value;
6121#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
6123 return PyLong_FromUnsignedNativeBytes(bytes,
sizeof(value), -1);
6125 return PyLong_FromNativeBytes(bytes,
sizeof(value), -1);
6127#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
6128 int one = 1;
int little = (int)*(
unsigned char *)&one;
6129 return _PyLong_FromByteArray(bytes,
sizeof(
int),
6130 little, !is_unsigned);
6132 int one = 1;
int little = (int)*(
unsigned char *)&one;
6133 PyObject *from_bytes, *result = NULL;
6134 PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
6135 from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type,
"from_bytes");
6136 if (!from_bytes)
return NULL;
6137 py_bytes = PyBytes_FromStringAndSize((
char*)bytes,
sizeof(
int));
6138 if (!py_bytes)
goto limited_bad;
6139 order_str = PyUnicode_FromString(little ?
"little" :
"big");
6140 if (!order_str)
goto limited_bad;
6141 arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
6142 if (!arg_tuple)
goto limited_bad;
6144 kwds = PyDict_New();
6145 if (!kwds)
goto limited_bad;
6146 if (PyDict_SetItemString(kwds,
"signed", __Pyx_NewRef(Py_True)))
goto limited_bad;
6148 result = PyObject_Call(from_bytes, arg_tuple, kwds);
6151 Py_XDECREF(arg_tuple);
6152 Py_XDECREF(order_str);
6153 Py_XDECREF(py_bytes);
6154 Py_XDECREF(from_bytes);
6161#if CYTHON_COMPILING_IN_LIMITED_API
6162static __Pyx_TypeName
6163__Pyx_PyType_GetName(PyTypeObject* tp)
6165 PyObject *
name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
6167 if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) {
6170 name = __Pyx_NewRef(__pyx_n_s__5);
6177static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value) {
6178#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
6179#pragma GCC diagnostic push
6180#pragma GCC diagnostic ignored "-Wconversion"
6182 const long neg_one = (long) -1, const_zero = (
long) 0;
6183#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
6184#pragma GCC diagnostic pop
6186 const int is_unsigned = neg_one > const_zero;
6188 if (
sizeof(
long) <
sizeof(long)) {
6189 return PyInt_FromLong((
long) value);
6190 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
6191 return PyLong_FromUnsignedLong((
unsigned long) value);
6192#ifdef HAVE_LONG_LONG
6193 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
6194 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
6198 if (
sizeof(
long) <=
sizeof(
long)) {
6199 return PyInt_FromLong((
long) value);
6200#ifdef HAVE_LONG_LONG
6201 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
6202 return PyLong_FromLongLong((PY_LONG_LONG) value);
6207 unsigned char *bytes = (
unsigned char *)&value;
6208#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
6210 return PyLong_FromUnsignedNativeBytes(bytes,
sizeof(value), -1);
6212 return PyLong_FromNativeBytes(bytes,
sizeof(value), -1);
6214#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
6215 int one = 1;
int little = (int)*(
unsigned char *)&one;
6216 return _PyLong_FromByteArray(bytes,
sizeof(
long),
6217 little, !is_unsigned);
6219 int one = 1;
int little = (int)*(
unsigned char *)&one;
6220 PyObject *from_bytes, *result = NULL;
6221 PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
6222 from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type,
"from_bytes");
6223 if (!from_bytes)
return NULL;
6224 py_bytes = PyBytes_FromStringAndSize((
char*)bytes,
sizeof(
long));
6225 if (!py_bytes)
goto limited_bad;
6226 order_str = PyUnicode_FromString(little ?
"little" :
"big");
6227 if (!order_str)
goto limited_bad;
6228 arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
6229 if (!arg_tuple)
goto limited_bad;
6231 kwds = PyDict_New();
6232 if (!kwds)
goto limited_bad;
6233 if (PyDict_SetItemString(kwds,
"signed", __Pyx_NewRef(Py_True)))
goto limited_bad;
6235 result = PyObject_Call(from_bytes, arg_tuple, kwds);
6238 Py_XDECREF(arg_tuple);
6239 Py_XDECREF(order_str);
6240 Py_XDECREF(py_bytes);
6241 Py_XDECREF(from_bytes);
6248#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
6249 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
6250#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
6251 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
6252#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
6254 func_type value = func_value;\
6255 if (sizeof(target_type) < sizeof(func_type)) {\
6256 if (unlikely(value != (func_type) (target_type) value)) {\
6257 func_type zero = 0;\
6258 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
6259 return (target_type) -1;\
6260 if (is_unsigned && unlikely(value < zero))\
6261 goto raise_neg_overflow;\
6263 goto raise_overflow;\
6266 return (target_type) value;\
6270static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *x) {
6271#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
6272#pragma GCC diagnostic push
6273#pragma GCC diagnostic ignored "-Wconversion"
6275 const long neg_one = (long) -1, const_zero = (
long) 0;
6276#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
6277#pragma GCC diagnostic pop
6279 const int is_unsigned = neg_one > const_zero;
6280#if PY_MAJOR_VERSION < 3
6281 if (likely(PyInt_Check(x))) {
6282 if ((
sizeof(
long) <
sizeof(
long))) {
6283 __PYX_VERIFY_RETURN_INT(
long,
long, PyInt_AS_LONG(x))
6285 long val = PyInt_AS_LONG(x);
6286 if (is_unsigned && unlikely(val < 0)) {
6287 goto raise_neg_overflow;
6293 if (unlikely(!PyLong_Check(x))) {
6295 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
6296 if (!tmp)
return (
long) -1;
6297 val = __Pyx_PyInt_As_long(tmp);
6302#if CYTHON_USE_PYLONG_INTERNALS
6303 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
6304 goto raise_neg_overflow;
6305 }
else if (__Pyx_PyLong_IsCompact(x)) {
6306 __PYX_VERIFY_RETURN_INT(
long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
6308 const digit* digits = __Pyx_PyLong_Digits(x);
6309 assert(__Pyx_PyLong_DigitCount(x) > 1);
6310 switch (__Pyx_PyLong_DigitCount(x)) {
6312 if ((8 *
sizeof(
long) > 1 * PyLong_SHIFT)) {
6313 if ((8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT)) {
6314 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
6315 }
else if ((8 *
sizeof(
long) >= 2 * PyLong_SHIFT)) {
6316 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
6321 if ((8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
6322 if ((8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT)) {
6323 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
6324 }
else if ((8 *
sizeof(
long) >= 3 * PyLong_SHIFT)) {
6325 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
6330 if ((8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
6331 if ((8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT)) {
6332 __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])))
6333 }
else if ((8 *
sizeof(
long) >= 4 * PyLong_SHIFT)) {
6334 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
6341#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
6342 if (unlikely(Py_SIZE(x) < 0)) {
6343 goto raise_neg_overflow;
6347 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
6348 if (unlikely(result < 0))
6350 if (unlikely(result == 1))
6351 goto raise_neg_overflow;
6354 if ((
sizeof(
long) <=
sizeof(
unsigned long))) {
6355 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
6356#ifdef HAVE_LONG_LONG
6357 }
else if ((
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG))) {
6358 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
6362#if CYTHON_USE_PYLONG_INTERNALS
6363 if (__Pyx_PyLong_IsCompact(x)) {
6364 __PYX_VERIFY_RETURN_INT(
long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
6366 const digit* digits = __Pyx_PyLong_Digits(x);
6367 assert(__Pyx_PyLong_DigitCount(x) > 1);
6368 switch (__Pyx_PyLong_SignedDigitCount(x)) {
6370 if ((8 *
sizeof(
long) - 1 > 1 * PyLong_SHIFT)) {
6371 if ((8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT)) {
6372 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
6373 }
else if ((8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT)) {
6374 return (
long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
6379 if ((8 *
sizeof(
long) > 1 * PyLong_SHIFT)) {
6380 if ((8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT)) {
6381 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
6382 }
else if ((8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT)) {
6383 return (
long) ((((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
6388 if ((8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT)) {
6389 if ((8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT)) {
6390 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
6391 }
else if ((8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT)) {
6392 return (
long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
6397 if ((8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
6398 if ((8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT)) {
6399 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
6400 }
else if ((8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT)) {
6401 return (
long) ((((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
6406 if ((8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT)) {
6407 if ((8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT)) {
6408 __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])))
6409 }
else if ((8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT)) {
6410 return (
long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
6415 if ((8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
6416 if ((8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT)) {
6417 __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])))
6418 }
else if ((8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT)) {
6419 return (
long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
6426 if ((
sizeof(
long) <=
sizeof(long))) {
6427 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
6428#ifdef HAVE_LONG_LONG
6429 }
else if ((
sizeof(
long) <=
sizeof(PY_LONG_LONG))) {
6430 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
6437#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
6438 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
6439 x, &val,
sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
6440 if (unlikely(bytes_copied == -1)) {
6441 }
else if (unlikely(bytes_copied > (Py_ssize_t)
sizeof(val))) {
6442 goto raise_overflow;
6446#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
6447 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
6448 unsigned char *bytes = (
unsigned char *)&val;
6449 ret = _PyLong_AsByteArray((PyLongObject *)x,
6451 is_little, !is_unsigned);
6454 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
6455 int bits, remaining_bits, is_negative = 0;
6456 int chunk_size = (
sizeof(long) < 8) ? 30 : 62;
6457 if (likely(PyLong_CheckExact(x))) {
6458 v = __Pyx_NewRef(x);
6460 v = PyNumber_Long(x);
6461 if (unlikely(!v))
return (
long) -1;
6462 assert(PyLong_CheckExact(v));
6465 int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
6466 if (unlikely(result < 0)) {
6470 is_negative = result == 1;
6472 if (is_unsigned && unlikely(is_negative)) {
6474 goto raise_neg_overflow;
6475 }
else if (is_negative) {
6476 stepval = PyNumber_Invert(v);
6478 if (unlikely(!stepval))
6485 mask = PyLong_FromLong((1L << chunk_size) - 1);
if (unlikely(!mask))
goto done;
6486 shift = PyLong_FromLong(chunk_size);
if (unlikely(!shift))
goto done;
6487 for (bits = 0; bits < (int)
sizeof(
long) * 8 - chunk_size; bits += chunk_size) {
6488 PyObject *tmp, *digit;
6490 digit = PyNumber_And(stepval, mask);
6491 if (unlikely(!digit))
goto done;
6492 idigit = PyLong_AsLong(digit);
6494 if (unlikely(idigit < 0))
goto done;
6495 val |= ((long) idigit) << bits;
6496 tmp = PyNumber_Rshift(stepval, shift);
6497 if (unlikely(!tmp))
goto done;
6498 Py_DECREF(stepval); stepval = tmp;
6500 Py_DECREF(shift); shift = NULL;
6501 Py_DECREF(mask); mask = NULL;
6503 long idigit = PyLong_AsLong(stepval);
6504 if (unlikely(idigit < 0))
goto done;
6505 remaining_bits = ((int)
sizeof(
long) * 8) - bits - (is_unsigned ? 0 : 1);
6506 if (unlikely(idigit >= (1L << remaining_bits)))
6507 goto raise_overflow;
6508 val |= ((long) idigit) << bits;
6511 if (unlikely(val & (((
long) 1) << (
sizeof(
long) * 8 - 1))))
6512 goto raise_overflow;
6520 Py_XDECREF(stepval);
6527 PyErr_SetString(PyExc_OverflowError,
6528 "value too large to convert to long");
6531 PyErr_SetString(PyExc_OverflowError,
6532 "can't convert negative value to long");
6537static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *x) {
6538#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
6539#pragma GCC diagnostic push
6540#pragma GCC diagnostic ignored "-Wconversion"
6542 const int neg_one = (int) -1, const_zero = (
int) 0;
6543#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
6544#pragma GCC diagnostic pop
6546 const int is_unsigned = neg_one > const_zero;
6547#if PY_MAJOR_VERSION < 3
6548 if (likely(PyInt_Check(x))) {
6549 if ((
sizeof(
int) <
sizeof(
long))) {
6550 __PYX_VERIFY_RETURN_INT(
int,
long, PyInt_AS_LONG(x))
6552 long val = PyInt_AS_LONG(x);
6553 if (is_unsigned && unlikely(val < 0)) {
6554 goto raise_neg_overflow;
6560 if (unlikely(!PyLong_Check(x))) {
6562 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
6563 if (!tmp)
return (
int) -1;
6564 val = __Pyx_PyInt_As_int(tmp);
6569#if CYTHON_USE_PYLONG_INTERNALS
6570 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
6571 goto raise_neg_overflow;
6572 }
else if (__Pyx_PyLong_IsCompact(x)) {
6573 __PYX_VERIFY_RETURN_INT(
int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
6575 const digit* digits = __Pyx_PyLong_Digits(x);
6576 assert(__Pyx_PyLong_DigitCount(x) > 1);
6577 switch (__Pyx_PyLong_DigitCount(x)) {
6579 if ((8 *
sizeof(
int) > 1 * PyLong_SHIFT)) {
6580 if ((8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT)) {
6581 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
6582 }
else if ((8 *
sizeof(
int) >= 2 * PyLong_SHIFT)) {
6583 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
6588 if ((8 *
sizeof(
int) > 2 * PyLong_SHIFT)) {
6589 if ((8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT)) {
6590 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
6591 }
else if ((8 *
sizeof(
int) >= 3 * PyLong_SHIFT)) {
6592 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
6597 if ((8 *
sizeof(
int) > 3 * PyLong_SHIFT)) {
6598 if ((8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT)) {
6599 __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])))
6600 }
else if ((8 *
sizeof(
int) >= 4 * PyLong_SHIFT)) {
6601 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
6608#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
6609 if (unlikely(Py_SIZE(x) < 0)) {
6610 goto raise_neg_overflow;
6614 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
6615 if (unlikely(result < 0))
6617 if (unlikely(result == 1))
6618 goto raise_neg_overflow;
6621 if ((
sizeof(
int) <=
sizeof(
unsigned long))) {
6622 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
6623#ifdef HAVE_LONG_LONG
6624 }
else if ((
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG))) {
6625 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
6629#if CYTHON_USE_PYLONG_INTERNALS
6630 if (__Pyx_PyLong_IsCompact(x)) {
6631 __PYX_VERIFY_RETURN_INT(
int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
6633 const digit* digits = __Pyx_PyLong_Digits(x);
6634 assert(__Pyx_PyLong_DigitCount(x) > 1);
6635 switch (__Pyx_PyLong_SignedDigitCount(x)) {
6637 if ((8 *
sizeof(
int) - 1 > 1 * PyLong_SHIFT)) {
6638 if ((8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT)) {
6639 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
6640 }
else if ((8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT)) {
6641 return (
int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
6646 if ((8 *
sizeof(
int) > 1 * PyLong_SHIFT)) {
6647 if ((8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT)) {
6648 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
6649 }
else if ((8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT)) {
6650 return (
int) ((((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
6655 if ((8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT)) {
6656 if ((8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT)) {
6657 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
6658 }
else if ((8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT)) {
6659 return (
int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
6664 if ((8 *
sizeof(
int) > 2 * PyLong_SHIFT)) {
6665 if ((8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT)) {
6666 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
6667 }
else if ((8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT)) {
6668 return (
int) ((((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
6673 if ((8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT)) {
6674 if ((8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT)) {
6675 __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])))
6676 }
else if ((8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT)) {
6677 return (
int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
6682 if ((8 *
sizeof(
int) > 3 * PyLong_SHIFT)) {
6683 if ((8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT)) {
6684 __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])))
6685 }
else if ((8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT)) {
6686 return (
int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
6693 if ((
sizeof(
int) <=
sizeof(long))) {
6694 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
6695#ifdef HAVE_LONG_LONG
6696 }
else if ((
sizeof(
int) <=
sizeof(PY_LONG_LONG))) {
6697 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
6704#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
6705 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
6706 x, &val,
sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
6707 if (unlikely(bytes_copied == -1)) {
6708 }
else if (unlikely(bytes_copied > (Py_ssize_t)
sizeof(val))) {
6709 goto raise_overflow;
6713#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
6714 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
6715 unsigned char *bytes = (
unsigned char *)&val;
6716 ret = _PyLong_AsByteArray((PyLongObject *)x,
6718 is_little, !is_unsigned);
6721 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
6722 int bits, remaining_bits, is_negative = 0;
6723 int chunk_size = (
sizeof(long) < 8) ? 30 : 62;
6724 if (likely(PyLong_CheckExact(x))) {
6725 v = __Pyx_NewRef(x);
6727 v = PyNumber_Long(x);
6728 if (unlikely(!v))
return (
int) -1;
6729 assert(PyLong_CheckExact(v));
6732 int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
6733 if (unlikely(result < 0)) {
6737 is_negative = result == 1;
6739 if (is_unsigned && unlikely(is_negative)) {
6741 goto raise_neg_overflow;
6742 }
else if (is_negative) {
6743 stepval = PyNumber_Invert(v);
6745 if (unlikely(!stepval))
6752 mask = PyLong_FromLong((1L << chunk_size) - 1);
if (unlikely(!mask))
goto done;
6753 shift = PyLong_FromLong(chunk_size);
if (unlikely(!shift))
goto done;
6754 for (bits = 0; bits < (int)
sizeof(
int) * 8 - chunk_size; bits += chunk_size) {
6755 PyObject *tmp, *digit;
6757 digit = PyNumber_And(stepval, mask);
6758 if (unlikely(!digit))
goto done;
6759 idigit = PyLong_AsLong(digit);
6761 if (unlikely(idigit < 0))
goto done;
6762 val |= ((int) idigit) << bits;
6763 tmp = PyNumber_Rshift(stepval, shift);
6764 if (unlikely(!tmp))
goto done;
6765 Py_DECREF(stepval); stepval = tmp;
6767 Py_DECREF(shift); shift = NULL;
6768 Py_DECREF(mask); mask = NULL;
6770 long idigit = PyLong_AsLong(stepval);
6771 if (unlikely(idigit < 0))
goto done;
6772 remaining_bits = ((int)
sizeof(
int) * 8) - bits - (is_unsigned ? 0 : 1);
6773 if (unlikely(idigit >= (1L << remaining_bits)))
6774 goto raise_overflow;
6775 val |= ((int) idigit) << bits;
6778 if (unlikely(val & (((
int) 1) << (
sizeof(
int) * 8 - 1))))
6779 goto raise_overflow;
6787 Py_XDECREF(stepval);
6794 PyErr_SetString(PyExc_OverflowError,
6795 "value too large to convert to int");
6798 PyErr_SetString(PyExc_OverflowError,
6799 "can't convert negative value to int");
6804#if CYTHON_COMPILING_IN_CPYTHON
6805static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
6807 a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
6811 return b == &PyBaseObject_Type;
6813static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
6815 if (a == b)
return 1;
6819 n = PyTuple_GET_SIZE(mro);
6820 for (i = 0; i < n; i++) {
6821 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
6826 return __Pyx_InBases(a, b);
6828static CYTHON_INLINE
int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
6830 if (cls == a || cls == b)
return 1;
6834 n = PyTuple_GET_SIZE(mro);
6835 for (i = 0; i < n; i++) {
6836 PyObject *base = PyTuple_GET_ITEM(mro, i);
6837 if (base == (PyObject *)a || base == (PyObject *)b)
6842 return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
6844#if PY_MAJOR_VERSION == 2
6845static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
6846 PyObject *exception, *value, *tb;
6848 __Pyx_PyThreadState_declare
6849 __Pyx_PyThreadState_assign
6850 __Pyx_ErrFetch(&exception, &value, &tb);
6851 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
6852 if (unlikely(res == -1)) {
6853 PyErr_WriteUnraisable(err);
6857 res = PyObject_IsSubclass(err, exc_type2);
6858 if (unlikely(res == -1)) {
6859 PyErr_WriteUnraisable(err);
6863 __Pyx_ErrRestore(exception, value, tb);
6867static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
6869 return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
6871 return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
6875static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
6877 assert(PyExceptionClass_Check(exc_type));
6878 n = PyTuple_GET_SIZE(tuple);
6879#if PY_MAJOR_VERSION >= 3
6880 for (i=0; i<n; i++) {
6881 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
6884 for (i=0; i<n; i++) {
6885 PyObject *t = PyTuple_GET_ITEM(tuple, i);
6886 #if PY_MAJOR_VERSION < 3
6887 if (likely(exc_type == t))
return 1;
6889 if (likely(PyExceptionClass_Check(t))) {
6890 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
6896static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
6897 if (likely(err == exc_type))
return 1;
6898 if (likely(PyExceptionClass_Check(err))) {
6899 if (likely(PyExceptionClass_Check(exc_type))) {
6900 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
6901 }
else if (likely(PyTuple_Check(exc_type))) {
6902 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
6906 return PyErr_GivenExceptionMatches(err, exc_type);
6908static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
6909 assert(PyExceptionClass_Check(exc_type1));
6910 assert(PyExceptionClass_Check(exc_type2));
6911 if (likely(err == exc_type1 || err == exc_type2))
return 1;
6912 if (likely(PyExceptionClass_Check(err))) {
6913 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
6915 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
6920static unsigned long __Pyx_get_runtime_version(
void) {
6921#if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4
6922 return Py_Version & ~0xFFUL;
6924 const char* rt_version = Py_GetVersion();
6925 unsigned long version = 0;
6926 unsigned long factor = 0x01000000UL;
6927 unsigned int digit = 0;
6930 while (
'0' <= rt_version[i] && rt_version[i] <=
'9') {
6931 digit = digit * 10 + (
unsigned int) (rt_version[i] -
'0');
6934 version += factor * digit;
6935 if (rt_version[i] !=
'.')
6944static int __Pyx_check_binary_version(
unsigned long ct_version,
unsigned long rt_version,
int allow_newer) {
6945 const unsigned long MAJOR_MINOR = 0xFFFF0000UL;
6946 if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR))
6948 if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
6952 PyOS_snprintf(message,
sizeof(message),
6953 "compile time Python version %d.%d "
6954 "of module '%.100s' "
6956 "runtime version %d.%d",
6957 (
int) (ct_version >> 24), (
int) ((ct_version >> 16) & 0xFF),
6959 (allow_newer) ?
"was newer than" :
"does not match",
6960 (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF)
6962 return PyErr_WarnEx(NULL, message, 1);
6967static int __Pyx_ExportFunction(
const char *name,
void (*f)(
void),
const char *sig) {
6974 d = PyObject_GetAttrString(__pyx_m, (
char *)
"__pyx_capi__");
6981 if (PyModule_AddObject(__pyx_m, (
char *)
"__pyx_capi__", d) < 0)
6985 cobj = PyCapsule_New(tmp.p, sig, 0);
6988 if (PyDict_SetItemString(d, name, cobj) < 0)
7000#if PY_MAJOR_VERSION >= 3
7001static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) {
7002 if (t.is_unicode | t.is_str) {
7004 *str = PyUnicode_InternFromString(t.s);
7005 }
else if (t.encoding) {
7006 *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL);
7008 *str = PyUnicode_FromStringAndSize(t.s, t.n - 1);
7011 *str = PyBytes_FromStringAndSize(t.s, t.n - 1);
7015 if (PyObject_Hash(*str) == -1)
7020static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
7022 #if PY_MAJOR_VERSION >= 3
7023 __Pyx_InitString(*t, t->p);
7025 if (t->is_unicode) {
7026 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
7027 }
else if (t->intern) {
7028 *t->p = PyString_InternFromString(t->s);
7030 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
7034 if (PyObject_Hash(*t->p) == -1)
7043static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(
const char *s) {
7044 size_t len = strlen(s);
7045 if (unlikely(len > (
size_t) PY_SSIZE_T_MAX)) {
7046 PyErr_SetString(PyExc_OverflowError,
"byte string is too long");
7049 return (Py_ssize_t) len;
7051static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
7052 Py_ssize_t len = __Pyx_ssize_strlen(c_str);
7053 if (unlikely(len < 0))
return NULL;
7054 return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
7056static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(
const char* c_str) {
7057 Py_ssize_t len = __Pyx_ssize_strlen(c_str);
7058 if (unlikely(len < 0))
return NULL;
7059 return PyByteArray_FromStringAndSize(c_str, len);
7061static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
7063 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
7065#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
7066#if !CYTHON_PEP393_ENABLED
7067static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
7069 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
7070 if (!defenc)
return NULL;
7071 defenc_c = PyBytes_AS_STRING(defenc);
7072#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
7074 char*
end = defenc_c + PyBytes_GET_SIZE(defenc);
7076 for (c = defenc_c; c <
end; c++) {
7077 if ((
unsigned char) (*c) >= 128) {
7078 PyUnicode_AsASCIIString(o);
7084 *length = PyBytes_GET_SIZE(defenc);
7088static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
7089 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
7090#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
7091 if (likely(PyUnicode_IS_ASCII(o))) {
7092 *length = PyUnicode_GET_LENGTH(o);
7093 return PyUnicode_AsUTF8(o);
7095 PyUnicode_AsASCIIString(o);
7099 return PyUnicode_AsUTF8AndSize(o, length);
7104static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
7105#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
7107#
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
7108 __Pyx_sys_getdefaultencoding_not_ascii &&
7110 PyUnicode_Check(o)) {
7111 return __Pyx_PyUnicode_AsStringAndSize(o, length);
7114#if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
7115 if (PyByteArray_Check(o)) {
7116 *length = PyByteArray_GET_SIZE(o);
7117 return PyByteArray_AS_STRING(o);
7122 int r = PyBytes_AsStringAndSize(o, &result, length);
7123 if (unlikely(r < 0)) {
7130static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
7131 int is_true = x == Py_True;
7132 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
7133 else return PyObject_IsTrue(x);
7135static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
7137 if (unlikely(!x))
return -1;
7138 retval = __Pyx_PyObject_IsTrue(x);
7142static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result,
const char* type_name) {
7143 __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result));
7144#if PY_MAJOR_VERSION >= 3
7145 if (PyLong_Check(result)) {
7146 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
7147 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME
"). "
7148 "The ability to return an instance of a strict subclass of int is deprecated, "
7149 "and may be removed in a future version of Python.",
7150 result_type_name)) {
7151 __Pyx_DECREF_TypeName(result_type_name);
7155 __Pyx_DECREF_TypeName(result_type_name);
7159 PyErr_Format(PyExc_TypeError,
7160 "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME
")",
7161 type_name, type_name, result_type_name);
7162 __Pyx_DECREF_TypeName(result_type_name);
7166static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
7167#if CYTHON_USE_TYPE_SLOTS
7170 const char *
name = NULL;
7171 PyObject *res = NULL;
7172#if PY_MAJOR_VERSION < 3
7173 if (likely(PyInt_Check(x) || PyLong_Check(x)))
7175 if (likely(PyLong_Check(x)))
7177 return __Pyx_NewRef(x);
7178#if CYTHON_USE_TYPE_SLOTS
7179 m = Py_TYPE(x)->tp_as_number;
7180 #if PY_MAJOR_VERSION < 3
7181 if (m && m->nb_int) {
7185 else if (m && m->nb_long) {
7187 res = m->nb_long(x);
7190 if (likely(m && m->nb_int)) {
7196 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
7197 res = PyNumber_Int(x);
7201#if PY_MAJOR_VERSION < 3
7202 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
7204 if (unlikely(!PyLong_CheckExact(res))) {
7206 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
7209 else if (!PyErr_Occurred()) {
7210 PyErr_SetString(PyExc_TypeError,
7211 "an integer is required");
7215static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
7218#if PY_MAJOR_VERSION < 3
7219 if (likely(PyInt_CheckExact(b))) {
7220 if (
sizeof(Py_ssize_t) >=
sizeof(
long))
7221 return PyInt_AS_LONG(b);
7223 return PyInt_AsSsize_t(b);
7226 if (likely(PyLong_CheckExact(b))) {
7227 #if CYTHON_USE_PYLONG_INTERNALS
7228 if (likely(__Pyx_PyLong_IsCompact(b))) {
7229 return __Pyx_PyLong_CompactValue(b);
7231 const digit* digits = __Pyx_PyLong_Digits(b);
7232 const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b);
7235 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
7236 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
7240 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
7241 return -(Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
7245 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
7246 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
7250 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
7251 return -(Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
7255 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
7256 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]));
7260 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
7261 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]));
7267 return PyLong_AsSsize_t(b);
7269 x = PyNumber_Index(b);
7271 ival = PyInt_AsSsize_t(x);
7275static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
7276 if (
sizeof(Py_hash_t) ==
sizeof(Py_ssize_t)) {
7277 return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
7278#if PY_MAJOR_VERSION < 3
7279 }
else if (likely(PyInt_CheckExact(o))) {
7280 return PyInt_AS_LONG(o);
7285 x = PyNumber_Index(o);
7287 ival = PyInt_AsLong(x);
7292static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
7293 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
7295static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t ival) {
7296 return PyInt_FromSize_t(ival);
7302#pragma warning( pop )
The abstract base class used by all types of agents that live and interact in a simulation.
The Facility class is the abstract class/interface used by all facility agents.
The Institution class is the abstract class/interface used by all institution agents.
The Region class is the abstract class/interface used by all region agents.
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 void CyclusPyCallListeners(std::string, cyclus::Agent *, void *, int, boost::spirit::hold_any)
PyMODINIT_FUNC initpymodule(void)
__PYX_EXTERN_C std::string CyclusPyFindModule(std::string)
__PYX_EXTERN_C cyclus::Agent * CyclusMakePyAgent(std::string, std::string, void *)
__PYX_EXTERN_C void CyclusClearPyAgentRefs(void)
__PYX_EXTERN_C void CyclusInitFromPyAgent(cyclus::Agent *, cyclus::Agent *, void *)
__PYX_EXTERN_C void CyclusPyDelAgent(int)