chaine 3.12.1__cp312-cp312-win32.whl → 3.13.1__cp312-cp312-win32.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of chaine might be problematic. Click here for more details.
chaine/_core/crf.cpp
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Generated by Cython 3.0.
|
|
1
|
+
/* Generated by Cython 3.0.11 */
|
|
2
2
|
|
|
3
3
|
/* BEGIN: Cython Metadata
|
|
4
4
|
{
|
|
@@ -69,15 +69,15 @@ END: Cython Metadata */
|
|
|
69
69
|
#elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
|
|
70
70
|
#error Cython requires Python 2.7+ or Python 3.3+.
|
|
71
71
|
#else
|
|
72
|
-
#if CYTHON_LIMITED_API
|
|
72
|
+
#if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API
|
|
73
73
|
#define __PYX_EXTRA_ABI_MODULE_NAME "limited"
|
|
74
74
|
#else
|
|
75
75
|
#define __PYX_EXTRA_ABI_MODULE_NAME ""
|
|
76
76
|
#endif
|
|
77
|
-
#define CYTHON_ABI "
|
|
77
|
+
#define CYTHON_ABI "3_0_11" __PYX_EXTRA_ABI_MODULE_NAME
|
|
78
78
|
#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
|
|
79
79
|
#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."
|
|
80
|
-
#define CYTHON_HEX_VERSION
|
|
80
|
+
#define CYTHON_HEX_VERSION 0x03000BF0
|
|
81
81
|
#define CYTHON_FUTURE_DIVISION 0
|
|
82
82
|
#include <stddef.h>
|
|
83
83
|
#ifndef offsetof
|
|
@@ -169,6 +169,8 @@ END: Cython Metadata */
|
|
|
169
169
|
#ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
|
|
170
170
|
#define CYTHON_UPDATE_DESCRIPTOR_DOC 0
|
|
171
171
|
#endif
|
|
172
|
+
#undef CYTHON_USE_FREELISTS
|
|
173
|
+
#define CYTHON_USE_FREELISTS 0
|
|
172
174
|
#elif defined(PYPY_VERSION)
|
|
173
175
|
#define CYTHON_COMPILING_IN_PYPY 1
|
|
174
176
|
#define CYTHON_COMPILING_IN_CPYTHON 0
|
|
@@ -230,6 +232,8 @@ END: Cython Metadata */
|
|
|
230
232
|
#ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
|
|
231
233
|
#define CYTHON_UPDATE_DESCRIPTOR_DOC 0
|
|
232
234
|
#endif
|
|
235
|
+
#undef CYTHON_USE_FREELISTS
|
|
236
|
+
#define CYTHON_USE_FREELISTS 0
|
|
233
237
|
#elif defined(CYTHON_LIMITED_API)
|
|
234
238
|
#ifdef Py_LIMITED_API
|
|
235
239
|
#undef __PYX_LIMITED_VERSION_HEX
|
|
@@ -291,7 +295,9 @@ END: Cython Metadata */
|
|
|
291
295
|
#ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
|
|
292
296
|
#define CYTHON_UPDATE_DESCRIPTOR_DOC 0
|
|
293
297
|
#endif
|
|
294
|
-
#
|
|
298
|
+
#undef CYTHON_USE_FREELISTS
|
|
299
|
+
#define CYTHON_USE_FREELISTS 0
|
|
300
|
+
#elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL)
|
|
295
301
|
#define CYTHON_COMPILING_IN_PYPY 0
|
|
296
302
|
#define CYTHON_COMPILING_IN_CPYTHON 0
|
|
297
303
|
#define CYTHON_COMPILING_IN_LIMITED_API 0
|
|
@@ -300,11 +306,17 @@ END: Cython Metadata */
|
|
|
300
306
|
#ifndef CYTHON_USE_TYPE_SLOTS
|
|
301
307
|
#define CYTHON_USE_TYPE_SLOTS 1
|
|
302
308
|
#endif
|
|
309
|
+
#ifndef CYTHON_USE_TYPE_SPECS
|
|
310
|
+
#define CYTHON_USE_TYPE_SPECS 0
|
|
311
|
+
#endif
|
|
303
312
|
#undef CYTHON_USE_PYTYPE_LOOKUP
|
|
304
313
|
#define CYTHON_USE_PYTYPE_LOOKUP 0
|
|
305
314
|
#ifndef CYTHON_USE_ASYNC_SLOTS
|
|
306
315
|
#define CYTHON_USE_ASYNC_SLOTS 1
|
|
307
316
|
#endif
|
|
317
|
+
#ifndef CYTHON_USE_PYLONG_INTERNALS
|
|
318
|
+
#define CYTHON_USE_PYLONG_INTERNALS 0
|
|
319
|
+
#endif
|
|
308
320
|
#undef CYTHON_USE_PYLIST_INTERNALS
|
|
309
321
|
#define CYTHON_USE_PYLIST_INTERNALS 0
|
|
310
322
|
#ifndef CYTHON_USE_UNICODE_INTERNALS
|
|
@@ -312,8 +324,6 @@ END: Cython Metadata */
|
|
|
312
324
|
#endif
|
|
313
325
|
#undef CYTHON_USE_UNICODE_WRITER
|
|
314
326
|
#define CYTHON_USE_UNICODE_WRITER 0
|
|
315
|
-
#undef CYTHON_USE_PYLONG_INTERNALS
|
|
316
|
-
#define CYTHON_USE_PYLONG_INTERNALS 0
|
|
317
327
|
#ifndef CYTHON_AVOID_BORROWED_REFS
|
|
318
328
|
#define CYTHON_AVOID_BORROWED_REFS 0
|
|
319
329
|
#endif
|
|
@@ -325,11 +335,22 @@ END: Cython Metadata */
|
|
|
325
335
|
#endif
|
|
326
336
|
#undef CYTHON_FAST_THREAD_STATE
|
|
327
337
|
#define CYTHON_FAST_THREAD_STATE 0
|
|
338
|
+
#undef CYTHON_FAST_GIL
|
|
339
|
+
#define CYTHON_FAST_GIL 0
|
|
340
|
+
#ifndef CYTHON_METH_FASTCALL
|
|
341
|
+
#define CYTHON_METH_FASTCALL 1
|
|
342
|
+
#endif
|
|
328
343
|
#undef CYTHON_FAST_PYCALL
|
|
329
344
|
#define CYTHON_FAST_PYCALL 0
|
|
345
|
+
#ifndef CYTHON_PEP487_INIT_SUBCLASS
|
|
346
|
+
#define CYTHON_PEP487_INIT_SUBCLASS 1
|
|
347
|
+
#endif
|
|
330
348
|
#ifndef CYTHON_PEP489_MULTI_PHASE_INIT
|
|
331
349
|
#define CYTHON_PEP489_MULTI_PHASE_INIT 1
|
|
332
350
|
#endif
|
|
351
|
+
#ifndef CYTHON_USE_MODULE_STATE
|
|
352
|
+
#define CYTHON_USE_MODULE_STATE 0
|
|
353
|
+
#endif
|
|
333
354
|
#ifndef CYTHON_USE_TP_FINALIZE
|
|
334
355
|
#define CYTHON_USE_TP_FINALIZE 1
|
|
335
356
|
#endif
|
|
@@ -337,6 +358,12 @@ END: Cython Metadata */
|
|
|
337
358
|
#define CYTHON_USE_DICT_VERSIONS 0
|
|
338
359
|
#undef CYTHON_USE_EXC_INFO_STACK
|
|
339
360
|
#define CYTHON_USE_EXC_INFO_STACK 0
|
|
361
|
+
#ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
|
|
362
|
+
#define CYTHON_UPDATE_DESCRIPTOR_DOC 1
|
|
363
|
+
#endif
|
|
364
|
+
#ifndef CYTHON_USE_FREELISTS
|
|
365
|
+
#define CYTHON_USE_FREELISTS 0
|
|
366
|
+
#endif
|
|
340
367
|
#else
|
|
341
368
|
#define CYTHON_COMPILING_IN_PYPY 0
|
|
342
369
|
#define CYTHON_COMPILING_IN_CPYTHON 1
|
|
@@ -427,6 +454,9 @@ END: Cython Metadata */
|
|
|
427
454
|
#ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
|
|
428
455
|
#define CYTHON_UPDATE_DESCRIPTOR_DOC 1
|
|
429
456
|
#endif
|
|
457
|
+
#ifndef CYTHON_USE_FREELISTS
|
|
458
|
+
#define CYTHON_USE_FREELISTS 1
|
|
459
|
+
#endif
|
|
430
460
|
#endif
|
|
431
461
|
#if !defined(CYTHON_FAST_PYCCALL)
|
|
432
462
|
#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
|
|
@@ -635,18 +665,19 @@ class __Pyx_FakeReference {
|
|
|
635
665
|
PyObject *exception_table = NULL;
|
|
636
666
|
PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
|
|
637
667
|
#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
|
|
638
|
-
PyObject *version_info;
|
|
639
|
-
#endif
|
|
668
|
+
PyObject *version_info;
|
|
640
669
|
PyObject *py_minor_version = NULL;
|
|
670
|
+
#endif
|
|
641
671
|
long minor_version = 0;
|
|
642
672
|
PyObject *type, *value, *traceback;
|
|
643
673
|
PyErr_Fetch(&type, &value, &traceback);
|
|
644
674
|
#if __PYX_LIMITED_VERSION_HEX >= 0x030B0000
|
|
645
|
-
minor_version = 11;
|
|
675
|
+
minor_version = 11;
|
|
646
676
|
#else
|
|
647
677
|
if (!(version_info = PySys_GetObject("version_info"))) goto end;
|
|
648
678
|
if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end;
|
|
649
679
|
minor_version = PyLong_AsLong(py_minor_version);
|
|
680
|
+
Py_DECREF(py_minor_version);
|
|
650
681
|
if (minor_version == -1 && PyErr_Occurred()) goto end;
|
|
651
682
|
#endif
|
|
652
683
|
if (!(types_module = PyImport_ImportModule("types"))) goto end;
|
|
@@ -667,7 +698,6 @@ class __Pyx_FakeReference {
|
|
|
667
698
|
Py_XDECREF(code_type);
|
|
668
699
|
Py_XDECREF(exception_table);
|
|
669
700
|
Py_XDECREF(types_module);
|
|
670
|
-
Py_XDECREF(py_minor_version);
|
|
671
701
|
if (type) {
|
|
672
702
|
PyErr_Restore(type, value, traceback);
|
|
673
703
|
}
|
|
@@ -700,7 +730,7 @@ class __Pyx_FakeReference {
|
|
|
700
730
|
PyObject *fv, PyObject *cell, PyObject* fn,
|
|
701
731
|
PyObject *name, int fline, PyObject *lnos) {
|
|
702
732
|
PyCodeObject *result;
|
|
703
|
-
PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0);
|
|
733
|
+
PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0);
|
|
704
734
|
if (!empty_bytes) return NULL;
|
|
705
735
|
result =
|
|
706
736
|
#if PY_VERSION_HEX >= 0x030C0000
|
|
@@ -786,8 +816,13 @@ class __Pyx_FakeReference {
|
|
|
786
816
|
typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
|
|
787
817
|
Py_ssize_t nargs, PyObject *kwnames);
|
|
788
818
|
#else
|
|
789
|
-
#
|
|
790
|
-
#define
|
|
819
|
+
#if PY_VERSION_HEX >= 0x030d00A4
|
|
820
|
+
# define __Pyx_PyCFunctionFast PyCFunctionFast
|
|
821
|
+
# define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
|
|
822
|
+
#else
|
|
823
|
+
# define __Pyx_PyCFunctionFast _PyCFunctionFast
|
|
824
|
+
# define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
|
|
825
|
+
#endif
|
|
791
826
|
#endif
|
|
792
827
|
#if CYTHON_METH_FASTCALL
|
|
793
828
|
#define __Pyx_METH_FASTCALL METH_FASTCALL
|
|
@@ -862,6 +897,8 @@ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) {
|
|
|
862
897
|
#define __Pyx_PyThreadState_Current PyThreadState_Get()
|
|
863
898
|
#elif !CYTHON_FAST_THREAD_STATE
|
|
864
899
|
#define __Pyx_PyThreadState_Current PyThreadState_GET()
|
|
900
|
+
#elif PY_VERSION_HEX >= 0x030d00A1
|
|
901
|
+
#define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
|
|
865
902
|
#elif PY_VERSION_HEX >= 0x03060000
|
|
866
903
|
#define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
|
|
867
904
|
#elif PY_VERSION_HEX >= 0x03000000
|
|
@@ -937,7 +974,7 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
|
|
|
937
974
|
}
|
|
938
975
|
#endif
|
|
939
976
|
#endif
|
|
940
|
-
#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
|
|
977
|
+
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized)
|
|
941
978
|
#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
|
|
942
979
|
#else
|
|
943
980
|
#define __Pyx_PyDict_NewPresized(n) PyDict_New()
|
|
@@ -949,7 +986,7 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
|
|
|
949
986
|
#define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
|
|
950
987
|
#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
|
|
951
988
|
#endif
|
|
952
|
-
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && CYTHON_USE_UNICODE_INTERNALS
|
|
989
|
+
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS
|
|
953
990
|
#define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
|
|
954
991
|
static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
|
|
955
992
|
PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
|
|
@@ -993,7 +1030,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict,
|
|
|
993
1030
|
#endif
|
|
994
1031
|
#if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000
|
|
995
1032
|
#define __Pyx_PyHeapTypeObject_GC_Del(obj) {\
|
|
996
|
-
PyTypeObject *type = Py_TYPE(obj);\
|
|
1033
|
+
PyTypeObject *type = Py_TYPE((PyObject*)obj);\
|
|
997
1034
|
assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
|
|
998
1035
|
PyObject_GC_Del(obj);\
|
|
999
1036
|
Py_DECREF(type);\
|
|
@@ -1137,6 +1174,15 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict,
|
|
|
1137
1174
|
#define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
|
|
1138
1175
|
#define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
|
|
1139
1176
|
#endif
|
|
1177
|
+
#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
|
|
1178
|
+
#define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
|
|
1179
|
+
#else
|
|
1180
|
+
static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
|
|
1181
|
+
PyObject *module = PyImport_AddModule(name);
|
|
1182
|
+
Py_XINCREF(module);
|
|
1183
|
+
return module;
|
|
1184
|
+
}
|
|
1185
|
+
#endif
|
|
1140
1186
|
#if PY_MAJOR_VERSION >= 3
|
|
1141
1187
|
#define PyIntObject PyLongObject
|
|
1142
1188
|
#define PyInt_Type PyLong_Type
|
|
@@ -1215,7 +1261,7 @@ static CYTHON_INLINE float __PYX_NAN() {
|
|
|
1215
1261
|
#endif
|
|
1216
1262
|
|
|
1217
1263
|
#define __PYX_MARK_ERR_POS(f_index, lineno) \
|
|
1218
|
-
{ __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__;
|
|
1264
|
+
{ __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
|
|
1219
1265
|
#define __PYX_ERR(f_index, lineno, Ln_error) \
|
|
1220
1266
|
{ __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
|
|
1221
1267
|
|
|
@@ -1325,24 +1371,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
|
|
|
1325
1371
|
#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
|
|
1326
1372
|
#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
|
|
1327
1373
|
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
|
|
1328
|
-
#if CYTHON_COMPILING_IN_LIMITED_API
|
|
1329
|
-
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u)
|
|
1330
|
-
{
|
|
1331
|
-
const wchar_t *u_end = u;
|
|
1332
|
-
while (*u_end++) ;
|
|
1333
|
-
return (size_t)(u_end - u - 1);
|
|
1334
|
-
}
|
|
1335
|
-
#else
|
|
1336
|
-
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
|
|
1337
|
-
{
|
|
1338
|
-
const Py_UNICODE *u_end = u;
|
|
1339
|
-
while (*u_end++) ;
|
|
1340
|
-
return (size_t)(u_end - u - 1);
|
|
1341
|
-
}
|
|
1342
|
-
#endif
|
|
1343
1374
|
#define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o)
|
|
1344
|
-
#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
|
|
1345
|
-
#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
|
|
1346
1375
|
#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
|
|
1347
1376
|
#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
|
|
1348
1377
|
#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
|
|
@@ -1392,7 +1421,7 @@ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
|
|
|
1392
1421
|
#endif
|
|
1393
1422
|
typedef Py_ssize_t __Pyx_compact_pylong;
|
|
1394
1423
|
typedef size_t __Pyx_compact_upylong;
|
|
1395
|
-
#else
|
|
1424
|
+
#else
|
|
1396
1425
|
#define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0)
|
|
1397
1426
|
#define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0)
|
|
1398
1427
|
#define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0)
|
|
@@ -1770,8 +1799,8 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int
|
|
|
1770
1799
|
#define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg)
|
|
1771
1800
|
#define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg)
|
|
1772
1801
|
#else
|
|
1773
|
-
#define __Pyx_Arg_NewRef_VARARGS(arg) arg
|
|
1774
|
-
#define __Pyx_Arg_XDECREF_VARARGS(arg)
|
|
1802
|
+
#define __Pyx_Arg_NewRef_VARARGS(arg) arg
|
|
1803
|
+
#define __Pyx_Arg_XDECREF_VARARGS(arg)
|
|
1775
1804
|
#endif
|
|
1776
1805
|
#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
|
|
1777
1806
|
#define __Pyx_KwValues_VARARGS(args, nargs) NULL
|
|
@@ -1782,9 +1811,14 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int
|
|
|
1782
1811
|
#define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds)
|
|
1783
1812
|
#define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
|
|
1784
1813
|
static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s);
|
|
1814
|
+
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
|
|
1815
|
+
CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues);
|
|
1816
|
+
#else
|
|
1785
1817
|
#define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
|
|
1786
|
-
|
|
1787
|
-
#define
|
|
1818
|
+
#endif
|
|
1819
|
+
#define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs
|
|
1820
|
+
to have the same reference counting */
|
|
1821
|
+
#define __Pyx_Arg_XDECREF_FASTCALL(arg)
|
|
1788
1822
|
#else
|
|
1789
1823
|
#define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS
|
|
1790
1824
|
#define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
|
|
@@ -1941,7 +1975,11 @@ static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
|
|
|
1941
1975
|
Py_ssize_t len = Py_SIZE(list);
|
|
1942
1976
|
if (likely(L->allocated > len)) {
|
|
1943
1977
|
Py_INCREF(x);
|
|
1978
|
+
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
|
|
1979
|
+
L->ob_item[len] = x;
|
|
1980
|
+
#else
|
|
1944
1981
|
PyList_SET_ITEM(list, len, x);
|
|
1982
|
+
#endif
|
|
1945
1983
|
__Pyx_SET_SIZE(list, len + 1);
|
|
1946
1984
|
return 0;
|
|
1947
1985
|
}
|
|
@@ -2175,7 +2213,11 @@ static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
|
|
|
2175
2213
|
Py_ssize_t len = Py_SIZE(list);
|
|
2176
2214
|
if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
|
|
2177
2215
|
Py_INCREF(x);
|
|
2216
|
+
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
|
|
2217
|
+
L->ob_item[len] = x;
|
|
2218
|
+
#else
|
|
2178
2219
|
PyList_SET_ITEM(list, len, x);
|
|
2220
|
+
#endif
|
|
2179
2221
|
__Pyx_SET_SIZE(list, len + 1);
|
|
2180
2222
|
return 0;
|
|
2181
2223
|
}
|
|
@@ -2357,7 +2399,7 @@ typedef struct {
|
|
|
2357
2399
|
#endif
|
|
2358
2400
|
void *defaults;
|
|
2359
2401
|
int defaults_pyobjects;
|
|
2360
|
-
size_t defaults_size;
|
|
2402
|
+
size_t defaults_size;
|
|
2361
2403
|
int flags;
|
|
2362
2404
|
PyObject *defaults_tuple;
|
|
2363
2405
|
PyObject *defaults_kwdict;
|
|
@@ -2524,7 +2566,7 @@ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObj
|
|
|
2524
2566
|
#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
|
|
2525
2567
|
|
|
2526
2568
|
/* CheckBinaryVersion.proto */
|
|
2527
|
-
static unsigned long __Pyx_get_runtime_version();
|
|
2569
|
+
static unsigned long __Pyx_get_runtime_version(void);
|
|
2528
2570
|
static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer);
|
|
2529
2571
|
|
|
2530
2572
|
/* InitStrings.proto */
|
|
@@ -2545,12 +2587,12 @@ static PyObject *__pyx_f_6chaine_5_core_3crf_5Model_set_sequence(struct __pyx_ob
|
|
|
2545
2587
|
/* Module declarations from "chaine._core.crf" */
|
|
2546
2588
|
static CRFSuite::Item __pyx_f_6chaine_5_core_3crf_to_item(PyObject *); /*proto*/
|
|
2547
2589
|
static CRFSuite::ItemSequence __pyx_f_6chaine_5_core_3crf_to_seq(PyObject *); /*proto*/
|
|
2548
|
-
static std::string
|
|
2549
|
-
static CYTHON_INLINE PyObject *
|
|
2550
|
-
static CYTHON_INLINE PyObject *
|
|
2551
|
-
static CYTHON_INLINE PyObject *
|
|
2552
|
-
static CYTHON_INLINE PyObject *
|
|
2553
|
-
static CYTHON_INLINE PyObject *
|
|
2590
|
+
static std::string __pyx_convert_string_from_py_6libcpp_6string_std__in_string(PyObject *); /*proto*/
|
|
2591
|
+
static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string(std::string const &); /*proto*/
|
|
2592
|
+
static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(std::string const &); /*proto*/
|
|
2593
|
+
static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string(std::string const &); /*proto*/
|
|
2594
|
+
static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(std::string const &); /*proto*/
|
|
2595
|
+
static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string(std::string const &); /*proto*/
|
|
2554
2596
|
static PyObject *__pyx_convert_vector_to_py_std_3a__3a_string(std::vector<std::string> const &); /*proto*/
|
|
2555
2597
|
static std::vector<std::string> __pyx_convert_vector_from_py_std_3a__3a_string(PyObject *); /*proto*/
|
|
2556
2598
|
/* #### Code section: typeinfo ### */
|
|
@@ -3904,13 +3946,13 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
|
|
|
3904
3946
|
|
|
3905
3947
|
/* "string.from_py":13
|
|
3906
3948
|
*
|
|
3907
|
-
* @cname("
|
|
3908
|
-
* cdef string
|
|
3949
|
+
* @cname("__pyx_convert_string_from_py_6libcpp_6string_std__in_string")
|
|
3950
|
+
* cdef string __pyx_convert_string_from_py_6libcpp_6string_std__in_string(object o) except *: # <<<<<<<<<<<<<<
|
|
3909
3951
|
* cdef Py_ssize_t length = 0
|
|
3910
3952
|
* cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
|
|
3911
3953
|
*/
|
|
3912
3954
|
|
|
3913
|
-
static std::string
|
|
3955
|
+
static std::string __pyx_convert_string_from_py_6libcpp_6string_std__in_string(PyObject *__pyx_v_o) {
|
|
3914
3956
|
Py_ssize_t __pyx_v_length;
|
|
3915
3957
|
char const *__pyx_v_data;
|
|
3916
3958
|
std::string __pyx_r;
|
|
@@ -3921,8 +3963,8 @@ static std::string __pyx_convert_string_from_py_std__in_string(PyObject *__pyx_v
|
|
|
3921
3963
|
int __pyx_clineno = 0;
|
|
3922
3964
|
|
|
3923
3965
|
/* "string.from_py":14
|
|
3924
|
-
* @cname("
|
|
3925
|
-
* cdef string
|
|
3966
|
+
* @cname("__pyx_convert_string_from_py_6libcpp_6string_std__in_string")
|
|
3967
|
+
* cdef string __pyx_convert_string_from_py_6libcpp_6string_std__in_string(object o) except *:
|
|
3926
3968
|
* cdef Py_ssize_t length = 0 # <<<<<<<<<<<<<<
|
|
3927
3969
|
* cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
|
|
3928
3970
|
* return string(data, length)
|
|
@@ -3930,7 +3972,7 @@ static std::string __pyx_convert_string_from_py_std__in_string(PyObject *__pyx_v
|
|
|
3930
3972
|
__pyx_v_length = 0;
|
|
3931
3973
|
|
|
3932
3974
|
/* "string.from_py":15
|
|
3933
|
-
* cdef string
|
|
3975
|
+
* cdef string __pyx_convert_string_from_py_6libcpp_6string_std__in_string(object o) except *:
|
|
3934
3976
|
* cdef Py_ssize_t length = 0
|
|
3935
3977
|
* cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) # <<<<<<<<<<<<<<
|
|
3936
3978
|
* return string(data, length)
|
|
@@ -3957,15 +3999,15 @@ static std::string __pyx_convert_string_from_py_std__in_string(PyObject *__pyx_v
|
|
|
3957
3999
|
|
|
3958
4000
|
/* "string.from_py":13
|
|
3959
4001
|
*
|
|
3960
|
-
* @cname("
|
|
3961
|
-
* cdef string
|
|
4002
|
+
* @cname("__pyx_convert_string_from_py_6libcpp_6string_std__in_string")
|
|
4003
|
+
* cdef string __pyx_convert_string_from_py_6libcpp_6string_std__in_string(object o) except *: # <<<<<<<<<<<<<<
|
|
3962
4004
|
* cdef Py_ssize_t length = 0
|
|
3963
4005
|
* cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
|
|
3964
4006
|
*/
|
|
3965
4007
|
|
|
3966
4008
|
/* function exit code */
|
|
3967
4009
|
__pyx_L1_error:;
|
|
3968
|
-
__Pyx_AddTraceback("string.from_py.
|
|
4010
|
+
__Pyx_AddTraceback("string.from_py.__pyx_convert_string_from_py_6libcpp_6string_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
3969
4011
|
__Pyx_pretend_to_initialize(&__pyx_r);
|
|
3970
4012
|
__pyx_L0:;
|
|
3971
4013
|
return __pyx_r;
|
|
@@ -3973,24 +4015,24 @@ static std::string __pyx_convert_string_from_py_std__in_string(PyObject *__pyx_v
|
|
|
3973
4015
|
|
|
3974
4016
|
/* "string.to_py":31
|
|
3975
4017
|
*
|
|
3976
|
-
* @cname("
|
|
3977
|
-
* cdef inline object
|
|
4018
|
+
* @cname("__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string")
|
|
4019
|
+
* cdef inline object __pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string(const string& s): # <<<<<<<<<<<<<<
|
|
3978
4020
|
* return __Pyx_PyObject_FromStringAndSize(s.data(), s.size())
|
|
3979
4021
|
* cdef extern from *:
|
|
3980
4022
|
*/
|
|
3981
4023
|
|
|
3982
|
-
static CYTHON_INLINE PyObject *
|
|
4024
|
+
static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string(std::string const &__pyx_v_s) {
|
|
3983
4025
|
PyObject *__pyx_r = NULL;
|
|
3984
4026
|
__Pyx_RefNannyDeclarations
|
|
3985
4027
|
PyObject *__pyx_t_1 = NULL;
|
|
3986
4028
|
int __pyx_lineno = 0;
|
|
3987
4029
|
const char *__pyx_filename = NULL;
|
|
3988
4030
|
int __pyx_clineno = 0;
|
|
3989
|
-
__Pyx_RefNannySetupContext("
|
|
4031
|
+
__Pyx_RefNannySetupContext("__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string", 1);
|
|
3990
4032
|
|
|
3991
4033
|
/* "string.to_py":32
|
|
3992
|
-
* @cname("
|
|
3993
|
-
* cdef inline object
|
|
4034
|
+
* @cname("__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string")
|
|
4035
|
+
* cdef inline object __pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string(const string& s):
|
|
3994
4036
|
* return __Pyx_PyObject_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
|
|
3995
4037
|
* cdef extern from *:
|
|
3996
4038
|
* cdef object __Pyx_PyUnicode_FromStringAndSize(const char*, size_t)
|
|
@@ -4004,8 +4046,8 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_strin
|
|
|
4004
4046
|
|
|
4005
4047
|
/* "string.to_py":31
|
|
4006
4048
|
*
|
|
4007
|
-
* @cname("
|
|
4008
|
-
* cdef inline object
|
|
4049
|
+
* @cname("__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string")
|
|
4050
|
+
* cdef inline object __pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string(const string& s): # <<<<<<<<<<<<<<
|
|
4009
4051
|
* return __Pyx_PyObject_FromStringAndSize(s.data(), s.size())
|
|
4010
4052
|
* cdef extern from *:
|
|
4011
4053
|
*/
|
|
@@ -4013,7 +4055,7 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_strin
|
|
|
4013
4055
|
/* function exit code */
|
|
4014
4056
|
__pyx_L1_error:;
|
|
4015
4057
|
__Pyx_XDECREF(__pyx_t_1);
|
|
4016
|
-
__Pyx_AddTraceback("string.to_py.
|
|
4058
|
+
__Pyx_AddTraceback("string.to_py.__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
4017
4059
|
__pyx_r = 0;
|
|
4018
4060
|
__pyx_L0:;
|
|
4019
4061
|
__Pyx_XGIVEREF(__pyx_r);
|
|
@@ -4023,24 +4065,24 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_strin
|
|
|
4023
4065
|
|
|
4024
4066
|
/* "string.to_py":37
|
|
4025
4067
|
*
|
|
4026
|
-
* @cname("
|
|
4027
|
-
* cdef inline object
|
|
4068
|
+
* @cname("__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string")
|
|
4069
|
+
* cdef inline object __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(const string& s): # <<<<<<<<<<<<<<
|
|
4028
4070
|
* return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size())
|
|
4029
4071
|
* cdef extern from *:
|
|
4030
4072
|
*/
|
|
4031
4073
|
|
|
4032
|
-
static CYTHON_INLINE PyObject *
|
|
4074
|
+
static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(std::string const &__pyx_v_s) {
|
|
4033
4075
|
PyObject *__pyx_r = NULL;
|
|
4034
4076
|
__Pyx_RefNannyDeclarations
|
|
4035
4077
|
PyObject *__pyx_t_1 = NULL;
|
|
4036
4078
|
int __pyx_lineno = 0;
|
|
4037
4079
|
const char *__pyx_filename = NULL;
|
|
4038
4080
|
int __pyx_clineno = 0;
|
|
4039
|
-
__Pyx_RefNannySetupContext("
|
|
4081
|
+
__Pyx_RefNannySetupContext("__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string", 1);
|
|
4040
4082
|
|
|
4041
4083
|
/* "string.to_py":38
|
|
4042
|
-
* @cname("
|
|
4043
|
-
* cdef inline object
|
|
4084
|
+
* @cname("__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string")
|
|
4085
|
+
* cdef inline object __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(const string& s):
|
|
4044
4086
|
* return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
|
|
4045
4087
|
* cdef extern from *:
|
|
4046
4088
|
* cdef object __Pyx_PyStr_FromStringAndSize(const char*, size_t)
|
|
@@ -4054,8 +4096,8 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_stri
|
|
|
4054
4096
|
|
|
4055
4097
|
/* "string.to_py":37
|
|
4056
4098
|
*
|
|
4057
|
-
* @cname("
|
|
4058
|
-
* cdef inline object
|
|
4099
|
+
* @cname("__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string")
|
|
4100
|
+
* cdef inline object __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(const string& s): # <<<<<<<<<<<<<<
|
|
4059
4101
|
* return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size())
|
|
4060
4102
|
* cdef extern from *:
|
|
4061
4103
|
*/
|
|
@@ -4063,7 +4105,7 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_stri
|
|
|
4063
4105
|
/* function exit code */
|
|
4064
4106
|
__pyx_L1_error:;
|
|
4065
4107
|
__Pyx_XDECREF(__pyx_t_1);
|
|
4066
|
-
__Pyx_AddTraceback("string.to_py.
|
|
4108
|
+
__Pyx_AddTraceback("string.to_py.__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
4067
4109
|
__pyx_r = 0;
|
|
4068
4110
|
__pyx_L0:;
|
|
4069
4111
|
__Pyx_XGIVEREF(__pyx_r);
|
|
@@ -4073,24 +4115,24 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_stri
|
|
|
4073
4115
|
|
|
4074
4116
|
/* "string.to_py":43
|
|
4075
4117
|
*
|
|
4076
|
-
* @cname("
|
|
4077
|
-
* cdef inline object
|
|
4118
|
+
* @cname("__pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string")
|
|
4119
|
+
* cdef inline object __pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string(const string& s): # <<<<<<<<<<<<<<
|
|
4078
4120
|
* return __Pyx_PyStr_FromStringAndSize(s.data(), s.size())
|
|
4079
4121
|
* cdef extern from *:
|
|
4080
4122
|
*/
|
|
4081
4123
|
|
|
4082
|
-
static CYTHON_INLINE PyObject *
|
|
4124
|
+
static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string(std::string const &__pyx_v_s) {
|
|
4083
4125
|
PyObject *__pyx_r = NULL;
|
|
4084
4126
|
__Pyx_RefNannyDeclarations
|
|
4085
4127
|
PyObject *__pyx_t_1 = NULL;
|
|
4086
4128
|
int __pyx_lineno = 0;
|
|
4087
4129
|
const char *__pyx_filename = NULL;
|
|
4088
4130
|
int __pyx_clineno = 0;
|
|
4089
|
-
__Pyx_RefNannySetupContext("
|
|
4131
|
+
__Pyx_RefNannySetupContext("__pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string", 1);
|
|
4090
4132
|
|
|
4091
4133
|
/* "string.to_py":44
|
|
4092
|
-
* @cname("
|
|
4093
|
-
* cdef inline object
|
|
4134
|
+
* @cname("__pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string")
|
|
4135
|
+
* cdef inline object __pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string(const string& s):
|
|
4094
4136
|
* return __Pyx_PyStr_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
|
|
4095
4137
|
* cdef extern from *:
|
|
4096
4138
|
* cdef object __Pyx_PyBytes_FromStringAndSize(const char*, size_t)
|
|
@@ -4104,8 +4146,8 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(s
|
|
|
4104
4146
|
|
|
4105
4147
|
/* "string.to_py":43
|
|
4106
4148
|
*
|
|
4107
|
-
* @cname("
|
|
4108
|
-
* cdef inline object
|
|
4149
|
+
* @cname("__pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string")
|
|
4150
|
+
* cdef inline object __pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string(const string& s): # <<<<<<<<<<<<<<
|
|
4109
4151
|
* return __Pyx_PyStr_FromStringAndSize(s.data(), s.size())
|
|
4110
4152
|
* cdef extern from *:
|
|
4111
4153
|
*/
|
|
@@ -4113,7 +4155,7 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(s
|
|
|
4113
4155
|
/* function exit code */
|
|
4114
4156
|
__pyx_L1_error:;
|
|
4115
4157
|
__Pyx_XDECREF(__pyx_t_1);
|
|
4116
|
-
__Pyx_AddTraceback("string.to_py.
|
|
4158
|
+
__Pyx_AddTraceback("string.to_py.__pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
4117
4159
|
__pyx_r = 0;
|
|
4118
4160
|
__pyx_L0:;
|
|
4119
4161
|
__Pyx_XGIVEREF(__pyx_r);
|
|
@@ -4123,24 +4165,24 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(s
|
|
|
4123
4165
|
|
|
4124
4166
|
/* "string.to_py":49
|
|
4125
4167
|
*
|
|
4126
|
-
* @cname("
|
|
4127
|
-
* cdef inline object
|
|
4168
|
+
* @cname("__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string")
|
|
4169
|
+
* cdef inline object __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(const string& s): # <<<<<<<<<<<<<<
|
|
4128
4170
|
* return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size())
|
|
4129
4171
|
* cdef extern from *:
|
|
4130
4172
|
*/
|
|
4131
4173
|
|
|
4132
|
-
static CYTHON_INLINE PyObject *
|
|
4174
|
+
static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(std::string const &__pyx_v_s) {
|
|
4133
4175
|
PyObject *__pyx_r = NULL;
|
|
4134
4176
|
__Pyx_RefNannyDeclarations
|
|
4135
4177
|
PyObject *__pyx_t_1 = NULL;
|
|
4136
4178
|
int __pyx_lineno = 0;
|
|
4137
4179
|
const char *__pyx_filename = NULL;
|
|
4138
4180
|
int __pyx_clineno = 0;
|
|
4139
|
-
__Pyx_RefNannySetupContext("
|
|
4181
|
+
__Pyx_RefNannySetupContext("__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string", 1);
|
|
4140
4182
|
|
|
4141
4183
|
/* "string.to_py":50
|
|
4142
|
-
* @cname("
|
|
4143
|
-
* cdef inline object
|
|
4184
|
+
* @cname("__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string")
|
|
4185
|
+
* cdef inline object __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(const string& s):
|
|
4144
4186
|
* return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
|
|
4145
4187
|
* cdef extern from *:
|
|
4146
4188
|
* cdef object __Pyx_PyByteArray_FromStringAndSize(const char*, size_t)
|
|
@@ -4154,8 +4196,8 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string
|
|
|
4154
4196
|
|
|
4155
4197
|
/* "string.to_py":49
|
|
4156
4198
|
*
|
|
4157
|
-
* @cname("
|
|
4158
|
-
* cdef inline object
|
|
4199
|
+
* @cname("__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string")
|
|
4200
|
+
* cdef inline object __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(const string& s): # <<<<<<<<<<<<<<
|
|
4159
4201
|
* return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size())
|
|
4160
4202
|
* cdef extern from *:
|
|
4161
4203
|
*/
|
|
@@ -4163,7 +4205,7 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string
|
|
|
4163
4205
|
/* function exit code */
|
|
4164
4206
|
__pyx_L1_error:;
|
|
4165
4207
|
__Pyx_XDECREF(__pyx_t_1);
|
|
4166
|
-
__Pyx_AddTraceback("string.to_py.
|
|
4208
|
+
__Pyx_AddTraceback("string.to_py.__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
4167
4209
|
__pyx_r = 0;
|
|
4168
4210
|
__pyx_L0:;
|
|
4169
4211
|
__Pyx_XGIVEREF(__pyx_r);
|
|
@@ -4173,24 +4215,24 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string
|
|
|
4173
4215
|
|
|
4174
4216
|
/* "string.to_py":55
|
|
4175
4217
|
*
|
|
4176
|
-
* @cname("
|
|
4177
|
-
* cdef inline object
|
|
4218
|
+
* @cname("__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string")
|
|
4219
|
+
* cdef inline object __pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string(const string& s): # <<<<<<<<<<<<<<
|
|
4178
4220
|
* return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size())
|
|
4179
4221
|
*
|
|
4180
4222
|
*/
|
|
4181
4223
|
|
|
4182
|
-
static CYTHON_INLINE PyObject *
|
|
4224
|
+
static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string(std::string const &__pyx_v_s) {
|
|
4183
4225
|
PyObject *__pyx_r = NULL;
|
|
4184
4226
|
__Pyx_RefNannyDeclarations
|
|
4185
4227
|
PyObject *__pyx_t_1 = NULL;
|
|
4186
4228
|
int __pyx_lineno = 0;
|
|
4187
4229
|
const char *__pyx_filename = NULL;
|
|
4188
4230
|
int __pyx_clineno = 0;
|
|
4189
|
-
__Pyx_RefNannySetupContext("
|
|
4231
|
+
__Pyx_RefNannySetupContext("__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string", 1);
|
|
4190
4232
|
|
|
4191
4233
|
/* "string.to_py":56
|
|
4192
|
-
* @cname("
|
|
4193
|
-
* cdef inline object
|
|
4234
|
+
* @cname("__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string")
|
|
4235
|
+
* cdef inline object __pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string(const string& s):
|
|
4194
4236
|
* return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
|
|
4195
4237
|
*
|
|
4196
4238
|
*/
|
|
@@ -4203,8 +4245,8 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_st
|
|
|
4203
4245
|
|
|
4204
4246
|
/* "string.to_py":55
|
|
4205
4247
|
*
|
|
4206
|
-
* @cname("
|
|
4207
|
-
* cdef inline object
|
|
4248
|
+
* @cname("__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string")
|
|
4249
|
+
* cdef inline object __pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string(const string& s): # <<<<<<<<<<<<<<
|
|
4208
4250
|
* return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size())
|
|
4209
4251
|
*
|
|
4210
4252
|
*/
|
|
@@ -4212,7 +4254,7 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_st
|
|
|
4212
4254
|
/* function exit code */
|
|
4213
4255
|
__pyx_L1_error:;
|
|
4214
4256
|
__Pyx_XDECREF(__pyx_t_1);
|
|
4215
|
-
__Pyx_AddTraceback("string.to_py.
|
|
4257
|
+
__Pyx_AddTraceback("string.to_py.__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
4216
4258
|
__pyx_r = 0;
|
|
4217
4259
|
__pyx_L0:;
|
|
4218
4260
|
__Pyx_XGIVEREF(__pyx_r);
|
|
@@ -4313,7 +4355,7 @@ static PyObject *__pyx_convert_vector_to_py_std_3a__3a_string(std::vector<std::s
|
|
|
4313
4355
|
* Py_INCREF(item)
|
|
4314
4356
|
* PyList_SET_ITEM(o, i, item)
|
|
4315
4357
|
*/
|
|
4316
|
-
__pyx_t_2 =
|
|
4358
|
+
__pyx_t_2 = __pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 77, __pyx_L1_error)
|
|
4317
4359
|
__Pyx_GOTREF(__pyx_t_2);
|
|
4318
4360
|
__Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_2);
|
|
4319
4361
|
__pyx_t_2 = 0;
|
|
@@ -4461,7 +4503,7 @@ static std::vector<std::string> __pyx_convert_vector_from_py_std_3a__3a_string(
|
|
|
4461
4503
|
* return v
|
|
4462
4504
|
*
|
|
4463
4505
|
*/
|
|
4464
|
-
__pyx_t_5 =
|
|
4506
|
+
__pyx_t_5 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_v_item); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 48, __pyx_L1_error)
|
|
4465
4507
|
try {
|
|
4466
4508
|
__pyx_v_v.push_back(((std::string)__pyx_t_5));
|
|
4467
4509
|
} catch(...) {
|
|
@@ -5152,7 +5194,7 @@ static int __pyx_pf_6chaine_5_core_3crf_7Trainer___init__(struct __pyx_obj_6chai
|
|
|
5152
5194
|
PyObject *__pyx_t_1 = NULL;
|
|
5153
5195
|
PyObject *__pyx_t_2 = NULL;
|
|
5154
5196
|
PyObject *__pyx_t_3 = NULL;
|
|
5155
|
-
int __pyx_t_4;
|
|
5197
|
+
unsigned int __pyx_t_4;
|
|
5156
5198
|
PyObject *__pyx_t_5 = NULL;
|
|
5157
5199
|
PyObject *__pyx_t_6 = NULL;
|
|
5158
5200
|
int __pyx_lineno = 0;
|
|
@@ -5336,8 +5378,8 @@ static int __pyx_pf_6chaine_5_core_3crf_7Trainer_2__cinit__(struct __pyx_obj_6ch
|
|
|
5336
5378
|
* self._trainer._init_trainer()
|
|
5337
5379
|
*
|
|
5338
5380
|
*/
|
|
5339
|
-
__pyx_t_1 =
|
|
5340
|
-
__pyx_t_2 =
|
|
5381
|
+
__pyx_t_1 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_n_b_l2sgd); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 87, __pyx_L1_error)
|
|
5382
|
+
__pyx_t_2 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_n_b_crf1d); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 87, __pyx_L1_error)
|
|
5341
5383
|
try {
|
|
5342
5384
|
__pyx_v_self->_trainer.select(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1), __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_2));
|
|
5343
5385
|
} catch(...) {
|
|
@@ -5573,7 +5615,7 @@ static PyObject *__pyx_pf_6chaine_5_core_3crf_7Trainer_4train(struct __pyx_obj_6
|
|
|
5573
5615
|
*/
|
|
5574
5616
|
__pyx_t_1 = __Pyx_PyObject_Str(__pyx_v_model_filepath); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error)
|
|
5575
5617
|
__Pyx_GOTREF(__pyx_t_1);
|
|
5576
|
-
__pyx_t_2 =
|
|
5618
|
+
__pyx_t_2 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 95, __pyx_L1_error)
|
|
5577
5619
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
5578
5620
|
try {
|
|
5579
5621
|
__pyx_v_self->_trainer.train(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_2), -1);
|
|
@@ -5719,7 +5761,7 @@ static PyObject *__pyx_pf_6chaine_5_core_3crf_7Trainer_6_log(CYTHON_UNUSED struc
|
|
|
5719
5761
|
PyObject *__pyx_t_1 = NULL;
|
|
5720
5762
|
PyObject *__pyx_t_2 = NULL;
|
|
5721
5763
|
PyObject *__pyx_t_3 = NULL;
|
|
5722
|
-
int __pyx_t_4;
|
|
5764
|
+
unsigned int __pyx_t_4;
|
|
5723
5765
|
int __pyx_lineno = 0;
|
|
5724
5766
|
const char *__pyx_filename = NULL;
|
|
5725
5767
|
int __pyx_clineno = 0;
|
|
@@ -5799,7 +5841,7 @@ static PyObject *__pyx_f_6chaine_5_core_3crf_7Trainer__on_message(struct __pyx_o
|
|
|
5799
5841
|
PyObject *__pyx_t_2 = NULL;
|
|
5800
5842
|
PyObject *__pyx_t_3 = NULL;
|
|
5801
5843
|
PyObject *__pyx_t_4 = NULL;
|
|
5802
|
-
int __pyx_t_5;
|
|
5844
|
+
unsigned int __pyx_t_5;
|
|
5803
5845
|
int __pyx_lineno = 0;
|
|
5804
5846
|
const char *__pyx_filename = NULL;
|
|
5805
5847
|
int __pyx_clineno = 0;
|
|
@@ -5814,7 +5856,7 @@ static PyObject *__pyx_f_6chaine_5_core_3crf_7Trainer__on_message(struct __pyx_o
|
|
|
5814
5856
|
*/
|
|
5815
5857
|
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_log); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error)
|
|
5816
5858
|
__Pyx_GOTREF(__pyx_t_2);
|
|
5817
|
-
__pyx_t_3 =
|
|
5859
|
+
__pyx_t_3 = __pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string(__pyx_v_message); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 101, __pyx_L1_error)
|
|
5818
5860
|
__Pyx_GOTREF(__pyx_t_3);
|
|
5819
5861
|
__pyx_t_4 = NULL;
|
|
5820
5862
|
__pyx_t_5 = 0;
|
|
@@ -6378,7 +6420,7 @@ static PyObject *__pyx_pf_6chaine_5_core_3crf_7Trainer_10translate_params(struct
|
|
|
6378
6420
|
PyObject *__pyx_t_7 = NULL;
|
|
6379
6421
|
PyObject *__pyx_t_8 = NULL;
|
|
6380
6422
|
PyObject *(*__pyx_t_9)(PyObject *);
|
|
6381
|
-
int __pyx_t_10;
|
|
6423
|
+
unsigned int __pyx_t_10;
|
|
6382
6424
|
int __pyx_lineno = 0;
|
|
6383
6425
|
const char *__pyx_filename = NULL;
|
|
6384
6426
|
int __pyx_clineno = 0;
|
|
@@ -6834,8 +6876,8 @@ static PyObject *__pyx_pf_6chaine_5_core_3crf_7Trainer_12select_algorithm(struct
|
|
|
6834
6876
|
* raise ValueError(f"{algorithm} is no available algorithm")
|
|
6835
6877
|
*
|
|
6836
6878
|
*/
|
|
6837
|
-
__pyx_t_9 =
|
|
6838
|
-
__pyx_t_10 =
|
|
6879
|
+
__pyx_t_9 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_v_algorithm); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 124, __pyx_L1_error)
|
|
6880
|
+
__pyx_t_10 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_n_b_crf1d); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 124, __pyx_L1_error)
|
|
6839
6881
|
try {
|
|
6840
6882
|
__pyx_t_11 = __pyx_v_self->_trainer.select(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_9), __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_10));
|
|
6841
6883
|
} catch(...) {
|
|
@@ -7022,7 +7064,7 @@ static PyObject *__pyx_pf_6chaine_5_core_3crf_7Trainer_14set_params(struct __pyx
|
|
|
7022
7064
|
PyObject *__pyx_t_6 = NULL;
|
|
7023
7065
|
PyObject *__pyx_t_7 = NULL;
|
|
7024
7066
|
PyObject *(*__pyx_t_8)(PyObject *);
|
|
7025
|
-
int __pyx_t_9;
|
|
7067
|
+
unsigned int __pyx_t_9;
|
|
7026
7068
|
int __pyx_lineno = 0;
|
|
7027
7069
|
const char *__pyx_filename = NULL;
|
|
7028
7070
|
int __pyx_clineno = 0;
|
|
@@ -7390,10 +7432,10 @@ static PyObject *__pyx_pf_6chaine_5_core_3crf_7Trainer_16set_param(struct __pyx_
|
|
|
7390
7432
|
*
|
|
7391
7433
|
* def get_param(self, param: str):
|
|
7392
7434
|
*/
|
|
7393
|
-
__pyx_t_3 =
|
|
7435
|
+
__pyx_t_3 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_v_param); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L1_error)
|
|
7394
7436
|
__pyx_t_1 = __Pyx_PyObject_Str(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L1_error)
|
|
7395
7437
|
__Pyx_GOTREF(__pyx_t_1);
|
|
7396
|
-
__pyx_t_4 =
|
|
7438
|
+
__pyx_t_4 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L1_error)
|
|
7397
7439
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
7398
7440
|
try {
|
|
7399
7441
|
__pyx_v_self->_trainer.set(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_3), __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_4));
|
|
@@ -7543,7 +7585,7 @@ static PyObject *__pyx_pf_6chaine_5_core_3crf_7Trainer_18get_param(struct __pyx_
|
|
|
7543
7585
|
std::string __pyx_t_4;
|
|
7544
7586
|
PyObject *__pyx_t_5 = NULL;
|
|
7545
7587
|
PyObject *__pyx_t_6 = NULL;
|
|
7546
|
-
int __pyx_t_7;
|
|
7588
|
+
unsigned int __pyx_t_7;
|
|
7547
7589
|
int __pyx_lineno = 0;
|
|
7548
7590
|
const char *__pyx_filename = NULL;
|
|
7549
7591
|
int __pyx_clineno = 0;
|
|
@@ -7559,14 +7601,14 @@ static PyObject *__pyx_pf_6chaine_5_core_3crf_7Trainer_18get_param(struct __pyx_
|
|
|
7559
7601
|
__Pyx_XDECREF(__pyx_r);
|
|
7560
7602
|
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cast_parameter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error)
|
|
7561
7603
|
__Pyx_GOTREF(__pyx_t_2);
|
|
7562
|
-
__pyx_t_3 =
|
|
7604
|
+
__pyx_t_3 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_v_param); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 137, __pyx_L1_error)
|
|
7563
7605
|
try {
|
|
7564
7606
|
__pyx_t_4 = __pyx_v_self->_trainer.get(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_3));
|
|
7565
7607
|
} catch(...) {
|
|
7566
7608
|
__Pyx_CppExn2PyErr();
|
|
7567
7609
|
__PYX_ERR(0, 137, __pyx_L1_error)
|
|
7568
7610
|
}
|
|
7569
|
-
__pyx_t_5 =
|
|
7611
|
+
__pyx_t_5 = __pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 137, __pyx_L1_error)
|
|
7570
7612
|
__Pyx_GOTREF(__pyx_t_5);
|
|
7571
7613
|
__pyx_t_6 = NULL;
|
|
7572
7614
|
__pyx_t_7 = 0;
|
|
@@ -7749,7 +7791,7 @@ static PyObject *__pyx_pf_6chaine_5_core_3crf_7Trainer_20cast_parameter(struct _
|
|
|
7749
7791
|
int __pyx_t_2;
|
|
7750
7792
|
PyObject *__pyx_t_3 = NULL;
|
|
7751
7793
|
PyObject *__pyx_t_4 = NULL;
|
|
7752
|
-
int __pyx_t_5;
|
|
7794
|
+
unsigned int __pyx_t_5;
|
|
7753
7795
|
int __pyx_lineno = 0;
|
|
7754
7796
|
const char *__pyx_filename = NULL;
|
|
7755
7797
|
int __pyx_clineno = 0;
|
|
@@ -8158,7 +8200,7 @@ static int __pyx_pf_6chaine_5_core_3crf_5Model___init__(struct __pyx_obj_6chaine
|
|
|
8158
8200
|
PyObject *__pyx_t_1 = NULL;
|
|
8159
8201
|
PyObject *__pyx_t_2 = NULL;
|
|
8160
8202
|
PyObject *__pyx_t_3 = NULL;
|
|
8161
|
-
int __pyx_t_4;
|
|
8203
|
+
unsigned int __pyx_t_4;
|
|
8162
8204
|
int __pyx_lineno = 0;
|
|
8163
8205
|
const char *__pyx_filename = NULL;
|
|
8164
8206
|
int __pyx_clineno = 0;
|
|
@@ -8585,7 +8627,7 @@ static PyObject *__pyx_pf_6chaine_5_core_3crf_5Model_4predict_proba_single(struc
|
|
|
8585
8627
|
PyObject *__pyx_t_10 = NULL;
|
|
8586
8628
|
PyObject *__pyx_t_11 = NULL;
|
|
8587
8629
|
PyObject *__pyx_t_12 = NULL;
|
|
8588
|
-
int __pyx_t_13;
|
|
8630
|
+
unsigned int __pyx_t_13;
|
|
8589
8631
|
int __pyx_lineno = 0;
|
|
8590
8632
|
const char *__pyx_filename = NULL;
|
|
8591
8633
|
int __pyx_clineno = 0;
|
|
@@ -8880,9 +8922,10 @@ static PyObject *__pyx_pf_6chaine_5_core_3crf_5Model_6load(struct __pyx_obj_6cha
|
|
|
8880
8922
|
PyObject *__pyx_t_1 = NULL;
|
|
8881
8923
|
PyObject *__pyx_t_2 = NULL;
|
|
8882
8924
|
PyObject *__pyx_t_3 = NULL;
|
|
8883
|
-
int __pyx_t_4;
|
|
8925
|
+
unsigned int __pyx_t_4;
|
|
8884
8926
|
std::string __pyx_t_5;
|
|
8885
8927
|
int __pyx_t_6;
|
|
8928
|
+
int __pyx_t_7;
|
|
8886
8929
|
int __pyx_lineno = 0;
|
|
8887
8930
|
const char *__pyx_filename = NULL;
|
|
8888
8931
|
int __pyx_clineno = 0;
|
|
@@ -8941,15 +8984,15 @@ static PyObject *__pyx_pf_6chaine_5_core_3crf_5Model_6load(struct __pyx_obj_6cha
|
|
|
8941
8984
|
* raise ValueError(f"Cannot load model file {filepath}")
|
|
8942
8985
|
*
|
|
8943
8986
|
*/
|
|
8944
|
-
__pyx_t_5 =
|
|
8987
|
+
__pyx_t_5 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_v_filepath); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 169, __pyx_L1_error)
|
|
8945
8988
|
try {
|
|
8946
|
-
|
|
8989
|
+
__pyx_t_6 = __pyx_v_self->_tagger.open(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_5));
|
|
8947
8990
|
} catch(...) {
|
|
8948
8991
|
__Pyx_CppExn2PyErr();
|
|
8949
8992
|
__PYX_ERR(0, 169, __pyx_L1_error)
|
|
8950
8993
|
}
|
|
8951
|
-
|
|
8952
|
-
if (unlikely(
|
|
8994
|
+
__pyx_t_7 = (!(__pyx_t_6 != 0));
|
|
8995
|
+
if (unlikely(__pyx_t_7)) {
|
|
8953
8996
|
|
|
8954
8997
|
/* "chaine/_core/crf.pyx":170
|
|
8955
8998
|
* self.check_model(filepath)
|
|
@@ -9148,7 +9191,7 @@ static PyObject *__pyx_pf_6chaine_5_core_3crf_5Model_8marginal(struct __pyx_obj_
|
|
|
9148
9191
|
* cpdef set_sequence(self, sequence) except +:
|
|
9149
9192
|
*/
|
|
9150
9193
|
__Pyx_XDECREF(__pyx_r);
|
|
9151
|
-
__pyx_t_1 =
|
|
9194
|
+
__pyx_t_1 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_v_label); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 173, __pyx_L1_error)
|
|
9152
9195
|
__pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_index); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 173, __pyx_L1_error)
|
|
9153
9196
|
try {
|
|
9154
9197
|
__pyx_t_3 = __pyx_v_self->_tagger.marginal(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1), __pyx_t_2);
|
|
@@ -9203,7 +9246,7 @@ static PyObject *__pyx_f_6chaine_5_core_3crf_5Model_set_sequence(struct __pyx_ob
|
|
|
9203
9246
|
PyObject *__pyx_t_2 = NULL;
|
|
9204
9247
|
PyObject *__pyx_t_3 = NULL;
|
|
9205
9248
|
PyObject *__pyx_t_4 = NULL;
|
|
9206
|
-
int __pyx_t_5;
|
|
9249
|
+
unsigned int __pyx_t_5;
|
|
9207
9250
|
CRFSuite::ItemSequence __pyx_t_6;
|
|
9208
9251
|
int __pyx_lineno = 0;
|
|
9209
9252
|
const char *__pyx_filename = NULL;
|
|
@@ -9556,7 +9599,7 @@ static PyObject *__pyx_pf_6chaine_5_core_3crf_5Model_12check_model(PyObject *__p
|
|
|
9556
9599
|
PyObject *__pyx_t_3 = NULL;
|
|
9557
9600
|
PyObject *__pyx_t_4 = NULL;
|
|
9558
9601
|
PyObject *__pyx_t_5 = NULL;
|
|
9559
|
-
int __pyx_t_6;
|
|
9602
|
+
unsigned int __pyx_t_6;
|
|
9560
9603
|
PyObject *__pyx_t_7 = NULL;
|
|
9561
9604
|
PyObject *__pyx_t_8 = NULL;
|
|
9562
9605
|
PyObject *__pyx_t_9 = NULL;
|
|
@@ -10044,7 +10087,8 @@ static PyObject *__pyx_pf_6chaine_5_core_3crf_5Model_14dump_transitions(struct _
|
|
|
10044
10087
|
PyObject *__pyx_t_4 = NULL;
|
|
10045
10088
|
PyObject *__pyx_t_5 = NULL;
|
|
10046
10089
|
PyObject *__pyx_t_6 = NULL;
|
|
10047
|
-
int __pyx_t_7;
|
|
10090
|
+
unsigned int __pyx_t_7;
|
|
10091
|
+
int __pyx_t_8;
|
|
10048
10092
|
int __pyx_lineno = 0;
|
|
10049
10093
|
const char *__pyx_filename = NULL;
|
|
10050
10094
|
int __pyx_clineno = 0;
|
|
@@ -10102,10 +10146,10 @@ static PyObject *__pyx_pf_6chaine_5_core_3crf_5Model_14dump_transitions(struct _
|
|
|
10102
10146
|
__Pyx_GOTREF(__pyx_t_1);
|
|
10103
10147
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
10104
10148
|
}
|
|
10105
|
-
|
|
10149
|
+
__pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 189, __pyx_L1_error)
|
|
10106
10150
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
10107
10151
|
try {
|
|
10108
|
-
__pyx_v_self->_tagger.dump_transitions(
|
|
10152
|
+
__pyx_v_self->_tagger.dump_transitions(__pyx_t_8);
|
|
10109
10153
|
} catch(...) {
|
|
10110
10154
|
__Pyx_CppExn2PyErr();
|
|
10111
10155
|
__PYX_ERR(0, 189, __pyx_L1_error)
|
|
@@ -10251,7 +10295,8 @@ static PyObject *__pyx_pf_6chaine_5_core_3crf_5Model_16dump_states(struct __pyx_
|
|
|
10251
10295
|
PyObject *__pyx_t_4 = NULL;
|
|
10252
10296
|
PyObject *__pyx_t_5 = NULL;
|
|
10253
10297
|
PyObject *__pyx_t_6 = NULL;
|
|
10254
|
-
int __pyx_t_7;
|
|
10298
|
+
unsigned int __pyx_t_7;
|
|
10299
|
+
int __pyx_t_8;
|
|
10255
10300
|
int __pyx_lineno = 0;
|
|
10256
10301
|
const char *__pyx_filename = NULL;
|
|
10257
10302
|
int __pyx_clineno = 0;
|
|
@@ -10309,10 +10354,10 @@ static PyObject *__pyx_pf_6chaine_5_core_3crf_5Model_16dump_states(struct __pyx_
|
|
|
10309
10354
|
__Pyx_GOTREF(__pyx_t_1);
|
|
10310
10355
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
10311
10356
|
}
|
|
10312
|
-
|
|
10357
|
+
__pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 192, __pyx_L1_error)
|
|
10313
10358
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
10314
10359
|
try {
|
|
10315
|
-
__pyx_v_self->_tagger.dump_states(
|
|
10360
|
+
__pyx_v_self->_tagger.dump_states(__pyx_t_8);
|
|
10316
10361
|
} catch(...) {
|
|
10317
10362
|
__Pyx_CppExn2PyErr();
|
|
10318
10363
|
__PYX_ERR(0, 192, __pyx_L1_error)
|
|
@@ -10604,7 +10649,7 @@ static CRFSuite::Item __pyx_f_6chaine_5_core_3crf_to_item(PyObject *__pyx_v_sequ
|
|
|
10604
10649
|
* is_dict = isinstance(sequence, dict)
|
|
10605
10650
|
* c_item = crfsuite_api.Item()
|
|
10606
10651
|
*/
|
|
10607
|
-
__pyx_t_1 =
|
|
10652
|
+
__pyx_t_1 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_kp_b__2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 201, __pyx_L1_error)
|
|
10608
10653
|
__pyx_v_separator = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1);
|
|
10609
10654
|
|
|
10610
10655
|
/* "chaine/_core/crf.pyx":202
|
|
@@ -10732,7 +10777,7 @@ static CRFSuite::Item __pyx_f_6chaine_5_core_3crf_to_item(PyObject *__pyx_v_sequ
|
|
|
10732
10777
|
}
|
|
10733
10778
|
__pyx_t_7 = PyUnicode_AsUTF8String(((PyObject*)__pyx_v_token)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 208, __pyx_L1_error)
|
|
10734
10779
|
__Pyx_GOTREF(__pyx_t_7);
|
|
10735
|
-
__pyx_t_1 =
|
|
10780
|
+
__pyx_t_1 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_7); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 208, __pyx_L1_error)
|
|
10736
10781
|
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
|
|
10737
10782
|
__pyx_v_c_token = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1);
|
|
10738
10783
|
|
|
@@ -10754,7 +10799,7 @@ static CRFSuite::Item __pyx_f_6chaine_5_core_3crf_to_item(PyObject *__pyx_v_sequ
|
|
|
10754
10799
|
* c_value = 1.0
|
|
10755
10800
|
*/
|
|
10756
10801
|
/*else*/ {
|
|
10757
|
-
__pyx_t_1 =
|
|
10802
|
+
__pyx_t_1 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_v_token); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 210, __pyx_L1_error)
|
|
10758
10803
|
__pyx_v_c_token = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1);
|
|
10759
10804
|
}
|
|
10760
10805
|
__pyx_L5:;
|
|
@@ -10950,7 +10995,7 @@ static CRFSuite::Item __pyx_f_6chaine_5_core_3crf_to_item(PyObject *__pyx_v_sequ
|
|
|
10950
10995
|
}
|
|
10951
10996
|
__pyx_t_7 = PyUnicode_AsUTF8String(((PyObject*)__pyx_v_value)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 224, __pyx_L1_error)
|
|
10952
10997
|
__Pyx_GOTREF(__pyx_t_7);
|
|
10953
|
-
__pyx_t_12 =
|
|
10998
|
+
__pyx_t_12 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_7); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 224, __pyx_L1_error)
|
|
10954
10999
|
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
|
|
10955
11000
|
__pyx_v_c_token += ((std::string)__pyx_t_12);
|
|
10956
11001
|
|
|
@@ -10999,7 +11044,7 @@ static CRFSuite::Item __pyx_f_6chaine_5_core_3crf_to_item(PyObject *__pyx_v_sequ
|
|
|
10999
11044
|
* c_value = 1.0
|
|
11000
11045
|
* else:
|
|
11001
11046
|
*/
|
|
11002
|
-
__pyx_t_12 =
|
|
11047
|
+
__pyx_t_12 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 228, __pyx_L1_error)
|
|
11003
11048
|
__pyx_v_c_token += ((std::string)__pyx_t_12);
|
|
11004
11049
|
|
|
11005
11050
|
/* "chaine/_core/crf.pyx":229
|
|
@@ -12132,6 +12177,9 @@ static PyTypeObject __pyx_type_6chaine_5_core_3crf_Trainer = {
|
|
|
12132
12177
|
#if PY_VERSION_HEX >= 0x030C0000
|
|
12133
12178
|
0, /*tp_watched*/
|
|
12134
12179
|
#endif
|
|
12180
|
+
#if PY_VERSION_HEX >= 0x030d00A4
|
|
12181
|
+
0, /*tp_versions_used*/
|
|
12182
|
+
#endif
|
|
12135
12183
|
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
|
|
12136
12184
|
0, /*tp_pypy_flags*/
|
|
12137
12185
|
#endif
|
|
@@ -12295,6 +12343,9 @@ static PyTypeObject __pyx_type_6chaine_5_core_3crf_Model = {
|
|
|
12295
12343
|
#if PY_VERSION_HEX >= 0x030C0000
|
|
12296
12344
|
0, /*tp_watched*/
|
|
12297
12345
|
#endif
|
|
12346
|
+
#if PY_VERSION_HEX >= 0x030d00A4
|
|
12347
|
+
0, /*tp_versions_used*/
|
|
12348
|
+
#endif
|
|
12298
12349
|
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
|
|
12299
12350
|
0, /*tp_pypy_flags*/
|
|
12300
12351
|
#endif
|
|
@@ -12467,6 +12518,9 @@ static PyTypeObject __pyx_type_6chaine_5_core_3crf_ItemSequence = {
|
|
|
12467
12518
|
#if PY_VERSION_HEX >= 0x030C0000
|
|
12468
12519
|
0, /*tp_watched*/
|
|
12469
12520
|
#endif
|
|
12521
|
+
#if PY_VERSION_HEX >= 0x030d00A4
|
|
12522
|
+
0, /*tp_versions_used*/
|
|
12523
|
+
#endif
|
|
12470
12524
|
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
|
|
12471
12525
|
0, /*tp_pypy_flags*/
|
|
12472
12526
|
#endif
|
|
@@ -13338,7 +13392,7 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_crf(PyObject *__pyx_pyinit_module)
|
|
|
13338
13392
|
__pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
13339
13393
|
{
|
|
13340
13394
|
int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef);
|
|
13341
|
-
__pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to crf pseudovariable */
|
|
13395
|
+
__pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "crf" pseudovariable */
|
|
13342
13396
|
if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
13343
13397
|
pystate_addmodule_run = 1;
|
|
13344
13398
|
}
|
|
@@ -13350,10 +13404,8 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_crf(PyObject *__pyx_pyinit_module)
|
|
|
13350
13404
|
CYTHON_UNUSED_VAR(__pyx_t_1);
|
|
13351
13405
|
__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
13352
13406
|
Py_INCREF(__pyx_d);
|
|
13353
|
-
__pyx_b =
|
|
13354
|
-
|
|
13355
|
-
__pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
13356
|
-
Py_INCREF(__pyx_cython_runtime);
|
|
13407
|
+
__pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
13408
|
+
__pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
13357
13409
|
if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
13358
13410
|
#if CYTHON_REFNANNY
|
|
13359
13411
|
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
|
|
@@ -14396,14 +14448,20 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject
|
|
|
14396
14448
|
#endif
|
|
14397
14449
|
|
|
14398
14450
|
/* PyObjectGetAttrStrNoError */
|
|
14451
|
+
#if __PYX_LIMITED_VERSION_HEX < 0x030d00A1
|
|
14399
14452
|
static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
|
|
14400
14453
|
__Pyx_PyThreadState_declare
|
|
14401
14454
|
__Pyx_PyThreadState_assign
|
|
14402
14455
|
if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
|
|
14403
14456
|
__Pyx_PyErr_Clear();
|
|
14404
14457
|
}
|
|
14458
|
+
#endif
|
|
14405
14459
|
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
|
|
14406
14460
|
PyObject *result;
|
|
14461
|
+
#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
|
|
14462
|
+
(void) PyObject_GetOptionalAttr(obj, attr_name, &result);
|
|
14463
|
+
return result;
|
|
14464
|
+
#else
|
|
14407
14465
|
#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
|
|
14408
14466
|
PyTypeObject* tp = Py_TYPE(obj);
|
|
14409
14467
|
if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
|
|
@@ -14415,6 +14473,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, P
|
|
|
14415
14473
|
__Pyx_PyObject_GetAttrStr_ClearAttributeError();
|
|
14416
14474
|
}
|
|
14417
14475
|
return result;
|
|
14476
|
+
#endif
|
|
14418
14477
|
}
|
|
14419
14478
|
|
|
14420
14479
|
/* GetBuiltinName */
|
|
@@ -14630,13 +14689,31 @@ static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyO
|
|
|
14630
14689
|
{
|
|
14631
14690
|
int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ);
|
|
14632
14691
|
if (unlikely(eq != 0)) {
|
|
14633
|
-
if (unlikely(eq < 0)) return NULL;
|
|
14692
|
+
if (unlikely(eq < 0)) return NULL;
|
|
14634
14693
|
return kwvalues[i];
|
|
14635
14694
|
}
|
|
14636
14695
|
}
|
|
14637
|
-
return NULL;
|
|
14696
|
+
return NULL;
|
|
14697
|
+
}
|
|
14698
|
+
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
|
|
14699
|
+
CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) {
|
|
14700
|
+
Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames);
|
|
14701
|
+
PyObject *dict;
|
|
14702
|
+
dict = PyDict_New();
|
|
14703
|
+
if (unlikely(!dict))
|
|
14704
|
+
return NULL;
|
|
14705
|
+
for (i=0; i<nkwargs; i++) {
|
|
14706
|
+
PyObject *key = PyTuple_GET_ITEM(kwnames, i);
|
|
14707
|
+
if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
|
|
14708
|
+
goto bad;
|
|
14709
|
+
}
|
|
14710
|
+
return dict;
|
|
14711
|
+
bad:
|
|
14712
|
+
Py_DECREF(dict);
|
|
14713
|
+
return NULL;
|
|
14638
14714
|
}
|
|
14639
14715
|
#endif
|
|
14716
|
+
#endif
|
|
14640
14717
|
|
|
14641
14718
|
/* RaiseDoubleKeywords */
|
|
14642
14719
|
static void __Pyx_RaiseDoubleKeywordsError(
|
|
@@ -14703,7 +14780,7 @@ static int __Pyx_ParseOptionalKeywords(
|
|
|
14703
14780
|
if (*name) {
|
|
14704
14781
|
values[name-argnames] = value;
|
|
14705
14782
|
#if CYTHON_AVOID_BORROWED_REFS
|
|
14706
|
-
Py_INCREF(value);
|
|
14783
|
+
Py_INCREF(value);
|
|
14707
14784
|
Py_DECREF(key);
|
|
14708
14785
|
#endif
|
|
14709
14786
|
key = NULL;
|
|
@@ -14722,7 +14799,7 @@ static int __Pyx_ParseOptionalKeywords(
|
|
|
14722
14799
|
&& _PyString_Eq(**name, key)) {
|
|
14723
14800
|
values[name-argnames] = value;
|
|
14724
14801
|
#if CYTHON_AVOID_BORROWED_REFS
|
|
14725
|
-
value = NULL;
|
|
14802
|
+
value = NULL;
|
|
14726
14803
|
#endif
|
|
14727
14804
|
break;
|
|
14728
14805
|
}
|
|
@@ -14754,7 +14831,7 @@ static int __Pyx_ParseOptionalKeywords(
|
|
|
14754
14831
|
if (cmp == 0) {
|
|
14755
14832
|
values[name-argnames] = value;
|
|
14756
14833
|
#if CYTHON_AVOID_BORROWED_REFS
|
|
14757
|
-
value = NULL;
|
|
14834
|
+
value = NULL;
|
|
14758
14835
|
#endif
|
|
14759
14836
|
break;
|
|
14760
14837
|
}
|
|
@@ -14906,9 +14983,15 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args,
|
|
|
14906
14983
|
PyObject *result;
|
|
14907
14984
|
assert(kwargs == NULL || PyDict_Check(kwargs));
|
|
14908
14985
|
nk = kwargs ? PyDict_Size(kwargs) : 0;
|
|
14986
|
+
#if PY_MAJOR_VERSION < 3
|
|
14909
14987
|
if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) {
|
|
14910
14988
|
return NULL;
|
|
14911
14989
|
}
|
|
14990
|
+
#else
|
|
14991
|
+
if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) {
|
|
14992
|
+
return NULL;
|
|
14993
|
+
}
|
|
14994
|
+
#endif
|
|
14912
14995
|
if (
|
|
14913
14996
|
#if PY_MAJOR_VERSION >= 3
|
|
14914
14997
|
co->co_kwonlyargcount == 0 &&
|
|
@@ -14985,8 +15068,13 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg
|
|
|
14985
15068
|
ternaryfunc call = Py_TYPE(func)->tp_call;
|
|
14986
15069
|
if (unlikely(!call))
|
|
14987
15070
|
return PyObject_Call(func, arg, kw);
|
|
15071
|
+
#if PY_MAJOR_VERSION < 3
|
|
14988
15072
|
if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
|
|
14989
15073
|
return NULL;
|
|
15074
|
+
#else
|
|
15075
|
+
if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
|
|
15076
|
+
return NULL;
|
|
15077
|
+
#endif
|
|
14990
15078
|
result = (*call)(func, arg, kw);
|
|
14991
15079
|
Py_LeaveRecursiveCall();
|
|
14992
15080
|
if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
|
|
@@ -15005,8 +15093,13 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject
|
|
|
15005
15093
|
PyCFunction cfunc;
|
|
15006
15094
|
cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
|
|
15007
15095
|
self = __Pyx_CyOrPyCFunction_GET_SELF(func);
|
|
15096
|
+
#if PY_MAJOR_VERSION < 3
|
|
15008
15097
|
if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
|
|
15009
15098
|
return NULL;
|
|
15099
|
+
#else
|
|
15100
|
+
if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
|
|
15101
|
+
return NULL;
|
|
15102
|
+
#endif
|
|
15010
15103
|
result = cfunc(self, arg);
|
|
15011
15104
|
Py_LeaveRecursiveCall();
|
|
15012
15105
|
if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
|
|
@@ -15071,7 +15164,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj
|
|
|
15071
15164
|
#endif
|
|
15072
15165
|
if (kwargs == NULL) {
|
|
15073
15166
|
#if CYTHON_VECTORCALL
|
|
15074
|
-
#if
|
|
15167
|
+
#if PY_VERSION_HEX < 0x03090000
|
|
15075
15168
|
vectorcallfunc f = _PyVectorcall_Function(func);
|
|
15076
15169
|
#else
|
|
15077
15170
|
vectorcallfunc f = PyVectorcall_Function(func);
|
|
@@ -15205,7 +15298,7 @@ static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
|
|
|
15205
15298
|
{
|
|
15206
15299
|
PyObject *result;
|
|
15207
15300
|
#if !CYTHON_AVOID_BORROWED_REFS
|
|
15208
|
-
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
|
|
15301
|
+
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000
|
|
15209
15302
|
result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
|
|
15210
15303
|
__PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
|
|
15211
15304
|
if (likely(result)) {
|
|
@@ -15241,9 +15334,10 @@ static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
|
|
|
15241
15334
|
|
|
15242
15335
|
/* UnpackUnboundCMethod */
|
|
15243
15336
|
static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) {
|
|
15337
|
+
PyObject *result;
|
|
15244
15338
|
PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args));
|
|
15245
15339
|
if (unlikely(!selfless_args)) return NULL;
|
|
15246
|
-
|
|
15340
|
+
result = PyObject_Call(method, selfless_args, kwargs);
|
|
15247
15341
|
Py_DECREF(selfless_args);
|
|
15248
15342
|
return result;
|
|
15249
15343
|
}
|
|
@@ -15342,9 +15436,10 @@ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
|
|
|
15342
15436
|
|
|
15343
15437
|
/* IterFinish */
|
|
15344
15438
|
static CYTHON_INLINE int __Pyx_IterFinish(void) {
|
|
15439
|
+
PyObject* exc_type;
|
|
15345
15440
|
__Pyx_PyThreadState_declare
|
|
15346
15441
|
__Pyx_PyThreadState_assign
|
|
15347
|
-
|
|
15442
|
+
exc_type = __Pyx_PyErr_CurrentExceptionType();
|
|
15348
15443
|
if (unlikely(exc_type)) {
|
|
15349
15444
|
if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))
|
|
15350
15445
|
return -1;
|
|
@@ -15452,7 +15547,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
|
|
|
15452
15547
|
}
|
|
15453
15548
|
}
|
|
15454
15549
|
#else
|
|
15455
|
-
if (is_list ||
|
|
15550
|
+
if (is_list || !PyMapping_Check(o)) {
|
|
15456
15551
|
return PySequence_GetItem(o, i);
|
|
15457
15552
|
}
|
|
15458
15553
|
#endif
|
|
@@ -15487,7 +15582,9 @@ static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) {
|
|
|
15487
15582
|
__Pyx_TypeName obj_type_name;
|
|
15488
15583
|
if (likely(PyType_Check(obj))) {
|
|
15489
15584
|
PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem);
|
|
15490
|
-
if (meth) {
|
|
15585
|
+
if (!meth) {
|
|
15586
|
+
PyErr_Clear();
|
|
15587
|
+
} else {
|
|
15491
15588
|
PyObject *result = __Pyx_PyObject_CallOneArg(meth, key);
|
|
15492
15589
|
Py_DECREF(meth);
|
|
15493
15590
|
return result;
|
|
@@ -15745,17 +15842,19 @@ static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_le
|
|
|
15745
15842
|
&& PyUnicode_CheckExact(right)
|
|
15746
15843
|
&& PyUnicode_KIND(right) <= PyUnicode_KIND(left)
|
|
15747
15844
|
&& !(PyUnicode_IS_ASCII(left) && !PyUnicode_IS_ASCII(right))) {
|
|
15845
|
+
int ret;
|
|
15748
15846
|
__Pyx_GIVEREF(*p_left);
|
|
15749
|
-
|
|
15750
|
-
|
|
15847
|
+
ret = PyUnicode_Resize(p_left, new_len);
|
|
15848
|
+
__Pyx_GOTREF(*p_left);
|
|
15849
|
+
if (unlikely(ret != 0))
|
|
15751
15850
|
return NULL;
|
|
15752
|
-
|
|
15753
|
-
__Pyx_INCREF(*p_left);
|
|
15754
|
-
#if PY_VERSION_HEX >= 0x030D0000
|
|
15851
|
+
#if PY_VERSION_HEX >= 0x030d0000
|
|
15755
15852
|
if (unlikely(PyUnicode_CopyCharacters(*p_left, left_len, right, 0, right_len) < 0)) return NULL;
|
|
15756
15853
|
#else
|
|
15757
15854
|
_PyUnicode_FastCopyCharacters(*p_left, left_len, right, 0, right_len);
|
|
15758
15855
|
#endif
|
|
15856
|
+
__Pyx_INCREF(*p_left);
|
|
15857
|
+
__Pyx_GIVEREF(*p_left);
|
|
15759
15858
|
return *p_left;
|
|
15760
15859
|
} else {
|
|
15761
15860
|
return __Pyx_PyUnicode_Concat(left, right);
|
|
@@ -16013,7 +16112,7 @@ static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_co
|
|
|
16013
16112
|
if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) {
|
|
16014
16113
|
memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift));
|
|
16015
16114
|
} else {
|
|
16016
|
-
#if PY_VERSION_HEX >=
|
|
16115
|
+
#if PY_VERSION_HEX >= 0x030d0000
|
|
16017
16116
|
if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad;
|
|
16018
16117
|
#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters)
|
|
16019
16118
|
_PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
|
|
@@ -16484,38 +16583,38 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs
|
|
|
16484
16583
|
#endif
|
|
16485
16584
|
return -1;
|
|
16486
16585
|
}
|
|
16487
|
-
|
|
16488
|
-
if (dictoffset == 0) {
|
|
16489
|
-
PyErr_Format(PyExc_TypeError,
|
|
16490
|
-
"extension type '%s.200s': "
|
|
16491
|
-
"unable to validate whether bases have a __dict__ "
|
|
16492
|
-
"when CYTHON_USE_TYPE_SLOTS is off "
|
|
16493
|
-
"(likely because you are building in the limited API). "
|
|
16494
|
-
"Therefore, all extension types with multiple bases "
|
|
16495
|
-
"must add 'cdef dict __dict__' in this compilation mode",
|
|
16496
|
-
type_name);
|
|
16497
|
-
#if CYTHON_AVOID_BORROWED_REFS
|
|
16498
|
-
Py_DECREF(b0);
|
|
16499
|
-
#endif
|
|
16500
|
-
return -1;
|
|
16501
|
-
}
|
|
16502
|
-
#else
|
|
16503
|
-
if (dictoffset == 0 && b->tp_dictoffset)
|
|
16586
|
+
if (dictoffset == 0)
|
|
16504
16587
|
{
|
|
16505
|
-
|
|
16506
|
-
|
|
16507
|
-
|
|
16508
|
-
|
|
16509
|
-
|
|
16510
|
-
|
|
16511
|
-
|
|
16512
|
-
|
|
16588
|
+
Py_ssize_t b_dictoffset = 0;
|
|
16589
|
+
#if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
|
|
16590
|
+
b_dictoffset = b->tp_dictoffset;
|
|
16591
|
+
#else
|
|
16592
|
+
PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__");
|
|
16593
|
+
if (!py_b_dictoffset) goto dictoffset_return;
|
|
16594
|
+
b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset);
|
|
16595
|
+
Py_DECREF(py_b_dictoffset);
|
|
16596
|
+
if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return;
|
|
16597
|
+
#endif
|
|
16598
|
+
if (b_dictoffset) {
|
|
16599
|
+
{
|
|
16600
|
+
__Pyx_TypeName b_name = __Pyx_PyType_GetName(b);
|
|
16601
|
+
PyErr_Format(PyExc_TypeError,
|
|
16602
|
+
"extension type '%.200s' has no __dict__ slot, "
|
|
16603
|
+
"but base type '" __Pyx_FMT_TYPENAME "' has: "
|
|
16604
|
+
"either add 'cdef dict __dict__' to the extension type "
|
|
16605
|
+
"or add '__slots__ = [...]' to the base type",
|
|
16606
|
+
type_name, b_name);
|
|
16607
|
+
__Pyx_DECREF_TypeName(b_name);
|
|
16608
|
+
}
|
|
16609
|
+
#if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY)
|
|
16610
|
+
dictoffset_return:
|
|
16611
|
+
#endif
|
|
16513
16612
|
#if CYTHON_AVOID_BORROWED_REFS
|
|
16514
|
-
|
|
16613
|
+
Py_DECREF(b0);
|
|
16515
16614
|
#endif
|
|
16516
|
-
|
|
16615
|
+
return -1;
|
|
16616
|
+
}
|
|
16517
16617
|
}
|
|
16518
|
-
#endif
|
|
16519
16618
|
#if CYTHON_AVOID_BORROWED_REFS
|
|
16520
16619
|
Py_DECREF(b0);
|
|
16521
16620
|
#endif
|
|
@@ -17119,10 +17218,7 @@ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
|
|
|
17119
17218
|
|
|
17120
17219
|
/* FetchSharedCythonModule */
|
|
17121
17220
|
static PyObject *__Pyx_FetchSharedCythonABIModule(void) {
|
|
17122
|
-
|
|
17123
|
-
if (unlikely(!abi_module)) return NULL;
|
|
17124
|
-
Py_INCREF(abi_module);
|
|
17125
|
-
return abi_module;
|
|
17221
|
+
return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME);
|
|
17126
17222
|
}
|
|
17127
17223
|
|
|
17128
17224
|
/* FetchCommonType */
|
|
@@ -18106,7 +18202,7 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func,
|
|
|
18106
18202
|
default:
|
|
18107
18203
|
return NULL;
|
|
18108
18204
|
}
|
|
18109
|
-
return ((
|
|
18205
|
+
return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames);
|
|
18110
18206
|
}
|
|
18111
18207
|
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
|
|
18112
18208
|
{
|
|
@@ -18241,6 +18337,9 @@ static PyTypeObject __pyx_CyFunctionType_type = {
|
|
|
18241
18337
|
#if PY_VERSION_HEX >= 0x030C0000
|
|
18242
18338
|
0,
|
|
18243
18339
|
#endif
|
|
18340
|
+
#if PY_VERSION_HEX >= 0x030d00A4
|
|
18341
|
+
0,
|
|
18342
|
+
#endif
|
|
18244
18343
|
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
|
|
18245
18344
|
0,
|
|
18246
18345
|
#endif
|
|
@@ -18468,8 +18567,8 @@ static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject
|
|
|
18468
18567
|
Py_DECREF(replace);
|
|
18469
18568
|
return result;
|
|
18470
18569
|
}
|
|
18471
|
-
#if __PYX_LIMITED_VERSION_HEX < 0x030780000
|
|
18472
18570
|
PyErr_Clear();
|
|
18571
|
+
#if __PYX_LIMITED_VERSION_HEX < 0x030780000
|
|
18473
18572
|
{
|
|
18474
18573
|
PyObject *compiled = NULL, *result = NULL;
|
|
18475
18574
|
if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL;
|
|
@@ -18489,6 +18588,8 @@ static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject
|
|
|
18489
18588
|
if (result) Py_INCREF(result);
|
|
18490
18589
|
return result;
|
|
18491
18590
|
}
|
|
18591
|
+
#else
|
|
18592
|
+
return NULL;
|
|
18492
18593
|
#endif
|
|
18493
18594
|
}
|
|
18494
18595
|
static void __Pyx_AddTraceback(const char *funcname, int c_line,
|
|
@@ -18586,7 +18687,7 @@ static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
|
|
|
18586
18687
|
#else
|
|
18587
18688
|
py_code = PyCode_NewEmpty(filename, funcname, py_line);
|
|
18588
18689
|
#endif
|
|
18589
|
-
Py_XDECREF(py_funcname);
|
|
18690
|
+
Py_XDECREF(py_funcname);
|
|
18590
18691
|
return py_code;
|
|
18591
18692
|
bad:
|
|
18592
18693
|
Py_XDECREF(py_funcname);
|
|
@@ -18679,245 +18780,239 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
|
|
|
18679
18780
|
}
|
|
18680
18781
|
return (int) val;
|
|
18681
18782
|
}
|
|
18682
|
-
}
|
|
18783
|
+
}
|
|
18683
18784
|
#endif
|
|
18684
|
-
if (
|
|
18685
|
-
|
|
18785
|
+
if (unlikely(!PyLong_Check(x))) {
|
|
18786
|
+
int val;
|
|
18787
|
+
PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
|
|
18788
|
+
if (!tmp) return (int) -1;
|
|
18789
|
+
val = __Pyx_PyInt_As_int(tmp);
|
|
18790
|
+
Py_DECREF(tmp);
|
|
18791
|
+
return val;
|
|
18792
|
+
}
|
|
18793
|
+
if (is_unsigned) {
|
|
18686
18794
|
#if CYTHON_USE_PYLONG_INTERNALS
|
|
18687
|
-
|
|
18688
|
-
|
|
18689
|
-
|
|
18690
|
-
|
|
18691
|
-
|
|
18692
|
-
|
|
18693
|
-
|
|
18694
|
-
|
|
18695
|
-
|
|
18696
|
-
|
|
18697
|
-
|
|
18698
|
-
|
|
18699
|
-
|
|
18700
|
-
|
|
18701
|
-
}
|
|
18795
|
+
if (unlikely(__Pyx_PyLong_IsNeg(x))) {
|
|
18796
|
+
goto raise_neg_overflow;
|
|
18797
|
+
} else if (__Pyx_PyLong_IsCompact(x)) {
|
|
18798
|
+
__PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
|
|
18799
|
+
} else {
|
|
18800
|
+
const digit* digits = __Pyx_PyLong_Digits(x);
|
|
18801
|
+
assert(__Pyx_PyLong_DigitCount(x) > 1);
|
|
18802
|
+
switch (__Pyx_PyLong_DigitCount(x)) {
|
|
18803
|
+
case 2:
|
|
18804
|
+
if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
|
|
18805
|
+
if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
|
|
18806
|
+
__PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
|
18807
|
+
} else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) {
|
|
18808
|
+
return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
|
|
18702
18809
|
}
|
|
18703
|
-
|
|
18704
|
-
|
|
18705
|
-
|
|
18706
|
-
|
|
18707
|
-
|
|
18708
|
-
|
|
18709
|
-
|
|
18710
|
-
|
|
18810
|
+
}
|
|
18811
|
+
break;
|
|
18812
|
+
case 3:
|
|
18813
|
+
if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
|
|
18814
|
+
if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
|
|
18815
|
+
__PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
|
18816
|
+
} else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) {
|
|
18817
|
+
return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
|
|
18711
18818
|
}
|
|
18712
|
-
|
|
18713
|
-
|
|
18714
|
-
|
|
18715
|
-
|
|
18716
|
-
|
|
18717
|
-
|
|
18718
|
-
|
|
18719
|
-
|
|
18819
|
+
}
|
|
18820
|
+
break;
|
|
18821
|
+
case 4:
|
|
18822
|
+
if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
|
|
18823
|
+
if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
|
|
18824
|
+
__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])))
|
|
18825
|
+
} else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) {
|
|
18826
|
+
return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
|
|
18720
18827
|
}
|
|
18721
|
-
|
|
18722
|
-
|
|
18828
|
+
}
|
|
18829
|
+
break;
|
|
18723
18830
|
}
|
|
18831
|
+
}
|
|
18724
18832
|
#endif
|
|
18725
18833
|
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
|
|
18726
|
-
|
|
18727
|
-
|
|
18728
|
-
|
|
18834
|
+
if (unlikely(Py_SIZE(x) < 0)) {
|
|
18835
|
+
goto raise_neg_overflow;
|
|
18836
|
+
}
|
|
18729
18837
|
#else
|
|
18730
|
-
|
|
18731
|
-
|
|
18732
|
-
|
|
18733
|
-
|
|
18734
|
-
|
|
18735
|
-
|
|
18736
|
-
|
|
18838
|
+
{
|
|
18839
|
+
int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
|
|
18840
|
+
if (unlikely(result < 0))
|
|
18841
|
+
return (int) -1;
|
|
18842
|
+
if (unlikely(result == 1))
|
|
18843
|
+
goto raise_neg_overflow;
|
|
18844
|
+
}
|
|
18737
18845
|
#endif
|
|
18738
|
-
|
|
18739
|
-
|
|
18846
|
+
if ((sizeof(int) <= sizeof(unsigned long))) {
|
|
18847
|
+
__PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
|
|
18740
18848
|
#ifdef HAVE_LONG_LONG
|
|
18741
|
-
|
|
18742
|
-
|
|
18849
|
+
} else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) {
|
|
18850
|
+
__PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
|
|
18743
18851
|
#endif
|
|
18744
|
-
|
|
18745
|
-
|
|
18852
|
+
}
|
|
18853
|
+
} else {
|
|
18746
18854
|
#if CYTHON_USE_PYLONG_INTERNALS
|
|
18747
|
-
|
|
18748
|
-
|
|
18749
|
-
|
|
18750
|
-
|
|
18751
|
-
|
|
18752
|
-
|
|
18753
|
-
|
|
18754
|
-
|
|
18755
|
-
|
|
18756
|
-
|
|
18757
|
-
|
|
18758
|
-
|
|
18759
|
-
}
|
|
18855
|
+
if (__Pyx_PyLong_IsCompact(x)) {
|
|
18856
|
+
__PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
|
|
18857
|
+
} else {
|
|
18858
|
+
const digit* digits = __Pyx_PyLong_Digits(x);
|
|
18859
|
+
assert(__Pyx_PyLong_DigitCount(x) > 1);
|
|
18860
|
+
switch (__Pyx_PyLong_SignedDigitCount(x)) {
|
|
18861
|
+
case -2:
|
|
18862
|
+
if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) {
|
|
18863
|
+
if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
|
|
18864
|
+
__PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
|
18865
|
+
} else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
|
|
18866
|
+
return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
|
|
18760
18867
|
}
|
|
18761
|
-
|
|
18762
|
-
|
|
18763
|
-
|
|
18764
|
-
|
|
18765
|
-
|
|
18766
|
-
|
|
18767
|
-
|
|
18768
|
-
|
|
18868
|
+
}
|
|
18869
|
+
break;
|
|
18870
|
+
case 2:
|
|
18871
|
+
if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
|
|
18872
|
+
if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
|
|
18873
|
+
__PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
|
18874
|
+
} else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
|
|
18875
|
+
return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
|
|
18769
18876
|
}
|
|
18770
|
-
|
|
18771
|
-
|
|
18772
|
-
|
|
18773
|
-
|
|
18774
|
-
|
|
18775
|
-
|
|
18776
|
-
|
|
18777
|
-
|
|
18877
|
+
}
|
|
18878
|
+
break;
|
|
18879
|
+
case -3:
|
|
18880
|
+
if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
|
|
18881
|
+
if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
|
|
18882
|
+
__PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
|
18883
|
+
} else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
|
|
18884
|
+
return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
|
|
18778
18885
|
}
|
|
18779
|
-
|
|
18780
|
-
|
|
18781
|
-
|
|
18782
|
-
|
|
18783
|
-
|
|
18784
|
-
|
|
18785
|
-
|
|
18786
|
-
|
|
18886
|
+
}
|
|
18887
|
+
break;
|
|
18888
|
+
case 3:
|
|
18889
|
+
if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
|
|
18890
|
+
if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
|
|
18891
|
+
__PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
|
18892
|
+
} else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
|
|
18893
|
+
return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
|
|
18787
18894
|
}
|
|
18788
|
-
|
|
18789
|
-
|
|
18790
|
-
|
|
18791
|
-
|
|
18792
|
-
|
|
18793
|
-
|
|
18794
|
-
|
|
18795
|
-
|
|
18895
|
+
}
|
|
18896
|
+
break;
|
|
18897
|
+
case -4:
|
|
18898
|
+
if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
|
|
18899
|
+
if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
|
|
18900
|
+
__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])))
|
|
18901
|
+
} else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
|
|
18902
|
+
return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
|
|
18796
18903
|
}
|
|
18797
|
-
|
|
18798
|
-
|
|
18799
|
-
|
|
18800
|
-
|
|
18801
|
-
|
|
18802
|
-
|
|
18803
|
-
|
|
18804
|
-
|
|
18904
|
+
}
|
|
18905
|
+
break;
|
|
18906
|
+
case 4:
|
|
18907
|
+
if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
|
|
18908
|
+
if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
|
|
18909
|
+
__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])))
|
|
18910
|
+
} else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
|
|
18911
|
+
return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
|
|
18805
18912
|
}
|
|
18806
|
-
|
|
18807
|
-
|
|
18913
|
+
}
|
|
18914
|
+
break;
|
|
18808
18915
|
}
|
|
18916
|
+
}
|
|
18809
18917
|
#endif
|
|
18810
|
-
|
|
18811
|
-
|
|
18918
|
+
if ((sizeof(int) <= sizeof(long))) {
|
|
18919
|
+
__PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
|
|
18812
18920
|
#ifdef HAVE_LONG_LONG
|
|
18813
|
-
|
|
18814
|
-
|
|
18921
|
+
} else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) {
|
|
18922
|
+
__PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
|
|
18815
18923
|
#endif
|
|
18816
|
-
|
|
18924
|
+
}
|
|
18925
|
+
}
|
|
18926
|
+
{
|
|
18927
|
+
int val;
|
|
18928
|
+
int ret = -1;
|
|
18929
|
+
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
|
|
18930
|
+
Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
|
|
18931
|
+
x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
|
|
18932
|
+
if (unlikely(bytes_copied == -1)) {
|
|
18933
|
+
} else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
|
|
18934
|
+
goto raise_overflow;
|
|
18935
|
+
} else {
|
|
18936
|
+
ret = 0;
|
|
18937
|
+
}
|
|
18938
|
+
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
|
|
18939
|
+
int one = 1; int is_little = (int)*(unsigned char *)&one;
|
|
18940
|
+
unsigned char *bytes = (unsigned char *)&val;
|
|
18941
|
+
ret = _PyLong_AsByteArray((PyLongObject *)x,
|
|
18942
|
+
bytes, sizeof(val),
|
|
18943
|
+
is_little, !is_unsigned);
|
|
18944
|
+
#else
|
|
18945
|
+
PyObject *v;
|
|
18946
|
+
PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
|
|
18947
|
+
int bits, remaining_bits, is_negative = 0;
|
|
18948
|
+
int chunk_size = (sizeof(long) < 8) ? 30 : 62;
|
|
18949
|
+
if (likely(PyLong_CheckExact(x))) {
|
|
18950
|
+
v = __Pyx_NewRef(x);
|
|
18951
|
+
} else {
|
|
18952
|
+
v = PyNumber_Long(x);
|
|
18953
|
+
if (unlikely(!v)) return (int) -1;
|
|
18954
|
+
assert(PyLong_CheckExact(v));
|
|
18817
18955
|
}
|
|
18818
18956
|
{
|
|
18819
|
-
int
|
|
18820
|
-
|
|
18821
|
-
#if PY_MAJOR_VERSION < 3
|
|
18822
|
-
if (likely(v) && !PyLong_Check(v)) {
|
|
18823
|
-
PyObject *tmp = v;
|
|
18824
|
-
v = PyNumber_Long(tmp);
|
|
18825
|
-
Py_DECREF(tmp);
|
|
18826
|
-
}
|
|
18827
|
-
#endif
|
|
18828
|
-
if (likely(v)) {
|
|
18829
|
-
int ret = -1;
|
|
18830
|
-
#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
|
|
18831
|
-
int one = 1; int is_little = (int)*(unsigned char *)&one;
|
|
18832
|
-
unsigned char *bytes = (unsigned char *)&val;
|
|
18833
|
-
ret = _PyLong_AsByteArray((PyLongObject *)v,
|
|
18834
|
-
bytes, sizeof(val),
|
|
18835
|
-
is_little, !is_unsigned);
|
|
18836
|
-
#else
|
|
18837
|
-
PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
|
|
18838
|
-
int bits, remaining_bits, is_negative = 0;
|
|
18839
|
-
long idigit;
|
|
18840
|
-
int chunk_size = (sizeof(long) < 8) ? 30 : 62;
|
|
18841
|
-
if (unlikely(!PyLong_CheckExact(v))) {
|
|
18842
|
-
PyObject *tmp = v;
|
|
18843
|
-
v = PyNumber_Long(v);
|
|
18844
|
-
assert(PyLong_CheckExact(v));
|
|
18845
|
-
Py_DECREF(tmp);
|
|
18846
|
-
if (unlikely(!v)) return (int) -1;
|
|
18847
|
-
}
|
|
18848
|
-
#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000
|
|
18849
|
-
if (Py_SIZE(x) == 0)
|
|
18850
|
-
return (int) 0;
|
|
18851
|
-
is_negative = Py_SIZE(x) < 0;
|
|
18852
|
-
#else
|
|
18853
|
-
{
|
|
18854
|
-
int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
|
|
18855
|
-
if (unlikely(result < 0))
|
|
18856
|
-
return (int) -1;
|
|
18857
|
-
is_negative = result == 1;
|
|
18858
|
-
}
|
|
18859
|
-
#endif
|
|
18860
|
-
if (is_unsigned && unlikely(is_negative)) {
|
|
18861
|
-
goto raise_neg_overflow;
|
|
18862
|
-
} else if (is_negative) {
|
|
18863
|
-
stepval = PyNumber_Invert(v);
|
|
18864
|
-
if (unlikely(!stepval))
|
|
18865
|
-
return (int) -1;
|
|
18866
|
-
} else {
|
|
18867
|
-
stepval = __Pyx_NewRef(v);
|
|
18868
|
-
}
|
|
18869
|
-
val = (int) 0;
|
|
18870
|
-
mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
|
|
18871
|
-
shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
|
|
18872
|
-
for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) {
|
|
18873
|
-
PyObject *tmp, *digit;
|
|
18874
|
-
digit = PyNumber_And(stepval, mask);
|
|
18875
|
-
if (unlikely(!digit)) goto done;
|
|
18876
|
-
idigit = PyLong_AsLong(digit);
|
|
18877
|
-
Py_DECREF(digit);
|
|
18878
|
-
if (unlikely(idigit < 0)) goto done;
|
|
18879
|
-
tmp = PyNumber_Rshift(stepval, shift);
|
|
18880
|
-
if (unlikely(!tmp)) goto done;
|
|
18881
|
-
Py_DECREF(stepval); stepval = tmp;
|
|
18882
|
-
val |= ((int) idigit) << bits;
|
|
18883
|
-
#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000
|
|
18884
|
-
if (Py_SIZE(stepval) == 0)
|
|
18885
|
-
goto unpacking_done;
|
|
18886
|
-
#endif
|
|
18887
|
-
}
|
|
18888
|
-
idigit = PyLong_AsLong(stepval);
|
|
18889
|
-
if (unlikely(idigit < 0)) goto done;
|
|
18890
|
-
remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
|
|
18891
|
-
if (unlikely(idigit >= (1L << remaining_bits)))
|
|
18892
|
-
goto raise_overflow;
|
|
18893
|
-
val |= ((int) idigit) << bits;
|
|
18894
|
-
#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000
|
|
18895
|
-
unpacking_done:
|
|
18896
|
-
#endif
|
|
18897
|
-
if (!is_unsigned) {
|
|
18898
|
-
if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1))))
|
|
18899
|
-
goto raise_overflow;
|
|
18900
|
-
if (is_negative)
|
|
18901
|
-
val = ~val;
|
|
18902
|
-
}
|
|
18903
|
-
ret = 0;
|
|
18904
|
-
done:
|
|
18905
|
-
Py_XDECREF(shift);
|
|
18906
|
-
Py_XDECREF(mask);
|
|
18907
|
-
Py_XDECREF(stepval);
|
|
18908
|
-
#endif
|
|
18957
|
+
int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
|
|
18958
|
+
if (unlikely(result < 0)) {
|
|
18909
18959
|
Py_DECREF(v);
|
|
18910
|
-
|
|
18911
|
-
return val;
|
|
18960
|
+
return (int) -1;
|
|
18912
18961
|
}
|
|
18913
|
-
|
|
18962
|
+
is_negative = result == 1;
|
|
18914
18963
|
}
|
|
18915
|
-
|
|
18916
|
-
|
|
18917
|
-
|
|
18918
|
-
|
|
18919
|
-
|
|
18920
|
-
|
|
18964
|
+
if (is_unsigned && unlikely(is_negative)) {
|
|
18965
|
+
Py_DECREF(v);
|
|
18966
|
+
goto raise_neg_overflow;
|
|
18967
|
+
} else if (is_negative) {
|
|
18968
|
+
stepval = PyNumber_Invert(v);
|
|
18969
|
+
Py_DECREF(v);
|
|
18970
|
+
if (unlikely(!stepval))
|
|
18971
|
+
return (int) -1;
|
|
18972
|
+
} else {
|
|
18973
|
+
stepval = v;
|
|
18974
|
+
}
|
|
18975
|
+
v = NULL;
|
|
18976
|
+
val = (int) 0;
|
|
18977
|
+
mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
|
|
18978
|
+
shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
|
|
18979
|
+
for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) {
|
|
18980
|
+
PyObject *tmp, *digit;
|
|
18981
|
+
long idigit;
|
|
18982
|
+
digit = PyNumber_And(stepval, mask);
|
|
18983
|
+
if (unlikely(!digit)) goto done;
|
|
18984
|
+
idigit = PyLong_AsLong(digit);
|
|
18985
|
+
Py_DECREF(digit);
|
|
18986
|
+
if (unlikely(idigit < 0)) goto done;
|
|
18987
|
+
val |= ((int) idigit) << bits;
|
|
18988
|
+
tmp = PyNumber_Rshift(stepval, shift);
|
|
18989
|
+
if (unlikely(!tmp)) goto done;
|
|
18990
|
+
Py_DECREF(stepval); stepval = tmp;
|
|
18991
|
+
}
|
|
18992
|
+
Py_DECREF(shift); shift = NULL;
|
|
18993
|
+
Py_DECREF(mask); mask = NULL;
|
|
18994
|
+
{
|
|
18995
|
+
long idigit = PyLong_AsLong(stepval);
|
|
18996
|
+
if (unlikely(idigit < 0)) goto done;
|
|
18997
|
+
remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
|
|
18998
|
+
if (unlikely(idigit >= (1L << remaining_bits)))
|
|
18999
|
+
goto raise_overflow;
|
|
19000
|
+
val |= ((int) idigit) << bits;
|
|
19001
|
+
}
|
|
19002
|
+
if (!is_unsigned) {
|
|
19003
|
+
if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1))))
|
|
19004
|
+
goto raise_overflow;
|
|
19005
|
+
if (is_negative)
|
|
19006
|
+
val = ~val;
|
|
19007
|
+
}
|
|
19008
|
+
ret = 0;
|
|
19009
|
+
done:
|
|
19010
|
+
Py_XDECREF(shift);
|
|
19011
|
+
Py_XDECREF(mask);
|
|
19012
|
+
Py_XDECREF(stepval);
|
|
19013
|
+
#endif
|
|
19014
|
+
if (unlikely(ret))
|
|
19015
|
+
return (int) -1;
|
|
18921
19016
|
return val;
|
|
18922
19017
|
}
|
|
18923
19018
|
raise_overflow:
|
|
@@ -18977,15 +19072,22 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
|
|
|
18977
19072
|
}
|
|
18978
19073
|
}
|
|
18979
19074
|
{
|
|
18980
|
-
int one = 1; int little = (int)*(unsigned char *)&one;
|
|
18981
19075
|
unsigned char *bytes = (unsigned char *)&value;
|
|
18982
|
-
#if !CYTHON_COMPILING_IN_LIMITED_API
|
|
19076
|
+
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
|
|
19077
|
+
if (is_unsigned) {
|
|
19078
|
+
return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
|
|
19079
|
+
} else {
|
|
19080
|
+
return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
|
|
19081
|
+
}
|
|
19082
|
+
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
|
|
19083
|
+
int one = 1; int little = (int)*(unsigned char *)&one;
|
|
18983
19084
|
return _PyLong_FromByteArray(bytes, sizeof(long),
|
|
18984
19085
|
little, !is_unsigned);
|
|
18985
19086
|
#else
|
|
19087
|
+
int one = 1; int little = (int)*(unsigned char *)&one;
|
|
18986
19088
|
PyObject *from_bytes, *result = NULL;
|
|
18987
19089
|
PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
|
|
18988
|
-
from_bytes = PyObject_GetAttrString((PyObject*)&
|
|
19090
|
+
from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
|
|
18989
19091
|
if (!from_bytes) return NULL;
|
|
18990
19092
|
py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long));
|
|
18991
19093
|
if (!py_bytes) goto limited_bad;
|
|
@@ -18993,16 +19095,18 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
|
|
|
18993
19095
|
if (!order_str) goto limited_bad;
|
|
18994
19096
|
arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
|
|
18995
19097
|
if (!arg_tuple) goto limited_bad;
|
|
18996
|
-
|
|
18997
|
-
|
|
18998
|
-
|
|
19098
|
+
if (!is_unsigned) {
|
|
19099
|
+
kwds = PyDict_New();
|
|
19100
|
+
if (!kwds) goto limited_bad;
|
|
19101
|
+
if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
|
|
19102
|
+
}
|
|
18999
19103
|
result = PyObject_Call(from_bytes, arg_tuple, kwds);
|
|
19000
19104
|
limited_bad:
|
|
19001
|
-
Py_XDECREF(from_bytes);
|
|
19002
|
-
Py_XDECREF(py_bytes);
|
|
19003
|
-
Py_XDECREF(order_str);
|
|
19004
|
-
Py_XDECREF(arg_tuple);
|
|
19005
19105
|
Py_XDECREF(kwds);
|
|
19106
|
+
Py_XDECREF(arg_tuple);
|
|
19107
|
+
Py_XDECREF(order_str);
|
|
19108
|
+
Py_XDECREF(py_bytes);
|
|
19109
|
+
Py_XDECREF(from_bytes);
|
|
19006
19110
|
return result;
|
|
19007
19111
|
#endif
|
|
19008
19112
|
}
|
|
@@ -19030,245 +19134,239 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
|
|
|
19030
19134
|
}
|
|
19031
19135
|
return (long) val;
|
|
19032
19136
|
}
|
|
19033
|
-
}
|
|
19137
|
+
}
|
|
19034
19138
|
#endif
|
|
19035
|
-
if (
|
|
19036
|
-
|
|
19139
|
+
if (unlikely(!PyLong_Check(x))) {
|
|
19140
|
+
long val;
|
|
19141
|
+
PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
|
|
19142
|
+
if (!tmp) return (long) -1;
|
|
19143
|
+
val = __Pyx_PyInt_As_long(tmp);
|
|
19144
|
+
Py_DECREF(tmp);
|
|
19145
|
+
return val;
|
|
19146
|
+
}
|
|
19147
|
+
if (is_unsigned) {
|
|
19037
19148
|
#if CYTHON_USE_PYLONG_INTERNALS
|
|
19038
|
-
|
|
19039
|
-
|
|
19040
|
-
|
|
19041
|
-
|
|
19042
|
-
|
|
19043
|
-
|
|
19044
|
-
|
|
19045
|
-
|
|
19046
|
-
|
|
19047
|
-
|
|
19048
|
-
|
|
19049
|
-
|
|
19050
|
-
|
|
19051
|
-
|
|
19052
|
-
}
|
|
19149
|
+
if (unlikely(__Pyx_PyLong_IsNeg(x))) {
|
|
19150
|
+
goto raise_neg_overflow;
|
|
19151
|
+
} else if (__Pyx_PyLong_IsCompact(x)) {
|
|
19152
|
+
__PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
|
|
19153
|
+
} else {
|
|
19154
|
+
const digit* digits = __Pyx_PyLong_Digits(x);
|
|
19155
|
+
assert(__Pyx_PyLong_DigitCount(x) > 1);
|
|
19156
|
+
switch (__Pyx_PyLong_DigitCount(x)) {
|
|
19157
|
+
case 2:
|
|
19158
|
+
if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
|
|
19159
|
+
if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
|
|
19160
|
+
__PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
|
19161
|
+
} else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) {
|
|
19162
|
+
return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
|
|
19053
19163
|
}
|
|
19054
|
-
|
|
19055
|
-
|
|
19056
|
-
|
|
19057
|
-
|
|
19058
|
-
|
|
19059
|
-
|
|
19060
|
-
|
|
19061
|
-
|
|
19164
|
+
}
|
|
19165
|
+
break;
|
|
19166
|
+
case 3:
|
|
19167
|
+
if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
|
|
19168
|
+
if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
|
|
19169
|
+
__PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
|
19170
|
+
} else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) {
|
|
19171
|
+
return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
|
|
19062
19172
|
}
|
|
19063
|
-
|
|
19064
|
-
|
|
19065
|
-
|
|
19066
|
-
|
|
19067
|
-
|
|
19068
|
-
|
|
19069
|
-
|
|
19070
|
-
|
|
19173
|
+
}
|
|
19174
|
+
break;
|
|
19175
|
+
case 4:
|
|
19176
|
+
if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
|
|
19177
|
+
if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
|
|
19178
|
+
__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])))
|
|
19179
|
+
} else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) {
|
|
19180
|
+
return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
|
|
19071
19181
|
}
|
|
19072
|
-
|
|
19073
|
-
|
|
19182
|
+
}
|
|
19183
|
+
break;
|
|
19074
19184
|
}
|
|
19185
|
+
}
|
|
19075
19186
|
#endif
|
|
19076
19187
|
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
|
|
19077
|
-
|
|
19078
|
-
|
|
19079
|
-
|
|
19188
|
+
if (unlikely(Py_SIZE(x) < 0)) {
|
|
19189
|
+
goto raise_neg_overflow;
|
|
19190
|
+
}
|
|
19080
19191
|
#else
|
|
19081
|
-
|
|
19082
|
-
|
|
19083
|
-
|
|
19084
|
-
|
|
19085
|
-
|
|
19086
|
-
|
|
19087
|
-
|
|
19192
|
+
{
|
|
19193
|
+
int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
|
|
19194
|
+
if (unlikely(result < 0))
|
|
19195
|
+
return (long) -1;
|
|
19196
|
+
if (unlikely(result == 1))
|
|
19197
|
+
goto raise_neg_overflow;
|
|
19198
|
+
}
|
|
19088
19199
|
#endif
|
|
19089
|
-
|
|
19090
|
-
|
|
19200
|
+
if ((sizeof(long) <= sizeof(unsigned long))) {
|
|
19201
|
+
__PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
|
|
19091
19202
|
#ifdef HAVE_LONG_LONG
|
|
19092
|
-
|
|
19093
|
-
|
|
19203
|
+
} else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) {
|
|
19204
|
+
__PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
|
|
19094
19205
|
#endif
|
|
19095
|
-
|
|
19096
|
-
|
|
19206
|
+
}
|
|
19207
|
+
} else {
|
|
19097
19208
|
#if CYTHON_USE_PYLONG_INTERNALS
|
|
19098
|
-
|
|
19099
|
-
|
|
19100
|
-
|
|
19101
|
-
|
|
19102
|
-
|
|
19103
|
-
|
|
19104
|
-
|
|
19105
|
-
|
|
19106
|
-
|
|
19107
|
-
|
|
19108
|
-
|
|
19109
|
-
|
|
19110
|
-
}
|
|
19209
|
+
if (__Pyx_PyLong_IsCompact(x)) {
|
|
19210
|
+
__PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
|
|
19211
|
+
} else {
|
|
19212
|
+
const digit* digits = __Pyx_PyLong_Digits(x);
|
|
19213
|
+
assert(__Pyx_PyLong_DigitCount(x) > 1);
|
|
19214
|
+
switch (__Pyx_PyLong_SignedDigitCount(x)) {
|
|
19215
|
+
case -2:
|
|
19216
|
+
if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) {
|
|
19217
|
+
if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
|
|
19218
|
+
__PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
|
19219
|
+
} else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
|
|
19220
|
+
return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
|
|
19111
19221
|
}
|
|
19112
|
-
|
|
19113
|
-
|
|
19114
|
-
|
|
19115
|
-
|
|
19116
|
-
|
|
19117
|
-
|
|
19118
|
-
|
|
19119
|
-
|
|
19222
|
+
}
|
|
19223
|
+
break;
|
|
19224
|
+
case 2:
|
|
19225
|
+
if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
|
|
19226
|
+
if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
|
|
19227
|
+
__PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
|
19228
|
+
} else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
|
|
19229
|
+
return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
|
|
19120
19230
|
}
|
|
19121
|
-
|
|
19122
|
-
|
|
19123
|
-
|
|
19124
|
-
|
|
19125
|
-
|
|
19126
|
-
|
|
19127
|
-
|
|
19128
|
-
|
|
19231
|
+
}
|
|
19232
|
+
break;
|
|
19233
|
+
case -3:
|
|
19234
|
+
if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
|
|
19235
|
+
if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
|
|
19236
|
+
__PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
|
19237
|
+
} else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
|
|
19238
|
+
return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
|
|
19129
19239
|
}
|
|
19130
|
-
|
|
19131
|
-
|
|
19132
|
-
|
|
19133
|
-
|
|
19134
|
-
|
|
19135
|
-
|
|
19136
|
-
|
|
19137
|
-
|
|
19240
|
+
}
|
|
19241
|
+
break;
|
|
19242
|
+
case 3:
|
|
19243
|
+
if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
|
|
19244
|
+
if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
|
|
19245
|
+
__PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
|
19246
|
+
} else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
|
|
19247
|
+
return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
|
|
19138
19248
|
}
|
|
19139
|
-
|
|
19140
|
-
|
|
19141
|
-
|
|
19142
|
-
|
|
19143
|
-
|
|
19144
|
-
|
|
19145
|
-
|
|
19146
|
-
|
|
19249
|
+
}
|
|
19250
|
+
break;
|
|
19251
|
+
case -4:
|
|
19252
|
+
if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
|
|
19253
|
+
if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
|
|
19254
|
+
__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])))
|
|
19255
|
+
} else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
|
|
19256
|
+
return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
|
|
19147
19257
|
}
|
|
19148
|
-
|
|
19149
|
-
|
|
19150
|
-
|
|
19151
|
-
|
|
19152
|
-
|
|
19153
|
-
|
|
19154
|
-
|
|
19155
|
-
|
|
19258
|
+
}
|
|
19259
|
+
break;
|
|
19260
|
+
case 4:
|
|
19261
|
+
if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
|
|
19262
|
+
if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
|
|
19263
|
+
__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])))
|
|
19264
|
+
} else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
|
|
19265
|
+
return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
|
|
19156
19266
|
}
|
|
19157
|
-
|
|
19158
|
-
|
|
19267
|
+
}
|
|
19268
|
+
break;
|
|
19159
19269
|
}
|
|
19270
|
+
}
|
|
19160
19271
|
#endif
|
|
19161
|
-
|
|
19162
|
-
|
|
19272
|
+
if ((sizeof(long) <= sizeof(long))) {
|
|
19273
|
+
__PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
|
|
19163
19274
|
#ifdef HAVE_LONG_LONG
|
|
19164
|
-
|
|
19165
|
-
|
|
19275
|
+
} else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) {
|
|
19276
|
+
__PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
|
|
19166
19277
|
#endif
|
|
19167
|
-
|
|
19278
|
+
}
|
|
19279
|
+
}
|
|
19280
|
+
{
|
|
19281
|
+
long val;
|
|
19282
|
+
int ret = -1;
|
|
19283
|
+
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
|
|
19284
|
+
Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
|
|
19285
|
+
x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
|
|
19286
|
+
if (unlikely(bytes_copied == -1)) {
|
|
19287
|
+
} else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
|
|
19288
|
+
goto raise_overflow;
|
|
19289
|
+
} else {
|
|
19290
|
+
ret = 0;
|
|
19291
|
+
}
|
|
19292
|
+
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
|
|
19293
|
+
int one = 1; int is_little = (int)*(unsigned char *)&one;
|
|
19294
|
+
unsigned char *bytes = (unsigned char *)&val;
|
|
19295
|
+
ret = _PyLong_AsByteArray((PyLongObject *)x,
|
|
19296
|
+
bytes, sizeof(val),
|
|
19297
|
+
is_little, !is_unsigned);
|
|
19298
|
+
#else
|
|
19299
|
+
PyObject *v;
|
|
19300
|
+
PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
|
|
19301
|
+
int bits, remaining_bits, is_negative = 0;
|
|
19302
|
+
int chunk_size = (sizeof(long) < 8) ? 30 : 62;
|
|
19303
|
+
if (likely(PyLong_CheckExact(x))) {
|
|
19304
|
+
v = __Pyx_NewRef(x);
|
|
19305
|
+
} else {
|
|
19306
|
+
v = PyNumber_Long(x);
|
|
19307
|
+
if (unlikely(!v)) return (long) -1;
|
|
19308
|
+
assert(PyLong_CheckExact(v));
|
|
19168
19309
|
}
|
|
19169
19310
|
{
|
|
19170
|
-
|
|
19171
|
-
|
|
19172
|
-
#if PY_MAJOR_VERSION < 3
|
|
19173
|
-
if (likely(v) && !PyLong_Check(v)) {
|
|
19174
|
-
PyObject *tmp = v;
|
|
19175
|
-
v = PyNumber_Long(tmp);
|
|
19176
|
-
Py_DECREF(tmp);
|
|
19177
|
-
}
|
|
19178
|
-
#endif
|
|
19179
|
-
if (likely(v)) {
|
|
19180
|
-
int ret = -1;
|
|
19181
|
-
#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
|
|
19182
|
-
int one = 1; int is_little = (int)*(unsigned char *)&one;
|
|
19183
|
-
unsigned char *bytes = (unsigned char *)&val;
|
|
19184
|
-
ret = _PyLong_AsByteArray((PyLongObject *)v,
|
|
19185
|
-
bytes, sizeof(val),
|
|
19186
|
-
is_little, !is_unsigned);
|
|
19187
|
-
#else
|
|
19188
|
-
PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
|
|
19189
|
-
int bits, remaining_bits, is_negative = 0;
|
|
19190
|
-
long idigit;
|
|
19191
|
-
int chunk_size = (sizeof(long) < 8) ? 30 : 62;
|
|
19192
|
-
if (unlikely(!PyLong_CheckExact(v))) {
|
|
19193
|
-
PyObject *tmp = v;
|
|
19194
|
-
v = PyNumber_Long(v);
|
|
19195
|
-
assert(PyLong_CheckExact(v));
|
|
19196
|
-
Py_DECREF(tmp);
|
|
19197
|
-
if (unlikely(!v)) return (long) -1;
|
|
19198
|
-
}
|
|
19199
|
-
#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000
|
|
19200
|
-
if (Py_SIZE(x) == 0)
|
|
19201
|
-
return (long) 0;
|
|
19202
|
-
is_negative = Py_SIZE(x) < 0;
|
|
19203
|
-
#else
|
|
19204
|
-
{
|
|
19205
|
-
int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
|
|
19206
|
-
if (unlikely(result < 0))
|
|
19207
|
-
return (long) -1;
|
|
19208
|
-
is_negative = result == 1;
|
|
19209
|
-
}
|
|
19210
|
-
#endif
|
|
19211
|
-
if (is_unsigned && unlikely(is_negative)) {
|
|
19212
|
-
goto raise_neg_overflow;
|
|
19213
|
-
} else if (is_negative) {
|
|
19214
|
-
stepval = PyNumber_Invert(v);
|
|
19215
|
-
if (unlikely(!stepval))
|
|
19216
|
-
return (long) -1;
|
|
19217
|
-
} else {
|
|
19218
|
-
stepval = __Pyx_NewRef(v);
|
|
19219
|
-
}
|
|
19220
|
-
val = (long) 0;
|
|
19221
|
-
mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
|
|
19222
|
-
shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
|
|
19223
|
-
for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) {
|
|
19224
|
-
PyObject *tmp, *digit;
|
|
19225
|
-
digit = PyNumber_And(stepval, mask);
|
|
19226
|
-
if (unlikely(!digit)) goto done;
|
|
19227
|
-
idigit = PyLong_AsLong(digit);
|
|
19228
|
-
Py_DECREF(digit);
|
|
19229
|
-
if (unlikely(idigit < 0)) goto done;
|
|
19230
|
-
tmp = PyNumber_Rshift(stepval, shift);
|
|
19231
|
-
if (unlikely(!tmp)) goto done;
|
|
19232
|
-
Py_DECREF(stepval); stepval = tmp;
|
|
19233
|
-
val |= ((long) idigit) << bits;
|
|
19234
|
-
#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000
|
|
19235
|
-
if (Py_SIZE(stepval) == 0)
|
|
19236
|
-
goto unpacking_done;
|
|
19237
|
-
#endif
|
|
19238
|
-
}
|
|
19239
|
-
idigit = PyLong_AsLong(stepval);
|
|
19240
|
-
if (unlikely(idigit < 0)) goto done;
|
|
19241
|
-
remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
|
|
19242
|
-
if (unlikely(idigit >= (1L << remaining_bits)))
|
|
19243
|
-
goto raise_overflow;
|
|
19244
|
-
val |= ((long) idigit) << bits;
|
|
19245
|
-
#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000
|
|
19246
|
-
unpacking_done:
|
|
19247
|
-
#endif
|
|
19248
|
-
if (!is_unsigned) {
|
|
19249
|
-
if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1))))
|
|
19250
|
-
goto raise_overflow;
|
|
19251
|
-
if (is_negative)
|
|
19252
|
-
val = ~val;
|
|
19253
|
-
}
|
|
19254
|
-
ret = 0;
|
|
19255
|
-
done:
|
|
19256
|
-
Py_XDECREF(shift);
|
|
19257
|
-
Py_XDECREF(mask);
|
|
19258
|
-
Py_XDECREF(stepval);
|
|
19259
|
-
#endif
|
|
19311
|
+
int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
|
|
19312
|
+
if (unlikely(result < 0)) {
|
|
19260
19313
|
Py_DECREF(v);
|
|
19261
|
-
|
|
19262
|
-
return val;
|
|
19314
|
+
return (long) -1;
|
|
19263
19315
|
}
|
|
19264
|
-
|
|
19316
|
+
is_negative = result == 1;
|
|
19265
19317
|
}
|
|
19266
|
-
|
|
19267
|
-
|
|
19268
|
-
|
|
19269
|
-
|
|
19270
|
-
|
|
19271
|
-
|
|
19318
|
+
if (is_unsigned && unlikely(is_negative)) {
|
|
19319
|
+
Py_DECREF(v);
|
|
19320
|
+
goto raise_neg_overflow;
|
|
19321
|
+
} else if (is_negative) {
|
|
19322
|
+
stepval = PyNumber_Invert(v);
|
|
19323
|
+
Py_DECREF(v);
|
|
19324
|
+
if (unlikely(!stepval))
|
|
19325
|
+
return (long) -1;
|
|
19326
|
+
} else {
|
|
19327
|
+
stepval = v;
|
|
19328
|
+
}
|
|
19329
|
+
v = NULL;
|
|
19330
|
+
val = (long) 0;
|
|
19331
|
+
mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
|
|
19332
|
+
shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
|
|
19333
|
+
for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) {
|
|
19334
|
+
PyObject *tmp, *digit;
|
|
19335
|
+
long idigit;
|
|
19336
|
+
digit = PyNumber_And(stepval, mask);
|
|
19337
|
+
if (unlikely(!digit)) goto done;
|
|
19338
|
+
idigit = PyLong_AsLong(digit);
|
|
19339
|
+
Py_DECREF(digit);
|
|
19340
|
+
if (unlikely(idigit < 0)) goto done;
|
|
19341
|
+
val |= ((long) idigit) << bits;
|
|
19342
|
+
tmp = PyNumber_Rshift(stepval, shift);
|
|
19343
|
+
if (unlikely(!tmp)) goto done;
|
|
19344
|
+
Py_DECREF(stepval); stepval = tmp;
|
|
19345
|
+
}
|
|
19346
|
+
Py_DECREF(shift); shift = NULL;
|
|
19347
|
+
Py_DECREF(mask); mask = NULL;
|
|
19348
|
+
{
|
|
19349
|
+
long idigit = PyLong_AsLong(stepval);
|
|
19350
|
+
if (unlikely(idigit < 0)) goto done;
|
|
19351
|
+
remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
|
|
19352
|
+
if (unlikely(idigit >= (1L << remaining_bits)))
|
|
19353
|
+
goto raise_overflow;
|
|
19354
|
+
val |= ((long) idigit) << bits;
|
|
19355
|
+
}
|
|
19356
|
+
if (!is_unsigned) {
|
|
19357
|
+
if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1))))
|
|
19358
|
+
goto raise_overflow;
|
|
19359
|
+
if (is_negative)
|
|
19360
|
+
val = ~val;
|
|
19361
|
+
}
|
|
19362
|
+
ret = 0;
|
|
19363
|
+
done:
|
|
19364
|
+
Py_XDECREF(shift);
|
|
19365
|
+
Py_XDECREF(mask);
|
|
19366
|
+
Py_XDECREF(stepval);
|
|
19367
|
+
#endif
|
|
19368
|
+
if (unlikely(ret))
|
|
19369
|
+
return (long) -1;
|
|
19272
19370
|
return val;
|
|
19273
19371
|
}
|
|
19274
19372
|
raise_overflow:
|
|
@@ -19398,7 +19496,7 @@ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObj
|
|
|
19398
19496
|
#endif
|
|
19399
19497
|
|
|
19400
19498
|
/* CheckBinaryVersion */
|
|
19401
|
-
static unsigned long __Pyx_get_runtime_version() {
|
|
19499
|
+
static unsigned long __Pyx_get_runtime_version(void) {
|
|
19402
19500
|
#if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4
|
|
19403
19501
|
return Py_Version & ~0xFFUL;
|
|
19404
19502
|
#else
|