ez-a-sync 0.32.24__cp311-cp311-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.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 ez-a-sync might be problematic. Click here for more details.

Files changed (177) hide show
  1. a_sync/ENVIRONMENT_VARIABLES.py +42 -0
  2. a_sync/__init__.pxd +2 -0
  3. a_sync/__init__.py +145 -0
  4. a_sync/_smart.c +22686 -0
  5. a_sync/_smart.cpython-311-i386-linux-gnu.so +0 -0
  6. a_sync/_smart.pxd +2 -0
  7. a_sync/_smart.pyi +202 -0
  8. a_sync/_smart.pyx +674 -0
  9. a_sync/_typing.py +258 -0
  10. a_sync/a_sync/__init__.py +60 -0
  11. a_sync/a_sync/_descriptor.c +19749 -0
  12. a_sync/a_sync/_descriptor.cpython-311-i386-linux-gnu.so +0 -0
  13. a_sync/a_sync/_descriptor.pyi +34 -0
  14. a_sync/a_sync/_descriptor.pyx +422 -0
  15. a_sync/a_sync/_flags.c +5687 -0
  16. a_sync/a_sync/_flags.cpython-311-i386-linux-gnu.so +0 -0
  17. a_sync/a_sync/_flags.pxd +3 -0
  18. a_sync/a_sync/_flags.pyx +92 -0
  19. a_sync/a_sync/_helpers.c +13722 -0
  20. a_sync/a_sync/_helpers.cpython-311-i386-linux-gnu.so +0 -0
  21. a_sync/a_sync/_helpers.pxd +3 -0
  22. a_sync/a_sync/_helpers.pyi +10 -0
  23. a_sync/a_sync/_helpers.pyx +167 -0
  24. a_sync/a_sync/_kwargs.c +10672 -0
  25. a_sync/a_sync/_kwargs.cpython-311-i386-linux-gnu.so +0 -0
  26. a_sync/a_sync/_kwargs.pxd +2 -0
  27. a_sync/a_sync/_kwargs.pyx +64 -0
  28. a_sync/a_sync/_meta.py +210 -0
  29. a_sync/a_sync/abstract.c +11350 -0
  30. a_sync/a_sync/abstract.cpython-311-i386-linux-gnu.so +0 -0
  31. a_sync/a_sync/abstract.pyi +141 -0
  32. a_sync/a_sync/abstract.pyx +221 -0
  33. a_sync/a_sync/base.c +14066 -0
  34. a_sync/a_sync/base.cpython-311-i386-linux-gnu.so +0 -0
  35. a_sync/a_sync/base.pyi +60 -0
  36. a_sync/a_sync/base.pyx +271 -0
  37. a_sync/a_sync/config.py +168 -0
  38. a_sync/a_sync/decorator.py +651 -0
  39. a_sync/a_sync/flags.c +4471 -0
  40. a_sync/a_sync/flags.cpython-311-i386-linux-gnu.so +0 -0
  41. a_sync/a_sync/flags.pxd +72 -0
  42. a_sync/a_sync/flags.pyi +74 -0
  43. a_sync/a_sync/flags.pyx +72 -0
  44. a_sync/a_sync/function.c +38189 -0
  45. a_sync/a_sync/function.cpython-311-i386-linux-gnu.so +0 -0
  46. a_sync/a_sync/function.pxd +28 -0
  47. a_sync/a_sync/function.pyi +571 -0
  48. a_sync/a_sync/function.pyx +1381 -0
  49. a_sync/a_sync/method.c +30587 -0
  50. a_sync/a_sync/method.cpython-311-i386-linux-gnu.so +0 -0
  51. a_sync/a_sync/method.pxd +9 -0
  52. a_sync/a_sync/method.pyi +524 -0
  53. a_sync/a_sync/method.pyx +1023 -0
  54. a_sync/a_sync/modifiers/__init__.pxd +1 -0
  55. a_sync/a_sync/modifiers/__init__.py +101 -0
  56. a_sync/a_sync/modifiers/cache/__init__.py +160 -0
  57. a_sync/a_sync/modifiers/cache/memory.py +165 -0
  58. a_sync/a_sync/modifiers/limiter.py +132 -0
  59. a_sync/a_sync/modifiers/manager.c +14939 -0
  60. a_sync/a_sync/modifiers/manager.cpython-311-i386-linux-gnu.so +0 -0
  61. a_sync/a_sync/modifiers/manager.pxd +5 -0
  62. a_sync/a_sync/modifiers/manager.pyi +219 -0
  63. a_sync/a_sync/modifiers/manager.pyx +299 -0
  64. a_sync/a_sync/modifiers/semaphores.py +173 -0
  65. a_sync/a_sync/property.c +28130 -0
  66. a_sync/a_sync/property.cpython-311-i386-linux-gnu.so +0 -0
  67. a_sync/a_sync/property.pyi +376 -0
  68. a_sync/a_sync/property.pyx +820 -0
  69. a_sync/a_sync/singleton.py +63 -0
  70. a_sync/aliases.py +3 -0
  71. a_sync/async_property/__init__.pxd +1 -0
  72. a_sync/async_property/__init__.py +1 -0
  73. a_sync/async_property/cached.c +20542 -0
  74. a_sync/async_property/cached.cpython-311-i386-linux-gnu.so +0 -0
  75. a_sync/async_property/cached.pxd +10 -0
  76. a_sync/async_property/cached.pyi +45 -0
  77. a_sync/async_property/cached.pyx +178 -0
  78. a_sync/async_property/proxy.c +36410 -0
  79. a_sync/async_property/proxy.cpython-311-i386-linux-gnu.so +0 -0
  80. a_sync/async_property/proxy.pxd +2 -0
  81. a_sync/async_property/proxy.pyi +124 -0
  82. a_sync/async_property/proxy.pyx +474 -0
  83. a_sync/asyncio/__init__.pxd +6 -0
  84. a_sync/asyncio/__init__.py +164 -0
  85. a_sync/asyncio/as_completed.c +18198 -0
  86. a_sync/asyncio/as_completed.cpython-311-i386-linux-gnu.so +0 -0
  87. a_sync/asyncio/as_completed.pxd +8 -0
  88. a_sync/asyncio/as_completed.pyi +109 -0
  89. a_sync/asyncio/as_completed.pyx +269 -0
  90. a_sync/asyncio/create_task.c +15109 -0
  91. a_sync/asyncio/create_task.cpython-311-i386-linux-gnu.so +0 -0
  92. a_sync/asyncio/create_task.pxd +2 -0
  93. a_sync/asyncio/create_task.pyi +51 -0
  94. a_sync/asyncio/create_task.pyx +276 -0
  95. a_sync/asyncio/gather.c +15735 -0
  96. a_sync/asyncio/gather.cpython-311-i386-linux-gnu.so +0 -0
  97. a_sync/asyncio/gather.pyi +107 -0
  98. a_sync/asyncio/gather.pyx +218 -0
  99. a_sync/asyncio/igather.c +11984 -0
  100. a_sync/asyncio/igather.cpython-311-i386-linux-gnu.so +0 -0
  101. a_sync/asyncio/igather.pxd +1 -0
  102. a_sync/asyncio/igather.pyi +7 -0
  103. a_sync/asyncio/igather.pyx +182 -0
  104. a_sync/asyncio/sleep.c +8916 -0
  105. a_sync/asyncio/sleep.cpython-311-i386-linux-gnu.so +0 -0
  106. a_sync/asyncio/sleep.pyi +14 -0
  107. a_sync/asyncio/sleep.pyx +49 -0
  108. a_sync/debugging.c +15157 -0
  109. a_sync/debugging.cpython-311-i386-linux-gnu.so +0 -0
  110. a_sync/debugging.pyi +76 -0
  111. a_sync/debugging.pyx +107 -0
  112. a_sync/exceptions.c +13169 -0
  113. a_sync/exceptions.cpython-311-i386-linux-gnu.so +0 -0
  114. a_sync/exceptions.pyi +376 -0
  115. a_sync/exceptions.pyx +446 -0
  116. a_sync/executor.py +575 -0
  117. a_sync/functools.c +11489 -0
  118. a_sync/functools.cpython-311-i386-linux-gnu.so +0 -0
  119. a_sync/functools.pxd +7 -0
  120. a_sync/functools.pyi +33 -0
  121. a_sync/functools.pyx +139 -0
  122. a_sync/future.py +1497 -0
  123. a_sync/iter.c +37702 -0
  124. a_sync/iter.cpython-311-i386-linux-gnu.so +0 -0
  125. a_sync/iter.pxd +11 -0
  126. a_sync/iter.pyi +366 -0
  127. a_sync/iter.pyx +981 -0
  128. a_sync/primitives/__init__.pxd +1 -0
  129. a_sync/primitives/__init__.py +53 -0
  130. a_sync/primitives/_debug.c +14737 -0
  131. a_sync/primitives/_debug.cpython-311-i386-linux-gnu.so +0 -0
  132. a_sync/primitives/_debug.pxd +12 -0
  133. a_sync/primitives/_debug.pyi +52 -0
  134. a_sync/primitives/_debug.pyx +223 -0
  135. a_sync/primitives/_loggable.c +10569 -0
  136. a_sync/primitives/_loggable.cpython-311-i386-linux-gnu.so +0 -0
  137. a_sync/primitives/_loggable.pxd +4 -0
  138. a_sync/primitives/_loggable.pyi +66 -0
  139. a_sync/primitives/_loggable.pyx +102 -0
  140. a_sync/primitives/locks/__init__.pxd +8 -0
  141. a_sync/primitives/locks/__init__.py +17 -0
  142. a_sync/primitives/locks/counter.c +16972 -0
  143. a_sync/primitives/locks/counter.cpython-311-i386-linux-gnu.so +0 -0
  144. a_sync/primitives/locks/counter.pxd +12 -0
  145. a_sync/primitives/locks/counter.pyi +151 -0
  146. a_sync/primitives/locks/counter.pyx +260 -0
  147. a_sync/primitives/locks/event.c +16125 -0
  148. a_sync/primitives/locks/event.cpython-311-i386-linux-gnu.so +0 -0
  149. a_sync/primitives/locks/event.pxd +22 -0
  150. a_sync/primitives/locks/event.pyi +43 -0
  151. a_sync/primitives/locks/event.pyx +185 -0
  152. a_sync/primitives/locks/prio_semaphore.c +25204 -0
  153. a_sync/primitives/locks/prio_semaphore.cpython-311-i386-linux-gnu.so +0 -0
  154. a_sync/primitives/locks/prio_semaphore.pxd +25 -0
  155. a_sync/primitives/locks/prio_semaphore.pyi +217 -0
  156. a_sync/primitives/locks/prio_semaphore.pyx +597 -0
  157. a_sync/primitives/locks/semaphore.c +25813 -0
  158. a_sync/primitives/locks/semaphore.cpython-311-i386-linux-gnu.so +0 -0
  159. a_sync/primitives/locks/semaphore.pxd +21 -0
  160. a_sync/primitives/locks/semaphore.pyi +196 -0
  161. a_sync/primitives/locks/semaphore.pyx +454 -0
  162. a_sync/primitives/queue.py +1018 -0
  163. a_sync/py.typed +0 -0
  164. a_sync/sphinx/__init__.py +3 -0
  165. a_sync/sphinx/ext.py +289 -0
  166. a_sync/task.py +932 -0
  167. a_sync/utils/__init__.py +105 -0
  168. a_sync/utils/iterators.py +297 -0
  169. a_sync/utils/repr.c +14354 -0
  170. a_sync/utils/repr.cpython-311-i386-linux-gnu.so +0 -0
  171. a_sync/utils/repr.pyi +2 -0
  172. a_sync/utils/repr.pyx +73 -0
  173. ez_a_sync-0.32.24.dist-info/METADATA +367 -0
  174. ez_a_sync-0.32.24.dist-info/RECORD +177 -0
  175. ez_a_sync-0.32.24.dist-info/WHEEL +7 -0
  176. ez_a_sync-0.32.24.dist-info/licenses/LICENSE.txt +17 -0
  177. ez_a_sync-0.32.24.dist-info/top_level.txt +1 -0
