44#ifndef PY_SSIZE_T_CLEAN
45#define PY_SSIZE_T_CLEAN
48#if defined(Py_LIMITED_API)
49 #if !defined(CYTHON_LIMITED_API)
50 #define CYTHON_LIMITED_API 1
52#elif defined(CYTHON_LIMITED_API)
54 #pragma message ("Limited API usage is enabled with 'CYTHON_LIMITED_API' but 'Py_LIMITED_API' does not define a Python target version. Consider setting 'Py_LIMITED_API' instead.")
56 #warning Limited API usage is enabled with 'CYTHON_LIMITED_API' but 'Py_LIMITED_API' does not define a Python target version. Consider setting 'Py_LIMITED_API' instead.
62 #error Python headers needed to compile C extensions, please install development version of Python.
63#elif PY_VERSION_HEX < 0x03090000
64 #error Cython requires Python 3.9+.
65#elif defined(Py_LIMITED_API) && (Py_LIMITED_API & 0xFFFF0000) > (PY_VERSION_HEX & 0xFFFF0000)
66 #error 'Py_LIMITED_API' can only select past Python X.Y versions, not future ones.
68#define __PYX_ABI_VERSION "3_3_0"
69#define CYTHON_HEX_VERSION 0x030300F0
70#define CYTHON_FUTURE_DIVISION 1
74 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
76#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS)
88 #define __Pyx_has_cbuiltin(name) __has_builtin(name)
90 #define __Pyx_has_cbuiltin(name) (0)
93 #define DL_IMPORT(t) t
96 #define DL_EXPORT(t) t
100 #define PY_LONG_LONG LONG_LONG
103 #define Py_HUGE_VAL HUGE_VAL
105#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX
106#if defined(CYTHON_LIMITED_API)
107 #ifdef Py_LIMITED_API
108 #undef __PYX_LIMITED_VERSION_HEX
109 #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API
110 #if Py_LIMITED_API < 0x03090000
111 #error "Cython 3.3 requires the Python Limited API version to be 3.9 or greater."
114 #if defined(GRAALVM_PYTHON) || defined(PYPY_VERSION)
116 #pragma message ("Py_LIMITED_API is defined on PyPy or GraalPy. This takes precedence over Cython's specialized\
117 code for PyPy and GraalPy and is unlikely to work.")
119 #warning "Py_LIMITED_API is defined on PyPy or GraalPy. This takes precedence over Cython's specialized\
120 code for PyPy and GraalPy and is unlikely to work."
123 #define CYTHON_COMPILING_IN_PYPY 0
124 #define CYTHON_COMPILING_IN_CPYTHON 0
125 #define CYTHON_COMPILING_IN_LIMITED_API 1
126 #define CYTHON_COMPILING_IN_GRAAL 0
127 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
128 #undef CYTHON_USE_TYPE_SLOTS
129 #define CYTHON_USE_TYPE_SLOTS 0
130 #undef CYTHON_USE_TYPE_SPECS
131 #define CYTHON_USE_TYPE_SPECS 1
132 #undef CYTHON_USE_PYTYPE_LOOKUP
133 #define CYTHON_USE_PYTYPE_LOOKUP 0
134 #undef CYTHON_USE_PYLIST_INTERNALS
135 #define CYTHON_USE_PYLIST_INTERNALS 0
136 #undef CYTHON_USE_UNICODE_INTERNALS
137 #define CYTHON_USE_UNICODE_INTERNALS 0
138 #ifndef CYTHON_USE_UNICODE_WRITER
139 #define CYTHON_USE_UNICODE_WRITER 0
141 #undef CYTHON_USE_PYLONG_INTERNALS
142 #define CYTHON_USE_PYLONG_INTERNALS 0
143 #ifndef CYTHON_AVOID_BORROWED_REFS
144 #define CYTHON_AVOID_BORROWED_REFS 0
146 #ifndef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
147 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
149 #undef CYTHON_ASSUME_SAFE_MACROS
150 #define CYTHON_ASSUME_SAFE_MACROS 0
151 #undef CYTHON_ASSUME_SAFE_SIZE
152 #define CYTHON_ASSUME_SAFE_SIZE 0
153 #undef CYTHON_UNPACK_METHODS
154 #define CYTHON_UNPACK_METHODS 0
155 #undef CYTHON_FAST_THREAD_STATE
156 #define CYTHON_FAST_THREAD_STATE 0
157 #undef CYTHON_FAST_GIL
158 #define CYTHON_FAST_GIL 0
159 #undef CYTHON_VECTORCALL
160 #define CYTHON_VECTORCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000)
161 #ifndef CYTHON_VECTORCALL_TPNEW
162 #define CYTHON_VECTORCALL_TPNEW (CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
164 #ifndef CYTHON_PEP487_INIT_SUBCLASS
165 #define CYTHON_PEP487_INIT_SUBCLASS 1
167 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
168 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
170 #ifndef CYTHON_USE_MODULE_STATE
171 #define CYTHON_USE_MODULE_STATE 0
173 #undef CYTHON_USE_SYS_MONITORING
174 #define CYTHON_USE_SYS_MONITORING 0
175 #ifndef CYTHON_USE_TP_FINALIZE
176 #define CYTHON_USE_TP_FINALIZE (__PYX_LIMITED_VERSION_HEX >= 0x030F0000 && PY_VERSION_HEX > 0x030F00A8)
178 #ifndef CYTHON_USE_AM_SEND
179 #define CYTHON_USE_AM_SEND (__PYX_LIMITED_VERSION_HEX >= 0x030A0000)
181 #undef CYTHON_USE_DICT_VERSIONS
182 #define CYTHON_USE_DICT_VERSIONS 0
183 #undef CYTHON_USE_EXC_INFO_STACK
184 #define CYTHON_USE_EXC_INFO_STACK 0
185 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
186 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
188 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
189 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
191 #ifndef CYTHON_USE_FREELISTS
192 #define CYTHON_USE_FREELISTS 1
194 #undef CYTHON_IMMORTAL_CONSTANTS
195 #define CYTHON_IMMORTAL_CONSTANTS 0
196 #if __PYX_LIMITED_VERSION_HEX < 0x030E0000
197 #undef CYTHON_OPAQUE_OBJECTS
198 #define CYTHON_OPAQUE_OBJECTS 0
199 #elif !defined(CYTHON_OPAQUE_OBJECTS)
200 #define CYTHON_OPAQUE_OBJECTS (__PYX_LIMITED_VERSION_HEX >= 0x030F0000)
202#elif defined(GRAALVM_PYTHON)
205 #define CYTHON_COMPILING_IN_PYPY 0
206 #define CYTHON_COMPILING_IN_CPYTHON 0
207 #define CYTHON_COMPILING_IN_LIMITED_API 0
208 #define CYTHON_COMPILING_IN_GRAAL 1
209 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
210 #ifndef CYTHON_USE_TYPE_SLOTS
211 #define CYTHON_USE_TYPE_SLOTS 0
213 #undef CYTHON_USE_TYPE_SPECS
214 #define CYTHON_USE_TYPE_SPECS 0
215 #undef CYTHON_USE_PYTYPE_LOOKUP
216 #define CYTHON_USE_PYTYPE_LOOKUP 0
217 #undef CYTHON_USE_PYLIST_INTERNALS
218 #define CYTHON_USE_PYLIST_INTERNALS 0
219 #undef CYTHON_USE_UNICODE_INTERNALS
220 #define CYTHON_USE_UNICODE_INTERNALS 0
221 #undef CYTHON_USE_UNICODE_WRITER
222 #define CYTHON_USE_UNICODE_WRITER 0
223 #undef CYTHON_USE_PYLONG_INTERNALS
224 #define CYTHON_USE_PYLONG_INTERNALS 0
225 #undef CYTHON_AVOID_BORROWED_REFS
226 #define CYTHON_AVOID_BORROWED_REFS 1
227 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
228 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
229 #undef CYTHON_ASSUME_SAFE_MACROS
230 #define CYTHON_ASSUME_SAFE_MACROS 0
231 #undef CYTHON_ASSUME_SAFE_SIZE
232 #define CYTHON_ASSUME_SAFE_SIZE 0
233 #undef CYTHON_UNPACK_METHODS
234 #define CYTHON_UNPACK_METHODS 0
235 #undef CYTHON_FAST_THREAD_STATE
236 #define CYTHON_FAST_THREAD_STATE 0
237 #undef CYTHON_FAST_GIL
238 #define CYTHON_FAST_GIL 0
239 #ifndef CYTHON_VECTORCALL
240 #define CYTHON_VECTORCALL 1
242 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
243 #undef CYTHON_VECTORCALL_TPNEW
244 #define CYTHON_VECTORCALL_TPNEW 0
245 #elif !defined(CYTHON_VECTORCALL_TPNEW)
246 #define CYTHON_VECTORCALL_TPNEW CYTHON_VECTORCALL
248 #ifndef CYTHON_PEP487_INIT_SUBCLASS
249 #define CYTHON_PEP487_INIT_SUBCLASS 1
251 #undef CYTHON_PEP489_MULTI_PHASE_INIT
252 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
253 #undef CYTHON_USE_MODULE_STATE
254 #define CYTHON_USE_MODULE_STATE 0
255 #undef CYTHON_USE_SYS_MONITORING
256 #define CYTHON_USE_SYS_MONITORING 0
257 #undef CYTHON_USE_TP_FINALIZE
258 #define CYTHON_USE_TP_FINALIZE 0
259 #undef CYTHON_USE_AM_SEND
260 #define CYTHON_USE_AM_SEND 0
261 #undef CYTHON_USE_DICT_VERSIONS
262 #define CYTHON_USE_DICT_VERSIONS 0
263 #undef CYTHON_USE_EXC_INFO_STACK
264 #define CYTHON_USE_EXC_INFO_STACK 1
265 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
266 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
268 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
269 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
271 #undef CYTHON_USE_FREELISTS
272 #define CYTHON_USE_FREELISTS 0
273 #undef CYTHON_IMMORTAL_CONSTANTS
274 #define CYTHON_IMMORTAL_CONSTANTS 0
275 #undef CYTHON_OPAQUE_OBJECTS
276 #define CYTHON_OPAQUE_OBJECTS 0
277#elif defined(PYPY_VERSION)
278 #define CYTHON_COMPILING_IN_PYPY 1
279 #define CYTHON_COMPILING_IN_CPYTHON 0
280 #define CYTHON_COMPILING_IN_LIMITED_API 0
281 #define CYTHON_COMPILING_IN_GRAAL 0
282 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
283 #undef CYTHON_USE_TYPE_SLOTS
284 #define CYTHON_USE_TYPE_SLOTS 1
285 #ifndef CYTHON_USE_TYPE_SPECS
286 #define CYTHON_USE_TYPE_SPECS 0
288 #undef CYTHON_USE_PYTYPE_LOOKUP
289 #define CYTHON_USE_PYTYPE_LOOKUP 0
290 #undef CYTHON_USE_PYLIST_INTERNALS
291 #define CYTHON_USE_PYLIST_INTERNALS 0
292 #undef CYTHON_USE_UNICODE_INTERNALS
293 #define CYTHON_USE_UNICODE_INTERNALS 0
294 #undef CYTHON_USE_UNICODE_WRITER
295 #define CYTHON_USE_UNICODE_WRITER 0
296 #undef CYTHON_USE_PYLONG_INTERNALS
297 #define CYTHON_USE_PYLONG_INTERNALS 0
298 #undef CYTHON_AVOID_BORROWED_REFS
299 #define CYTHON_AVOID_BORROWED_REFS 1
300 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
301 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
302 #undef CYTHON_ASSUME_SAFE_MACROS
303 #define CYTHON_ASSUME_SAFE_MACROS 0
304 #ifndef CYTHON_ASSUME_SAFE_SIZE
305 #define CYTHON_ASSUME_SAFE_SIZE 1
307 #undef CYTHON_UNPACK_METHODS
308 #define CYTHON_UNPACK_METHODS 0
309 #undef CYTHON_FAST_THREAD_STATE
310 #define CYTHON_FAST_THREAD_STATE 0
311 #undef CYTHON_FAST_GIL
312 #define CYTHON_FAST_GIL 0
313 #ifndef CYTHON_VECTORCALL
314 #define CYTHON_VECTORCALL 1
316 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
317 #undef CYTHON_VECTORCALL_TPNEW
318 #define CYTHON_VECTORCALL_TPNEW 0
319 #elif !defined(CYTHON_VECTORCALL_TPNEW)
320 #define CYTHON_VECTORCALL_TPNEW (PYPY_VERSION_NUM >= 0x07030800 && CYTHON_VECTORCALL)
322 #ifndef CYTHON_PEP487_INIT_SUBCLASS
323 #define CYTHON_PEP487_INIT_SUBCLASS 1
325 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
326 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
328 #undef CYTHON_USE_MODULE_STATE
329 #define CYTHON_USE_MODULE_STATE 0
330 #undef CYTHON_USE_SYS_MONITORING
331 #define CYTHON_USE_SYS_MONITORING 0
332 #ifndef CYTHON_USE_TP_FINALIZE
333 #define CYTHON_USE_TP_FINALIZE (PYPY_VERSION_NUM >= 0x07030C00)
335 #undef CYTHON_USE_AM_SEND
336 #define CYTHON_USE_AM_SEND 0
337 #undef CYTHON_USE_DICT_VERSIONS
338 #define CYTHON_USE_DICT_VERSIONS 0
339 #undef CYTHON_USE_EXC_INFO_STACK
340 #define CYTHON_USE_EXC_INFO_STACK 0
341 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
342 #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_NUM >= 0x07031100)
344 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
345 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
347 #undef CYTHON_USE_FREELISTS
348 #define CYTHON_USE_FREELISTS 0
349 #undef CYTHON_IMMORTAL_CONSTANTS
350 #define CYTHON_IMMORTAL_CONSTANTS 0
351 #undef CYTHON_OPAQUE_OBJECTS
352 #define CYTHON_OPAQUE_OBJECTS 0
354 #define CYTHON_COMPILING_IN_PYPY 0
355 #define CYTHON_COMPILING_IN_CPYTHON 1
356 #define CYTHON_COMPILING_IN_LIMITED_API 0
357 #define CYTHON_COMPILING_IN_GRAAL 0
358 #ifdef Py_GIL_DISABLED
359 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 1
361 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
363 #if PY_VERSION_HEX < 0x030A0000
364 #undef CYTHON_USE_TYPE_SLOTS
365 #define CYTHON_USE_TYPE_SLOTS 1
366 #elif !defined(CYTHON_USE_TYPE_SLOTS)
367 #define CYTHON_USE_TYPE_SLOTS 1
369 #ifndef CYTHON_USE_TYPE_SPECS
370 #define CYTHON_USE_TYPE_SPECS 0
372 #ifndef CYTHON_USE_PYTYPE_LOOKUP
373 #define CYTHON_USE_PYTYPE_LOOKUP 1
375 #ifndef CYTHON_USE_PYLONG_INTERNALS
376 #define CYTHON_USE_PYLONG_INTERNALS 1
378 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
379 #undef CYTHON_USE_PYLIST_INTERNALS
380 #define CYTHON_USE_PYLIST_INTERNALS 0
381 #elif !defined(CYTHON_USE_PYLIST_INTERNALS)
382 #define CYTHON_USE_PYLIST_INTERNALS 1
384 #ifndef CYTHON_USE_UNICODE_INTERNALS
385 #define CYTHON_USE_UNICODE_INTERNALS 1
387 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING || PY_VERSION_HEX >= 0x030B00A2
388 #undef CYTHON_USE_UNICODE_WRITER
389 #define CYTHON_USE_UNICODE_WRITER 0
390 #elif !defined(CYTHON_USE_UNICODE_WRITER)
391 #define CYTHON_USE_UNICODE_WRITER 1
393 #ifndef CYTHON_AVOID_BORROWED_REFS
394 #define CYTHON_AVOID_BORROWED_REFS 0
396 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
397 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
398 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
399 #elif !defined(CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)
400 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
402 #ifndef CYTHON_ASSUME_SAFE_MACROS
403 #define CYTHON_ASSUME_SAFE_MACROS 1
405 #ifndef CYTHON_ASSUME_SAFE_SIZE
406 #define CYTHON_ASSUME_SAFE_SIZE 1
408 #ifndef CYTHON_UNPACK_METHODS
409 #define CYTHON_UNPACK_METHODS 1
411 #ifndef CYTHON_FAST_THREAD_STATE
412 #define CYTHON_FAST_THREAD_STATE 1
414 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
415 #undef CYTHON_FAST_GIL
416 #define CYTHON_FAST_GIL 0
417 #elif !defined(CYTHON_FAST_GIL)
418 #define CYTHON_FAST_GIL (PY_VERSION_HEX < 0x030C00A6)
420 #ifndef CYTHON_VECTORCALL
421 #define CYTHON_VECTORCALL 1
423 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
424 #undef CYTHON_VECTORCALL_TPNEW
425 #define CYTHON_VECTORCALL_TPNEW 0
426 #elif !defined(CYTHON_VECTORCALL_TPNEW)
427 #define CYTHON_VECTORCALL_TPNEW CYTHON_VECTORCALL
429 #ifndef CYTHON_PEP487_INIT_SUBCLASS
430 #define CYTHON_PEP487_INIT_SUBCLASS 1
432 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
433 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
435 #ifndef CYTHON_USE_MODULE_STATE
436 #define CYTHON_USE_MODULE_STATE 0
438 #ifndef CYTHON_USE_SYS_MONITORING
439 #define CYTHON_USE_SYS_MONITORING (PY_VERSION_HEX >= 0x030d00B1)
441 #ifndef CYTHON_USE_TP_FINALIZE
442 #define CYTHON_USE_TP_FINALIZE 1
444 #ifndef CYTHON_USE_AM_SEND
445 #define CYTHON_USE_AM_SEND 1
447 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
448 #undef CYTHON_USE_DICT_VERSIONS
449 #define CYTHON_USE_DICT_VERSIONS 0
450 #elif !defined(CYTHON_USE_DICT_VERSIONS)
451 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5 && !CYTHON_USE_MODULE_STATE)
453 #ifndef CYTHON_USE_EXC_INFO_STACK
454 #define CYTHON_USE_EXC_INFO_STACK 1
456 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
457 #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
459 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
460 #define CYTHON_USE_OWN_PREP_RERAISE_STAR (PY_VERSION_HEX < 0x030C00B2)
462 #ifndef CYTHON_USE_FREELISTS
463 #define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
465 #if defined(CYTHON_IMMORTAL_CONSTANTS) && PY_VERSION_HEX < 0x030C0000
466 #undef CYTHON_IMMORTAL_CONSTANTS
467 #define CYTHON_IMMORTAL_CONSTANTS 0
468 #elif !defined(CYTHON_IMMORTAL_CONSTANTS)
469 #define CYTHON_IMMORTAL_CONSTANTS (PY_VERSION_HEX >= 0x030C0000 && !CYTHON_USE_MODULE_STATE && CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
471 #ifndef CYTHON_OPAQUE_OBJECTS
472 #define CYTHON_OPAQUE_OBJECTS 0
475#if CYTHON_USE_PYLONG_INTERNALS
480 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P ==
sizeof(
void*)) };
483#ifndef __has_attribute
484 #define __has_attribute(x) 0
486#ifndef __has_cpp_attribute
487 #define __has_cpp_attribute(x) 0
489#ifndef CYTHON_RESTRICT
490 #if defined(__GNUC__)
491 #define CYTHON_RESTRICT __restrict__
492 #elif defined(_MSC_VER) && _MSC_VER >= 1400
493 #define CYTHON_RESTRICT __restrict
494 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
495 #define CYTHON_RESTRICT restrict
497 #define CYTHON_RESTRICT
501 #if defined(__cplusplus)
504 #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
505 #if __has_cpp_attribute(maybe_unused)
506 #define CYTHON_UNUSED [[maybe_unused]]
509 #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L
510 #define CYTHON_UNUSED [[maybe_unused]]
514# if defined(__GNUC__)
515# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
516# define CYTHON_UNUSED __attribute__ ((__unused__))
518# define CYTHON_UNUSED
520# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
521# define CYTHON_UNUSED __attribute__ ((__unused__))
523# define CYTHON_UNUSED
526#ifndef CYTHON_UNUSED_VAR
527# if defined(__cplusplus)
528 template<
class T>
void CYTHON_UNUSED_VAR(
const T& ) { }
530# define CYTHON_UNUSED_VAR(x) (void)(x)
533#ifndef CYTHON_MAYBE_UNUSED_VAR
534 #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
536#ifndef CYTHON_NCP_UNUSED
537# if CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
538# define CYTHON_NCP_UNUSED
540# define CYTHON_NCP_UNUSED CYTHON_UNUSED
543#ifndef CYTHON_USE_CPP_STD_MOVE
544 #if defined(__cplusplus) && (\
545 __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600))
546 #define CYTHON_USE_CPP_STD_MOVE 1
548 #define CYTHON_USE_CPP_STD_MOVE 0
551#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
553typedef uintptr_t __pyx_uintptr_t;
554#ifndef CYTHON_FALLTHROUGH
555 #if defined(__cplusplus)
558 #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
559 #if __has_cpp_attribute(fallthrough)
560 #define CYTHON_FALLTHROUGH [[fallthrough]]
563 #ifndef CYTHON_FALLTHROUGH
564 #if __has_cpp_attribute(clang::fallthrough)
565 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
566 #elif __has_cpp_attribute(gnu::fallthrough)
567 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
571 #ifndef CYTHON_FALLTHROUGH
572 #if __has_attribute(fallthrough)
573 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
575 #define CYTHON_FALLTHROUGH
578 #if defined(__clang__) && defined(__apple_build_version__)
579 #if __apple_build_version__ < 7000000
580 #undef CYTHON_FALLTHROUGH
581 #define CYTHON_FALLTHROUGH
586 #define __Pyx_UNREACHABLE() Py_UNREACHABLE()
587#elif __Pyx_has_cbuiltin(__builtin_unreachable)
588 #define __Pyx_UNREACHABLE() __builtin_unreachable()
589#elif defined(__clang__) || defined(__INTEL_COMPILER) || (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)))
590 #define __Pyx_UNREACHABLE() __builtin_unreachable()
591#elif defined(_MSC_VER)
592 #define __Pyx_UNREACHABLE() __assume(0)
594 #define __Pyx_UNREACHABLE() Py_FatalError("Unreachable C code path reached")
596#ifndef Py_UNREACHABLE
597 #define Py_UNREACHABLE() __Pyx_UNREACHABLE()
600 template <
typename T>
601 struct __PYX_IS_UNSIGNED_IMPL {
static const bool value =
T(0) <
T(-1);};
602 #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::value)
604 #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
606#if CYTHON_COMPILING_IN_PYPY == 1
607 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX < 0x030A0000)
609 #define __PYX_NEED_TP_PRINT_SLOT 0
611#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))
612#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
613#define __Pyx_PyErr_FetchException(petype, peval, petb) PyErr_Fetch(petype, peval, petb)
614#define __Pyx_PyErr_RestoreException(etype, eval, etb) PyErr_Restore(etype, eval, etb)
616#define __Pyx_PyErr_FetchException(petype, peval, petb) *(petype)=NULL; *(peval)=PyErr_GetRaisedException(); *(petb)=NULL
617#define __Pyx_PyErr_RestoreException(etype, eval, etb) PyErr_SetRaisedException(eval)
622 #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
625 #if defined(__clang__)
626 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
628 #define CYTHON_INLINE inline
632void __Pyx_call_destructor(
T& x) {
636class __Pyx_FakeReference {
638 __Pyx_FakeReference() : ptr(NULL) { }
639 __Pyx_FakeReference(
const T& ref) : ptr(const_cast<
T*>(&ref)) { }
640 T *operator->() {
return ptr; }
641 T *operator&() {
return ptr; }
642 operator T&() {
return *ptr; }
643 template<
typename U>
bool operator ==(
const U& other)
const {
return *ptr == other; }
644 template<
typename U>
bool operator !=(
const U& other)
const {
return *ptr != other; }
645 template<
typename U>
bool operator==(
const __Pyx_FakeReference<U>& other)
const {
return *ptr == *other.ptr; }
646 template<
typename U>
bool operator!=(
const __Pyx_FakeReference<U>& other)
const {
return *ptr != *other.ptr; }
652#define __PYX_BUILD_PY_SSIZE_T "n"
653#define CYTHON_FORMAT_SSIZE_T "z"
654#define __Pyx_BUILTIN_MODULE_NAME "builtins"
655#define __Pyx_DefaultClassType PyType_Type
656#if CYTHON_COMPILING_IN_LIMITED_API
658 static int CO_OPTIMIZED;
661 static int CO_NEWLOCALS;
664 static int CO_VARARGS;
666 #ifndef CO_VARKEYWORDS
667 static int CO_VARKEYWORDS;
669 #ifndef CO_ASYNC_GENERATOR
670 static int CO_ASYNC_GENERATOR;
673 static int CO_GENERATOR;
676 static int CO_COROUTINE;
680 #define CO_COROUTINE 0x80
682 #ifndef CO_ASYNC_GENERATOR
683 #define CO_ASYNC_GENERATOR 0x200
686static int __Pyx_init_co_variables(
void);
687#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is)
688 #define __Pyx_Py_Is(x, y) Py_Is(x, y)
690 #define __Pyx_Py_Is(x, y) ((x) == (y))
692#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
693 #define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
695 #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
697#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
698 #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
700 #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
702#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
703 #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
705 #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
707#define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj))
708#if CYTHON_COMPILING_IN_PYPY
709 #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
711 #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
713#if CYTHON_COMPILING_IN_LIMITED_API
714static unsigned long __Pyx_Runtime_TPFLAGS_SEQUENCE;
715static unsigned long __Pyx_Runtime_TPFLAGS_MAPPING;
717#define __Pyx_Runtime_TPFLAGS_SEQUENCE Py_TPFLAGS_SEQUENCE
718#define __Pyx_Runtime_TPFLAGS_MAPPING Py_TPFLAGS_MAPPING
720static int __Pyx_init_tpflags_variables(
void);
721#ifndef Py_TPFLAGS_HAVE_FINALIZE
722 #define Py_TPFLAGS_HAVE_FINALIZE 0
724#ifndef Py_TPFLAGS_SEQUENCE
725 #define Py_TPFLAGS_SEQUENCE (CYTHON_COMPILING_IN_LIMITED_API ? 0 : 1 << 5)
727#ifndef Py_TPFLAGS_MAPPING
728 #define Py_TPFLAGS_MAPPING (CYTHON_COMPILING_IN_LIMITED_API ? 0 : 1 << 6)
730#ifndef Py_TPFLAGS_IMMUTABLETYPE
731 #define Py_TPFLAGS_IMMUTABLETYPE (1UL << 8)
733#ifndef Py_TPFLAGS_DISALLOW_INSTANTIATION
734 #define Py_TPFLAGS_DISALLOW_INSTANTIATION (1UL << 7)
736#ifndef METH_STACKLESS
737 #define METH_STACKLESS 0
739#if !defined(METH_FASTCALL) || CYTHON_COMPILING_IN_PYPY
740 #ifndef METH_FASTCALL
741 #define METH_FASTCALL 0x80
743 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *
const *args, Py_ssize_t nargs);
744 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *
const *args,
745 Py_ssize_t nargs, PyObject *kwnames);
747 #if PY_VERSION_HEX >= 0x030d00A4
748 # define __Pyx_PyCFunctionFast PyCFunctionFast
749 # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
751 # define __Pyx_PyCFunctionFast _PyCFunctionFast
752 # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
756 #define __Pyx_METH_FASTCALL METH_FASTCALL
757 #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
758 #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
760 #define __Pyx_METH_FASTCALL METH_VARARGS
761 #define __Pyx_PyCFunction_FastCall PyCFunction
762 #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
765 #define __pyx_vectorcallfunc vectorcallfunc
766 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET
767 #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n))
769 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0
770 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n))
772#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func)
773#define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func)
774#if CYTHON_COMPILING_IN_CPYTHON
775#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth)
776#elif !CYTHON_COMPILING_IN_LIMITED_API
777#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func)
779#if CYTHON_COMPILING_IN_CPYTHON
780#define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags)
781static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) {
782 return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self;
785static CYTHON_INLINE
int __Pyx__IsSameCFunction(PyObject *func,
void (*cfunc)(
void)) {
786#if CYTHON_COMPILING_IN_LIMITED_API
787 return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
789 return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
792#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc)
793#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
794 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b))
796 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b)
798#if CYTHON_COMPILING_IN_PYPY
799 typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *
const *, size_t, PyObject *);
801 #define __Pyx_PyCMethod PyCMethod
804 #define METH_METHOD 0x200
806#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
807 #define PyObject_Malloc(s) PyMem_Malloc(s)
808 #define PyObject_Free(p) PyMem_Free(p)
809 #define PyObject_Realloc(p) PyMem_Realloc(p)
811#if CYTHON_COMPILING_IN_LIMITED_API
812 #define __Pyx_PyFrame_SetLineNumber(frame, lineno)
813#elif CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
814 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
815 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) GraalPyFrame_SetLineNumber((frame), (lineno))
816#elif CYTHON_COMPILING_IN_GRAAL
817 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
818 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) _PyFrame_SetLineNumber((frame), (lineno))
820 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
821 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
823#if CYTHON_COMPILING_IN_LIMITED_API
824 #define __Pyx_PyThreadState_Current PyThreadState_Get()
825#elif !CYTHON_FAST_THREAD_STATE
826 #define __Pyx_PyThreadState_Current PyThreadState_GET()
827#elif PY_VERSION_HEX >= 0x030d00A1
828 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
830 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
832#if CYTHON_OPAQUE_OBJECTS && CYTHON_COMPILING_IN_LIMITED_API
833 #define __PYX_SHARED_SIZEOF(T) -((int)sizeof(T))
834 #define __PYX_SHARED_RELATIVE_OFFSET Py_RELATIVE_OFFSET
835 #define CYTHON_OPAQUE_SHARED_TYPES 1
837 #define __PYX_SHARED_SIZEOF(T) sizeof(T)
838 #define __PYX_SHARED_RELATIVE_OFFSET 0
839 #define CYTHON_OPAQUE_SHARED_TYPES 0
841#if CYTHON_USE_MODULE_STATE
842static CYTHON_INLINE
void *__Pyx__PyModule_GetState(PyObject *op)
845 result = PyModule_GetState(op);
847 Py_FatalError(
"Couldn't find the module state");
850#define __Pyx_PyModule_GetState(o) (__pyx_mstatetype *)__Pyx__PyModule_GetState(o)
852#define __Pyx_PyModule_GetState(op) ((void)op,__pyx_mstate_global)
854#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE((PyObject *) obj), name, func_ctype)
855#define __Pyx_PyObject_TryGetSlot(obj, name, func_ctype) __Pyx_PyType_TryGetSlot(Py_TYPE(obj), name, func_ctype)
856#define __Pyx_PyObject_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
857#define __Pyx_PyObject_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
858#if CYTHON_USE_TYPE_SLOTS
859 #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name)
860 #define __Pyx_PyType_TryGetSlot(type, name, func_ctype) __Pyx_PyType_GetSlot(type, name, func_ctype)
861 #define __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) (((type)->sub) ? ((type)->sub->name) : NULL)
862 #define __Pyx_PyType_TryGetSubSlot(type, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype)
864 #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name))
865 #define __Pyx_PyType_TryGetSlot(type, name, func_ctype)\
866 ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000 ||\
867 (PyType_GetFlags(type) & Py_TPFLAGS_HEAPTYPE) || __Pyx_get_runtime_version() >= 0x030A0000) ?\
868 __Pyx_PyType_GetSlot(type, name, func_ctype) : NULL)
869 #define __Pyx_PyType_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSlot(obj, name, func_ctype)
870 #define __Pyx_PyType_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSlot(obj, name, func_ctype)
872#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
873#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
875#define __Pyx_PyDict_NewPresized(n) PyDict_New()
877#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
878#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
879#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_UNICODE_INTERNALS
880#define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
881static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
882 PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
883 if (res == NULL && PyErr_Occurred()) {
884 PyErr_WriteUnraisable(NULL);
888#elif !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000
889#define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError
890#define __Pyx_PyDict_GetItemStr PyDict_GetItem
892static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
893#if CYTHON_COMPILING_IN_PYPY
894 return PyDict_GetItem(dict, name);
897 PyDictObject *mp = (PyDictObject*) dict;
898 long hash = ((PyStringObject *) name)->ob_shash;
900 ep = (mp->ma_lookup)(mp, name, hash);
907#define __Pyx_PyDict_GetItemStr PyDict_GetItem
909#if CYTHON_USE_TYPE_SLOTS
910 #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags)
911 #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
913 #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp))
914 #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature)
916#define __Pyx_PyObject_GetIterNextFunc(iterator) __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc)
917#if CYTHON_USE_TYPE_SPECS
918#define __Pyx_PyHeapTypeObject_GC_Del(obj) {\
919 PyTypeObject *type = Py_TYPE((PyObject*)obj);\
920 assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
921 PyObject_GC_Del(obj);\
925#define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj)
927#if CYTHON_COMPILING_IN_LIMITED_API
928 #define __Pyx_PyUnicode_READY(op) (0)
929 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
930 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U)
931 #define __Pyx_PyUnicode_KIND(u) ((void)u, (0))
932 #define __Pyx_PyUnicode_KIND_04(u) __Pyx_PyUnicode_KIND(u)
933 #define __Pyx_PyUnicode_DATA(u) ((void*)u)
934 #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
935 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u))
937 #if PY_VERSION_HEX >= 0x030C0000
938 #define __Pyx_PyUnicode_READY(op) (0)
940 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
941 0 : _PyUnicode_Ready((PyObject *)(op)))
943 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
944 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
945 #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u))
946 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
947 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
948 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch)
949 #if PY_VERSION_HEX >= 0x030C0000
950 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
952 #if CYTHON_COMPILING_IN_CPYTHON
953 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
955 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
958 static CYTHON_INLINE
int __Pyx_PyUnicode_KIND_04(PyObject *o) {
959 return __Pyx_PyUnicode_KIND(o) - (int) !!PyUnicode_IS_ASCII(o);
962#if CYTHON_COMPILING_IN_PYPY
963 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
964 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
966 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
967 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
968 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
970#if CYTHON_COMPILING_IN_PYPY
971 #if !defined(PyUnicode_DecodeUnicodeEscape)
972 #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors)
974 #if !defined(PyUnicode_Contains)
975 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
977 #if !defined(PyByteArray_Check)
978 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
980 #if !defined(PyObject_Format)
981 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
984#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
985#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
986 #define __Pyx_PySequence_ListKeepNew(obj)\
987 (likely(PyList_CheckExact(obj) && PyUnstable_Object_IsUniquelyReferenced(obj)) ? __Pyx_NewRef(obj) : PySequence_List(obj))
988#elif CYTHON_COMPILING_IN_CPYTHON
989 #define __Pyx_PySequence_ListKeepNew(obj)\
990 (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
992 #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj)
994#ifndef PySet_CheckExact
995 #define PySet_CheckExact(obj) Py_IS_TYPE(obj, &PySet_Type)
997enum __Pyx_ReferenceSharing {
998 __Pyx_ReferenceSharing_DefinitelyUnique,
999 __Pyx_ReferenceSharing_OwnStrongReference,
1000 __Pyx_ReferenceSharing_FunctionArgument,
1001 __Pyx_ReferenceSharing_SharedReference,
1003#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX >= 0x030E0000
1004#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing)\
1005 (sharing == __Pyx_ReferenceSharing_DefinitelyUnique ? 1 :\
1006 (sharing == __Pyx_ReferenceSharing_FunctionArgument ? PyUnstable_Object_IsUniqueReferencedTemporary(o) :\
1007 (sharing == __Pyx_ReferenceSharing_OwnStrongReference ? PyUnstable_Object_IsUniquelyReferenced(o) : 0)))
1008#elif (CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) || CYTHON_COMPILING_IN_LIMITED_API
1009#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)sharing), Py_REFCNT(o) == 1)
1011#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)o), ((void)sharing), 0)
1013#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
1014 #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
1015#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
1016 #if CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS
1017 #define __Pyx_PyList_GetItemRef(o, i) (likely((i) >= 0) ? PySequence_GetItem(o, i) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1019 #define __Pyx_PyList_GetItemRef(o, i) PySequence_ITEM(o, i)
1021#elif CYTHON_COMPILING_IN_LIMITED_API || !(CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE)
1022 #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i))
1024 #define __Pyx_PyList_GetItemRef(o, i) (likely(__Pyx_is_valid_index(i, PyList_GET_SIZE(o))) ?\
1025 __Pyx_NewRef(PyList_GET_ITEM(o, i)) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1027#if CYTHON_AVOID_BORROWED_REFS || CYTHON_COMPILING_IN_LIMITED_API
1028 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\
1029 __Pyx_PyList_GetItemRef(o, i))
1030#elif CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
1031 #if CYTHON_ASSUME_SAFE_MACROS
1032 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) (\
1033 __Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\
1034 __Pyx_NewRef(PyList_GET_ITEM(o, i)) : __Pyx_PyList_GetItemRef(o, i))
1036 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) (\
1037 __Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\
1038 __Pyx_XNewRef(PyList_GetItem(o, i)) : __Pyx_PyList_GetItemRef(o, i))
1040#elif CYTHON_ASSUME_SAFE_MACROS
1041 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\
1042 __Pyx_NewRef(PyList_GET_ITEM(o, i)))
1044 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\
1045 __Pyx_XNewRef(PyList_GetItem(o, i)))
1047#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
1048#define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result)
1049#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
1050static CYTHON_INLINE
int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
1051 *result = PyObject_GetItem(dict, key);
1052 if (*result == NULL) {
1053 if (PyErr_ExceptionMatches(PyExc_KeyError)) {
1062static CYTHON_INLINE
int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
1063 *result = PyDict_GetItemWithError(dict, key);
1064 if (*result == NULL) {
1065 return PyErr_Occurred() ? -1 : 0;
1071#if defined(CYTHON_DEBUG_VISIT_CONST) && CYTHON_DEBUG_VISIT_CONST
1072 #define __Pyx_VISIT_CONST(obj) Py_VISIT(obj)
1074 #define __Pyx_VISIT_CONST(obj)
1076#if CYTHON_ASSUME_SAFE_MACROS
1077 #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i)
1078 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
1079 #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0))
1080 #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GET_ITEM(o, i)
1081 #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
1082 #define __Pyx_PyList_GET_ITEM(o, i) PyList_GET_ITEM(o, i)
1084 #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i)
1085 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
1086 #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v)
1087 #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GetItem(o, i)
1088 #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
1089 #define __Pyx_PyList_GET_ITEM(o, i) PyList_GetItem(o, i)
1091#if CYTHON_ASSUME_SAFE_SIZE
1092 #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o)
1093 #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o)
1094 #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o)
1095 #define __Pyx_PyDict_GET_SIZE(o) PyDict_GET_SIZE(o)
1096 #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
1097 #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
1098 #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GET_LENGTH(o)
1100 #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o)
1101 #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o)
1102 #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o)
1103 #define __Pyx_PyDict_GET_SIZE(o) PyDict_Size(o)
1104 #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
1105 #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
1106 #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o)
1108#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString)
1109 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
1111#define __Pyx_PyLong_FromHash_t PyLong_FromSsize_t
1112#define __Pyx_PyLong_AsHash_t __Pyx_PyIndex_AsSsize_t
1113#if __PYX_LIMITED_VERSION_HEX >= 0x030A0000
1114 #define __Pyx_PySendResult PySendResult
1120 } __Pyx_PySendResult;
1122#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030A00A3
1123 typedef __Pyx_PySendResult (*__Pyx_pyiter_sendfunc)(PyObject *iter, PyObject *value, PyObject **result);
1125 #define __Pyx_pyiter_sendfunc sendfunc
1127#if !CYTHON_USE_AM_SEND
1128#define __PYX_HAS_PY_AM_SEND 0
1129#elif __PYX_LIMITED_VERSION_HEX >= 0x030A0000
1130#define __PYX_HAS_PY_AM_SEND 1
1132#define __PYX_HAS_PY_AM_SEND 2
1134#if __PYX_HAS_PY_AM_SEND < 2
1135 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
1141 __Pyx_pyiter_sendfunc am_send;
1142 } __Pyx_PyAsyncMethodsStruct;
1143 #define __Pyx_SlotTpAsAsync(s) ((PyAsyncMethods*)(s))
1145#if CYTHON_USE_AM_SEND && PY_VERSION_HEX < 0x030A00F0
1146 #define __Pyx_TPFLAGS_HAVE_AM_SEND (1UL << 21)
1148 #define __Pyx_TPFLAGS_HAVE_AM_SEND (0)
1150#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030A0000
1154PyAPI_FUNC(
void *) PyMem_Calloc(
size_t nelem,
size_t elsize);
1156#if CYTHON_COMPILING_IN_LIMITED_API
1157static int __Pyx_init_co_variable(PyObject *inspect,
const char* name,
int *write_to) {
1159 PyObject *py_value = PyObject_GetAttrString(inspect, name);
1160 if (!py_value)
return 0;
1161 value = (int) PyLong_AsLong(py_value);
1162 Py_DECREF(py_value);
1164 return value != -1 || !PyErr_Occurred();
1166static int __Pyx_init_co_variables(
void) {
1169 inspect = PyImport_ImportModule(
"inspect");
1171#if !defined(CO_OPTIMIZED)
1172 __Pyx_init_co_variable(inspect,
"CO_OPTIMIZED", &CO_OPTIMIZED) &&
1174#if !defined(CO_NEWLOCALS)
1175 __Pyx_init_co_variable(inspect,
"CO_NEWLOCALS", &CO_NEWLOCALS) &&
1177#if !defined(CO_VARARGS)
1178 __Pyx_init_co_variable(inspect,
"CO_VARARGS", &CO_VARARGS) &&
1180#if !defined(CO_VARKEYWORDS)
1181 __Pyx_init_co_variable(inspect,
"CO_VARKEYWORDS", &CO_VARKEYWORDS) &&
1183#if !defined(CO_ASYNC_GENERATOR)
1184 __Pyx_init_co_variable(inspect,
"CO_ASYNC_GENERATOR", &CO_ASYNC_GENERATOR) &&
1186#if !defined(CO_GENERATOR)
1187 __Pyx_init_co_variable(inspect,
"CO_GENERATOR", &CO_GENERATOR) &&
1189#if !defined(CO_COROUTINE)
1190 __Pyx_init_co_variable(inspect,
"CO_COROUTINE", &CO_COROUTINE) &&
1194 return result ? 0 : -1;
1196static int __Pyx_init_tpflags_bitcount(
unsigned long flag) {
1199 count += (int) (flag & 1);
1204static int __Pyx_init_tpflags_variables(
void) {
1205 if (__Pyx_Runtime_TPFLAGS_SEQUENCE != 0 && __Pyx_Runtime_TPFLAGS_MAPPING != 0) {
1208 PyObject *collections_abc = PyImport_ImportModule(
"collections.abc");
1209 if (!collections_abc)
return -1;
1211 PyObject *sequence = NULL, *mapping = NULL;
1212#if __PYX_LIMITED_VERSION_HEX >= 0x030D0000
1213 if (PyObject_GetOptionalAttrString(collections_abc,
"Sequence", &sequence) != 1)
goto fail;
1214 if (PyObject_GetOptionalAttrString(collections_abc,
"Mapping", &mapping) != 1)
goto fail;
1216 sequence = PyObject_GetAttrString(collections_abc,
"Sequence");
1217 if (!sequence)
goto fail_attr_lookup;
1218 mapping = PyObject_GetAttrString(collections_abc,
"Mapping");
1219 if (!mapping)
goto fail_attr_lookup;
1221 if (!PyType_Check(sequence) || !PyType_Check(mapping))
goto fail;
1223 unsigned long sequence_flags = PyType_GetFlags((PyTypeObject*)sequence);
1224 unsigned long mapping_flags = PyType_GetFlags((PyTypeObject*)mapping);
1225 unsigned long mutual_flags = sequence_flags & mapping_flags;
1226 sequence_flags = sequence_flags ^ mutual_flags;
1227 mapping_flags = mapping_flags ^ mutual_flags;
1228 if (__Pyx_Runtime_TPFLAGS_SEQUENCE == 0 && __Pyx_init_tpflags_bitcount(sequence_flags) == 1) {
1229 __Pyx_Runtime_TPFLAGS_SEQUENCE = sequence_flags;
1231 if (__Pyx_Runtime_TPFLAGS_MAPPING == 0 && __Pyx_init_tpflags_bitcount(mapping_flags) == 1) {
1232 __Pyx_Runtime_TPFLAGS_MAPPING = mapping_flags;
1236 Py_XDECREF(mapping);
1237 Py_XDECREF(sequence);
1238 Py_DECREF(collections_abc);
1240#if __PYX_LIMITED_VERSION_HEX < 0x030D0000
1242 if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
1247 result = PyErr_Occurred() ? -1 : 0;
1251static int __Pyx_init_co_variables(
void) {
1254static int __Pyx_init_tpflags_variables(
void) {
1260#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
1261 #ifndef _USE_MATH_DEFINES
1262 #define _USE_MATH_DEFINES
1266#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
1267#define __Pyx_truncl trunc
1269#define __Pyx_truncl truncl
1272#ifndef CYTHON_CLINE_IN_TRACEBACK_RUNTIME
1273#define CYTHON_CLINE_IN_TRACEBACK_RUNTIME 1
1275#ifndef CYTHON_CLINE_IN_TRACEBACK
1276#define CYTHON_CLINE_IN_TRACEBACK CYTHON_CLINE_IN_TRACEBACK_RUNTIME
1278#if CYTHON_CLINE_IN_TRACEBACK
1279#define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; __pyx_clineno = __LINE__; (void) __pyx_clineno; }
1281#define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; (void) __pyx_clineno; }
1283#define __PYX_ERR(f_index, lineno, Ln_error) \
1284 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
1286#ifdef CYTHON_EXTERN_C
1287 #undef __PYX_EXTERN_C
1288 #define __PYX_EXTERN_C CYTHON_EXTERN_C
1289#elif defined(__PYX_EXTERN_C)
1291 #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.")
1293 #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.
1296 #define __PYX_EXTERN_C extern "C++"
1299#define __PYX_HAVE__fenton__Fenton
1300#define __PYX_HAVE_API__fenton__Fenton
1307#include "numpy/arrayobject.h"
1308#include "numpy/ndarrayobject.h"
1309#include "numpy/ndarraytypes.h"
1310#include "numpy/arrayscalars.h"
1311#include "numpy/ufuncobject.h"
1317#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
1318#define CYTHON_WITHOUT_ASSERTIONS
1321#ifdef CYTHON_FREETHREADING_COMPATIBLE
1322#if CYTHON_FREETHREADING_COMPATIBLE
1323#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_NOT_USED
1325#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
1328#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
1330#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
1331#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
1332#define __PYX_DEFAULT_STRING_ENCODING ""
1333#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
1334#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
1335#define __Pyx_uchar_cast(c) ((unsigned char)c)
1336#define __Pyx_long_cast(x) ((long)x)
1337#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
1338 (sizeof(type) < sizeof(Py_ssize_t)) ||\
1339 (sizeof(type) > sizeof(Py_ssize_t) &&\
1340 likely(v < (type)PY_SSIZE_T_MAX ||\
1341 v == (type)PY_SSIZE_T_MAX) &&\
1342 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
1343 v == (type)PY_SSIZE_T_MIN))) ||\
1344 (sizeof(type) == sizeof(Py_ssize_t) &&\
1345 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
1346 v == (type)PY_SSIZE_T_MAX))) )
1347static CYTHON_INLINE
int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
1348 return (
size_t) i < (size_t) limit;
1350#if defined (__cplusplus) && __cplusplus >= 201103L
1352 #define __Pyx_sst_abs(value) std::abs(value)
1353#elif SIZEOF_INT >= SIZEOF_SIZE_T
1354 #define __Pyx_sst_abs(value) abs(value)
1355#elif SIZEOF_LONG >= SIZEOF_SIZE_T
1356 #define __Pyx_sst_abs(value) labs(value)
1357#elif defined (_MSC_VER)
1358 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
1359#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
1360 #define __Pyx_sst_abs(value) llabs(value)
1361#elif defined (__GNUC__)
1362 #define __Pyx_sst_abs(value) __builtin_llabs(value)
1364 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
1366static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(
const char *
s);
1367static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
1368static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
1369static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(
const char*);
1370#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
1371#define __Pyx_PyBytes_FromString PyBytes_FromString
1372#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
1373static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
1374#if CYTHON_ASSUME_SAFE_MACROS
1375 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
1376 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
1377 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
1378 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
1379 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
1380 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
1381 #define __Pyx_PyByteArray_AsString(s) PyByteArray_AS_STRING(s)
1383 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AsString(s))
1384 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AsString(s))
1385 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AsString(s))
1386 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AsString(s))
1387 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AsString(s))
1388 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AsString(s))
1389 #define __Pyx_PyByteArray_AsString(s) PyByteArray_AsString(s)
1391#define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1392#define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1393#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1394#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
1395#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
1396#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
1397#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
1398#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
1399#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
1400#define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o)
1401#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
1402static CYTHON_INLINE PyObject *__Pyx_NewRef(PyObject *obj) {
1403#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_NewRef)
1404 return Py_NewRef(obj);
1410static CYTHON_INLINE PyObject *__Pyx_XNewRef(PyObject *obj) {
1411#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_XNewRef)
1412 return Py_XNewRef(obj);
1418static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(
int b);
1419static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
1420static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
1421static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
1422static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x);
1423#define __Pyx_PyObject_RichCompareBool(a,b,cmp) __Pyx_PyObject_IsTrueAndDecref(PyObject_RichCompare((a),(b),(cmp)))
1424#define __Pyx_PySequence_Tuple(obj)\
1425 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
1426static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
1427static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(
size_t);
1428static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
1429#if CYTHON_ASSUME_SAFE_MACROS
1430#define __Pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
1431#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AS_DOUBLE(x)
1432#define __Pyx_PyFloat_IsNonZero(x) (PyFloat_AS_DOUBLE(x) != 0.0)
1434#define __Pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
1435#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AsDouble(x)
1436#define __Pyx_PyFloat_IsNonZero(x) PyObject_IsTrue(x)
1438#define __Pyx_PyFloat_AsFloat(x) ((float) __Pyx_PyFloat_AsDouble(x))
1439#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
1440#if CYTHON_USE_PYLONG_INTERNALS
1441 #if PY_VERSION_HEX >= 0x030C00A7
1442 #ifndef _PyLong_SIGN_MASK
1443 #define _PyLong_SIGN_MASK 3
1445 #ifndef _PyLong_NON_SIZE_BITS
1446 #define _PyLong_NON_SIZE_BITS 3
1448 #define __Pyx_PyLong_SignBits(x) ((int) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK))
1449 #define __Pyx_PyLong_Sign(x) (1 - __Pyx_PyLong_SignBits(x))
1450 #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_SignBits(x) & 2) != 0)
1451 #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x))
1452 #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_SignBits(x) & 1)
1453 #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_SignBits(x) == 0)
1454 #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0])
1455 #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
1456 #define __Pyx_PyLong_SignedDigitCount(x)\
1457 (((Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
1458 #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
1459 #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x)
1460 #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x)
1462 #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
1463 #define __Pyx_PyLong_CompactValue(x) (((Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
1465 static CYTHON_INLINE Py_ssize_t __Pyx_PyLong_CompareSignAndSize(PyObject *a, PyObject *b) {
1466 uintptr_t tag_a = ((PyLongObject*)a)->long_value.lv_tag;
1467 uintptr_t tag_b = ((PyLongObject*)b)->long_value.lv_tag;
1468 if (tag_a == tag_b)
return 0;
1469 int sign_a = (int) (tag_a & _PyLong_SIGN_MASK);
1470 int sign_b = (int) (tag_b & _PyLong_SIGN_MASK);
1471 if (sign_a > sign_b)
return -1;
1472 if (sign_a < sign_b)
return 1;
1473 Py_ssize_t size_a = (Py_ssize_t) (tag_a >> _PyLong_NON_SIZE_BITS);
1474 Py_ssize_t size_b = (Py_ssize_t) (tag_b >> _PyLong_NON_SIZE_BITS);
1475 return (1 - sign_a) * (size_a - size_b);
1477 typedef Py_ssize_t __Pyx_compact_pylong;
1478 typedef size_t __Pyx_compact_upylong;
1480 #define __Pyx_PyLong_Sign(x) ((int) ((Py_SIZE(x) == 0) ? 0 : (Py_SIZE(x) < 0) ? -1 : 1))
1481 #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0)
1482 #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0)
1483 #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0)
1484 #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0)
1485 #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
1486 #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x))
1487 #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x)
1488 #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
1489 #define __Pyx_PyLong_CompactValue(x)\
1490 ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
1491 #define __Pyx_PyLong_CompareSignAndSize(a, b) (Py_SIZE(a) - Py_SIZE(b))
1492 typedef sdigit __Pyx_compact_pylong;
1493 typedef digit __Pyx_compact_upylong;
1495 #if PY_VERSION_HEX >= 0x030C00A5
1496 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit)
1498 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit)
1500 #define __Pyx_PyLong_IsNonZero(x) (!__Pyx_PyLong_IsZero(x))
1502 #define __Pyx_PyLong_IsNonZero(x) PyObject_IsTrue(x)
1504#if __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
1505 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
1506#elif __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1507 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeASCII(c_str, size, NULL)
1509 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
1514#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
1515 #define likely(x) __builtin_expect(!!(x), 1)
1516 #define unlikely(x) __builtin_expect(!!(x), 0)
1518 #define likely(x) (x)
1519 #define unlikely(x) (x)
1523#if __cplusplus > 201103L
1524#include <type_traits>
1526template <
typename T>
1527static void __Pyx_pretend_to_initialize(
T* ptr) {
1528#if __cplusplus > 201103L
1529 if ((std::is_trivially_default_constructible<T>::value))
1535static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
1539#if !CYTHON_USE_MODULE_STATE
1540static PyObject *__pyx_m = NULL;
1542static const char *
const __pyx_cfilenm = __FILE__;
1545#if !defined(CYTHON_CCOMPLEX)
1546 #if defined(__cplusplus)
1547 #define CYTHON_CCOMPLEX 1
1548 #elif (defined(_Complex_I) && !defined(_MSC_VER)) || ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_COMPLEX__) && !defined(_MSC_VER))
1549 #define CYTHON_CCOMPLEX 1
1551 #define CYTHON_CCOMPLEX 0
1558 #include <complex.h>
1561#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
1563 #define _Complex_I 1.0fj
1568static const char*
const __pyx_f[] = {
1569 "proteus/fenton/Fenton.pyx",
1570 "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd",
1575#include <pythread.h>
1576#ifndef CYTHON_ATOMICS
1577 #define CYTHON_ATOMICS 1
1579#define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
1580#define __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
1581#define __pyx_atomic_int_type int
1582#define __pyx_nonatomic_int_type int
1583#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
1584 (__STDC_VERSION__ >= 201112L) &&\
1585 !defined(__STDC_NO_ATOMICS__))
1586 #include <stdatomic.h>
1587#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
1588 (__cplusplus >= 201103L) ||\
1589 (defined(_MSC_VER) && _MSC_VER >= 1700)))
1592#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
1593 (__STDC_VERSION__ >= 201112L) &&\
1594 !defined(__STDC_NO_ATOMICS__) &&\
1595 ATOMIC_INT_LOCK_FREE == 2)
1596 #undef __pyx_atomic_int_type
1597 #define __pyx_atomic_int_type atomic_int
1598 #define __pyx_atomic_ptr_type atomic_uintptr_t
1599 #define __pyx_nonatomic_ptr_type uintptr_t
1600 #define __pyx_atomic_incr_relaxed(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed)
1601 #define __pyx_atomic_incr_acq_rel(value) atomic_fetch_add_explicit(value, 1, memory_order_acq_rel)
1602 #define __pyx_atomic_decr_acq_rel(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel)
1603 #define __pyx_atomic_sub(value, arg) atomic_fetch_sub(value, arg)
1604 #define __pyx_atomic_int_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
1605 #define __pyx_atomic_load(value) atomic_load(value)
1606 #define __pyx_atomic_store(value, new_value) atomic_store(value, new_value)
1607 #define __pyx_atomic_pointer_load_relaxed(value) atomic_load_explicit(value, memory_order_relaxed)
1608 #define __pyx_atomic_pointer_load_acquire(value) atomic_load_explicit(value, memory_order_acquire)
1609 #define __pyx_atomic_pointer_exchange(value, new_value) atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
1610 #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
1611 #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
1612 #pragma message ("Using standard C atomics")
1613 #elif defined(__PYX_DEBUG_ATOMICS)
1614 #warning "Using standard C atomics"
1616#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
1617 (__cplusplus >= 201103L) ||\
1619 (defined(_MSC_VER) && _MSC_VER >= 1700)) &&\
1620 ATOMIC_INT_LOCK_FREE == 2)
1621 #undef __pyx_atomic_int_type
1622 #define __pyx_atomic_int_type std::atomic_int
1623 #define __pyx_atomic_ptr_type std::atomic_uintptr_t
1624 #define __pyx_nonatomic_ptr_type uintptr_t
1625 #define __pyx_atomic_incr_relaxed(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed)
1626 #define __pyx_atomic_incr_acq_rel(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_acq_rel)
1627 #define __pyx_atomic_decr_acq_rel(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel)
1628 #define __pyx_atomic_sub(value, arg) std::atomic_fetch_sub(value, arg)
1629 #define __pyx_atomic_int_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
1630 #define __pyx_atomic_load(value) std::atomic_load(value)
1631 #define __pyx_atomic_store(value, new_value) std::atomic_store(value, new_value)
1632 #define __pyx_atomic_pointer_load_relaxed(value) std::atomic_load_explicit(value, std::memory_order_relaxed)
1633 #define __pyx_atomic_pointer_load_acquire(value) std::atomic_load_explicit(value, std::memory_order_acquire)
1634 #define __pyx_atomic_pointer_exchange(value, new_value) std::atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
1635 #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
1636 #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
1637 #pragma message ("Using standard C++ atomics")
1638 #elif defined(__PYX_DEBUG_ATOMICS)
1639 #warning "Using standard C++ atomics"
1641#elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
1642 (__GNUC_MINOR__ > 1 ||\
1643 (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
1644 #define __pyx_atomic_ptr_type void*
1645 #define __pyx_nonatomic_ptr_type void*
1646 #define __pyx_atomic_incr_relaxed(value) __sync_fetch_and_add(value, 1)
1647 #define __pyx_atomic_incr_acq_rel(value) __sync_fetch_and_add(value, 1)
1648 #define __pyx_atomic_decr_acq_rel(value) __sync_fetch_and_sub(value, 1)
1649 #define __pyx_atomic_sub(value, arg) __sync_fetch_and_sub(value, arg)
1650 static CYTHON_INLINE
int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
1651 __pyx_nonatomic_int_type old = __sync_val_compare_and_swap(value, *expected, desired);
1652 int result = old == *expected;
1656 #define __pyx_atomic_load(value) __sync_fetch_and_add(value, 0)
1657 #define __pyx_atomic_store(value, new_value) __sync_lock_test_and_set(value, new_value)
1658 #define __pyx_atomic_pointer_load_relaxed(value) __sync_fetch_and_add(value, 0)
1659 #define __pyx_atomic_pointer_load_acquire(value) __sync_fetch_and_add(value, 0)
1660 #define __pyx_atomic_pointer_exchange(value, new_value) __sync_lock_test_and_set(value, (__pyx_atomic_ptr_type)new_value)
1661 static CYTHON_INLINE
int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
1662 __pyx_nonatomic_ptr_type old = __sync_val_compare_and_swap(value, *expected, desired);
1663 int result = old == *expected;
1667 #ifdef __PYX_DEBUG_ATOMICS
1668 #warning "Using GNU atomics"
1670#elif CYTHON_ATOMICS && defined(_MSC_VER)
1672 #undef __pyx_atomic_int_type
1673 #define __pyx_atomic_int_type long
1674 #define __pyx_atomic_ptr_type void*
1675 #undef __pyx_nonatomic_int_type
1676 #define __pyx_nonatomic_int_type long
1677 #define __pyx_nonatomic_ptr_type void*
1678 #pragma intrinsic (_InterlockedExchangeAdd, _InterlockedExchange, _InterlockedCompareExchange, _InterlockedCompareExchangePointer, _InterlockedExchangePointer)
1679 #define __pyx_atomic_incr_relaxed(value) _InterlockedExchangeAdd(value, 1)
1680 #define __pyx_atomic_incr_acq_rel(value) _InterlockedExchangeAdd(value, 1)
1681 #define __pyx_atomic_decr_acq_rel(value) _InterlockedExchangeAdd(value, -1)
1682 #define __pyx_atomic_sub(value, arg) _InterlockedExchangeAdd(value, -arg)
1683 static CYTHON_INLINE
int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
1684 __pyx_nonatomic_int_type old = _InterlockedCompareExchange(value, desired, *expected);
1685 int result = old == *expected;
1689 #define __pyx_atomic_load(value) _InterlockedExchangeAdd(value, 0)
1690 #define __pyx_atomic_store(value, new_value) _InterlockedExchange(value, new_value)
1691 #define __pyx_atomic_pointer_load_relaxed(value) *(void * volatile *)value
1692 #define __pyx_atomic_pointer_load_acquire(value) _InterlockedCompareExchangePointer(value, 0, 0)
1693 #define __pyx_atomic_pointer_exchange(value, new_value) _InterlockedExchangePointer(value, (__pyx_atomic_ptr_type)new_value)
1694 static CYTHON_INLINE
int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
1695 __pyx_atomic_ptr_type old = _InterlockedCompareExchangePointer(value, desired, *expected);
1696 int result = old == *expected;
1700 #ifdef __PYX_DEBUG_ATOMICS
1701 #pragma message ("Using MSVC atomics")
1704 #undef CYTHON_ATOMICS
1705 #define CYTHON_ATOMICS 0
1706 #ifdef __PYX_DEBUG_ATOMICS
1707 #warning "Not using atomics"
1712#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
1713#define __Pyx_PyCriticalSection void*
1714#define __Pyx_PyCriticalSection2 void*
1715#define __Pyx_PyCriticalSection_End(cs)
1716#define __Pyx_PyCriticalSection2_End(cs)
1718#define __Pyx_PyCriticalSection PyCriticalSection
1719#define __Pyx_PyCriticalSection2 PyCriticalSection2
1720#define __Pyx_PyCriticalSection_End PyCriticalSection_End
1721#define __Pyx_PyCriticalSection2_End PyCriticalSection2_End
1725#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
1726#define __Pyx_PyCriticalSection_Begin(cs, arg) (void)(cs)
1727#define __Pyx_PyCriticalSection2_Begin(cs, arg1, arg2) (void)(cs)
1729#define __Pyx_PyCriticalSection_Begin PyCriticalSection_Begin
1730#define __Pyx_PyCriticalSection2_Begin PyCriticalSection2_Begin
1732#if PY_VERSION_HEX < 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
1733#define __Pyx_BEGIN_CRITICAL_SECTION(o) {
1734#define __Pyx_END_CRITICAL_SECTION() }
1736#define __Pyx_BEGIN_CRITICAL_SECTION Py_BEGIN_CRITICAL_SECTION
1737#define __Pyx_END_CRITICAL_SECTION Py_END_CRITICAL_SECTION
1741#include <structmember.h>
1752typedef npy_int8 __pyx_t_5numpy_int8_t;
1761typedef npy_int16 __pyx_t_5numpy_int16_t;
1770typedef npy_int32 __pyx_t_5numpy_int32_t;
1779typedef npy_int64 __pyx_t_5numpy_int64_t;
1788typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1797typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1806typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1815typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1824typedef npy_float32 __pyx_t_5numpy_float32_t;
1833typedef npy_float64 __pyx_t_5numpy_float64_t;
1842typedef npy_longlong __pyx_t_5numpy_longlong_t;
1851typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1860typedef npy_intp __pyx_t_5numpy_intp_t;
1869typedef npy_uintp __pyx_t_5numpy_uintp_t;
1878typedef npy_double __pyx_t_5numpy_float_t;
1887typedef npy_double __pyx_t_5numpy_double_t;
1896typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1899#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1901 typedef ::std::complex< float > __pyx_t_float_complex;
1903 typedef float _Complex __pyx_t_float_complex;
1906 typedef struct {
float real, imag; } __pyx_t_float_complex;
1908static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float,
float);
1911#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1913 typedef ::std::complex< double > __pyx_t_double_complex;
1915 typedef double _Complex __pyx_t_double_complex;
1918 typedef struct {
double real, imag; } __pyx_t_double_complex;
1920static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double,
double);
1923#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1925 typedef ::std::complex< long double > __pyx_t_long_double_complex;
1927 typedef long double _Complex __pyx_t_long_double_complex;
1930 typedef struct {
long double real, imag; } __pyx_t_long_double_complex;
1932static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(
long double,
long double);
1941#ifndef CYTHON_REFNANNY
1942 #define CYTHON_REFNANNY 0
1946 void (*INCREF)(
void*, PyObject*, Py_ssize_t);
1947 void (*DECREF)(
void*, PyObject*, Py_ssize_t);
1948 void (*GOTREF)(
void*, PyObject*, Py_ssize_t);
1949 void (*GIVEREF)(
void*, PyObject*, Py_ssize_t);
1950 void* (*SetupContext)(
const char*, Py_ssize_t,
const char*);
1951 void (*FinishContext)(
void**);
1952 } __Pyx_RefNannyAPIStruct;
1953 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1954 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1955 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1956 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1958 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1959 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
1960 PyGILState_Release(__pyx_gilstate_save);\
1962 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
1964 #define __Pyx_RefNannyFinishContextNogil() {\
1965 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1966 __Pyx_RefNannyFinishContext();\
1967 PyGILState_Release(__pyx_gilstate_save);\
1969 #define __Pyx_RefNannyFinishContextNogil() {\
1970 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1971 __Pyx_RefNannyFinishContext();\
1972 PyGILState_Release(__pyx_gilstate_save);\
1974 #define __Pyx_RefNannyFinishContext()\
1975 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1976 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
1977 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
1978 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
1979 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
1980 #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0)
1981 #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0)
1982 #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0)
1983 #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0)
1985 #define __Pyx_RefNannyDeclarations
1986 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1987 #define __Pyx_RefNannyFinishContextNogil()
1988 #define __Pyx_RefNannyFinishContext()
1989 #define __Pyx_INCREF(r) Py_INCREF(r)
1990 #define __Pyx_DECREF(r) Py_DECREF(r)
1991 #define __Pyx_GOTREF(r)
1992 #define __Pyx_GIVEREF(r)
1993 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1994 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1995 #define __Pyx_XGOTREF(r)
1996 #define __Pyx_XGIVEREF(r)
1998#define __Pyx_Py_XDECREF_SET(r, v) do {\
1999 PyObject *tmp = (PyObject *) r;\
2000 r = v; Py_XDECREF(tmp);\
2002#define __Pyx_XDECREF_SET(r, v) do {\
2003 PyObject *tmp = (PyObject *) r;\
2004 r = v; __Pyx_XDECREF(tmp);\
2006#define __Pyx_DECREF_SET(r, v) do {\
2007 PyObject *tmp = (PyObject *) r;\
2008 r = v; __Pyx_DECREF(tmp);\
2010#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
2011#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
2014#if CYTHON_COMPILING_IN_CPYTHON
2015#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2016#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2)
2017static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2018static CYTHON_INLINE
int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b);
2019#define __Pyx_PyAnySet_Check(obj) __Pyx_TypeCheck2(obj, &PySet_Type, &PyFrozenSet_Type)
2021#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2022#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2))
2023#define __Pyx_PyAnySet_Check(obj) PyAnySet_Check(obj)
2027#if CYTHON_FAST_THREAD_STATE
2028#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
2029#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
2030#if PY_VERSION_HEX >= 0x030C00A6
2031#define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL)
2032#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL)
2034#define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL)
2035#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type)
2038#define __Pyx_PyThreadState_declare
2039#define __Pyx_PyThreadState_assign
2040#define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL)
2041#define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred()
2045#if CYTHON_FAST_THREAD_STATE
2046#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
2047#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
2048#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
2049#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
2050#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
2051static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2052static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2053#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6
2054#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
2056#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2059#define __Pyx_PyErr_Clear() PyErr_Clear()
2060#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2061#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
2062#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
2063#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
2064#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
2065#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
2066#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
2070#if CYTHON_COMPILING_IN_CPYTHON
2071static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2072static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2074#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2075static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2) {
2076 return PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2);
2079#define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
2082#if CYTHON_FAST_THREAD_STATE
2083#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
2084static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
2086#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
2090#if CYTHON_USE_TYPE_SLOTS
2091static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
2093#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
2097static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2100static PyObject *__Pyx_GetBuiltinName(PyObject *name);
2103#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
2104static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
2108#if CYTHON_FAST_THREAD_STATE
2109#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
2110static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2111#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
2112static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2114#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
2115#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
2119#define __Pyx_PyExc_Exception_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2122#if CYTHON_FAST_THREAD_STATE
2123#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
2124static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2126static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2130#define __Pyx_PyExc_ImportError_Check(obj) __Pyx_TypeCheck(obj, PyExc_ImportError)
2133#if CYTHON_COMPILING_IN_CPYTHON
2134static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
2136#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
2140#if CYTHON_COMPILING_IN_CPYTHON
2141static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
2145#define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL)
2146static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *
const*args,
size_t nargsf, PyObject *kwargs);
2149static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
2152#if CYTHON_COMPILING_IN_CPYTHON
2153static CYTHON_INLINE
void __Pyx_copy_object_array(PyObject *
const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length);
2157#if PY_VERSION_HEX >= 0x030F0000 && !CYTHON_COMPILING_IN_LIMITED_API
2158#define __Pyx_PyTuple_FromArray(src, n) PyTuple_FromArray(src, ((n)<0) ? 0 : (n))
2160CYTHON_UNUSED
static PyObject *
2161__Pyx_PyTuple_FromArray(PyObject *
const *src, Py_ssize_t
n);
2171static CYTHON_INLINE
int __Pyx_PyObject_CompareBoolEq_str_str(PyObject *op1, PyObject *op2,
int pyop);
2174#define __Pyx_PyUnicode_Equals(s1, s2) __Pyx_PyObject_CompareBoolEq_str_str(s1, s2, Py_EQ)
2177#if CYTHON_AVOID_BORROWED_REFS
2178 #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_PySequence_ITEM(args, i)
2179#elif CYTHON_ASSUME_SAFE_MACROS
2180 #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(args, i))
2182 #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_XNewRef(PyTuple_GetItem(args, i))
2184#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
2185#define __Pyx_KwValues_VARARGS(args, nargs) NULL
2186#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s)
2187#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw)
2188#if CYTHON_VECTORCALL
2189 #define __Pyx_ArgRef_FASTCALL(args, i) __Pyx_NewRef(args[i])
2190 #define __Pyx_NumKwargs_FASTCALL(kwds) __Pyx_PyTuple_GET_SIZE(kwds)
2191 #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
2192 static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *
const *kwvalues, PyObject *
s);
2193 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL
2194 CYTHON_UNUSED
static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *
const *kwvalues);
2196 #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
2199 #define __Pyx_ArgRef_FASTCALL __Pyx_ArgRef_VARARGS
2200 #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
2201 #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS
2202 #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS
2203 #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS
2205#if CYTHON_VECTORCALL_TPNEW
2206 #if !CYTHON_VECTORCALL
2207 #error Enabling CYTHON_VECTORCALL_TPNEW without CYTHON_VECTORCALL is not supported
2209 #define __Pyx_ArgRef_FASTCALL_TPNEW __Pyx_ArgRef_FASTCALL
2210 #define __Pyx_NumKwargs_FASTCALL_TPNEW __Pyx_NumKwargs_FASTCALL
2211 #define __Pyx_KwValues_FASTCALL_TPNEW __Pyx_KwValues_FASTCALL
2212 #define __Pyx_GetKwValue_FASTCALL_TPNEW __Pyx_GetKwValue_FASTCALL
2213 #define __Pyx_KwargsAsDict_FASTCALL_TPNEW __Pyx_KwargsAsDict_FASTCALL
2215 #define __Pyx_ArgRef_FASTCALL_TPNEW __Pyx_ArgRef_VARARGS
2216 #define __Pyx_NumKwargs_FASTCALL_TPNEW __Pyx_NumKwargs_VARARGS
2217 #define __Pyx_KwValues_FASTCALL_TPNEW __Pyx_KwValues_VARARGS
2218 #define __Pyx_GetKwValue_FASTCALL_TPNEW __Pyx_GetKwValue_VARARGS
2219 #define __Pyx_KwargsAsDict_FASTCALL_TPNEW __Pyx_KwargsAsDict_VARARGS
2221#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
2222#if CYTHON_VECTORCALL
2223#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(args + start, stop - start)
2225#define __Pyx_ArgsSlice_FASTCALL __Pyx_ArgsSlice_VARARGS
2229#define __Pyx_PyDict_items_TypePtr (&PyDictKeys_Type)
2230#define __Pyx_PyDict_items_Check(obj) PyObject_TypeCheck((obj), __Pyx_PyDictItems_TypePtr)
2231#define __Pyx_PyDict_items_CheckExact(obj) Py_IS_TYPE((obj), __Pyx_PyDictItems_TypePtr)
2232static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d);
2235#define __Pyx_CallCFunction(cfunc, self, args)\
2236 ((PyCFunction)(void(*)(void))(cfunc)->func)(self, args)
2237#define __Pyx_CallCFunctionWithKeywords(cfunc, self, args, kwargs)\
2238 ((PyCFunctionWithKeywords)(void(*)(void))(cfunc)->func)(self, args, kwargs)
2239#define __Pyx_CallCFunctionFast(cfunc, self, args, nargs)\
2240 ((__Pyx_PyCFunctionFast)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs)
2241#define __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, nargs, kwnames)\
2242 ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs, kwnames)
2245static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
2250 PyObject **method_name;
2254#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && CYTHON_ATOMICS
2255 __pyx_atomic_int_type initialized;
2257} __Pyx_CachedCFunction;
2260static CYTHON_INLINE
int __Pyx_IgnoreGivenException(PyObject *given_exception, PyObject *ignorable_exception);
2261#define __Pyx_IgnoreException(ignorable_exception) __Pyx_IgnoreGivenException(NULL, ignorable_exception)
2264static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target);
2267#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
2268static CYTHON_INLINE
int __Pyx_CachedCFunction_GetAndSetInitializing(__Pyx_CachedCFunction *cfunc) {
2272 __pyx_nonatomic_int_type expected = 0;
2273 if (__pyx_atomic_int_cmp_exchange(&cfunc->initialized, &expected, 1)) {
2279static CYTHON_INLINE
void __Pyx_CachedCFunction_SetFinishedInitializing(__Pyx_CachedCFunction *cfunc) {
2281 __pyx_atomic_store(&cfunc->initialized, 2);
2285#define __Pyx_CachedCFunction_GetAndSetInitializing(cfunc) 2
2286#define __Pyx_CachedCFunction_SetFinishedInitializing(cfunc)
2291static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
2292#if CYTHON_COMPILING_IN_CPYTHON
2293static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
2295#define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self)
2299#define __Pyx_PyDict_values_TypePtr (&PyDictKeys_Type)
2300#define __Pyx_PyDict_values_Check(obj) PyObject_TypeCheck((obj), __Pyx_PyDictValues_TypePtr)
2301#define __Pyx_PyDict_values_CheckExact(obj) Py_IS_TYPE((obj), __Pyx_PyDictValues_TypePtr)
2302static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d);
2305#if CYTHON_AVOID_BORROWED_REFS
2306static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue);
2309static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue);
2313static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
2316static int __Pyx_ParseKeywordsTuple(
2318 PyObject *
const *kwvalues,
2319 PyObject **
const argnames[],
2322 Py_ssize_t num_pos_args,
2323 Py_ssize_t num_kwargs,
2324 const char* function_name,
2325 int ignore_unknown_kwargs
2327static int __Pyx_ParseKeywordDictToDict(
2329 PyObject **
const argnames[],
2332 Py_ssize_t num_pos_args,
2333 const char* function_name
2335static int __Pyx_ParseKeywordDict(
2337 PyObject **
const argnames[],
2339 Py_ssize_t num_pos_args,
2340 Py_ssize_t num_kwargs,
2341 const char* function_name,
2342 int ignore_unknown_kwargs
2347static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2);
2348#if CYTHON_COMPILING_IN_CPYTHON
2349static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2);
2351#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2)
2355static CYTHON_INLINE
int __Pyx_ParseKeywords(
2356 PyObject *kwds, PyObject *
const *kwvalues, PyObject **
const argnames[],
2357 PyObject *kwds2, PyObject *values[],
2358 Py_ssize_t num_pos_args, Py_ssize_t num_kwargs,
2359 const char* function_name,
2360 int ignore_unknown_kwargs
2364static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
2365 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
2368#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000
2369 static int __pyx_assertions_enabled_flag;
2370 #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag)
2371 #if __clang__ || __GNUC__
2372 __attribute__((no_sanitize(
"thread")))
2374 static int __Pyx_init_assertions_enabled(
void) {
2375 PyObject *builtins, *debug, *debug_str;
2377 builtins = PyEval_GetBuiltins();
2378 if (!builtins)
goto bad;
2379 debug_str = PyUnicode_FromStringAndSize(
"__debug__", 9);
2380 if (!debug_str)
goto bad;
2381 debug = PyObject_GetItem(builtins, debug_str);
2382 Py_DECREF(debug_str);
2383 if (!debug)
goto bad;
2384 flag = PyObject_IsTrue(debug);
2386 if (flag == -1)
goto bad;
2387 __pyx_assertions_enabled_flag = flag;
2390 __pyx_assertions_enabled_flag = 1;
2394 #define __Pyx_init_assertions_enabled() (0)
2395 #define __pyx_assertions_enabled() (!Py_OptimizeFlag)
2399#define __Pyx_PyExc_AssertionError_Check(obj) __Pyx_TypeCheck(obj, PyExc_AssertionError)
2402#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
2403#define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 0)
2404#define __Pyx_PyObject_LookupSpecial(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 1)
2405static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name,
int with_error);
2407#define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n)
2408#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n)
2412static CYTHON_INLINE
int __Pyx_PyObject_CompareBoolEq_object_str(PyObject *op1, PyObject *op2,
int pyop);
2415#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
2416#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
2417#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
2418#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
2419 (version_var) = __PYX_GET_DICT_VERSION(dict);\
2420 (cache_var) = (value);
2421#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
2422 static PY_UINT64_T __pyx_dict_version = 0;\
2423 static PyObject *__pyx_dict_cached_value = NULL;\
2424 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
2425 (VAR) = __Pyx_XNewRef(__pyx_dict_cached_value);\
2427 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
2428 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
2431static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
2432static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
2433static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
2435#define __PYX_GET_DICT_VERSION(dict) (0)
2436#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
2437#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
2441#if CYTHON_USE_DICT_VERSIONS
2442#define __Pyx_GetModuleGlobalName(var, name) do {\
2443 static PY_UINT64_T __pyx_dict_version = 0;\
2444 static PyObject *__pyx_dict_cached_value = NULL;\
2445 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_mstate_global->__pyx_d))) ?\
2446 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
2447 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2449#define __Pyx_GetModuleGlobalNameUncached(var, name) do {\
2450 PY_UINT64_T __pyx_dict_version;\
2451 PyObject *__pyx_dict_cached_value;\
2452 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2454static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
2456#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
2457#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
2458static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
2462#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030d0000
2463typedef PyObject *__Pyx_TypeName;
2464#define __Pyx_FMT_TYPENAME "%N"
2465#define __Pyx_PyType_GetFullyQualifiedName(tp) Py_NewRef((PyObject*)tp)
2466#define __Pyx_DECREF_TypeName(obj) Py_DECREF(obj)
2467#elif CYTHON_COMPILING_IN_LIMITED_API
2468typedef PyObject *__Pyx_TypeName;
2469#define __Pyx_FMT_TYPENAME "%U"
2470#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
2471static __Pyx_TypeName __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp);
2473typedef const char *__Pyx_TypeName;
2474#define __Pyx_FMT_TYPENAME "%.200s"
2475#define __Pyx_PyType_GetFullyQualifiedName(tp) ((tp)->tp_name)
2476#define __Pyx_DECREF_TypeName(obj)
2480#define __Pyx_RaiseErrorWithObjectTypes1(exc_type, message, arg, obj1, obj2) __Pyx_RaiseErrorWithTypes1(exc_type, message, arg, Py_TYPE(obj1), Py_TYPE(obj2))
2481#define __Pyx_RaiseTypeErrorWithObjectTypes(message, obj1, obj2) __Pyx_RaiseTypeErrorWithTypes(message, Py_TYPE(obj1), Py_TYPE(obj2))
2482#define __Pyx_RaiseTypeErrorWithTypes(message, type_obj1, type_obj2) __Pyx_RaiseErrorWithTypes1(PyExc_TypeError, "%.1s" message, "", type_obj1, type_obj2)
2484static void __Pyx_RaiseErrorWithTypes1(PyObject* exc_type,
const char *message,
const char *arg, PyTypeObject *type_obj1, PyTypeObject *type_obj2);
2487#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL || CYTHON_COMPILING_IN_LIMITED_API
2488#define __Pyx_PyNumber_Multiply_object_object(op1, op2) PyNumber_Multiply(op1, op2)
2489#define __Pyx_PyNumber_InPlaceMultiply_object_object(op1, op2) PyNumber_InPlaceMultiply(op1, op2)
2491#define __Pyx_PyNumber_Multiply_object_object(op1, op2) __Pyx__PyNumber_Multiply_object_object(op1, op2, 0)
2492#define __Pyx_PyNumber_InPlaceMultiply_object_object(op1, op2) __Pyx__PyNumber_Multiply_object_object(op1, op2, 1)
2493static CYTHON_INLINE PyObject* __Pyx__PyNumber_Multiply_object_object(PyObject *op1, PyObject *op2,
int inplace);
2497static void __Pyx_RaiseUnboundLocalError(
const char *varname);
2500#if CYTHON_VECTORCALL
2501#define __Pyx_Object_VectorcallKwds PyObject_Vectorcall
2502CYTHON_UNUSED
static int __Pyx_CheckVectorcallKwarg(PyObject *kwnames, Py_ssize_t i);
2504#define __Pyx_Object_VectorcallKwds __Pyx_PyObject_FastCallDict
2505CYTHON_UNUSED
static PyObject *__Pyx_MakeKwargDict(PyObject **keys, PyObject **values, Py_ssize_t
n);
2506CYTHON_UNUSED
static int __Pyx_CheckVectorcallKwarg(PyObject **kwnames, Py_ssize_t i);
2510#if CYTHON_VECTORCALL
2511#define __Pyx_Object_VectorcallMethodKwds PyObject_VectorcallMethod
2513static PyObject *__Pyx_Object_VectorcallMethodKwds(PyObject *name, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
2517#define __Pyx_RaiseTypeErrorWithObjectType1(message, arg, obj) __Pyx_RaiseErrorWithObjectType1(PyExc_TypeError, message, arg, obj)
2518#define __Pyx_RaiseErrorWithObjectType1(exc_type, message, arg, obj) __Pyx_RaiseErrorWithType1(exc_type, message, arg, Py_TYPE(obj))
2520static void __Pyx_RaiseErrorWithType1(PyObject* exc_type,
const char* message,
const char *arg, PyTypeObject *type_obj);
2524static int __Pyx_RaiseUnexpectedTypeError(
const char *expected, PyObject *obj);
2527#if CYTHON_VECTORCALL
2528#define __Pyx_PyObject_FastCallMethod(name, args, nargsf) PyObject_VectorcallMethod(name, args, nargsf, NULL)
2530static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *
const *args,
size_t nargsf);
2534#if CYTHON_COMPILING_IN_LIMITED_API
2535#define __Pyx_PyFrozenDict_TypePtr ((PyTypeObject*) __pyx_mstate_global->__Pyx_PyFrozenDictType)
2536#define __Pyx_PyFrozenDict_New(it) __Pyx__PyFrozenDict_New(__pyx_mstate_global->__Pyx_PyFrozenDictType, it)
2537static CYTHON_INLINE PyObject* __Pyx__PyFrozenDict_New(PyObject* frozendict_type, PyObject* it);
2538#define __Pyx_PyFrozenDict_NewEmpty() __Pyx_PyFrozenDict_New(NULL)
2539#define __Pyx_PyFrozenDict_Check(obj) PyObject_TypeCheck((obj), __Pyx_PyFrozenDict_TypePtr)
2540#define __Pyx_PyFrozenDict_CheckExact(obj) Py_IS_TYPE((obj), __Pyx_PyFrozenDict_TypePtr)
2541#define __Pyx_PyAnyDict_Check(obj) __Pyx__PyAnyDict_Check(obj, __Pyx_PyFrozenDict_TypePtr)
2542static CYTHON_INLINE
int __Pyx__PyAnyDict_Check(PyObject *obj, PyTypeObject* frozendict_type) {
2543 return PyObject_TypeCheck(obj, &PyDict_Type) || PyObject_TypeCheck(obj, frozendict_type);
2545#define __Pyx_PyAnyDict_CheckExact(obj) __Pyx__PyAnyDict_CheckExact(obj, __Pyx_PyFrozenDict_TypePtr)
2546static CYTHON_INLINE
int __Pyx__PyAnyDict_CheckExact(PyObject *obj, PyTypeObject* frozendict_type) {
2547 return Py_IS_TYPE(obj, &PyDict_Type) || Py_IS_TYPE(obj, frozendict_type);
2549#elif PY_VERSION_HEX >= 0x030f00a6 ||\
2550 (defined(PyFrozenDict_Check) && defined(PyAnyDict_Check) && defined(PyFrozenDict_New))
2551#define __Pyx_PyFrozenDict_TypePtr (&PyFrozenDict_Type)
2552#define __Pyx_PyFrozenDict_New(it) PyFrozenDict_New(it)
2553#define __Pyx_PyFrozenDict_NewEmpty() PyFrozenDict_New(NULL)
2554#define __Pyx_PyFrozenDict_Check(obj) PyFrozenDict_Check(obj)
2555#define __Pyx_PyFrozenDict_CheckExact(obj) PyFrozenDict_CheckExact(obj)
2556#define __Pyx_PyAnyDict_Check(obj) PyAnyDict_Check(obj)
2557#define __Pyx_PyAnyDict_CheckExact(obj) PyAnyDict_CheckExact(obj)
2559#define __Pyx_PyFrozenDict_TypePtr (&PyDict_Type)
2560static CYTHON_INLINE PyObject* __Pyx_PyFrozenDict_New(PyObject* it) {
2562 return PyDict_New();
2563 }
else if (PyDict_Check(it)) {
2564 return PyDict_Copy(it);
2566 PyObject *dict = PyDict_New();
2567 if (!dict)
return NULL;
2568 PyObject *result = PyNumber_InPlaceOr(dict, it);
2573#define __Pyx_PyFrozenDict_NewEmpty() PyDict_New()
2574#define __Pyx_PyFrozenDict_Check(obj) PyDict_Check(obj)
2575#define __Pyx_PyFrozenDict_CheckExact(obj) PyDict_CheckExact(obj)
2576#define __Pyx_PyAnyDict_Check(obj) PyDict_Check(obj)
2577#define __Pyx_PyAnyDict_CheckExact(obj) PyDict_CheckExact(obj)
2581#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, wraparound, boundscheck, has_gil, unsafe_shared)\
2582 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2583 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
2584 __Pyx_GetItemInt_Generic(o, to_py_func(i)))
2585#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, wraparound, boundscheck, has_gil, unsafe_shared)\
2586 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2587 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
2588 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
2589static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
2590 int wraparound,
int boundscheck,
int unsafe_shared);
2591#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, wraparound, boundscheck, has_gil, unsafe_shared)\
2592 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2593 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
2594 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
2595static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
2596 int wraparound,
int boundscheck,
int unsafe_shared);
2597static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
2598static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
2599 int wraparound,
int boundscheck,
int unsafe_shared);
2602#define __Pyx_RaiseTypeErrorWithObjectType(message, obj) __Pyx_RaiseErrorWithObjectType(PyExc_TypeError, message, obj)
2603#define __Pyx_RaiseErrorWithObjectType(exc_type, message, obj) __Pyx_RaiseErrorWithType(exc_type, message, Py_TYPE(obj))
2605static void __Pyx_RaiseErrorWithType(PyObject* exc_type,
const char* message, PyTypeObject *type_obj);
2608#if CYTHON_USE_TYPE_SLOTS
2609static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key);
2611#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
2615static CYTHON_INLINE
int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq,
int eq) {
2616 int result = PySequence_Contains(seq, item);
2617 return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
2621static double __Pyx_SlowPyString_AsDouble(PyObject *obj);
2622static double __Pyx__PyBytes_AsDouble(PyObject *obj,
const char* start, Py_ssize_t length);
2623static CYTHON_INLINE
double __Pyx_PyBytes_AsDouble(PyObject *obj) {
2626#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
2627 as_c_string = PyBytes_AS_STRING(obj);
2628 size = PyBytes_GET_SIZE(obj);
2630 if (PyBytes_AsStringAndSize(obj, &as_c_string, &size) < 0) {
2634 return __Pyx__PyBytes_AsDouble(obj, as_c_string, size);
2636static CYTHON_INLINE
double __Pyx_PyByteArray_AsDouble(PyObject *obj) {
2639#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
2640 as_c_string = PyByteArray_AS_STRING(obj);
2641 size = PyByteArray_GET_SIZE(obj);
2643 as_c_string = PyByteArray_AsString(obj);
2644 if (as_c_string == NULL) {
2647 size = PyByteArray_Size(obj);
2649 return __Pyx__PyBytes_AsDouble(obj, as_c_string, size);
2653#if !CYTHON_COMPILING_IN_PYPY && CYTHON_ASSUME_SAFE_MACROS
2654static const char* __Pyx__PyUnicode_AsDouble_Copy(
const void* data,
const int kind,
char* buffer, Py_ssize_t start, Py_ssize_t end) {
2655 int last_was_punctuation;
2657 last_was_punctuation = 1;
2658 for (i=start; i <= end; i++) {
2659 Py_UCS4 chr = PyUnicode_READ(kind, data, i);
2660 int is_punctuation = (chr ==
'_') | (chr ==
'.');
2661 *buffer = (char)chr;
2662 buffer += (chr !=
'_');
2663 if (unlikely(chr > 127))
goto parse_failure;
2664 if (unlikely(last_was_punctuation & is_punctuation))
goto parse_failure;
2665 last_was_punctuation = is_punctuation;
2667 if (unlikely(last_was_punctuation))
goto parse_failure;
2673static double __Pyx__PyUnicode_AsDouble_inf_nan(
const void* data,
int kind, Py_ssize_t start, Py_ssize_t length) {
2676 Py_UCS4
sign = PyUnicode_READ(kind, data, start);
2677 int is_signed = (
sign ==
'-') | (
sign ==
'+');
2679 length -= is_signed;
2680 switch (PyUnicode_READ(kind, data, start)) {
2684 if (unlikely(length != 3))
goto parse_failure;
2685 chr = PyUnicode_READ(kind, data, start+1);
2686 matches &= (chr ==
'a') | (chr ==
'A');
2687 chr = PyUnicode_READ(kind, data, start+2);
2688 matches &= (chr ==
'n') | (chr ==
'N');
2689 if (unlikely(!matches))
goto parse_failure;
2690 return (
sign ==
'-') ? -Py_NAN : Py_NAN;
2694 if (unlikely(length < 3))
goto parse_failure;
2695 chr = PyUnicode_READ(kind, data, start+1);
2696 matches &= (chr ==
'n') | (chr ==
'N');
2697 chr = PyUnicode_READ(kind, data, start+2);
2698 matches &= (chr ==
'f') | (chr ==
'F');
2699 if (likely(length == 3 && matches))
2700 return (
sign ==
'-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
2701 if (unlikely(length != 8))
goto parse_failure;
2702 chr = PyUnicode_READ(kind, data, start+3);
2703 matches &= (chr ==
'i') | (chr ==
'I');
2704 chr = PyUnicode_READ(kind, data, start+4);
2705 matches &= (chr ==
'n') | (chr ==
'N');
2706 chr = PyUnicode_READ(kind, data, start+5);
2707 matches &= (chr ==
'i') | (chr ==
'I');
2708 chr = PyUnicode_READ(kind, data, start+6);
2709 matches &= (chr ==
't') | (chr ==
'T');
2710 chr = PyUnicode_READ(kind, data, start+7);
2711 matches &= (chr ==
'y') | (chr ==
'Y');
2712 if (unlikely(!matches))
goto parse_failure;
2713 return (
sign ==
'-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
2714 case '.':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
2723static double __Pyx_PyUnicode_AsDouble_WithSpaces(PyObject *obj) {
2728 Py_ssize_t start, length = PyUnicode_GET_LENGTH(obj);
2729 const int kind = PyUnicode_KIND(obj);
2730 const void* data = PyUnicode_DATA(obj);
2732 while (Py_UNICODE_ISSPACE(PyUnicode_READ(kind, data, start)))
2734 while (start < length - 1 && Py_UNICODE_ISSPACE(PyUnicode_READ(kind, data, length - 1)))
2737 if (unlikely(length <= 0))
goto fallback;
2738 value = __Pyx__PyUnicode_AsDouble_inf_nan(data, kind, start, length);
2740 if (unlikely(value == -1.0))
goto fallback;
2745 last = __Pyx__PyUnicode_AsDouble_Copy(data, kind,
number, start, start + length);
2746 if (unlikely(!last))
goto fallback;
2747 value = PyOS_string_to_double(
number, &end, NULL);
2748 valid_parse = (end == last);
2750 char *
number = (
char*) PyMem_Malloc(((
size_t) length + 1) *
sizeof(
char));
2751 if (unlikely(!
number))
goto fallback;
2752 last = __Pyx__PyUnicode_AsDouble_Copy(data, kind,
number, start, start + length);
2753 if (unlikely(!last)) {
2757 value = PyOS_string_to_double(
number, &end, NULL);
2758 valid_parse = (end == last);
2761 if (likely(valid_parse) || (value == (
double)-1 && PyErr_Occurred())) {
2765 return __Pyx_SlowPyString_AsDouble(obj);
2768static CYTHON_INLINE
double __Pyx_PyUnicode_AsDouble(PyObject *obj) {
2769#if !CYTHON_COMPILING_IN_PYPY && CYTHON_ASSUME_SAFE_MACROS
2770 if (unlikely(__Pyx_PyUnicode_READY(obj) == -1))
2772 if (likely(PyUnicode_IS_ASCII(obj))) {
2775 s = PyUnicode_AsUTF8AndSize(obj, &length);
2776 return __Pyx__PyBytes_AsDouble(obj,
s, length);
2778 return __Pyx_PyUnicode_AsDouble_WithSpaces(obj);
2780 return __Pyx_SlowPyString_AsDouble(obj);
2785static CYTHON_INLINE PyObject* __Pyx__PyNumber_Float(PyObject* obj);
2786#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : __Pyx__PyNumber_Float(x))
2789static void __Pyx_PyBuiltin_Invalid(PyObject *obj,
const char *builtin_type_name,
const char *argname);
2792static CYTHON_INLINE
int __Pyx_PyFloat_FromNumber(PyObject **number_var,
const char *argname,
int accept_none);
2795#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL
2796#define __Pyx_PyObject_Equals_uchar(s1, s2, ch2, equals, s1_is_str) (\
2797 ((s1) == (s2)) ? ((equals) == Py_EQ) :\
2798 ((s1) == Py_None) ? ((equals) == Py_NE) :\
2799 __Pyx_PyObject_RichCompareBool(s1, s2, equals)\
2802#define __Pyx_PyObject_Equals_uchar(s1, s2, ch2, equals, s1_is_str) (\
2803 ((s1) == (s2)) ? ((equals) == Py_EQ) :\
2804 ((s1) == Py_None) ? ((equals) == Py_NE) :\
2805 (likely((s1_is_str) || PyUnicode_CheckExact(s1)) ?\
2806 __Pyx__PyUnicode_EqualsUCS4(s1, ch2, equals) :\
2807 __Pyx_PyObject_RichCompareBool(s1, s2, equals)\
2809static CYTHON_INLINE
int __Pyx__PyUnicode_EqualsUCS4(PyObject* s1, Py_UCS4 ch2,
int equals);
2813#define __Pyx_PyObject_Equals_obj_ch46(s1, s2, equals) __Pyx_PyObject_Equals_uchar(s1, s2, 46, equals, 0)
2816#ifndef __PYX_HAVE_RT_ImportType_proto_3_3_0
2817#define __PYX_HAVE_RT_ImportType_proto_3_3_0
2818#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
2819#include <stdalign.h>
2821#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
2822#define __PYX_GET_STRUCT_ALIGNMENT_3_3_0(s) alignof(s)
2824#define __PYX_GET_STRUCT_ALIGNMENT_3_3_0(s) sizeof(void*)
2826enum __Pyx_ImportType_CheckSize_3_3_0 {
2827 __Pyx_ImportType_CheckSize_Error_3_3_0 = 0,
2828 __Pyx_ImportType_CheckSize_Warn_3_3_0 = 1,
2829 __Pyx_ImportType_CheckSize_Ignore_3_3_0 = 2
2831static PyTypeObject *__Pyx_ImportType_3_3_0(PyObject* module,
const char *module_name,
const char *class_name,
size_t size,
size_t alignment,
enum __Pyx_ImportType_CheckSize_3_3_0 check_size);
2835#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
2836#define __Pyx_HasAttr(o, n) PyObject_HasAttrWithError(o, n)
2838static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *, PyObject *);
2842CYTHON_UNUSED
static PyObject *
2843__Pyx_PyList_FromArray(PyObject *
const *src, Py_ssize_t
n);
2849static PyObject *__Pyx__Import(PyObject *name, PyObject *
const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict,
int level);
2852static CYTHON_INLINE PyObject *__Pyx_Import(PyObject *name, PyObject *
const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname,
int level);
2855static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
2858static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value);
2861#if ((CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX < 0x030F00a3) ||\
2862 __PYX_LIMITED_VERSION_HEX < 0x030d0000)
2863 static PyObject *__Pyx_PyImport_AddModuleRef(
const char *name);
2865 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
2869static PyObject *__Pyx_FetchSharedCythonABIModule(
void);
2872static int __Pyx_VerifyCachedType(PyObject *cached_type,
2874 Py_ssize_t expected_basicsize);
2877static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases);
2880static int __pyx_CommonTypesMetaclass_init(PyObject *module);
2881#define __Pyx_CommonTypesMetaclass_USED
2884#define __Pyx_CyFunction_USED
2885#if CYTHON_OPAQUE_SHARED_TYPES
2886#define __Pyx_as_CyFunctionObject(o) ((__pyx_CyFunctionObject *)PyObject_GetTypeData((o), __pyx_mstate_global->__pyx_CyFunctionType))
2888#define __Pyx_as_CyFunctionObject(o) ((__pyx_CyFunctionObject *)o)
2890#define __Pyx_CYFUNCTION_STATICMETHOD 0x01
2891#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
2892#define __Pyx_CYFUNCTION_CCLASS 0x04
2893#define __Pyx_CYFUNCTION_COROUTINE 0x08
2894#define __Pyx_CyFunction_GetClosure(f)\
2895 ((__Pyx_as_CyFunctionObject(f))->func_closure)
2896#if CYTHON_COMPILING_IN_LIMITED_API
2897 #define __Pyx__CyFunction_GetClassObj(f)\
2898 ((f)->func_classobj)
2900 #define __Pyx__CyFunction_GetClassObj(f)\
2901 ((PyObject*) ((PyCMethodObject *) (f))->mm_class)
2903#define __Pyx_CyFunction_GetClassObj(f)\
2904 __Pyx__CyFunction_GetClassObj(__Pyx_as_CyFunctionObject(f))
2905#define __Pyx_CyFunction_SetClassObj(f, classobj)\
2906 __Pyx__CyFunction_SetClassObj(__Pyx_as_CyFunctionObject(f), (classobj))
2907#define __Pyx_CyFunction_Defaults(type, f)\
2908 ((type *)((__Pyx_as_CyFunctionObject(f))->defaults))
2909#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2910 (__Pyx_as_CyFunctionObject(f))->defaults_getter = (g)
2912#if CYTHON_COMPILING_IN_LIMITED_API
2913#if !CYTHON_OPAQUE_OBJECTS
2916 PyMethodDef *func_methoddef;
2917 PyObject *func_module;
2919 PyCMethodObject func;
2921#if (CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY) && CYTHON_VECTORCALL
2922 __pyx_vectorcallfunc func_vectorcall;
2924#if CYTHON_COMPILING_IN_LIMITED_API
2925 PyObject *func_weakreflist;
2927#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
2928 PyObject *func_dict;
2930 PyObject *func_name;
2931 PyObject *func_qualname;
2933 PyObject *func_globals;
2934 PyObject *func_code;
2935 PyObject *func_closure;
2936#if CYTHON_COMPILING_IN_LIMITED_API
2937 PyObject *func_classobj;
2941 PyObject *defaults_tuple;
2942 PyObject *defaults_kwdict;
2943 PyObject *(*defaults_getter)(PyObject *);
2944 PyObject *func_annotations;
2945#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
2946 PyObject *func_is_coroutine;
2948} __pyx_CyFunctionObject;
2949#undef __Pyx_CyOrPyCFunction_Check
2950#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_mstate_global->__pyx_CyFunctionType)
2951#define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_mstate_global->__pyx_CyFunctionType, &PyCFunction_Type)
2952#define __Pyx_CyFunction_CheckExact(obj) Py_IS_TYPE(obj, __pyx_mstate_global->__pyx_CyFunctionType)
2953static CYTHON_INLINE
int __Pyx__IsSameCyOrCFunction(PyObject *func,
void (*cfunc)(
void));
2954#undef __Pyx_IsSameCFunction
2955#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc)
2956static CYTHON_INLINE
void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject*
f, PyObject* classobj);
2957static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func,
2958 PyTypeObject *defaults_type);
2959static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2961static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2963static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2965static int __pyx_CyFunction_init(PyObject *module);
2966#if CYTHON_VECTORCALL
2967#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
2968#define __Pyx_CyFunction_func_vectorcall(f) ((f)->func_vectorcall)
2970#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall)
2975#if !CYTHON_USE_TYPE_SPECS
2976#define __Pyx_call_type_traverse(o, always_call, visit, arg) 0
2978static int __Pyx_call_type_traverse(PyObject *o,
int always_call, visitproc visit,
void *arg);
2982static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ);
2985#if CYTHON_VECTORCALL
2986static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *
const *args,
size_t nargs, PyObject *kw);
2990static PyObject *__Pyx_CyFunction_Init(PyObject *op_in, PyMethodDef *ml,
2991 int flags, PyObject* qualname,
2993 PyObject *module, PyObject *globals,
2995#if CYTHON_VECTORCALL
2996static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
2997static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
2998static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
2999static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames);
3003static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
3004 int flags, PyObject* qualname,
3006 PyObject *module, PyObject *globals,
3008static PyTypeObject *__Pyx_Get_CyFunction_Type(
void);
3011#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
3012static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
3014#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
3018#if CYTHON_COMPILING_IN_LIMITED_API
3019typedef PyObject __Pyx_CachedCodeObjectType;
3021typedef PyCodeObject __Pyx_CachedCodeObjectType;
3024 __Pyx_CachedCodeObjectType* code_object;
3026} __Pyx_CodeObjectCacheEntry;
3027struct __Pyx_CodeObjectCache {
3030 __Pyx_CodeObjectCacheEntry* entries;
3031 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
3032 __pyx_atomic_int_type accessor_count;
3035static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
3036static __Pyx_CachedCodeObjectType *__pyx_find_code_object(
int code_line);
3037static void __pyx_insert_code_object(
int code_line, __Pyx_CachedCodeObjectType* code_object);
3040static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
3041 int py_line,
const char *filename);
3044#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
3045#define __Pyx_HAS_GCC_DIAGNOSTIC
3051 #define __Pyx_CREAL(z) ((z).real())
3052 #define __Pyx_CIMAG(z) ((z).imag())
3054 #define __Pyx_CREAL(z) (__real__(z))
3055 #define __Pyx_CIMAG(z) (__imag__(z))
3058 #define __Pyx_CREAL(z) ((z).real)
3059 #define __Pyx_CIMAG(z) ((z).imag)
3061#if defined(__cplusplus) && CYTHON_CCOMPLEX\
3062 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
3063 #define __Pyx_SET_CREAL(z,x) ((z).real(x))
3064 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
3066 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
3067 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
3071#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3072 #define __Pyx_c_eq_float(a, b) ((a)==(b))
3073 #define __Pyx_c_sum_float(a, b) ((a)+(b))
3074 #define __Pyx_c_diff_float(a, b) ((a)-(b))
3075 #define __Pyx_c_prod_float(a, b) ((a)*(b))
3076 #define __Pyx_c_quot_float(a, b) ((a)/(b))
3077 #define __Pyx_c_neg_float(a) (-(a))
3079 #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
3080 #define __Pyx_c_conj_float(z) (::std::conj(z))
3082 #define __Pyx_c_abs_float(z) (::std::abs(z))
3083 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
3086 #define __Pyx_c_is_zero_float(z) ((z)==0)
3087 #define __Pyx_c_conj_float(z) (conjf(z))
3089 #define __Pyx_c_abs_float(z) (cabsf(z))
3090 #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
3094 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
3095 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
3096 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
3097 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
3098 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
3099 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
3100 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex);
3101 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
3103 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex);
3104 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
3109#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3110 #define __Pyx_c_eq_double(a, b) ((a)==(b))
3111 #define __Pyx_c_sum_double(a, b) ((a)+(b))
3112 #define __Pyx_c_diff_double(a, b) ((a)-(b))
3113 #define __Pyx_c_prod_double(a, b) ((a)*(b))
3114 #define __Pyx_c_quot_double(a, b) ((a)/(b))
3115 #define __Pyx_c_neg_double(a) (-(a))
3117 #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
3118 #define __Pyx_c_conj_double(z) (::std::conj(z))
3120 #define __Pyx_c_abs_double(z) (::std::abs(z))
3121 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
3124 #define __Pyx_c_is_zero_double(z) ((z)==0)
3125 #define __Pyx_c_conj_double(z) (conj(z))
3127 #define __Pyx_c_abs_double(z) (cabs(z))
3128 #define __Pyx_c_pow_double(a, b) (cpow(a, b))
3132 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
3133 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
3134 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
3135 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
3136 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
3137 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
3138 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex);
3139 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
3141 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex);
3142 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
3147#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3148 #define __Pyx_c_eq_long__double(a, b) ((a)==(b))
3149 #define __Pyx_c_sum_long__double(a, b) ((a)+(b))
3150 #define __Pyx_c_diff_long__double(a, b) ((a)-(b))
3151 #define __Pyx_c_prod_long__double(a, b) ((a)*(b))
3152 #define __Pyx_c_quot_long__double(a, b) ((a)/(b))
3153 #define __Pyx_c_neg_long__double(a) (-(a))
3155 #define __Pyx_c_is_zero_long__double(z) ((z)==(long double)0)
3156 #define __Pyx_c_conj_long__double(z) (::std::conj(z))
3158 #define __Pyx_c_abs_long__double(z) (::std::abs(z))
3159 #define __Pyx_c_pow_long__double(a, b) (::std::pow(a, b))
3162 #define __Pyx_c_is_zero_long__double(z) ((z)==0)
3163 #define __Pyx_c_conj_long__double(z) (conjl(z))
3165 #define __Pyx_c_abs_long__double(z) (cabsl(z))
3166 #define __Pyx_c_pow_long__double(a, b) (cpowl(a, b))
3170 static CYTHON_INLINE
int __Pyx_c_eq_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3171 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_sum_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3172 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_diff_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3173 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_prod_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3174 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3175 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex);
3176 static CYTHON_INLINE
int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex);
3177 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex);
3179 static CYTHON_INLINE
long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex);
3180 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_pow_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3185static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(
long value);
3188static CYTHON_INLINE
long __Pyx_PyLong_As_long(PyObject *);
3191static CYTHON_INLINE
int __Pyx_PyLong_As_int(PyObject *);
3194#if __PYX_LIMITED_VERSION_HEX < 0x030b0000
3195static unsigned long __Pyx_cached_runtime_version = 0;
3196static void __Pyx_init_runtime_version(
void);
3198#define __Pyx_init_runtime_version()
3200static unsigned long __Pyx_get_runtime_version(
void);
3203static int __Pyx_check_binary_version(
unsigned long ct_version,
unsigned long rt_version,
int allow_newer);
3206static PyObject *__Pyx_DecompressString(
const char *
s, Py_ssize_t length,
int algo);
3209static PyObject *__Pyx_DecompressString_LZSS(
const char *
s,
size_t compressed_length,
size_t uncompressed_length);
3212#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
3214static PyObject *__Pyx_State_FindModule(
void*);
3215static int __Pyx_State_AddModule(PyObject* module,
void*);
3216static int __Pyx_State_RemoveModule(
void*);
3217#elif CYTHON_USE_MODULE_STATE
3218#define __Pyx_State_FindModule PyState_FindModule
3219#define __Pyx_State_AddModule PyState_AddModule
3220#define __Pyx_State_RemoveModule PyState_RemoveModule
3225#if CYTHON_COMPILING_IN_LIMITED_API
3226 #if CYTHON_VECTORCALL
3227 #define __PYX_VECTORCALL_ABI_SUFFIX "_vectorcall"
3229 #define __PYX_VECTORCALL_ABI_SUFFIX
3231 #define __PYX_LIMITED_ABI_SUFFIX "limited" __PYX_VECTORCALL_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX
3233 #define __PYX_LIMITED_ABI_SUFFIX
3235#if __PYX_HAS_PY_AM_SEND == 1
3236 #define __PYX_AM_SEND_ABI_SUFFIX
3237#elif __PYX_HAS_PY_AM_SEND == 2
3238 #define __PYX_AM_SEND_ABI_SUFFIX "amsendbackport"
3240 #define __PYX_AM_SEND_ABI_SUFFIX "noamsend"
3242#ifndef __PYX_MONITORING_ABI_SUFFIX
3243 #define __PYX_MONITORING_ABI_SUFFIX
3245#if CYTHON_USE_TP_FINALIZE
3246 #define __PYX_TP_FINALIZE_ABI_SUFFIX
3248 #define __PYX_TP_FINALIZE_ABI_SUFFIX "nofinalize"
3250#if CYTHON_USE_FREELISTS || !defined(__Pyx_AsyncGen_USED)
3251 #define __PYX_FREELISTS_ABI_SUFFIX
3253 #define __PYX_FREELISTS_ABI_SUFFIX "nofreelists"
3255#if CYTHON_OPAQUE_OBJECTS && CYTHON_COMPILING_IN_LIMITED_API
3256 #define __PYX_OPAQUE_OBJECTS_ABI_SUFFIX "opaque"
3258 #define __PYX_OPAQUE_OBJECTS_ABI_SUFFIX
3260#define CYTHON_ABI __PYX_ABI_VERSION __PYX_LIMITED_ABI_SUFFIX __PYX_MONITORING_ABI_SUFFIX __PYX_TP_FINALIZE_ABI_SUFFIX __PYX_FREELISTS_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX __PYX_OPAQUE_OBJECTS_ABI_SUFFIX
3261#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
3262#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."
3264static CYTHON_INLINE PyTypeObject *__pyx_f_5numpy_5dtype_7typeobj___get__(PyArray_Descr *__pyx_v_self);
3265static CYTHON_INLINE
char __pyx_f_5numpy_5dtype_4kind___get__(PyArray_Descr *__pyx_v_self);
3266static CYTHON_INLINE
char __pyx_f_5numpy_5dtype_4type___get__(PyArray_Descr *__pyx_v_self);
3267static CYTHON_INLINE
char __pyx_f_5numpy_5dtype_9byteorder___get__(PyArray_Descr *__pyx_v_self);
3268static CYTHON_INLINE
int __pyx_f_5numpy_5dtype_8type_num___get__(PyArray_Descr *__pyx_v_self);
3269static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize___get__(PyArray_Descr *__pyx_v_self);
3270static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment___get__(PyArray_Descr *__pyx_v_self);
3271static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields___get__(PyArray_Descr *__pyx_v_self);
3272static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names___get__(PyArray_Descr *__pyx_v_self);
3273static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray___get__(PyArray_Descr *__pyx_v_self);
3274static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags___get__(PyArray_Descr *__pyx_v_self);
3275static CYTHON_INLINE
int __pyx_f_5numpy_9broadcast_7numiter___get__(PyArrayMultiIterObject *__pyx_v_self);
3276static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size___get__(PyArrayMultiIterObject *__pyx_v_self);
3277static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index___get__(PyArrayMultiIterObject *__pyx_v_self);
3278static CYTHON_INLINE
int __pyx_f_5numpy_9broadcast_2nd___get__(PyArrayMultiIterObject *__pyx_v_self);
3279static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions___get__(PyArrayMultiIterObject *__pyx_v_self);
3280static CYTHON_INLINE
void **__pyx_f_5numpy_9broadcast_5iters___get__(PyArrayMultiIterObject *__pyx_v_self);
3281static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base___get__(PyArrayObject *__pyx_v_self);
3282static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr___get__(PyArrayObject *__pyx_v_self);
3283static CYTHON_INLINE
int __pyx_f_5numpy_7ndarray_4ndim___get__(PyArrayObject *__pyx_v_self);
3284static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape___get__(PyArrayObject *__pyx_v_self);
3285static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides___get__(PyArrayObject *__pyx_v_self);
3286static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size___get__(PyArrayObject *__pyx_v_self);
3287static CYTHON_INLINE
char *__pyx_f_5numpy_7ndarray_4data___get__(PyArrayObject *__pyx_v_self);
3288static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_3nin___get__(PyUFuncObject *__pyx_v_self);
3289static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_4nout___get__(PyUFuncObject *__pyx_v_self);
3290static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_5nargs___get__(PyUFuncObject *__pyx_v_self);
3291static CYTHON_INLINE PyUFuncGenericFunction *__pyx_f_5numpy_5ufunc_9functions___get__(PyUFuncObject *__pyx_v_self);
3292static CYTHON_INLINE
void **__pyx_f_5numpy_5ufunc_4data___get__(PyUFuncObject *__pyx_v_self);
3293static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_6ntypes___get__(PyUFuncObject *__pyx_v_self);
3294static CYTHON_INLINE
char const *__pyx_f_5numpy_5ufunc_4name___get__(PyUFuncObject *__pyx_v_self);
3295static CYTHON_INLINE
char const *__pyx_f_5numpy_5ufunc_3doc___get__(PyUFuncObject *__pyx_v_self);
3296static CYTHON_INLINE
void *__pyx_f_5numpy_5ufunc_3ptr___get__(PyUFuncObject *__pyx_v_self);
3297static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_3obj___get__(PyUFuncObject *__pyx_v_self);
3298static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_9userloops___get__(PyUFuncObject *__pyx_v_self);
3321#define __Pyx_MODULE_NAME "fenton.Fenton"
3322extern int __pyx_module_is_main_fenton__Fenton;
3323int __pyx_module_is_main_fenton__Fenton = 0;
3327static PyObject *__pyx_builtin_open;
3329static const char __pyx_k_Scripts_for_creating_Fenton_wav[] =
"\nScripts for creating Fenton waves.\nModified from johndfenton.com/Steady-waves/Fourier.html to work with python and Proteus\nUsed in proteus.WaveTools\n";
3331static PyObject *__pyx_pf_6fenton_6Fenton_writeInput(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_waveheight, PyObject *__pyx_v_depth, PyObject *__pyx_v_period, PyObject *__pyx_v_wavelength, PyObject *__pyx_v_mode, PyObject *__pyx_v_current_criterion, PyObject *__pyx_v_current_magnitude, PyObject *__pyx_v_ncoeffs, PyObject *__pyx_v_height_steps, PyObject *__pyx_v_g, PyObject *__pyx_v_niter, PyObject *__pyx_v_conv_crit, CYTHON_UNUSED PyObject *__pyx_v_points_freesurface, CYTHON_UNUSED PyObject *__pyx_v_points_velocity, CYTHON_UNUSED PyObject *__pyx_v_points_vertical);
3332static PyObject *__pyx_pf_6fenton_6Fenton_2runFourier(CYTHON_UNUSED PyObject *__pyx_self);
3333static PyObject *__pyx_pf_6fenton_6Fenton_4getBYCoeffs(CYTHON_UNUSED PyObject *__pyx_self);
3334static PyObject *__pyx_pf_6fenton_6Fenton_6getWavelength(CYTHON_UNUSED PyObject *__pyx_self);
3335static PyObject *__pyx_pf_6fenton_6Fenton_8copyFiles(CYTHON_UNUSED PyObject *__pyx_self);
3336static PyObject *__pyx_pf_6fenton_6Fenton_10__get_dir(CYTHON_UNUSED PyObject *__pyx_self);
3340#ifndef CYTHON_SMALL_CODE
3341#if defined(__clang__)
3342 #define CYTHON_SMALL_CODE
3343#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
3344 #define CYTHON_SMALL_CODE __attribute__((cold))
3346 #define CYTHON_SMALL_CODE
3356 PyObject *__pyx_cython_runtime;
3357 PyObject *__pyx_empty_tuple;
3358 PyObject *__pyx_empty_bytes;
3359 PyObject *__pyx_empty_unicode;
3360 PyTypeObject *__pyx_ptype_7cpython_4type_type;
3361 PyTypeObject *__pyx_ptype_5numpy_dtype;
3362 PyTypeObject *__pyx_ptype_5numpy_flatiter;
3363 PyTypeObject *__pyx_ptype_5numpy_broadcast;
3364 PyTypeObject *__pyx_ptype_5numpy_ndarray;
3365 PyTypeObject *__pyx_ptype_5numpy_generic;
3366 PyTypeObject *__pyx_ptype_5numpy_number;
3367 PyTypeObject *__pyx_ptype_5numpy_integer;
3368 PyTypeObject *__pyx_ptype_5numpy_signedinteger;
3369 PyTypeObject *__pyx_ptype_5numpy_unsignedinteger;
3370 PyTypeObject *__pyx_ptype_5numpy_inexact;
3371 PyTypeObject *__pyx_ptype_5numpy_floating;
3372 PyTypeObject *__pyx_ptype_5numpy_complexfloating;
3373 PyTypeObject *__pyx_ptype_5numpy_flexible;
3374 PyTypeObject *__pyx_ptype_5numpy_character;
3375 PyTypeObject *__pyx_ptype_5numpy_ufunc;
3376 __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items;
3377 __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop;
3378 __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_values;
3379 PyObject *__pyx_slice[1];
3380 PyObject *__pyx_tuple[8];
3381 PyObject *__pyx_codeobj_tab[6];
3382 PyObject *__pyx_string_tab[98];
3383 PyObject *__pyx_number_tab[10];
3386#if CYTHON_COMPILING_IN_LIMITED_API
3387PyObject *__Pyx_PyFrozenDictType;
3391PyTypeObject *__pyx_CommonTypesMetaclassType;
3394#if CYTHON_COMPILING_IN_LIMITED_API
3395PyObject *__Pyx_CachedMethodType;
3399PyTypeObject *__pyx_CyFunctionType;
3402struct __Pyx_CodeObjectCache __pyx_code_cache;
3410#if CYTHON_USE_MODULE_STATE
3413extern struct PyModuleDef __pyx_moduledef;
3416static struct PyModuleDef __pyx_moduledef;
3419#define __pyx_mstate_global (__Pyx_PyModule_GetState(__Pyx_State_FindModule(&__pyx_moduledef)))
3421#define __pyx_m (__Pyx_State_FindModule(&__pyx_moduledef))
3423static __pyx_mstatetype __pyx_mstate_global_static =
3429static __pyx_mstatetype *
const __pyx_mstate_global = &__pyx_mstate_global_static;
3432#define __pyx_kp_u__2 __pyx_string_tab[0]
3433#define __pyx_kp_u__3 __pyx_string_tab[1]
3434#define __pyx_kp_u_ __pyx_string_tab[2]
3435#define __pyx_kp_u_Control_file_to_control_converge __pyx_string_tab[3]
3436#define __pyx_kp_u_Convergence_dat __pyx_string_tab[4]
3437#define __pyx_kp_u_Data_dat __pyx_string_tab[5]
3438#define __pyx_kp_u_Flowfield_res __pyx_string_tab[6]
3439#define __pyx_kp_u_Period_or_wavelength_must_be_set __pyx_string_tab[7]
3440#define __pyx_kp_u_Points_dat __pyx_string_tab[8]
3441#define __pyx_kp_u_Solution_res __pyx_string_tab[9]
3442#define __pyx_kp_u_Surface_res __pyx_string_tab[10]
3443#define __pyx_kp_u_Wave_waveheight_mode_length_curr __pyx_string_tab[11]
3444#define __pyx_kp_u_numpy__core_multiarray_failed_to __pyx_string_tab[12]
3445#define __pyx_kp_u_numpy__core_umath_failed_to_impo __pyx_string_tab[13]
3446#define __pyx_kp_u_proteus_fenton_Fenton_pyx __pyx_string_tab[14]
3447#define __pyx_n_u_BCoeffs __pyx_string_tab[15]
3448#define __pyx_n_u_FFT __pyx_string_tab[16]
3449#define __pyx_n_u_Period __pyx_string_tab[17]
3450#define __pyx_n_u_Profiling __pyx_string_tab[18]
3451#define __pyx_n_u_Wave __pyx_string_tab[19]
3452#define __pyx_n_u_Wavelength __pyx_string_tab[20]
3453#define __pyx_n_u_YCoeffs __pyx_string_tab[21]
3454#define __pyx_n_u_Pyx_PyDict_NextRef __pyx_string_tab[22]
3455#define __pyx_n_u_annotate __pyx_string_tab[23]
3456#define __pyx_n_u_class_getitem __pyx_string_tab[24]
3457#define __pyx_n_u_enter __pyx_string_tab[25]
3458#define __pyx_n_u_exit __pyx_string_tab[26]
3459#define __pyx_n_u_file __pyx_string_tab[27]
3460#define __pyx_n_u_func __pyx_string_tab[28]
3461#define __pyx_n_u_get_dir __pyx_string_tab[29]
3462#define __pyx_n_u_main __pyx_string_tab[30]
3463#define __pyx_n_u_module __pyx_string_tab[31]
3464#define __pyx_n_u_name __pyx_string_tab[32]
3465#define __pyx_n_u_qualname __pyx_string_tab[33]
3466#define __pyx_n_u_test __pyx_string_tab[34]
3467#define __pyx_n_u_is_coroutine __pyx_string_tab[35]
3468#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[36]
3469#define __pyx_n_u_check_call __pyx_string_tab[37]
3470#define __pyx_n_u_cline_in_traceback __pyx_string_tab[38]
3471#define __pyx_n_u_comments __pyx_string_tab[39]
3472#define __pyx_n_u_conv_crit __pyx_string_tab[40]
3473#define __pyx_n_u_copy __pyx_string_tab[41]
3474#define __pyx_n_u_copyFiles __pyx_string_tab[42]
3475#define __pyx_n_u_current_criterion __pyx_string_tab[43]
3476#define __pyx_n_u_current_magnitude __pyx_string_tab[44]
3477#define __pyx_n_u_current_magnitude_dimless __pyx_string_tab[45]
3478#define __pyx_n_u_delimiter __pyx_string_tab[46]
3479#define __pyx_n_u_depth __pyx_string_tab[47]
3480#define __pyx_n_u_dirname __pyx_string_tab[48]
3481#define __pyx_n_u_f __pyx_string_tab[49]
3482#define __pyx_n_u_fenton_Fenton __pyx_string_tab[50]
3483#define __pyx_n_u_filename __pyx_string_tab[51]
3484#define __pyx_n_u_format __pyx_string_tab[52]
3485#define __pyx_n_u_g __pyx_string_tab[53]
3486#define __pyx_n_u_genfromtxt __pyx_string_tab[54]
3487#define __pyx_n_u_getBYCoeffs __pyx_string_tab[55]
3488#define __pyx_n_u_getWavelength __pyx_string_tab[56]
3489#define __pyx_n_u_height_steps __pyx_string_tab[57]
3490#define __pyx_n_u_items __pyx_string_tab[58]
3491#define __pyx_n_u_l __pyx_string_tab[59]
3492#define __pyx_n_u_length __pyx_string_tab[60]
3493#define __pyx_n_u_length_dimless __pyx_string_tab[61]
3494#define __pyx_n_u_line __pyx_string_tab[62]
3495#define __pyx_n_u_logDir __pyx_string_tab[63]
3496#define __pyx_n_u_mode __pyx_string_tab[64]
3497#define __pyx_n_u_ncoeffs __pyx_string_tab[65]
3498#define __pyx_n_u_niter __pyx_string_tab[66]
3499#define __pyx_n_u_np __pyx_string_tab[67]
3500#define __pyx_n_u_numpy __pyx_string_tab[68]
3501#define __pyx_n_u_open __pyx_string_tab[69]
3502#define __pyx_n_u_os __pyx_string_tab[70]
3503#define __pyx_n_u_path __pyx_string_tab[71]
3504#define __pyx_n_u_period __pyx_string_tab[72]
3505#define __pyx_n_u_points_freesurface __pyx_string_tab[73]
3506#define __pyx_n_u_points_velocity __pyx_string_tab[74]
3507#define __pyx_n_u_points_vertical __pyx_string_tab[75]
3508#define __pyx_n_u_pop __pyx_string_tab[76]
3509#define __pyx_n_u_proteus __pyx_string_tab[77]
3510#define __pyx_n_u_r __pyx_string_tab[78]
3511#define __pyx_n_u_runFourier __pyx_string_tab[79]
3512#define __pyx_n_u_setdefault __pyx_string_tab[80]
3513#define __pyx_n_u_shutil __pyx_string_tab[81]
3514#define __pyx_n_u_split __pyx_string_tab[82]
3515#define __pyx_n_u_sqrt __pyx_string_tab[83]
3516#define __pyx_n_u_subprocess __pyx_string_tab[84]
3517#define __pyx_n_u_values __pyx_string_tab[85]
3518#define __pyx_n_u_w __pyx_string_tab[86]
3519#define __pyx_n_u_waveheight __pyx_string_tab[87]
3520#define __pyx_n_u_waveheight_dimless __pyx_string_tab[88]
3521#define __pyx_n_u_wavelength __pyx_string_tab[89]
3522#define __pyx_n_u_write __pyx_string_tab[90]
3523#define __pyx_n_u_writeInput __pyx_string_tab[91]
3524#define __pyx_kp_b_iso88591_2U_1 __pyx_string_tab[92]
3525#define __pyx_kp_b_iso88591_H_7_c_G6_wc_d_WA_q_wgU_k_A_q_q __pyx_string_tab[93]
3526#define __pyx_kp_b_iso88591_y_1_A_A_y_A_1_A_IQ_A_9A_A_Ya __pyx_string_tab[94]
3527#define __pyx_kp_b_iso88591_a __pyx_string_tab[95]
3528#define __pyx_kp_b_iso88591_Kq_c_A_c_A_9A __pyx_string_tab[96]
3529#define __pyx_kp_b_iso88591_Q_ha_HA_F_wc_4y_1_Qaq_5 __pyx_string_tab[97]
3530#define __pyx_float_9_81 __pyx_number_tab[0]
3531#define __pyx_float_1_eneg_05 __pyx_number_tab[1]
3532#define __pyx_int_0 __pyx_number_tab[2]
3533#define __pyx_int_1 __pyx_number_tab[3]
3534#define __pyx_int_2 __pyx_number_tab[4]
3535#define __pyx_int_8 __pyx_number_tab[5]
3536#define __pyx_int_16 __pyx_number_tab[6]
3537#define __pyx_int_20 __pyx_number_tab[7]
3538#define __pyx_int_40 __pyx_number_tab[8]
3539#define __pyx_int_50 __pyx_number_tab[9]
3541#if CYTHON_USE_MODULE_STATE
3542static CYTHON_SMALL_CODE
int __pyx_m_clear(PyObject *m) {
3543 __pyx_mstatetype *clear_module_state = __Pyx_PyModule_GetState(m);
3544 if (!clear_module_state)
return 0;
3545 Py_CLEAR(clear_module_state->__pyx_d);
3546 Py_CLEAR(clear_module_state->__pyx_b);
3547 Py_CLEAR(clear_module_state->__pyx_cython_runtime);
3548 Py_CLEAR(clear_module_state->__pyx_empty_tuple);
3549 Py_CLEAR(clear_module_state->__pyx_empty_bytes);
3550 Py_CLEAR(clear_module_state->__pyx_empty_unicode);
3551 #if CYTHON_PEP489_MULTI_PHASE_INIT
3552 __Pyx_State_RemoveModule(NULL);
3554 Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type);
3555 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_dtype);
3556 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flatiter);
3557 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_broadcast);
3558 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ndarray);
3559 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_generic);
3560 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_number);
3561 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_integer);
3562 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_signedinteger);
3563 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_unsignedinteger);
3564 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_inexact);
3565 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_floating);
3566 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_complexfloating);
3567 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flexible);
3568 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_character);
3569 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ufunc);
3570 Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_items.method);
3571 Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_pop.method);
3572 Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_values.method);
3573 for (
int i=0; i<1; ++i) { Py_CLEAR(clear_module_state->__pyx_slice[i]); }
3574 for (
int i=0; i<8; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); }
3575 for (
int i=0; i<6; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); }
3576 for (
int i=0; i<98; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); }
3577 for (
int i=0; i<10; ++i) { Py_CLEAR(clear_module_state->__pyx_number_tab[i]); }
3580Py_CLEAR(clear_module_state->__pyx_CommonTypesMetaclassType);
3583Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
3590#if CYTHON_USE_MODULE_STATE
3591static CYTHON_SMALL_CODE
int __pyx_m_traverse(PyObject *m, visitproc visit,
void *arg) {
3592 __pyx_mstatetype *traverse_module_state = __Pyx_PyModule_GetState(m);
3593 if (!traverse_module_state)
return 0;
3594 Py_VISIT(traverse_module_state->__pyx_d);
3595 Py_VISIT(traverse_module_state->__pyx_b);
3596 Py_VISIT(traverse_module_state->__pyx_cython_runtime);
3597 __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_tuple);
3598 __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_bytes);
3599 __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_unicode);
3600 Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type);
3601 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_dtype);
3602 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flatiter);
3603 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_broadcast);
3604 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ndarray);
3605 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_generic);
3606 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_number);
3607 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_integer);
3608 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_signedinteger);
3609 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_unsignedinteger);
3610 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_inexact);
3611 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_floating);
3612 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_complexfloating);
3613 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flexible);
3614 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_character);
3615 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ufunc);
3616 Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_items.method);
3617 Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_pop.method);
3618 Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_values.method);
3619 for (
int i=0; i<1; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_slice[i]); }
3620 for (
int i=0; i<8; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); }
3621 for (
int i=0; i<6; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); }
3622 for (
int i=0; i<98; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); }
3623 for (
int i=0; i<10; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_number_tab[i]); }
3626Py_VISIT(traverse_module_state->__pyx_CommonTypesMetaclassType);
3629Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
3645static CYTHON_INLINE PyTypeObject *__pyx_f_5numpy_5dtype_7typeobj___get__(PyArray_Descr *__pyx_v_self) {
3646 PyTypeObject *__pyx_r;
3657 __pyx_r = PyDataType_TYPEOBJ(__pyx_v_self);
3682static CYTHON_INLINE
char __pyx_f_5numpy_5dtype_4kind___get__(PyArray_Descr *__pyx_v_self) {
3694 __pyx_r = PyDataType_KIND(__pyx_v_self);
3719static CYTHON_INLINE
char __pyx_f_5numpy_5dtype_4type___get__(PyArray_Descr *__pyx_v_self) {
3731 __pyx_r = PyDataType_TYPE(__pyx_v_self);
3756static CYTHON_INLINE
char __pyx_f_5numpy_5dtype_9byteorder___get__(PyArray_Descr *__pyx_v_self) {
3768 __pyx_r = PyDataType_BYTEORDER(__pyx_v_self);
3793static CYTHON_INLINE
int __pyx_f_5numpy_5dtype_8type_num___get__(PyArray_Descr *__pyx_v_self) {
3805 __pyx_r = PyDataType_TYPENUM(__pyx_v_self);
3830static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize___get__(PyArray_Descr *__pyx_v_self) {
3842 __pyx_r = PyDataType_ELSIZE(__pyx_v_self);
3867static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment___get__(PyArray_Descr *__pyx_v_self) {
3879 __pyx_r = PyDataType_ALIGNMENT(__pyx_v_self);
3904static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields___get__(PyArray_Descr *__pyx_v_self) {
3905 PyObject *__pyx_r = NULL;
3906 __Pyx_RefNannyDeclarations
3907 PyObject *__pyx_t_1;
3908 __Pyx_RefNannySetupContext(
"__get__", 0);
3917 __pyx_t_1 = PyDataType_FIELDS(__pyx_v_self);
3920 PyObject *__pyx_temp;
3922 __pyx_temp = __pyx_r;
3923 __Pyx_INCREF(((PyObject *)__pyx_t_1));
3924 __pyx_r = ((PyObject *)__pyx_t_1);
3926 __Pyx_XDECREF(__pyx_temp);
3941 __Pyx_XGIVEREF(__pyx_r);
3942 __Pyx_RefNannyFinishContext();
3954static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names___get__(PyArray_Descr *__pyx_v_self) {
3955 PyObject *__pyx_r = NULL;
3956 __Pyx_RefNannyDeclarations
3957 PyObject *__pyx_t_1;
3958 __Pyx_RefNannySetupContext(
"__get__", 0);
3967 __pyx_t_1 = PyDataType_NAMES(__pyx_v_self);
3970 PyObject *__pyx_temp;
3972 __pyx_temp = __pyx_r;
3973 __Pyx_INCREF(((PyObject*)__pyx_t_1));
3974 __pyx_r = ((PyObject*)__pyx_t_1);
3976 __Pyx_XDECREF(__pyx_temp);
3991 __Pyx_XGIVEREF(__pyx_r);
3992 __Pyx_RefNannyFinishContext();
4004static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray___get__(PyArray_Descr *__pyx_v_self) {
4005 PyArray_ArrayDescr *__pyx_r;
4016 __pyx_r = PyDataType_SUBARRAY(__pyx_v_self);
4041static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags___get__(PyArray_Descr *__pyx_v_self) {
4053 __pyx_r = PyDataType_FLAGS(__pyx_v_self);
4078static CYTHON_INLINE
int __pyx_f_5numpy_9broadcast_7numiter___get__(PyArrayMultiIterObject *__pyx_v_self) {
4090 __pyx_r = PyArray_MultiIter_NUMITER(__pyx_v_self);
4115static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size___get__(PyArrayMultiIterObject *__pyx_v_self) {
4127 __pyx_r = PyArray_MultiIter_SIZE(__pyx_v_self);
4152static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index___get__(PyArrayMultiIterObject *__pyx_v_self) {
4164 __pyx_r = PyArray_MultiIter_INDEX(__pyx_v_self);
4189static CYTHON_INLINE
int __pyx_f_5numpy_9broadcast_2nd___get__(PyArrayMultiIterObject *__pyx_v_self) {
4201 __pyx_r = PyArray_MultiIter_NDIM(__pyx_v_self);
4226static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions___get__(PyArrayMultiIterObject *__pyx_v_self) {
4238 __pyx_r = PyArray_MultiIter_DIMS(__pyx_v_self);
4263static CYTHON_INLINE
void **__pyx_f_5numpy_9broadcast_5iters___get__(PyArrayMultiIterObject *__pyx_v_self) {
4275 __pyx_r = PyArray_MultiIter_ITERS(__pyx_v_self);
4300static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base___get__(PyArrayObject *__pyx_v_self) {
4312 __pyx_r = PyArray_BASE(__pyx_v_self);
4337static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr___get__(PyArrayObject *__pyx_v_self) {
4338 PyArray_Descr *__pyx_r = NULL;
4339 __Pyx_RefNannyDeclarations
4340 PyArray_Descr *__pyx_t_1;
4341 __Pyx_RefNannySetupContext(
"__get__", 0);
4350 __pyx_t_1 = PyArray_DESCR(__pyx_v_self);
4353 PyArray_Descr *__pyx_temp;
4355 __pyx_temp = __pyx_r;
4356 __Pyx_INCREF((PyObject *)((PyArray_Descr *)__pyx_t_1));
4357 __pyx_r = ((PyArray_Descr *)__pyx_t_1);
4359 __Pyx_XDECREF((PyObject *)__pyx_temp);
4374 __Pyx_XGIVEREF((PyObject *)__pyx_r);
4375 __Pyx_RefNannyFinishContext();
4387static CYTHON_INLINE
int __pyx_f_5numpy_7ndarray_4ndim___get__(PyArrayObject *__pyx_v_self) {
4399 __pyx_r = PyArray_NDIM(__pyx_v_self);
4424static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape___get__(PyArrayObject *__pyx_v_self) {
4436 __pyx_r = PyArray_DIMS(__pyx_v_self);
4461static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides___get__(PyArrayObject *__pyx_v_self) {
4473 __pyx_r = PyArray_STRIDES(__pyx_v_self);
4498static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size___get__(PyArrayObject *__pyx_v_self) {
4510 __pyx_r = PyArray_SIZE(__pyx_v_self);
4535static CYTHON_INLINE
char *__pyx_f_5numpy_7ndarray_4data___get__(PyArrayObject *__pyx_v_self) {
4547 __pyx_r = PyArray_BYTES(__pyx_v_self);
4572static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
4573 PyObject *__pyx_r = NULL;
4574 __Pyx_RefNannyDeclarations
4575 PyObject *__pyx_t_1 = NULL;
4576 int __pyx_lineno = 0;
4577 const char *__pyx_filename = NULL;
4578 int __pyx_clineno = 0;
4579 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew1", 0);
4588 __pyx_t_1 = PyArray_MultiIterNew(1, ((
void *)__pyx_v_a));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 795, __pyx_L1_error)
4589 __Pyx_GOTREF(__pyx_t_1);
4591 PyObject *__pyx_temp;
4593 __pyx_temp = __pyx_r;
4594 __pyx_r = __pyx_t_1;
4596 __Pyx_XDECREF(__pyx_temp);
4611 __Pyx_XDECREF(__pyx_t_1);
4612 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
4615 __Pyx_XGIVEREF(__pyx_r);
4616 __Pyx_RefNannyFinishContext();
4628static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
4629 PyObject *__pyx_r = NULL;
4630 __Pyx_RefNannyDeclarations
4631 PyObject *__pyx_t_1 = NULL;
4632 int __pyx_lineno = 0;
4633 const char *__pyx_filename = NULL;
4634 int __pyx_clineno = 0;
4635 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew2", 0);
4644 __pyx_t_1 = PyArray_MultiIterNew(2, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 798, __pyx_L1_error)
4645 __Pyx_GOTREF(__pyx_t_1);
4647 PyObject *__pyx_temp;
4649 __pyx_temp = __pyx_r;
4650 __pyx_r = __pyx_t_1;
4652 __Pyx_XDECREF(__pyx_temp);
4667 __Pyx_XDECREF(__pyx_t_1);
4668 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
4671 __Pyx_XGIVEREF(__pyx_r);
4672 __Pyx_RefNannyFinishContext();
4684static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
4685 PyObject *__pyx_r = NULL;
4686 __Pyx_RefNannyDeclarations
4687 PyObject *__pyx_t_1 = NULL;
4688 int __pyx_lineno = 0;
4689 const char *__pyx_filename = NULL;
4690 int __pyx_clineno = 0;
4691 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew3", 0);
4700 __pyx_t_1 = PyArray_MultiIterNew(3, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 801, __pyx_L1_error)
4701 __Pyx_GOTREF(__pyx_t_1);
4703 PyObject *__pyx_temp;
4705 __pyx_temp = __pyx_r;
4706 __pyx_r = __pyx_t_1;
4708 __Pyx_XDECREF(__pyx_temp);
4723 __Pyx_XDECREF(__pyx_t_1);
4724 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
4727 __Pyx_XGIVEREF(__pyx_r);
4728 __Pyx_RefNannyFinishContext();
4740static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
4741 PyObject *__pyx_r = NULL;
4742 __Pyx_RefNannyDeclarations
4743 PyObject *__pyx_t_1 = NULL;
4744 int __pyx_lineno = 0;
4745 const char *__pyx_filename = NULL;
4746 int __pyx_clineno = 0;
4747 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew4", 0);
4756 __pyx_t_1 = PyArray_MultiIterNew(4, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c), ((
void *)__pyx_v_d));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 804, __pyx_L1_error)
4757 __Pyx_GOTREF(__pyx_t_1);
4759 PyObject *__pyx_temp;
4761 __pyx_temp = __pyx_r;
4762 __pyx_r = __pyx_t_1;
4764 __Pyx_XDECREF(__pyx_temp);
4779 __Pyx_XDECREF(__pyx_t_1);
4780 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
4783 __Pyx_XGIVEREF(__pyx_r);
4784 __Pyx_RefNannyFinishContext();
4796static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
4797 PyObject *__pyx_r = NULL;
4798 __Pyx_RefNannyDeclarations
4799 PyObject *__pyx_t_1 = NULL;
4800 int __pyx_lineno = 0;
4801 const char *__pyx_filename = NULL;
4802 int __pyx_clineno = 0;
4803 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew5", 0);
4812 __pyx_t_1 = PyArray_MultiIterNew(5, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c), ((
void *)__pyx_v_d), ((
void *)__pyx_v_e));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 807, __pyx_L1_error)
4813 __Pyx_GOTREF(__pyx_t_1);
4815 PyObject *__pyx_temp;
4817 __pyx_temp = __pyx_r;
4818 __pyx_r = __pyx_t_1;
4820 __Pyx_XDECREF(__pyx_temp);
4835 __Pyx_XDECREF(__pyx_t_1);
4836 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
4839 __Pyx_XGIVEREF(__pyx_r);
4840 __Pyx_RefNannyFinishContext();
4852static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
4853 PyObject *__pyx_r = NULL;
4854 __Pyx_RefNannyDeclarations
4856 PyObject *__pyx_t_2;
4857 __Pyx_RefNannySetupContext(
"PyDataType_SHAPE", 0);
4866 __pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d);
4878 __pyx_t_2 = __pyx_f_5numpy_5dtype_8subarray___get__(__pyx_v_d)->shape;
4881 PyObject *__pyx_temp;
4883 __pyx_temp = __pyx_r;
4884 __Pyx_INCREF(((PyObject*)__pyx_t_2));
4885 __pyx_r = ((PyObject*)__pyx_t_2);
4887 __Pyx_XDECREF(__pyx_temp);
4910 PyObject *__pyx_temp;
4912 __pyx_temp = __pyx_r;
4913 __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple);
4914 __pyx_r = __pyx_mstate_global->__pyx_empty_tuple;
4916 __Pyx_XDECREF(__pyx_temp);
4931 __Pyx_XGIVEREF(__pyx_r);
4932 __Pyx_RefNannyFinishContext();
4944static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_3nin___get__(PyUFuncObject *__pyx_v_self) {
4956 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nin;
4981static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_4nout___get__(PyUFuncObject *__pyx_v_self) {
4993 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nout;
5018static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_5nargs___get__(PyUFuncObject *__pyx_v_self) {
5030 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nargs;
5055static CYTHON_INLINE PyUFuncGenericFunction *__pyx_f_5numpy_5ufunc_9functions___get__(PyUFuncObject *__pyx_v_self) {
5056 PyUFuncGenericFunction *__pyx_r;
5067 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->functions;
5092static CYTHON_INLINE
void **__pyx_f_5numpy_5ufunc_4data___get__(PyUFuncObject *__pyx_v_self) {
5104 __pyx_r = ((
void **)_PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->data);
5129static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_6ntypes___get__(PyUFuncObject *__pyx_v_self) {
5141 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->ntypes;
5166static CYTHON_INLINE
char const *__pyx_f_5numpy_5ufunc_4name___get__(PyUFuncObject *__pyx_v_self) {
5167 char const *__pyx_r;
5178 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->name;
5203static CYTHON_INLINE
char const *__pyx_f_5numpy_5ufunc_3doc___get__(PyUFuncObject *__pyx_v_self) {
5204 char const *__pyx_r;
5215 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->doc;
5240static CYTHON_INLINE
void *__pyx_f_5numpy_5ufunc_3ptr___get__(PyUFuncObject *__pyx_v_self) {
5252 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->ptr;
5277static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_3obj___get__(PyUFuncObject *__pyx_v_self) {
5289 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->obj;
5314static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_9userloops___get__(PyUFuncObject *__pyx_v_self) {
5326 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->userloops;
5351static CYTHON_INLINE
void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
5353 int __pyx_lineno = 0;
5354 const char *__pyx_filename = NULL;
5355 int __pyx_clineno = 0;
5364 Py_INCREF(__pyx_v_base);
5373 __pyx_t_1 = PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base);
if (unlikely(__pyx_t_1 == ((
int)-1))) __PYX_ERR(1, 1067, __pyx_L1_error)
5387 __Pyx_AddTraceback(
"numpy.set_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename);
5400static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
5401 PyObject *__pyx_v_base;
5402 PyObject *__pyx_r = NULL;
5403 __Pyx_RefNannyDeclarations
5405 __Pyx_RefNannySetupContext(
"get_array_base", 0);
5414 __pyx_v_base = PyArray_BASE(__pyx_v_arr);
5423 __pyx_t_1 = (__pyx_v_base == NULL);
5436 PyObject *__pyx_temp;
5438 __pyx_temp = __pyx_r;
5439 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5441 __Pyx_XDECREF(__pyx_temp);
5462 PyObject *__pyx_temp;
5464 __pyx_temp = __pyx_r;
5465 __Pyx_INCREF(((PyObject *)__pyx_v_base));
5466 __pyx_r = ((PyObject *)__pyx_v_base);
5468 __Pyx_XDECREF(__pyx_temp);
5483 __Pyx_XGIVEREF(__pyx_r);
5484 __Pyx_RefNannyFinishContext();
5496static CYTHON_INLINE
int __pyx_f_5numpy_import_array(
void) {
5498 __Pyx_RefNannyDeclarations
5499 PyObject *__pyx_t_1 = NULL;
5500 PyObject *__pyx_t_2 = NULL;
5501 PyObject *__pyx_t_3 = NULL;
5503 PyObject *__pyx_t_5 = NULL;
5504 PyObject *__pyx_t_6 = NULL;
5505 PyObject *__pyx_t_7 = NULL;
5506 PyObject *__pyx_t_8 = NULL;
5507 PyObject *__pyx_t_9 = NULL;
5509 int __pyx_lineno = 0;
5510 const char *__pyx_filename = NULL;
5511 int __pyx_clineno = 0;
5512 __Pyx_RefNannySetupContext(
"import_array", 0);
5522 __Pyx_PyThreadState_declare
5523 __Pyx_PyThreadState_assign
5524 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
5525 __Pyx_XGOTREF(__pyx_t_1);
5526 __Pyx_XGOTREF(__pyx_t_2);
5527 __Pyx_XGOTREF(__pyx_t_3);
5537 __pyx_t_4 = _import_array();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 1079, __pyx_L3_error)
5548 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5549 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5550 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5551 goto __pyx_L8_try_end;
5561 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
5563 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
5564 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1080, __pyx_L5_except_error)
5565 __Pyx_XGOTREF(__pyx_t_5);
5566 __Pyx_XGOTREF(__pyx_t_6);
5567 __Pyx_XGOTREF(__pyx_t_7);
5579 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_multiarray_failed_to};
5580 __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ImportError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
5581 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5582 if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1081, __pyx_L5_except_error)
5583 __Pyx_GOTREF(__pyx_t_8);
5585 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
5586 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5587 __PYX_ERR(1, 1081, __pyx_L5_except_error)
5589 goto __pyx_L5_except_error;
5598 __pyx_L5_except_error:;
5599 __Pyx_XGIVEREF(__pyx_t_1);
5600 __Pyx_XGIVEREF(__pyx_t_2);
5601 __Pyx_XGIVEREF(__pyx_t_3);
5602 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
5603 goto __pyx_L1_error;
5619 __Pyx_XDECREF(__pyx_t_5);
5620 __Pyx_XDECREF(__pyx_t_6);
5621 __Pyx_XDECREF(__pyx_t_7);
5622 __Pyx_XDECREF(__pyx_t_8);
5623 __Pyx_XDECREF(__pyx_t_9);
5624 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
5628 __Pyx_RefNannyFinishContext();
5640static CYTHON_INLINE
int __pyx_f_5numpy_import_umath(
void) {
5642 __Pyx_RefNannyDeclarations
5643 PyObject *__pyx_t_1 = NULL;
5644 PyObject *__pyx_t_2 = NULL;
5645 PyObject *__pyx_t_3 = NULL;
5647 PyObject *__pyx_t_5 = NULL;
5648 PyObject *__pyx_t_6 = NULL;
5649 PyObject *__pyx_t_7 = NULL;
5650 PyObject *__pyx_t_8 = NULL;
5651 PyObject *__pyx_t_9 = NULL;
5653 int __pyx_lineno = 0;
5654 const char *__pyx_filename = NULL;
5655 int __pyx_clineno = 0;
5656 __Pyx_RefNannySetupContext(
"import_umath", 0);
5666 __Pyx_PyThreadState_declare
5667 __Pyx_PyThreadState_assign
5668 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
5669 __Pyx_XGOTREF(__pyx_t_1);
5670 __Pyx_XGOTREF(__pyx_t_2);
5671 __Pyx_XGOTREF(__pyx_t_3);
5681 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 1085, __pyx_L3_error)
5692 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5693 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5694 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5695 goto __pyx_L8_try_end;
5705 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
5707 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
5708 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1086, __pyx_L5_except_error)
5709 __Pyx_XGOTREF(__pyx_t_5);
5710 __Pyx_XGOTREF(__pyx_t_6);
5711 __Pyx_XGOTREF(__pyx_t_7);
5723 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_umath_failed_to_impo};
5724 __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ImportError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
5725 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5726 if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1087, __pyx_L5_except_error)
5727 __Pyx_GOTREF(__pyx_t_8);
5729 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
5730 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5731 __PYX_ERR(1, 1087, __pyx_L5_except_error)
5733 goto __pyx_L5_except_error;
5742 __pyx_L5_except_error:;
5743 __Pyx_XGIVEREF(__pyx_t_1);
5744 __Pyx_XGIVEREF(__pyx_t_2);
5745 __Pyx_XGIVEREF(__pyx_t_3);
5746 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
5747 goto __pyx_L1_error;
5763 __Pyx_XDECREF(__pyx_t_5);
5764 __Pyx_XDECREF(__pyx_t_6);
5765 __Pyx_XDECREF(__pyx_t_7);
5766 __Pyx_XDECREF(__pyx_t_8);
5767 __Pyx_XDECREF(__pyx_t_9);
5768 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
5772 __Pyx_RefNannyFinishContext();
5784static CYTHON_INLINE
int __pyx_f_5numpy_import_ufunc(
void) {
5786 __Pyx_RefNannyDeclarations
5787 PyObject *__pyx_t_1 = NULL;
5788 PyObject *__pyx_t_2 = NULL;
5789 PyObject *__pyx_t_3 = NULL;
5791 PyObject *__pyx_t_5 = NULL;
5792 PyObject *__pyx_t_6 = NULL;
5793 PyObject *__pyx_t_7 = NULL;
5794 PyObject *__pyx_t_8 = NULL;
5795 PyObject *__pyx_t_9 = NULL;
5797 int __pyx_lineno = 0;
5798 const char *__pyx_filename = NULL;
5799 int __pyx_clineno = 0;
5800 __Pyx_RefNannySetupContext(
"import_ufunc", 0);
5810 __Pyx_PyThreadState_declare
5811 __Pyx_PyThreadState_assign
5812 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
5813 __Pyx_XGOTREF(__pyx_t_1);
5814 __Pyx_XGOTREF(__pyx_t_2);
5815 __Pyx_XGOTREF(__pyx_t_3);
5825 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 1091, __pyx_L3_error)
5836 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5837 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5838 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5839 goto __pyx_L8_try_end;
5849 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
5851 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
5852 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1092, __pyx_L5_except_error)
5853 __Pyx_XGOTREF(__pyx_t_5);
5854 __Pyx_XGOTREF(__pyx_t_6);
5855 __Pyx_XGOTREF(__pyx_t_7);
5867 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_umath_failed_to_impo};
5868 __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ImportError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
5869 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5870 if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1093, __pyx_L5_except_error)
5871 __Pyx_GOTREF(__pyx_t_8);
5873 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
5874 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5875 __PYX_ERR(1, 1093, __pyx_L5_except_error)
5877 goto __pyx_L5_except_error;
5886 __pyx_L5_except_error:;
5887 __Pyx_XGIVEREF(__pyx_t_1);
5888 __Pyx_XGIVEREF(__pyx_t_2);
5889 __Pyx_XGIVEREF(__pyx_t_3);
5890 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
5891 goto __pyx_L1_error;
5907 __Pyx_XDECREF(__pyx_t_5);
5908 __Pyx_XDECREF(__pyx_t_6);
5909 __Pyx_XDECREF(__pyx_t_7);
5910 __Pyx_XDECREF(__pyx_t_8);
5911 __Pyx_XDECREF(__pyx_t_9);
5912 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
5916 __Pyx_RefNannyFinishContext();
5928static CYTHON_INLINE
int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
5940 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
5966static CYTHON_INLINE
int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
5978 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
6004static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
6005 npy_datetime __pyx_r;
6016 __pyx_r = _PyDatetimeScalarObject_GetValue(__pyx_v_obj);
6041static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
6042 npy_timedelta __pyx_r;
6053 __pyx_r = _PyTimedeltaScalarObject_GetValue(__pyx_v_obj);
6078static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
6079 NPY_DATETIMEUNIT __pyx_r;
6090 __pyx_r = _PyDatetimeScalarObject_GetMetadata(__pyx_v_obj).base;
6116static PyObject *__pyx_pw_6fenton_6Fenton_1writeInput(PyObject *__pyx_self,
6117#
if CYTHON_VECTORCALL
6118PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6120PyObject *__pyx_args, PyObject *__pyx_kwds
6123PyDoc_STRVAR(__pyx_doc_6fenton_6Fenton_writeInput,
"\n Creates input files for Fourier script\n\n Parameters\n ----------\n waveheight: double\n Height of wave\n depth: double\n Water depth\n period: double\n Wave period\n mode: string\n \047Period\047 or \047Wavelength\047\n current_criterion: int\n 1: Euler, 2: Stokes\n current_magnitude: double\n Magnitude of current\n ncoeffs: int\n Number of Fourier coefficients\n height_steps: int\n Number of height steps to reach H/d\n g: double\n Gravity\n niter: int\n Max number of iterations \n conv_crit: double\n Criterion for convergence\n points_freesurface: int\n Number of points on free surface\n points_velocity: int\n Number of velocity/acceleration profiles to print out\n points_vertical: int\n Number of vertical points in each profile\n ");
6124static PyMethodDef __pyx_mdef_6fenton_6Fenton_1writeInput = {
"writeInput", (PyCFunction)(
void(*)(
void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6fenton_6Fenton_1writeInput, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6fenton_6Fenton_writeInput};
6125static PyObject *__pyx_pw_6fenton_6Fenton_1writeInput(PyObject *__pyx_self,
6126#
if CYTHON_VECTORCALL
6127PyObject *
const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6129PyObject *__pyx_args, PyObject *__pyx_kwds
6132 PyObject *__pyx_v_waveheight = 0;
6133 PyObject *__pyx_v_depth = 0;
6134 PyObject *__pyx_v_period = 0;
6135 PyObject *__pyx_v_wavelength = 0;
6136 PyObject *__pyx_v_mode = 0;
6137 PyObject *__pyx_v_current_criterion = 0;
6138 PyObject *__pyx_v_current_magnitude = 0;
6139 PyObject *__pyx_v_ncoeffs = 0;
6140 PyObject *__pyx_v_height_steps = 0;
6141 PyObject *__pyx_v_g = 0;
6142 PyObject *__pyx_v_niter = 0;
6143 PyObject *__pyx_v_conv_crit = 0;
6144 CYTHON_UNUSED PyObject *__pyx_v_points_freesurface = 0;
6145 CYTHON_UNUSED PyObject *__pyx_v_points_velocity = 0;
6146 CYTHON_UNUSED PyObject *__pyx_v_points_vertical = 0;
6147 #if !CYTHON_VECTORCALL
6148 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6150 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
6151 PyObject* values[15] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
6152 int __pyx_lineno = 0;
6153 const char *__pyx_filename = NULL;
6154 int __pyx_clineno = 0;
6155 PyObject *__pyx_r = 0;
6156 __Pyx_RefNannyDeclarations
6157 __Pyx_RefNannySetupContext(
"writeInput (wrapper)", 0);
6158 #if !CYTHON_VECTORCALL
6159 #if CYTHON_ASSUME_SAFE_SIZE
6160 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6162 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
6165 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6167 PyObject **
const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_waveheight,&__pyx_mstate_global->__pyx_n_u_depth,&__pyx_mstate_global->__pyx_n_u_period,&__pyx_mstate_global->__pyx_n_u_wavelength,&__pyx_mstate_global->__pyx_n_u_mode,&__pyx_mstate_global->__pyx_n_u_current_criterion,&__pyx_mstate_global->__pyx_n_u_current_magnitude,&__pyx_mstate_global->__pyx_n_u_ncoeffs,&__pyx_mstate_global->__pyx_n_u_height_steps,&__pyx_mstate_global->__pyx_n_u_g,&__pyx_mstate_global->__pyx_n_u_niter,&__pyx_mstate_global->__pyx_n_u_conv_crit,&__pyx_mstate_global->__pyx_n_u_points_freesurface,&__pyx_mstate_global->__pyx_n_u_points_velocity,&__pyx_mstate_global->__pyx_n_u_points_vertical,0};
6168 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
6169 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 17, __pyx_L3_error)
6170 if (__pyx_kwds_len > 0) {
6171 switch (__pyx_nargs) {
6173 values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
6174 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 17, __pyx_L3_error)
6177 values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
6178 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 17, __pyx_L3_error)
6181 values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
6182 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 17, __pyx_L3_error)
6185 values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
6186 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 17, __pyx_L3_error)
6189 values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
6190 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 17, __pyx_L3_error)
6193 values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
6194 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 17, __pyx_L3_error)
6197 values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
6198 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 17, __pyx_L3_error)
6201 values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
6202 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 17, __pyx_L3_error)
6205 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
6206 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 17, __pyx_L3_error)
6209 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
6210 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 17, __pyx_L3_error)
6213 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
6214 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 17, __pyx_L3_error)
6217 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
6218 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 17, __pyx_L3_error)
6221 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
6222 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 17, __pyx_L3_error)
6225 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
6226 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 17, __pyx_L3_error)
6229 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
6230 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 17, __pyx_L3_error)
6233 default:
goto __pyx_L5_argtuple_error;
6235 const Py_ssize_t kwd_pos_args = __pyx_nargs;
6236 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len,
"writeInput", 0) < (0)) __PYX_ERR(0, 17, __pyx_L3_error)
6245 if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
6254 if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
6255 if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_n_u_Period)));
6256 if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_int_1)));
6257 if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_int_0)));
6258 if (!values[7]) values[7] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_int_8)));
6259 if (!values[8]) values[8] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_int_1)));
6260 if (!values[9]) values[9] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_float_9_81)));
6261 if (!values[10]) values[10] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_int_40)));
6262 if (!values[11]) values[11] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_float_1_eneg_05)));
6263 if (!values[12]) values[12] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_int_50)));
6264 if (!values[13]) values[13] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_int_16)));
6265 if (!values[14]) values[14] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_int_20)));
6266 for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
6267 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid(
"writeInput", 0, 2, 15, i); __PYX_ERR(0, 17, __pyx_L3_error) }
6270 switch (__pyx_nargs) {
6272 values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
6273 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 17, __pyx_L3_error)
6276 values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
6277 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 17, __pyx_L3_error)
6280 values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
6281 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 17, __pyx_L3_error)
6284 values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
6285 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 17, __pyx_L3_error)
6288 values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
6289 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 17, __pyx_L3_error)
6292 values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
6293 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 17, __pyx_L3_error)
6296 values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
6297 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 17, __pyx_L3_error)
6300 values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
6301 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 17, __pyx_L3_error)
6304 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
6305 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 17, __pyx_L3_error)
6308 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
6309 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 17, __pyx_L3_error)
6312 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
6313 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 17, __pyx_L3_error)
6316 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
6317 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 17, __pyx_L3_error)
6320 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
6321 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 17, __pyx_L3_error)
6324 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
6325 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 17, __pyx_L3_error)
6326 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
6327 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 17, __pyx_L3_error)
6329 default:
goto __pyx_L5_argtuple_error;
6339 if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
6348 if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
6349 if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_n_u_Period)));
6350 if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_int_1)));
6351 if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_int_0)));
6352 if (!values[7]) values[7] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_int_8)));
6353 if (!values[8]) values[8] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_int_1)));
6354 if (!values[9]) values[9] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_float_9_81)));
6355 if (!values[10]) values[10] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_int_40)));
6356 if (!values[11]) values[11] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_float_1_eneg_05)));
6357 if (!values[12]) values[12] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_int_50)));
6358 if (!values[13]) values[13] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_int_16)));
6359 if (!values[14]) values[14] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_int_20)));
6361 __pyx_v_waveheight = values[0];
6362 __pyx_v_depth = values[1];
6363 __pyx_v_period = values[2];
6364 __pyx_v_wavelength = values[3];
6365 __pyx_v_mode = values[4];
6366 __pyx_v_current_criterion = values[5];
6367 __pyx_v_current_magnitude = values[6];
6368 __pyx_v_ncoeffs = values[7];
6369 __pyx_v_height_steps = values[8];
6370 __pyx_v_g = values[9];
6371 __pyx_v_niter = values[10];
6372 __pyx_v_conv_crit = values[11];
6373 __pyx_v_points_freesurface = values[12];
6374 __pyx_v_points_velocity = values[13];
6375 __pyx_v_points_vertical = values[14];
6378 __pyx_L5_argtuple_error:;
6379 __Pyx_RaiseArgtupleInvalid(
"writeInput", 0, 2, 15, __pyx_nargs); __PYX_ERR(0, 17, __pyx_L3_error)
6381 goto __pyx_L4_argument_unpacking_done;
6383 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
6384 Py_XDECREF(values[__pyx_temp]);
6386 __Pyx_AddTraceback(
"fenton.Fenton.writeInput", __pyx_clineno, __pyx_lineno, __pyx_filename);
6387 __Pyx_RefNannyFinishContext();
6389 __pyx_L4_argument_unpacking_done:;
6390 __pyx_r = __pyx_pf_6fenton_6Fenton_writeInput(__pyx_self, __pyx_v_waveheight, __pyx_v_depth, __pyx_v_period, __pyx_v_wavelength, __pyx_v_mode, __pyx_v_current_criterion, __pyx_v_current_magnitude, __pyx_v_ncoeffs, __pyx_v_height_steps, __pyx_v_g, __pyx_v_niter, __pyx_v_conv_crit, __pyx_v_points_freesurface, __pyx_v_points_velocity, __pyx_v_points_vertical);
6401 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(
sizeof(values)/
sizeof(values[0])); ++__pyx_temp) {
6402 Py_XDECREF(values[__pyx_temp]);
6404 __Pyx_RefNannyFinishContext();
6408static PyObject *__pyx_pf_6fenton_6Fenton_writeInput(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_waveheight, PyObject *__pyx_v_depth, PyObject *__pyx_v_period, PyObject *__pyx_v_wavelength, PyObject *__pyx_v_mode, PyObject *__pyx_v_current_criterion, PyObject *__pyx_v_current_magnitude, PyObject *__pyx_v_ncoeffs, PyObject *__pyx_v_height_steps, PyObject *__pyx_v_g, PyObject *__pyx_v_niter, PyObject *__pyx_v_conv_crit, CYTHON_UNUSED PyObject *__pyx_v_points_freesurface, CYTHON_UNUSED PyObject *__pyx_v_points_velocity, CYTHON_UNUSED PyObject *__pyx_v_points_vertical) {
6409 PyObject *__pyx_v_filename = NULL;
6410 PyObject *__pyx_v_f = NULL;
6411 PyObject *__pyx_v_waveheight_dimless = NULL;
6412 PyObject *__pyx_v_length_dimless = NULL;
6413 PyObject *__pyx_v_current_magnitude_dimless = NULL;
6414 PyObject *__pyx_r = NULL;
6415 __Pyx_RefNannyDeclarations
6418 PyObject *__pyx_t_3 = NULL;
6419 PyObject *__pyx_t_4 = NULL;
6421 PyObject *__pyx_t_6 = NULL;
6422 PyObject *__pyx_t_7 = NULL;
6423 PyObject *__pyx_t_8 = NULL;
6424 PyObject *__pyx_t_9 = NULL;
6425 PyObject *__pyx_t_10 = NULL;
6426 PyObject *__pyx_t_11 = NULL;
6427 PyObject *__pyx_t_12 = NULL;
6428 PyObject *__pyx_t_13 = NULL;
6429 int __pyx_lineno = 0;
6430 const char *__pyx_filename = NULL;
6431 int __pyx_clineno = 0;
6432 __Pyx_RefNannySetupContext(
"writeInput", 0);
6433 __Pyx_INCREF(__pyx_v_mode);
6442 #ifndef CYTHON_WITHOUT_ASSERTIONS
6443 if (unlikely(__pyx_assertions_enabled())) {
6444 __pyx_t_2 = (__pyx_v_period != Py_None);
6449 __pyx_t_1 = __pyx_t_2;
6451 goto __pyx_L3_bool_binop_done;
6453 __pyx_t_2 = (__pyx_v_wavelength != Py_None);
6455 __pyx_t_1 = __pyx_t_2;
6457 __pyx_L3_bool_binop_done:;
6458 if (unlikely(!__pyx_t_1)) {
6459 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_mstate_global->__pyx_kp_u_Period_or_wavelength_must_be_set, 0, 0);
6460 __PYX_ERR(0, 67, __pyx_L1_error)
6465 if ((1));
else __PYX_ERR(0, 67, __pyx_L1_error)
6475 __pyx_t_2 = (__pyx_v_period == Py_None);
6480 __pyx_t_1 = __pyx_t_2;
6482 goto __pyx_L6_bool_binop_done;
6484 __pyx_t_2 = (__pyx_v_wavelength != Py_None);
6486 __pyx_t_1 = __pyx_t_2;
6488 __pyx_L6_bool_binop_done:;
6499 __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_Wavelength);
6500 __Pyx_DECREF_SET(__pyx_v_mode, __pyx_mstate_global->__pyx_n_u_Wavelength);
6518 __pyx_t_2 = (__pyx_v_period != Py_None);
6523 __pyx_t_1 = __pyx_t_2;
6525 goto __pyx_L9_bool_binop_done;
6527 __pyx_t_2 = (__pyx_v_wavelength == Py_None);
6529 __pyx_t_1 = __pyx_t_2;
6531 __pyx_L9_bool_binop_done:;
6542 __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_Period);
6543 __Pyx_DECREF_SET(__pyx_v_mode, __pyx_mstate_global->__pyx_n_u_Period);
6561 __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_Data_dat);
6562 __pyx_v_filename = __pyx_mstate_global->__pyx_kp_u_Data_dat;
6575 PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_filename, __pyx_mstate_global->__pyx_n_u_w};
6576 __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_open, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
6577 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6578 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 73, __pyx_L1_error)
6579 __Pyx_GOTREF(__pyx_t_3);
6581 __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_exit);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 73, __pyx_L1_error)
6582 __Pyx_GOTREF(__pyx_t_6);
6584 __pyx_t_8 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_enter);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 73, __pyx_L11_error)
6585 __Pyx_GOTREF(__pyx_t_8);
6587 #if CYTHON_UNPACK_METHODS
6588 if (likely(PyMethod_Check(__pyx_t_8))) {
6589 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
6591 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
6592 __Pyx_INCREF(__pyx_t_7);
6593 __Pyx_INCREF(__pyx__function);
6594 __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
6599 PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
6600 __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
6601 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6602 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6603 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 73, __pyx_L11_error)
6604 __Pyx_GOTREF(__pyx_t_4);
6606 __pyx_t_8 = __pyx_t_4;
6608 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6611 __Pyx_PyThreadState_declare
6612 __Pyx_PyThreadState_assign
6613 __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
6614 __Pyx_XGOTREF(__pyx_t_9);
6615 __Pyx_XGOTREF(__pyx_t_10);
6616 __Pyx_XGOTREF(__pyx_t_11);
6618 __pyx_v_f = __pyx_t_8;
6628 __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_v_waveheight, __pyx_v_depth);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 74, __pyx_L15_error)
6629 __Pyx_GOTREF(__pyx_t_8);
6630 __pyx_v_waveheight_dimless = __pyx_t_8;
6640 __Pyx_INCREF(__pyx_v_mode);
6641 __Pyx_DECREF_SET(__pyx_v_mode, __pyx_v_mode);
6650 __pyx_t_1 = __Pyx_PyObject_CompareBoolEq_object_str(__pyx_v_mode, __pyx_mstate_global->__pyx_n_u_Period, Py_EQ);
if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 76, __pyx_L15_error)
6662 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L15_error)
6663 __Pyx_GOTREF(__pyx_t_4);
6664 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_sqrt);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 77, __pyx_L15_error)
6665 __Pyx_GOTREF(__pyx_t_7);
6666 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6667 __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_v_g, __pyx_v_depth);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L15_error)
6668 __Pyx_GOTREF(__pyx_t_4);
6670 #if CYTHON_UNPACK_METHODS
6671 if (unlikely(PyMethod_Check(__pyx_t_7))) {
6672 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
6674 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
6675 __Pyx_INCREF(__pyx_t_3);
6676 __Pyx_INCREF(__pyx__function);
6677 __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
6682 PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
6683 __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
6684 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6685 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6686 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6687 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 77, __pyx_L15_error)
6688 __Pyx_GOTREF(__pyx_t_8);
6690 __pyx_t_7 = __Pyx_PyNumber_Multiply_object_object(__pyx_v_period, __pyx_t_8);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 77, __pyx_L15_error)
6691 __Pyx_GOTREF(__pyx_t_7);
6692 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6693 __pyx_v_length_dimless = __pyx_t_7;
6713 __pyx_t_1 = __Pyx_PyObject_CompareBoolEq_object_str(__pyx_v_mode, __pyx_mstate_global->__pyx_n_u_Wavelength, Py_EQ);
if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 78, __pyx_L15_error)
6724 __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_v_wavelength, __pyx_v_depth);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 79, __pyx_L15_error)
6725 __Pyx_GOTREF(__pyx_t_7);
6726 __pyx_v_length_dimless = __pyx_t_7;
6747 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_np);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 80, __pyx_L15_error)
6748 __Pyx_GOTREF(__pyx_t_4);
6749 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_sqrt);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L15_error)
6750 __Pyx_GOTREF(__pyx_t_3);
6751 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6752 __pyx_t_4 = __Pyx_PyNumber_Multiply_object_object(__pyx_v_g, __pyx_v_depth);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 80, __pyx_L15_error)
6753 __Pyx_GOTREF(__pyx_t_4);
6755 #if CYTHON_UNPACK_METHODS
6756 if (unlikely(PyMethod_Check(__pyx_t_3))) {
6757 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
6759 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
6760 __Pyx_INCREF(__pyx_t_8);
6761 __Pyx_INCREF(__pyx__function);
6762 __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
6767 PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_4};
6768 __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
6769 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
6770 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6771 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6772 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 80, __pyx_L15_error)
6773 __Pyx_GOTREF(__pyx_t_7);
6775 __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_v_current_magnitude, __pyx_t_7);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L15_error)
6776 __Pyx_GOTREF(__pyx_t_3);
6777 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6778 __pyx_v_current_magnitude_dimless = __pyx_t_3;
6788 __pyx_t_7 = __pyx_v_f;
6789 __Pyx_INCREF(__pyx_t_7);
6798 __pyx_t_8 = __pyx_mstate_global->__pyx_kp_u_Wave_waveheight_mode_length_curr;
6799 __Pyx_INCREF(__pyx_t_8);
6800 if (unlikely(!__pyx_v_length_dimless)) { __Pyx_RaiseUnboundLocalError(
"length_dimless"); __PYX_ERR(0, 89, __pyx_L15_error) }
6811 PyObject *__pyx_callargs[8] = {__pyx_t_8, __pyx_v_waveheight_dimless, __pyx_v_mode, __pyx_v_length_dimless, __pyx_v_current_criterion, __pyx_v_current_magnitude_dimless, __pyx_v_ncoeffs, __pyx_v_height_steps};
6812 #if CYTHON_VECTORCALL
6813 __pyx_t_12 = __pyx_mstate_global->__pyx_tuple[0];
6814 if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 89, __pyx_L15_error)
6815 __Pyx_INCREF(__pyx_t_12);
6818 PyObject *__pyx_temp[7] = {__pyx_mstate_global->__pyx_n_u_waveheight, __pyx_mstate_global->__pyx_n_u_mode, __pyx_mstate_global->__pyx_n_u_length, __pyx_mstate_global->__pyx_n_u_current_criterion, __pyx_mstate_global->__pyx_n_u_current_magnitude, __pyx_mstate_global->__pyx_n_u_ncoeffs, __pyx_mstate_global->__pyx_n_u_height_steps};
6819 __pyx_t_12 = __Pyx_MakeKwargDict(__pyx_temp, __pyx_callargs+1, 7);
6820 if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 89, __pyx_L15_error)
6821 __Pyx_GOTREF(__pyx_t_12);
6824 __pyx_t_4 = __Pyx_Object_VectorcallMethodKwds((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_12);
6825 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
6826 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
6827 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 89, __pyx_L15_error)
6828 __Pyx_GOTREF(__pyx_t_4);
6838 if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError(
"str", __pyx_t_4))) __PYX_ERR(0, 89, __pyx_L15_error)
6841 PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_4};
6842 __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
6843 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6844 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6845 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 81, __pyx_L15_error)
6846 __Pyx_GOTREF(__pyx_t_3);
6848 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6858 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
6859 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
6860 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
6861 goto __pyx_L20_try_end;
6863 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
6864 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6865 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6866 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6867 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
6869 __Pyx_AddTraceback(
"fenton.Fenton.writeInput", __pyx_clineno, __pyx_lineno, __pyx_filename);
6870 if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_7) < 0) __PYX_ERR(0, 73, __pyx_L17_except_error)
6871 __Pyx_XGOTREF(__pyx_t_3);
6872 __Pyx_XGOTREF(__pyx_t_4);
6873 __Pyx_XGOTREF(__pyx_t_7);
6875 PyObject* __pyx_temp[3] = {__pyx_t_3, __pyx_t_4, __pyx_t_7};
6876 __pyx_t_12 = __Pyx_PyTuple_FromArray(__pyx_temp, 3);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 73, __pyx_L17_except_error)
6877 __Pyx_GOTREF(__pyx_t_12);
6879 __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_12, NULL);
6880 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6881 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
6882 if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 73, __pyx_L17_except_error)
6883 __Pyx_GOTREF(__pyx_t_13);
6884 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_13);
6885 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
6886 if (__pyx_t_1 < (0)) __PYX_ERR(0, 73, __pyx_L17_except_error)
6887 __pyx_t_2 = (!__pyx_t_1);
6890 if (unlikely(__pyx_t_2)) {
6892 __Pyx_GIVEREF(__pyx_t_3);
6893 __Pyx_GIVEREF(__pyx_t_4);
6894 __Pyx_XGIVEREF(__pyx_t_7);
6895 __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_4, __pyx_t_7);
6896 __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_7 = 0;
6897 __PYX_ERR(0, 73, __pyx_L17_except_error)
6899 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6900 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6901 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6902 goto __pyx_L16_exception_handled;
6904 __pyx_L17_except_error:;
6905 __Pyx_XGIVEREF(__pyx_t_9);
6906 __Pyx_XGIVEREF(__pyx_t_10);
6907 __Pyx_XGIVEREF(__pyx_t_11);
6908 __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
6909 goto __pyx_L1_error;
6910 __pyx_L16_exception_handled:;
6911 __Pyx_XGIVEREF(__pyx_t_9);
6912 __Pyx_XGIVEREF(__pyx_t_10);
6913 __Pyx_XGIVEREF(__pyx_t_11);
6914 __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
6921 __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[1], NULL);
6922 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6923 if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 73, __pyx_L1_error)
6924 __Pyx_GOTREF(__pyx_t_11);
6925 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
6933 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6934 goto __pyx_L1_error;
6945 __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_Convergence_dat);
6946 __Pyx_DECREF_SET(__pyx_v_filename, __pyx_mstate_global->__pyx_kp_u_Convergence_dat);
6959 PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_filename, __pyx_mstate_global->__pyx_n_u_w};
6960 __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_open, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
6961 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6962 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 93, __pyx_L1_error)
6963 __Pyx_GOTREF(__pyx_t_7);
6965 __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_exit);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 93, __pyx_L1_error)
6966 __Pyx_GOTREF(__pyx_t_6);
6968 __pyx_t_12 = __Pyx_PyObject_LookupSpecial(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_enter);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 93, __pyx_L26_error)
6969 __Pyx_GOTREF(__pyx_t_12);
6971 #if CYTHON_UNPACK_METHODS
6972 if (likely(PyMethod_Check(__pyx_t_12))) {
6973 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_12);
6975 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12);
6976 __Pyx_INCREF(__pyx_t_3);
6977 __Pyx_INCREF(__pyx__function);
6978 __Pyx_DECREF_SET(__pyx_t_12, __pyx__function);
6983 PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
6984 __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_12, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
6985 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6986 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
6987 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 93, __pyx_L26_error)
6988 __Pyx_GOTREF(__pyx_t_4);
6990 __pyx_t_12 = __pyx_t_4;
6992 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6995 __Pyx_PyThreadState_declare
6996 __Pyx_PyThreadState_assign
6997 __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
6998 __Pyx_XGOTREF(__pyx_t_11);
6999 __Pyx_XGOTREF(__pyx_t_10);
7000 __Pyx_XGOTREF(__pyx_t_9);
7002 __Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_12);
7012 __pyx_t_7 = __pyx_v_f;
7013 __Pyx_INCREF(__pyx_t_7);
7022 __pyx_t_3 = __pyx_mstate_global->__pyx_kp_u_Control_file_to_control_converge;
7023 __Pyx_INCREF(__pyx_t_3);
7026 PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_niter, __pyx_v_conv_crit};
7027 #if CYTHON_VECTORCALL
7028 __pyx_t_8 = __pyx_mstate_global->__pyx_tuple[2];
7029 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 97, __pyx_L30_error)
7030 __Pyx_INCREF(__pyx_t_8);
7033 PyObject *__pyx_temp[2] = {__pyx_mstate_global->__pyx_n_u_niter, __pyx_mstate_global->__pyx_n_u_conv_crit};
7034 __pyx_t_8 = __Pyx_MakeKwargDict(__pyx_temp, __pyx_callargs+1, 2);
7035 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 97, __pyx_L30_error)
7036 __Pyx_GOTREF(__pyx_t_8);
7039 __pyx_t_4 = __Pyx_Object_VectorcallMethodKwds((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_8);
7040 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7041 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7042 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 97, __pyx_L30_error)
7043 __Pyx_GOTREF(__pyx_t_4);
7045 if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError(
"str", __pyx_t_4))) __PYX_ERR(0, 97, __pyx_L30_error)
7048 PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_4};
7049 __pyx_t_12 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
7050 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
7051 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7052 if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 94, __pyx_L30_error)
7053 __Pyx_GOTREF(__pyx_t_12);
7055 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7065 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
7066 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
7067 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
7068 goto __pyx_L35_try_end;
7070 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
7071 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7072 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7073 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
7074 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
7076 __Pyx_AddTraceback(
"fenton.Fenton.writeInput", __pyx_clineno, __pyx_lineno, __pyx_filename);
7077 if (__Pyx_GetException(&__pyx_t_12, &__pyx_t_4, &__pyx_t_7) < 0) __PYX_ERR(0, 93, __pyx_L32_except_error)
7078 __Pyx_XGOTREF(__pyx_t_12);
7079 __Pyx_XGOTREF(__pyx_t_4);
7080 __Pyx_XGOTREF(__pyx_t_7);
7082 PyObject* __pyx_temp[3] = {__pyx_t_12, __pyx_t_4, __pyx_t_7};
7083 __pyx_t_8 = __Pyx_PyTuple_FromArray(__pyx_temp, 3);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 93, __pyx_L32_except_error)
7084 __Pyx_GOTREF(__pyx_t_8);
7086 __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL);
7087 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7088 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7089 if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 93, __pyx_L32_except_error)
7090 __Pyx_GOTREF(__pyx_t_13);
7091 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13);
7092 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7093 if (__pyx_t_2 < (0)) __PYX_ERR(0, 93, __pyx_L32_except_error)
7094 __pyx_t_1 = (!__pyx_t_2);
7097 if (unlikely(__pyx_t_1)) {
7099 __Pyx_GIVEREF(__pyx_t_12);
7100 __Pyx_GIVEREF(__pyx_t_4);
7101 __Pyx_XGIVEREF(__pyx_t_7);
7102 __Pyx_ErrRestoreWithState(__pyx_t_12, __pyx_t_4, __pyx_t_7);
7103 __pyx_t_12 = 0; __pyx_t_4 = 0; __pyx_t_7 = 0;
7104 __PYX_ERR(0, 93, __pyx_L32_except_error)
7106 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
7107 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7108 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
7109 goto __pyx_L31_exception_handled;
7111 __pyx_L32_except_error:;
7112 __Pyx_XGIVEREF(__pyx_t_11);
7113 __Pyx_XGIVEREF(__pyx_t_10);
7114 __Pyx_XGIVEREF(__pyx_t_9);
7115 __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9);
7116 goto __pyx_L1_error;
7117 __pyx_L31_exception_handled:;
7118 __Pyx_XGIVEREF(__pyx_t_11);
7119 __Pyx_XGIVEREF(__pyx_t_10);
7120 __Pyx_XGIVEREF(__pyx_t_9);
7121 __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9);
7128 __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[1], NULL);
7129 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7130 if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 93, __pyx_L1_error)
7131 __Pyx_GOTREF(__pyx_t_9);
7132 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7140 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7141 goto __pyx_L1_error;
7152 __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_Points_dat);
7153 __Pyx_DECREF_SET(__pyx_v_filename, __pyx_mstate_global->__pyx_kp_u_Points_dat);
7166 PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_filename, __pyx_mstate_global->__pyx_n_u_w};
7167 __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_open, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
7168 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7169 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 100, __pyx_L1_error)
7170 __Pyx_GOTREF(__pyx_t_7);
7172 __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_exit);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 100, __pyx_L1_error)
7173 __Pyx_GOTREF(__pyx_t_6);
7175 __pyx_t_8 = __Pyx_PyObject_LookupSpecial(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_enter);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 100, __pyx_L40_error)
7176 __Pyx_GOTREF(__pyx_t_8);
7178 #if CYTHON_UNPACK_METHODS
7179 if (likely(PyMethod_Check(__pyx_t_8))) {
7180 __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_8);
7182 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
7183 __Pyx_INCREF(__pyx_t_12);
7184 __Pyx_INCREF(__pyx__function);
7185 __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
7190 PyObject *__pyx_callargs[2] = {__pyx_t_12, NULL};
7191 __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
7192 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
7193 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7194 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 100, __pyx_L40_error)
7195 __Pyx_GOTREF(__pyx_t_4);
7197 __pyx_t_8 = __pyx_t_4;
7199 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7202 __Pyx_PyThreadState_declare
7203 __Pyx_PyThreadState_assign
7204 __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
7205 __Pyx_XGOTREF(__pyx_t_9);
7206 __Pyx_XGOTREF(__pyx_t_10);
7207 __Pyx_XGOTREF(__pyx_t_11);
7209 __Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_8);
7219 __pyx_t_7 = __pyx_v_f;
7220 __Pyx_INCREF(__pyx_t_7);
7229 __pyx_t_12 = __pyx_mstate_global->__pyx_kp_u_Control_file_to_control_converge;
7230 __Pyx_INCREF(__pyx_t_12);
7233 PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_v_niter, __pyx_v_conv_crit};
7234 #if CYTHON_VECTORCALL
7235 __pyx_t_3 = __pyx_mstate_global->__pyx_tuple[2];
7236 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L44_error)
7237 __Pyx_INCREF(__pyx_t_3);
7240 PyObject *__pyx_temp[2] = {__pyx_mstate_global->__pyx_n_u_niter, __pyx_mstate_global->__pyx_n_u_conv_crit};
7241 __pyx_t_3 = __Pyx_MakeKwargDict(__pyx_temp, __pyx_callargs+1, 2);
7242 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L44_error)
7243 __Pyx_GOTREF(__pyx_t_3);
7246 __pyx_t_4 = __Pyx_Object_VectorcallMethodKwds((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3);
7247 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
7248 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7249 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 104, __pyx_L44_error)
7250 __Pyx_GOTREF(__pyx_t_4);
7252 if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError(
"str", __pyx_t_4))) __PYX_ERR(0, 104, __pyx_L44_error)
7255 PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_4};
7256 __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
7257 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
7258 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7259 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 101, __pyx_L44_error)
7260 __Pyx_GOTREF(__pyx_t_8);
7262 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7272 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
7273 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
7274 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
7275 goto __pyx_L49_try_end;
7277 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
7278 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7279 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7280 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
7281 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
7283 __Pyx_AddTraceback(
"fenton.Fenton.writeInput", __pyx_clineno, __pyx_lineno, __pyx_filename);
7284 if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_4, &__pyx_t_7) < 0) __PYX_ERR(0, 100, __pyx_L46_except_error)
7285 __Pyx_XGOTREF(__pyx_t_8);
7286 __Pyx_XGOTREF(__pyx_t_4);
7287 __Pyx_XGOTREF(__pyx_t_7);
7289 PyObject* __pyx_temp[3] = {__pyx_t_8, __pyx_t_4, __pyx_t_7};
7290 __pyx_t_3 = __Pyx_PyTuple_FromArray(__pyx_temp, 3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 100, __pyx_L46_except_error)
7291 __Pyx_GOTREF(__pyx_t_3);
7293 __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL);
7294 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7295 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7296 if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 100, __pyx_L46_except_error)
7297 __Pyx_GOTREF(__pyx_t_13);
7298 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_13);
7299 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7300 if (__pyx_t_1 < (0)) __PYX_ERR(0, 100, __pyx_L46_except_error)
7301 __pyx_t_2 = (!__pyx_t_1);
7304 if (unlikely(__pyx_t_2)) {
7306 __Pyx_GIVEREF(__pyx_t_8);
7307 __Pyx_GIVEREF(__pyx_t_4);
7308 __Pyx_XGIVEREF(__pyx_t_7);
7309 __Pyx_ErrRestoreWithState(__pyx_t_8, __pyx_t_4, __pyx_t_7);
7310 __pyx_t_8 = 0; __pyx_t_4 = 0; __pyx_t_7 = 0;
7311 __PYX_ERR(0, 100, __pyx_L46_except_error)
7313 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
7314 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7315 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
7316 goto __pyx_L45_exception_handled;
7318 __pyx_L46_except_error:;
7319 __Pyx_XGIVEREF(__pyx_t_9);
7320 __Pyx_XGIVEREF(__pyx_t_10);
7321 __Pyx_XGIVEREF(__pyx_t_11);
7322 __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
7323 goto __pyx_L1_error;
7324 __pyx_L45_exception_handled:;
7325 __Pyx_XGIVEREF(__pyx_t_9);
7326 __Pyx_XGIVEREF(__pyx_t_10);
7327 __Pyx_XGIVEREF(__pyx_t_11);
7328 __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
7335 __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[1], NULL);
7336 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7337 if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 100, __pyx_L1_error)
7338 __Pyx_GOTREF(__pyx_t_11);
7339 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7347 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7348 goto __pyx_L1_error;
7361 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7364 __Pyx_XDECREF(__pyx_t_3);
7365 __Pyx_XDECREF(__pyx_t_4);
7366 __Pyx_XDECREF(__pyx_t_7);
7367 __Pyx_XDECREF(__pyx_t_8);
7368 __Pyx_XDECREF(__pyx_t_12);
7369 __Pyx_AddTraceback(
"fenton.Fenton.writeInput", __pyx_clineno, __pyx_lineno, __pyx_filename);
7372 __Pyx_XDECREF(__pyx_v_filename);
7373 __Pyx_XDECREF(__pyx_v_f);
7374 __Pyx_XDECREF(__pyx_v_waveheight_dimless);
7375 __Pyx_XDECREF(__pyx_v_length_dimless);
7376 __Pyx_XDECREF(__pyx_v_current_magnitude_dimless);
7377 __Pyx_XDECREF(__pyx_v_mode);
7378 __Pyx_XGIVEREF(__pyx_r);
7379 __Pyx_RefNannyFinishContext();
7392static PyObject *__pyx_pw_6fenton_6Fenton_3runFourier(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused);
7393PyDoc_STRVAR(__pyx_doc_6fenton_6Fenton_2runFourier,
"\n Runs Fourier.cpp script to get Fenton wave solution\n (!) must be called after writeInput(...)\n ");
7394static PyMethodDef __pyx_mdef_6fenton_6Fenton_3runFourier = {
"runFourier", (PyCFunction)__pyx_pw_6fenton_6Fenton_3runFourier, METH_NOARGS, __pyx_doc_6fenton_6Fenton_2runFourier};
7395static PyObject *__pyx_pw_6fenton_6Fenton_3runFourier(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
7396 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
7397 PyObject *__pyx_r = 0;
7398 __Pyx_RefNannyDeclarations
7399 __Pyx_RefNannySetupContext(
"runFourier (wrapper)", 0);
7400 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
7401 __pyx_r = __pyx_pf_6fenton_6Fenton_2runFourier(__pyx_self);
7404 __Pyx_RefNannyFinishContext();
7408static PyObject *__pyx_pf_6fenton_6Fenton_2runFourier(CYTHON_UNUSED PyObject *__pyx_self) {
7409 PyObject *__pyx_r = NULL;
7410 __Pyx_RefNannyDeclarations
7411 __Pyx_RefNannySetupContext(
"runFourier", 0);
7431 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7432 __Pyx_XGIVEREF(__pyx_r);
7433 __Pyx_RefNannyFinishContext();
7446static PyObject *__pyx_pw_6fenton_6Fenton_5getBYCoeffs(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused);
7447PyDoc_STRVAR(__pyx_doc_6fenton_6Fenton_4getBYCoeffs,
"\n Get B and Y coeffs of solution\n (!) must be called after runFourier()\n\n Returns\n -------\n BCoeffs: array_like\n B coeffs of solution\n YCoeffs: array_like\n Y coeffs of solution\n ");
7448static PyMethodDef __pyx_mdef_6fenton_6Fenton_5getBYCoeffs = {
"getBYCoeffs", (PyCFunction)__pyx_pw_6fenton_6Fenton_5getBYCoeffs, METH_NOARGS, __pyx_doc_6fenton_6Fenton_4getBYCoeffs};
7449static PyObject *__pyx_pw_6fenton_6Fenton_5getBYCoeffs(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
7450 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
7451 PyObject *__pyx_r = 0;
7452 __Pyx_RefNannyDeclarations
7453 __Pyx_RefNannySetupContext(
"getBYCoeffs (wrapper)", 0);
7454 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
7455 __pyx_r = __pyx_pf_6fenton_6Fenton_4getBYCoeffs(__pyx_self);
7458 __Pyx_RefNannyFinishContext();
7462static PyObject *__pyx_pf_6fenton_6Fenton_4getBYCoeffs(CYTHON_UNUSED PyObject *__pyx_self) {
7463 PyObject *__pyx_v_FFT = NULL;
7464 PyObject *__pyx_v_BCoeffs = NULL;
7465 PyObject *__pyx_v_YCoeffs = NULL;
7466 PyObject *__pyx_r = NULL;
7467 __Pyx_RefNannyDeclarations
7468 PyObject *__pyx_t_1 = NULL;
7469 PyObject *__pyx_t_2 = NULL;
7470 PyObject *__pyx_t_3 = NULL;
7471 PyObject *__pyx_t_4 = NULL;
7473 int __pyx_lineno = 0;
7474 const char *__pyx_filename = NULL;
7475 int __pyx_clineno = 0;
7476 __Pyx_RefNannySetupContext(
"getBYCoeffs", 0);
7486 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error)
7487 __Pyx_GOTREF(__pyx_t_3);
7488 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_genfromtxt);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 125, __pyx_L1_error)
7489 __Pyx_GOTREF(__pyx_t_4);
7490 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7492 #if CYTHON_UNPACK_METHODS
7493 if (unlikely(PyMethod_Check(__pyx_t_4))) {
7494 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
7496 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
7497 __Pyx_INCREF(__pyx_t_2);
7498 __Pyx_INCREF(__pyx__function);
7499 __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
7504 PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Solution_res, Py_None, __pyx_mstate_global->__pyx_kp_u__2};
7505 #if CYTHON_VECTORCALL
7506 __pyx_t_3 = __pyx_mstate_global->__pyx_tuple[3];
7507 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error)
7508 __Pyx_INCREF(__pyx_t_3);
7511 PyObject *__pyx_temp[2] = {__pyx_mstate_global->__pyx_n_u_delimiter, __pyx_mstate_global->__pyx_n_u_comments};
7512 __pyx_t_3 = __Pyx_MakeKwargDict(__pyx_temp, __pyx_callargs+2, 2);
7513 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error)
7514 __Pyx_GOTREF(__pyx_t_3);
7517 __pyx_t_1 = __Pyx_Object_VectorcallKwds((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3);
7518 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7519 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7520 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7521 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error)
7522 __Pyx_GOTREF(__pyx_t_1);
7524 __pyx_v_FFT = __pyx_t_1;
7534 __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_FFT, __pyx_mstate_global->__pyx_tuple[4]);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error)
7535 __Pyx_GOTREF(__pyx_t_1);
7536 __pyx_v_BCoeffs = __pyx_t_1;
7546 __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_FFT, __pyx_mstate_global->__pyx_tuple[5]);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 127, __pyx_L1_error)
7547 __Pyx_GOTREF(__pyx_t_1);
7548 __pyx_v_YCoeffs = __pyx_t_1;
7558 __pyx_t_1 = PyTuple_New(2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error)
7559 __Pyx_GOTREF(__pyx_t_1);
7560 __Pyx_INCREF(__pyx_v_BCoeffs);
7561 __Pyx_GIVEREF(__pyx_v_BCoeffs);
7562 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_BCoeffs) != (0)) __PYX_ERR(0, 128, __pyx_L1_error);
7563 __Pyx_INCREF(__pyx_v_YCoeffs);
7564 __Pyx_GIVEREF(__pyx_v_YCoeffs);
7565 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_YCoeffs) != (0)) __PYX_ERR(0, 128, __pyx_L1_error);
7567 PyObject *__pyx_temp;
7569 __pyx_temp = __pyx_r;
7570 __pyx_r = __pyx_t_1;
7572 __Pyx_XDECREF(__pyx_temp);
7587 __Pyx_XDECREF(__pyx_t_1);
7588 __Pyx_XDECREF(__pyx_t_2);
7589 __Pyx_XDECREF(__pyx_t_3);
7590 __Pyx_XDECREF(__pyx_t_4);
7591 __Pyx_AddTraceback(
"fenton.Fenton.getBYCoeffs", __pyx_clineno, __pyx_lineno, __pyx_filename);
7594 __Pyx_XDECREF(__pyx_v_FFT);
7595 __Pyx_XDECREF(__pyx_v_BCoeffs);
7596 __Pyx_XDECREF(__pyx_v_YCoeffs);
7597 __Pyx_XGIVEREF(__pyx_r);
7598 __Pyx_RefNannyFinishContext();
7611static PyObject *__pyx_pw_6fenton_6Fenton_7getWavelength(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused);
7612PyDoc_STRVAR(__pyx_doc_6fenton_6Fenton_6getWavelength,
"\n Get wavelength/depth (dimensionless)\n (!) must be called after runFourier()\n\n Parameters\n ----------\n depth: double\n water depth used to compute solution\n\n Returns\n -------\n wavelength: double\n wavelength\n ");
7613static PyMethodDef __pyx_mdef_6fenton_6Fenton_7getWavelength = {
"getWavelength", (PyCFunction)__pyx_pw_6fenton_6Fenton_7getWavelength, METH_NOARGS, __pyx_doc_6fenton_6Fenton_6getWavelength};
7614static PyObject *__pyx_pw_6fenton_6Fenton_7getWavelength(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
7615 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
7616 PyObject *__pyx_r = 0;
7617 __Pyx_RefNannyDeclarations
7618 __Pyx_RefNannySetupContext(
"getWavelength (wrapper)", 0);
7619 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
7620 __pyx_r = __pyx_pf_6fenton_6Fenton_6getWavelength(__pyx_self);
7623 __Pyx_RefNannyFinishContext();
7627static PyObject *__pyx_pf_6fenton_6Fenton_6getWavelength(CYTHON_UNUSED PyObject *__pyx_self) {
7628 PyObject *__pyx_v_wavelength = NULL;
7629 PyObject *__pyx_v_f = NULL;
7630 PyObject *__pyx_v_line = NULL;
7631 PyObject *__pyx_v_l = NULL;
7632 PyObject *__pyx_r = NULL;
7633 __Pyx_RefNannyDeclarations
7634 PyObject *__pyx_t_1 = NULL;
7635 PyObject *__pyx_t_2 = NULL;
7636 PyObject *__pyx_t_3 = NULL;
7637 PyObject *__pyx_t_4 = NULL;
7638 PyObject *__pyx_t_5 = NULL;
7640 PyObject *__pyx_t_7 = NULL;
7641 PyObject *__pyx_t_8 = NULL;
7642 PyObject *__pyx_t_9 = NULL;
7643 Py_ssize_t __pyx_t_10;
7644 PyObject *(*__pyx_t_11)(PyObject *);
7647 PyObject *__pyx_t_14 = NULL;
7648 int __pyx_lineno = 0;
7649 const char *__pyx_filename = NULL;
7650 int __pyx_clineno = 0;
7651 __Pyx_RefNannySetupContext(
"getWavelength", 0);
7660 __Pyx_INCREF(Py_None);
7661 __pyx_v_wavelength = Py_None;
7671 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_mstate_global->__pyx_tuple[6], NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error)
7672 __Pyx_GOTREF(__pyx_t_1);
7673 __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_exit);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error)
7674 __Pyx_GOTREF(__pyx_t_2);
7676 __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_enter);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 146, __pyx_L3_error)
7677 __Pyx_GOTREF(__pyx_t_5);
7679 #if CYTHON_UNPACK_METHODS
7680 if (likely(PyMethod_Check(__pyx_t_5))) {
7681 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
7683 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
7684 __Pyx_INCREF(__pyx_t_4);
7685 __Pyx_INCREF(__pyx__function);
7686 __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
7691 PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
7692 __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
7693 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7694 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7695 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 146, __pyx_L3_error)
7696 __Pyx_GOTREF(__pyx_t_3);
7698 __pyx_t_5 = __pyx_t_3;
7700 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7703 __Pyx_PyThreadState_declare
7704 __Pyx_PyThreadState_assign
7705 __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
7706 __Pyx_XGOTREF(__pyx_t_7);
7707 __Pyx_XGOTREF(__pyx_t_8);
7708 __Pyx_XGOTREF(__pyx_t_9);
7710 __pyx_v_f = __pyx_t_5;
7720 if (likely(PyList_CheckExact(__pyx_v_f)) || PyTuple_CheckExact(__pyx_v_f)) {
7721 __pyx_t_5 = __pyx_v_f; __Pyx_INCREF(__pyx_t_5);
7725 __pyx_t_10 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_f);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 147, __pyx_L7_error)
7726 __Pyx_GOTREF(__pyx_t_5);
7727 __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 147, __pyx_L7_error)
7730 if (likely(!__pyx_t_11)) {
7731 if (likely(PyList_CheckExact(__pyx_t_5))) {
7733 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5);
7734 #if !CYTHON_ASSUME_SAFE_SIZE
7735 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 147, __pyx_L7_error)
7737 if (__pyx_t_10 >= __pyx_temp)
break;
7739 __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_5, __pyx_t_10, __Pyx_ReferenceSharing_OwnStrongReference);
7743 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5);
7744 #if !CYTHON_ASSUME_SAFE_SIZE
7745 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 147, __pyx_L7_error)
7747 if (__pyx_t_10 >= __pyx_temp)
break;
7749 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7750 __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_10));
7752 __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_10);
7756 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L7_error)
7758 __pyx_t_1 = __pyx_t_11(__pyx_t_5);
7759 if (unlikely(!__pyx_t_1)) {
7760 PyObject* exc_type = PyErr_Occurred();
7762 if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 147, __pyx_L7_error)
7768 __Pyx_GOTREF(__pyx_t_1);
7769 __Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_1);
7779 __pyx_t_3 = __pyx_v_line;
7780 __Pyx_INCREF(__pyx_t_3);
7783 PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
7784 __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_split, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
7785 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7786 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L7_error)
7787 __Pyx_GOTREF(__pyx_t_1);
7789 __Pyx_XDECREF_SET(__pyx_v_l, __pyx_t_1);
7799 __pyx_t_13 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_n_u_Wave, __pyx_v_l, Py_EQ));
if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 149, __pyx_L7_error)
7804 __pyx_t_12 = __pyx_t_13;
7806 goto __pyx_L16_bool_binop_done;
7808 __pyx_t_13 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_n_u_length, __pyx_v_l, Py_EQ));
if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 149, __pyx_L7_error)
7810 __pyx_t_12 = __pyx_t_13;
7812 __pyx_L16_bool_binop_done:;
7823 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_l, 5,
long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 150, __pyx_L7_error)
7824 __Pyx_GOTREF(__pyx_t_1);
7825 __Pyx_DECREF_SET(__pyx_v_wavelength, __pyx_t_1);
7845 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7855 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
7856 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
7857 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
7858 goto __pyx_L12_try_end;
7860 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7861 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7862 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7863 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
7865 __Pyx_AddTraceback(
"fenton.Fenton.getWavelength", __pyx_clineno, __pyx_lineno, __pyx_filename);
7866 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_1, &__pyx_t_3) < 0) __PYX_ERR(0, 146, __pyx_L9_except_error)
7867 __Pyx_XGOTREF(__pyx_t_5);
7868 __Pyx_XGOTREF(__pyx_t_1);
7869 __Pyx_XGOTREF(__pyx_t_3);
7871 PyObject* __pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_t_3};
7872 __pyx_t_4 = __Pyx_PyTuple_FromArray(__pyx_temp, 3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L9_except_error)
7873 __Pyx_GOTREF(__pyx_t_4);
7875 __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL);
7876 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7877 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7878 if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 146, __pyx_L9_except_error)
7879 __Pyx_GOTREF(__pyx_t_14);
7880 __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_14);
7881 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
7882 if (__pyx_t_12 < (0)) __PYX_ERR(0, 146, __pyx_L9_except_error)
7883 __pyx_t_13 = (!__pyx_t_12);
7886 if (unlikely(__pyx_t_13)) {
7888 __Pyx_GIVEREF(__pyx_t_5);
7889 __Pyx_GIVEREF(__pyx_t_1);
7890 __Pyx_XGIVEREF(__pyx_t_3);
7891 __Pyx_ErrRestoreWithState(__pyx_t_5, __pyx_t_1, __pyx_t_3);
7892 __pyx_t_5 = 0; __pyx_t_1 = 0; __pyx_t_3 = 0;
7893 __PYX_ERR(0, 146, __pyx_L9_except_error)
7895 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
7896 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7897 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7898 goto __pyx_L8_exception_handled;
7900 __pyx_L9_except_error:;
7901 __Pyx_XGIVEREF(__pyx_t_7);
7902 __Pyx_XGIVEREF(__pyx_t_8);
7903 __Pyx_XGIVEREF(__pyx_t_9);
7904 __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
7905 goto __pyx_L1_error;
7906 __pyx_L8_exception_handled:;
7907 __Pyx_XGIVEREF(__pyx_t_7);
7908 __Pyx_XGIVEREF(__pyx_t_8);
7909 __Pyx_XGIVEREF(__pyx_t_9);
7910 __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
7917 __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[1], NULL);
7918 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7919 if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 146, __pyx_L1_error)
7920 __Pyx_GOTREF(__pyx_t_9);
7921 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7929 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7930 goto __pyx_L1_error;
7941 __pyx_t_3 = __Pyx_PyNumber_Float(__pyx_v_wavelength);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 151, __pyx_L1_error)
7942 __Pyx_GOTREF(__pyx_t_3);
7943 if (__Pyx_PyFloat_FromNumber(&__pyx_t_3, NULL, 0) < (0)) __PYX_ERR(0, 151, __pyx_L1_error)
7945 PyObject *__pyx_temp;
7947 __pyx_temp = __pyx_r;
7948 __pyx_r = __pyx_t_3;
7950 __Pyx_XDECREF(__pyx_temp);
7965 __Pyx_XDECREF(__pyx_t_1);
7966 __Pyx_XDECREF(__pyx_t_3);
7967 __Pyx_XDECREF(__pyx_t_4);
7968 __Pyx_XDECREF(__pyx_t_5);
7969 __Pyx_AddTraceback(
"fenton.Fenton.getWavelength", __pyx_clineno, __pyx_lineno, __pyx_filename);
7972 __Pyx_XDECREF(__pyx_v_wavelength);
7973 __Pyx_XDECREF(__pyx_v_f);
7974 __Pyx_XDECREF(__pyx_v_line);
7975 __Pyx_XDECREF(__pyx_v_l);
7976 __Pyx_XGIVEREF(__pyx_r);
7977 __Pyx_RefNannyFinishContext();
7990static PyObject *__pyx_pw_6fenton_6Fenton_9copyFiles(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused);
7991PyDoc_STRVAR(__pyx_doc_6fenton_6Fenton_8copyFiles,
"\n Copy the files to log directory\n ");
7992static PyMethodDef __pyx_mdef_6fenton_6Fenton_9copyFiles = {
"copyFiles", (PyCFunction)__pyx_pw_6fenton_6Fenton_9copyFiles, METH_NOARGS, __pyx_doc_6fenton_6Fenton_8copyFiles};
7993static PyObject *__pyx_pw_6fenton_6Fenton_9copyFiles(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
7994 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
7995 PyObject *__pyx_r = 0;
7996 __Pyx_RefNannyDeclarations
7997 __Pyx_RefNannySetupContext(
"copyFiles (wrapper)", 0);
7998 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
7999 __pyx_r = __pyx_pf_6fenton_6Fenton_8copyFiles(__pyx_self);
8002 __Pyx_RefNannyFinishContext();
8006static PyObject *__pyx_pf_6fenton_6Fenton_8copyFiles(CYTHON_UNUSED PyObject *__pyx_self) {
8007 PyObject *__pyx_r = NULL;
8008 __Pyx_RefNannyDeclarations
8009 PyObject *__pyx_t_1 = NULL;
8010 PyObject *__pyx_t_2 = NULL;
8012 PyObject *__pyx_t_4 = NULL;
8013 PyObject *__pyx_t_5 = NULL;
8014 PyObject *__pyx_t_6 = NULL;
8016 int __pyx_lineno = 0;
8017 const char *__pyx_filename = NULL;
8018 int __pyx_clineno = 0;
8019 __Pyx_RefNannySetupContext(
"copyFiles", 0);
8028 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Profiling);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error)
8029 __Pyx_GOTREF(__pyx_t_1);
8030 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_logDir);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error)
8031 __Pyx_GOTREF(__pyx_t_2);
8032 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8033 __pyx_t_3 = (__Pyx_PyObject_Equals_obj_ch46(__pyx_t_2, __pyx_mstate_global->__pyx_kp_u__3, Py_NE));
if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 158, __pyx_L1_error)
8034 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8046 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_copy);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error)
8047 __Pyx_GOTREF(__pyx_t_4);
8048 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_Profiling);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 159, __pyx_L1_error)
8049 __Pyx_GOTREF(__pyx_t_5);
8050 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_logDir);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 159, __pyx_L1_error)
8051 __Pyx_GOTREF(__pyx_t_6);
8052 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8054 #if CYTHON_UNPACK_METHODS
8055 if (unlikely(PyMethod_Check(__pyx_t_4))) {
8056 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
8058 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
8059 __Pyx_INCREF(__pyx_t_1);
8060 __Pyx_INCREF(__pyx__function);
8061 __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
8066 PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_Data_dat, __pyx_t_6};
8067 __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
8068 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8069 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8070 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8071 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error)
8072 __Pyx_GOTREF(__pyx_t_2);
8074 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8084 __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_copy);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 160, __pyx_L1_error)
8085 __Pyx_GOTREF(__pyx_t_6);
8086 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Profiling);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error)
8087 __Pyx_GOTREF(__pyx_t_1);
8088 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_logDir);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 160, __pyx_L1_error)
8089 __Pyx_GOTREF(__pyx_t_5);
8090 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8092 #if CYTHON_UNPACK_METHODS
8093 if (unlikely(PyMethod_Check(__pyx_t_6))) {
8094 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
8096 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
8097 __Pyx_INCREF(__pyx_t_4);
8098 __Pyx_INCREF(__pyx__function);
8099 __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
8104 PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Convergence_dat, __pyx_t_5};
8105 __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
8106 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8107 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8108 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8109 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error)
8110 __Pyx_GOTREF(__pyx_t_2);
8112 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8122 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_copy);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 161, __pyx_L1_error)
8123 __Pyx_GOTREF(__pyx_t_5);
8124 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_Profiling);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 161, __pyx_L1_error)
8125 __Pyx_GOTREF(__pyx_t_4);
8126 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_logDir);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error)
8127 __Pyx_GOTREF(__pyx_t_1);
8128 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8130 #if CYTHON_UNPACK_METHODS
8131 if (unlikely(PyMethod_Check(__pyx_t_5))) {
8132 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
8134 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
8135 __Pyx_INCREF(__pyx_t_6);
8136 __Pyx_INCREF(__pyx__function);
8137 __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
8142 PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_mstate_global->__pyx_kp_u_Points_dat, __pyx_t_1};
8143 __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
8144 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8145 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8146 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8147 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 161, __pyx_L1_error)
8148 __Pyx_GOTREF(__pyx_t_2);
8150 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8160 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_copy);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error)
8161 __Pyx_GOTREF(__pyx_t_1);
8162 __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_Profiling);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 162, __pyx_L1_error)
8163 __Pyx_GOTREF(__pyx_t_6);
8164 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_logDir);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 162, __pyx_L1_error)
8165 __Pyx_GOTREF(__pyx_t_4);
8166 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8168 #if CYTHON_UNPACK_METHODS
8169 if (unlikely(PyMethod_Check(__pyx_t_1))) {
8170 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
8172 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
8173 __Pyx_INCREF(__pyx_t_5);
8174 __Pyx_INCREF(__pyx__function);
8175 __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
8180 PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_Solution_res, __pyx_t_4};
8181 __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_1, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
8182 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
8183 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8184 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8185 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error)
8186 __Pyx_GOTREF(__pyx_t_2);
8188 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8198 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_copy);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error)
8199 __Pyx_GOTREF(__pyx_t_4);
8200 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_Profiling);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 163, __pyx_L1_error)
8201 __Pyx_GOTREF(__pyx_t_5);
8202 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_logDir);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 163, __pyx_L1_error)
8203 __Pyx_GOTREF(__pyx_t_6);
8204 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8206 #if CYTHON_UNPACK_METHODS
8207 if (unlikely(PyMethod_Check(__pyx_t_4))) {
8208 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
8210 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
8211 __Pyx_INCREF(__pyx_t_1);
8212 __Pyx_INCREF(__pyx__function);
8213 __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
8218 PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_Surface_res, __pyx_t_6};
8219 __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
8220 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8221 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8222 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8223 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error)
8224 __Pyx_GOTREF(__pyx_t_2);
8226 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8236 __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_copy);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 164, __pyx_L1_error)
8237 __Pyx_GOTREF(__pyx_t_6);
8238 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Profiling);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 164, __pyx_L1_error)
8239 __Pyx_GOTREF(__pyx_t_1);
8240 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_logDir);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 164, __pyx_L1_error)
8241 __Pyx_GOTREF(__pyx_t_5);
8242 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8244 #if CYTHON_UNPACK_METHODS
8245 if (unlikely(PyMethod_Check(__pyx_t_6))) {
8246 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
8248 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
8249 __Pyx_INCREF(__pyx_t_4);
8250 __Pyx_INCREF(__pyx__function);
8251 __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
8256 PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Flowfield_res, __pyx_t_5};
8257 __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
8258 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8259 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8260 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8261 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 164, __pyx_L1_error)
8262 __Pyx_GOTREF(__pyx_t_2);
8264 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8284 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8287 __Pyx_XDECREF(__pyx_t_1);
8288 __Pyx_XDECREF(__pyx_t_2);
8289 __Pyx_XDECREF(__pyx_t_4);
8290 __Pyx_XDECREF(__pyx_t_5);
8291 __Pyx_XDECREF(__pyx_t_6);
8292 __Pyx_AddTraceback(
"fenton.Fenton.copyFiles", __pyx_clineno, __pyx_lineno, __pyx_filename);
8295 __Pyx_XGIVEREF(__pyx_r);
8296 __Pyx_RefNannyFinishContext();
8308static PyObject *__pyx_pw_6fenton_6Fenton_11__get_dir(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused);
8309static PyMethodDef __pyx_mdef_6fenton_6Fenton_11__get_dir = {
"__get_dir", (PyCFunction)__pyx_pw_6fenton_6Fenton_11__get_dir, METH_NOARGS, 0};
8310static PyObject *__pyx_pw_6fenton_6Fenton_11__get_dir(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
8311 CYTHON_UNUSED PyObject *
const *__pyx_kwvalues;
8312 PyObject *__pyx_r = 0;
8313 __Pyx_RefNannyDeclarations
8314 __Pyx_RefNannySetupContext(
"__get_dir (wrapper)", 0);
8315 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
8316 __pyx_r = __pyx_pf_6fenton_6Fenton_10__get_dir(__pyx_self);
8319 __Pyx_RefNannyFinishContext();
8323static PyObject *__pyx_pf_6fenton_6Fenton_10__get_dir(CYTHON_UNUSED PyObject *__pyx_self) {
8324 PyObject *__pyx_r = NULL;
8325 __Pyx_RefNannyDeclarations
8326 PyObject *__pyx_t_1 = NULL;
8327 PyObject *__pyx_t_2 = NULL;
8328 PyObject *__pyx_t_3 = NULL;
8329 PyObject *__pyx_t_4 = NULL;
8331 int __pyx_lineno = 0;
8332 const char *__pyx_filename = NULL;
8333 int __pyx_clineno = 0;
8334 __Pyx_RefNannySetupContext(
"__get_dir", 0);
8341 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_os);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 167, __pyx_L1_error)
8342 __Pyx_GOTREF(__pyx_t_3);
8343 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_path);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error)
8344 __Pyx_GOTREF(__pyx_t_4);
8345 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8346 __pyx_t_2 = __pyx_t_4;
8347 __Pyx_INCREF(__pyx_t_2);
8348 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_file);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 167, __pyx_L1_error)
8349 __Pyx_GOTREF(__pyx_t_3);
8352 PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
8353 __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_dirname, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
8354 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8355 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8356 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8357 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error)
8358 __Pyx_GOTREF(__pyx_t_1);
8361 PyObject *__pyx_temp;
8363 __pyx_temp = __pyx_r;
8364 __pyx_r = __pyx_t_1;
8366 __Pyx_XDECREF(__pyx_temp);
8380 __Pyx_XDECREF(__pyx_t_1);
8381 __Pyx_XDECREF(__pyx_t_2);
8382 __Pyx_XDECREF(__pyx_t_3);
8383 __Pyx_XDECREF(__pyx_t_4);
8384 __Pyx_AddTraceback(
"fenton.Fenton.__get_dir", __pyx_clineno, __pyx_lineno, __pyx_filename);
8387 __Pyx_XGIVEREF(__pyx_r);
8388 __Pyx_RefNannyFinishContext();
8393static PyMethodDef __pyx_methods[] = {
8397static CYTHON_SMALL_CODE
int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate);
8398static CYTHON_SMALL_CODE
int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate);
8399static CYTHON_SMALL_CODE
int __Pyx_InitGlobals(
void);
8400static CYTHON_SMALL_CODE
int __Pyx_InitAfterSharedUtility(
void);
8401static CYTHON_SMALL_CODE
int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate);
8402static CYTHON_SMALL_CODE
int __Pyx_modinit_Global_init_code(__pyx_mstatetype *__pyx_mstate);
8403static CYTHON_SMALL_CODE
int __Pyx_modinit_Variable_export_code(__pyx_mstatetype *__pyx_mstate);
8404static CYTHON_SMALL_CODE
int __Pyx_modinit_Function_export_code(__pyx_mstatetype *__pyx_mstate);
8405static CYTHON_SMALL_CODE
int __Pyx_modinit_Type_import_code(__pyx_mstatetype *__pyx_mstate);
8406static CYTHON_SMALL_CODE
int __Pyx_modinit_Variable_import_code(__pyx_mstatetype *__pyx_mstate);
8407static CYTHON_SMALL_CODE
int __Pyx_modinit_Function_import_code(__pyx_mstatetype *__pyx_mstate);
8408static CYTHON_SMALL_CODE
int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate);
8411static int __Pyx_modinit_Global_init_code(__pyx_mstatetype *__pyx_mstate) {
8412 __Pyx_RefNannyDeclarations
8413 CYTHON_UNUSED_VAR(__pyx_mstate);
8414 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Global_init_code", 0);
8416 __Pyx_RefNannyFinishContext();
8420static int __Pyx_modinit_Variable_export_code(__pyx_mstatetype *__pyx_mstate) {
8421 __Pyx_RefNannyDeclarations
8422 CYTHON_UNUSED_VAR(__pyx_mstate);
8423 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Variable_export_code", 0);
8425 __Pyx_RefNannyFinishContext();
8429static int __Pyx_modinit_Function_export_code(__pyx_mstatetype *__pyx_mstate) {
8430 __Pyx_RefNannyDeclarations
8431 CYTHON_UNUSED_VAR(__pyx_mstate);
8432 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Function_export_code", 0);
8434 __Pyx_RefNannyFinishContext();
8438static int __Pyx_modinit_Type_import_code(__pyx_mstatetype *__pyx_mstate) {
8439 __Pyx_RefNannyDeclarations
8440 PyObject *__pyx_t_1 = NULL;
8441 int __pyx_lineno = 0;
8442 const char *__pyx_filename = NULL;
8443 int __pyx_clineno = 0;
8444 CYTHON_UNUSED_VAR(__pyx_mstate);
8445 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Type_import_code", 0);
8447 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error)
8448 __Pyx_GOTREF(__pyx_t_1);
8449 __pyx_mstate->__pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_3_0(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME,
"type",
8450 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
8451 sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyTypeObject),
8452 #elif CYTHON_COMPILING_IN_LIMITED_API
8455 sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyHeapTypeObject),
8457 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error)
8458 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8459 __pyx_t_1 = PyImport_ImportModule(
"numpy");
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 229, __pyx_L1_error)
8460 __Pyx_GOTREF(__pyx_t_1);
8461 __pyx_mstate->__pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"dtype",
8462 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
8463 sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArray_Descr),
8464 #elif CYTHON_COMPILING_IN_LIMITED_API
8465 sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArray_Descr),
8467 sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArray_Descr),
8469 __Pyx_ImportType_CheckSize_Ignore_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 229, __pyx_L1_error)
8470 __pyx_mstate->__pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"flatiter",
8471 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
8472 sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayIterObject),
8473 #elif CYTHON_COMPILING_IN_LIMITED_API
8474 sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayIterObject),
8476 sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayIterObject),
8478 __Pyx_ImportType_CheckSize_Ignore_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 286, __pyx_L1_error)
8479 __pyx_mstate->__pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"broadcast",
8480 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
8481 sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayMultiIterObject),
8482 #elif CYTHON_COMPILING_IN_LIMITED_API
8483 sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayMultiIterObject),
8485 sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayMultiIterObject),
8487 __Pyx_ImportType_CheckSize_Ignore_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 290, __pyx_L1_error)
8488 __pyx_mstate->__pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"ndarray",
8489 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
8490 sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayObject),
8491 #elif CYTHON_COMPILING_IN_LIMITED_API
8492 sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayObject),
8494 sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayObject),
8496 __Pyx_ImportType_CheckSize_Ignore_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 329, __pyx_L1_error)
8497 __pyx_mstate->__pyx_ptype_5numpy_generic = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"generic",
8498 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
8499 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8500 #elif CYTHON_COMPILING_IN_LIMITED_API
8501 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8503 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8505 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_generic) __PYX_ERR(1, 847, __pyx_L1_error)
8506 __pyx_mstate->__pyx_ptype_5numpy_number = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"number",
8507 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
8508 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8509 #elif CYTHON_COMPILING_IN_LIMITED_API
8510 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8512 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8514 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_number) __PYX_ERR(1, 849, __pyx_L1_error)
8515 __pyx_mstate->__pyx_ptype_5numpy_integer = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"integer",
8516 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
8517 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8518 #elif CYTHON_COMPILING_IN_LIMITED_API
8519 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8521 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8523 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_integer) __PYX_ERR(1, 851, __pyx_L1_error)
8524 __pyx_mstate->__pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"signedinteger",
8525 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
8526 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8527 #elif CYTHON_COMPILING_IN_LIMITED_API
8528 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8530 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8532 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_signedinteger) __PYX_ERR(1, 853, __pyx_L1_error)
8533 __pyx_mstate->__pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"unsignedinteger",
8534 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
8535 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8536 #elif CYTHON_COMPILING_IN_LIMITED_API
8537 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8539 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8541 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(1, 855, __pyx_L1_error)
8542 __pyx_mstate->__pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"inexact",
8543 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
8544 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8545 #elif CYTHON_COMPILING_IN_LIMITED_API
8546 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8548 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8550 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_inexact) __PYX_ERR(1, 857, __pyx_L1_error)
8551 __pyx_mstate->__pyx_ptype_5numpy_floating = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"floating",
8552 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
8553 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8554 #elif CYTHON_COMPILING_IN_LIMITED_API
8555 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8557 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8559 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_floating) __PYX_ERR(1, 859, __pyx_L1_error)
8560 __pyx_mstate->__pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"complexfloating",
8561 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
8562 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8563 #elif CYTHON_COMPILING_IN_LIMITED_API
8564 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8566 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8568 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_complexfloating) __PYX_ERR(1, 861, __pyx_L1_error)
8569 __pyx_mstate->__pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"flexible",
8570 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
8571 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8572 #elif CYTHON_COMPILING_IN_LIMITED_API
8573 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8575 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8577 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_flexible) __PYX_ERR(1, 863, __pyx_L1_error)
8578 __pyx_mstate->__pyx_ptype_5numpy_character = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"character",
8579 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
8580 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8581 #elif CYTHON_COMPILING_IN_LIMITED_API
8582 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8584 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
8586 __Pyx_ImportType_CheckSize_Warn_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_character) __PYX_ERR(1, 865, __pyx_L1_error)
8587 __pyx_mstate->__pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_3_0(__pyx_t_1,
"numpy",
"ufunc",
8588 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
8589 sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyUFuncObject),
8590 #elif CYTHON_COMPILING_IN_LIMITED_API
8591 sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyUFuncObject),
8593 sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyUFuncObject),
8595 __Pyx_ImportType_CheckSize_Ignore_3_3_0);
if (!__pyx_mstate->__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 946, __pyx_L1_error)
8596 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8597 __Pyx_RefNannyFinishContext();
8600 __Pyx_XDECREF(__pyx_t_1);
8601 __Pyx_RefNannyFinishContext();
8605static int __Pyx_modinit_Variable_import_code(__pyx_mstatetype *__pyx_mstate) {
8606 __Pyx_RefNannyDeclarations
8607 CYTHON_UNUSED_VAR(__pyx_mstate);
8608 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Variable_import_code", 0);
8610 __Pyx_RefNannyFinishContext();
8614static int __Pyx_modinit_Function_import_code(__pyx_mstatetype *__pyx_mstate) {
8615 __Pyx_RefNannyDeclarations
8616 CYTHON_UNUSED_VAR(__pyx_mstate);
8617 __Pyx_RefNannySetupContext(
"__Pyx_modinit_Function_import_code", 0);
8619 __Pyx_RefNannyFinishContext();
8623#if CYTHON_PEP489_MULTI_PHASE_INIT
8624static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
8625static int __pyx_pymod_exec_Fenton(PyObject* module);
8626static PyModuleDef_Slot __pyx_moduledef_slots[] = {
8627 {Py_mod_create, (
void*)__pyx_pymod_create},
8628 {Py_mod_exec, (
void*)__pyx_pymod_exec_Fenton},
8629 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
8630 {Py_mod_gil, __Pyx_FREETHREADING_COMPATIBLE},
8632 #if PY_VERSION_HEX >= 0x030C0000 && CYTHON_USE_MODULE_STATE
8633 {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},
8641 struct PyModuleDef __pyx_moduledef =
8643 static struct PyModuleDef __pyx_moduledef =
8646 PyModuleDef_HEAD_INIT,
8648 __pyx_k_Scripts_for_creating_Fenton_wav,
8649 #if CYTHON_USE_MODULE_STATE
8650 sizeof(__pyx_mstatetype),
8652 (CYTHON_PEP489_MULTI_PHASE_INIT) ? 0 : -1,
8655 #if CYTHON_PEP489_MULTI_PHASE_INIT
8656 __pyx_moduledef_slots,
8660 #if CYTHON_USE_MODULE_STATE
8675#ifndef CYTHON_NO_PYINIT_EXPORT
8676 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
8679 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
8681 #define __Pyx_PyMODINIT_FUNC PyObject *
8685__Pyx_PyMODINIT_FUNC PyInit_Fenton(
void) CYTHON_SMALL_CODE;
8686__Pyx_PyMODINIT_FUNC PyInit_Fenton(
void)
8687#if CYTHON_PEP489_MULTI_PHASE_INIT
8689 return PyModuleDef_Init(&__pyx_moduledef);
8692#if CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x030A0000 &&\
8693 (defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)))
8694static PY_INT64_T __Pyx_GetCurrentInterpreterId(
void) {
8696 PyObject *module = PyImport_ImportModule(
"_interpreters");
8698 if (!PyErr_ExceptionMatches(PyExc_Exception)) {
8702 module = PyImport_ImportModule("_xxsubinterpreters");
8703 if (!module)
goto bad;
8705 PyObject *current = PyObject_CallMethod(module,
"get_current", NULL);
8707 if (!current)
goto bad;
8708 if (PyTuple_Check(current)) {
8709 PyObject *new_current = PySequence_GetItem(current, 0);
8711 current = new_current;
8712 if (!new_current)
goto bad;
8714 long long as_c_int = PyLong_AsLongLong(current);
8719 PySys_WriteStderr(
"__Pyx_GetCurrentInterpreterId failed. Try setting the C define CYTHON_PEP489_MULTI_PHASE_INIT=0\n");
8723#if !CYTHON_USE_MODULE_STATE
8724static CYTHON_SMALL_CODE
int __Pyx_check_single_interpreter(
void) {
8725 static PY_INT64_T main_interpreter_id = -1;
8726#if CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
8727 PY_INT64_T current_id = GraalPyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
8728#elif CYTHON_COMPILING_IN_GRAAL
8729 PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
8730#elif CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x030A0000 &&\
8731 (defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)))
8732 PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId();
8733#elif CYTHON_COMPILING_IN_LIMITED_API
8734 PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get());
8736 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
8738 if (unlikely(current_id == -1)) {
8741 if (main_interpreter_id == -1) {
8742 main_interpreter_id = current_id;
8744 }
else if (unlikely(main_interpreter_id != current_id)) {
8747 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
8753static CYTHON_SMALL_CODE
int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict,
const char* from_name,
const char* to_name,
int allow_none)
8755 PyObject *value = PyObject_GetAttrString(spec, from_name);
8757 if (likely(value)) {
8758 if (allow_none || value != Py_None) {
8759 result = PyDict_SetItemString(moddict, to_name, value);
8762 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
8769static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) {
8770 PyObject *module = NULL, *moddict, *modname;
8771 CYTHON_UNUSED_VAR(def);
8772 #if !CYTHON_USE_MODULE_STATE
8773 if (__Pyx_check_single_interpreter())
8777 return __Pyx_NewRef(__pyx_m);
8778 modname = PyObject_GetAttrString(spec,
"name");
8779 if (unlikely(!modname))
goto bad;
8780 module = PyModule_NewObject(modname);
8782 if (unlikely(!module))
goto bad;
8783 moddict = PyModule_GetDict(module);
8784 if (unlikely(!moddict))
goto bad;
8785 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__", 1) < 0))
goto bad;
8786 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__", 1) < 0))
goto bad;
8787 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__", 1) < 0))
goto bad;
8788 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__", 0) < 0))
goto bad;
8796static CYTHON_SMALL_CODE
int __pyx_pymod_exec_Fenton(PyObject *__pyx_pyinit_module)
8799 int stringtab_initialized = 0;
8800 #if CYTHON_USE_MODULE_STATE
8801 int pystate_addmodule_run = 0;
8803 __pyx_mstatetype *__pyx_mstate = NULL;
8804 PyObject *__pyx_t_1 = NULL;
8805 PyObject *__pyx_t_2 = NULL;
8806 Py_ssize_t __pyx_t_3;
8807 PyObject *__pyx_t_4 = NULL;
8808 int __pyx_lineno = 0;
8809 const char *__pyx_filename = NULL;
8810 int __pyx_clineno = 0;
8811 __Pyx_RefNannyDeclarations
8812 #if CYTHON_PEP489_MULTI_PHASE_INIT
8814 if (__pyx_m == __pyx_pyinit_module)
return 0;
8815 PyErr_SetString(PyExc_RuntimeError,
"Module 'Fenton' has already been imported. Re-initialisation is not supported.");
8819 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
8822 #if CYTHON_PEP489_MULTI_PHASE_INIT
8823 __pyx_t_1 = __pyx_pyinit_module;
8824 Py_INCREF(__pyx_t_1);
8826 __pyx_t_1 = PyModule_Create(&__pyx_moduledef);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
8828 #if CYTHON_USE_MODULE_STATE
8830 int add_module_result = __Pyx_State_AddModule(__pyx_t_1, &__pyx_moduledef);
8832 if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
8833 pystate_addmodule_run = 1;
8836 __pyx_m = __pyx_t_1;
8838 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
8839 PyUnstable_Module_SetGIL(__pyx_m, Py_MOD_GIL_USED);
8841 __pyx_mstate = __pyx_mstate_global;
8842 CYTHON_UNUSED_VAR(__pyx_t_1);
8843 __pyx_mstate->__pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_mstate->__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
8844 Py_INCREF(__pyx_mstate->__pyx_d);
8845 __pyx_mstate->__pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_mstate->__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
8846 __pyx_mstate->__pyx_cython_runtime = __Pyx_PyImport_AddModuleRef(
"cython_runtime");
if (unlikely(!__pyx_mstate->__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
8847 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_mstate->__pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
8850 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
8851 if (!__Pyx_RefNanny) {
8852 if (PyErr_ExceptionMatches(PyExc_Exception)) {
8854 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
8856 if (!__Pyx_RefNanny)
8857 Py_FatalError(
"failed to import 'refnanny' module");
8861__Pyx_RefNannySetupContext(
"PyInit_Fenton", 0);
8862 __Pyx_init_runtime_version();
8863 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)
8864 __pyx_mstate->__pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
8865 __pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
8866 __pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
8869 if (__Pyx_InitConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
8870 stringtab_initialized = 1;
8871 if (__Pyx_InitGlobals() < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
8872 if (__pyx_module_is_main_fenton__Fenton) {
8873 if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_main) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
8876 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
8877 if (!PyDict_GetItemString(modules,
"fenton.Fenton")) {
8878 if (unlikely((PyDict_SetItemString(modules,
"fenton.Fenton", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
8882 if (__Pyx_InitCachedBuiltins(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
8884 if (__Pyx_InitCachedConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
8885 if (__Pyx_CreateCodeObjects(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
8887 (void)__Pyx_modinit_Global_init_code(__pyx_mstate);
8888 (void)__Pyx_modinit_Variable_export_code(__pyx_mstate);
8889 (void)__Pyx_modinit_Function_export_code(__pyx_mstate);
8891 if (unlikely((__Pyx_modinit_Type_import_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
8892 (void)__Pyx_modinit_Variable_import_code(__pyx_mstate);
8893 (void)__Pyx_modinit_Function_import_code(__pyx_mstate);
8894 if (__Pyx_InitAfterSharedUtility() < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
8904 __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_os, 0, 0, NULL, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error)
8905 __pyx_t_2 = __pyx_t_1;
8906 __Pyx_GOTREF(__pyx_t_2);
8907 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_os, __pyx_t_2) < (0)) __PYX_ERR(0, 7, __pyx_L1_error)
8908 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8918 PyObject*
const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_check_call};
8919 __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_subprocess, __pyx_imported_names, 1, NULL, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error)
8921 __pyx_t_2 = __pyx_t_1;
8922 __Pyx_GOTREF(__pyx_t_2);
8924 PyObject*
const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_check_call};
8926 __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 8, __pyx_L1_error)
8927 __Pyx_GOTREF(__pyx_t_4);
8928 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 8, __pyx_L1_error)
8929 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8932 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8942 PyObject*
const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_copy};
8943 __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_shutil, __pyx_imported_names, 1, NULL, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
8945 __pyx_t_2 = __pyx_t_1;
8946 __Pyx_GOTREF(__pyx_t_2);
8948 PyObject*
const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_copy};
8950 __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 9, __pyx_L1_error)
8951 __Pyx_GOTREF(__pyx_t_4);
8952 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 9, __pyx_L1_error)
8953 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8956 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8965 __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_numpy, 0, 0, NULL, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
8966 __pyx_t_2 = __pyx_t_1;
8967 __Pyx_GOTREF(__pyx_t_2);
8968 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_np, __pyx_t_2) < (0)) __PYX_ERR(0, 10, __pyx_L1_error)
8969 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8979 PyObject*
const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Profiling};
8980 __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_proteus, __pyx_imported_names, 1, NULL, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
8982 __pyx_t_2 = __pyx_t_1;
8983 __Pyx_GOTREF(__pyx_t_2);
8985 PyObject*
const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Profiling};
8987 __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 12, __pyx_L1_error)
8988 __Pyx_GOTREF(__pyx_t_4);
8989 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 12, __pyx_L1_error)
8990 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8993 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9002 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6fenton_6Fenton_1writeInput, 0, __pyx_mstate_global->__pyx_n_u_writeInput, NULL, __pyx_mstate_global->__pyx_n_u_fenton_Fenton, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0]));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error)
9003 __Pyx_GOTREF(__pyx_t_2);
9004 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
9005 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
9007 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[7]);
9008 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_writeInput, __pyx_t_2) < (0)) __PYX_ERR(0, 17, __pyx_L1_error)
9009 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9018 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6fenton_6Fenton_3runFourier, 0, __pyx_mstate_global->__pyx_n_u_runFourier, NULL, __pyx_mstate_global->__pyx_n_u_fenton_Fenton, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1]));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error)
9019 __Pyx_GOTREF(__pyx_t_2);
9020 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
9021 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
9023 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_runFourier, __pyx_t_2) < (0)) __PYX_ERR(0, 106, __pyx_L1_error)
9024 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9033 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6fenton_6Fenton_5getBYCoeffs, 0, __pyx_mstate_global->__pyx_n_u_getBYCoeffs, NULL, __pyx_mstate_global->__pyx_n_u_fenton_Fenton, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2]));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
9034 __Pyx_GOTREF(__pyx_t_2);
9035 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
9036 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
9038 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_getBYCoeffs, __pyx_t_2) < (0)) __PYX_ERR(0, 113, __pyx_L1_error)
9039 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9048 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6fenton_6Fenton_7getWavelength, 0, __pyx_mstate_global->__pyx_n_u_getWavelength, NULL, __pyx_mstate_global->__pyx_n_u_fenton_Fenton, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3]));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 130, __pyx_L1_error)
9049 __Pyx_GOTREF(__pyx_t_2);
9050 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
9051 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
9053 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_getWavelength, __pyx_t_2) < (0)) __PYX_ERR(0, 130, __pyx_L1_error)
9054 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9063 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6fenton_6Fenton_9copyFiles, 0, __pyx_mstate_global->__pyx_n_u_copyFiles, NULL, __pyx_mstate_global->__pyx_n_u_fenton_Fenton, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4]));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 154, __pyx_L1_error)
9064 __Pyx_GOTREF(__pyx_t_2);
9065 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
9066 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
9068 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_copyFiles, __pyx_t_2) < (0)) __PYX_ERR(0, 154, __pyx_L1_error)
9069 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9077 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6fenton_6Fenton_11__get_dir, 0, __pyx_mstate_global->__pyx_n_u_get_dir, NULL, __pyx_mstate_global->__pyx_n_u_fenton_Fenton, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5]));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 166, __pyx_L1_error)
9078 __Pyx_GOTREF(__pyx_t_2);
9079 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
9080 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2);
9082 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_get_dir, __pyx_t_2) < (0)) __PYX_ERR(0, 166, __pyx_L1_error)
9083 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9090 __pyx_t_2 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
9091 __Pyx_GOTREF(__pyx_t_2);
9092 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_2) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
9093 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9099 __Pyx_XDECREF(__pyx_t_2);
9100 __Pyx_XDECREF(__pyx_t_4);
9102 if (__pyx_mstate->__pyx_d && stringtab_initialized) {
9103 __Pyx_AddTraceback(
"init fenton.Fenton", __pyx_clineno, __pyx_lineno, __pyx_filename);
9105 #if !CYTHON_USE_MODULE_STATE
9109 if (pystate_addmodule_run) {
9110 PyObject *tp, *value, *tb;
9111 __Pyx_PyErr_FetchException(&tp, &value, &tb);
9112 __Pyx_State_RemoveModule(&__pyx_moduledef);
9113 __Pyx_PyErr_RestoreException(tp, value, tb);
9116 }
else if (!PyErr_Occurred()) {
9117 PyErr_SetString(PyExc_ImportError,
"init fenton.Fenton");
9120 __Pyx_RefNannyFinishContext();
9121 #if CYTHON_PEP489_MULTI_PHASE_INIT
9122 return (__pyx_m != NULL) ? 0 : -1;
9130static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) {
9131 int __pyx_lineno = 0;
9132 const char *__pyx_filename = NULL;
9133 int __pyx_clineno = 0;
9134 CYTHON_UNUSED_VAR(__pyx_mstate);
9135 __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_open);
if (!__pyx_builtin_open) __PYX_ERR(0, 73, __pyx_L1_error)
9138 __pyx_mstate->__pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type;
9139 __pyx_mstate->__pyx_umethod_PyDict_Type_items.method_name = &__pyx_mstate->__pyx_n_u_items;
9140 __pyx_mstate->__pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type;
9141 __pyx_mstate->__pyx_umethod_PyDict_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop;
9142 __pyx_mstate->__pyx_umethod_PyDict_Type_values.type = (PyObject*)&PyDict_Type;
9143 __pyx_mstate->__pyx_umethod_PyDict_Type_values.method_name = &__pyx_mstate->__pyx_n_u_values;
9150static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) {
9151 __Pyx_RefNannyDeclarations
9152 int __pyx_lineno = 0;
9153 const char *__pyx_filename = NULL;
9154 int __pyx_clineno = 0;
9155 CYTHON_UNUSED_VAR(__pyx_mstate);
9156 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
9166 PyObject* __pyx_temp[7] = {__pyx_mstate_global->__pyx_n_u_waveheight, __pyx_mstate_global->__pyx_n_u_mode, __pyx_mstate_global->__pyx_n_u_length, __pyx_mstate_global->__pyx_n_u_current_criterion, __pyx_mstate_global->__pyx_n_u_current_magnitude, __pyx_mstate_global->__pyx_n_u_ncoeffs, __pyx_mstate_global->__pyx_n_u_height_steps};
9167 __pyx_mstate_global->__pyx_tuple[0] = __Pyx_PyTuple_FromArray(__pyx_temp, 7);
if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(0, 89, __pyx_L1_error)
9168 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]);
9170 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]);
9180 PyObject* __pyx_temp[3] = {Py_None, Py_None, Py_None};
9181 __pyx_mstate_global->__pyx_tuple[1] = __Pyx_PyTuple_FromArray(__pyx_temp, 3);
if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(0, 73, __pyx_L1_error)
9182 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]);
9184 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]);
9194 PyObject* __pyx_temp[2] = {__pyx_mstate_global->__pyx_n_u_niter, __pyx_mstate_global->__pyx_n_u_conv_crit};
9195 __pyx_mstate_global->__pyx_tuple[2] = __Pyx_PyTuple_FromArray(__pyx_temp, 2);
if (unlikely(!__pyx_mstate_global->__pyx_tuple[2])) __PYX_ERR(0, 97, __pyx_L1_error)
9196 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]);
9198 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]);
9208 PyObject* __pyx_temp[2] = {__pyx_mstate_global->__pyx_n_u_delimiter, __pyx_mstate_global->__pyx_n_u_comments};
9209 __pyx_mstate_global->__pyx_tuple[3] = __Pyx_PyTuple_FromArray(__pyx_temp, 2);
if (unlikely(!__pyx_mstate_global->__pyx_tuple[3])) __PYX_ERR(0, 125, __pyx_L1_error)
9210 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]);
9212 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]);
9221 __pyx_mstate_global->__pyx_slice[0] = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_mstate_global->__pyx_slice[0])) __PYX_ERR(0, 126, __pyx_L1_error)
9222 __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[0]);
9223 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
9225 PyObject* __pyx_temp[2] = {__pyx_mstate_global->__pyx_slice[0], __pyx_mstate_global->__pyx_int_1};
9226 __pyx_mstate_global->__pyx_tuple[4] = __Pyx_PyTuple_FromArray(__pyx_temp, 2);
if (unlikely(!__pyx_mstate_global->__pyx_tuple[4])) __PYX_ERR(0, 126, __pyx_L1_error)
9227 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[4]);
9229 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[4]);
9239 PyObject* __pyx_temp[2] = {__pyx_mstate_global->__pyx_slice[0], __pyx_mstate_global->__pyx_int_2};
9240 __pyx_mstate_global->__pyx_tuple[5] = __Pyx_PyTuple_FromArray(__pyx_temp, 2);
if (unlikely(!__pyx_mstate_global->__pyx_tuple[5])) __PYX_ERR(0, 127, __pyx_L1_error)
9241 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[5]);
9243 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[5]);
9253 PyObject* __pyx_temp[2] = {__pyx_mstate_global->__pyx_kp_u_Solution_res, __pyx_mstate_global->__pyx_n_u_r};
9254 __pyx_mstate_global->__pyx_tuple[6] = __Pyx_PyTuple_FromArray(__pyx_temp, 2);
if (unlikely(!__pyx_mstate_global->__pyx_tuple[6])) __PYX_ERR(0, 146, __pyx_L1_error)
9255 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[6]);
9257 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[6]);
9267 PyObject* __pyx_temp[13] = {Py_None, Py_None, ((PyObject*)__pyx_mstate_global->__pyx_n_u_Period), ((PyObject*)__pyx_mstate_global->__pyx_int_1), ((PyObject*)__pyx_mstate_global->__pyx_int_0), ((PyObject*)__pyx_mstate_global->__pyx_int_8), ((PyObject*)__pyx_mstate_global->__pyx_int_1), ((PyObject*)__pyx_mstate_global->__pyx_float_9_81), ((PyObject*)__pyx_mstate_global->__pyx_int_40), ((PyObject*)__pyx_mstate_global->__pyx_float_1_eneg_05), ((PyObject*)__pyx_mstate_global->__pyx_int_50), ((PyObject*)__pyx_mstate_global->__pyx_int_16), ((PyObject*)__pyx_mstate_global->__pyx_int_20)};
9268 __pyx_mstate_global->__pyx_tuple[7] = __Pyx_PyTuple_FromArray(__pyx_temp, 13);
if (unlikely(!__pyx_mstate_global->__pyx_tuple[7])) __PYX_ERR(0, 17, __pyx_L1_error)
9269 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[7]);
9271 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[7]);
9272 #if CYTHON_IMMORTAL_CONSTANTS
9274 PyObject **table = __pyx_mstate->__pyx_tuple;
9275 for (Py_ssize_t i=0; i<8; ++i) {
9276 #if PY_VERSION_HEX >= 0x030F0000
9277 PyUnstable_SetImmortal(table[i]);
9278 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
9279 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL))
break;
9280 #if PY_VERSION_HEX < 0x030E0000
9281 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
9283 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
9286 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
9289 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT))
break;
9290 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
9295 #if CYTHON_IMMORTAL_CONSTANTS
9297 PyObject **table = __pyx_mstate->__pyx_slice;
9298 for (Py_ssize_t i=0; i<1; ++i) {
9299 #if PY_VERSION_HEX >= 0x030F0000
9300 PyUnstable_SetImmortal(table[i]);
9301 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
9302 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL))
break;
9303 #if PY_VERSION_HEX < 0x030E0000
9304 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
9306 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
9309 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
9312 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT))
break;
9313 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
9318 __Pyx_RefNannyFinishContext();
9321 __Pyx_RefNannyFinishContext();
9326static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) {
9327 int __pyx_lineno = 0;
9328 const char *__pyx_filename = NULL;
9329 int __pyx_clineno = 0;
9330 CYTHON_UNUSED_VAR(__pyx_mstate);
9332 const struct {
const unsigned int length: 8; } str_length_index[] = {{1},{1},{1},{242},{15},{8},{13},{48},{10},{12},{11},{99},{39},{34},{25},{7},{3},{6},{9},{4},{10},{7},{20},{12},{17},{9},{8},{8},{8},{9},{8},{10},{8},{12},{8},{13},{18},{10},{18},{8},{9},{4},{9},{17},{17},{25},{9},{5},{7},{1},{13},{8},{6},{1},{10},{11},{13},{12},{5},{1},{6},{14},{4},{6},{4},{7},{5},{2},{5},{4},{2},{4},{6},{18},{15},{15},{3},{7},{1},{10},{10},{6},{5},{4},{10},{6},{1},{10},{18},{10},{5},{10}};
9333 const struct {
const unsigned int length: 9; } bytes_length_index[] = {{15},{331},{83},{9},{49},{72}};
9334 #ifndef CYTHON_COMPRESS_STRINGS
9335 #define CYTHON_COMPRESS_STRINGS 90
9337 #if (CYTHON_COMPRESS_STRINGS) == 1
9338static const char cstring[] =
"x\332\215TMo\333F\020\225\020\253\225d;\376\010\222\006(\234\322\215\333\246\255\243D\205\235\"H\201B\266\241&H\322ZMS\327-jb\275\\J[\223\\jwi\2110\014\370\310#\217{\344\221G\035u\314\261G\035u\314O\360O\350,)\333B}\211 r\206\303\267og\336\314\362~\355\307m\346I\316\034\303\246\0161$3\360\344\031\3541\341m\342ab \3172X \375@\032\31468\021\201#E\365\304\243\222\360\323J\3455\352S7p\r/p\017\t\327\020\375\002I\312<a\330\214\033\004\341\216\321!\264\335\221\206\220\304\177f\324\037\033\277\274\314\3361nQ\017\361\320\350\241c\"\326\215\215\307Y\270\003`\"d\365D\347abN\345ie\233k^`\315\020S\t\256\0332\364)F\216\023\032\365\032y\270\261\016\264\231\2679M\226oQ\335\276ZX\263\220\334A\022i\333tX\317\246\304\261jP\340\256\336\307\322,z\215C\274\266\354\030n\000\034\207\304\020Df\264M\342IHF#v\031\365\244\3204o\230\023\350\3125\313\233\200\333\010v\001w\017@\325\023\r\315u8\255\236\270\314\"`rrpp\30090f\305feN\305\\\324\006\265\203l\201\207\031\261m\001^NejI\341\021\344\367\303\232\211\031\0475\027:D\021\347(4l\004\235\265tk\251\3533.\247a\201\213\240\256\377#|\316$\t\304#;\253\357Q^f\315\017\373[\333\331\316\315\346o\271>\273\234\301\330P\257\255\253\333\273\024j?\207\231\346n\330\207k\207bi\376L\372\362Wb\233&\362<&\221$&\374\260\203\2040\333DB\301\256\016\300N\204gN\237Jm\365Tf6\360\260\266\2005-\n\020\027QO\007@\304 \207x\310\315l7@\316\205/\241\353`\250\320\345\302\004S\217 \021z\230\262\332e@\340\016\301G\246\236\036\014\265\020\023\210%\207\266\035\"|\204\231\353BR\342r\n1\363C}5!1q\255c\327\332u-\000\331\273\260RX\304\241\256^e\021_v\240$\235\262\235+^\313\025\327\265gQ\306\241Mm\030X\2333W\366%\210\2605\321\030\334+\335\247\307A+*\234<\236\337/v\3265:\254\275C\271\036\300\3110eG\331\363\263\331`>\361\230\360a2\374\254\313~6\333\246\315\t\034\374l\240\047\021\330\227a\nG\357\342\221K}\010}\346O&\210\363\300k\262\200S\302\341\314X\304F\372\303\321\001\331\035\341;T\212.\227\"8\0044\206\304\216\221\023\020\321\273:#W\336E\356W\207\261\247%\317n/<\370.\235\025\3073\263""\321w\321\333\370\201ZU\365\263\342\373\205\305\361\007\374\317\237\027\013\245\271\350\373\370+u[\341\344\323\364\247\301\223\341\322x\346\343\263^\204\343\333\261\245\276M\366\322\306\270\274\020u\363h;~\253\326\324Qz\3532\252o\225\371\250\025\375\243\312Iq\\^Q\177&\335\264\230\277-\317F\233\361\215\270>\236[Q\277\047\365d+!i=m\244\255\024\215\347\227\343\373qK\277\231,X\033\255m\016Z\203\303ai\330\032\242a\367\035\304*\321\235\250\033\027\317\027\013P\340j\364lt\347\233\364\213\364x\2607\372\341\325\350\325\301\350\300\034\027\226G\313\017\323?\006\373C\367\337\372\373k\371\\0|\2243<\211?Q\325d\365Cqg\305\363r\241T>\013\343\262\272\241\352\343\362\\\324\210\376R\225d)sG\363\237\251P\347\256\303\177\253\257\223\t\302T/\222V\356\036\250\247Ic\002^Q\373\t\002\312j\241\264\020i\347n\2414\033}\036\275\214\273\243\273\017\322\352\340\313a\345\035\350\177\023\324\277\0257\246\234\331\350i\334\200\005\367\n\245\345x)K|t\363\236\352$HS?\007\310\334b<\0237\325\352xn!\352\305X-\253\rH\355FZ\037/\256\250\226B\252\253Y6\343b\274\364\037\242\355\260v";
9339 PyObject *data = __Pyx_DecompressString(cstring, 1077, 1);
9340 #define __Pyx_DecompressString_LZSS_UNUSED
9341 if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
9342 const char*
const bytes = __Pyx_PyBytes_AsString(data);
9343 #if !CYTHON_ASSUME_SAFE_MACROS
9344 if (likely(bytes));
else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
9346 #elif (CYTHON_COMPRESS_STRINGS) > 0 && (CYTHON_COMPRESS_STRINGS) <= 90
9347static const char cstring[] =
"\377#.?Contr\377ol file \317to c\t\004\005\000ve\377rgence a\377nd outpu\377t of res\377ults\n{ni\377ter}\t\tMa\377ximum nu\317mber\037\001\025\001at\377ions for\377 each he\377ight ste\377p; 10 OK\376\027\002ordinar\377y waves,\327 40.\002h*\000es\367t\n{\204\001_criot}\tC\003\000erS\000\374P\002\226\010, typi\377cally 1.\237e-4, s\000\006\0015\344A\t]\003\n\357\000\322\005.da\337tData\004\001Fl\377owfield.\322\336\000Pd\001\362\000r\222\002le\377ngth mus\377t be set~\322\002Fenton\264\002\277PointsK\001S\347olu\366\001B\001Sur\257faceM\001W\333\000\n\371{\340\001\202#}\n{mo\343de\004\000W\003\r\000cur\341rO\000\350\002\342\002\t\010mag\372\353 u,\002ncoef\023fs?\000\315#_\317!\014\000\374 \377py._core\373.m\237@iarra\257y fa\327@d\327Ai\337mport\033\tum\371a\325\000\022\rprote\257us/f\333\002/\341\003.\337pyxBCu\002FF\335T\232#Pro\264`in\321g\332\001\336\001\243#Y!\003__\367Pyx\001\000Dict\377_NextRef\377__annota\377te____cl\177ass_get\306`\331m\r\001\316 er\004\002xiqt\036\001\222\204\001\003\002unc.\001\356)\000_di \000mai\331n?\001\302 ulH\002na\275mP\002qual\004\005t\254\300`f\000is\222!o\225@n\377easyncio\371.\244 \013\003schec\373k_\272acline\355_V\000tr\264@bac_kcomm\343@s\375f\357copy\000\001Fil\203es\241N\273E\246F\000\016\273\000m~7\000sdelim\274\205\001\237depth\320\000\273\001fb\354#.\323c\216\206\001\021\002or\244@\377ggenfrom\027txt\256 B\335$\271 \356\047\014\203i\316!sl\263\204\003\271\204\003r\005\340\001?logDir\375a\306d\366\306\206\002np\276bopenWosp\227`p\201\205\002p\327\204\002?_frees\313\204\003\013\004\377velocityv\006\006rt\201\206\001pop\273d\377rrunFour\377iersetde\373fa\265\207\001hutil\377splitsqr\357tsub\355`ces\377svaluesw \232\205\007\244\205\007\256%\240\207\001\207\206\003w\210\207\001\000\002\377Input\200\001\330\377\004\013\2102\210U\220(\377\230!\2301\200\001\340\017\303\020\330\000\000\000\003\000\t\n\013\360H\377\001\000\005\014\2107\220\047\377\230\025\230c\240\033\250G\377\2606\270\021\330\004\007\200\377w\210c\220\025\220d""\230\377+\240W\250A\330\010\017\373\210q\020\003g\220U\230$\317\230k\250\023\r\006\027\001\t\r\377\210Q\210j\230\010\240\001\377\330\010\035\230Z\240q\250\375\001.\003\010\013\2105\220\003\377\2201\330\014\035\230V\240\3771\240B\240e\2501\250\377A\250Q\250a\330\r\022\317\220#\220Q\026\001*\004$\320\377$5\260Q\260b\270\005\177\270Q\270a\270q\300K\000\377\t\210\026\210q\220\001\360\373\020\000\336\000!\210;\320\026\377*\250%\250v\260W\320\377<L\320L^\320^_\377\330\000\022\320\022-\250X\377\260Y\270m\3101\340\004\364\200\r:\005\006<\0036\220\027\230\367\n\240!\000%\200\001\360\010\377\000\005\010\200y\220\010\230\377\003\2301\330\010\014\210A\277\210[\230\t\240\021\006\002\320\317\r\037\230y\351\001\023\001]\230\373)\240\033\004_\230I\240Q\276\047\003^\2309\240A&\004\035\357\230Y\240aP\000\n\000\005\373\017\210\005\001\030\000\005\013\210\377\"\210K\220q\320\030(\177\250\n\260&\270\t\300\375 }\016\373 \023\220A\330\004\000\006\337\013\2109\220A\212\000\036\000\337\005\022\220\021\330\355!\320\016_\036\230h\240a\217\001H)\000\377\014\020\220\004\220F\230!\377\330\014\017\210w\220c\230\367\022\2304\230\000\003\2501\330\177\020\035\230Q\230a\230\277@\016\212A\001\220\021";
9348 PyObject *data = __Pyx_DecompressString_LZSS(cstring, 1350, 1784);
9349 #define __Pyx_DecompressString_UNUSED
9350 if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
9351 const char*
const bytes = __Pyx_PyBytes_AsString(data);
9352 #if !CYTHON_ASSUME_SAFE_MACROS
9353 if (likely(bytes));
else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
9356static const char bytes[] =
"#.?Control file to control convergence and output of results\n{niter}\t\tMaximum number of iterations for each height step; 10 OK for ordinary waves, 40 for highest\n{conv_crit}\tCriterion for convergence, typically 1.e-4, or 1.e-5 for highest waves\nConvergence.datData.datFlowfield.resPeriod or wavelength must be set for Fenton wavePoints.datSolution.resSurface.resWave\n{waveheight}\n{mode}\n{length}\n{current_criterion}\n{current_magnitude}\n{ncoeffs}\n{height_steps}\nnumpy._core.multiarray failed to importnumpy._core.umath failed to importproteus/fenton/Fenton.pyxBCoeffsFFTPeriodProfilingWaveWavelengthYCoeffs__Pyx_PyDict_NextRef__annotate____class_getitem____enter____exit____file____func____get_dir__main____module____name____qualname____test___is_coroutineasyncio.coroutinescheck_callcline_in_tracebackcommentsconv_critcopycopyFilescurrent_criterioncurrent_magnitudecurrent_magnitude_dimlessdelimiterdepthdirnameffenton.FentonfilenameformatggenfromtxtgetBYCoeffsgetWavelengthheight_stepsitemsllengthlength_dimlesslinelogDirmodencoeffsniternpnumpyopenospathperiodpoints_freesurfacepoints_velocitypoints_verticalpopproteusrrunFouriersetdefaultshutilsplitsqrtsubprocessvalueswwaveheightwaveheight_dimlesswavelengthwritewriteInput\200\001\330\004\013\2102\210U\220(\230!\2301\200\001\340\017\020\330\017\020\330\017\020\330\017\020\330\017\020\330\017\020\330\017\020\330\017\020\330\017\020\330\017\020\330\017\020\330\017\020\330\017\020\360H\001\000\005\014\2107\220\047\230\025\230c\240\033\250G\2606\270\021\330\004\007\200w\210c\220\025\220d\230+\240W\250A\330\010\017\210q\330\004\007\200w\210g\220U\230$\230k\250\023\250A\330\010\017\210q\330\004\017\210q\330\t\r\210Q\210j\230\010\240\001\330\010\035\230Z\240q\250\001\330\010\017\210q\330\010\013\2105\220\003\2201\330\014\035\230V\2401\240B\240e\2501\250A\250Q\250a\330\r\022\220#\220Q\330\014\035\230Z\240q\250\001\330\010$\320$5\260Q\260b\270\005\270Q\270a\270q\300\001\330\010\t\210\026\210q\220\001\360\020\000\004\013\210!""\210;\320\026*\250%\250v\260W\320<L\320L^\320^_\330\000\022\320\022-\250X\260Y\270m\3101\340\004\017\210q\330\t\r\210Q\210j\230\010\240\001\330\010\t\210\026\210q\220\001\360\006\000\004\013\210!\2106\220\027\230\n\240!\340\004\017\210q\330\t\r\210Q\210j\230\010\240\001\330\010\t\210\026\210q\220\001\360\006\000\004\013\210!\2106\220\027\230\n\240!\200\001\360\010\000\005\010\200y\220\010\230\003\2301\330\010\014\210A\210[\230\t\240\021\330\010\014\210A\320\r\037\230y\250\001\330\010\014\210A\210]\230)\2401\330\010\014\210A\210_\230I\240Q\330\010\014\210A\210^\2309\240A\330\010\014\210A\320\r\035\230Y\240a\200\001\360\n\000\005\017\210a\200\001\360\030\000\005\013\210\"\210K\220q\320\030(\250\n\260&\270\t\300\021\330\004\016\210c\220\023\220A\330\004\016\210c\220\023\220A\330\004\013\2109\220A\200\001\360\036\000\005\022\220\021\330\t\r\210Q\320\016\036\230h\240a\330\010\014\210H\220A\330\014\020\220\004\220F\230!\330\014\017\210w\220c\230\022\2304\230y\250\003\2501\330\020\035\230Q\230a\230q\330\004\013\2105\220\001\220\021";
9357 PyObject *data = NULL;
9358 #define __Pyx_DecompressString_UNUSED
9359 #define __Pyx_DecompressString_LZSS_UNUSED
9361 PyObject **stringtab = __pyx_mstate->__pyx_string_tab;
9363 for (
int i = 0; i < 92; i++) {
9364 Py_ssize_t bytes_length = str_length_index[i].length;
9365 PyObject *
string = PyUnicode_DecodeUTF8(bytes + pos, bytes_length, NULL);
9366 if (likely(
string) && i >= 15) PyUnicode_InternInPlace(&
string);
9367 if (unlikely(!
string)) {
9369 __PYX_ERR(0, 1, __pyx_L1_error)
9371 stringtab[i] = string;
9372 pos += bytes_length;
9374 for (
int i = 92; i < 98; i++) {
9375 Py_ssize_t bytes_length = bytes_length_index[i-92].length;
9376 PyObject *
string = PyBytes_FromStringAndSize(bytes + pos, bytes_length);
9377 stringtab[i] = string;
9378 pos += bytes_length;
9379 if (unlikely(!
string)) {
9381 __PYX_ERR(0, 1, __pyx_L1_error)
9385 for (Py_ssize_t i = 0; i < 98; i++) {
9386 if (unlikely(PyObject_Hash(stringtab[i]) == -1)) {
9387 __PYX_ERR(0, 1, __pyx_L1_error)
9390 #if CYTHON_IMMORTAL_CONSTANTS
9392 PyObject **table = stringtab + 92;
9393 for (Py_ssize_t i=0; i<6; ++i) {
9394 #if PY_VERSION_HEX >= 0x030F0000
9395 PyUnstable_SetImmortal(table[i]);
9396 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
9397 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL))
break;
9398 #if PY_VERSION_HEX < 0x030E0000
9399 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
9401 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
9404 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
9407 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT))
break;
9408 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
9415 PyObject **numbertab = __pyx_mstate->__pyx_number_tab;
9416 double const c_constants[] = {9.81,1.e-05};
9417 for (
int i = 0; i < 2; i++) {
9418 numbertab[i] = PyFloat_FromDouble(c_constants[i]);
9419 if (unlikely(!numbertab[i])) __PYX_ERR(0, 1, __pyx_L1_error)
9423 PyObject **numbertab = __pyx_mstate->__pyx_number_tab + 2;
9424 int8_t
const cint_constants_1[] = {0,1,2,8,16,20,40,50};
9425 for (
int i = 0; i < 8; i++) {
9426 numbertab[i] = PyLong_FromLong(cint_constants_1[i - 0]);
9427 if (unlikely(!numbertab[i])) __PYX_ERR(0, 1, __pyx_L1_error)
9430 #if CYTHON_IMMORTAL_CONSTANTS
9432 PyObject **table = __pyx_mstate->__pyx_number_tab;
9433 for (Py_ssize_t i=0; i<10; ++i) {
9434 #if PY_VERSION_HEX >= 0x030F0000
9435 PyUnstable_SetImmortal(table[i]);
9436 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
9437 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL))
break;
9438 #if PY_VERSION_HEX < 0x030E0000
9439 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
9441 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
9444 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
9447 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT))
break;
9448 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
9462 unsigned int argcount : 4;
9463 unsigned int num_posonly_args : 1;
9464 unsigned int num_kwonly_args : 1;
9465 unsigned int nlocals : 5;
9466 unsigned int flags : 10;
9467 unsigned int first_line : 8;
9468} __Pyx_PyCode_New_function_description;
9473static PyObject* __Pyx_PyCode_New(
9474 const __Pyx_PyCode_New_function_description descr,
9475 PyObject *
const *varnames,
9478 PyObject *line_table,
9479 PyObject *tuple_dedup_map
9483static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) {
9484 PyObject* tuple_dedup_map = PyDict_New();
9485 if (unlikely(!tuple_dedup_map))
return -1;
9487 const __Pyx_PyCode_New_function_description descr = {15, 0, 0, 20, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 17};
9488 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_waveheight, __pyx_mstate->__pyx_n_u_depth, __pyx_mstate->__pyx_n_u_period, __pyx_mstate->__pyx_n_u_wavelength, __pyx_mstate->__pyx_n_u_mode, __pyx_mstate->__pyx_n_u_current_criterion, __pyx_mstate->__pyx_n_u_current_magnitude, __pyx_mstate->__pyx_n_u_ncoeffs, __pyx_mstate->__pyx_n_u_height_steps, __pyx_mstate->__pyx_n_u_g, __pyx_mstate->__pyx_n_u_niter, __pyx_mstate->__pyx_n_u_conv_crit, __pyx_mstate->__pyx_n_u_points_freesurface, __pyx_mstate->__pyx_n_u_points_velocity, __pyx_mstate->__pyx_n_u_points_vertical, __pyx_mstate->__pyx_n_u_filename, __pyx_mstate->__pyx_n_u_f, __pyx_mstate->__pyx_n_u_waveheight_dimless, __pyx_mstate->__pyx_n_u_length_dimless, __pyx_mstate->__pyx_n_u_current_magnitude_dimless};
9489 __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_fenton_Fenton_pyx, __pyx_mstate->__pyx_n_u_writeInput, __pyx_mstate->__pyx_kp_b_iso88591_H_7_c_G6_wc_d_WA_q_wgU_k_A_q_q, tuple_dedup_map);
if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0]))
goto bad;
9492 const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 0, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 106};
9493 PyObject*
const varnames[] = {0};
9494 __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_fenton_Fenton_pyx, __pyx_mstate->__pyx_n_u_runFourier, __pyx_mstate->__pyx_kp_b_iso88591_a, tuple_dedup_map);
if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1]))
goto bad;
9497 const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 3, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 113};
9498 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_FFT, __pyx_mstate->__pyx_n_u_BCoeffs, __pyx_mstate->__pyx_n_u_YCoeffs};
9499 __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_fenton_Fenton_pyx, __pyx_mstate->__pyx_n_u_getBYCoeffs, __pyx_mstate->__pyx_kp_b_iso88591_Kq_c_A_c_A_9A, tuple_dedup_map);
if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2]))
goto bad;
9502 const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 4, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 130};
9503 PyObject*
const varnames[] = {__pyx_mstate->__pyx_n_u_wavelength, __pyx_mstate->__pyx_n_u_f, __pyx_mstate->__pyx_n_u_line, __pyx_mstate->__pyx_n_u_l};
9504 __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_fenton_Fenton_pyx, __pyx_mstate->__pyx_n_u_getWavelength, __pyx_mstate->__pyx_kp_b_iso88591_Q_ha_HA_F_wc_4y_1_Qaq_5, tuple_dedup_map);
if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3]))
goto bad;
9507 const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 0, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 154};
9508 PyObject*
const varnames[] = {0};
9509 __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_fenton_Fenton_pyx, __pyx_mstate->__pyx_n_u_copyFiles, __pyx_mstate->__pyx_kp_b_iso88591_y_1_A_A_y_A_1_A_IQ_A_9A_A_Ya, tuple_dedup_map);
if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4]))
goto bad;
9512 const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 0, (
unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 166};
9513 PyObject*
const varnames[] = {0};
9514 __pyx_mstate_global->__pyx_codeobj_tab[5] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_fenton_Fenton_pyx, __pyx_mstate->__pyx_n_u_get_dir, __pyx_mstate->__pyx_kp_b_iso88591_2U_1, tuple_dedup_map);
if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5]))
goto bad;
9516 Py_DECREF(tuple_dedup_map);
9519 Py_DECREF(tuple_dedup_map);
9524static int __Pyx_InitGlobals(
void) {
9525 int __pyx_lineno = 0;
9526 const char *__pyx_filename = NULL;
9527 int __pyx_clineno = 0;
9529 if (likely(__Pyx_init_co_variables() == 0 && __Pyx_init_tpflags_variables() == 0));
else
9531 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
9534 if (likely(__Pyx_init_assertions_enabled() == 0));
else
9536 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
9539 #if CYTHON_COMPILING_IN_LIMITED_API
9541 PyObject *builtins = PyEval_GetBuiltins();
9542 if (likely(builtins)) {
9543 PyObject *type_name = PyUnicode_FromStringAndSize(
"frozendict",
sizeof(
"frozendict")-1);
9544 if (likely(type_name)) {
9545 PyObject *frozendict_type = PyObject_GetItem(builtins, type_name);
9546 Py_DECREF(type_name);
9547 if (!frozendict_type && PyErr_ExceptionMatches(PyExc_KeyError)) {
9549 frozendict_type = (PyObject*) &PyDict_Type;
9550 Py_INCREF(frozendict_type);
9552 __pyx_mstate_global->__Pyx_PyFrozenDictType = frozendict_type;
9558 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
9567 #ifdef NPY_FEATURE_VERSION
9568 #ifndef NO_IMPORT_ARRAY
9569 if (unlikely(_import_array() == -1)) {
9570 PyErr_SetString(PyExc_ImportError,
"numpy.core.multiarray failed to import "
9571 "(auto-generated because you didn't call 'numpy.import_array()' after cimporting numpy; "
9572 "use '<void>numpy._import_array' to disable if you are certain you don't need it).");
9577 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
9580 if (likely(__pyx_CommonTypesMetaclass_init(__pyx_m) == 0));
else
9582 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
9585 #if CYTHON_COMPILING_IN_LIMITED_API
9587 PyObject *typesModule=NULL;
9588 typesModule = PyImport_ImportModule(
"types");
9590 __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule,
"MethodType");
9591 Py_DECREF(typesModule);
9596 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
9604static int __Pyx_InitAfterSharedUtility(
void) {
9605 int __pyx_lineno = 0;
9606 const char *__pyx_filename = NULL;
9607 int __pyx_clineno = 0;
9609 if (likely(__pyx_CyFunction_init(__pyx_m) == 0));
else
9611 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
9622#pragma warning( push )
9627#pragma warning( disable : 4127 )
9637static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
9638 PyObject *m = NULL, *p = NULL;
9640 m = PyImport_ImportModule(modname);
9642 p = PyObject_GetAttrString(m,
"RefNannyAPI");
9644 r = PyLong_AsVoidPtr(p);
9648 return (__Pyx_RefNannyAPIStruct *)
r;
9653#if CYTHON_COMPILING_IN_CPYTHON
9654static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
9656 a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
9660 return b == &PyBaseObject_Type;
9662static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
9664 if (a == b)
return 1;
9668 n = PyTuple_GET_SIZE(mro);
9669 for (i = 0; i <
n; i++) {
9670 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
9675 return __Pyx_InBases(a, b);
9677static CYTHON_INLINE
int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
9679 if (cls == a || cls == b)
return 1;
9683 n = PyTuple_GET_SIZE(mro);
9684 for (i = 0; i <
n; i++) {
9685 PyObject *base = PyTuple_GET_ITEM(mro, i);
9686 if (base == (PyObject *)a || base == (PyObject *)b)
9691 return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
9696#if CYTHON_FAST_THREAD_STATE
9697static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
9698#if PY_VERSION_HEX >= 0x030C00A6
9699 PyObject *tmp_value;
9700 assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
9702 #if CYTHON_COMPILING_IN_CPYTHON
9703 if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
9705 PyException_SetTraceback(value, tb);
9707 tmp_value = tstate->current_exception;
9708 tstate->current_exception = value;
9709 Py_XDECREF(tmp_value);
9713 PyObject *tmp_type, *tmp_value, *tmp_tb;
9714 tmp_type = tstate->curexc_type;
9715 tmp_value = tstate->curexc_value;
9716 tmp_tb = tstate->curexc_traceback;
9717 tstate->curexc_type = type;
9718 tstate->curexc_value = value;
9719 tstate->curexc_traceback = tb;
9720 Py_XDECREF(tmp_type);
9721 Py_XDECREF(tmp_value);
9725static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
9726#if PY_VERSION_HEX >= 0x030C00A6
9727 PyObject* exc_value;
9728 exc_value = tstate->current_exception;
9729 tstate->current_exception = 0;
9734 *type = (PyObject*) Py_TYPE(exc_value);
9736 #if CYTHON_COMPILING_IN_CPYTHON
9737 *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
9740 *tb = PyException_GetTraceback(exc_value);
9744 *type = tstate->curexc_type;
9745 *value = tstate->curexc_value;
9746 *tb = tstate->curexc_traceback;
9747 tstate->curexc_type = 0;
9748 tstate->curexc_value = 0;
9749 tstate->curexc_traceback = 0;
9755#if CYTHON_COMPILING_IN_CPYTHON
9756static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
9758 return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
9760 return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
9763static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
9765 assert(PyExceptionClass_Check(exc_type));
9766 n = PyTuple_GET_SIZE(tuple);
9767 for (i=0; i<
n; i++) {
9768 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
9770 for (i=0; i<
n; i++) {
9771 PyObject *t = PyTuple_GET_ITEM(tuple, i);
9772 if (likely(PyExceptionClass_Check(t))) {
9773 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
9779static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
9780 if (likely(err == exc_type))
return 1;
9781 if (likely(PyExceptionClass_Check(err))) {
9782 if (likely(PyExceptionClass_Check(exc_type))) {
9783 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
9784 }
else if (likely(PyTuple_Check(exc_type))) {
9785 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
9789 return PyErr_GivenExceptionMatches(err, exc_type);
9791static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
9792 assert(PyExceptionClass_Check(exc_type1));
9793 assert(PyExceptionClass_Check(exc_type2));
9794 if (likely(err == exc_type1 || err == exc_type2))
return 1;
9795 if (likely(PyExceptionClass_Check(err))) {
9796 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
9798 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
9803#if CYTHON_FAST_THREAD_STATE
9804static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
9806 n = PyTuple_GET_SIZE(tuple);
9807 for (i=0; i<
n; i++) {
9808 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
9810 for (i=0; i<
n; i++) {
9811 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i)))
return 1;
9815static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
9818#if PY_VERSION_HEX >= 0x030C00A6
9819 PyObject *current_exception = tstate->current_exception;
9820 if (unlikely(!current_exception))
return 0;
9821 exc_type = (PyObject*) Py_TYPE(current_exception);
9822 if (exc_type == err)
return 1;
9824 exc_type = tstate->curexc_type;
9825 if (exc_type == err)
return 1;
9826 if (unlikely(!exc_type))
return 0;
9828 #if CYTHON_AVOID_BORROWED_REFS
9829 Py_INCREF(exc_type);
9831 if (unlikely(PyTuple_Check(err))) {
9832 result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
9834 result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
9836 #if CYTHON_AVOID_BORROWED_REFS
9837 Py_DECREF(exc_type);
9844#if CYTHON_USE_TYPE_SLOTS
9845static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
9846 PyTypeObject* tp = Py_TYPE(obj);
9847 if (likely(tp->tp_getattro))
9848 return tp->tp_getattro(obj, attr_name);
9849 return PyObject_GetAttr(obj, attr_name);
9854#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
9855static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(
void) {
9856 __Pyx_PyThreadState_declare
9857 __Pyx_PyThreadState_assign
9858 if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
9859 __Pyx_PyErr_Clear();
9862static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
9864#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
9865 (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
9868#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS
9869 PyTypeObject* tp = Py_TYPE(obj);
9870 if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
9871 return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
9874 result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
9875 if (unlikely(!result)) {
9876 __Pyx_PyObject_GetAttrStr_ClearAttributeError();
9883static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
9884 PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_b, name);
9885 if (unlikely(!result) && !PyErr_Occurred()) {
9886 PyErr_Format(PyExc_NameError,
9887 "name '%U' is not defined", name);
9893#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
9894static _PyErr_StackItem *
9895__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
9897 _PyErr_StackItem *exc_info = tstate->exc_info;
9898 while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) &&
9899 exc_info->previous_item != NULL)
9901 exc_info = exc_info->previous_item;
9908#if CYTHON_FAST_THREAD_STATE
9909static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
9910 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
9911 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
9912 PyObject *exc_value = exc_info->exc_value;
9913 if (exc_value == NULL || exc_value == Py_None) {
9920 *type = (PyObject*) Py_TYPE(exc_value);
9922 *tb = PyException_GetTraceback(exc_value);
9924 #elif CYTHON_USE_EXC_INFO_STACK
9925 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
9926 *type = exc_info->exc_type;
9927 *value = exc_info->exc_value;
9928 *tb = exc_info->exc_traceback;
9933 *type = tstate->exc_type;
9934 *value = tstate->exc_value;
9935 *tb = tstate->exc_traceback;
9941static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
9942 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
9943 _PyErr_StackItem *exc_info = tstate->exc_info;
9944 PyObject *tmp_value = exc_info->exc_value;
9945 exc_info->exc_value = value;
9946 Py_XDECREF(tmp_value);
9950 PyObject *tmp_type, *tmp_value, *tmp_tb;
9951 #if CYTHON_USE_EXC_INFO_STACK
9952 _PyErr_StackItem *exc_info = tstate->exc_info;
9953 tmp_type = exc_info->exc_type;
9954 tmp_value = exc_info->exc_value;
9955 tmp_tb = exc_info->exc_traceback;
9956 exc_info->exc_type = type;
9957 exc_info->exc_value = value;
9958 exc_info->exc_traceback = tb;
9960 tmp_type = tstate->exc_type;
9961 tmp_value = tstate->exc_value;
9962 tmp_tb = tstate->exc_traceback;
9963 tstate->exc_type = type;
9964 tstate->exc_value = value;
9965 tstate->exc_traceback = tb;
9967 Py_XDECREF(tmp_type);
9968 Py_XDECREF(tmp_value);
9975#if CYTHON_FAST_THREAD_STATE
9976static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
9978static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
9981 PyObject *local_type = NULL, *local_value, *local_tb = NULL;
9982#if CYTHON_FAST_THREAD_STATE
9983 PyObject *tmp_type, *tmp_value, *tmp_tb;
9984 #if PY_VERSION_HEX >= 0x030C0000
9985 local_value = tstate->current_exception;
9986 tstate->current_exception = 0;
9988 local_type = tstate->curexc_type;
9989 local_value = tstate->curexc_value;
9990 local_tb = tstate->curexc_traceback;
9991 tstate->curexc_type = 0;
9992 tstate->curexc_value = 0;
9993 tstate->curexc_traceback = 0;
9995#elif __PYX_LIMITED_VERSION_HEX >= 0x030C0000
9996 local_value = PyErr_GetRaisedException();
9998 PyErr_Fetch(&local_type, &local_value, &local_tb);
10000#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
10001 if (likely(local_value)) {
10002 local_type = (PyObject*) Py_TYPE(local_value);
10003 Py_INCREF(local_type);
10004 local_tb = PyException_GetTraceback(local_value);
10007 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
10008#if CYTHON_FAST_THREAD_STATE
10009 if (unlikely(tstate->curexc_type))
10011 if (unlikely(PyErr_Occurred()))
10015 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
10019 Py_XINCREF(local_tb);
10020 Py_XINCREF(local_type);
10021 Py_XINCREF(local_value);
10022 *type = local_type;
10023 *value = local_value;
10025#if CYTHON_FAST_THREAD_STATE
10026 #if CYTHON_USE_EXC_INFO_STACK
10028 _PyErr_StackItem *exc_info = tstate->exc_info;
10029 #if PY_VERSION_HEX >= 0x030B00a4
10030 tmp_value = exc_info->exc_value;
10031 exc_info->exc_value = local_value;
10034 Py_XDECREF(local_type);
10035 Py_XDECREF(local_tb);
10037 tmp_type = exc_info->exc_type;
10038 tmp_value = exc_info->exc_value;
10039 tmp_tb = exc_info->exc_traceback;
10040 exc_info->exc_type = local_type;
10041 exc_info->exc_value = local_value;
10042 exc_info->exc_traceback = local_tb;
10046 tmp_type = tstate->exc_type;
10047 tmp_value = tstate->exc_value;
10048 tmp_tb = tstate->exc_traceback;
10049 tstate->exc_type = local_type;
10050 tstate->exc_value = local_value;
10051 tstate->exc_traceback = local_tb;
10053 Py_XDECREF(tmp_type);
10054 Py_XDECREF(tmp_value);
10055 Py_XDECREF(tmp_tb);
10056#elif __PYX_LIMITED_VERSION_HEX >= 0x030b0000
10057 PyErr_SetHandledException(local_value);
10058 Py_XDECREF(local_value);
10059 Py_XDECREF(local_type);
10060 Py_XDECREF(local_tb);
10062 PyErr_SetExcInfo(local_type, local_value, local_tb);
10065#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
10070 Py_XDECREF(local_type);
10071 Py_XDECREF(local_value);
10072 Py_XDECREF(local_tb);
10078#if CYTHON_COMPILING_IN_CPYTHON
10079static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
10081 ternaryfunc call = Py_TYPE(func)->tp_call;
10082 if (unlikely(!call))
10083 return PyObject_Call(func, arg, kw);
10084 if (unlikely(Py_EnterRecursiveCall(
" while calling a Python object")))
10086 result = (*call)(func, arg, kw);
10087 Py_LeaveRecursiveCall();
10088 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
10091 "NULL result without error in PyObject_Call");
10098#if CYTHON_COMPILING_IN_CPYTHON
10099static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
10100 PyObject *self, *result;
10102 cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
10103 self = __Pyx_CyOrPyCFunction_GET_SELF(func);
10104 if (unlikely(Py_EnterRecursiveCall(
" while calling a Python object")))
10106 result = cfunc(self, arg);
10107 Py_LeaveRecursiveCall();
10108 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
10111 "NULL result without error in PyObject_Call");
10118#if CYTHON_COMPILING_IN_LIMITED_API
10119static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject *
const*args,
size_t nargs, PyObject *kwargs) {
10120 PyObject *argstuple;
10121 PyObject *result = 0;
10123 argstuple = PyTuple_New((Py_ssize_t)nargs);
10124 if (unlikely(!argstuple))
return NULL;
10125 for (i = 0; i < nargs; i++) {
10126 Py_INCREF(args[i]);
10127 if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) != (0))
goto bad;
10129 result = __Pyx_PyObject_Call(func, argstuple, kwargs);
10131 Py_DECREF(argstuple);
10135#if CYTHON_VECTORCALL && !(CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY)
10136 #if CYTHON_COMPILING_IN_CPYTHON
10137static CYTHON_INLINE vectorcallfunc __Pyx_PyVectorcall_Function(PyObject *callable) {
10138 PyTypeObject *tp = Py_TYPE(callable);
10139 #if defined(__Pyx_CyFunction_USED)
10140 if (__Pyx_CyFunction_CheckExact(callable)) {
10141 return __Pyx_CyFunction_func_vectorcall(callable);
10144 if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL)) {
10147 assert(PyCallable_Check(callable));
10148 Py_ssize_t offset = tp->tp_vectorcall_offset;
10149 assert(offset > 0);
10150 vectorcallfunc ptr;
10151 memcpy(&ptr, (
char *) callable + offset,
sizeof(ptr));
10155 #define __Pyx_PyVectorcall_Function(callable) PyVectorcall_Function(callable)
10158static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwargs) {
10159 Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(nargsf);
10160#if CYTHON_COMPILING_IN_CPYTHON
10161 if (nargs == 0 && kwargs == NULL) {
10162 if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS))
10163 return __Pyx_PyObject_CallMethO(func, NULL);
10165 else if (nargs == 1 && kwargs == NULL) {
10166 if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O))
10167 return __Pyx_PyObject_CallMethO(func, args[0]);
10170 if (kwargs == NULL) {
10171 #if CYTHON_VECTORCALL
10172 #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
10173 return PyObject_Vectorcall(func, args, nargsf, NULL);
10175 vectorcallfunc
f = __Pyx_PyVectorcall_Function(func);
10177 return f(func, args, nargsf, NULL);
10183 return __Pyx_PyObject_Call(func, __pyx_mstate_global->__pyx_empty_tuple, kwargs);
10185 #if CYTHON_COMPILING_IN_LIMITED_API
10186 return __Pyx_PyObject_FastCall_fallback(func, args, (
size_t)nargs, kwargs);
10187 #elif CYTHON_COMPILING_IN_PYPY
10188 return PyObject_VectorcallDict(func, args, (
size_t) nargs, kwargs);
10190 return PyObject_VectorcallDict(func, args, nargsf, kwargs);
10195static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
10196 PyObject* owned_instance = NULL;
10197 if (tb == Py_None) {
10199 }
else if (tb && !PyTraceBack_Check(tb)) {
10200 PyErr_SetString(PyExc_TypeError,
10201 "raise: arg 3 must be a traceback or None");
10204 if (value == Py_None)
10206 if (PyExceptionInstance_Check(type)) {
10208 PyErr_SetString(PyExc_TypeError,
10209 "instance exception may not have a separate value");
10213 type = (PyObject*) Py_TYPE(value);
10214 }
else if (PyExceptionClass_Check(type)) {
10215 PyObject *instance_class = NULL;
10216 if (value && PyExceptionInstance_Check(value)) {
10217 instance_class = (PyObject*) Py_TYPE(value);
10218 if (instance_class != type) {
10219 int is_subclass = PyObject_IsSubclass(instance_class, type);
10220 if (!is_subclass) {
10221 instance_class = NULL;
10222 }
else if (unlikely(is_subclass == -1)) {
10225 type = instance_class;
10229 if (!instance_class) {
10232 args = PyTuple_New(0);
10233 else if (PyTuple_Check(value)) {
10237 args = PyTuple_Pack(1, value);
10240 owned_instance = PyObject_Call(type, args, NULL);
10242 if (!owned_instance)
10244 value = owned_instance;
10245 if (!PyExceptionInstance_Check(value)) {
10246 PyErr_Format(PyExc_TypeError,
10247 "calling %R should have returned an instance of "
10248 "BaseException, not %R",
10249 type, Py_TYPE(value));
10254 PyErr_SetString(PyExc_TypeError,
10255 "raise: exception class must be a subclass of BaseException");
10259 PyObject *fixed_cause;
10260 if (cause == Py_None) {
10261 fixed_cause = NULL;
10262 }
else if (PyExceptionClass_Check(cause)) {
10263 fixed_cause = PyObject_CallObject(cause, NULL);
10264 if (fixed_cause == NULL)
10266 }
else if (PyExceptionInstance_Check(cause)) {
10267 fixed_cause = cause;
10268 Py_INCREF(fixed_cause);
10270 PyErr_SetString(PyExc_TypeError,
10271 "exception causes must derive from "
10275 PyException_SetCause(value, fixed_cause);
10277 PyErr_SetObject(type, value);
10279#if PY_VERSION_HEX >= 0x030C00A6
10280 PyException_SetTraceback(value, tb);
10281#elif CYTHON_FAST_THREAD_STATE
10282 PyThreadState *tstate = __Pyx_PyThreadState_Current;
10283 PyObject* tmp_tb = tstate->curexc_traceback;
10284 if (tb != tmp_tb) {
10286 tstate->curexc_traceback = tb;
10287 Py_XDECREF(tmp_tb);
10290 PyObject *tmp_type, *tmp_value, *tmp_tb;
10291 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
10293 PyErr_Restore(tmp_type, tmp_value, tb);
10294 Py_XDECREF(tmp_tb);
10298 Py_XDECREF(owned_instance);
10303#if CYTHON_COMPILING_IN_CPYTHON
10304static CYTHON_INLINE
void __Pyx_copy_object_array(PyObject *
const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
10307 for (i = 0; i < length; i++) {
10308 v = dest[i] = src[i];
10315#if !(PY_VERSION_HEX >= 0x030F0000 && !CYTHON_COMPILING_IN_LIMITED_API)
10316CYTHON_UNUSED
static PyObject *
10317__Pyx_PyTuple_FromArray(PyObject *
const *src, Py_ssize_t
n) {
10319 return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
10321 PyObject *res = PyTuple_New(
n);
10322 if (unlikely(res == NULL))
return NULL;
10323 #if CYTHON_COMPILING_IN_CPYTHON
10324 __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item,
n);
10327 for (i = 0; i <
n; i++) {
10329 if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < (0))) {
10340#ifndef __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
10341#define __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
10342static CYTHON_INLINE
int __Pyx_PyObject_CompareStrStrBoolEq(PyObject* s1, PyObject* s2) {
10343 #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
10344 int result = PyUnicode_Equal(s1, s2);
10345 #if !CYTHON_COMPILING_IN_CPYTHON
10346 if (unlikely(result == -1))
return -1;
10348 if (result == 0)
goto __pyx_return_false;
else goto __pyx_return_true;
10350 int result = PyUnicode_Compare(s1, s2);
10351 if (unlikely((result == -1) && PyErr_Occurred()))
return -1;
10352 if (result == 0)
goto __pyx_return_true;
else goto __pyx_return_false;
10360static CYTHON_INLINE
int __Pyx_PyObject_CompareBoolEq_str_str(PyObject *op1, PyObject *op2,
int pyop) {
10361 CYTHON_UNUSED_VAR(pyop);
10362 if (unlikely(op1 == Py_None)) {
10363 if (op2 == Py_None)
goto __pyx_return_true;
else goto __pyx_return_false;
10365 if (unlikely(op2 == Py_None)) {
10366 if (op1 == Py_None)
goto __pyx_return_true;
else goto __pyx_return_false;
10369 if (likely(op1 != Py_None)) {
10370 if (op1 == op2)
goto __pyx_return_true;
10371 if (likely(op2 != Py_None)) {
10372 return __Pyx_PyObject_CompareStrStrBoolEq(op1, op2);
10374 goto __pyx_richcmp;
10377 if ((0))
goto __pyx_richcmp;
10378 if ((0))
goto __pyx_return_true;
10379 if ((0))
goto __pyx_return_false;
10381 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_EQ);
10389#if CYTHON_VECTORCALL
10390static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *
const *kwvalues, PyObject *
s)
10392 Py_ssize_t i,
n = __Pyx_PyTuple_GET_SIZE(kwnames);
10393 #if !CYTHON_ASSUME_SAFE_SIZE
10394 if (unlikely(
n == -1))
return NULL;
10396 for (i = 0; i <
n; i++)
10398 PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
10399 #if !CYTHON_ASSUME_SAFE_MACROS
10400 if (unlikely(!namei))
return NULL;
10402 if (
s == namei)
return kwvalues[i];
10404 for (i = 0; i <
n; i++)
10406 PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
10407 #if !CYTHON_ASSUME_SAFE_MACROS
10408 if (unlikely(!namei))
return NULL;
10410 int eq = __Pyx_PyUnicode_Equals(
s, namei);
10411 if (unlikely(eq != 0)) {
10412 if (unlikely(eq < 0))
return NULL;
10413 return kwvalues[i];
10418#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL
10419CYTHON_UNUSED
static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *
const *kwvalues) {
10420 Py_ssize_t i, nkwargs;
10422#if !CYTHON_ASSUME_SAFE_SIZE
10423 nkwargs = PyTuple_Size(kwnames);
10424 if (unlikely(nkwargs < 0))
return NULL;
10426 nkwargs = PyTuple_GET_SIZE(kwnames);
10428 dict = PyDict_New();
10429 if (unlikely(!dict))
10431 for (i=0; i<nkwargs; i++) {
10432#if !CYTHON_ASSUME_SAFE_MACROS
10433 PyObject *key = PyTuple_GetItem(kwnames, i);
10434 if (!key)
goto bad;
10436 PyObject *key = PyTuple_GET_ITEM(kwnames, i);
10438 if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
10450static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
10451 PyObject *args[2] = {NULL, arg};
10452 return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
10456static CYTHON_INLINE
int __Pyx_IgnoreGivenException(PyObject *given_exception, PyObject *ignorable_exception) {
10457 if (PyErr_GivenExceptionMatches(given_exception ? given_exception : PyErr_Occurred(), ignorable_exception)) {
10465#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
10466static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) {
10468 PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args));
10469 if (unlikely(!selfless_args))
return NULL;
10470 result = PyObject_Call(method, selfless_args, kwargs);
10471 Py_DECREF(selfless_args);
10475static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames) {
10476 return PyObject_Vectorcall(method, args ? args+1 : NULL, nargs ? (
size_t) nargs-1 : 0, kwnames);
10479static PyMethodDef __Pyx_UnboundCMethod_Def = {
10480 "CythonUnboundCMethod",
10481 __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall),
10482#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
10483 METH_VARARGS | METH_KEYWORDS,
10485 METH_FASTCALL | METH_KEYWORDS,
10489static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
10490 PyObject *method, *result=NULL;
10491 method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
10492 if (unlikely(!method))
10495#if CYTHON_COMPILING_IN_CPYTHON
10496 if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
10498 PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
10499 target->func = descr->d_method->ml_meth;
10500 target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST);
10503#if CYTHON_COMPILING_IN_PYPY
10505 if (PyCFunction_Check(method))
10510#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
10511 self = PyObject_GetAttrString(method,
"__self__");
10512 if (!self && !__Pyx_IgnoreException(PyExc_AttributeError)) {
10516 self = PyCFunction_GET_SELF(method);
10518 self_found = (self && self != Py_None);
10519#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
10523 PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method);
10524 if (unlikely(!unbound_method))
return -1;
10526 result = unbound_method;
10529#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
10530 if (unlikely(target->method)) {
10534 target->method = result;
10539#if CYTHON_COMPILING_IN_CPYTHON
10540static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
10541 int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
10542 if (likely(was_initialized == 2 && cfunc->func)) {
10543 if (likely(cfunc->flag == METH_NOARGS))
10544 return __Pyx_CallCFunction(cfunc, self, NULL);
10545 if (likely(cfunc->flag == METH_FASTCALL))
10546 return __Pyx_CallCFunctionFast(cfunc, self, NULL, 0);
10547 if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
10548 return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, NULL, 0, NULL);
10549 if (likely(cfunc->flag == (METH_VARARGS | METH_KEYWORDS)))
10550 return __Pyx_CallCFunctionWithKeywords(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple, NULL);
10551 if (cfunc->flag == METH_VARARGS)
10552 return __Pyx_CallCFunction(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple);
10553 return __Pyx__CallUnboundCMethod0(cfunc, self);
10555#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
10556 else if (unlikely(was_initialized == 1)) {
10557 __Pyx_CachedCFunction tmp_cfunc = {
10562 tmp_cfunc.type = cfunc->type;
10563 tmp_cfunc.method_name = cfunc->method_name;
10564 return __Pyx__CallUnboundCMethod0(&tmp_cfunc, self);
10567 PyObject *result = __Pyx__CallUnboundCMethod0(cfunc, self);
10568 __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
10572static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
10574 if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0))
return NULL;
10575 result = __Pyx_PyObject_CallOneArg(cfunc->method, self);
10580static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) {
10581 return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_items, d);
10585static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) {
10586 return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_values, d);
10590#if CYTHON_AVOID_BORROWED_REFS
10591static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue) {
10592 PyObject *next = NULL;
10595 PyObject *dictview = pkey ? __Pyx_PyDict_Items(p) : __Pyx_PyDict_Values(p);
10596 if (unlikely(!dictview))
goto bad;
10597 *ppos = PyObject_GetIter(dictview);
10598 Py_DECREF(dictview);
10600 *ppos = PyObject_GetIter(p);
10602 if (unlikely(!*ppos))
goto bad;
10604 next = PyIter_Next(*ppos);
10606 if (PyErr_Occurred())
goto bad;
10609 if (pkey && pvalue) {
10610 *pkey = __Pyx_PySequence_ITEM(next, 0);
10611 if (unlikely(*pkey))
goto bad;
10612 *pvalue = __Pyx_PySequence_ITEM(next, 1);
10613 if (unlikely(*pvalue))
goto bad;
10624#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
10625 PyErr_FormatUnraisable(
"Exception ignored in __Pyx_PyDict_NextRef");
10627 PyErr_WriteUnraisable(__pyx_mstate_global->__pyx_n_u_Pyx_PyDict_NextRef);
10629 if (pkey) *pkey = NULL;
10630 if (pvalue) *pvalue = NULL;
10634static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue) {
10635 int result = PyDict_Next(p, ppos, pkey, pvalue);
10636 if (likely(result == 1)) {
10637 if (pkey) Py_INCREF(*pkey);
10638 if (pvalue) Py_INCREF(*pvalue);
10645static void __Pyx_RaiseDoubleKeywordsError(
10646 const char* func_name,
10649 PyErr_Format(PyExc_TypeError,
10650 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
10654#if CYTHON_COMPILING_IN_CPYTHON
10655static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) {
10656 int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
10657 if (likely(was_initialized == 2 && cfunc->func)) {
10658 PyObject *args[2] = {arg1, arg2};
10659 if (cfunc->flag == METH_FASTCALL) {
10660 return __Pyx_CallCFunctionFast(cfunc, self, args, 2);
10662 if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
10663 return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, 2, NULL);
10665#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
10666 else if (unlikely(was_initialized == 1)) {
10667 __Pyx_CachedCFunction tmp_cfunc = {
10672 tmp_cfunc.type = cfunc->type;
10673 tmp_cfunc.method_name = cfunc->method_name;
10674 return __Pyx__CallUnboundCMethod2(&tmp_cfunc, self, arg1, arg2);
10677 PyObject *result = __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
10678 __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
10682static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){
10683 if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0))
return NULL;
10684#if CYTHON_COMPILING_IN_CPYTHON
10685 if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
10686 PyObject *result = NULL;
10687 PyObject *args = PyTuple_New(2);
10688 if (unlikely(!args))
return NULL;
10690 PyTuple_SET_ITEM(args, 0, arg1);
10692 PyTuple_SET_ITEM(args, 1, arg2);
10693 if (cfunc->flag & METH_KEYWORDS)
10694 result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL);
10696 result = __Pyx_CallCFunction(cfunc, self, args);
10702 PyObject *args[4] = {NULL, self, arg1, arg2};
10703 return __Pyx_PyObject_FastCall(cfunc->method, args+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
10708static int __Pyx_ValidateDuplicatePosArgs(
10710 PyObject **
const argnames[],
10711 PyObject **
const *first_kw_arg,
10712 const char* function_name)
10714 PyObject **
const *name = argnames;
10715 while (name != first_kw_arg) {
10716 PyObject *key = **name;
10717 int found = PyDict_Contains(kwds, key);
10718 if (unlikely(found)) {
10719 if (found == 1) __Pyx_RaiseDoubleKeywordsError(function_name, key);
10728#if CYTHON_USE_UNICODE_INTERNALS
10729static CYTHON_INLINE
int __Pyx_UnicodeKeywordsEqual(PyObject *s1, PyObject *s2) {
10731 Py_ssize_t len = PyUnicode_GET_LENGTH(s1);
10732 if (len != PyUnicode_GET_LENGTH(s2))
return 0;
10733 kind = PyUnicode_KIND(s1);
10734 if (kind != PyUnicode_KIND(s2))
return 0;
10735 const void *data1 = PyUnicode_DATA(s1);
10736 const void *data2 = PyUnicode_DATA(s2);
10737 return (memcmp(data1, data2, (
size_t) len * (
size_t) kind) == 0);
10740static int __Pyx_MatchKeywordArg_str(
10742 PyObject **
const argnames[],
10743 PyObject **
const *first_kw_arg,
10744 size_t *index_found,
10745 const char *function_name)
10747 PyObject **
const *name;
10748 #if CYTHON_USE_UNICODE_INTERNALS
10749 Py_hash_t key_hash = ((PyASCIIObject*)key)->hash;
10750 if (unlikely(key_hash == -1)) {
10751 key_hash = PyObject_Hash(key);
10752 if (unlikely(key_hash == -1))
10756 name = first_kw_arg;
10758 PyObject *name_str = **name;
10759 #if CYTHON_USE_UNICODE_INTERNALS
10760 if (key_hash == ((PyASCIIObject*)name_str)->hash && __Pyx_UnicodeKeywordsEqual(name_str, key)) {
10761 *index_found = (size_t) (name - argnames);
10765 #if CYTHON_ASSUME_SAFE_SIZE
10766 if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
10769 int cmp = PyUnicode_Compare(name_str, key);
10770 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
10772 *index_found = (size_t) (name - argnames);
10780 while (name != first_kw_arg) {
10781 PyObject *name_str = **name;
10782 #if CYTHON_USE_UNICODE_INTERNALS
10783 if (unlikely(key_hash == ((PyASCIIObject*)name_str)->hash)) {
10784 if (__Pyx_UnicodeKeywordsEqual(name_str, key))
10785 goto arg_passed_twice;
10788 #if CYTHON_ASSUME_SAFE_SIZE
10789 if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
10792 if (unlikely(name_str == key))
goto arg_passed_twice;
10793 int cmp = PyUnicode_Compare(name_str, key);
10794 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
10795 if (cmp == 0)
goto arg_passed_twice;
10802 __Pyx_RaiseDoubleKeywordsError(function_name, key);
10807static int __Pyx_MatchKeywordArg_nostr(
10809 PyObject **
const argnames[],
10810 PyObject **
const *first_kw_arg,
10811 size_t *index_found,
10812 const char *function_name)
10814 PyObject **
const *name;
10815 if (unlikely(!PyUnicode_Check(key)))
goto invalid_keyword_type;
10816 name = first_kw_arg;
10818 int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
10820 *index_found = (size_t) (name - argnames);
10823 if (unlikely(cmp == -1))
goto bad;
10827 while (name != first_kw_arg) {
10828 int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
10829 if (unlikely(cmp != 0)) {
10830 if (cmp == 1)
goto arg_passed_twice;
10837 __Pyx_RaiseDoubleKeywordsError(function_name, key);
10839invalid_keyword_type:
10840 PyErr_Format(PyExc_TypeError,
10841 "%.200s() keywords must be strings", function_name);
10846static CYTHON_INLINE
int __Pyx_MatchKeywordArg(
10848 PyObject **
const argnames[],
10849 PyObject **
const *first_kw_arg,
10850 size_t *index_found,
10851 const char *function_name)
10853 return likely(PyUnicode_CheckExact(key)) ?
10854 __Pyx_MatchKeywordArg_str(key, argnames, first_kw_arg, index_found, function_name) :
10855 __Pyx_MatchKeywordArg_nostr(key, argnames, first_kw_arg, index_found, function_name);
10857static void __Pyx_RejectUnknownKeyword(
10859 PyObject **
const argnames[],
10860 PyObject **
const *first_kw_arg,
10861 const char *function_name)
10863 #if CYTHON_AVOID_BORROWED_REFS
10864 PyObject *pos = NULL;
10866 Py_ssize_t pos = 0;
10868 PyObject *key = NULL;
10869 __Pyx_BEGIN_CRITICAL_SECTION(kwds);
10870 #if CYTHON_AVOID_BORROWED_REFS
10871 while (__Pyx_PyDict_NextRef(kwds, &pos, &key, NULL))
10873 (void) __Pyx_PyDict_NextRef;
10874 while (PyDict_Next(kwds, &pos, &key, NULL))
10877 PyObject**
const *name = first_kw_arg;
10878 while (*name && (**name != key)) name++;
10880 size_t index_found = 0;
10881 int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
10884 PyErr_Format(PyExc_TypeError,
10885 "%s() got an unexpected keyword argument '%U'",
10886 function_name, key);
10888 #if CYTHON_AVOID_BORROWED_REFS
10894 #if CYTHON_AVOID_BORROWED_REFS
10898 __Pyx_END_CRITICAL_SECTION();
10899 #if CYTHON_AVOID_BORROWED_REFS
10902 assert(PyErr_Occurred());
10904static int __Pyx_ParseKeywordDict(
10906 PyObject **
const argnames[],
10907 PyObject *values[],
10908 Py_ssize_t num_pos_args,
10909 Py_ssize_t num_kwargs,
10910 const char* function_name,
10911 int ignore_unknown_kwargs)
10913 PyObject**
const *name;
10914 PyObject**
const *first_kw_arg = argnames + num_pos_args;
10915 Py_ssize_t extracted = 0;
10916#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
10917 if (unlikely(!PyArg_ValidateKeywordArguments(kwds)))
return -1;
10919 name = first_kw_arg;
10920 while (*name && num_kwargs > extracted) {
10921 PyObject * key = **name;
10924 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
10925 found = PyDict_GetItemRef(kwds, key, &value);
10927 value = PyDict_GetItemWithError(kwds, key);
10932 if (unlikely(PyErr_Occurred()))
goto bad;
10936 if (unlikely(found < 0))
goto bad;
10937 values[name-argnames] = value;
10942 if (num_kwargs > extracted) {
10943 if (ignore_unknown_kwargs) {
10944 if (unlikely(__Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name) == -1))
10947 __Pyx_RejectUnknownKeyword(kwds, argnames, first_kw_arg, function_name);
10955static int __Pyx_ParseKeywordDictToDict(
10957 PyObject **
const argnames[],
10959 PyObject *values[],
10960 Py_ssize_t num_pos_args,
10961 const char* function_name)
10963 PyObject**
const *name;
10964 PyObject**
const *first_kw_arg = argnames + num_pos_args;
10966#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
10967 if (unlikely(!PyArg_ValidateKeywordArguments(kwds)))
return -1;
10969 if (PyDict_Update(kwds2, kwds) < 0)
goto bad;
10970 name = first_kw_arg;
10972 PyObject *key = **name;
10974#if !CYTHON_COMPILING_IN_LIMITED_API && (PY_VERSION_HEX >= 0x030d00A2 || defined(PyDict_Pop))
10975 int found = PyDict_Pop(kwds2, key, &value);
10977 if (unlikely(found < 0))
goto bad;
10978 values[name-argnames] = value;
10980#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000
10981 int found = PyDict_GetItemRef(kwds2, key, &value);
10983 if (unlikely(found < 0))
goto bad;
10984 values[name-argnames] = value;
10985 if (unlikely(PyDict_DelItem(kwds2, key) < 0))
goto bad;
10988 #if CYTHON_COMPILING_IN_CPYTHON
10989 value = _PyDict_Pop(kwds2, key, kwds2);
10991 value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_pop, kwds2, key, kwds2);
10993 if (value == kwds2) {
10996 if (unlikely(!value))
goto bad;
10997 values[name-argnames] = value;
11002 len = PyDict_Size(kwds2);
11004 return __Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name);
11005 }
else if (unlikely(len == -1)) {
11012static int __Pyx_ParseKeywordsTuple(
11014 PyObject *
const *kwvalues,
11015 PyObject **
const argnames[],
11017 PyObject *values[],
11018 Py_ssize_t num_pos_args,
11019 Py_ssize_t num_kwargs,
11020 const char* function_name,
11021 int ignore_unknown_kwargs)
11023 PyObject *key = NULL;
11024 PyObject**
const * name;
11025 PyObject**
const *first_kw_arg = argnames + num_pos_args;
11026 for (Py_ssize_t pos = 0; pos < num_kwargs; pos++) {
11027#if CYTHON_AVOID_BORROWED_REFS
11028 key = __Pyx_PySequence_ITEM(kwds, pos);
11030 key = __Pyx_PyTuple_GET_ITEM(kwds, pos);
11032#if !CYTHON_ASSUME_SAFE_MACROS
11033 if (unlikely(!key))
goto bad;
11035 name = first_kw_arg;
11036 while (*name && (**name != key)) name++;
11038 PyObject *value = kwvalues[pos];
11039 values[name-argnames] = __Pyx_NewRef(value);
11041 size_t index_found = 0;
11042 int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
11044 PyObject *value = kwvalues[pos];
11045 values[index_found] = __Pyx_NewRef(value);
11047 if (unlikely(cmp == -1))
goto bad;
11049 PyObject *value = kwvalues[pos];
11050 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
11051 }
else if (!ignore_unknown_kwargs) {
11052 goto invalid_keyword;
11056 #if CYTHON_AVOID_BORROWED_REFS
11063 PyErr_Format(PyExc_TypeError,
11064 "%s() got an unexpected keyword argument '%U'",
11065 function_name, key);
11068 #if CYTHON_AVOID_BORROWED_REFS
11075static int __Pyx_ParseKeywords(
11077 PyObject *
const *kwvalues,
11078 PyObject **
const argnames[],
11080 PyObject *values[],
11081 Py_ssize_t num_pos_args,
11082 Py_ssize_t num_kwargs,
11083 const char* function_name,
11084 int ignore_unknown_kwargs)
11086 if (CYTHON_VECTORCALL && likely(PyTuple_Check(kwds)))
11087 return __Pyx_ParseKeywordsTuple(kwds, kwvalues, argnames, kwds2, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
11089 return __Pyx_ParseKeywordDictToDict(kwds, argnames, kwds2, values, num_pos_args, function_name);
11091 return __Pyx_ParseKeywordDict(kwds, argnames, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
11095static void __Pyx_RaiseArgtupleInvalid(
11096 const char* func_name,
11098 Py_ssize_t num_min,
11099 Py_ssize_t num_max,
11100 Py_ssize_t num_found)
11102 Py_ssize_t num_expected;
11103 const char *more_or_less;
11104 if (num_found < num_min) {
11105 num_expected = num_min;
11106 more_or_less =
"at least";
11108 num_expected = num_max;
11109 more_or_less =
"at most";
11112 more_or_less =
"exactly";
11114 PyErr_Format(PyExc_TypeError,
11115 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
11116 func_name, more_or_less, num_expected,
11117 (num_expected == 1) ?
"" :
"s", num_found);
11121#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
11122static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name,
int with_error) {
11124 PyTypeObject *tp = Py_TYPE(obj);
11125 res = _PyType_Lookup(tp, attr_name);
11127 descrgetfunc
f = Py_TYPE(res)->tp_descr_get;
11131 res =
f(res, obj, (PyObject *)tp);
11133 }
else if (with_error) {
11134 PyErr_SetObject(PyExc_AttributeError, attr_name);
11141#ifndef __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
11142#define __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
11143static CYTHON_INLINE
int __Pyx_PyObject_CompareStrStrBoolEq(PyObject* s1, PyObject* s2) {
11144 #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
11145 int result = PyUnicode_Equal(s1, s2);
11146 #if !CYTHON_COMPILING_IN_CPYTHON
11147 if (unlikely(result == -1))
return -1;
11149 if (result == 0)
goto __pyx_return_false;
else goto __pyx_return_true;
11151 int result = PyUnicode_Compare(s1, s2);
11152 if (unlikely((result == -1) && PyErr_Occurred()))
return -1;
11153 if (result == 0)
goto __pyx_return_true;
else goto __pyx_return_false;
11161static CYTHON_INLINE
int __Pyx_PyObject_CompareBoolEq_object_str(PyObject *op1, PyObject *op2,
int pyop) {
11162 CYTHON_UNUSED_VAR(pyop);
11163 if (unlikely(op2 == Py_None)) {
11164 if (op1 == Py_None)
goto __pyx_return_true;
else goto __pyx_richcmp;
11166 if (PyFloat_CheckExact(op1)) {
11167 goto __pyx_richcmp;
11169 if (PyLong_CheckExact(op1)) {
11170 if (op1 == op2)
goto __pyx_return_true;
11171 goto __pyx_richcmp;
11174 if (likely(PyUnicode_CheckExact(op1))) {
11175 if (op1 == op2)
goto __pyx_return_true;
11176 if (likely(op2 != Py_None)) {
11177 return __Pyx_PyObject_CompareStrStrBoolEq(op1, op2);
11179 goto __pyx_richcmp;
11182 if ((0))
goto __pyx_richcmp;
11183 if ((0))
goto __pyx_return_true;
11184 if ((0))
goto __pyx_return_false;
11186 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_EQ);
11194#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
11195static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
11196 PyObject *dict = Py_TYPE(obj)->tp_dict;
11197 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
11199static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
11200 PyObject **dictptr = NULL;
11201 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
11203#if CYTHON_COMPILING_IN_CPYTHON
11204 dictptr = (likely(offset > 0)) ? (PyObject **) ((
char *)obj + offset) : _PyObject_GetDictPtr(obj);
11206 dictptr = _PyObject_GetDictPtr(obj);
11209 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
11211static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
11212 PyObject *dict = Py_TYPE(obj)->tp_dict;
11213 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
11215 return obj_dict_version == __Pyx_get_object_dict_version(obj);
11220#if CYTHON_USE_DICT_VERSIONS
11221static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
11223static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
11227#if CYTHON_COMPILING_IN_LIMITED_API
11228 if (unlikely(!__pyx_m)) {
11229 if (!PyErr_Occurred())
11230 PyErr_SetNone(PyExc_NameError);
11233 result = PyObject_GetAttr(__pyx_m, name);
11234 if (likely(result)) {
11237 if (!__Pyx_IgnoreException(PyExc_Exception)) {
11240#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
11241 if (unlikely(__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, name, &result) == -1)) {
11242 if (!__Pyx_IgnoreException(PyExc_Exception)) {
11246 __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
11247 if (likely(result)) {
11251 result = _PyDict_GetItem_KnownHash(__pyx_mstate_global->__pyx_d, name, ((PyASCIIObject *) name)->hash);
11252 __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
11253 if (likely(result)) {
11254 return __Pyx_NewRef(result);
11256 PyObject *exc = PyErr_Occurred();
11257 if (unlikely(exc) && !__Pyx_IgnoreGivenException(exc, PyExc_Exception)) {
11261 return __Pyx_GetBuiltinName(name);
11265#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
11266static __Pyx_TypeName
11267__Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp)
11269 PyObject *module = NULL, *name = NULL, *result = NULL;
11270 #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
11271 name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
11272 __pyx_mstate_global->__pyx_n_u_qualname);
11274 name = PyType_GetQualName(tp);
11276 if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name)))
goto bad;
11277 module = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
11278 __pyx_mstate_global->__pyx_n_u_module);
11279 if (unlikely(module == NULL) || unlikely(!PyUnicode_Check(module)))
goto bad;
11280 if (PyUnicode_CompareWithASCIIString(module,
"builtins") == 0) {
11285 result = PyUnicode_FromFormat(
"%U.%U", module, name);
11286 if (unlikely(result == NULL))
goto bad;
11289 Py_XDECREF(module);
11297 result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u_);
11304static void __Pyx_RaiseErrorWithTypes1(PyObject* exc_type,
const char *message,
const char *arg, PyTypeObject *type_obj1, PyTypeObject *type_obj2) {
11305 __Pyx_TypeName type_name1 = __Pyx_PyType_GetFullyQualifiedName(type_obj1);
11306 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
11307 if (unlikely(!type_name1))
return;
11309 __Pyx_TypeName type_name2 = __Pyx_PyType_GetFullyQualifiedName(type_obj2);
11310 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
11311 if (unlikely(!type_name2))
goto type2_failed;
11313 PyErr_Format(exc_type, message, arg, type_name1, type_name2);
11314 __Pyx_DECREF_TypeName(type_name2);
11315#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
11318 __Pyx_DECREF_TypeName(type_name1);
11322#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL || CYTHON_COMPILING_IN_LIMITED_API)
11323#if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
11324#ifndef __Pyx_DEFINED_BinopTypeError
11325#define __Pyx_DEFINED_BinopTypeError
11326static void __Pyx_BinopTypeError(PyObject *op1, PyObject *op2,
const char* op,
int inplace) {
11327 char opname[4] = {op[0], op[1], 0, 0};
11329 opname[op[1] ? 2 : 1] =
'=';
11331 __Pyx_RaiseErrorWithObjectTypes1(
11333 "unsupported operand type(s) for %.3s: '" __Pyx_FMT_TYPENAME
"' and '" __Pyx_FMT_TYPENAME
"'",
11338#ifndef __Pyx_DEFINED_PyNumber_Multiply_xfloat_object
11339#define __Pyx_DEFINED_PyNumber_Multiply_xfloat_object
11340static PyObject* __Pyx_PyNumber_Multiply_xfloat_object(PyObject *op1, PyObject *op2,
int inplace) {
11341 if (PyLong_CheckExact(op2)) {
11343 #if CYTHON_USE_PYLONG_INTERNALS
11344 if (__Pyx_PyLong_IsCompact(op2)) {
11345 Py_ssize_t compact_op2 = __Pyx_PyLong_CompactValue(op2);
11346 int_op2 = (double) compact_op2;
11350 int_op2 = PyLong_AsDouble(op2);
11351 if (unlikely((int_op2 == -1.) && PyErr_Occurred()))
return NULL;
11353 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
11354 #if !CYTHON_ASSUME_SAFE_MACROS
11355 if (unlikely((float_op1 == -1.) && PyErr_Occurred()))
return NULL;
11357 if (float_op1 == 0.)
return __Pyx_NewRef(op1);
11358 return PyFloat_FromDouble(float_op1 * int_op2);
11360 if (PyLong_Check(op2)) {
11361 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(&PyFloat_Type, tp_as_number, nb_multiply, binaryfunc);
11362 if (likely(slot_func)) {
11363 return slot_func(op1, op2);
11366 #if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
11368 PyTypeObject *type_op2 = Py_TYPE(op2);
11369 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_number, nb_multiply, binaryfunc);
11370 if (likely(slot_func)) {
11371 PyObject *result = slot_func(op1, op2);
11372 if (likely(result != Py_NotImplemented)) {
11377 __Pyx_BinopTypeError(op1, op2,
"*", inplace);
11381 return (inplace) ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2);
11385#ifndef __Pyx_DEFINED_PyNumber_Multiply_xint_object
11386#define __Pyx_DEFINED_PyNumber_Multiply_xint_object
11387static PyObject* __Pyx_PyNumber_Multiply_xint_object(PyObject *op1, PyObject *op2,
int inplace) {
11388 if (PyFloat_CheckExact(op2)) {
11390 #if CYTHON_USE_PYLONG_INTERNALS
11391 if (__Pyx_PyLong_IsCompact(op1)) {
11392 Py_ssize_t compact_op1 = __Pyx_PyLong_CompactValue(op1);
11393 int_op1 = (double) compact_op1;
11397 int_op1 = PyLong_AsDouble(op1);
11398 if (unlikely((int_op1 == -1.) && PyErr_Occurred()))
return NULL;
11400 double float_op2 = __Pyx_PyFloat_AS_DOUBLE(op2);
11401 #if !CYTHON_ASSUME_SAFE_MACROS
11402 if (unlikely((float_op2 == -1.) && PyErr_Occurred()))
return NULL;
11404 return PyFloat_FromDouble(int_op1 * float_op2);
11406 #if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
11408 PyTypeObject *type_op2 = Py_TYPE(op2);
11409 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_number, nb_multiply, binaryfunc);
11410 if (likely(slot_func)) {
11411 PyObject *result = slot_func(op1, op2);
11412 if (likely(result != Py_NotImplemented)) {
11417 ssizeargfunc repeat_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_sequence, sq_repeat, ssizeargfunc);
11418 if (likely(repeat_func)) {
11420 #if CYTHON_USE_PYLONG_INTERNALS
11421 if (__Pyx_PyLong_IsCompact(op1)) {
11422 count = __Pyx_PyLong_CompactValue(op1);
11426 count = PyLong_AsSsize_t(op1);
11427 if (unlikely((count == -1) && PyErr_Occurred()))
return NULL;
11429 return repeat_func(op2, count);
11431 __Pyx_BinopTypeError(op1, op2,
"*", inplace);
11435 return (inplace) ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2);
11439static CYTHON_INLINE PyObject* __Pyx__PyNumber_Multiply_object_object(PyObject *op1, PyObject *op2,
int inplace) {
11440 if (PyFloat_CheckExact(op1)) {
11441 if (PyFloat_CheckExact(op2)) {
11442 double float_op2 = __Pyx_PyFloat_AS_DOUBLE(op2);
11443 #if !CYTHON_ASSUME_SAFE_MACROS
11444 if (unlikely((float_op2 == -1.) && PyErr_Occurred()))
return NULL;
11446 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
11447 #if !CYTHON_ASSUME_SAFE_MACROS
11448 if (unlikely((float_op1 == -1.) && PyErr_Occurred()))
return NULL;
11450 return PyFloat_FromDouble(float_op1 * float_op2);
11452 return __Pyx_PyNumber_Multiply_xfloat_object(op1, op2, inplace);
11454 if (PyLong_CheckExact(op1)) {
11455 if (PyLong_CheckExact(op2)) {
11456 #if CYTHON_USE_PYLONG_INTERNALS
11457 if (__Pyx_PyLong_IsCompact(op1)) {
11458 long long int_op1 = (
long long) __Pyx_PyLong_CompactValue(op1);
11459 if (int_op1 == 0)
return __Pyx_NewRef(op1);
11460 if (__Pyx_PyLong_IsCompact(op2)) {
11461 long long int_op2 = (
long long) __Pyx_PyLong_CompactValue(op2);
11462 if (int_op2 == 0)
return __Pyx_NewRef(op2);
11463 return PyLong_FromLongLong(int_op1 * int_op2);
11466 else if (__Pyx_PyLong_IsZero(op2))
return __Pyx_NewRef(op2);
11468 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(&PyLong_Type, tp_as_number, nb_multiply, binaryfunc);
11469 if (likely(slot_func)) {
11470 return slot_func(op1, op2);
11473 return __Pyx_PyNumber_Multiply_xint_object(op1, op2, inplace);
11475 return (inplace) ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2);
11480static void __Pyx_RaiseUnboundLocalError(
const char *varname) {
11481 PyErr_Format(PyExc_UnboundLocalError,
"local variable '%s' referenced before assignment", varname);
11485#if CYTHON_VECTORCALL
11486CYTHON_UNUSED
static int __Pyx_CheckVectorcallKwarg(PyObject *kwnames, Py_ssize_t i) {
11487 PyObject *key = __Pyx_PyTuple_GET_ITEM(kwnames, i);
11488#if !CYTHON_ASSUME_SAFE_MACROS
11489 if (unlikely(!key))
return -1;
11491 if (unlikely(!PyUnicode_Check(key))) {
11492 PyErr_SetString(PyExc_TypeError,
"keywords must be strings");
11498CYTHON_UNUSED
static PyObject *__Pyx_MakeKwargDict(PyObject **keys, PyObject **values, Py_ssize_t
n) {
11499 PyObject *out = PyDict_New();
11500 if (unlikely(!out))
return NULL;
11501 for (Py_ssize_t i=0; i<
n; ++i) {
11502 if (unlikely(PyDict_SetItem(out, keys[i], values[i]) < 0)) {
11509CYTHON_UNUSED
static int __Pyx_CheckVectorcallKwarg(PyObject **kwnames, Py_ssize_t i) {
11510 PyObject *key = kwnames[i];
11511 if (unlikely(!PyUnicode_Check(key))) {
11512 PyErr_SetString(PyExc_TypeError,
"keywords must be strings");
11520#if !CYTHON_VECTORCALL
11521static PyObject *__Pyx_Object_VectorcallMethodKwds(PyObject *name, PyObject *
const *args,
size_t nargsf, PyObject *kwnames) {
11523 PyObject *obj = PyObject_GetAttr(args[0], name);
11524 if (unlikely(!obj))
11526 result = __Pyx_Object_VectorcallKwds(obj, args+1, nargsf-1, kwnames);
11533static void __Pyx_RaiseErrorWithType1(PyObject* exc_type,
const char* message,
const char *arg, PyTypeObject *type_obj) {
11534 __Pyx_TypeName type_name = __Pyx_PyType_GetFullyQualifiedName(type_obj);
11535 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
11536 if (unlikely(!type_name))
return;
11538 PyErr_Format(exc_type, message, arg, type_name);
11539 __Pyx_DECREF_TypeName(type_name);
11543static int __Pyx_RaiseUnexpectedTypeError(
const char *expected, PyObject *obj) {
11544 __Pyx_RaiseTypeErrorWithObjectType1(
11545 "Expected %.42s, got " __Pyx_FMT_TYPENAME,
11551#if !CYTHON_VECTORCALL
11552static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *
const *args,
size_t nargsf) {
11554 switch (__Pyx_PyVectorcall_NARGS(nargsf)) {
11556 return PyObject_CallMethodObjArgs(args[0], name, NULL);
11558 return PyObject_CallMethodObjArgs(args[0], name, args[1], NULL);
11560 return PyObject_CallMethodObjArgs(args[0], name, args[1], args[2], NULL);
11562 return PyObject_CallMethodObjArgs(args[0], name, args[1], args[2], args[3], NULL);
11564 return PyObject_CallMethodObjArgs(args[0], name, args[1], args[2], args[3], args[4], NULL);
11566 PyObject *attr = PyObject_GetAttr(args[0], name);
11567 if (unlikely(!attr))
11569 result = __Pyx_PyObject_FastCall(attr, args+1, nargsf - 1);
11576#if CYTHON_COMPILING_IN_LIMITED_API
11577static CYTHON_INLINE PyObject* __Pyx__PyFrozenDict_New(PyObject* frozendict_type, PyObject* it) {
11578 return PyObject_CallFunctionObjArgs(frozendict_type, it, NULL);
11583#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
11584static int __Pyx_GetItemInt_wraparound(PyObject *o, PySequenceMethods *sm, Py_ssize_t *i) {
11586 if (likely(sm->sq_length)) {
11587 Py_ssize_t l = sm->sq_length(o);
11588 if (likely(l >= 0)) {
11591 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
11601static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
11603 if (unlikely(!j))
return NULL;
11604 r = PyObject_GetItem(o, j);
11608static PyObject *__Pyx_GetItemInt_Generic_size(PyObject *o, Py_ssize_t i) {
11609 return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i));
11611static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
11612 int wraparound,
int boundscheck,
int unsafe_shared) {
11613 CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
11614#if CYTHON_AVOID_BORROWED_REFS
11615 CYTHON_UNUSED_VAR(boundscheck);
11616 Py_ssize_t wrapped_i = i;
11617 if (wraparound & unlikely(i < 0)) {
11618 Py_ssize_t size = __Pyx_PyList_GET_SIZE(o);
11619 #if !CYTHON_ASSUME_SAFE_SIZE
11620 if (unlikely(size < 0))
return NULL;
11624 return __Pyx_PyList_GetItemRef(o, wrapped_i);
11625#elif CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
11626 Py_ssize_t wrapped_i = i;
11627 Py_ssize_t size = (wraparound | boundscheck) ? PyList_GET_SIZE(o) : -1;
11628 if (wraparound & unlikely(i < 0)) {
11631 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, size))) {
11632 return __Pyx_PyList_GET_ITEM_REF(o, wrapped_i, unsafe_shared);
11634 return __Pyx_GetItemInt_Generic_size(o, i);
11638 return PySequence_GetItem(o, i);
11641static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
11642 int wraparound,
int boundscheck,
int unsafe_shared) {
11643 CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
11644#if CYTHON_AVOID_BORROWED_REFS
11645 CYTHON_UNUSED_VAR(boundscheck);
11646 Py_ssize_t wrapped_i = i;
11647 if (wraparound & unlikely(i < 0)) {
11648 Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(o);
11649 #if !CYTHON_ASSUME_SAFE_SIZE
11650 if (unlikely(size < 0))
return NULL;
11654 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_COMPILING_IN_LIMITED_API
11655 return PySequence_ITEM(o, wrapped_i);
11657 if (unlikely(wrapped_i < 0)) {
11658 PyErr_SetString(PyExc_IndexError,
"tuple index out of range");
11661 return PySequence_GetItem(o, wrapped_i);
11663#elif CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
11664 Py_ssize_t wrapped_i = i;
11665 Py_ssize_t size = (wraparound | boundscheck) ? PyTuple_GET_SIZE(o) : -1;
11666 if (wraparound & unlikely(i < 0)) {
11669 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, size))) {
11670 return __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(o, wrapped_i));
11672 return __Pyx_GetItemInt_Generic_size(o, i);
11676 return PySequence_GetItem(o, i);
11679#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
11680static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast_mapping(PyObject *o, binaryfunc getitem, Py_ssize_t i) {
11681 PyObject *
r, *key = PyLong_FromSsize_t(i);
11682 if (unlikely(!key))
return NULL;
11683 r = getitem(o, key);
11688static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
11689 int wraparound,
int boundscheck,
int unsafe_shared) {
11690 CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
11691#if CYTHON_ASSUME_SAFE_SIZE
11692 if (PyList_CheckExact(o)) {
11693 return __Pyx_GetItemInt_List_Fast(o, i, wraparound, boundscheck, unsafe_shared);
11695 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11696 if (PyTuple_CheckExact(o)) {
11697 return __Pyx_GetItemInt_Tuple_Fast(o, i, wraparound, boundscheck, unsafe_shared);
11701 if ((!wraparound || i >= 0) & PyList_CheckExact(o)) {
11702 return boundscheck ? __Pyx_PyList_GetItemRef(o, i) : __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared);
11705#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
11706 if (PyDict_CheckExact(o)) {
11707 return __Pyx_GetItemInt_Fast_mapping(o, PyDict_Type.tp_as_mapping->mp_subscript, i);
11708 #if defined(PyFrozenDict_CheckExact)
11709 }
else if (PyFrozenDict_CheckExact(o)) {
11710 return __Pyx_GetItemInt_Fast_mapping(o, PyFrozenDict_Type.tp_as_mapping->mp_subscript, i);
11714 PyTypeObject *obj_type = Py_TYPE(o);
11715 int seq_or_mapping = __Pyx_PyType_GetFlags(obj_type) & (Py_TPFLAGS_SEQUENCE|Py_TPFLAGS_MAPPING);
11716 if (seq_or_mapping != Py_TPFLAGS_SEQUENCE) {
11717 PyMappingMethods *mm = obj_type->tp_as_mapping;
11718 if (mm && mm->mp_subscript)
11719 return __Pyx_GetItemInt_Fast_mapping(o, mm->mp_subscript, i);
11721 PySequenceMethods *sm = obj_type->tp_as_sequence;
11722 if (likely(sm && sm->sq_item)) {
11723 if (wraparound && (i < 0) && unlikely(__Pyx_GetItemInt_wraparound(o, sm, &i) == -1))
11725 return sm->sq_item(o, i);
11727 if (seq_or_mapping == Py_TPFLAGS_SEQUENCE) {
11728 PyMappingMethods *mm = obj_type->tp_as_mapping;
11729 if (likely(mm && mm->mp_subscript))
11730 return __Pyx_GetItemInt_Fast_mapping(o, mm->mp_subscript, i);
11734 if (!PyMapping_Check(o)) {
11735 return PySequence_GetItem(o, i);
11740 return __Pyx_GetItemInt_Generic_size(o, i);
11744static void __Pyx_RaiseErrorWithType(PyObject* exc_type,
const char* message, PyTypeObject *type_obj) {
11745 __Pyx_TypeName type_name = __Pyx_PyType_GetFullyQualifiedName(type_obj);
11746 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
11747 if (unlikely(!type_name))
return;
11749 PyErr_Format(exc_type, message, type_name);
11750 __Pyx_DECREF_TypeName(type_name);
11754#if CYTHON_USE_TYPE_SLOTS
11755static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) {
11756 PyObject *runerr = NULL;
11757 Py_ssize_t key_value;
11758 key_value = __Pyx_PyIndex_AsSsize_t(index);
11759 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
11760 return __Pyx_GetItemInt_Fast(obj, key_value, 1, 1, 1);
11762 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
11764 __Pyx_RaiseErrorWithObjectType(
11766 "cannot fit '" __Pyx_FMT_TYPENAME
"' into an index-sized integer",
11771static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) {
11772 if (likely(PyType_Check(obj))) {
11773 if ((PyTypeObject*)obj == &PyType_Type) {
11774 return Py_GenericAlias(obj, key);
11776 PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_mstate_global->__pyx_n_u_class_getitem);
11778 if (PyErr_Occurred()) {
11782 PyObject *result = __Pyx_PyObject_CallOneArg(meth, key);
11787 __Pyx_RaiseTypeErrorWithObjectType(
11788 "'" __Pyx_FMT_TYPENAME
"' object is not subscriptable", obj);
11791static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) {
11792 PyTypeObject *tp = Py_TYPE(obj);
11793 PyMappingMethods *mm = tp->tp_as_mapping;
11794 PySequenceMethods *sm = tp->tp_as_sequence;
11795 if (likely(mm && mm->mp_subscript)) {
11796 return mm->mp_subscript(obj, key);
11798 if (likely(sm && sm->sq_item)) {
11799 return __Pyx_PyObject_GetIndex(obj, key);
11801 return __Pyx_PyObject_GetItem_Slow(obj, key);
11806static double __Pyx_SlowPyString_AsDouble(PyObject *obj) {
11807 PyObject *float_value = PyFloat_FromString(obj);
11808 if (likely(float_value)) {
11809 double value = __Pyx_PyFloat_AS_DOUBLE(float_value);
11810 Py_DECREF(float_value);
11815static const char* __Pyx__PyBytes_AsDouble_Copy(
const char* start,
char* buffer, Py_ssize_t length) {
11816 int last_was_punctuation = 1;
11817 int parse_error_found = 0;
11819 for (i=0; i < length; i++) {
11820 char chr = start[i];
11821 int is_punctuation = (chr ==
'_') | (chr ==
'.') | (chr ==
'e') | (chr ==
'E');
11823 buffer += (chr !=
'_');
11824 parse_error_found |= last_was_punctuation & is_punctuation;
11825 last_was_punctuation = is_punctuation;
11827 parse_error_found |= last_was_punctuation;
11829 return unlikely(parse_error_found) ? NULL : buffer;
11831static double __Pyx__PyBytes_AsDouble_inf_nan(
const char* start, Py_ssize_t length) {
11833 char sign = start[0];
11834 int is_signed = (
sign ==
'+') | (
sign ==
'-');
11835 start += is_signed;
11836 length -= is_signed;
11837 switch (start[0]) {
11841 if (unlikely(length != 3))
goto parse_failure;
11842 matches &= (start[1] ==
'a' || start[1] ==
'A');
11843 matches &= (start[2] ==
'n' || start[2] ==
'N');
11844 if (unlikely(!matches))
goto parse_failure;
11845 return (
sign ==
'-') ? -Py_NAN : Py_NAN;
11849 if (unlikely(length < 3))
goto parse_failure;
11850 matches &= (start[1] ==
'n' || start[1] ==
'N');
11851 matches &= (start[2] ==
'f' || start[2] ==
'F');
11852 if (likely(length == 3 && matches))
11853 return (
sign ==
'-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
11854 if (unlikely(length != 8))
goto parse_failure;
11855 matches &= (start[3] ==
'i' || start[3] ==
'I');
11856 matches &= (start[4] ==
'n' || start[4] ==
'N');
11857 matches &= (start[5] ==
'i' || start[5] ==
'I');
11858 matches &= (start[6] ==
't' || start[6] ==
'T');
11859 matches &= (start[7] ==
'y' || start[7] ==
'Y');
11860 if (unlikely(!matches))
goto parse_failure;
11861 return (
sign ==
'-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
11862 case '.':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
11865 goto parse_failure;
11871static CYTHON_INLINE
int __Pyx__PyBytes_AsDouble_IsSpace(
char ch) {
11872 return (ch == 0x20) | !((ch < 0x9) | (ch > 0xd));
11874CYTHON_UNUSED
static double __Pyx__PyBytes_AsDouble(PyObject *obj,
const char* start, Py_ssize_t length) {
11876 Py_ssize_t i, digits;
11877 const char *last = start + length;
11880 while (__Pyx__PyBytes_AsDouble_IsSpace(*start))
11882 while (start < last - 1 && __Pyx__PyBytes_AsDouble_IsSpace(last[-1]))
11884 length = last - start;
11885 if (unlikely(length <= 0))
goto fallback;
11886 value = __Pyx__PyBytes_AsDouble_inf_nan(start, length);
11887 if (value != 0.0) {
11888 if (unlikely(value == -1.0))
goto fallback;
11892 for (i=0; i < length; digits += start[i++] !=
'_');
11893 if (likely(digits == length)) {
11894 value = PyOS_string_to_double(start, &end, NULL);
11895 valid_parse = (end == last);
11896 }
else if (digits < 40) {
11898 last = __Pyx__PyBytes_AsDouble_Copy(start,
number, length);
11899 if (unlikely(!last))
goto fallback;
11900 value = PyOS_string_to_double(
number, &end, NULL);
11901 valid_parse = (end == last);
11903 char *
number = (
char*) PyMem_Malloc(((
size_t) digits + 1) *
sizeof(
char));
11904 if (unlikely(!
number))
goto fallback;
11905 last = __Pyx__PyBytes_AsDouble_Copy(start,
number, length);
11906 if (unlikely(!last)) {
11910 value = PyOS_string_to_double(
number, &end, NULL);
11911 valid_parse = (end == last);
11914 if (likely(valid_parse) || (value == (
double)-1 && PyErr_Occurred())) {
11918 return __Pyx_SlowPyString_AsDouble(obj);
11922static CYTHON_INLINE PyObject* __Pyx__PyNumber_Float(PyObject* obj) {
11924 if (PyLong_CheckExact(obj)) {
11925#if CYTHON_USE_PYLONG_INTERNALS
11926 if (likely(__Pyx_PyLong_IsCompact(obj))) {
11927 val = (double) __Pyx_PyLong_CompactValue(obj);
11931 val = PyLong_AsDouble(obj);
11932 }
else if (PyUnicode_CheckExact(obj)) {
11933 val = __Pyx_PyUnicode_AsDouble(obj);
11934 }
else if (PyBytes_CheckExact(obj)) {
11935 val = __Pyx_PyBytes_AsDouble(obj);
11936 }
else if (PyByteArray_CheckExact(obj)) {
11937 val = __Pyx_PyByteArray_AsDouble(obj);
11939 return PyNumber_Float(obj);
11941 if (unlikely(val == -1 && PyErr_Occurred())) {
11944#if CYTHON_USE_PYLONG_INTERNALS
11947 return PyFloat_FromDouble(val);
11951static void __Pyx_PyBuiltin_Invalid(PyObject *obj,
const char *builtin_type_name,
const char *argname) {
11952 __Pyx_TypeName obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
11953 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
11954 if (unlikely(!obj_type_name))
return;
11957 PyErr_Format(PyExc_TypeError,
11958 "Argument '%.200s' has incorrect type (expected %.5s, got " __Pyx_FMT_TYPENAME
")",
11959 argname, builtin_type_name, obj_type_name
11962 PyErr_Format(PyExc_TypeError,
11963 "Expected %.5s, got " __Pyx_FMT_TYPENAME,
11964 builtin_type_name, obj_type_name
11967 __Pyx_DECREF_TypeName(obj_type_name);
11971static int __Pyx__PyFloat_FromNumber(PyObject **number_var,
const char *argname);
11972static CYTHON_INLINE
int __Pyx_PyFloat_FromNumber(PyObject **number_var,
const char *argname,
int accept_none) {
11973 PyObject *
number = *number_var;
11974 if (likely((accept_none &&
number == Py_None) || PyFloat_CheckExact(
number))) {
11977 return __Pyx__PyFloat_FromNumber(number_var, argname);
11979static int __Pyx__PyFloat_FromNumber(PyObject **number_var,
const char *argname) {
11980 PyObject *
number = *number_var;
11981 PyObject *float_object;
11982 if (likely(PyLong_CheckExact(
number))) {
11984#if CYTHON_USE_PYLONG_INTERNALS
11985 if (likely(__Pyx_PyLong_IsCompact(
number))) {
11986 val = (double) __Pyx_PyLong_CompactValue(
number);
11990 val = PyLong_AsDouble(
number);
11991 if (unlikely(val == -1.0 && PyErr_Occurred()))
goto bad;
11993 float_object = PyFloat_FromDouble(val);
11995 else if (PyNumber_Check(
number)) {
11996 float_object = PyNumber_Float(
number);
11998 __Pyx_PyBuiltin_Invalid(
number,
"float", argname);
12001 if (unlikely(!float_object))
goto bad;
12002 *number_var = float_object;
12006 *number_var = NULL;
12012#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL)
12013static CYTHON_INLINE
int __Pyx__PyUnicode_EqualsUCS4(PyObject* s1, Py_UCS4 ch2,
int equals) {
12017 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0))
goto bad;
12018 length = __Pyx_PyUnicode_GET_LENGTH(s1);
12019 #if !CYTHON_ASSUME_SAFE_SIZE
12020 if (unlikely(length < 0))
goto bad;
12022 if (length != 1)
goto return_ne;
12023 kind = PyUnicode_KIND(s1);
12025 if (likely(kind == PyUnicode_1BYTE_KIND)) {
12026 ch1 = PyUnicode_1BYTE_DATA(s1)[0];
12027 }
else if (kind == PyUnicode_2BYTE_KIND) {
12028 ch1 = PyUnicode_2BYTE_DATA(s1)[0];
12030 ch1 = PyUnicode_4BYTE_DATA(s1)[0];
12032 }
else if (ch2 < 65536) {
12033 if (kind == PyUnicode_2BYTE_KIND) {
12034 ch1 = PyUnicode_2BYTE_DATA(s1)[0];
12035 }
else if (kind == PyUnicode_4BYTE_KIND) {
12036 ch1 = PyUnicode_4BYTE_DATA(s1)[0];
12041 if (kind == PyUnicode_4BYTE_KIND){
12042 ch1 = PyUnicode_4BYTE_DATA(s1)[0];
12053 return (equals == Py_EQ);
12055 return (equals == Py_NE);
12062#ifndef __PYX_HAVE_RT_ImportType_3_3_0
12063#define __PYX_HAVE_RT_ImportType_3_3_0
12064static PyTypeObject *__Pyx_ImportType_3_3_0(PyObject *module,
const char *module_name,
const char *class_name,
12065 size_t size,
size_t alignment,
enum __Pyx_ImportType_CheckSize_3_3_0 check_size)
12067 PyObject *result = 0;
12068 Py_ssize_t basicsize;
12069 Py_ssize_t itemsize;
12070#if defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && CYTHON_COMPILING_IN_LIMITED_API)
12071 PyObject *py_basicsize;
12072 PyObject *py_itemsize;
12074 result = PyObject_GetAttrString(module, class_name);
12077 if (!PyType_Check(result)) {
12078 PyErr_Format(PyExc_TypeError,
12079 "%.200s.%.200s is not a type object",
12080 module_name, class_name);
12083#if !( defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && CYTHON_COMPILING_IN_LIMITED_API) )
12084 basicsize = ((PyTypeObject *)result)->tp_basicsize;
12085 itemsize = ((PyTypeObject *)result)->tp_itemsize;
12088 return (PyTypeObject *)result;
12090 py_basicsize = PyObject_GetAttrString(result,
"__basicsize__");
12093 basicsize = PyLong_AsSsize_t(py_basicsize);
12094 Py_DECREF(py_basicsize);
12096 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
12098 py_itemsize = PyObject_GetAttrString(result,
"__itemsize__");
12101 itemsize = PyLong_AsSsize_t(py_itemsize);
12102 Py_DECREF(py_itemsize);
12104 if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
12108 if (size % alignment) {
12109 alignment = size % alignment;
12111 if (itemsize < (Py_ssize_t)alignment)
12112 itemsize = (Py_ssize_t)alignment;
12114 if ((
size_t)(basicsize + itemsize) < size) {
12115 PyErr_Format(PyExc_ValueError,
12116 "%.200s.%.200s size changed, may indicate binary incompatibility. "
12117 "Expected %zd from C header, got %zd from PyObject",
12118 module_name, class_name, size, basicsize+itemsize);
12121 if (check_size == __Pyx_ImportType_CheckSize_Error_3_3_0 &&
12122 ((
size_t)basicsize > size || (
size_t)(basicsize + itemsize) < size)) {
12123 PyErr_Format(PyExc_ValueError,
12124 "%.200s.%.200s size changed, may indicate binary incompatibility. "
12125 "Expected %zd from C header, got %zd-%zd from PyObject",
12126 module_name, class_name, size, basicsize, basicsize+itemsize);
12129 else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_3_0 && (
size_t)basicsize > size) {
12130 if (PyErr_WarnFormat(NULL, 0,
12131 "%.200s.%.200s size changed, may indicate binary incompatibility. "
12132 "Expected %zd from C header, got %zd from PyObject",
12133 module_name, class_name, size, basicsize) < 0) {
12137 return (PyTypeObject *)result;
12139 Py_XDECREF(result);
12145#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
12146static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *o, PyObject *
n) {
12148 if (unlikely(!PyUnicode_Check(
n))) {
12149 PyErr_SetString(PyExc_TypeError,
12150 "hasattr(): attribute name must be string");
12153 r = __Pyx_PyObject_GetAttrStrNoError(o,
n);
12155 return (unlikely(PyErr_Occurred())) ? -1 : 0;
12164CYTHON_UNUSED
static PyObject *
12165__Pyx_PyList_FromArray(PyObject *
const *src, Py_ssize_t
n) {
12166 PyObject *res = PyList_New(
n);
12167 if (unlikely(res == NULL))
return NULL;
12168 #if CYTHON_COMPILING_IN_CPYTHON
12169 __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item,
n);
12172 for (i = 0; i <
n; i++) {
12174 if (unlikely(__Pyx_PyList_SET_ITEM(res, i, src[i]) < (0))) {
12184static int __Pyx__Import_GetModule(PyObject *qualname, PyObject **module) {
12185 PyObject *imported_module = PyImport_GetModule(qualname);
12186 if (unlikely(!imported_module)) {
12188 if (PyErr_Occurred()) {
12193 *
module = imported_module;
12196static int __Pyx__Import_Lookup(PyObject *qualname, PyObject *
const *imported_names, Py_ssize_t len_imported_names, PyObject **module) {
12197 PyObject *imported_module;
12198 PyObject *top_level_package_name;
12200 int status, module_found;
12201 Py_ssize_t dot_index;
12202 module_found = __Pyx__Import_GetModule(qualname, &imported_module);
12203 if (unlikely(!module_found || module_found == -1)) {
12205 return module_found;
12207 if (imported_names) {
12208 for (i = 0; i < len_imported_names; i++) {
12209 PyObject *imported_name = imported_names[i];
12210#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
12211 int has_imported_attribute = PyObject_HasAttr(imported_module, imported_name);
12213 int has_imported_attribute = PyObject_HasAttrWithError(imported_module, imported_name);
12214 if (unlikely(has_imported_attribute == -1))
goto error;
12216 if (!has_imported_attribute) {
12220 *
module = imported_module;
12223 dot_index = PyUnicode_FindChar(qualname,
'.', 0, PY_SSIZE_T_MAX, 1);
12224 if (dot_index == -1) {
12225 *
module = imported_module;
12228 if (unlikely(dot_index == -2))
goto error;
12229 top_level_package_name = PyUnicode_Substring(qualname, 0, dot_index);
12230 if (unlikely(!top_level_package_name))
goto error;
12231 Py_DECREF(imported_module);
12232 status = __Pyx__Import_GetModule(top_level_package_name, module);
12233 Py_DECREF(top_level_package_name);
12236 Py_DECREF(imported_module);
12240 Py_DECREF(imported_module);
12244static PyObject *__Pyx__Import(PyObject *name, PyObject *
const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict,
int level) {
12245 PyObject *module = 0;
12246 PyObject *empty_dict = 0;
12247 PyObject *from_list = 0;
12252 module_found = __Pyx__Import_Lookup(qualname, imported_names, len_imported_names, &module);
12253 if (likely(module_found == 1)) {
12255 }
else if (unlikely(module_found == -1)) {
12258 #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030f00a6
12259 empty_dict = PyFrozenDict_New(NULL);
12261 empty_dict = PyDict_New();
12263 if (unlikely(!empty_dict))
12265 if (imported_names) {
12266 from_list = __Pyx_PyList_FromArray(imported_names, len_imported_names);
12267 if (unlikely(!from_list))
12271 const char* package_sep = strchr(__Pyx_MODULE_NAME,
'.');
12272 if (package_sep != (0)) {
12273 module = PyImport_ImportModuleLevelObject(
12274 name, moddict, empty_dict, from_list, 1);
12275 if (unlikely(!module)) {
12276 if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError)))
12284 module = PyImport_ImportModuleLevelObject(
12285 name, moddict, empty_dict, from_list, level);
12288 Py_XDECREF(from_list);
12289 Py_XDECREF(empty_dict);
12294static PyObject *__Pyx_Import(PyObject *name, PyObject *
const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname,
int level) {
12295 return __Pyx__Import(name, imported_names, len_imported_names, qualname, __pyx_mstate_global->__pyx_d, level);
12299static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
12300 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
12301 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
12302 const char* module_name_str = 0;
12303 PyObject* module_name = 0;
12304 PyObject* module_dot = 0;
12305 PyObject* full_name = 0;
12307 module_name_str = PyModule_GetName(module);
12308 if (unlikely(!module_name_str)) {
goto modbad; }
12309 module_name = PyUnicode_FromString(module_name_str);
12310 if (unlikely(!module_name)) {
goto modbad; }
12311 module_dot = PyUnicode_Concat(module_name, __pyx_mstate_global->__pyx_kp_u__3);
12312 if (unlikely(!module_dot)) {
goto modbad; }
12313 full_name = PyUnicode_Concat(module_dot, name);
12314 if (unlikely(!full_name)) {
goto modbad; }
12315 #if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) ||\
12316 CYTHON_COMPILING_IN_GRAAL
12318 PyObject *modules = PyImport_GetModuleDict();
12319 if (unlikely(!modules))
12321 value = PyObject_GetItem(modules, full_name);
12324 value = PyImport_GetModule(full_name);
12327 Py_XDECREF(full_name);
12328 Py_XDECREF(module_dot);
12329 Py_XDECREF(module_name);
12331 if (unlikely(!value)) {
12332 PyErr_Format(PyExc_ImportError,
"cannot import name %S", name);
12338static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value) {
12340#if __PYX_LIMITED_VERSION_HEX >= 0x030F0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4)
12341 PyDict_SetDefaultRef(d, key, default_value, &value);
12342#elif CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030C0000
12343 PyObject *args[] = {d, key, default_value};
12344 value = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_n_u_setdefault, args, 3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
12345#elif CYTHON_COMPILING_IN_LIMITED_API
12346 value = PyObject_CallMethodObjArgs(d, __pyx_mstate_global->__pyx_n_u_setdefault, key, default_value, NULL);
12348 value = PyDict_SetDefault(d, key, default_value);
12349 if (unlikely(!value))
return NULL;
12356#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX < 0x030F00a3
12357 static PyObject *__Pyx_PyImport_AddModuleObjectRef(PyObject *name) {
12358 PyObject *module_dict = PyImport_GetModuleDict();
12360 if (PyMapping_GetOptionalItem(module_dict, name, &m) < 0) {
12363 if (m != NULL && PyModule_Check(m)) {
12367 m = PyModule_NewObject(name);
12370 if (PyDict_CheckExact(module_dict)) {
12372 (void)PyDict_SetDefaultRef(module_dict, name, m, &new_m);
12376 if (PyObject_SetItem(module_dict, name, m) != 0) {
12383 static PyObject *__Pyx_PyImport_AddModuleRef(
const char *name) {
12384 if ((PY_VERSION_HEX >= 0x030E0000) && Py_Version >= 0x030E0100) {
12385 return PyImport_AddModuleRef(name);
12387 PyObject *py_name = PyUnicode_FromString(name);
12388 if (!py_name)
return NULL;
12389 PyObject *module = __Pyx_PyImport_AddModuleObjectRef(py_name);
12390 Py_DECREF(py_name);
12393#elif __PYX_LIMITED_VERSION_HEX < 0x030d0000
12394 static PyObject *__Pyx_PyImport_AddModuleRef(
const char *name) {
12395 PyObject *module = PyImport_AddModule(name);
12396 Py_XINCREF(module);
12402static PyObject *__Pyx_FetchSharedCythonABIModule(
void) {
12403 return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME);
12407static int __Pyx_VerifyCachedType(PyObject *cached_type,
12409 Py_ssize_t expected_basicsize) {
12410 Py_ssize_t basicsize;
12411 if (!PyType_Check(cached_type)) {
12412 PyErr_Format(PyExc_TypeError,
12413 "Shared Cython type %.200s is not a type object", name);
12416 if (expected_basicsize == 0) {
12419#if CYTHON_COMPILING_IN_LIMITED_API && CYTHON_OPAQUE_OBJECTS
12420 if (expected_basicsize < 0) {
12421 basicsize = PyType_GetTypeDataSize((PyTypeObject*)cached_type);
12425 #if CYTHON_COMPILING_IN_LIMITED_API
12426 PyObject *py_basicsize;
12427 py_basicsize = PyObject_GetAttrString(cached_type,
"__basicsize__");
12428 if (unlikely(!py_basicsize))
return -1;
12429 basicsize = PyLong_AsSsize_t(py_basicsize);
12430 Py_DECREF(py_basicsize);
12431 py_basicsize = NULL;
12432 if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred())
return -1;
12434 basicsize = ((PyTypeObject*) cached_type)->tp_basicsize;
12437 if ((expected_basicsize >= 0) ?
12438 (basicsize != expected_basicsize) :
12439 (basicsize < -expected_basicsize)) {
12440 PyErr_Format(PyExc_TypeError,
12441 "Shared Cython type %.200s has the wrong size, try recompiling",
12449#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
12450static PyObject* __Pyx_PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
12451 PyObject *result = __Pyx_PyType_FromModuleAndSpec(module, spec, bases);
12452 if (result && metaclass) {
12453 PyObject *old_tp = (PyObject*)Py_TYPE(result);
12454 Py_INCREF((PyObject*)metaclass);
12455 Py_SET_TYPE(result, metaclass);
12457 PyType_Modified((PyTypeObject*)result);
12462#define __Pyx_PyType_FromMetaclass(me, mo, s, b) PyType_FromMetaclass(me, mo, s, b)
12464static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
12465 PyObject *abi_module = NULL, *cached_type = NULL, *abi_module_dict, *new_cached_type, *py_object_name;
12466 int get_item_ref_result;
12467 const char* object_name = strrchr(spec->name,
'.');
12468 object_name = object_name ? object_name+1 : spec->name;
12469 py_object_name = PyUnicode_FromString(object_name);
12470 if (!py_object_name)
return NULL;
12471 abi_module = __Pyx_FetchSharedCythonABIModule();
12472 if (!abi_module)
goto done;
12473 abi_module_dict = PyModule_GetDict(abi_module);
12474 if (!abi_module_dict)
goto done;
12475 get_item_ref_result = __Pyx_PyDict_GetItemRef(abi_module_dict, py_object_name, &cached_type);
12476 if (get_item_ref_result == 1) {
12477 if (__Pyx_VerifyCachedType(
12480 spec->basicsize) < 0) {
12484 }
else if (unlikely(get_item_ref_result == -1)) {
12487 cached_type = __Pyx_PyType_FromMetaclass(
12489 CYTHON_USE_MODULE_STATE ? module : abi_module,
12491 if (unlikely(!cached_type))
goto bad;
12492 new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type);
12493 if (unlikely(new_cached_type != cached_type)) {
12494 if (unlikely(!new_cached_type))
goto bad;
12495 Py_DECREF(cached_type);
12496 cached_type = new_cached_type;
12497 if (__Pyx_VerifyCachedType(
12500 spec->basicsize) < 0) {
12505 Py_DECREF(new_cached_type);
12508 Py_XDECREF(abi_module);
12509 Py_DECREF(py_object_name);
12510 assert(cached_type == NULL || PyType_Check(cached_type));
12511 return (PyTypeObject *) cached_type;
12513 Py_XDECREF(cached_type);
12514 cached_type = NULL;
12519static PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED
void* context) {
12520 return PyUnicode_FromString(__PYX_ABI_MODULE_NAME);
12522#if __PYX_LIMITED_VERSION_HEX < 0x030A0000
12523static PyObject* __pyx_CommonTypesMetaclass_call(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *args, CYTHON_UNUSED PyObject *kwds) {
12524 PyErr_SetString(PyExc_TypeError,
"Cannot instantiate Cython internal types");
12527static int __pyx_CommonTypesMetaclass_setattr(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *attr, CYTHON_UNUSED PyObject *value) {
12528 PyErr_SetString(PyExc_TypeError,
"Cython internal types are immutable");
12532static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = {
12533 {
"__module__", __pyx_CommonTypesMetaclass_get_module, NULL, NULL, NULL},
12536static PyType_Slot __pyx_CommonTypesMetaclass_slots[] = {
12537 {Py_tp_getset, (
void *)__pyx_CommonTypesMetaclass_getset},
12538 #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
12539 {Py_tp_call, (
void*)__pyx_CommonTypesMetaclass_call},
12540 {Py_tp_new, (
void*)__pyx_CommonTypesMetaclass_call},
12541 {Py_tp_setattro, (
void*)__pyx_CommonTypesMetaclass_setattr},
12545static PyType_Spec __pyx_CommonTypesMetaclass_spec = {
12546 __PYX_TYPE_MODULE_PREFIX
"_common_types_metatype",
12549 Py_TPFLAGS_IMMUTABLETYPE |
12550 Py_TPFLAGS_DISALLOW_INSTANTIATION |
12551 Py_TPFLAGS_DEFAULT,
12552 __pyx_CommonTypesMetaclass_slots
12554static int __pyx_CommonTypesMetaclass_init(PyObject *module) {
12555 __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
12556 PyObject *bases = PyTuple_Pack(1, &PyType_Type);
12557 if (unlikely(!bases)) {
12560 mstate->__pyx_CommonTypesMetaclassType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CommonTypesMetaclass_spec, bases);
12562 if (unlikely(mstate->__pyx_CommonTypesMetaclassType == NULL)) {
12569#if CYTHON_COMPILING_IN_LIMITED_API
12570static CYTHON_INLINE
int __Pyx__IsSameCyOrCFunctionNoMethod(PyObject *func,
void (*cfunc)(
void)) {
12571 if (__Pyx_CyFunction_Check(func)) {
12572 return __Pyx_as_CyFunctionObject(func)->func_methoddef->ml_meth == (PyCFunction) cfunc;
12573 }
else if (PyCFunction_Check(func)) {
12574 return PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
12578static CYTHON_INLINE
int __Pyx__IsSameCyOrCFunction(PyObject *func,
void (*cfunc)(
void)) {
12579 if ((PyObject*)Py_TYPE(func) == __pyx_mstate_global->__Pyx_CachedMethodType) {
12581 PyObject *newFunc = PyObject_GetAttr(func, __pyx_mstate_global->__pyx_n_u_func);
12582 if (unlikely(!newFunc)) {
12586 result = __Pyx__IsSameCyOrCFunctionNoMethod(newFunc, cfunc);
12587 Py_DECREF(newFunc);
12590 return __Pyx__IsSameCyOrCFunctionNoMethod(func, cfunc);
12593static CYTHON_INLINE
int __Pyx__IsSameCyOrCFunction(PyObject *func,
void (*cfunc)(
void)) {
12594 if (PyMethod_Check(func)) {
12595 func = PyMethod_GET_FUNCTION(func);
12597 return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
12600static CYTHON_INLINE
void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject*
f, PyObject* classobj) {
12601#if CYTHON_COMPILING_IN_LIMITED_API
12602 __Pyx_Py_XDECREF_SET(
12603 __Pyx__CyFunction_GetClassObj(
f),
12604 ((classobj) ? __Pyx_NewRef(classobj) : NULL));
12606 __Pyx_Py_XDECREF_SET(
12607 ((PyCMethodObject *) (
f))->mm_class,
12608 (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL));
12611static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, PyTypeObject *defaults_type) {
12612 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
12613 m->defaults = PyObject_CallObject((PyObject*)defaults_type, NULL);
12614 if (unlikely(!m->defaults))
12616 return m->defaults;
12618static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
12619 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
12620 m->defaults_tuple = tuple;
12623static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
12624 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
12625 m->defaults_kwdict = dict;
12628static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
12629 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
12630 m->func_annotations = dict;
12635#if !CYTHON_USE_TYPE_SPECS
12637static int __Pyx_call_type_traverse(PyObject *o,
int always_call, visitproc visit,
void *arg) {
12638 if (!always_call) {
12639 PyTypeObject *base = __Pyx_PyObject_GetSlot(o, tp_base, PyTypeObject*);
12640 unsigned long flags = PyType_GetFlags(base);
12641 if (flags & Py_TPFLAGS_HEAPTYPE) {
12645 Py_VISIT((PyObject*)Py_TYPE(o));
12651#if CYTHON_COMPILING_IN_LIMITED_API
12652static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
12654 CYTHON_UNUSED_VAR(typ);
12656 return __Pyx_NewRef(func);
12657 #if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
12659 PyObject *args[] = {func, self};
12660 result = PyObject_Vectorcall(__pyx_mstate_global->__Pyx_CachedMethodType, args, 2, NULL);
12663 result = PyObject_CallFunctionObjArgs(__pyx_mstate_global->__Pyx_CachedMethodType, func, self, NULL);
12668static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
12669 CYTHON_UNUSED_VAR(typ);
12671 return __Pyx_NewRef(func);
12672 return PyMethod_New(func, self);
12677#if CYTHON_VECTORCALL
12678static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *
const *args,
size_t nargs, PyObject *kw)
12680 PyObject *res = NULL;
12682 PyObject **newargs;
12683 PyObject **kwvalues;
12685 #if CYTHON_AVOID_BORROWED_REFS
12691 PyObject *key, *value;
12692 unsigned long keys_are_strings;
12693 #if !CYTHON_ASSUME_SAFE_SIZE
12694 Py_ssize_t nkw = PyDict_Size(kw);
12695 if (unlikely(nkw == -1))
return NULL;
12697 Py_ssize_t nkw = PyDict_GET_SIZE(kw);
12699 newargs = (PyObject **)PyMem_Malloc((nargs + (
size_t)nkw) *
sizeof(args[0]));
12700 if (unlikely(newargs == NULL)) {
12704 for (j = 0; j < nargs; j++) newargs[j] = args[j];
12705 kwnames = PyTuple_New(nkw);
12706 if (unlikely(kwnames == NULL)) {
12707 PyMem_Free(newargs);
12710 kwvalues = newargs + nargs;
12713 keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
12714 while (__Pyx_PyDict_NextRef(kw, &pos, &key, &value)) {
12715 keys_are_strings &=
12716 #if CYTHON_COMPILING_IN_LIMITED_API
12717 PyType_GetFlags(Py_TYPE(key));
12719 Py_TYPE(key)->tp_flags;
12721 #if !CYTHON_ASSUME_SAFE_MACROS
12722 if (unlikely(PyTuple_SetItem(kwnames, i, key) < 0))
goto cleanup;
12724 PyTuple_SET_ITEM(kwnames, i, key);
12726 kwvalues[i] = value;
12729 if (unlikely(!keys_are_strings)) {
12730 PyErr_SetString(PyExc_TypeError,
"keywords must be strings");
12733 res = vc(func, newargs, nargs, kwnames);
12735 #if CYTHON_AVOID_BORROWED_REFS
12738 Py_DECREF(kwnames);
12739 for (i = 0; i < nkw; i++)
12740 Py_DECREF(kwvalues[i]);
12741 PyMem_Free(newargs);
12744static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *
const *args,
size_t nargs, PyObject *kw)
12746 Py_ssize_t kw_size =
12747 likely(kw == NULL) ?
12749#if !CYTHON_ASSUME_SAFE_SIZE
12752 PyDict_GET_SIZE(kw);
12754 if (kw_size == 0) {
12755 return vc(func, args, nargs, NULL);
12757#if !CYTHON_ASSUME_SAFE_SIZE
12758 else if (unlikely(kw_size == -1)) {
12762 return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
12768__Pyx_CyFunction_get_doc_locked(__pyx_CyFunctionObject *op)
12770 if (unlikely(op->func_doc == NULL)) {
12771#if CYTHON_COMPILING_IN_LIMITED_API
12772 const char *doc = op->func_methoddef->ml_doc;
12774 const char *doc = ((PyCFunctionObject*)op)->m_ml->ml_doc;
12777 op->func_doc = PyUnicode_FromString(doc);
12778 if (unlikely(op->func_doc == NULL))
12781 Py_INCREF(Py_None);
12785 Py_INCREF(op->func_doc);
12786 return op->func_doc;
12789__Pyx_CyFunction_get_doc(PyObject *op_in,
void *closure) {
12791 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
12792 CYTHON_UNUSED_VAR(closure);
12793 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
12794 result = __Pyx_CyFunction_get_doc_locked(op);
12795 __Pyx_END_CRITICAL_SECTION();
12799__Pyx_CyFunction_set_doc(PyObject *op_in, PyObject *value,
void *context)
12801 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
12802 CYTHON_UNUSED_VAR(context);
12803 if (value == NULL) {
12807 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
12808 __Pyx_Py_XDECREF_SET(op->func_doc, value);
12809 __Pyx_END_CRITICAL_SECTION();
12813__Pyx_CyFunction_get_name_locked(__pyx_CyFunctionObject *op)
12815 if (unlikely(op->func_name == NULL)) {
12816#if CYTHON_COMPILING_IN_LIMITED_API
12817 const char *name = op->func_methoddef->ml_name;
12819 const char *name = ((PyCFunctionObject*)op)->m_ml->ml_name;
12821 op->func_name = PyUnicode_InternFromString(name);
12822 if (unlikely(op->func_name == NULL))
12825 Py_INCREF(op->func_name);
12826 return op->func_name;
12829__Pyx_CyFunction_get_name(PyObject *op,
void *context)
12831 PyObject *result = NULL;
12832 CYTHON_UNUSED_VAR(context);
12833 __Pyx_BEGIN_CRITICAL_SECTION(op);
12834 result = __Pyx_CyFunction_get_name_locked(__Pyx_as_CyFunctionObject(op));
12835 __Pyx_END_CRITICAL_SECTION();
12839__Pyx_CyFunction_set_name(PyObject *op_in, PyObject *value,
void *context)
12841 CYTHON_UNUSED_VAR(context);
12842 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
12843 PyErr_SetString(PyExc_TypeError,
12844 "__name__ must be set to a string object");
12847 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
12849 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
12850 __Pyx_Py_XDECREF_SET(op->func_name, value);
12851 __Pyx_END_CRITICAL_SECTION();
12855__Pyx_CyFunction_get_qualname(PyObject *op_in,
void *context)
12857 CYTHON_UNUSED_VAR(context);
12858 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
12860 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
12861 Py_INCREF(op->func_qualname);
12862 result = op->func_qualname;
12863 __Pyx_END_CRITICAL_SECTION();
12867__Pyx_CyFunction_set_qualname(PyObject *op_in, PyObject *value,
void *context)
12869 CYTHON_UNUSED_VAR(context);
12870 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
12871 PyErr_SetString(PyExc_TypeError,
12872 "__qualname__ must be set to a string object");
12875 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
12877 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
12878 __Pyx_Py_XDECREF_SET(op->func_qualname, value);
12879 __Pyx_END_CRITICAL_SECTION();
12882#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
12884__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op,
void *context)
12886 CYTHON_UNUSED_VAR(context);
12887 if (unlikely(op->func_dict == NULL)) {
12888 op->func_dict = PyDict_New();
12889 if (unlikely(op->func_dict == NULL))
12892 Py_INCREF(op->func_dict);
12893 return op->func_dict;
12897__Pyx_CyFunction_get_globals(PyObject *op_in,
void *context)
12899 CYTHON_UNUSED_VAR(context);
12900 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
12901 Py_INCREF(op->func_globals);
12902 return op->func_globals;
12905__Pyx_CyFunction_get_closure(PyObject *op,
void *context)
12907 CYTHON_UNUSED_VAR(op);
12908 CYTHON_UNUSED_VAR(context);
12909 Py_INCREF(Py_None);
12913__Pyx_CyFunction_get_code(PyObject *op_in,
void *context)
12915 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
12916 PyObject* result = (op->func_code) ? op->func_code : Py_None;
12917 CYTHON_UNUSED_VAR(context);
12922__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op, PyObject *op_obj) {
12924 PyObject *res = op->defaults_getter(op_obj);
12925 if (unlikely(!res))
12927 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12928 op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
12929 Py_INCREF(op->defaults_tuple);
12930 op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
12931 Py_INCREF(op->defaults_kwdict);
12933 op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0);
12934 if (unlikely(!op->defaults_tuple)) result = -1;
12936 op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1);
12937 if (unlikely(!op->defaults_kwdict)) result = -1;
12944__Pyx_CyFunction_set_defaults(PyObject *op_in, PyObject* value,
void *context) {
12945 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
12946 CYTHON_UNUSED_VAR(context);
12949 }
else if (unlikely(value != Py_None && !PyTuple_Check(value))) {
12950 PyErr_SetString(PyExc_TypeError,
12951 "__defaults__ must be set to a tuple object");
12954 PyErr_WarnEx(PyExc_RuntimeWarning,
"changes to cyfunction.__defaults__ will not "
12955 "currently affect the values used in function calls", 1);
12957 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
12958 __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
12959 __Pyx_END_CRITICAL_SECTION();
12963__Pyx_CyFunction_get_defaults_locked(PyObject *op_in) {
12964 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
12965 PyObject* result = op->defaults_tuple;
12966 if (unlikely(!result)) {
12967 if (op->defaults_getter) {
12968 if (unlikely(__Pyx_CyFunction_init_defaults(op, op_in) < 0))
return NULL;
12969 result = op->defaults_tuple;
12978__Pyx_CyFunction_get_defaults(PyObject *op,
void *context) {
12979 PyObject* result = NULL;
12980 CYTHON_UNUSED_VAR(context);
12981 __Pyx_BEGIN_CRITICAL_SECTION(op);
12982 result = __Pyx_CyFunction_get_defaults_locked(op);
12983 __Pyx_END_CRITICAL_SECTION();
12987__Pyx_CyFunction_set_kwdefaults(PyObject *op_in, PyObject* value,
void *context) {
12988 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
12989 CYTHON_UNUSED_VAR(context);
12992 }
else if (unlikely(value != Py_None && !PyDict_Check(value))) {
12993 PyErr_SetString(PyExc_TypeError,
12994 "__kwdefaults__ must be set to a dict object");
12997 PyErr_WarnEx(PyExc_RuntimeWarning,
"changes to cyfunction.__kwdefaults__ will not "
12998 "currently affect the values used in function calls", 1);
13000 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
13001 __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
13002 __Pyx_END_CRITICAL_SECTION();
13006__Pyx_CyFunction_get_kwdefaults_locked(PyObject *op_in) {
13007 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
13008 PyObject* result = op->defaults_kwdict;
13009 if (unlikely(!result)) {
13010 if (op->defaults_getter) {
13011 if (unlikely(__Pyx_CyFunction_init_defaults(op, op_in) < 0))
return NULL;
13012 result = op->defaults_kwdict;
13021__Pyx_CyFunction_get_kwdefaults(PyObject *op,
void *context) {
13023 CYTHON_UNUSED_VAR(context);
13024 __Pyx_BEGIN_CRITICAL_SECTION(op);
13025 result = __Pyx_CyFunction_get_kwdefaults_locked(op);
13026 __Pyx_END_CRITICAL_SECTION();
13029static int __Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value);
13031__Pyx_CyFunction_set_annotations(PyObject *op_in, PyObject* value,
void *context) {
13032 CYTHON_UNUSED_VAR(context);
13033 if (!value || value == Py_None) {
13035 }
else if (unlikely(!PyDict_Check(value))) {
13036 PyErr_SetString(PyExc_TypeError,
13037 "__annotations__ must be set to a dict object");
13040 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
13042 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
13043 __Pyx_Py_XDECREF_SET(op->func_annotations, value);
13044 __Pyx_END_CRITICAL_SECTION();
13045 if (unlikely(__Pyx_CyFunction_set_annotate_in_dict_if_exists(op_in, Py_None) < 0))
return -1;
13049__Pyx_CyFunction_get_dict_if_exists(PyObject *op_in, PyObject **dict) {
13052#if CYTHON_COMPILING_IN_PYPY
13053 *dict = PyObject_GenericGetDict(op_in, NULL);
13054#elif CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030C0000
13055 *dict = __Pyx_as_CyFunctionObject(op_in)->func_dict;
13057 PyObject **dictptr = _PyObject_GetDictPtr(op_in);
13058 *dict = likely(dictptr) ? *dictptr : NULL;
13060 return *dict ? 1 : 0;
13063__Pyx_CyFunction_get_annotate_from_dict_if_exists(PyObject *op_in, PyObject **annotate) {
13067 dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict);
13068 if (!dict_found)
return 0;
13069 return __Pyx_PyDict_GetItemRef(dict, __pyx_mstate_global->__pyx_n_u_annotate, annotate);
13072__Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value) {
13075 dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict);
13076 if (!dict_found)
return 0;
13078 return PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value);
13080#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
13081 return PyDict_Pop(dict, __pyx_mstate_global->__pyx_n_u_annotate, NULL);
13083 int result = PyDict_Contains(dict, __pyx_mstate_global->__pyx_n_u_annotate);
13085 result = PyDict_DelItem(dict, __pyx_mstate_global->__pyx_n_u_annotate);
13092__Pyx_CyFunction_set_annotate_in_dict(PyObject *op_in, PyObject *value) {
13095#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
13096 dict = __Pyx_CyFunction_get_dict(__Pyx_as_CyFunctionObject(op_in), NULL);
13098 dict = PyObject_GenericGetDict(op_in, NULL);
13100 if (unlikely(!dict))
return -1;
13101 result = PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value);
13106__Pyx_CyFunction_get_annotations_locked(__pyx_CyFunctionObject *op) {
13107 PyObject* result = op->func_annotations;
13108 if (unlikely(!result)) {
13109 result = PyDict_New();
13110 if (unlikely(!result))
return NULL;
13111 op->func_annotations = result;
13117__Pyx_CyFunction_get_annotations(PyObject *op_in,
void *context) {
13118 PyObject *annotate = NULL;
13119 PyObject *result = NULL;
13120 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
13121 CYTHON_UNUSED_VAR(context);
13122 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
13123 result = __Pyx_XNewRef(op->func_annotations);
13124 __Pyx_END_CRITICAL_SECTION();
13125 if (result)
return result;
13126 if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0))
return NULL;
13127 if (!annotate || annotate == Py_None) {
13128 Py_XDECREF(annotate);
13129 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
13130 result = __Pyx_CyFunction_get_annotations_locked(op);
13131 __Pyx_END_CRITICAL_SECTION();
13134 PyObject *format = PyLong_FromLong(1L);
13135 if (likely(format)) {
13136 if (!Py_EnterRecursiveCall(
" cyfunction __annotations__.__get__")) {
13137 result = __Pyx_PyObject_CallOneArg(annotate, format);
13138 Py_LeaveRecursiveCall();
13142 Py_DECREF(annotate);
13143 if (unlikely(!result))
return NULL;
13144 if (unlikely(!PyDict_Check(result))) {
13145 PyErr_SetString(PyExc_TypeError,
"__annotate__ must return a dict");
13149 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
13150 __Pyx_Py_XDECREF_SET(op->func_annotations, __Pyx_NewRef(result));
13151 __Pyx_END_CRITICAL_SECTION();
13154static PyObject *__Pyx_CyFunction_annotate_impl(PyObject *self, PyObject *arg) {
13155 CYTHON_UNUSED_VAR(arg);
13156 if (unlikely(!self)) {
13157 PyErr_SetString(PyExc_SystemError,
"cython __annotate__ called without 'self' argument");
13161 if (Py_EnterRecursiveCall(
" in cyfunction annotate")) {
13164 result = __Pyx_CyFunction_get_annotations(self, NULL);
13165 Py_LeaveRecursiveCall();
13169__Pyx_CyFunction_get_annotate(PyObject *op_in,
void *context);
13171__Pyx_CyFunction_set_annotate(PyObject *op_in, PyObject* value,
void *context) {
13172 CYTHON_UNUSED_VAR(context);
13173 if (value == NULL) {
13174 PyErr_SetString(PyExc_TypeError,
"__annotate__ cannot be deleted");
13177 if (unlikely(value != Py_None && !PyCallable_Check(value))) {
13178 PyErr_SetString(PyExc_TypeError,
"__annotate__ must be callable or None");
13181 if (unlikely(__Pyx_TypeCheck(value, &PyCFunction_Type))) {
13182#if !CYTHON_ASSUME_SAFE_MACROS && !CYTHON_COMPILING_IN_PYPY
13183 PyCFunction cfunction = PyCFunction_GetFunction(value);
13184 if (unlikely(!cfunction))
return -1;
13185 PyObject *value_self = PyCFunction_GetSelf(value);
13186 if (unlikely(!value_self && PyErr_Occurred()))
return -1;
13188 PyCFunction cfunction = PyCFunction_GET_FUNCTION(value);
13189 PyObject *value_self = PyCFunction_GET_SELF(value);
13191 if (cfunction == __Pyx_CyFunction_annotate_impl && value_self == op_in) {
13192 return __Pyx_CyFunction_set_annotate_in_dict_if_exists(op_in, NULL);
13195 if (value != Py_None) {
13196 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
13197 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
13198 Py_CLEAR(op->func_annotations);
13199 __Pyx_END_CRITICAL_SECTION();
13201 return __Pyx_CyFunction_set_annotate_in_dict(op_in, value);
13203#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
13205__Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) {
13206 int is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
13207 if (is_coroutine) {
13208 PyObject *is_coroutine_value, *module, *fromlist, *marker = __pyx_mstate_global->__pyx_n_u_is_coroutine;
13209 fromlist = PyList_New(1);
13210 if (unlikely(!fromlist))
return NULL;
13212#if CYTHON_ASSUME_SAFE_MACROS
13213 PyList_SET_ITEM(fromlist, 0, marker);
13215 if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) {
13216 Py_DECREF(fromlist);
13220 module = PyImport_ImportModuleLevelObject(__pyx_mstate_global->__pyx_n_u_asyncio_coroutines, NULL, NULL, fromlist, 0);
13221 Py_DECREF(fromlist);
13222 if (unlikely(!module)) {
13223 goto ignore_or_error;
13225 is_coroutine_value = __Pyx_PyObject_GetAttrStr(module, marker);
13227 if (likely(is_coroutine_value)) {
13228 return is_coroutine_value;
13231 if (!__Pyx_IgnoreException(PyExc_Exception)) {
13235 return __Pyx_PyBool_FromLong(is_coroutine);
13238__Pyx_CyFunction_get_is_coroutine(PyObject *op_in,
void *context) {
13239 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
13241 CYTHON_UNUSED_VAR(context);
13242 if (op->func_is_coroutine) {
13243 return __Pyx_NewRef(op->func_is_coroutine);
13245 result = __Pyx_CyFunction_get_is_coroutine_value(op);
13246 if (unlikely(!result))
13248 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
13249 if (op->func_is_coroutine) {
13251 result = __Pyx_NewRef(op->func_is_coroutine);
13253 op->func_is_coroutine = __Pyx_NewRef(result);
13255 __Pyx_END_CRITICAL_SECTION();
13259static void __Pyx_CyFunction_raise_argument_count_error(PyObject *func,
const char* message, Py_ssize_t size) {
13260#if CYTHON_COMPILING_IN_LIMITED_API
13261 PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
13262 if (!py_name)
return;
13263 PyErr_Format(PyExc_TypeError,
13264 "%.200S() %s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
13265 py_name, message, size);
13266 Py_DECREF(py_name);
13268 const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
13269 PyErr_Format(PyExc_TypeError,
13270 "%.200s() %s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
13271 name, message, size);
13274static void __Pyx_CyFunction_raise_type_error(PyObject *func,
const char* message) {
13275#if CYTHON_COMPILING_IN_LIMITED_API
13276 PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
13277 if (!py_name)
return;
13278 PyErr_Format(PyExc_TypeError,
13281 Py_DECREF(py_name);
13283 const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
13284 PyErr_Format(PyExc_TypeError,
13289#if CYTHON_COMPILING_IN_LIMITED_API
13291__Pyx_CyFunction_get_module(PyObject *op_in,
void *context) {
13292 CYTHON_UNUSED_VAR(context);
13293 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
13294 Py_INCREF(op->func_module);
13295 return op->func_module;
13298__Pyx_CyFunction_set_module(PyObject *op_in, PyObject* value,
void *context) {
13299 CYTHON_UNUSED_VAR(context);
13300 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
13301 if (value == NULL) {
13305 PyObject *old = op->func_module;
13306 op->func_module = value;
13311static PyGetSetDef __pyx_CyFunction_getsets[] = {
13312 {
"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
13313 {
"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
13314 {
"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
13315 {
"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
13316 {
"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
13317#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
13318 {
"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
13319 {
"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
13321 {
"func_dict", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
13322 {
"__dict__", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
13324 {
"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
13325 {
"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
13326 {
"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
13327 {
"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
13328 {
"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
13329 {
"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
13330 {
"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
13331 {
"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
13332 {
"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
13333 {
"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
13334 {
"__annotate__", (getter)__Pyx_CyFunction_get_annotate, (setter)__Pyx_CyFunction_set_annotate, 0, 0},
13335#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
13336 {
"_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
13338#if CYTHON_COMPILING_IN_LIMITED_API
13339 {
"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0},
13343static PyMemberDef __pyx_CyFunction_members[] = {
13344#if !CYTHON_COMPILING_IN_LIMITED_API
13345 {
"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
13347#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
13348 {
"__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict),
13349 __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
13351#if CYTHON_VECTORCALL
13352#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
13353 {
"__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall),
13354 __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
13356 {
"__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
13358#if CYTHON_COMPILING_IN_LIMITED_API
13359 {
"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist),
13360 __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
13362 {
"__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
13368__Pyx_CyFunction_reduce(PyObject *m_in, PyObject *args)
13370 PyObject *result = NULL;
13371 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(m_in);
13372 CYTHON_UNUSED_VAR(args);
13373 __Pyx_BEGIN_CRITICAL_SECTION(m_in);
13374 Py_INCREF(m->func_qualname);
13375 result = m->func_qualname;
13376 __Pyx_END_CRITICAL_SECTION();
13379static PyMethodDef __pyx_CyFunction_methods[] = {
13380 {
"__annotate_cython__", __Pyx_CyFunction_annotate_impl, METH_O,
13381 "Placeholder __annotate__ function to allow 'functools.wraps' to work "
13382 "on Cython functions."},
13383 {
"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_NOARGS, 0},
13387__Pyx_CyFunction_get_annotate(PyObject *op_in,
void *context) {
13388 PyObject *annotate = NULL;
13389 CYTHON_UNUSED_VAR(context);
13390 if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0))
return NULL;
13391 if (annotate)
return annotate;
13392 PyObject *method = PyCFunction_New(
13393 &__pyx_CyFunction_methods[0],
13397#if CYTHON_COMPILING_IN_LIMITED_API
13398#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
13400#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist)
13402static PyObject *__Pyx_CyFunction_Init(PyObject *op_in,
13403 PyMethodDef *ml,
int flags, PyObject* qualname,
13404 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
13405 __pyx_CyFunctionObject* op = __Pyx_as_CyFunctionObject(op_in);
13406#if !CYTHON_COMPILING_IN_LIMITED_API
13407 PyCFunctionObject *cf = (PyCFunctionObject*) op;
13409 if (unlikely(op == NULL))
13411#if CYTHON_COMPILING_IN_LIMITED_API
13412 op->func_methoddef = ml;
13414 op->func_module =
module;
13417 __Pyx_CyFunction_weakreflist(op) = NULL;
13418#if !CYTHON_COMPILING_IN_LIMITED_API
13420 cf->m_self = (PyObject *) op;
13422 Py_XINCREF(closure);
13423 op->func_closure = closure;
13424#if !CYTHON_COMPILING_IN_LIMITED_API
13425 Py_XINCREF(module);
13426 cf->m_module =
module;
13428#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
13429 op->func_dict = NULL;
13431 op->func_name = NULL;
13432 Py_INCREF(qualname);
13433 op->func_qualname = qualname;
13434 op->func_doc = NULL;
13435#if CYTHON_COMPILING_IN_LIMITED_API
13436 op->func_classobj = NULL;
13438 ((PyCMethodObject*)op)->mm_class = NULL;
13440 op->func_globals = globals;
13441 Py_INCREF(op->func_globals);
13443 op->func_code = code;
13444 op->defaults = NULL;
13445 op->defaults_tuple = NULL;
13446 op->defaults_kwdict = NULL;
13447 op->defaults_getter = NULL;
13448 op->func_annotations = NULL;
13449#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
13450 op->func_is_coroutine = NULL;
13452#if CYTHON_VECTORCALL
13453 switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) {
13455 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS;
13458 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O;
13460 case METH_METHOD | METH_FASTCALL | METH_KEYWORDS:
13461 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD;
13463 case METH_FASTCALL | METH_KEYWORDS:
13464 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS;
13466 case METH_VARARGS | METH_KEYWORDS:
13467 __Pyx_CyFunction_func_vectorcall(op) = NULL;
13470 PyErr_SetString(PyExc_SystemError,
"Bad call flags for CyFunction");
13477static int __Pyx__CyFunction_clear(__pyx_CyFunctionObject *m)
13479 Py_CLEAR(m->func_closure);
13480#if CYTHON_COMPILING_IN_LIMITED_API
13481 Py_CLEAR(m->func_module);
13483 Py_CLEAR(((PyCFunctionObject*)m)->m_module);
13485#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
13486 Py_CLEAR(m->func_dict);
13487#elif PY_VERSION_HEX < 0x030d0000
13488 _PyObject_ClearManagedDict((PyObject*)m);
13490 PyObject_ClearManagedDict((PyObject*)m);
13492 Py_CLEAR(m->func_name);
13493 Py_CLEAR(m->func_qualname);
13494 Py_CLEAR(m->func_doc);
13495 Py_CLEAR(m->func_globals);
13496 Py_CLEAR(m->func_code);
13497#if CYTHON_COMPILING_IN_LIMITED_API
13498 Py_CLEAR(m->func_classobj);
13501 PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
13502 ((PyCMethodObject *) (m))->mm_class = NULL;
13506 Py_CLEAR(m->defaults_tuple);
13507 Py_CLEAR(m->defaults_kwdict);
13508 Py_CLEAR(m->func_annotations);
13509#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
13510 Py_CLEAR(m->func_is_coroutine);
13512 Py_CLEAR(m->defaults);
13516__Pyx_CyFunction_clear(PyObject *m)
13518 return __Pyx__CyFunction_clear(__Pyx_as_CyFunctionObject(m));
13520static void __Pyx__CyFunction_dealloc(PyObject *m)
13522 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(m);
13523 if (__Pyx_CyFunction_weakreflist(cyfunc) != NULL)
13524 PyObject_ClearWeakRefs(m);
13525 __Pyx__CyFunction_clear(cyfunc);
13526 __Pyx_PyHeapTypeObject_GC_Del(m);
13528static void __Pyx_CyFunction_dealloc(PyObject *m)
13530 PyObject_GC_UnTrack(m);
13531 __Pyx__CyFunction_dealloc(m);
13533static int __Pyx_CyFunction_traverse(PyObject *m_in, visitproc visit,
void *arg)
13535 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(m_in);
13537 int e = __Pyx_call_type_traverse(m_in, 1, visit, arg);
13540 Py_VISIT(m->func_closure);
13541#if CYTHON_COMPILING_IN_LIMITED_API
13542 Py_VISIT(m->func_module);
13544 Py_VISIT(((PyCFunctionObject*)m)->m_module);
13546#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
13547 Py_VISIT(m->func_dict);
13551#if PY_VERSION_HEX < 0x030d0000
13552 _PyObject_VisitManagedDict
13554 PyObject_VisitManagedDict
13556 ((PyObject*)m, visit, arg);
13557 if (e != 0)
return e;
13560 __Pyx_VISIT_CONST(m->func_name);
13561 __Pyx_VISIT_CONST(m->func_qualname);
13562 Py_VISIT(m->func_doc);
13563 Py_VISIT(m->func_globals);
13564 __Pyx_VISIT_CONST(m->func_code);
13565 Py_VISIT(__Pyx__CyFunction_GetClassObj(m));
13566 Py_VISIT(m->defaults_tuple);
13567 Py_VISIT(m->defaults_kwdict);
13568 Py_VISIT(m->func_annotations);
13569#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
13570 Py_VISIT(m->func_is_coroutine);
13572 Py_VISIT(m->defaults);
13576__Pyx_CyFunction_repr(PyObject *op_in)
13578 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
13580 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
13581 repr = PyUnicode_FromFormat(
"<cyfunction %U at %p>",
13582 op->func_qualname, (
void *)op);
13583 __Pyx_END_CRITICAL_SECTION();
13586static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
13587#if CYTHON_COMPILING_IN_LIMITED_API
13588 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
13589 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
13590 int flags = cyfunc->func_methoddef->ml_flags;
13592 PyCFunctionObject*
f = (PyCFunctionObject*)func;
13593 PyCFunction meth =
f->m_ml->ml_meth;
13594 int flags =
f->m_ml->ml_flags;
13597 switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
13599 if (likely(kw == NULL || PyDict_Size(kw) == 0))
13600 return (*meth)(self, arg);
13602 case METH_VARARGS | METH_KEYWORDS:
13603 return (*(PyCFunctionWithKeywords)(
void(*)(
void))meth)(self, arg, kw);
13605 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
13606#if CYTHON_ASSUME_SAFE_SIZE
13607 size = PyTuple_GET_SIZE(arg);
13609 size = PyTuple_Size(arg);
13610 if (unlikely(size < 0))
return NULL;
13612 if (likely(size == 0))
13613 return (*meth)(self, NULL);
13614 __Pyx_CyFunction_raise_argument_count_error(
13616 "takes no arguments", size);
13621 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
13622#if CYTHON_ASSUME_SAFE_SIZE
13623 size = PyTuple_GET_SIZE(arg);
13625 size = PyTuple_Size(arg);
13626 if (unlikely(size < 0))
return NULL;
13628 if (likely(size == 1)) {
13629 PyObject *result, *arg0;
13630 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13631 arg0 = PyTuple_GET_ITEM(arg, 0);
13633 arg0 = __Pyx_PySequence_ITEM(arg, 0);
if (unlikely(!arg0))
return NULL;
13635 result = (*meth)(self, arg0);
13636 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
13641 __Pyx_CyFunction_raise_argument_count_error(
13643 "takes exactly one argument", size);
13648 PyErr_SetString(PyExc_SystemError,
"Bad call flags for CyFunction");
13651 __Pyx_CyFunction_raise_type_error(
13652 func,
"takes no keyword arguments");
13655static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
13657 result = __Pyx_CyFunction_CallMethod(func, func, arg, kw);
13660static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
13662 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
13663#if CYTHON_VECTORCALL
13664 __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
13666#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
13667 return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (
size_t)PyTuple_GET_SIZE(args), kw);
13669 (void) &__Pyx_PyVectorcall_FastCallDict;
13670 return PyVectorcall_Call(func, args, kw);
13674 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
13676 PyObject *new_args;
13678#if CYTHON_ASSUME_SAFE_SIZE
13679 argc = PyTuple_GET_SIZE(args);
13681 argc = PyTuple_Size(args);
13682 if (unlikely(argc < 0))
return NULL;
13684 new_args = PyTuple_GetSlice(args, 1, argc);
13685 if (unlikely(!new_args))
13687 self = PyTuple_GetItem(args, 0);
13688 if (unlikely(!self)) {
13689 Py_DECREF(new_args);
13690 PyErr_Format(PyExc_TypeError,
13691 "unbound method %.200S() needs an argument",
13692 cyfunc->func_qualname);
13695 result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
13696 Py_DECREF(new_args);
13698 result = __Pyx_CyFunction_Call(func, args, kw);
13702#if CYTHON_VECTORCALL
13703static CYTHON_INLINE
int __Pyx_CyFunction_Vectorcall_CheckArgs(PyObject *func, __pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames)
13706 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
13707 if (unlikely(nargs < 1)) {
13708 __Pyx_CyFunction_raise_type_error(
13709 func,
"needs an argument");
13714 if (unlikely(kwnames) && unlikely(__Pyx_PyTuple_GET_SIZE(kwnames))) {
13715 __Pyx_CyFunction_raise_type_error(
13716 func,
"takes no keyword arguments");
13721static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames)
13723 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
13724 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
13726#if CYTHON_COMPILING_IN_LIMITED_API
13727 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
13728 if (unlikely(!meth))
return NULL;
13730 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
13732 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, kwnames)) {
13744 if (unlikely(nargs != 0)) {
13745 __Pyx_CyFunction_raise_argument_count_error(
13746 func,
"takes no arguments", nargs);
13749 return meth(self, NULL);
13751static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames)
13753 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
13754 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
13756#if CYTHON_COMPILING_IN_LIMITED_API
13757 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
13758 if (unlikely(!meth))
return NULL;
13760 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
13762 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, kwnames)) {
13774 if (unlikely(nargs != 1)) {
13775 __Pyx_CyFunction_raise_argument_count_error(
13776 func,
"takes exactly one argument", nargs);
13779 return meth(self, args[0]);
13781static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames)
13783 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
13784 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
13786#if CYTHON_COMPILING_IN_LIMITED_API
13787 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
13788 if (unlikely(!meth))
return NULL;
13790 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
13792 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, NULL)) {
13804 return ((__Pyx_PyCFunctionFastWithKeywords)(
void(*)(
void))meth)(self, args, nargs, kwnames);
13806static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames)
13808 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
13809 PyTypeObject *cls = (PyTypeObject *) __Pyx__CyFunction_GetClassObj(cyfunc);
13810 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
13812#if CYTHON_COMPILING_IN_LIMITED_API
13813 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
13814 if (unlikely(!meth))
return NULL;
13816 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
13818 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, NULL)) {
13830 #if PY_VERSION_HEX < 0x030e00A6
13831 size_t nargs_value = (size_t) nargs;
13833 Py_ssize_t nargs_value = nargs;
13835 return ((__Pyx_PyCMethod)(
void(*)(
void))meth)(self, cls, args, nargs_value, kwnames);
13838static PyType_Slot __pyx_CyFunctionType_slots[] = {
13839 {Py_tp_dealloc, (
void *)__Pyx_CyFunction_dealloc},
13840 {Py_tp_repr, (
void *)__Pyx_CyFunction_repr},
13841 {Py_tp_call, (
void *)__Pyx_CyFunction_CallAsMethod},
13842 {Py_tp_traverse, (
void *)__Pyx_CyFunction_traverse},
13843 {Py_tp_clear, (
void *)__Pyx_CyFunction_clear},
13844 {Py_tp_methods, (
void *)__pyx_CyFunction_methods},
13845 {Py_tp_members, (
void *)__pyx_CyFunction_members},
13846 {Py_tp_getset, (
void *)__pyx_CyFunction_getsets},
13847 {Py_tp_descr_get, (
void *)__Pyx_PyMethod_New},
13850static PyType_Spec __pyx_CyFunctionType_spec = {
13851 __PYX_TYPE_MODULE_PREFIX
"cython_function_or_method",
13852 __PYX_SHARED_SIZEOF(__pyx_CyFunctionObject),
13854#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
13855 Py_TPFLAGS_METHOD_DESCRIPTOR |
13857#if CYTHON_VECTORCALL
13858#if defined(Py_TPFLAGS_HAVE_VECTORCALL)
13859 Py_TPFLAGS_HAVE_VECTORCALL |
13860#elif defined(_Py_TPFLAGS_HAVE_VECTORCALL)
13861 _Py_TPFLAGS_HAVE_VECTORCALL |
13864#if PY_VERSION_HEX >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API
13865 Py_TPFLAGS_MANAGED_DICT |
13867 Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION |
13868 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
13869 __pyx_CyFunctionType_slots
13871static int __pyx_CyFunction_init(PyObject *module) {
13872 __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
13873 mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(
13874 mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_CyFunctionType_spec, NULL);
13875 if (unlikely(mstate->__pyx_CyFunctionType == NULL)) {
13882static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
int flags, PyObject* qualname,
13883 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
13884 (void)&__Pyx_Get_CyFunction_Type;
13885 PyObject *op = __Pyx_CyFunction_Init(
13886 PyObject_GC_New(PyObject, __pyx_mstate_global->__pyx_CyFunctionType),
13887 ml, flags, qualname, closure, module, globals, code
13890 PyObject_GC_Track(op);
13894static PyTypeObject *__Pyx_Get_CyFunction_Type(
void) {
13895 PyTypeObject *tp = __pyx_mstate_global->__pyx_CyFunctionType;
13896 Py_INCREF((PyObject*)tp);
13901#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
13902#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
13903#define __Pyx_PyProbablyModule_GetDict(o) __Pyx_XNewRef(PyModule_GetDict(o))
13904#elif !CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
13905#define __Pyx_PyProbablyModule_GetDict(o) PyObject_GenericGetDict(o, NULL);
13907PyObject* __Pyx_PyProbablyModule_GetDict(PyObject *o) {
13908 PyObject **dict_ptr = _PyObject_GetDictPtr(o);
13909 return dict_ptr ? __Pyx_XNewRef(*dict_ptr) : NULL;
13912static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line) {
13913 PyObject *use_cline = NULL;
13914 PyObject *ptype, *pvalue, *ptraceback;
13915 PyObject *cython_runtime_dict;
13916 CYTHON_MAYBE_UNUSED_VAR(tstate);
13917 if (unlikely(!__pyx_mstate_global->__pyx_cython_runtime)) {
13920 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
13921 cython_runtime_dict = __Pyx_PyProbablyModule_GetDict(__pyx_mstate_global->__pyx_cython_runtime);
13922 if (likely(cython_runtime_dict)) {
13923 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
13924 use_cline, cython_runtime_dict,
13925 __Pyx_PyDict_SetDefault(cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False))
13927 if (use_cline == NULL || use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
13930 Py_XDECREF(use_cline);
13931 Py_XDECREF(cython_runtime_dict);
13932 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
13938static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
13939 int start = 0, mid = 0, end = count - 1;
13940 if (end >= 0 && code_line > entries[end].code_line) {
13943 while (start < end) {
13944 mid = start + (end - start) / 2;
13945 if (code_line < entries[mid].code_line) {
13947 }
else if (code_line > entries[mid].code_line) {
13953 if (code_line <= entries[mid].code_line) {
13959static __Pyx_CachedCodeObjectType *__pyx__find_code_object(
struct __Pyx_CodeObjectCache *code_cache,
int code_line) {
13960 __Pyx_CachedCodeObjectType* code_object;
13962 if (unlikely(!code_line) || unlikely(!code_cache->entries)) {
13965 pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
13966 if (unlikely(pos >= code_cache->count) || unlikely(code_cache->entries[pos].code_line != code_line)) {
13969 code_object = code_cache->entries[pos].code_object;
13970 Py_INCREF(code_object);
13971 return code_object;
13973static __Pyx_CachedCodeObjectType *__pyx_find_code_object(
int code_line) {
13974#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
13975 (void)__pyx__find_code_object;
13978 struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
13979#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
13980 __pyx_nonatomic_int_type old_count = __pyx_atomic_incr_acq_rel(&code_cache->accessor_count);
13981 if (old_count < 0) {
13982 __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
13986 __Pyx_CachedCodeObjectType *result = __pyx__find_code_object(code_cache, code_line);
13987#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
13988 __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
13993static void __pyx__insert_code_object(
struct __Pyx_CodeObjectCache *code_cache,
int code_line, __Pyx_CachedCodeObjectType* code_object)
13996 __Pyx_CodeObjectCacheEntry* entries = code_cache->entries;
13997 if (unlikely(!code_line)) {
14000 if (unlikely(!entries)) {
14001 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
14002 if (likely(entries)) {
14003 code_cache->entries = entries;
14004 code_cache->max_count = 64;
14005 code_cache->count = 1;
14006 entries[0].code_line = code_line;
14007 entries[0].code_object = code_object;
14008 Py_INCREF(code_object);
14012 pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
14013 if ((pos < code_cache->count) && unlikely(code_cache->entries[pos].code_line == code_line)) {
14014 __Pyx_CachedCodeObjectType* tmp = entries[pos].code_object;
14015 entries[pos].code_object = code_object;
14016 Py_INCREF(code_object);
14020 if (code_cache->count == code_cache->max_count) {
14021 int new_max = code_cache->max_count + 64;
14022 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
14023 code_cache->entries, ((
size_t)new_max) *
sizeof(__Pyx_CodeObjectCacheEntry));
14024 if (unlikely(!entries)) {
14027 code_cache->entries = entries;
14028 code_cache->max_count = new_max;
14030 for (i=code_cache->count; i>pos; i--) {
14031 entries[i] = entries[i-1];
14033 entries[pos].code_line = code_line;
14034 entries[pos].code_object = code_object;
14035 code_cache->count++;
14036 Py_INCREF(code_object);
14038static void __pyx_insert_code_object(
int code_line, __Pyx_CachedCodeObjectType* code_object) {
14039#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
14040 (void)__pyx__insert_code_object;
14043 struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
14044#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
14045 __pyx_nonatomic_int_type expected = 0;
14046 if (!__pyx_atomic_int_cmp_exchange(&code_cache->accessor_count, &expected, INT_MIN)) {
14050 __pyx__insert_code_object(code_cache, code_line, code_object);
14051#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
14052 __pyx_atomic_sub(&code_cache->accessor_count, INT_MIN);
14058#include "compile.h"
14059#include "frameobject.h"
14060#include "traceback.h"
14061#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION)
14062 #ifndef Py_BUILD_CORE
14063 #define Py_BUILD_CORE 1
14065 #include "internal/pycore_frame.h"
14067#if CYTHON_COMPILING_IN_LIMITED_API
14068static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
14069 PyObject *firstlineno, PyObject *name) {
14070 PyObject *replace = NULL;
14071 if (unlikely(PyDict_SetItemString(scratch_dict,
"co_firstlineno", firstlineno)))
return NULL;
14072 if (unlikely(PyDict_SetItemString(scratch_dict,
"co_name", name)))
return NULL;
14073 replace = PyObject_GetAttrString(code,
"replace");
14074 if (likely(replace)) {
14075 PyObject *result = PyObject_Call(replace, __pyx_mstate_global->__pyx_empty_tuple, scratch_dict);
14076 Py_DECREF(replace);
14081static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
14082 int py_line,
const char *filename) {
14083 PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
14084 PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
14085 PyObject *exc_type, *exc_value, *exc_traceback;
14088 c_line = __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
14090 __Pyx_PyErr_FetchException(&exc_type, &exc_value, &exc_traceback);
14091 code_object = __pyx_find_code_object(c_line ? -c_line : py_line);
14092 if (!code_object) {
14093 code_object = Py_CompileString(
"_getframe()", filename, Py_eval_input);
14094 if (unlikely(!code_object))
goto bad;
14095 py_py_line = PyLong_FromLong(py_line);
14096 if (unlikely(!py_py_line))
goto bad;
14098 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
14100 py_funcname = PyUnicode_FromString(funcname);
14102 if (unlikely(!py_funcname))
goto bad;
14103 dict = PyDict_New();
14104 if (unlikely(!dict))
goto bad;
14106 PyObject *old_code_object = code_object;
14107 code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
14108 Py_DECREF(old_code_object);
14110 if (unlikely(!code_object))
goto bad;
14111 __pyx_insert_code_object(c_line ? -c_line : py_line, code_object);
14113 dict = PyDict_New();
14115 getframe = PySys_GetObject(
"_getframe");
14116 if (unlikely(!getframe))
goto bad;
14117 if (unlikely(PyDict_SetItemString(dict,
"_getframe", getframe)))
goto bad;
14118 frame = PyEval_EvalCode(code_object, dict, dict);
14119 if (unlikely(!frame) || frame == Py_None)
goto bad;
14122 __Pyx_PyErr_RestoreException(exc_type, exc_value, exc_traceback);
14123 Py_XDECREF(code_object);
14124 Py_XDECREF(py_py_line);
14125 Py_XDECREF(py_funcname);
14127 Py_XDECREF(replace);
14130 (
struct _frame*)frame);
14135static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
14136 const char *funcname,
int c_line,
14137 int py_line,
const char *filename) {
14138 PyCodeObject *py_code = NULL;
14139 PyObject *py_funcname = NULL;
14141 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
14142 if (!py_funcname)
goto bad;
14143 funcname = PyUnicode_AsUTF8(py_funcname);
14144 if (!funcname)
goto bad;
14146 py_code = PyCode_NewEmpty(filename, funcname, py_line);
14147 Py_XDECREF(py_funcname);
14150 Py_XDECREF(py_funcname);
14153static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
14154 int py_line,
const char *filename) {
14155 PyCodeObject *py_code = 0;
14156 PyFrameObject *py_frame = 0;
14157 PyThreadState *tstate = __Pyx_PyThreadState_Current;
14158 PyObject *ptype, *pvalue, *ptraceback;
14160 c_line = __Pyx_CLineForTraceback(tstate, c_line);
14162 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
14164 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
14165 py_code = __Pyx_CreateCodeObjectForTraceback(
14166 funcname, c_line, py_line, filename);
14171 Py_XDECREF(pvalue);
14172 Py_XDECREF(ptraceback);
14175 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
14176 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
14178 py_frame = PyFrame_New(
14181 __pyx_mstate_global->__pyx_d,
14184 if (!py_frame)
goto bad;
14185 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
14186 PyTraceBack_Here(py_frame);
14188 Py_XDECREF(py_code);
14189 Py_XDECREF(py_frame);
14194#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
14196 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
14197 return ::std::complex< float >(x, y);
14200 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
14201 return x + y*(__pyx_t_float_complex)_Complex_I;
14205 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
14206 __pyx_t_float_complex
z;
14214#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
14216 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
14217 return (a.real == b.real) && (a.imag == b.imag);
14219 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
14220 __pyx_t_float_complex
z;
14221 z.real = a.real + b.real;
14222 z.imag = a.imag + b.imag;
14225 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
14226 __pyx_t_float_complex
z;
14227 z.real = a.real - b.real;
14228 z.imag = a.imag - b.imag;
14231 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
14232 __pyx_t_float_complex
z;
14233 z.real = a.real * b.real - a.imag * b.imag;
14234 z.imag = a.real * b.imag + a.imag * b.real;
14238 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
14240 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
14241 }
else if (fabsf(b.real) >= fabsf(b.imag)) {
14242 if (b.real == 0 && b.imag == 0) {
14243 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
14245 float r = b.imag / b.real;
14246 float s = (float)(1.0) / (b.real + b.imag *
r);
14247 return __pyx_t_float_complex_from_parts(
14248 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
14251 float r = b.real / b.imag;
14252 float s = (float)(1.0) / (b.imag + b.real *
r);
14253 return __pyx_t_float_complex_from_parts(
14254 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
14258 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
14260 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
14262 float denom = b.real * b.real + b.imag * b.imag;
14263 return __pyx_t_float_complex_from_parts(
14264 (a.real * b.real + a.imag * b.imag) / denom,
14265 (a.imag * b.real - a.real * b.imag) / denom);
14269 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
14270 __pyx_t_float_complex
z;
14275 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
14276 return (a.real == 0) && (a.imag == 0);
14278 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
14279 __pyx_t_float_complex
z;
14285 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex
z) {
14286 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
14287 return sqrtf(
z.real*
z.real +
z.imag*
z.imag);
14289 return hypotf(
z.real,
z.imag);
14292 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
14293 __pyx_t_float_complex
z;
14294 float r, lnr, theta, z_r, z_theta;
14295 if (b.imag == 0 && b.real == (
int)b.real) {
14297 float denom = a.real * a.real + a.imag * a.imag;
14298 a.real = a.real / denom;
14299 a.imag = -a.imag / denom;
14302 switch ((
int)b.real) {
14310 return __Pyx_c_prod_float(a, a);
14312 z = __Pyx_c_prod_float(a, a);
14313 return __Pyx_c_prod_float(
z, a);
14315 z = __Pyx_c_prod_float(a, a);
14316 return __Pyx_c_prod_float(
z,
z);
14322 }
else if ((b.imag == 0) && (a.real >= 0)) {
14323 z.real = powf(a.real, b.real);
14326 }
else if (a.real > 0) {
14331 theta = atan2f(0.0, -1.0);
14334 r = __Pyx_c_abs_float(a);
14335 theta = atan2f(a.imag, a.real);
14338 z_r = expf(lnr * b.real - theta * b.imag);
14339 z_theta = theta * b.real + lnr * b.imag;
14340 z.real = z_r * cosf(z_theta);
14341 z.imag = z_r * sinf(z_theta);
14348#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
14350 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
14351 return ::std::complex< double >(x, y);
14354 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
14355 return x + y*(__pyx_t_double_complex)_Complex_I;
14359 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
14360 __pyx_t_double_complex
z;
14368#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
14370 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
14371 return (a.real == b.real) && (a.imag == b.imag);
14373 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
14374 __pyx_t_double_complex
z;
14375 z.real = a.real + b.real;
14376 z.imag = a.imag + b.imag;
14379 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
14380 __pyx_t_double_complex
z;
14381 z.real = a.real - b.real;
14382 z.imag = a.imag - b.imag;
14385 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
14386 __pyx_t_double_complex
z;
14387 z.real = a.real * b.real - a.imag * b.imag;
14388 z.imag = a.real * b.imag + a.imag * b.real;
14392 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
14394 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
14395 }
else if (fabs(b.real) >= fabs(b.imag)) {
14396 if (b.real == 0 && b.imag == 0) {
14397 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
14399 double r = b.imag / b.real;
14400 double s = (double)(1.0) / (b.real + b.imag *
r);
14401 return __pyx_t_double_complex_from_parts(
14402 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
14405 double r = b.real / b.imag;
14406 double s = (double)(1.0) / (b.imag + b.real *
r);
14407 return __pyx_t_double_complex_from_parts(
14408 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
14412 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
14414 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
14416 double denom = b.real * b.real + b.imag * b.imag;
14417 return __pyx_t_double_complex_from_parts(
14418 (a.real * b.real + a.imag * b.imag) / denom,
14419 (a.imag * b.real - a.real * b.imag) / denom);
14423 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
14424 __pyx_t_double_complex
z;
14429 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
14430 return (a.real == 0) && (a.imag == 0);
14432 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
14433 __pyx_t_double_complex
z;
14439 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex
z) {
14440 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
14441 return sqrt(
z.real*
z.real +
z.imag*
z.imag);
14443 return hypot(
z.real,
z.imag);
14446 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
14447 __pyx_t_double_complex
z;
14448 double r, lnr, theta, z_r, z_theta;
14449 if (b.imag == 0 && b.real == (
int)b.real) {
14451 double denom = a.real * a.real + a.imag * a.imag;
14452 a.real = a.real / denom;
14453 a.imag = -a.imag / denom;
14456 switch ((
int)b.real) {
14464 return __Pyx_c_prod_double(a, a);
14466 z = __Pyx_c_prod_double(a, a);
14467 return __Pyx_c_prod_double(
z, a);
14469 z = __Pyx_c_prod_double(a, a);
14470 return __Pyx_c_prod_double(
z,
z);
14476 }
else if ((b.imag == 0) && (a.real >= 0)) {
14477 z.real = pow(a.real, b.real);
14480 }
else if (a.real > 0) {
14485 theta = atan2(0.0, -1.0);
14488 r = __Pyx_c_abs_double(a);
14489 theta = atan2(a.imag, a.real);
14492 z_r = exp(lnr * b.real - theta * b.imag);
14493 z_theta = theta * b.real + lnr * b.imag;
14494 z.real = z_r * cos(z_theta);
14495 z.imag = z_r * sin(z_theta);
14502#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
14504 static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(
long double x,
long double y) {
14505 return ::std::complex< long double >(x, y);
14508 static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(
long double x,
long double y) {
14509 return x + y*(__pyx_t_long_double_complex)_Complex_I;
14513 static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(
long double x,
long double y) {
14514 __pyx_t_long_double_complex
z;
14522#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
14524 static CYTHON_INLINE
int __Pyx_c_eq_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
14525 return (a.real == b.real) && (a.imag == b.imag);
14527 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_sum_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
14528 __pyx_t_long_double_complex
z;
14529 z.real = a.real + b.real;
14530 z.imag = a.imag + b.imag;
14533 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_diff_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
14534 __pyx_t_long_double_complex
z;
14535 z.real = a.real - b.real;
14536 z.imag = a.imag - b.imag;
14539 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_prod_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
14540 __pyx_t_long_double_complex
z;
14541 z.real = a.real * b.real - a.imag * b.imag;
14542 z.imag = a.real * b.imag + a.imag * b.real;
14546 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
14548 return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
14549 }
else if (fabsl(b.real) >= fabsl(b.imag)) {
14550 if (b.real == 0 && b.imag == 0) {
14551 return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
14553 long double r = b.imag / b.real;
14554 long double s = (
long double)(1.0) / (b.real + b.imag *
r);
14555 return __pyx_t_long_double_complex_from_parts(
14556 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
14559 long double r = b.real / b.imag;
14560 long double s = (
long double)(1.0) / (b.imag + b.real *
r);
14561 return __pyx_t_long_double_complex_from_parts(
14562 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
14566 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
14568 return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
14570 long double denom = b.real * b.real + b.imag * b.imag;
14571 return __pyx_t_long_double_complex_from_parts(
14572 (a.real * b.real + a.imag * b.imag) / denom,
14573 (a.imag * b.real - a.real * b.imag) / denom);
14577 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex a) {
14578 __pyx_t_long_double_complex
z;
14583 static CYTHON_INLINE
int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex a) {
14584 return (a.real == 0) && (a.imag == 0);
14586 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex a) {
14587 __pyx_t_long_double_complex
z;
14593 static CYTHON_INLINE
long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex
z) {
14594 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
14595 return sqrtl(
z.real*
z.real +
z.imag*
z.imag);
14597 return hypotl(
z.real,
z.imag);
14600 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_pow_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
14601 __pyx_t_long_double_complex
z;
14602 long double r, lnr, theta, z_r, z_theta;
14603 if (b.imag == 0 && b.real == (
int)b.real) {
14605 long double denom = a.real * a.real + a.imag * a.imag;
14606 a.real = a.real / denom;
14607 a.imag = -a.imag / denom;
14610 switch ((
int)b.real) {
14618 return __Pyx_c_prod_long__double(a, a);
14620 z = __Pyx_c_prod_long__double(a, a);
14621 return __Pyx_c_prod_long__double(
z, a);
14623 z = __Pyx_c_prod_long__double(a, a);
14624 return __Pyx_c_prod_long__double(
z,
z);
14630 }
else if ((b.imag == 0) && (a.real >= 0)) {
14631 z.real = powl(a.real, b.real);
14634 }
else if (a.real > 0) {
14639 theta = atan2l(0.0, -1.0);
14642 r = __Pyx_c_abs_long__double(a);
14643 theta = atan2l(a.imag, a.real);
14646 z_r = expl(lnr * b.real - theta * b.imag);
14647 z_theta = theta * b.real + lnr * b.imag;
14648 z.real = z_r * cosl(z_theta);
14649 z.imag = z_r * sinl(z_theta);
14656static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(
long value) {
14657#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
14658#pragma GCC diagnostic push
14659#pragma GCC diagnostic ignored "-Wconversion"
14661 const long neg_one = (long) -1, const_zero = (
long) 0;
14662#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
14663#pragma GCC diagnostic pop
14665 const int is_unsigned = neg_one > const_zero;
14667 if (
sizeof(
long) <
sizeof(
long)) {
14668 return PyLong_FromLong((
long) value);
14669 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
14670 return PyLong_FromUnsignedLong((
unsigned long) value);
14671#if !CYTHON_COMPILING_IN_PYPY
14672 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
14673 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
14677 if (
sizeof(
long) <=
sizeof(
long)) {
14678 return PyLong_FromLong((
long) value);
14679 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
14680 return PyLong_FromLongLong((PY_LONG_LONG) value);
14684 unsigned char *bytes = (
unsigned char *)&value;
14685#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
14687 return PyLong_FromUnsignedNativeBytes(bytes,
sizeof(value), -1);
14689 return PyLong_FromNativeBytes(bytes,
sizeof(value), -1);
14691#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
14692 int one = 1;
int little = (int)*(
unsigned char *)&one;
14693 return _PyLong_FromByteArray(bytes,
sizeof(
long),
14694 little, !is_unsigned);
14696 int one = 1;
int little = (int)*(
unsigned char *)&one;
14697 PyObject *result = NULL, *kwds = NULL;
14698 PyObject *py_bytes = NULL, *order_str = NULL, *from_bytes_str = NULL;;
14699 py_bytes = PyBytes_FromStringAndSize((
char*)bytes,
sizeof(
long));
14700 if (!py_bytes)
goto limited_bad;
14701 from_bytes_str = PyUnicode_FromStringAndSize(
"from_bytes", 10);
14702 if (!from_bytes_str)
goto limited_bad;
14703 order_str = PyUnicode_FromString(little ?
"little" :
"big");
14704 if (!order_str)
goto limited_bad;
14706 PyObject *args[] = { (PyObject*)&PyLong_Type, py_bytes, order_str, Py_True };
14707 if (!is_unsigned) {
14708 PyObject *signed_str = PyUnicode_FromStringAndSize(
"signed", 6);
14709 if (!signed_str)
goto limited_bad;
14710#if CYTHON_VECTORCALL
14711 kwds = PyTuple_Pack(1, signed_str);
14714 PyObject *keys[] = {signed_str};
14715 PyObject *values[] = {Py_True};
14716 kwds = __Pyx_MakeKwargDict(keys, values, 1);
14719 Py_DECREF(signed_str);
14720 if (unlikely(!kwds))
goto limited_bad;
14722 result = __Pyx_Object_VectorcallMethodKwds(from_bytes_str, args, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
14726 Py_XDECREF(order_str);
14727 Py_XDECREF(py_bytes);
14728 Py_XDECREF(from_bytes_str);
14735#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
14736 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
14737#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
14738 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
14739#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
14741 func_type value = func_value;\
14742 if (sizeof(target_type) < sizeof(func_type)) {\
14743 if (unlikely(value != (func_type) (target_type) value)) {\
14744 func_type zero = 0;\
14745 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
14746 return (target_type) -1;\
14747 if (is_unsigned && unlikely(value < zero))\
14748 goto raise_neg_overflow;\
14750 goto raise_overflow;\
14753 return (target_type) value;\
14757static long __Pyx_LargePyLong___Pyx_PyLong_As_long(PyObject *x);
14758static long __Pyx_raise_neg_overflow___Pyx_PyLong_As_long(
void) {
14759 const char* type_name =
"long";
14760 PyErr_Format(PyExc_OverflowError,
14761 "can't convert negative value to %.200s", type_name);
14764static long __Pyx_raise_overflow___Pyx_PyLong_As_long(
void) {
14765 const char* type_name =
"long";
14766 PyErr_Format(PyExc_OverflowError,
14767 "value too large to convert to %.200s", type_name);
14770static CYTHON_INLINE
long __Pyx_PyULong___Pyx_PyLong_As_long(PyObject *x) {
14771 const int is_unsigned = 1;
14772#if CYTHON_USE_PYLONG_INTERNALS
14774 const digit* digits = __Pyx_PyLong_Digits(x);
14775 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
14776 if (size == 2 && (8 *
sizeof(
long) > 1 * PyLong_SHIFT)) {
14777 if ((8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT)) {
14778 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
14779 }
else if ((8 *
sizeof(
long) >= 2 * PyLong_SHIFT)) {
14780 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
14783 if (size == 3 && (8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
14784 if ((8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT)) {
14785 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
14786 }
else if ((8 *
sizeof(
long) >= 3 * PyLong_SHIFT)) {
14787 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
14790 if (size == 4 && (8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
14791 if ((8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT)) {
14792 __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])))
14793 }
else if ((8 *
sizeof(
long) >= 4 * PyLong_SHIFT)) {
14794 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
14799#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
14800 if (unlikely(Py_SIZE(x) < 0)) {
14801 goto raise_neg_overflow;
14805 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
14806 if (unlikely(result < 0))
14808 if (unlikely(result == 1))
14809 goto raise_neg_overflow;
14812 if ((
sizeof(
long) <=
sizeof(
unsigned long))) {
14813 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
14814 }
else if ((
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG))) {
14815 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
14817 return __Pyx_LargePyLong___Pyx_PyLong_As_long(x);
14819 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
14821 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
14823static CYTHON_INLINE
long __Pyx_PySLong___Pyx_PyLong_As_long(PyObject *x) {
14824 const int is_unsigned = 0;
14825#if CYTHON_USE_PYLONG_INTERNALS
14826 if (__Pyx_PyLong_IsNeg(x)) {
14827 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
14828 const digit* digits = __Pyx_PyLong_Digits(x);
14829 if (size == 2 && (8 *
sizeof(
long) > 1 * PyLong_SHIFT)) {
14830 if ((8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
14831 long ival = - (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
14832 __PYX_VERIFY_RETURN_INT(
long,
long, ival)
14833 }
else if ((8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT)) {
14834 return (
long) (((long) -1) * (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
14837 if (size == 3 && (8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
14838 if ((8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
14839 long ival = - (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
14840 __PYX_VERIFY_RETURN_INT(
long,
long, ival)
14841 }
else if ((8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT)) {
14842 return (
long) (((long) -1) * (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
14845 if (size == 4 && (8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
14846 if ((8 *
sizeof(
long) > 4 * PyLong_SHIFT)) {
14847 long ival = - (long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
14848 __PYX_VERIFY_RETURN_INT(
long,
long, ival)
14849 }
else if ((8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT)) {
14850 return (
long) (((long) -1) * (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
14855 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
14856 const digit* digits = __Pyx_PyLong_Digits(x);
14857 if (size == 2 && (8 *
sizeof(
long) > 1 * PyLong_SHIFT)) {
14858 if ((8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
14859 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
14860 }
else if ((8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT)) {
14861 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
14864 if (size == 3 && (8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
14865 if ((8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
14866 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
14867 }
else if ((8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT)) {
14868 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
14871 if (size == 4 && (8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
14872 if ((8 *
sizeof(
long) > 4 * PyLong_SHIFT)) {
14873 __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])))
14874 }
else if ((8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT)) {
14875 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
14881 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
14882 if ((
sizeof(
long) <=
sizeof(
int)) && (
sizeof(
int) <
sizeof(
long))) {
14883 __PYX_VERIFY_RETURN_INT_EXC(
long,
int, PyLong_AsInt(x))
14886 if ((
sizeof(
long) <=
sizeof(
long))) {
14887 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
14888 }
else if ((
sizeof(
long) <=
sizeof(PY_LONG_LONG))) {
14889 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
14891 return __Pyx_LargePyLong___Pyx_PyLong_As_long(x);
14893 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
14895 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
14897static long __Pyx_LargePyLong___Pyx_PyLong_As_long(PyObject *x) {
14898#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
14899#pragma GCC diagnostic push
14900#pragma GCC diagnostic ignored "-Wconversion"
14902 const long neg_one = (long) -1, const_zero = (
long) 0;
14903#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
14904#pragma GCC diagnostic pop
14906 const int is_unsigned = neg_one > const_zero;
14909#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
14910 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
14911 x, &val,
sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
14912 if (unlikely(bytes_copied == -1)) {
14913 }
else if (unlikely(bytes_copied > (Py_ssize_t)
sizeof(val))) {
14914 goto raise_overflow;
14918#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
14919 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
14920 unsigned char *bytes = (
unsigned char *)&val;
14921 ret = _PyLong_AsByteArray((PyLongObject *)x,
14922 bytes,
sizeof(val),
14923 is_little, !is_unsigned);
14924 if ((0))
goto raise_overflow;
14927 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
14928 int bits, remaining_bits, is_negative = 0;
14929 int chunk_size = (
sizeof(long) < 8) ? 30 : 62;
14930 if (likely(PyLong_CheckExact(x))) {
14931 v = __Pyx_NewRef(x);
14933 v = PyNumber_Long(x);
14934 if (unlikely(!
v))
return (
long) -1;
14935 assert(PyLong_CheckExact(
v));
14938 int result = PyObject_RichCompareBool(
v, Py_False, Py_LT);
14939 if (unlikely(result < 0)) {
14943 is_negative = result == 1;
14945 if (is_unsigned && unlikely(is_negative)) {
14947 PyErr_SetString(PyExc_OverflowError,
14948 "can't convert negative value to long");
14950 }
else if (is_negative) {
14951 stepval = PyNumber_Invert(
v);
14953 if (unlikely(!stepval))
14960 mask = PyLong_FromLong((1L << chunk_size) - 1);
if (unlikely(!mask))
goto done;
14961 shift = PyLong_FromLong(chunk_size);
if (unlikely(!shift))
goto done;
14962 for (bits = 0; bits < (int)
sizeof(long) * 8 - chunk_size; bits += chunk_size) {
14963 PyObject *tmp, *digit;
14965 digit = PyNumber_And(stepval, mask);
14966 if (unlikely(!digit))
goto done;
14967 idigit = PyLong_AsLong(digit);
14969 if (unlikely(idigit < 0))
goto done;
14970 val |= ((long) idigit) << bits;
14971 tmp = PyNumber_Rshift(stepval, shift);
14972 if (unlikely(!tmp))
goto done;
14973 Py_DECREF(stepval); stepval = tmp;
14975 Py_DECREF(shift); shift = NULL;
14976 Py_DECREF(mask); mask = NULL;
14978 long idigit = PyLong_AsLong(stepval);
14979 if (unlikely(idigit < 0))
goto done;
14980 remaining_bits = ((int)
sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
14981 if (unlikely(idigit >= (1L << remaining_bits)))
14982 goto raise_overflow;
14983 val |= ((long) idigit) << bits;
14985 if (!is_unsigned) {
14986 if (unlikely(val & (((
long) 1) << (
sizeof(
long) * 8 - 1))))
14987 goto raise_overflow;
14995 Py_XDECREF(stepval);
15001 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
15003static CYTHON_INLINE
long __Pyx_PyLong___Pyx_PyLong_As_long(PyObject *x) {
15004#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
15005#pragma GCC diagnostic push
15006#pragma GCC diagnostic ignored "-Wconversion"
15008 const long neg_one = (long) -1, const_zero = (
long) 0;
15009#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
15010#pragma GCC diagnostic pop
15012 const int is_unsigned = neg_one > const_zero;
15014 #if CYTHON_USE_PYLONG_INTERNALS
15015 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
15016 goto raise_neg_overflow;
15017 }
else if (__Pyx_PyLong_IsCompact(x)) {
15018 __PYX_VERIFY_RETURN_INT(
long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
15022 return __Pyx_PyULong___Pyx_PyLong_As_long(x);
15025 #if CYTHON_USE_PYLONG_INTERNALS
15026 if (__Pyx_PyLong_IsCompact(x)) {
15027 __PYX_VERIFY_RETURN_INT(
long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
15031 return __Pyx_PySLong___Pyx_PyLong_As_long(x);
15034#if CYTHON_USE_PYLONG_INTERNALS
15036 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
15038 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
15041static long __Pyx_NonPyLong___Pyx_PyLong_As_long(PyObject *x) {
15043 PyObject *tmp = __Pyx_PyNumber_Long(x);
15044 if (!tmp)
return (
long) -1;
15045 val = __Pyx_PyLong_As_long(tmp);
15049static CYTHON_INLINE
long __Pyx_PyLong_As_long(PyObject *x) {
15050 if (likely(PyLong_Check(x))) {
15051 return __Pyx_PyLong___Pyx_PyLong_As_long(x);
15053 return __Pyx_NonPyLong___Pyx_PyLong_As_long(x);
15058static int __Pyx_LargePyLong___Pyx_PyLong_As_int(PyObject *x);
15059static int __Pyx_raise_neg_overflow___Pyx_PyLong_As_int(
void) {
15060 const char* type_name =
"int";
15061 PyErr_Format(PyExc_OverflowError,
15062 "can't convert negative value to %.200s", type_name);
15065static int __Pyx_raise_overflow___Pyx_PyLong_As_int(
void) {
15066 const char* type_name =
"int";
15067 PyErr_Format(PyExc_OverflowError,
15068 "value too large to convert to %.200s", type_name);
15071static CYTHON_INLINE
int __Pyx_PyULong___Pyx_PyLong_As_int(PyObject *x) {
15072 const int is_unsigned = 1;
15073#if CYTHON_USE_PYLONG_INTERNALS
15075 const digit* digits = __Pyx_PyLong_Digits(x);
15076 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
15077 if (size == 2 && (8 *
sizeof(
int) > 1 * PyLong_SHIFT)) {
15078 if ((8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT)) {
15079 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
15080 }
else if ((8 *
sizeof(
int) >= 2 * PyLong_SHIFT)) {
15081 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
15084 if (size == 3 && (8 *
sizeof(
int) > 2 * PyLong_SHIFT)) {
15085 if ((8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT)) {
15086 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
15087 }
else if ((8 *
sizeof(
int) >= 3 * PyLong_SHIFT)) {
15088 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
15091 if (size == 4 && (8 *
sizeof(
int) > 3 * PyLong_SHIFT)) {
15092 if ((8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT)) {
15093 __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])))
15094 }
else if ((8 *
sizeof(
int) >= 4 * PyLong_SHIFT)) {
15095 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
15100#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
15101 if (unlikely(Py_SIZE(x) < 0)) {
15102 goto raise_neg_overflow;
15106 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
15107 if (unlikely(result < 0))
15109 if (unlikely(result == 1))
15110 goto raise_neg_overflow;
15113 if ((
sizeof(
int) <=
sizeof(
unsigned long))) {
15114 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
15115 }
else if ((
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG))) {
15116 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
15118 return __Pyx_LargePyLong___Pyx_PyLong_As_int(x);
15120 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
15122 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
15124static CYTHON_INLINE
int __Pyx_PySLong___Pyx_PyLong_As_int(PyObject *x) {
15125 const int is_unsigned = 0;
15126#if CYTHON_USE_PYLONG_INTERNALS
15127 if (__Pyx_PyLong_IsNeg(x)) {
15128 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
15129 const digit* digits = __Pyx_PyLong_Digits(x);
15130 if (size == 2 && (8 *
sizeof(
int) > 1 * PyLong_SHIFT)) {
15131 if ((8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
15132 long ival = - (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
15133 __PYX_VERIFY_RETURN_INT(
int,
long, ival)
15134 }
else if ((8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT)) {
15135 return (
int) (((int) -1) * (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
15138 if (size == 3 && (8 *
sizeof(
int) > 2 * PyLong_SHIFT)) {
15139 if ((8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
15140 long ival = - (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
15141 __PYX_VERIFY_RETURN_INT(
int,
long, ival)
15142 }
else if ((8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT)) {
15143 return (
int) (((int) -1) * (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
15146 if (size == 4 && (8 *
sizeof(
int) > 3 * PyLong_SHIFT)) {
15147 if ((8 *
sizeof(
long) > 4 * PyLong_SHIFT)) {
15148 long ival = - (long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
15149 __PYX_VERIFY_RETURN_INT(
int,
long, ival)
15150 }
else if ((8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT)) {
15151 return (
int) (((int) -1) * (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
15156 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
15157 const digit* digits = __Pyx_PyLong_Digits(x);
15158 if (size == 2 && (8 *
sizeof(
int) > 1 * PyLong_SHIFT)) {
15159 if ((8 *
sizeof(
long) > 2 * PyLong_SHIFT)) {
15160 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
15161 }
else if ((8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT)) {
15162 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
15165 if (size == 3 && (8 *
sizeof(
int) > 2 * PyLong_SHIFT)) {
15166 if ((8 *
sizeof(
long) > 3 * PyLong_SHIFT)) {
15167 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
15168 }
else if ((8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT)) {
15169 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
15172 if (size == 4 && (8 *
sizeof(
int) > 3 * PyLong_SHIFT)) {
15173 if ((8 *
sizeof(
long) > 4 * PyLong_SHIFT)) {
15174 __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])))
15175 }
else if ((8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT)) {
15176 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
15182 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
15183 if ((
sizeof(
int) <=
sizeof(
int)) && (
sizeof(
int) <
sizeof(
long))) {
15184 __PYX_VERIFY_RETURN_INT_EXC(
int,
int, PyLong_AsInt(x))
15187 if ((
sizeof(
int) <=
sizeof(
long))) {
15188 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
15189 }
else if ((
sizeof(
int) <=
sizeof(PY_LONG_LONG))) {
15190 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
15192 return __Pyx_LargePyLong___Pyx_PyLong_As_int(x);
15194 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
15196 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
15198static int __Pyx_LargePyLong___Pyx_PyLong_As_int(PyObject *x) {
15199#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
15200#pragma GCC diagnostic push
15201#pragma GCC diagnostic ignored "-Wconversion"
15203 const int neg_one = (int) -1, const_zero = (
int) 0;
15204#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
15205#pragma GCC diagnostic pop
15207 const int is_unsigned = neg_one > const_zero;
15210#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
15211 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
15212 x, &val,
sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
15213 if (unlikely(bytes_copied == -1)) {
15214 }
else if (unlikely(bytes_copied > (Py_ssize_t)
sizeof(val))) {
15215 goto raise_overflow;
15219#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
15220 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
15221 unsigned char *bytes = (
unsigned char *)&val;
15222 ret = _PyLong_AsByteArray((PyLongObject *)x,
15223 bytes,
sizeof(val),
15224 is_little, !is_unsigned);
15225 if ((0))
goto raise_overflow;
15228 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
15229 int bits, remaining_bits, is_negative = 0;
15230 int chunk_size = (
sizeof(long) < 8) ? 30 : 62;
15231 if (likely(PyLong_CheckExact(x))) {
15232 v = __Pyx_NewRef(x);
15234 v = PyNumber_Long(x);
15235 if (unlikely(!
v))
return (
int) -1;
15236 assert(PyLong_CheckExact(
v));
15239 int result = PyObject_RichCompareBool(
v, Py_False, Py_LT);
15240 if (unlikely(result < 0)) {
15244 is_negative = result == 1;
15246 if (is_unsigned && unlikely(is_negative)) {
15248 PyErr_SetString(PyExc_OverflowError,
15249 "can't convert negative value to int");
15251 }
else if (is_negative) {
15252 stepval = PyNumber_Invert(
v);
15254 if (unlikely(!stepval))
15261 mask = PyLong_FromLong((1L << chunk_size) - 1);
if (unlikely(!mask))
goto done;
15262 shift = PyLong_FromLong(chunk_size);
if (unlikely(!shift))
goto done;
15263 for (bits = 0; bits < (int)
sizeof(int) * 8 - chunk_size; bits += chunk_size) {
15264 PyObject *tmp, *digit;
15266 digit = PyNumber_And(stepval, mask);
15267 if (unlikely(!digit))
goto done;
15268 idigit = PyLong_AsLong(digit);
15270 if (unlikely(idigit < 0))
goto done;
15271 val |= ((int) idigit) << bits;
15272 tmp = PyNumber_Rshift(stepval, shift);
15273 if (unlikely(!tmp))
goto done;
15274 Py_DECREF(stepval); stepval = tmp;
15276 Py_DECREF(shift); shift = NULL;
15277 Py_DECREF(mask); mask = NULL;
15279 long idigit = PyLong_AsLong(stepval);
15280 if (unlikely(idigit < 0))
goto done;
15281 remaining_bits = ((int)
sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
15282 if (unlikely(idigit >= (1L << remaining_bits)))
15283 goto raise_overflow;
15284 val |= ((int) idigit) << bits;
15286 if (!is_unsigned) {
15287 if (unlikely(val & (((
int) 1) << (
sizeof(
int) * 8 - 1))))
15288 goto raise_overflow;
15296 Py_XDECREF(stepval);
15302 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
15304static CYTHON_INLINE
int __Pyx_PyLong___Pyx_PyLong_As_int(PyObject *x) {
15305#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
15306#pragma GCC diagnostic push
15307#pragma GCC diagnostic ignored "-Wconversion"
15309 const int neg_one = (int) -1, const_zero = (
int) 0;
15310#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
15311#pragma GCC diagnostic pop
15313 const int is_unsigned = neg_one > const_zero;
15315 #if CYTHON_USE_PYLONG_INTERNALS
15316 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
15317 goto raise_neg_overflow;
15318 }
else if (__Pyx_PyLong_IsCompact(x)) {
15319 __PYX_VERIFY_RETURN_INT(
int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
15323 return __Pyx_PyULong___Pyx_PyLong_As_int(x);
15326 #if CYTHON_USE_PYLONG_INTERNALS
15327 if (__Pyx_PyLong_IsCompact(x)) {
15328 __PYX_VERIFY_RETURN_INT(
int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
15332 return __Pyx_PySLong___Pyx_PyLong_As_int(x);
15335#if CYTHON_USE_PYLONG_INTERNALS
15337 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
15339 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
15342static int __Pyx_NonPyLong___Pyx_PyLong_As_int(PyObject *x) {
15344 PyObject *tmp = __Pyx_PyNumber_Long(x);
15345 if (!tmp)
return (
int) -1;
15346 val = __Pyx_PyLong_As_int(tmp);
15350static CYTHON_INLINE
int __Pyx_PyLong_As_int(PyObject *x) {
15351 if (likely(PyLong_Check(x))) {
15352 return __Pyx_PyLong___Pyx_PyLong_As_int(x);
15354 return __Pyx_NonPyLong___Pyx_PyLong_As_int(x);
15359#if __PYX_LIMITED_VERSION_HEX < 0x030b0000
15360void __Pyx_init_runtime_version(
void) {
15361 if (__Pyx_cached_runtime_version == 0) {
15362 const char* rt_version = Py_GetVersion();
15363 unsigned long version = 0;
15364 unsigned long factor = 0x01000000UL;
15365 unsigned int digit = 0;
15368 while (
'0' <= rt_version[i] && rt_version[i] <=
'9') {
15369 digit = digit * 10 + (
unsigned int) (rt_version[i] -
'0');
15372 version += factor * digit;
15373 if (rt_version[i] !=
'.')
15379 __Pyx_cached_runtime_version = version;
15383static unsigned long __Pyx_get_runtime_version(
void) {
15384#if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
15385 return Py_Version & ~0xFFUL;
15387 return __Pyx_cached_runtime_version;
15392static int __Pyx_check_binary_version(
unsigned long ct_version,
unsigned long rt_version,
int allow_newer) {
15393 const unsigned long MAJOR_MINOR = 0xFFFF0000UL;
15394 if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR))
15396 if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
15400 PyOS_snprintf(message,
sizeof(message),
15401 "compile time Python version %d.%d "
15402 "of module '%.100s' "
15404 "runtime version %d.%d",
15405 (
int) (ct_version >> 24), (
int) ((ct_version >> 16) & 0xFF),
15407 (allow_newer) ?
"was newer than" :
"does not match",
15408 (
int) (rt_version >> 24), (
int) ((rt_version >> 16) & 0xFF)
15410 return PyErr_WarnEx(NULL, message, 1);
15415#if CYTHON_COMPILING_IN_LIMITED_API
15416 static PyObject* __Pyx__PyCode_New(
int a,
int p,
int k,
int l,
int s,
int f,
15417 PyObject *code, PyObject *
c, PyObject*
n, PyObject *
v,
15418 PyObject *fv, PyObject *cell, PyObject* fn,
15419 PyObject *name,
int fline, PyObject *lnos) {
15420 PyObject *exception_table = NULL;
15421 PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
15422 #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
15423 PyObject *version_info;
15424 PyObject *py_minor_version = NULL;
15426 long minor_version = 0;
15427 #if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
15428 minor_version = 11;
15430 if (!(version_info = PySys_GetObject(
"version_info")))
goto end;
15431 if (!(py_minor_version = PySequence_GetItem(version_info, 1)))
goto end;
15432 minor_version = PyLong_AsLong(py_minor_version);
15433 Py_DECREF(py_minor_version);
15434 if (minor_version == -1 && PyErr_Occurred())
goto end;
15436 if (!(types_module = PyImport_ImportModule(
"types")))
goto end;
15437 if (!(code_type = PyObject_GetAttrString(types_module,
"CodeType")))
goto end;
15438 if (minor_version <= 10) {
15439 result = PyObject_CallFunction(code_type,
"iiiiiiOOOOOOiOOO", a,p, k, l,
s,
f, code,
15440 c,
n,
v, fn, name, fline, lnos, fv, cell);
15442 if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0)))
goto end;
15443 result = PyObject_CallFunction(code_type,
"iiiiiiOOOOOOOiOOOO", a,p, k, l,
s,
f, code,
15444 c,
n,
v, fn, name, name, fline, lnos, exception_table, fv, cell);
15447 Py_XDECREF(code_type);
15448 Py_XDECREF(exception_table);
15449 Py_XDECREF(types_module);
15451 PyObject *exc_type, *exc_value, *exc_tb;
15452 PyErr_Fetch(&exc_type, &exc_value, &exc_tb);
15453 if (PyErr_WarnFormat(
15454 PyExc_RuntimeWarning, 1,
15455 "Code object creation failed in Cython module: %S\nTry recompiling with a more recent version of Cython.",
15456 exc_value ? exc_value : exc_type) == 0) {
15460 Py_DECREF(exc_type);
15461 Py_XDECREF(exc_value);
15462 Py_XDECREF(exc_tb);
15466#elif PY_VERSION_HEX >= 0x030B0000
15467 static PyCodeObject* __Pyx__PyCode_New(
int a,
int p,
int k,
int l,
int s,
int f,
15468 PyObject *code, PyObject *
c, PyObject*
n, PyObject *
v,
15469 PyObject *fv, PyObject *cell, PyObject* fn,
15470 PyObject *name,
int fline, PyObject *lnos) {
15471 PyCodeObject *result;
15473 #if PY_VERSION_HEX >= 0x030C0000
15474 PyUnstable_Code_NewWithPosOnlyArgs
15476 PyCode_NewWithPosOnlyArgs
15478 (a, p, k, l,
s,
f, code,
c,
n,
v, fv, cell, fn, name, name, fline, lnos, __pyx_mstate_global->__pyx_empty_bytes);
15479 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030c00A1
15480 if (likely(result))
15481 result->_co_firsttraceable = 0;
15485#elif !CYTHON_COMPILING_IN_PYPY
15486 #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
15487 PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
15489 #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
15490 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
15492static PyObject* __Pyx_PyCode_New(
15493 const __Pyx_PyCode_New_function_description descr,
15494 PyObject *
const *varnames,
15495 PyObject *filename,
15496 PyObject *funcname,
15497 PyObject *line_table,
15498 PyObject *tuple_dedup_map
15500 PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL;
15501 Py_ssize_t var_count = (Py_ssize_t) descr.nlocals;
15502 PyObject *varnames_tuple = PyTuple_New(var_count);
15503 if (unlikely(!varnames_tuple))
return NULL;
15504 for (Py_ssize_t i=0; i < var_count; i++) {
15505 Py_INCREF(varnames[i]);
15506 if (__Pyx_PyTuple_SET_ITEM(varnames_tuple, i, varnames[i]) != (0))
goto done;
15508 #if CYTHON_COMPILING_IN_LIMITED_API
15509 varnames_tuple_dedup = PyDict_GetItem(tuple_dedup_map, varnames_tuple);
15510 if (!varnames_tuple_dedup) {
15511 if (unlikely(PyDict_SetItem(tuple_dedup_map, varnames_tuple, varnames_tuple) < 0))
goto done;
15512 varnames_tuple_dedup = varnames_tuple;
15515 varnames_tuple_dedup = PyDict_SetDefault(tuple_dedup_map, varnames_tuple, varnames_tuple);
15516 if (unlikely(!varnames_tuple_dedup))
goto done;
15518 #if CYTHON_AVOID_BORROWED_REFS
15519 Py_INCREF(varnames_tuple_dedup);
15521 if (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table != NULL && !CYTHON_COMPILING_IN_GRAAL) {
15522 Py_ssize_t line_table_length = __Pyx_PyBytes_GET_SIZE(line_table);
15523 #if !CYTHON_ASSUME_SAFE_SIZE
15524 if (unlikely(line_table_length == -1))
goto done;
15526 Py_ssize_t code_len = (line_table_length * 2 + 4) & ~3LL;
15527 code_bytes = PyBytes_FromStringAndSize(NULL, code_len);
15528 if (unlikely(!code_bytes))
goto done;
15529 char* c_code_bytes = PyBytes_AsString(code_bytes);
15530 if (unlikely(!c_code_bytes))
goto done;
15531 memset(c_code_bytes, 0, (
size_t) code_len);
15533 code_obj = (PyObject*) __Pyx__PyCode_New(
15534 (
int) descr.argcount,
15535 (
int) descr.num_posonly_args,
15536 (
int) descr.num_kwonly_args,
15537 (
int) descr.nlocals,
15540 code_bytes ? code_bytes : __pyx_mstate_global->__pyx_empty_bytes,
15541 __pyx_mstate_global->__pyx_empty_tuple,
15542 __pyx_mstate_global->__pyx_empty_tuple,
15543 varnames_tuple_dedup,
15544 __pyx_mstate_global->__pyx_empty_tuple,
15545 __pyx_mstate_global->__pyx_empty_tuple,
15548 (
int) descr.first_line,
15549 (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table) ? line_table : __pyx_mstate_global->__pyx_empty_bytes
15552 Py_XDECREF(code_bytes);
15553 #if CYTHON_AVOID_BORROWED_REFS
15554 Py_XDECREF(varnames_tuple_dedup);
15556 Py_DECREF(varnames_tuple);
15562static CYTHON_SMALL_CODE PyObject *__Pyx_DecompressString(
const char *
s, Py_ssize_t length,
int algo) {
15563#ifdef __Pyx_DecompressString_UNUSED
15564 CYTHON_UNUSED_VAR(
s);
15565 CYTHON_UNUSED_VAR(length);
15566 CYTHON_UNUSED_VAR(algo);
15569 PyObject *module = NULL, *decompress, *compressed_bytes, *decompressed;
15570 const char* module_name = algo == 3 ?
"compression.zstd" : algo == 2 ?
"bz2" :
"zlib";
15571 PyObject *methodname = PyUnicode_FromString(
"decompress");
15572 if (unlikely(!methodname))
return NULL;
15573 #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
15575 PyObject *fromlist = Py_BuildValue(
"[O]", methodname);
15576 if (unlikely(!fromlist))
goto bad;
15577 module = PyImport_ImportModuleLevel("compression.zstd", NULL, NULL, fromlist, 0);
15578 Py_DECREF(fromlist);
15581 module = PyImport_ImportModule(module_name);
15582 if (unlikely(!module))
goto import_failed;
15583 decompress = PyObject_GetAttr(module, methodname);
15584 if (unlikely(!decompress))
goto import_failed;
15587 char *memview_bytes =
const_cast<char*
>(
s);
15589 #if defined(__clang__)
15590 #pragma clang diagnostic push
15591 #pragma clang diagnostic ignored "-Wcast-qual"
15592 #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
15593 #pragma GCC diagnostic push
15594 #pragma GCC diagnostic ignored "-Wcast-qual"
15596 char *memview_bytes = (
char*)
s;
15597 #if defined(__clang__)
15598 #pragma clang diagnostic pop
15599 #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
15600 #pragma GCC diagnostic pop
15603 #if CYTHON_COMPILING_IN_LIMITED_API && !defined(PyBUF_READ)
15604 int memview_flags = 0x100;
15606 int memview_flags = PyBUF_READ;
15608 compressed_bytes = PyMemoryView_FromMemory(memview_bytes, length, memview_flags);
15610 if (unlikely(!compressed_bytes)) {
15611 Py_DECREF(decompress);
15614 decompressed = PyObject_CallFunctionObjArgs(decompress, compressed_bytes, NULL);
15615 Py_DECREF(compressed_bytes);
15616 Py_DECREF(decompress);
15618 Py_DECREF(methodname);
15619 return decompressed;
15621 PyErr_Format(PyExc_ImportError,
15622 "Failed to import '%.20s.decompress' - cannot initialise module strings. "
15623 "String compression was configured with the C macro 'CYTHON_COMPRESS_STRINGS=%d'.",
15624 module_name, algo);
15626 Py_XDECREF(module);
15627 Py_DECREF(methodname);
15633#ifndef __Pyx_DecompressString_LZSS_UNUSED
15635static CYTHON_SMALL_CODE
size_t __pyx_lzss_decompress(
const uint8_t* src, uint8_t* dst,
size_t dst_len) {
15636 size_t pos = 0, out_pos = 0;
15638 uint32_t flags = src[pos++] | 0xFF00;
15639 while (flags & 0x100) {
15641 dst[out_pos++] = src[pos++];
15643 uint32_t lo = src[pos++], hi = src[pos++];
15644 uint32_t end_offset_of_last_occurrence, match_length;
15645 if (!(lo & 0x80)) {
15646 end_offset_of_last_occurrence = lo;
15648 }
else if (!(hi & 0x80)) {
15649 end_offset_of_last_occurrence = 0x80 + (((hi << 2) & 0x180) | (lo & 0x7F));
15650 match_length = hi & 0x1F;
15652 end_offset_of_last_occurrence = 0x80 + ((hi & 0x7F) << 7 | (lo & 0x7F));
15653 match_length = src[pos++];
15656 size_t ref_pos = out_pos - end_offset_of_last_occurrence - match_length;
15657 memcpy(dst + out_pos, dst + ref_pos, match_length);
15658 out_pos += match_length;
15660 if (out_pos >= dst_len)
return pos;
15666static CYTHON_SMALL_CODE PyObject *__Pyx_DecompressString_LZSS(
const char *
s,
size_t compressed_length,
size_t uncompressed_length) {
15667#ifdef __Pyx_DecompressString_LZSS_UNUSED
15668 CYTHON_UNUSED_VAR(
s);
15669 CYTHON_UNUSED_VAR(compressed_length);
15670 CYTHON_UNUSED_VAR(uncompressed_length);
15674 unsigned char *result_data;
15676 result = PyBytes_FromStringAndSize(NULL, (Py_ssize_t) uncompressed_length);
15677 if (unlikely(!result))
return NULL;
15678 result_data = __Pyx_PyBytes_AsWritableUString(result);
15679 if (unlikely(!result_data))
goto bad;
15680 src_length = __pyx_lzss_decompress((
const uint8_t*)
s, result_data, uncompressed_length);
15681 if (unlikely(src_length != compressed_length))
goto decompression_failed;
15683decompression_failed:
15684 PyErr_SetString(PyExc_RuntimeError,
"LZSS string data decompression failed");
15692static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(
const char *
s) {
15693 size_t len = strlen(
s);
15694 if (unlikely(len > (
size_t) PY_SSIZE_T_MAX)) {
15695 PyErr_SetString(PyExc_OverflowError,
"byte string is too long");
15698 return (Py_ssize_t) len;
15700static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
15701 Py_ssize_t len = __Pyx_ssize_strlen(c_str);
15702 if (unlikely(len < 0))
return NULL;
15703 return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
15705static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(
const char* c_str) {
15706 Py_ssize_t len = __Pyx_ssize_strlen(c_str);
15707 if (unlikely(len < 0))
return NULL;
15708 return PyByteArray_FromStringAndSize(c_str, len);
15710static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
15712 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
15714#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
15715static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
15716 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
15717#if CYTHON_COMPILING_IN_LIMITED_API
15719 const char* result;
15720 Py_ssize_t unicode_length;
15721 CYTHON_MAYBE_UNUSED_VAR(unicode_length);
15722 #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
15723 if (unlikely(PyArg_Parse(o,
"s#", &result, length) < 0))
return NULL;
15725 result = PyUnicode_AsUTF8AndSize(o, length);
15727 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
15728 unicode_length = PyUnicode_GetLength(o);
15729 if (unlikely(unicode_length < 0))
return NULL;
15730 if (unlikely(unicode_length != *length)) {
15731 PyUnicode_AsASCIIString(o);
15738#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
15739 if (likely(PyUnicode_IS_ASCII(o))) {
15740 *length = PyUnicode_GET_LENGTH(o);
15741 return PyUnicode_AsUTF8(o);
15743 PyUnicode_AsASCIIString(o);
15747 return PyUnicode_AsUTF8AndSize(o, length);
15752static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
15753#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
15754 if (PyUnicode_Check(o)) {
15755 return __Pyx_PyUnicode_AsStringAndSize(o, length);
15758 if (PyByteArray_Check(o)) {
15759#if (CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) || (CYTHON_COMPILING_IN_PYPY && (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)))
15760 *length = PyByteArray_GET_SIZE(o);
15761 return PyByteArray_AS_STRING(o);
15763 *length = PyByteArray_Size(o);
15764 if (*length == -1)
return NULL;
15765 return PyByteArray_AsString(o);
15770 int r = PyBytes_AsStringAndSize(o, &result, length);
15771 if (unlikely(
r < 0)) {
15778static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
15779 int is_true = x == Py_True;
15780 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
15781 else return PyObject_IsTrue(x);
15783static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
15785 if (unlikely(!x))
return -1;
15786 retval = __Pyx_PyObject_IsTrue(x);
15790static PyObject* __Pyx_PyNumber_LongWrongResultType(PyObject* result) {
15791 __Pyx_TypeName result_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(result));
15792 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
15793 if (unlikely(!result_type_name))
goto bad;
15795 if (PyLong_Check(result)) {
15796 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
15797 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME
"). "
15798 "The ability to return an instance of a strict subclass of int is deprecated, "
15799 "and may be removed in a future version of Python.",
15800 result_type_name)) {
15801 __Pyx_DECREF_TypeName(result_type_name);
15804 __Pyx_DECREF_TypeName(result_type_name);
15807 PyErr_Format(PyExc_TypeError,
15808 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME
")",
15810 __Pyx_DECREF_TypeName(result_type_name);
15815static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x) {
15816#if CYTHON_USE_TYPE_SLOTS
15817 PyNumberMethods *m;
15819 PyObject *res = NULL;
15820 if (likely(PyLong_Check(x)))
15821 return __Pyx_NewRef(x);
15822#if CYTHON_USE_TYPE_SLOTS
15823 m = Py_TYPE(x)->tp_as_number;
15824 if (likely(m && m->nb_int)) {
15825 res = m->nb_int(x);
15828 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
15829 res = PyNumber_Long(x);
15833 if (unlikely(!PyLong_CheckExact(res))) {
15834 return __Pyx_PyNumber_LongWrongResultType(res);
15837 else if (!PyErr_Occurred()) {
15838 PyErr_SetString(PyExc_TypeError,
15839 "an integer is required");
15843static CYTHON_INLINE Py_ssize_t __Pyx_PyLong_AsSsize_t(PyObject* b) {
15844 #if CYTHON_USE_PYLONG_INTERNALS
15846 const Py_ssize_t size = __Pyx_PyLong_DigitCount(b);
15847 const int is_neg = __Pyx_PyLong_IsNeg(b);
15848 const digit* digits = __Pyx_PyLong_Digits(b);
15849 if (size == 0)
return 0;
15850 #if SIZEOF_SIZE_T * 8 > 1 * PyLong_SHIFT
15852 ival = (Py_ssize_t) (((
size_t)digits[0]));
15855 #if SIZEOF_SIZE_T * 8 > 2 * PyLong_SHIFT
15857 ival = (Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
15860 #if SIZEOF_SIZE_T * 8 > 3 * PyLong_SHIFT
15862 ival = (Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
15865 #if SIZEOF_SIZE_T * 8 > 4 * PyLong_SHIFT
15867 ival = (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]));
15870 return PyLong_AsSsize_t(b);
15871 return is_neg ? -ival : ival;
15873 return PyLong_AsSsize_t(b);
15876static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
15877 if (likely(PyLong_Check(b))) {
15878 return __Pyx_PyLong_AsSsize_t(b);
15881 PyObject *x = PyNumber_Index(b);
15882 if (unlikely(!x))
return -1;
15883 ival = __Pyx_PyLong_AsSsize_t(x);
15888static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
15889 if (
sizeof(Py_hash_t) ==
sizeof(Py_ssize_t)) {
15890 return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
15894 x = PyNumber_Index(o);
15896 ival = PyLong_AsLong(x);
15901static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(
int b) {
15902 CYTHON_UNUSED_VAR(b);
15903 return __Pyx_NewRef(Py_None);
15905static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
15906 return __Pyx_NewRef(b ? Py_True: Py_False);
15908static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(
size_t ival) {
15909 return PyLong_FromSize_t(ival);
15914#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
15915#ifndef CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
15916#if (CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000)
15917 #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 1
15919 #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 0
15922#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE && !CYTHON_ATOMICS
15923#error "Module state with PEP489 requires atomics. Currently that's one of\
15924 C11, C++11, gcc atomic intrinsics or MSVC atomic intrinsics"
15926#if !CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
15927#define __Pyx_ModuleStateLookup_Lock()
15928#define __Pyx_ModuleStateLookup_Unlock()
15929#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
15930static PyMutex __Pyx_ModuleStateLookup_mutex = {0};
15931#define __Pyx_ModuleStateLookup_Lock() PyMutex_Lock(&__Pyx_ModuleStateLookup_mutex)
15932#define __Pyx_ModuleStateLookup_Unlock() PyMutex_Unlock(&__Pyx_ModuleStateLookup_mutex)
15933#elif defined(__cplusplus) && __cplusplus >= 201103L
15935static std::mutex __Pyx_ModuleStateLookup_mutex;
15936#define __Pyx_ModuleStateLookup_Lock() __Pyx_ModuleStateLookup_mutex.lock()
15937#define __Pyx_ModuleStateLookup_Unlock() __Pyx_ModuleStateLookup_mutex.unlock()
15938#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ > 201112L) && !defined(__STDC_NO_THREADS__)
15939#include <threads.h>
15940static mtx_t __Pyx_ModuleStateLookup_mutex;
15941static once_flag __Pyx_ModuleStateLookup_mutex_once_flag = ONCE_FLAG_INIT;
15942static void __Pyx_ModuleStateLookup_initialize_mutex(
void) {
15943 mtx_init(&__Pyx_ModuleStateLookup_mutex, mtx_plain);
15945#define __Pyx_ModuleStateLookup_Lock()\
15946 call_once(&__Pyx_ModuleStateLookup_mutex_once_flag, __Pyx_ModuleStateLookup_initialize_mutex);\
15947 mtx_lock(&__Pyx_ModuleStateLookup_mutex)
15948#define __Pyx_ModuleStateLookup_Unlock() mtx_unlock(&__Pyx_ModuleStateLookup_mutex)
15949#elif defined(HAVE_PTHREAD_H)
15950#include <pthread.h>
15951static pthread_mutex_t __Pyx_ModuleStateLookup_mutex = PTHREAD_MUTEX_INITIALIZER;
15952#define __Pyx_ModuleStateLookup_Lock() pthread_mutex_lock(&__Pyx_ModuleStateLookup_mutex)
15953#define __Pyx_ModuleStateLookup_Unlock() pthread_mutex_unlock(&__Pyx_ModuleStateLookup_mutex)
15954#elif defined(_WIN32)
15955#include <Windows.h>
15956static SRWLOCK __Pyx_ModuleStateLookup_mutex = SRWLOCK_INIT;
15957#define __Pyx_ModuleStateLookup_Lock() AcquireSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
15958#define __Pyx_ModuleStateLookup_Unlock() ReleaseSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
15960#error "No suitable lock available for CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE.\
15961 Requires C standard >= C11, or C++ standard >= C++11,\
15962 or pthreads, or the Windows 32 API, or Python >= 3.13."
15967} __Pyx_InterpreterIdAndModule;
15969 char interpreter_id_as_index;
15971 Py_ssize_t allocated;
15972 __Pyx_InterpreterIdAndModule table[1];
15973} __Pyx_ModuleStateLookupData;
15974#define __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE 32
15975#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
15976static __pyx_atomic_int_type __Pyx_ModuleStateLookup_read_counter = 0;
15978#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
15979static __pyx_atomic_ptr_type __Pyx_ModuleStateLookup_data = 0;
15981static __Pyx_ModuleStateLookupData* __Pyx_ModuleStateLookup_data = NULL;
15983static __Pyx_InterpreterIdAndModule* __Pyx_State_FindModuleStateLookupTableLowerBound(
15984 __Pyx_InterpreterIdAndModule* table,
15986 int64_t interpreterId) {
15987 __Pyx_InterpreterIdAndModule* begin = table;
15988 __Pyx_InterpreterIdAndModule* end = begin + count;
15989 if (begin->id == interpreterId) {
15992 while ((end - begin) > __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
15993 __Pyx_InterpreterIdAndModule* halfway = begin + (end - begin)/2;
15994 if (halfway->id == interpreterId) {
15997 if (halfway->id < interpreterId) {
16003 for (; begin < end; ++begin) {
16004 if (begin->id >= interpreterId)
return begin;
16008static PyObject *__Pyx_State_FindModule(CYTHON_UNUSED
void* dummy) {
16009 int64_t interpreter_id = PyInterpreterState_GetID(PyInterpreterState_Get());
16010 if (interpreter_id == -1)
return NULL;
16011#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
16012 __Pyx_ModuleStateLookupData* data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
16014 __pyx_atomic_incr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
16015 if (likely(data)) {
16016 __Pyx_ModuleStateLookupData* new_data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_acquire(&__Pyx_ModuleStateLookup_data);
16017 if (likely(data == new_data)) {
16018 goto read_finished;
16021 __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
16022 __Pyx_ModuleStateLookup_Lock();
16023 __pyx_atomic_incr_relaxed(&__Pyx_ModuleStateLookup_read_counter);
16024 data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
16025 __Pyx_ModuleStateLookup_Unlock();
16029 __Pyx_ModuleStateLookupData* data = __Pyx_ModuleStateLookup_data;
16031 __Pyx_InterpreterIdAndModule* found = NULL;
16032 if (unlikely(!data))
goto end;
16033 if (data->interpreter_id_as_index) {
16034 if (interpreter_id < data->count) {
16035 found = data->table+interpreter_id;
16038 found = __Pyx_State_FindModuleStateLookupTableLowerBound(
16039 data->table, data->count, interpreter_id);
16043 PyObject *result=NULL;
16044 if (found && found->id == interpreter_id) {
16045 result = found->module;
16047#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
16048 __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
16053#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
16054static void __Pyx_ModuleStateLookup_wait_until_no_readers(
void) {
16055 while (__pyx_atomic_load(&__Pyx_ModuleStateLookup_read_counter) != 0);
16058#define __Pyx_ModuleStateLookup_wait_until_no_readers()
16060static int __Pyx_State_AddModuleInterpIdAsIndex(__Pyx_ModuleStateLookupData **old_data, PyObject* module, int64_t interpreter_id) {
16061 Py_ssize_t to_allocate = (*old_data)->allocated;
16062 while (to_allocate <= interpreter_id) {
16063 if (to_allocate == 0) to_allocate = 1;
16064 else to_allocate *= 2;
16066 __Pyx_ModuleStateLookupData *new_data = *old_data;
16067 if (to_allocate != (*old_data)->allocated) {
16068 new_data = (__Pyx_ModuleStateLookupData *)realloc(
16070 sizeof(__Pyx_ModuleStateLookupData)+(to_allocate-1)*
sizeof(__Pyx_InterpreterIdAndModule));
16075 for (Py_ssize_t i = new_data->allocated; i < to_allocate; ++i) {
16076 new_data->table[i].id = i;
16077 new_data->table[i].module = NULL;
16079 new_data->allocated = to_allocate;
16081 new_data->table[interpreter_id].module =
module;
16082 if (new_data->count < interpreter_id+1) {
16083 new_data->count = interpreter_id+1;
16085 *old_data = new_data;
16088static void __Pyx_State_ConvertFromInterpIdAsIndex(__Pyx_ModuleStateLookupData *data) {
16089 __Pyx_InterpreterIdAndModule *read = data->table;
16090 __Pyx_InterpreterIdAndModule *write = data->table;
16091 __Pyx_InterpreterIdAndModule *end = read + data->count;
16092 for (; read<end; ++read) {
16093 if (read->module) {
16094 write->id = read->id;
16095 write->module = read->module;
16099 data->count = write - data->table;
16100 for (; write<end; ++write) {
16102 write->module = NULL;
16104 data->interpreter_id_as_index = 0;
16106static int __Pyx_State_AddModule(PyObject* module, CYTHON_UNUSED
void* dummy) {
16107 int64_t interpreter_id = PyInterpreterState_GetID(PyInterpreterState_Get());
16108 if (interpreter_id == -1)
return -1;
16110 __Pyx_ModuleStateLookup_Lock();
16111#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
16112 __Pyx_ModuleStateLookupData *old_data = (__Pyx_ModuleStateLookupData *)
16113 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
16115 __Pyx_ModuleStateLookupData *old_data = __Pyx_ModuleStateLookup_data;
16117 __Pyx_ModuleStateLookupData *new_data = old_data;
16119 new_data = (__Pyx_ModuleStateLookupData *)calloc(1,
sizeof(__Pyx_ModuleStateLookupData));
16125 new_data->allocated = 1;
16126 new_data->interpreter_id_as_index = 1;
16128 __Pyx_ModuleStateLookup_wait_until_no_readers();
16129 if (new_data->interpreter_id_as_index) {
16130 if (interpreter_id < __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
16131 result = __Pyx_State_AddModuleInterpIdAsIndex(&new_data, module, interpreter_id);
16134 __Pyx_State_ConvertFromInterpIdAsIndex(new_data);
16137 Py_ssize_t insert_at = 0;
16139 __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
16140 new_data->table, new_data->count, interpreter_id);
16141 assert(lower_bound);
16142 insert_at = lower_bound - new_data->table;
16143 if (unlikely(insert_at < new_data->count && lower_bound->id == interpreter_id)) {
16144 lower_bound->module =
module;
16148 if (new_data->count+1 >= new_data->allocated) {
16149 Py_ssize_t to_allocate = (new_data->count+1)*2;
16151 (__Pyx_ModuleStateLookupData*)realloc(
16153 sizeof(__Pyx_ModuleStateLookupData) +
16154 (to_allocate-1)*
sizeof(__Pyx_InterpreterIdAndModule));
16157 new_data = old_data;
16161 new_data->allocated = to_allocate;
16164 int64_t last_id = interpreter_id;
16165 PyObject *last_module =
module;
16166 for (Py_ssize_t i=insert_at; i<new_data->count; ++i) {
16167 int64_t current_id = new_data->table[i].id;
16168 new_data->table[i].id = last_id;
16169 last_id = current_id;
16170 PyObject *current_module = new_data->table[i].module;
16171 new_data->table[i].module = last_module;
16172 last_module = current_module;
16176#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
16177 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, new_data);
16179 __Pyx_ModuleStateLookup_data = new_data;
16181 __Pyx_ModuleStateLookup_Unlock();
16184static int __Pyx_State_RemoveModule(CYTHON_UNUSED
void* dummy) {
16185 int64_t interpreter_id = PyInterpreterState_GetID(PyInterpreterState_Get());
16186 if (interpreter_id == -1)
return -1;
16187 __Pyx_ModuleStateLookup_Lock();
16188#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
16189 __Pyx_ModuleStateLookupData *data = (__Pyx_ModuleStateLookupData *)
16190 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
16192 __Pyx_ModuleStateLookupData *data = __Pyx_ModuleStateLookup_data;
16194 if (data->interpreter_id_as_index) {
16195 if (interpreter_id < data->count) {
16196 data->table[interpreter_id].module = NULL;
16201 __Pyx_ModuleStateLookup_wait_until_no_readers();
16202 __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
16203 data->table, data->count, interpreter_id);
16204 if (!lower_bound)
goto done;
16205 if (lower_bound->id != interpreter_id)
goto done;
16206 __Pyx_InterpreterIdAndModule *end = data->table+data->count;
16207 for (;lower_bound<end-1; ++lower_bound) {
16208 lower_bound->id = (lower_bound+1)->
id;
16209 lower_bound->module = (lower_bound+1)->module;
16213 if (data->count == 0) {
16218#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
16219 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, data);
16221 __Pyx_ModuleStateLookup_data = data;
16223 __Pyx_ModuleStateLookup_Unlock();
16230#pragma warning( pop )