1 /* Generated by Cython 0.29.13 */
3 #define PY_SSIZE_T_CLEAN
6 #error Python headers needed to compile C extensions, please install development version of Python.
7 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
8 #error Cython requires Python 2.6+ or Python 3.3+.
10 #define CYTHON_ABI "0_29_13"
11 #define CYTHON_HEX_VERSION 0x001D0DF0
12 #define CYTHON_FUTURE_DIVISION 1
15 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
17 #if !defined(WIN32) && !defined(MS_WINDOWS)
29 #define DL_IMPORT(t) t
32 #define DL_EXPORT(t) t
35 #ifndef HAVE_LONG_LONG
36 #if PY_VERSION_HEX >= 0x02070000
37 #define HAVE_LONG_LONG
41 #define PY_LONG_LONG LONG_LONG
44 #define Py_HUGE_VAL HUGE_VAL
47 #define CYTHON_COMPILING_IN_PYPY 1
48 #define CYTHON_COMPILING_IN_PYSTON 0
49 #define CYTHON_COMPILING_IN_CPYTHON 0
50 #undef CYTHON_USE_TYPE_SLOTS
51 #define CYTHON_USE_TYPE_SLOTS 0
52 #undef CYTHON_USE_PYTYPE_LOOKUP
53 #define CYTHON_USE_PYTYPE_LOOKUP 0
54 #if PY_VERSION_HEX < 0x03050000
55 #undef CYTHON_USE_ASYNC_SLOTS
56 #define CYTHON_USE_ASYNC_SLOTS 0
57 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
58 #define CYTHON_USE_ASYNC_SLOTS 1
60 #undef CYTHON_USE_PYLIST_INTERNALS
61 #define CYTHON_USE_PYLIST_INTERNALS 0
62 #undef CYTHON_USE_UNICODE_INTERNALS
63 #define CYTHON_USE_UNICODE_INTERNALS 0
64 #undef CYTHON_USE_UNICODE_WRITER
65 #define CYTHON_USE_UNICODE_WRITER 0
66 #undef CYTHON_USE_PYLONG_INTERNALS
67 #define CYTHON_USE_PYLONG_INTERNALS 0
68 #undef CYTHON_AVOID_BORROWED_REFS
69 #define CYTHON_AVOID_BORROWED_REFS 1
70 #undef CYTHON_ASSUME_SAFE_MACROS
71 #define CYTHON_ASSUME_SAFE_MACROS 0
72 #undef CYTHON_UNPACK_METHODS
73 #define CYTHON_UNPACK_METHODS 0
74 #undef CYTHON_FAST_THREAD_STATE
75 #define CYTHON_FAST_THREAD_STATE 0
76 #undef CYTHON_FAST_PYCALL
77 #define CYTHON_FAST_PYCALL 0
78 #undef CYTHON_PEP489_MULTI_PHASE_INIT
79 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
80 #undef CYTHON_USE_TP_FINALIZE
81 #define CYTHON_USE_TP_FINALIZE 0
82 #undef CYTHON_USE_DICT_VERSIONS
83 #define CYTHON_USE_DICT_VERSIONS 0
84 #undef CYTHON_USE_EXC_INFO_STACK
85 #define CYTHON_USE_EXC_INFO_STACK 0
86 #elif defined(PYSTON_VERSION)
87 #define CYTHON_COMPILING_IN_PYPY 0
88 #define CYTHON_COMPILING_IN_PYSTON 1
89 #define CYTHON_COMPILING_IN_CPYTHON 0
90 #ifndef CYTHON_USE_TYPE_SLOTS
91 #define CYTHON_USE_TYPE_SLOTS 1
93 #undef CYTHON_USE_PYTYPE_LOOKUP
94 #define CYTHON_USE_PYTYPE_LOOKUP 0
95 #undef CYTHON_USE_ASYNC_SLOTS
96 #define CYTHON_USE_ASYNC_SLOTS 0
97 #undef CYTHON_USE_PYLIST_INTERNALS
98 #define CYTHON_USE_PYLIST_INTERNALS 0
99 #ifndef CYTHON_USE_UNICODE_INTERNALS
100 #define CYTHON_USE_UNICODE_INTERNALS 1
102 #undef CYTHON_USE_UNICODE_WRITER
103 #define CYTHON_USE_UNICODE_WRITER 0
104 #undef CYTHON_USE_PYLONG_INTERNALS
105 #define CYTHON_USE_PYLONG_INTERNALS 0
106 #ifndef CYTHON_AVOID_BORROWED_REFS
107 #define CYTHON_AVOID_BORROWED_REFS 0
109 #ifndef CYTHON_ASSUME_SAFE_MACROS
110 #define CYTHON_ASSUME_SAFE_MACROS 1
112 #ifndef CYTHON_UNPACK_METHODS
113 #define CYTHON_UNPACK_METHODS 1
115 #undef CYTHON_FAST_THREAD_STATE
116 #define CYTHON_FAST_THREAD_STATE 0
117 #undef CYTHON_FAST_PYCALL
118 #define CYTHON_FAST_PYCALL 0
119 #undef CYTHON_PEP489_MULTI_PHASE_INIT
120 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
121 #undef CYTHON_USE_TP_FINALIZE
122 #define CYTHON_USE_TP_FINALIZE 0
123 #undef CYTHON_USE_DICT_VERSIONS
124 #define CYTHON_USE_DICT_VERSIONS 0
125 #undef CYTHON_USE_EXC_INFO_STACK
126 #define CYTHON_USE_EXC_INFO_STACK 0
128 #define CYTHON_COMPILING_IN_PYPY 0
129 #define CYTHON_COMPILING_IN_PYSTON 0
130 #define CYTHON_COMPILING_IN_CPYTHON 1
131 #ifndef CYTHON_USE_TYPE_SLOTS
132 #define CYTHON_USE_TYPE_SLOTS 1
134 #if PY_VERSION_HEX < 0x02070000
135 #undef CYTHON_USE_PYTYPE_LOOKUP
136 #define CYTHON_USE_PYTYPE_LOOKUP 0
137 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
138 #define CYTHON_USE_PYTYPE_LOOKUP 1
140 #if PY_MAJOR_VERSION < 3
141 #undef CYTHON_USE_ASYNC_SLOTS
142 #define CYTHON_USE_ASYNC_SLOTS 0
143 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
144 #define CYTHON_USE_ASYNC_SLOTS 1
146 #if PY_VERSION_HEX < 0x02070000
147 #undef CYTHON_USE_PYLONG_INTERNALS
148 #define CYTHON_USE_PYLONG_INTERNALS 0
149 #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
150 #define CYTHON_USE_PYLONG_INTERNALS 1
152 #ifndef CYTHON_USE_PYLIST_INTERNALS
153 #define CYTHON_USE_PYLIST_INTERNALS 1
155 #ifndef CYTHON_USE_UNICODE_INTERNALS
156 #define CYTHON_USE_UNICODE_INTERNALS 1
158 #if PY_VERSION_HEX < 0x030300F0
159 #undef CYTHON_USE_UNICODE_WRITER
160 #define CYTHON_USE_UNICODE_WRITER 0
161 #elif !defined(CYTHON_USE_UNICODE_WRITER)
162 #define CYTHON_USE_UNICODE_WRITER 1
164 #ifndef CYTHON_AVOID_BORROWED_REFS
165 #define CYTHON_AVOID_BORROWED_REFS 0
167 #ifndef CYTHON_ASSUME_SAFE_MACROS
168 #define CYTHON_ASSUME_SAFE_MACROS 1
170 #ifndef CYTHON_UNPACK_METHODS
171 #define CYTHON_UNPACK_METHODS 1
173 #ifndef CYTHON_FAST_THREAD_STATE
174 #define CYTHON_FAST_THREAD_STATE 1
176 #ifndef CYTHON_FAST_PYCALL
177 #define CYTHON_FAST_PYCALL 1
179 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
180 #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
182 #ifndef CYTHON_USE_TP_FINALIZE
183 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
185 #ifndef CYTHON_USE_DICT_VERSIONS
186 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
188 #ifndef CYTHON_USE_EXC_INFO_STACK
189 #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
192 #if !defined(CYTHON_FAST_PYCCALL)
193 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
195 #if CYTHON_USE_PYLONG_INTERNALS
196 #include "longintrepr.h"
201 enum { __pyx_check_sizeof_voidp
= 1 / (int)(SIZEOF_VOID_P
== sizeof(void*)) };
204 #ifndef __has_attribute
205 #define __has_attribute(x) 0
207 #ifndef __has_cpp_attribute
208 #define __has_cpp_attribute(x) 0
210 #ifndef CYTHON_RESTRICT
211 #if defined(__GNUC__)
212 #define CYTHON_RESTRICT __restrict__
213 #elif defined(_MSC_VER) && _MSC_VER >= 1400
214 #define CYTHON_RESTRICT __restrict
215 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
216 #define CYTHON_RESTRICT restrict
218 #define CYTHON_RESTRICT
221 #ifndef CYTHON_UNUSED
222 # if defined(__GNUC__)
223 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
224 # define CYTHON_UNUSED __attribute__ ((__unused__))
226 # define CYTHON_UNUSED
228 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
229 # define CYTHON_UNUSED __attribute__ ((__unused__))
231 # define CYTHON_UNUSED
234 #ifndef CYTHON_MAYBE_UNUSED_VAR
235 # if defined(__cplusplus)
236 template<class T
> void CYTHON_MAYBE_UNUSED_VAR( const T
& ) { }
238 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
241 #ifndef CYTHON_NCP_UNUSED
242 # if CYTHON_COMPILING_IN_CPYTHON
243 # define CYTHON_NCP_UNUSED
245 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
248 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
250 #ifndef _MSC_STDINT_H_
252 typedef unsigned char uint8_t;
253 typedef unsigned int uint32_t;
255 typedef unsigned __int8
uint8_t;
256 typedef unsigned __int32
uint32_t;
262 #ifndef CYTHON_FALLTHROUGH
263 #if defined(__cplusplus) && __cplusplus >= 201103L
264 #if __has_cpp_attribute(fallthrough)
265 #define CYTHON_FALLTHROUGH [[fallthrough]]
266 #elif __has_cpp_attribute(clang::fallthrough)
267 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
268 #elif __has_cpp_attribute(gnu::fallthrough)
269 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
272 #ifndef CYTHON_FALLTHROUGH
273 #if __has_attribute(fallthrough)
274 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
276 #define CYTHON_FALLTHROUGH
279 #if defined(__clang__ ) && defined(__apple_build_version__)
280 #if __apple_build_version__ < 7000000
281 #undef CYTHON_FALLTHROUGH
282 #define CYTHON_FALLTHROUGH
287 #ifndef CYTHON_INLINE
288 #if defined(__clang__)
289 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
290 #elif defined(__GNUC__)
291 #define CYTHON_INLINE __inline__
292 #elif defined(_MSC_VER)
293 #define CYTHON_INLINE __inline
294 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
295 #define CYTHON_INLINE inline
297 #define CYTHON_INLINE
301 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
302 #define Py_OptimizeFlag 0
304 #define __PYX_BUILD_PY_SSIZE_T "n"
305 #define CYTHON_FORMAT_SSIZE_T "z"
306 #if PY_MAJOR_VERSION < 3
307 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
308 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
309 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
310 #define __Pyx_DefaultClassType PyClass_Type
312 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
313 #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
314 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
315 PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
317 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
318 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
320 #define __Pyx_DefaultClassType PyType_Type
322 #ifndef Py_TPFLAGS_CHECKTYPES
323 #define Py_TPFLAGS_CHECKTYPES 0
325 #ifndef Py_TPFLAGS_HAVE_INDEX
326 #define Py_TPFLAGS_HAVE_INDEX 0
328 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
329 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
331 #ifndef Py_TPFLAGS_HAVE_FINALIZE
332 #define Py_TPFLAGS_HAVE_FINALIZE 0
334 #ifndef METH_STACKLESS
335 #define METH_STACKLESS 0
337 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
338 #ifndef METH_FASTCALL
339 #define METH_FASTCALL 0x80
341 typedef PyObject
*(*__Pyx_PyCFunctionFast
) (PyObject
*self
, PyObject
*const *args
, Py_ssize_t nargs
);
342 typedef PyObject
*(*__Pyx_PyCFunctionFastWithKeywords
) (PyObject
*self
, PyObject
*const *args
,
343 Py_ssize_t nargs
, PyObject
*kwnames
);
345 #define __Pyx_PyCFunctionFast _PyCFunctionFast
346 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
348 #if CYTHON_FAST_PYCCALL
349 #define __Pyx_PyFastCFunction_Check(func)\
350 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
352 #define __Pyx_PyFastCFunction_Check(func) 0
354 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
355 #define PyObject_Malloc(s) PyMem_Malloc(s)
356 #define PyObject_Free(p) PyMem_Free(p)
357 #define PyObject_Realloc(p) PyMem_Realloc(p)
359 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
360 #define PyMem_RawMalloc(n) PyMem_Malloc(n)
361 #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
362 #define PyMem_RawFree(p) PyMem_Free(p)
364 #if CYTHON_COMPILING_IN_PYSTON
365 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
366 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
368 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
369 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
371 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
372 #define __Pyx_PyThreadState_Current PyThreadState_GET()
373 #elif PY_VERSION_HEX >= 0x03060000
374 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
375 #elif PY_VERSION_HEX >= 0x03000000
376 #define __Pyx_PyThreadState_Current PyThreadState_GET()
378 #define __Pyx_PyThreadState_Current _PyThreadState_Current
380 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
381 #include "pythread.h"
382 #define Py_tss_NEEDS_INIT 0
383 typedef int Py_tss_t
;
384 static CYTHON_INLINE
int PyThread_tss_create(Py_tss_t
*key
) {
385 *key
= PyThread_create_key();
388 static CYTHON_INLINE Py_tss_t
* PyThread_tss_alloc(void) {
389 Py_tss_t
*key
= (Py_tss_t
*)PyObject_Malloc(sizeof(Py_tss_t
));
390 *key
= Py_tss_NEEDS_INIT
;
393 static CYTHON_INLINE
void PyThread_tss_free(Py_tss_t
*key
) {
396 static CYTHON_INLINE
int PyThread_tss_is_created(Py_tss_t
*key
) {
397 return *key
!= Py_tss_NEEDS_INIT
;
399 static CYTHON_INLINE
void PyThread_tss_delete(Py_tss_t
*key
) {
400 PyThread_delete_key(*key
);
401 *key
= Py_tss_NEEDS_INIT
;
403 static CYTHON_INLINE
int PyThread_tss_set(Py_tss_t
*key
, void *value
) {
404 return PyThread_set_key_value(*key
, value
);
406 static CYTHON_INLINE
void * PyThread_tss_get(Py_tss_t
*key
) {
407 return PyThread_get_key_value(*key
);
410 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
411 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
413 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
415 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
416 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
417 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
419 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
420 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
422 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
423 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
425 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
427 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
428 #define CYTHON_PEP393_ENABLED 1
429 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
430 0 : _PyUnicode_Ready((PyObject *)(op)))
431 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
432 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
433 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
434 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
435 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
436 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
437 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
438 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
440 #define CYTHON_PEP393_ENABLED 0
441 #define PyUnicode_1BYTE_KIND 1
442 #define PyUnicode_2BYTE_KIND 2
443 #define PyUnicode_4BYTE_KIND 4
444 #define __Pyx_PyUnicode_READY(op) (0)
445 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
446 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
447 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
448 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
449 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
450 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
451 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
452 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
454 #if CYTHON_COMPILING_IN_PYPY
455 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
456 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
458 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
459 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
460 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
462 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
463 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
465 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
466 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
468 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
469 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
471 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
472 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
473 #if PY_MAJOR_VERSION >= 3
474 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
476 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
478 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
479 #define PyObject_ASCII(o) PyObject_Repr(o)
481 #if PY_MAJOR_VERSION >= 3
482 #define PyBaseString_Type PyUnicode_Type
483 #define PyStringObject PyUnicodeObject
484 #define PyString_Type PyUnicode_Type
485 #define PyString_Check PyUnicode_Check
486 #define PyString_CheckExact PyUnicode_CheckExact
487 #define PyObject_Unicode PyObject_Str
489 #if PY_MAJOR_VERSION >= 3
490 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
491 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
493 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
494 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
496 #ifndef PySet_CheckExact
497 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
499 #if CYTHON_ASSUME_SAFE_MACROS
500 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
502 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
504 #if PY_MAJOR_VERSION >= 3
505 #define PyIntObject PyLongObject
506 #define PyInt_Type PyLong_Type
507 #define PyInt_Check(op) PyLong_Check(op)
508 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
509 #define PyInt_FromString PyLong_FromString
510 #define PyInt_FromUnicode PyLong_FromUnicode
511 #define PyInt_FromLong PyLong_FromLong
512 #define PyInt_FromSize_t PyLong_FromSize_t
513 #define PyInt_FromSsize_t PyLong_FromSsize_t
514 #define PyInt_AsLong PyLong_AsLong
515 #define PyInt_AS_LONG PyLong_AS_LONG
516 #define PyInt_AsSsize_t PyLong_AsSsize_t
517 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
518 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
519 #define PyNumber_Int PyNumber_Long
521 #if PY_MAJOR_VERSION >= 3
522 #define PyBoolObject PyLongObject
524 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
525 #ifndef PyUnicode_InternFromString
526 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
529 #if PY_VERSION_HEX < 0x030200A4
530 typedef long Py_hash_t
;
531 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
532 #define __Pyx_PyInt_AsHash_t PyInt_AsLong
534 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
535 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
537 #if PY_MAJOR_VERSION >= 3
538 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
540 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
542 #if CYTHON_USE_ASYNC_SLOTS
543 #if PY_VERSION_HEX >= 0x030500B1
544 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
545 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
547 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
550 #define __Pyx_PyType_AsAsync(obj) NULL
552 #ifndef __Pyx_PyAsyncMethodsStruct
557 } __Pyx_PyAsyncMethodsStruct
;
560 #if defined(WIN32) || defined(MS_WINDOWS)
561 #define _USE_MATH_DEFINES
565 #define __PYX_NAN() ((float) NAN)
567 static CYTHON_INLINE
float __PYX_NAN() {
569 memset(&value
, 0xFF, sizeof(value
));
573 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
574 #define __Pyx_truncl trunc
576 #define __Pyx_truncl truncl
580 #define __PYX_ERR(f_index, lineno, Ln_error) \
582 __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
585 #ifndef __PYX_EXTERN_C
587 #define __PYX_EXTERN_C extern "C"
589 #define __PYX_EXTERN_C extern
593 #define __PYX_HAVE__MACS2__Statistics
594 #define __PYX_HAVE_API__MACS2__Statistics
601 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
602 #define CYTHON_WITHOUT_ASSERTIONS
605 typedef struct {PyObject
**p
; const char *s
; const Py_ssize_t n
; const char* encoding
;
606 const char is_unicode
; const char is_str
; const char intern
; } __Pyx_StringTabEntry
;
608 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
609 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
610 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
611 #define __PYX_DEFAULT_STRING_ENCODING ""
612 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
613 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
614 #define __Pyx_uchar_cast(c) ((unsigned char)c)
615 #define __Pyx_long_cast(x) ((long)x)
616 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
617 (sizeof(type) < sizeof(Py_ssize_t)) ||\
618 (sizeof(type) > sizeof(Py_ssize_t) &&\
619 likely(v < (type)PY_SSIZE_T_MAX ||\
620 v == (type)PY_SSIZE_T_MAX) &&\
621 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
622 v == (type)PY_SSIZE_T_MIN))) ||\
623 (sizeof(type) == sizeof(Py_ssize_t) &&\
624 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
625 v == (type)PY_SSIZE_T_MAX))) )
626 static CYTHON_INLINE
int __Pyx_is_valid_index(Py_ssize_t i
, Py_ssize_t limit
) {
627 return (size_t) i
< (size_t) limit
;
629 #if defined (__cplusplus) && __cplusplus >= 201103L
631 #define __Pyx_sst_abs(value) std::abs(value)
632 #elif SIZEOF_INT >= SIZEOF_SIZE_T
633 #define __Pyx_sst_abs(value) abs(value)
634 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
635 #define __Pyx_sst_abs(value) labs(value)
636 #elif defined (_MSC_VER)
637 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
638 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
639 #define __Pyx_sst_abs(value) llabs(value)
640 #elif defined (__GNUC__)
641 #define __Pyx_sst_abs(value) __builtin_llabs(value)
643 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
645 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject
*);
646 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject
*, Py_ssize_t
* length
);
647 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
648 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
649 #define __Pyx_PyBytes_FromString PyBytes_FromString
650 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
651 static CYTHON_INLINE PyObject
* __Pyx_PyUnicode_FromString(const char*);
652 #if PY_MAJOR_VERSION < 3
653 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
654 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
656 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
657 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
659 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
660 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
661 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
662 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
663 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
664 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
665 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
666 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
667 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
668 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
669 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
670 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
671 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
672 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
673 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
674 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
675 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE
*u
) {
676 const Py_UNICODE
*u_end
= u
;
678 return (size_t)(u_end
- u
- 1);
680 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
681 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
682 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
683 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
684 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
685 static CYTHON_INLINE PyObject
* __Pyx_PyBool_FromLong(long b
);
686 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject
*);
687 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject
*);
688 static CYTHON_INLINE PyObject
* __Pyx_PyNumber_IntOrLong(PyObject
* x
);
689 #define __Pyx_PySequence_Tuple(obj)\
690 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
691 static CYTHON_INLINE Py_ssize_t
__Pyx_PyIndex_AsSsize_t(PyObject
*);
692 static CYTHON_INLINE PyObject
* __Pyx_PyInt_FromSize_t(size_t);
693 #if CYTHON_ASSUME_SAFE_MACROS
694 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
696 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
698 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
699 #if PY_MAJOR_VERSION >= 3
700 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
702 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
704 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
705 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
706 static int __Pyx_sys_getdefaultencoding_not_ascii
;
707 static int __Pyx_init_sys_getdefaultencoding_params(void) {
709 PyObject
* default_encoding
= NULL
;
710 PyObject
* ascii_chars_u
= NULL
;
711 PyObject
* ascii_chars_b
= NULL
;
712 const char* default_encoding_c
;
713 sys
= PyImport_ImportModule("sys");
715 default_encoding
= PyObject_CallMethod(sys
, (char*) "getdefaultencoding", NULL
);
717 if (!default_encoding
) goto bad
;
718 default_encoding_c
= PyBytes_AsString(default_encoding
);
719 if (!default_encoding_c
) goto bad
;
720 if (strcmp(default_encoding_c
, "ascii") == 0) {
721 __Pyx_sys_getdefaultencoding_not_ascii
= 0;
723 char ascii_chars
[128];
725 for (c
= 0; c
< 128; c
++) {
728 __Pyx_sys_getdefaultencoding_not_ascii
= 1;
729 ascii_chars_u
= PyUnicode_DecodeASCII(ascii_chars
, 128, NULL
);
730 if (!ascii_chars_u
) goto bad
;
731 ascii_chars_b
= PyUnicode_AsEncodedString(ascii_chars_u
, default_encoding_c
, NULL
);
732 if (!ascii_chars_b
|| !PyBytes_Check(ascii_chars_b
) || memcmp(ascii_chars
, PyBytes_AS_STRING(ascii_chars_b
), 128) != 0) {
735 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
739 Py_DECREF(ascii_chars_u
);
740 Py_DECREF(ascii_chars_b
);
742 Py_DECREF(default_encoding
);
745 Py_XDECREF(default_encoding
);
746 Py_XDECREF(ascii_chars_u
);
747 Py_XDECREF(ascii_chars_b
);
751 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
752 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
754 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
755 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
756 static char* __PYX_DEFAULT_STRING_ENCODING
;
757 static int __Pyx_init_sys_getdefaultencoding_params(void) {
759 PyObject
* default_encoding
= NULL
;
760 char* default_encoding_c
;
761 sys
= PyImport_ImportModule("sys");
763 default_encoding
= PyObject_CallMethod(sys
, (char*) (const char*) "getdefaultencoding", NULL
);
765 if (!default_encoding
) goto bad
;
766 default_encoding_c
= PyBytes_AsString(default_encoding
);
767 if (!default_encoding_c
) goto bad
;
768 __PYX_DEFAULT_STRING_ENCODING
= (char*) malloc(strlen(default_encoding_c
) + 1);
769 if (!__PYX_DEFAULT_STRING_ENCODING
) goto bad
;
770 strcpy(__PYX_DEFAULT_STRING_ENCODING
, default_encoding_c
);
771 Py_DECREF(default_encoding
);
774 Py_XDECREF(default_encoding
);
781 /* Test for GCC > 2.95 */
782 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
783 #define likely(x) __builtin_expect(!!(x), 1)
784 #define unlikely(x) __builtin_expect(!!(x), 0)
785 #else /* !__GNUC__ or GCC < 2.95 */
786 #define likely(x) (x)
787 #define unlikely(x) (x)
788 #endif /* __GNUC__ */
789 static CYTHON_INLINE
void __Pyx_pretend_to_initialize(void* ptr
) { (void)ptr
; }
791 static PyObject
*__pyx_m
= NULL
;
792 static PyObject
*__pyx_d
;
793 static PyObject
*__pyx_b
;
794 static PyObject
*__pyx_cython_runtime
= NULL
;
795 static PyObject
*__pyx_empty_tuple
;
796 static PyObject
*__pyx_empty_bytes
;
797 static PyObject
*__pyx_empty_unicode
;
798 static int __pyx_lineno
;
799 static int __pyx_clineno
= 0;
800 static const char * __pyx_cfilenm
= __FILE__
;
801 static const char *__pyx_filename
;
804 static const char *__pyx_f
[] = {
805 "MACS2/Statistics.pyx",
809 /*--- Type declarations ---*/
810 struct __pyx_obj_5MACS2_10Statistics_P_Score_Upper_Tail
;
811 struct __pyx_obj_5MACS2_10Statistics_LogLR_Asym
;
812 struct __pyx_obj_5MACS2_10Statistics_LogLR_Sym
;
813 struct __pyx_obj_5MACS2_10Statistics_LogLR_Diff
;
815 /* "MACS2/Statistics.pyx":15
816 * from MACS2.Prob import poisson_cdf
818 * cdef class P_Score_Upper_Tail: # <<<<<<<<<<<<<<
819 * """Unit to calculate -log10 poisson_CDF of upper tail and cache
820 * results in a hashtable.
822 struct __pyx_obj_5MACS2_10Statistics_P_Score_Upper_Tail
{
824 struct __pyx_vtabstruct_5MACS2_10Statistics_P_Score_Upper_Tail
*__pyx_vtab
;
825 PyObject
*pscore_dict
;
829 /* "MACS2/Statistics.pyx":37
832 * cdef class LogLR_Asym: # <<<<<<<<<<<<<<
833 * """Unit to calculate asymmetric log likelihood, and cache
834 * results in a hashtable.
836 struct __pyx_obj_5MACS2_10Statistics_LogLR_Asym
{
838 struct __pyx_vtabstruct_5MACS2_10Statistics_LogLR_Asym
*__pyx_vtab
;
839 PyObject
*logLR_dict
;
843 /* "MACS2/Statistics.pyx":65
846 * cdef class LogLR_Sym: # <<<<<<<<<<<<<<
847 * """Unit to calculate symmetric log likelihood, and cache
848 * results in a hashtable.
850 struct __pyx_obj_5MACS2_10Statistics_LogLR_Sym
{
852 struct __pyx_vtabstruct_5MACS2_10Statistics_LogLR_Sym
*__pyx_vtab
;
853 PyObject
*logLR_dict
;
857 /* "MACS2/Statistics.pyx":96
860 * cdef class LogLR_Diff: # <<<<<<<<<<<<<<
861 * """Unit to calculate log likelihood for differential calling, and cache
862 * results in a hashtable.
864 struct __pyx_obj_5MACS2_10Statistics_LogLR_Diff
{
866 struct __pyx_vtabstruct_5MACS2_10Statistics_LogLR_Diff
*__pyx_vtab
;
867 PyObject
*logLR_dict
;
872 /* "MACS2/Statistics.pyx":15
873 * from MACS2.Prob import poisson_cdf
875 * cdef class P_Score_Upper_Tail: # <<<<<<<<<<<<<<
876 * """Unit to calculate -log10 poisson_CDF of upper tail and cache
877 * results in a hashtable.
880 struct __pyx_vtabstruct_5MACS2_10Statistics_P_Score_Upper_Tail
{
881 float (*get_pscore
)(struct __pyx_obj_5MACS2_10Statistics_P_Score_Upper_Tail
*, int, float, int __pyx_skip_dispatch
);
883 static struct __pyx_vtabstruct_5MACS2_10Statistics_P_Score_Upper_Tail
*__pyx_vtabptr_5MACS2_10Statistics_P_Score_Upper_Tail
;
886 /* "MACS2/Statistics.pyx":37
889 * cdef class LogLR_Asym: # <<<<<<<<<<<<<<
890 * """Unit to calculate asymmetric log likelihood, and cache
891 * results in a hashtable.
894 struct __pyx_vtabstruct_5MACS2_10Statistics_LogLR_Asym
{
895 float (*get_logLR_asym
)(struct __pyx_obj_5MACS2_10Statistics_LogLR_Asym
*, float, float, int __pyx_skip_dispatch
);
897 static struct __pyx_vtabstruct_5MACS2_10Statistics_LogLR_Asym
*__pyx_vtabptr_5MACS2_10Statistics_LogLR_Asym
;
900 /* "MACS2/Statistics.pyx":65
903 * cdef class LogLR_Sym: # <<<<<<<<<<<<<<
904 * """Unit to calculate symmetric log likelihood, and cache
905 * results in a hashtable.
908 struct __pyx_vtabstruct_5MACS2_10Statistics_LogLR_Sym
{
909 float (*get_logLR_sym
)(struct __pyx_obj_5MACS2_10Statistics_LogLR_Sym
*, float, float, int __pyx_skip_dispatch
);
911 static struct __pyx_vtabstruct_5MACS2_10Statistics_LogLR_Sym
*__pyx_vtabptr_5MACS2_10Statistics_LogLR_Sym
;
914 /* "MACS2/Statistics.pyx":96
917 * cdef class LogLR_Diff: # <<<<<<<<<<<<<<
918 * """Unit to calculate log likelihood for differential calling, and cache
919 * results in a hashtable.
922 struct __pyx_vtabstruct_5MACS2_10Statistics_LogLR_Diff
{
923 float (*get_logLR_diff
)(struct __pyx_obj_5MACS2_10Statistics_LogLR_Diff
*, float, float, int __pyx_skip_dispatch
);
925 static struct __pyx_vtabstruct_5MACS2_10Statistics_LogLR_Diff
*__pyx_vtabptr_5MACS2_10Statistics_LogLR_Diff
;
927 /* --- Runtime support code (head) --- */
929 #ifndef CYTHON_REFNANNY
930 #define CYTHON_REFNANNY 0
934 void (*INCREF
)(void*, PyObject
*, int);
935 void (*DECREF
)(void*, PyObject
*, int);
936 void (*GOTREF
)(void*, PyObject
*, int);
937 void (*GIVEREF
)(void*, PyObject
*, int);
938 void* (*SetupContext
)(const char*, int, const char*);
939 void (*FinishContext
)(void**);
940 } __Pyx_RefNannyAPIStruct
;
941 static __Pyx_RefNannyAPIStruct
*__Pyx_RefNanny
= NULL
;
942 static __Pyx_RefNannyAPIStruct
*__Pyx_RefNannyImportAPI(const char *modname
);
943 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
945 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
947 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
948 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
949 PyGILState_Release(__pyx_gilstate_save);\
951 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
954 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
955 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
957 #define __Pyx_RefNannyFinishContext()\
958 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
959 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
960 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
961 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
962 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
963 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
964 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
965 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
966 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
968 #define __Pyx_RefNannyDeclarations
969 #define __Pyx_RefNannySetupContext(name, acquire_gil)
970 #define __Pyx_RefNannyFinishContext()
971 #define __Pyx_INCREF(r) Py_INCREF(r)
972 #define __Pyx_DECREF(r) Py_DECREF(r)
973 #define __Pyx_GOTREF(r)
974 #define __Pyx_GIVEREF(r)
975 #define __Pyx_XINCREF(r) Py_XINCREF(r)
976 #define __Pyx_XDECREF(r) Py_XDECREF(r)
977 #define __Pyx_XGOTREF(r)
978 #define __Pyx_XGIVEREF(r)
980 #define __Pyx_XDECREF_SET(r, v) do {\
981 PyObject *tmp = (PyObject *) r;\
982 r = v; __Pyx_XDECREF(tmp);\
984 #define __Pyx_DECREF_SET(r, v) do {\
985 PyObject *tmp = (PyObject *) r;\
986 r = v; __Pyx_DECREF(tmp);\
988 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
989 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
991 /* RaiseArgTupleInvalid.proto */
992 static void __Pyx_RaiseArgtupleInvalid(const char* func_name
, int exact
,
993 Py_ssize_t num_min
, Py_ssize_t num_max
, Py_ssize_t num_found
);
995 /* KeywordStringCheck.proto */
996 static int __Pyx_CheckKeywordStrings(PyObject
*kwdict
, const char* function_name
, int kw_allowed
);
998 /* PyThreadStateGet.proto */
999 #if CYTHON_FAST_THREAD_STATE
1000 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1001 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1002 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1004 #define __Pyx_PyThreadState_declare
1005 #define __Pyx_PyThreadState_assign
1006 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1009 /* PyErrFetchRestore.proto */
1010 #if CYTHON_FAST_THREAD_STATE
1011 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1012 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1013 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1014 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1015 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1016 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState
*tstate
, PyObject
*type
, PyObject
*value
, PyObject
*tb
);
1017 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState
*tstate
, PyObject
**type
, PyObject
**value
, PyObject
**tb
);
1018 #if CYTHON_COMPILING_IN_CPYTHON
1019 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1021 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1024 #define __Pyx_PyErr_Clear() PyErr_Clear()
1025 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1026 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1027 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1028 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1029 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1030 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1031 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1035 #ifndef CYTHON_PROFILE
1036 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
1037 #define CYTHON_PROFILE 0
1039 #define CYTHON_PROFILE 1
1042 #ifndef CYTHON_TRACE_NOGIL
1043 #define CYTHON_TRACE_NOGIL 0
1045 #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE)
1046 #define CYTHON_TRACE 1
1049 #ifndef CYTHON_TRACE
1050 #define CYTHON_TRACE 0
1053 #undef CYTHON_PROFILE_REUSE_FRAME
1055 #ifndef CYTHON_PROFILE_REUSE_FRAME
1056 #define CYTHON_PROFILE_REUSE_FRAME 0
1058 #if CYTHON_PROFILE || CYTHON_TRACE
1059 #include "compile.h"
1060 #include "frameobject.h"
1061 #include "traceback.h"
1062 #if CYTHON_PROFILE_REUSE_FRAME
1063 #define CYTHON_FRAME_MODIFIER static
1064 #define CYTHON_FRAME_DEL(frame)
1066 #define CYTHON_FRAME_MODIFIER
1067 #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame)
1069 #define __Pyx_TraceDeclarations\
1070 static PyCodeObject *__pyx_frame_code = NULL;\
1071 CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\
1072 int __Pyx_use_tracing = 0;
1073 #define __Pyx_TraceFrameInit(codeobj)\
1074 if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj;
1076 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1078 if (CYTHON_TRACE_NOGIL) {\
1079 PyThreadState *tstate;\
1080 PyGILState_STATE state = PyGILState_Ensure();\
1081 tstate = __Pyx_PyThreadState_Current;\
1082 if (unlikely(tstate->use_tracing) && !tstate->tracing &&\
1083 (tstate->c_profilefunc || (CYTHON_TRACE && tstate->c_tracefunc))) {\
1084 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1086 PyGILState_Release(state);\
1087 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1090 PyThreadState* tstate = PyThreadState_GET();\
1091 if (unlikely(tstate->use_tracing) && !tstate->tracing &&\
1092 (tstate->c_profilefunc || (CYTHON_TRACE && tstate->c_tracefunc))) {\
1093 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1094 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1098 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1099 { PyThreadState* tstate = PyThreadState_GET();\
1100 if (unlikely(tstate->use_tracing) && !tstate->tracing &&\
1101 (tstate->c_profilefunc || (CYTHON_TRACE && tstate->c_tracefunc))) {\
1102 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1103 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1107 #define __Pyx_TraceException()\
1108 if (likely(!__Pyx_use_tracing)); else {\
1109 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1110 if (tstate->use_tracing &&\
1111 (tstate->c_profilefunc || (CYTHON_TRACE && tstate->c_tracefunc))) {\
1113 tstate->use_tracing = 0;\
1114 PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\
1116 if (CYTHON_TRACE && tstate->c_tracefunc)\
1117 tstate->c_tracefunc(\
1118 tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1119 tstate->c_profilefunc(\
1120 tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1121 Py_DECREF(exc_info);\
1123 tstate->use_tracing = 1;\
1127 static void __Pyx_call_return_trace_func(PyThreadState
*tstate
, PyFrameObject
*frame
, PyObject
*result
) {
1128 PyObject
*type
, *value
, *traceback
;
1129 __Pyx_ErrFetchInState(tstate
, &type
, &value
, &traceback
);
1131 tstate
->use_tracing
= 0;
1132 if (CYTHON_TRACE
&& tstate
->c_tracefunc
)
1133 tstate
->c_tracefunc(tstate
->c_traceobj
, frame
, PyTrace_RETURN
, result
);
1134 if (tstate
->c_profilefunc
)
1135 tstate
->c_profilefunc(tstate
->c_profileobj
, frame
, PyTrace_RETURN
, result
);
1136 CYTHON_FRAME_DEL(frame
);
1137 tstate
->use_tracing
= 1;
1139 __Pyx_ErrRestoreInState(tstate
, type
, value
, traceback
);
1142 #define __Pyx_TraceReturn(result, nogil)\
1143 if (likely(!__Pyx_use_tracing)); else {\
1145 if (CYTHON_TRACE_NOGIL) {\
1146 PyThreadState *tstate;\
1147 PyGILState_STATE state = PyGILState_Ensure();\
1148 tstate = __Pyx_PyThreadState_Current;\
1149 if (tstate->use_tracing) {\
1150 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1152 PyGILState_Release(state);\
1155 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1156 if (tstate->use_tracing) {\
1157 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1162 #define __Pyx_TraceReturn(result, nogil)\
1163 if (likely(!__Pyx_use_tracing)); else {\
1164 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1165 if (tstate->use_tracing) {\
1166 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1170 static PyCodeObject
*__Pyx_createFrameCodeObject(const char *funcname
, const char *srcfile
, int firstlineno
);
1171 static int __Pyx_TraceSetupAndCall(PyCodeObject
** code
, PyFrameObject
** frame
, PyThreadState
* tstate
, const char *funcname
, const char *srcfile
, int firstlineno
);
1173 #define __Pyx_TraceDeclarations
1174 #define __Pyx_TraceFrameInit(codeobj)
1175 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error;
1176 #define __Pyx_TraceException()
1177 #define __Pyx_TraceReturn(result, nogil)
1180 static int __Pyx_call_line_trace_func(PyThreadState
*tstate
, PyFrameObject
*frame
, int lineno
) {
1182 PyObject
*type
, *value
, *traceback
;
1183 __Pyx_ErrFetchInState(tstate
, &type
, &value
, &traceback
);
1184 __Pyx_PyFrame_SetLineNumber(frame
, lineno
);
1186 tstate
->use_tracing
= 0;
1187 ret
= tstate
->c_tracefunc(tstate
->c_traceobj
, frame
, PyTrace_LINE
, NULL
);
1188 tstate
->use_tracing
= 1;
1191 __Pyx_ErrRestoreInState(tstate
, type
, value
, traceback
);
1195 Py_XDECREF(traceback
);
1200 #define __Pyx_TraceLine(lineno, nogil, goto_error)\
1201 if (likely(!__Pyx_use_tracing)); else {\
1203 if (CYTHON_TRACE_NOGIL) {\
1205 PyThreadState *tstate;\
1206 PyGILState_STATE state = PyGILState_Ensure();\
1207 tstate = __Pyx_PyThreadState_Current;\
1208 if (unlikely(tstate->use_tracing && tstate->c_tracefunc && __pyx_frame->f_trace)) {\
1209 ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1211 PyGILState_Release(state);\
1212 if (unlikely(ret)) goto_error;\
1215 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1216 if (unlikely(tstate->use_tracing && tstate->c_tracefunc && __pyx_frame->f_trace)) {\
1217 int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1218 if (unlikely(ret)) goto_error;\
1223 #define __Pyx_TraceLine(lineno, nogil, goto_error)\
1224 if (likely(!__Pyx_use_tracing)); else {\
1225 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1226 if (unlikely(tstate->use_tracing && tstate->c_tracefunc && __pyx_frame->f_trace)) {\
1227 int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1228 if (unlikely(ret)) goto_error;\
1233 #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error;
1236 /* PyDictVersioning.proto */
1237 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1238 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1239 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1240 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1241 (version_var) = __PYX_GET_DICT_VERSION(dict);\
1242 (cache_var) = (value);
1243 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1244 static PY_UINT64_T __pyx_dict_version = 0;\
1245 static PyObject *__pyx_dict_cached_value = NULL;\
1246 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1247 (VAR) = __pyx_dict_cached_value;\
1249 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1250 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1253 static CYTHON_INLINE PY_UINT64_T
__Pyx_get_tp_dict_version(PyObject
*obj
);
1254 static CYTHON_INLINE PY_UINT64_T
__Pyx_get_object_dict_version(PyObject
*obj
);
1255 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject
* obj
, PY_UINT64_T tp_dict_version
, PY_UINT64_T obj_dict_version
);
1257 #define __PYX_GET_DICT_VERSION(dict) (0)
1258 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1259 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1262 /* PyObjectGetAttrStr.proto */
1263 #if CYTHON_USE_TYPE_SLOTS
1264 static CYTHON_INLINE PyObject
* __Pyx_PyObject_GetAttrStr(PyObject
* obj
, PyObject
* attr_name
);
1266 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1269 /* PyFunctionFastCall.proto */
1270 #if CYTHON_FAST_PYCALL
1271 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1272 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1273 #if 1 || PY_VERSION_HEX < 0x030600B1
1274 static PyObject
*__Pyx_PyFunction_FastCallDict(PyObject
*func
, PyObject
**args
, Py_ssize_t nargs
, PyObject
*kwargs
);
1276 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1278 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1279 (sizeof(char [1 - 2*!(cond)]) - 1)
1280 #ifndef Py_MEMBER_SIZE
1281 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1283 static size_t __pyx_pyframe_localsplus_offset
= 0;
1284 #include "frameobject.h"
1285 #define __Pxy_PyFrame_Initialize_Offsets()\
1286 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1287 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1288 #define __Pyx_PyFrame_GetLocalsplus(frame)\
1289 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1292 /* PyCFunctionFastCall.proto */
1293 #if CYTHON_FAST_PYCCALL
1294 static CYTHON_INLINE PyObject
*__Pyx_PyCFunction_FastCall(PyObject
*func
, PyObject
**args
, Py_ssize_t nargs
);
1296 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1299 /* PyObjectCall.proto */
1300 #if CYTHON_COMPILING_IN_CPYTHON
1301 static CYTHON_INLINE PyObject
* __Pyx_PyObject_Call(PyObject
*func
, PyObject
*arg
, PyObject
*kw
);
1303 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1306 /* PyDictContains.proto */
1307 static CYTHON_INLINE
int __Pyx_PyDict_ContainsTF(PyObject
* item
, PyObject
* dict
, int eq
) {
1308 int result
= PyDict_Contains(dict
, item
);
1309 return unlikely(result
< 0) ? result
: (result
== (eq
== Py_EQ
));
1312 /* DictGetItem.proto */
1313 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
1314 static PyObject
*__Pyx_PyDict_GetItem(PyObject
*d
, PyObject
* key
);
1315 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
1316 (likely(PyDict_CheckExact(obj)) ?\
1317 __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
1319 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
1320 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
1323 /* GetBuiltinName.proto */
1324 static PyObject
*__Pyx_GetBuiltinName(PyObject
*name
);
1326 /* GetModuleGlobalName.proto */
1327 #if CYTHON_USE_DICT_VERSIONS
1328 #define __Pyx_GetModuleGlobalName(var, name) {\
1329 static PY_UINT64_T __pyx_dict_version = 0;\
1330 static PyObject *__pyx_dict_cached_value = NULL;\
1331 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1332 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1333 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1335 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1336 PY_UINT64_T __pyx_dict_version;\
1337 PyObject *__pyx_dict_cached_value;\
1338 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1340 static PyObject
*__Pyx__GetModuleGlobalName(PyObject
*name
, PY_UINT64_T
*dict_version
, PyObject
**dict_cached_value
);
1342 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1343 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1344 static CYTHON_INLINE PyObject
*__Pyx__GetModuleGlobalName(PyObject
*name
);
1347 /* WriteUnraisableException.proto */
1348 static void __Pyx_WriteUnraisable(const char *name
, int clineno
,
1349 int lineno
, const char *filename
,
1350 int full_traceback
, int nogil
);
1352 /* RaiseDoubleKeywords.proto */
1353 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name
, PyObject
* kw_name
);
1355 /* ParseKeywords.proto */
1356 static int __Pyx_ParseOptionalKeywords(PyObject
*kwds
, PyObject
**argnames
[],\
1357 PyObject
*kwds2
, PyObject
*values
[], Py_ssize_t num_pos_args
,\
1358 const char* function_name
);
1360 /* PyErrExceptionMatches.proto */
1361 #if CYTHON_FAST_THREAD_STATE
1362 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1363 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState
* tstate
, PyObject
* err
);
1365 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1369 static CYTHON_INLINE PyObject
*__Pyx_GetAttr(PyObject
*, PyObject
*);
1371 /* GetAttr3.proto */
1372 static CYTHON_INLINE PyObject
*__Pyx_GetAttr3(PyObject
*, PyObject
*, PyObject
*);
1375 static PyObject
*__Pyx_Import(PyObject
*name
, PyObject
*from_list
, int level
);
1377 /* ImportFrom.proto */
1378 static PyObject
* __Pyx_ImportFrom(PyObject
* module
, PyObject
* name
);
1380 /* PyObjectCall2Args.proto */
1381 static CYTHON_UNUSED PyObject
* __Pyx_PyObject_Call2Args(PyObject
* function
, PyObject
* arg1
, PyObject
* arg2
);
1383 /* PyObjectCallMethO.proto */
1384 #if CYTHON_COMPILING_IN_CPYTHON
1385 static CYTHON_INLINE PyObject
* __Pyx_PyObject_CallMethO(PyObject
*func
, PyObject
*arg
);
1388 /* PyObjectCallOneArg.proto */
1389 static CYTHON_INLINE PyObject
* __Pyx_PyObject_CallOneArg(PyObject
*func
, PyObject
*arg
);
1391 /* RaiseException.proto */
1392 static void __Pyx_Raise(PyObject
*type
, PyObject
*value
, PyObject
*tb
, PyObject
*cause
);
1394 /* GetItemInt.proto */
1395 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1396 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1397 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1398 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1399 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1400 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1401 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1402 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1403 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1404 static CYTHON_INLINE PyObject
*__Pyx_GetItemInt_List_Fast(PyObject
*o
, Py_ssize_t i
,
1405 int wraparound
, int boundscheck
);
1406 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1407 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1408 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1409 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1410 static CYTHON_INLINE PyObject
*__Pyx_GetItemInt_Tuple_Fast(PyObject
*o
, Py_ssize_t i
,
1411 int wraparound
, int boundscheck
);
1412 static PyObject
*__Pyx_GetItemInt_Generic(PyObject
*o
, PyObject
* j
);
1413 static CYTHON_INLINE PyObject
*__Pyx_GetItemInt_Fast(PyObject
*o
, Py_ssize_t i
,
1414 int is_list
, int wraparound
, int boundscheck
);
1417 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject
*, PyObject
*);
1419 /* PyObject_GenericGetAttrNoDict.proto */
1420 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1421 static CYTHON_INLINE PyObject
* __Pyx_PyObject_GenericGetAttrNoDict(PyObject
* obj
, PyObject
* attr_name
);
1423 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1426 /* PyObject_GenericGetAttr.proto */
1427 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1428 static PyObject
* __Pyx_PyObject_GenericGetAttr(PyObject
* obj
, PyObject
* attr_name
);
1430 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1433 /* SetVTable.proto */
1434 static int __Pyx_SetVtable(PyObject
*dict
, void *vtable
);
1436 /* SetupReduce.proto */
1437 static int __Pyx_setup_reduce(PyObject
* type_obj
);
1439 /* CLineInTraceback.proto */
1440 #ifdef CYTHON_CLINE_IN_TRACEBACK
1441 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1443 static int __Pyx_CLineForTraceback(PyThreadState
*tstate
, int c_line
);
1446 /* CodeObjectCache.proto */
1448 PyCodeObject
* code_object
;
1450 } __Pyx_CodeObjectCacheEntry
;
1451 struct __Pyx_CodeObjectCache
{
1454 __Pyx_CodeObjectCacheEntry
* entries
;
1456 static struct __Pyx_CodeObjectCache __pyx_code_cache
= {0,0,NULL
};
1457 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry
* entries
, int count
, int code_line
);
1458 static PyCodeObject
*__pyx_find_code_object(int code_line
);
1459 static void __pyx_insert_code_object(int code_line
, PyCodeObject
* code_object
);
1461 /* AddTraceback.proto */
1462 static void __Pyx_AddTraceback(const char *funcname
, int c_line
,
1463 int py_line
, const char *filename
);
1465 /* CIntToPy.proto */
1466 static CYTHON_INLINE PyObject
* __Pyx_PyInt_From_int(int value
);
1468 /* CIntToPy.proto */
1469 static CYTHON_INLINE PyObject
* __Pyx_PyInt_From_long(long value
);
1471 /* CIntFromPy.proto */
1472 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject
*);
1474 /* CIntFromPy.proto */
1475 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject
*);
1477 /* FastTypeChecks.proto */
1478 #if CYTHON_COMPILING_IN_CPYTHON
1479 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1480 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject
*a
, PyTypeObject
*b
);
1481 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject
*err
, PyObject
*type
);
1482 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject
*err
, PyObject
*type1
, PyObject
*type2
);
1484 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1485 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1486 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1488 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1490 /* CheckBinaryVersion.proto */
1491 static int __Pyx_check_binary_version(void);
1493 /* InitStrings.proto */
1494 static int __Pyx_InitStrings(__Pyx_StringTabEntry
*t
);
1496 static float __pyx_f_5MACS2_10Statistics_18P_Score_Upper_Tail_get_pscore(struct __pyx_obj_5MACS2_10Statistics_P_Score_Upper_Tail
*__pyx_v_self
, int __pyx_v_x
, float __pyx_v_l
, int __pyx_skip_dispatch
); /* proto*/
1497 static float __pyx_f_5MACS2_10Statistics_10LogLR_Asym_get_logLR_asym(struct __pyx_obj_5MACS2_10Statistics_LogLR_Asym
*__pyx_v_self
, float __pyx_v_x
, float __pyx_v_y
, int __pyx_skip_dispatch
); /* proto*/
1498 static float __pyx_f_5MACS2_10Statistics_9LogLR_Sym_get_logLR_sym(struct __pyx_obj_5MACS2_10Statistics_LogLR_Sym
*__pyx_v_self
, float __pyx_v_x
, float __pyx_v_y
, int __pyx_skip_dispatch
); /* proto*/
1499 static float __pyx_f_5MACS2_10Statistics_10LogLR_Diff_get_logLR_diff(struct __pyx_obj_5MACS2_10Statistics_LogLR_Diff
*__pyx_v_self
, float __pyx_v_x
, float __pyx_v_y
, int __pyx_skip_dispatch
); /* proto*/
1501 /* Module declarations from 'libc.math' */
1503 /* Module declarations from 'MACS2.Statistics' */
1504 static PyTypeObject
*__pyx_ptype_5MACS2_10Statistics_P_Score_Upper_Tail
= 0;
1505 static PyTypeObject
*__pyx_ptype_5MACS2_10Statistics_LogLR_Asym
= 0;
1506 static PyTypeObject
*__pyx_ptype_5MACS2_10Statistics_LogLR_Sym
= 0;
1507 static PyTypeObject
*__pyx_ptype_5MACS2_10Statistics_LogLR_Diff
= 0;
1508 static PyObject
*__pyx_f_5MACS2_10Statistics___pyx_unpickle_P_Score_Upper_Tail__set_state(struct __pyx_obj_5MACS2_10Statistics_P_Score_Upper_Tail
*, PyObject
*); /*proto*/
1509 static PyObject
*__pyx_f_5MACS2_10Statistics___pyx_unpickle_LogLR_Asym__set_state(struct __pyx_obj_5MACS2_10Statistics_LogLR_Asym
*, PyObject
*); /*proto*/
1510 static PyObject
*__pyx_f_5MACS2_10Statistics___pyx_unpickle_LogLR_Sym__set_state(struct __pyx_obj_5MACS2_10Statistics_LogLR_Sym
*, PyObject
*); /*proto*/
1511 static PyObject
*__pyx_f_5MACS2_10Statistics___pyx_unpickle_LogLR_Diff__set_state(struct __pyx_obj_5MACS2_10Statistics_LogLR_Diff
*, PyObject
*); /*proto*/
1512 #define __Pyx_MODULE_NAME "MACS2.Statistics"
1513 extern int __pyx_module_is_main_MACS2__Statistics
;
1514 int __pyx_module_is_main_MACS2__Statistics
= 0;
1516 /* Implementation of 'MACS2.Statistics' */
1517 static const char __pyx_k_l
[] = "l";
1518 static const char __pyx_k_x
[] = "x";
1519 static const char __pyx_k_y
[] = "y";
1520 static const char __pyx_k_new
[] = "__new__";
1521 static const char __pyx_k_dict
[] = "__dict__";
1522 static const char __pyx_k_main
[] = "__main__";
1523 static const char __pyx_k_name
[] = "__name__";
1524 static const char __pyx_k_test
[] = "__test__";
1525 static const char __pyx_k_import
[] = "__import__";
1526 static const char __pyx_k_pickle
[] = "pickle";
1527 static const char __pyx_k_reduce
[] = "__reduce__";
1528 static const char __pyx_k_update
[] = "update";
1529 static const char __pyx_k_getstate
[] = "__getstate__";
1530 static const char __pyx_k_pyx_type
[] = "__pyx_type";
1531 static const char __pyx_k_setstate
[] = "__setstate__";
1532 static const char __pyx_k_LogLR_Sym
[] = "LogLR_Sym";
1533 static const char __pyx_k_pyx_state
[] = "__pyx_state";
1534 static const char __pyx_k_reduce_ex
[] = "__reduce_ex__";
1535 static const char __pyx_k_LogLR_Asym
[] = "LogLR_Asym";
1536 static const char __pyx_k_LogLR_Diff
[] = "LogLR_Diff";
1537 static const char __pyx_k_MACS2_Prob
[] = "MACS2.Prob";
1538 static const char __pyx_k_get_pscore
[] = "get_pscore";
1539 static const char __pyx_k_pyx_result
[] = "__pyx_result";
1540 static const char __pyx_k_pyx_vtable
[] = "__pyx_vtable__";
1541 static const char __pyx_k_PickleError
[] = "PickleError";
1542 static const char __pyx_k_poisson_cdf
[] = "poisson_cdf";
1543 static const char __pyx_k_pyx_checksum
[] = "__pyx_checksum";
1544 static const char __pyx_k_stringsource
[] = "stringsource";
1545 static const char __pyx_k_get_logLR_sym
[] = "get_logLR_sym";
1546 static const char __pyx_k_reduce_cython
[] = "__reduce_cython__";
1547 static const char __pyx_k_get_logLR_asym
[] = "get_logLR_asym";
1548 static const char __pyx_k_get_logLR_diff
[] = "get_logLR_diff";
1549 static const char __pyx_k_pyx_PickleError
[] = "__pyx_PickleError";
1550 static const char __pyx_k_setstate_cython
[] = "__setstate_cython__";
1551 static const char __pyx_k_MACS2_Statistics
[] = "MACS2.Statistics";
1552 static const char __pyx_k_P_Score_Upper_Tail
[] = "P_Score_Upper_Tail";
1553 static const char __pyx_k_cline_in_traceback
[] = "cline_in_traceback";
1554 static const char __pyx_k_pyx_unpickle_LogLR_Sym
[] = "__pyx_unpickle_LogLR_Sym";
1555 static const char __pyx_k_pyx_unpickle_LogLR_Asym
[] = "__pyx_unpickle_LogLR_Asym";
1556 static const char __pyx_k_pyx_unpickle_LogLR_Diff
[] = "__pyx_unpickle_LogLR_Diff";
1557 static const char __pyx_k_pyx_unpickle_P_Score_Upper_Tai
[] = "__pyx_unpickle_P_Score_Upper_Tail";
1558 static const char __pyx_k_Incompatible_checksums_s_vs_0x08
[] = "Incompatible checksums (%s vs 0x086441e = (logLR_dict))";
1559 static const char __pyx_k_Incompatible_checksums_s_vs_0xf5
[] = "Incompatible checksums (%s vs 0xf502884 = (pscore_dict))";
1560 static const char __pyx_k_Module_Description_Statistics_fu
[] = "Module Description: Statistics function wrappers.\n\nThis code is free software; you can redistribute it and/or modify it\nunder the terms of the BSD License (see the file LICENSE included with\nthe distribution).\n";
1561 static PyObject
*__pyx_kp_s_Incompatible_checksums_s_vs_0x08
;
1562 static PyObject
*__pyx_kp_s_Incompatible_checksums_s_vs_0xf5
;
1563 static PyObject
*__pyx_n_s_LogLR_Asym
;
1564 static PyObject
*__pyx_n_s_LogLR_Diff
;
1565 static PyObject
*__pyx_n_s_LogLR_Sym
;
1566 static PyObject
*__pyx_n_s_MACS2_Prob
;
1567 static PyObject
*__pyx_n_s_MACS2_Statistics
;
1568 static PyObject
*__pyx_n_s_P_Score_Upper_Tail
;
1569 static PyObject
*__pyx_n_s_PickleError
;
1570 static PyObject
*__pyx_n_s_cline_in_traceback
;
1571 static PyObject
*__pyx_n_s_dict
;
1572 static PyObject
*__pyx_n_s_get_logLR_asym
;
1573 static PyObject
*__pyx_n_s_get_logLR_diff
;
1574 static PyObject
*__pyx_n_s_get_logLR_sym
;
1575 static PyObject
*__pyx_n_s_get_pscore
;
1576 static PyObject
*__pyx_n_s_getstate
;
1577 static PyObject
*__pyx_n_s_import
;
1578 static PyObject
*__pyx_n_s_l
;
1579 static PyObject
*__pyx_n_s_main
;
1580 static PyObject
*__pyx_n_s_name
;
1581 static PyObject
*__pyx_n_s_new
;
1582 static PyObject
*__pyx_n_s_pickle
;
1583 static PyObject
*__pyx_n_s_poisson_cdf
;
1584 static PyObject
*__pyx_n_s_pyx_PickleError
;
1585 static PyObject
*__pyx_n_s_pyx_checksum
;
1586 static PyObject
*__pyx_n_s_pyx_result
;
1587 static PyObject
*__pyx_n_s_pyx_state
;
1588 static PyObject
*__pyx_n_s_pyx_type
;
1589 static PyObject
*__pyx_n_s_pyx_unpickle_LogLR_Asym
;
1590 static PyObject
*__pyx_n_s_pyx_unpickle_LogLR_Diff
;
1591 static PyObject
*__pyx_n_s_pyx_unpickle_LogLR_Sym
;
1592 static PyObject
*__pyx_n_s_pyx_unpickle_P_Score_Upper_Tai
;
1593 static PyObject
*__pyx_n_s_pyx_vtable
;
1594 static PyObject
*__pyx_n_s_reduce
;
1595 static PyObject
*__pyx_n_s_reduce_cython
;
1596 static PyObject
*__pyx_n_s_reduce_ex
;
1597 static PyObject
*__pyx_n_s_setstate
;
1598 static PyObject
*__pyx_n_s_setstate_cython
;
1599 static PyObject
*__pyx_kp_s_stringsource
;
1600 static PyObject
*__pyx_n_s_test
;
1601 static PyObject
*__pyx_n_s_update
;
1602 static PyObject
*__pyx_n_s_x
;
1603 static PyObject
*__pyx_n_s_y
;
1604 static int __pyx_pf_5MACS2_10Statistics_18P_Score_Upper_Tail___init__(struct __pyx_obj_5MACS2_10Statistics_P_Score_Upper_Tail
*__pyx_v_self
); /* proto */
1605 static PyObject
*__pyx_pf_5MACS2_10Statistics_18P_Score_Upper_Tail_2get_pscore(struct __pyx_obj_5MACS2_10Statistics_P_Score_Upper_Tail
*__pyx_v_self
, int __pyx_v_x
, float __pyx_v_l
); /* proto */
1606 static PyObject
*__pyx_pf_5MACS2_10Statistics_18P_Score_Upper_Tail_4__reduce_cython__(struct __pyx_obj_5MACS2_10Statistics_P_Score_Upper_Tail
*__pyx_v_self
); /* proto */
1607 static PyObject
*__pyx_pf_5MACS2_10Statistics_18P_Score_Upper_Tail_6__setstate_cython__(struct __pyx_obj_5MACS2_10Statistics_P_Score_Upper_Tail
*__pyx_v_self
, PyObject
*__pyx_v___pyx_state
); /* proto */
1608 static int __pyx_pf_5MACS2_10Statistics_10LogLR_Asym___init__(struct __pyx_obj_5MACS2_10Statistics_LogLR_Asym
*__pyx_v_self
); /* proto */
1609 static PyObject
*__pyx_pf_5MACS2_10Statistics_10LogLR_Asym_2get_logLR_asym(struct __pyx_obj_5MACS2_10Statistics_LogLR_Asym
*__pyx_v_self
, float __pyx_v_x
, float __pyx_v_y
); /* proto */
1610 static PyObject
*__pyx_pf_5MACS2_10Statistics_10LogLR_Asym_4__reduce_cython__(struct __pyx_obj_5MACS2_10Statistics_LogLR_Asym
*__pyx_v_self
); /* proto */
1611 static PyObject
*__pyx_pf_5MACS2_10Statistics_10LogLR_Asym_6__setstate_cython__(struct __pyx_obj_5MACS2_10Statistics_LogLR_Asym
*__pyx_v_self
, PyObject
*__pyx_v___pyx_state
); /* proto */
1612 static int __pyx_pf_5MACS2_10Statistics_9LogLR_Sym___init__(struct __pyx_obj_5MACS2_10Statistics_LogLR_Sym
*__pyx_v_self
); /* proto */
1613 static PyObject
*__pyx_pf_5MACS2_10Statistics_9LogLR_Sym_2get_logLR_sym(struct __pyx_obj_5MACS2_10Statistics_LogLR_Sym
*__pyx_v_self
, float __pyx_v_x
, float __pyx_v_y
); /* proto */
1614 static PyObject
*__pyx_pf_5MACS2_10Statistics_9LogLR_Sym_4__reduce_cython__(struct __pyx_obj_5MACS2_10Statistics_LogLR_Sym
*__pyx_v_self
); /* proto */
1615 static PyObject
*__pyx_pf_5MACS2_10Statistics_9LogLR_Sym_6__setstate_cython__(struct __pyx_obj_5MACS2_10Statistics_LogLR_Sym
*__pyx_v_self
, PyObject
*__pyx_v___pyx_state
); /* proto */
1616 static int __pyx_pf_5MACS2_10Statistics_10LogLR_Diff___init__(struct __pyx_obj_5MACS2_10Statistics_LogLR_Diff
*__pyx_v_self
); /* proto */
1617 static PyObject
*__pyx_pf_5MACS2_10Statistics_10LogLR_Diff_2get_logLR_diff(struct __pyx_obj_5MACS2_10Statistics_LogLR_Diff
*__pyx_v_self
, float __pyx_v_x
, float __pyx_v_y
); /* proto */
1618 static PyObject
*__pyx_pf_5MACS2_10Statistics_10LogLR_Diff_4__reduce_cython__(struct __pyx_obj_5MACS2_10Statistics_LogLR_Diff
*__pyx_v_self
); /* proto */
1619 static PyObject
*__pyx_pf_5MACS2_10Statistics_10LogLR_Diff_6__setstate_cython__(struct __pyx_obj_5MACS2_10Statistics_LogLR_Diff
*__pyx_v_self
, PyObject
*__pyx_v___pyx_state
); /* proto */
1620 static PyObject
*__pyx_pf_5MACS2_10Statistics___pyx_unpickle_P_Score_Upper_Tail(CYTHON_UNUSED PyObject
*__pyx_self
, PyObject
*__pyx_v___pyx_type
, long __pyx_v___pyx_checksum
, PyObject
*__pyx_v___pyx_state
); /* proto */
1621 static PyObject
*__pyx_pf_5MACS2_10Statistics_2__pyx_unpickle_LogLR_Asym(CYTHON_UNUSED PyObject
*__pyx_self
, PyObject
*__pyx_v___pyx_type
, long __pyx_v___pyx_checksum
, PyObject
*__pyx_v___pyx_state
); /* proto */
1622 static PyObject
*__pyx_pf_5MACS2_10Statistics_4__pyx_unpickle_LogLR_Sym(CYTHON_UNUSED PyObject
*__pyx_self
, PyObject
*__pyx_v___pyx_type
, long __pyx_v___pyx_checksum
, PyObject
*__pyx_v___pyx_state
); /* proto */
1623 static PyObject
*__pyx_pf_5MACS2_10Statistics_6__pyx_unpickle_LogLR_Diff(CYTHON_UNUSED PyObject
*__pyx_self
, PyObject
*__pyx_v___pyx_type
, long __pyx_v___pyx_checksum
, PyObject
*__pyx_v___pyx_state
); /* proto */
1624 static PyObject
*__pyx_tp_new_5MACS2_10Statistics_P_Score_Upper_Tail(PyTypeObject
*t
, PyObject
*a
, PyObject
*k
); /*proto*/
1625 static PyObject
*__pyx_tp_new_5MACS2_10Statistics_LogLR_Asym(PyTypeObject
*t
, PyObject
*a
, PyObject
*k
); /*proto*/
1626 static PyObject
*__pyx_tp_new_5MACS2_10Statistics_LogLR_Sym(PyTypeObject
*t
, PyObject
*a
, PyObject
*k
); /*proto*/
1627 static PyObject
*__pyx_tp_new_5MACS2_10Statistics_LogLR_Diff(PyTypeObject
*t
, PyObject
*a
, PyObject
*k
); /*proto*/
1628 static PyObject
*__pyx_int_8799262
;
1629 static PyObject
*__pyx_int_256911492
;
1630 static PyObject
*__pyx_int_neg_1
;
1631 static PyObject
*__pyx_codeobj_
;
1632 static PyObject
*__pyx_tuple__5
;
1633 static PyObject
*__pyx_tuple__6
;
1634 static PyObject
*__pyx_tuple__7
;
1635 static PyObject
*__pyx_tuple__8
;
1636 static PyObject
*__pyx_codeobj__2
;
1637 static PyObject
*__pyx_codeobj__3
;
1638 static PyObject
*__pyx_codeobj__4
;
1641 /* "MACS2/Statistics.pyx":22
1644 * def __init__ ( self ): # <<<<<<<<<<<<<<
1645 * self.pscore_dict = dict()
1649 /* Python wrapper */
1650 static int __pyx_pw_5MACS2_10Statistics_18P_Score_Upper_Tail_1__init__(PyObject
*__pyx_v_self
, PyObject
*__pyx_args
, PyObject
*__pyx_kwds
); /*proto*/
1651 static int __pyx_pw_5MACS2_10Statistics_18P_Score_Upper_Tail_1__init__(PyObject
*__pyx_v_self
, PyObject
*__pyx_args
, PyObject
*__pyx_kwds
) {
1653 __Pyx_RefNannyDeclarations
1654 __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
1655 if (unlikely(PyTuple_GET_SIZE(__pyx_args
) > 0)) {
1656 __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args
)); return -1;}
1657 if (unlikely(__pyx_kwds
) && unlikely(PyDict_Size(__pyx_kwds
) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds
, "__init__", 0))) return -1;
1658 __pyx_r
= __pyx_pf_5MACS2_10Statistics_18P_Score_Upper_Tail___init__(((struct __pyx_obj_5MACS2_10Statistics_P_Score_Upper_Tail
*)__pyx_v_self
));
1660 /* function exit code */
1661 __Pyx_RefNannyFinishContext();
1665 static int __pyx_pf_5MACS2_10Statistics_18P_Score_Upper_Tail___init__(struct __pyx_obj_5MACS2_10Statistics_P_Score_Upper_Tail
*__pyx_v_self
) {
1667 __Pyx_TraceDeclarations
1668 __Pyx_RefNannyDeclarations
1669 PyObject
*__pyx_t_1
= NULL
;
1670 __Pyx_RefNannySetupContext("__init__", 0);
1671 __Pyx_TraceCall("__init__", __pyx_f
[0], 22, 0, __PYX_ERR(0, 22, __pyx_L1_error
));
1673 /* "MACS2/Statistics.pyx":23
1675 * def __init__ ( self ):
1676 * self.pscore_dict = dict() # <<<<<<<<<<<<<<
1678 * cpdef float get_pscore ( self, int x, float l ):
1680 __pyx_t_1
= __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1
)) __PYX_ERR(0, 23, __pyx_L1_error
)
1681 __Pyx_GOTREF(__pyx_t_1
);
1682 __Pyx_GIVEREF(__pyx_t_1
);
1683 __Pyx_GOTREF(__pyx_v_self
->pscore_dict
);
1684 __Pyx_DECREF(__pyx_v_self
->pscore_dict
);
1685 __pyx_v_self
->pscore_dict
= ((PyObject
*)__pyx_t_1
);
1688 /* "MACS2/Statistics.pyx":22
1691 * def __init__ ( self ): # <<<<<<<<<<<<<<
1692 * self.pscore_dict = dict()
1696 /* function exit code */
1700 __Pyx_XDECREF(__pyx_t_1
);
1701 __Pyx_AddTraceback("MACS2.Statistics.P_Score_Upper_Tail.__init__", __pyx_clineno
, __pyx_lineno
, __pyx_filename
);
1704 __Pyx_TraceReturn(Py_None
, 0);
1705 __Pyx_RefNannyFinishContext();
1709 /* "MACS2/Statistics.pyx":25
1710 * self.pscore_dict = dict()
1712 * cpdef float get_pscore ( self, int x, float l ): # <<<<<<<<<<<<<<
1717 static PyObject
*__pyx_pw_5MACS2_10Statistics_18P_Score_Upper_Tail_3get_pscore(PyObject
*__pyx_v_self
, PyObject
*__pyx_args
, PyObject
*__pyx_kwds
); /*proto*/
1718 static float __pyx_f_5MACS2_10Statistics_18P_Score_Upper_Tail_get_pscore(struct __pyx_obj_5MACS2_10Statistics_P_Score_Upper_Tail
*__pyx_v_self
, int __pyx_v_x
, float __pyx_v_l
, int __pyx_skip_dispatch
) {
1721 __Pyx_TraceDeclarations
1722 __Pyx_RefNannyDeclarations
1723 PyObject
*__pyx_t_1
= NULL
;
1724 PyObject
*__pyx_t_2
= NULL
;
1725 PyObject
*__pyx_t_3
= NULL
;
1726 PyObject
*__pyx_t_4
= NULL
;
1727 PyObject
*__pyx_t_5
= NULL
;
1728 PyObject
*__pyx_t_6
= NULL
;
1730 PyObject
*__pyx_t_8
= NULL
;
1734 __Pyx_RefNannySetupContext("get_pscore", 0);
1735 __Pyx_TraceCall("get_pscore", __pyx_f
[0], 25, 0, __PYX_ERR(0, 25, __pyx_L1_error
));
1736 /* Check if called by wrapper */
1737 if (unlikely(__pyx_skip_dispatch
)) ;
1738 /* Check if overridden in Python */
1739 else if (unlikely((Py_TYPE(((PyObject
*)__pyx_v_self
))->tp_dictoffset
!= 0) || (Py_TYPE(((PyObject
*)__pyx_v_self
))->tp_flags
& (Py_TPFLAGS_IS_ABSTRACT
| Py_TPFLAGS_HEAPTYPE
)))) {
1740 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
1741 static PY_UINT64_T __pyx_tp_dict_version
= __PYX_DICT_VERSION_INIT
, __pyx_obj_dict_version
= __PYX_DICT_VERSION_INIT
;
1742 if (unlikely(!__Pyx_object_dict_version_matches(((PyObject
*)__pyx_v_self
), __pyx_tp_dict_version
, __pyx_obj_dict_version
))) {
1743 PY_UINT64_T __pyx_type_dict_guard
= __Pyx_get_tp_dict_version(((PyObject
*)__pyx_v_self
));
1745 __pyx_t_1
= __Pyx_PyObject_GetAttrStr(((PyObject
*)__pyx_v_self
), __pyx_n_s_get_pscore
); if (unlikely(!__pyx_t_1
)) __PYX_ERR(0, 25, __pyx_L1_error
)
1746 __Pyx_GOTREF(__pyx_t_1
);
1747 if (!PyCFunction_Check(__pyx_t_1
) || (PyCFunction_GET_FUNCTION(__pyx_t_1
) != (PyCFunction
)(void*)__pyx_pw_5MACS2_10Statistics_18P_Score_Upper_Tail_3get_pscore
)) {
1748 __pyx_t_3
= __Pyx_PyInt_From_int(__pyx_v_x
); if (unlikely(!__pyx_t_3
)) __PYX_ERR(0, 25, __pyx_L1_error
)
1749 __Pyx_GOTREF(__pyx_t_3
);
1750 __pyx_t_4
= PyFloat_FromDouble(__pyx_v_l
); if (unlikely(!__pyx_t_4
)) __PYX_ERR(0, 25, __pyx_L1_error
)
1751 __Pyx_GOTREF(__pyx_t_4
);
1752 __Pyx_INCREF(__pyx_t_1
);
1753 __pyx_t_5
= __pyx_t_1
; __pyx_t_6
= NULL
;
1755 if (CYTHON_UNPACK_METHODS
&& unlikely(PyMethod_Check(__pyx_t_5
))) {
1756 __pyx_t_6
= PyMethod_GET_SELF(__pyx_t_5
);
1757 if (likely(__pyx_t_6
)) {
1758 PyObject
* function
= PyMethod_GET_FUNCTION(__pyx_t_5
);
1759 __Pyx_INCREF(__pyx_t_6
);
1760 __Pyx_INCREF(function
);
1761 __Pyx_DECREF_SET(__pyx_t_5
, function
);
1765 #if CYTHON_FAST_PYCALL
1766 if (PyFunction_Check(__pyx_t_5
)) {
1767 PyObject
*__pyx_temp
[3] = {__pyx_t_6
, __pyx_t_3
, __pyx_t_4
};
1768 __pyx_t_2
= __Pyx_PyFunction_FastCall(__pyx_t_5
, __pyx_temp
+1-__pyx_t_7
, 2+__pyx_t_7
); if (unlikely(!__pyx_t_2
)) __PYX_ERR(0, 25, __pyx_L1_error
)
1769 __Pyx_XDECREF(__pyx_t_6
); __pyx_t_6
= 0;
1770 __Pyx_GOTREF(__pyx_t_2
);
1771 __Pyx_DECREF(__pyx_t_3
); __pyx_t_3
= 0;
1772 __Pyx_DECREF(__pyx_t_4
); __pyx_t_4
= 0;
1775 #if CYTHON_FAST_PYCCALL
1776 if (__Pyx_PyFastCFunction_Check(__pyx_t_5
)) {
1777 PyObject
*__pyx_temp
[3] = {__pyx_t_6
, __pyx_t_3
, __pyx_t_4
};
1778 __pyx_t_2
= __Pyx_PyCFunction_FastCall(__pyx_t_5
, __pyx_temp
+1-__pyx_t_7
, 2+__pyx_t_7
); if (unlikely(!__pyx_t_2
)) __PYX_ERR(0, 25, __pyx_L1_error
)
1779 __Pyx_XDECREF(__pyx_t_6
); __pyx_t_6
= 0;
1780 __Pyx_GOTREF(__pyx_t_2
);
1781 __Pyx_DECREF(__pyx_t_3
); __pyx_t_3
= 0;
1782 __Pyx_DECREF(__pyx_t_4
); __pyx_t_4
= 0;
1786 __pyx_t_8
= PyTuple_New(2+__pyx_t_7
); if (unlikely(!__pyx_t_8
)) __PYX_ERR(0, 25, __pyx_L1_error
)
1787 __Pyx_GOTREF(__pyx_t_8
);
1789 __Pyx_GIVEREF(__pyx_t_6
); PyTuple_SET_ITEM(__pyx_t_8
, 0, __pyx_t_6
); __pyx_t_6
= NULL
;
1791 __Pyx_GIVEREF(__pyx_t_3
);
1792 PyTuple_SET_ITEM(__pyx_t_8
, 0+__pyx_t_7
, __pyx_t_3
);
1793 __Pyx_GIVEREF(__pyx_t_4
);
1794 PyTuple_SET_ITEM(__pyx_t_8
, 1+__pyx_t_7
, __pyx_t_4
);
1797 __pyx_t_2
= __Pyx_PyObject_Call(__pyx_t_5
, __pyx_t_8
, NULL
); if (unlikely(!__pyx_t_2
)) __PYX_ERR(0, 25, __pyx_L1_error
)
1798 __Pyx_GOTREF(__pyx_t_2
);
1799 __Pyx_DECREF(__pyx_t_8
); __pyx_t_8
= 0;
1801 __Pyx_DECREF(__pyx_t_5
); __pyx_t_5
= 0;
1802 __pyx_t_9
= __pyx_PyFloat_AsFloat(__pyx_t_2
); if (unlikely((__pyx_t_9
== (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 25, __pyx_L1_error
)
1803 __Pyx_DECREF(__pyx_t_2
); __pyx_t_2
= 0;
1804 __pyx_r
= __pyx_t_9
;
1805 __Pyx_DECREF(__pyx_t_1
); __pyx_t_1
= 0;
1808 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
1809 __pyx_tp_dict_version
= __Pyx_get_tp_dict_version(((PyObject
*)__pyx_v_self
));
1810 __pyx_obj_dict_version
= __Pyx_get_object_dict_version(((PyObject
*)__pyx_v_self
));
1811 if (unlikely(__pyx_type_dict_guard
!= __pyx_tp_dict_version
)) {
1812 __pyx_tp_dict_version
= __pyx_obj_dict_version
= __PYX_DICT_VERSION_INIT
;
1815 __Pyx_DECREF(__pyx_t_1
); __pyx_t_1
= 0;
1816 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
1821 /* "MACS2/Statistics.pyx":29
1824 * if ( x, l ) in self.pscore_dict: # <<<<<<<<<<<<<<
1825 * return self.pscore_dict [ (x, l ) ]
1828 __pyx_t_1
= __Pyx_PyInt_From_int(__pyx_v_x
); if (unlikely(!__pyx_t_1
)) __PYX_ERR(0, 29, __pyx_L1_error
)
1829 __Pyx_GOTREF(__pyx_t_1
);
1830 __pyx_t_2
= PyFloat_FromDouble(__pyx_v_l
); if (unlikely(!__pyx_t_2
)) __PYX_ERR(0, 29, __pyx_L1_error
)
1831 __Pyx_GOTREF(__pyx_t_2
);
1832 __pyx_t_5
= PyTuple_New(2); if (unlikely(!__pyx_t_5
)) __PYX_ERR(0, 29, __pyx_L1_error
)
1833 __Pyx_GOTREF(__pyx_t_5
);
1834 __Pyx_GIVEREF(__pyx_t_1
);
1835 PyTuple_SET_ITEM(__pyx_t_5
, 0, __pyx_t_1
);
1836 __Pyx_GIVEREF(__pyx_t_2
);
1837 PyTuple_SET_ITEM(__pyx_t_5
, 1, __pyx_t_2
);
1840 if (unlikely(__pyx_v_self
->pscore_dict
== Py_None
)) {
1841 PyErr_SetString(PyExc_TypeError
, "'NoneType' object is not iterable");
1842 __PYX_ERR(0, 29, __pyx_L1_error
)
1844 __pyx_t_10
= (__Pyx_PyDict_ContainsTF(__pyx_t_5
, __pyx_v_self
->pscore_dict
, Py_EQ
)); if (unlikely(__pyx_t_10
< 0)) __PYX_ERR(0, 29, __pyx_L1_error
)
1845 __Pyx_DECREF(__pyx_t_5
); __pyx_t_5
= 0;
1846 __pyx_t_11
= (__pyx_t_10
!= 0);
1849 /* "MACS2/Statistics.pyx":30
1851 * if ( x, l ) in self.pscore_dict:
1852 * return self.pscore_dict [ (x, l ) ] # <<<<<<<<<<<<<<
1854 * # calculate and cache
1856 if (unlikely(__pyx_v_self
->pscore_dict
== Py_None
)) {
1857 PyErr_SetString(PyExc_TypeError
, "'NoneType' object is not subscriptable");
1858 __PYX_ERR(0, 30, __pyx_L1_error
)
1860 __pyx_t_5
= __Pyx_PyInt_From_int(__pyx_v_x
); if (unlikely(!__pyx_t_5
)) __PYX_ERR(0, 30, __pyx_L1_error
)
1861 __Pyx_GOTREF(__pyx_t_5
);
1862 __pyx_t_2
= PyFloat_FromDouble(__pyx_v_l
); if (unlikely(!__pyx_t_2
)) __PYX_ERR(0, 30, __pyx_L1_error
)
1863 __Pyx_GOTREF(__pyx_t_2
);
1864 __pyx_t_1
= PyTuple_New(2); if (unlikely(!__pyx_t_1
)) __PYX_ERR(0, 30, __pyx_L1_error
)
1865 __Pyx_GOTREF(__pyx_t_1
);
1866 __Pyx_GIVEREF(__pyx_t_5
);
1867 PyTuple_SET_ITEM(__pyx_t_1
, 0, __pyx_t_5
);
1868 __Pyx_GIVEREF(__pyx_t_2
);
1869 PyTuple_SET_ITEM(__pyx_t_1
, 1, __pyx_t_2
);
1872 __pyx_t_2
= __Pyx_PyDict_GetItem(__pyx_v_self
->pscore_dict
, __pyx_t_1
); if (unlikely(!__pyx_t_2
)) __PYX_ERR(0, 30, __pyx_L1_error
)
1873 __Pyx_GOTREF(__pyx_t_2
);
1874 __Pyx_DECREF(__pyx_t_1
); __pyx_t_1
= 0;
1875 __pyx_t_9
= __pyx_PyFloat_AsFloat(__pyx_t_2
); if (unlikely((__pyx_t_9
== (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 30, __pyx_L1_error
)
1876 __Pyx_DECREF(__pyx_t_2
); __pyx_t_2
= 0;
1877 __pyx_r
= __pyx_t_9
;
1880 /* "MACS2/Statistics.pyx":29
1883 * if ( x, l ) in self.pscore_dict: # <<<<<<<<<<<<<<
1884 * return self.pscore_dict [ (x, l ) ]
1889 /* "MACS2/Statistics.pyx":33
1891 * # calculate and cache
1892 * val = -1 * poisson_cdf ( x, l, False, True ) # <<<<<<<<<<<<<<
1893 * self.pscore_dict[ ( x, l ) ] = val
1897 __Pyx_GetModuleGlobalName(__pyx_t_1
, __pyx_n_s_poisson_cdf
); if (unlikely(!__pyx_t_1
)) __PYX_ERR(0, 33, __pyx_L1_error
)
1898 __Pyx_GOTREF(__pyx_t_1
);
1899 __pyx_t_5
= __Pyx_PyInt_From_int(__pyx_v_x
); if (unlikely(!__pyx_t_5
)) __PYX_ERR(0, 33, __pyx_L1_error
)
1900 __Pyx_GOTREF(__pyx_t_5
);
1901 __pyx_t_8
= PyFloat_FromDouble(__pyx_v_l
); if (unlikely(!__pyx_t_8
)) __PYX_ERR(0, 33, __pyx_L1_error
)
1902 __Pyx_GOTREF(__pyx_t_8
);
1905 if (CYTHON_UNPACK_METHODS
&& unlikely(PyMethod_Check(__pyx_t_1
))) {
1906 __pyx_t_4
= PyMethod_GET_SELF(__pyx_t_1
);
1907 if (likely(__pyx_t_4
)) {
1908 PyObject
* function
= PyMethod_GET_FUNCTION(__pyx_t_1
);
1909 __Pyx_INCREF(__pyx_t_4
);
1910 __Pyx_INCREF(function
);
1911 __Pyx_DECREF_SET(__pyx_t_1
, function
);
1915 #if CYTHON_FAST_PYCALL
1916 if (PyFunction_Check(__pyx_t_1
)) {
1917 PyObject
*__pyx_temp
[5] = {__pyx_t_4
, __pyx_t_5
, __pyx_t_8
, Py_False
, Py_True
};
1918 __pyx_t_2
= __Pyx_PyFunction_FastCall(__pyx_t_1
, __pyx_temp
+1-__pyx_t_7
, 4+__pyx_t_7
); if (unlikely(!__pyx_t_2
)) __PYX_ERR(0, 33, __pyx_L1_error
)
1919 __Pyx_XDECREF(__pyx_t_4
); __pyx_t_4
= 0;
1920 __Pyx_GOTREF(__pyx_t_2
);
1921 __Pyx_DECREF(__pyx_t_5
); __pyx_t_5
= 0;
1922 __Pyx_DECREF(__pyx_t_8
); __pyx_t_8
= 0;
1925 #if CYTHON_FAST_PYCCALL
1926 if (__Pyx_PyFastCFunction_Check(__pyx_t_1
)) {
1927 PyObject
*__pyx_temp
[5] = {__pyx_t_4
, __pyx_t_5
, __pyx_t_8
, Py_False
, Py_True
};
1928 __pyx_t_2
= __Pyx_PyCFunction_FastCall(__pyx_t_1
, __pyx_temp
+1-__pyx_t_7
, 4+__pyx_t_7
); if (unlikely(!__pyx_t_2
)) __PYX_ERR(0, 33, __pyx_L1_error
)
1929 __Pyx_XDECREF(__pyx_t_4
); __pyx_t_4
= 0;
1930 __Pyx_GOTREF(__pyx_t_2
);
1931 __Pyx_DECREF(__pyx_t_5
); __pyx_t_5
= 0;
1932 __Pyx_DECREF(__pyx_t_8
); __pyx_t_8
= 0;
1936 __pyx_t_3
= PyTuple_New(4+__pyx_t_7
); if (unlikely(!__pyx_t_3
)) __PYX_ERR(0, 33, __pyx_L1_error
)
1937 __Pyx_GOTREF(__pyx_t_3
);
1939 __Pyx_GIVEREF(__pyx_t_4
); PyTuple_SET_ITEM(__pyx_t_3
, 0, __pyx_t_4
); __pyx_t_4
= NULL
;
1941 __Pyx_GIVEREF(__pyx_t_5
);
1942 PyTuple_SET_ITEM(__pyx_t_3
, 0+__pyx_t_7
, __pyx_t_5
);
1943 __Pyx_GIVEREF(__pyx_t_8
);
1944 PyTuple_SET_ITEM(__pyx_t_3
, 1+__pyx_t_7
, __pyx_t_8
);
1945 __Pyx_INCREF(Py_False
);
1946 __Pyx_GIVEREF(Py_False
);
1947 PyTuple_SET_ITEM(__pyx_t_3
, 2+__pyx_t_7
, Py_False
);
1948 __Pyx_INCREF(Py_True
);
1949 __Pyx_GIVEREF(Py_True
);
1950 PyTuple_SET_ITEM(__pyx_t_3
, 3+__pyx_t_7
, Py_True
);
1953 __pyx_t_2
= __Pyx_PyObject_Call(__pyx_t_1
, __pyx_t_3
, NULL
); if (unlikely(!__pyx_t_2
)) __PYX_ERR(0, 33, __pyx_L1_error
)
1954 __Pyx_GOTREF(__pyx_t_2
);
1955 __Pyx_DECREF(__pyx_t_3
); __pyx_t_3
= 0;
1957 __Pyx_DECREF(__pyx_t_1
); __pyx_t_1
= 0;
1958 __pyx_t_1
= PyNumber_Multiply(__pyx_int_neg_1
, __pyx_t_2
); if (unlikely(!__pyx_t_1
)) __PYX_ERR(0, 33, __pyx_L1_error
)
1959 __Pyx_GOTREF(__pyx_t_1
);
1960 __Pyx_DECREF(__pyx_t_2
); __pyx_t_2
= 0;
1961 __pyx_t_9
= __pyx_PyFloat_AsFloat(__pyx_t_1
); if (unlikely((__pyx_t_9
== (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 33, __pyx_L1_error
)
1962 __Pyx_DECREF(__pyx_t_1
); __pyx_t_1
= 0;
1963 __pyx_v_val
= __pyx_t_9
;
1965 /* "MACS2/Statistics.pyx":34
1966 * # calculate and cache
1967 * val = -1 * poisson_cdf ( x, l, False, True )
1968 * self.pscore_dict[ ( x, l ) ] = val # <<<<<<<<<<<<<<
1972 __pyx_t_1
= PyFloat_FromDouble(__pyx_v_val
); if (unlikely(!__pyx_t_1
)) __PYX_ERR(0, 34, __pyx_L1_error
)
1973 __Pyx_GOTREF(__pyx_t_1
);
1974 if (unlikely(__pyx_v_self
->pscore_dict
== Py_None
)) {
1975 PyErr_SetString(PyExc_TypeError
, "'NoneType' object is not subscriptable");
1976 __PYX_ERR(0, 34, __pyx_L1_error
)
1978 __pyx_t_2
= __Pyx_PyInt_From_int(__pyx_v_x
); if (unlikely(!__pyx_t_2
)) __PYX_ERR(0, 34, __pyx_L1_error
)
1979 __Pyx_GOTREF(__pyx_t_2
);
1980 __pyx_t_3
= PyFloat_FromDouble(__pyx_v_l
); if (unlikely(!__pyx_t_3
)) __PYX_ERR(0, 34, __pyx_L1_error
)
1981 __Pyx_GOTREF(__pyx_t_3
);
1982 __pyx_t_8
= PyTuple_New(2); if (unlikely(!__pyx_t_8
)) __PYX_ERR(0, 34, __pyx_L1_error
)
1983 __Pyx_GOTREF(__pyx_t_8
);
1984 __Pyx_GIVEREF(__pyx_t_2
);
1985 PyTuple_SET_ITEM(__pyx_t_8
, 0, __pyx_t_2
);
1986 __Pyx_GIVEREF(__pyx_t_3
);
1987 PyTuple_SET_ITEM(__pyx_t_8
, 1, __pyx_t_3
);
1990 if (unlikely(PyDict_SetItem(__pyx_v_self
->pscore_dict
, __pyx_t_8
, __pyx_t_1
) < 0)) __PYX_ERR(0, 34, __pyx_L1_error
)
1991 __Pyx_DECREF(__pyx_t_8
); __pyx_t_8
= 0;
1992 __Pyx_DECREF(__pyx_t_1
); __pyx_t_1
= 0;
1994 /* "MACS2/Statistics.pyx":35
1995 * val = -1 * poisson_cdf ( x, l, False, True )
1996 * self.pscore_dict[ ( x, l ) ] = val
1997 * return val # <<<<<<<<<<<<<<
1999 * cdef class LogLR_Asym:
2001 __pyx_r
= __pyx_v_val
;
2005 /* "MACS2/Statistics.pyx":25
2006 * self.pscore_dict = dict()
2008 * cpdef float get_pscore ( self, int x, float l ): # <<<<<<<<<<<<<<
2013 /* function exit code */
2015 __Pyx_XDECREF(__pyx_t_1
);
2016 __Pyx_XDECREF(__pyx_t_2
);
2017 __Pyx_XDECREF(__pyx_t_3
);
2018 __Pyx_XDECREF(__pyx_t_4
);
2019 __Pyx_XDECREF(__pyx_t_5
);
2020 __Pyx_XDECREF(__pyx_t_6
);
2021 __Pyx_XDECREF(__pyx_t_8
);
2022 __Pyx_WriteUnraisable("MACS2.Statistics.P_Score_Upper_Tail.get_pscore", __pyx_clineno
, __pyx_lineno
, __pyx_filename
, 1, 0);
2025 __Pyx_TraceReturn(Py_None
, 0);
2026 __Pyx_RefNannyFinishContext();
2030 /* Python wrapper */
2031 static PyObject
*__pyx_pw_5MACS2_10Statistics_18P_Score_Upper_Tail_3get_pscore(PyObject
*__pyx_v_self
, PyObject
*__pyx_args
, PyObject
*__pyx_kwds
); /*proto*/
2032 static PyObject
*__pyx_pw_5MACS2_10Statistics_18P_Score_Upper_Tail_3get_pscore(PyObject
*__pyx_v_self
, PyObject
*__pyx_args
, PyObject
*__pyx_kwds
) {
2035 PyObject
*__pyx_r
= 0;
2036 __Pyx_RefNannyDeclarations
2037 __Pyx_RefNannySetupContext("get_pscore (wrapper)", 0);
2039 static PyObject
**__pyx_pyargnames
[] = {&__pyx_n_s_x
,&__pyx_n_s_l
,0};
2040 PyObject
* values
[2] = {0,0};
2041 if (unlikely(__pyx_kwds
)) {
2043 const Py_ssize_t pos_args
= PyTuple_GET_SIZE(__pyx_args
);
2045 case 2: values
[1] = PyTuple_GET_ITEM(__pyx_args
, 1);
2047 case 1: values
[0] = PyTuple_GET_ITEM(__pyx_args
, 0);
2050 default: goto __pyx_L5_argtuple_error
;
2052 kw_args
= PyDict_Size(__pyx_kwds
);
2055 if (likely((values
[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds
, __pyx_n_s_x
)) != 0)) kw_args
--;
2056 else goto __pyx_L5_argtuple_error
;
2059 if (likely((values
[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds
, __pyx_n_s_l
)) != 0)) kw_args
--;
2061 __Pyx_RaiseArgtupleInvalid("get_pscore", 1, 2, 2, 1); __PYX_ERR(0, 25, __pyx_L3_error
)
2064 if (unlikely(kw_args
> 0)) {
2065 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds
, __pyx_pyargnames
, 0, values
, pos_args
, "get_pscore") < 0)) __PYX_ERR(0, 25, __pyx_L3_error
)
2067 } else if (PyTuple_GET_SIZE(__pyx_args
) != 2) {
2068 goto __pyx_L5_argtuple_error
;
2070 values
[0] = PyTuple_GET_ITEM(__pyx_args
, 0);
2071 values
[1] = PyTuple_GET_ITEM(__pyx_args
, 1);
2073 __pyx_v_x
= __Pyx_PyInt_As_int(values
[0]); if (unlikely((__pyx_v_x
== (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 25, __pyx_L3_error
)
2074 __pyx_v_l
= __pyx_PyFloat_AsFloat(values
[1]); if (unlikely((__pyx_v_l
== (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 25, __pyx_L3_error
)
2076 goto __pyx_L4_argument_unpacking_done
;
2077 __pyx_L5_argtuple_error
:;
2078 __Pyx_RaiseArgtupleInvalid("get_pscore", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args
)); __PYX_ERR(0, 25, __pyx_L3_error
)
2080 __Pyx_AddTraceback("MACS2.Statistics.P_Score_Upper_Tail.get_pscore", __pyx_clineno
, __pyx_lineno
, __pyx_filename
);
2081 __Pyx_RefNannyFinishContext();
2083 __pyx_L4_argument_unpacking_done
:;
2084 __pyx_r
= __pyx_pf_5MACS2_10Statistics_18P_Score_Upper_Tail_2get_pscore(((struct __pyx_obj_5MACS2_10Statistics_P_Score_Upper_Tail
*)__pyx_v_self
), __pyx_v_x
, __pyx_v_l
);
2086 /* function exit code */
2087 __Pyx_RefNannyFinishContext();
2091 static PyObject
*__pyx_pf_5MACS2_10Statistics_18P_Score_Upper_Tail_2get_pscore(struct __pyx_obj_5MACS2_10Statistics_P_Score_Upper_Tail
*__pyx_v_self
, int __pyx_v_x
, float __pyx_v_l
) {
2092 PyObject
*__pyx_r
= NULL
;
2093 __Pyx_TraceDeclarations
2094 __Pyx_RefNannyDeclarations
2095 PyObject
*__pyx_t_1
= NULL
;
2096 __Pyx_RefNannySetupContext("get_pscore", 0);
2097 __Pyx_TraceCall("get_pscore (wrapper)", __pyx_f
[0], 25, 0, __PYX_ERR(0, 25, __pyx_L1_error
));
2098 __Pyx_XDECREF(__pyx_r
);
2099 __pyx_t_1
= PyFloat_FromDouble(__pyx_f_5MACS2_10Statistics_18P_Score_Upper_Tail_get_pscore(__pyx_v_self
, __pyx_v_x
, __pyx_v_l
, 1)); if (unlikely(!__pyx_t_1
)) __PYX_ERR(0, 25, __pyx_L1_error
)
2100 __Pyx_GOTREF(__pyx_t_1
);
2101 __pyx_r
= __pyx_t_1
;
2105 /* function exit code */
2107 __Pyx_XDECREF(__pyx_t_1
);
2108 __Pyx_AddTraceback("MACS2.Statistics.P_Score_Upper_Tail.get_pscore", __pyx_clineno
, __pyx_lineno
, __pyx_filename
);
2111 __Pyx_XGIVEREF(__pyx_r
);
2112 __Pyx_TraceReturn(__pyx_r
, 0);
2113 __Pyx_RefNannyFinishContext();
2117 /* "(tree fragment)":1
2118 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
2123 /* Python wrapper */
2124 static PyObject
*__pyx_pw_5MACS2_10Statistics_18P_Score_Upper_Tail_5__reduce_cython__(PyObject
*__pyx_v_self
, CYTHON_UNUSED PyObject
*unused
); /*proto*/
2125 static PyObject
*__pyx_pw_5MACS2_10Statistics_18P_Score_Upper_Tail_5__reduce_cython__(PyObject
*__pyx_v_self
, CYTHON_UNUSED PyObject
*unused
) {
2126 PyObject
*__pyx_r
= 0;
2127 __Pyx_RefNannyDeclarations
2128 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
2129 __pyx_r
= __pyx_pf_5MACS2_10Statistics_18P_Score_Upper_Tail_4__reduce_cython__(((struct __pyx_obj_5MACS2_10Statistics_P_Score_Upper_Tail
*)__pyx_v_self
));
2131 /* function exit code */
2132 __Pyx_RefNannyFinishContext();
2136 static PyObject
*__pyx_pf_5MACS2_10Statistics_18P_Score_Upper_Tail_4__reduce_cython__(struct __pyx_obj_5MACS2_10Statistics_P_Score_Upper_Tail
*__pyx_v_self
) {
2137 PyObject
*__pyx_v_state
= 0;
2138 PyObject
*__pyx_v__dict
= 0;
2139 int __pyx_v_use_setstate
;
2140 PyObject
*__pyx_r
= NULL
;
2141 __Pyx_TraceDeclarations
2142 __Pyx_RefNannyDeclarations
2143 PyObject
*__pyx_t_1
= NULL
;
2146 PyObject
*__pyx_t_4
= NULL
;
2147 PyObject
*__pyx_t_5
= NULL
;
2148 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
2149 __Pyx_TraceCall("__reduce_cython__", __pyx_f
[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error
));
2151 /* "(tree fragment)":5
2153 * cdef bint use_setstate
2154 * state = (self.pscore_dict,) # <<<<<<<<<<<<<<
2155 * _dict = getattr(self, '__dict__', None)
2156 * if _dict is not None:
2158 __pyx_t_1
= PyTuple_New(1); if (unlikely(!__pyx_t_1
)) __PYX_ERR(1, 5, __pyx_L1_error
)
2159 __Pyx_GOTREF(__pyx_t_1
);
2160 __Pyx_INCREF(__pyx_v_self
->pscore_dict
);
2161 __Pyx_GIVEREF(__pyx_v_self
->pscore_dict
);
2162 PyTuple_SET_ITEM(__pyx_t_1
, 0, __pyx_v_self
->pscore_dict
);
2163 __pyx_v_state
= ((PyObject
*)__pyx_t_1
);
2166 /* "(tree fragment)":6
2167 * cdef bint use_setstate
2168 * state = (self.pscore_dict,)
2169 * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
2170 * if _dict is not None:
2173 __pyx_t_1
= __Pyx_GetAttr3(((PyObject
*)__pyx_v_self
), __pyx_n_s_dict
, Py_None
); if (unlikely(!__pyx_t_1
)) __PYX_ERR(1, 6, __pyx_L1_error
)
2174 __Pyx_GOTREF(__pyx_t_1
);
2175 __pyx_v__dict
= __pyx_t_1
;
2178 /* "(tree fragment)":7
2179 * state = (self.pscore_dict,)
2180 * _dict = getattr(self, '__dict__', None)
2181 * if _dict is not None: # <<<<<<<<<<<<<<
2183 * use_setstate = True
2185 __pyx_t_2
= (__pyx_v__dict
!= Py_None
);
2186 __pyx_t_3
= (__pyx_t_2
!= 0);
2189 /* "(tree fragment)":8
2190 * _dict = getattr(self, '__dict__', None)
2191 * if _dict is not None:
2192 * state += (_dict,) # <<<<<<<<<<<<<<
2193 * use_setstate = True
2196 __pyx_t_1
= PyTuple_New(1); if (unlikely(!__pyx_t_1
)) __PYX_ERR(1, 8, __pyx_L1_error
)
2197 __Pyx_GOTREF(__pyx_t_1
);
2198 __Pyx_INCREF(__pyx_v__dict
);
2199 __Pyx_GIVEREF(__pyx_v__dict
);
2200 PyTuple_SET_ITEM(__pyx_t_1
, 0, __pyx_v__dict
);
2201 __pyx_t_4
= PyNumber_InPlaceAdd(__pyx_v_state
, __pyx_t_1
); if (unlikely(!__pyx_t_4
)) __PYX_ERR(1, 8, __pyx_L1_error
)
2202 __Pyx_GOTREF(__pyx_t_4
);
2203 __Pyx_DECREF(__pyx_t_1
); __pyx_t_1
= 0;
2204 __Pyx_DECREF_SET(__pyx_v_state
, ((PyObject
*)__pyx_t_4
));
2207 /* "(tree fragment)":9
2208 * if _dict is not None:
2210 * use_setstate = True # <<<<<<<<<<<<<<
2212 * use_setstate = self.pscore_dict is not None
2214 __pyx_v_use_setstate
= 1;
2216 /* "(tree fragment)":7
2217 * state = (self.pscore_dict,)
2218 * _dict = getattr(self, '__dict__', None)
2219 * if _dict is not None: # <<<<<<<<<<<<<<
2221 * use_setstate = True
2226 /* "(tree fragment)":11
2227 * use_setstate = True
2229 * use_setstate = self.pscore_dict is not None # <<<<<<<<<<<<<<
2231 * return __pyx_unpickle_P_Score_Upper_Tail, (type(self), 0xf502884, None), state
2234 __pyx_t_3
= (__pyx_v_self
->pscore_dict
!= ((PyObject
*)Py_None
));
2235 __pyx_v_use_setstate
= __pyx_t_3
;
2239 /* "(tree fragment)":12
2241 * use_setstate = self.pscore_dict is not None
2242 * if use_setstate: # <<<<<<<<<<<<<<
2243 * return __pyx_unpickle_P_Score_Upper_Tail, (type(self), 0xf502884, None), state
2246 __pyx_t_3
= (__pyx_v_use_setstate
!= 0);
2249 /* "(tree fragment)":13
2250 * use_setstate = self.pscore_dict is not None
2252 * return __pyx_unpickle_P_Score_Upper_Tail, (type(self), 0xf502884, None), state # <<<<<<<<<<<<<<
2254 * return __pyx_unpickle_P_Score_Upper_Tail, (type(self), 0xf502884, state)
2256 __Pyx_XDECREF(__pyx_r
);
2257 __Pyx_GetModuleGlobalName(__pyx_t_4
, __pyx_n_s_pyx_unpickle_P_Score_Upper_Tai
); if (unlikely(!__pyx_t_4
)) __PYX_ERR(1, 13, __pyx_L1_error
)
2258 __Pyx_GOTREF(__pyx_t_4
);
2259 __pyx_t_1
= PyTuple_New(3); if (unlikely(!__pyx_t_1
)) __PYX_ERR(1, 13, __pyx_L1_error
)
2260 __Pyx_GOTREF(__pyx_t_1
);
2261 __Pyx_INCREF(((PyObject
*)Py_TYPE(((PyObject
*)__pyx_v_self
))));
2262 __Pyx_GIVEREF(((PyObject
*)Py_TYPE(((PyObject
*)__pyx_v_self
))));
2263 PyTuple_SET_ITEM(__pyx_t_1
, 0, ((PyObject
*)Py_TYPE(((PyObject
*)__pyx_v_self
))));
2264 __Pyx_INCREF(__pyx_int_256911492
);
2265 __Pyx_GIVEREF(__pyx_int_256911492
);
2266 PyTuple_SET_ITEM(__pyx_t_1
, 1, __pyx_int_256911492
);
2267 __Pyx_INCREF(Py_None
);
2268 __Pyx_GIVEREF(Py_None
);
2269 PyTuple_SET_ITEM(__pyx_t_1
, 2, Py_None
);
2270 __pyx_t_5
= PyTuple_New(3); if (unlikely(!__pyx_t_5
)) __PYX_ERR(1, 13, __pyx_L1_error
)
2271 __Pyx_GOTREF(__pyx_t_5
);
2272 __Pyx_GIVEREF(__pyx_t_4
);
2273 PyTuple_SET_ITEM(__pyx_t_5
, 0, __pyx_t_4
);
2274 __Pyx_GIVEREF(__pyx_t_1
);
2275 PyTuple_SET_ITEM(__pyx_t_5
, 1, __pyx_t_1
);
2276 __Pyx_INCREF(__pyx_v_state
);
2277 __Pyx_GIVEREF(__pyx_v_state
);
2278 PyTuple_SET_ITEM(__pyx_t_5
, 2, __pyx_v_state
);
2281 __pyx_r
= __pyx_t_5
;
2285 /* "(tree fragment)":12
2287 * use_setstate = self.pscore_dict is not None
2288 * if use_setstate: # <<<<<<<<<<<<<<
2289 * return __pyx_unpickle_P_Score_Upper_Tail, (type(self), 0xf502884, None), state
2294 /* "(tree fragment)":15
2295 * return __pyx_unpickle_P_Score_Upper_Tail, (type(self), 0xf502884, None), state
2297 * return __pyx_unpickle_P_Score_Upper_Tail, (type(self), 0xf502884, state) # <<<<<<<<<<<<<<
2298 * def __setstate_cython__(self, __pyx_state):
2299 * __pyx_unpickle_P_Score_Upper_Tail__set_state(self, __pyx_state)
2302 __Pyx_XDECREF(__pyx_r
);
2303 __Pyx_GetModuleGlobalName(__pyx_t_5
, __pyx_n_s_pyx_unpickle_P_Score_Upper_Tai
); if (unlikely(!__pyx_t_5
)) __PYX_ERR(1, 15, __pyx_L1_error
)
2304 __Pyx_GOTREF(__pyx_t_5
);
2305 __pyx_t_1
= PyTuple_New(3); if (unlikely(!__pyx_t_1
)) __PYX_ERR(1, 15, __pyx_L1_error
)
2306 __Pyx_GOTREF(__pyx_t_1
);
2307 __Pyx_INCREF(((PyObject
*)Py_TYPE(((PyObject
*)__pyx_v_self
))));
2308 __Pyx_GIVEREF(((PyObject
*)Py_TYPE(((PyObject
*)__pyx_v_self
))));
2309 PyTuple_SET_ITEM(__pyx_t_1
, 0, ((PyObject
*)Py_TYPE(((PyObject
*)__pyx_v_self
))));
2310 __Pyx_INCREF(__pyx_int_256911492
);
2311 __Pyx_GIVEREF(__pyx_int_256911492
);
2312 PyTuple_SET_ITEM(__pyx_t_1
, 1, __pyx_int_256911492
);
2313 __Pyx_INCREF(__pyx_v_state
);
2314 __Pyx_GIVEREF(__pyx_v_state
);
2315 PyTuple_SET_ITEM(__pyx_t_1
, 2, __pyx_v_state
);
2316 __pyx_t_4
= PyTuple_New(2); if (unlikely(!__pyx_t_4
)) __PYX_ERR(1, 15, __pyx_L1_error
)
2317 __Pyx_GOTREF(__pyx_t_4
);
2318 __Pyx_GIVEREF(__pyx_t_5
);
2319 PyTuple_SET_ITEM(__pyx_t_4
, 0, __pyx_t_5
);
2320 __Pyx_GIVEREF(__pyx_t_1
);
2321 PyTuple_SET_ITEM(__pyx_t_4
, 1, __pyx_t_1
);
2324 __pyx_r
= __pyx_t_4
;
2329 /* "(tree fragment)":1
2330 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
2335 /* function exit code */
2337 __Pyx_XDECREF(__pyx_t_1
);
2338 __Pyx_XDECREF(__pyx_t_4
);
2339 __Pyx_XDECREF(__pyx_t_5
);
2340 __Pyx_AddTraceback("MACS2.Statistics.P_Score_Upper_Tail.__reduce_cython__", __pyx_clineno
, __pyx_lineno
, __pyx_filename
);
2343 __Pyx_XDECREF(__pyx_v_state
);
2344 __Pyx_XDECREF(__pyx_v__dict
);
2345 __Pyx_XGIVEREF(__pyx_r
);
2346 __Pyx_TraceReturn(__pyx_r
, 0);
2347 __Pyx_RefNannyFinishContext();
2351 /* "(tree fragment)":16
2353 * return __pyx_unpickle_P_Score_Upper_Tail, (type(self), 0xf502884, state)
2354 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
2355 * __pyx_unpickle_P_Score_Upper_Tail__set_state(self, __pyx_state)
2358 /* Python wrapper */
2359 static PyObject
*__pyx_pw_5MACS2_10Statistics_18P_Score_Upper_Tail_7__setstate_cython__(PyObject
*__pyx_v_self
, PyObject
*__pyx_v___pyx_state
); /*proto*/
2360 static PyObject
*__pyx_pw_5MACS2_10Statistics_18P_Score_Upper_Tail_7__setstate_cython__(PyObject
*__pyx_v_self
, PyObject
*__pyx_v___pyx_state
) {
2361 PyObject
*__pyx_r
= 0;
2362 __Pyx_RefNannyDeclarations
2363 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
2364 __pyx_r
= __pyx_pf_5MACS2_10Statistics_18P_Score_Upper_Tail_6__setstate_cython__(((struct __pyx_obj_5MACS2_10Statistics_P_Score_Upper_Tail
*)__pyx_v_self
), ((PyObject
*)__pyx_v___pyx_state
));
2366 /* function exit code */
2367 __Pyx_RefNannyFinishContext();
2371 static PyObject
*__pyx_pf_5MACS2_10Statistics_18P_Score_Upper_Tail_6__setstate_cython__(struct __pyx_obj_5MACS2_10Statistics_P_Score_Upper_Tail
*__pyx_v_self
, PyObject
*__pyx_v___pyx_state
) {
2372 PyObject
*__pyx_r
= NULL
;
2373 __Pyx_TraceDeclarations
2374 __Pyx_RefNannyDeclarations
2375 PyObject
*__pyx_t_1
= NULL
;
2376 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
2377 __Pyx_TraceCall("__setstate_cython__", __pyx_f
[1], 16, 0, __PYX_ERR(1, 16, __pyx_L1_error
));
2379 /* "(tree fragment)":17
2380 * return __pyx_unpickle_P_Score_Upper_Tail, (type(self), 0xf502884, state)
2381 * def __setstate_cython__(self, __pyx_state):
2382 * __pyx_unpickle_P_Score_Upper_Tail__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
2384 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state
))||((__pyx_v___pyx_state
) == Py_None
)||(PyErr_Format(PyExc_TypeError
, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state
)->tp_name
), 0))) __PYX_ERR(1, 17, __pyx_L1_error
)
2385 __pyx_t_1
= __pyx_f_5MACS2_10Statistics___pyx_unpickle_P_Score_Upper_Tail__set_state(__pyx_v_self
, ((PyObject
*)__pyx_v___pyx_state
)); if (unlikely(!__pyx_t_1
)) __PYX_ERR(1, 17, __pyx_L1_error
)
2386 __Pyx_GOTREF(__pyx_t_1
);
2387 __Pyx_DECREF(__pyx_t_1
); __pyx_t_1
= 0;
2389 /* "(tree fragment)":16
2391 * return __pyx_unpickle_P_Score_Upper_Tail, (type(self), 0xf502884, state)
2392 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
2393 * __pyx_unpickle_P_Score_Upper_Tail__set_state(self, __pyx_state)
2396 /* function exit code */
2397 __pyx_r
= Py_None
; __Pyx_INCREF(Py_None
);
2400 __Pyx_XDECREF(__pyx_t_1
);
2401 __Pyx_AddTraceback("MACS2.Statistics.P_Score_Upper_Tail.__setstate_cython__", __pyx_clineno
, __pyx_lineno
, __pyx_filename
);
2404 __Pyx_XGIVEREF(__pyx_r
);
2405 __Pyx_TraceReturn(__pyx_r
, 0);
2406 __Pyx_RefNannyFinishContext();
2410 /* "MACS2/Statistics.pyx":44
2413 * def __init__ ( self ): # <<<<<<<<<<<<<<
2414 * self.logLR_dict = dict()
2418 /* Python wrapper */
2419 static int __pyx_pw_5MACS2_10Statistics_10LogLR_Asym_1__init__(PyObject
*__pyx_v_self
, PyObject
*__pyx_args
, PyObject
*__pyx_kwds
); /*proto*/
2420 static int __pyx_pw_5MACS2_10Statistics_10LogLR_Asym_1__init__(PyObject
*__pyx_v_self
, PyObject
*__pyx_args
, PyObject
*__pyx_kwds
) {
2422 __Pyx_RefNannyDeclarations
2423 __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
2424 if (unlikely(PyTuple_GET_SIZE(__pyx_args
) > 0)) {
2425 __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args
)); return -1;}
2426 if (unlikely(__pyx_kwds
) && unlikely(PyDict_Size(__pyx_kwds
) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds
, "__init__", 0))) return -1;
2427 __pyx_r
= __pyx_pf_5MACS2_10Statistics_10LogLR_Asym___init__(((struct __pyx_obj_5MACS2_10Statistics_LogLR_Asym
*)__pyx_v_self
));
2429 /* function exit code */
2430 __Pyx_RefNannyFinishContext();
2434 static int __pyx_pf_5MACS2_10Statistics_10LogLR_Asym___init__(struct __pyx_obj_5MACS2_10Statistics_LogLR_Asym
*__pyx_v_self
) {
2436 __Pyx_TraceDeclarations
2437 __Pyx_RefNannyDeclarations
2438 PyObject
*__pyx_t_1
= NULL
;
2439 __Pyx_RefNannySetupContext("__init__", 0);
2440 __Pyx_TraceCall("__init__", __pyx_f
[0], 44, 0, __PYX_ERR(0, 44, __pyx_L1_error
));
2442 /* "MACS2/Statistics.pyx":45
2444 * def __init__ ( self ):
2445 * self.logLR_dict = dict() # <<<<<<<<<<<<<<
2447 * cpdef float get_logLR_asym ( self, float x, float y ):
2449 __pyx_t_1
= __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1
)) __PYX_ERR(0, 45, __pyx_L1_error
)
2450 __Pyx_GOTREF(__pyx_t_1
);
2451 __Pyx_GIVEREF(__pyx_t_1
);
2452 __Pyx_GOTREF(__pyx_v_self
->logLR_dict
);
2453 __Pyx_DECREF(__pyx_v_self
->logLR_dict
);
2454 __pyx_v_self
->logLR_dict
= ((PyObject
*)__pyx_t_1
);
2457 /* "MACS2/Statistics.pyx":44
2460 * def __init__ ( self ): # <<<<<<<<<<<<<<
2461 * self.logLR_dict = dict()
2465 /* function exit code */
2469 __Pyx_XDECREF(__pyx_t_1
);
2470 __Pyx_AddTraceback("MACS2.Statistics.LogLR_Asym.__init__", __pyx_clineno
, __pyx_lineno
, __pyx_filename
);
2473 __Pyx_TraceReturn(Py_None
, 0);
2474 __Pyx_RefNannyFinishContext();
2478 /* "MACS2/Statistics.pyx":47
2479 * self.logLR_dict = dict()
2481 * cpdef float get_logLR_asym ( self, float x, float y ): # <<<<<<<<<<<<<<
2486 static PyObject
*__pyx_pw_5MACS2_10Statistics_10LogLR_Asym_3get_logLR_asym(PyObject
*__pyx_v_self
, PyObject
*__pyx_args
, PyObject
*__pyx_kwds
); /*proto*/
2487 static float __pyx_f_5MACS2_10Statistics_10LogLR_Asym_get_logLR_asym(struct __pyx_obj_5MACS2_10Statistics_LogLR_Asym
*__pyx_v_self
, float __pyx_v_x
, float __pyx_v_y
, int __pyx_skip_dispatch
) {
2490 __Pyx_TraceDeclarations
2491 __Pyx_RefNannyDeclarations
2492 PyObject
*__pyx_t_1
= NULL
;
2493 PyObject
*__pyx_t_2
= NULL
;
2494 PyObject
*__pyx_t_3
= NULL
;
2495 PyObject
*__pyx_t_4
= NULL
;
2496 PyObject
*__pyx_t_5
= NULL
;
2497 PyObject
*__pyx_t_6
= NULL
;
2499 PyObject
*__pyx_t_8
= NULL
;
2503 __Pyx_RefNannySetupContext("get_logLR_asym", 0);
2504 __Pyx_TraceCall("get_logLR_asym", __pyx_f
[0], 47, 0, __PYX_ERR(0, 47, __pyx_L1_error
));
2505 /* Check if called by wrapper */
2506 if (unlikely(__pyx_skip_dispatch
)) ;
2507 /* Check if overridden in Python */
2508 else if (unlikely((Py_TYPE(((PyObject
*)__pyx_v_self
))->tp_dictoffset
!= 0) || (Py_TYPE(((PyObject
*)__pyx_v_self
))->tp_flags
& (Py_TPFLAGS_IS_ABSTRACT
| Py_TPFLAGS_HEAPTYPE
)))) {
2509 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
2510 static PY_UINT64_T __pyx_tp_dict_version
= __PYX_DICT_VERSION_INIT
, __pyx_obj_dict_version
= __PYX_DICT_VERSION_INIT
;
2511 if (unlikely(!__Pyx_object_dict_version_matches(((PyObject
*)__pyx_v_self
), __pyx_tp_dict_version
, __pyx_obj_dict_version
))) {
2512 PY_UINT64_T __pyx_type_dict_guard
= __Pyx_get_tp_dict_version(((PyObject
*)__pyx_v_self
));
2514 __pyx_t_1
= __Pyx_PyObject_GetAttrStr(((PyObject
*)__pyx_v_self
), __pyx_n_s_get_logLR_asym
); if (unlikely(!__pyx_t_1
)) __PYX_ERR(0, 47, __pyx_L1_error
)
2515 __Pyx_GOTREF(__pyx_t_1
);
2516 if (!PyCFunction_Check(__pyx_t_1
) || (PyCFunction_GET_FUNCTION(__pyx_t_1
) != (PyCFunction
)(void*)__pyx_pw_5MACS2_10Statistics_10LogLR_Asym_3get_logLR_asym
)) {
2517 __pyx_t_3
= PyFloat_FromDouble(__pyx_v_x
); if (unlikely(!__pyx_t_3
)) __PYX_ERR(0, 47, __pyx_L1_error
)
2518 __Pyx_GOTREF(__pyx_t_3
);
2519 __pyx_t_4
= PyFloat_FromDouble(__pyx_v_y
); if (unlikely(!__pyx_t_4
)) __PYX_ERR(0, 47, __pyx_L1_error
)
2520 __Pyx_GOTREF(__pyx_t_4
);
2521 __Pyx_INCREF(__pyx_t_1
);
2522 __pyx_t_5
= __pyx_t_1
; __pyx_t_6
= NULL
;
2524 if (CYTHON_UNPACK_METHODS
&& unlikely(PyMethod_Check(__pyx_t_5
))) {
2525 __pyx_t_6
= PyMethod_GET_SELF(__pyx_t_5
);
2526 if (likely(__pyx_t_6
)) {
2527 PyObject
* function
= PyMethod_GET_FUNCTION(__pyx_t_5
);
2528 __Pyx_INCREF(__pyx_t_6
);
2529 __Pyx_INCREF(function
);
2530 __Pyx_DECREF_SET(__pyx_t_5
, function
);
2534 #if CYTHON_FAST_PYCALL
2535 if (PyFunction_Check(__pyx_t_5
)) {
2536 PyObject
*__pyx_temp
[3] = {__pyx_t_6
, __pyx_t_3
, __pyx_t_4
};
2537 __pyx_t_2
= __Pyx_PyFunction_FastCall(__pyx_t_5
, __pyx_temp
+1-__pyx_t_7
, 2+__pyx_t_7
); if (unlikely(!__pyx_t_2
)) __PYX_ERR(0, 47, __pyx_L1_error
)
2538 __Pyx_XDECREF(__pyx_t_6
); __pyx_t_6
= 0;
2539 __Pyx_GOTREF(__pyx_t_2
);
2540 __Pyx_DECREF(__pyx_t_3
); __pyx_t_3
= 0;
2541 __Pyx_DECREF(__pyx_t_4
); __pyx_t_4
= 0;
2544 #if CYTHON_FAST_PYCCALL
2545 if (__Pyx_PyFastCFunction_Check(__pyx_t_5
)) {
2546 PyObject
*__pyx_temp
[3] = {__pyx_t_6
, __pyx_t_3
, __pyx_t_4
};
2547 __pyx_t_2
= __Pyx_PyCFunction_FastCall(__pyx_t_5
, __pyx_temp
+1-__pyx_t_7
, 2+__pyx_t_7
); if (unlikely(!__pyx_t_2
)) __PYX_ERR(0, 47, __pyx_L1_error
)
2548 __Pyx_XDECREF(__pyx_t_6
); __pyx_t_6
= 0;
2549 __Pyx_GOTREF(__pyx_t_2
);
2550 __Pyx_DECREF(__pyx_t_3
); __pyx_t_3
= 0;
2551 __Pyx_DECREF(__pyx_t_4
); __pyx_t_4
= 0;
2555 __pyx_t_8
= PyTuple_New(2+__pyx_t_7
); if (unlikely(!__pyx_t_8
)) __PYX_ERR(0, 47, __pyx_L1_error
)
2556 __Pyx_GOTREF(__pyx_t_8
);
2558 __Pyx_GIVEREF(__pyx_t_6
); PyTuple_SET_ITEM(__pyx_t_8
, 0, __pyx_t_6
); __pyx_t_6
= NULL
;
2560 __Pyx_GIVEREF(__pyx_t_3
);
2561 PyTuple_SET_ITEM(__pyx_t_8
, 0+__pyx_t_7
, __pyx_t_3
);
2562 __Pyx_GIVEREF(__pyx_t_4
);
2563 PyTuple_SET_ITEM(__pyx_t_8
, 1+__pyx_t_7
, __pyx_t_4
);
2566 __pyx_t_2
= __Pyx_PyObject_Call(__pyx_t_5
, __pyx_t_8
, NULL
); if (unlikely(!__pyx_t_2
)) __PYX_ERR(0, 47, __pyx_L1_error
)
2567 __Pyx_GOTREF(__pyx_t_2
);
2568 __Pyx_DECREF(__pyx_t_8
); __pyx_t_8
= 0;
2570 __Pyx_DECREF(__pyx_t_5
); __pyx_t_5
= 0;
2571 __pyx_t_9
= __pyx_PyFloat_AsFloat(__pyx_t_2
); if (unlikely((__pyx_t_9
== (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 47, __pyx_L1_error
)
2572 __Pyx_DECREF(__pyx_t_2
); __pyx_t_2
= 0;
2573 __pyx_r
= __pyx_t_9
;
2574 __Pyx_DECREF(__pyx_t_1
); __pyx_t_1
= 0;
2577 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
2578 __pyx_tp_dict_version
= __Pyx_get_tp_dict_version(((PyObject
*)__pyx_v_self
));
2579 __pyx_obj_dict_version
= __Pyx_get_object_dict_version(((PyObject
*)__pyx_v_self
));
2580 if (unlikely(__pyx_type_dict_guard
!= __pyx_tp_dict_version
)) {
2581 __pyx_tp_dict_version
= __pyx_obj_dict_version
= __PYX_DICT_VERSION_INIT
;
2584 __Pyx_DECREF(__pyx_t_1
); __pyx_t_1
= 0;
2585 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
2590 /* "MACS2/Statistics.pyx":51
2593 * if ( x, y ) in self.logLR_dict: # <<<<<<<<<<<<<<
2594 * return self.logLR_dict[ ( x, y ) ]
2597 __pyx_t_1
= PyFloat_FromDouble(__pyx_v_x
); if (unlikely(!__pyx_t_1
)) __PYX_ERR(0, 51, __pyx_L1_error
)
2598 __Pyx_GOTREF(__pyx_t_1
);
2599 __pyx_t_2
= PyFloat_FromDouble(__pyx_v_y
); if (unlikely(!__pyx_t_2
)) __PYX_ERR(0, 51, __pyx_L1_error
)
2600 __Pyx_GOTREF(__pyx_t_2
);
2601 __pyx_t_5
= PyTuple_New(2); if (unlikely(!__pyx_t_5
)) __PYX_ERR(0, 51, __pyx_L1_error
)
2602 __Pyx_GOTREF(__pyx_t_5
);
2603 __Pyx_GIVEREF(__pyx_t_1
);
2604 PyTuple_SET_ITEM(__pyx_t_5
, 0, __pyx_t_1
);
2605 __Pyx_GIVEREF(__pyx_t_2
);
2606 PyTuple_SET_ITEM(__pyx_t_5
, 1, __pyx_t_2
);
2609 if (unlikely(__pyx_v_self
->logLR_dict
== Py_None
)) {
2610 PyErr_SetString(PyExc_TypeError
, "'NoneType' object is not iterable");
2611 __PYX_ERR(0, 51, __pyx_L1_error
)
2613 __pyx_t_10
= (__Pyx_PyDict_ContainsTF(__pyx_t_5
, __pyx_v_self
->logLR_dict
, Py_EQ
)); if (unlikely(__pyx_t_10
< 0)) __PYX_ERR(0, 51, __pyx_L1_error
)
2614 __Pyx_DECREF(__pyx_t_5
); __pyx_t_5
= 0;
2615 __pyx_t_11
= (__pyx_t_10
!= 0);
2618 /* "MACS2/Statistics.pyx":52
2620 * if ( x, y ) in self.logLR_dict:
2621 * return self.logLR_dict[ ( x, y ) ] # <<<<<<<<<<<<<<
2623 * # calculate and cache
2625 if (unlikely(__pyx_v_self
->logLR_dict
== Py_None
)) {
2626 PyErr_SetString(PyExc_TypeError
, "'NoneType' object is not subscriptable");
2627 __PYX_ERR(0, 52, __pyx_L1_error
)
2629 __pyx_t_5
= PyFloat_FromDouble(__pyx_v_x
); if (unlikely(!__pyx_t_5
)) __PYX_ERR(0, 52, __pyx_L1_error
)
2630 __Pyx_GOTREF(__pyx_t_5
);
2631 __pyx_t_2
= PyFloat_FromDouble(__pyx_v_y
); if (unlikely(!__pyx_t_2
)) __PYX_ERR(0, 52, __pyx_L1_error
)
2632 __Pyx_GOTREF(__pyx_t_2
);
2633 __pyx_t_1
= PyTuple_New(2); if (unlikely(!__pyx_t_1
)) __PYX_ERR(0, 52, __pyx_L1_error
)
2634 __Pyx_GOTREF(__pyx_t_1
);
2635 __Pyx_GIVEREF(__pyx_t_5
);
2636 PyTuple_SET_ITEM(__pyx_t_1
, 0, __pyx_t_5
);
2637 __Pyx_GIVEREF(__pyx_t_2
);
2638 PyTuple_SET_ITEM(__pyx_t_1
, 1, __pyx_t_2
);
2641 __pyx_t_2
= __Pyx_PyDict_GetItem(__pyx_v_self
->logLR_dict
, __pyx_t_1
); if (unlikely(!__pyx_t_2
)) __PYX_ERR(0, 52, __pyx_L1_error
)
2642 __Pyx_GOTREF(__pyx_t_2
);
2643 __Pyx_DECREF(__pyx_t_1
); __pyx_t_1
= 0;
2644 __pyx_t_9
= __pyx_PyFloat_AsFloat(__pyx_t_2
); if (unlikely((__pyx_t_9
== (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 52, __pyx_L1_error
)
2645 __Pyx_DECREF(__pyx_t_2
); __pyx_t_2
= 0;
2646 __pyx_r
= __pyx_t_9
;
2649 /* "MACS2/Statistics.pyx":51
2652 * if ( x, y ) in self.logLR_dict: # <<<<<<<<<<<<<<
2653 * return self.logLR_dict[ ( x, y ) ]
2658 /* "MACS2/Statistics.pyx":55
2660 * # calculate and cache
2661 * if x > y: # <<<<<<<<<<<<<<
2662 * val = (x*(log10(x)-log10(y))+y-x)
2666 __pyx_t_11
= ((__pyx_v_x
> __pyx_v_y
) != 0);
2669 /* "MACS2/Statistics.pyx":56
2670 * # calculate and cache
2672 * val = (x*(log10(x)-log10(y))+y-x) # <<<<<<<<<<<<<<
2674 * val = (x*(-log10(x)+log10(y))-y+x)
2676 __pyx_v_val
= (((__pyx_v_x
* (log10(__pyx_v_x
) - log10(__pyx_v_y
))) + __pyx_v_y
) - __pyx_v_x
);
2678 /* "MACS2/Statistics.pyx":55
2680 * # calculate and cache
2681 * if x > y: # <<<<<<<<<<<<<<
2682 * val = (x*(log10(x)-log10(y))+y-x)
2688 /* "MACS2/Statistics.pyx":57
2690 * val = (x*(log10(x)-log10(y))+y-x)
2691 * elif x < y: # <<<<<<<<<<<<<<
2692 * val = (x*(-log10(x)+log10(y))-y+x)
2695 __pyx_t_11
= ((__pyx_v_x
< __pyx_v_y
) != 0);
2698 /* "MACS2/Statistics.pyx":58
2699 * val = (x*(log10(x)-log10(y))+y-x)
2701 * val = (x*(-log10(x)+log10(y))-y+x) # <<<<<<<<<<<<<<
2705 __pyx_v_val
= (((__pyx_v_x
* ((-log10(__pyx_v_x
)) + log10(__pyx_v_y
))) - __pyx_v_y
) + __pyx_v_x
);
2707 /* "MACS2/Statistics.pyx":57
2709 * val = (x*(log10(x)-log10(y))+y-x)
2710 * elif x < y: # <<<<<<<<<<<<<<
2711 * val = (x*(-log10(x)+log10(y))-y+x)
2717 /* "MACS2/Statistics.pyx":60
2718 * val = (x*(-log10(x)+log10(y))-y+x)
2720 * val = 0 # <<<<<<<<<<<<<<
2721 * self.logLR_dict[ ( x, y ) ] = val
2729 /* "MACS2/Statistics.pyx":61
2732 * self.logLR_dict[ ( x, y ) ] = val # <<<<<<<<<<<<<<
2736 __pyx_t_2
= PyFloat_FromDouble(__pyx_v_val
); if (unlikely(!__pyx_t_2
)) __PYX_ERR(0, 61, __pyx_L1_error
)
2737 __Pyx_GOTREF(__pyx_t_2
);
2738 if (unlikely(__pyx_v_self
->logLR_dict
== Py_None
)) {
2739 PyErr_SetString(PyExc_TypeError
, "'NoneType' object is not subscriptable");
2740 __PYX_ERR(0, 61, __pyx_L1_error
)
2742 __pyx_t_1
= PyFloat_FromDouble(__pyx_v_x
); if (unlikely(!__pyx_t_1
)) __PYX_ERR(0, 61, __pyx_L1_error
)
2743 __Pyx_GOTREF(__pyx_t_1
);
2744 __pyx_t_5
= PyFloat_FromDouble(__pyx_v_y
); if (unlikely(!__pyx_t_5
)) __PYX_ERR(0, 61, __pyx_L1_error
)
2745 __Pyx_GOTREF(__pyx_t_5
);
2746 __pyx_t_8
= PyTuple_New(2); if (unlikely(!__pyx_t_8
)) __PYX_ERR(0, 61, __pyx_L1_error
)
2747 __Pyx_GOTREF(__pyx_t_8
);
2748 __Pyx_GIVEREF(__pyx_t_1
);
2749 PyTuple_SET_ITEM(__pyx_t_8
, 0, __pyx_t_1
);
2750 __Pyx_GIVEREF(__pyx_t_5
);
2751 PyTuple_SET_ITEM(__pyx_t_8
, 1, __pyx_t_5
);
2754 if (unlikely(PyDict_SetItem(__pyx_v_self
->logLR_dict
, __pyx_t_8
, __pyx_t_2
) < 0)) __PYX_ERR(0, 61, __pyx_L1_error
)
2755 __Pyx_DECREF(__pyx_t_8
); __pyx_t_8
= 0;
2756 __Pyx_DECREF(__pyx_t_2
); __pyx_t_2
= 0;
2758 /* "MACS2/Statistics.pyx":62
2760 * self.logLR_dict[ ( x, y ) ] = val
2761 * return val # <<<<<<<<<<<<<<
2765 __pyx_r
= __pyx_v_val
;
2769 /* "MACS2/Statistics.pyx":47
2770 * self.logLR_dict = dict()
2772 * cpdef float get_logLR_asym ( self, float x, float y ): # <<<<<<<<<<<<<<
2777 /* function exit code */
2779 __Pyx_XDECREF(__pyx_t_1
);
2780 __Pyx_XDECREF(__pyx_t_2
);
2781 __Pyx_XDECREF(__pyx_t_3
);
2782 __Pyx_XDECREF(__pyx_t_4
);
2783 __Pyx_XDECREF(__pyx_t_5
);
2784 __Pyx_XDECREF(__pyx_t_6
);
2785 __Pyx_XDECREF(__pyx_t_8
);
2786 __Pyx_WriteUnraisable("MACS2.Statistics.LogLR_Asym.get_logLR_asym", __pyx_clineno
, __pyx_lineno
, __pyx_filename
, 1, 0);
2789 __Pyx_TraceReturn(Py_None
, 0);
2790 __Pyx_RefNannyFinishContext();
2794 /* Python wrapper */
2795 static PyObject
*__pyx_pw_5MACS2_10Statistics_10LogLR_Asym_3get_logLR_asym(PyObject
*__pyx_v_self
, PyObject
*__pyx_args
, PyObject
*__pyx_kwds
); /*proto*/
2796 static PyObject
*__pyx_pw_5MACS2_10Statistics_10LogLR_Asym_3get_logLR_asym(PyObject
*__pyx_v_self
, PyObject
*__pyx_args
, PyObject
*__pyx_kwds
) {
2799 PyObject
*__pyx_r
= 0;
2800 __Pyx_RefNannyDeclarations
2801 __Pyx_RefNannySetupContext("get_logLR_asym (wrapper)", 0);
2803 static PyObject
**__pyx_pyargnames
[] = {&__pyx_n_s_x
,&__pyx_n_s_y
,0};
2804 PyObject
* values
[2] = {0,0};
2805 if (unlikely(__pyx_kwds
)) {
2807 const Py_ssize_t pos_args
= PyTuple_GET_SIZE(__pyx_args
);
2809 case 2: values
[1] = PyTuple_GET_ITEM(__pyx_args
, 1);
2811 case 1: values
[0] = PyTuple_GET_ITEM(__pyx_args
, 0);
2814 default: goto __pyx_L5_argtuple_error
;
2816 kw_args
= PyDict_Size(__pyx_kwds
);
2819 if (likely((values
[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds
, __pyx_n_s_x
)) != 0)) kw_args
--;
2820 else goto __pyx_L5_argtuple_error
;
2823 if (likely((values
[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds
, __pyx_n_s_y
)) != 0)) kw_args
--;
2825 __Pyx_RaiseArgtupleInvalid("get_logLR_asym", 1, 2, 2, 1); __PYX_ERR(0, 47, __pyx_L3_error
)
2828 if (unlikely(kw_args
> 0)) {
2829 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds
, __pyx_pyargnames
, 0, values
, pos_args
, "get_logLR_asym") < 0)) __PYX_ERR(0, 47, __pyx_L3_error
)
2831 } else if (PyTuple_GET_SIZE(__pyx_args
) != 2) {
2832 goto __pyx_L5_argtuple_error
;
2834 values
[0] = PyTuple_GET_ITEM(__pyx_args
, 0);
2835 values
[1] = PyTuple_GET_ITEM(__pyx_args
, 1);
2837 __pyx_v_x
= __pyx_PyFloat_AsFloat(values
[0]); if (unlikely((__pyx_v_x
== (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 47, __pyx_L3_error
)
2838 __pyx_v_y
= __pyx_PyFloat_AsFloat(values
[1]); if (unlikely((__pyx_v_y
== (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 47, __pyx_L3_error
)
2840 goto __pyx_L4_argument_unpacking_done
;
2841 __pyx_L5_argtuple_error
:;
2842 __Pyx_RaiseArgtupleInvalid("get_logLR_asym", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args
)); __PYX_ERR(0, 47, __pyx_L3_error
)
2844 __Pyx_AddTraceback("MACS2.Statistics.LogLR_Asym.get_logLR_asym", __pyx_clineno
, __pyx_lineno
, __pyx_filename
);
2845 __Pyx_RefNannyFinishContext();
2847 __pyx_L4_argument_unpacking_done
:;
2848 __pyx_r
= __pyx_pf_5MACS2_10Statistics_10LogLR_Asym_2get_logLR_asym(((struct __pyx_obj_5MACS2_10Statistics_LogLR_Asym
*)__pyx_v_self
), __pyx_v_x
, __pyx_v_y
);
2850 /* function exit code */
2851 __Pyx_RefNannyFinishContext();
2855 static PyObject
*__pyx_pf_5MACS2_10Statistics_10LogLR_Asym_2get_logLR_asym(struct __pyx_obj_5MACS2_10Statistics_LogLR_Asym
*__pyx_v_self
, float __pyx_v_x
, float __pyx_v_y
) {
2856 PyObject
*__pyx_r
= NULL
;
2857 __Pyx_TraceDeclarations
2858 __Pyx_RefNannyDeclarations
2859 PyObject
*__pyx_t_1
= NULL
;
2860 __Pyx_RefNannySetupContext("get_logLR_asym", 0);
2861 __Pyx_TraceCall("get_logLR_asym (wrapper)", __pyx_f
[0], 47, 0, __PYX_ERR(0, 47, __pyx_L1_error
));
2862 __Pyx_XDECREF(__pyx_r
);
2863 __pyx_t_1
= PyFloat_FromDouble(__pyx_f_5MACS2_10Statistics_10LogLR_Asym_get_logLR_asym(__pyx_v_self
, __pyx_v_x
, __pyx_v_y
, 1)); if (unlikely(!__pyx_t_1
)) __PYX_ERR(0, 47, __pyx_L1_error
)
2864 __Pyx_GOTREF(__pyx_t_1
);
2865 __pyx_r
= __pyx_t_1
;
2869 /* function exit code */
2871 __Pyx_XDECREF(__pyx_t_1
);
2872 __Pyx_AddTraceback("MACS2.Statistics.LogLR_Asym.get_logLR_asym", __pyx_clineno
, __pyx_lineno
, __pyx_filename
);
2875 __Pyx_XGIVEREF(__pyx_r
);
2876 __Pyx_TraceReturn(__pyx_r
, 0);
2877 __Pyx_RefNannyFinishContext();
2881 /* "(tree fragment)":1
2882 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
2887 /* Python wrapper */
2888 static PyObject
*__pyx_pw_5MACS2_10Statistics_10LogLR_Asym_5__reduce_cython__(PyObject
*__pyx_v_self
, CYTHON_UNUSED PyObject
*unused
); /*proto*/
2889 static PyObject
*__pyx_pw_5MACS2_10Statistics_10LogLR_Asym_5__reduce_cython__(PyObject
*__pyx_v_self
, CYTHON_UNUSED PyObject
*unused
) {
2890 PyObject
*__pyx_r
= 0;
2891 __Pyx_RefNannyDeclarations
2892 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
2893 __pyx_r
= __pyx_pf_5MACS2_10Statistics_10LogLR_Asym_4__reduce_cython__(((struct __pyx_obj_5MACS2_10Statistics_LogLR_Asym
*)__pyx_v_self
));
2895 /* function exit code */
2896 __Pyx_RefNannyFinishContext();
2900 static PyObject
*__pyx_pf_5MACS2_10Statistics_10LogLR_Asym_4__reduce_cython__(struct __pyx_obj_5MACS2_10Statistics_LogLR_Asym
*__pyx_v_self
) {
2901 PyObject
*__pyx_v_state
= 0;
2902 PyObject
*__pyx_v__dict
= 0;
2903 int __pyx_v_use_setstate
;
2904 PyObject
*__pyx_r
= NULL
;
2905 __Pyx_TraceDeclarations
2906 __Pyx_RefNannyDeclarations
2907 PyObject
*__pyx_t_1
= NULL
;
2910 PyObject
*__pyx_t_4
= NULL
;
2911 PyObject
*__pyx_t_5
= NULL
;
2912 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
2913 __Pyx_TraceCall("__reduce_cython__", __pyx_f
[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error
));
2915 /* "(tree fragment)":5
2917 * cdef bint use_setstate
2918 * state = (self.logLR_dict,) # <<<<<<<<<<<<<<
2919 * _dict = getattr(self, '__dict__', None)
2920 * if _dict is not None:
2922 __pyx_t_1
= PyTuple_New(1); if (unlikely(!__pyx_t_1
)) __PYX_ERR(1, 5, __pyx_L1_error
)
2923 __Pyx_GOTREF(__pyx_t_1
);
2924 __Pyx_INCREF(__pyx_v_self
->logLR_dict
);
2925 __Pyx_GIVEREF(__pyx_v_self
->logLR_dict
);
2926 PyTuple_SET_ITEM(__pyx_t_1
, 0, __pyx_v_self
->logLR_dict
);
2927 __pyx_v_state
= ((PyObject
*)__pyx_t_1
);
2930 /* "(tree fragment)":6
2931 * cdef bint use_setstate
2932 * state = (self.logLR_dict,)
2933 * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
2934 * if _dict is not None:
2937 __pyx_t_1
= __Pyx_GetAttr3(((PyObject
*)__pyx_v_self
), __pyx_n_s_dict
, Py_None
); if (unlikely(!__pyx_t_1
)) __PYX_ERR(1, 6, __pyx_L1_error
)
2938 __Pyx_GOTREF(__pyx_t_1
);
2939 __pyx_v__dict
= __pyx_t_1
;
2942 /* "(tree fragment)":7
2943 * state = (self.logLR_dict,)
2944 * _dict = getattr(self, '__dict__', None)
2945 * if _dict is not None: # <<<<<<<<<<<<<<
2947 * use_setstate = True
2949 __pyx_t_2
= (__pyx_v__dict
!= Py_None
);
2950 __pyx_t_3
= (__pyx_t_2
!= 0);
2953 /* "(tree fragment)":8
2954 * _dict = getattr(self, '__dict__', None)
2955 * if _dict is not None:
2956 * state += (_dict,) # <<<<<<<<<<<<<<
2957 * use_setstate = True
2960 __pyx_t_1
= PyTuple_New(1); if (unlikely(!__pyx_t_1
)) __PYX_ERR(1, 8, __pyx_L1_error
)
2961 __Pyx_GOTREF(__pyx_t_1
);
2962 __Pyx_INCREF(__pyx_v__dict
);
2963 __Pyx_GIVEREF(__pyx_v__dict
);
2964 PyTuple_SET_ITEM(__pyx_t_1
, 0, __pyx_v__dict
);
2965 __pyx_t_4
= PyNumber_InPlaceAdd(__pyx_v_state
, __pyx_t_1
); if (unlikely(!__pyx_t_4
)) __PYX_ERR(1, 8, __pyx_L1_error
)
2966 __Pyx_GOTREF(__pyx_t_4
);
2967 __Pyx_DECREF(__pyx_t_1
); __pyx_t_1
= 0;
2968 __Pyx_DECREF_SET(__pyx_v_state
, ((PyObject
*)__pyx_t_4
));
2971 /* "(tree fragment)":9
2972 * if _dict is not None:
2974 * use_setstate = True # <<<<<<<<<<<<<<
2976 * use_setstate = self.logLR_dict is not None
2978 __pyx_v_use_setstate
= 1;
2980 /* "(tree fragment)":7
2981 * state = (self.logLR_dict,)
2982 * _dict = getattr(self, '__dict__', None)
2983 * if _dict is not None: # <<<<<<<<<<<<<<
2985 * use_setstate = True
2990 /* "(tree fragment)":11
2991 * use_setstate = True
2993 * use_setstate = self.logLR_dict is not None # <<<<<<<<<<<<<<
2995 * return __pyx_unpickle_LogLR_Asym, (type(self), 0x086441e, None), state
2998 __pyx_t_3
= (__pyx_v_self
->logLR_dict
!= ((PyObject
*)Py_None
));
2999 __pyx_v_use_setstate
= __pyx_t_3
;
3003 /* "(tree fragment)":12
3005 * use_setstate = self.logLR_dict is not None
3006 * if use_setstate: # <<<<<<<<<<<<<<
3007 * return __pyx_unpickle_LogLR_Asym, (type(self), 0x086441e, None), state
3010 __pyx_t_3
= (__pyx_v_use_setstate
!= 0);
3013 /* "(tree fragment)":13
3014 * use_setstate = self.logLR_dict is not None
3016 * return __pyx_unpickle_LogLR_Asym, (type(self), 0x086441e, None), state # <<<<<<<<<<<<<<
3018 * return __pyx_unpickle_LogLR_Asym, (type(self), 0x086441e, state)
3020 __Pyx_XDECREF(__pyx_r
);
3021 __Pyx_GetModuleGlobalName(__pyx_t_4
, __pyx_n_s_pyx_unpickle_LogLR_Asym
); if (unlikely(!__pyx_t_4
)) __PYX_ERR(1, 13, __pyx_L1_error
)
3022 __Pyx_GOTREF(__pyx_t_4
);
3023 __pyx_t_1
= PyTuple_New(3); if (unlikely(!__pyx_t_1
)) __PYX_ERR(1, 13, __pyx_L1_error
)
3024 __Pyx_GOTREF(__pyx_t_1
);
3025 __Pyx_INCREF(((PyObject
*)Py_TYPE(((PyObject
*)__pyx_v_self
))));
3026 __Pyx_GIVEREF(((PyObject
*)Py_TYPE(((PyObject
*)__pyx_v_self
))));
3027 PyTuple_SET_ITEM(__pyx_t_1
, 0, ((PyObject
*)Py_TYPE(((PyObject
*)__pyx_v_self
))));
3028 __Pyx_INCREF(__pyx_int_8799262
);
3029 __Pyx_GIVEREF(__pyx_int_8799262
);
3030 PyTuple_SET_ITEM(__pyx_t_1
, 1, __pyx_int_8799262
);
3031 __Pyx_INCREF(Py_None
);
3032 __Pyx_GIVEREF(Py_None
);
3033 PyTuple_SET_ITEM(__pyx_t_1
, 2, Py_None
);
3034 __pyx_t_5
= PyTuple_New(3); if (unlikely(!__pyx_t_5
)) __PYX_ERR(1, 13, __pyx_L1_error
)
3035 __Pyx_GOTREF(__pyx_t_5
);
3036 __Pyx_GIVEREF(__pyx_t_4
);
3037 PyTuple_SET_ITEM(__pyx_t_5
, 0, __pyx_t_4
);
3038 __Pyx_GIVEREF(__pyx_t_1
);
3039 PyTuple_SET_ITEM(__pyx_t_5
, 1, __pyx_t_1
);
3040 __Pyx_INCREF(__pyx_v_state
);
3041 __Pyx_GIVEREF(__pyx_v_state
);
3042 PyTuple_SET_ITEM(__pyx_t_5
, 2, __pyx_v_state
);
3045 __pyx_r
= __pyx_t_5
;
3049 /* "(tree fragment)":12
3051 * use_setstate = self.logLR_dict is not None
3052 * if use_setstate: # <<<<<<<<<<<<<<
3053 * return __pyx_unpickle_LogLR_Asym, (type(self), 0x086441e, None), state
3058 /* "(tree fragment)":15
3059 * return __pyx_unpickle_LogLR_Asym, (type(self), 0x086441e, None), state
3061 * return __pyx_unpickle_LogLR_Asym, (type(self), 0x086441e, state) # <<<<<<<<<<<<<<
3062 * def __setstate_cython__(self, __pyx_state):
3063 * __pyx_unpickle_LogLR_Asym__set_state(self, __pyx_state)
3066 __Pyx_XDECREF(__pyx_r
);
3067 __Pyx_GetModuleGlobalName(__pyx_t_5
, __pyx_n_s_pyx_unpickle_LogLR_Asym
); if (unlikely(!__pyx_t_5
)) __PYX_ERR(1, 15, __pyx_L1_error
)
3068 __Pyx_GOTREF(__pyx_t_5
);
3069 __pyx_t_1
= PyTuple_New(3); if (unlikely(!__pyx_t_1
)) __PYX_ERR(1, 15, __pyx_L1_error
)
3070 __Pyx_GOTREF(__pyx_t_1
);
3071 __Pyx_INCREF(((PyObject
*)Py_TYPE(((PyObject
*)__pyx_v_self
))));
3072 __Pyx_GIVEREF(((PyObject
*)Py_TYPE(((PyObject
*)__pyx_v_self
))));
3073 PyTuple_SET_ITEM(__pyx_t_1
, 0, ((PyObject
*)Py_TYPE(((PyObject
*)__pyx_v_self
))));
3074 __Pyx_INCREF(__pyx_int_8799262
);
3075 __Pyx_GIVEREF(__pyx_int_8799262
);
3076 PyTuple_SET_ITEM(__pyx_t_1
, 1, __pyx_int_8799262
);
3077 __Pyx_INCREF(__pyx_v_state
);
3078 __Pyx_GIVEREF(__pyx_v_state
);
3079 PyTuple_SET_ITEM(__pyx_t_1
, 2, __pyx_v_state
);
3080 __pyx_t_4
= PyTuple_New(2); if (unlikely(!__pyx_t_4
)) __PYX_ERR(1, 15, __pyx_L1_error
)
3081 __Pyx_GOTREF(__pyx_t_4
);
3082 __Pyx_GIVEREF(__pyx_t_5
);
3083 PyTuple_SET_ITEM(__pyx_t_4
, 0, __pyx_t_5
);
3084 __Pyx_GIVEREF(__pyx_t_1
);
3085 PyTuple_SET_ITEM(__pyx_t_4
, 1, __pyx_t_1
);
3088 __pyx_r
= __pyx_t_4
;
3093 /* "(tree fragment)":1
3094 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
3099 /* function exit code */
3101 __Pyx_XDECREF(__pyx_t_1
);
3102 __Pyx_XDECREF(__pyx_t_4
);
3103 __Pyx_XDECREF(__pyx_t_5
);
3104 __Pyx_AddTraceback("MACS2.Statistics.LogLR_Asym.__reduce_cython__", __pyx_clineno
, __pyx_lineno
, __pyx_filename
);
3107 __Pyx_XDECREF(__pyx_v_state
);
3108 __Pyx_XDECREF(__pyx_v__dict
);
3109 __Pyx_XGIVEREF(__pyx_r
);
3110 __Pyx_TraceReturn(__pyx_r
, 0);
3111 __Pyx_RefNannyFinishContext();
3115 /* "(tree fragment)":16
3117 * return __pyx_unpickle_LogLR_Asym, (type(self), 0x086441e, state)
3118 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
3119 * __pyx_unpickle_LogLR_Asym__set_state(self, __pyx_state)
3122 /* Python wrapper */
3123 static PyObject
*__pyx_pw_5MACS2_10Statistics_10LogLR_Asym_7__setstate_cython__(PyObject
*__pyx_v_self
, PyObject
*__pyx_v___pyx_state
); /*proto*/
3124 static PyObject
*__pyx_pw_5MACS2_10Statistics_10LogLR_Asym_7__setstate_cython__(PyObject
*__pyx_v_self
, PyObject
*__pyx_v___pyx_state
) {
3125 PyObject
*__pyx_r
= 0;
3126 __Pyx_RefNannyDeclarations
3127 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
3128 __pyx_r
= __pyx_pf_5MACS2_10Statistics_10LogLR_Asym_6__setstate_cython__(((struct __pyx_obj_5MACS2_10Statistics_LogLR_Asym
*)__pyx_v_self
), ((PyObject
*)__pyx_v___pyx_state
));
3130 /* function exit code */
3131 __Pyx_RefNannyFinishContext();
3135 static PyObject
*__pyx_pf_5MACS2_10Statistics_10LogLR_Asym_6__setstate_cython__(struct __pyx_obj_5MACS2_10Statistics_LogLR_Asym
*__pyx_v_self
, PyObject
*__pyx_v___pyx_state
) {
3136 PyObject
*__pyx_r
= NULL
;
3137 __Pyx_TraceDeclarations
3138 __Pyx_RefNannyDeclarations
3139 PyObject
*__pyx_t_1
= NULL
;
3140 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
3141 __Pyx_TraceCall("__setstate_cython__", __pyx_f
[1], 16, 0, __PYX_ERR(1, 16, __pyx_L1_error
));
3143 /* "(tree fragment)":17
3144 * return __pyx_unpickle_LogLR_Asym, (type(self), 0x086441e, state)
3145 * def __setstate_cython__(self, __pyx_state):
3146 * __pyx_unpickle_LogLR_Asym__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
3148 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state
))||((__pyx_v___pyx_state
) == Py_None
)||(PyErr_Format(PyExc_TypeError
, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state
)->tp_name
), 0))) __PYX_ERR(1, 17, __pyx_L1_error
)
3149 __pyx_t_1
= __pyx_f_5MACS2_10Statistics___pyx_unpickle_LogLR_Asym__set_state(__pyx_v_self
, ((PyObject
*)__pyx_v___pyx_state
)); if (unlikely(!__pyx_t_1
)) __PYX_ERR(1, 17, __pyx_L1_error
)
3150 __Pyx_GOTREF(__pyx_t_1
);
3151 __Pyx_DECREF(__pyx_t_1
); __pyx_t_1
= 0;
3153 /* "(tree fragment)":16
3155 * return __pyx_unpickle_LogLR_Asym, (type(self), 0x086441e, state)
3156 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
3157 * __pyx_unpickle_LogLR_Asym__set_state(self, __pyx_state)
3160 /* function exit code */
3161 __pyx_r
= Py_None
; __Pyx_INCREF(Py_None
);
3164 __Pyx_XDECREF(__pyx_t_1
);
3165 __Pyx_AddTraceback("MACS2.Statistics.LogLR_Asym.__setstate_cython__", __pyx_clineno
, __pyx_lineno
, __pyx_filename
);
3168 __Pyx_XGIVEREF(__pyx_r
);
3169 __Pyx_TraceReturn(__pyx_r
, 0);
3170 __Pyx_RefNannyFinishContext();
3174 /* "MACS2/Statistics.pyx":74
3177 * def __init__ ( self ): # <<<<<<<<<<<<<<
3178 * self.logLR_dict = dict()
3182 /* Python wrapper */
3183 static int __pyx_pw_5MACS2_10Statistics_9LogLR_Sym_1__init__(PyObject
*__pyx_v_self
, PyObject
*__pyx_args
, PyObject
*__pyx_kwds
); /*proto*/
3184 static int __pyx_pw_5MACS2_10Statistics_9LogLR_Sym_1__init__(PyObject
*__pyx_v_self
, PyObject
*__pyx_args
, PyObject
*__pyx_kwds
) {
3186 __Pyx_RefNannyDeclarations
3187 __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
3188 if (unlikely(PyTuple_GET_SIZE(__pyx_args
) > 0)) {
3189 __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args
)); return -1;}
3190 if (unlikely(__pyx_kwds
) && unlikely(PyDict_Size(__pyx_kwds
) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds
, "__init__", 0))) return -1;
3191 __pyx_r
= __pyx_pf_5MACS2_10Statistics_9LogLR_Sym___init__(((struct __pyx_obj_5MACS2_10Statistics_LogLR_Sym
*)__pyx_v_self
));
3193 /* function exit code */
3194 __Pyx_RefNannyFinishContext();
3198 static int __pyx_pf_5MACS2_10Statistics_9LogLR_Sym___init__(struct __pyx_obj_5MACS2_10Statistics_LogLR_Sym
*__pyx_v_self
) {
3200 __Pyx_TraceDeclarations
3201 __Pyx_RefNannyDeclarations
3202 PyObject
*__pyx_t_1
= NULL
;
3203 __Pyx_RefNannySetupContext("__init__", 0);
3204 __Pyx_TraceCall("__init__", __pyx_f
[0], 74, 0, __PYX_ERR(0, 74, __pyx_L1_error
));
3206 /* "MACS2/Statistics.pyx":75
3208 * def __init__ ( self ):
3209 * self.logLR_dict = dict() # <<<<<<<<<<<<<<
3211 * cpdef float get_logLR_sym ( self, float x, float y ):
3213 __pyx_t_1
= __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1
)) __PYX_ERR(0, 75, __pyx_L1_error
)
3214 __Pyx_GOTREF(__pyx_t_1
);
3215 __Pyx_GIVEREF(__pyx_t_1
);
3216 __Pyx_GOTREF(__pyx_v_self
->logLR_dict
);
3217 __Pyx_DECREF(__pyx_v_self
->logLR_dict
);
3218 __pyx_v_self
->logLR_dict
= ((PyObject
*)__pyx_t_1
);
3221 /* "MACS2/Statistics.pyx":74
3224 * def __init__ ( self ): # <<<<<<<<<<<<<<
3225 * self.logLR_dict = dict()
3229 /* function exit code */
3233 __Pyx_XDECREF(__pyx_t_1
);
3234 __Pyx_AddTraceback("MACS2.Statistics.LogLR_Sym.__init__", __pyx_clineno
, __pyx_lineno
, __pyx_filename
);
3237 __Pyx_TraceReturn(Py_None
, 0);
3238 __Pyx_RefNannyFinishContext();
3242 /* "MACS2/Statistics.pyx":77
3243 * self.logLR_dict = dict()
3245 * cpdef float get_logLR_sym ( self, float x, float y ): # <<<<<<<<<<<<<<
3250 static PyObject
*__pyx_pw_5MACS2_10Statistics_9LogLR_Sym_3get_logLR_sym(PyObject
*__pyx_v_self
, PyObject
*__pyx_args
, PyObject
*__pyx_kwds
); /*proto*/
3251 static float __pyx_f_5MACS2_10Statistics_9LogLR_Sym_get_logLR_sym(struct __pyx_obj_5MACS2_10Statistics_LogLR_Sym
*__pyx_v_self
, float __pyx_v_x
, float __pyx_v_y
, int __pyx_skip_dispatch
) {
3254 __Pyx_TraceDeclarations
3255 __Pyx_RefNannyDeclarations
3256 PyObject
*__pyx_t_1
= NULL
;
3257 PyObject
*__pyx_t_2
= NULL
;
3258 PyObject
*__pyx_t_3
= NULL
;
3259 PyObject
*__pyx_t_4
= NULL
;
3260 PyObject
*__pyx_t_5
= NULL
;
3261 PyObject
*__pyx_t_6
= NULL
;
3263 PyObject
*__pyx_t_8
= NULL
;
3267 __Pyx_RefNannySetupContext("get_logLR_sym", 0);
3268 __Pyx_TraceCall("get_logLR_sym", __pyx_f
[0], 77, 0, __PYX_ERR(0, 77, __pyx_L1_error
));
3269 /* Check if called by wrapper */
3270 if (unlikely(__pyx_skip_dispatch
)) ;
3271 /* Check if overridden in Python */
3272 else if (unlikely((Py_TYPE(((PyObject
*)__pyx_v_self
))->tp_dictoffset
!= 0) || (Py_TYPE(((PyObject
*)__pyx_v_self
))->tp_flags
& (Py_TPFLAGS_IS_ABSTRACT
| Py_TPFLAGS_HEAPTYPE
)))) {
3273 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
3274 static PY_UINT64_T __pyx_tp_dict_version
= __PYX_DICT_VERSION_INIT
, __pyx_obj_dict_version
= __PYX_DICT_VERSION_INIT
;
3275 if (unlikely(!__Pyx_object_dict_version_matches(((PyObject
*)__pyx_v_self
), __pyx_tp_dict_version
, __pyx_obj_dict_version
))) {
3276 PY_UINT64_T __pyx_type_dict_guard
= __Pyx_get_tp_dict_version(((PyObject
*)__pyx_v_self
));
3278 __pyx_t_1
= __Pyx_PyObject_GetAttrStr(((PyObject
*)__pyx_v_self
), __pyx_n_s_get_logLR_sym
); if (unlikely(!__pyx_t_1
)) __PYX_ERR(0, 77, __pyx_L1_error
)
3279 __Pyx_GOTREF(__pyx_t_1
);
3280 if (!PyCFunction_Check(__pyx_t_1
) || (PyCFunction_GET_FUNCTION(__pyx_t_1
) != (PyCFunction
)(void*)__pyx_pw_5MACS2_10Statistics_9LogLR_Sym_3get_logLR_sym
)) {
3281 __pyx_t_3
= PyFloat_FromDouble(__pyx_v_x
); if (unlikely(!__pyx_t_3
)) __PYX_ERR(0, 77, __pyx_L1_error
)
3282 __Pyx_GOTREF(__pyx_t_3
);
3283 __pyx_t_4
= PyFloat_FromDouble(__pyx_v_y
); if (unlikely(!__pyx_t_4
)) __PYX_ERR(0, 77, __pyx_L1_error
)
3284 __Pyx_GOTREF(__pyx_t_4
);
3285 __Pyx_INCREF(__pyx_t_1
);
3286 __pyx_t_5
= __pyx_t_1
; __pyx_t_6
= NULL
;
3288 if (CYTHON_UNPACK_METHODS
&& unlikely(PyMethod_Check(__pyx_t_5
))) {
3289 __pyx_t_6
= PyMethod_GET_SELF(__pyx_t_5
);
3290 if (likely(__pyx_t_6
)) {
3291 PyObject
* function
= PyMethod_GET_FUNCTION(__pyx_t_5
);
3292 __Pyx_INCREF(__pyx_t_6
);
3293 __Pyx_INCREF(function
);
3294 __Pyx_DECREF_SET(__pyx_t_5
, function
);
3298 #if CYTHON_FAST_PYCALL
3299 if (PyFunction_Check(__pyx_t_5
)) {
3300 PyObject
*__pyx_temp
[3] = {__pyx_t_6
, __pyx_t_3
, __pyx_t_4
};
3301 __pyx_t_2
= __Pyx_PyFunction_FastCall(__pyx_t_5
, __pyx_temp
+1-__pyx_t_7
, 2+__pyx_t_7
); if (unlikely(!__pyx_t_2
)) __PYX_ERR(0, 77, __pyx_L1_error
)
3302 __Pyx_XDECREF(__pyx_t_6
); __pyx_t_6
= 0;
3303 __Pyx_GOTREF(__pyx_t_2
);
3304 __Pyx_DECREF(__pyx_t_3
); __pyx_t_3
= 0;
3305 __Pyx_DECREF(__pyx_t_4
); __pyx_t_4
= 0;
3308 #if CYTHON_FAST_PYCCALL
3309 if (__Pyx_PyFastCFunction_Check(__pyx_t_5
)) {
3310 PyObject
*__pyx_temp
[3] = {__pyx_t_6
, __pyx_t_3
, __pyx_t_4
};
3311 __pyx_t_2
= __Pyx_PyCFunction_FastCall(__pyx_t_5
, __pyx_temp
+1-__pyx_t_7
, 2+__pyx_t_7
); if (unlikely(!__pyx_t_2
)) __PYX_ERR(0, 77, __pyx_L1_error
)
3312 __Pyx_XDECREF(__pyx_t_6
); __pyx_t_6
= 0;
3313 __Pyx_GOTREF(__pyx_t_2
);
3314 __Pyx_DECREF(__pyx_t_3
); __pyx_t_3
= 0;
3315 __Pyx_DECREF(__pyx_t_4
); __pyx_t_4
= 0;
3319 __pyx_t_8
= PyTuple_New(2+__pyx_t_7
); if (unlikely(!__pyx_t_8
)) __PYX_ERR(0, 77, __pyx_L1_error
)
3320 __Pyx_GOTREF(__pyx_t_8
);
3322 __Pyx_GIVEREF(__pyx_t_6
); PyTuple_SET_ITEM(__pyx_t_8
, 0, __pyx_t_6
); __pyx_t_6
= NULL
;
3324 __Pyx_GIVEREF(__pyx_t_3
);
3325 PyTuple_SET_ITEM(__pyx_t_8
, 0+__pyx_t_7
, __pyx_t_3
);
3326 __Pyx_GIVEREF(__pyx_t_4
);
3327 PyTuple_SET_ITEM(__pyx_t_8
, 1+__pyx_t_7
, __pyx_t_4
);
3330 __pyx_t_2
= __Pyx_PyObject_Call(__pyx_t_5
, __pyx_t_8
, NULL
); if (unlikely(!__pyx_t_2
)) __PYX_ERR(0, 77, __pyx_L1_error
)
3331 __Pyx_GOTREF(__pyx_t_2
);
3332 __Pyx_DECREF(__pyx_t_8
); __pyx_t_8
= 0;
3334 __Pyx_DECREF(__pyx_t_5
); __pyx_t_5
= 0;
3335 __pyx_t_9
= __pyx_PyFloat_AsFloat(__pyx_t_2
); if (unlikely((__pyx_t_9
== (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 77, __pyx_L1_error
)
3336 __Pyx_DECREF(__pyx_t_2
); __pyx_t_2
= 0;
3337 __pyx_r
= __pyx_t_9
;
3338 __Pyx_DECREF(__pyx_t_1
); __pyx_t_1
= 0;
3341 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
3342 __pyx_tp_dict_version
= __Pyx_get_tp_dict_version(((PyObject
*)__pyx_v_self
));
3343 __pyx_obj_dict_version
= __Pyx_get_object_dict_version(((PyObject
*)__pyx_v_self
));
3344 if (unlikely(__pyx_type_dict_guard
!= __pyx_tp_dict_version
)) {
3345 __pyx_tp_dict_version
= __pyx_obj_dict_version
= __PYX_DICT_VERSION_INIT
;
3348 __Pyx_DECREF(__pyx_t_1
); __pyx_t_1
= 0;
3349 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
3354 /* "MACS2/Statistics.pyx":81
3357 * if ( x, y ) in self.logLR_dict: # <<<<<<<<<<<<<<
3358 * return self.logLR_dict[ ( x, y ) ]
3361 __pyx_t_1
= PyFloat_FromDouble(__pyx_v_x
); if (unlikely(!__pyx_t_1
)) __PYX_ERR(0, 81, __pyx_L1_error
)
3362 __Pyx_GOTREF(__pyx_t_1
);
3363 __pyx_t_2
= PyFloat_FromDouble(__pyx_v_y
); if (unlikely(!__pyx_t_2
)) __PYX_ERR(0, 81, __pyx_L1_error
)
3364 __Pyx_GOTREF(__pyx_t_2
);
3365 __pyx_t_5
= PyTuple_New(2); if (unlikely(!__pyx_t_5
)) __PYX_ERR(0, 81, __pyx_L1_error
)
3366 __Pyx_GOTREF(__pyx_t_5
);
3367 __Pyx_GIVEREF(__pyx_t_1
);
3368 PyTuple_SET_ITEM(__pyx_t_5
, 0, __pyx_t_1
);
3369 __Pyx_GIVEREF(__pyx_t_2
);
3370 PyTuple_SET_ITEM(__pyx_t_5
, 1, __pyx_t_2
);
3373 if (unlikely(__pyx_v_self
->logLR_dict
== Py_None
)) {
3374 PyErr_SetString(PyExc_TypeError
, "'NoneType' object is not iterable");
3375 __PYX_ERR(0, 81, __pyx_L1_error
)
3377 __pyx_t_10
= (__Pyx_PyDict_ContainsTF(__pyx_t_5
, __pyx_v_self
->logLR_dict
, Py_EQ
)); if (unlikely(__pyx_t_10
< 0)) __PYX_ERR(0, 81, __pyx_L1_error
)
3378 __Pyx_DECREF(__pyx_t_5
); __pyx_t_5
= 0;
3379 __pyx_t_11
= (__pyx_t_10
!= 0);
3382 /* "MACS2/Statistics.pyx":82
3384 * if ( x, y ) in self.logLR_dict:
3385 * return self.logLR_dict[ ( x, y ) ] # <<<<<<<<<<<<<<
3387 * # calculate and cache
3389 if (unlikely(__pyx_v_self
->logLR_dict
== Py_None
)) {
3390 PyErr_SetString(PyExc_TypeError
, "'NoneType' object is not subscriptable");
3391 __PYX_ERR(0, 82, __pyx_L1_error
)
3393 __pyx_t_5
= PyFloat_FromDouble(__pyx_v_x
); if (unlikely(!__pyx_t_5
)) __PYX_ERR(0, 82, __pyx_L1_error
)
3394 __Pyx_GOTREF(__pyx_t_5
);
3395 __pyx_t_2
= PyFloat_FromDouble(__pyx_v_y
); if (unlikely(!__pyx_t_2
)) __PYX_ERR(0, 82, __pyx_L1_error
)
3396 __Pyx_GOTREF(__pyx_t_2
);
3397 __pyx_t_1
= PyTuple_New(2); if (unlikely(!__pyx_t_1
)) __PYX_ERR(0, 82, __pyx_L1_error
)
3398 __Pyx_GOTREF(__pyx_t_1
);
3399 __Pyx_GIVEREF(__pyx_t_5
);
3400 PyTuple_SET_ITEM(__pyx_t_1
, 0, __pyx_t_5
);
3401 __Pyx_GIVEREF(__pyx_t_2
);
3402 PyTuple_SET_ITEM(__pyx_t_1
, 1, __pyx_t_2
);
3405 __pyx_t_2
= __Pyx_PyDict_GetItem(__pyx_v_self
->logLR_dict
, __pyx_t_1
); if (unlikely(!__pyx_t_2
)) __PYX_ERR(0, 82, __pyx_L1_error
)
3406 __Pyx_GOTREF(__pyx_t_2
);
3407 __Pyx_DECREF(__pyx_t_1
); __pyx_t_1
= 0;
3408 __pyx_t_9
= __pyx_PyFloat_AsFloat(__pyx_t_2
); if (unlikely((__pyx_t_9
== (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L1_error
)
3409 __Pyx_DECREF(__pyx_t_2
); __pyx_t_2
= 0;
3410 __pyx_r
= __pyx_t_9
;
3413 /* "MACS2/Statistics.pyx":81
3416 * if ( x, y ) in self.logLR_dict: # <<<<<<<<<<<<<<
3417 * return self.logLR_dict[ ( x, y ) ]
3422 /* "MACS2/Statistics.pyx":85
3424 * # calculate and cache
3425 * if x > y: # <<<<<<<<<<<<<<
3426 * val = (x*(log10(x)-log10(y))+y-x)
3430 __pyx_t_11
= ((__pyx_v_x
> __pyx_v_y
) != 0);
3433 /* "MACS2/Statistics.pyx":86
3434 * # calculate and cache
3436 * val = (x*(log10(x)-log10(y))+y-x) # <<<<<<<<<<<<<<
3438 * val = (y*(log10(x)-log10(y))+y-x)
3440 __pyx_v_val
= (((__pyx_v_x
* (log10(__pyx_v_x
) - log10(__pyx_v_y
))) + __pyx_v_y
) - __pyx_v_x
);
3442 /* "MACS2/Statistics.pyx":85
3444 * # calculate and cache
3445 * if x > y: # <<<<<<<<<<<<<<
3446 * val = (x*(log10(x)-log10(y))+y-x)
3452 /* "MACS2/Statistics.pyx":87
3454 * val = (x*(log10(x)-log10(y))+y-x)
3455 * elif y > x: # <<<<<<<<<<<<<<
3456 * val = (y*(log10(x)-log10(y))+y-x)
3459 __pyx_t_11
= ((__pyx_v_y
> __pyx_v_x
) != 0);
3462 /* "MACS2/Statistics.pyx":88
3463 * val = (x*(log10(x)-log10(y))+y-x)
3465 * val = (y*(log10(x)-log10(y))+y-x) # <<<<<<<<<<<<<<
3469 __pyx_v_val
= (((__pyx_v_y
* (log10(__pyx_v_x
) - log10(__pyx_v_y
))) + __pyx_v_y
) - __pyx_v_x
);
3471 /* "MACS2/Statistics.pyx":87
3473 * val = (x*(log10(x)-log10(y))+y-x)
3474 * elif y > x: # <<<<<<<<<<<<<<
3475 * val = (y*(log10(x)-log10(y))+y-x)
3481 /* "MACS2/Statistics.pyx":90
3482 * val = (y*(log10(x)-log10(y))+y-x)
3484 * val = 0 # <<<<<<<<<<<<<<
3486 * self.logLR_dict[ ( x, y ) ] = val
3493 /* "MACS2/Statistics.pyx":92
3496 * self.logLR_dict[ ( x, y ) ] = val # <<<<<<<<<<<<<<
3500 __pyx_t_2
= PyFloat_FromDouble(__pyx_v_val
); if (unlikely(!__pyx_t_2
)) __PYX_ERR(0, 92, __pyx_L1_error
)
3501 __Pyx_GOTREF(__pyx_t_2
);
3502 if (unlikely(__pyx_v_self
->logLR_dict
== Py_None
)) {
3503 PyErr_SetString(PyExc_TypeError
, "'NoneType' object is not subscriptable");
3504 __PYX_ERR(0, 92, __pyx_L1_error
)
3506 __pyx_t_1
= PyFloat_FromDouble(__pyx_v_x
); if (unlikely(!__pyx_t_1
)) __PYX_ERR(0, 92, __pyx_L1_error
)
3507 __Pyx_GOTREF(__pyx_t_1
);
3508 __pyx_t_5
= PyFloat_FromDouble(__pyx_v_y
); if (unlikely(!__pyx_t_5
)) __PYX_ERR(0, 92, __pyx_L1_error
)
3509 __Pyx_GOTREF(__pyx_t_5
);
3510 __pyx_t_8
= PyTuple_New(2); if (unlikely(!__pyx_t_8
)) __PYX_ERR(0, 92, __pyx_L1_error
)
3511 __Pyx_GOTREF(__pyx_t_8
);
3512 __Pyx_GIVEREF(__pyx_t_1
);
3513 PyTuple_SET_ITEM(__pyx_t_8
, 0, __pyx_t_1
);
3514 __Pyx_GIVEREF(__pyx_t_5
);
3515 PyTuple_SET_ITEM(__pyx_t_8
, 1, __pyx_t_5
);
3518 if (unlikely(PyDict_SetItem(__pyx_v_self
->logLR_dict
, __pyx_t_8
, __pyx_t_2
) < 0)) __PYX_ERR(0, 92, __pyx_L1_error
)
3519 __Pyx_DECREF(__pyx_t_8
); __pyx_t_8
= 0;
3520 __Pyx_DECREF(__pyx_t_2
); __pyx_t_2
= 0;
3522 /* "MACS2/Statistics.pyx":93
3524 * self.logLR_dict[ ( x, y ) ] = val
3525 * return val # <<<<<<<<<<<<<<
3529 __pyx_r
= __pyx_v_val
;
3533 /* "MACS2/Statistics.pyx":77
3534 * self.logLR_dict = dict()
3536 * cpdef float get_logLR_sym ( self, float x, float y ): # <<<<<<<<<<<<<<
3541 /* function exit code */
3543 __Pyx_XDECREF(__pyx_t_1
);
3544 __Pyx_XDECREF(__pyx_t_2
);
3545 __Pyx_XDECREF(__pyx_t_3
);
3546 __Pyx_XDECREF(__pyx_t_4
);
3547 __Pyx_XDECREF(__pyx_t_5
);
3548 __Pyx_XDECREF(__pyx_t_6
);
3549 __Pyx_XDECREF(__pyx_t_8
);
3550 __Pyx_WriteUnraisable("MACS2.Statistics.LogLR_Sym.get_logLR_sym", __pyx_clineno
, __pyx_lineno
, __pyx_filename
, 1, 0);
3553 __Pyx_TraceReturn(Py_None
, 0);
3554 __Pyx_RefNannyFinishContext();
3558 /* Python wrapper */
3559 static PyObject
*__pyx_pw_5MACS2_10Statistics_9LogLR_Sym_3get_logLR_sym(PyObject
*__pyx_v_self
, PyObject
*__pyx_args
, PyObject
*__pyx_kwds
); /*proto*/
3560 static PyObject
*__pyx_pw_5MACS2_10Statistics_9LogLR_Sym_3get_logLR_sym(PyObject
*__pyx_v_self
, PyObject
*__pyx_args
, PyObject
*__pyx_kwds
) {
3563 PyObject
*__pyx_r
= 0;
3564 __Pyx_RefNannyDeclarations
3565 __Pyx_RefNannySetupContext("get_logLR_sym (wrapper)", 0);
3567 static PyObject
**__pyx_pyargnames
[] = {&__pyx_n_s_x
,&__pyx_n_s_y
,0};
3568 PyObject
* values
[2] = {0,0};
3569 if (unlikely(__pyx_kwds
)) {
3571 const Py_ssize_t pos_args
= PyTuple_GET_SIZE(__pyx_args
);
3573 case 2: values
[1] = PyTuple_GET_ITEM(__pyx_args
, 1);
3575 case 1: values
[0] = PyTuple_GET_ITEM(__pyx_args
, 0);
3578 default: goto __pyx_L5_argtuple_error
;
3580 kw_args
= PyDict_Size(__pyx_kwds
);
3583 if (likely((values
[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds
, __pyx_n_s_x
)) != 0)) kw_args
--;
3584 else goto __pyx_L5_argtuple_error
;
3587 if (likely((values
[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds
, __pyx_n_s_y
)) != 0)) kw_args
--;
3589 __Pyx_RaiseArgtupleInvalid("get_logLR_sym", 1, 2, 2, 1); __PYX_ERR(0, 77, __pyx_L3_error
)
3592 if (unlikely(kw_args
> 0)) {
3593 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds
, __pyx_pyargnames
, 0, values
, pos_args
, "get_logLR_sym") < 0)) __PYX_ERR(0, 77, __pyx_L3_error
)
3595 } else if (PyTuple_GET_SIZE(__pyx_args
) != 2) {
3596 goto __pyx_L5_argtuple_error
;
3598 values
[0] = PyTuple_GET_ITEM(__pyx_args
, 0);
3599 values
[1] = PyTuple_GET_ITEM(__pyx_args
, 1);
3601 __pyx_v_x
= __pyx_PyFloat_AsFloat(values
[0]); if (unlikely((__pyx_v_x
== (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 77, __pyx_L3_error
)
3602 __pyx_v_y
= __pyx_PyFloat_AsFloat(values
[1]); if (unlikely((__pyx_v_y
== (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 77, __pyx_L3_error
)
3604 goto __pyx_L4_argument_unpacking_done
;
3605 __pyx_L5_argtuple_error
:;
3606 __Pyx_RaiseArgtupleInvalid("get_logLR_sym", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args
)); __PYX_ERR(0, 77, __pyx_L3_error
)
3608 __Pyx_AddTraceback("MACS2.Statistics.LogLR_Sym.get_logLR_sym", __pyx_clineno
, __pyx_lineno
, __pyx_filename
);
3609 __Pyx_RefNannyFinishContext();
3611 __pyx_L4_argument_unpacking_done
:;
3612 __pyx_r
= __pyx_pf_5MACS2_10Statistics_9LogLR_Sym_2get_logLR_sym(((struct __pyx_obj_5MACS2_10Statistics_LogLR_Sym
*)__pyx_v_self
), __pyx_v_x
, __pyx_v_y
);
3614 /* function exit code */
3615 __Pyx_RefNannyFinishContext();
3619 static PyObject
*__pyx_pf_5MACS2_10Statistics_9LogLR_Sym_2get_logLR_sym(struct __pyx_obj_5MACS2_10Statistics_LogLR_Sym
*__pyx_v_self
, float __pyx_v_x
, float __pyx_v_y
) {
3620 PyObject
*__pyx_r
= NULL
;
3621 __Pyx_TraceDeclarations
3622 __Pyx_RefNannyDeclarations
3623 PyObject
*__pyx_t_1
= NULL
;
3624 __Pyx_RefNannySetupContext("get_logLR_sym", 0);
3625 __Pyx_TraceCall("get_logLR_sym (wrapper)", __pyx_f
[0], 77, 0, __PYX_ERR(0, 77, __pyx_L1_error
));
3626 __Pyx_XDECREF(__pyx_r
);
3627 __pyx_t_1
= PyFloat_FromDouble(__pyx_f_5MACS2_10Statistics_9LogLR_Sym_get_logLR_sym(__pyx_v_self
, __pyx_v_x
, __pyx_v_y
, 1)); if (unlikely(!__pyx_t_1
)) __PYX_ERR(0, 77, __pyx_L1_error
)
3628 __Pyx_GOTREF(__pyx_t_1
);
3629 __pyx_r
= __pyx_t_1
;
3633 /* function exit code */
3635 __Pyx_XDECREF(__pyx_t_1
);
3636 __Pyx_AddTraceback("MACS2.Statistics.LogLR_Sym.get_logLR_sym", __pyx_clineno
, __pyx_lineno
, __pyx_filename
);
3639 __Pyx_XGIVEREF(__pyx_r
);
3640 __Pyx_TraceReturn(__pyx_r
, 0);
3641 __Pyx_RefNannyFinishContext();
3645 /* "(tree fragment)":1
3646 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
3651 /* Python wrapper */
3652 static PyObject
*__pyx_pw_5MACS2_10Statistics_9LogLR_Sym_5__reduce_cython__(PyObject
*__pyx_v_self
, CYTHON_UNUSED PyObject
*unused
); /*proto*/
3653 static PyObject
*__pyx_pw_5MACS2_10Statistics_9LogLR_Sym_5__reduce_cython__(PyObject
*__pyx_v_self
, CYTHON_UNUSED PyObject
*unused
) {
3654 PyObject
*__pyx_r
= 0;
3655 __Pyx_RefNannyDeclarations
3656 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
3657 __pyx_r
= __pyx_pf_5MACS2_10Statistics_9LogLR_Sym_4__reduce_cython__(((struct __pyx_obj_5MACS2_10Statistics_LogLR_Sym
*)__pyx_v_self
));
3659 /* function exit code */
3660 __Pyx_RefNannyFinishContext();
3664 static PyObject
*__pyx_pf_5MACS2_10Statistics_9LogLR_Sym_4__reduce_cython__(struct __pyx_obj_5MACS2_10Statistics_LogLR_Sym
*__pyx_v_self
) {
3665 PyObject
*__pyx_v_state
= 0;
3666 PyObject
*__pyx_v__dict
= 0;
3667 int __pyx_v_use_setstate
;
3668 PyObject
*__pyx_r
= NULL
;
3669 __Pyx_TraceDeclarations
3670 __Pyx_RefNannyDeclarations
3671 PyObject
*__pyx_t_1
= NULL
;
3674 PyObject
*__pyx_t_4
= NULL
;
3675 PyObject
*__pyx_t_5
= NULL
;
3676 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
3677 __Pyx_TraceCall("__reduce_cython__", __pyx_f
[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error
));
3679 /* "(tree fragment)":5
3681 * cdef bint use_setstate
3682 * state = (self.logLR_dict,) # <<<<<<<<<<<<<<
3683 * _dict = getattr(self, '__dict__', None)
3684 * if _dict is not None:
3686 __pyx_t_1
= PyTuple_New(1); if (unlikely(!__pyx_t_1
)) __PYX_ERR(1, 5, __pyx_L1_error
)
3687 __Pyx_GOTREF(__pyx_t_1
);
3688 __Pyx_INCREF(__pyx_v_self
->logLR_dict
);
3689 __Pyx_GIVEREF(__pyx_v_self
->logLR_dict
);
3690 PyTuple_SET_ITEM(__pyx_t_1
, 0, __pyx_v_self
->logLR_dict
);
3691 __pyx_v_state
= ((PyObject
*)__pyx_t_1
);
3694 /* "(tree fragment)":6
3695 * cdef bint use_setstate
3696 * state = (self.logLR_dict,)
3697 * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
3698 * if _dict is not None:
3701 __pyx_t_1
= __Pyx_GetAttr3(((PyObject
*)__pyx_v_self
), __pyx_n_s_dict
, Py_None
); if (unlikely(!__pyx_t_1
)) __PYX_ERR(1, 6, __pyx_L1_error
)
3702 __Pyx_GOTREF(__pyx_t_1
);
3703 __pyx_v__dict
= __pyx_t_1
;
3706 /* "(tree fragment)":7
3707 * state = (self.logLR_dict,)
3708 * _dict = getattr(self, '__dict__', None)
3709 * if _dict is not None: # <<<<<<<<<<<<<<
3711 * use_setstate = True
3713 __pyx_t_2
= (__pyx_v__dict
!= Py_None
);
3714 __pyx_t_3
= (__pyx_t_2
!= 0);
3717 /* "(tree fragment)":8
3718 * _dict = getattr(self, '__dict__', None)
3719 * if _dict is not None:
3720 * state += (_dict,) # <<<<<<<<<<<<<<
3721 * use_setstate = True
3724 __pyx_t_1
= PyTuple_New(1); if (unlikely(!__pyx_t_1
)) __PYX_ERR(1, 8, __pyx_L1_error
)
3725 __Pyx_GOTREF(__pyx_t_1
);
3726 __Pyx_INCREF(__pyx_v__dict
);
3727 __Pyx_GIVEREF(__pyx_v__dict
);
3728 PyTuple_SET_ITEM(__pyx_t_1
, 0, __pyx_v__dict
);
3729 __pyx_t_4
= PyNumber_InPlaceAdd(__pyx_v_state
, __pyx_t_1
); if (unlikely(!__pyx_t_4
)) __PYX_ERR(1, 8, __pyx_L1_error
)
3730 __Pyx_GOTREF(__pyx_t_4
);
3731 __Pyx_DECREF(__pyx_t_1
); __pyx_t_1
= 0;
3732 __Pyx_DECREF_SET(__pyx_v_state
, ((PyObject
*)__pyx_t_4
));
3735 /* "(tree fragment)":9
3736 * if _dict is not None:
3738 * use_setstate = True # <<<<<<<<<<<<<<
3740 * use_setstate = self.logLR_dict is not None
3742 __pyx_v_use_setstate
= 1;
3744 /* "(tree fragment)":7
3745 * state = (self.logLR_dict,)
3746 * _dict = getattr(self, '__dict__', None)
3747 * if _dict is not None: # <<<<<<<<<<<<<<
3749 * use_setstate = True
3754 /* "(tree fragment)":11
3755 * use_setstate = True
3757 * use_setstate = self.logLR_dict is not None # <<<<<<<<<<<<<<
3759 * return __pyx_unpickle_LogLR_Sym, (type(self), 0x086441e, None), state
3762 __pyx_t_3
= (__pyx_v_self
->logLR_dict
!= ((PyObject
*)Py_None
));
3763 __pyx_v_use_setstate
= __pyx_t_3
;
3767 /* "(tree fragment)":12
3769 * use_setstate = self.logLR_dict is not None
3770 * if use_setstate: # <<<<<<<<<<<<<<
3771 * return __pyx_unpickle_LogLR_Sym, (type(self), 0x086441e, None), state
3774 __pyx_t_3
= (__pyx_v_use_setstate
!= 0);
3777 /* "(tree fragment)":13
3778 * use_setstate = self.logLR_dict is not None
3780 * return __pyx_unpickle_LogLR_Sym, (type(self), 0x086441e, None), state # <<<<<<<<<<<<<<
3782 * return __pyx_unpickle_LogLR_Sym, (type(self), 0x086441e, state)
3784 __Pyx_XDECREF(__pyx_r
);
3785 __Pyx_GetModuleGlobalName(__pyx_t_4
, __pyx_n_s_pyx_unpickle_LogLR_Sym
); if (unlikely(!__pyx_t_4
)) __PYX_ERR(1, 13, __pyx_L1_error
)
3786 __Pyx_GOTREF(__pyx_t_4
);
3787 __pyx_t_1
= PyTuple_New(3); if (unlikely(!__pyx_t_1
)) __PYX_ERR(1, 13, __pyx_L1_error
)
3788 __Pyx_GOTREF(__pyx_t_1
);
3789 __Pyx_INCREF(((PyObject
*)Py_TYPE(((PyObject
*)__pyx_v_self
))));
3790 __Pyx_GIVEREF(((PyObject
*)Py_TYPE(((PyObject
*)__pyx_v_self
))));
3791 PyTuple_SET_ITEM(__pyx_t_1
, 0, ((PyObject
*)Py_TYPE(((PyObject
*)__pyx_v_self
))));
3792 __Pyx_INCREF(__pyx_int_8799262
);
3793 __Pyx_GIVEREF(__pyx_int_8799262
);
3794 PyTuple_SET_ITEM(__pyx_t_1
, 1, __pyx_int_8799262
);
3795 __Pyx_INCREF(Py_None
);
3796 __Pyx_GIVEREF(Py_None
);
3797 PyTuple_SET_ITEM(__pyx_t_1
, 2, Py_None
);
3798 __pyx_t_5
= PyTuple_New(3); if (unlikely(!__pyx_t_5
)) __PYX_ERR(1, 13, __pyx_L1_error
)
3799 __Pyx_GOTREF(__pyx_t_5
);
3800 __Pyx_GIVEREF(__pyx_t_4
);
3801 PyTuple_SET_ITEM(__pyx_t_5
, 0, __pyx_t_4
);
3802 __Pyx_GIVEREF(__pyx_t_1
);
3803 PyTuple_SET_ITEM(__pyx_t_5
, 1, __pyx_t_1
);
3804 __Pyx_INCREF(__pyx_v_state
);
3805 __Pyx_GIVEREF(__pyx_v_state
);
3806 PyTuple_SET_ITEM(__pyx_t_5
, 2, __pyx_v_state
);
3809 __pyx_r
= __pyx_t_5
;
3813 /* "(tree fragment)":12
3815 * use_setstate = self.logLR_dict is not None
3816 * if use_setstate: # <<<<<<<<<<<<<<
3817 * return __pyx_unpickle_LogLR_Sym, (type(self), 0x086441e, None), state
3822 /* "(tree fragment)":15
3823 * return __pyx_unpickle_LogLR_Sym, (type(self), 0x086441e, None), state
3825 * return __pyx_unpickle_LogLR_Sym, (type(self), 0x086441e, state) # <<<<<<<<<<<<<<
3826 * def __setstate_cython__(self, __pyx_state):
3827 * __pyx_unpickle_LogLR_Sym__set_state(self, __pyx_state)
3830 __Pyx_XDECREF(__pyx_r
);
3831 __Pyx_GetModuleGlobalName(__pyx_t_5
, __pyx_n_s_pyx_unpickle_LogLR_Sym
); if (unlikely(!__pyx_t_5
)) __PYX_ERR(1, 15, __pyx_L1_error
)
3832 __Pyx_GOTREF(__pyx_t_5
);
3833 __pyx_t_1
= PyTuple_New(3); if (unlikely(!__pyx_t_1
)) __PYX_ERR(1, 15, __pyx_L1_error
)
3834 __Pyx_GOTREF(__pyx_t_1
);
3835 __Pyx_INCREF(((PyObject
*)Py_TYPE(((PyObject
*)__pyx_v_self
))));
3836 __Pyx_GIVEREF(((PyObject
*)Py_TYPE(((PyObject
*)__pyx_v_self
))));
3837 PyTuple_SET_ITEM(__pyx_t_1
, 0, ((PyObject
*)Py_TYPE(((PyObject
*)__pyx_v_self
))));
3838 __Pyx_INCREF(__pyx_int_8799262
);
3839 __Pyx_GIVEREF(__pyx_int_8799262
);
3840 PyTuple_SET_ITEM(__pyx_t_1
, 1, __pyx_int_8799262
);
3841 __Pyx_INCREF(__pyx_v_state
);
3842 __Pyx_GIVEREF(__pyx_v_state
);
3843 PyTuple_SET_ITEM(__pyx_t_1
, 2, __pyx_v_state
);
3844 __pyx_t_4
= PyTuple_New(2); if (unlikely(!__pyx_t_4
)) __PYX_ERR(1, 15, __pyx_L1_error
)
3845 __Pyx_GOTREF(__pyx_t_4
);
3846 __Pyx_GIVEREF(__pyx_t_5
);
3847 PyTuple_SET_ITEM(__pyx_t_4
, 0, __pyx_t_5
);
3848 __Pyx_GIVEREF(__pyx_t_1
);
3849 PyTuple_SET_ITEM(__pyx_t_4
, 1, __pyx_t_1
);
3852 __pyx_r
= __pyx_t_4
;
3857 /* "(tree fragment)":1
3858 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
3863 /* function exit code */
3865 __Pyx_XDECREF(__pyx_t_1
);
3866 __Pyx_XDECREF(__pyx_t_4
);
3867 __Pyx_XDECREF(__pyx_t_5
);
3868 __Pyx_AddTraceback("MACS2.Statistics.LogLR_Sym.__reduce_cython__", __pyx_clineno
, __pyx_lineno
, __pyx_filename
);
3871 __Pyx_XDECREF(__pyx_v_state
);
3872 __Pyx_XDECREF(__pyx_v__dict
);
3873 __Pyx_XGIVEREF(__pyx_r
);
3874 __Pyx_TraceReturn(__pyx_r
, 0);
3875 __Pyx_RefNannyFinishContext();
3879 /* "(tree fragment)":16
3881 * return __pyx_unpickle_LogLR_Sym, (type(self), 0x086441e, state)
3882 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
3883 * __pyx_unpickle_LogLR_Sym__set_state(self, __pyx_state)
3886 /* Python wrapper */
3887 static PyObject
*__pyx_pw_5MACS2_10Statistics_9LogLR_Sym_7__setstate_cython__(PyObject
*__pyx_v_self
, PyObject
*__pyx_v___pyx_state
); /*proto*/
3888 static PyObject
*__pyx_pw_5MACS2_10Statistics_9LogLR_Sym_7__setstate_cython__(PyObject
*__pyx_v_self
, PyObject
*__pyx_v___pyx_state
) {
3889 PyObject
*__pyx_r
= 0;
3890 __Pyx_RefNannyDeclarations
3891 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
3892 __pyx_r
= __pyx_pf_5MACS2_10Statistics_9LogLR_Sym_6__setstate_cython__(((struct __pyx_obj_5MACS2_10Statistics_LogLR_Sym
*)__pyx_v_self
), ((PyObject
*)__pyx_v___pyx_state
));
3894 /* function exit code */
3895 __Pyx_RefNannyFinishContext();
3899 static PyObject
*__pyx_pf_5MACS2_10Statistics_9LogLR_Sym_6__setstate_cython__(struct __pyx_obj_5MACS2_10Statistics_LogLR_Sym
*__pyx_v_self
, PyObject
*__pyx_v___pyx_state
) {
3900 PyObject
*__pyx_r
= NULL
;
3901 __Pyx_TraceDeclarations
3902 __Pyx_RefNannyDeclarations
3903 PyObject
*__pyx_t_1
= NULL
;
3904 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
3905 __Pyx_TraceCall("__setstate_cython__", __pyx_f
[1], 16, 0, __PYX_ERR(1, 16, __pyx_L1_error
));
3907 /* "(tree fragment)":17
3908 * return __pyx_unpickle_LogLR_Sym, (type(self), 0x086441e, state)
3909 * def __setstate_cython__(self, __pyx_state):
3910 * __pyx_unpickle_LogLR_Sym__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
3912 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state
))||((__pyx_v___pyx_state
) == Py_None
)||(PyErr_Format(PyExc_TypeError
, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state
)->tp_name
), 0))) __PYX_ERR(1, 17, __pyx_L1_error
)
3913 __pyx_t_1
= __pyx_f_5MACS2_10Statistics___pyx_unpickle_LogLR_Sym__set_state(__pyx_v_self
, ((PyObject
*)__pyx_v___pyx_state
)); if (unlikely(!__pyx_t_1
)) __PYX_ERR(1, 17, __pyx_L1_error
)
3914 __Pyx_GOTREF(__pyx_t_1
);
3915 __Pyx_DECREF(__pyx_t_1
); __pyx_t_1
= 0;
3917 /* "(tree fragment)":16
3919 * return __pyx_unpickle_LogLR_Sym, (type(self), 0x086441e, state)
3920 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
3921 * __pyx_unpickle_LogLR_Sym__set_state(self, __pyx_state)
3924 /* function exit code */
3925 __pyx_r
= Py_None
; __Pyx_INCREF(Py_None
);
3928 __Pyx_XDECREF(__pyx_t_1
);
3929 __Pyx_AddTraceback("MACS2.Statistics.LogLR_Sym.__setstate_cython__", __pyx_clineno
, __pyx_lineno
, __pyx_filename
);
3932 __Pyx_XGIVEREF(__pyx_r
);
3933 __Pyx_TraceReturn(__pyx_r
, 0);
3934 __Pyx_RefNannyFinishContext();
3938 /* "MACS2/Statistics.pyx":105
3941 * def __init__ ( self ): # <<<<<<<<<<<<<<
3942 * self.logLR_dict = dict()
3946 /* Python wrapper */
3947 static int __pyx_pw_5MACS2_10Statistics_10LogLR_Diff_1__init__(PyObject
*__pyx_v_self
, PyObject
*__pyx_args
, PyObject
*__pyx_kwds
); /*proto*/
3948 static int __pyx_pw_5MACS2_10Statistics_10LogLR_Diff_1__init__(PyObject
*__pyx_v_self
, PyObject
*__pyx_args
, PyObject
*__pyx_kwds
) {
3950 __Pyx_RefNannyDeclarations
3951 __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
3952 if (unlikely(PyTuple_GET_SIZE(__pyx_args
) > 0)) {
3953 __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args
)); return -1;}
3954 if (unlikely(__pyx_kwds
) && unlikely(PyDict_Size(__pyx_kwds
) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds
, "__init__", 0))) return -1;
3955 __pyx_r
= __pyx_pf_5MACS2_10Statistics_10LogLR_Diff___init__(((struct __pyx_obj_5MACS2_10Statistics_LogLR_Diff
*)__pyx_v_self
));
3957 /* function exit code */
3958 __Pyx_RefNannyFinishContext();
3962 static int __pyx_pf_5MACS2_10Statistics_10LogLR_Diff___init__(struct __pyx_obj_5MACS2_10Statistics_LogLR_Diff
*__pyx_v_self
) {
3964 __Pyx_TraceDeclarations
3965 __Pyx_RefNannyDeclarations
3966 PyObject
*__pyx_t_1
= NULL
;
3967 __Pyx_RefNannySetupContext("__init__", 0);
3968 __Pyx_TraceCall("__init__", __pyx_f
[0], 105, 0, __PYX_ERR(0, 105, __pyx_L1_error
));
3970 /* "MACS2/Statistics.pyx":106
3972 * def __init__ ( self ):
3973 * self.logLR_dict = dict() # <<<<<<<<<<<<<<
3975 * cpdef float get_logLR_diff ( self, float x, float y ):
3977 __pyx_t_1
= __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1
)) __PYX_ERR(0, 106, __pyx_L1_error
)
3978 __Pyx_GOTREF(__pyx_t_1
);
3979 __Pyx_GIVEREF(__pyx_t_1
);
3980 __Pyx_GOTREF(__pyx_v_self
->logLR_dict
);
3981 __Pyx_DECREF(__pyx_v_self
->logLR_dict
);
3982 __pyx_v_self
->logLR_dict
= ((PyObject
*)__pyx_t_1
);
3985 /* "MACS2/Statistics.pyx":105
3988 * def __init__ ( self ): # <<<<<<<<<<<<<<
3989 * self.logLR_dict = dict()
3993 /* function exit code */
3997 __Pyx_XDECREF(__pyx_t_1
);
3998 __Pyx_AddTraceback("MACS2.Statistics.LogLR_Diff.__init__", __pyx_clineno
, __pyx_lineno
, __pyx_filename
);
4001 __Pyx_TraceReturn(Py_None
, 0);
4002 __Pyx_RefNannyFinishContext();
4006 /* "MACS2/Statistics.pyx":108
4007 * self.logLR_dict = dict()
4009 * cpdef float get_logLR_diff ( self, float x, float y ): # <<<<<<<<<<<<<<
4014 static PyObject
*__pyx_pw_5MACS2_10Statistics_10LogLR_Diff_3get_logLR_diff(PyObject
*__pyx_v_self
, PyObject
*__pyx_args
, PyObject
*__pyx_kwds
); /*proto*/
4015 static float __pyx_f_5MACS2_10Statistics_10LogLR_Diff_get_logLR_diff(struct __pyx_obj_5MACS2_10Statistics_LogLR_Diff
*__pyx_v_self
, float __pyx_v_x
, float __pyx_v_y
, int __pyx_skip_dispatch
) {
4018 __Pyx_TraceDeclarations
4019 __Pyx_RefNannyDeclarations
4020 PyObject
*__pyx_t_1
= NULL
;
4021 PyObject
*__pyx_t_2
= NULL
;
4022 PyObject
*__pyx_t_3
= NULL
;
4023 PyObject
*__pyx_t_4
= NULL
;
4024 PyObject
*__pyx_t_5
= NULL
;
4025 PyObject
*__pyx_t_6
= NULL
;
4027 PyObject
*__pyx_t_8
= NULL
;
4032 __Pyx_RefNannySetupContext("get_logLR_diff", 0);
4033 __Pyx_TraceCall("get_logLR_diff", __pyx_f
[0], 108, 0, __PYX_ERR(0, 108, __pyx_L1_error
));
4034 /* Check if called by wrapper */
4035 if (unlikely(__pyx_skip_dispatch
)) ;
4036 /* Check if overridden in Python */
4037 else if (unlikely((Py_TYPE(((PyObject
*)__pyx_v_self
))->tp_dictoffset
!= 0) || (Py_TYPE(((PyObject
*)__pyx_v_self
))->tp_flags
& (Py_TPFLAGS_IS_ABSTRACT
| Py_TPFLAGS_HEAPTYPE
)))) {
4038 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
4039 static PY_UINT64_T __pyx_tp_dict_version
= __PYX_DICT_VERSION_INIT
, __pyx_obj_dict_version
= __PYX_DICT_VERSION_INIT
;
4040 if (unlikely(!__Pyx_object_dict_version_matches(((PyObject
*)__pyx_v_self
), __pyx_tp_dict_version
, __pyx_obj_dict_version
))) {
4041 PY_UINT64_T __pyx_type_dict_guard
= __Pyx_get_tp_dict_version(((PyObject
*)__pyx_v_self
));
4043 __pyx_t_1
= __Pyx_PyObject_GetAttrStr(((PyObject
*)__pyx_v_self
), __pyx_n_s_get_logLR_diff
); if (unlikely(!__pyx_t_1
)) __PYX_ERR(0, 108, __pyx_L1_error
)
4044 __Pyx_GOTREF(__pyx_t_1
);
4045 if (!PyCFunction_Check(__pyx_t_1
) || (PyCFunction_GET_FUNCTION(__pyx_t_1
) != (PyCFunction
)(void*)__pyx_pw_5MACS2_10Statistics_10LogLR_Diff_3get_logLR_diff
)) {
4046 __pyx_t_3
= PyFloat_FromDouble(__pyx_v_x
); if (unlikely(!__pyx_t_3
)) __PYX_ERR(0, 108, __pyx_L1_error
)
4047 __Pyx_GOTREF(__pyx_t_3
);
4048 __pyx_t_4
= PyFloat_FromDouble(__pyx_v_y
); if (unlikely(!__pyx_t_4
)) __PYX_ERR(0, 108, __pyx_L1_error
)
4049 __Pyx_GOTREF(__pyx_t_4
);
4050 __Pyx_INCREF(__pyx_t_1
);
4051 __pyx_t_5
= __pyx_t_1
; __pyx_t_6
= NULL
;
4053 if (CYTHON_UNPACK_METHODS
&& unlikely(PyMethod_Check(__pyx_t_5
))) {
4054 __pyx_t_6
= PyMethod_GET_SELF(__pyx_t_5
);
4055 if (likely(__pyx_t_6
)) {
4056 PyObject
* function
= PyMethod_GET_FUNCTION(__pyx_t_5
);
4057 __Pyx_INCREF(__pyx_t_6
);
4058 __Pyx_INCREF(function
);
4059 __Pyx_DECREF_SET(__pyx_t_5
, function
);
4063 #if CYTHON_FAST_PYCALL
4064 if (PyFunction_Check(__pyx_t_5
)) {
4065 PyObject
*__pyx_temp
[3] = {__pyx_t_6
, __pyx_t_3
, __pyx_t_4
};
4066 __pyx_t_2
= __Pyx_PyFunction_FastCall(__pyx_t_5
, __pyx_temp
+1-__pyx_t_7
, 2+__pyx_t_7
); if (unlikely(!__pyx_t_2
)) __PYX_ERR(0, 108, __pyx_L1_error
)
4067 __Pyx_XDECREF(__pyx_t_6
); __pyx_t_6
= 0;
4068 __Pyx_GOTREF(__pyx_t_2
);
4069 __Pyx_DECREF(__pyx_t_3
); __pyx_t_3
= 0;
4070 __Pyx_DECREF(__pyx_t_4
); __pyx_t_4
= 0;
4073 #if CYTHON_FAST_PYCCALL
4074 if (__Pyx_PyFastCFunction_Check(__pyx_t_5
)) {
4075 PyObject
*__pyx_temp
[3] = {__pyx_t_6
, __pyx_t_3
, __pyx_t_4
};
4076 __pyx_t_2
= __Pyx_PyCFunction_FastCall(__pyx_t_5
, __pyx_temp
+1-__pyx_t_7
, 2+__pyx_t_7
); if (unlikely(!__pyx_t_2
)) __PYX_ERR(0, 108, __pyx_L1_error
)
4077 __Pyx_XDECREF(__pyx_t_6
); __pyx_t_6
= 0;
4078 __Pyx_GOTREF(__pyx_t_2
);
4079 __Pyx_DECREF(__pyx_t_3
); __pyx_t_3
= 0;
4080 __Pyx_DECREF(__pyx_t_4
); __pyx_t_4
= 0;
4084 __pyx_t_8
= PyTuple_New(2+__pyx_t_7
); if (unlikely(!__pyx_t_8
)) __PYX_ERR(0, 108, __pyx_L1_error
)
4085 __Pyx_GOTREF(__pyx_t_8
);
4087 __Pyx_GIVEREF(__pyx_t_6
); PyTuple_SET_ITEM(__pyx_t_8
, 0, __pyx_t_6
); __pyx_t_6
= NULL
;
4089 __Pyx_GIVEREF(__pyx_t_3
);
4090 PyTuple_SET_ITEM(__pyx_t_8
, 0+__pyx_t_7
, __pyx_t_3
);
4091 __Pyx_GIVEREF(__pyx_t_4
);
4092 PyTuple_SET_ITEM(__pyx_t_8
, 1+__pyx_t_7
, __pyx_t_4
);
4095 __pyx_t_2
= __Pyx_PyObject_Call(__pyx_t_5
, __pyx_t_8
, NULL
); if (unlikely(!__pyx_t_2
)) __PYX_ERR(0, 108, __pyx_L1_error
)
4096 __Pyx_GOTREF(__pyx_t_2
);
4097 __Pyx_DECREF(__pyx_t_8
); __pyx_t_8
= 0;
4099 __Pyx_DECREF(__pyx_t_5
); __pyx_t_5
= 0;
4100 __pyx_t_9
= __pyx_PyFloat_AsFloat(__pyx_t_2
); if (unlikely((__pyx_t_9
== (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L1_error
)
4101 __Pyx_DECREF(__pyx_t_2
); __pyx_t_2
= 0;
4102 __pyx_r
= __pyx_t_9
;
4103 __Pyx_DECREF(__pyx_t_1
); __pyx_t_1
= 0;
4106 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
4107 __pyx_tp_dict_version
= __Pyx_get_tp_dict_version(((PyObject
*)__pyx_v_self
));
4108 __pyx_obj_dict_version
= __Pyx_get_object_dict_version(((PyObject
*)__pyx_v_self
));
4109 if (unlikely(__pyx_type_dict_guard
!= __pyx_tp_dict_version
)) {
4110 __pyx_tp_dict_version
= __pyx_obj_dict_version
= __PYX_DICT_VERSION_INIT
;
4113 __Pyx_DECREF(__pyx_t_1
); __pyx_t_1
= 0;
4114 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
4119 /* "MACS2/Statistics.pyx":112
4122 * if ( x, y ) in self.logLR_dict: # <<<<<<<<<<<<<<
4123 * return self.logLR_dict[ ( x, y ) ]
4126 __pyx_t_1
= PyFloat_FromDouble(__pyx_v_x
); if (unlikely(!__pyx_t_1
)) __PYX_ERR(0, 112, __pyx_L1_error
)
4127 __Pyx_GOTREF(__pyx_t_1
);
4128 __pyx_t_2
= PyFloat_FromDouble(__pyx_v_y
); if (unlikely(!__pyx_t_2
)) __PYX_ERR(0, 112, __pyx_L1_error
)
4129 __Pyx_GOTREF(__pyx_t_2
);
4130 __pyx_t_5
= PyTuple_New(2); if (unlikely(!__pyx_t_5
)) __PYX_ERR(0, 112, __pyx_L1_error
)
4131 __Pyx_GOTREF(__pyx_t_5
);
4132 __Pyx_GIVEREF(__pyx_t_1
);
4133 PyTuple_SET_ITEM(__pyx_t_5
, 0, __pyx_t_1
);
4134 __Pyx_GIVEREF(__pyx_t_2
);
4135 PyTuple_SET_ITEM(__pyx_t_5
, 1, __pyx_t_2
);
4138 if (unlikely(__pyx_v_self
->logLR_dict
== Py_None
)) {
4139 PyErr_SetString(PyExc_TypeError
, "'NoneType' object is not iterable");
4140 __PYX_ERR(0, 112, __pyx_L1_error
)
4142 __pyx_t_10
= (__Pyx_PyDict_ContainsTF(__pyx_t_5
, __pyx_v_self
->logLR_dict
, Py_EQ
)); if (unlikely(__pyx_t_10
< 0)) __PYX_ERR(0, 112, __pyx_L1_error
)
4143 __Pyx_DECREF(__pyx_t_5
); __pyx_t_5
= 0;
4144 __pyx_t_11
= (__pyx_t_10
!= 0);
4147 /* "MACS2/Statistics.pyx":113
4149 * if ( x, y ) in self.logLR_dict:
4150 * return self.logLR_dict[ ( x, y ) ] # <<<<<<<<<<<<<<
4152 * # calculate and cache
4154 if (unlikely(__pyx_v_self
->logLR_dict
== Py_None
)) {
4155 PyErr_SetString(PyExc_TypeError
, "'NoneType' object is not subscriptable");
4156 __PYX_ERR(0, 113, __pyx_L1_error
)
4158 __pyx_t_5
= PyFloat_FromDouble(__pyx_v_x
); if (unlikely(!__pyx_t_5
)) __PYX_ERR(0, 113, __pyx_L1_error
)
4159 __Pyx_GOTREF(__pyx_t_5
);
4160 __pyx_t_2
= PyFloat_FromDouble(__pyx_v_y
); if (unlikely(!__pyx_t_2
)) __PYX_ERR(0, 113, __pyx_L1_error
)
4161 __Pyx_GOTREF(__pyx_t_2
);
4162 __pyx_t_1
= PyTuple_New(2); if (unlikely(!__pyx_t_1
)) __PYX_ERR(0, 113, __pyx_L1_error
)
4163 __Pyx_GOTREF(__pyx_t_1
);
4164 __Pyx_GIVEREF(__pyx_t_5
);
4165 PyTuple_SET_ITEM(__pyx_t_1
, 0, __pyx_t_5
);
4166 __Pyx_GIVEREF(__pyx_t_2
);
4167 PyTuple_SET_ITEM(__pyx_t_1
, 1, __pyx_t_2
);
4170 __pyx_t_2
= __Pyx_PyDict_GetItem(__pyx_v_self
->logLR_dict
, __pyx_t_1
); if (unlikely(!__pyx_t_2
)) __PYX_ERR(0, 113, __pyx_L1_error
)
4171 __Pyx_GOTREF(__pyx_t_2
);
4172 __Pyx_DECREF(__pyx_t_1
); __pyx_t_1
= 0;
4173 __pyx_t_9
= __pyx_PyFloat_AsFloat(__pyx_t_2
); if (unlikely((__pyx_t_9
== (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 113, __pyx_L1_error
)
4174 __Pyx_DECREF(__pyx_t_2
); __pyx_t_2
= 0;
4175 __pyx_r
= __pyx_t_9
;
4178 /* "MACS2/Statistics.pyx":112
4181 * if ( x, y ) in self.logLR_dict: # <<<<<<<<<<<<<<
4182 * return self.logLR_dict[ ( x, y ) ]
4187 /* "MACS2/Statistics.pyx":116
4189 * # calculate and cache
4190 * if y > x: y, x = x, y # <<<<<<<<<<<<<<
4195 __pyx_t_11
= ((__pyx_v_y
> __pyx_v_x
) != 0);
4197 __pyx_t_9
= __pyx_v_x
;
4198 __pyx_t_12
= __pyx_v_y
;
4199 __pyx_v_y
= __pyx_t_9
;
4200 __pyx_v_x
= __pyx_t_12
;
4203 /* "MACS2/Statistics.pyx":117
4204 * # calculate and cache
4205 * if y > x: y, x = x, y
4206 * if x == y: # <<<<<<<<<<<<<<
4210 __pyx_t_11
= ((__pyx_v_x
== __pyx_v_y
) != 0);
4213 /* "MACS2/Statistics.pyx":118
4214 * if y > x: y, x = x, y
4216 * val = 0 # <<<<<<<<<<<<<<
4218 * val = (x*(log10(x)-log10(y))+y-x)
4222 /* "MACS2/Statistics.pyx":117
4223 * # calculate and cache
4224 * if y > x: y, x = x, y
4225 * if x == y: # <<<<<<<<<<<<<<
4232 /* "MACS2/Statistics.pyx":120
4235 * val = (x*(log10(x)-log10(y))+y-x) # <<<<<<<<<<<<<<
4237 * self.logLR_dict[ ( x, y ) ] = val
4240 __pyx_v_val
= (((__pyx_v_x
* (log10(__pyx_v_x
) - log10(__pyx_v_y
))) + __pyx_v_y
) - __pyx_v_x
);
4244 /* "MACS2/Statistics.pyx":122
4245 * val = (x*(log10(x)-log10(y))+y-x)
4247 * self.logLR_dict[ ( x, y ) ] = val # <<<<<<<<<<<<<<
4250 __pyx_t_2
= PyFloat_FromDouble(__pyx_v_val
); if (unlikely(!__pyx_t_2
)) __PYX_ERR(0, 122, __pyx_L1_error
)
4251 __Pyx_GOTREF(__pyx_t_2
);
4252 if (unlikely(__pyx_v_self
->logLR_dict
== Py_None
)) {
4253 PyErr_SetString(PyExc_TypeError
, "'NoneType' object is not subscriptable");
4254 __PYX_ERR(0, 122, __pyx_L1_error
)
4256 __pyx_t_1
= PyFloat_FromDouble(__pyx_v_x
); if (unlikely(!__pyx_t_1
)) __PYX_ERR(0, 122, __pyx_L1_error
)
4257 __Pyx_GOTREF(__pyx_t_1
);
4258 __pyx_t_5
= PyFloat_FromDouble(__pyx_v_y
); if (unlikely(!__pyx_t_5
)) __PYX_ERR(0, 122, __pyx_L1_error
)
4259 __Pyx_GOTREF(__pyx_t_5
);
4260 __pyx_t_8
= PyTuple_New(2); if (unlikely(!__pyx_t_8
)) __PYX_ERR(0, 122, __pyx_L1_error
)
4261 __Pyx_GOTREF(__pyx_t_8
);
4262 __Pyx_GIVEREF(__pyx_t_1
);
4263 PyTuple_SET_ITEM(__pyx_t_8
, 0, __pyx_t_1
);
4264 __Pyx_GIVEREF(__pyx_t_5
);
4265 PyTuple_SET_ITEM(__pyx_t_8
, 1, __pyx_t_5
);
4268 if (unlikely(PyDict_SetItem(__pyx_v_self
->logLR_dict
, __pyx_t_8
, __pyx_t_2
) < 0)) __PYX_ERR(0, 122, __pyx_L1_error
)
4269 __Pyx_DECREF(__pyx_t_8
); __pyx_t_8
= 0;
4270 __Pyx_DECREF(__pyx_t_2
); __pyx_t_2
= 0;
4272 /* "MACS2/Statistics.pyx":123
4274 * self.logLR_dict[ ( x, y ) ] = val
4275 * return val # <<<<<<<<<<<<<<
4277 __pyx_r
= __pyx_v_val
;
4281 /* "MACS2/Statistics.pyx":108
4282 * self.logLR_dict = dict()
4284 * cpdef float get_logLR_diff ( self, float x, float y ): # <<<<<<<<<<<<<<
4289 /* function exit code */
4291 __Pyx_XDECREF(__pyx_t_1
);
4292 __Pyx_XDECREF(__pyx_t_2
);
4293 __Pyx_XDECREF(__pyx_t_3
);
4294 __Pyx_XDECREF(__pyx_t_4
);
4295 __Pyx_XDECREF(__pyx_t_5
);
4296 __Pyx_XDECREF(__pyx_t_6
);
4297 __Pyx_XDECREF(__pyx_t_8
);
4298 __Pyx_WriteUnraisable("MACS2.Statistics.LogLR_Diff.get_logLR_diff", __pyx_clineno
, __pyx_lineno
, __pyx_filename
, 1, 0);
4301 __Pyx_TraceReturn(Py_None
, 0);
4302 __Pyx_RefNannyFinishContext();
4306 /* Python wrapper */
4307 static PyObject
*__pyx_pw_5MACS2_10Statistics_10LogLR_Diff_3get_logLR_diff(PyObject
*__pyx_v_self
, PyObject
*__pyx_args
, PyObject
*__pyx_kwds
); /*proto*/
4308 static PyObject
*__pyx_pw_5MACS2_10Statistics_10LogLR_Diff_3get_logLR_diff(PyObject
*__pyx_v_self
, PyObject
*__pyx_args
, PyObject
*__pyx_kwds
) {
4311 PyObject
*__pyx_r
= 0;
4312 __Pyx_RefNannyDeclarations
4313 __Pyx_RefNannySetupContext("get_logLR_diff (wrapper)", 0);
4315 static PyObject
**__pyx_pyargnames
[] = {&__pyx_n_s_x
,&__pyx_n_s_y
,0};
4316 PyObject
* values
[2] = {0,0};
4317 if (unlikely(__pyx_kwds
)) {
4319 const Py_ssize_t pos_args
= PyTuple_GET_SIZE(__pyx_args
);
4321 case 2: values
[1] = PyTuple_GET_ITEM(__pyx_args
, 1);
4323 case 1: values
[0] = PyTuple_GET_ITEM(__pyx_args
, 0);
4326 default: goto __pyx_L5_argtuple_error
;
4328 kw_args
= PyDict_Size(__pyx_kwds
);
4331 if (likely((values
[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds
, __pyx_n_s_x
)) != 0)) kw_args
--;
4332 else goto __pyx_L5_argtuple_error
;
4335 if (likely((values
[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds
, __pyx_n_s_y
)) != 0)) kw_args
--;
4337 __Pyx_RaiseArgtupleInvalid("get_logLR_diff", 1, 2, 2, 1); __PYX_ERR(0, 108, __pyx_L3_error
)
4340 if (unlikely(kw_args
> 0)) {
4341 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds
, __pyx_pyargnames
, 0, values
, pos_args
, "get_logLR_diff") < 0)) __PYX_ERR(0, 108, __pyx_L3_error
)
4343 } else if (PyTuple_GET_SIZE(__pyx_args
) != 2) {
4344 goto __pyx_L5_argtuple_error
;
4346 values
[0] = PyTuple_GET_ITEM(__pyx_args
, 0);
4347 values
[1] = PyTuple_GET_ITEM(__pyx_args
, 1);
4349 __pyx_v_x
= __pyx_PyFloat_AsFloat(values
[0]); if (unlikely((__pyx_v_x
== (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L3_error
)
4350 __pyx_v_y
= __pyx_PyFloat_AsFloat(values
[1]); if (unlikely((__pyx_v_y
== (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L3_error
)
4352 goto __pyx_L4_argument_unpacking_done
;
4353 __pyx_L5_argtuple_error
:;
4354 __Pyx_RaiseArgtupleInvalid("get_logLR_diff", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args
)); __PYX_ERR(0, 108, __pyx_L3_error
)
4356 __Pyx_AddTraceback("MACS2.Statistics.LogLR_Diff.get_logLR_diff", __pyx_clineno
, __pyx_lineno
, __pyx_filename
);
4357 __Pyx_RefNannyFinishContext();
4359 __pyx_L4_argument_unpacking_done
:;
4360 __pyx_r
= __pyx_pf_5MACS2_10Statistics_10LogLR_Diff_2get_logLR_diff(((struct __pyx_obj_5MACS2_10Statistics_LogLR_Diff
*)__pyx_v_self
), __pyx_v_x
, __pyx_v_y
);
4362 /* function exit code */
4363 __Pyx_RefNannyFinishContext();
4367 static PyObject
*__pyx_pf_5MACS2_10Statistics_10LogLR_Diff_2get_logLR_diff(struct __pyx_obj_5MACS2_10Statistics_LogLR_Diff
*__pyx_v_self
, float __pyx_v_x
, float __pyx_v_y
) {
4368 PyObject
*__pyx_r
= NULL
;
4369 __Pyx_TraceDeclarations
4370 __Pyx_RefNannyDeclarations
4371 PyObject
*__pyx_t_1
= NULL
;
4372 __Pyx_RefNannySetupContext("get_logLR_diff", 0);
4373 __Pyx_TraceCall("get_logLR_diff (wrapper)", __pyx_f
[0], 108, 0, __PYX_ERR(0, 108, __pyx_L1_error
));
4374 __Pyx_XDECREF(__pyx_r
);
4375 __pyx_t_1
= PyFloat_FromDouble(__pyx_f_5MACS2_10Statistics_10LogLR_Diff_get_logLR_diff(__pyx_v_self
, __pyx_v_x
, __pyx_v_y
, 1)); if (unlikely(!__pyx_t_1
)) __PYX_ERR(0, 108, __pyx_L1_error
)
4376 __Pyx_GOTREF(__pyx_t_1
);
4377 __pyx_r
= __pyx_t_1
;
4381 /* function exit code */
4383 __Pyx_XDECREF(__pyx_t_1
);
4384 __Pyx_AddTraceback("MACS2.Statistics.LogLR_Diff.get_logLR_diff", __pyx_clineno
, __pyx_lineno
, __pyx_filename
);
4387 __Pyx_XGIVEREF(__pyx_r
);
4388 __Pyx_TraceReturn(__pyx_r
, 0);
4389 __Pyx_RefNannyFinishContext();
4393 /* "(tree fragment)":1
4394 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
4399 /* Python wrapper */
4400 static PyObject
*__pyx_pw_5MACS2_10Statistics_10LogLR_Diff_5__reduce_cython__(PyObject
*__pyx_v_self
, CYTHON_UNUSED PyObject
*unused
); /*proto*/
4401 static PyObject
*__pyx_pw_5MACS2_10Statistics_10LogLR_Diff_5__reduce_cython__(PyObject
*__pyx_v_self
, CYTHON_UNUSED PyObject
*unused
) {
4402 PyObject
*__pyx_r
= 0;
4403 __Pyx_RefNannyDeclarations
4404 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
4405 __pyx_r
= __pyx_pf_5MACS2_10Statistics_10LogLR_Diff_4__reduce_cython__(((struct __pyx_obj_5MACS2_10Statistics_LogLR_Diff
*)__pyx_v_self
));
4407 /* function exit code */
4408 __Pyx_RefNannyFinishContext();
4412 static PyObject
*__pyx_pf_5MACS2_10Statistics_10LogLR_Diff_4__reduce_cython__(struct __pyx_obj_5MACS2_10Statistics_LogLR_Diff
*__pyx_v_self
) {
4413 PyObject
*__pyx_v_state
= 0;
4414 PyObject
*__pyx_v__dict
= 0;
4415 int __pyx_v_use_setstate
;
4416 PyObject
*__pyx_r
= NULL
;
4417 __Pyx_TraceDeclarations
4418 __Pyx_RefNannyDeclarations
4419 PyObject
*__pyx_t_1
= NULL
;
4422 PyObject
*__pyx_t_4
= NULL
;
4423 PyObject
*__pyx_t_5
= NULL
;
4424 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
4425 __Pyx_TraceCall("__reduce_cython__", __pyx_f
[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error
));
4427 /* "(tree fragment)":5
4429 * cdef bint use_setstate
4430 * state = (self.logLR_dict,) # <<<<<<<<<<<<<<
4431 * _dict = getattr(self, '__dict__', None)
4432 * if _dict is not None:
4434 __pyx_t_1
= PyTuple_New(1); if (unlikely(!__pyx_t_1
)) __PYX_ERR(1, 5, __pyx_L1_error
)
4435 __Pyx_GOTREF(__pyx_t_1
);
4436 __Pyx_INCREF(__pyx_v_self
->logLR_dict
);
4437 __Pyx_GIVEREF(__pyx_v_self
->logLR_dict
);
4438 PyTuple_SET_ITEM(__pyx_t_1
, 0, __pyx_v_self
->logLR_dict
);
4439 __pyx_v_state
= ((PyObject
*)__pyx_t_1
);
4442 /* "(tree fragment)":6
4443 * cdef bint use_setstate
4444 * state = (self.logLR_dict,)
4445 * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
4446 * if _dict is not None:
4449 __pyx_t_1
= __Pyx_GetAttr3(((PyObject
*)__pyx_v_self
), __pyx_n_s_dict
, Py_None
); if (unlikely(!__pyx_t_1
)) __PYX_ERR(1, 6, __pyx_L1_error
)
4450 __Pyx_GOTREF(__pyx_t_1
);
4451 __pyx_v__dict
= __pyx_t_1
;
4454 /* "(tree fragment)":7
4455 * state = (self.logLR_dict,)
4456 * _dict = getattr(self, '__dict__', None)
4457 * if _dict is not None: # <<<<<<<<<<<<<<
4459 * use_setstate = True
4461 __pyx_t_2
= (__pyx_v__dict
!= Py_None
);
4462 __pyx_t_3
= (__pyx_t_2
!= 0);
4465 /* "(tree fragment)":8
4466 * _dict = getattr(self, '__dict__', None)
4467 * if _dict is not None:
4468 * state += (_dict,) # <<<<<<<<<<<<<<
4469 * use_setstate = True
4472 __pyx_t_1
= PyTuple_New(1); if (unlikely(!__pyx_t_1
)) __PYX_ERR(1, 8, __pyx_L1_error
)
4473 __Pyx_GOTREF(__pyx_t_1
);
4474 __Pyx_INCREF(__pyx_v__dict
);
4475 __Pyx_GIVEREF(__pyx_v__dict
);
4476 PyTuple_SET_ITEM(__pyx_t_1
, 0, __pyx_v__dict
);
4477 __pyx_t_4
= PyNumber_InPlaceAdd(__pyx_v_state
, __pyx_t_1
); if (unlikely(!__pyx_t_4
)) __PYX_ERR(1, 8, __pyx_L1_error
)
4478 __Pyx_GOTREF(__pyx_t_4
);
4479 __Pyx_DECREF(__pyx_t_1
); __pyx_t_1
= 0;
4480 __Pyx_DECREF_SET(__pyx_v_state
, ((PyObject
*)__pyx_t_4
));
4483 /* "(tree fragment)":9
4484 * if _dict is not None:
4486 * use_setstate = True # <<<<<<<<<<<<<<
4488 * use_setstate = self.logLR_dict is not None
4490 __pyx_v_use_setstate
= 1;
4492 /* "(tree fragment)":7
4493 * state = (self.logLR_dict,)
4494 * _dict = getattr(self, '__dict__', None)
4495 * if _dict is not None: # <<<<<<<<<<<<<<
4497 * use_setstate = True
4502 /* "(tree fragment)":11
4503 * use_setstate = True
4505 * use_setstate = self.logLR_dict is not None # <<<<<<<<<<<<<<
4507 * return __pyx_unpickle_LogLR_Diff, (type(self), 0x086441e, None), state
4510 __pyx_t_3
= (__pyx_v_self
->logLR_dict
!= ((PyObject
*)Py_None
));
4511 __pyx_v_use_setstate
= __pyx_t_3
;
4515 /* "(tree fragment)":12
4517 * use_setstate = self.logLR_dict is not None
4518 * if use_setstate: # <<<<<<<<<<<<<<
4519 * return __pyx_unpickle_LogLR_Diff, (type(self), 0x086441e, None), state
4522 __pyx_t_3
= (__pyx_v_use_setstate
!= 0);
4525 /* "(tree fragment)":13
4526 * use_setstate = self.logLR_dict is not None
4528 * return __pyx_unpickle_LogLR_Diff, (type(self), 0x086441e, None), state # <<<<<<<<<<<<<<
4530 * return __pyx_unpickle_LogLR_Diff, (type(self), 0x086441e, state)
4532 __Pyx_XDECREF(__pyx_r
);
4533 __Pyx_GetModuleGlobalName(__pyx_t_4
, __pyx_n_s_pyx_unpickle_LogLR_Diff
); if (unlikely(!__pyx_t_4
)) __PYX_ERR(1, 13, __pyx_L1_error
)
4534 __Pyx_GOTREF(__pyx_t_4
);
4535 __pyx_t_1
= PyTuple_New(3); if (unlikely(!__pyx_t_1
)) __PYX_ERR(1, 13, __pyx_L1_error
)
4536 __Pyx_GOTREF(__pyx_t_1
);
4537 __Pyx_INCREF(((PyObject
*)Py_TYPE(((PyObject
*)__pyx_v_self
))));
4538 __Pyx_GIVEREF(((PyObject
*)Py_TYPE(((PyObject
*)__pyx_v_self
))));
4539 PyTuple_SET_ITEM(__pyx_t_1
, 0, ((PyObject
*)Py_TYPE(((PyObject
*)__pyx_v_self
))));
4540 __Pyx_INCREF(__pyx_int_8799262
);
4541 __Pyx_GIVEREF(__pyx_int_8799262
);
4542 PyTuple_SET_ITEM(__pyx_t_1
, 1, __pyx_int_8799262
);
4543 __Pyx_INCREF(Py_None
);
4544 __Pyx_GIVEREF(Py_None
);
4545 PyTuple_SET_ITEM(__pyx_t_1
, 2, Py_None
);
4546 __pyx_t_5
= PyTuple_New(3); if (unlikely(!__pyx_t_5
)) __PYX_ERR(1, 13, __pyx_L1_error
)
4547 __Pyx_GOTREF(__pyx_t_5
);
4548 __Pyx_GIVEREF(__pyx_t_4
);
4549 PyTuple_SET_ITEM(__pyx_t_5
, 0, __pyx_t_4
);
4550 __Pyx_GIVEREF(__pyx_t_1
);
4551 PyTuple_SET_ITEM(__pyx_t_5
, 1, __pyx_t_1
);
4552 __Pyx_INCREF(__pyx_v_state
);
4553 __Pyx_GIVEREF(__pyx_v_state
);
4554 PyTuple_SET_ITEM(__pyx_t_5
, 2, __pyx_v_state
);
4557 __pyx_r
= __pyx_t_5
;
4561 /* "(tree fragment)":12
4563 * use_setstate = self.logLR_dict is not None
4564 * if use_setstate: # <<<<<<<<<<<<<<
4565 * return __pyx_unpickle_LogLR_Diff, (type(self), 0x086441e, None), state
4570 /* "(tree fragment)":15
4571 * return __pyx_unpickle_LogLR_Diff, (type(self), 0x086441e, None), state
4573 * return __pyx_unpickle_LogLR_Diff, (type(self), 0x086441e, state) # <<<<<<<<<<<<<<
4574 * def __setstate_cython__(self, __pyx_state):
4575 * __pyx_unpickle_LogLR_Diff__set_state(self, __pyx_state)
4578 __Pyx_XDECREF(__pyx_r
);
4579 __Pyx_GetModuleGlobalName(__pyx_t_5
, __pyx_n_s_pyx_unpickle_LogLR_Diff
); if (unlikely(!__pyx_t_5
)) __PYX_ERR(1, 15, __pyx_L1_error
)
4580 __Pyx_GOTREF(__pyx_t_5
);
4581 __pyx_t_1
= PyTuple_New(3); if (unlikely(!__pyx_t_1
)) __PYX_ERR(1, 15, __pyx_L1_error
)
4582 __Pyx_GOTREF(__pyx_t_1
);
4583 __Pyx_INCREF(((PyObject
*)Py_TYPE(((PyObject
*)__pyx_v_self
))));
4584 __Pyx_GIVEREF(((PyObject
*)Py_TYPE(((PyObject
*)__pyx_v_self
))));
4585 PyTuple_SET_ITEM(__pyx_t_1
, 0, ((PyObject
*)Py_TYPE(((PyObject
*)__pyx_v_self
))));
4586 __Pyx_INCREF(__pyx_int_8799262
);
4587 __Pyx_GIVEREF(__pyx_int_8799262
);
4588 PyTuple_SET_ITEM(__pyx_t_1
, 1, __pyx_int_8799262
);
4589 __Pyx_INCREF(__pyx_v_state
);
4590 __Pyx_GIVEREF(__pyx_v_state
);
4591 PyTuple_SET_ITEM(__pyx_t_1
, 2, __pyx_v_state
);
4592 __pyx_t_4
= PyTuple_New(2); if (unlikely(!__pyx_t_4
)) __PYX_ERR(1, 15, __pyx_L1_error
)
4593 __Pyx_GOTREF(__pyx_t_4
);
4594 __Pyx_GIVEREF(__pyx_t_5
);
4595 PyTuple_SET_ITEM(__pyx_t_4
, 0, __pyx_t_5
);
4596 __Pyx_GIVEREF(__pyx_t_1
);
4597 PyTuple_SET_ITEM(__pyx_t_4
, 1, __pyx_t_1
);
4600 __pyx_r
= __pyx_t_4
;
4605 /* "(tree fragment)":1
4606 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
4611 /* function exit code */
4613 __Pyx_XDECREF(__pyx_t_1
);
4614 __Pyx_XDECREF(__pyx_t_4
);
4615 __Pyx_XDECREF(__pyx_t_5
);
4616 __Pyx_AddTraceback("MACS2.Statistics.LogLR_Diff.__reduce_cython__", __pyx_clineno
, __pyx_lineno
, __pyx_filename
);
4619 __Pyx_XDECREF(__pyx_v_state
);
4620 __Pyx_XDECREF(__pyx_v__dict
);
4621 __Pyx_XGIVEREF(__pyx_r
);
4622 __Pyx_TraceReturn(__pyx_r
, 0);
4623 __Pyx_RefNannyFinishContext();
4627 /* "(tree fragment)":16
4629 * return __pyx_unpickle_LogLR_Diff, (type(self), 0x086441e, state)
4630 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
4631 * __pyx_unpickle_LogLR_Diff__set_state(self, __pyx_state)
4634 /* Python wrapper */
4635 static PyObject
*__pyx_pw_5MACS2_10Statistics_10LogLR_Diff_7__setstate_cython__(PyObject
*__pyx_v_self
, PyObject
*__pyx_v___pyx_state
); /*proto*/
4636 static PyObject
*__pyx_pw_5MACS2_10Statistics_10LogLR_Diff_7__setstate_cython__(PyObject
*__pyx_v_self
, PyObject
*__pyx_v___pyx_state
) {
4637 PyObject
*__pyx_r
= 0;
4638 __Pyx_RefNannyDeclarations
4639 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
4640 __pyx_r
= __pyx_pf_5MACS2_10Statistics_10LogLR_Diff_6__setstate_cython__(((struct __pyx_obj_5MACS2_10Statistics_LogLR_Diff
*)__pyx_v_self
), ((PyObject
*)__pyx_v___pyx_state
));
4642 /* function exit code */
4643 __Pyx_RefNannyFinishContext();
4647 static PyObject
*__pyx_pf_5MACS2_10Statistics_10LogLR_Diff_6__setstate_cython__(struct __pyx_obj_5MACS2_10Statistics_LogLR_Diff
*__pyx_v_self
, PyObject
*__pyx_v___pyx_state
) {
4648 PyObject
*__pyx_r
= NULL
;
4649 __Pyx_TraceDeclarations
4650 __Pyx_RefNannyDeclarations
4651 PyObject
*__pyx_t_1
= NULL
;
4652 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
4653 __Pyx_TraceCall("__setstate_cython__", __pyx_f
[1], 16, 0, __PYX_ERR(1, 16, __pyx_L1_error
));
4655 /* "(tree fragment)":17
4656 * return __pyx_unpickle_LogLR_Diff, (type(self), 0x086441e, state)
4657 * def __setstate_cython__(self, __pyx_state):
4658 * __pyx_unpickle_LogLR_Diff__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
4660 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state
))||((__pyx_v___pyx_state
) == Py_None
)||(PyErr_Format(PyExc_TypeError
, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state
)->tp_name
), 0))) __PYX_ERR(1, 17, __pyx_L1_error
)
4661 __pyx_t_1
= __pyx_f_5MACS2_10Statistics___pyx_unpickle_LogLR_Diff__set_state(__pyx_v_self
, ((PyObject
*)__pyx_v___pyx_state
)); if (unlikely(!__pyx_t_1
)) __PYX_ERR(1, 17, __pyx_L1_error
)
4662 __Pyx_GOTREF(__pyx_t_1
);
4663 __Pyx_DECREF(__pyx_t_1
); __pyx_t_1
= 0;
4665 /* "(tree fragment)":16
4667 * return __pyx_unpickle_LogLR_Diff, (type(self), 0x086441e, state)
4668 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
4669 * __pyx_unpickle_LogLR_Diff__set_state(self, __pyx_state)
4672 /* function exit code */
4673 __pyx_r
= Py_None
; __Pyx_INCREF(Py_None
);
4676 __Pyx_XDECREF(__pyx_t_1
);
4677 __Pyx_AddTraceback("MACS2.Statistics.LogLR_Diff.__setstate_cython__", __pyx_clineno
, __pyx_lineno
, __pyx_filename
);
4680 __Pyx_XGIVEREF(__pyx_r
);
4681 __Pyx_TraceReturn(__pyx_r
, 0);
4682 __Pyx_RefNannyFinishContext();
4686 /* "(tree fragment)":1
4687 * def __pyx_unpickle_P_Score_Upper_Tail(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
4688 * cdef object __pyx_PickleError
4689 * cdef object __pyx_result
4692 /* Python wrapper */
4693 static PyObject
*__pyx_pw_5MACS2_10Statistics_1__pyx_unpickle_P_Score_Upper_Tail(PyObject
*__pyx_self
, PyObject
*__pyx_args
, PyObject
*__pyx_kwds
); /*proto*/
4694 static PyMethodDef __pyx_mdef_5MACS2_10Statistics_1__pyx_unpickle_P_Score_Upper_Tail
= {"__pyx_unpickle_P_Score_Upper_Tail", (PyCFunction
)(void*)(PyCFunctionWithKeywords
)__pyx_pw_5MACS2_10Statistics_1__pyx_unpickle_P_Score_Upper_Tail
, METH_VARARGS
|METH_KEYWORDS
, 0};
4695 static PyObject
*__pyx_pw_5MACS2_10Statistics_1__pyx_unpickle_P_Score_Upper_Tail(PyObject
*__pyx_self
, PyObject
*__pyx_args
, PyObject
*__pyx_kwds
) {
4696 PyObject
*__pyx_v___pyx_type
= 0;
4697 long __pyx_v___pyx_checksum
;
4698 PyObject
*__pyx_v___pyx_state
= 0;
4699 PyObject
*__pyx_r
= 0;
4700 __Pyx_RefNannyDeclarations
4701 __Pyx_RefNannySetupContext("__pyx_unpickle_P_Score_Upper_Tail (wrapper)", 0);
4703 static PyObject
**__pyx_pyargnames
[] = {&__pyx_n_s_pyx_type
,&__pyx_n_s_pyx_checksum
,&__pyx_n_s_pyx_state
,0};
4704 PyObject
* values
[3] = {0,0,0};
4705 if (unlikely(__pyx_kwds
)) {
4707 const Py_ssize_t pos_args
= PyTuple_GET_SIZE(__pyx_args
);
4709 case 3: values
[2] = PyTuple_GET_ITEM(__pyx_args
, 2);
4711 case 2: values
[1] = PyTuple_GET_ITEM(__pyx_args
, 1);
4713 case 1: values
[0] = PyTuple_GET_ITEM(__pyx_args
, 0);
4716 default: goto __pyx_L5_argtuple_error
;
4718 kw_args
= PyDict_Size(__pyx_kwds
);
4721 if (likely((values
[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds
, __pyx_n_s_pyx_type
)) != 0)) kw_args
--;
4722 else goto __pyx_L5_argtuple_error
;
4725 if (likely((values
[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds
, __pyx_n_s_pyx_checksum
)) != 0)) kw_args
--;
4727 __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_P_Score_Upper_Tail", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error
)
4731 if (likely((values
[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds
, __pyx_n_s_pyx_state
)) != 0)) kw_args
--;
4733 __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_P_Score_Upper_Tail", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error
)
4736 if (unlikely(kw_args
> 0)) {
4737 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds
, __pyx_pyargnames
, 0, values
, pos_args
, "__pyx_unpickle_P_Score_Upper_Tail") < 0)) __PYX_ERR(1, 1, __pyx_L3_error
)
4739 } else if (PyTuple_GET_SIZE(__pyx_args
) != 3) {
4740 goto __pyx_L5_argtuple_error
;
4742 values
[0] = PyTuple_GET_ITEM(__pyx_args
, 0);
4743 values
[1] = PyTuple_GET_ITEM(__pyx_args
, 1);
4744 values
[2] = PyTuple_GET_ITEM(__pyx_args
, 2);
4746 __pyx_v___pyx_type
= values
[0];
4747 __pyx_v___pyx_checksum
= __Pyx_PyInt_As_long(values
[1]); if (unlikely((__pyx_v___pyx_checksum
== (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error
)
4748 __pyx_v___pyx_state
= values
[2];
4750 goto __pyx_L4_argument_unpacking_done
;
4751 __pyx_L5_argtuple_error
:;
4752 __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_P_Score_Upper_Tail", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args
)); __PYX_ERR(1, 1, __pyx_L3_error
)
4754 __Pyx_AddTraceback("MACS2.Statistics.__pyx_unpickle_P_Score_Upper_Tail", __pyx_clineno
, __pyx_lineno
, __pyx_filename
);
4755 __Pyx_RefNannyFinishContext();
4757 __pyx_L4_argument_unpacking_done
:;
4758 __pyx_r
= __pyx_pf_5MACS2_10Statistics___pyx_unpickle_P_Score_Upper_Tail(__pyx_self
, __pyx_v___pyx_type
, __pyx_v___pyx_checksum
, __pyx_v___pyx_state
);
4760 /* function exit code */
4761 __Pyx_RefNannyFinishContext();
4765 static PyObject
*__pyx_pf_5MACS2_10Statistics___pyx_unpickle_P_Score_Upper_Tail(CYTHON_UNUSED PyObject
*__pyx_self
, PyObject
*__pyx_v___pyx_type
, long __pyx_v___pyx_checksum
, PyObject
*__pyx_v___pyx_state
) {
4766 PyObject
*__pyx_v___pyx_PickleError
= 0;
4767 PyObject
*__pyx_v___pyx_result
= 0;
4768 PyObject
*__pyx_r
= NULL
;
4769 __Pyx_TraceDeclarations
4770 __Pyx_RefNannyDeclarations
4772 PyObject
*__pyx_t_2
= NULL
;
4773 PyObject
*__pyx_t_3
= NULL
;
4774 PyObject
*__pyx_t_4
= NULL
;
4775 PyObject
*__pyx_t_5
= NULL
;
4777 __Pyx_TraceFrameInit(__pyx_codeobj_
)
4778 __Pyx_RefNannySetupContext("__pyx_unpickle_P_Score_Upper_Tail", 0);
4779 __Pyx_TraceCall("__pyx_unpickle_P_Score_Upper_Tail", __pyx_f
[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error
));
4781 /* "(tree fragment)":4
4782 * cdef object __pyx_PickleError
4783 * cdef object __pyx_result
4784 * if __pyx_checksum != 0xf502884: # <<<<<<<<<<<<<<
4785 * from pickle import PickleError as __pyx_PickleError
4786 * raise __pyx_PickleError("Incompatible checksums (%s vs 0xf502884 = (pscore_dict))" % __pyx_checksum)
4788 __pyx_t_1
= ((__pyx_v___pyx_checksum
!= 0xf502884) != 0);
4791 /* "(tree fragment)":5
4792 * cdef object __pyx_result
4793 * if __pyx_checksum != 0xf502884:
4794 * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
4795 * raise __pyx_PickleError("Incompatible checksums (%s vs 0xf502884 = (pscore_dict))" % __pyx_checksum)
4796 * __pyx_result = P_Score_Upper_Tail.__new__(__pyx_type)
4798 __pyx_t_2
= PyList_New(1); if (unlikely(!__pyx_t_2
)) __PYX_ERR(1, 5, __pyx_L1_error
)
4799 __Pyx_GOTREF(__pyx_t_2
);
4800 __Pyx_INCREF(__pyx_n_s_PickleError
);
4801 __Pyx_GIVEREF(__pyx_n_s_PickleError
);
4802 PyList_SET_ITEM(__pyx_t_2
, 0, __pyx_n_s_PickleError
);
4803 __pyx_t_3
= __Pyx_Import(__pyx_n_s_pickle
, __pyx_t_2
, 0); if (unlikely(!__pyx_t_3
)) __PYX_ERR(1, 5, __pyx_L1_error
)
4804 __Pyx_GOTREF(__pyx_t_3
);
4805 __Pyx_DECREF(__pyx_t_2
); __pyx_t_2
= 0;
4806 __pyx_t_2
= __Pyx_ImportFrom(__pyx_t_3
, __pyx_n_s_PickleError
); if (unlikely(!__pyx_t_2
)) __PYX_ERR(1, 5, __pyx_L1_error
)
4807 __Pyx_GOTREF(__pyx_t_2
);
4808 __Pyx_INCREF(__pyx_t_2
);
4809 __pyx_v___pyx_PickleError
= __pyx_t_2
;
4810 __Pyx_DECREF(__pyx_t_2
); __pyx_t_2
= 0;
4811 __Pyx_DECREF(__pyx_t_3
); __pyx_t_3
= 0;
4813 /* "(tree fragment)":6
4814 * if __pyx_checksum != 0xf502884:
4815 * from pickle import PickleError as __pyx_PickleError
4816 * raise __pyx_PickleError("Incompatible checksums (%s vs 0xf502884 = (pscore_dict))" % __pyx_checksum) # <<<<<<<<<<<<<<
4817 * __pyx_result = P_Score_Upper_Tail.__new__(__pyx_type)
4818 * if __pyx_state is not None:
4820 __pyx_t_2
= __Pyx_PyInt_From_long(__pyx_v___pyx_checksum
); if (unlikely(!__pyx_t_2
)) __PYX_ERR(1, 6, __pyx_L1_error
)
4821 __Pyx_GOTREF(__pyx_t_2
);
4822 __pyx_t_4
= __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xf5
, __pyx_t_2
); if (unlikely(!__pyx_t_4
)) __PYX_ERR(1, 6, __pyx_L1_error
)
4823 __Pyx_GOTREF(__pyx_t_4
);
4824 __Pyx_DECREF(__pyx_t_2
); __pyx_t_2
= 0;
4825 __Pyx_INCREF(__pyx_v___pyx_PickleError
);
4826 __pyx_t_2
= __pyx_v___pyx_PickleError
; __pyx_t_5
= NULL
;
4827 if (CYTHON_UNPACK_METHODS
&& unlikely(PyMethod_Check(__pyx_t_2
))) {
4828 __pyx_t_5
= PyMethod_GET_SELF(__pyx_t_2
);
4829 if (likely(__pyx_t_5
)) {
4830 PyObject
* function
= PyMethod_GET_FUNCTION(__pyx_t_2
);
4831 __Pyx_INCREF(__pyx_t_5
);
4832 __Pyx_INCREF(function
);
4833 __Pyx_DECREF_SET(__pyx_t_2
, function
);
4836 __pyx_t_3
= (__pyx_t_5
) ? __Pyx_PyObject_Call2Args(__pyx_t_2
, __pyx_t_5
, __pyx_t_4
) : __Pyx_PyObject_CallOneArg(__pyx_t_2
, __pyx_t_4
);
4837 __Pyx_XDECREF(__pyx_t_5
); __pyx_t_5
= 0;
4838 __Pyx_DECREF(__pyx_t_4
); __pyx_t_4
= 0;
4839 if (unlikely(!__pyx_t_3
)) __PYX_ERR(1, 6, __pyx_L1_error
)
4840 __Pyx_GOTREF(__pyx_t_3
);
4841 __Pyx_DECREF(__pyx_t_2
); __pyx_t_2
= 0;
4842 __Pyx_Raise(__pyx_t_3
, 0, 0, 0);
4843 __Pyx_DECREF(__pyx_t_3
); __pyx_t_3
= 0;
4844 __PYX_ERR(1, 6, __pyx_L1_error
)
4846 /* "(tree fragment)":4
4847 * cdef object __pyx_PickleError
4848 * cdef object __pyx_result
4849 * if __pyx_checksum != 0xf502884: # <<<<<<<<<<<<<<
4850 * from pickle import PickleError as __pyx_PickleError
4851 * raise __pyx_PickleError("Incompatible checksums (%s vs 0xf502884 = (pscore_dict))" % __pyx_checksum)
4855 /* "(tree fragment)":7
4856 * from pickle import PickleError as __pyx_PickleError
4857 * raise __pyx_PickleError("Incompatible checksums (%s vs 0xf502884 = (pscore_dict))" % __pyx_checksum)
4858 * __pyx_result = P_Score_Upper_Tail.__new__(__pyx_type) # <<<<<<<<<<<<<<
4859 * if __pyx_state is not None:
4860 * __pyx_unpickle_P_Score_Upper_Tail__set_state(<P_Score_Upper_Tail> __pyx_result, __pyx_state)
4862 __pyx_t_2
= __Pyx_PyObject_GetAttrStr(((PyObject
*)__pyx_ptype_5MACS2_10Statistics_P_Score_Upper_Tail
), __pyx_n_s_new
); if (unlikely(!__pyx_t_2
)) __PYX_ERR(1, 7, __pyx_L1_error
)
4863 __Pyx_GOTREF(__pyx_t_2
);
4865 if (CYTHON_UNPACK_METHODS
&& likely(PyMethod_Check(__pyx_t_2
))) {
4866 __pyx_t_4
= PyMethod_GET_SELF(__pyx_t_2
);
4867 if (likely(__pyx_t_4
)) {
4868 PyObject
* function
= PyMethod_GET_FUNCTION(__pyx_t_2
);
4869 __Pyx_INCREF(__pyx_t_4
);
4870 __Pyx_INCREF(function
);
4871 __Pyx_DECREF_SET(__pyx_t_2
, function
);
4874 __pyx_t_3
= (__pyx_t_4
) ? __Pyx_PyObject_Call2Args(__pyx_t_2
, __pyx_t_4
, __pyx_v___pyx_type
) : __Pyx_PyObject_CallOneArg(__pyx_t_2
, __pyx_v___pyx_type
);
4875 __Pyx_XDECREF(__pyx_t_4
); __pyx_t_4
= 0;
4876 if (unlikely(!__pyx_t_3
)) __PYX_ERR(1, 7, __pyx_L1_error
)
4877 __Pyx_GOTREF(__pyx_t_3
);
4878 __Pyx_DECREF(__pyx_t_2
); __pyx_t_2
= 0;
4879 __pyx_v___pyx_result
= __pyx_t_3
;
4882 /* "(tree fragment)":8
4883 * raise __pyx_PickleError("Incompatible checksums (%s vs 0xf502884 = (pscore_dict))" % __pyx_checksum)
4884 * __pyx_result = P_Score_Upper_Tail.__new__(__pyx_type)
4885 * if __pyx_state is not None: # <<<<<<<<<<<<<<
4886 * __pyx_unpickle_P_Score_Upper_Tail__set_state(<P_Score_Upper_Tail> __pyx_result, __pyx_state)
4887 * return __pyx_result
4889 __pyx_t_1
= (__pyx_v___pyx_state
!= Py_None
);
4890 __pyx_t_6
= (__pyx_t_1
!= 0);
4893 /* "(tree fragment)":9
4894 * __pyx_result = P_Score_Upper_Tail.__new__(__pyx_type)
4895 * if __pyx_state is not None:
4896 * __pyx_unpickle_P_Score_Upper_Tail__set_state(<P_Score_Upper_Tail> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
4897 * return __pyx_result
4898 * cdef __pyx_unpickle_P_Score_Upper_Tail__set_state(P_Score_Upper_Tail __pyx_result, tuple __pyx_state):
4900 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state
))||((__pyx_v___pyx_state
) == Py_None
)||(PyErr_Format(PyExc_TypeError
, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state
)->tp_name
), 0))) __PYX_ERR(1, 9, __pyx_L1_error
)
4901 __pyx_t_3
= __pyx_f_5MACS2_10Statistics___pyx_unpickle_P_Score_Upper_Tail__set_state(((struct __pyx_obj_5MACS2_10Statistics_P_Score_Upper_Tail
*)__pyx_v___pyx_result
), ((PyObject
*)__pyx_v___pyx_state
)); if (unlikely(!__pyx_t_3
)) __PYX_ERR(1, 9, __pyx_L1_error
)
4902 __Pyx_GOTREF(__pyx_t_3
);
4903 __Pyx_DECREF(__pyx_t_3
); __pyx_t_3
= 0;
4905 /* "(tree fragment)":8
4906 * raise __pyx_PickleError("Incompatible checksums (%s vs 0xf502884 = (pscore_dict))" % __pyx_checksum)
4907 * __pyx_result = P_Score_Upper_Tail.__new__(__pyx_type)
4908 * if __pyx_state is not None: # <<<<<<<<<<<<<<
4909 * __pyx_unpickle_P_Score_Upper_Tail__set_state(<P_Score_Upper_Tail> __pyx_result, __pyx_state)
4910 * return __pyx_result
4914 /* "(tree fragment)":10
4915 * if __pyx_state is not None:
4916 * __pyx_unpickle_P_Score_Upper_Tail__set_state(<P_Score_Upper_Tail> __pyx_result, __pyx_state)
4917 * return __pyx_result # <<<<<<<<<<<<<<
4918 * cdef __pyx_unpickle_P_Score_Upper_Tail__set_state(P_Score_Upper_Tail __pyx_result, tuple __pyx_state):
4919 * __pyx_result.pscore_dict = __pyx_state[0]
4921 __Pyx_XDECREF(__pyx_r
);
4922 __Pyx_INCREF(__pyx_v___pyx_result
);
4923 __pyx_r
= __pyx_v___pyx_result
;
4926 /* "(tree fragment)":1
4927 * def __pyx_unpickle_P_Score_Upper_Tail(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
4928 * cdef object __pyx_PickleError
4929 * cdef object __pyx_result
4932 /* function exit code */
4934 __Pyx_XDECREF(__pyx_t_2
);
4935 __Pyx_XDECREF(__pyx_t_3
);
4936 __Pyx_XDECREF(__pyx_t_4
);
4937 __Pyx_XDECREF(__pyx_t_5
);
4938 __Pyx_AddTraceback("MACS2.Statistics.__pyx_unpickle_P_Score_Upper_Tail", __pyx_clineno
, __pyx_lineno
, __pyx_filename
);
4941 __Pyx_XDECREF(__pyx_v___pyx_PickleError
);
4942 __Pyx_XDECREF(__pyx_v___pyx_result
);
4943 __Pyx_XGIVEREF(__pyx_r
);
4944 __Pyx_TraceReturn(__pyx_r
, 0);
4945 __Pyx_RefNannyFinishContext();
4949 /* "(tree fragment)":11
4950 * __pyx_unpickle_P_Score_Upper_Tail__set_state(<P_Score_Upper_Tail> __pyx_result, __pyx_state)
4951 * return __pyx_result
4952 * cdef __pyx_unpickle_P_Score_Upper_Tail__set_state(P_Score_Upper_Tail __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
4953 * __pyx_result.pscore_dict = __pyx_state[0]
4954 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
4957 static PyObject
*__pyx_f_5MACS2_10Statistics___pyx_unpickle_P_Score_Upper_Tail__set_state(struct __pyx_obj_5MACS2_10Statistics_P_Score_Upper_Tail
*__pyx_v___pyx_result
, PyObject
*__pyx_v___pyx_state
) {
4958 PyObject
*__pyx_r
= NULL
;
4959 __Pyx_TraceDeclarations
4960 __Pyx_RefNannyDeclarations
4961 PyObject
*__pyx_t_1
= NULL
;
4963 Py_ssize_t __pyx_t_3
;
4966 PyObject
*__pyx_t_6
= NULL
;
4967 PyObject
*__pyx_t_7
= NULL
;
4968 PyObject
*__pyx_t_8
= NULL
;
4969 __Pyx_RefNannySetupContext("__pyx_unpickle_P_Score_Upper_Tail__set_state", 0);
4970 __Pyx_TraceCall("__pyx_unpickle_P_Score_Upper_Tail__set_state", __pyx_f
[1], 11, 0, __PYX_ERR(1, 11, __pyx_L1_error
));
4972 /* "(tree fragment)":12
4973 * return __pyx_result
4974 * cdef __pyx_unpickle_P_Score_Upper_Tail__set_state(P_Score_Upper_Tail __pyx_result, tuple __pyx_state):
4975 * __pyx_result.pscore_dict = __pyx_state[0] # <<<<<<<<<<<<<<
4976 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
4977 * __pyx_result.__dict__.update(__pyx_state[1])
4979 if (unlikely(__pyx_v___pyx_state
== Py_None
)) {
4980 PyErr_SetString(PyExc_TypeError
, "'NoneType' object is not subscriptable");
4981 __PYX_ERR(1, 12, __pyx_L1_error
)
4983 __pyx_t_1
= __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state
, 0, long, 1, __Pyx_PyInt_From_long
, 0, 0, 1); if (unlikely(!__pyx_t_1
)) __PYX_ERR(1, 12, __pyx_L1_error
)
4984 __Pyx_GOTREF(__pyx_t_1
);
4985 if (!(likely(PyDict_CheckExact(__pyx_t_1
))||((__pyx_t_1
) == Py_None
)||(PyErr_Format(PyExc_TypeError
, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1
)->tp_name
), 0))) __PYX_ERR(1, 12, __pyx_L1_error
)
4986 __Pyx_GIVEREF(__pyx_t_1
);
4987 __Pyx_GOTREF(__pyx_v___pyx_result
->pscore_dict
);
4988 __Pyx_DECREF(__pyx_v___pyx_result
->pscore_dict
);
4989 __pyx_v___pyx_result
->pscore_dict
= ((PyObject
*)__pyx_t_1
);
4992 /* "(tree fragment)":13
4993 * cdef __pyx_unpickle_P_Score_Upper_Tail__set_state(P_Score_Upper_Tail __pyx_result, tuple __pyx_state):
4994 * __pyx_result.pscore_dict = __pyx_state[0]
4995 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
4996 * __pyx_result.__dict__.update(__pyx_state[1])
4998 if (unlikely(__pyx_v___pyx_state
== Py_None
)) {
4999 PyErr_SetString(PyExc_TypeError
, "object of type 'NoneType' has no len()");
5000 __PYX_ERR(1, 13, __pyx_L1_error
)
5002 __pyx_t_3
= PyTuple_GET_SIZE(__pyx_v___pyx_state
); if (unlikely(__pyx_t_3
== ((Py_ssize_t
)-1))) __PYX_ERR(1, 13, __pyx_L1_error
)
5003 __pyx_t_4
= ((__pyx_t_3
> 1) != 0);
5006 __pyx_t_2
= __pyx_t_4
;
5007 goto __pyx_L4_bool_binop_done
;
5009 __pyx_t_4
= __Pyx_HasAttr(((PyObject
*)__pyx_v___pyx_result
), __pyx_n_s_dict
); if (unlikely(__pyx_t_4
== ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error
)
5010 __pyx_t_5
= (__pyx_t_4
!= 0);
5011 __pyx_t_2
= __pyx_t_5
;
5012 __pyx_L4_bool_binop_done
:;
5015 /* "(tree fragment)":14
5016 * __pyx_result.pscore_dict = __pyx_state[0]
5017 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
5018 * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<<
5020 __pyx_t_6
= __Pyx_PyObject_GetAttrStr(((PyObject
*)__pyx_v___pyx_result
), __pyx_n_s_dict
); if (unlikely(!__pyx_t_6
)) __PYX_ERR(1, 14, __pyx_L1_error
)
5021 __Pyx_GOTREF(__pyx_t_6
);
5022 __pyx_t_7
= __Pyx_PyObject_GetAttrStr(__pyx_t_6
, __pyx_n_s_update
); if (unlikely(!__pyx_t_7
)) __PYX_ERR(1, 14, __pyx_L1_error
)
5023 __Pyx_GOTREF(__pyx_t_7
);
5024 __Pyx_DECREF(__pyx_t_6
); __pyx_t_6
= 0;
5025 if (unlikely(__pyx_v___pyx_state
== Py_None
)) {
5026 PyErr_SetString(PyExc_TypeError
, "'NoneType' object is not subscriptable");
5027 __PYX_ERR(1, 14, __pyx_L1_error
)
5029 __pyx_t_6
= __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state
, 1, long, 1, __Pyx_PyInt_From_long
, 0, 0, 1); if (unlikely(!__pyx_t_6
)) __PYX_ERR(1, 14, __pyx_L1_error
)
5030 __Pyx_GOTREF(__pyx_t_6
);
5032 if (CYTHON_UNPACK_METHODS
&& likely(PyMethod_Check(__pyx_t_7
))) {
5033 __pyx_t_8
= PyMethod_GET_SELF(__pyx_t_7
);
5034 if (likely(__pyx_t_8
)) {
5035 PyObject
* function
= PyMethod_GET_FUNCTION(__pyx_t_7
);
5036 __Pyx_INCREF(__pyx_t_8
);
5037 __Pyx_INCREF(function
);
5038 __Pyx_DECREF_SET(__pyx_t_7
, function
);
5041 __pyx_t_1
= (__pyx_t_8
) ? __Pyx_PyObject_Call2Args(__pyx_t_7
, __pyx_t_8
, __pyx_t_6
) : __Pyx_PyObject_CallOneArg(__pyx_t_7
, __pyx_t_6
);
5042 __Pyx_XDECREF(__pyx_t_8
); __pyx_t_8
= 0;
5043 __Pyx_DECREF(__pyx_t_6
); __pyx_t_6
= 0;
5044 if (unlikely(!__pyx_t_1
)) __PYX_ERR(1, 14, __pyx_L1_error
)
5045 __Pyx_GOTREF(__pyx_t_1
);
5046 __Pyx_DECREF(__pyx_t_7
); __pyx_t_7
= 0;
5047 __Pyx_DECREF(__pyx_t_1
); __pyx_t_1
= 0;
5049 /* "(tree fragment)":13
5050 * cdef __pyx_unpickle_P_Score_Upper_Tail__set_state(P_Score_Upper_Tail __pyx_result, tuple __pyx_state):
5051 * __pyx_result.pscore_dict = __pyx_state[0]
5052 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
5053 * __pyx_result.__dict__.update(__pyx_state[1])
5057 /* "(tree fragment)":11
5058 * __pyx_unpickle_P_Score_Upper_Tail__set_state(<P_Score_Upper_Tail> __pyx_result, __pyx_state)
5059 * return __pyx_result
5060 * cdef __pyx_unpickle_P_Score_Upper_Tail__set_state(P_Score_Upper_Tail __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
5061 * __pyx_result.pscore_dict = __pyx_state[0]
5062 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
5065 /* function exit code */
5066 __pyx_r
= Py_None
; __Pyx_INCREF(Py_None
);
5069 __Pyx_XDECREF(__pyx_t_1
);
5070 __Pyx_XDECREF(__pyx_t_6
);
5071 __Pyx_XDECREF(__pyx_t_7
);
5072 __Pyx_XDECREF(__pyx_t_8
);
5073 __Pyx_AddTraceback("MACS2.Statistics.__pyx_unpickle_P_Score_Upper_Tail__set_state", __pyx_clineno
, __pyx_lineno
, __pyx_filename
);
5076 __Pyx_XGIVEREF(__pyx_r
);
5077 __Pyx_TraceReturn(__pyx_r
, 0);
5078 __Pyx_RefNannyFinishContext();
5082 /* "(tree fragment)":1
5083 * def __pyx_unpickle_LogLR_Asym(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
5084 * cdef object __pyx_PickleError
5085 * cdef object __pyx_result
5088 /* Python wrapper */
5089 static PyObject
*__pyx_pw_5MACS2_10Statistics_3__pyx_unpickle_LogLR_Asym(PyObject
*__pyx_self
, PyObject
*__pyx_args
, PyObject
*__pyx_kwds
); /*proto*/
5090 static PyMethodDef __pyx_mdef_5MACS2_10Statistics_3__pyx_unpickle_LogLR_Asym
= {"__pyx_unpickle_LogLR_Asym", (PyCFunction
)(void*)(PyCFunctionWithKeywords
)__pyx_pw_5MACS2_10Statistics_3__pyx_unpickle_LogLR_Asym
, METH_VARARGS
|METH_KEYWORDS
, 0};
5091 static PyObject
*__pyx_pw_5MACS2_10Statistics_3__pyx_unpickle_LogLR_Asym(PyObject
*__pyx_self
, PyObject
*__pyx_args
, PyObject
*__pyx_kwds
) {
5092 PyObject
*__pyx_v___pyx_type
= 0;
5093 long __pyx_v___pyx_checksum
;
5094 PyObject
*__pyx_v___pyx_state
= 0;
5095 PyObject
*__pyx_r
= 0;
5096 __Pyx_RefNannyDeclarations
5097 __Pyx_RefNannySetupContext("__pyx_unpickle_LogLR_Asym (wrapper)", 0);
5099 static PyObject
**__pyx_pyargnames
[] = {&__pyx_n_s_pyx_type
,&__pyx_n_s_pyx_checksum
,&__pyx_n_s_pyx_state
,0};
5100 PyObject
* values
[3] = {0,0,0};
5101 if (unlikely(__pyx_kwds
)) {
5103 const Py_ssize_t pos_args
= PyTuple_GET_SIZE(__pyx_args
);
5105 case 3: values
[2] = PyTuple_GET_ITEM(__pyx_args
, 2);
5107 case 2: values
[1] = PyTuple_GET_ITEM(__pyx_args
, 1);
5109 case 1: values
[0] = PyTuple_GET_ITEM(__pyx_args
, 0);
5112 default: goto __pyx_L5_argtuple_error
;
5114 kw_args
= PyDict_Size(__pyx_kwds
);
5117 if (likely((values
[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds
, __pyx_n_s_pyx_type
)) != 0)) kw_args
--;
5118 else goto __pyx_L5_argtuple_error
;
5121 if (likely((values
[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds
, __pyx_n_s_pyx_checksum
)) != 0)) kw_args
--;
5123 __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_LogLR_Asym", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error
)
5127 if (likely((values
[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds
, __pyx_n_s_pyx_state
)) != 0)) kw_args
--;
5129 __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_LogLR_Asym", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error
)
5132 if (unlikely(kw_args
> 0)) {
5133 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds
, __pyx_pyargnames
, 0, values
, pos_args
, "__pyx_unpickle_LogLR_Asym") < 0)) __PYX_ERR(1, 1, __pyx_L3_error
)
5135 } else if (PyTuple_GET_SIZE(__pyx_args
) != 3) {
5136 goto __pyx_L5_argtuple_error
;
5138 values
[0] = PyTuple_GET_ITEM(__pyx_args
, 0);
5139 values
[1] = PyTuple_GET_ITEM(__pyx_args
, 1);
5140 values
[2] = PyTuple_GET_ITEM(__pyx_args
, 2);
5142 __pyx_v___pyx_type
= values
[0];
5143 __pyx_v___pyx_checksum
= __Pyx_PyInt_As_long(values
[1]); if (unlikely((__pyx_v___pyx_checksum
== (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error
)
5144 __pyx_v___pyx_state
= values
[2];
5146 goto __pyx_L4_argument_unpacking_done
;
5147 __pyx_L5_argtuple_error
:;
5148 __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_LogLR_Asym", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args
)); __PYX_ERR(1, 1, __pyx_L3_error
)
5150 __Pyx_AddTraceback("MACS2.Statistics.__pyx_unpickle_LogLR_Asym", __pyx_clineno
, __pyx_lineno
, __pyx_filename
);
5151 __Pyx_RefNannyFinishContext();
5153 __pyx_L4_argument_unpacking_done
:;
5154 __pyx_r
= __pyx_pf_5MACS2_10Statistics_2__pyx_unpickle_LogLR_Asym(__pyx_self
, __pyx_v___pyx_type
, __pyx_v___pyx_checksum
, __pyx_v___pyx_state
);
5156 /* function exit code */
5157 __Pyx_RefNannyFinishContext();
5161 static PyObject
*__pyx_pf_5MACS2_10Statistics_2__pyx_unpickle_LogLR_Asym(CYTHON_UNUSED PyObject
*__pyx_self
, PyObject
*__pyx_v___pyx_type
, long __pyx_v___pyx_checksum
, PyObject
*__pyx_v___pyx_state
) {
5162 PyObject
*__pyx_v___pyx_PickleError
= 0;
5163 PyObject
*__pyx_v___pyx_result
= 0;
5164 PyObject
*__pyx_r
= NULL
;
5165 __Pyx_TraceDeclarations
5166 __Pyx_RefNannyDeclarations
5168 PyObject
*__pyx_t_2
= NULL
;
5169 PyObject
*__pyx_t_3
= NULL
;
5170 PyObject
*__pyx_t_4
= NULL
;
5171 PyObject
*__pyx_t_5
= NULL
;
5173 __Pyx_TraceFrameInit(__pyx_codeobj__2
)
5174 __Pyx_RefNannySetupContext("__pyx_unpickle_LogLR_Asym", 0);
5175 __Pyx_TraceCall("__pyx_unpickle_LogLR_Asym", __pyx_f
[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error
));
5177 /* "(tree fragment)":4
5178 * cdef object __pyx_PickleError
5179 * cdef object __pyx_result
5180 * if __pyx_checksum != 0x086441e: # <<<<<<<<<<<<<<
5181 * from pickle import PickleError as __pyx_PickleError
5182 * raise __pyx_PickleError("Incompatible checksums (%s vs 0x086441e = (logLR_dict))" % __pyx_checksum)
5184 __pyx_t_1
= ((__pyx_v___pyx_checksum
!= 0x086441e) != 0);
5187 /* "(tree fragment)":5
5188 * cdef object __pyx_result
5189 * if __pyx_checksum != 0x086441e:
5190 * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
5191 * raise __pyx_PickleError("Incompatible checksums (%s vs 0x086441e = (logLR_dict))" % __pyx_checksum)
5192 * __pyx_result = LogLR_Asym.__new__(__pyx_type)
5194 __pyx_t_2
= PyList_New(1); if (unlikely(!__pyx_t_2
)) __PYX_ERR(1, 5, __pyx_L1_error
)
5195 __Pyx_GOTREF(__pyx_t_2
);
5196 __Pyx_INCREF(__pyx_n_s_PickleError
);
5197 __Pyx_GIVEREF(__pyx_n_s_PickleError
);
5198 PyList_SET_ITEM(__pyx_t_2
, 0, __pyx_n_s_PickleError
);
5199 __pyx_t_3
= __Pyx_Import(__pyx_n_s_pickle
, __pyx_t_2
, 0); if (unlikely(!__pyx_t_3
)) __PYX_ERR(1, 5, __pyx_L1_error
)
5200 __Pyx_GOTREF(__pyx_t_3
);
5201 __Pyx_DECREF(__pyx_t_2
); __pyx_t_2
= 0;
5202 __pyx_t_2
= __Pyx_ImportFrom(__pyx_t_3
, __pyx_n_s_PickleError
); if (unlikely(!__pyx_t_2
)) __PYX_ERR(1, 5, __pyx_L1_error
)
5203 __Pyx_GOTREF(__pyx_t_2
);
5204 __Pyx_INCREF(__pyx_t_2
);
5205 __pyx_v___pyx_PickleError
= __pyx_t_2
;
5206 __Pyx_DECREF(__pyx_t_2
); __pyx_t_2
= 0;
5207 __Pyx_DECREF(__pyx_t_3
); __pyx_t_3
= 0;
5209 /* "(tree fragment)":6
5210 * if __pyx_checksum != 0x086441e:
5211 * from pickle import PickleError as __pyx_PickleError
5212 * raise __pyx_PickleError("Incompatible checksums (%s vs 0x086441e = (logLR_dict))" % __pyx_checksum) # <<<<<<<<<<<<<<
5213 * __pyx_result = LogLR_Asym.__new__(__pyx_type)
5214 * if __pyx_state is not None:
5216 __pyx_t_2
= __Pyx_PyInt_From_long(__pyx_v___pyx_checksum
); if (unlikely(!__pyx_t_2
)) __PYX_ERR(1, 6, __pyx_L1_error
)
5217 __Pyx_GOTREF(__pyx_t_2
);
5218 __pyx_t_4
= __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x08
, __pyx_t_2
); if (unlikely(!__pyx_t_4
)) __PYX_ERR(1, 6, __pyx_L1_error
)
5219 __Pyx_GOTREF(__pyx_t_4
);
5220 __Pyx_DECREF(__pyx_t_2
); __pyx_t_2
= 0;
5221 __Pyx_INCREF(__pyx_v___pyx_PickleError
);
5222 __pyx_t_2
= __pyx_v___pyx_PickleError
; __pyx_t_5
= NULL
;
5223 if (CYTHON_UNPACK_METHODS
&& unlikely(PyMethod_Check(__pyx_t_2
))) {
5224 __pyx_t_5
= PyMethod_GET_SELF(__pyx_t_2
);
5225 if (likely(__pyx_t_5
)) {
5226 PyObject
* function
= PyMethod_GET_FUNCTION(__pyx_t_2
);
5227 __Pyx_INCREF(__pyx_t_5
);
5228 __Pyx_INCREF(function
);
5229 __Pyx_DECREF_SET(__pyx_t_2
, function
);
5232 __pyx_t_3
= (__pyx_t_5
) ? __Pyx_PyObject_Call2Args(__pyx_t_2
, __pyx_t_5
, __pyx_t_4
) : __Pyx_PyObject_CallOneArg(__pyx_t_2
, __pyx_t_4
);
5233 __Pyx_XDECREF(__pyx_t_5
); __pyx_t_5
= 0;
5234 __Pyx_DECREF(__pyx_t_4
); __pyx_t_4
= 0;
5235 if (unlikely(!__pyx_t_3
)) __PYX_ERR(1, 6, __pyx_L1_error
)
5236 __Pyx_GOTREF(__pyx_t_3
);
5237 __Pyx_DECREF(__pyx_t_2
); __pyx_t_2
= 0;
5238 __Pyx_Raise(__pyx_t_3
, 0, 0, 0);
5239 __Pyx_DECREF(__pyx_t_3
); __pyx_t_3
= 0;
5240 __PYX_ERR(1, 6, __pyx_L1_error
)
5242 /* "(tree fragment)":4
5243 * cdef object __pyx_PickleError
5244 * cdef object __pyx_result
5245 * if __pyx_checksum != 0x086441e: # <<<<<<<<<<<<<<
5246 * from pickle import PickleError as __pyx_PickleError
5247 * raise __pyx_PickleError("Incompatible checksums (%s vs 0x086441e = (logLR_dict))" % __pyx_checksum)
5251 /* "(tree fragment)":7
5252 * from pickle import PickleError as __pyx_PickleError
5253 * raise __pyx_PickleError("Incompatible checksums (%s vs 0x086441e = (logLR_dict))" % __pyx_checksum)
5254 * __pyx_result = LogLR_Asym.__new__(__pyx_type) # <<<<<<<<<<<<<<
5255 * if __pyx_state is not None:
5256 * __pyx_unpickle_LogLR_Asym__set_state(<LogLR_Asym> __pyx_result, __pyx_state)
5258 __pyx_t_2
= __Pyx_PyObject_GetAttrStr(((PyObject
*)__pyx_ptype_5MACS2_10Statistics_LogLR_Asym
), __pyx_n_s_new
); if (unlikely(!__pyx_t_2
)) __PYX_ERR(1, 7, __pyx_L1_error
)
5259 __Pyx_GOTREF(__pyx_t_2
);
5261 if (CYTHON_UNPACK_METHODS
&& likely(PyMethod_Check(__pyx_t_2
))) {
5262 __pyx_t_4
= PyMethod_GET_SELF(__pyx_t_2
);
5263 if (likely(__pyx_t_4
)) {
5264 PyObject
* function
= PyMethod_GET_FUNCTION(__pyx_t_2
);
5265 __Pyx_INCREF(__pyx_t_4
);
5266 __Pyx_INCREF(function
);
5267 __Pyx_DECREF_SET(__pyx_t_2
, function
);
5270 __pyx_t_3
= (__pyx_t_4
) ? __Pyx_PyObject_Call2Args(__pyx_t_2
, __pyx_t_4
, __pyx_v___pyx_type
) : __Pyx_PyObject_CallOneArg(__pyx_t_2
, __pyx_v___pyx_type
);
5271 __Pyx_XDECREF(__pyx_t_4
); __pyx_t_4
= 0;
5272 if (unlikely(!__pyx_t_3
)) __PYX_ERR(1, 7, __pyx_L1_error
)
5273 __Pyx_GOTREF(__pyx_t_3
);
5274 __Pyx_DECREF(__pyx_t_2
); __pyx_t_2
= 0;
5275 __pyx_v___pyx_result
= __pyx_t_3
;
5278 /* "(tree fragment)":8
5279 * raise __pyx_PickleError("Incompatible checksums (%s vs 0x086441e = (logLR_dict))" % __pyx_checksum)
5280 * __pyx_result = LogLR_Asym.__new__(__pyx_type)
5281 * if __pyx_state is not None: # <<<<<<<<<<<<<<
5282 * __pyx_unpickle_LogLR_Asym__set_state(<LogLR_Asym> __pyx_result, __pyx_state)
5283 * return __pyx_result
5285 __pyx_t_1
= (__pyx_v___pyx_state
!= Py_None
);
5286 __pyx_t_6
= (__pyx_t_1
!= 0);
5289 /* "(tree fragment)":9
5290 * __pyx_result = LogLR_Asym.__new__(__pyx_type)
5291 * if __pyx_state is not None:
5292 * __pyx_unpickle_LogLR_Asym__set_state(<LogLR_Asym> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
5293 * return __pyx_result
5294 * cdef __pyx_unpickle_LogLR_Asym__set_state(LogLR_Asym __pyx_result, tuple __pyx_state):
5296 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state
))||((__pyx_v___pyx_state
) == Py_None
)||(PyErr_Format(PyExc_TypeError
, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state
)->tp_name
), 0))) __PYX_ERR(1, 9, __pyx_L1_error
)
5297 __pyx_t_3
= __pyx_f_5MACS2_10Statistics___pyx_unpickle_LogLR_Asym__set_state(((struct __pyx_obj_5MACS2_10Statistics_LogLR_Asym
*)__pyx_v___pyx_result
), ((PyObject
*)__pyx_v___pyx_state
)); if (unlikely(!__pyx_t_3
)) __PYX_ERR(1, 9, __pyx_L1_error
)
5298 __Pyx_GOTREF(__pyx_t_3
);
5299 __Pyx_DECREF(__pyx_t_3
); __pyx_t_3
= 0;
5301 /* "(tree fragment)":8
5302 * raise __pyx_PickleError("Incompatible checksums (%s vs 0x086441e = (logLR_dict))" % __pyx_checksum)
5303 * __pyx_result = LogLR_Asym.__new__(__pyx_type)
5304 * if __pyx_state is not None: # <<<<<<<<<<<<<<
5305 * __pyx_unpickle_LogLR_Asym__set_state(<LogLR_Asym> __pyx_result, __pyx_state)
5306 * return __pyx_result
5310 /* "(tree fragment)":10
5311 * if __pyx_state is not None:
5312 * __pyx_unpickle_LogLR_Asym__set_state(<LogLR_Asym> __pyx_result, __pyx_state)
5313 * return __pyx_result # <<<<<<<<<<<<<<
5314 * cdef __pyx_unpickle_LogLR_Asym__set_state(LogLR_Asym __pyx_result, tuple __pyx_state):
5315 * __pyx_result.logLR_dict = __pyx_state[0]
5317 __Pyx_XDECREF(__pyx_r
);
5318 __Pyx_INCREF(__pyx_v___pyx_result
);
5319 __pyx_r
= __pyx_v___pyx_result
;
5322 /* "(tree fragment)":1
5323 * def __pyx_unpickle_LogLR_Asym(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
5324 * cdef object __pyx_PickleError
5325 * cdef object __pyx_result
5328 /* function exit code */
5330 __Pyx_XDECREF(__pyx_t_2
);
5331 __Pyx_XDECREF(__pyx_t_3
);
5332 __Pyx_XDECREF(__pyx_t_4
);
5333 __Pyx_XDECREF(__pyx_t_5
);
5334 __Pyx_AddTraceback("MACS2.Statistics.__pyx_unpickle_LogLR_Asym", __pyx_clineno
, __pyx_lineno
, __pyx_filename
);
5337 __Pyx_XDECREF(__pyx_v___pyx_PickleError
);
5338 __Pyx_XDECREF(__pyx_v___pyx_result
);
5339 __Pyx_XGIVEREF(__pyx_r
);
5340 __Pyx_TraceReturn(__pyx_r
, 0);
5341 __Pyx_RefNannyFinishContext();
5345 /* "(tree fragment)":11
5346 * __pyx_unpickle_LogLR_Asym__set_state(<LogLR_Asym> __pyx_result, __pyx_state)
5347 * return __pyx_result
5348 * cdef __pyx_unpickle_LogLR_Asym__set_state(LogLR_Asym __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
5349 * __pyx_result.logLR_dict = __pyx_state[0]
5350 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
5353 static PyObject
*__pyx_f_5MACS2_10Statistics___pyx_unpickle_LogLR_Asym__set_state(struct __pyx_obj_5MACS2_10Statistics_LogLR_Asym
*__pyx_v___pyx_result
, PyObject
*__pyx_v___pyx_state
) {
5354 PyObject
*__pyx_r
= NULL
;
5355 __Pyx_TraceDeclarations
5356 __Pyx_RefNannyDeclarations
5357 PyObject
*__pyx_t_1
= NULL
;
5359 Py_ssize_t __pyx_t_3
;
5362 PyObject
*__pyx_t_6
= NULL
;
5363 PyObject
*__pyx_t_7
= NULL
;
5364 PyObject
*__pyx_t_8
= NULL
;
5365 __Pyx_RefNannySetupContext("__pyx_unpickle_LogLR_Asym__set_state", 0);
5366 __Pyx_TraceCall("__pyx_unpickle_LogLR_Asym__set_state", __pyx_f
[1], 11, 0, __PYX_ERR(1, 11, __pyx_L1_error
));
5368 /* "(tree fragment)":12
5369 * return __pyx_result
5370 * cdef __pyx_unpickle_LogLR_Asym__set_state(LogLR_Asym __pyx_result, tuple __pyx_state):
5371 * __pyx_result.logLR_dict = __pyx_state[0] # <<<<<<<<<<<<<<
5372 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
5373 * __pyx_result.__dict__.update(__pyx_state[1])
5375 if (unlikely(__pyx_v___pyx_state
== Py_None
)) {
5376 PyErr_SetString(PyExc_TypeError
, "'NoneType' object is not subscriptable");
5377 __PYX_ERR(1, 12, __pyx_L1_error
)
5379 __pyx_t_1
= __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state
, 0, long, 1, __Pyx_PyInt_From_long
, 0, 0, 1); if (unlikely(!__pyx_t_1
)) __PYX_ERR(1, 12, __pyx_L1_error
)
5380 __Pyx_GOTREF(__pyx_t_1
);
5381 if (!(likely(PyDict_CheckExact(__pyx_t_1
))||((__pyx_t_1
) == Py_None
)||(PyErr_Format(PyExc_TypeError
, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1
)->tp_name
), 0))) __PYX_ERR(1, 12, __pyx_L1_error
)
5382 __Pyx_GIVEREF(__pyx_t_1
);
5383 __Pyx_GOTREF(__pyx_v___pyx_result
->logLR_dict
);
5384 __Pyx_DECREF(__pyx_v___pyx_result
->logLR_dict
);
5385 __pyx_v___pyx_result
->logLR_dict
= ((PyObject
*)__pyx_t_1
);
5388 /* "(tree fragment)":13
5389 * cdef __pyx_unpickle_LogLR_Asym__set_state(LogLR_Asym __pyx_result, tuple __pyx_state):
5390 * __pyx_result.logLR_dict = __pyx_state[0]
5391 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
5392 * __pyx_result.__dict__.update(__pyx_state[1])
5394 if (unlikely(__pyx_v___pyx_state
== Py_None
)) {
5395 PyErr_SetString(PyExc_TypeError
, "object of type 'NoneType' has no len()");
5396 __PYX_ERR(1, 13, __pyx_L1_error
)
5398 __pyx_t_3
= PyTuple_GET_SIZE(__pyx_v___pyx_state
); if (unlikely(__pyx_t_3
== ((Py_ssize_t
)-1))) __PYX_ERR(1, 13, __pyx_L1_error
)
5399 __pyx_t_4
= ((__pyx_t_3
> 1) != 0);
5402 __pyx_t_2
= __pyx_t_4
;
5403 goto __pyx_L4_bool_binop_done
;
5405 __pyx_t_4
= __Pyx_HasAttr(((PyObject
*)__pyx_v___pyx_result
), __pyx_n_s_dict
); if (unlikely(__pyx_t_4
== ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error
)
5406 __pyx_t_5
= (__pyx_t_4
!= 0);
5407 __pyx_t_2
= __pyx_t_5
;
5408 __pyx_L4_bool_binop_done
:;
5411 /* "(tree fragment)":14
5412 * __pyx_result.logLR_dict = __pyx_state[0]
5413 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
5414 * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<<
5416 __pyx_t_6
= __Pyx_PyObject_GetAttrStr(((PyObject
*)__pyx_v___pyx_result
), __pyx_n_s_dict
); if (unlikely(!__pyx_t_6
)) __PYX_ERR(1, 14, __pyx_L1_error
)
5417 __Pyx_GOTREF(__pyx_t_6
);
5418 __pyx_t_7
= __Pyx_PyObject_GetAttrStr(__pyx_t_6
, __pyx_n_s_update
); if (unlikely(!__pyx_t_7
)) __PYX_ERR(1, 14, __pyx_L1_error
)
5419 __Pyx_GOTREF(__pyx_t_7
);
5420 __Pyx_DECREF(__pyx_t_6
); __pyx_t_6
= 0;
5421 if (unlikely(__pyx_v___pyx_state
== Py_None
)) {
5422 PyErr_SetString(PyExc_TypeError
, "'NoneType' object is not subscriptable");
5423 __PYX_ERR(1, 14, __pyx_L1_error
)
5425 __pyx_t_6
= __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state
, 1, long, 1, __Pyx_PyInt_From_long
, 0, 0, 1); if (unlikely(!__pyx_t_6
)) __PYX_ERR(1, 14, __pyx_L1_error
)
5426 __Pyx_GOTREF(__pyx_t_6
);
5428 if (CYTHON_UNPACK_METHODS
&& likely(PyMethod_Check(__pyx_t_7
))) {
5429 __pyx_t_8
= PyMethod_GET_SELF(__pyx_t_7
);
5430 if (likely(__pyx_t_8
)) {
5431 PyObject
* function
= PyMethod_GET_FUNCTION(__pyx_t_7
);
5432 __Pyx_INCREF(__pyx_t_8
);
5433 __Pyx_INCREF(function
);
5434 __Pyx_DECREF_SET(__pyx_t_7
, function
);
5437 __pyx_t_1
= (__pyx_t_8
) ? __Pyx_PyObject_Call2Args(__pyx_t_7
, __pyx_t_8
, __pyx_t_6
) : __Pyx_PyObject_CallOneArg(__pyx_t_7
, __pyx_t_6
);
5438 __Pyx_XDECREF(__pyx_t_8
); __pyx_t_8
= 0;
5439 __Pyx_DECREF(__pyx_t_6
); __pyx_t_6
= 0;
5440 if (unlikely(!__pyx_t_1
)) __PYX_ERR(1, 14, __pyx_L1_error
)
5441 __Pyx_GOTREF(__pyx_t_1
);
5442 __Pyx_DECREF(__pyx_t_7
); __pyx_t_7
= 0;
5443 __Pyx_DECREF(__pyx_t_1
); __pyx_t_1
= 0;
5445 /* "(tree fragment)":13
5446 * cdef __pyx_unpickle_LogLR_Asym__set_state(LogLR_Asym __pyx_result, tuple __pyx_state):
5447 * __pyx_result.logLR_dict = __pyx_state[0]
5448 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
5449 * __pyx_result.__dict__.update(__pyx_state[1])
5453 /* "(tree fragment)":11
5454 * __pyx_unpickle_LogLR_Asym__set_state(<LogLR_Asym> __pyx_result, __pyx_state)
5455 * return __pyx_result
5456 * cdef __pyx_unpickle_LogLR_Asym__set_state(LogLR_Asym __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
5457 * __pyx_result.logLR_dict = __pyx_state[0]
5458 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
5461 /* function exit code */
5462 __pyx_r
= Py_None
; __Pyx_INCREF(Py_None
);
5465 __Pyx_XDECREF(__pyx_t_1
);
5466 __Pyx_XDECREF(__pyx_t_6
);
5467 __Pyx_XDECREF(__pyx_t_7
);
5468 __Pyx_XDECREF(__pyx_t_8
);
5469 __Pyx_AddTraceback("MACS2.Statistics.__pyx_unpickle_LogLR_Asym__set_state", __pyx_clineno
, __pyx_lineno
, __pyx_filename
);
5472 __Pyx_XGIVEREF(__pyx_r
);
5473 __Pyx_TraceReturn(__pyx_r
, 0);
5474 __Pyx_RefNannyFinishContext();
5478 /* "(tree fragment)":1
5479 * def __pyx_unpickle_LogLR_Sym(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
5480 * cdef object __pyx_PickleError
5481 * cdef object __pyx_result
5484 /* Python wrapper */
5485 static PyObject
*__pyx_pw_5MACS2_10Statistics_5__pyx_unpickle_LogLR_Sym(PyObject
*__pyx_self
, PyObject
*__pyx_args
, PyObject
*__pyx_kwds
); /*proto*/
5486 static PyMethodDef __pyx_mdef_5MACS2_10Statistics_5__pyx_unpickle_LogLR_Sym
= {"__pyx_unpickle_LogLR_Sym", (PyCFunction
)(void*)(PyCFunctionWithKeywords
)__pyx_pw_5MACS2_10Statistics_5__pyx_unpickle_LogLR_Sym
, METH_VARARGS
|METH_KEYWORDS
, 0};
5487 static PyObject
*__pyx_pw_5MACS2_10Statistics_5__pyx_unpickle_LogLR_Sym(PyObject
*__pyx_self
, PyObject
*__pyx_args
, PyObject
*__pyx_kwds
) {
5488 PyObject
*__pyx_v___pyx_type
= 0;
5489 long __pyx_v___pyx_checksum
;
5490 PyObject
*__pyx_v___pyx_state
= 0;
5491 PyObject
*__pyx_r
= 0;
5492 __Pyx_RefNannyDeclarations
5493 __Pyx_RefNannySetupContext("__pyx_unpickle_LogLR_Sym (wrapper)", 0);
5495 static PyObject
**__pyx_pyargnames
[] = {&__pyx_n_s_pyx_type
,&__pyx_n_s_pyx_checksum
,&__pyx_n_s_pyx_state
,0};
5496 PyObject
* values
[3] = {0,0,0};
5497 if (unlikely(__pyx_kwds
)) {
5499 const Py_ssize_t pos_args
= PyTuple_GET_SIZE(__pyx_args
);
5501 case 3: values
[2] = PyTuple_GET_ITEM(__pyx_args
, 2);
5503 case 2: values
[1] = PyTuple_GET_ITEM(__pyx_args
, 1);
5505 case 1: values
[0] = PyTuple_GET_ITEM(__pyx_args
, 0);
5508 default: goto __pyx_L5_argtuple_error
;
5510 kw_args
= PyDict_Size(__pyx_kwds
);
5513 if (likely((values
[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds
, __pyx_n_s_pyx_type
)) != 0)) kw_args
--;
5514 else goto __pyx_L5_argtuple_error
;
5517 if (likely((values
[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds
, __pyx_n_s_pyx_checksum
)) != 0)) kw_args
--;
5519 __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_LogLR_Sym", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error
)
5523 if (likely((values
[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds
, __pyx_n_s_pyx_state
)) != 0)) kw_args
--;
5525 __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_LogLR_Sym", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error
)
5528 if (unlikely(kw_args
> 0)) {
5529 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds
, __pyx_pyargnames
, 0, values
, pos_args
, "__pyx_unpickle_LogLR_Sym") < 0)) __PYX_ERR(1, 1, __pyx_L3_error
)
5531 } else if (PyTuple_GET_SIZE(__pyx_args
) != 3) {
5532 goto __pyx_L5_argtuple_error
;
5534 values
[0] = PyTuple_GET_ITEM(__pyx_args
, 0);
5535 values
[1] = PyTuple_GET_ITEM(__pyx_args
, 1);
5536 values
[2] = PyTuple_GET_ITEM(__pyx_args
, 2);
5538 __pyx_v___pyx_type
= values
[0];
5539 __pyx_v___pyx_checksum
= __Pyx_PyInt_As_long(values
[1]); if (unlikely((__pyx_v___pyx_checksum
== (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error
)
5540 __pyx_v___pyx_state
= values
[2];
5542 goto __pyx_L4_argument_unpacking_done
;
5543 __pyx_L5_argtuple_error
:;
5544 __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_LogLR_Sym", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args
)); __PYX_ERR(1, 1, __pyx_L3_error
)
5546 __Pyx_AddTraceback("MACS2.Statistics.__pyx_unpickle_LogLR_Sym", __pyx_clineno
, __pyx_lineno
, __pyx_filename
);
5547 __Pyx_RefNannyFinishContext();
5549 __pyx_L4_argument_unpacking_done
:;
5550 __pyx_r
= __pyx_pf_5MACS2_10Statistics_4__pyx_unpickle_LogLR_Sym(__pyx_self
, __pyx_v___pyx_type
, __pyx_v___pyx_checksum
, __pyx_v___pyx_state
);
5552 /* function exit code */
5553 __Pyx_RefNannyFinishContext();
5557 static PyObject
*__pyx_pf_5MACS2_10Statistics_4__pyx_unpickle_LogLR_Sym(CYTHON_UNUSED PyObject
*__pyx_self
, PyObject
*__pyx_v___pyx_type
, long __pyx_v___pyx_checksum
, PyObject
*__pyx_v___pyx_state
) {
5558 PyObject
*__pyx_v___pyx_PickleError
= 0;
5559 PyObject
*__pyx_v___pyx_result
= 0;
5560 PyObject
*__pyx_r
= NULL
;
5561 __Pyx_TraceDeclarations
5562 __Pyx_RefNannyDeclarations
5564 PyObject
*__pyx_t_2
= NULL
;
5565 PyObject
*__pyx_t_3
= NULL
;
5566 PyObject
*__pyx_t_4
= NULL
;
5567 PyObject
*__pyx_t_5
= NULL
;
5569 __Pyx_TraceFrameInit(__pyx_codeobj__3
)
5570 __Pyx_RefNannySetupContext("__pyx_unpickle_LogLR_Sym", 0);
5571 __Pyx_TraceCall("__pyx_unpickle_LogLR_Sym", __pyx_f
[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error
));
5573 /* "(tree fragment)":4
5574 * cdef object __pyx_PickleError
5575 * cdef object __pyx_result
5576 * if __pyx_checksum != 0x086441e: # <<<<<<<<<<<<<<
5577 * from pickle import PickleError as __pyx_PickleError
5578 * raise __pyx_PickleError("Incompatible checksums (%s vs 0x086441e = (logLR_dict))" % __pyx_checksum)
5580 __pyx_t_1
= ((__pyx_v___pyx_checksum
!= 0x086441e) != 0);
5583 /* "(tree fragment)":5
5584 * cdef object __pyx_result
5585 * if __pyx_checksum != 0x086441e:
5586 * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
5587 * raise __pyx_PickleError("Incompatible checksums (%s vs 0x086441e = (logLR_dict))" % __pyx_checksum)
5588 * __pyx_result = LogLR_Sym.__new__(__pyx_type)
5590 __pyx_t_2
= PyList_New(1); if (unlikely(!__pyx_t_2
)) __PYX_ERR(1, 5, __pyx_L1_error
)
5591 __Pyx_GOTREF(__pyx_t_2
);
5592 __Pyx_INCREF(__pyx_n_s_PickleError
);
5593 __Pyx_GIVEREF(__pyx_n_s_PickleError
);
5594 PyList_SET_ITEM(__pyx_t_2
, 0, __pyx_n_s_PickleError
);
5595 __pyx_t_3
= __Pyx_Import(__pyx_n_s_pickle
, __pyx_t_2
, 0); if (unlikely(!__pyx_t_3
)) __PYX_ERR(1, 5, __pyx_L1_error
)
5596 __Pyx_GOTREF(__pyx_t_3
);
5597 __Pyx_DECREF(__pyx_t_2
); __pyx_t_2
= 0;
5598 __pyx_t_2
= __Pyx_ImportFrom(__pyx_t_3
, __pyx_n_s_PickleError
); if (unlikely(!__pyx_t_2
)) __PYX_ERR(1, 5, __pyx_L1_error
)
5599 __Pyx_GOTREF(__pyx_t_2
);
5600 __Pyx_INCREF(__pyx_t_2
);
5601 __pyx_v___pyx_PickleError
= __pyx_t_2
;
5602 __Pyx_DECREF(__pyx_t_2
); __pyx_t_2
= 0;
5603 __Pyx_DECREF(__pyx_t_3
); __pyx_t_3
= 0;
5605 /* "(tree fragment)":6
5606 * if __pyx_checksum != 0x086441e:
5607 * from pickle import PickleError as __pyx_PickleError
5608 * raise __pyx_PickleError("Incompatible checksums (%s vs 0x086441e = (logLR_dict))" % __pyx_checksum) # <<<<<<<<<<<<<<
5609 * __pyx_result = LogLR_Sym.__new__(__pyx_type)
5610 * if __pyx_state is not None:
5612 __pyx_t_2
= __Pyx_PyInt_From_long(__pyx_v___pyx_checksum
); if (unlikely(!__pyx_t_2
)) __PYX_ERR(1, 6, __pyx_L1_error
)
5613 __Pyx_GOTREF(__pyx_t_2
);
5614 __pyx_t_4
= __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x08
, __pyx_t_2
); if (unlikely(!__pyx_t_4
)) __PYX_ERR(1, 6, __pyx_L1_error
)
5615 __Pyx_GOTREF(__pyx_t_4
);
5616 __Pyx_DECREF(__pyx_t_2
); __pyx_t_2
= 0;
5617 __Pyx_INCREF(__pyx_v___pyx_PickleError
);
5618 __pyx_t_2
= __pyx_v___pyx_PickleError
; __pyx_t_5
= NULL
;
5619 if (CYTHON_UNPACK_METHODS
&& unlikely(PyMethod_Check(__pyx_t_2
))) {
5620 __pyx_t_5
= PyMethod_GET_SELF(__pyx_t_2
);
5621 if (likely(__pyx_t_5
)) {
5622 PyObject
* function
= PyMethod_GET_FUNCTION(__pyx_t_2
);
5623 __Pyx_INCREF(__pyx_t_5
);
5624 __Pyx_INCREF(function
);
5625 __Pyx_DECREF_SET(__pyx_t_2
, function
);
5628 __pyx_t_3
= (__pyx_t_5
) ? __Pyx_PyObject_Call2Args(__pyx_t_2
, __pyx_t_5
, __pyx_t_4
) : __Pyx_PyObject_CallOneArg(__pyx_t_2
, __pyx_t_4
);
5629 __Pyx_XDECREF(__pyx_t_5
); __pyx_t_5
= 0;
5630 __Pyx_DECREF(__pyx_t_4
); __pyx_t_4
= 0;
5631 if (unlikely(!__pyx_t_3
)) __PYX_ERR(1, 6, __pyx_L1_error
)
5632 __Pyx_GOTREF(__pyx_t_3
);
5633 __Pyx_DECREF(__pyx_t_2
); __pyx_t_2
= 0;
5634 __Pyx_Raise(__pyx_t_3
, 0, 0, 0);
5635 __Pyx_DECREF(__pyx_t_3
); __pyx_t_3
= 0;
5636 __PYX_ERR(1, 6, __pyx_L1_error
)
5638 /* "(tree fragment)":4
5639 * cdef object __pyx_PickleError
5640 * cdef object __pyx_result
5641 * if __pyx_checksum != 0x086441e: # <<<<<<<<<<<<<<
5642 * from pickle import PickleError as __pyx_PickleError
5643 * raise __pyx_PickleError("Incompatible checksums (%s vs 0x086441e = (logLR_dict))" % __pyx_checksum)
5647 /* "(tree fragment)":7
5648 * from pickle import PickleError as __pyx_PickleError
5649 * raise __pyx_PickleError("Incompatible checksums (%s vs 0x086441e = (logLR_dict))" % __pyx_checksum)
5650 * __pyx_result = LogLR_Sym.__new__(__pyx_type) # <<<<<<<<<<<<<<
5651 * if __pyx_state is not None:
5652 * __pyx_unpickle_LogLR_Sym__set_state(<LogLR_Sym> __pyx_result, __pyx_state)
5654 __pyx_t_2
= __Pyx_PyObject_GetAttrStr(((PyObject
*)__pyx_ptype_5MACS2_10Statistics_LogLR_Sym
), __pyx_n_s_new
); if (unlikely(!__pyx_t_2
)) __PYX_ERR(1, 7, __pyx_L1_error
)
5655 __Pyx_GOTREF(__pyx_t_2
);
5657 if (CYTHON_UNPACK_METHODS
&& likely(PyMethod_Check(__pyx_t_2
))) {
5658 __pyx_t_4
= PyMethod_GET_SELF(__pyx_t_2
);
5659 if (likely(__pyx_t_4
)) {
5660 PyObject
* function
= PyMethod_GET_FUNCTION(__pyx_t_2
);
5661 __Pyx_INCREF(__pyx_t_4
);
5662 __Pyx_INCREF(function
);
5663 __Pyx_DECREF_SET(__pyx_t_2
, function
);
5666 __pyx_t_3
= (__pyx_t_4
) ? __Pyx_PyObject_Call2Args(__pyx_t_2
, __pyx_t_4
, __pyx_v___pyx_type
) : __Pyx_PyObject_CallOneArg(__pyx_t_2
, __pyx_v___pyx_type
);
5667 __Pyx_XDECREF(__pyx_t_4
); __pyx_t_4
= 0;
5668 if (unlikely(!__pyx_t_3
)) __PYX_ERR(1, 7, __pyx_L1_error
)
5669 __Pyx_GOTREF(__pyx_t_3
);
5670 __Pyx_DECREF(__pyx_t_2
); __pyx_t_2
= 0;
5671 __pyx_v___pyx_result
= __pyx_t_3
;
5674 /* "(tree fragment)":8
5675 * raise __pyx_PickleError("Incompatible checksums (%s vs 0x086441e = (logLR_dict))" % __pyx_checksum)
5676 * __pyx_result = LogLR_Sym.__new__(__pyx_type)
5677 * if __pyx_state is not None: # <<<<<<<<<<<<<<
5678 * __pyx_unpickle_LogLR_Sym__set_state(<LogLR_Sym> __pyx_result, __pyx_state)
5679 * return __pyx_result
5681 __pyx_t_1
= (__pyx_v___pyx_state
!= Py_None
);
5682 __pyx_t_6
= (__pyx_t_1
!= 0);
5685 /* "(tree fragment)":9
5686 * __pyx_result = LogLR_Sym.__new__(__pyx_type)
5687 * if __pyx_state is not None:
5688 * __pyx_unpickle_LogLR_Sym__set_state(<LogLR_Sym> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
5689 * return __pyx_result
5690 * cdef __pyx_unpickle_LogLR_Sym__set_state(LogLR_Sym __pyx_result, tuple __pyx_state):
5692 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state
))||((__pyx_v___pyx_state
) == Py_None
)||(PyErr_Format(PyExc_TypeError
, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state
)->tp_name
), 0))) __PYX_ERR(1, 9, __pyx_L1_error
)
5693 __pyx_t_3
= __pyx_f_5MACS2_10Statistics___pyx_unpickle_LogLR_Sym__set_state(((struct __pyx_obj_5MACS2_10Statistics_LogLR_Sym
*)__pyx_v___pyx_result
), ((PyObject
*)__pyx_v___pyx_state
)); if (unlikely(!__pyx_t_3
)) __PYX_ERR(1, 9, __pyx_L1_error
)
5694 __Pyx_GOTREF(__pyx_t_3
);
5695 __Pyx_DECREF(__pyx_t_3
); __pyx_t_3
= 0;
5697 /* "(tree fragment)":8
5698 * raise __pyx_PickleError("Incompatible checksums (%s vs 0x086441e = (logLR_dict))" % __pyx_checksum)
5699 * __pyx_result = LogLR_Sym.__new__(__pyx_type)
5700 * if __pyx_state is not None: # <<<<<<<<<<<<<<
5701 * __pyx_unpickle_LogLR_Sym__set_state(<LogLR_Sym> __pyx_result, __pyx_state)
5702 * return __pyx_result
5706 /* "(tree fragment)":10
5707 * if __pyx_state is not None:
5708 * __pyx_unpickle_LogLR_Sym__set_state(<LogLR_Sym> __pyx_result, __pyx_state)
5709 * return __pyx_result # <<<<<<<<<<<<<<
5710 * cdef __pyx_unpickle_LogLR_Sym__set_state(LogLR_Sym __pyx_result, tuple __pyx_state):
5711 * __pyx_result.logLR_dict = __pyx_state[0]
5713 __Pyx_XDECREF(__pyx_r
);
5714 __Pyx_INCREF(__pyx_v___pyx_result
);
5715 __pyx_r
= __pyx_v___pyx_result
;
5718 /* "(tree fragment)":1
5719 * def __pyx_unpickle_LogLR_Sym(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
5720 * cdef object __pyx_PickleError
5721 * cdef object __pyx_result
5724 /* function exit code */
5726 __Pyx_XDECREF(__pyx_t_2
);
5727 __Pyx_XDECREF(__pyx_t_3
);
5728 __Pyx_XDECREF(__pyx_t_4
);
5729 __Pyx_XDECREF(__pyx_t_5
);
5730 __Pyx_AddTraceback("MACS2.Statistics.__pyx_unpickle_LogLR_Sym", __pyx_clineno
, __pyx_lineno
, __pyx_filename
);
5733 __Pyx_XDECREF(__pyx_v___pyx_PickleError
);
5734 __Pyx_XDECREF(__pyx_v___pyx_result
);
5735 __Pyx_XGIVEREF(__pyx_r
);
5736 __Pyx_TraceReturn(__pyx_r
, 0);
5737 __Pyx_RefNannyFinishContext();
5741 /* "(tree fragment)":11
5742 * __pyx_unpickle_LogLR_Sym__set_state(<LogLR_Sym> __pyx_result, __pyx_state)
5743 * return __pyx_result
5744 * cdef __pyx_unpickle_LogLR_Sym__set_state(LogLR_Sym __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
5745 * __pyx_result.logLR_dict = __pyx_state[0]
5746 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
5749 static PyObject
*__pyx_f_5MACS2_10Statistics___pyx_unpickle_LogLR_Sym__set_state(struct __pyx_obj_5MACS2_10Statistics_LogLR_Sym
*__pyx_v___pyx_result
, PyObject
*__pyx_v___pyx_state
) {
5750 PyObject
*__pyx_r
= NULL
;
5751 __Pyx_TraceDeclarations
5752 __Pyx_RefNannyDeclarations
5753 PyObject
*__pyx_t_1
= NULL
;
5755 Py_ssize_t __pyx_t_3
;
5758 PyObject
*__pyx_t_6
= NULL
;
5759 PyObject
*__pyx_t_7
= NULL
;
5760 PyObject
*__pyx_t_8
= NULL
;
5761 __Pyx_RefNannySetupContext("__pyx_unpickle_LogLR_Sym__set_state", 0);
5762 __Pyx_TraceCall("__pyx_unpickle_LogLR_Sym__set_state", __pyx_f
[1], 11, 0, __PYX_ERR(1, 11, __pyx_L1_error
));
5764 /* "(tree fragment)":12
5765 * return __pyx_result
5766 * cdef __pyx_unpickle_LogLR_Sym__set_state(LogLR_Sym __pyx_result, tuple __pyx_state):
5767 * __pyx_result.logLR_dict = __pyx_state[0] # <<<<<<<<<<<<<<
5768 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
5769 * __pyx_result.__dict__.update(__pyx_state[1])
5771 if (unlikely(__pyx_v___pyx_state
== Py_None
)) {
5772 PyErr_SetString(PyExc_TypeError
, "'NoneType' object is not subscriptable");
5773 __PYX_ERR(1, 12, __pyx_L1_error
)
5775 __pyx_t_1
= __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state
, 0, long, 1, __Pyx_PyInt_From_long
, 0, 0, 1); if (unlikely(!__pyx_t_1
)) __PYX_ERR(1, 12, __pyx_L1_error
)
5776 __Pyx_GOTREF(__pyx_t_1
);
5777 if (!(likely(PyDict_CheckExact(__pyx_t_1
))||((__pyx_t_1
) == Py_None
)||(PyErr_Format(PyExc_TypeError
, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1
)->tp_name
), 0))) __PYX_ERR(1, 12, __pyx_L1_error
)
5778 __Pyx_GIVEREF(__pyx_t_1
);
5779 __Pyx_GOTREF(__pyx_v___pyx_result
->logLR_dict
);
5780 __Pyx_DECREF(__pyx_v___pyx_result
->logLR_dict
);
5781 __pyx_v___pyx_result
->logLR_dict
= ((PyObject
*)__pyx_t_1
);
5784 /* "(tree fragment)":13
5785 * cdef __pyx_unpickle_LogLR_Sym__set_state(LogLR_Sym __pyx_result, tuple __pyx_state):
5786 * __pyx_result.logLR_dict = __pyx_state[0]
5787 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
5788 * __pyx_result.__dict__.update(__pyx_state[1])
5790 if (unlikely(__pyx_v___pyx_state
== Py_None
)) {
5791 PyErr_SetString(PyExc_TypeError
, "object of type 'NoneType' has no len()");
5792 __PYX_ERR(1, 13, __pyx_L1_error
)
5794 __pyx_t_3
= PyTuple_GET_SIZE(__pyx_v___pyx_state
); if (unlikely(__pyx_t_3
== ((Py_ssize_t
)-1))) __PYX_ERR(1, 13, __pyx_L1_error
)
5795 __pyx_t_4
= ((__pyx_t_3
> 1) != 0);
5798 __pyx_t_2
= __pyx_t_4
;
5799 goto __pyx_L4_bool_binop_done
;
5801 __pyx_t_4
= __Pyx_HasAttr(((PyObject
*)__pyx_v___pyx_result
), __pyx_n_s_dict
); if (unlikely(__pyx_t_4
== ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error
)
5802 __pyx_t_5
= (__pyx_t_4
!= 0);
5803 __pyx_t_2
= __pyx_t_5
;
5804 __pyx_L4_bool_binop_done
:;
5807 /* "(tree fragment)":14
5808 * __pyx_result.logLR_dict = __pyx_state[0]
5809 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
5810 * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<<
5812 __pyx_t_6
= __Pyx_PyObject_GetAttrStr(((PyObject
*)__pyx_v___pyx_result
), __pyx_n_s_dict
); if (unlikely(!__pyx_t_6
)) __PYX_ERR(1, 14, __pyx_L1_error
)
5813 __Pyx_GOTREF(__pyx_t_6
);
5814 __pyx_t_7
= __Pyx_PyObject_GetAttrStr(__pyx_t_6
, __pyx_n_s_update
); if (unlikely(!__pyx_t_7
)) __PYX_ERR(1, 14, __pyx_L1_error
)
5815 __Pyx_GOTREF(__pyx_t_7
);
5816 __Pyx_DECREF(__pyx_t_6
); __pyx_t_6
= 0;
5817 if (unlikely(__pyx_v___pyx_state
== Py_None
)) {
5818 PyErr_SetString(PyExc_TypeError
, "'NoneType' object is not subscriptable");
5819 __PYX_ERR(1, 14, __pyx_L1_error
)
5821 __pyx_t_6
= __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state
, 1, long, 1, __Pyx_PyInt_From_long
, 0, 0, 1); if (unlikely(!__pyx_t_6
)) __PYX_ERR(1, 14, __pyx_L1_error
)
5822 __Pyx_GOTREF(__pyx_t_6
);
5824 if (CYTHON_UNPACK_METHODS
&& likely(PyMethod_Check(__pyx_t_7
))) {
5825 __pyx_t_8
= PyMethod_GET_SELF(__pyx_t_7
);
5826 if (likely(__pyx_t_8
)) {
5827 PyObject
* function
= PyMethod_GET_FUNCTION(__pyx_t_7
);
5828 __Pyx_INCREF(__pyx_t_8
);
5829 __Pyx_INCREF(function
);
5830 __Pyx_DECREF_SET(__pyx_t_7
, function
);
5833 __pyx_t_1
= (__pyx_t_8
) ? __Pyx_PyObject_Call2Args(__pyx_t_7
, __pyx_t_8
, __pyx_t_6
) : __Pyx_PyObject_CallOneArg(__pyx_t_7
, __pyx_t_6
);
5834 __Pyx_XDECREF(__pyx_t_8
); __pyx_t_8
= 0;
5835 __Pyx_DECREF(__pyx_t_6
); __pyx_t_6
= 0;
5836 if (unlikely(!__pyx_t_1
)) __PYX_ERR(1, 14, __pyx_L1_error
)
5837 __Pyx_GOTREF(__pyx_t_1
);
5838 __Pyx_DECREF(__pyx_t_7
); __pyx_t_7
= 0;
5839 __Pyx_DECREF(__pyx_t_1
); __pyx_t_1
= 0;
5841 /* "(tree fragment)":13
5842 * cdef __pyx_unpickle_LogLR_Sym__set_state(LogLR_Sym __pyx_result, tuple __pyx_state):
5843 * __pyx_result.logLR_dict = __pyx_state[0]
5844 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
5845 * __pyx_result.__dict__.update(__pyx_state[1])
5849 /* "(tree fragment)":11
5850 * __pyx_unpickle_LogLR_Sym__set_state(<LogLR_Sym> __pyx_result, __pyx_state)
5851 * return __pyx_result
5852 * cdef __pyx_unpickle_LogLR_Sym__set_state(LogLR_Sym __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
5853 * __pyx_result.logLR_dict = __pyx_state[0]
5854 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
5857 /* function exit code */
5858 __pyx_r
= Py_None
; __Pyx_INCREF(Py_None
);
5861 __Pyx_XDECREF(__pyx_t_1
);
5862 __Pyx_XDECREF(__pyx_t_6
);
5863 __Pyx_XDECREF(__pyx_t_7
);
5864 __Pyx_XDECREF(__pyx_t_8
);
5865 __Pyx_AddTraceback("MACS2.Statistics.__pyx_unpickle_LogLR_Sym__set_state", __pyx_clineno
, __pyx_lineno
, __pyx_filename
);
5868 __Pyx_XGIVEREF(__pyx_r
);
5869 __Pyx_TraceReturn(__pyx_r
, 0);
5870 __Pyx_RefNannyFinishContext();
5874 /* "(tree fragment)":1
5875 * def __pyx_unpickle_LogLR_Diff(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
5876 * cdef object __pyx_PickleError
5877 * cdef object __pyx_result
5880 /* Python wrapper */
5881 static PyObject
*__pyx_pw_5MACS2_10Statistics_7__pyx_unpickle_LogLR_Diff(PyObject
*__pyx_self
, PyObject
*__pyx_args
, PyObject
*__pyx_kwds
); /*proto*/
5882 static PyMethodDef __pyx_mdef_5MACS2_10Statistics_7__pyx_unpickle_LogLR_Diff
= {"__pyx_unpickle_LogLR_Diff", (PyCFunction
)(void*)(PyCFunctionWithKeywords
)__pyx_pw_5MACS2_10Statistics_7__pyx_unpickle_LogLR_Diff
, METH_VARARGS
|METH_KEYWORDS
, 0};
5883 static PyObject
*__pyx_pw_5MACS2_10Statistics_7__pyx_unpickle_LogLR_Diff(PyObject
*__pyx_self
, PyObject
*__pyx_args
, PyObject
*__pyx_kwds
) {
5884 PyObject
*__pyx_v___pyx_type
= 0;
5885 long __pyx_v___pyx_checksum
;
5886 PyObject
*__pyx_v___pyx_state
= 0;
5887 PyObject
*__pyx_r
= 0;
5888 __Pyx_RefNannyDeclarations
5889 __Pyx_RefNannySetupContext("__pyx_unpickle_LogLR_Diff (wrapper)", 0);
5891 static PyObject
**__pyx_pyargnames
[] = {&__pyx_n_s_pyx_type
,&__pyx_n_s_pyx_checksum
,&__pyx_n_s_pyx_state
,0};
5892 PyObject
* values
[3] = {0,0,0};
5893 if (unlikely(__pyx_kwds
)) {
5895 const Py_ssize_t pos_args
= PyTuple_GET_SIZE(__pyx_args
);
5897 case 3: values
[2] = PyTuple_GET_ITEM(__pyx_args
, 2);
5899 case 2: values
[1] = PyTuple_GET_ITEM(__pyx_args
, 1);
5901 case 1: values
[0] = PyTuple_GET_ITEM(__pyx_args
, 0);
5904 default: goto __pyx_L5_argtuple_error
;
5906 kw_args
= PyDict_Size(__pyx_kwds
);
5909 if (likely((values
[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds
, __pyx_n_s_pyx_type
)) != 0)) kw_args
--;
5910 else goto __pyx_L5_argtuple_error
;
5913 if (likely((values
[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds
, __pyx_n_s_pyx_checksum
)) != 0)) kw_args
--;
5915 __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_LogLR_Diff", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error
)
5919 if (likely((values
[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds
, __pyx_n_s_pyx_state
)) != 0)) kw_args
--;
5921 __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_LogLR_Diff", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error
)
5924 if (unlikely(kw_args
> 0)) {
5925 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds
, __pyx_pyargnames
, 0, values
, pos_args
, "__pyx_unpickle_LogLR_Diff") < 0)) __PYX_ERR(1, 1, __pyx_L3_error
)
5927 } else if (PyTuple_GET_SIZE(__pyx_args
) != 3) {
5928 goto __pyx_L5_argtuple_error
;
5930 values
[0] = PyTuple_GET_ITEM(__pyx_args
, 0);
5931 values
[1] = PyTuple_GET_ITEM(__pyx_args
, 1);
5932 values
[2] = PyTuple_GET_ITEM(__pyx_args
, 2);
5934 __pyx_v___pyx_type
= values
[0];
5935 __pyx_v___pyx_checksum
= __Pyx_PyInt_As_long(values
[1]); if (unlikely((__pyx_v___pyx_checksum
== (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error
)
5936 __pyx_v___pyx_state
= values
[2];
5938 goto __pyx_L4_argument_unpacking_done
;
5939 __pyx_L5_argtuple_error
:;
5940 __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_LogLR_Diff", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args
)); __PYX_ERR(1, 1, __pyx_L3_error
)
5942 __Pyx_AddTraceback("MACS2.Statistics.__pyx_unpickle_LogLR_Diff", __pyx_clineno
, __pyx_lineno
, __pyx_filename
);
5943 __Pyx_RefNannyFinishContext();
5945 __pyx_L4_argument_unpacking_done
:;
5946 __pyx_r
= __pyx_pf_5MACS2_10Statistics_6__pyx_unpickle_LogLR_Diff(__pyx_self
, __pyx_v___pyx_type
, __pyx_v___pyx_checksum
, __pyx_v___pyx_state
);
5948 /* function exit code */
5949 __Pyx_RefNannyFinishContext();
5953 static PyObject
*__pyx_pf_5MACS2_10Statistics_6__pyx_unpickle_LogLR_Diff(CYTHON_UNUSED PyObject
*__pyx_self
, PyObject
*__pyx_v___pyx_type
, long __pyx_v___pyx_checksum
, PyObject
*__pyx_v___pyx_state
) {
5954 PyObject
*__pyx_v___pyx_PickleError
= 0;
5955 PyObject
*__pyx_v___pyx_result
= 0;
5956 PyObject
*__pyx_r
= NULL
;
5957 __Pyx_TraceDeclarations
5958 __Pyx_RefNannyDeclarations
5960 PyObject
*__pyx_t_2
= NULL
;
5961 PyObject
*__pyx_t_3
= NULL
;
5962 PyObject
*__pyx_t_4
= NULL
;
5963 PyObject
*__pyx_t_5
= NULL
;
5965 __Pyx_TraceFrameInit(__pyx_codeobj__4
)
5966 __Pyx_RefNannySetupContext("__pyx_unpickle_LogLR_Diff", 0);
5967 __Pyx_TraceCall("__pyx_unpickle_LogLR_Diff", __pyx_f
[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error
));
5969 /* "(tree fragment)":4
5970 * cdef object __pyx_PickleError
5971 * cdef object __pyx_result
5972 * if __pyx_checksum != 0x086441e: # <<<<<<<<<<<<<<
5973 * from pickle import PickleError as __pyx_PickleError
5974 * raise __pyx_PickleError("Incompatible checksums (%s vs 0x086441e = (logLR_dict))" % __pyx_checksum)
5976 __pyx_t_1
= ((__pyx_v___pyx_checksum
!= 0x086441e) != 0);
5979 /* "(tree fragment)":5
5980 * cdef object __pyx_result
5981 * if __pyx_checksum != 0x086441e:
5982 * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
5983 * raise __pyx_PickleError("Incompatible checksums (%s vs 0x086441e = (logLR_dict))" % __pyx_checksum)
5984 * __pyx_result = LogLR_Diff.__new__(__pyx_type)
5986 __pyx_t_2
= PyList_New(1); if (unlikely(!__pyx_t_2
)) __PYX_ERR(1, 5, __pyx_L1_error
)
5987 __Pyx_GOTREF(__pyx_t_2
);
5988 __Pyx_INCREF(__pyx_n_s_PickleError
);
5989 __Pyx_GIVEREF(__pyx_n_s_PickleError
);
5990 PyList_SET_ITEM(__pyx_t_2
, 0, __pyx_n_s_PickleError
);
5991 __pyx_t_3
= __Pyx_Import(__pyx_n_s_pickle
, __pyx_t_2
, 0); if (unlikely(!__pyx_t_3
)) __PYX_ERR(1, 5, __pyx_L1_error
)
5992 __Pyx_GOTREF(__pyx_t_3
);
5993 __Pyx_DECREF(__pyx_t_2
); __pyx_t_2
= 0;
5994 __pyx_t_2
= __Pyx_ImportFrom(__pyx_t_3
, __pyx_n_s_PickleError
); if (unlikely(!__pyx_t_2
)) __PYX_ERR(1, 5, __pyx_L1_error
)
5995 __Pyx_GOTREF(__pyx_t_2
);
5996 __Pyx_INCREF(__pyx_t_2
);
5997 __pyx_v___pyx_PickleError
= __pyx_t_2
;
5998 __Pyx_DECREF(__pyx_t_2
); __pyx_t_2
= 0;
5999 __Pyx_DECREF(__pyx_t_3
); __pyx_t_3
= 0;
6001 /* "(tree fragment)":6
6002 * if __pyx_checksum != 0x086441e:
6003 * from pickle import PickleError as __pyx_PickleError
6004 * raise __pyx_PickleError("Incompatible checksums (%s vs 0x086441e = (logLR_dict))" % __pyx_checksum) # <<<<<<<<<<<<<<
6005 * __pyx_result = LogLR_Diff.__new__(__pyx_type)
6006 * if __pyx_state is not None:
6008 __pyx_t_2
= __Pyx_PyInt_From_long(__pyx_v___pyx_checksum
); if (unlikely(!__pyx_t_2
)) __PYX_ERR(1, 6, __pyx_L1_error
)
6009 __Pyx_GOTREF(__pyx_t_2
);
6010 __pyx_t_4
= __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x08
, __pyx_t_2
); if (unlikely(!__pyx_t_4
)) __PYX_ERR(1, 6, __pyx_L1_error
)
6011 __Pyx_GOTREF(__pyx_t_4
);
6012 __Pyx_DECREF(__pyx_t_2
); __pyx_t_2
= 0;
6013 __Pyx_INCREF(__pyx_v___pyx_PickleError
);
6014 __pyx_t_2
= __pyx_v___pyx_PickleError
; __pyx_t_5
= NULL
;
6015 if (CYTHON_UNPACK_METHODS
&& unlikely(PyMethod_Check(__pyx_t_2
))) {
6016 __pyx_t_5
= PyMethod_GET_SELF(__pyx_t_2
);
6017 if (likely(__pyx_t_5
)) {
6018 PyObject
* function
= PyMethod_GET_FUNCTION(__pyx_t_2
);
6019 __Pyx_INCREF(__pyx_t_5
);
6020 __Pyx_INCREF(function
);
6021 __Pyx_DECREF_SET(__pyx_t_2
, function
);
6024 __pyx_t_3
= (__pyx_t_5
) ? __Pyx_PyObject_Call2Args(__pyx_t_2
, __pyx_t_5
, __pyx_t_4
) : __Pyx_PyObject_CallOneArg(__pyx_t_2
, __pyx_t_4
);
6025 __Pyx_XDECREF(__pyx_t_5
); __pyx_t_5
= 0;
6026 __Pyx_DECREF(__pyx_t_4
); __pyx_t_4
= 0;
6027 if (unlikely(!__pyx_t_3
)) __PYX_ERR(1, 6, __pyx_L1_error
)
6028 __Pyx_GOTREF(__pyx_t_3
);
6029 __Pyx_DECREF(__pyx_t_2
); __pyx_t_2
= 0;
6030 __Pyx_Raise(__pyx_t_3
, 0, 0, 0);
6031 __Pyx_DECREF(__pyx_t_3
); __pyx_t_3
= 0;
6032 __PYX_ERR(1, 6, __pyx_L1_error
)
6034 /* "(tree fragment)":4
6035 * cdef object __pyx_PickleError
6036 * cdef object __pyx_result
6037 * if __pyx_checksum != 0x086441e: # <<<<<<<<<<<<<<
6038 * from pickle import PickleError as __pyx_PickleError
6039 * raise __pyx_PickleError("Incompatible checksums (%s vs 0x086441e = (logLR_dict))" % __pyx_checksum)
6043 /* "(tree fragment)":7
6044 * from pickle import PickleError as __pyx_PickleError
6045 * raise __pyx_PickleError("Incompatible checksums (%s vs 0x086441e = (logLR_dict))" % __pyx_checksum)
6046 * __pyx_result = LogLR_Diff.__new__(__pyx_type) # <<<<<<<<<<<<<<
6047 * if __pyx_state is not None:
6048 * __pyx_unpickle_LogLR_Diff__set_state(<LogLR_Diff> __pyx_result, __pyx_state)
6050 __pyx_t_2
= __Pyx_PyObject_GetAttrStr(((PyObject
*)__pyx_ptype_5MACS2_10Statistics_LogLR_Diff
), __pyx_n_s_new
); if (unlikely(!__pyx_t_2
)) __PYX_ERR(1, 7, __pyx_L1_error
)
6051 __Pyx_GOTREF(__pyx_t_2
);
6053 if (CYTHON_UNPACK_METHODS
&& likely(PyMethod_Check(__pyx_t_2
))) {
6054 __pyx_t_4
= PyMethod_GET_SELF(__pyx_t_2
);
6055 if (likely(__pyx_t_4
)) {
6056 PyObject
* function
= PyMethod_GET_FUNCTION(__pyx_t_2
);
6057 __Pyx_INCREF(__pyx_t_4
);
6058 __Pyx_INCREF(function
);
6059 __Pyx_DECREF_SET(__pyx_t_2
, function
);
6062 __pyx_t_3
= (__pyx_t_4
) ? __Pyx_PyObject_Call2Args(__pyx_t_2
, __pyx_t_4
, __pyx_v___pyx_type
) : __Pyx_PyObject_CallOneArg(__pyx_t_2
, __pyx_v___pyx_type
);
6063 __Pyx_XDECREF(__pyx_t_4
); __pyx_t_4
= 0;
6064 if (unlikely(!__pyx_t_3
)) __PYX_ERR(1, 7, __pyx_L1_error
)
6065 __Pyx_GOTREF(__pyx_t_3
);
6066 __Pyx_DECREF(__pyx_t_2
); __pyx_t_2
= 0;
6067 __pyx_v___pyx_result
= __pyx_t_3
;
6070 /* "(tree fragment)":8
6071 * raise __pyx_PickleError("Incompatible checksums (%s vs 0x086441e = (logLR_dict))" % __pyx_checksum)
6072 * __pyx_result = LogLR_Diff.__new__(__pyx_type)
6073 * if __pyx_state is not None: # <<<<<<<<<<<<<<
6074 * __pyx_unpickle_LogLR_Diff__set_state(<LogLR_Diff> __pyx_result, __pyx_state)
6075 * return __pyx_result
6077 __pyx_t_1
= (__pyx_v___pyx_state
!= Py_None
);
6078 __pyx_t_6
= (__pyx_t_1
!= 0);
6081 /* "(tree fragment)":9
6082 * __pyx_result = LogLR_Diff.__new__(__pyx_type)
6083 * if __pyx_state is not None:
6084 * __pyx_unpickle_LogLR_Diff__set_state(<LogLR_Diff> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
6085 * return __pyx_result
6086 * cdef __pyx_unpickle_LogLR_Diff__set_state(LogLR_Diff __pyx_result, tuple __pyx_state):
6088 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state
))||((__pyx_v___pyx_state
) == Py_None
)||(PyErr_Format(PyExc_TypeError
, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state
)->tp_name
), 0))) __PYX_ERR(1, 9, __pyx_L1_error
)
6089 __pyx_t_3
= __pyx_f_5MACS2_10Statistics___pyx_unpickle_LogLR_Diff__set_state(((struct __pyx_obj_5MACS2_10Statistics_LogLR_Diff
*)__pyx_v___pyx_result
), ((PyObject
*)__pyx_v___pyx_state
)); if (unlikely(!__pyx_t_3
)) __PYX_ERR(1, 9, __pyx_L1_error
)
6090 __Pyx_GOTREF(__pyx_t_3
);
6091 __Pyx_DECREF(__pyx_t_3
); __pyx_t_3
= 0;
6093 /* "(tree fragment)":8
6094 * raise __pyx_PickleError("Incompatible checksums (%s vs 0x086441e = (logLR_dict))" % __pyx_checksum)
6095 * __pyx_result = LogLR_Diff.__new__(__pyx_type)
6096 * if __pyx_state is not None: # <<<<<<<<<<<<<<
6097 * __pyx_unpickle_LogLR_Diff__set_state(<LogLR_Diff> __pyx_result, __pyx_state)
6098 * return __pyx_result
6102 /* "(tree fragment)":10
6103 * if __pyx_state is not None:
6104 * __pyx_unpickle_LogLR_Diff__set_state(<LogLR_Diff> __pyx_result, __pyx_state)
6105 * return __pyx_result # <<<<<<<<<<<<<<
6106 * cdef __pyx_unpickle_LogLR_Diff__set_state(LogLR_Diff __pyx_result, tuple __pyx_state):
6107 * __pyx_result.logLR_dict = __pyx_state[0]
6109 __Pyx_XDECREF(__pyx_r
);
6110 __Pyx_INCREF(__pyx_v___pyx_result
);
6111 __pyx_r
= __pyx_v___pyx_result
;
6114 /* "(tree fragment)":1
6115 * def __pyx_unpickle_LogLR_Diff(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
6116 * cdef object __pyx_PickleError
6117 * cdef object __pyx_result
6120 /* function exit code */
6122 __Pyx_XDECREF(__pyx_t_2
);
6123 __Pyx_XDECREF(__pyx_t_3
);
6124 __Pyx_XDECREF(__pyx_t_4
);
6125 __Pyx_XDECREF(__pyx_t_5
);
6126 __Pyx_AddTraceback("MACS2.Statistics.__pyx_unpickle_LogLR_Diff", __pyx_clineno
, __pyx_lineno
, __pyx_filename
);
6129 __Pyx_XDECREF(__pyx_v___pyx_PickleError
);
6130 __Pyx_XDECREF(__pyx_v___pyx_result
);
6131 __Pyx_XGIVEREF(__pyx_r
);
6132 __Pyx_TraceReturn(__pyx_r
, 0);
6133 __Pyx_RefNannyFinishContext();
6137 /* "(tree fragment)":11
6138 * __pyx_unpickle_LogLR_Diff__set_state(<LogLR_Diff> __pyx_result, __pyx_state)
6139 * return __pyx_result
6140 * cdef __pyx_unpickle_LogLR_Diff__set_state(LogLR_Diff __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
6141 * __pyx_result.logLR_dict = __pyx_state[0]
6142 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
6145 static PyObject
*__pyx_f_5MACS2_10Statistics___pyx_unpickle_LogLR_Diff__set_state(struct __pyx_obj_5MACS2_10Statistics_LogLR_Diff
*__pyx_v___pyx_result
, PyObject
*__pyx_v___pyx_state
) {
6146 PyObject
*__pyx_r
= NULL
;
6147 __Pyx_TraceDeclarations
6148 __Pyx_RefNannyDeclarations
6149 PyObject
*__pyx_t_1
= NULL
;
6151 Py_ssize_t __pyx_t_3
;
6154 PyObject
*__pyx_t_6
= NULL
;
6155 PyObject
*__pyx_t_7
= NULL
;
6156 PyObject
*__pyx_t_8
= NULL
;
6157 __Pyx_RefNannySetupContext("__pyx_unpickle_LogLR_Diff__set_state", 0);
6158 __Pyx_TraceCall("__pyx_unpickle_LogLR_Diff__set_state", __pyx_f
[1], 11, 0, __PYX_ERR(1, 11, __pyx_L1_error
));
6160 /* "(tree fragment)":12
6161 * return __pyx_result
6162 * cdef __pyx_unpickle_LogLR_Diff__set_state(LogLR_Diff __pyx_result, tuple __pyx_state):
6163 * __pyx_result.logLR_dict = __pyx_state[0] # <<<<<<<<<<<<<<
6164 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
6165 * __pyx_result.__dict__.update(__pyx_state[1])
6167 if (unlikely(__pyx_v___pyx_state
== Py_None
)) {
6168 PyErr_SetString(PyExc_TypeError
, "'NoneType' object is not subscriptable");
6169 __PYX_ERR(1, 12, __pyx_L1_error
)
6171 __pyx_t_1
= __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state
, 0, long, 1, __Pyx_PyInt_From_long
, 0, 0, 1); if (unlikely(!__pyx_t_1
)) __PYX_ERR(1, 12, __pyx_L1_error
)
6172 __Pyx_GOTREF(__pyx_t_1
);
6173 if (!(likely(PyDict_CheckExact(__pyx_t_1
))||((__pyx_t_1
) == Py_None
)||(PyErr_Format(PyExc_TypeError
, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1
)->tp_name
), 0))) __PYX_ERR(1, 12, __pyx_L1_error
)
6174 __Pyx_GIVEREF(__pyx_t_1
);
6175 __Pyx_GOTREF(__pyx_v___pyx_result
->logLR_dict
);
6176 __Pyx_DECREF(__pyx_v___pyx_result
->logLR_dict
);
6177 __pyx_v___pyx_result
->logLR_dict
= ((PyObject
*)__pyx_t_1
);
6180 /* "(tree fragment)":13
6181 * cdef __pyx_unpickle_LogLR_Diff__set_state(LogLR_Diff __pyx_result, tuple __pyx_state):
6182 * __pyx_result.logLR_dict = __pyx_state[0]
6183 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
6184 * __pyx_result.__dict__.update(__pyx_state[1])
6186 if (unlikely(__pyx_v___pyx_state
== Py_None
)) {
6187 PyErr_SetString(PyExc_TypeError
, "object of type 'NoneType' has no len()");
6188 __PYX_ERR(1, 13, __pyx_L1_error
)
6190 __pyx_t_3
= PyTuple_GET_SIZE(__pyx_v___pyx_state
); if (unlikely(__pyx_t_3
== ((Py_ssize_t
)-1))) __PYX_ERR(1, 13, __pyx_L1_error
)
6191 __pyx_t_4
= ((__pyx_t_3
> 1) != 0);
6194 __pyx_t_2
= __pyx_t_4
;
6195 goto __pyx_L4_bool_binop_done
;
6197 __pyx_t_4
= __Pyx_HasAttr(((PyObject
*)__pyx_v___pyx_result
), __pyx_n_s_dict
); if (unlikely(__pyx_t_4
== ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error
)
6198 __pyx_t_5
= (__pyx_t_4
!= 0);
6199 __pyx_t_2
= __pyx_t_5
;
6200 __pyx_L4_bool_binop_done
:;
6203 /* "(tree fragment)":14
6204 * __pyx_result.logLR_dict = __pyx_state[0]
6205 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
6206 * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<<
6208 __pyx_t_6
= __Pyx_PyObject_GetAttrStr(((PyObject
*)__pyx_v___pyx_result
), __pyx_n_s_dict
); if (unlikely(!__pyx_t_6
)) __PYX_ERR(1, 14, __pyx_L1_error
)
6209 __Pyx_GOTREF(__pyx_t_6
);
6210 __pyx_t_7
= __Pyx_PyObject_GetAttrStr(__pyx_t_6
, __pyx_n_s_update
); if (unlikely(!__pyx_t_7
)) __PYX_ERR(1, 14, __pyx_L1_error
)
6211 __Pyx_GOTREF(__pyx_t_7
);
6212 __Pyx_DECREF(__pyx_t_6
); __pyx_t_6
= 0;
6213 if (unlikely(__pyx_v___pyx_state
== Py_None
)) {
6214 PyErr_SetString(PyExc_TypeError
, "'NoneType' object is not subscriptable");
6215 __PYX_ERR(1, 14, __pyx_L1_error
)
6217 __pyx_t_6
= __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state
, 1, long, 1, __Pyx_PyInt_From_long
, 0, 0, 1); if (unlikely(!__pyx_t_6
)) __PYX_ERR(1, 14, __pyx_L1_error
)
6218 __Pyx_GOTREF(__pyx_t_6
);
6220 if (CYTHON_UNPACK_METHODS
&& likely(PyMethod_Check(__pyx_t_7
))) {
6221 __pyx_t_8
= PyMethod_GET_SELF(__pyx_t_7
);
6222 if (likely(__pyx_t_8
)) {
6223 PyObject
* function
= PyMethod_GET_FUNCTION(__pyx_t_7
);
6224 __Pyx_INCREF(__pyx_t_8
);
6225 __Pyx_INCREF(function
);
6226 __Pyx_DECREF_SET(__pyx_t_7
, function
);
6229 __pyx_t_1
= (__pyx_t_8
) ? __Pyx_PyObject_Call2Args(__pyx_t_7
, __pyx_t_8
, __pyx_t_6
) : __Pyx_PyObject_CallOneArg(__pyx_t_7
, __pyx_t_6
);
6230 __Pyx_XDECREF(__pyx_t_8
); __pyx_t_8
= 0;
6231 __Pyx_DECREF(__pyx_t_6
); __pyx_t_6
= 0;
6232 if (unlikely(!__pyx_t_1
)) __PYX_ERR(1, 14, __pyx_L1_error
)
6233 __Pyx_GOTREF(__pyx_t_1
);
6234 __Pyx_DECREF(__pyx_t_7
); __pyx_t_7
= 0;
6235 __Pyx_DECREF(__pyx_t_1
); __pyx_t_1
= 0;
6237 /* "(tree fragment)":13
6238 * cdef __pyx_unpickle_LogLR_Diff__set_state(LogLR_Diff __pyx_result, tuple __pyx_state):
6239 * __pyx_result.logLR_dict = __pyx_state[0]
6240 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
6241 * __pyx_result.__dict__.update(__pyx_state[1])
6245 /* "(tree fragment)":11
6246 * __pyx_unpickle_LogLR_Diff__set_state(<LogLR_Diff> __pyx_result, __pyx_state)
6247 * return __pyx_result
6248 * cdef __pyx_unpickle_LogLR_Diff__set_state(LogLR_Diff __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
6249 * __pyx_result.logLR_dict = __pyx_state[0]
6250 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
6253 /* function exit code */
6254 __pyx_r
= Py_None
; __Pyx_INCREF(Py_None
);
6257 __Pyx_XDECREF(__pyx_t_1
);
6258 __Pyx_XDECREF(__pyx_t_6
);
6259 __Pyx_XDECREF(__pyx_t_7
);
6260 __Pyx_XDECREF(__pyx_t_8
);
6261 __Pyx_AddTraceback("MACS2.Statistics.__pyx_unpickle_LogLR_Diff__set_state", __pyx_clineno
, __pyx_lineno
, __pyx_filename
);
6264 __Pyx_XGIVEREF(__pyx_r
);
6265 __Pyx_TraceReturn(__pyx_r
, 0);
6266 __Pyx_RefNannyFinishContext();
6269 static struct __pyx_vtabstruct_5MACS2_10Statistics_P_Score_Upper_Tail __pyx_vtable_5MACS2_10Statistics_P_Score_Upper_Tail
;
6271 static PyObject
*__pyx_tp_new_5MACS2_10Statistics_P_Score_Upper_Tail(PyTypeObject
*t
, CYTHON_UNUSED PyObject
*a
, CYTHON_UNUSED PyObject
*k
) {
6272 struct __pyx_obj_5MACS2_10Statistics_P_Score_Upper_Tail
*p
;
6274 if (likely((t
->tp_flags
& Py_TPFLAGS_IS_ABSTRACT
) == 0)) {
6275 o
= (*t
->tp_alloc
)(t
, 0);
6277 o
= (PyObject
*) PyBaseObject_Type
.tp_new(t
, __pyx_empty_tuple
, 0);
6279 if (unlikely(!o
)) return 0;
6280 p
= ((struct __pyx_obj_5MACS2_10Statistics_P_Score_Upper_Tail
*)o
);
6281 p
->__pyx_vtab
= __pyx_vtabptr_5MACS2_10Statistics_P_Score_Upper_Tail
;
6282 p
->pscore_dict
= ((PyObject
*)Py_None
); Py_INCREF(Py_None
);
6286 static void __pyx_tp_dealloc_5MACS2_10Statistics_P_Score_Upper_Tail(PyObject
*o
) {
6287 struct __pyx_obj_5MACS2_10Statistics_P_Score_Upper_Tail
*p
= (struct __pyx_obj_5MACS2_10Statistics_P_Score_Upper_Tail
*)o
;
6288 #if CYTHON_USE_TP_FINALIZE
6289 if (unlikely(PyType_HasFeature(Py_TYPE(o
), Py_TPFLAGS_HAVE_FINALIZE
) && Py_TYPE(o
)->tp_finalize
) && !_PyGC_FINALIZED(o
)) {
6290 if (PyObject_CallFinalizerFromDealloc(o
)) return;
6293 PyObject_GC_UnTrack(o
);
6294 Py_CLEAR(p
->pscore_dict
);
6295 (*Py_TYPE(o
)->tp_free
)(o
);
6298 static int __pyx_tp_traverse_5MACS2_10Statistics_P_Score_Upper_Tail(PyObject
*o
, visitproc v
, void *a
) {
6300 struct __pyx_obj_5MACS2_10Statistics_P_Score_Upper_Tail
*p
= (struct __pyx_obj_5MACS2_10Statistics_P_Score_Upper_Tail
*)o
;
6301 if (p
->pscore_dict
) {
6302 e
= (*v
)(p
->pscore_dict
, a
); if (e
) return e
;
6307 static int __pyx_tp_clear_5MACS2_10Statistics_P_Score_Upper_Tail(PyObject
*o
) {
6309 struct __pyx_obj_5MACS2_10Statistics_P_Score_Upper_Tail
*p
= (struct __pyx_obj_5MACS2_10Statistics_P_Score_Upper_Tail
*)o
;
6310 tmp
= ((PyObject
*)p
->pscore_dict
);
6311 p
->pscore_dict
= ((PyObject
*)Py_None
); Py_INCREF(Py_None
);
6316 static PyMethodDef __pyx_methods_5MACS2_10Statistics_P_Score_Upper_Tail
[] = {
6317 {"get_pscore", (PyCFunction
)(void*)(PyCFunctionWithKeywords
)__pyx_pw_5MACS2_10Statistics_18P_Score_Upper_Tail_3get_pscore
, METH_VARARGS
|METH_KEYWORDS
, 0},
6318 {"__reduce_cython__", (PyCFunction
)__pyx_pw_5MACS2_10Statistics_18P_Score_Upper_Tail_5__reduce_cython__
, METH_NOARGS
, 0},
6319 {"__setstate_cython__", (PyCFunction
)__pyx_pw_5MACS2_10Statistics_18P_Score_Upper_Tail_7__setstate_cython__
, METH_O
, 0},
6323 static PyTypeObject __pyx_type_5MACS2_10Statistics_P_Score_Upper_Tail
= {
6324 PyVarObject_HEAD_INIT(0, 0)
6325 "MACS2.Statistics.P_Score_Upper_Tail", /*tp_name*/
6326 sizeof(struct __pyx_obj_5MACS2_10Statistics_P_Score_Upper_Tail
), /*tp_basicsize*/
6328 __pyx_tp_dealloc_5MACS2_10Statistics_P_Score_Upper_Tail
, /*tp_dealloc*/
6332 #if PY_MAJOR_VERSION < 3
6335 #if PY_MAJOR_VERSION >= 3
6340 0, /*tp_as_sequence*/
6341 0, /*tp_as_mapping*/
6348 Py_TPFLAGS_DEFAULT
|Py_TPFLAGS_HAVE_VERSION_TAG
|Py_TPFLAGS_CHECKTYPES
|Py_TPFLAGS_HAVE_NEWBUFFER
|Py_TPFLAGS_BASETYPE
|Py_TPFLAGS_HAVE_GC
, /*tp_flags*/
6349 "Unit to calculate -log10 poisson_CDF of upper tail and cache\n results in a hashtable.\n ", /*tp_doc*/
6350 __pyx_tp_traverse_5MACS2_10Statistics_P_Score_Upper_Tail
, /*tp_traverse*/
6351 __pyx_tp_clear_5MACS2_10Statistics_P_Score_Upper_Tail
, /*tp_clear*/
6352 0, /*tp_richcompare*/
6353 0, /*tp_weaklistoffset*/
6356 __pyx_methods_5MACS2_10Statistics_P_Score_Upper_Tail
, /*tp_methods*/
6363 0, /*tp_dictoffset*/
6364 __pyx_pw_5MACS2_10Statistics_18P_Score_Upper_Tail_1__init__
, /*tp_init*/
6366 __pyx_tp_new_5MACS2_10Statistics_P_Score_Upper_Tail
, /*tp_new*/
6372 0, /*tp_subclasses*/
6375 0, /*tp_version_tag*/
6376 #if PY_VERSION_HEX >= 0x030400a1
6379 #if PY_VERSION_HEX >= 0x030800b1
6380 0, /*tp_vectorcall*/
6383 static struct __pyx_vtabstruct_5MACS2_10Statistics_LogLR_Asym __pyx_vtable_5MACS2_10Statistics_LogLR_Asym
;
6385 static PyObject
*__pyx_tp_new_5MACS2_10Statistics_LogLR_Asym(PyTypeObject
*t
, CYTHON_UNUSED PyObject
*a
, CYTHON_UNUSED PyObject
*k
) {
6386 struct __pyx_obj_5MACS2_10Statistics_LogLR_Asym
*p
;
6388 if (likely((t
->tp_flags
& Py_TPFLAGS_IS_ABSTRACT
) == 0)) {
6389 o
= (*t
->tp_alloc
)(t
, 0);
6391 o
= (PyObject
*) PyBaseObject_Type
.tp_new(t
, __pyx_empty_tuple
, 0);
6393 if (unlikely(!o
)) return 0;
6394 p
= ((struct __pyx_obj_5MACS2_10Statistics_LogLR_Asym
*)o
);
6395 p
->__pyx_vtab
= __pyx_vtabptr_5MACS2_10Statistics_LogLR_Asym
;
6396 p
->logLR_dict
= ((PyObject
*)Py_None
); Py_INCREF(Py_None
);
6400 static void __pyx_tp_dealloc_5MACS2_10Statistics_LogLR_Asym(PyObject
*o
) {
6401 struct __pyx_obj_5MACS2_10Statistics_LogLR_Asym
*p
= (struct __pyx_obj_5MACS2_10Statistics_LogLR_Asym
*)o
;
6402 #if CYTHON_USE_TP_FINALIZE
6403 if (unlikely(PyType_HasFeature(Py_TYPE(o
), Py_TPFLAGS_HAVE_FINALIZE
) && Py_TYPE(o
)->tp_finalize
) && !_PyGC_FINALIZED(o
)) {
6404 if (PyObject_CallFinalizerFromDealloc(o
)) return;
6407 PyObject_GC_UnTrack(o
);
6408 Py_CLEAR(p
->logLR_dict
);
6409 (*Py_TYPE(o
)->tp_free
)(o
);
6412 static int __pyx_tp_traverse_5MACS2_10Statistics_LogLR_Asym(PyObject
*o
, visitproc v
, void *a
) {
6414 struct __pyx_obj_5MACS2_10Statistics_LogLR_Asym
*p
= (struct __pyx_obj_5MACS2_10Statistics_LogLR_Asym
*)o
;
6415 if (p
->logLR_dict
) {
6416 e
= (*v
)(p
->logLR_dict
, a
); if (e
) return e
;
6421 static int __pyx_tp_clear_5MACS2_10Statistics_LogLR_Asym(PyObject
*o
) {
6423 struct __pyx_obj_5MACS2_10Statistics_LogLR_Asym
*p
= (struct __pyx_obj_5MACS2_10Statistics_LogLR_Asym
*)o
;
6424 tmp
= ((PyObject
*)p
->logLR_dict
);
6425 p
->logLR_dict
= ((PyObject
*)Py_None
); Py_INCREF(Py_None
);
6430 static PyMethodDef __pyx_methods_5MACS2_10Statistics_LogLR_Asym
[] = {
6431 {"get_logLR_asym", (PyCFunction
)(void*)(PyCFunctionWithKeywords
)__pyx_pw_5MACS2_10Statistics_10LogLR_Asym_3get_logLR_asym
, METH_VARARGS
|METH_KEYWORDS
, 0},
6432 {"__reduce_cython__", (PyCFunction
)__pyx_pw_5MACS2_10Statistics_10LogLR_Asym_5__reduce_cython__
, METH_NOARGS
, 0},
6433 {"__setstate_cython__", (PyCFunction
)__pyx_pw_5MACS2_10Statistics_10LogLR_Asym_7__setstate_cython__
, METH_O
, 0},
6437 static PyTypeObject __pyx_type_5MACS2_10Statistics_LogLR_Asym
= {
6438 PyVarObject_HEAD_INIT(0, 0)
6439 "MACS2.Statistics.LogLR_Asym", /*tp_name*/
6440 sizeof(struct __pyx_obj_5MACS2_10Statistics_LogLR_Asym
), /*tp_basicsize*/
6442 __pyx_tp_dealloc_5MACS2_10Statistics_LogLR_Asym
, /*tp_dealloc*/
6446 #if PY_MAJOR_VERSION < 3
6449 #if PY_MAJOR_VERSION >= 3
6454 0, /*tp_as_sequence*/
6455 0, /*tp_as_mapping*/
6462 Py_TPFLAGS_DEFAULT
|Py_TPFLAGS_HAVE_VERSION_TAG
|Py_TPFLAGS_CHECKTYPES
|Py_TPFLAGS_HAVE_NEWBUFFER
|Py_TPFLAGS_BASETYPE
|Py_TPFLAGS_HAVE_GC
, /*tp_flags*/
6463 "Unit to calculate asymmetric log likelihood, and cache\n results in a hashtable.\n ", /*tp_doc*/
6464 __pyx_tp_traverse_5MACS2_10Statistics_LogLR_Asym
, /*tp_traverse*/
6465 __pyx_tp_clear_5MACS2_10Statistics_LogLR_Asym
, /*tp_clear*/
6466 0, /*tp_richcompare*/
6467 0, /*tp_weaklistoffset*/
6470 __pyx_methods_5MACS2_10Statistics_LogLR_Asym
, /*tp_methods*/
6477 0, /*tp_dictoffset*/
6478 __pyx_pw_5MACS2_10Statistics_10LogLR_Asym_1__init__
, /*tp_init*/
6480 __pyx_tp_new_5MACS2_10Statistics_LogLR_Asym
, /*tp_new*/
6486 0, /*tp_subclasses*/
6489 0, /*tp_version_tag*/
6490 #if PY_VERSION_HEX >= 0x030400a1
6493 #if PY_VERSION_HEX >= 0x030800b1
6494 0, /*tp_vectorcall*/
6497 static struct __pyx_vtabstruct_5MACS2_10Statistics_LogLR_Sym __pyx_vtable_5MACS2_10Statistics_LogLR_Sym
;
6499 static PyObject
*__pyx_tp_new_5MACS2_10Statistics_LogLR_Sym(PyTypeObject
*t
, CYTHON_UNUSED PyObject
*a
, CYTHON_UNUSED PyObject
*k
) {
6500 struct __pyx_obj_5MACS2_10Statistics_LogLR_Sym
*p
;
6502 if (likely((t
->tp_flags
& Py_TPFLAGS_IS_ABSTRACT
) == 0)) {
6503 o
= (*t
->tp_alloc
)(t
, 0);
6505 o
= (PyObject
*) PyBaseObject_Type
.tp_new(t
, __pyx_empty_tuple
, 0);
6507 if (unlikely(!o
)) return 0;
6508 p
= ((struct __pyx_obj_5MACS2_10Statistics_LogLR_Sym
*)o
);
6509 p
->__pyx_vtab
= __pyx_vtabptr_5MACS2_10Statistics_LogLR_Sym
;
6510 p
->logLR_dict
= ((PyObject
*)Py_None
); Py_INCREF(Py_None
);
6514 static void __pyx_tp_dealloc_5MACS2_10Statistics_LogLR_Sym(PyObject
*o
) {
6515 struct __pyx_obj_5MACS2_10Statistics_LogLR_Sym
*p
= (struct __pyx_obj_5MACS2_10Statistics_LogLR_Sym
*)o
;
6516 #if CYTHON_USE_TP_FINALIZE
6517 if (unlikely(PyType_HasFeature(Py_TYPE(o
), Py_TPFLAGS_HAVE_FINALIZE
) && Py_TYPE(o
)->tp_finalize
) && !_PyGC_FINALIZED(o
)) {
6518 if (PyObject_CallFinalizerFromDealloc(o
)) return;
6521 PyObject_GC_UnTrack(o
);
6522 Py_CLEAR(p
->logLR_dict
);
6523 (*Py_TYPE(o
)->tp_free
)(o
);
6526 static int __pyx_tp_traverse_5MACS2_10Statistics_LogLR_Sym(PyObject
*o
, visitproc v
, void *a
) {
6528 struct __pyx_obj_5MACS2_10Statistics_LogLR_Sym
*p
= (struct __pyx_obj_5MACS2_10Statistics_LogLR_Sym
*)o
;
6529 if (p
->logLR_dict
) {
6530 e
= (*v
)(p
->logLR_dict
, a
); if (e
) return e
;
6535 static int __pyx_tp_clear_5MACS2_10Statistics_LogLR_Sym(PyObject
*o
) {
6537 struct __pyx_obj_5MACS2_10Statistics_LogLR_Sym
*p
= (struct __pyx_obj_5MACS2_10Statistics_LogLR_Sym
*)o
;
6538 tmp
= ((PyObject
*)p
->logLR_dict
);
6539 p
->logLR_dict
= ((PyObject
*)Py_None
); Py_INCREF(Py_None
);
6544 static PyMethodDef __pyx_methods_5MACS2_10Statistics_LogLR_Sym
[] = {
6545 {"get_logLR_sym", (PyCFunction
)(void*)(PyCFunctionWithKeywords
)__pyx_pw_5MACS2_10Statistics_9LogLR_Sym_3get_logLR_sym
, METH_VARARGS
|METH_KEYWORDS
, 0},
6546 {"__reduce_cython__", (PyCFunction
)__pyx_pw_5MACS2_10Statistics_9LogLR_Sym_5__reduce_cython__
, METH_NOARGS
, 0},
6547 {"__setstate_cython__", (PyCFunction
)__pyx_pw_5MACS2_10Statistics_9LogLR_Sym_7__setstate_cython__
, METH_O
, 0},
6551 static PyTypeObject __pyx_type_5MACS2_10Statistics_LogLR_Sym
= {
6552 PyVarObject_HEAD_INIT(0, 0)
6553 "MACS2.Statistics.LogLR_Sym", /*tp_name*/
6554 sizeof(struct __pyx_obj_5MACS2_10Statistics_LogLR_Sym
), /*tp_basicsize*/
6556 __pyx_tp_dealloc_5MACS2_10Statistics_LogLR_Sym
, /*tp_dealloc*/
6560 #if PY_MAJOR_VERSION < 3
6563 #if PY_MAJOR_VERSION >= 3
6568 0, /*tp_as_sequence*/
6569 0, /*tp_as_mapping*/
6576 Py_TPFLAGS_DEFAULT
|Py_TPFLAGS_HAVE_VERSION_TAG
|Py_TPFLAGS_CHECKTYPES
|Py_TPFLAGS_HAVE_NEWBUFFER
|Py_TPFLAGS_BASETYPE
|Py_TPFLAGS_HAVE_GC
, /*tp_flags*/
6577 "Unit to calculate symmetric log likelihood, and cache\n results in a hashtable.\n\n \"symmetric\" means f(x,y) = -f(y,x)\n ", /*tp_doc*/
6578 __pyx_tp_traverse_5MACS2_10Statistics_LogLR_Sym
, /*tp_traverse*/
6579 __pyx_tp_clear_5MACS2_10Statistics_LogLR_Sym
, /*tp_clear*/
6580 0, /*tp_richcompare*/
6581 0, /*tp_weaklistoffset*/
6584 __pyx_methods_5MACS2_10Statistics_LogLR_Sym
, /*tp_methods*/
6591 0, /*tp_dictoffset*/
6592 __pyx_pw_5MACS2_10Statistics_9LogLR_Sym_1__init__
, /*tp_init*/
6594 __pyx_tp_new_5MACS2_10Statistics_LogLR_Sym
, /*tp_new*/
6600 0, /*tp_subclasses*/
6603 0, /*tp_version_tag*/
6604 #if PY_VERSION_HEX >= 0x030400a1
6607 #if PY_VERSION_HEX >= 0x030800b1
6608 0, /*tp_vectorcall*/
6611 static struct __pyx_vtabstruct_5MACS2_10Statistics_LogLR_Diff __pyx_vtable_5MACS2_10Statistics_LogLR_Diff
;
6613 static PyObject
*__pyx_tp_new_5MACS2_10Statistics_LogLR_Diff(PyTypeObject
*t
, CYTHON_UNUSED PyObject
*a
, CYTHON_UNUSED PyObject
*k
) {
6614 struct __pyx_obj_5MACS2_10Statistics_LogLR_Diff
*p
;
6616 if (likely((t
->tp_flags
& Py_TPFLAGS_IS_ABSTRACT
) == 0)) {
6617 o
= (*t
->tp_alloc
)(t
, 0);
6619 o
= (PyObject
*) PyBaseObject_Type
.tp_new(t
, __pyx_empty_tuple
, 0);
6621 if (unlikely(!o
)) return 0;
6622 p
= ((struct __pyx_obj_5MACS2_10Statistics_LogLR_Diff
*)o
);
6623 p
->__pyx_vtab
= __pyx_vtabptr_5MACS2_10Statistics_LogLR_Diff
;
6624 p
->logLR_dict
= ((PyObject
*)Py_None
); Py_INCREF(Py_None
);
6628 static void __pyx_tp_dealloc_5MACS2_10Statistics_LogLR_Diff(PyObject
*o
) {
6629 struct __pyx_obj_5MACS2_10Statistics_LogLR_Diff
*p
= (struct __pyx_obj_5MACS2_10Statistics_LogLR_Diff
*)o
;
6630 #if CYTHON_USE_TP_FINALIZE
6631 if (unlikely(PyType_HasFeature(Py_TYPE(o
), Py_TPFLAGS_HAVE_FINALIZE
) && Py_TYPE(o
)->tp_finalize
) && !_PyGC_FINALIZED(o
)) {
6632 if (PyObject_CallFinalizerFromDealloc(o
)) return;
6635 PyObject_GC_UnTrack(o
);
6636 Py_CLEAR(p
->logLR_dict
);
6637 (*Py_TYPE(o
)->tp_free
)(o
);
6640 static int __pyx_tp_traverse_5MACS2_10Statistics_LogLR_Diff(PyObject
*o
, visitproc v
, void *a
) {
6642 struct __pyx_obj_5MACS2_10Statistics_LogLR_Diff
*p
= (struct __pyx_obj_5MACS2_10Statistics_LogLR_Diff
*)o
;
6643 if (p
->logLR_dict
) {
6644 e
= (*v
)(p
->logLR_dict
, a
); if (e
) return e
;
6649 static int __pyx_tp_clear_5MACS2_10Statistics_LogLR_Diff(PyObject
*o
) {
6651 struct __pyx_obj_5MACS2_10Statistics_LogLR_Diff
*p
= (struct __pyx_obj_5MACS2_10Statistics_LogLR_Diff
*)o
;
6652 tmp
= ((PyObject
*)p
->logLR_dict
);
6653 p
->logLR_dict
= ((PyObject
*)Py_None
); Py_INCREF(Py_None
);
6658 static PyMethodDef __pyx_methods_5MACS2_10Statistics_LogLR_Diff
[] = {
6659 {"get_logLR_diff", (PyCFunction
)(void*)(PyCFunctionWithKeywords
)__pyx_pw_5MACS2_10Statistics_10LogLR_Diff_3get_logLR_diff
, METH_VARARGS
|METH_KEYWORDS
, 0},
6660 {"__reduce_cython__", (PyCFunction
)__pyx_pw_5MACS2_10Statistics_10LogLR_Diff_5__reduce_cython__
, METH_NOARGS
, 0},
6661 {"__setstate_cython__", (PyCFunction
)__pyx_pw_5MACS2_10Statistics_10LogLR_Diff_7__setstate_cython__
, METH_O
, 0},
6665 static PyTypeObject __pyx_type_5MACS2_10Statistics_LogLR_Diff
= {
6666 PyVarObject_HEAD_INIT(0, 0)
6667 "MACS2.Statistics.LogLR_Diff", /*tp_name*/
6668 sizeof(struct __pyx_obj_5MACS2_10Statistics_LogLR_Diff
), /*tp_basicsize*/
6670 __pyx_tp_dealloc_5MACS2_10Statistics_LogLR_Diff
, /*tp_dealloc*/
6674 #if PY_MAJOR_VERSION < 3
6677 #if PY_MAJOR_VERSION >= 3
6682 0, /*tp_as_sequence*/
6683 0, /*tp_as_mapping*/
6690 Py_TPFLAGS_DEFAULT
|Py_TPFLAGS_HAVE_VERSION_TAG
|Py_TPFLAGS_CHECKTYPES
|Py_TPFLAGS_HAVE_NEWBUFFER
|Py_TPFLAGS_BASETYPE
|Py_TPFLAGS_HAVE_GC
, /*tp_flags*/
6691 "Unit to calculate log likelihood for differential calling, and cache\n results in a hashtable.\n\n here f(x,y) = f(y,x) and f() is always positive.\n ", /*tp_doc*/
6692 __pyx_tp_traverse_5MACS2_10Statistics_LogLR_Diff
, /*tp_traverse*/
6693 __pyx_tp_clear_5MACS2_10Statistics_LogLR_Diff
, /*tp_clear*/
6694 0, /*tp_richcompare*/
6695 0, /*tp_weaklistoffset*/
6698 __pyx_methods_5MACS2_10Statistics_LogLR_Diff
, /*tp_methods*/
6705 0, /*tp_dictoffset*/
6706 __pyx_pw_5MACS2_10Statistics_10LogLR_Diff_1__init__
, /*tp_init*/
6708 __pyx_tp_new_5MACS2_10Statistics_LogLR_Diff
, /*tp_new*/
6714 0, /*tp_subclasses*/
6717 0, /*tp_version_tag*/
6718 #if PY_VERSION_HEX >= 0x030400a1
6721 #if PY_VERSION_HEX >= 0x030800b1
6722 0, /*tp_vectorcall*/
6726 static PyMethodDef __pyx_methods
[] = {
6730 #if PY_MAJOR_VERSION >= 3
6731 #if CYTHON_PEP489_MULTI_PHASE_INIT
6732 static PyObject
* __pyx_pymod_create(PyObject
*spec
, PyModuleDef
*def
); /*proto*/
6733 static int __pyx_pymod_exec_Statistics(PyObject
* module
); /*proto*/
6734 static PyModuleDef_Slot __pyx_moduledef_slots
[] = {
6735 {Py_mod_create
, (void*)__pyx_pymod_create
},
6736 {Py_mod_exec
, (void*)__pyx_pymod_exec_Statistics
},
6741 static struct PyModuleDef __pyx_moduledef
= {
6742 PyModuleDef_HEAD_INIT
,
6744 __pyx_k_Module_Description_Statistics_fu
, /* m_doc */
6745 #if CYTHON_PEP489_MULTI_PHASE_INIT
6750 __pyx_methods
/* m_methods */,
6751 #if CYTHON_PEP489_MULTI_PHASE_INIT
6752 __pyx_moduledef_slots
, /* m_slots */
6754 NULL
, /* m_reload */
6756 NULL
, /* m_traverse */
6761 #ifndef CYTHON_SMALL_CODE
6762 #if defined(__clang__)
6763 #define CYTHON_SMALL_CODE
6764 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
6765 #define CYTHON_SMALL_CODE __attribute__((cold))
6767 #define CYTHON_SMALL_CODE
6771 static __Pyx_StringTabEntry __pyx_string_tab
[] = {
6772 {&__pyx_kp_s_Incompatible_checksums_s_vs_0x08
, __pyx_k_Incompatible_checksums_s_vs_0x08
, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x08
), 0, 0, 1, 0},
6773 {&__pyx_kp_s_Incompatible_checksums_s_vs_0xf5
, __pyx_k_Incompatible_checksums_s_vs_0xf5
, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xf5
), 0, 0, 1, 0},
6774 {&__pyx_n_s_LogLR_Asym
, __pyx_k_LogLR_Asym
, sizeof(__pyx_k_LogLR_Asym
), 0, 0, 1, 1},
6775 {&__pyx_n_s_LogLR_Diff
, __pyx_k_LogLR_Diff
, sizeof(__pyx_k_LogLR_Diff
), 0, 0, 1, 1},
6776 {&__pyx_n_s_LogLR_Sym
, __pyx_k_LogLR_Sym
, sizeof(__pyx_k_LogLR_Sym
), 0, 0, 1, 1},
6777 {&__pyx_n_s_MACS2_Prob
, __pyx_k_MACS2_Prob
, sizeof(__pyx_k_MACS2_Prob
), 0, 0, 1, 1},
6778 {&__pyx_n_s_MACS2_Statistics
, __pyx_k_MACS2_Statistics
, sizeof(__pyx_k_MACS2_Statistics
), 0, 0, 1, 1},
6779 {&__pyx_n_s_P_Score_Upper_Tail
, __pyx_k_P_Score_Upper_Tail
, sizeof(__pyx_k_P_Score_Upper_Tail
), 0, 0, 1, 1},
6780 {&__pyx_n_s_PickleError
, __pyx_k_PickleError
, sizeof(__pyx_k_PickleError
), 0, 0, 1, 1},
6781 {&__pyx_n_s_cline_in_traceback
, __pyx_k_cline_in_traceback
, sizeof(__pyx_k_cline_in_traceback
), 0, 0, 1, 1},
6782 {&__pyx_n_s_dict
, __pyx_k_dict
, sizeof(__pyx_k_dict
), 0, 0, 1, 1},
6783 {&__pyx_n_s_get_logLR_asym
, __pyx_k_get_logLR_asym
, sizeof(__pyx_k_get_logLR_asym
), 0, 0, 1, 1},
6784 {&__pyx_n_s_get_logLR_diff
, __pyx_k_get_logLR_diff
, sizeof(__pyx_k_get_logLR_diff
), 0, 0, 1, 1},
6785 {&__pyx_n_s_get_logLR_sym
, __pyx_k_get_logLR_sym
, sizeof(__pyx_k_get_logLR_sym
), 0, 0, 1, 1},
6786 {&__pyx_n_s_get_pscore
, __pyx_k_get_pscore
, sizeof(__pyx_k_get_pscore
), 0, 0, 1, 1},
6787 {&__pyx_n_s_getstate
, __pyx_k_getstate
, sizeof(__pyx_k_getstate
), 0, 0, 1, 1},
6788 {&__pyx_n_s_import
, __pyx_k_import
, sizeof(__pyx_k_import
), 0, 0, 1, 1},
6789 {&__pyx_n_s_l
, __pyx_k_l
, sizeof(__pyx_k_l
), 0, 0, 1, 1},
6790 {&__pyx_n_s_main
, __pyx_k_main
, sizeof(__pyx_k_main
), 0, 0, 1, 1},
6791 {&__pyx_n_s_name
, __pyx_k_name
, sizeof(__pyx_k_name
), 0, 0, 1, 1},
6792 {&__pyx_n_s_new
, __pyx_k_new
, sizeof(__pyx_k_new
), 0, 0, 1, 1},
6793 {&__pyx_n_s_pickle
, __pyx_k_pickle
, sizeof(__pyx_k_pickle
), 0, 0, 1, 1},
6794 {&__pyx_n_s_poisson_cdf
, __pyx_k_poisson_cdf
, sizeof(__pyx_k_poisson_cdf
), 0, 0, 1, 1},
6795 {&__pyx_n_s_pyx_PickleError
, __pyx_k_pyx_PickleError
, sizeof(__pyx_k_pyx_PickleError
), 0, 0, 1, 1},
6796 {&__pyx_n_s_pyx_checksum
, __pyx_k_pyx_checksum
, sizeof(__pyx_k_pyx_checksum
), 0, 0, 1, 1},
6797 {&__pyx_n_s_pyx_result
, __pyx_k_pyx_result
, sizeof(__pyx_k_pyx_result
), 0, 0, 1, 1},
6798 {&__pyx_n_s_pyx_state
, __pyx_k_pyx_state
, sizeof(__pyx_k_pyx_state
), 0, 0, 1, 1},
6799 {&__pyx_n_s_pyx_type
, __pyx_k_pyx_type
, sizeof(__pyx_k_pyx_type
), 0, 0, 1, 1},
6800 {&__pyx_n_s_pyx_unpickle_LogLR_Asym
, __pyx_k_pyx_unpickle_LogLR_Asym
, sizeof(__pyx_k_pyx_unpickle_LogLR_Asym
), 0, 0, 1, 1},
6801 {&__pyx_n_s_pyx_unpickle_LogLR_Diff
, __pyx_k_pyx_unpickle_LogLR_Diff
, sizeof(__pyx_k_pyx_unpickle_LogLR_Diff
), 0, 0, 1, 1},
6802 {&__pyx_n_s_pyx_unpickle_LogLR_Sym
, __pyx_k_pyx_unpickle_LogLR_Sym
, sizeof(__pyx_k_pyx_unpickle_LogLR_Sym
), 0, 0, 1, 1},
6803 {&__pyx_n_s_pyx_unpickle_P_Score_Upper_Tai
, __pyx_k_pyx_unpickle_P_Score_Upper_Tai
, sizeof(__pyx_k_pyx_unpickle_P_Score_Upper_Tai
), 0, 0, 1, 1},
6804 {&__pyx_n_s_pyx_vtable
, __pyx_k_pyx_vtable
, sizeof(__pyx_k_pyx_vtable
), 0, 0, 1, 1},
6805 {&__pyx_n_s_reduce
, __pyx_k_reduce
, sizeof(__pyx_k_reduce
), 0, 0, 1, 1},
6806 {&__pyx_n_s_reduce_cython
, __pyx_k_reduce_cython
, sizeof(__pyx_k_reduce_cython
), 0, 0, 1, 1},
6807 {&__pyx_n_s_reduce_ex
, __pyx_k_reduce_ex
, sizeof(__pyx_k_reduce_ex
), 0, 0, 1, 1},
6808 {&__pyx_n_s_setstate
, __pyx_k_setstate
, sizeof(__pyx_k_setstate
), 0, 0, 1, 1},
6809 {&__pyx_n_s_setstate_cython
, __pyx_k_setstate_cython
, sizeof(__pyx_k_setstate_cython
), 0, 0, 1, 1},
6810 {&__pyx_kp_s_stringsource
, __pyx_k_stringsource
, sizeof(__pyx_k_stringsource
), 0, 0, 1, 0},
6811 {&__pyx_n_s_test
, __pyx_k_test
, sizeof(__pyx_k_test
), 0, 0, 1, 1},
6812 {&__pyx_n_s_update
, __pyx_k_update
, sizeof(__pyx_k_update
), 0, 0, 1, 1},
6813 {&__pyx_n_s_x
, __pyx_k_x
, sizeof(__pyx_k_x
), 0, 0, 1, 1},
6814 {&__pyx_n_s_y
, __pyx_k_y
, sizeof(__pyx_k_y
), 0, 0, 1, 1},
6815 {0, 0, 0, 0, 0, 0, 0}
6817 static CYTHON_SMALL_CODE
int __Pyx_InitCachedBuiltins(void) {
6821 static CYTHON_SMALL_CODE
int __Pyx_InitCachedConstants(void) {
6822 __Pyx_RefNannyDeclarations
6823 __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
6825 /* "(tree fragment)":1
6826 * def __pyx_unpickle_P_Score_Upper_Tail(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
6827 * cdef object __pyx_PickleError
6828 * cdef object __pyx_result
6830 __pyx_tuple__5
= PyTuple_Pack(5, __pyx_n_s_pyx_type
, __pyx_n_s_pyx_checksum
, __pyx_n_s_pyx_state
, __pyx_n_s_pyx_PickleError
, __pyx_n_s_pyx_result
); if (unlikely(!__pyx_tuple__5
)) __PYX_ERR(1, 1, __pyx_L1_error
)
6831 __Pyx_GOTREF(__pyx_tuple__5
);
6832 __Pyx_GIVEREF(__pyx_tuple__5
);
6833 __pyx_codeobj_
= (PyObject
*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED
|CO_NEWLOCALS
, __pyx_empty_bytes
, __pyx_empty_tuple
, __pyx_empty_tuple
, __pyx_tuple__5
, __pyx_empty_tuple
, __pyx_empty_tuple
, __pyx_kp_s_stringsource
, __pyx_n_s_pyx_unpickle_P_Score_Upper_Tai
, 1, __pyx_empty_bytes
); if (unlikely(!__pyx_codeobj_
)) __PYX_ERR(1, 1, __pyx_L1_error
)
6834 __pyx_tuple__6
= PyTuple_Pack(5, __pyx_n_s_pyx_type
, __pyx_n_s_pyx_checksum
, __pyx_n_s_pyx_state
, __pyx_n_s_pyx_PickleError
, __pyx_n_s_pyx_result
); if (unlikely(!__pyx_tuple__6
)) __PYX_ERR(1, 1, __pyx_L1_error
)
6835 __Pyx_GOTREF(__pyx_tuple__6
);
6836 __Pyx_GIVEREF(__pyx_tuple__6
);
6837 __pyx_codeobj__2
= (PyObject
*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED
|CO_NEWLOCALS
, __pyx_empty_bytes
, __pyx_empty_tuple
, __pyx_empty_tuple
, __pyx_tuple__6
, __pyx_empty_tuple
, __pyx_empty_tuple
, __pyx_kp_s_stringsource
, __pyx_n_s_pyx_unpickle_LogLR_Asym
, 1, __pyx_empty_bytes
); if (unlikely(!__pyx_codeobj__2
)) __PYX_ERR(1, 1, __pyx_L1_error
)
6838 __pyx_tuple__7
= PyTuple_Pack(5, __pyx_n_s_pyx_type
, __pyx_n_s_pyx_checksum
, __pyx_n_s_pyx_state
, __pyx_n_s_pyx_PickleError
, __pyx_n_s_pyx_result
); if (unlikely(!__pyx_tuple__7
)) __PYX_ERR(1, 1, __pyx_L1_error
)
6839 __Pyx_GOTREF(__pyx_tuple__7
);
6840 __Pyx_GIVEREF(__pyx_tuple__7
);
6841 __pyx_codeobj__3
= (PyObject
*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED
|CO_NEWLOCALS
, __pyx_empty_bytes
, __pyx_empty_tuple
, __pyx_empty_tuple
, __pyx_tuple__7
, __pyx_empty_tuple
, __pyx_empty_tuple
, __pyx_kp_s_stringsource
, __pyx_n_s_pyx_unpickle_LogLR_Sym
, 1, __pyx_empty_bytes
); if (unlikely(!__pyx_codeobj__3
)) __PYX_ERR(1, 1, __pyx_L1_error
)
6842 __pyx_tuple__8
= PyTuple_Pack(5, __pyx_n_s_pyx_type
, __pyx_n_s_pyx_checksum
, __pyx_n_s_pyx_state
, __pyx_n_s_pyx_PickleError
, __pyx_n_s_pyx_result
); if (unlikely(!__pyx_tuple__8
)) __PYX_ERR(1, 1, __pyx_L1_error
)
6843 __Pyx_GOTREF(__pyx_tuple__8
);
6844 __Pyx_GIVEREF(__pyx_tuple__8
);
6845 __pyx_codeobj__4
= (PyObject
*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED
|CO_NEWLOCALS
, __pyx_empty_bytes
, __pyx_empty_tuple
, __pyx_empty_tuple
, __pyx_tuple__8
, __pyx_empty_tuple
, __pyx_empty_tuple
, __pyx_kp_s_stringsource
, __pyx_n_s_pyx_unpickle_LogLR_Diff
, 1, __pyx_empty_bytes
); if (unlikely(!__pyx_codeobj__4
)) __PYX_ERR(1, 1, __pyx_L1_error
)
6846 __Pyx_RefNannyFinishContext();
6849 __Pyx_RefNannyFinishContext();
6853 static CYTHON_SMALL_CODE
int __Pyx_InitGlobals(void) {
6854 if (__Pyx_InitStrings(__pyx_string_tab
) < 0) __PYX_ERR(0, 1, __pyx_L1_error
);
6855 __pyx_int_8799262
= PyInt_FromLong(8799262L); if (unlikely(!__pyx_int_8799262
)) __PYX_ERR(0, 1, __pyx_L1_error
)
6856 __pyx_int_256911492
= PyInt_FromLong(256911492L); if (unlikely(!__pyx_int_256911492
)) __PYX_ERR(0, 1, __pyx_L1_error
)
6857 __pyx_int_neg_1
= PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1
)) __PYX_ERR(0, 1, __pyx_L1_error
)
6863 static CYTHON_SMALL_CODE
int __Pyx_modinit_global_init_code(void); /*proto*/
6864 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_export_code(void); /*proto*/
6865 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_export_code(void); /*proto*/
6866 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_init_code(void); /*proto*/
6867 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_import_code(void); /*proto*/
6868 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_import_code(void); /*proto*/
6869 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_import_code(void); /*proto*/
6871 static int __Pyx_modinit_global_init_code(void) {
6872 __Pyx_RefNannyDeclarations
6873 __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
6874 /*--- Global init code ---*/
6875 __Pyx_RefNannyFinishContext();
6879 static int __Pyx_modinit_variable_export_code(void) {
6880 __Pyx_RefNannyDeclarations
6881 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
6882 /*--- Variable export code ---*/
6883 __Pyx_RefNannyFinishContext();
6887 static int __Pyx_modinit_function_export_code(void) {
6888 __Pyx_RefNannyDeclarations
6889 __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
6890 /*--- Function export code ---*/
6891 __Pyx_RefNannyFinishContext();
6895 static int __Pyx_modinit_type_init_code(void) {
6896 __Pyx_RefNannyDeclarations
6897 __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
6898 /*--- Type init code ---*/
6899 __pyx_vtabptr_5MACS2_10Statistics_P_Score_Upper_Tail
= &__pyx_vtable_5MACS2_10Statistics_P_Score_Upper_Tail
;
6900 __pyx_vtable_5MACS2_10Statistics_P_Score_Upper_Tail
.get_pscore
= (float (*)(struct __pyx_obj_5MACS2_10Statistics_P_Score_Upper_Tail
*, int, float, int __pyx_skip_dispatch
))__pyx_f_5MACS2_10Statistics_18P_Score_Upper_Tail_get_pscore
;
6901 if (PyType_Ready(&__pyx_type_5MACS2_10Statistics_P_Score_Upper_Tail
) < 0) __PYX_ERR(0, 15, __pyx_L1_error
)
6902 #if PY_VERSION_HEX < 0x030800B1
6903 __pyx_type_5MACS2_10Statistics_P_Score_Upper_Tail
.tp_print
= 0;
6905 if ((CYTHON_USE_TYPE_SLOTS
&& CYTHON_USE_PYTYPE_LOOKUP
) && likely(!__pyx_type_5MACS2_10Statistics_P_Score_Upper_Tail
.tp_dictoffset
&& __pyx_type_5MACS2_10Statistics_P_Score_Upper_Tail
.tp_getattro
== PyObject_GenericGetAttr
)) {
6906 __pyx_type_5MACS2_10Statistics_P_Score_Upper_Tail
.tp_getattro
= __Pyx_PyObject_GenericGetAttr
;
6908 if (__Pyx_SetVtable(__pyx_type_5MACS2_10Statistics_P_Score_Upper_Tail
.tp_dict
, __pyx_vtabptr_5MACS2_10Statistics_P_Score_Upper_Tail
) < 0) __PYX_ERR(0, 15, __pyx_L1_error
)
6909 if (PyObject_SetAttr(__pyx_m
, __pyx_n_s_P_Score_Upper_Tail
, (PyObject
*)&__pyx_type_5MACS2_10Statistics_P_Score_Upper_Tail
) < 0) __PYX_ERR(0, 15, __pyx_L1_error
)
6910 if (__Pyx_setup_reduce((PyObject
*)&__pyx_type_5MACS2_10Statistics_P_Score_Upper_Tail
) < 0) __PYX_ERR(0, 15, __pyx_L1_error
)
6911 __pyx_ptype_5MACS2_10Statistics_P_Score_Upper_Tail
= &__pyx_type_5MACS2_10Statistics_P_Score_Upper_Tail
;
6912 __pyx_vtabptr_5MACS2_10Statistics_LogLR_Asym
= &__pyx_vtable_5MACS2_10Statistics_LogLR_Asym
;
6913 __pyx_vtable_5MACS2_10Statistics_LogLR_Asym
.get_logLR_asym
= (float (*)(struct __pyx_obj_5MACS2_10Statistics_LogLR_Asym
*, float, float, int __pyx_skip_dispatch
))__pyx_f_5MACS2_10Statistics_10LogLR_Asym_get_logLR_asym
;
6914 if (PyType_Ready(&__pyx_type_5MACS2_10Statistics_LogLR_Asym
) < 0) __PYX_ERR(0, 37, __pyx_L1_error
)
6915 #if PY_VERSION_HEX < 0x030800B1
6916 __pyx_type_5MACS2_10Statistics_LogLR_Asym
.tp_print
= 0;
6918 if ((CYTHON_USE_TYPE_SLOTS
&& CYTHON_USE_PYTYPE_LOOKUP
) && likely(!__pyx_type_5MACS2_10Statistics_LogLR_Asym
.tp_dictoffset
&& __pyx_type_5MACS2_10Statistics_LogLR_Asym
.tp_getattro
== PyObject_GenericGetAttr
)) {
6919 __pyx_type_5MACS2_10Statistics_LogLR_Asym
.tp_getattro
= __Pyx_PyObject_GenericGetAttr
;
6921 if (__Pyx_SetVtable(__pyx_type_5MACS2_10Statistics_LogLR_Asym
.tp_dict
, __pyx_vtabptr_5MACS2_10Statistics_LogLR_Asym
) < 0) __PYX_ERR(0, 37, __pyx_L1_error
)
6922 if (PyObject_SetAttr(__pyx_m
, __pyx_n_s_LogLR_Asym
, (PyObject
*)&__pyx_type_5MACS2_10Statistics_LogLR_Asym
) < 0) __PYX_ERR(0, 37, __pyx_L1_error
)
6923 if (__Pyx_setup_reduce((PyObject
*)&__pyx_type_5MACS2_10Statistics_LogLR_Asym
) < 0) __PYX_ERR(0, 37, __pyx_L1_error
)
6924 __pyx_ptype_5MACS2_10Statistics_LogLR_Asym
= &__pyx_type_5MACS2_10Statistics_LogLR_Asym
;
6925 __pyx_vtabptr_5MACS2_10Statistics_LogLR_Sym
= &__pyx_vtable_5MACS2_10Statistics_LogLR_Sym
;
6926 __pyx_vtable_5MACS2_10Statistics_LogLR_Sym
.get_logLR_sym
= (float (*)(struct __pyx_obj_5MACS2_10Statistics_LogLR_Sym
*, float, float, int __pyx_skip_dispatch
))__pyx_f_5MACS2_10Statistics_9LogLR_Sym_get_logLR_sym
;
6927 if (PyType_Ready(&__pyx_type_5MACS2_10Statistics_LogLR_Sym
) < 0) __PYX_ERR(0, 65, __pyx_L1_error
)
6928 #if PY_VERSION_HEX < 0x030800B1
6929 __pyx_type_5MACS2_10Statistics_LogLR_Sym
.tp_print
= 0;
6931 if ((CYTHON_USE_TYPE_SLOTS
&& CYTHON_USE_PYTYPE_LOOKUP
) && likely(!__pyx_type_5MACS2_10Statistics_LogLR_Sym
.tp_dictoffset
&& __pyx_type_5MACS2_10Statistics_LogLR_Sym
.tp_getattro
== PyObject_GenericGetAttr
)) {
6932 __pyx_type_5MACS2_10Statistics_LogLR_Sym
.tp_getattro
= __Pyx_PyObject_GenericGetAttr
;
6934 if (__Pyx_SetVtable(__pyx_type_5MACS2_10Statistics_LogLR_Sym
.tp_dict
, __pyx_vtabptr_5MACS2_10Statistics_LogLR_Sym
) < 0) __PYX_ERR(0, 65, __pyx_L1_error
)
6935 if (PyObject_SetAttr(__pyx_m
, __pyx_n_s_LogLR_Sym
, (PyObject
*)&__pyx_type_5MACS2_10Statistics_LogLR_Sym
) < 0) __PYX_ERR(0, 65, __pyx_L1_error
)
6936 if (__Pyx_setup_reduce((PyObject
*)&__pyx_type_5MACS2_10Statistics_LogLR_Sym
) < 0) __PYX_ERR(0, 65, __pyx_L1_error
)
6937 __pyx_ptype_5MACS2_10Statistics_LogLR_Sym
= &__pyx_type_5MACS2_10Statistics_LogLR_Sym
;
6938 __pyx_vtabptr_5MACS2_10Statistics_LogLR_Diff
= &__pyx_vtable_5MACS2_10Statistics_LogLR_Diff
;
6939 __pyx_vtable_5MACS2_10Statistics_LogLR_Diff
.get_logLR_diff
= (float (*)(struct __pyx_obj_5MACS2_10Statistics_LogLR_Diff
*, float, float, int __pyx_skip_dispatch
))__pyx_f_5MACS2_10Statistics_10LogLR_Diff_get_logLR_diff
;
6940 if (PyType_Ready(&__pyx_type_5MACS2_10Statistics_LogLR_Diff
) < 0) __PYX_ERR(0, 96, __pyx_L1_error
)
6941 #if PY_VERSION_HEX < 0x030800B1
6942 __pyx_type_5MACS2_10Statistics_LogLR_Diff
.tp_print
= 0;
6944 if ((CYTHON_USE_TYPE_SLOTS
&& CYTHON_USE_PYTYPE_LOOKUP
) && likely(!__pyx_type_5MACS2_10Statistics_LogLR_Diff
.tp_dictoffset
&& __pyx_type_5MACS2_10Statistics_LogLR_Diff
.tp_getattro
== PyObject_GenericGetAttr
)) {
6945 __pyx_type_5MACS2_10Statistics_LogLR_Diff
.tp_getattro
= __Pyx_PyObject_GenericGetAttr
;
6947 if (__Pyx_SetVtable(__pyx_type_5MACS2_10Statistics_LogLR_Diff
.tp_dict
, __pyx_vtabptr_5MACS2_10Statistics_LogLR_Diff
) < 0) __PYX_ERR(0, 96, __pyx_L1_error
)
6948 if (PyObject_SetAttr(__pyx_m
, __pyx_n_s_LogLR_Diff
, (PyObject
*)&__pyx_type_5MACS2_10Statistics_LogLR_Diff
) < 0) __PYX_ERR(0, 96, __pyx_L1_error
)
6949 if (__Pyx_setup_reduce((PyObject
*)&__pyx_type_5MACS2_10Statistics_LogLR_Diff
) < 0) __PYX_ERR(0, 96, __pyx_L1_error
)
6950 __pyx_ptype_5MACS2_10Statistics_LogLR_Diff
= &__pyx_type_5MACS2_10Statistics_LogLR_Diff
;
6951 __Pyx_RefNannyFinishContext();
6954 __Pyx_RefNannyFinishContext();
6958 static int __Pyx_modinit_type_import_code(void) {
6959 __Pyx_RefNannyDeclarations
6960 __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
6961 /*--- Type import code ---*/
6962 __Pyx_RefNannyFinishContext();
6966 static int __Pyx_modinit_variable_import_code(void) {
6967 __Pyx_RefNannyDeclarations
6968 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
6969 /*--- Variable import code ---*/
6970 __Pyx_RefNannyFinishContext();
6974 static int __Pyx_modinit_function_import_code(void) {
6975 __Pyx_RefNannyDeclarations
6976 __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
6977 /*--- Function import code ---*/
6978 __Pyx_RefNannyFinishContext();
6983 #if PY_MAJOR_VERSION < 3
6984 #ifdef CYTHON_NO_PYINIT_EXPORT
6985 #define __Pyx_PyMODINIT_FUNC void
6987 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
6990 #ifdef CYTHON_NO_PYINIT_EXPORT
6991 #define __Pyx_PyMODINIT_FUNC PyObject *
6993 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
6998 #if PY_MAJOR_VERSION < 3
6999 __Pyx_PyMODINIT_FUNC
initStatistics(void) CYTHON_SMALL_CODE
; /*proto*/
7000 __Pyx_PyMODINIT_FUNC
initStatistics(void)
7002 __Pyx_PyMODINIT_FUNC
PyInit_Statistics(void) CYTHON_SMALL_CODE
; /*proto*/
7003 __Pyx_PyMODINIT_FUNC
PyInit_Statistics(void)
7004 #if CYTHON_PEP489_MULTI_PHASE_INIT
7006 return PyModuleDef_Init(&__pyx_moduledef
);
7008 static CYTHON_SMALL_CODE
int __Pyx_check_single_interpreter(void) {
7009 #if PY_VERSION_HEX >= 0x030700A1
7010 static PY_INT64_T main_interpreter_id
= -1;
7011 PY_INT64_T current_id
= PyInterpreterState_GetID(PyThreadState_Get()->interp
);
7012 if (main_interpreter_id
== -1) {
7013 main_interpreter_id
= current_id
;
7014 return (unlikely(current_id
== -1)) ? -1 : 0;
7015 } else if (unlikely(main_interpreter_id
!= current_id
))
7017 static PyInterpreterState
*main_interpreter
= NULL
;
7018 PyInterpreterState
*current_interpreter
= PyThreadState_Get()->interp
;
7019 if (!main_interpreter
) {
7020 main_interpreter
= current_interpreter
;
7021 } else if (unlikely(main_interpreter
!= current_interpreter
))
7026 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
7031 static CYTHON_SMALL_CODE
int __Pyx_copy_spec_to_module(PyObject
*spec
, PyObject
*moddict
, const char* from_name
, const char* to_name
, int allow_none
) {
7032 PyObject
*value
= PyObject_GetAttrString(spec
, from_name
);
7034 if (likely(value
)) {
7035 if (allow_none
|| value
!= Py_None
) {
7036 result
= PyDict_SetItemString(moddict
, to_name
, value
);
7039 } else if (PyErr_ExceptionMatches(PyExc_AttributeError
)) {
7046 static CYTHON_SMALL_CODE PyObject
* __pyx_pymod_create(PyObject
*spec
, CYTHON_UNUSED PyModuleDef
*def
) {
7047 PyObject
*module
= NULL
, *moddict
, *modname
;
7048 if (__Pyx_check_single_interpreter())
7051 return __Pyx_NewRef(__pyx_m
);
7052 modname
= PyObject_GetAttrString(spec
, "name");
7053 if (unlikely(!modname
)) goto bad
;
7054 module
= PyModule_NewObject(modname
);
7056 if (unlikely(!module
)) goto bad
;
7057 moddict
= PyModule_GetDict(module
);
7058 if (unlikely(!moddict
)) goto bad
;
7059 if (unlikely(__Pyx_copy_spec_to_module(spec
, moddict
, "loader", "__loader__", 1) < 0)) goto bad
;
7060 if (unlikely(__Pyx_copy_spec_to_module(spec
, moddict
, "origin", "__file__", 1) < 0)) goto bad
;
7061 if (unlikely(__Pyx_copy_spec_to_module(spec
, moddict
, "parent", "__package__", 1) < 0)) goto bad
;
7062 if (unlikely(__Pyx_copy_spec_to_module(spec
, moddict
, "submodule_search_locations", "__path__", 0) < 0)) goto bad
;
7070 static CYTHON_SMALL_CODE
int __pyx_pymod_exec_Statistics(PyObject
*__pyx_pyinit_module
)
7074 __Pyx_TraceDeclarations
7075 PyObject
*__pyx_t_1
= NULL
;
7076 PyObject
*__pyx_t_2
= NULL
;
7077 __Pyx_RefNannyDeclarations
7078 #if CYTHON_PEP489_MULTI_PHASE_INIT
7080 if (__pyx_m
== __pyx_pyinit_module
) return 0;
7081 PyErr_SetString(PyExc_RuntimeError
, "Module 'Statistics' has already been imported. Re-initialisation is not supported.");
7084 #elif PY_MAJOR_VERSION >= 3
7085 if (__pyx_m
) return __Pyx_NewRef(__pyx_m
);
7088 __Pyx_RefNanny
= __Pyx_RefNannyImportAPI("refnanny");
7089 if (!__Pyx_RefNanny
) {
7091 __Pyx_RefNanny
= __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
7092 if (!__Pyx_RefNanny
)
7093 Py_FatalError("failed to import 'refnanny' module");
7096 __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_Statistics(void)", 0);
7097 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error
)
7098 #ifdef __Pxy_PyFrame_Initialize_Offsets
7099 __Pxy_PyFrame_Initialize_Offsets();
7101 __pyx_empty_tuple
= PyTuple_New(0); if (unlikely(!__pyx_empty_tuple
)) __PYX_ERR(0, 1, __pyx_L1_error
)
7102 __pyx_empty_bytes
= PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes
)) __PYX_ERR(0, 1, __pyx_L1_error
)
7103 __pyx_empty_unicode
= PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode
)) __PYX_ERR(0, 1, __pyx_L1_error
)
7104 #ifdef __Pyx_CyFunction_USED
7105 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error
)
7107 #ifdef __Pyx_FusedFunction_USED
7108 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error
)
7110 #ifdef __Pyx_Coroutine_USED
7111 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error
)
7113 #ifdef __Pyx_Generator_USED
7114 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error
)
7116 #ifdef __Pyx_AsyncGen_USED
7117 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error
)
7119 #ifdef __Pyx_StopAsyncIteration_USED
7120 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error
)
7122 /*--- Library function declarations ---*/
7123 /*--- Threads initialization code ---*/
7124 #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
7125 #ifdef WITH_THREAD /* Python build with threading support? */
7126 PyEval_InitThreads();
7129 /*--- Module creation code ---*/
7130 #if CYTHON_PEP489_MULTI_PHASE_INIT
7131 __pyx_m
= __pyx_pyinit_module
;
7134 #if PY_MAJOR_VERSION < 3
7135 __pyx_m
= Py_InitModule4("Statistics", __pyx_methods
, __pyx_k_Module_Description_Statistics_fu
, 0, PYTHON_API_VERSION
); Py_XINCREF(__pyx_m
);
7137 __pyx_m
= PyModule_Create(&__pyx_moduledef
);
7139 if (unlikely(!__pyx_m
)) __PYX_ERR(0, 1, __pyx_L1_error
)
7141 __pyx_d
= PyModule_GetDict(__pyx_m
); if (unlikely(!__pyx_d
)) __PYX_ERR(0, 1, __pyx_L1_error
)
7143 __pyx_b
= PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME
); if (unlikely(!__pyx_b
)) __PYX_ERR(0, 1, __pyx_L1_error
)
7145 __pyx_cython_runtime
= PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime
)) __PYX_ERR(0, 1, __pyx_L1_error
)
7146 Py_INCREF(__pyx_cython_runtime
);
7147 if (PyObject_SetAttrString(__pyx_m
, "__builtins__", __pyx_b
) < 0) __PYX_ERR(0, 1, __pyx_L1_error
);
7148 /*--- Initialize various global constants etc. ---*/
7149 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error
)
7150 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
7151 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error
)
7153 if (__pyx_module_is_main_MACS2__Statistics
) {
7154 if (PyObject_SetAttr(__pyx_m
, __pyx_n_s_name
, __pyx_n_s_main
) < 0) __PYX_ERR(0, 1, __pyx_L1_error
)
7156 #if PY_MAJOR_VERSION >= 3
7158 PyObject
*modules
= PyImport_GetModuleDict(); if (unlikely(!modules
)) __PYX_ERR(0, 1, __pyx_L1_error
)
7159 if (!PyDict_GetItemString(modules
, "MACS2.Statistics")) {
7160 if (unlikely(PyDict_SetItemString(modules
, "MACS2.Statistics", __pyx_m
) < 0)) __PYX_ERR(0, 1, __pyx_L1_error
)
7164 /*--- Builtin init code ---*/
7165 if (__Pyx_InitCachedBuiltins() < 0) goto __pyx_L1_error
;
7166 /*--- Constants init code ---*/
7167 if (__Pyx_InitCachedConstants() < 0) goto __pyx_L1_error
;
7168 /*--- Global type/function init code ---*/
7169 (void)__Pyx_modinit_global_init_code();
7170 (void)__Pyx_modinit_variable_export_code();
7171 (void)__Pyx_modinit_function_export_code();
7172 if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error
;
7173 (void)__Pyx_modinit_type_import_code();
7174 (void)__Pyx_modinit_variable_import_code();
7175 (void)__Pyx_modinit_function_import_code();
7176 /*--- Execution code ---*/
7177 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
7178 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error
)
7180 __Pyx_TraceCall("__Pyx_PyMODINIT_FUNC PyInit_Statistics(void)", __pyx_f
[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error
));
7182 /* "MACS2/Statistics.pyx":13
7184 * from libc.math cimport log10, log
7185 * from MACS2.Prob import poisson_cdf # <<<<<<<<<<<<<<
7187 * cdef class P_Score_Upper_Tail:
7189 __pyx_t_1
= PyList_New(1); if (unlikely(!__pyx_t_1
)) __PYX_ERR(0, 13, __pyx_L1_error
)
7190 __Pyx_GOTREF(__pyx_t_1
);
7191 __Pyx_INCREF(__pyx_n_s_poisson_cdf
);
7192 __Pyx_GIVEREF(__pyx_n_s_poisson_cdf
);
7193 PyList_SET_ITEM(__pyx_t_1
, 0, __pyx_n_s_poisson_cdf
);
7194 __pyx_t_2
= __Pyx_Import(__pyx_n_s_MACS2_Prob
, __pyx_t_1
, 0); if (unlikely(!__pyx_t_2
)) __PYX_ERR(0, 13, __pyx_L1_error
)
7195 __Pyx_GOTREF(__pyx_t_2
);
7196 __Pyx_DECREF(__pyx_t_1
); __pyx_t_1
= 0;
7197 __pyx_t_1
= __Pyx_ImportFrom(__pyx_t_2
, __pyx_n_s_poisson_cdf
); if (unlikely(!__pyx_t_1
)) __PYX_ERR(0, 13, __pyx_L1_error
)
7198 __Pyx_GOTREF(__pyx_t_1
);
7199 if (PyDict_SetItem(__pyx_d
, __pyx_n_s_poisson_cdf
, __pyx_t_1
) < 0) __PYX_ERR(0, 13, __pyx_L1_error
)
7200 __Pyx_DECREF(__pyx_t_1
); __pyx_t_1
= 0;
7201 __Pyx_DECREF(__pyx_t_2
); __pyx_t_2
= 0;
7203 /* "(tree fragment)":1
7204 * def __pyx_unpickle_P_Score_Upper_Tail(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
7205 * cdef object __pyx_PickleError
7206 * cdef object __pyx_result
7208 __pyx_t_2
= PyCFunction_NewEx(&__pyx_mdef_5MACS2_10Statistics_1__pyx_unpickle_P_Score_Upper_Tail
, NULL
, __pyx_n_s_MACS2_Statistics
); if (unlikely(!__pyx_t_2
)) __PYX_ERR(1, 1, __pyx_L1_error
)
7209 __Pyx_GOTREF(__pyx_t_2
);
7210 if (PyDict_SetItem(__pyx_d
, __pyx_n_s_pyx_unpickle_P_Score_Upper_Tai
, __pyx_t_2
) < 0) __PYX_ERR(1, 1, __pyx_L1_error
)
7211 __Pyx_DECREF(__pyx_t_2
); __pyx_t_2
= 0;
7213 /* "(tree fragment)":11
7214 * __pyx_unpickle_P_Score_Upper_Tail__set_state(<P_Score_Upper_Tail> __pyx_result, __pyx_state)
7215 * return __pyx_result
7216 * cdef __pyx_unpickle_P_Score_Upper_Tail__set_state(P_Score_Upper_Tail __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
7217 * __pyx_result.pscore_dict = __pyx_state[0]
7218 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
7220 __pyx_t_2
= PyCFunction_NewEx(&__pyx_mdef_5MACS2_10Statistics_3__pyx_unpickle_LogLR_Asym
, NULL
, __pyx_n_s_MACS2_Statistics
); if (unlikely(!__pyx_t_2
)) __PYX_ERR(1, 1, __pyx_L1_error
)
7221 __Pyx_GOTREF(__pyx_t_2
);
7222 if (PyDict_SetItem(__pyx_d
, __pyx_n_s_pyx_unpickle_LogLR_Asym
, __pyx_t_2
) < 0) __PYX_ERR(1, 1, __pyx_L1_error
)
7223 __Pyx_DECREF(__pyx_t_2
); __pyx_t_2
= 0;
7225 /* "(tree fragment)":1
7226 * def __pyx_unpickle_LogLR_Sym(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
7227 * cdef object __pyx_PickleError
7228 * cdef object __pyx_result
7230 __pyx_t_2
= PyCFunction_NewEx(&__pyx_mdef_5MACS2_10Statistics_5__pyx_unpickle_LogLR_Sym
, NULL
, __pyx_n_s_MACS2_Statistics
); if (unlikely(!__pyx_t_2
)) __PYX_ERR(1, 1, __pyx_L1_error
)
7231 __Pyx_GOTREF(__pyx_t_2
);
7232 if (PyDict_SetItem(__pyx_d
, __pyx_n_s_pyx_unpickle_LogLR_Sym
, __pyx_t_2
) < 0) __PYX_ERR(1, 1, __pyx_L1_error
)
7233 __Pyx_DECREF(__pyx_t_2
); __pyx_t_2
= 0;
7235 /* "(tree fragment)":11
7236 * __pyx_unpickle_LogLR_Sym__set_state(<LogLR_Sym> __pyx_result, __pyx_state)
7237 * return __pyx_result
7238 * cdef __pyx_unpickle_LogLR_Sym__set_state(LogLR_Sym __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
7239 * __pyx_result.logLR_dict = __pyx_state[0]
7240 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
7242 __pyx_t_2
= PyCFunction_NewEx(&__pyx_mdef_5MACS2_10Statistics_7__pyx_unpickle_LogLR_Diff
, NULL
, __pyx_n_s_MACS2_Statistics
); if (unlikely(!__pyx_t_2
)) __PYX_ERR(1, 1, __pyx_L1_error
)
7243 __Pyx_GOTREF(__pyx_t_2
);
7244 if (PyDict_SetItem(__pyx_d
, __pyx_n_s_pyx_unpickle_LogLR_Diff
, __pyx_t_2
) < 0) __PYX_ERR(1, 1, __pyx_L1_error
)
7245 __Pyx_DECREF(__pyx_t_2
); __pyx_t_2
= 0;
7247 /* "MACS2/Statistics.pyx":1
7248 * # cython: language_level=3 # <<<<<<<<<<<<<<
7249 * # cython: profile=True
7250 * # Time-stamp: <2019-10-30 17:27:50 taoliu>
7252 __pyx_t_2
= __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2
)) __PYX_ERR(0, 1, __pyx_L1_error
)
7253 __Pyx_GOTREF(__pyx_t_2
);
7254 if (PyDict_SetItem(__pyx_d
, __pyx_n_s_test
, __pyx_t_2
) < 0) __PYX_ERR(0, 1, __pyx_L1_error
)
7255 __Pyx_DECREF(__pyx_t_2
); __pyx_t_2
= 0;
7256 __Pyx_TraceReturn(Py_None
, 0);
7258 /*--- Wrapped vars code ---*/
7262 __Pyx_XDECREF(__pyx_t_1
);
7263 __Pyx_XDECREF(__pyx_t_2
);
7266 __Pyx_AddTraceback("init MACS2.Statistics", __pyx_clineno
, __pyx_lineno
, __pyx_filename
);
7269 } else if (!PyErr_Occurred()) {
7270 PyErr_SetString(PyExc_ImportError
, "init MACS2.Statistics");
7273 __Pyx_RefNannyFinishContext();
7274 #if CYTHON_PEP489_MULTI_PHASE_INIT
7275 return (__pyx_m
!= NULL
) ? 0 : -1;
7276 #elif PY_MAJOR_VERSION >= 3
7283 /* --- Runtime support code --- */
7286 static __Pyx_RefNannyAPIStruct
*__Pyx_RefNannyImportAPI(const char *modname
) {
7287 PyObject
*m
= NULL
, *p
= NULL
;
7289 m
= PyImport_ImportModule(modname
);
7291 p
= PyObject_GetAttrString(m
, "RefNannyAPI");
7293 r
= PyLong_AsVoidPtr(p
);
7297 return (__Pyx_RefNannyAPIStruct
*)r
;
7301 /* RaiseArgTupleInvalid */
7302 static void __Pyx_RaiseArgtupleInvalid(
7303 const char* func_name
,
7307 Py_ssize_t num_found
)
7309 Py_ssize_t num_expected
;
7310 const char *more_or_less
;
7311 if (num_found
< num_min
) {
7312 num_expected
= num_min
;
7313 more_or_less
= "at least";
7315 num_expected
= num_max
;
7316 more_or_less
= "at most";
7319 more_or_less
= "exactly";
7321 PyErr_Format(PyExc_TypeError
,
7322 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
7323 func_name
, more_or_less
, num_expected
,
7324 (num_expected
== 1) ? "" : "s", num_found
);
7327 /* KeywordStringCheck */
7328 static int __Pyx_CheckKeywordStrings(
7330 const char* function_name
,
7335 #if CYTHON_COMPILING_IN_PYPY
7336 if (!kw_allowed
&& PyDict_Next(kwdict
, &pos
, &key
, 0))
7337 goto invalid_keyword
;
7340 while (PyDict_Next(kwdict
, &pos
, &key
, 0)) {
7341 #if PY_MAJOR_VERSION < 3
7342 if (unlikely(!PyString_Check(key
)))
7344 if (unlikely(!PyUnicode_Check(key
)))
7345 goto invalid_keyword_type
;
7347 if ((!kw_allowed
) && unlikely(key
))
7348 goto invalid_keyword
;
7350 invalid_keyword_type
:
7351 PyErr_Format(PyExc_TypeError
,
7352 "%.200s() keywords must be strings", function_name
);
7356 PyErr_Format(PyExc_TypeError
,
7357 #if PY_MAJOR_VERSION < 3
7358 "%.200s() got an unexpected keyword argument '%.200s'",
7359 function_name
, PyString_AsString(key
));
7361 "%s() got an unexpected keyword argument '%U'",
7362 function_name
, key
);
7367 /* PyErrFetchRestore */
7368 #if CYTHON_FAST_THREAD_STATE
7369 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState
*tstate
, PyObject
*type
, PyObject
*value
, PyObject
*tb
) {
7370 PyObject
*tmp_type
, *tmp_value
, *tmp_tb
;
7371 tmp_type
= tstate
->curexc_type
;
7372 tmp_value
= tstate
->curexc_value
;
7373 tmp_tb
= tstate
->curexc_traceback
;
7374 tstate
->curexc_type
= type
;
7375 tstate
->curexc_value
= value
;
7376 tstate
->curexc_traceback
= tb
;
7377 Py_XDECREF(tmp_type
);
7378 Py_XDECREF(tmp_value
);
7381 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState
*tstate
, PyObject
**type
, PyObject
**value
, PyObject
**tb
) {
7382 *type
= tstate
->curexc_type
;
7383 *value
= tstate
->curexc_value
;
7384 *tb
= tstate
->curexc_traceback
;
7385 tstate
->curexc_type
= 0;
7386 tstate
->curexc_value
= 0;
7387 tstate
->curexc_traceback
= 0;
7393 static int __Pyx_TraceSetupAndCall(PyCodeObject
** code
,
7394 PyFrameObject
** frame
,
7395 PyThreadState
* tstate
,
7396 const char *funcname
,
7397 const char *srcfile
,
7399 PyObject
*type
, *value
, *traceback
;
7401 if (*frame
== NULL
|| !CYTHON_PROFILE_REUSE_FRAME
) {
7402 if (*code
== NULL
) {
7403 *code
= __Pyx_createFrameCodeObject(funcname
, srcfile
, firstlineno
);
7404 if (*code
== NULL
) return 0;
7406 *frame
= PyFrame_New(
7407 tstate
, /*PyThreadState *tstate*/
7408 *code
, /*PyCodeObject *code*/
7409 __pyx_d
, /*PyObject *globals*/
7410 0 /*PyObject *locals*/
7412 if (*frame
== NULL
) return 0;
7413 if (CYTHON_TRACE
&& (*frame
)->f_trace
== NULL
) {
7415 (*frame
)->f_trace
= Py_None
;
7417 #if PY_VERSION_HEX < 0x030400B1
7419 (*frame
)->f_tstate
= tstate
;
7422 __Pyx_PyFrame_SetLineNumber(*frame
, firstlineno
);
7425 tstate
->use_tracing
= 0;
7426 __Pyx_ErrFetchInState(tstate
, &type
, &value
, &traceback
);
7428 if (tstate
->c_tracefunc
)
7429 retval
= tstate
->c_tracefunc(tstate
->c_traceobj
, *frame
, PyTrace_CALL
, NULL
) == 0;
7430 if (retval
&& tstate
->c_profilefunc
)
7432 retval
= tstate
->c_profilefunc(tstate
->c_profileobj
, *frame
, PyTrace_CALL
, NULL
) == 0;
7433 tstate
->use_tracing
= (tstate
->c_profilefunc
||
7434 (CYTHON_TRACE
&& tstate
->c_tracefunc
));
7437 __Pyx_ErrRestoreInState(tstate
, type
, value
, traceback
);
7438 return tstate
->use_tracing
&& retval
;
7442 Py_XDECREF(traceback
);
7446 static PyCodeObject
*__Pyx_createFrameCodeObject(const char *funcname
, const char *srcfile
, int firstlineno
) {
7447 PyCodeObject
*py_code
= 0;
7448 #if PY_MAJOR_VERSION >= 3
7449 py_code
= PyCode_NewEmpty(srcfile
, funcname
, firstlineno
);
7450 if (likely(py_code
)) {
7451 py_code
->co_flags
|= CO_OPTIMIZED
| CO_NEWLOCALS
;
7454 PyObject
*py_srcfile
= 0;
7455 PyObject
*py_funcname
= 0;
7456 py_funcname
= PyString_FromString(funcname
);
7457 if (unlikely(!py_funcname
)) goto bad
;
7458 py_srcfile
= PyString_FromString(srcfile
);
7459 if (unlikely(!py_srcfile
)) goto bad
;
7460 py_code
= PyCode_New(
7464 CO_OPTIMIZED
| CO_NEWLOCALS
,
7465 __pyx_empty_bytes
, /*PyObject *code,*/
7466 __pyx_empty_tuple
, /*PyObject *consts,*/
7467 __pyx_empty_tuple
, /*PyObject *names,*/
7468 __pyx_empty_tuple
, /*PyObject *varnames,*/
7469 __pyx_empty_tuple
, /*PyObject *freevars,*/
7470 __pyx_empty_tuple
, /*PyObject *cellvars,*/
7471 py_srcfile
, /*PyObject *filename,*/
7472 py_funcname
, /*PyObject *name,*/
7474 __pyx_empty_bytes
/*PyObject *lnotab*/
7477 Py_XDECREF(py_srcfile
);
7478 Py_XDECREF(py_funcname
);
7484 /* PyDictVersioning */
7485 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
7486 static CYTHON_INLINE PY_UINT64_T
__Pyx_get_tp_dict_version(PyObject
*obj
) {
7487 PyObject
*dict
= Py_TYPE(obj
)->tp_dict
;
7488 return likely(dict
) ? __PYX_GET_DICT_VERSION(dict
) : 0;
7490 static CYTHON_INLINE PY_UINT64_T
__Pyx_get_object_dict_version(PyObject
*obj
) {
7491 PyObject
**dictptr
= NULL
;
7492 Py_ssize_t offset
= Py_TYPE(obj
)->tp_dictoffset
;
7494 #if CYTHON_COMPILING_IN_CPYTHON
7495 dictptr
= (likely(offset
> 0)) ? (PyObject
**) ((char *)obj
+ offset
) : _PyObject_GetDictPtr(obj
);
7497 dictptr
= _PyObject_GetDictPtr(obj
);
7500 return (dictptr
&& *dictptr
) ? __PYX_GET_DICT_VERSION(*dictptr
) : 0;
7502 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject
* obj
, PY_UINT64_T tp_dict_version
, PY_UINT64_T obj_dict_version
) {
7503 PyObject
*dict
= Py_TYPE(obj
)->tp_dict
;
7504 if (unlikely(!dict
) || unlikely(tp_dict_version
!= __PYX_GET_DICT_VERSION(dict
)))
7506 return obj_dict_version
== __Pyx_get_object_dict_version(obj
);
7510 /* PyObjectGetAttrStr */
7511 #if CYTHON_USE_TYPE_SLOTS
7512 static CYTHON_INLINE PyObject
* __Pyx_PyObject_GetAttrStr(PyObject
* obj
, PyObject
* attr_name
) {
7513 PyTypeObject
* tp
= Py_TYPE(obj
);
7514 if (likely(tp
->tp_getattro
))
7515 return tp
->tp_getattro(obj
, attr_name
);
7516 #if PY_MAJOR_VERSION < 3
7517 if (likely(tp
->tp_getattr
))
7518 return tp
->tp_getattr(obj
, PyString_AS_STRING(attr_name
));
7520 return PyObject_GetAttr(obj
, attr_name
);
7524 /* PyFunctionFastCall */
7525 #if CYTHON_FAST_PYCALL
7526 static PyObject
* __Pyx_PyFunction_FastCallNoKw(PyCodeObject
*co
, PyObject
**args
, Py_ssize_t na
,
7527 PyObject
*globals
) {
7529 PyThreadState
*tstate
= __Pyx_PyThreadState_Current
;
7530 PyObject
**fastlocals
;
7533 assert(globals
!= NULL
);
7534 /* XXX Perhaps we should create a specialized
7535 PyFrame_New() that doesn't take locals, but does
7536 take builtins without sanity checking them.
7538 assert(tstate
!= NULL
);
7539 f
= PyFrame_New(tstate
, co
, globals
, NULL
);
7543 fastlocals
= __Pyx_PyFrame_GetLocalsplus(f
);
7544 for (i
= 0; i
< na
; i
++) {
7546 fastlocals
[i
] = *args
++;
7548 result
= PyEval_EvalFrameEx(f
,0);
7549 ++tstate
->recursion_depth
;
7551 --tstate
->recursion_depth
;
7554 #if 1 || PY_VERSION_HEX < 0x030600B1
7555 static PyObject
*__Pyx_PyFunction_FastCallDict(PyObject
*func
, PyObject
**args
, Py_ssize_t nargs
, PyObject
*kwargs
) {
7556 PyCodeObject
*co
= (PyCodeObject
*)PyFunction_GET_CODE(func
);
7557 PyObject
*globals
= PyFunction_GET_GLOBALS(func
);
7558 PyObject
*argdefs
= PyFunction_GET_DEFAULTS(func
);
7560 #if PY_MAJOR_VERSION >= 3
7563 PyObject
*kwtuple
, **k
;
7568 assert(kwargs
== NULL
|| PyDict_Check(kwargs
));
7569 nk
= kwargs
? PyDict_Size(kwargs
) : 0;
7570 if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
7574 #if PY_MAJOR_VERSION >= 3
7575 co
->co_kwonlyargcount
== 0 &&
7577 likely(kwargs
== NULL
|| nk
== 0) &&
7578 co
->co_flags
== (CO_OPTIMIZED
| CO_NEWLOCALS
| CO_NOFREE
)) {
7579 if (argdefs
== NULL
&& co
->co_argcount
== nargs
) {
7580 result
= __Pyx_PyFunction_FastCallNoKw(co
, args
, nargs
, globals
);
7583 else if (nargs
== 0 && argdefs
!= NULL
7584 && co
->co_argcount
== Py_SIZE(argdefs
)) {
7585 /* function called with no arguments, but all parameters have
7586 a default value: use default values as arguments .*/
7587 args
= &PyTuple_GET_ITEM(argdefs
, 0);
7588 result
=__Pyx_PyFunction_FastCallNoKw(co
, args
, Py_SIZE(argdefs
), globals
);
7592 if (kwargs
!= NULL
) {
7594 kwtuple
= PyTuple_New(2 * nk
);
7595 if (kwtuple
== NULL
) {
7599 k
= &PyTuple_GET_ITEM(kwtuple
, 0);
7601 while (PyDict_Next(kwargs
, &pos
, &k
[i
], &k
[i
+1])) {
7612 closure
= PyFunction_GET_CLOSURE(func
);
7613 #if PY_MAJOR_VERSION >= 3
7614 kwdefs
= PyFunction_GET_KW_DEFAULTS(func
);
7616 if (argdefs
!= NULL
) {
7617 d
= &PyTuple_GET_ITEM(argdefs
, 0);
7618 nd
= Py_SIZE(argdefs
);
7624 #if PY_MAJOR_VERSION >= 3
7625 result
= PyEval_EvalCodeEx((PyObject
*)co
, globals
, (PyObject
*)NULL
,
7628 d
, (int)nd
, kwdefs
, closure
);
7630 result
= PyEval_EvalCodeEx(co
, globals
, (PyObject
*)NULL
,
7633 d
, (int)nd
, closure
);
7635 Py_XDECREF(kwtuple
);
7637 Py_LeaveRecursiveCall();
7643 /* PyCFunctionFastCall */
7644 #if CYTHON_FAST_PYCCALL
7645 static CYTHON_INLINE PyObject
* __Pyx_PyCFunction_FastCall(PyObject
*func_obj
, PyObject
**args
, Py_ssize_t nargs
) {
7646 PyCFunctionObject
*func
= (PyCFunctionObject
*)func_obj
;
7647 PyCFunction meth
= PyCFunction_GET_FUNCTION(func
);
7648 PyObject
*self
= PyCFunction_GET_SELF(func
);
7649 int flags
= PyCFunction_GET_FLAGS(func
);
7650 assert(PyCFunction_Check(func
));
7651 assert(METH_FASTCALL
== (flags
& ~(METH_CLASS
| METH_STATIC
| METH_COEXIST
| METH_KEYWORDS
| METH_STACKLESS
)));
7653 assert(nargs
== 0 || args
!= NULL
);
7654 /* _PyCFunction_FastCallDict() must not be called with an exception set,
7655 because it may clear it (directly or indirectly) and so the
7656 caller loses its exception */
7657 assert(!PyErr_Occurred());
7658 if ((PY_VERSION_HEX
< 0x030700A0) || unlikely(flags
& METH_KEYWORDS
)) {
7659 return (*((__Pyx_PyCFunctionFastWithKeywords
)(void*)meth
)) (self
, args
, nargs
, NULL
);
7661 return (*((__Pyx_PyCFunctionFast
)(void*)meth
)) (self
, args
, nargs
);
7667 #if CYTHON_COMPILING_IN_CPYTHON
7668 static CYTHON_INLINE PyObject
* __Pyx_PyObject_Call(PyObject
*func
, PyObject
*arg
, PyObject
*kw
) {
7670 ternaryfunc call
= func
->ob_type
->tp_call
;
7671 if (unlikely(!call
))
7672 return PyObject_Call(func
, arg
, kw
);
7673 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
7675 result
= (*call
)(func
, arg
, kw
);
7676 Py_LeaveRecursiveCall();
7677 if (unlikely(!result
) && unlikely(!PyErr_Occurred())) {
7680 "NULL result without error in PyObject_Call");
7687 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
7688 static PyObject
*__Pyx_PyDict_GetItem(PyObject
*d
, PyObject
* key
) {
7690 value
= PyDict_GetItemWithError(d
, key
);
7691 if (unlikely(!value
)) {
7692 if (!PyErr_Occurred()) {
7693 if (unlikely(PyTuple_Check(key
))) {
7694 PyObject
* args
= PyTuple_Pack(1, key
);
7696 PyErr_SetObject(PyExc_KeyError
, args
);
7700 PyErr_SetObject(PyExc_KeyError
, key
);
7710 /* GetBuiltinName */
7711 static PyObject
*__Pyx_GetBuiltinName(PyObject
*name
) {
7712 PyObject
* result
= __Pyx_PyObject_GetAttrStr(__pyx_b
, name
);
7713 if (unlikely(!result
)) {
7714 PyErr_Format(PyExc_NameError
,
7715 #if PY_MAJOR_VERSION >= 3
7716 "name '%U' is not defined", name
);
7718 "name '%.200s' is not defined", PyString_AS_STRING(name
));
7724 /* GetModuleGlobalName */
7725 #if CYTHON_USE_DICT_VERSIONS
7726 static PyObject
*__Pyx__GetModuleGlobalName(PyObject
*name
, PY_UINT64_T
*dict_version
, PyObject
**dict_cached_value
)
7728 static CYTHON_INLINE PyObject
*__Pyx__GetModuleGlobalName(PyObject
*name
)
7732 #if !CYTHON_AVOID_BORROWED_REFS
7733 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
7734 result
= _PyDict_GetItem_KnownHash(__pyx_d
, name
, ((PyASCIIObject
*) name
)->hash
);
7735 __PYX_UPDATE_DICT_CACHE(__pyx_d
, result
, *dict_cached_value
, *dict_version
)
7736 if (likely(result
)) {
7737 return __Pyx_NewRef(result
);
7738 } else if (unlikely(PyErr_Occurred())) {
7742 result
= PyDict_GetItem(__pyx_d
, name
);
7743 __PYX_UPDATE_DICT_CACHE(__pyx_d
, result
, *dict_cached_value
, *dict_version
)
7744 if (likely(result
)) {
7745 return __Pyx_NewRef(result
);
7749 result
= PyObject_GetItem(__pyx_d
, name
);
7750 __PYX_UPDATE_DICT_CACHE(__pyx_d
, result
, *dict_cached_value
, *dict_version
)
7751 if (likely(result
)) {
7752 return __Pyx_NewRef(result
);
7756 return __Pyx_GetBuiltinName(name
);
7759 /* WriteUnraisableException */
7760 static void __Pyx_WriteUnraisable(const char *name
, CYTHON_UNUSED
int clineno
,
7761 CYTHON_UNUSED
int lineno
, CYTHON_UNUSED
const char *filename
,
7762 int full_traceback
, CYTHON_UNUSED
int nogil
) {
7763 PyObject
*old_exc
, *old_val
, *old_tb
;
7765 __Pyx_PyThreadState_declare
7767 PyGILState_STATE state
;
7769 state
= PyGILState_Ensure();
7771 else state
= (PyGILState_STATE
)-1;
7774 __Pyx_PyThreadState_assign
7775 __Pyx_ErrFetch(&old_exc
, &old_val
, &old_tb
);
7776 if (full_traceback
) {
7777 Py_XINCREF(old_exc
);
7778 Py_XINCREF(old_val
);
7780 __Pyx_ErrRestore(old_exc
, old_val
, old_tb
);
7783 #if PY_MAJOR_VERSION < 3
7784 ctx
= PyString_FromString(name
);
7786 ctx
= PyUnicode_FromString(name
);
7788 __Pyx_ErrRestore(old_exc
, old_val
, old_tb
);
7790 PyErr_WriteUnraisable(Py_None
);
7792 PyErr_WriteUnraisable(ctx
);
7797 PyGILState_Release(state
);
7801 /* RaiseDoubleKeywords */
7802 static void __Pyx_RaiseDoubleKeywordsError(
7803 const char* func_name
,
7806 PyErr_Format(PyExc_TypeError
,
7807 #if PY_MAJOR_VERSION >= 3
7808 "%s() got multiple values for keyword argument '%U'", func_name
, kw_name
);
7810 "%s() got multiple values for keyword argument '%s'", func_name
,
7811 PyString_AsString(kw_name
));
7816 static int __Pyx_ParseOptionalKeywords(
7818 PyObject
**argnames
[],
7821 Py_ssize_t num_pos_args
,
7822 const char* function_name
)
7824 PyObject
*key
= 0, *value
= 0;
7827 PyObject
*** first_kw_arg
= argnames
+ num_pos_args
;
7828 while (PyDict_Next(kwds
, &pos
, &key
, &value
)) {
7829 name
= first_kw_arg
;
7830 while (*name
&& (**name
!= key
)) name
++;
7832 values
[name
-argnames
] = value
;
7835 name
= first_kw_arg
;
7836 #if PY_MAJOR_VERSION < 3
7837 if (likely(PyString_CheckExact(key
)) || likely(PyString_Check(key
))) {
7839 if ((CYTHON_COMPILING_IN_PYPY
|| PyString_GET_SIZE(**name
) == PyString_GET_SIZE(key
))
7840 && _PyString_Eq(**name
, key
)) {
7841 values
[name
-argnames
] = value
;
7846 if (*name
) continue;
7848 PyObject
*** argname
= argnames
;
7849 while (argname
!= first_kw_arg
) {
7850 if ((**argname
== key
) || (
7851 (CYTHON_COMPILING_IN_PYPY
|| PyString_GET_SIZE(**argname
) == PyString_GET_SIZE(key
))
7852 && _PyString_Eq(**argname
, key
))) {
7853 goto arg_passed_twice
;
7860 if (likely(PyUnicode_Check(key
))) {
7862 int cmp
= (**name
== key
) ? 0 :
7863 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
7864 (PyUnicode_GET_SIZE(**name
) != PyUnicode_GET_SIZE(key
)) ? 1 :
7866 PyUnicode_Compare(**name
, key
);
7867 if (cmp
< 0 && unlikely(PyErr_Occurred())) goto bad
;
7869 values
[name
-argnames
] = value
;
7874 if (*name
) continue;
7876 PyObject
*** argname
= argnames
;
7877 while (argname
!= first_kw_arg
) {
7878 int cmp
= (**argname
== key
) ? 0 :
7879 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
7880 (PyUnicode_GET_SIZE(**argname
) != PyUnicode_GET_SIZE(key
)) ? 1 :
7882 PyUnicode_Compare(**argname
, key
);
7883 if (cmp
< 0 && unlikely(PyErr_Occurred())) goto bad
;
7884 if (cmp
== 0) goto arg_passed_twice
;
7889 goto invalid_keyword_type
;
7891 if (unlikely(PyDict_SetItem(kwds2
, key
, value
))) goto bad
;
7893 goto invalid_keyword
;
7898 __Pyx_RaiseDoubleKeywordsError(function_name
, key
);
7900 invalid_keyword_type
:
7901 PyErr_Format(PyExc_TypeError
,
7902 "%.200s() keywords must be strings", function_name
);
7905 PyErr_Format(PyExc_TypeError
,
7906 #if PY_MAJOR_VERSION < 3
7907 "%.200s() got an unexpected keyword argument '%.200s'",
7908 function_name
, PyString_AsString(key
));
7910 "%s() got an unexpected keyword argument '%U'",
7911 function_name
, key
);
7917 /* PyErrExceptionMatches */
7918 #if CYTHON_FAST_THREAD_STATE
7919 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject
*exc_type
, PyObject
*tuple
) {
7921 n
= PyTuple_GET_SIZE(tuple
);
7922 #if PY_MAJOR_VERSION >= 3
7923 for (i
=0; i
<n
; i
++) {
7924 if (exc_type
== PyTuple_GET_ITEM(tuple
, i
)) return 1;
7927 for (i
=0; i
<n
; i
++) {
7928 if (__Pyx_PyErr_GivenExceptionMatches(exc_type
, PyTuple_GET_ITEM(tuple
, i
))) return 1;
7932 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState
* tstate
, PyObject
* err
) {
7933 PyObject
*exc_type
= tstate
->curexc_type
;
7934 if (exc_type
== err
) return 1;
7935 if (unlikely(!exc_type
)) return 0;
7936 if (unlikely(PyTuple_Check(err
)))
7937 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type
, err
);
7938 return __Pyx_PyErr_GivenExceptionMatches(exc_type
, err
);
7943 static CYTHON_INLINE PyObject
*__Pyx_GetAttr(PyObject
*o
, PyObject
*n
) {
7944 #if CYTHON_USE_TYPE_SLOTS
7945 #if PY_MAJOR_VERSION >= 3
7946 if (likely(PyUnicode_Check(n
)))
7948 if (likely(PyString_Check(n
)))
7950 return __Pyx_PyObject_GetAttrStr(o
, n
);
7952 return PyObject_GetAttr(o
, n
);
7956 static PyObject
*__Pyx_GetAttr3Default(PyObject
*d
) {
7957 __Pyx_PyThreadState_declare
7958 __Pyx_PyThreadState_assign
7959 if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError
)))
7961 __Pyx_PyErr_Clear();
7965 static CYTHON_INLINE PyObject
*__Pyx_GetAttr3(PyObject
*o
, PyObject
*n
, PyObject
*d
) {
7966 PyObject
*r
= __Pyx_GetAttr(o
, n
);
7967 return (likely(r
)) ? r
: __Pyx_GetAttr3Default(d
);
7971 static PyObject
*__Pyx_Import(PyObject
*name
, PyObject
*from_list
, int level
) {
7972 PyObject
*empty_list
= 0;
7973 PyObject
*module
= 0;
7974 PyObject
*global_dict
= 0;
7975 PyObject
*empty_dict
= 0;
7977 #if PY_MAJOR_VERSION < 3
7978 PyObject
*py_import
;
7979 py_import
= __Pyx_PyObject_GetAttrStr(__pyx_b
, __pyx_n_s_import
);
7986 empty_list
= PyList_New(0);
7991 global_dict
= PyModule_GetDict(__pyx_m
);
7994 empty_dict
= PyDict_New();
7998 #if PY_MAJOR_VERSION >= 3
8000 if (strchr(__Pyx_MODULE_NAME
, '.')) {
8001 module
= PyImport_ImportModuleLevelObject(
8002 name
, global_dict
, empty_dict
, list
, 1);
8004 if (!PyErr_ExceptionMatches(PyExc_ImportError
))
8013 #if PY_MAJOR_VERSION < 3
8014 PyObject
*py_level
= PyInt_FromLong(level
);
8017 module
= PyObject_CallFunctionObjArgs(py_import
,
8018 name
, global_dict
, empty_dict
, list
, py_level
, (PyObject
*)NULL
);
8019 Py_DECREF(py_level
);
8021 module
= PyImport_ImportModuleLevelObject(
8022 name
, global_dict
, empty_dict
, list
, level
);
8027 #if PY_MAJOR_VERSION < 3
8028 Py_XDECREF(py_import
);
8030 Py_XDECREF(empty_list
);
8031 Py_XDECREF(empty_dict
);
8036 static PyObject
* __Pyx_ImportFrom(PyObject
* module
, PyObject
* name
) {
8037 PyObject
* value
= __Pyx_PyObject_GetAttrStr(module
, name
);
8038 if (unlikely(!value
) && PyErr_ExceptionMatches(PyExc_AttributeError
)) {
8039 PyErr_Format(PyExc_ImportError
,
8040 #if PY_MAJOR_VERSION < 3
8041 "cannot import name %.230s", PyString_AS_STRING(name
));
8043 "cannot import name %S", name
);
8049 /* PyObjectCall2Args */
8050 static CYTHON_UNUSED PyObject
* __Pyx_PyObject_Call2Args(PyObject
* function
, PyObject
* arg1
, PyObject
* arg2
) {
8051 PyObject
*args
, *result
= NULL
;
8052 #if CYTHON_FAST_PYCALL
8053 if (PyFunction_Check(function
)) {
8054 PyObject
*args
[2] = {arg1
, arg2
};
8055 return __Pyx_PyFunction_FastCall(function
, args
, 2);
8058 #if CYTHON_FAST_PYCCALL
8059 if (__Pyx_PyFastCFunction_Check(function
)) {
8060 PyObject
*args
[2] = {arg1
, arg2
};
8061 return __Pyx_PyCFunction_FastCall(function
, args
, 2);
8064 args
= PyTuple_New(2);
8065 if (unlikely(!args
)) goto done
;
8067 PyTuple_SET_ITEM(args
, 0, arg1
);
8069 PyTuple_SET_ITEM(args
, 1, arg2
);
8070 Py_INCREF(function
);
8071 result
= __Pyx_PyObject_Call(function
, args
, NULL
);
8073 Py_DECREF(function
);
8078 /* PyObjectCallMethO */
8079 #if CYTHON_COMPILING_IN_CPYTHON
8080 static CYTHON_INLINE PyObject
* __Pyx_PyObject_CallMethO(PyObject
*func
, PyObject
*arg
) {
8081 PyObject
*self
, *result
;
8083 cfunc
= PyCFunction_GET_FUNCTION(func
);
8084 self
= PyCFunction_GET_SELF(func
);
8085 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
8087 result
= cfunc(self
, arg
);
8088 Py_LeaveRecursiveCall();
8089 if (unlikely(!result
) && unlikely(!PyErr_Occurred())) {
8092 "NULL result without error in PyObject_Call");
8098 /* PyObjectCallOneArg */
8099 #if CYTHON_COMPILING_IN_CPYTHON
8100 static PyObject
* __Pyx__PyObject_CallOneArg(PyObject
*func
, PyObject
*arg
) {
8102 PyObject
*args
= PyTuple_New(1);
8103 if (unlikely(!args
)) return NULL
;
8105 PyTuple_SET_ITEM(args
, 0, arg
);
8106 result
= __Pyx_PyObject_Call(func
, args
, NULL
);
8110 static CYTHON_INLINE PyObject
* __Pyx_PyObject_CallOneArg(PyObject
*func
, PyObject
*arg
) {
8111 #if CYTHON_FAST_PYCALL
8112 if (PyFunction_Check(func
)) {
8113 return __Pyx_PyFunction_FastCall(func
, &arg
, 1);
8116 if (likely(PyCFunction_Check(func
))) {
8117 if (likely(PyCFunction_GET_FLAGS(func
) & METH_O
)) {
8118 return __Pyx_PyObject_CallMethO(func
, arg
);
8119 #if CYTHON_FAST_PYCCALL
8120 } else if (PyCFunction_GET_FLAGS(func
) & METH_FASTCALL
) {
8121 return __Pyx_PyCFunction_FastCall(func
, &arg
, 1);
8125 return __Pyx__PyObject_CallOneArg(func
, arg
);
8128 static CYTHON_INLINE PyObject
* __Pyx_PyObject_CallOneArg(PyObject
*func
, PyObject
*arg
) {
8130 PyObject
*args
= PyTuple_Pack(1, arg
);
8131 if (unlikely(!args
)) return NULL
;
8132 result
= __Pyx_PyObject_Call(func
, args
, NULL
);
8138 /* RaiseException */
8139 #if PY_MAJOR_VERSION < 3
8140 static void __Pyx_Raise(PyObject
*type
, PyObject
*value
, PyObject
*tb
,
8141 CYTHON_UNUSED PyObject
*cause
) {
8142 __Pyx_PyThreadState_declare
8144 if (!value
|| value
== Py_None
)
8148 if (!tb
|| tb
== Py_None
)
8152 if (!PyTraceBack_Check(tb
)) {
8153 PyErr_SetString(PyExc_TypeError
,
8154 "raise: arg 3 must be a traceback or None");
8158 if (PyType_Check(type
)) {
8159 #if CYTHON_COMPILING_IN_PYPY
8165 PyErr_NormalizeException(&type
, &value
, &tb
);
8168 PyErr_SetString(PyExc_TypeError
,
8169 "instance exception may not have a separate value");
8173 type
= (PyObject
*) Py_TYPE(type
);
8175 if (!PyType_IsSubtype((PyTypeObject
*)type
, (PyTypeObject
*)PyExc_BaseException
)) {
8176 PyErr_SetString(PyExc_TypeError
,
8177 "raise: exception class must be a subclass of BaseException");
8181 __Pyx_PyThreadState_assign
8182 __Pyx_ErrRestore(type
, value
, tb
);
8191 static void __Pyx_Raise(PyObject
*type
, PyObject
*value
, PyObject
*tb
, PyObject
*cause
) {
8192 PyObject
* owned_instance
= NULL
;
8193 if (tb
== Py_None
) {
8195 } else if (tb
&& !PyTraceBack_Check(tb
)) {
8196 PyErr_SetString(PyExc_TypeError
,
8197 "raise: arg 3 must be a traceback or None");
8200 if (value
== Py_None
)
8202 if (PyExceptionInstance_Check(type
)) {
8204 PyErr_SetString(PyExc_TypeError
,
8205 "instance exception may not have a separate value");
8209 type
= (PyObject
*) Py_TYPE(value
);
8210 } else if (PyExceptionClass_Check(type
)) {
8211 PyObject
*instance_class
= NULL
;
8212 if (value
&& PyExceptionInstance_Check(value
)) {
8213 instance_class
= (PyObject
*) Py_TYPE(value
);
8214 if (instance_class
!= type
) {
8215 int is_subclass
= PyObject_IsSubclass(instance_class
, type
);
8217 instance_class
= NULL
;
8218 } else if (unlikely(is_subclass
== -1)) {
8221 type
= instance_class
;
8225 if (!instance_class
) {
8228 args
= PyTuple_New(0);
8229 else if (PyTuple_Check(value
)) {
8233 args
= PyTuple_Pack(1, value
);
8236 owned_instance
= PyObject_Call(type
, args
, NULL
);
8238 if (!owned_instance
)
8240 value
= owned_instance
;
8241 if (!PyExceptionInstance_Check(value
)) {
8242 PyErr_Format(PyExc_TypeError
,
8243 "calling %R should have returned an instance of "
8244 "BaseException, not %R",
8245 type
, Py_TYPE(value
));
8250 PyErr_SetString(PyExc_TypeError
,
8251 "raise: exception class must be a subclass of BaseException");
8255 PyObject
*fixed_cause
;
8256 if (cause
== Py_None
) {
8258 } else if (PyExceptionClass_Check(cause
)) {
8259 fixed_cause
= PyObject_CallObject(cause
, NULL
);
8260 if (fixed_cause
== NULL
)
8262 } else if (PyExceptionInstance_Check(cause
)) {
8263 fixed_cause
= cause
;
8264 Py_INCREF(fixed_cause
);
8266 PyErr_SetString(PyExc_TypeError
,
8267 "exception causes must derive from "
8271 PyException_SetCause(value
, fixed_cause
);
8273 PyErr_SetObject(type
, value
);
8275 #if CYTHON_COMPILING_IN_PYPY
8276 PyObject
*tmp_type
, *tmp_value
, *tmp_tb
;
8277 PyErr_Fetch(&tmp_type
, &tmp_value
, &tmp_tb
);
8279 PyErr_Restore(tmp_type
, tmp_value
, tb
);
8282 PyThreadState
*tstate
= __Pyx_PyThreadState_Current
;
8283 PyObject
* tmp_tb
= tstate
->curexc_traceback
;
8286 tstate
->curexc_traceback
= tb
;
8292 Py_XDECREF(owned_instance
);
8298 static PyObject
*__Pyx_GetItemInt_Generic(PyObject
*o
, PyObject
* j
) {
8300 if (!j
) return NULL
;
8301 r
= PyObject_GetItem(o
, j
);
8305 static CYTHON_INLINE PyObject
*__Pyx_GetItemInt_List_Fast(PyObject
*o
, Py_ssize_t i
,
8306 CYTHON_NCP_UNUSED
int wraparound
,
8307 CYTHON_NCP_UNUSED
int boundscheck
) {
8308 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8309 Py_ssize_t wrapped_i
= i
;
8310 if (wraparound
& unlikely(i
< 0)) {
8311 wrapped_i
+= PyList_GET_SIZE(o
);
8313 if ((!boundscheck
) || likely(__Pyx_is_valid_index(wrapped_i
, PyList_GET_SIZE(o
)))) {
8314 PyObject
*r
= PyList_GET_ITEM(o
, wrapped_i
);
8318 return __Pyx_GetItemInt_Generic(o
, PyInt_FromSsize_t(i
));
8320 return PySequence_GetItem(o
, i
);
8323 static CYTHON_INLINE PyObject
*__Pyx_GetItemInt_Tuple_Fast(PyObject
*o
, Py_ssize_t i
,
8324 CYTHON_NCP_UNUSED
int wraparound
,
8325 CYTHON_NCP_UNUSED
int boundscheck
) {
8326 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8327 Py_ssize_t wrapped_i
= i
;
8328 if (wraparound
& unlikely(i
< 0)) {
8329 wrapped_i
+= PyTuple_GET_SIZE(o
);
8331 if ((!boundscheck
) || likely(__Pyx_is_valid_index(wrapped_i
, PyTuple_GET_SIZE(o
)))) {
8332 PyObject
*r
= PyTuple_GET_ITEM(o
, wrapped_i
);
8336 return __Pyx_GetItemInt_Generic(o
, PyInt_FromSsize_t(i
));
8338 return PySequence_GetItem(o
, i
);
8341 static CYTHON_INLINE PyObject
*__Pyx_GetItemInt_Fast(PyObject
*o
, Py_ssize_t i
, int is_list
,
8342 CYTHON_NCP_UNUSED
int wraparound
,
8343 CYTHON_NCP_UNUSED
int boundscheck
) {
8344 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
8345 if (is_list
|| PyList_CheckExact(o
)) {
8346 Py_ssize_t n
= ((!wraparound
) | likely(i
>= 0)) ? i
: i
+ PyList_GET_SIZE(o
);
8347 if ((!boundscheck
) || (likely(__Pyx_is_valid_index(n
, PyList_GET_SIZE(o
))))) {
8348 PyObject
*r
= PyList_GET_ITEM(o
, n
);
8353 else if (PyTuple_CheckExact(o
)) {
8354 Py_ssize_t n
= ((!wraparound
) | likely(i
>= 0)) ? i
: i
+ PyTuple_GET_SIZE(o
);
8355 if ((!boundscheck
) || likely(__Pyx_is_valid_index(n
, PyTuple_GET_SIZE(o
)))) {
8356 PyObject
*r
= PyTuple_GET_ITEM(o
, n
);
8361 PySequenceMethods
*m
= Py_TYPE(o
)->tp_as_sequence
;
8362 if (likely(m
&& m
->sq_item
)) {
8363 if (wraparound
&& unlikely(i
< 0) && likely(m
->sq_length
)) {
8364 Py_ssize_t l
= m
->sq_length(o
);
8365 if (likely(l
>= 0)) {
8368 if (!PyErr_ExceptionMatches(PyExc_OverflowError
))
8373 return m
->sq_item(o
, i
);
8377 if (is_list
|| PySequence_Check(o
)) {
8378 return PySequence_GetItem(o
, i
);
8381 return __Pyx_GetItemInt_Generic(o
, PyInt_FromSsize_t(i
));
8385 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject
*o
, PyObject
*n
) {
8387 if (unlikely(!__Pyx_PyBaseString_Check(n
))) {
8388 PyErr_SetString(PyExc_TypeError
,
8389 "hasattr(): attribute name must be string");
8392 r
= __Pyx_GetAttr(o
, n
);
8402 /* PyObject_GenericGetAttrNoDict */
8403 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
8404 static PyObject
*__Pyx_RaiseGenericGetAttributeError(PyTypeObject
*tp
, PyObject
*attr_name
) {
8405 PyErr_Format(PyExc_AttributeError
,
8406 #if PY_MAJOR_VERSION >= 3
8407 "'%.50s' object has no attribute '%U'",
8408 tp
->tp_name
, attr_name
);
8410 "'%.50s' object has no attribute '%.400s'",
8411 tp
->tp_name
, PyString_AS_STRING(attr_name
));
8415 static CYTHON_INLINE PyObject
* __Pyx_PyObject_GenericGetAttrNoDict(PyObject
* obj
, PyObject
* attr_name
) {
8417 PyTypeObject
*tp
= Py_TYPE(obj
);
8418 if (unlikely(!PyString_Check(attr_name
))) {
8419 return PyObject_GenericGetAttr(obj
, attr_name
);
8421 assert(!tp
->tp_dictoffset
);
8422 descr
= _PyType_Lookup(tp
, attr_name
);
8423 if (unlikely(!descr
)) {
8424 return __Pyx_RaiseGenericGetAttributeError(tp
, attr_name
);
8427 #if PY_MAJOR_VERSION < 3
8428 if (likely(PyType_HasFeature(Py_TYPE(descr
), Py_TPFLAGS_HAVE_CLASS
)))
8431 descrgetfunc f
= Py_TYPE(descr
)->tp_descr_get
;
8433 PyObject
*res
= f(descr
, obj
, (PyObject
*)tp
);
8442 /* PyObject_GenericGetAttr */
8443 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
8444 static PyObject
* __Pyx_PyObject_GenericGetAttr(PyObject
* obj
, PyObject
* attr_name
) {
8445 if (unlikely(Py_TYPE(obj
)->tp_dictoffset
)) {
8446 return PyObject_GenericGetAttr(obj
, attr_name
);
8448 return __Pyx_PyObject_GenericGetAttrNoDict(obj
, attr_name
);
8453 static int __Pyx_SetVtable(PyObject
*dict
, void *vtable
) {
8454 #if PY_VERSION_HEX >= 0x02070000
8455 PyObject
*ob
= PyCapsule_New(vtable
, 0, 0);
8457 PyObject
*ob
= PyCObject_FromVoidPtr(vtable
, 0);
8461 if (PyDict_SetItem(dict
, __pyx_n_s_pyx_vtable
, ob
) < 0)
8471 static int __Pyx_setup_reduce_is_named(PyObject
* meth
, PyObject
* name
) {
8473 PyObject
*name_attr
;
8474 name_attr
= __Pyx_PyObject_GetAttrStr(meth
, __pyx_n_s_name
);
8475 if (likely(name_attr
)) {
8476 ret
= PyObject_RichCompareBool(name_attr
, name
, Py_EQ
);
8480 if (unlikely(ret
< 0)) {
8484 Py_XDECREF(name_attr
);
8487 static int __Pyx_setup_reduce(PyObject
* type_obj
) {
8489 PyObject
*object_reduce
= NULL
;
8490 PyObject
*object_reduce_ex
= NULL
;
8491 PyObject
*reduce
= NULL
;
8492 PyObject
*reduce_ex
= NULL
;
8493 PyObject
*reduce_cython
= NULL
;
8494 PyObject
*setstate
= NULL
;
8495 PyObject
*setstate_cython
= NULL
;
8496 #if CYTHON_USE_PYTYPE_LOOKUP
8497 if (_PyType_Lookup((PyTypeObject
*)type_obj
, __pyx_n_s_getstate
)) goto GOOD
;
8499 if (PyObject_HasAttr(type_obj
, __pyx_n_s_getstate
)) goto GOOD
;
8501 #if CYTHON_USE_PYTYPE_LOOKUP
8502 object_reduce_ex
= _PyType_Lookup(&PyBaseObject_Type
, __pyx_n_s_reduce_ex
); if (!object_reduce_ex
) goto BAD
;
8504 object_reduce_ex
= __Pyx_PyObject_GetAttrStr((PyObject
*)&PyBaseObject_Type
, __pyx_n_s_reduce_ex
); if (!object_reduce_ex
) goto BAD
;
8506 reduce_ex
= __Pyx_PyObject_GetAttrStr(type_obj
, __pyx_n_s_reduce_ex
); if (unlikely(!reduce_ex
)) goto BAD
;
8507 if (reduce_ex
== object_reduce_ex
) {
8508 #if CYTHON_USE_PYTYPE_LOOKUP
8509 object_reduce
= _PyType_Lookup(&PyBaseObject_Type
, __pyx_n_s_reduce
); if (!object_reduce
) goto BAD
;
8511 object_reduce
= __Pyx_PyObject_GetAttrStr((PyObject
*)&PyBaseObject_Type
, __pyx_n_s_reduce
); if (!object_reduce
) goto BAD
;
8513 reduce
= __Pyx_PyObject_GetAttrStr(type_obj
, __pyx_n_s_reduce
); if (unlikely(!reduce
)) goto BAD
;
8514 if (reduce
== object_reduce
|| __Pyx_setup_reduce_is_named(reduce
, __pyx_n_s_reduce_cython
)) {
8515 reduce_cython
= __Pyx_PyObject_GetAttrStr(type_obj
, __pyx_n_s_reduce_cython
); if (unlikely(!reduce_cython
)) goto BAD
;
8516 ret
= PyDict_SetItem(((PyTypeObject
*)type_obj
)->tp_dict
, __pyx_n_s_reduce
, reduce_cython
); if (unlikely(ret
< 0)) goto BAD
;
8517 ret
= PyDict_DelItem(((PyTypeObject
*)type_obj
)->tp_dict
, __pyx_n_s_reduce_cython
); if (unlikely(ret
< 0)) goto BAD
;
8518 setstate
= __Pyx_PyObject_GetAttrStr(type_obj
, __pyx_n_s_setstate
);
8519 if (!setstate
) PyErr_Clear();
8520 if (!setstate
|| __Pyx_setup_reduce_is_named(setstate
, __pyx_n_s_setstate_cython
)) {
8521 setstate_cython
= __Pyx_PyObject_GetAttrStr(type_obj
, __pyx_n_s_setstate_cython
); if (unlikely(!setstate_cython
)) goto BAD
;
8522 ret
= PyDict_SetItem(((PyTypeObject
*)type_obj
)->tp_dict
, __pyx_n_s_setstate
, setstate_cython
); if (unlikely(ret
< 0)) goto BAD
;
8523 ret
= PyDict_DelItem(((PyTypeObject
*)type_obj
)->tp_dict
, __pyx_n_s_setstate_cython
); if (unlikely(ret
< 0)) goto BAD
;
8525 PyType_Modified((PyTypeObject
*)type_obj
);
8530 if (!PyErr_Occurred())
8531 PyErr_Format(PyExc_RuntimeError
, "Unable to initialize pickling for %s", ((PyTypeObject
*)type_obj
)->tp_name
);
8534 #if !CYTHON_USE_PYTYPE_LOOKUP
8535 Py_XDECREF(object_reduce
);
8536 Py_XDECREF(object_reduce_ex
);
8539 Py_XDECREF(reduce_ex
);
8540 Py_XDECREF(reduce_cython
);
8541 Py_XDECREF(setstate
);
8542 Py_XDECREF(setstate_cython
);
8546 /* CLineInTraceback */
8547 #ifndef CYTHON_CLINE_IN_TRACEBACK
8548 static int __Pyx_CLineForTraceback(PyThreadState
*tstate
, int c_line
) {
8549 PyObject
*use_cline
;
8550 PyObject
*ptype
, *pvalue
, *ptraceback
;
8551 #if CYTHON_COMPILING_IN_CPYTHON
8552 PyObject
**cython_runtime_dict
;
8554 if (unlikely(!__pyx_cython_runtime
)) {
8557 __Pyx_ErrFetchInState(tstate
, &ptype
, &pvalue
, &ptraceback
);
8558 #if CYTHON_COMPILING_IN_CPYTHON
8559 cython_runtime_dict
= _PyObject_GetDictPtr(__pyx_cython_runtime
);
8560 if (likely(cython_runtime_dict
)) {
8561 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
8562 use_cline
, *cython_runtime_dict
,
8563 __Pyx_PyDict_GetItemStr(*cython_runtime_dict
, __pyx_n_s_cline_in_traceback
))
8567 PyObject
*use_cline_obj
= __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime
, __pyx_n_s_cline_in_traceback
);
8568 if (use_cline_obj
) {
8569 use_cline
= PyObject_Not(use_cline_obj
) ? Py_False
: Py_True
;
8570 Py_DECREF(use_cline_obj
);
8578 PyObject_SetAttr(__pyx_cython_runtime
, __pyx_n_s_cline_in_traceback
, Py_False
);
8580 else if (use_cline
== Py_False
|| (use_cline
!= Py_True
&& PyObject_Not(use_cline
) != 0)) {
8583 __Pyx_ErrRestoreInState(tstate
, ptype
, pvalue
, ptraceback
);
8588 /* CodeObjectCache */
8589 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry
* entries
, int count
, int code_line
) {
8590 int start
= 0, mid
= 0, end
= count
- 1;
8591 if (end
>= 0 && code_line
> entries
[end
].code_line
) {
8594 while (start
< end
) {
8595 mid
= start
+ (end
- start
) / 2;
8596 if (code_line
< entries
[mid
].code_line
) {
8598 } else if (code_line
> entries
[mid
].code_line
) {
8604 if (code_line
<= entries
[mid
].code_line
) {
8610 static PyCodeObject
*__pyx_find_code_object(int code_line
) {
8611 PyCodeObject
* code_object
;
8613 if (unlikely(!code_line
) || unlikely(!__pyx_code_cache
.entries
)) {
8616 pos
= __pyx_bisect_code_objects(__pyx_code_cache
.entries
, __pyx_code_cache
.count
, code_line
);
8617 if (unlikely(pos
>= __pyx_code_cache
.count
) || unlikely(__pyx_code_cache
.entries
[pos
].code_line
!= code_line
)) {
8620 code_object
= __pyx_code_cache
.entries
[pos
].code_object
;
8621 Py_INCREF(code_object
);
8624 static void __pyx_insert_code_object(int code_line
, PyCodeObject
* code_object
) {
8626 __Pyx_CodeObjectCacheEntry
* entries
= __pyx_code_cache
.entries
;
8627 if (unlikely(!code_line
)) {
8630 if (unlikely(!entries
)) {
8631 entries
= (__Pyx_CodeObjectCacheEntry
*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry
));
8632 if (likely(entries
)) {
8633 __pyx_code_cache
.entries
= entries
;
8634 __pyx_code_cache
.max_count
= 64;
8635 __pyx_code_cache
.count
= 1;
8636 entries
[0].code_line
= code_line
;
8637 entries
[0].code_object
= code_object
;
8638 Py_INCREF(code_object
);
8642 pos
= __pyx_bisect_code_objects(__pyx_code_cache
.entries
, __pyx_code_cache
.count
, code_line
);
8643 if ((pos
< __pyx_code_cache
.count
) && unlikely(__pyx_code_cache
.entries
[pos
].code_line
== code_line
)) {
8644 PyCodeObject
* tmp
= entries
[pos
].code_object
;
8645 entries
[pos
].code_object
= code_object
;
8649 if (__pyx_code_cache
.count
== __pyx_code_cache
.max_count
) {
8650 int new_max
= __pyx_code_cache
.max_count
+ 64;
8651 entries
= (__Pyx_CodeObjectCacheEntry
*)PyMem_Realloc(
8652 __pyx_code_cache
.entries
, (size_t)new_max
*sizeof(__Pyx_CodeObjectCacheEntry
));
8653 if (unlikely(!entries
)) {
8656 __pyx_code_cache
.entries
= entries
;
8657 __pyx_code_cache
.max_count
= new_max
;
8659 for (i
=__pyx_code_cache
.count
; i
>pos
; i
--) {
8660 entries
[i
] = entries
[i
-1];
8662 entries
[pos
].code_line
= code_line
;
8663 entries
[pos
].code_object
= code_object
;
8664 __pyx_code_cache
.count
++;
8665 Py_INCREF(code_object
);
8669 #include "compile.h"
8670 #include "frameobject.h"
8671 #include "traceback.h"
8672 static PyCodeObject
* __Pyx_CreateCodeObjectForTraceback(
8673 const char *funcname
, int c_line
,
8674 int py_line
, const char *filename
) {
8675 PyCodeObject
*py_code
= 0;
8676 PyObject
*py_srcfile
= 0;
8677 PyObject
*py_funcname
= 0;
8678 #if PY_MAJOR_VERSION < 3
8679 py_srcfile
= PyString_FromString(filename
);
8681 py_srcfile
= PyUnicode_FromString(filename
);
8683 if (!py_srcfile
) goto bad
;
8685 #if PY_MAJOR_VERSION < 3
8686 py_funcname
= PyString_FromFormat( "%s (%s:%d)", funcname
, __pyx_cfilenm
, c_line
);
8688 py_funcname
= PyUnicode_FromFormat( "%s (%s:%d)", funcname
, __pyx_cfilenm
, c_line
);
8692 #if PY_MAJOR_VERSION < 3
8693 py_funcname
= PyString_FromString(funcname
);
8695 py_funcname
= PyUnicode_FromString(funcname
);
8698 if (!py_funcname
) goto bad
;
8699 py_code
= __Pyx_PyCode_New(
8705 __pyx_empty_bytes
, /*PyObject *code,*/
8706 __pyx_empty_tuple
, /*PyObject *consts,*/
8707 __pyx_empty_tuple
, /*PyObject *names,*/
8708 __pyx_empty_tuple
, /*PyObject *varnames,*/
8709 __pyx_empty_tuple
, /*PyObject *freevars,*/
8710 __pyx_empty_tuple
, /*PyObject *cellvars,*/
8711 py_srcfile
, /*PyObject *filename,*/
8712 py_funcname
, /*PyObject *name,*/
8714 __pyx_empty_bytes
/*PyObject *lnotab*/
8716 Py_DECREF(py_srcfile
);
8717 Py_DECREF(py_funcname
);
8720 Py_XDECREF(py_srcfile
);
8721 Py_XDECREF(py_funcname
);
8724 static void __Pyx_AddTraceback(const char *funcname
, int c_line
,
8725 int py_line
, const char *filename
) {
8726 PyCodeObject
*py_code
= 0;
8727 PyFrameObject
*py_frame
= 0;
8728 PyThreadState
*tstate
= __Pyx_PyThreadState_Current
;
8730 c_line
= __Pyx_CLineForTraceback(tstate
, c_line
);
8732 py_code
= __pyx_find_code_object(c_line
? -c_line
: py_line
);
8734 py_code
= __Pyx_CreateCodeObjectForTraceback(
8735 funcname
, c_line
, py_line
, filename
);
8736 if (!py_code
) goto bad
;
8737 __pyx_insert_code_object(c_line
? -c_line
: py_line
, py_code
);
8739 py_frame
= PyFrame_New(
8740 tstate
, /*PyThreadState *tstate,*/
8741 py_code
, /*PyCodeObject *code,*/
8742 __pyx_d
, /*PyObject *globals,*/
8743 0 /*PyObject *locals*/
8745 if (!py_frame
) goto bad
;
8746 __Pyx_PyFrame_SetLineNumber(py_frame
, py_line
);
8747 PyTraceBack_Here(py_frame
);
8749 Py_XDECREF(py_code
);
8750 Py_XDECREF(py_frame
);
8753 /* CIntFromPyVerify */
8754 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
8755 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
8756 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
8757 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
8758 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
8760 func_type value = func_value;\
8761 if (sizeof(target_type) < sizeof(func_type)) {\
8762 if (unlikely(value != (func_type) (target_type) value)) {\
8763 func_type zero = 0;\
8764 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
8765 return (target_type) -1;\
8766 if (is_unsigned && unlikely(value < zero))\
8767 goto raise_neg_overflow;\
8769 goto raise_overflow;\
8772 return (target_type) value;\
8776 static CYTHON_INLINE PyObject
* __Pyx_PyInt_From_int(int value
) {
8777 const int neg_one
= (int) ((int) 0 - (int) 1), const_zero
= (int) 0;
8778 const int is_unsigned
= neg_one
> const_zero
;
8780 if (sizeof(int) < sizeof(long)) {
8781 return PyInt_FromLong((long) value
);
8782 } else if (sizeof(int) <= sizeof(unsigned long)) {
8783 return PyLong_FromUnsignedLong((unsigned long) value
);
8784 #ifdef HAVE_LONG_LONG
8785 } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG
)) {
8786 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG
) value
);
8790 if (sizeof(int) <= sizeof(long)) {
8791 return PyInt_FromLong((long) value
);
8792 #ifdef HAVE_LONG_LONG
8793 } else if (sizeof(int) <= sizeof(PY_LONG_LONG
)) {
8794 return PyLong_FromLongLong((PY_LONG_LONG
) value
);
8799 int one
= 1; int little
= (int)*(unsigned char *)&one
;
8800 unsigned char *bytes
= (unsigned char *)&value
;
8801 return _PyLong_FromByteArray(bytes
, sizeof(int),
8802 little
, !is_unsigned
);
8807 static CYTHON_INLINE PyObject
* __Pyx_PyInt_From_long(long value
) {
8808 const long neg_one
= (long) ((long) 0 - (long) 1), const_zero
= (long) 0;
8809 const int is_unsigned
= neg_one
> const_zero
;
8811 if (sizeof(long) < sizeof(long)) {
8812 return PyInt_FromLong((long) value
);
8813 } else if (sizeof(long) <= sizeof(unsigned long)) {
8814 return PyLong_FromUnsignedLong((unsigned long) value
);
8815 #ifdef HAVE_LONG_LONG
8816 } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG
)) {
8817 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG
) value
);
8821 if (sizeof(long) <= sizeof(long)) {
8822 return PyInt_FromLong((long) value
);
8823 #ifdef HAVE_LONG_LONG
8824 } else if (sizeof(long) <= sizeof(PY_LONG_LONG
)) {
8825 return PyLong_FromLongLong((PY_LONG_LONG
) value
);
8830 int one
= 1; int little
= (int)*(unsigned char *)&one
;
8831 unsigned char *bytes
= (unsigned char *)&value
;
8832 return _PyLong_FromByteArray(bytes
, sizeof(long),
8833 little
, !is_unsigned
);
8838 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject
*x
) {
8839 const int neg_one
= (int) ((int) 0 - (int) 1), const_zero
= (int) 0;
8840 const int is_unsigned
= neg_one
> const_zero
;
8841 #if PY_MAJOR_VERSION < 3
8842 if (likely(PyInt_Check(x
))) {
8843 if (sizeof(int) < sizeof(long)) {
8844 __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x
))
8846 long val
= PyInt_AS_LONG(x
);
8847 if (is_unsigned
&& unlikely(val
< 0)) {
8848 goto raise_neg_overflow
;
8854 if (likely(PyLong_Check(x
))) {
8856 #if CYTHON_USE_PYLONG_INTERNALS
8857 const digit
* digits
= ((PyLongObject
*)x
)->ob_digit
;
8858 switch (Py_SIZE(x
)) {
8859 case 0: return (int) 0;
8860 case 1: __PYX_VERIFY_RETURN_INT(int, digit
, digits
[0])
8862 if (8 * sizeof(int) > 1 * PyLong_SHIFT
) {
8863 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT
) {
8864 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits
[1]) << PyLong_SHIFT
) | (unsigned long)digits
[0])))
8865 } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT
) {
8866 return (int) (((((int)digits
[1]) << PyLong_SHIFT
) | (int)digits
[0]));
8871 if (8 * sizeof(int) > 2 * PyLong_SHIFT
) {
8872 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT
) {
8873 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits
[2]) << PyLong_SHIFT
) | (unsigned long)digits
[1]) << PyLong_SHIFT
) | (unsigned long)digits
[0])))
8874 } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT
) {
8875 return (int) (((((((int)digits
[2]) << PyLong_SHIFT
) | (int)digits
[1]) << PyLong_SHIFT
) | (int)digits
[0]));
8880 if (8 * sizeof(int) > 3 * PyLong_SHIFT
) {
8881 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT
) {
8882 __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])))
8883 } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT
) {
8884 return (int) (((((((((int)digits
[3]) << PyLong_SHIFT
) | (int)digits
[2]) << PyLong_SHIFT
) | (int)digits
[1]) << PyLong_SHIFT
) | (int)digits
[0]));
8890 #if CYTHON_COMPILING_IN_CPYTHON
8891 if (unlikely(Py_SIZE(x
) < 0)) {
8892 goto raise_neg_overflow
;
8896 int result
= PyObject_RichCompareBool(x
, Py_False
, Py_LT
);
8897 if (unlikely(result
< 0))
8899 if (unlikely(result
== 1))
8900 goto raise_neg_overflow
;
8903 if (sizeof(int) <= sizeof(unsigned long)) {
8904 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x
))
8905 #ifdef HAVE_LONG_LONG
8906 } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG
)) {
8907 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG
, PyLong_AsUnsignedLongLong(x
))
8911 #if CYTHON_USE_PYLONG_INTERNALS
8912 const digit
* digits
= ((PyLongObject
*)x
)->ob_digit
;
8913 switch (Py_SIZE(x
)) {
8914 case 0: return (int) 0;
8915 case -1: __PYX_VERIFY_RETURN_INT(int, sdigit
, (sdigit
) (-(sdigit
)digits
[0]))
8916 case 1: __PYX_VERIFY_RETURN_INT(int, digit
, +digits
[0])
8918 if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT
) {
8919 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT
) {
8920 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits
[1]) << PyLong_SHIFT
) | (unsigned long)digits
[0])))
8921 } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT
) {
8922 return (int) (((int)-1)*(((((int)digits
[1]) << PyLong_SHIFT
) | (int)digits
[0])));
8927 if (8 * sizeof(int) > 1 * PyLong_SHIFT
) {
8928 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT
) {
8929 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits
[1]) << PyLong_SHIFT
) | (unsigned long)digits
[0])))
8930 } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT
) {
8931 return (int) ((((((int)digits
[1]) << PyLong_SHIFT
) | (int)digits
[0])));
8936 if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT
) {
8937 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT
) {
8938 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits
[2]) << PyLong_SHIFT
) | (unsigned long)digits
[1]) << PyLong_SHIFT
) | (unsigned long)digits
[0])))
8939 } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT
) {
8940 return (int) (((int)-1)*(((((((int)digits
[2]) << PyLong_SHIFT
) | (int)digits
[1]) << PyLong_SHIFT
) | (int)digits
[0])));
8945 if (8 * sizeof(int) > 2 * PyLong_SHIFT
) {
8946 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT
) {
8947 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits
[2]) << PyLong_SHIFT
) | (unsigned long)digits
[1]) << PyLong_SHIFT
) | (unsigned long)digits
[0])))
8948 } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT
) {
8949 return (int) ((((((((int)digits
[2]) << PyLong_SHIFT
) | (int)digits
[1]) << PyLong_SHIFT
) | (int)digits
[0])));
8954 if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT
) {
8955 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT
) {
8956 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits
[3]) << PyLong_SHIFT
) | (unsigned long)digits
[2]) << PyLong_SHIFT
) | (unsigned long)digits
[1]) << PyLong_SHIFT
) | (unsigned long)digits
[0])))
8957 } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT
) {
8958 return (int) (((int)-1)*(((((((((int)digits
[3]) << PyLong_SHIFT
) | (int)digits
[2]) << PyLong_SHIFT
) | (int)digits
[1]) << PyLong_SHIFT
) | (int)digits
[0])));
8963 if (8 * sizeof(int) > 3 * PyLong_SHIFT
) {
8964 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT
) {
8965 __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])))
8966 } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT
) {
8967 return (int) ((((((((((int)digits
[3]) << PyLong_SHIFT
) | (int)digits
[2]) << PyLong_SHIFT
) | (int)digits
[1]) << PyLong_SHIFT
) | (int)digits
[0])));
8973 if (sizeof(int) <= sizeof(long)) {
8974 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x
))
8975 #ifdef HAVE_LONG_LONG
8976 } else if (sizeof(int) <= sizeof(PY_LONG_LONG
)) {
8977 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG
, PyLong_AsLongLong(x
))
8982 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
8983 PyErr_SetString(PyExc_RuntimeError
,
8984 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
8987 PyObject
*v
= __Pyx_PyNumber_IntOrLong(x
);
8988 #if PY_MAJOR_VERSION < 3
8989 if (likely(v
) && !PyLong_Check(v
)) {
8991 v
= PyNumber_Long(tmp
);
8996 int one
= 1; int is_little
= (int)*(unsigned char *)&one
;
8997 unsigned char *bytes
= (unsigned char *)&val
;
8998 int ret
= _PyLong_AsByteArray((PyLongObject
*)v
,
9000 is_little
, !is_unsigned
);
9010 PyObject
*tmp
= __Pyx_PyNumber_IntOrLong(x
);
9011 if (!tmp
) return (int) -1;
9012 val
= __Pyx_PyInt_As_int(tmp
);
9017 PyErr_SetString(PyExc_OverflowError
,
9018 "value too large to convert to int");
9021 PyErr_SetString(PyExc_OverflowError
,
9022 "can't convert negative value to int");
9027 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject
*x
) {
9028 const long neg_one
= (long) ((long) 0 - (long) 1), const_zero
= (long) 0;
9029 const int is_unsigned
= neg_one
> const_zero
;
9030 #if PY_MAJOR_VERSION < 3
9031 if (likely(PyInt_Check(x
))) {
9032 if (sizeof(long) < sizeof(long)) {
9033 __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x
))
9035 long val
= PyInt_AS_LONG(x
);
9036 if (is_unsigned
&& unlikely(val
< 0)) {
9037 goto raise_neg_overflow
;
9043 if (likely(PyLong_Check(x
))) {
9045 #if CYTHON_USE_PYLONG_INTERNALS
9046 const digit
* digits
= ((PyLongObject
*)x
)->ob_digit
;
9047 switch (Py_SIZE(x
)) {
9048 case 0: return (long) 0;
9049 case 1: __PYX_VERIFY_RETURN_INT(long, digit
, digits
[0])
9051 if (8 * sizeof(long) > 1 * PyLong_SHIFT
) {
9052 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT
) {
9053 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits
[1]) << PyLong_SHIFT
) | (unsigned long)digits
[0])))
9054 } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT
) {
9055 return (long) (((((long)digits
[1]) << PyLong_SHIFT
) | (long)digits
[0]));
9060 if (8 * sizeof(long) > 2 * PyLong_SHIFT
) {
9061 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT
) {
9062 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits
[2]) << PyLong_SHIFT
) | (unsigned long)digits
[1]) << PyLong_SHIFT
) | (unsigned long)digits
[0])))
9063 } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT
) {
9064 return (long) (((((((long)digits
[2]) << PyLong_SHIFT
) | (long)digits
[1]) << PyLong_SHIFT
) | (long)digits
[0]));
9069 if (8 * sizeof(long) > 3 * PyLong_SHIFT
) {
9070 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT
) {
9071 __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])))
9072 } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT
) {
9073 return (long) (((((((((long)digits
[3]) << PyLong_SHIFT
) | (long)digits
[2]) << PyLong_SHIFT
) | (long)digits
[1]) << PyLong_SHIFT
) | (long)digits
[0]));
9079 #if CYTHON_COMPILING_IN_CPYTHON
9080 if (unlikely(Py_SIZE(x
) < 0)) {
9081 goto raise_neg_overflow
;
9085 int result
= PyObject_RichCompareBool(x
, Py_False
, Py_LT
);
9086 if (unlikely(result
< 0))
9088 if (unlikely(result
== 1))
9089 goto raise_neg_overflow
;
9092 if (sizeof(long) <= sizeof(unsigned long)) {
9093 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x
))
9094 #ifdef HAVE_LONG_LONG
9095 } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG
)) {
9096 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG
, PyLong_AsUnsignedLongLong(x
))
9100 #if CYTHON_USE_PYLONG_INTERNALS
9101 const digit
* digits
= ((PyLongObject
*)x
)->ob_digit
;
9102 switch (Py_SIZE(x
)) {
9103 case 0: return (long) 0;
9104 case -1: __PYX_VERIFY_RETURN_INT(long, sdigit
, (sdigit
) (-(sdigit
)digits
[0]))
9105 case 1: __PYX_VERIFY_RETURN_INT(long, digit
, +digits
[0])
9107 if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT
) {
9108 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT
) {
9109 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits
[1]) << PyLong_SHIFT
) | (unsigned long)digits
[0])))
9110 } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT
) {
9111 return (long) (((long)-1)*(((((long)digits
[1]) << PyLong_SHIFT
) | (long)digits
[0])));
9116 if (8 * sizeof(long) > 1 * PyLong_SHIFT
) {
9117 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT
) {
9118 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits
[1]) << PyLong_SHIFT
) | (unsigned long)digits
[0])))
9119 } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT
) {
9120 return (long) ((((((long)digits
[1]) << PyLong_SHIFT
) | (long)digits
[0])));
9125 if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT
) {
9126 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT
) {
9127 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits
[2]) << PyLong_SHIFT
) | (unsigned long)digits
[1]) << PyLong_SHIFT
) | (unsigned long)digits
[0])))
9128 } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT
) {
9129 return (long) (((long)-1)*(((((((long)digits
[2]) << PyLong_SHIFT
) | (long)digits
[1]) << PyLong_SHIFT
) | (long)digits
[0])));
9134 if (8 * sizeof(long) > 2 * PyLong_SHIFT
) {
9135 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT
) {
9136 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits
[2]) << PyLong_SHIFT
) | (unsigned long)digits
[1]) << PyLong_SHIFT
) | (unsigned long)digits
[0])))
9137 } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT
) {
9138 return (long) ((((((((long)digits
[2]) << PyLong_SHIFT
) | (long)digits
[1]) << PyLong_SHIFT
) | (long)digits
[0])));
9143 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT
) {
9144 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT
) {
9145 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits
[3]) << PyLong_SHIFT
) | (unsigned long)digits
[2]) << PyLong_SHIFT
) | (unsigned long)digits
[1]) << PyLong_SHIFT
) | (unsigned long)digits
[0])))
9146 } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT
) {
9147 return (long) (((long)-1)*(((((((((long)digits
[3]) << PyLong_SHIFT
) | (long)digits
[2]) << PyLong_SHIFT
) | (long)digits
[1]) << PyLong_SHIFT
) | (long)digits
[0])));
9152 if (8 * sizeof(long) > 3 * PyLong_SHIFT
) {
9153 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT
) {
9154 __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])))
9155 } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT
) {
9156 return (long) ((((((((((long)digits
[3]) << PyLong_SHIFT
) | (long)digits
[2]) << PyLong_SHIFT
) | (long)digits
[1]) << PyLong_SHIFT
) | (long)digits
[0])));
9162 if (sizeof(long) <= sizeof(long)) {
9163 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x
))
9164 #ifdef HAVE_LONG_LONG
9165 } else if (sizeof(long) <= sizeof(PY_LONG_LONG
)) {
9166 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG
, PyLong_AsLongLong(x
))
9171 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
9172 PyErr_SetString(PyExc_RuntimeError
,
9173 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
9176 PyObject
*v
= __Pyx_PyNumber_IntOrLong(x
);
9177 #if PY_MAJOR_VERSION < 3
9178 if (likely(v
) && !PyLong_Check(v
)) {
9180 v
= PyNumber_Long(tmp
);
9185 int one
= 1; int is_little
= (int)*(unsigned char *)&one
;
9186 unsigned char *bytes
= (unsigned char *)&val
;
9187 int ret
= _PyLong_AsByteArray((PyLongObject
*)v
,
9189 is_little
, !is_unsigned
);
9199 PyObject
*tmp
= __Pyx_PyNumber_IntOrLong(x
);
9200 if (!tmp
) return (long) -1;
9201 val
= __Pyx_PyInt_As_long(tmp
);
9206 PyErr_SetString(PyExc_OverflowError
,
9207 "value too large to convert to long");
9210 PyErr_SetString(PyExc_OverflowError
,
9211 "can't convert negative value to long");
9215 /* FastTypeChecks */
9216 #if CYTHON_COMPILING_IN_CPYTHON
9217 static int __Pyx_InBases(PyTypeObject
*a
, PyTypeObject
*b
) {
9223 return b
== &PyBaseObject_Type
;
9225 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject
*a
, PyTypeObject
*b
) {
9227 if (a
== b
) return 1;
9231 n
= PyTuple_GET_SIZE(mro
);
9232 for (i
= 0; i
< n
; i
++) {
9233 if (PyTuple_GET_ITEM(mro
, i
) == (PyObject
*)b
)
9238 return __Pyx_InBases(a
, b
);
9240 #if PY_MAJOR_VERSION == 2
9241 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject
*err
, PyObject
* exc_type1
, PyObject
* exc_type2
) {
9242 PyObject
*exception
, *value
, *tb
;
9244 __Pyx_PyThreadState_declare
9245 __Pyx_PyThreadState_assign
9246 __Pyx_ErrFetch(&exception
, &value
, &tb
);
9247 res
= exc_type1
? PyObject_IsSubclass(err
, exc_type1
) : 0;
9248 if (unlikely(res
== -1)) {
9249 PyErr_WriteUnraisable(err
);
9253 res
= PyObject_IsSubclass(err
, exc_type2
);
9254 if (unlikely(res
== -1)) {
9255 PyErr_WriteUnraisable(err
);
9259 __Pyx_ErrRestore(exception
, value
, tb
);
9263 static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject
*err
, PyObject
* exc_type1
, PyObject
*exc_type2
) {
9264 int res
= exc_type1
? __Pyx_IsSubtype((PyTypeObject
*)err
, (PyTypeObject
*)exc_type1
) : 0;
9266 res
= __Pyx_IsSubtype((PyTypeObject
*)err
, (PyTypeObject
*)exc_type2
);
9271 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject
*exc_type
, PyObject
*tuple
) {
9273 assert(PyExceptionClass_Check(exc_type
));
9274 n
= PyTuple_GET_SIZE(tuple
);
9275 #if PY_MAJOR_VERSION >= 3
9276 for (i
=0; i
<n
; i
++) {
9277 if (exc_type
== PyTuple_GET_ITEM(tuple
, i
)) return 1;
9280 for (i
=0; i
<n
; i
++) {
9281 PyObject
*t
= PyTuple_GET_ITEM(tuple
, i
);
9282 #if PY_MAJOR_VERSION < 3
9283 if (likely(exc_type
== t
)) return 1;
9285 if (likely(PyExceptionClass_Check(t
))) {
9286 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type
, NULL
, t
)) return 1;
9292 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject
*err
, PyObject
* exc_type
) {
9293 if (likely(err
== exc_type
)) return 1;
9294 if (likely(PyExceptionClass_Check(err
))) {
9295 if (likely(PyExceptionClass_Check(exc_type
))) {
9296 return __Pyx_inner_PyErr_GivenExceptionMatches2(err
, NULL
, exc_type
);
9297 } else if (likely(PyTuple_Check(exc_type
))) {
9298 return __Pyx_PyErr_GivenExceptionMatchesTuple(err
, exc_type
);
9302 return PyErr_GivenExceptionMatches(err
, exc_type
);
9304 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject
*err
, PyObject
*exc_type1
, PyObject
*exc_type2
) {
9305 assert(PyExceptionClass_Check(exc_type1
));
9306 assert(PyExceptionClass_Check(exc_type2
));
9307 if (likely(err
== exc_type1
|| err
== exc_type2
)) return 1;
9308 if (likely(PyExceptionClass_Check(err
))) {
9309 return __Pyx_inner_PyErr_GivenExceptionMatches2(err
, exc_type1
, exc_type2
);
9311 return (PyErr_GivenExceptionMatches(err
, exc_type1
) || PyErr_GivenExceptionMatches(err
, exc_type2
));
9315 /* CheckBinaryVersion */
9316 static int __Pyx_check_binary_version(void) {
9317 char ctversion
[4], rtversion
[4];
9318 PyOS_snprintf(ctversion
, 4, "%d.%d", PY_MAJOR_VERSION
, PY_MINOR_VERSION
);
9319 PyOS_snprintf(rtversion
, 4, "%s", Py_GetVersion());
9320 if (ctversion
[0] != rtversion
[0] || ctversion
[2] != rtversion
[2]) {
9322 PyOS_snprintf(message
, sizeof(message
),
9323 "compiletime version %s of module '%.100s' "
9324 "does not match runtime version %s",
9325 ctversion
, __Pyx_MODULE_NAME
, rtversion
);
9326 return PyErr_WarnEx(NULL
, message
, 1);
9332 static int __Pyx_InitStrings(__Pyx_StringTabEntry
*t
) {
9334 #if PY_MAJOR_VERSION < 3
9335 if (t
->is_unicode
) {
9336 *t
->p
= PyUnicode_DecodeUTF8(t
->s
, t
->n
- 1, NULL
);
9337 } else if (t
->intern
) {
9338 *t
->p
= PyString_InternFromString(t
->s
);
9340 *t
->p
= PyString_FromStringAndSize(t
->s
, t
->n
- 1);
9343 if (t
->is_unicode
| t
->is_str
) {
9345 *t
->p
= PyUnicode_InternFromString(t
->s
);
9346 } else if (t
->encoding
) {
9347 *t
->p
= PyUnicode_Decode(t
->s
, t
->n
- 1, t
->encoding
, NULL
);
9349 *t
->p
= PyUnicode_FromStringAndSize(t
->s
, t
->n
- 1);
9352 *t
->p
= PyBytes_FromStringAndSize(t
->s
, t
->n
- 1);
9357 if (PyObject_Hash(*t
->p
) == -1)
9364 static CYTHON_INLINE PyObject
* __Pyx_PyUnicode_FromString(const char* c_str
) {
9365 return __Pyx_PyUnicode_FromStringAndSize(c_str
, (Py_ssize_t
)strlen(c_str
));
9367 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject
* o
) {
9369 return __Pyx_PyObject_AsStringAndSize(o
, &ignore
);
9371 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
9372 #if !CYTHON_PEP393_ENABLED
9373 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject
* o
, Py_ssize_t
*length
) {
9375 PyObject
* defenc
= _PyUnicode_AsDefaultEncodedString(o
, NULL
);
9376 if (!defenc
) return NULL
;
9377 defenc_c
= PyBytes_AS_STRING(defenc
);
9378 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
9380 char* end
= defenc_c
+ PyBytes_GET_SIZE(defenc
);
9382 for (c
= defenc_c
; c
< end
; c
++) {
9383 if ((unsigned char) (*c
) >= 128) {
9384 PyUnicode_AsASCIIString(o
);
9390 *length
= PyBytes_GET_SIZE(defenc
);
9394 static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject
* o
, Py_ssize_t
*length
) {
9395 if (unlikely(__Pyx_PyUnicode_READY(o
) == -1)) return NULL
;
9396 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
9397 if (likely(PyUnicode_IS_ASCII(o
))) {
9398 *length
= PyUnicode_GET_LENGTH(o
);
9399 return PyUnicode_AsUTF8(o
);
9401 PyUnicode_AsASCIIString(o
);
9405 return PyUnicode_AsUTF8AndSize(o
, length
);
9410 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject
* o
, Py_ssize_t
*length
) {
9411 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
9413 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
9414 __Pyx_sys_getdefaultencoding_not_ascii
&&
9416 PyUnicode_Check(o
)) {
9417 return __Pyx_PyUnicode_AsStringAndSize(o
, length
);
9420 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
9421 if (PyByteArray_Check(o
)) {
9422 *length
= PyByteArray_GET_SIZE(o
);
9423 return PyByteArray_AS_STRING(o
);
9428 int r
= PyBytes_AsStringAndSize(o
, &result
, length
);
9429 if (unlikely(r
< 0)) {
9436 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject
* x
) {
9437 int is_true
= x
== Py_True
;
9438 if (is_true
| (x
== Py_False
) | (x
== Py_None
)) return is_true
;
9439 else return PyObject_IsTrue(x
);
9441 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject
* x
) {
9443 if (unlikely(!x
)) return -1;
9444 retval
= __Pyx_PyObject_IsTrue(x
);
9448 static PyObject
* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject
* result
, const char* type_name
) {
9449 #if PY_MAJOR_VERSION >= 3
9450 if (PyLong_Check(result
)) {
9451 if (PyErr_WarnFormat(PyExc_DeprecationWarning
, 1,
9452 "__int__ returned non-int (type %.200s). "
9453 "The ability to return an instance of a strict subclass of int "
9454 "is deprecated, and may be removed in a future version of Python.",
9455 Py_TYPE(result
)->tp_name
)) {
9462 PyErr_Format(PyExc_TypeError
,
9463 "__%.4s__ returned non-%.4s (type %.200s)",
9464 type_name
, type_name
, Py_TYPE(result
)->tp_name
);
9468 static CYTHON_INLINE PyObject
* __Pyx_PyNumber_IntOrLong(PyObject
* x
) {
9469 #if CYTHON_USE_TYPE_SLOTS
9472 const char *name
= NULL
;
9473 PyObject
*res
= NULL
;
9474 #if PY_MAJOR_VERSION < 3
9475 if (likely(PyInt_Check(x
) || PyLong_Check(x
)))
9477 if (likely(PyLong_Check(x
)))
9479 return __Pyx_NewRef(x
);
9480 #if CYTHON_USE_TYPE_SLOTS
9481 m
= Py_TYPE(x
)->tp_as_number
;
9482 #if PY_MAJOR_VERSION < 3
9483 if (m
&& m
->nb_int
) {
9487 else if (m
&& m
->nb_long
) {
9489 res
= m
->nb_long(x
);
9492 if (likely(m
&& m
->nb_int
)) {
9498 if (!PyBytes_CheckExact(x
) && !PyUnicode_CheckExact(x
)) {
9499 res
= PyNumber_Int(x
);
9503 #if PY_MAJOR_VERSION < 3
9504 if (unlikely(!PyInt_Check(res
) && !PyLong_Check(res
))) {
9506 if (unlikely(!PyLong_CheckExact(res
))) {
9508 return __Pyx_PyNumber_IntOrLongWrongResultType(res
, name
);
9511 else if (!PyErr_Occurred()) {
9512 PyErr_SetString(PyExc_TypeError
,
9513 "an integer is required");
9517 static CYTHON_INLINE Py_ssize_t
__Pyx_PyIndex_AsSsize_t(PyObject
* b
) {
9520 #if PY_MAJOR_VERSION < 3
9521 if (likely(PyInt_CheckExact(b
))) {
9522 if (sizeof(Py_ssize_t
) >= sizeof(long))
9523 return PyInt_AS_LONG(b
);
9525 return PyInt_AsSsize_t(b
);
9528 if (likely(PyLong_CheckExact(b
))) {
9529 #if CYTHON_USE_PYLONG_INTERNALS
9530 const digit
* digits
= ((PyLongObject
*)b
)->ob_digit
;
9531 const Py_ssize_t size
= Py_SIZE(b
);
9532 if (likely(__Pyx_sst_abs(size
) <= 1)) {
9533 ival
= likely(size
) ? digits
[0] : 0;
9534 if (size
== -1) ival
= -ival
;
9539 if (8 * sizeof(Py_ssize_t
) > 2 * PyLong_SHIFT
) {
9540 return (Py_ssize_t
) (((((size_t)digits
[1]) << PyLong_SHIFT
) | (size_t)digits
[0]));
9544 if (8 * sizeof(Py_ssize_t
) > 2 * PyLong_SHIFT
) {
9545 return -(Py_ssize_t
) (((((size_t)digits
[1]) << PyLong_SHIFT
) | (size_t)digits
[0]));
9549 if (8 * sizeof(Py_ssize_t
) > 3 * PyLong_SHIFT
) {
9550 return (Py_ssize_t
) (((((((size_t)digits
[2]) << PyLong_SHIFT
) | (size_t)digits
[1]) << PyLong_SHIFT
) | (size_t)digits
[0]));
9554 if (8 * sizeof(Py_ssize_t
) > 3 * PyLong_SHIFT
) {
9555 return -(Py_ssize_t
) (((((((size_t)digits
[2]) << PyLong_SHIFT
) | (size_t)digits
[1]) << PyLong_SHIFT
) | (size_t)digits
[0]));
9559 if (8 * sizeof(Py_ssize_t
) > 4 * PyLong_SHIFT
) {
9560 return (Py_ssize_t
) (((((((((size_t)digits
[3]) << PyLong_SHIFT
) | (size_t)digits
[2]) << PyLong_SHIFT
) | (size_t)digits
[1]) << PyLong_SHIFT
) | (size_t)digits
[0]));
9564 if (8 * sizeof(Py_ssize_t
) > 4 * PyLong_SHIFT
) {
9565 return -(Py_ssize_t
) (((((((((size_t)digits
[3]) << PyLong_SHIFT
) | (size_t)digits
[2]) << PyLong_SHIFT
) | (size_t)digits
[1]) << PyLong_SHIFT
) | (size_t)digits
[0]));
9571 return PyLong_AsSsize_t(b
);
9573 x
= PyNumber_Index(b
);
9575 ival
= PyInt_AsSsize_t(x
);
9579 static CYTHON_INLINE PyObject
* __Pyx_PyBool_FromLong(long b
) {
9580 return b
? __Pyx_NewRef(Py_True
) : __Pyx_NewRef(Py_False
);
9582 static CYTHON_INLINE PyObject
* __Pyx_PyInt_FromSize_t(size_t ival
) {
9583 return PyInt_FromSize_t(ival
);
9587 #endif /* Py_PYTHON_H */