a_sync/a_sync/flags.c ADDED
@@ -0,0 +1,4471 @@
1
+ /* Generated by Cython 3.0.12 */
2
+
3
+ /* BEGIN: Cython Metadata
4
+ {
5
+ "distutils": {
6
+ "include_dirs": [
7
+ "include"
8
+ ],
9
+ "name": "a_sync.a_sync.flags",
10
+ "sources": [
11
+ "a_sync/a_sync/flags.pyx"
12
+ ]
13
+ },
14
+ "module_name": "a_sync.a_sync.flags"
15
+ }
16
+ END: Cython Metadata */
17
+
18
+ #ifndef PY_SSIZE_T_CLEAN
19
+ #define PY_SSIZE_T_CLEAN
20
+ #endif /* PY_SSIZE_T_CLEAN */
21
+ #if defined(CYTHON_LIMITED_API) && 0
22
+ #ifndef Py_LIMITED_API
23
+ #if CYTHON_LIMITED_API+0 > 0x03030000
24
+ #define Py_LIMITED_API CYTHON_LIMITED_API
25
+ #else
26
+ #define Py_LIMITED_API 0x03030000
27
+ #endif
28
+ #endif
29
+ #endif
30
+
31
+ #include "Python.h"
32
+ #ifndef Py_PYTHON_H
33
+ #error Python headers needed to compile C extensions, please install development version of Python.
34
+ #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
35
+ #error Cython requires Python 2.7+ or Python 3.3+.
36
+ #else
37
+ #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API
38
+ #define __PYX_EXTRA_ABI_MODULE_NAME "limited"
39
+ #else
40
+ #define __PYX_EXTRA_ABI_MODULE_NAME ""
41
+ #endif
42
+ #define CYTHON_ABI "3_0_12" __PYX_EXTRA_ABI_MODULE_NAME
43
+ #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
44
+ #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."
45
+ #define CYTHON_HEX_VERSION 0x03000CF0
46
+ #define CYTHON_FUTURE_DIVISION 1
47
+ #include <stddef.h>
48
+ #ifndef offsetof
49
+ #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
50
+ #endif
51
+ #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS)
52
+ #ifndef __stdcall
53
+ #define __stdcall
54
+ #endif
55
+ #ifndef __cdecl
56
+ #define __cdecl
57
+ #endif
58
+ #ifndef __fastcall
59
+ #define __fastcall
60
+ #endif
61
+ #endif
62
+ #ifndef DL_IMPORT
63
+ #define DL_IMPORT(t) t
64
+ #endif
65
+ #ifndef DL_EXPORT
66
+ #define DL_EXPORT(t) t
67
+ #endif
68
+ #define __PYX_COMMA ,
69
+ #ifndef HAVE_LONG_LONG
70
+ #define HAVE_LONG_LONG
71
+ #endif
72
+ #ifndef PY_LONG_LONG
73
+ #define PY_LONG_LONG LONG_LONG
74
+ #endif
75
+ #ifndef Py_HUGE_VAL
76
+ #define Py_HUGE_VAL HUGE_VAL
77
+ #endif
78
+ #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX
79
+ #if defined(GRAALVM_PYTHON)
80
+ /* For very preliminary testing purposes. Most variables are set the same as PyPy.
81
+ The existence of this section does not imply that anything works or is even tested */
82
+ #define CYTHON_COMPILING_IN_PYPY 0
83
+ #define CYTHON_COMPILING_IN_CPYTHON 0
84
+ #define CYTHON_COMPILING_IN_LIMITED_API 0
85
+ #define CYTHON_COMPILING_IN_GRAAL 1
86
+ #define CYTHON_COMPILING_IN_NOGIL 0
87
+ #undef CYTHON_USE_TYPE_SLOTS
88
+ #define CYTHON_USE_TYPE_SLOTS 0
89
+ #undef CYTHON_USE_TYPE_SPECS
90
+ #define CYTHON_USE_TYPE_SPECS 0
91
+ #undef CYTHON_USE_PYTYPE_LOOKUP
92
+ #define CYTHON_USE_PYTYPE_LOOKUP 0
93
+ #if PY_VERSION_HEX < 0x03050000
94
+ #undef CYTHON_USE_ASYNC_SLOTS
95
+ #define CYTHON_USE_ASYNC_SLOTS 0
96
+ #elif !defined(CYTHON_USE_ASYNC_SLOTS)
97
+ #define CYTHON_USE_ASYNC_SLOTS 1
98
+ #endif
99
+ #undef CYTHON_USE_PYLIST_INTERNALS
100
+ #define CYTHON_USE_PYLIST_INTERNALS 0
101
+ #undef CYTHON_USE_UNICODE_INTERNALS
102
+ #define CYTHON_USE_UNICODE_INTERNALS 0
103
+ #undef CYTHON_USE_UNICODE_WRITER
104
+ #define CYTHON_USE_UNICODE_WRITER 0
105
+ #undef CYTHON_USE_PYLONG_INTERNALS
106
+ #define CYTHON_USE_PYLONG_INTERNALS 0
107
+ #undef CYTHON_AVOID_BORROWED_REFS
108
+ #define CYTHON_AVOID_BORROWED_REFS 1
109
+ #undef CYTHON_ASSUME_SAFE_MACROS
110
+ #define CYTHON_ASSUME_SAFE_MACROS 0
111
+ #undef CYTHON_UNPACK_METHODS
112
+ #define CYTHON_UNPACK_METHODS 0
113
+ #undef CYTHON_FAST_THREAD_STATE
114
+ #define CYTHON_FAST_THREAD_STATE 0
115
+ #undef CYTHON_FAST_GIL
116
+ #define CYTHON_FAST_GIL 0
117
+ #undef CYTHON_METH_FASTCALL
118
+ #define CYTHON_METH_FASTCALL 0
119
+ #undef CYTHON_FAST_PYCALL
120
+ #define CYTHON_FAST_PYCALL 0
121
+ #ifndef CYTHON_PEP487_INIT_SUBCLASS
122
+ #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3)
123
+ #endif
124
+ #undef CYTHON_PEP489_MULTI_PHASE_INIT
125
+ #define CYTHON_PEP489_MULTI_PHASE_INIT 1
126
+ #undef CYTHON_USE_MODULE_STATE
127
+ #define CYTHON_USE_MODULE_STATE 0
128
+ #undef CYTHON_USE_TP_FINALIZE
129
+ #define CYTHON_USE_TP_FINALIZE 0
130
+ #undef CYTHON_USE_DICT_VERSIONS
131
+ #define CYTHON_USE_DICT_VERSIONS 0
132
+ #undef CYTHON_USE_EXC_INFO_STACK
133
+ #define CYTHON_USE_EXC_INFO_STACK 0
134
+ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
135
+ #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
136
+ #endif
137
+ #undef CYTHON_USE_FREELISTS
138
+ #define CYTHON_USE_FREELISTS 0
139
+ #elif defined(PYPY_VERSION)
140
+ #define CYTHON_COMPILING_IN_PYPY 1
141
+ #define CYTHON_COMPILING_IN_CPYTHON 0
142
+ #define CYTHON_COMPILING_IN_LIMITED_API 0
143
+ #define CYTHON_COMPILING_IN_GRAAL 0
144
+ #define CYTHON_COMPILING_IN_NOGIL 0
145
+ #undef CYTHON_USE_TYPE_SLOTS
146
+ #define CYTHON_USE_TYPE_SLOTS 0
147
+ #ifndef CYTHON_USE_TYPE_SPECS
148
+ #define CYTHON_USE_TYPE_SPECS 0
149
+ #endif
150
+ #undef CYTHON_USE_PYTYPE_LOOKUP
151
+ #define CYTHON_USE_PYTYPE_LOOKUP 0
152
+ #if PY_VERSION_HEX < 0x03050000
153
+ #undef CYTHON_USE_ASYNC_SLOTS
154
+ #define CYTHON_USE_ASYNC_SLOTS 0
155
+ #elif !defined(CYTHON_USE_ASYNC_SLOTS)
156
+ #define CYTHON_USE_ASYNC_SLOTS 1
157
+ #endif
158
+ #undef CYTHON_USE_PYLIST_INTERNALS
159
+ #define CYTHON_USE_PYLIST_INTERNALS 0
160
+ #undef CYTHON_USE_UNICODE_INTERNALS
161
+ #define CYTHON_USE_UNICODE_INTERNALS 0
162
+ #undef CYTHON_USE_UNICODE_WRITER
163
+ #define CYTHON_USE_UNICODE_WRITER 0
164
+ #undef CYTHON_USE_PYLONG_INTERNALS
165
+ #define CYTHON_USE_PYLONG_INTERNALS 0
166
+ #undef CYTHON_AVOID_BORROWED_REFS
167
+ #define CYTHON_AVOID_BORROWED_REFS 1
168
+ #undef CYTHON_ASSUME_SAFE_MACROS
169
+ #define CYTHON_ASSUME_SAFE_MACROS 0
170
+ #undef CYTHON_UNPACK_METHODS
171
+ #define CYTHON_UNPACK_METHODS 0
172
+ #undef CYTHON_FAST_THREAD_STATE
173
+ #define CYTHON_FAST_THREAD_STATE 0
174
+ #undef CYTHON_FAST_GIL
175
+ #define CYTHON_FAST_GIL 0
176
+ #undef CYTHON_METH_FASTCALL
177
+ #define CYTHON_METH_FASTCALL 0
178
+ #undef CYTHON_FAST_PYCALL
179
+ #define CYTHON_FAST_PYCALL 0
180
+ #ifndef CYTHON_PEP487_INIT_SUBCLASS
181
+ #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3)
182
+ #endif
183
+ #if PY_VERSION_HEX < 0x03090000
184
+ #undef CYTHON_PEP489_MULTI_PHASE_INIT
185
+ #define CYTHON_PEP489_MULTI_PHASE_INIT 0
186
+ #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
187
+ #define CYTHON_PEP489_MULTI_PHASE_INIT 1
188
+ #endif
189
+ #undef CYTHON_USE_MODULE_STATE
190
+ #define CYTHON_USE_MODULE_STATE 0
191
+ #undef CYTHON_USE_TP_FINALIZE
192
+ #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00)
193
+ #undef CYTHON_USE_DICT_VERSIONS
194
+ #define CYTHON_USE_DICT_VERSIONS 0
195
+ #undef CYTHON_USE_EXC_INFO_STACK
196
+ #define CYTHON_USE_EXC_INFO_STACK 0
197
+ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
198
+ #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
199
+ #endif
200
+ #undef CYTHON_USE_FREELISTS
201
+ #define CYTHON_USE_FREELISTS 0
202
+ #elif defined(CYTHON_LIMITED_API)
203
+ #ifdef Py_LIMITED_API
204
+ #undef __PYX_LIMITED_VERSION_HEX
205
+ #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API
206
+ #endif
207
+ #define CYTHON_COMPILING_IN_PYPY 0
208
+ #define CYTHON_COMPILING_IN_CPYTHON 0
209
+ #define CYTHON_COMPILING_IN_LIMITED_API 1
210
+ #define CYTHON_COMPILING_IN_GRAAL 0
211
+ #define CYTHON_COMPILING_IN_NOGIL 0
212
+ #undef CYTHON_CLINE_IN_TRACEBACK
213
+ #define CYTHON_CLINE_IN_TRACEBACK 0
214
+ #undef CYTHON_USE_TYPE_SLOTS
215
+ #define CYTHON_USE_TYPE_SLOTS 0
216
+ #undef CYTHON_USE_TYPE_SPECS
217
+ #define CYTHON_USE_TYPE_SPECS 1
218
+ #undef CYTHON_USE_PYTYPE_LOOKUP
219
+ #define CYTHON_USE_PYTYPE_LOOKUP 0
220
+ #undef CYTHON_USE_ASYNC_SLOTS
221
+ #define CYTHON_USE_ASYNC_SLOTS 0
222
+ #undef CYTHON_USE_PYLIST_INTERNALS
223
+ #define CYTHON_USE_PYLIST_INTERNALS 0
224
+ #undef CYTHON_USE_UNICODE_INTERNALS
225
+ #define CYTHON_USE_UNICODE_INTERNALS 0
226
+ #ifndef CYTHON_USE_UNICODE_WRITER
227
+ #define CYTHON_USE_UNICODE_WRITER 0
228
+ #endif
229
+ #undef CYTHON_USE_PYLONG_INTERNALS
230
+ #define CYTHON_USE_PYLONG_INTERNALS 0
231
+ #ifndef CYTHON_AVOID_BORROWED_REFS
232
+ #define CYTHON_AVOID_BORROWED_REFS 0
233
+ #endif
234
+ #undef CYTHON_ASSUME_SAFE_MACROS
235
+ #define CYTHON_ASSUME_SAFE_MACROS 0
236
+ #undef CYTHON_UNPACK_METHODS
237
+ #define CYTHON_UNPACK_METHODS 0
238
+ #undef CYTHON_FAST_THREAD_STATE
239
+ #define CYTHON_FAST_THREAD_STATE 0
240
+ #undef CYTHON_FAST_GIL
241
+ #define CYTHON_FAST_GIL 0
242
+ #undef CYTHON_METH_FASTCALL
243
+ #define CYTHON_METH_FASTCALL 0
244
+ #undef CYTHON_FAST_PYCALL
245
+ #define CYTHON_FAST_PYCALL 0
246
+ #ifndef CYTHON_PEP487_INIT_SUBCLASS
247
+ #define CYTHON_PEP487_INIT_SUBCLASS 1
248
+ #endif
249
+ #undef CYTHON_PEP489_MULTI_PHASE_INIT
250
+ #define CYTHON_PEP489_MULTI_PHASE_INIT 0
251
+ #undef CYTHON_USE_MODULE_STATE
252
+ #define CYTHON_USE_MODULE_STATE 1
253
+ #ifndef CYTHON_USE_TP_FINALIZE
254
+ #define CYTHON_USE_TP_FINALIZE 0
255
+ #endif
256
+ #undef CYTHON_USE_DICT_VERSIONS
257
+ #define CYTHON_USE_DICT_VERSIONS 0
258
+ #undef CYTHON_USE_EXC_INFO_STACK
259
+ #define CYTHON_USE_EXC_INFO_STACK 0
260
+ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
261
+ #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
262
+ #endif
263
+ #undef CYTHON_USE_FREELISTS
264
+ #define CYTHON_USE_FREELISTS 0
265
+ #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL)
266
+ #define CYTHON_COMPILING_IN_PYPY 0
267
+ #define CYTHON_COMPILING_IN_CPYTHON 0
268
+ #define CYTHON_COMPILING_IN_LIMITED_API 0
269
+ #define CYTHON_COMPILING_IN_GRAAL 0
270
+ #define CYTHON_COMPILING_IN_NOGIL 1
271
+ #ifndef CYTHON_USE_TYPE_SLOTS
272
+ #define CYTHON_USE_TYPE_SLOTS 1
273
+ #endif
274
+ #ifndef CYTHON_USE_TYPE_SPECS
275
+ #define CYTHON_USE_TYPE_SPECS 0
276
+ #endif
277
+ #undef CYTHON_USE_PYTYPE_LOOKUP
278
+ #define CYTHON_USE_PYTYPE_LOOKUP 0
279
+ #ifndef CYTHON_USE_ASYNC_SLOTS
280
+ #define CYTHON_USE_ASYNC_SLOTS 1
281
+ #endif
282
+ #ifndef CYTHON_USE_PYLONG_INTERNALS
283
+ #define CYTHON_USE_PYLONG_INTERNALS 0
284
+ #endif
285
+ #undef CYTHON_USE_PYLIST_INTERNALS
286
+ #define CYTHON_USE_PYLIST_INTERNALS 0
287
+ #ifndef CYTHON_USE_UNICODE_INTERNALS
288
+ #define CYTHON_USE_UNICODE_INTERNALS 1
289
+ #endif
290
+ #undef CYTHON_USE_UNICODE_WRITER
291
+ #define CYTHON_USE_UNICODE_WRITER 0
292
+ #ifndef CYTHON_AVOID_BORROWED_REFS
293
+ #define CYTHON_AVOID_BORROWED_REFS 0
294
+ #endif
295
+ #ifndef CYTHON_ASSUME_SAFE_MACROS
296
+ #define CYTHON_ASSUME_SAFE_MACROS 1
297
+ #endif
298
+ #ifndef CYTHON_UNPACK_METHODS
299
+ #define CYTHON_UNPACK_METHODS 1
300
+ #endif
301
+ #undef CYTHON_FAST_THREAD_STATE
302
+ #define CYTHON_FAST_THREAD_STATE 0
303
+ #undef CYTHON_FAST_GIL
304
+ #define CYTHON_FAST_GIL 0
305
+ #ifndef CYTHON_METH_FASTCALL
306
+ #define CYTHON_METH_FASTCALL 1
307
+ #endif
308
+ #undef CYTHON_FAST_PYCALL
309
+ #define CYTHON_FAST_PYCALL 0
310
+ #ifndef CYTHON_PEP487_INIT_SUBCLASS
311
+ #define CYTHON_PEP487_INIT_SUBCLASS 1
312
+ #endif
313
+ #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
314
+ #define CYTHON_PEP489_MULTI_PHASE_INIT 1
315
+ #endif
316
+ #ifndef CYTHON_USE_MODULE_STATE
317
+ #define CYTHON_USE_MODULE_STATE 0
318
+ #endif
319
+ #ifndef CYTHON_USE_TP_FINALIZE
320
+ #define CYTHON_USE_TP_FINALIZE 1
321
+ #endif
322
+ #undef CYTHON_USE_DICT_VERSIONS
323
+ #define CYTHON_USE_DICT_VERSIONS 0
324
+ #undef CYTHON_USE_EXC_INFO_STACK
325
+ #define CYTHON_USE_EXC_INFO_STACK 0
326
+ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
327
+ #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
328
+ #endif
329
+ #ifndef CYTHON_USE_FREELISTS
330
+ #define CYTHON_USE_FREELISTS 0
331
+ #endif
332
+ #else
333
+ #define CYTHON_COMPILING_IN_PYPY 0
334
+ #define CYTHON_COMPILING_IN_CPYTHON 1
335
+ #define CYTHON_COMPILING_IN_LIMITED_API 0
336
+ #define CYTHON_COMPILING_IN_GRAAL 0
337
+ #define CYTHON_COMPILING_IN_NOGIL 0
338
+ #ifndef CYTHON_USE_TYPE_SLOTS
339
+ #define CYTHON_USE_TYPE_SLOTS 1
340
+ #endif
341
+ #ifndef CYTHON_USE_TYPE_SPECS
342
+ #define CYTHON_USE_TYPE_SPECS 0
343
+ #endif
344
+ #ifndef CYTHON_USE_PYTYPE_LOOKUP
345
+ #define CYTHON_USE_PYTYPE_LOOKUP 1
346
+ #endif
347
+ #if PY_MAJOR_VERSION < 3
348
+ #undef CYTHON_USE_ASYNC_SLOTS
349
+ #define CYTHON_USE_ASYNC_SLOTS 0
350
+ #elif !defined(CYTHON_USE_ASYNC_SLOTS)
351
+ #define CYTHON_USE_ASYNC_SLOTS 1
352
+ #endif
353
+ #ifndef CYTHON_USE_PYLONG_INTERNALS
354
+ #define CYTHON_USE_PYLONG_INTERNALS 1
355
+ #endif
356
+ #ifndef CYTHON_USE_PYLIST_INTERNALS
357
+ #define CYTHON_USE_PYLIST_INTERNALS 1
358
+ #endif
359
+ #ifndef CYTHON_USE_UNICODE_INTERNALS
360
+ #define CYTHON_USE_UNICODE_INTERNALS 1
361
+ #endif
362
+ #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
363
+ #undef CYTHON_USE_UNICODE_WRITER
364
+ #define CYTHON_USE_UNICODE_WRITER 0
365
+ #elif !defined(CYTHON_USE_UNICODE_WRITER)
366
+ #define CYTHON_USE_UNICODE_WRITER 1
367
+ #endif
368
+ #ifndef CYTHON_AVOID_BORROWED_REFS
369
+ #define CYTHON_AVOID_BORROWED_REFS 0
370
+ #endif
371
+ #ifndef CYTHON_ASSUME_SAFE_MACROS
372
+ #define CYTHON_ASSUME_SAFE_MACROS 1
373
+ #endif
374
+ #ifndef CYTHON_UNPACK_METHODS
375
+ #define CYTHON_UNPACK_METHODS 1
376
+ #endif
377
+ #ifndef CYTHON_FAST_THREAD_STATE
378
+ #define CYTHON_FAST_THREAD_STATE 1
379
+ #endif
380
+ #ifndef CYTHON_FAST_GIL
381
+ #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6)
382
+ #endif
383
+ #ifndef CYTHON_METH_FASTCALL
384
+ #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1)
385
+ #endif
386
+ #ifndef CYTHON_FAST_PYCALL
387
+ #define CYTHON_FAST_PYCALL 1
388
+ #endif
389
+ #ifndef CYTHON_PEP487_INIT_SUBCLASS
390
+ #define CYTHON_PEP487_INIT_SUBCLASS 1
391
+ #endif
392
+ #if PY_VERSION_HEX < 0x03050000
393
+ #undef CYTHON_PEP489_MULTI_PHASE_INIT
394
+ #define CYTHON_PEP489_MULTI_PHASE_INIT 0
395
+ #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
396
+ #define CYTHON_PEP489_MULTI_PHASE_INIT 1
397
+ #endif
398
+ #ifndef CYTHON_USE_MODULE_STATE
399
+ #define CYTHON_USE_MODULE_STATE 0
400
+ #endif
401
+ #if PY_VERSION_HEX < 0x030400a1
402
+ #undef CYTHON_USE_TP_FINALIZE
403
+ #define CYTHON_USE_TP_FINALIZE 0
404
+ #elif !defined(CYTHON_USE_TP_FINALIZE)
405
+ #define CYTHON_USE_TP_FINALIZE 1
406
+ #endif
407
+ #if PY_VERSION_HEX < 0x030600B1
408
+ #undef CYTHON_USE_DICT_VERSIONS
409
+ #define CYTHON_USE_DICT_VERSIONS 0
410
+ #elif !defined(CYTHON_USE_DICT_VERSIONS)
411
+ #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5)
412
+ #endif
413
+ #if PY_VERSION_HEX < 0x030700A3
414
+ #undef CYTHON_USE_EXC_INFO_STACK
415
+ #define CYTHON_USE_EXC_INFO_STACK 0
416
+ #elif !defined(CYTHON_USE_EXC_INFO_STACK)
417
+ #define CYTHON_USE_EXC_INFO_STACK 1
418
+ #endif
419
+ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
420
+ #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
421
+ #endif
422
+ #ifndef CYTHON_USE_FREELISTS
423
+ #define CYTHON_USE_FREELISTS 1
424
+ #endif
425
+ #endif
426
+ #if !defined(CYTHON_FAST_PYCCALL)
427
+ #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
428
+ #endif
429
+ #if !defined(CYTHON_VECTORCALL)
430
+ #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1)
431
+ #endif
432
+ #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1)
433
+ #if CYTHON_USE_PYLONG_INTERNALS
434
+ #if PY_MAJOR_VERSION < 3
435
+ #include "longintrepr.h"
436
+ #endif
437
+ #undef SHIFT
438
+ #undef BASE
439
+ #undef MASK
440
+ #ifdef SIZEOF_VOID_P
441
+ enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
442
+ #endif
443
+ #endif
444
+ #ifndef __has_attribute
445
+ #define __has_attribute(x) 0
446
+ #endif
447
+ #ifndef __has_cpp_attribute
448
+ #define __has_cpp_attribute(x) 0
449
+ #endif
450
+ #ifndef CYTHON_RESTRICT
451
+ #if defined(__GNUC__)
452
+ #define CYTHON_RESTRICT __restrict__
453
+ #elif defined(_MSC_VER) && _MSC_VER >= 1400
454
+ #define CYTHON_RESTRICT __restrict
455
+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
456
+ #define CYTHON_RESTRICT restrict
457
+ #else
458
+ #define CYTHON_RESTRICT
459
+ #endif
460
+ #endif
461
+ #ifndef CYTHON_UNUSED
462
+ #if defined(__cplusplus)
463
+ /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17
464
+ * but leads to warnings with -pedantic, since it is a C++17 feature */
465
+ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
466
+ #if __has_cpp_attribute(maybe_unused)
467
+ #define CYTHON_UNUSED [[maybe_unused]]
468
+ #endif
469
+ #endif
470
+ #endif
471
+ #endif
472
+ #ifndef CYTHON_UNUSED
473
+ # if defined(__GNUC__)
474
+ # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
475
+ # define CYTHON_UNUSED __attribute__ ((__unused__))
476
+ # else
477
+ # define CYTHON_UNUSED
478
+ # endif
479
+ # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
480
+ # define CYTHON_UNUSED __attribute__ ((__unused__))
481
+ # else
482
+ # define CYTHON_UNUSED
483
+ # endif
484
+ #endif
485
+ #ifndef CYTHON_UNUSED_VAR
486
+ # if defined(__cplusplus)
487
+ template<class T> void CYTHON_UNUSED_VAR( const T& ) { }
488
+ # else
489
+ # define CYTHON_UNUSED_VAR(x) (void)(x)
490
+ # endif
491
+ #endif
492
+ #ifndef CYTHON_MAYBE_UNUSED_VAR
493
+ #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
494
+ #endif
495
+ #ifndef CYTHON_NCP_UNUSED
496
+ # if CYTHON_COMPILING_IN_CPYTHON
497
+ # define CYTHON_NCP_UNUSED
498
+ # else
499
+ # define CYTHON_NCP_UNUSED CYTHON_UNUSED
500
+ # endif
501
+ #endif
502
+ #ifndef CYTHON_USE_CPP_STD_MOVE
503
+ #if defined(__cplusplus) && (\
504
+ __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600))
505
+ #define CYTHON_USE_CPP_STD_MOVE 1
506
+ #else
507
+ #define CYTHON_USE_CPP_STD_MOVE 0
508
+ #endif
509
+ #endif
510
+ #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
511
+ #ifdef _MSC_VER
512
+ #ifndef _MSC_STDINT_H_
513
+ #if _MSC_VER < 1300
514
+ typedef unsigned char uint8_t;
515
+ typedef unsigned short uint16_t;
516
+ typedef unsigned int uint32_t;
517
+ #else
518
+ typedef unsigned __int8 uint8_t;
519
+ typedef unsigned __int16 uint16_t;
520
+ typedef unsigned __int32 uint32_t;
521
+ #endif
522
+ #endif
523
+ #if _MSC_VER < 1300
524
+ #ifdef _WIN64
525
+ typedef unsigned long long __pyx_uintptr_t;
526
+ #else
527
+ typedef unsigned int __pyx_uintptr_t;
528
+ #endif
529
+ #else
530
+ #ifdef _WIN64
531
+ typedef unsigned __int64 __pyx_uintptr_t;
532
+ #else
533
+ typedef unsigned __int32 __pyx_uintptr_t;
534
+ #endif
535
+ #endif
536
+ #else
537
+ #include <stdint.h>
538
+ typedef uintptr_t __pyx_uintptr_t;
539
+ #endif
540
+ #ifndef CYTHON_FALLTHROUGH
541
+ #if defined(__cplusplus)
542
+ /* for clang __has_cpp_attribute(fallthrough) is true even before C++17
543
+ * but leads to warnings with -pedantic, since it is a C++17 feature */
544
+ #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
545
+ #if __has_cpp_attribute(fallthrough)
546
+ #define CYTHON_FALLTHROUGH [[fallthrough]]
547
+ #endif
548
+ #endif
549
+ #ifndef CYTHON_FALLTHROUGH
550
+ #if __has_cpp_attribute(clang::fallthrough)
551
+ #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
552
+ #elif __has_cpp_attribute(gnu::fallthrough)
553
+ #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
554
+ #endif
555
+ #endif
556
+ #endif
557
+ #ifndef CYTHON_FALLTHROUGH
558
+ #if __has_attribute(fallthrough)
559
+ #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
560
+ #else
561
+ #define CYTHON_FALLTHROUGH
562
+ #endif
563
+ #endif
564
+ #if defined(__clang__) && defined(__apple_build_version__)
565
+ #if __apple_build_version__ < 7000000
566
+ #undef CYTHON_FALLTHROUGH
567
+ #define CYTHON_FALLTHROUGH
568
+ #endif
569
+ #endif
570
+ #endif
571
+ #ifdef __cplusplus
572
+ template <typename T>
573
+ struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);};
574
+ #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::value)
575
+ #else
576
+ #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
577
+ #endif
578
+ #if CYTHON_COMPILING_IN_PYPY == 1
579
+ #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000)
580
+ #else
581
+ #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000)
582
+ #endif
583
+ #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))
584
+
585
+ #ifndef CYTHON_INLINE
586
+ #if defined(__clang__)
587
+ #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
588
+ #elif defined(__GNUC__)
589
+ #define CYTHON_INLINE __inline__
590
+ #elif defined(_MSC_VER)
591
+ #define CYTHON_INLINE __inline
592
+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
593
+ #define CYTHON_INLINE inline
594
+ #else
595
+ #define CYTHON_INLINE
596
+ #endif
597
+ #endif
598
+
599
+ #define __PYX_BUILD_PY_SSIZE_T "n"
600
+ #define CYTHON_FORMAT_SSIZE_T "z"
601
+ #if PY_MAJOR_VERSION < 3
602
+ #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
603
+ #define __Pyx_DefaultClassType PyClass_Type
604
+ #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
605
+ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
606
+ #else
607
+ #define __Pyx_BUILTIN_MODULE_NAME "builtins"
608
+ #define __Pyx_DefaultClassType PyType_Type
609
+ #if CYTHON_COMPILING_IN_LIMITED_API
610
+ static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f,
611
+ PyObject *code, PyObject *c, PyObject* n, PyObject *v,
612
+ PyObject *fv, PyObject *cell, PyObject* fn,
613
+ PyObject *name, int fline, PyObject *lnos) {
614
+ PyObject *exception_table = NULL;
615
+ PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
616
+ #if __PYX_LIMITED_VERSION_HEX < 0x030B0000
617
+ PyObject *version_info;
618
+ PyObject *py_minor_version = NULL;
619
+ #endif
620
+ long minor_version = 0;
621
+ PyObject *type, *value, *traceback;
622
+ PyErr_Fetch(&type, &value, &traceback);
623
+ #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000
624
+ minor_version = 11;
625
+ #else
626
+ if (!(version_info = PySys_GetObject("version_info"))) goto end;
627
+ if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end;
628
+ minor_version = PyLong_AsLong(py_minor_version);
629
+ Py_DECREF(py_minor_version);
630
+ if (minor_version == -1 && PyErr_Occurred()) goto end;
631
+ #endif
632
+ if (!(types_module = PyImport_ImportModule("types"))) goto end;
633
+ if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end;
634
+ if (minor_version <= 7) {
635
+ (void)p;
636
+ result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code,
637
+ c, n, v, fn, name, fline, lnos, fv, cell);
638
+ } else if (minor_version <= 10) {
639
+ result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code,
640
+ c, n, v, fn, name, fline, lnos, fv, cell);
641
+ } else {
642
+ if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end;
643
+ result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code,
644
+ c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell);
645
+ }
646
+ end:
647
+ Py_XDECREF(code_type);
648
+ Py_XDECREF(exception_table);
649
+ Py_XDECREF(types_module);
650
+ if (type) {
651
+ PyErr_Restore(type, value, traceback);
652
+ }
653
+ return result;
654
+ }
655
+ #ifndef CO_OPTIMIZED
656
+ #define CO_OPTIMIZED 0x0001
657
+ #endif
658
+ #ifndef CO_NEWLOCALS
659
+ #define CO_NEWLOCALS 0x0002
660
+ #endif
661
+ #ifndef CO_VARARGS
662
+ #define CO_VARARGS 0x0004
663
+ #endif
664
+ #ifndef CO_VARKEYWORDS
665
+ #define CO_VARKEYWORDS 0x0008
666
+ #endif
667
+ #ifndef CO_ASYNC_GENERATOR
668
+ #define CO_ASYNC_GENERATOR 0x0200
669
+ #endif
670
+ #ifndef CO_GENERATOR
671
+ #define CO_GENERATOR 0x0020
672
+ #endif
673
+ #ifndef CO_COROUTINE
674
+ #define CO_COROUTINE 0x0080
675
+ #endif
676
+ #elif PY_VERSION_HEX >= 0x030B0000
677
+ static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f,
678
+ PyObject *code, PyObject *c, PyObject* n, PyObject *v,
679
+ PyObject *fv, PyObject *cell, PyObject* fn,
680
+ PyObject *name, int fline, PyObject *lnos) {
681
+ PyCodeObject *result;
682
+ PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0);
683
+ if (!empty_bytes) return NULL;
684
+ result =
685
+ #if PY_VERSION_HEX >= 0x030C0000
686
+ PyUnstable_Code_NewWithPosOnlyArgs
687
+ #else
688
+ PyCode_NewWithPosOnlyArgs
689
+ #endif
690
+ (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes);
691
+ Py_DECREF(empty_bytes);
692
+ return result;
693
+ }
694
+ #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY
695
+ #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
696
+ PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
697
+ #else
698
+ #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
699
+ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
700
+ #endif
701
+ #endif
702
+ #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE)
703
+ #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type)
704
+ #else
705
+ #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type))
706
+ #endif
707
+ #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is)
708
+ #define __Pyx_Py_Is(x, y) Py_Is(x, y)
709
+ #else
710
+ #define __Pyx_Py_Is(x, y) ((x) == (y))
711
+ #endif
712
+ #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
713
+ #define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
714
+ #else
715
+ #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
716
+ #endif
717
+ #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
718
+ #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
719
+ #else
720
+ #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
721
+ #endif
722
+ #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
723
+ #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
724
+ #else
725
+ #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
726
+ #endif
727
+ #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj))
728
+ #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY
729
+ #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
730
+ #else
731
+ #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
732
+ #endif
733
+ #ifndef CO_COROUTINE
734
+ #define CO_COROUTINE 0x80
735
+ #endif
736
+ #ifndef CO_ASYNC_GENERATOR
737
+ #define CO_ASYNC_GENERATOR 0x200
738
+ #endif
739
+ #ifndef Py_TPFLAGS_CHECKTYPES
740
+ #define Py_TPFLAGS_CHECKTYPES 0
741
+ #endif
742
+ #ifndef Py_TPFLAGS_HAVE_INDEX
743
+ #define Py_TPFLAGS_HAVE_INDEX 0
744
+ #endif
745
+ #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
746
+ #define Py_TPFLAGS_HAVE_NEWBUFFER 0
747
+ #endif
748
+ #ifndef Py_TPFLAGS_HAVE_FINALIZE
749
+ #define Py_TPFLAGS_HAVE_FINALIZE 0
750
+ #endif
751
+ #ifndef Py_TPFLAGS_SEQUENCE
752
+ #define Py_TPFLAGS_SEQUENCE 0
753
+ #endif
754
+ #ifndef Py_TPFLAGS_MAPPING
755
+ #define Py_TPFLAGS_MAPPING 0
756
+ #endif
757
+ #ifndef METH_STACKLESS
758
+ #define METH_STACKLESS 0
759
+ #endif
760
+ #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
761
+ #ifndef METH_FASTCALL
762
+ #define METH_FASTCALL 0x80
763
+ #endif
764
+ typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
765
+ typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
766
+ Py_ssize_t nargs, PyObject *kwnames);
767
+ #else
768
+ #if PY_VERSION_HEX >= 0x030d00A4
769
+ # define __Pyx_PyCFunctionFast PyCFunctionFast
770
+ # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
771
+ #else
772
+ # define __Pyx_PyCFunctionFast _PyCFunctionFast
773
+ # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
774
+ #endif
775
+ #endif
776
+ #if CYTHON_METH_FASTCALL
777
+ #define __Pyx_METH_FASTCALL METH_FASTCALL
778
+ #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
779
+ #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
780
+ #else
781
+ #define __Pyx_METH_FASTCALL METH_VARARGS
782
+ #define __Pyx_PyCFunction_FastCall PyCFunction
783
+ #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
784
+ #endif
785
+ #if CYTHON_VECTORCALL
786
+ #define __pyx_vectorcallfunc vectorcallfunc
787
+ #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET
788
+ #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n))
789
+ #elif CYTHON_BACKPORT_VECTORCALL
790
+ typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args,
791
+ size_t nargsf, PyObject *kwnames);
792
+ #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1))
793
+ #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET))
794
+ #else
795
+ #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0
796
+ #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n))
797
+ #endif
798
+ #if PY_MAJOR_VERSION >= 0x030900B1
799
+ #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func)
800
+ #else
801
+ #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func)
802
+ #endif
803
+ #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func)
804
+ #if CYTHON_COMPILING_IN_CPYTHON
805
+ #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth)
806
+ #elif !CYTHON_COMPILING_IN_LIMITED_API
807
+ #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func)
808
+ #endif
809
+ #if CYTHON_COMPILING_IN_CPYTHON
810
+ #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags)
811
+ static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) {
812
+ return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self;
813
+ }
814
+ #endif
815
+ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) {
816
+ #if CYTHON_COMPILING_IN_LIMITED_API
817
+ return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
818
+ #else
819
+ return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
820
+ #endif
821
+ }
822
+ #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc)
823
+ #if __PYX_LIMITED_VERSION_HEX < 0x030900B1
824
+ #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b))
825
+ typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *);
826
+ #else
827
+ #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b)
828
+ #define __Pyx_PyCMethod PyCMethod
829
+ #endif
830
+ #ifndef METH_METHOD
831
+ #define METH_METHOD 0x200
832
+ #endif
833
+ #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
834
+ #define PyObject_Malloc(s) PyMem_Malloc(s)
835
+ #define PyObject_Free(p) PyMem_Free(p)
836
+ #define PyObject_Realloc(p) PyMem_Realloc(p)
837
+ #endif
838
+ #if CYTHON_COMPILING_IN_LIMITED_API
839
+ #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
840
+ #define __Pyx_PyFrame_SetLineNumber(frame, lineno)
841
+ #else
842
+ #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
843
+ #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
844
+ #endif
845
+ #if CYTHON_COMPILING_IN_LIMITED_API
846
+ #define __Pyx_PyThreadState_Current PyThreadState_Get()
847
+ #elif !CYTHON_FAST_THREAD_STATE
848
+ #define __Pyx_PyThreadState_Current PyThreadState_GET()
849
+ #elif PY_VERSION_HEX >= 0x030d00A1
850
+ #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
851
+ #elif PY_VERSION_HEX >= 0x03060000
852
+ #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
853
+ #elif PY_VERSION_HEX >= 0x03000000
854
+ #define __Pyx_PyThreadState_Current PyThreadState_GET()
855
+ #else
856
+ #define __Pyx_PyThreadState_Current _PyThreadState_Current
857
+ #endif
858
+ #if CYTHON_COMPILING_IN_LIMITED_API
859
+ static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op)
860
+ {
861
+ void *result;
862
+ result = PyModule_GetState(op);
863
+ if (!result)
864
+ Py_FatalError("Couldn't find the module state");
865
+ return result;
866
+ }
867
+ #endif
868
+ #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype)
869
+ #if CYTHON_COMPILING_IN_LIMITED_API
870
+ #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name))
871
+ #else
872
+ #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name)
873
+ #endif
874
+ #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
875
+ #include "pythread.h"
876
+ #define Py_tss_NEEDS_INIT 0
877
+ typedef int Py_tss_t;
878
+ static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
879
+ *key = PyThread_create_key();
880
+ return 0;
881
+ }
882
+ static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
883
+ Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
884
+ *key = Py_tss_NEEDS_INIT;
885
+ return key;
886
+ }
887
+ static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
888
+ PyObject_Free(key);
889
+ }
890
+ static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
891
+ return *key != Py_tss_NEEDS_INIT;
892
+ }
893
+ static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
894
+ PyThread_delete_key(*key);
895
+ *key = Py_tss_NEEDS_INIT;
896
+ }
897
+ static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
898
+ return PyThread_set_key_value(*key, value);
899
+ }
900
+ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
901
+ return PyThread_get_key_value(*key);
902
+ }
903
+ #endif
904
+ #if PY_MAJOR_VERSION < 3
905
+ #if CYTHON_COMPILING_IN_PYPY
906
+ #if PYPY_VERSION_NUM < 0x07030600
907
+ #if defined(__cplusplus) && __cplusplus >= 201402L
908
+ [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]]
909
+ #elif defined(__GNUC__) || defined(__clang__)
910
+ __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")))
911
+ #elif defined(_MSC_VER)
912
+ __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))
913
+ #endif
914
+ static CYTHON_INLINE int PyGILState_Check(void) {
915
+ return 0;
916
+ }
917
+ #else // PYPY_VERSION_NUM < 0x07030600
918
+ #endif // PYPY_VERSION_NUM < 0x07030600
919
+ #else
920
+ static CYTHON_INLINE int PyGILState_Check(void) {
921
+ PyThreadState * tstate = _PyThreadState_Current;
922
+ return tstate && (tstate == PyGILState_GetThisThreadState());
923
+ }
924
+ #endif
925
+ #endif
926
+ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized)
927
+ #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
928
+ #else
929
+ #define __Pyx_PyDict_NewPresized(n) PyDict_New()
930
+ #endif
931
+ #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
932
+ #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
933
+ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
934
+ #else
935
+ #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
936
+ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
937
+ #endif
938
+ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS
939
+ #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
940
+ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
941
+ PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
942
+ if (res == NULL) PyErr_Clear();
943
+ return res;
944
+ }
945
+ #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000)
946
+ #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError
947
+ #define __Pyx_PyDict_GetItemStr PyDict_GetItem
948
+ #else
949
+ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
950
+ #if CYTHON_COMPILING_IN_PYPY
951
+ return PyDict_GetItem(dict, name);
952
+ #else
953
+ PyDictEntry *ep;
954
+ PyDictObject *mp = (PyDictObject*) dict;
955
+ long hash = ((PyStringObject *) name)->ob_shash;
956
+ assert(hash != -1);
957
+ ep = (mp->ma_lookup)(mp, name, hash);
958
+ if (ep == NULL) {
959
+ return NULL;
960
+ }
961
+ return ep->me_value;
962
+ #endif
963
+ }
964
+ #define __Pyx_PyDict_GetItemStr PyDict_GetItem
965
+ #endif
966
+ #if CYTHON_USE_TYPE_SLOTS
967
+ #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags)
968
+ #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
969
+ #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext)
970
+ #else
971
+ #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp))
972
+ #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature)
973
+ #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next
974
+ #endif
975
+ #if CYTHON_COMPILING_IN_LIMITED_API
976
+ #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v)
977
+ #else
978
+ #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v)
979
+ #endif
980
+ #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000
981
+ #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\
982
+ PyTypeObject *type = Py_TYPE((PyObject*)obj);\
983
+ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
984
+ PyObject_GC_Del(obj);\
985
+ Py_DECREF(type);\
986
+ }
987
+ #else
988
+ #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj)
989
+ #endif
990
+ #if CYTHON_COMPILING_IN_LIMITED_API
991
+ #define CYTHON_PEP393_ENABLED 1
992
+ #define __Pyx_PyUnicode_READY(op) (0)
993
+ #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u)
994
+ #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
995
+ #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U)
996
+ #define __Pyx_PyUnicode_KIND(u) ((void)u, (0))
997
+ #define __Pyx_PyUnicode_DATA(u) ((void*)u)
998
+ #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
999
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u))
1000
+ #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
1001
+ #define CYTHON_PEP393_ENABLED 1
1002
+ #if PY_VERSION_HEX >= 0x030C0000
1003
+ #define __Pyx_PyUnicode_READY(op) (0)
1004
+ #else
1005
+ #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
1006
+ 0 : _PyUnicode_Ready((PyObject *)(op)))
1007
+ #endif
1008
+ #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
1009
+ #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
1010
+ #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
1011
+ #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u))
1012
+ #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
1013
+ #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
1014
+ #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch)
1015
+ #if PY_VERSION_HEX >= 0x030C0000
1016
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
1017
+ #else
1018
+ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
1019
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
1020
+ #else
1021
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
1022
+ #endif
1023
+ #endif
1024
+ #else
1025
+ #define CYTHON_PEP393_ENABLED 0
1026
+ #define PyUnicode_1BYTE_KIND 1
1027
+ #define PyUnicode_2BYTE_KIND 2
1028
+ #define PyUnicode_4BYTE_KIND 4
1029
+ #define __Pyx_PyUnicode_READY(op) (0)
1030
+ #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
1031
+ #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
1032
+ #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U)
1033
+ #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE))
1034
+ #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
1035
+ #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
1036
+ #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch)
1037
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
1038
+ #endif
1039
+ #if CYTHON_COMPILING_IN_PYPY
1040
+ #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
1041
+ #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
1042
+ #else
1043
+ #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
1044
+ #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
1045
+ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
1046
+ #endif
1047
+ #if CYTHON_COMPILING_IN_PYPY
1048
+ #if !defined(PyUnicode_DecodeUnicodeEscape)
1049
+ #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors)
1050
+ #endif
1051
+ #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500)
1052
+ #undef PyUnicode_Contains
1053
+ #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
1054
+ #endif
1055
+ #if !defined(PyByteArray_Check)
1056
+ #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
1057
+ #endif
1058
+ #if !defined(PyObject_Format)
1059
+ #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
1060
+ #endif
1061
+ #endif
1062
+ #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
1063
+ #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
1064
+ #if PY_MAJOR_VERSION >= 3
1065
+ #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
1066
+ #else
1067
+ #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
1068
+ #endif
1069
+ #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
1070
+ #define PyObject_ASCII(o) PyObject_Repr(o)
1071
+ #endif
1072
+ #if PY_MAJOR_VERSION >= 3
1073
+ #define PyBaseString_Type PyUnicode_Type
1074
+ #define PyStringObject PyUnicodeObject
1075
+ #define PyString_Type PyUnicode_Type
1076
+ #define PyString_Check PyUnicode_Check
1077
+ #define PyString_CheckExact PyUnicode_CheckExact
1078
+ #ifndef PyObject_Unicode
1079
+ #define PyObject_Unicode PyObject_Str
1080
+ #endif
1081
+ #endif
1082
+ #if PY_MAJOR_VERSION >= 3
1083
+ #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
1084
+ #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
1085
+ #else
1086
+ #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
1087
+ #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
1088
+ #endif
1089
+ #if CYTHON_COMPILING_IN_CPYTHON
1090
+ #define __Pyx_PySequence_ListKeepNew(obj)\
1091
+ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
1092
+ #else
1093
+ #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj)
1094
+ #endif
1095
+ #ifndef PySet_CheckExact
1096
+ #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type)
1097
+ #endif
1098
+ #if PY_VERSION_HEX >= 0x030900A4
1099
+ #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
1100
+ #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
1101
+ #else
1102
+ #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
1103
+ #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
1104
+ #endif
1105
+ #if CYTHON_ASSUME_SAFE_MACROS
1106
+ #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i)
1107
+ #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
1108
+ #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0))
1109
+ #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
1110
+ #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o)
1111
+ #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o)
1112
+ #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o)
1113
+ #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
1114
+ #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
1115
+ #else
1116
+ #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i)
1117
+ #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
1118
+ #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v)
1119
+ #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
1120
+ #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o)
1121
+ #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o)
1122
+ #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o)
1123
+ #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
1124
+ #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
1125
+ #endif
1126
+ #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
1127
+ #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
1128
+ #else
1129
+ static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
1130
+ PyObject *module = PyImport_AddModule(name);
1131
+ Py_XINCREF(module);
1132
+ return module;
1133
+ }
1134
+ #endif
1135
+ #if PY_MAJOR_VERSION >= 3
1136
+ #define PyIntObject PyLongObject
1137
+ #define PyInt_Type PyLong_Type
1138
+ #define PyInt_Check(op) PyLong_Check(op)
1139
+ #define PyInt_CheckExact(op) PyLong_CheckExact(op)
1140
+ #define __Pyx_Py3Int_Check(op) PyLong_Check(op)
1141
+ #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op)
1142
+ #define PyInt_FromString PyLong_FromString
1143
+ #define PyInt_FromUnicode PyLong_FromUnicode
1144
+ #define PyInt_FromLong PyLong_FromLong
1145
+ #define PyInt_FromSize_t PyLong_FromSize_t
1146
+ #define PyInt_FromSsize_t PyLong_FromSsize_t
1147
+ #define PyInt_AsLong PyLong_AsLong
1148
+ #define PyInt_AS_LONG PyLong_AS_LONG
1149
+ #define PyInt_AsSsize_t PyLong_AsSsize_t
1150
+ #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
1151
+ #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
1152
+ #define PyNumber_Int PyNumber_Long
1153
+ #else
1154
+ #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op))
1155
+ #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op))
1156
+ #endif
1157
+ #if PY_MAJOR_VERSION >= 3
1158
+ #define PyBoolObject PyLongObject
1159
+ #endif
1160
+ #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
1161
+ #ifndef PyUnicode_InternFromString
1162
+ #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
1163
+ #endif
1164
+ #endif
1165
+ #if PY_VERSION_HEX < 0x030200A4
1166
+ typedef long Py_hash_t;
1167
+ #define __Pyx_PyInt_FromHash_t PyInt_FromLong
1168
+ #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
1169
+ #else
1170
+ #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
1171
+ #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
1172
+ #endif
1173
+ #if CYTHON_USE_ASYNC_SLOTS
1174
+ #if PY_VERSION_HEX >= 0x030500B1
1175
+ #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
1176
+ #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
1177
+ #else
1178
+ #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
1179
+ #endif
1180
+ #else
1181
+ #define __Pyx_PyType_AsAsync(obj) NULL
1182
+ #endif
1183
+ #ifndef __Pyx_PyAsyncMethodsStruct
1184
+ typedef struct {
1185
+ unaryfunc am_await;
1186
+ unaryfunc am_aiter;
1187
+ unaryfunc am_anext;
1188
+ } __Pyx_PyAsyncMethodsStruct;
1189
+ #endif
1190
+
1191
+ #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
1192
+ #if !defined(_USE_MATH_DEFINES)
1193
+ #define _USE_MATH_DEFINES
1194
+ #endif
1195
+ #endif
1196
+ #include <math.h>
1197
+ #ifdef NAN
1198
+ #define __PYX_NAN() ((float) NAN)
1199
+ #else
1200
+ static CYTHON_INLINE float __PYX_NAN() {
1201
+ float value;
1202
+ memset(&value, 0xFF, sizeof(value));
1203
+ return value;
1204
+ }
1205
+ #endif
1206
+ #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
1207
+ #define __Pyx_truncl trunc
1208
+ #else
1209
+ #define __Pyx_truncl truncl
1210
+ #endif
1211
+
1212
+ #define __PYX_MARK_ERR_POS(f_index, lineno) \
1213
+ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
1214
+ #define __PYX_ERR(f_index, lineno, Ln_error) \
1215
+ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
1216
+
1217
+ #ifdef CYTHON_EXTERN_C
1218
+ #undef __PYX_EXTERN_C
1219
+ #define __PYX_EXTERN_C CYTHON_EXTERN_C
1220
+ #elif defined(__PYX_EXTERN_C)
1221
+ #ifdef _MSC_VER
1222
+ #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.")
1223
+ #else
1224
+ #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.
1225
+ #endif
1226
+ #else
1227
+ #ifdef __cplusplus
1228
+ #define __PYX_EXTERN_C extern "C"
1229
+ #else
1230
+ #define __PYX_EXTERN_C extern
1231
+ #endif
1232
+ #endif
1233
+
1234
+ #define __PYX_HAVE__a_sync__a_sync__flags
1235
+ #define __PYX_HAVE_API__a_sync__a_sync__flags
1236
+ /* Early includes */
1237
+ #ifdef _OPENMP
1238
+ #include <omp.h>
1239
+ #endif /* _OPENMP */
1240
+
1241
+ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
1242
+ #define CYTHON_WITHOUT_ASSERTIONS
1243
+ #endif
1244
+
1245
+ typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
1246
+ const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
1247
+
1248
+ #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
1249
+ #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
1250
+ #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
1251
+ #define __PYX_DEFAULT_STRING_ENCODING ""
1252
+ #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
1253
+ #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
1254
+ #define __Pyx_uchar_cast(c) ((unsigned char)c)
1255
+ #define __Pyx_long_cast(x) ((long)x)
1256
+ #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
1257
+ (sizeof(type) < sizeof(Py_ssize_t)) ||\
1258
+ (sizeof(type) > sizeof(Py_ssize_t) &&\
1259
+ likely(v < (type)PY_SSIZE_T_MAX ||\
1260
+ v == (type)PY_SSIZE_T_MAX) &&\
1261
+ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
1262
+ v == (type)PY_SSIZE_T_MIN))) ||\
1263
+ (sizeof(type) == sizeof(Py_ssize_t) &&\
1264
+ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
1265
+ v == (type)PY_SSIZE_T_MAX))) )
1266
+ static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
1267
+ return (size_t) i < (size_t) limit;
1268
+ }
1269
+ #if defined (__cplusplus) && __cplusplus >= 201103L
1270
+ #include <cstdlib>
1271
+ #define __Pyx_sst_abs(value) std::abs(value)
1272
+ #elif SIZEOF_INT >= SIZEOF_SIZE_T
1273
+ #define __Pyx_sst_abs(value) abs(value)
1274
+ #elif SIZEOF_LONG >= SIZEOF_SIZE_T
1275
+ #define __Pyx_sst_abs(value) labs(value)
1276
+ #elif defined (_MSC_VER)
1277
+ #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
1278
+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
1279
+ #define __Pyx_sst_abs(value) llabs(value)
1280
+ #elif defined (__GNUC__)
1281
+ #define __Pyx_sst_abs(value) __builtin_llabs(value)
1282
+ #else
1283
+ #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
1284
+ #endif
1285
+ static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s);
1286
+ static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
1287
+ static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
1288
+ static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*);
1289
+ #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
1290
+ #define __Pyx_PyBytes_FromString PyBytes_FromString
1291
+ #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
1292
+ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
1293
+ #if PY_MAJOR_VERSION < 3
1294
+ #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
1295
+ #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
1296
+ #else
1297
+ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
1298
+ #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
1299
+ #endif
1300
+ #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
1301
+ #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
1302
+ #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
1303
+ #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
1304
+ #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
1305
+ #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
1306
+ #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1307
+ #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1308
+ #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1309
+ #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
1310
+ #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
1311
+ #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
1312
+ #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
1313
+ #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
1314
+ #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
1315
+ #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
1316
+ #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o)
1317
+ #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
1318
+ #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
1319
+ #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
1320
+ static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
1321
+ static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
1322
+ static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
1323
+ static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
1324
+ #define __Pyx_PySequence_Tuple(obj)\
1325
+ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
1326
+ static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
1327
+ static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
1328
+ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
1329
+ #if CYTHON_ASSUME_SAFE_MACROS
1330
+ #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
1331
+ #else
1332
+ #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
1333
+ #endif
1334
+ #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
1335
+ #if PY_MAJOR_VERSION >= 3
1336
+ #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
1337
+ #else
1338
+ #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
1339
+ #endif
1340
+ #if CYTHON_USE_PYLONG_INTERNALS
1341
+ #if PY_VERSION_HEX >= 0x030C00A7
1342
+ #ifndef _PyLong_SIGN_MASK
1343
+ #define _PyLong_SIGN_MASK 3
1344
+ #endif
1345
+ #ifndef _PyLong_NON_SIZE_BITS
1346
+ #define _PyLong_NON_SIZE_BITS 3
1347
+ #endif
1348
+ #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK)
1349
+ #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0)
1350
+ #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x))
1351
+ #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1)
1352
+ #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0)
1353
+ #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0])
1354
+ #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
1355
+ #define __Pyx_PyLong_SignedDigitCount(x)\
1356
+ ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
1357
+ #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
1358
+ #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x)
1359
+ #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x)
1360
+ #else
1361
+ #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
1362
+ #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
1363
+ #endif
1364
+ typedef Py_ssize_t __Pyx_compact_pylong;
1365
+ typedef size_t __Pyx_compact_upylong;
1366
+ #else
1367
+ #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0)
1368
+ #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0)
1369
+ #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0)
1370
+ #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0)
1371
+ #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
1372
+ #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x))
1373
+ #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x)
1374
+ #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
1375
+ #define __Pyx_PyLong_CompactValue(x)\
1376
+ ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
1377
+ typedef sdigit __Pyx_compact_pylong;
1378
+ typedef digit __Pyx_compact_upylong;
1379
+ #endif
1380
+ #if PY_VERSION_HEX >= 0x030C00A5
1381
+ #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit)
1382
+ #else
1383
+ #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit)
1384
+ #endif
1385
+ #endif
1386
+ #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1387
+ #include <string.h>
1388
+ static int __Pyx_sys_getdefaultencoding_not_ascii;
1389
+ static int __Pyx_init_sys_getdefaultencoding_params(void) {
1390
+ PyObject* sys;
1391
+ PyObject* default_encoding = NULL;
1392
+ PyObject* ascii_chars_u = NULL;
1393
+ PyObject* ascii_chars_b = NULL;
1394
+ const char* default_encoding_c;
1395
+ sys = PyImport_ImportModule("sys");
1396
+ if (!sys) goto bad;
1397
+ default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
1398
+ Py_DECREF(sys);
1399
+ if (!default_encoding) goto bad;
1400
+ default_encoding_c = PyBytes_AsString(default_encoding);
1401
+ if (!default_encoding_c) goto bad;
1402
+ if (strcmp(default_encoding_c, "ascii") == 0) {
1403
+ __Pyx_sys_getdefaultencoding_not_ascii = 0;
1404
+ } else {
1405
+ char ascii_chars[128];
1406
+ int c;
1407
+ for (c = 0; c < 128; c++) {
1408
+ ascii_chars[c] = (char) c;
1409
+ }
1410
+ __Pyx_sys_getdefaultencoding_not_ascii = 1;
1411
+ ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
1412
+ if (!ascii_chars_u) goto bad;
1413
+ ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
1414
+ if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
1415
+ PyErr_Format(
1416
+ PyExc_ValueError,
1417
+ "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
1418
+ default_encoding_c);
1419
+ goto bad;
1420
+ }
1421
+ Py_DECREF(ascii_chars_u);
1422
+ Py_DECREF(ascii_chars_b);
1423
+ }
1424
+ Py_DECREF(default_encoding);
1425
+ return 0;
1426
+ bad:
1427
+ Py_XDECREF(default_encoding);
1428
+ Py_XDECREF(ascii_chars_u);
1429
+ Py_XDECREF(ascii_chars_b);
1430
+ return -1;
1431
+ }
1432
+ #endif
1433
+ #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
1434
+ #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
1435
+ #else
1436
+ #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
1437
+ #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
1438
+ #include <string.h>
1439
+ static char* __PYX_DEFAULT_STRING_ENCODING;
1440
+ static int __Pyx_init_sys_getdefaultencoding_params(void) {
1441
+ PyObject* sys;
1442
+ PyObject* default_encoding = NULL;
1443
+ char* default_encoding_c;
1444
+ sys = PyImport_ImportModule("sys");
1445
+ if (!sys) goto bad;
1446
+ default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
1447
+ Py_DECREF(sys);
1448
+ if (!default_encoding) goto bad;
1449
+ default_encoding_c = PyBytes_AsString(default_encoding);
1450
+ if (!default_encoding_c) goto bad;
1451
+ __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
1452
+ if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
1453
+ strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
1454
+ Py_DECREF(default_encoding);
1455
+ return 0;
1456
+ bad:
1457
+ Py_XDECREF(default_encoding);
1458
+ return -1;
1459
+ }
1460
+ #endif
1461
+ #endif
1462
+
1463
+
1464
+ /* Test for GCC > 2.95 */
1465
+ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
1466
+ #define likely(x) __builtin_expect(!!(x), 1)
1467
+ #define unlikely(x) __builtin_expect(!!(x), 0)
1468
+ #else /* !__GNUC__ or GCC < 2.95 */
1469
+ #define likely(x) (x)
1470
+ #define unlikely(x) (x)
1471
+ #endif /* __GNUC__ */
1472
+ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
1473
+
1474
+ #if !CYTHON_USE_MODULE_STATE
1475
+ static PyObject *__pyx_m = NULL;
1476
+ #endif
1477
+ static int __pyx_lineno;
1478
+ static int __pyx_clineno = 0;
1479
+ static const char * __pyx_cfilenm = __FILE__;
1480
+ static const char *__pyx_filename;
1481
+
1482
+ /* #### Code section: filename_table ### */
1483
+
1484
+ static const char *__pyx_f[] = {
1485
+ "a_sync/a_sync/flags.pyx",
1486
+ };
1487
+ /* #### Code section: utility_code_proto_before_types ### */
1488
+ /* NoFastGil.proto */
1489
+ #define __Pyx_PyGILState_Ensure PyGILState_Ensure
1490
+ #define __Pyx_PyGILState_Release PyGILState_Release
1491
+ #define __Pyx_FastGIL_Remember()
1492
+ #define __Pyx_FastGIL_Forget()
1493
+ #define __Pyx_FastGilFuncInit()
1494
+
1495
+ /* #### Code section: numeric_typedefs ### */
1496
+ /* #### Code section: complex_type_declarations ### */
1497
+ /* #### Code section: type_declarations ### */
1498
+
1499
+ /*--- Type declarations ---*/
1500
+ /* #### Code section: utility_code_proto ### */
1501
+
1502
+ /* --- Runtime support code (head) --- */
1503
+ /* Refnanny.proto */
1504
+ #ifndef CYTHON_REFNANNY
1505
+ #define CYTHON_REFNANNY 0
1506
+ #endif
1507
+ #if CYTHON_REFNANNY
1508
+ typedef struct {
1509
+ void (*INCREF)(void*, PyObject*, Py_ssize_t);
1510
+ void (*DECREF)(void*, PyObject*, Py_ssize_t);
1511
+ void (*GOTREF)(void*, PyObject*, Py_ssize_t);
1512
+ void (*GIVEREF)(void*, PyObject*, Py_ssize_t);
1513
+ void* (*SetupContext)(const char*, Py_ssize_t, const char*);
1514
+ void (*FinishContext)(void**);
1515
+ } __Pyx_RefNannyAPIStruct;
1516
+ static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1517
+ static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1518
+ #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1519
+ #ifdef WITH_THREAD
1520
+ #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1521
+ if (acquire_gil) {\
1522
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1523
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
1524
+ PyGILState_Release(__pyx_gilstate_save);\
1525
+ } else {\
1526
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
1527
+ }
1528
+ #define __Pyx_RefNannyFinishContextNogil() {\
1529
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1530
+ __Pyx_RefNannyFinishContext();\
1531
+ PyGILState_Release(__pyx_gilstate_save);\
1532
+ }
1533
+ #else
1534
+ #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1535
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__))
1536
+ #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext()
1537
+ #endif
1538
+ #define __Pyx_RefNannyFinishContextNogil() {\
1539
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1540
+ __Pyx_RefNannyFinishContext();\
1541
+ PyGILState_Release(__pyx_gilstate_save);\
1542
+ }
1543
+ #define __Pyx_RefNannyFinishContext()\
1544
+ __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1545
+ #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
1546
+ #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
1547
+ #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
1548
+ #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
1549
+ #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0)
1550
+ #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0)
1551
+ #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0)
1552
+ #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0)
1553
+ #else
1554
+ #define __Pyx_RefNannyDeclarations
1555
+ #define __Pyx_RefNannySetupContext(name, acquire_gil)
1556
+ #define __Pyx_RefNannyFinishContextNogil()
1557
+ #define __Pyx_RefNannyFinishContext()
1558
+ #define __Pyx_INCREF(r) Py_INCREF(r)
1559
+ #define __Pyx_DECREF(r) Py_DECREF(r)
1560
+ #define __Pyx_GOTREF(r)
1561
+ #define __Pyx_GIVEREF(r)
1562
+ #define __Pyx_XINCREF(r) Py_XINCREF(r)
1563
+ #define __Pyx_XDECREF(r) Py_XDECREF(r)
1564
+ #define __Pyx_XGOTREF(r)
1565
+ #define __Pyx_XGIVEREF(r)
1566
+ #endif
1567
+ #define __Pyx_Py_XDECREF_SET(r, v) do {\
1568
+ PyObject *tmp = (PyObject *) r;\
1569
+ r = v; Py_XDECREF(tmp);\
1570
+ } while (0)
1571
+ #define __Pyx_XDECREF_SET(r, v) do {\
1572
+ PyObject *tmp = (PyObject *) r;\
1573
+ r = v; __Pyx_XDECREF(tmp);\
1574
+ } while (0)
1575
+ #define __Pyx_DECREF_SET(r, v) do {\
1576
+ PyObject *tmp = (PyObject *) r;\
1577
+ r = v; __Pyx_DECREF(tmp);\
1578
+ } while (0)
1579
+ #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1580
+ #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1581
+
1582
+ /* PyThreadStateGet.proto */
1583
+ #if CYTHON_FAST_THREAD_STATE
1584
+ #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1585
+ #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1586
+ #if PY_VERSION_HEX >= 0x030C00A6
1587
+ #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL)
1588
+ #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL)
1589
+ #else
1590
+ #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL)
1591
+ #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type)
1592
+ #endif
1593
+ #else
1594
+ #define __Pyx_PyThreadState_declare
1595
+ #define __Pyx_PyThreadState_assign
1596
+ #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL)
1597
+ #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred()
1598
+ #endif
1599
+
1600
+ /* PyErrFetchRestore.proto */
1601
+ #if CYTHON_FAST_THREAD_STATE
1602
+ #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1603
+ #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1604
+ #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1605
+ #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1606
+ #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1607
+ static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1608
+ static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1609
+ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6
1610
+ #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1611
+ #else
1612
+ #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1613
+ #endif
1614
+ #else
1615
+ #define __Pyx_PyErr_Clear() PyErr_Clear()
1616
+ #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1617
+ #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1618
+ #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1619
+ #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1620
+ #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1621
+ #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1622
+ #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1623
+ #endif
1624
+
1625
+ /* Profile.proto */
1626
+ #ifndef CYTHON_PROFILE
1627
+ #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
1628
+ #define CYTHON_PROFILE 0
1629
+ #else
1630
+ #define CYTHON_PROFILE 1
1631
+ #endif
1632
+ #endif
1633
+ #ifndef CYTHON_TRACE_NOGIL
1634
+ #define CYTHON_TRACE_NOGIL 0
1635
+ #else
1636
+ #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE)
1637
+ #define CYTHON_TRACE 1
1638
+ #endif
1639
+ #endif
1640
+ #ifndef CYTHON_TRACE
1641
+ #define CYTHON_TRACE 0
1642
+ #endif
1643
+ #if CYTHON_TRACE
1644
+ #undef CYTHON_PROFILE_REUSE_FRAME
1645
+ #endif
1646
+ #ifndef CYTHON_PROFILE_REUSE_FRAME
1647
+ #define CYTHON_PROFILE_REUSE_FRAME 0
1648
+ #endif
1649
+ #if CYTHON_PROFILE || CYTHON_TRACE
1650
+ #include "compile.h"
1651
+ #include "frameobject.h"
1652
+ #include "traceback.h"
1653
+ #if PY_VERSION_HEX >= 0x030b00a6 && !defined(PYPY_VERSION)
1654
+ #ifndef Py_BUILD_CORE
1655
+ #define Py_BUILD_CORE 1
1656
+ #endif
1657
+ #include "internal/pycore_frame.h"
1658
+ #endif
1659
+ #if CYTHON_PROFILE_REUSE_FRAME
1660
+ #define CYTHON_FRAME_MODIFIER static
1661
+ #define CYTHON_FRAME_DEL(frame)
1662
+ #else
1663
+ #define CYTHON_FRAME_MODIFIER
1664
+ #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame)
1665
+ #endif
1666
+ #define __Pyx_TraceDeclarations\
1667
+ static PyCodeObject *__pyx_frame_code = NULL;\
1668
+ CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\
1669
+ int __Pyx_use_tracing = 0;
1670
+ #define __Pyx_TraceFrameInit(codeobj)\
1671
+ if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj;
1672
+ #if PY_VERSION_HEX >= 0x030b00a2
1673
+ #if PY_VERSION_HEX >= 0x030C00b1
1674
+ #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1675
+ ((!(check_tracing) || !(tstate)->tracing) &&\
1676
+ (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1677
+ #else
1678
+ #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1679
+ (unlikely((tstate)->cframe->use_tracing) &&\
1680
+ (!(check_tracing) || !(tstate)->tracing) &&\
1681
+ (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1682
+ #endif
1683
+ #define __Pyx_EnterTracing(tstate) PyThreadState_EnterTracing(tstate)
1684
+ #define __Pyx_LeaveTracing(tstate) PyThreadState_LeaveTracing(tstate)
1685
+ #elif PY_VERSION_HEX >= 0x030a00b1
1686
+ #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1687
+ (unlikely((tstate)->cframe->use_tracing) &&\
1688
+ (!(check_tracing) || !(tstate)->tracing) &&\
1689
+ (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1690
+ #define __Pyx_EnterTracing(tstate)\
1691
+ do { tstate->tracing++; tstate->cframe->use_tracing = 0; } while (0)
1692
+ #define __Pyx_LeaveTracing(tstate)\
1693
+ do {\
1694
+ tstate->tracing--;\
1695
+ tstate->cframe->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\
1696
+ || tstate->c_profilefunc != NULL);\
1697
+ } while (0)
1698
+ #else
1699
+ #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1700
+ (unlikely((tstate)->use_tracing) &&\
1701
+ (!(check_tracing) || !(tstate)->tracing) &&\
1702
+ (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1703
+ #define __Pyx_EnterTracing(tstate)\
1704
+ do { tstate->tracing++; tstate->use_tracing = 0; } while (0)
1705
+ #define __Pyx_LeaveTracing(tstate)\
1706
+ do {\
1707
+ tstate->tracing--;\
1708
+ tstate->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\
1709
+ || tstate->c_profilefunc != NULL);\
1710
+ } while (0)
1711
+ #endif
1712
+ #ifdef WITH_THREAD
1713
+ #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1714
+ if (nogil) {\
1715
+ if (CYTHON_TRACE_NOGIL) {\
1716
+ PyThreadState *tstate;\
1717
+ PyGILState_STATE state = PyGILState_Ensure();\
1718
+ tstate = __Pyx_PyThreadState_Current;\
1719
+ if (__Pyx_IsTracing(tstate, 1, 1)) {\
1720
+ __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1721
+ }\
1722
+ PyGILState_Release(state);\
1723
+ if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1724
+ }\
1725
+ } else {\
1726
+ PyThreadState* tstate = PyThreadState_GET();\
1727
+ if (__Pyx_IsTracing(tstate, 1, 1)) {\
1728
+ __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1729
+ if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1730
+ }\
1731
+ }
1732
+ #else
1733
+ #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1734
+ { PyThreadState* tstate = PyThreadState_GET();\
1735
+ if (__Pyx_IsTracing(tstate, 1, 1)) {\
1736
+ __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1737
+ if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1738
+ }\
1739
+ }
1740
+ #endif
1741
+ #define __Pyx_TraceException()\
1742
+ if (likely(!__Pyx_use_tracing)); else {\
1743
+ PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1744
+ if (__Pyx_IsTracing(tstate, 0, 1)) {\
1745
+ __Pyx_EnterTracing(tstate);\
1746
+ PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\
1747
+ if (exc_info) {\
1748
+ if (CYTHON_TRACE && tstate->c_tracefunc)\
1749
+ tstate->c_tracefunc(\
1750
+ tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1751
+ tstate->c_profilefunc(\
1752
+ tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1753
+ Py_DECREF(exc_info);\
1754
+ }\
1755
+ __Pyx_LeaveTracing(tstate);\
1756
+ }\
1757
+ }
1758
+ static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) {
1759
+ PyObject *type, *value, *traceback;
1760
+ __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
1761
+ __Pyx_EnterTracing(tstate);
1762
+ if (CYTHON_TRACE && tstate->c_tracefunc)
1763
+ tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result);
1764
+ if (tstate->c_profilefunc)
1765
+ tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result);
1766
+ CYTHON_FRAME_DEL(frame);
1767
+ __Pyx_LeaveTracing(tstate);
1768
+ __Pyx_ErrRestoreInState(tstate, type, value, traceback);
1769
+ }
1770
+ #ifdef WITH_THREAD
1771
+ #define __Pyx_TraceReturn(result, nogil)\
1772
+ if (likely(!__Pyx_use_tracing)); else {\
1773
+ if (nogil) {\
1774
+ if (CYTHON_TRACE_NOGIL) {\
1775
+ PyThreadState *tstate;\
1776
+ PyGILState_STATE state = PyGILState_Ensure();\
1777
+ tstate = __Pyx_PyThreadState_Current;\
1778
+ if (__Pyx_IsTracing(tstate, 0, 0)) {\
1779
+ __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1780
+ }\
1781
+ PyGILState_Release(state);\
1782
+ }\
1783
+ } else {\
1784
+ PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1785
+ if (__Pyx_IsTracing(tstate, 0, 0)) {\
1786
+ __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1787
+ }\
1788
+ }\
1789
+ }
1790
+ #else
1791
+ #define __Pyx_TraceReturn(result, nogil)\
1792
+ if (likely(!__Pyx_use_tracing)); else {\
1793
+ PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1794
+ if (__Pyx_IsTracing(tstate, 0, 0)) {\
1795
+ __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1796
+ }\
1797
+ }
1798
+ #endif
1799
+ static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno);
1800
+ static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate, const char *funcname, const char *srcfile, int firstlineno);
1801
+ #else
1802
+ #define __Pyx_TraceDeclarations
1803
+ #define __Pyx_TraceFrameInit(codeobj)
1804
+ #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error;
1805
+ #define __Pyx_TraceException()
1806
+ #define __Pyx_TraceReturn(result, nogil)
1807
+ #endif
1808
+ #if CYTHON_TRACE
1809
+ static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame, int lineno) {
1810
+ int ret;
1811
+ PyObject *type, *value, *traceback;
1812
+ __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
1813
+ __Pyx_PyFrame_SetLineNumber(frame, lineno);
1814
+ __Pyx_EnterTracing(tstate);
1815
+ ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL);
1816
+ __Pyx_LeaveTracing(tstate);
1817
+ if (likely(!ret)) {
1818
+ __Pyx_ErrRestoreInState(tstate, type, value, traceback);
1819
+ } else {
1820
+ Py_XDECREF(type);
1821
+ Py_XDECREF(value);
1822
+ Py_XDECREF(traceback);
1823
+ }
1824
+ return ret;
1825
+ }
1826
+ #ifdef WITH_THREAD
1827
+ #define __Pyx_TraceLine(lineno, nogil, goto_error)\
1828
+ if (likely(!__Pyx_use_tracing)); else {\
1829
+ if (nogil) {\
1830
+ if (CYTHON_TRACE_NOGIL) {\
1831
+ int ret = 0;\
1832
+ PyThreadState *tstate;\
1833
+ PyGILState_STATE state = __Pyx_PyGILState_Ensure();\
1834
+ tstate = __Pyx_PyThreadState_Current;\
1835
+ if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1836
+ ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1837
+ }\
1838
+ __Pyx_PyGILState_Release(state);\
1839
+ if (unlikely(ret)) goto_error;\
1840
+ }\
1841
+ } else {\
1842
+ PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1843
+ if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1844
+ int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1845
+ if (unlikely(ret)) goto_error;\
1846
+ }\
1847
+ }\
1848
+ }
1849
+ #else
1850
+ #define __Pyx_TraceLine(lineno, nogil, goto_error)\
1851
+ if (likely(!__Pyx_use_tracing)); else {\
1852
+ PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1853
+ if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1854
+ int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1855
+ if (unlikely(ret)) goto_error;\
1856
+ }\
1857
+ }
1858
+ #endif
1859
+ #else
1860
+ #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error;
1861
+ #endif
1862
+
1863
+ /* PyDictVersioning.proto */
1864
+ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1865
+ #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1866
+ #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1867
+ #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1868
+ (version_var) = __PYX_GET_DICT_VERSION(dict);\
1869
+ (cache_var) = (value);
1870
+ #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1871
+ static PY_UINT64_T __pyx_dict_version = 0;\
1872
+ static PyObject *__pyx_dict_cached_value = NULL;\
1873
+ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1874
+ (VAR) = __pyx_dict_cached_value;\
1875
+ } else {\
1876
+ (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1877
+ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1878
+ }\
1879
+ }
1880
+ static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1881
+ static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1882
+ static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1883
+ #else
1884
+ #define __PYX_GET_DICT_VERSION(dict) (0)
1885
+ #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1886
+ #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1887
+ #endif
1888
+
1889
+ /* PyErrExceptionMatches.proto */
1890
+ #if CYTHON_FAST_THREAD_STATE
1891
+ #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1892
+ static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1893
+ #else
1894
+ #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1895
+ #endif
1896
+
1897
+ /* PyObjectGetAttrStr.proto */
1898
+ #if CYTHON_USE_TYPE_SLOTS
1899
+ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1900
+ #else
1901
+ #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1902
+ #endif
1903
+
1904
+ /* PyObjectGetAttrStrNoError.proto */
1905
+ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
1906
+
1907
+ /* CLineInTraceback.proto */
1908
+ #ifdef CYTHON_CLINE_IN_TRACEBACK
1909
+ #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1910
+ #else
1911
+ static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1912
+ #endif
1913
+
1914
+ /* CodeObjectCache.proto */
1915
+ #if !CYTHON_COMPILING_IN_LIMITED_API
1916
+ typedef struct {
1917
+ PyCodeObject* code_object;
1918
+ int code_line;
1919
+ } __Pyx_CodeObjectCacheEntry;
1920
+ struct __Pyx_CodeObjectCache {
1921
+ int count;
1922
+ int max_count;
1923
+ __Pyx_CodeObjectCacheEntry* entries;
1924
+ };
1925
+ static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1926
+ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
1927
+ static PyCodeObject *__pyx_find_code_object(int code_line);
1928
+ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
1929
+ #endif
1930
+
1931
+ /* AddTraceback.proto */
1932
+ static void __Pyx_AddTraceback(const char *funcname, int c_line,
1933
+ int py_line, const char *filename);
1934
+
1935
+ /* FormatTypeName.proto */
1936
+ #if CYTHON_COMPILING_IN_LIMITED_API
1937
+ typedef PyObject *__Pyx_TypeName;
1938
+ #define __Pyx_FMT_TYPENAME "%U"
1939
+ static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp);
1940
+ #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
1941
+ #else
1942
+ typedef const char *__Pyx_TypeName;
1943
+ #define __Pyx_FMT_TYPENAME "%.200s"
1944
+ #define __Pyx_PyType_GetName(tp) ((tp)->tp_name)
1945
+ #define __Pyx_DECREF_TypeName(obj)
1946
+ #endif
1947
+
1948
+ /* GCCDiagnostics.proto */
1949
+ #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
1950
+ #define __Pyx_HAS_GCC_DIAGNOSTIC
1951
+ #endif
1952
+
1953
+ /* CIntToPy.proto */
1954
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
1955
+
1956
+ /* CIntFromPy.proto */
1957
+ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
1958
+
1959
+ /* CIntFromPy.proto */
1960
+ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
1961
+
1962
+ /* FastTypeChecks.proto */
1963
+ #if CYTHON_COMPILING_IN_CPYTHON
1964
+ #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1965
+ #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2)
1966
+ static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1967
+ static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b);
1968
+ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1969
+ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1970
+ #else
1971
+ #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1972
+ #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2))
1973
+ #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1974
+ #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1975
+ #endif
1976
+ #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
1977
+ #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1978
+
1979
+ /* CheckBinaryVersion.proto */
1980
+ static unsigned long __Pyx_get_runtime_version(void);
1981
+ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer);
1982
+
1983
+ /* PyObjectSetAttrStr.proto */
1984
+ #if CYTHON_USE_TYPE_SLOTS
1985
+ #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
1986
+ static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
1987
+ #else
1988
+ #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
1989
+ #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
1990
+ #endif
1991
+
1992
+ /* VoidPtrExport.proto */
1993
+ static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig);
1994
+
1995
+ /* InitStrings.proto */
1996
+ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1997
+
1998
+ /* #### Code section: module_declarations ### */
1999
+
2000
+ /* Module declarations from "a_sync.a_sync.flags" */
2001
+ __PYX_EXTERN_C DL_EXPORT(PyObject) *AFFIRMATIVE_FLAGS;
2002
+ __PYX_EXTERN_C DL_EXPORT(PyObject) *NEGATIVE_FLAGS;
2003
+ __PYX_EXTERN_C DL_EXPORT(PyObject) *VIABLE_FLAGS;
2004
+ /* #### Code section: typeinfo ### */
2005
+ /* #### Code section: before_global_var ### */
2006
+ #define __Pyx_MODULE_NAME "a_sync.a_sync.flags"
2007
+ extern int __pyx_module_is_main_a_sync__a_sync__flags;
2008
+ int __pyx_module_is_main_a_sync__a_sync__flags = 0;
2009
+
2010
+ /* Implementation of "a_sync.a_sync.flags" */
2011
+ /* #### Code section: global_var ### */
2012
+ /* #### Code section: string_decls ### */
2013
+ static const char __pyx_k_[] = "?";
2014
+ static const char __pyx_k_main[] = "__main__";
2015
+ static const char __pyx_k_name[] = "__name__";
2016
+ static const char __pyx_k_sync[] = "sync";
2017
+ static const char __pyx_k_test[] = "__test__";
2018
+ static const char __pyx_k_pyx_capi[] = "__pyx_capi__";
2019
+ static const char __pyx_k_VIABLE_FLAGS[] = "VIABLE_FLAGS";
2020
+ static const char __pyx_k_asynchronous[] = "asynchronous";
2021
+ static const char __pyx_k_NEGATIVE_FLAGS[] = "NEGATIVE_FLAGS";
2022
+ static const char __pyx_k_AFFIRMATIVE_FLAGS[] = "AFFIRMATIVE_FLAGS";
2023
+ static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2024
+ static const char __pyx_k_This_module_provides_functional[] = "\nThis module provides functionality for handling synchronous and asynchronous flags\nin the ez-a-sync library.\n\nez-a-sync uses 'flags' to indicate whether objects or function calls will be synchronous or asynchronous.\n\nYou can use any of the provided flags, whichever makes the most sense for your use case.\n\n:obj:`AFFIRMATIVE_FLAGS`: Set of flags indicating synchronous behavior. Currently includes \"sync\".\n\n:obj:`NEGATIVE_FLAGS`: Set of flags indicating asynchronous behavior. Currently includes \"asynchronous\".\n\n:obj:`VIABLE_FLAGS`: Set of all valid flags, combining both synchronous and asynchronous indicators.\n";
2025
+ /* #### Code section: decls ### */
2026
+ /* #### Code section: late_includes ### */
2027
+ /* #### Code section: module_state ### */
2028
+ typedef struct {
2029
+ PyObject *__pyx_d;
2030
+ PyObject *__pyx_b;
2031
+ PyObject *__pyx_cython_runtime;
2032
+ PyObject *__pyx_empty_tuple;
2033
+ PyObject *__pyx_empty_bytes;
2034
+ PyObject *__pyx_empty_unicode;
2035
+ #ifdef __Pyx_CyFunction_USED
2036
+ PyTypeObject *__pyx_CyFunctionType;
2037
+ #endif
2038
+ #ifdef __Pyx_FusedFunction_USED
2039
+ PyTypeObject *__pyx_FusedFunctionType;
2040
+ #endif
2041
+ #ifdef __Pyx_Generator_USED
2042
+ PyTypeObject *__pyx_GeneratorType;
2043
+ #endif
2044
+ #ifdef __Pyx_IterableCoroutine_USED
2045
+ PyTypeObject *__pyx_IterableCoroutineType;
2046
+ #endif
2047
+ #ifdef __Pyx_Coroutine_USED
2048
+ PyTypeObject *__pyx_CoroutineAwaitType;
2049
+ #endif
2050
+ #ifdef __Pyx_Coroutine_USED
2051
+ PyTypeObject *__pyx_CoroutineType;
2052
+ #endif
2053
+ #if CYTHON_USE_MODULE_STATE
2054
+ #endif
2055
+ PyObject *__pyx_n_s_;
2056
+ PyObject *__pyx_n_s_AFFIRMATIVE_FLAGS;
2057
+ PyObject *__pyx_n_s_NEGATIVE_FLAGS;
2058
+ PyObject *__pyx_n_s_VIABLE_FLAGS;
2059
+ PyObject *__pyx_n_u_asynchronous;
2060
+ PyObject *__pyx_n_s_cline_in_traceback;
2061
+ PyObject *__pyx_n_s_main;
2062
+ PyObject *__pyx_n_s_name;
2063
+ PyObject *__pyx_n_s_pyx_capi;
2064
+ PyObject *__pyx_n_u_sync;
2065
+ PyObject *__pyx_n_s_test;
2066
+ } __pyx_mstate;
2067
+
2068
+ #if CYTHON_USE_MODULE_STATE
2069
+ #ifdef __cplusplus
2070
+ namespace {
2071
+ extern struct PyModuleDef __pyx_moduledef;
2072
+ } /* anonymous namespace */
2073
+ #else
2074
+ static struct PyModuleDef __pyx_moduledef;
2075
+ #endif
2076
+
2077
+ #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o))
2078
+
2079
+ #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef)))
2080
+
2081
+ #define __pyx_m (PyState_FindModule(&__pyx_moduledef))
2082
+ #else
2083
+ static __pyx_mstate __pyx_mstate_global_static =
2084
+ #ifdef __cplusplus
2085
+ {};
2086
+ #else
2087
+ {0};
2088
+ #endif
2089
+ static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static;
2090
+ #endif
2091
+ /* #### Code section: module_state_clear ### */
2092
+ #if CYTHON_USE_MODULE_STATE
2093
+ static int __pyx_m_clear(PyObject *m) {
2094
+ __pyx_mstate *clear_module_state = __pyx_mstate(m);
2095
+ if (!clear_module_state) return 0;
2096
+ Py_CLEAR(clear_module_state->__pyx_d);
2097
+ Py_CLEAR(clear_module_state->__pyx_b);
2098
+ Py_CLEAR(clear_module_state->__pyx_cython_runtime);
2099
+ Py_CLEAR(clear_module_state->__pyx_empty_tuple);
2100
+ Py_CLEAR(clear_module_state->__pyx_empty_bytes);
2101
+ Py_CLEAR(clear_module_state->__pyx_empty_unicode);
2102
+ #ifdef __Pyx_CyFunction_USED
2103
+ Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
2104
+ #endif
2105
+ #ifdef __Pyx_FusedFunction_USED
2106
+ Py_CLEAR(clear_module_state->__pyx_FusedFunctionType);
2107
+ #endif
2108
+ Py_CLEAR(clear_module_state->__pyx_n_s_);
2109
+ Py_CLEAR(clear_module_state->__pyx_n_s_AFFIRMATIVE_FLAGS);
2110
+ Py_CLEAR(clear_module_state->__pyx_n_s_NEGATIVE_FLAGS);
2111
+ Py_CLEAR(clear_module_state->__pyx_n_s_VIABLE_FLAGS);
2112
+ Py_CLEAR(clear_module_state->__pyx_n_u_asynchronous);
2113
+ Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback);
2114
+ Py_CLEAR(clear_module_state->__pyx_n_s_main);
2115
+ Py_CLEAR(clear_module_state->__pyx_n_s_name);
2116
+ Py_CLEAR(clear_module_state->__pyx_n_s_pyx_capi);
2117
+ Py_CLEAR(clear_module_state->__pyx_n_u_sync);
2118
+ Py_CLEAR(clear_module_state->__pyx_n_s_test);
2119
+ return 0;
2120
+ }
2121
+ #endif
2122
+ /* #### Code section: module_state_traverse ### */
2123
+ #if CYTHON_USE_MODULE_STATE
2124
+ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
2125
+ __pyx_mstate *traverse_module_state = __pyx_mstate(m);
2126
+ if (!traverse_module_state) return 0;
2127
+ Py_VISIT(traverse_module_state->__pyx_d);
2128
+ Py_VISIT(traverse_module_state->__pyx_b);
2129
+ Py_VISIT(traverse_module_state->__pyx_cython_runtime);
2130
+ Py_VISIT(traverse_module_state->__pyx_empty_tuple);
2131
+ Py_VISIT(traverse_module_state->__pyx_empty_bytes);
2132
+ Py_VISIT(traverse_module_state->__pyx_empty_unicode);
2133
+ #ifdef __Pyx_CyFunction_USED
2134
+ Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
2135
+ #endif
2136
+ #ifdef __Pyx_FusedFunction_USED
2137
+ Py_VISIT(traverse_module_state->__pyx_FusedFunctionType);
2138
+ #endif
2139
+ Py_VISIT(traverse_module_state->__pyx_n_s_);
2140
+ Py_VISIT(traverse_module_state->__pyx_n_s_AFFIRMATIVE_FLAGS);
2141
+ Py_VISIT(traverse_module_state->__pyx_n_s_NEGATIVE_FLAGS);
2142
+ Py_VISIT(traverse_module_state->__pyx_n_s_VIABLE_FLAGS);
2143
+ Py_VISIT(traverse_module_state->__pyx_n_u_asynchronous);
2144
+ Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback);
2145
+ Py_VISIT(traverse_module_state->__pyx_n_s_main);
2146
+ Py_VISIT(traverse_module_state->__pyx_n_s_name);
2147
+ Py_VISIT(traverse_module_state->__pyx_n_s_pyx_capi);
2148
+ Py_VISIT(traverse_module_state->__pyx_n_u_sync);
2149
+ Py_VISIT(traverse_module_state->__pyx_n_s_test);
2150
+ return 0;
2151
+ }
2152
+ #endif
2153
+ /* #### Code section: module_state_defines ### */
2154
+ #define __pyx_d __pyx_mstate_global->__pyx_d
2155
+ #define __pyx_b __pyx_mstate_global->__pyx_b
2156
+ #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime
2157
+ #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple
2158
+ #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes
2159
+ #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode
2160
+ #ifdef __Pyx_CyFunction_USED
2161
+ #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType
2162
+ #endif
2163
+ #ifdef __Pyx_FusedFunction_USED
2164
+ #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType
2165
+ #endif
2166
+ #ifdef __Pyx_Generator_USED
2167
+ #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType
2168
+ #endif
2169
+ #ifdef __Pyx_IterableCoroutine_USED
2170
+ #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType
2171
+ #endif
2172
+ #ifdef __Pyx_Coroutine_USED
2173
+ #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType
2174
+ #endif
2175
+ #ifdef __Pyx_Coroutine_USED
2176
+ #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType
2177
+ #endif
2178
+ #if CYTHON_USE_MODULE_STATE
2179
+ #endif
2180
+ #define __pyx_n_s_ __pyx_mstate_global->__pyx_n_s_
2181
+ #define __pyx_n_s_AFFIRMATIVE_FLAGS __pyx_mstate_global->__pyx_n_s_AFFIRMATIVE_FLAGS
2182
+ #define __pyx_n_s_NEGATIVE_FLAGS __pyx_mstate_global->__pyx_n_s_NEGATIVE_FLAGS
2183
+ #define __pyx_n_s_VIABLE_FLAGS __pyx_mstate_global->__pyx_n_s_VIABLE_FLAGS
2184
+ #define __pyx_n_u_asynchronous __pyx_mstate_global->__pyx_n_u_asynchronous
2185
+ #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback
2186
+ #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main
2187
+ #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name
2188
+ #define __pyx_n_s_pyx_capi __pyx_mstate_global->__pyx_n_s_pyx_capi
2189
+ #define __pyx_n_u_sync __pyx_mstate_global->__pyx_n_u_sync
2190
+ #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test
2191
+ /* #### Code section: module_code ### */
2192
+ PyObject *AFFIRMATIVE_FLAGS = 0;
2193
+ PyObject *NEGATIVE_FLAGS = 0;
2194
+ PyObject *VIABLE_FLAGS = 0;
2195
+
2196
+ static PyMethodDef __pyx_methods[] = {
2197
+ {0, 0, 0, 0}
2198
+ };
2199
+ #ifndef CYTHON_SMALL_CODE
2200
+ #if defined(__clang__)
2201
+ #define CYTHON_SMALL_CODE
2202
+ #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
2203
+ #define CYTHON_SMALL_CODE __attribute__((cold))
2204
+ #else
2205
+ #define CYTHON_SMALL_CODE
2206
+ #endif
2207
+ #endif
2208
+ /* #### Code section: pystring_table ### */
2209
+
2210
+ static int __Pyx_CreateStringTabAndInitStrings(void) {
2211
+ __Pyx_StringTabEntry __pyx_string_tab[] = {
2212
+ {&__pyx_n_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 1},
2213
+ {&__pyx_n_s_AFFIRMATIVE_FLAGS, __pyx_k_AFFIRMATIVE_FLAGS, sizeof(__pyx_k_AFFIRMATIVE_FLAGS), 0, 0, 1, 1},
2214
+ {&__pyx_n_s_NEGATIVE_FLAGS, __pyx_k_NEGATIVE_FLAGS, sizeof(__pyx_k_NEGATIVE_FLAGS), 0, 0, 1, 1},
2215
+ {&__pyx_n_s_VIABLE_FLAGS, __pyx_k_VIABLE_FLAGS, sizeof(__pyx_k_VIABLE_FLAGS), 0, 0, 1, 1},
2216
+ {&__pyx_n_u_asynchronous, __pyx_k_asynchronous, sizeof(__pyx_k_asynchronous), 0, 1, 0, 1},
2217
+ {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
2218
+ {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
2219
+ {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
2220
+ {&__pyx_n_s_pyx_capi, __pyx_k_pyx_capi, sizeof(__pyx_k_pyx_capi), 0, 0, 1, 1},
2221
+ {&__pyx_n_u_sync, __pyx_k_sync, sizeof(__pyx_k_sync), 0, 1, 0, 1},
2222
+ {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
2223
+ {0, 0, 0, 0, 0, 0, 0}
2224
+ };
2225
+ return __Pyx_InitStrings(__pyx_string_tab);
2226
+ }
2227
+ /* #### Code section: cached_builtins ### */
2228
+ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
2229
+ return 0;
2230
+ }
2231
+ /* #### Code section: cached_constants ### */
2232
+
2233
+ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
2234
+ __Pyx_RefNannyDeclarations
2235
+ __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
2236
+ __Pyx_RefNannyFinishContext();
2237
+ return 0;
2238
+ }
2239
+ /* #### Code section: init_constants ### */
2240
+
2241
+ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) {
2242
+ if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error);
2243
+ return 0;
2244
+ __pyx_L1_error:;
2245
+ return -1;
2246
+ }
2247
+ /* #### Code section: init_globals ### */
2248
+
2249
+ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
2250
+ return 0;
2251
+ }
2252
+ /* #### Code section: init_module ### */
2253
+
2254
+ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
2255
+ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
2256
+ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
2257
+ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
2258
+ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
2259
+ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
2260
+ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
2261
+
2262
+ static int __Pyx_modinit_global_init_code(void) {
2263
+ __Pyx_RefNannyDeclarations
2264
+ __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
2265
+ /*--- Global init code ---*/
2266
+ AFFIRMATIVE_FLAGS = ((PyObject*)Py_None); Py_INCREF(Py_None);
2267
+ NEGATIVE_FLAGS = ((PyObject*)Py_None); Py_INCREF(Py_None);
2268
+ VIABLE_FLAGS = ((PyObject*)Py_None); Py_INCREF(Py_None);
2269
+ __Pyx_RefNannyFinishContext();
2270
+ return 0;
2271
+ }
2272
+
2273
+ static int __Pyx_modinit_variable_export_code(void) {
2274
+ __Pyx_RefNannyDeclarations
2275
+ int __pyx_lineno = 0;
2276
+ const char *__pyx_filename = NULL;
2277
+ int __pyx_clineno = 0;
2278
+ __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
2279
+ /*--- Variable export code ---*/
2280
+ if (__Pyx_ExportVoidPtr(__pyx_n_s_AFFIRMATIVE_FLAGS, (void *)&AFFIRMATIVE_FLAGS, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
2281
+ if (__Pyx_ExportVoidPtr(__pyx_n_s_NEGATIVE_FLAGS, (void *)&NEGATIVE_FLAGS, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
2282
+ if (__Pyx_ExportVoidPtr(__pyx_n_s_VIABLE_FLAGS, (void *)&VIABLE_FLAGS, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
2283
+ __Pyx_RefNannyFinishContext();
2284
+ return 0;
2285
+ __pyx_L1_error:;
2286
+ __Pyx_RefNannyFinishContext();
2287
+ return -1;
2288
+ }
2289
+
2290
+ static int __Pyx_modinit_function_export_code(void) {
2291
+ __Pyx_RefNannyDeclarations
2292
+ __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
2293
+ /*--- Function export code ---*/
2294
+ __Pyx_RefNannyFinishContext();
2295
+ return 0;
2296
+ }
2297
+
2298
+ static int __Pyx_modinit_type_init_code(void) {
2299
+ __Pyx_RefNannyDeclarations
2300
+ __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
2301
+ /*--- Type init code ---*/
2302
+ __Pyx_RefNannyFinishContext();
2303
+ return 0;
2304
+ }
2305
+
2306
+ static int __Pyx_modinit_type_import_code(void) {
2307
+ __Pyx_RefNannyDeclarations
2308
+ __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
2309
+ /*--- Type import code ---*/
2310
+ __Pyx_RefNannyFinishContext();
2311
+ return 0;
2312
+ }
2313
+
2314
+ static int __Pyx_modinit_variable_import_code(void) {
2315
+ __Pyx_RefNannyDeclarations
2316
+ __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
2317
+ /*--- Variable import code ---*/
2318
+ __Pyx_RefNannyFinishContext();
2319
+ return 0;
2320
+ }
2321
+
2322
+ static int __Pyx_modinit_function_import_code(void) {
2323
+ __Pyx_RefNannyDeclarations
2324
+ __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
2325
+ /*--- Function import code ---*/
2326
+ __Pyx_RefNannyFinishContext();
2327
+ return 0;
2328
+ }
2329
+
2330
+
2331
+ #if PY_MAJOR_VERSION >= 3
2332
+ #if CYTHON_PEP489_MULTI_PHASE_INIT
2333
+ static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
2334
+ static int __pyx_pymod_exec_flags(PyObject* module); /*proto*/
2335
+ static PyModuleDef_Slot __pyx_moduledef_slots[] = {
2336
+ {Py_mod_create, (void*)__pyx_pymod_create},
2337
+ {Py_mod_exec, (void*)__pyx_pymod_exec_flags},
2338
+ {0, NULL}
2339
+ };
2340
+ #endif
2341
+
2342
+ #ifdef __cplusplus
2343
+ namespace {
2344
+ struct PyModuleDef __pyx_moduledef =
2345
+ #else
2346
+ static struct PyModuleDef __pyx_moduledef =
2347
+ #endif
2348
+ {
2349
+ PyModuleDef_HEAD_INIT,
2350
+ "flags",
2351
+ __pyx_k_This_module_provides_functional, /* m_doc */
2352
+ #if CYTHON_PEP489_MULTI_PHASE_INIT
2353
+ 0, /* m_size */
2354
+ #elif CYTHON_USE_MODULE_STATE
2355
+ sizeof(__pyx_mstate), /* m_size */
2356
+ #else
2357
+ -1, /* m_size */
2358
+ #endif
2359
+ __pyx_methods /* m_methods */,
2360
+ #if CYTHON_PEP489_MULTI_PHASE_INIT
2361
+ __pyx_moduledef_slots, /* m_slots */
2362
+ #else
2363
+ NULL, /* m_reload */
2364
+ #endif
2365
+ #if CYTHON_USE_MODULE_STATE
2366
+ __pyx_m_traverse, /* m_traverse */
2367
+ __pyx_m_clear, /* m_clear */
2368
+ NULL /* m_free */
2369
+ #else
2370
+ NULL, /* m_traverse */
2371
+ NULL, /* m_clear */
2372
+ NULL /* m_free */
2373
+ #endif
2374
+ };
2375
+ #ifdef __cplusplus
2376
+ } /* anonymous namespace */
2377
+ #endif
2378
+ #endif
2379
+
2380
+ #ifndef CYTHON_NO_PYINIT_EXPORT
2381
+ #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
2382
+ #elif PY_MAJOR_VERSION < 3
2383
+ #ifdef __cplusplus
2384
+ #define __Pyx_PyMODINIT_FUNC extern "C" void
2385
+ #else
2386
+ #define __Pyx_PyMODINIT_FUNC void
2387
+ #endif
2388
+ #else
2389
+ #ifdef __cplusplus
2390
+ #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
2391
+ #else
2392
+ #define __Pyx_PyMODINIT_FUNC PyObject *
2393
+ #endif
2394
+ #endif
2395
+
2396
+
2397
+ #if PY_MAJOR_VERSION < 3
2398
+ __Pyx_PyMODINIT_FUNC initflags(void) CYTHON_SMALL_CODE; /*proto*/
2399
+ __Pyx_PyMODINIT_FUNC initflags(void)
2400
+ #else
2401
+ __Pyx_PyMODINIT_FUNC PyInit_flags(void) CYTHON_SMALL_CODE; /*proto*/
2402
+ __Pyx_PyMODINIT_FUNC PyInit_flags(void)
2403
+ #if CYTHON_PEP489_MULTI_PHASE_INIT
2404
+ {
2405
+ return PyModuleDef_Init(&__pyx_moduledef);
2406
+ }
2407
+ static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
2408
+ #if PY_VERSION_HEX >= 0x030700A1
2409
+ static PY_INT64_T main_interpreter_id = -1;
2410
+ PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
2411
+ if (main_interpreter_id == -1) {
2412
+ main_interpreter_id = current_id;
2413
+ return (unlikely(current_id == -1)) ? -1 : 0;
2414
+ } else if (unlikely(main_interpreter_id != current_id))
2415
+ #else
2416
+ static PyInterpreterState *main_interpreter = NULL;
2417
+ PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
2418
+ if (!main_interpreter) {
2419
+ main_interpreter = current_interpreter;
2420
+ } else if (unlikely(main_interpreter != current_interpreter))
2421
+ #endif
2422
+ {
2423
+ PyErr_SetString(
2424
+ PyExc_ImportError,
2425
+ "Interpreter change detected - this module can only be loaded into one interpreter per process.");
2426
+ return -1;
2427
+ }
2428
+ return 0;
2429
+ }
2430
+ #if CYTHON_COMPILING_IN_LIMITED_API
2431
+ static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none)
2432
+ #else
2433
+ static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none)
2434
+ #endif
2435
+ {
2436
+ PyObject *value = PyObject_GetAttrString(spec, from_name);
2437
+ int result = 0;
2438
+ if (likely(value)) {
2439
+ if (allow_none || value != Py_None) {
2440
+ #if CYTHON_COMPILING_IN_LIMITED_API
2441
+ result = PyModule_AddObject(module, to_name, value);
2442
+ #else
2443
+ result = PyDict_SetItemString(moddict, to_name, value);
2444
+ #endif
2445
+ }
2446
+ Py_DECREF(value);
2447
+ } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
2448
+ PyErr_Clear();
2449
+ } else {
2450
+ result = -1;
2451
+ }
2452
+ return result;
2453
+ }
2454
+ static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) {
2455
+ PyObject *module = NULL, *moddict, *modname;
2456
+ CYTHON_UNUSED_VAR(def);
2457
+ if (__Pyx_check_single_interpreter())
2458
+ return NULL;
2459
+ if (__pyx_m)
2460
+ return __Pyx_NewRef(__pyx_m);
2461
+ modname = PyObject_GetAttrString(spec, "name");
2462
+ if (unlikely(!modname)) goto bad;
2463
+ module = PyModule_NewObject(modname);
2464
+ Py_DECREF(modname);
2465
+ if (unlikely(!module)) goto bad;
2466
+ #if CYTHON_COMPILING_IN_LIMITED_API
2467
+ moddict = module;
2468
+ #else
2469
+ moddict = PyModule_GetDict(module);
2470
+ if (unlikely(!moddict)) goto bad;
2471
+ #endif
2472
+ if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
2473
+ if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
2474
+ if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
2475
+ if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
2476
+ return module;
2477
+ bad:
2478
+ Py_XDECREF(module);
2479
+ return NULL;
2480
+ }
2481
+
2482
+
2483
+ static CYTHON_SMALL_CODE int __pyx_pymod_exec_flags(PyObject *__pyx_pyinit_module)
2484
+ #endif
2485
+ #endif
2486
+ {
2487
+ int stringtab_initialized = 0;
2488
+ #if CYTHON_USE_MODULE_STATE
2489
+ int pystate_addmodule_run = 0;
2490
+ #endif
2491
+ __Pyx_TraceDeclarations
2492
+ PyObject *__pyx_t_1 = NULL;
2493
+ PyObject *__pyx_t_2 = NULL;
2494
+ int __pyx_lineno = 0;
2495
+ const char *__pyx_filename = NULL;
2496
+ int __pyx_clineno = 0;
2497
+ __Pyx_RefNannyDeclarations
2498
+ #if CYTHON_PEP489_MULTI_PHASE_INIT
2499
+ if (__pyx_m) {
2500
+ if (__pyx_m == __pyx_pyinit_module) return 0;
2501
+ PyErr_SetString(PyExc_RuntimeError, "Module 'flags' has already been imported. Re-initialisation is not supported.");
2502
+ return -1;
2503
+ }
2504
+ #elif PY_MAJOR_VERSION >= 3
2505
+ if (__pyx_m) return __Pyx_NewRef(__pyx_m);
2506
+ #endif
2507
+ /*--- Module creation code ---*/
2508
+ #if CYTHON_PEP489_MULTI_PHASE_INIT
2509
+ __pyx_m = __pyx_pyinit_module;
2510
+ Py_INCREF(__pyx_m);
2511
+ #else
2512
+ #if PY_MAJOR_VERSION < 3
2513
+ __pyx_m = Py_InitModule4("flags", __pyx_methods, __pyx_k_This_module_provides_functional, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
2514
+ if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
2515
+ #elif CYTHON_USE_MODULE_STATE
2516
+ __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
2517
+ {
2518
+ int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef);
2519
+ __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "flags" pseudovariable */
2520
+ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
2521
+ pystate_addmodule_run = 1;
2522
+ }
2523
+ #else
2524
+ __pyx_m = PyModule_Create(&__pyx_moduledef);
2525
+ if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
2526
+ #endif
2527
+ #endif
2528
+ CYTHON_UNUSED_VAR(__pyx_t_1);
2529
+ __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
2530
+ Py_INCREF(__pyx_d);
2531
+ __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
2532
+ __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
2533
+ if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
2534
+ #if CYTHON_REFNANNY
2535
+ __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
2536
+ if (!__Pyx_RefNanny) {
2537
+ PyErr_Clear();
2538
+ __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
2539
+ if (!__Pyx_RefNanny)
2540
+ Py_FatalError("failed to import 'refnanny' module");
2541
+ }
2542
+ #endif
2543
+ __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_flags(void)", 0);
2544
+ if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
2545
+ #ifdef __Pxy_PyFrame_Initialize_Offsets
2546
+ __Pxy_PyFrame_Initialize_Offsets();
2547
+ #endif
2548
+ __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
2549
+ __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
2550
+ __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
2551
+ #ifdef __Pyx_CyFunction_USED
2552
+ if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
2553
+ #endif
2554
+ #ifdef __Pyx_FusedFunction_USED
2555
+ if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
2556
+ #endif
2557
+ #ifdef __Pyx_Coroutine_USED
2558
+ if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
2559
+ #endif
2560
+ #ifdef __Pyx_Generator_USED
2561
+ if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
2562
+ #endif
2563
+ #ifdef __Pyx_AsyncGen_USED
2564
+ if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
2565
+ #endif
2566
+ #ifdef __Pyx_StopAsyncIteration_USED
2567
+ if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
2568
+ #endif
2569
+ /*--- Library function declarations ---*/
2570
+ /*--- Threads initialization code ---*/
2571
+ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
2572
+ PyEval_InitThreads();
2573
+ #endif
2574
+ /*--- Initialize various global constants etc. ---*/
2575
+ if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
2576
+ stringtab_initialized = 1;
2577
+ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
2578
+ #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
2579
+ if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
2580
+ #endif
2581
+ if (__pyx_module_is_main_a_sync__a_sync__flags) {
2582
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
2583
+ }
2584
+ #if PY_MAJOR_VERSION >= 3
2585
+ {
2586
+ PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
2587
+ if (!PyDict_GetItemString(modules, "a_sync.a_sync.flags")) {
2588
+ if (unlikely((PyDict_SetItemString(modules, "a_sync.a_sync.flags", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
2589
+ }
2590
+ }
2591
+ #endif
2592
+ /*--- Builtin init code ---*/
2593
+ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
2594
+ /*--- Constants init code ---*/
2595
+ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
2596
+ /*--- Global type/function init code ---*/
2597
+ (void)__Pyx_modinit_global_init_code();
2598
+ if (unlikely((__Pyx_modinit_variable_export_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
2599
+ (void)__Pyx_modinit_function_export_code();
2600
+ (void)__Pyx_modinit_type_init_code();
2601
+ (void)__Pyx_modinit_type_import_code();
2602
+ (void)__Pyx_modinit_variable_import_code();
2603
+ (void)__Pyx_modinit_function_import_code();
2604
+ /*--- Execution code ---*/
2605
+ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
2606
+ if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
2607
+ #endif
2608
+ __Pyx_TraceCall("__Pyx_PyMODINIT_FUNC PyInit_flags(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error));
2609
+
2610
+ /* "a_sync/a_sync/flags.pyx":16
2611
+ * """
2612
+ *
2613
+ * cdef public set[str] AFFIRMATIVE_FLAGS = {"sync"} # <<<<<<<<<<<<<<
2614
+ * """Set of flags indicating synchronous behavior.
2615
+ *
2616
+ */
2617
+ __Pyx_TraceLine(16,0,__PYX_ERR(0, 16, __pyx_L1_error))
2618
+ __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error)
2619
+ __Pyx_GOTREF(__pyx_t_2);
2620
+ if (PySet_Add(__pyx_t_2, __pyx_n_u_sync) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
2621
+ __Pyx_XGOTREF(AFFIRMATIVE_FLAGS);
2622
+ __Pyx_DECREF_SET(AFFIRMATIVE_FLAGS, ((PyObject*)__pyx_t_2));
2623
+ __Pyx_GIVEREF(__pyx_t_2);
2624
+ __pyx_t_2 = 0;
2625
+
2626
+ /* "a_sync/a_sync/flags.pyx":34
2627
+ * """
2628
+ *
2629
+ * cdef public set[str] NEGATIVE_FLAGS = {"asynchronous"} # <<<<<<<<<<<<<<
2630
+ * """Set of flags indicating asynchronous behavior.
2631
+ *
2632
+ */
2633
+ __Pyx_TraceLine(34,0,__PYX_ERR(0, 34, __pyx_L1_error))
2634
+ __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error)
2635
+ __Pyx_GOTREF(__pyx_t_2);
2636
+ if (PySet_Add(__pyx_t_2, __pyx_n_u_asynchronous) < 0) __PYX_ERR(0, 34, __pyx_L1_error)
2637
+ __Pyx_XGOTREF(NEGATIVE_FLAGS);
2638
+ __Pyx_DECREF_SET(NEGATIVE_FLAGS, ((PyObject*)__pyx_t_2));
2639
+ __Pyx_GIVEREF(__pyx_t_2);
2640
+ __pyx_t_2 = 0;
2641
+
2642
+ /* "a_sync/a_sync/flags.pyx":52
2643
+ * """
2644
+ *
2645
+ * cdef public set[str] VIABLE_FLAGS = AFFIRMATIVE_FLAGS | NEGATIVE_FLAGS # <<<<<<<<<<<<<<
2646
+ * """Set of all valid flags, combining both synchronous and asynchronous indicators.
2647
+ *
2648
+ */
2649
+ __Pyx_TraceLine(52,0,__PYX_ERR(0, 52, __pyx_L1_error))
2650
+ __pyx_t_2 = PyNumber_Or(AFFIRMATIVE_FLAGS, NEGATIVE_FLAGS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error)
2651
+ __Pyx_GOTREF(__pyx_t_2);
2652
+ __Pyx_XGOTREF(VIABLE_FLAGS);
2653
+ __Pyx_DECREF_SET(VIABLE_FLAGS, ((PyObject*)__pyx_t_2));
2654
+ __Pyx_GIVEREF(__pyx_t_2);
2655
+ __pyx_t_2 = 0;
2656
+
2657
+ /* "a_sync/a_sync/flags.pyx":1
2658
+ * """ # <<<<<<<<<<<<<<
2659
+ * This module provides functionality for handling synchronous and asynchronous flags
2660
+ * in the ez-a-sync library.
2661
+ */
2662
+ __Pyx_TraceLine(1,0,__PYX_ERR(0, 1, __pyx_L1_error))
2663
+ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
2664
+ __Pyx_GOTREF(__pyx_t_2);
2665
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
2666
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2667
+ __Pyx_TraceReturn(Py_None, 0);
2668
+
2669
+ /*--- Wrapped vars code ---*/
2670
+
2671
+ goto __pyx_L0;
2672
+ __pyx_L1_error:;
2673
+ __Pyx_XDECREF(__pyx_t_2);
2674
+ if (__pyx_m) {
2675
+ if (__pyx_d && stringtab_initialized) {
2676
+ __Pyx_AddTraceback("init a_sync.a_sync.flags", __pyx_clineno, __pyx_lineno, __pyx_filename);
2677
+ }
2678
+ #if !CYTHON_USE_MODULE_STATE
2679
+ Py_CLEAR(__pyx_m);
2680
+ #else
2681
+ Py_DECREF(__pyx_m);
2682
+ if (pystate_addmodule_run) {
2683
+ PyObject *tp, *value, *tb;
2684
+ PyErr_Fetch(&tp, &value, &tb);
2685
+ PyState_RemoveModule(&__pyx_moduledef);
2686
+ PyErr_Restore(tp, value, tb);
2687
+ }
2688
+ #endif
2689
+ } else if (!PyErr_Occurred()) {
2690
+ PyErr_SetString(PyExc_ImportError, "init a_sync.a_sync.flags");
2691
+ }
2692
+ __pyx_L0:;
2693
+ __Pyx_RefNannyFinishContext();
2694
+ #if CYTHON_PEP489_MULTI_PHASE_INIT
2695
+ return (__pyx_m != NULL) ? 0 : -1;
2696
+ #elif PY_MAJOR_VERSION >= 3
2697
+ return __pyx_m;
2698
+ #else
2699
+ return;
2700
+ #endif
2701
+ }
2702
+ /* #### Code section: cleanup_globals ### */
2703
+ /* #### Code section: cleanup_module ### */
2704
+ /* #### Code section: main_method ### */
2705
+ /* #### Code section: utility_code_pragmas ### */
2706
+ #ifdef _MSC_VER
2707
+ #pragma warning( push )
2708
+ /* Warning 4127: conditional expression is constant
2709
+ * Cython uses constant conditional expressions to allow in inline functions to be optimized at
2710
+ * compile-time, so this warning is not useful
2711
+ */
2712
+ #pragma warning( disable : 4127 )
2713
+ #endif
2714
+
2715
+
2716
+
2717
+ /* #### Code section: utility_code_def ### */
2718
+
2719
+ /* --- Runtime support code --- */
2720
+ /* Refnanny */
2721
+ #if CYTHON_REFNANNY
2722
+ static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
2723
+ PyObject *m = NULL, *p = NULL;
2724
+ void *r = NULL;
2725
+ m = PyImport_ImportModule(modname);
2726
+ if (!m) goto end;
2727
+ p = PyObject_GetAttrString(m, "RefNannyAPI");
2728
+ if (!p) goto end;
2729
+ r = PyLong_AsVoidPtr(p);
2730
+ end:
2731
+ Py_XDECREF(p);
2732
+ Py_XDECREF(m);
2733
+ return (__Pyx_RefNannyAPIStruct *)r;
2734
+ }
2735
+ #endif
2736
+
2737
+ /* PyErrFetchRestore */
2738
+ #if CYTHON_FAST_THREAD_STATE
2739
+ static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
2740
+ #if PY_VERSION_HEX >= 0x030C00A6
2741
+ PyObject *tmp_value;
2742
+ assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
2743
+ if (value) {
2744
+ #if CYTHON_COMPILING_IN_CPYTHON
2745
+ if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
2746
+ #endif
2747
+ PyException_SetTraceback(value, tb);
2748
+ }
2749
+ tmp_value = tstate->current_exception;
2750
+ tstate->current_exception = value;
2751
+ Py_XDECREF(tmp_value);
2752
+ Py_XDECREF(type);
2753
+ Py_XDECREF(tb);
2754
+ #else
2755
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
2756
+ tmp_type = tstate->curexc_type;
2757
+ tmp_value = tstate->curexc_value;
2758
+ tmp_tb = tstate->curexc_traceback;
2759
+ tstate->curexc_type = type;
2760
+ tstate->curexc_value = value;
2761
+ tstate->curexc_traceback = tb;
2762
+ Py_XDECREF(tmp_type);
2763
+ Py_XDECREF(tmp_value);
2764
+ Py_XDECREF(tmp_tb);
2765
+ #endif
2766
+ }
2767
+ static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
2768
+ #if PY_VERSION_HEX >= 0x030C00A6
2769
+ PyObject* exc_value;
2770
+ exc_value = tstate->current_exception;
2771
+ tstate->current_exception = 0;
2772
+ *value = exc_value;
2773
+ *type = NULL;
2774
+ *tb = NULL;
2775
+ if (exc_value) {
2776
+ *type = (PyObject*) Py_TYPE(exc_value);
2777
+ Py_INCREF(*type);
2778
+ #if CYTHON_COMPILING_IN_CPYTHON
2779
+ *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
2780
+ Py_XINCREF(*tb);
2781
+ #else
2782
+ *tb = PyException_GetTraceback(exc_value);
2783
+ #endif
2784
+ }
2785
+ #else
2786
+ *type = tstate->curexc_type;
2787
+ *value = tstate->curexc_value;
2788
+ *tb = tstate->curexc_traceback;
2789
+ tstate->curexc_type = 0;
2790
+ tstate->curexc_value = 0;
2791
+ tstate->curexc_traceback = 0;
2792
+ #endif
2793
+ }
2794
+ #endif
2795
+
2796
+ /* Profile */
2797
+ #if CYTHON_PROFILE
2798
+ static int __Pyx_TraceSetupAndCall(PyCodeObject** code,
2799
+ PyFrameObject** frame,
2800
+ PyThreadState* tstate,
2801
+ const char *funcname,
2802
+ const char *srcfile,
2803
+ int firstlineno) {
2804
+ PyObject *type, *value, *traceback;
2805
+ int retval;
2806
+ if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) {
2807
+ if (*code == NULL) {
2808
+ *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno);
2809
+ if (*code == NULL) return 0;
2810
+ }
2811
+ *frame = PyFrame_New(
2812
+ tstate, /*PyThreadState *tstate*/
2813
+ *code, /*PyCodeObject *code*/
2814
+ __pyx_d, /*PyObject *globals*/
2815
+ 0 /*PyObject *locals*/
2816
+ );
2817
+ if (*frame == NULL) return 0;
2818
+ if (CYTHON_TRACE && (*frame)->f_trace == NULL) {
2819
+ Py_INCREF(Py_None);
2820
+ (*frame)->f_trace = Py_None;
2821
+ }
2822
+ #if PY_VERSION_HEX < 0x030400B1
2823
+ } else {
2824
+ (*frame)->f_tstate = tstate;
2825
+ #endif
2826
+ }
2827
+ __Pyx_PyFrame_SetLineNumber(*frame, firstlineno);
2828
+ retval = 1;
2829
+ __Pyx_EnterTracing(tstate);
2830
+ __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
2831
+ #if CYTHON_TRACE
2832
+ if (tstate->c_tracefunc)
2833
+ retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0;
2834
+ if (retval && tstate->c_profilefunc)
2835
+ #endif
2836
+ retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0;
2837
+ __Pyx_LeaveTracing(tstate);
2838
+ if (retval) {
2839
+ __Pyx_ErrRestoreInState(tstate, type, value, traceback);
2840
+ return __Pyx_IsTracing(tstate, 0, 0) && retval;
2841
+ } else {
2842
+ Py_XDECREF(type);
2843
+ Py_XDECREF(value);
2844
+ Py_XDECREF(traceback);
2845
+ return -1;
2846
+ }
2847
+ }
2848
+ static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) {
2849
+ PyCodeObject *py_code = 0;
2850
+ #if PY_MAJOR_VERSION >= 3
2851
+ py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno);
2852
+ if (likely(py_code)) {
2853
+ py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS;
2854
+ }
2855
+ #else
2856
+ PyObject *py_srcfile = 0;
2857
+ PyObject *py_funcname = 0;
2858
+ py_funcname = PyString_FromString(funcname);
2859
+ if (unlikely(!py_funcname)) goto bad;
2860
+ py_srcfile = PyString_FromString(srcfile);
2861
+ if (unlikely(!py_srcfile)) goto bad;
2862
+ py_code = PyCode_New(
2863
+ 0,
2864
+ 0,
2865
+ 0,
2866
+ CO_OPTIMIZED | CO_NEWLOCALS,
2867
+ __pyx_empty_bytes, /*PyObject *code,*/
2868
+ __pyx_empty_tuple, /*PyObject *consts,*/
2869
+ __pyx_empty_tuple, /*PyObject *names,*/
2870
+ __pyx_empty_tuple, /*PyObject *varnames,*/
2871
+ __pyx_empty_tuple, /*PyObject *freevars,*/
2872
+ __pyx_empty_tuple, /*PyObject *cellvars,*/
2873
+ py_srcfile, /*PyObject *filename,*/
2874
+ py_funcname, /*PyObject *name,*/
2875
+ firstlineno,
2876
+ __pyx_empty_bytes /*PyObject *lnotab*/
2877
+ );
2878
+ bad:
2879
+ Py_XDECREF(py_srcfile);
2880
+ Py_XDECREF(py_funcname);
2881
+ #endif
2882
+ return py_code;
2883
+ }
2884
+ #endif
2885
+
2886
+ /* PyDictVersioning */
2887
+ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
2888
+ static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
2889
+ PyObject *dict = Py_TYPE(obj)->tp_dict;
2890
+ return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
2891
+ }
2892
+ static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
2893
+ PyObject **dictptr = NULL;
2894
+ Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
2895
+ if (offset) {
2896
+ #if CYTHON_COMPILING_IN_CPYTHON
2897
+ dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
2898
+ #else
2899
+ dictptr = _PyObject_GetDictPtr(obj);
2900
+ #endif
2901
+ }
2902
+ return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
2903
+ }
2904
+ static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
2905
+ PyObject *dict = Py_TYPE(obj)->tp_dict;
2906
+ if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
2907
+ return 0;
2908
+ return obj_dict_version == __Pyx_get_object_dict_version(obj);
2909
+ }
2910
+ #endif
2911
+
2912
+ /* PyErrExceptionMatches */
2913
+ #if CYTHON_FAST_THREAD_STATE
2914
+ static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
2915
+ Py_ssize_t i, n;
2916
+ n = PyTuple_GET_SIZE(tuple);
2917
+ #if PY_MAJOR_VERSION >= 3
2918
+ for (i=0; i<n; i++) {
2919
+ if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
2920
+ }
2921
+ #endif
2922
+ for (i=0; i<n; i++) {
2923
+ if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
2924
+ }
2925
+ return 0;
2926
+ }
2927
+ static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
2928
+ int result;
2929
+ PyObject *exc_type;
2930
+ #if PY_VERSION_HEX >= 0x030C00A6
2931
+ PyObject *current_exception = tstate->current_exception;
2932
+ if (unlikely(!current_exception)) return 0;
2933
+ exc_type = (PyObject*) Py_TYPE(current_exception);
2934
+ if (exc_type == err) return 1;
2935
+ #else
2936
+ exc_type = tstate->curexc_type;
2937
+ if (exc_type == err) return 1;
2938
+ if (unlikely(!exc_type)) return 0;
2939
+ #endif
2940
+ #if CYTHON_AVOID_BORROWED_REFS
2941
+ Py_INCREF(exc_type);
2942
+ #endif
2943
+ if (unlikely(PyTuple_Check(err))) {
2944
+ result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
2945
+ } else {
2946
+ result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
2947
+ }
2948
+ #if CYTHON_AVOID_BORROWED_REFS
2949
+ Py_DECREF(exc_type);
2950
+ #endif
2951
+ return result;
2952
+ }
2953
+ #endif
2954
+
2955
+ /* PyObjectGetAttrStr */
2956
+ #if CYTHON_USE_TYPE_SLOTS
2957
+ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
2958
+ PyTypeObject* tp = Py_TYPE(obj);
2959
+ if (likely(tp->tp_getattro))
2960
+ return tp->tp_getattro(obj, attr_name);
2961
+ #if PY_MAJOR_VERSION < 3
2962
+ if (likely(tp->tp_getattr))
2963
+ return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
2964
+ #endif
2965
+ return PyObject_GetAttr(obj, attr_name);
2966
+ }
2967
+ #endif
2968
+
2969
+ /* PyObjectGetAttrStrNoError */
2970
+ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1
2971
+ static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
2972
+ __Pyx_PyThreadState_declare
2973
+ __Pyx_PyThreadState_assign
2974
+ if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
2975
+ __Pyx_PyErr_Clear();
2976
+ }
2977
+ #endif
2978
+ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
2979
+ PyObject *result;
2980
+ #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
2981
+ (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
2982
+ return result;
2983
+ #else
2984
+ #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
2985
+ PyTypeObject* tp = Py_TYPE(obj);
2986
+ if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
2987
+ return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
2988
+ }
2989
+ #endif
2990
+ result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
2991
+ if (unlikely(!result)) {
2992
+ __Pyx_PyObject_GetAttrStr_ClearAttributeError();
2993
+ }
2994
+ return result;
2995
+ #endif
2996
+ }
2997
+
2998
+ /* CLineInTraceback */
2999
+ #ifndef CYTHON_CLINE_IN_TRACEBACK
3000
+ static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
3001
+ PyObject *use_cline;
3002
+ PyObject *ptype, *pvalue, *ptraceback;
3003
+ #if CYTHON_COMPILING_IN_CPYTHON
3004
+ PyObject **cython_runtime_dict;
3005
+ #endif
3006
+ CYTHON_MAYBE_UNUSED_VAR(tstate);
3007
+ if (unlikely(!__pyx_cython_runtime)) {
3008
+ return c_line;
3009
+ }
3010
+ __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
3011
+ #if CYTHON_COMPILING_IN_CPYTHON
3012
+ cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
3013
+ if (likely(cython_runtime_dict)) {
3014
+ __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
3015
+ use_cline, *cython_runtime_dict,
3016
+ __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
3017
+ } else
3018
+ #endif
3019
+ {
3020
+ PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
3021
+ if (use_cline_obj) {
3022
+ use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
3023
+ Py_DECREF(use_cline_obj);
3024
+ } else {
3025
+ PyErr_Clear();
3026
+ use_cline = NULL;
3027
+ }
3028
+ }
3029
+ if (!use_cline) {
3030
+ c_line = 0;
3031
+ (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
3032
+ }
3033
+ else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
3034
+ c_line = 0;
3035
+ }
3036
+ __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
3037
+ return c_line;
3038
+ }
3039
+ #endif
3040
+
3041
+ /* CodeObjectCache */
3042
+ #if !CYTHON_COMPILING_IN_LIMITED_API
3043
+ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
3044
+ int start = 0, mid = 0, end = count - 1;
3045
+ if (end >= 0 && code_line > entries[end].code_line) {
3046
+ return count;
3047
+ }
3048
+ while (start < end) {
3049
+ mid = start + (end - start) / 2;
3050
+ if (code_line < entries[mid].code_line) {
3051
+ end = mid;
3052
+ } else if (code_line > entries[mid].code_line) {
3053
+ start = mid + 1;
3054
+ } else {
3055
+ return mid;
3056
+ }
3057
+ }
3058
+ if (code_line <= entries[mid].code_line) {
3059
+ return mid;
3060
+ } else {
3061
+ return mid + 1;
3062
+ }
3063
+ }
3064
+ static PyCodeObject *__pyx_find_code_object(int code_line) {
3065
+ PyCodeObject* code_object;
3066
+ int pos;
3067
+ if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
3068
+ return NULL;
3069
+ }
3070
+ pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
3071
+ if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
3072
+ return NULL;
3073
+ }
3074
+ code_object = __pyx_code_cache.entries[pos].code_object;
3075
+ Py_INCREF(code_object);
3076
+ return code_object;
3077
+ }
3078
+ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
3079
+ int pos, i;
3080
+ __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
3081
+ if (unlikely(!code_line)) {
3082
+ return;
3083
+ }
3084
+ if (unlikely(!entries)) {
3085
+ entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
3086
+ if (likely(entries)) {
3087
+ __pyx_code_cache.entries = entries;
3088
+ __pyx_code_cache.max_count = 64;
3089
+ __pyx_code_cache.count = 1;
3090
+ entries[0].code_line = code_line;
3091
+ entries[0].code_object = code_object;
3092
+ Py_INCREF(code_object);
3093
+ }
3094
+ return;
3095
+ }
3096
+ pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
3097
+ if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
3098
+ PyCodeObject* tmp = entries[pos].code_object;
3099
+ entries[pos].code_object = code_object;
3100
+ Py_DECREF(tmp);
3101
+ return;
3102
+ }
3103
+ if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
3104
+ int new_max = __pyx_code_cache.max_count + 64;
3105
+ entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
3106
+ __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
3107
+ if (unlikely(!entries)) {
3108
+ return;
3109
+ }
3110
+ __pyx_code_cache.entries = entries;
3111
+ __pyx_code_cache.max_count = new_max;
3112
+ }
3113
+ for (i=__pyx_code_cache.count; i>pos; i--) {
3114
+ entries[i] = entries[i-1];
3115
+ }
3116
+ entries[pos].code_line = code_line;
3117
+ entries[pos].code_object = code_object;
3118
+ __pyx_code_cache.count++;
3119
+ Py_INCREF(code_object);
3120
+ }
3121
+ #endif
3122
+
3123
+ /* AddTraceback */
3124
+ #include "compile.h"
3125
+ #include "frameobject.h"
3126
+ #include "traceback.h"
3127
+ #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION)
3128
+ #ifndef Py_BUILD_CORE
3129
+ #define Py_BUILD_CORE 1
3130
+ #endif
3131
+ #include "internal/pycore_frame.h"
3132
+ #endif
3133
+ #if CYTHON_COMPILING_IN_LIMITED_API
3134
+ static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
3135
+ PyObject *firstlineno, PyObject *name) {
3136
+ PyObject *replace = NULL;
3137
+ if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL;
3138
+ if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL;
3139
+ replace = PyObject_GetAttrString(code, "replace");
3140
+ if (likely(replace)) {
3141
+ PyObject *result;
3142
+ result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict);
3143
+ Py_DECREF(replace);
3144
+ return result;
3145
+ }
3146
+ PyErr_Clear();
3147
+ #if __PYX_LIMITED_VERSION_HEX < 0x030780000
3148
+ {
3149
+ PyObject *compiled = NULL, *result = NULL;
3150
+ if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL;
3151
+ if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL;
3152
+ compiled = Py_CompileString(
3153
+ "out = type(code)(\n"
3154
+ " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n"
3155
+ " code.co_flags, code.co_code, code.co_consts, code.co_names,\n"
3156
+ " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n"
3157
+ " code.co_lnotab)\n", "<dummy>", Py_file_input);
3158
+ if (!compiled) return NULL;
3159
+ result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict);
3160
+ Py_DECREF(compiled);
3161
+ if (!result) PyErr_Print();
3162
+ Py_DECREF(result);
3163
+ result = PyDict_GetItemString(scratch_dict, "out");
3164
+ if (result) Py_INCREF(result);
3165
+ return result;
3166
+ }
3167
+ #else
3168
+ return NULL;
3169
+ #endif
3170
+ }
3171
+ static void __Pyx_AddTraceback(const char *funcname, int c_line,
3172
+ int py_line, const char *filename) {
3173
+ PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
3174
+ PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
3175
+ PyObject *exc_type, *exc_value, *exc_traceback;
3176
+ int success = 0;
3177
+ if (c_line) {
3178
+ (void) __pyx_cfilenm;
3179
+ (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
3180
+ }
3181
+ PyErr_Fetch(&exc_type, &exc_value, &exc_traceback);
3182
+ code_object = Py_CompileString("_getframe()", filename, Py_eval_input);
3183
+ if (unlikely(!code_object)) goto bad;
3184
+ py_py_line = PyLong_FromLong(py_line);
3185
+ if (unlikely(!py_py_line)) goto bad;
3186
+ py_funcname = PyUnicode_FromString(funcname);
3187
+ if (unlikely(!py_funcname)) goto bad;
3188
+ dict = PyDict_New();
3189
+ if (unlikely(!dict)) goto bad;
3190
+ {
3191
+ PyObject *old_code_object = code_object;
3192
+ code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
3193
+ Py_DECREF(old_code_object);
3194
+ }
3195
+ if (unlikely(!code_object)) goto bad;
3196
+ getframe = PySys_GetObject("_getframe");
3197
+ if (unlikely(!getframe)) goto bad;
3198
+ if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad;
3199
+ frame = PyEval_EvalCode(code_object, dict, dict);
3200
+ if (unlikely(!frame) || frame == Py_None) goto bad;
3201
+ success = 1;
3202
+ bad:
3203
+ PyErr_Restore(exc_type, exc_value, exc_traceback);
3204
+ Py_XDECREF(code_object);
3205
+ Py_XDECREF(py_py_line);
3206
+ Py_XDECREF(py_funcname);
3207
+ Py_XDECREF(dict);
3208
+ Py_XDECREF(replace);
3209
+ if (success) {
3210
+ PyTraceBack_Here(
3211
+ (struct _frame*)frame);
3212
+ }
3213
+ Py_XDECREF(frame);
3214
+ }
3215
+ #else
3216
+ static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
3217
+ const char *funcname, int c_line,
3218
+ int py_line, const char *filename) {
3219
+ PyCodeObject *py_code = NULL;
3220
+ PyObject *py_funcname = NULL;
3221
+ #if PY_MAJOR_VERSION < 3
3222
+ PyObject *py_srcfile = NULL;
3223
+ py_srcfile = PyString_FromString(filename);
3224
+ if (!py_srcfile) goto bad;
3225
+ #endif
3226
+ if (c_line) {
3227
+ #if PY_MAJOR_VERSION < 3
3228
+ py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
3229
+ if (!py_funcname) goto bad;
3230
+ #else
3231
+ py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
3232
+ if (!py_funcname) goto bad;
3233
+ funcname = PyUnicode_AsUTF8(py_funcname);
3234
+ if (!funcname) goto bad;
3235
+ #endif
3236
+ }
3237
+ else {
3238
+ #if PY_MAJOR_VERSION < 3
3239
+ py_funcname = PyString_FromString(funcname);
3240
+ if (!py_funcname) goto bad;
3241
+ #endif
3242
+ }
3243
+ #if PY_MAJOR_VERSION < 3
3244
+ py_code = __Pyx_PyCode_New(
3245
+ 0,
3246
+ 0,
3247
+ 0,
3248
+ 0,
3249
+ 0,
3250
+ 0,
3251
+ __pyx_empty_bytes, /*PyObject *code,*/
3252
+ __pyx_empty_tuple, /*PyObject *consts,*/
3253
+ __pyx_empty_tuple, /*PyObject *names,*/
3254
+ __pyx_empty_tuple, /*PyObject *varnames,*/
3255
+ __pyx_empty_tuple, /*PyObject *freevars,*/
3256
+ __pyx_empty_tuple, /*PyObject *cellvars,*/
3257
+ py_srcfile, /*PyObject *filename,*/
3258
+ py_funcname, /*PyObject *name,*/
3259
+ py_line,
3260
+ __pyx_empty_bytes /*PyObject *lnotab*/
3261
+ );
3262
+ Py_DECREF(py_srcfile);
3263
+ #else
3264
+ py_code = PyCode_NewEmpty(filename, funcname, py_line);
3265
+ #endif
3266
+ Py_XDECREF(py_funcname);
3267
+ return py_code;
3268
+ bad:
3269
+ Py_XDECREF(py_funcname);
3270
+ #if PY_MAJOR_VERSION < 3
3271
+ Py_XDECREF(py_srcfile);
3272
+ #endif
3273
+ return NULL;
3274
+ }
3275
+ static void __Pyx_AddTraceback(const char *funcname, int c_line,
3276
+ int py_line, const char *filename) {
3277
+ PyCodeObject *py_code = 0;
3278
+ PyFrameObject *py_frame = 0;
3279
+ PyThreadState *tstate = __Pyx_PyThreadState_Current;
3280
+ PyObject *ptype, *pvalue, *ptraceback;
3281
+ if (c_line) {
3282
+ c_line = __Pyx_CLineForTraceback(tstate, c_line);
3283
+ }
3284
+ py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
3285
+ if (!py_code) {
3286
+ __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
3287
+ py_code = __Pyx_CreateCodeObjectForTraceback(
3288
+ funcname, c_line, py_line, filename);
3289
+ if (!py_code) {
3290
+ /* If the code object creation fails, then we should clear the
3291
+ fetched exception references and propagate the new exception */
3292
+ Py_XDECREF(ptype);
3293
+ Py_XDECREF(pvalue);
3294
+ Py_XDECREF(ptraceback);
3295
+ goto bad;
3296
+ }
3297
+ __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
3298
+ __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
3299
+ }
3300
+ py_frame = PyFrame_New(
3301
+ tstate, /*PyThreadState *tstate,*/
3302
+ py_code, /*PyCodeObject *code,*/
3303
+ __pyx_d, /*PyObject *globals,*/
3304
+ 0 /*PyObject *locals*/
3305
+ );
3306
+ if (!py_frame) goto bad;
3307
+ __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
3308
+ PyTraceBack_Here(py_frame);
3309
+ bad:
3310
+ Py_XDECREF(py_code);
3311
+ Py_XDECREF(py_frame);
3312
+ }
3313
+ #endif
3314
+
3315
+ /* FormatTypeName */
3316
+ #if CYTHON_COMPILING_IN_LIMITED_API
3317
+ static __Pyx_TypeName
3318
+ __Pyx_PyType_GetName(PyTypeObject* tp)
3319
+ {
3320
+ PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
3321
+ __pyx_n_s_name);
3322
+ if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) {
3323
+ PyErr_Clear();
3324
+ Py_XDECREF(name);
3325
+ name = __Pyx_NewRef(__pyx_n_s_);
3326
+ }
3327
+ return name;
3328
+ }
3329
+ #endif
3330
+
3331
+ /* CIntToPy */
3332
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
3333
+ #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
3334
+ #pragma GCC diagnostic push
3335
+ #pragma GCC diagnostic ignored "-Wconversion"
3336
+ #endif
3337
+ const long neg_one = (long) -1, const_zero = (long) 0;
3338
+ #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
3339
+ #pragma GCC diagnostic pop
3340
+ #endif
3341
+ const int is_unsigned = neg_one > const_zero;
3342
+ if (is_unsigned) {
3343
+ if (sizeof(long) < sizeof(long)) {
3344
+ return PyInt_FromLong((long) value);
3345
+ } else if (sizeof(long) <= sizeof(unsigned long)) {
3346
+ return PyLong_FromUnsignedLong((unsigned long) value);
3347
+ #ifdef HAVE_LONG_LONG
3348
+ } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
3349
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
3350
+ #endif
3351
+ }
3352
+ } else {
3353
+ if (sizeof(long) <= sizeof(long)) {
3354
+ return PyInt_FromLong((long) value);
3355
+ #ifdef HAVE_LONG_LONG
3356
+ } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
3357
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
3358
+ #endif
3359
+ }
3360
+ }
3361
+ {
3362
+ unsigned char *bytes = (unsigned char *)&value;
3363
+ #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
3364
+ if (is_unsigned) {
3365
+ return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
3366
+ } else {
3367
+ return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
3368
+ }
3369
+ #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
3370
+ int one = 1; int little = (int)*(unsigned char *)&one;
3371
+ return _PyLong_FromByteArray(bytes, sizeof(long),
3372
+ little, !is_unsigned);
3373
+ #else
3374
+ int one = 1; int little = (int)*(unsigned char *)&one;
3375
+ PyObject *from_bytes, *result = NULL;
3376
+ PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
3377
+ from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
3378
+ if (!from_bytes) return NULL;
3379
+ py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long));
3380
+ if (!py_bytes) goto limited_bad;
3381
+ order_str = PyUnicode_FromString(little ? "little" : "big");
3382
+ if (!order_str) goto limited_bad;
3383
+ arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
3384
+ if (!arg_tuple) goto limited_bad;
3385
+ if (!is_unsigned) {
3386
+ kwds = PyDict_New();
3387
+ if (!kwds) goto limited_bad;
3388
+ if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
3389
+ }
3390
+ result = PyObject_Call(from_bytes, arg_tuple, kwds);
3391
+ limited_bad:
3392
+ Py_XDECREF(kwds);
3393
+ Py_XDECREF(arg_tuple);
3394
+ Py_XDECREF(order_str);
3395
+ Py_XDECREF(py_bytes);
3396
+ Py_XDECREF(from_bytes);
3397
+ return result;
3398
+ #endif
3399
+ }
3400
+ }
3401
+
3402
+ /* CIntFromPyVerify */
3403
+ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
3404
+ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
3405
+ #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
3406
+ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
3407
+ #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
3408
+ {\
3409
+ func_type value = func_value;\
3410
+ if (sizeof(target_type) < sizeof(func_type)) {\
3411
+ if (unlikely(value != (func_type) (target_type) value)) {\
3412
+ func_type zero = 0;\
3413
+ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
3414
+ return (target_type) -1;\
3415
+ if (is_unsigned && unlikely(value < zero))\
3416
+ goto raise_neg_overflow;\
3417
+ else\
3418
+ goto raise_overflow;\
3419
+ }\
3420
+ }\
3421
+ return (target_type) value;\
3422
+ }
3423
+
3424
+ /* CIntFromPy */
3425
+ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
3426
+ #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
3427
+ #pragma GCC diagnostic push
3428
+ #pragma GCC diagnostic ignored "-Wconversion"
3429
+ #endif
3430
+ const long neg_one = (long) -1, const_zero = (long) 0;
3431
+ #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
3432
+ #pragma GCC diagnostic pop
3433
+ #endif
3434
+ const int is_unsigned = neg_one > const_zero;
3435
+ #if PY_MAJOR_VERSION < 3
3436
+ if (likely(PyInt_Check(x))) {
3437
+ if ((sizeof(long) < sizeof(long))) {
3438
+ __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
3439
+ } else {
3440
+ long val = PyInt_AS_LONG(x);
3441
+ if (is_unsigned && unlikely(val < 0)) {
3442
+ goto raise_neg_overflow;
3443
+ }
3444
+ return (long) val;
3445
+ }
3446
+ }
3447
+ #endif
3448
+ if (unlikely(!PyLong_Check(x))) {
3449
+ long val;
3450
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
3451
+ if (!tmp) return (long) -1;
3452
+ val = __Pyx_PyInt_As_long(tmp);
3453
+ Py_DECREF(tmp);
3454
+ return val;
3455
+ }
3456
+ if (is_unsigned) {
3457
+ #if CYTHON_USE_PYLONG_INTERNALS
3458
+ if (unlikely(__Pyx_PyLong_IsNeg(x))) {
3459
+ goto raise_neg_overflow;
3460
+ } else if (__Pyx_PyLong_IsCompact(x)) {
3461
+ __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
3462
+ } else {
3463
+ const digit* digits = __Pyx_PyLong_Digits(x);
3464
+ assert(__Pyx_PyLong_DigitCount(x) > 1);
3465
+ switch (__Pyx_PyLong_DigitCount(x)) {
3466
+ case 2:
3467
+ if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
3468
+ if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
3469
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
3470
+ } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) {
3471
+ return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
3472
+ }
3473
+ }
3474
+ break;
3475
+ case 3:
3476
+ if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
3477
+ if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
3478
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
3479
+ } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) {
3480
+ return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
3481
+ }
3482
+ }
3483
+ break;
3484
+ case 4:
3485
+ if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
3486
+ if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
3487
+ __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])))
3488
+ } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) {
3489
+ return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
3490
+ }
3491
+ }
3492
+ break;
3493
+ }
3494
+ }
3495
+ #endif
3496
+ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
3497
+ if (unlikely(Py_SIZE(x) < 0)) {
3498
+ goto raise_neg_overflow;
3499
+ }
3500
+ #else
3501
+ {
3502
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
3503
+ if (unlikely(result < 0))
3504
+ return (long) -1;
3505
+ if (unlikely(result == 1))
3506
+ goto raise_neg_overflow;
3507
+ }
3508
+ #endif
3509
+ if ((sizeof(long) <= sizeof(unsigned long))) {
3510
+ __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
3511
+ #ifdef HAVE_LONG_LONG
3512
+ } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) {
3513
+ __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
3514
+ #endif
3515
+ }
3516
+ } else {
3517
+ #if CYTHON_USE_PYLONG_INTERNALS
3518
+ if (__Pyx_PyLong_IsCompact(x)) {
3519
+ __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
3520
+ } else {
3521
+ const digit* digits = __Pyx_PyLong_Digits(x);
3522
+ assert(__Pyx_PyLong_DigitCount(x) > 1);
3523
+ switch (__Pyx_PyLong_SignedDigitCount(x)) {
3524
+ case -2:
3525
+ if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) {
3526
+ if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
3527
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
3528
+ } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
3529
+ return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
3530
+ }
3531
+ }
3532
+ break;
3533
+ case 2:
3534
+ if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
3535
+ if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
3536
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
3537
+ } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
3538
+ return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
3539
+ }
3540
+ }
3541
+ break;
3542
+ case -3:
3543
+ if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
3544
+ if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
3545
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
3546
+ } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
3547
+ return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
3548
+ }
3549
+ }
3550
+ break;
3551
+ case 3:
3552
+ if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
3553
+ if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
3554
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
3555
+ } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
3556
+ return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
3557
+ }
3558
+ }
3559
+ break;
3560
+ case -4:
3561
+ if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
3562
+ if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
3563
+ __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])))
3564
+ } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
3565
+ return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
3566
+ }
3567
+ }
3568
+ break;
3569
+ case 4:
3570
+ if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
3571
+ if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
3572
+ __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])))
3573
+ } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
3574
+ return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
3575
+ }
3576
+ }
3577
+ break;
3578
+ }
3579
+ }
3580
+ #endif
3581
+ if ((sizeof(long) <= sizeof(long))) {
3582
+ __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
3583
+ #ifdef HAVE_LONG_LONG
3584
+ } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) {
3585
+ __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
3586
+ #endif
3587
+ }
3588
+ }
3589
+ {
3590
+ long val;
3591
+ int ret = -1;
3592
+ #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
3593
+ Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
3594
+ x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
3595
+ if (unlikely(bytes_copied == -1)) {
3596
+ } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
3597
+ goto raise_overflow;
3598
+ } else {
3599
+ ret = 0;
3600
+ }
3601
+ #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
3602
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
3603
+ unsigned char *bytes = (unsigned char *)&val;
3604
+ ret = _PyLong_AsByteArray((PyLongObject *)x,
3605
+ bytes, sizeof(val),
3606
+ is_little, !is_unsigned);
3607
+ #else
3608
+ PyObject *v;
3609
+ PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
3610
+ int bits, remaining_bits, is_negative = 0;
3611
+ int chunk_size = (sizeof(long) < 8) ? 30 : 62;
3612
+ if (likely(PyLong_CheckExact(x))) {
3613
+ v = __Pyx_NewRef(x);
3614
+ } else {
3615
+ v = PyNumber_Long(x);
3616
+ if (unlikely(!v)) return (long) -1;
3617
+ assert(PyLong_CheckExact(v));
3618
+ }
3619
+ {
3620
+ int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
3621
+ if (unlikely(result < 0)) {
3622
+ Py_DECREF(v);
3623
+ return (long) -1;
3624
+ }
3625
+ is_negative = result == 1;
3626
+ }
3627
+ if (is_unsigned && unlikely(is_negative)) {
3628
+ Py_DECREF(v);
3629
+ goto raise_neg_overflow;
3630
+ } else if (is_negative) {
3631
+ stepval = PyNumber_Invert(v);
3632
+ Py_DECREF(v);
3633
+ if (unlikely(!stepval))
3634
+ return (long) -1;
3635
+ } else {
3636
+ stepval = v;
3637
+ }
3638
+ v = NULL;
3639
+ val = (long) 0;
3640
+ mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
3641
+ shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
3642
+ for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) {
3643
+ PyObject *tmp, *digit;
3644
+ long idigit;
3645
+ digit = PyNumber_And(stepval, mask);
3646
+ if (unlikely(!digit)) goto done;
3647
+ idigit = PyLong_AsLong(digit);
3648
+ Py_DECREF(digit);
3649
+ if (unlikely(idigit < 0)) goto done;
3650
+ val |= ((long) idigit) << bits;
3651
+ tmp = PyNumber_Rshift(stepval, shift);
3652
+ if (unlikely(!tmp)) goto done;
3653
+ Py_DECREF(stepval); stepval = tmp;
3654
+ }
3655
+ Py_DECREF(shift); shift = NULL;
3656
+ Py_DECREF(mask); mask = NULL;
3657
+ {
3658
+ long idigit = PyLong_AsLong(stepval);
3659
+ if (unlikely(idigit < 0)) goto done;
3660
+ remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
3661
+ if (unlikely(idigit >= (1L << remaining_bits)))
3662
+ goto raise_overflow;
3663
+ val |= ((long) idigit) << bits;
3664
+ }
3665
+ if (!is_unsigned) {
3666
+ if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1))))
3667
+ goto raise_overflow;
3668
+ if (is_negative)
3669
+ val = ~val;
3670
+ }
3671
+ ret = 0;
3672
+ done:
3673
+ Py_XDECREF(shift);
3674
+ Py_XDECREF(mask);
3675
+ Py_XDECREF(stepval);
3676
+ #endif
3677
+ if (unlikely(ret))
3678
+ return (long) -1;
3679
+ return val;
3680
+ }
3681
+ raise_overflow:
3682
+ PyErr_SetString(PyExc_OverflowError,
3683
+ "value too large to convert to long");
3684
+ return (long) -1;
3685
+ raise_neg_overflow:
3686
+ PyErr_SetString(PyExc_OverflowError,
3687
+ "can't convert negative value to long");
3688
+ return (long) -1;
3689
+ }
3690
+
3691
+ /* CIntFromPy */
3692
+ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
3693
+ #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
3694
+ #pragma GCC diagnostic push
3695
+ #pragma GCC diagnostic ignored "-Wconversion"
3696
+ #endif
3697
+ const int neg_one = (int) -1, const_zero = (int) 0;
3698
+ #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
3699
+ #pragma GCC diagnostic pop
3700
+ #endif
3701
+ const int is_unsigned = neg_one > const_zero;
3702
+ #if PY_MAJOR_VERSION < 3
3703
+ if (likely(PyInt_Check(x))) {
3704
+ if ((sizeof(int) < sizeof(long))) {
3705
+ __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
3706
+ } else {
3707
+ long val = PyInt_AS_LONG(x);
3708
+ if (is_unsigned && unlikely(val < 0)) {
3709
+ goto raise_neg_overflow;
3710
+ }
3711
+ return (int) val;
3712
+ }
3713
+ }
3714
+ #endif
3715
+ if (unlikely(!PyLong_Check(x))) {
3716
+ int val;
3717
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
3718
+ if (!tmp) return (int) -1;
3719
+ val = __Pyx_PyInt_As_int(tmp);
3720
+ Py_DECREF(tmp);
3721
+ return val;
3722
+ }
3723
+ if (is_unsigned) {
3724
+ #if CYTHON_USE_PYLONG_INTERNALS
3725
+ if (unlikely(__Pyx_PyLong_IsNeg(x))) {
3726
+ goto raise_neg_overflow;
3727
+ } else if (__Pyx_PyLong_IsCompact(x)) {
3728
+ __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
3729
+ } else {
3730
+ const digit* digits = __Pyx_PyLong_Digits(x);
3731
+ assert(__Pyx_PyLong_DigitCount(x) > 1);
3732
+ switch (__Pyx_PyLong_DigitCount(x)) {
3733
+ case 2:
3734
+ if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
3735
+ if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
3736
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
3737
+ } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) {
3738
+ return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
3739
+ }
3740
+ }
3741
+ break;
3742
+ case 3:
3743
+ if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
3744
+ if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
3745
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
3746
+ } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) {
3747
+ return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
3748
+ }
3749
+ }
3750
+ break;
3751
+ case 4:
3752
+ if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
3753
+ if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
3754
+ __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])))
3755
+ } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) {
3756
+ return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
3757
+ }
3758
+ }
3759
+ break;
3760
+ }
3761
+ }
3762
+ #endif
3763
+ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
3764
+ if (unlikely(Py_SIZE(x) < 0)) {
3765
+ goto raise_neg_overflow;
3766
+ }
3767
+ #else
3768
+ {
3769
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
3770
+ if (unlikely(result < 0))
3771
+ return (int) -1;
3772
+ if (unlikely(result == 1))
3773
+ goto raise_neg_overflow;
3774
+ }
3775
+ #endif
3776
+ if ((sizeof(int) <= sizeof(unsigned long))) {
3777
+ __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
3778
+ #ifdef HAVE_LONG_LONG
3779
+ } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) {
3780
+ __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
3781
+ #endif
3782
+ }
3783
+ } else {
3784
+ #if CYTHON_USE_PYLONG_INTERNALS
3785
+ if (__Pyx_PyLong_IsCompact(x)) {
3786
+ __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
3787
+ } else {
3788
+ const digit* digits = __Pyx_PyLong_Digits(x);
3789
+ assert(__Pyx_PyLong_DigitCount(x) > 1);
3790
+ switch (__Pyx_PyLong_SignedDigitCount(x)) {
3791
+ case -2:
3792
+ if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) {
3793
+ if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
3794
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
3795
+ } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
3796
+ return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
3797
+ }
3798
+ }
3799
+ break;
3800
+ case 2:
3801
+ if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
3802
+ if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
3803
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
3804
+ } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
3805
+ return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
3806
+ }
3807
+ }
3808
+ break;
3809
+ case -3:
3810
+ if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
3811
+ if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
3812
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
3813
+ } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
3814
+ return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
3815
+ }
3816
+ }
3817
+ break;
3818
+ case 3:
3819
+ if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
3820
+ if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
3821
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
3822
+ } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
3823
+ return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
3824
+ }
3825
+ }
3826
+ break;
3827
+ case -4:
3828
+ if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
3829
+ if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
3830
+ __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])))
3831
+ } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
3832
+ return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
3833
+ }
3834
+ }
3835
+ break;
3836
+ case 4:
3837
+ if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
3838
+ if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
3839
+ __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])))
3840
+ } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
3841
+ return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
3842
+ }
3843
+ }
3844
+ break;
3845
+ }
3846
+ }
3847
+ #endif
3848
+ if ((sizeof(int) <= sizeof(long))) {
3849
+ __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
3850
+ #ifdef HAVE_LONG_LONG
3851
+ } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) {
3852
+ __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
3853
+ #endif
3854
+ }
3855
+ }
3856
+ {
3857
+ int val;
3858
+ int ret = -1;
3859
+ #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
3860
+ Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
3861
+ x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
3862
+ if (unlikely(bytes_copied == -1)) {
3863
+ } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
3864
+ goto raise_overflow;
3865
+ } else {
3866
+ ret = 0;
3867
+ }
3868
+ #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
3869
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
3870
+ unsigned char *bytes = (unsigned char *)&val;
3871
+ ret = _PyLong_AsByteArray((PyLongObject *)x,
3872
+ bytes, sizeof(val),
3873
+ is_little, !is_unsigned);
3874
+ #else
3875
+ PyObject *v;
3876
+ PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
3877
+ int bits, remaining_bits, is_negative = 0;
3878
+ int chunk_size = (sizeof(long) < 8) ? 30 : 62;
3879
+ if (likely(PyLong_CheckExact(x))) {
3880
+ v = __Pyx_NewRef(x);
3881
+ } else {
3882
+ v = PyNumber_Long(x);
3883
+ if (unlikely(!v)) return (int) -1;
3884
+ assert(PyLong_CheckExact(v));
3885
+ }
3886
+ {
3887
+ int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
3888
+ if (unlikely(result < 0)) {
3889
+ Py_DECREF(v);
3890
+ return (int) -1;
3891
+ }
3892
+ is_negative = result == 1;
3893
+ }
3894
+ if (is_unsigned && unlikely(is_negative)) {
3895
+ Py_DECREF(v);
3896
+ goto raise_neg_overflow;
3897
+ } else if (is_negative) {
3898
+ stepval = PyNumber_Invert(v);
3899
+ Py_DECREF(v);
3900
+ if (unlikely(!stepval))
3901
+ return (int) -1;
3902
+ } else {
3903
+ stepval = v;
3904
+ }
3905
+ v = NULL;
3906
+ val = (int) 0;
3907
+ mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
3908
+ shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
3909
+ for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) {
3910
+ PyObject *tmp, *digit;
3911
+ long idigit;
3912
+ digit = PyNumber_And(stepval, mask);
3913
+ if (unlikely(!digit)) goto done;
3914
+ idigit = PyLong_AsLong(digit);
3915
+ Py_DECREF(digit);
3916
+ if (unlikely(idigit < 0)) goto done;
3917
+ val |= ((int) idigit) << bits;
3918
+ tmp = PyNumber_Rshift(stepval, shift);
3919
+ if (unlikely(!tmp)) goto done;
3920
+ Py_DECREF(stepval); stepval = tmp;
3921
+ }
3922
+ Py_DECREF(shift); shift = NULL;
3923
+ Py_DECREF(mask); mask = NULL;
3924
+ {
3925
+ long idigit = PyLong_AsLong(stepval);
3926
+ if (unlikely(idigit < 0)) goto done;
3927
+ remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
3928
+ if (unlikely(idigit >= (1L << remaining_bits)))
3929
+ goto raise_overflow;
3930
+ val |= ((int) idigit) << bits;
3931
+ }
3932
+ if (!is_unsigned) {
3933
+ if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1))))
3934
+ goto raise_overflow;
3935
+ if (is_negative)
3936
+ val = ~val;
3937
+ }
3938
+ ret = 0;
3939
+ done:
3940
+ Py_XDECREF(shift);
3941
+ Py_XDECREF(mask);
3942
+ Py_XDECREF(stepval);
3943
+ #endif
3944
+ if (unlikely(ret))
3945
+ return (int) -1;
3946
+ return val;
3947
+ }
3948
+ raise_overflow:
3949
+ PyErr_SetString(PyExc_OverflowError,
3950
+ "value too large to convert to int");
3951
+ return (int) -1;
3952
+ raise_neg_overflow:
3953
+ PyErr_SetString(PyExc_OverflowError,
3954
+ "can't convert negative value to int");
3955
+ return (int) -1;
3956
+ }
3957
+
3958
+ /* FastTypeChecks */
3959
+ #if CYTHON_COMPILING_IN_CPYTHON
3960
+ static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
3961
+ while (a) {
3962
+ a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
3963
+ if (a == b)
3964
+ return 1;
3965
+ }
3966
+ return b == &PyBaseObject_Type;
3967
+ }
3968
+ static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
3969
+ PyObject *mro;
3970
+ if (a == b) return 1;
3971
+ mro = a->tp_mro;
3972
+ if (likely(mro)) {
3973
+ Py_ssize_t i, n;
3974
+ n = PyTuple_GET_SIZE(mro);
3975
+ for (i = 0; i < n; i++) {
3976
+ if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
3977
+ return 1;
3978
+ }
3979
+ return 0;
3980
+ }
3981
+ return __Pyx_InBases(a, b);
3982
+ }
3983
+ static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
3984
+ PyObject *mro;
3985
+ if (cls == a || cls == b) return 1;
3986
+ mro = cls->tp_mro;
3987
+ if (likely(mro)) {
3988
+ Py_ssize_t i, n;
3989
+ n = PyTuple_GET_SIZE(mro);
3990
+ for (i = 0; i < n; i++) {
3991
+ PyObject *base = PyTuple_GET_ITEM(mro, i);
3992
+ if (base == (PyObject *)a || base == (PyObject *)b)
3993
+ return 1;
3994
+ }
3995
+ return 0;
3996
+ }
3997
+ return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
3998
+ }
3999
+ #if PY_MAJOR_VERSION == 2
4000
+ static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
4001
+ PyObject *exception, *value, *tb;
4002
+ int res;
4003
+ __Pyx_PyThreadState_declare
4004
+ __Pyx_PyThreadState_assign
4005
+ __Pyx_ErrFetch(&exception, &value, &tb);
4006
+ res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
4007
+ if (unlikely(res == -1)) {
4008
+ PyErr_WriteUnraisable(err);
4009
+ res = 0;
4010
+ }
4011
+ if (!res) {
4012
+ res = PyObject_IsSubclass(err, exc_type2);
4013
+ if (unlikely(res == -1)) {
4014
+ PyErr_WriteUnraisable(err);
4015
+ res = 0;
4016
+ }
4017
+ }
4018
+ __Pyx_ErrRestore(exception, value, tb);
4019
+ return res;
4020
+ }
4021
+ #else
4022
+ static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
4023
+ if (exc_type1) {
4024
+ return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
4025
+ } else {
4026
+ return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
4027
+ }
4028
+ }
4029
+ #endif
4030
+ static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
4031
+ Py_ssize_t i, n;
4032
+ assert(PyExceptionClass_Check(exc_type));
4033
+ n = PyTuple_GET_SIZE(tuple);
4034
+ #if PY_MAJOR_VERSION >= 3
4035
+ for (i=0; i<n; i++) {
4036
+ if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
4037
+ }
4038
+ #endif
4039
+ for (i=0; i<n; i++) {
4040
+ PyObject *t = PyTuple_GET_ITEM(tuple, i);
4041
+ #if PY_MAJOR_VERSION < 3
4042
+ if (likely(exc_type == t)) return 1;
4043
+ #endif
4044
+ if (likely(PyExceptionClass_Check(t))) {
4045
+ if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
4046
+ } else {
4047
+ }
4048
+ }
4049
+ return 0;
4050
+ }
4051
+ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
4052
+ if (likely(err == exc_type)) return 1;
4053
+ if (likely(PyExceptionClass_Check(err))) {
4054
+ if (likely(PyExceptionClass_Check(exc_type))) {
4055
+ return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
4056
+ } else if (likely(PyTuple_Check(exc_type))) {
4057
+ return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
4058
+ } else {
4059
+ }
4060
+ }
4061
+ return PyErr_GivenExceptionMatches(err, exc_type);
4062
+ }
4063
+ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
4064
+ assert(PyExceptionClass_Check(exc_type1));
4065
+ assert(PyExceptionClass_Check(exc_type2));
4066
+ if (likely(err == exc_type1 || err == exc_type2)) return 1;
4067
+ if (likely(PyExceptionClass_Check(err))) {
4068
+ return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
4069
+ }
4070
+ return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
4071
+ }
4072
+ #endif
4073
+
4074
+ /* CheckBinaryVersion */
4075
+ static unsigned long __Pyx_get_runtime_version(void) {
4076
+ #if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4
4077
+ return Py_Version & ~0xFFUL;
4078
+ #else
4079
+ const char* rt_version = Py_GetVersion();
4080
+ unsigned long version = 0;
4081
+ unsigned long factor = 0x01000000UL;
4082
+ unsigned int digit = 0;
4083
+ int i = 0;
4084
+ while (factor) {
4085
+ while ('0' <= rt_version[i] && rt_version[i] <= '9') {
4086
+ digit = digit * 10 + (unsigned int) (rt_version[i] - '0');
4087
+ ++i;
4088
+ }
4089
+ version += factor * digit;
4090
+ if (rt_version[i] != '.')
4091
+ break;
4092
+ digit = 0;
4093
+ factor >>= 8;
4094
+ ++i;
4095
+ }
4096
+ return version;
4097
+ #endif
4098
+ }
4099
+ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) {
4100
+ const unsigned long MAJOR_MINOR = 0xFFFF0000UL;
4101
+ if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR))
4102
+ return 0;
4103
+ if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
4104
+ return 1;
4105
+ {
4106
+ char message[200];
4107
+ PyOS_snprintf(message, sizeof(message),
4108
+ "compile time Python version %d.%d "
4109
+ "of module '%.100s' "
4110
+ "%s "
4111
+ "runtime version %d.%d",
4112
+ (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF),
4113
+ __Pyx_MODULE_NAME,
4114
+ (allow_newer) ? "was newer than" : "does not match",
4115
+ (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF)
4116
+ );
4117
+ return PyErr_WarnEx(NULL, message, 1);
4118
+ }
4119
+ }
4120
+
4121
+ /* PyObjectSetAttrStr */
4122
+ #if CYTHON_USE_TYPE_SLOTS
4123
+ static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
4124
+ PyTypeObject* tp = Py_TYPE(obj);
4125
+ if (likely(tp->tp_setattro))
4126
+ return tp->tp_setattro(obj, attr_name, value);
4127
+ #if PY_MAJOR_VERSION < 3
4128
+ if (likely(tp->tp_setattr))
4129
+ return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
4130
+ #endif
4131
+ return PyObject_SetAttr(obj, attr_name, value);
4132
+ }
4133
+ #endif
4134
+
4135
+ /* VoidPtrExport */
4136
+ static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig) {
4137
+ PyObject *d;
4138
+ PyObject *cobj = 0;
4139
+ d = PyDict_GetItem(__pyx_d, __pyx_n_s_pyx_capi);
4140
+ Py_XINCREF(d);
4141
+ if (!d) {
4142
+ d = PyDict_New();
4143
+ if (!d)
4144
+ goto bad;
4145
+ if (__Pyx_PyObject_SetAttrStr(__pyx_m, __pyx_n_s_pyx_capi, d) < 0)
4146
+ goto bad;
4147
+ }
4148
+ cobj = PyCapsule_New(p, sig, 0);
4149
+ if (!cobj)
4150
+ goto bad;
4151
+ if (PyDict_SetItem(d, name, cobj) < 0)
4152
+ goto bad;
4153
+ Py_DECREF(cobj);
4154
+ Py_DECREF(d);
4155
+ return 0;
4156
+ bad:
4157
+ Py_XDECREF(cobj);
4158
+ Py_XDECREF(d);
4159
+ return -1;
4160
+ }
4161
+
4162
+ /* InitStrings */
4163
+ #if PY_MAJOR_VERSION >= 3
4164
+ static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) {
4165
+ if (t.is_unicode | t.is_str) {
4166
+ if (t.intern) {
4167
+ *str = PyUnicode_InternFromString(t.s);
4168
+ } else if (t.encoding) {
4169
+ *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL);
4170
+ } else {
4171
+ *str = PyUnicode_FromStringAndSize(t.s, t.n - 1);
4172
+ }
4173
+ } else {
4174
+ *str = PyBytes_FromStringAndSize(t.s, t.n - 1);
4175
+ }
4176
+ if (!*str)
4177
+ return -1;
4178
+ if (PyObject_Hash(*str) == -1)
4179
+ return -1;
4180
+ return 0;
4181
+ }
4182
+ #endif
4183
+ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
4184
+ while (t->p) {
4185
+ #if PY_MAJOR_VERSION >= 3
4186
+ __Pyx_InitString(*t, t->p);
4187
+ #else
4188
+ if (t->is_unicode) {
4189
+ *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
4190
+ } else if (t->intern) {
4191
+ *t->p = PyString_InternFromString(t->s);
4192
+ } else {
4193
+ *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
4194
+ }
4195
+ if (!*t->p)
4196
+ return -1;
4197
+ if (PyObject_Hash(*t->p) == -1)
4198
+ return -1;
4199
+ #endif
4200
+ ++t;
4201
+ }
4202
+ return 0;
4203
+ }
4204
+
4205
+ #include <string.h>
4206
+ static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) {
4207
+ size_t len = strlen(s);
4208
+ if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) {
4209
+ PyErr_SetString(PyExc_OverflowError, "byte string is too long");
4210
+ return -1;
4211
+ }
4212
+ return (Py_ssize_t) len;
4213
+ }
4214
+ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
4215
+ Py_ssize_t len = __Pyx_ssize_strlen(c_str);
4216
+ if (unlikely(len < 0)) return NULL;
4217
+ return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
4218
+ }
4219
+ static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) {
4220
+ Py_ssize_t len = __Pyx_ssize_strlen(c_str);
4221
+ if (unlikely(len < 0)) return NULL;
4222
+ return PyByteArray_FromStringAndSize(c_str, len);
4223
+ }
4224
+ static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
4225
+ Py_ssize_t ignore;
4226
+ return __Pyx_PyObject_AsStringAndSize(o, &ignore);
4227
+ }
4228
+ #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
4229
+ #if !CYTHON_PEP393_ENABLED
4230
+ static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
4231
+ char* defenc_c;
4232
+ PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
4233
+ if (!defenc) return NULL;
4234
+ defenc_c = PyBytes_AS_STRING(defenc);
4235
+ #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
4236
+ {
4237
+ char* end = defenc_c + PyBytes_GET_SIZE(defenc);
4238
+ char* c;
4239
+ for (c = defenc_c; c < end; c++) {
4240
+ if ((unsigned char) (*c) >= 128) {
4241
+ PyUnicode_AsASCIIString(o);
4242
+ return NULL;
4243
+ }
4244
+ }
4245
+ }
4246
+ #endif
4247
+ *length = PyBytes_GET_SIZE(defenc);
4248
+ return defenc_c;
4249
+ }
4250
+ #else
4251
+ static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
4252
+ if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
4253
+ #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
4254
+ if (likely(PyUnicode_IS_ASCII(o))) {
4255
+ *length = PyUnicode_GET_LENGTH(o);
4256
+ return PyUnicode_AsUTF8(o);
4257
+ } else {
4258
+ PyUnicode_AsASCIIString(o);
4259
+ return NULL;
4260
+ }
4261
+ #else
4262
+ return PyUnicode_AsUTF8AndSize(o, length);
4263
+ #endif
4264
+ }
4265
+ #endif
4266
+ #endif
4267
+ static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
4268
+ #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
4269
+ if (
4270
+ #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
4271
+ __Pyx_sys_getdefaultencoding_not_ascii &&
4272
+ #endif
4273
+ PyUnicode_Check(o)) {
4274
+ return __Pyx_PyUnicode_AsStringAndSize(o, length);
4275
+ } else
4276
+ #endif
4277
+ #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
4278
+ if (PyByteArray_Check(o)) {
4279
+ *length = PyByteArray_GET_SIZE(o);
4280
+ return PyByteArray_AS_STRING(o);
4281
+ } else
4282
+ #endif
4283
+ {
4284
+ char* result;
4285
+ int r = PyBytes_AsStringAndSize(o, &result, length);
4286
+ if (unlikely(r < 0)) {
4287
+ return NULL;
4288
+ } else {
4289
+ return result;
4290
+ }
4291
+ }
4292
+ }
4293
+ static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
4294
+ int is_true = x == Py_True;
4295
+ if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
4296
+ else return PyObject_IsTrue(x);
4297
+ }
4298
+ static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
4299
+ int retval;
4300
+ if (unlikely(!x)) return -1;
4301
+ retval = __Pyx_PyObject_IsTrue(x);
4302
+ Py_DECREF(x);
4303
+ return retval;
4304
+ }
4305
+ static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
4306
+ __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result));
4307
+ #if PY_MAJOR_VERSION >= 3
4308
+ if (PyLong_Check(result)) {
4309
+ if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
4310
+ "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). "
4311
+ "The ability to return an instance of a strict subclass of int is deprecated, "
4312
+ "and may be removed in a future version of Python.",
4313
+ result_type_name)) {
4314
+ __Pyx_DECREF_TypeName(result_type_name);
4315
+ Py_DECREF(result);
4316
+ return NULL;
4317
+ }
4318
+ __Pyx_DECREF_TypeName(result_type_name);
4319
+ return result;
4320
+ }
4321
+ #endif
4322
+ PyErr_Format(PyExc_TypeError,
4323
+ "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")",
4324
+ type_name, type_name, result_type_name);
4325
+ __Pyx_DECREF_TypeName(result_type_name);
4326
+ Py_DECREF(result);
4327
+ return NULL;
4328
+ }
4329
+ static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
4330
+ #if CYTHON_USE_TYPE_SLOTS
4331
+ PyNumberMethods *m;
4332
+ #endif
4333
+ const char *name = NULL;
4334
+ PyObject *res = NULL;
4335
+ #if PY_MAJOR_VERSION < 3
4336
+ if (likely(PyInt_Check(x) || PyLong_Check(x)))
4337
+ #else
4338
+ if (likely(PyLong_Check(x)))
4339
+ #endif
4340
+ return __Pyx_NewRef(x);
4341
+ #if CYTHON_USE_TYPE_SLOTS
4342
+ m = Py_TYPE(x)->tp_as_number;
4343
+ #if PY_MAJOR_VERSION < 3
4344
+ if (m && m->nb_int) {
4345
+ name = "int";
4346
+ res = m->nb_int(x);
4347
+ }
4348
+ else if (m && m->nb_long) {
4349
+ name = "long";
4350
+ res = m->nb_long(x);
4351
+ }
4352
+ #else
4353
+ if (likely(m && m->nb_int)) {
4354
+ name = "int";
4355
+ res = m->nb_int(x);
4356
+ }
4357
+ #endif
4358
+ #else
4359
+ if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
4360
+ res = PyNumber_Int(x);
4361
+ }
4362
+ #endif
4363
+ if (likely(res)) {
4364
+ #if PY_MAJOR_VERSION < 3
4365
+ if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
4366
+ #else
4367
+ if (unlikely(!PyLong_CheckExact(res))) {
4368
+ #endif
4369
+ return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
4370
+ }
4371
+ }
4372
+ else if (!PyErr_Occurred()) {
4373
+ PyErr_SetString(PyExc_TypeError,
4374
+ "an integer is required");
4375
+ }
4376
+ return res;
4377
+ }
4378
+ static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
4379
+ Py_ssize_t ival;
4380
+ PyObject *x;
4381
+ #if PY_MAJOR_VERSION < 3
4382
+ if (likely(PyInt_CheckExact(b))) {
4383
+ if (sizeof(Py_ssize_t) >= sizeof(long))
4384
+ return PyInt_AS_LONG(b);
4385
+ else
4386
+ return PyInt_AsSsize_t(b);
4387
+ }
4388
+ #endif
4389
+ if (likely(PyLong_CheckExact(b))) {
4390
+ #if CYTHON_USE_PYLONG_INTERNALS
4391
+ if (likely(__Pyx_PyLong_IsCompact(b))) {
4392
+ return __Pyx_PyLong_CompactValue(b);
4393
+ } else {
4394
+ const digit* digits = __Pyx_PyLong_Digits(b);
4395
+ const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b);
4396
+ switch (size) {
4397
+ case 2:
4398
+ if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
4399
+ return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
4400
+ }
4401
+ break;
4402
+ case -2:
4403
+ if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
4404
+ return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
4405
+ }
4406
+ break;
4407
+ case 3:
4408
+ if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
4409
+ return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
4410
+ }
4411
+ break;
4412
+ case -3:
4413
+ if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
4414
+ return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
4415
+ }
4416
+ break;
4417
+ case 4:
4418
+ if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
4419
+ return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
4420
+ }
4421
+ break;
4422
+ case -4:
4423
+ if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
4424
+ return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
4425
+ }
4426
+ break;
4427
+ }
4428
+ }
4429
+ #endif
4430
+ return PyLong_AsSsize_t(b);
4431
+ }
4432
+ x = PyNumber_Index(b);
4433
+ if (!x) return -1;
4434
+ ival = PyInt_AsSsize_t(x);
4435
+ Py_DECREF(x);
4436
+ return ival;
4437
+ }
4438
+ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
4439
+ if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
4440
+ return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
4441
+ #if PY_MAJOR_VERSION < 3
4442
+ } else if (likely(PyInt_CheckExact(o))) {
4443
+ return PyInt_AS_LONG(o);
4444
+ #endif
4445
+ } else {
4446
+ Py_ssize_t ival;
4447
+ PyObject *x;
4448
+ x = PyNumber_Index(o);
4449
+ if (!x) return -1;
4450
+ ival = PyInt_AsLong(x);
4451
+ Py_DECREF(x);
4452
+ return ival;
4453
+ }
4454
+ }
4455
+ static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
4456
+ return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
4457
+ }
4458
+ static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
4459
+ return PyInt_FromSize_t(ival);
4460
+ }
4461
+
4462
+
4463
+ /* #### Code section: utility_code_pragmas_end ### */
4464
+ #ifdef _MSC_VER
4465
+ #pragma warning( pop )
4466
+ #endif
4467
+
4468
+
4469
+
4470
+ /* #### Code section: end ### */
4471
+ #endif /* Py_PYTHON_H */