Cython 3.2.0__cp39-abi3-win32.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (333) hide show
  1. Cython/Build/BuildExecutable.py +169 -0
  2. Cython/Build/Cache.py +199 -0
  3. Cython/Build/Cythonize.py +350 -0
  4. Cython/Build/Dependencies.py +1314 -0
  5. Cython/Build/Distutils.py +1 -0
  6. Cython/Build/Inline.py +463 -0
  7. Cython/Build/IpythonMagic.py +560 -0
  8. Cython/Build/SharedModule.py +94 -0
  9. Cython/Build/Tests/TestCyCache.py +194 -0
  10. Cython/Build/Tests/TestCythonizeArgsParser.py +481 -0
  11. Cython/Build/Tests/TestDependencies.py +133 -0
  12. Cython/Build/Tests/TestInline.py +177 -0
  13. Cython/Build/Tests/TestIpythonMagic.py +287 -0
  14. Cython/Build/Tests/TestRecythonize.py +212 -0
  15. Cython/Build/Tests/TestStripLiterals.py +155 -0
  16. Cython/Build/Tests/__init__.py +1 -0
  17. Cython/Build/__init__.py +11 -0
  18. Cython/CodeWriter.py +815 -0
  19. Cython/Compiler/AnalysedTreeTransforms.py +97 -0
  20. Cython/Compiler/Annotate.py +328 -0
  21. Cython/Compiler/AutoDocTransforms.py +320 -0
  22. Cython/Compiler/Buffer.py +680 -0
  23. Cython/Compiler/Builtin.py +984 -0
  24. Cython/Compiler/CmdLine.py +263 -0
  25. Cython/Compiler/Code.pxd +149 -0
  26. Cython/Compiler/Code.py +3746 -0
  27. Cython/Compiler/Code.pyd +0 -0
  28. Cython/Compiler/CodeGeneration.py +33 -0
  29. Cython/Compiler/CythonScope.py +191 -0
  30. Cython/Compiler/Dataclass.py +864 -0
  31. Cython/Compiler/DebugFlags.py +24 -0
  32. Cython/Compiler/Errors.py +297 -0
  33. Cython/Compiler/ExprNodes.py +15562 -0
  34. Cython/Compiler/FlowControl.pxd +97 -0
  35. Cython/Compiler/FlowControl.py +1451 -0
  36. Cython/Compiler/FlowControl.pyd +0 -0
  37. Cython/Compiler/FusedNode.py +971 -0
  38. Cython/Compiler/FusedNode.pyd +0 -0
  39. Cython/Compiler/Future.py +16 -0
  40. Cython/Compiler/Interpreter.py +57 -0
  41. Cython/Compiler/Lexicon.py +421 -0
  42. Cython/Compiler/LineTable.py +114 -0
  43. Cython/Compiler/LineTable.pyd +0 -0
  44. Cython/Compiler/Main.py +857 -0
  45. Cython/Compiler/MatchCaseNodes.py +259 -0
  46. Cython/Compiler/MemoryView.py +905 -0
  47. Cython/Compiler/ModuleNode.py +4235 -0
  48. Cython/Compiler/Naming.py +363 -0
  49. Cython/Compiler/Nodes.py +10831 -0
  50. Cython/Compiler/Optimize.py +5288 -0
  51. Cython/Compiler/Options.py +843 -0
  52. Cython/Compiler/ParseTreeTransforms.pxd +78 -0
  53. Cython/Compiler/ParseTreeTransforms.py +4638 -0
  54. Cython/Compiler/Parsing.pxd +9 -0
  55. Cython/Compiler/Parsing.py +4775 -0
  56. Cython/Compiler/Parsing.pyd +0 -0
  57. Cython/Compiler/Pipeline.py +439 -0
  58. Cython/Compiler/PyrexTypes.py +5870 -0
  59. Cython/Compiler/Pythran.py +232 -0
  60. Cython/Compiler/Scanning.pxd +48 -0
  61. Cython/Compiler/Scanning.py +701 -0
  62. Cython/Compiler/Scanning.pyd +0 -0
  63. Cython/Compiler/StringEncoding.py +298 -0
  64. Cython/Compiler/Symtab.py +3073 -0
  65. Cython/Compiler/Tests/TestBuffer.py +105 -0
  66. Cython/Compiler/Tests/TestBuiltin.py +72 -0
  67. Cython/Compiler/Tests/TestCmdLine.py +586 -0
  68. Cython/Compiler/Tests/TestCode.py +144 -0
  69. Cython/Compiler/Tests/TestFlowControl.py +65 -0
  70. Cython/Compiler/Tests/TestGrammar.py +202 -0
  71. Cython/Compiler/Tests/TestMemView.py +71 -0
  72. Cython/Compiler/Tests/TestParseTreeTransforms.py +285 -0
  73. Cython/Compiler/Tests/TestScanning.py +134 -0
  74. Cython/Compiler/Tests/TestSignatureMatching.py +73 -0
  75. Cython/Compiler/Tests/TestStringEncoding.py +21 -0
  76. Cython/Compiler/Tests/TestTreeFragment.py +63 -0
  77. Cython/Compiler/Tests/TestTreePath.py +103 -0
  78. Cython/Compiler/Tests/TestTypes.py +75 -0
  79. Cython/Compiler/Tests/TestUtilityLoad.py +112 -0
  80. Cython/Compiler/Tests/TestVisitor.py +61 -0
  81. Cython/Compiler/Tests/Utils.py +36 -0
  82. Cython/Compiler/Tests/__init__.py +1 -0
  83. Cython/Compiler/TreeFragment.py +278 -0
  84. Cython/Compiler/TreePath.py +303 -0
  85. Cython/Compiler/TypeInference.py +591 -0
  86. Cython/Compiler/TypeSlots.py +1174 -0
  87. Cython/Compiler/UFuncs.py +311 -0
  88. Cython/Compiler/UtilNodes.py +389 -0
  89. Cython/Compiler/UtilityCode.py +344 -0
  90. Cython/Compiler/Version.py +8 -0
  91. Cython/Compiler/Visitor.pxd +53 -0
  92. Cython/Compiler/Visitor.py +861 -0
  93. Cython/Compiler/Visitor.pyd +0 -0
  94. Cython/Compiler/__init__.py +1 -0
  95. Cython/Coverage.py +448 -0
  96. Cython/Debugger/Cygdb.py +177 -0
  97. Cython/Debugger/DebugWriter.py +82 -0
  98. Cython/Debugger/Tests/TestLibCython.py +275 -0
  99. Cython/Debugger/Tests/__init__.py +1 -0
  100. Cython/Debugger/Tests/cfuncs.c +8 -0
  101. Cython/Debugger/Tests/codefile +49 -0
  102. Cython/Debugger/Tests/test_libcython_in_gdb.py +578 -0
  103. Cython/Debugger/Tests/test_libpython_in_gdb.py +90 -0
  104. Cython/Debugger/__init__.py +1 -0
  105. Cython/Debugger/libcython.py +1548 -0
  106. Cython/Debugger/libpython.py +2821 -0
  107. Cython/Debugging.py +20 -0
  108. Cython/Distutils/__init__.py +2 -0
  109. Cython/Distutils/build_ext.py +139 -0
  110. Cython/Distutils/extension.py +96 -0
  111. Cython/Distutils/old_build_ext.py +351 -0
  112. Cython/Includes/cpython/__init__.pxd +173 -0
  113. Cython/Includes/cpython/array.pxd +178 -0
  114. Cython/Includes/cpython/bool.pxd +37 -0
  115. Cython/Includes/cpython/buffer.pxd +112 -0
  116. Cython/Includes/cpython/bytearray.pxd +33 -0
  117. Cython/Includes/cpython/bytes.pxd +200 -0
  118. Cython/Includes/cpython/cellobject.pxd +35 -0
  119. Cython/Includes/cpython/ceval.pxd +8 -0
  120. Cython/Includes/cpython/codecs.pxd +121 -0
  121. Cython/Includes/cpython/complex.pxd +60 -0
  122. Cython/Includes/cpython/contextvars.pxd +145 -0
  123. Cython/Includes/cpython/conversion.pxd +36 -0
  124. Cython/Includes/cpython/datetime.pxd +395 -0
  125. Cython/Includes/cpython/descr.pxd +26 -0
  126. Cython/Includes/cpython/dict.pxd +187 -0
  127. Cython/Includes/cpython/exc.pxd +263 -0
  128. Cython/Includes/cpython/fileobject.pxd +57 -0
  129. Cython/Includes/cpython/float.pxd +47 -0
  130. Cython/Includes/cpython/function.pxd +65 -0
  131. Cython/Includes/cpython/genobject.pxd +25 -0
  132. Cython/Includes/cpython/getargs.pxd +12 -0
  133. Cython/Includes/cpython/instance.pxd +25 -0
  134. Cython/Includes/cpython/iterator.pxd +36 -0
  135. Cython/Includes/cpython/iterobject.pxd +24 -0
  136. Cython/Includes/cpython/list.pxd +92 -0
  137. Cython/Includes/cpython/long.pxd +149 -0
  138. Cython/Includes/cpython/longintrepr.pxd +14 -0
  139. Cython/Includes/cpython/mapping.pxd +63 -0
  140. Cython/Includes/cpython/marshal.pxd +66 -0
  141. Cython/Includes/cpython/mem.pxd +120 -0
  142. Cython/Includes/cpython/memoryview.pxd +50 -0
  143. Cython/Includes/cpython/method.pxd +49 -0
  144. Cython/Includes/cpython/module.pxd +208 -0
  145. Cython/Includes/cpython/number.pxd +258 -0
  146. Cython/Includes/cpython/object.pxd +433 -0
  147. Cython/Includes/cpython/pycapsule.pxd +143 -0
  148. Cython/Includes/cpython/pylifecycle.pxd +68 -0
  149. Cython/Includes/cpython/pyport.pxd +8 -0
  150. Cython/Includes/cpython/pystate.pxd +95 -0
  151. Cython/Includes/cpython/pythread.pxd +53 -0
  152. Cython/Includes/cpython/ref.pxd +141 -0
  153. Cython/Includes/cpython/sequence.pxd +134 -0
  154. Cython/Includes/cpython/set.pxd +119 -0
  155. Cython/Includes/cpython/slice.pxd +70 -0
  156. Cython/Includes/cpython/time.pxd +129 -0
  157. Cython/Includes/cpython/tuple.pxd +72 -0
  158. Cython/Includes/cpython/type.pxd +53 -0
  159. Cython/Includes/cpython/unicode.pxd +639 -0
  160. Cython/Includes/cpython/version.pxd +32 -0
  161. Cython/Includes/cpython/weakref.pxd +78 -0
  162. Cython/Includes/libc/__init__.pxd +1 -0
  163. Cython/Includes/libc/complex.pxd +35 -0
  164. Cython/Includes/libc/errno.pxd +127 -0
  165. Cython/Includes/libc/float.pxd +43 -0
  166. Cython/Includes/libc/limits.pxd +28 -0
  167. Cython/Includes/libc/locale.pxd +46 -0
  168. Cython/Includes/libc/math.pxd +209 -0
  169. Cython/Includes/libc/setjmp.pxd +10 -0
  170. Cython/Includes/libc/signal.pxd +64 -0
  171. Cython/Includes/libc/stddef.pxd +9 -0
  172. Cython/Includes/libc/stdint.pxd +105 -0
  173. Cython/Includes/libc/stdio.pxd +80 -0
  174. Cython/Includes/libc/stdlib.pxd +72 -0
  175. Cython/Includes/libc/string.pxd +50 -0
  176. Cython/Includes/libc/threads.pxd +234 -0
  177. Cython/Includes/libc/time.pxd +52 -0
  178. Cython/Includes/libcpp/__init__.pxd +4 -0
  179. Cython/Includes/libcpp/algorithm.pxd +320 -0
  180. Cython/Includes/libcpp/any.pxd +16 -0
  181. Cython/Includes/libcpp/atomic.pxd +59 -0
  182. Cython/Includes/libcpp/barrier.pxd +22 -0
  183. Cython/Includes/libcpp/bit.pxd +29 -0
  184. Cython/Includes/libcpp/cast.pxd +12 -0
  185. Cython/Includes/libcpp/cmath.pxd +518 -0
  186. Cython/Includes/libcpp/complex.pxd +106 -0
  187. Cython/Includes/libcpp/condition_variable.pxd +322 -0
  188. Cython/Includes/libcpp/deque.pxd +165 -0
  189. Cython/Includes/libcpp/exception.pxd +86 -0
  190. Cython/Includes/libcpp/execution.pxd +15 -0
  191. Cython/Includes/libcpp/forward_list.pxd +63 -0
  192. Cython/Includes/libcpp/functional.pxd +26 -0
  193. Cython/Includes/libcpp/future.pxd +103 -0
  194. Cython/Includes/libcpp/iterator.pxd +34 -0
  195. Cython/Includes/libcpp/latch.pxd +17 -0
  196. Cython/Includes/libcpp/limits.pxd +61 -0
  197. Cython/Includes/libcpp/list.pxd +117 -0
  198. Cython/Includes/libcpp/map.pxd +252 -0
  199. Cython/Includes/libcpp/memory.pxd +115 -0
  200. Cython/Includes/libcpp/mutex.pxd +387 -0
  201. Cython/Includes/libcpp/numbers.pxd +15 -0
  202. Cython/Includes/libcpp/numeric.pxd +131 -0
  203. Cython/Includes/libcpp/optional.pxd +34 -0
  204. Cython/Includes/libcpp/pair.pxd +1 -0
  205. Cython/Includes/libcpp/queue.pxd +25 -0
  206. Cython/Includes/libcpp/random.pxd +166 -0
  207. Cython/Includes/libcpp/semaphore.pxd +43 -0
  208. Cython/Includes/libcpp/set.pxd +228 -0
  209. Cython/Includes/libcpp/shared_mutex.pxd +96 -0
  210. Cython/Includes/libcpp/span.pxd +87 -0
  211. Cython/Includes/libcpp/stack.pxd +11 -0
  212. Cython/Includes/libcpp/stop_token.pxd +117 -0
  213. Cython/Includes/libcpp/string.pxd +355 -0
  214. Cython/Includes/libcpp/string_view.pxd +183 -0
  215. Cython/Includes/libcpp/typeindex.pxd +15 -0
  216. Cython/Includes/libcpp/typeinfo.pxd +10 -0
  217. Cython/Includes/libcpp/unordered_map.pxd +193 -0
  218. Cython/Includes/libcpp/unordered_set.pxd +152 -0
  219. Cython/Includes/libcpp/utility.pxd +30 -0
  220. Cython/Includes/libcpp/vector.pxd +186 -0
  221. Cython/Includes/numpy/math.pxd +150 -0
  222. Cython/Includes/openmp.pxd +50 -0
  223. Cython/Includes/posix/__init__.pxd +1 -0
  224. Cython/Includes/posix/dlfcn.pxd +14 -0
  225. Cython/Includes/posix/fcntl.pxd +86 -0
  226. Cython/Includes/posix/ioctl.pxd +4 -0
  227. Cython/Includes/posix/mman.pxd +101 -0
  228. Cython/Includes/posix/resource.pxd +57 -0
  229. Cython/Includes/posix/select.pxd +21 -0
  230. Cython/Includes/posix/signal.pxd +73 -0
  231. Cython/Includes/posix/stat.pxd +98 -0
  232. Cython/Includes/posix/stdio.pxd +37 -0
  233. Cython/Includes/posix/stdlib.pxd +29 -0
  234. Cython/Includes/posix/strings.pxd +9 -0
  235. Cython/Includes/posix/time.pxd +71 -0
  236. Cython/Includes/posix/types.pxd +30 -0
  237. Cython/Includes/posix/uio.pxd +26 -0
  238. Cython/Includes/posix/unistd.pxd +271 -0
  239. Cython/Includes/posix/wait.pxd +38 -0
  240. Cython/Plex/Actions.pxd +24 -0
  241. Cython/Plex/Actions.py +119 -0
  242. Cython/Plex/Actions.pyd +0 -0
  243. Cython/Plex/DFA.pxd +14 -0
  244. Cython/Plex/DFA.py +164 -0
  245. Cython/Plex/DFA.pyd +0 -0
  246. Cython/Plex/Errors.py +48 -0
  247. Cython/Plex/Lexicons.py +178 -0
  248. Cython/Plex/Machines.pxd +36 -0
  249. Cython/Plex/Machines.py +238 -0
  250. Cython/Plex/Machines.pyd +0 -0
  251. Cython/Plex/Regexps.py +535 -0
  252. Cython/Plex/Scanners.pxd +45 -0
  253. Cython/Plex/Scanners.py +328 -0
  254. Cython/Plex/Scanners.pyd +0 -0
  255. Cython/Plex/Transitions.pxd +14 -0
  256. Cython/Plex/Transitions.py +239 -0
  257. Cython/Plex/Transitions.pyd +0 -0
  258. Cython/Plex/__init__.py +34 -0
  259. Cython/Runtime/__init__.py +1 -0
  260. Cython/Runtime/refnanny.pyd +0 -0
  261. Cython/Runtime/refnanny.pyx +237 -0
  262. Cython/Shadow.py +690 -0
  263. Cython/Shadow.pyi +521 -0
  264. Cython/StringIOTree.py +170 -0
  265. Cython/StringIOTree.pyd +0 -0
  266. Cython/Tempita/__init__.py +4 -0
  267. Cython/Tempita/_looper.py +154 -0
  268. Cython/Tempita/_tempita.py +1091 -0
  269. Cython/Tempita/_tempita.pyd +0 -0
  270. Cython/TestUtils.py +422 -0
  271. Cython/Tests/TestCodeWriter.py +128 -0
  272. Cython/Tests/TestCythonUtils.py +202 -0
  273. Cython/Tests/TestJediTyper.py +223 -0
  274. Cython/Tests/TestShadow.py +114 -0
  275. Cython/Tests/TestStringIOTree.py +67 -0
  276. Cython/Tests/TestTestUtils.py +90 -0
  277. Cython/Tests/__init__.py +1 -0
  278. Cython/Tests/xmlrunner.py +390 -0
  279. Cython/Utility/AsyncGen.c +1031 -0
  280. Cython/Utility/Buffer.c +865 -0
  281. Cython/Utility/BufferFormatFromTypeInfo.pxd +2 -0
  282. Cython/Utility/Builtins.c +810 -0
  283. Cython/Utility/CConvert.pyx +134 -0
  284. Cython/Utility/CMath.c +104 -0
  285. Cython/Utility/CommonStructures.c +226 -0
  286. Cython/Utility/Complex.c +378 -0
  287. Cython/Utility/Coroutine.c +2300 -0
  288. Cython/Utility/CpdefEnums.pyx +103 -0
  289. Cython/Utility/CppConvert.pyx +282 -0
  290. Cython/Utility/CppSupport.cpp +151 -0
  291. Cython/Utility/CythonFunction.c +1832 -0
  292. Cython/Utility/Dataclasses.c +101 -0
  293. Cython/Utility/Embed.c +121 -0
  294. Cython/Utility/Exceptions.c +1016 -0
  295. Cython/Utility/ExtensionTypes.c +996 -0
  296. Cython/Utility/FunctionArguments.c +1043 -0
  297. Cython/Utility/FusedFunction.pyx +44 -0
  298. Cython/Utility/ImportExport.c +907 -0
  299. Cython/Utility/MemoryView.pxd +188 -0
  300. Cython/Utility/MemoryView.pyx +1482 -0
  301. Cython/Utility/MemoryView_C.c +927 -0
  302. Cython/Utility/ModuleSetupCode.c +3203 -0
  303. Cython/Utility/NumpyImportArray.c +46 -0
  304. Cython/Utility/ObjectHandling.c +3273 -0
  305. Cython/Utility/Optimize.c +1603 -0
  306. Cython/Utility/Overflow.c +384 -0
  307. Cython/Utility/Printing.c +86 -0
  308. Cython/Utility/Profile.c +732 -0
  309. Cython/Utility/StringTools.c +1379 -0
  310. Cython/Utility/Synchronization.c +399 -0
  311. Cython/Utility/TString.c +356 -0
  312. Cython/Utility/TestCyUtilityLoader.pyx +8 -0
  313. Cython/Utility/TestCythonScope.pyx +75 -0
  314. Cython/Utility/TestUtilityLoader.c +12 -0
  315. Cython/Utility/TypeConversion.c +1385 -0
  316. Cython/Utility/UFuncs.pyx +50 -0
  317. Cython/Utility/UFuncs_C.c +89 -0
  318. Cython/Utility/__init__.py +28 -0
  319. Cython/Utility/arrayarray.h +167 -0
  320. Cython/Utils.py +687 -0
  321. Cython/Utils.pyd +0 -0
  322. Cython/__init__.py +10 -0
  323. Cython/__init__.pyi +7 -0
  324. Cython/py.typed +0 -0
  325. cython-3.2.0.dist-info/METADATA +85 -0
  326. cython-3.2.0.dist-info/RECORD +333 -0
  327. cython-3.2.0.dist-info/WHEEL +5 -0
  328. cython-3.2.0.dist-info/entry_points.txt +4 -0
  329. cython-3.2.0.dist-info/top_level.txt +3 -0
  330. cython.py +29 -0
  331. pyximport/__init__.py +4 -0
  332. pyximport/pyxbuild.py +160 -0
  333. pyximport/pyximport.py +482 -0
@@ -0,0 +1,810 @@
1
+ /*
2
+ * Special implementations of built-in functions and methods.
3
+ *
4
+ * Optional optimisations for builtins are in Optimize.c.
5
+ *
6
+ * General object operations and protocols are in ObjectHandling.c.
7
+ */
8
+
9
+ //////////////////// Globals.proto ////////////////////
10
+
11
+ static PyObject* __Pyx_Globals(void); /*proto*/
12
+
13
+ //////////////////// Globals ////////////////////
14
+ //@requires: ObjectHandling.c::GetAttr
15
+
16
+ // This is a stub implementation until we have something more complete.
17
+ // Currently, we only handle the most common case of a read-only dict
18
+ // of Python names. Supporting cdef names in the module and write
19
+ // access requires a rewrite as a dedicated class.
20
+
21
+ static PyObject* __Pyx_Globals(void) {
22
+ return __Pyx_NewRef(NAMED_CGLOBAL(moddict_cname));
23
+ }
24
+
25
+ //////////////////// PyExecGlobals.proto ////////////////////
26
+
27
+ static PyObject* __Pyx_PyExecGlobals(PyObject*);
28
+
29
+ //////////////////// PyExecGlobals ////////////////////
30
+ //@requires: PyExec
31
+
32
+ static PyObject* __Pyx_PyExecGlobals(PyObject* code) {
33
+ return __Pyx_PyExec2(code, NAMED_CGLOBAL(moddict_cname));
34
+ }
35
+
36
+ //////////////////// PyExec.proto ////////////////////
37
+
38
+ static PyObject* __Pyx_PyExec3(PyObject*, PyObject*, PyObject*);
39
+ static CYTHON_INLINE PyObject* __Pyx_PyExec2(PyObject*, PyObject*);
40
+
41
+ //////////////////// PyExec ////////////////////
42
+
43
+ static CYTHON_INLINE PyObject* __Pyx_PyExec2(PyObject* o, PyObject* globals) {
44
+ return __Pyx_PyExec3(o, globals, NULL);
45
+ }
46
+
47
+ static PyObject* __Pyx_PyExec3(PyObject* o, PyObject* globals, PyObject* locals) {
48
+ PyObject* result;
49
+ #if !CYTHON_COMPILING_IN_LIMITED_API
50
+ PyObject* s = 0;
51
+ char *code = 0;
52
+ #endif
53
+
54
+ if (!globals || globals == Py_None) {
55
+ globals = NAMED_CGLOBAL(moddict_cname);
56
+ }
57
+ #if !CYTHON_COMPILING_IN_LIMITED_API
58
+ // In Limited API we just use exec builtin which already has this
59
+ else if (unlikely(!PyDict_Check(globals))) {
60
+ __Pyx_TypeName globals_type_name =
61
+ __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(globals));
62
+ PyErr_Format(PyExc_TypeError,
63
+ "exec() arg 2 must be a dict, not " __Pyx_FMT_TYPENAME,
64
+ globals_type_name);
65
+ __Pyx_DECREF_TypeName(globals_type_name);
66
+ goto bad;
67
+ }
68
+ #endif
69
+ if (!locals || locals == Py_None) {
70
+ locals = globals;
71
+ }
72
+
73
+ #if !CYTHON_COMPILING_IN_LIMITED_API
74
+ if (__Pyx_PyDict_GetItemStr(globals, PYIDENT("__builtins__")) == NULL) {
75
+ if (unlikely(PyDict_SetItem(globals, PYIDENT("__builtins__"), PyEval_GetBuiltins()) < 0))
76
+ goto bad;
77
+ }
78
+
79
+ if (PyCode_Check(o)) {
80
+ if (unlikely(__Pyx_PyCode_HasFreeVars((PyCodeObject *)o))) {
81
+ PyErr_SetString(PyExc_TypeError,
82
+ "code object passed to exec() may not contain free variables");
83
+ goto bad;
84
+ }
85
+ #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400
86
+ result = PyEval_EvalCode((PyCodeObject *)o, globals, locals);
87
+ #else
88
+ result = PyEval_EvalCode(o, globals, locals);
89
+ #endif
90
+ } else {
91
+ PyCompilerFlags cf;
92
+ cf.cf_flags = 0;
93
+ cf.cf_feature_version = PY_MINOR_VERSION;
94
+ if (PyUnicode_Check(o)) {
95
+ cf.cf_flags = PyCF_SOURCE_IS_UTF8;
96
+ s = PyUnicode_AsUTF8String(o);
97
+ if (unlikely(!s)) goto bad;
98
+ o = s;
99
+ } else if (unlikely(!PyBytes_Check(o))) {
100
+ __Pyx_TypeName o_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(o));
101
+ PyErr_Format(PyExc_TypeError,
102
+ "exec: arg 1 must be string, bytes or code object, got " __Pyx_FMT_TYPENAME,
103
+ o_type_name);
104
+ __Pyx_DECREF_TypeName(o_type_name);
105
+ goto bad;
106
+ }
107
+ code = PyBytes_AS_STRING(o);
108
+ if (PyEval_MergeCompilerFlags(&cf)) {
109
+ result = PyRun_StringFlags(code, Py_file_input, globals, locals, &cf);
110
+ } else {
111
+ result = PyRun_String(code, Py_file_input, globals, locals);
112
+ }
113
+ Py_XDECREF(s);
114
+ }
115
+
116
+ return result;
117
+ bad:
118
+ Py_XDECREF(s);
119
+ return 0;
120
+ #else // CYTHON_COMPILING_IN_LIMITED_API
121
+ {
122
+ // For the limited API we just defer to the actual builtin
123
+ // (after setting up globals and locals) - there's too much we can't do otherwise
124
+ PyObject *builtins, *exec, *exec_str;
125
+ builtins = PyEval_GetBuiltins();
126
+ if (!builtins) return NULL;
127
+ exec_str = PyUnicode_FromStringAndSize("exec", 4);
128
+ if (!exec_str) return NULL;
129
+ exec = PyObject_GetItem(builtins, exec_str);
130
+ Py_DECREF(exec_str);
131
+ if (!exec) return NULL;
132
+ result = PyObject_CallFunctionObjArgs(exec, o, globals, locals, NULL);
133
+ Py_DECREF(exec);
134
+ return result;
135
+ }
136
+ #endif
137
+ }
138
+
139
+ //////////////////// GetAttr3.proto ////////////////////
140
+
141
+ static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); /*proto*/
142
+
143
+ //////////////////// GetAttr3 ////////////////////
144
+ //@requires: ObjectHandling.c::PyObjectGetAttrStr
145
+ //@requires: Exceptions.c::PyThreadStateGet
146
+ //@requires: Exceptions.c::PyErrFetchRestore
147
+ //@requires: Exceptions.c::PyErrExceptionMatches
148
+
149
+ #if __PYX_LIMITED_VERSION_HEX < 0x030d0000
150
+ static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
151
+ __Pyx_PyThreadState_declare
152
+ __Pyx_PyThreadState_assign
153
+ if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
154
+ return NULL;
155
+ __Pyx_PyErr_Clear();
156
+ Py_INCREF(d);
157
+ return d;
158
+ }
159
+ #endif
160
+
161
+ static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
162
+ PyObject *r;
163
+ #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
164
+ int res = PyObject_GetOptionalAttr(o, n, &r);
165
+ // On failure (res == -1), r is set to NULL.
166
+ return (res != 0) ? r : __Pyx_NewRef(d);
167
+ #else
168
+ #if CYTHON_USE_TYPE_SLOTS
169
+ if (likely(PyUnicode_Check(n))) {
170
+ r = __Pyx_PyObject_GetAttrStrNoError(o, n);
171
+ if (unlikely(!r) && likely(!PyErr_Occurred())) {
172
+ r = __Pyx_NewRef(d);
173
+ }
174
+ return r;
175
+ }
176
+ #endif
177
+ r = PyObject_GetAttr(o, n);
178
+ return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
179
+ #endif
180
+ }
181
+
182
+ //////////////////// HasAttr.proto ////////////////////
183
+
184
+ #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
185
+ #define __Pyx_HasAttr(o, n) PyObject_HasAttrWithError(o, n)
186
+ #else
187
+ static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); /*proto*/
188
+ #endif
189
+
190
+ //////////////////// HasAttr ////////////////////
191
+ //@requires: ObjectHandling.c::PyObjectGetAttrStrNoError
192
+
193
+ #if __PYX_LIMITED_VERSION_HEX < 0x030d0000
194
+ static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
195
+ PyObject *r;
196
+ if (unlikely(!PyUnicode_Check(n))) {
197
+ PyErr_SetString(PyExc_TypeError,
198
+ "hasattr(): attribute name must be string");
199
+ return -1;
200
+ }
201
+ r = __Pyx_PyObject_GetAttrStrNoError(o, n);
202
+ if (!r) {
203
+ return (unlikely(PyErr_Occurred())) ? -1 : 0;
204
+ } else {
205
+ Py_DECREF(r);
206
+ return 1;
207
+ }
208
+ }
209
+ #endif
210
+
211
+ //////////////////// Intern.proto ////////////////////
212
+
213
+ static PyObject* __Pyx_Intern(PyObject* s); /* proto */
214
+
215
+ //////////////////// Intern ////////////////////
216
+ //@requires: ObjectHandling.c::RaiseUnexpectedTypeError
217
+
218
+ static PyObject* __Pyx_Intern(PyObject* s) {
219
+ if (unlikely(!PyUnicode_CheckExact(s))) {
220
+ __Pyx_RaiseUnexpectedTypeError("str", s);
221
+ return NULL;
222
+ }
223
+ Py_INCREF(s);
224
+ PyUnicode_InternInPlace(&s);
225
+ return s;
226
+ }
227
+
228
+ //////////////////// abs_longlong.proto ////////////////////
229
+
230
+ static CYTHON_INLINE PY_LONG_LONG __Pyx_abs_longlong(PY_LONG_LONG x) {
231
+ #if defined (__cplusplus) && __cplusplus >= 201103L
232
+ return std::abs(x);
233
+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
234
+ return llabs(x);
235
+ #elif defined (_MSC_VER)
236
+ // abs() is defined for long, but 64-bits type on MSVC is long long.
237
+ // Use MS-specific _abs64() instead, which returns the original (negative) value for abs(-MAX-1)
238
+ return _abs64(x);
239
+ #elif defined (__GNUC__)
240
+ // gcc or clang on 64 bit windows.
241
+ return __builtin_llabs(x);
242
+ #else
243
+ if (sizeof(PY_LONG_LONG) <= sizeof(Py_ssize_t))
244
+ return __Pyx_sst_abs(x);
245
+ return (x<0) ? -x : x;
246
+ #endif
247
+ }
248
+
249
+
250
+ //////////////////// py_abs.proto ////////////////////
251
+
252
+ #if CYTHON_USE_PYLONG_INTERNALS
253
+ static PyObject *__Pyx_PyLong_AbsNeg(PyObject *num);/*proto*/
254
+
255
+ #define __Pyx_PyNumber_Absolute(x) \
256
+ ((likely(PyLong_CheckExact(x))) ? \
257
+ (likely(__Pyx_PyLong_IsNonNeg(x)) ? __Pyx_NewRef(x) : __Pyx_PyLong_AbsNeg(x)) : \
258
+ PyNumber_Absolute(x))
259
+
260
+ #else
261
+ #define __Pyx_PyNumber_Absolute(x) PyNumber_Absolute(x)
262
+ #endif
263
+
264
+ //////////////////// py_abs ////////////////////
265
+
266
+ #if CYTHON_USE_PYLONG_INTERNALS
267
+ static PyObject *__Pyx_PyLong_AbsNeg(PyObject *n) {
268
+ #if PY_VERSION_HEX >= 0x030C00A7
269
+ if (likely(__Pyx_PyLong_IsCompact(n))) {
270
+ return PyLong_FromSize_t(__Pyx_PyLong_CompactValueUnsigned(n));
271
+ }
272
+ #else
273
+ if (likely(Py_SIZE(n) == -1)) {
274
+ // digits are unsigned
275
+ return PyLong_FromUnsignedLong(__Pyx_PyLong_Digits(n)[0]);
276
+ }
277
+ #endif
278
+ #if CYTHON_COMPILING_IN_CPYTHON
279
+ {
280
+ PyObject *copy = _PyLong_Copy((PyLongObject*)n);
281
+ if (likely(copy)) {
282
+ #if PY_VERSION_HEX >= 0x030C00A7
283
+ // clear the sign bits to set the sign from SIGN_NEGATIVE (2) to positive (0)
284
+ ((PyLongObject*)copy)->long_value.lv_tag ^= ((PyLongObject*)copy)->long_value.lv_tag & _PyLong_SIGN_MASK;
285
+ #else
286
+ // negate the size to swap the sign
287
+ __Pyx_SET_SIZE(copy, -Py_SIZE(copy));
288
+ #endif
289
+ }
290
+ return copy;
291
+ }
292
+ #else
293
+ return PyNumber_Negative(n);
294
+ #endif
295
+ }
296
+ #endif
297
+
298
+
299
+ //////////////////// pow2.proto ////////////////////
300
+
301
+ #define __Pyx_PyNumber_Power2(a, b) PyNumber_Power(a, b, Py_None)
302
+
303
+
304
+ //////////////////// divmod_int.proto //////////////////
305
+
306
+ const {{RETURN_TYPE}} __Pyx_divmod_ERROR_VALUE_{{CFUNC_SUFFIX}} = {-1, -1};
307
+
308
+ static CYTHON_INLINE {{RETURN_TYPE}} __Pyx_divmod_{{CFUNC_SUFFIX}}({{TYPE}} a, {{TYPE}} b); /*proto*/
309
+
310
+
311
+ //////////////////// divmod_int //////////////////
312
+
313
+ static CYTHON_INLINE {{RETURN_TYPE}} __Pyx_divmod_{{CFUNC_SUFFIX}}({{TYPE}} a, {{TYPE}} b) {
314
+ // Python and C/C++ use different algorithms in calculating quotients and remainders.
315
+ // This results in different answers between Python and C/C++
316
+ // when the dividend is negative and the divisor is positive and vice versa.
317
+ {{TYPE}} q, r;
318
+ if (unlikely(b == 0)) {
319
+ {{if NOGIL}}PyGILState_STATE gilstate = PyGILState_Ensure();{{endif}}
320
+ PyErr_SetString(PyExc_ZeroDivisionError, "division by zero");
321
+ {{if NOGIL}}PyGILState_Release(gilstate);{{endif}}
322
+ return __Pyx_divmod_ERROR_VALUE_{{CFUNC_SUFFIX}};
323
+ } else if (a == 0) {
324
+ q = 0;
325
+ r = 0;
326
+ } else if ((a < 0) != (b < 0)) {
327
+ // see CMath.c :: DivInt and ModInt utility code
328
+ q = a / b;
329
+ r = a - q * b;
330
+ {{TYPE}} adapt_python = ((r != 0) & ((r < 0) ^ (b < 0)));
331
+ q -= adapt_python;
332
+ r += adapt_python * b;
333
+ }
334
+ else {
335
+ q = a / b;
336
+ r = a % b;
337
+ }
338
+
339
+ {{RETURN_TYPE}} c_result = {q, r};
340
+ return c_result;
341
+ }
342
+
343
+
344
+ //////////////////// divmod_float.proto //////////////////
345
+
346
+ const {{RETURN_TYPE}} __Pyx_divmod_ERROR_VALUE_{{CFUNC_SUFFIX}} = {-1.0, -1.0};
347
+
348
+ static CYTHON_INLINE {{RETURN_TYPE}} __Pyx_divmod_{{CFUNC_SUFFIX}}({{TYPE}} a, {{TYPE}} b); /*proto*/
349
+
350
+
351
+ //////////////////// divmod_float //////////////////
352
+
353
+ static CYTHON_INLINE {{RETURN_TYPE}} __Pyx_divmod_{{CFUNC_SUFFIX}}({{TYPE}} a, {{TYPE}} b) {
354
+ // Python and C/C++ use different algorithms in calculating quotients and remainders.
355
+ // This results in different answers between Python and C/C++
356
+ // when the dividend is negative and the divisor is positive and vice versa.
357
+
358
+ // Adapted from CPython 3.14: floatobject.c / _float_div_mod()
359
+
360
+ {{TYPE}} q, r, div;
361
+
362
+ if (unlikely(b == 0.0)) {
363
+ {{if NOGIL}}PyGILState_STATE gilstate = PyGILState_Ensure();{{endif}}
364
+ PyErr_SetString(PyExc_ZeroDivisionError, "division by zero");
365
+ {{if NOGIL}}PyGILState_Release(gilstate);{{endif}}
366
+ return __Pyx_divmod_ERROR_VALUE_{{CFUNC_SUFFIX}};
367
+ }
368
+
369
+ r = fmod{{MATH_SUFFIX}}(a, b);
370
+ // fmod is typically exact, so a-mod is *mathematically* an
371
+ // exact multiple of b. But this is fp arithmetic, and fp
372
+ // a - mod is an approximation; the result is that div may
373
+ // not be an exact integral value after the division, although
374
+ // it will always be very close to one.
375
+ div = (a - r) / b;
376
+ if (r) {
377
+ // ensure the remainder has the same sign as the denominator
378
+ if ((b < 0) != (r < 0)) {
379
+ r += b;
380
+ div -= 1.0;
381
+ }
382
+ }
383
+ else {
384
+ // the remainder is zero, and in the presence of signed zeroes
385
+ // fmod returns different results across platforms; ensure
386
+ // it has the same sign as the denominator.
387
+ r = copysign{{MATH_SUFFIX}}(0.0, b);
388
+ }
389
+ // snap quotient to nearest integral value
390
+ if (div) {
391
+ q = floor{{MATH_SUFFIX}}(div);
392
+ if (div - q > 0.5) {
393
+ q += 1.0;
394
+ }
395
+ }
396
+ else {
397
+ // div is zero - get the same sign as the true quotient
398
+ q = copysign{{MATH_SUFFIX}}(0.0, a / b); /* zero w/ sign of a/b */
399
+ }
400
+
401
+ {{RETURN_TYPE}} c_result = {q, r};
402
+ return c_result;
403
+ }
404
+
405
+
406
+ //////////////////// int_pyucs4.proto ////////////////////
407
+
408
+ static CYTHON_INLINE int __Pyx_int_from_UCS4(Py_UCS4 uchar);
409
+
410
+ //////////////////// int_pyucs4 ////////////////////
411
+
412
+ static int __Pyx_int_from_UCS4(Py_UCS4 uchar) {
413
+ // Fast path for ascii digits
414
+ if (likely(uchar >= (Py_UCS4)'0' && uchar <= (Py_UCS4)'9')) {
415
+ return uchar - (Py_UCS4)'0';
416
+ }
417
+ #if CYTHON_COMPILING_IN_LIMITED_API
418
+ PyObject *u = PyUnicode_FromOrdinal(uchar);
419
+ if (unlikely(!u)) return -1;
420
+ PyObject *l = PyObject_CallFunctionObjArgs((PyObject*)(&PyLong_Type), u, NULL);
421
+ Py_DECREF(u);
422
+ if (unlikely(!l)) return -1;
423
+ #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
424
+ int result = PyLong_AsInt(l);
425
+ #else
426
+ // just don't handle overflow - it's very difficult to see how we'll get it from
427
+ // a single digit.
428
+ int result = (int)PyLong_AsLong(l);
429
+ #endif
430
+ Py_DECREF(l);
431
+ return result;
432
+ #else
433
+ int digit = Py_UNICODE_TODECIMAL(uchar);
434
+ if (unlikely(digit < 0)) {
435
+ PyErr_Format(PyExc_ValueError,
436
+ "invalid literal for int() with base 10: '%c'",
437
+ (int) uchar);
438
+ return -1;
439
+ }
440
+ return digit;
441
+ #endif
442
+ }
443
+
444
+
445
+ //////////////////// float_pyucs4.proto ////////////////////
446
+
447
+ static CYTHON_INLINE double __Pyx_double_from_UCS4(Py_UCS4 uchar);
448
+
449
+ //////////////////// float_pyucs4 ////////////////////
450
+
451
+ static double __Pyx_double_from_UCS4(Py_UCS4 uchar) {
452
+ // fast path for "just an ascii digit"
453
+ if (likely(uchar >= (Py_UCS4)'0' && uchar <= (Py_UCS4)'9')) {
454
+ return uchar - (Py_UCS4)'0';
455
+ }
456
+ #if CYTHON_COMPILING_IN_LIMITED_API
457
+ PyObject *u = PyUnicode_FromOrdinal(uchar);
458
+ if (unlikely(!u)) return -1.0;
459
+ PyObject *f = PyFloat_FromString(u);
460
+ Py_DECREF(u);
461
+ if (unlikely(!f)) return -1.0;
462
+ double result = PyFloat_AsDouble(f);
463
+ Py_DECREF(f);
464
+ return result;
465
+ #else
466
+ // ...TONUMERIC would initially seem to be a better fit.
467
+ // However, that accepts things like the "half" symbol, while
468
+ // float(string) rejects those.
469
+ double digit = Py_UNICODE_TODECIMAL(uchar);
470
+ if (unlikely(digit < 0.0)) {
471
+ PyErr_Format(PyExc_ValueError,
472
+ "could not convert string to float: '%c'",
473
+ (int) uchar);
474
+ return -1.0;
475
+ }
476
+ return digit;
477
+ #endif
478
+ }
479
+
480
+
481
+ //////////////////// object_ord.proto ////////////////////
482
+ //@requires: TypeConversion.c::UnicodeAsUCS4
483
+
484
+ #define __Pyx_PyObject_Ord(c) \
485
+ (likely(PyUnicode_Check(c)) ? (long)__Pyx_PyUnicode_AsPy_UCS4(c) : __Pyx__PyObject_Ord(c))
486
+ static long __Pyx__PyObject_Ord(PyObject* c); /*proto*/
487
+
488
+ //////////////////// object_ord ////////////////////
489
+
490
+ static long __Pyx__PyObject_Ord(PyObject* c) {
491
+ Py_ssize_t size;
492
+ if (PyBytes_Check(c)) {
493
+ size = __Pyx_PyBytes_GET_SIZE(c);
494
+ if (likely(size == 1)) {
495
+ #if CYTHON_ASSUME_SAFE_MACROS
496
+ return (unsigned char) PyBytes_AS_STRING(c)[0];
497
+ #else
498
+ char *data = PyBytes_AsString(c);
499
+ if (unlikely(!data)) return -1;
500
+ return (unsigned char) data[0];
501
+ #endif
502
+ }
503
+ #if !CYTHON_ASSUME_SAFE_SIZE
504
+ else if (unlikely(size < 0)) return -1;
505
+ #endif
506
+ } else if (PyByteArray_Check(c)) {
507
+ size = __Pyx_PyByteArray_GET_SIZE(c);
508
+ if (likely(size == 1)) {
509
+ #if CYTHON_ASSUME_SAFE_MACROS
510
+ return (unsigned char) PyByteArray_AS_STRING(c)[0];
511
+ #else
512
+ char *data = PyByteArray_AsString(c);
513
+ if (unlikely(!data)) return -1;
514
+ return (unsigned char) data[0];
515
+ #endif
516
+ }
517
+ #if !CYTHON_ASSUME_SAFE_SIZE
518
+ else if (unlikely(size < 0)) return -1;
519
+ #endif
520
+ } else {
521
+ // FIXME: support character buffers - but CPython doesn't support them either
522
+ __Pyx_TypeName c_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(c));
523
+ PyErr_Format(PyExc_TypeError,
524
+ "ord() expected string of length 1, but " __Pyx_FMT_TYPENAME " found",
525
+ c_type_name);
526
+ __Pyx_DECREF_TypeName(c_type_name);
527
+ return (long)(Py_UCS4)-1;
528
+ }
529
+ PyErr_Format(PyExc_TypeError,
530
+ "ord() expected a character, but string of length %zd found", size);
531
+ return (long)(Py_UCS4)-1;
532
+ }
533
+
534
+
535
+ //////////////////// py_dict_keys.proto ////////////////////
536
+
537
+ static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d); /*proto*/
538
+
539
+ //////////////////// py_dict_keys ////////////////////
540
+
541
+ static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d) {
542
+ return CALL_UNBOUND_METHOD(PyDict_Type, "keys", d);
543
+ }
544
+
545
+ //////////////////// py_dict_values.proto ////////////////////
546
+
547
+ static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d); /*proto*/
548
+
549
+ //////////////////// py_dict_values ////////////////////
550
+
551
+ static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) {
552
+ return CALL_UNBOUND_METHOD(PyDict_Type, "values", d);
553
+ }
554
+
555
+ //////////////////// py_dict_items.proto ////////////////////
556
+
557
+ static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d); /*proto*/
558
+
559
+ //////////////////// py_dict_items ////////////////////
560
+
561
+ static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) {
562
+ return CALL_UNBOUND_METHOD(PyDict_Type, "items", d);
563
+ }
564
+
565
+ //////////////////// py_dict_iterkeys.proto ////////////////////
566
+
567
+ static CYTHON_INLINE PyObject* __Pyx_PyDict_IterKeys(PyObject* d); /*proto*/
568
+
569
+ //////////////////// py_dict_iterkeys ////////////////////
570
+
571
+ static CYTHON_INLINE PyObject* __Pyx_PyDict_IterKeys(PyObject* d) {
572
+ return CALL_UNBOUND_METHOD(PyDict_Type, "keys", d);
573
+ }
574
+
575
+ //////////////////// py_dict_itervalues.proto ////////////////////
576
+
577
+ static CYTHON_INLINE PyObject* __Pyx_PyDict_IterValues(PyObject* d); /*proto*/
578
+
579
+ //////////////////// py_dict_itervalues ////////////////////
580
+
581
+ static CYTHON_INLINE PyObject* __Pyx_PyDict_IterValues(PyObject* d) {
582
+ return CALL_UNBOUND_METHOD(PyDict_Type, "values", d);
583
+ }
584
+
585
+ //////////////////// py_dict_iteritems.proto ////////////////////
586
+
587
+ static CYTHON_INLINE PyObject* __Pyx_PyDict_IterItems(PyObject* d); /*proto*/
588
+
589
+ //////////////////// py_dict_iteritems ////////////////////
590
+
591
+ static CYTHON_INLINE PyObject* __Pyx_PyDict_IterItems(PyObject* d) {
592
+ return CALL_UNBOUND_METHOD(PyDict_Type, "items", d);
593
+ }
594
+
595
+ //////////////////// py_dict_viewkeys.proto ////////////////////
596
+
597
+ static CYTHON_INLINE PyObject* __Pyx_PyDict_ViewKeys(PyObject* d); /*proto*/
598
+
599
+ //////////////////// py_dict_viewkeys ////////////////////
600
+
601
+ static CYTHON_INLINE PyObject* __Pyx_PyDict_ViewKeys(PyObject* d) {
602
+ return CALL_UNBOUND_METHOD(PyDict_Type, "keys", d);
603
+ }
604
+
605
+ //////////////////// py_dict_viewvalues.proto ////////////////////
606
+
607
+ static CYTHON_INLINE PyObject* __Pyx_PyDict_ViewValues(PyObject* d); /*proto*/
608
+
609
+ //////////////////// py_dict_viewvalues ////////////////////
610
+
611
+ static CYTHON_INLINE PyObject* __Pyx_PyDict_ViewValues(PyObject* d) {
612
+ return CALL_UNBOUND_METHOD(PyDict_Type, "values", d);
613
+ }
614
+
615
+ //////////////////// py_dict_viewitems.proto ////////////////////
616
+
617
+ static CYTHON_INLINE PyObject* __Pyx_PyDict_ViewItems(PyObject* d); /*proto*/
618
+
619
+ //////////////////// py_dict_viewitems ////////////////////
620
+
621
+ static CYTHON_INLINE PyObject* __Pyx_PyDict_ViewItems(PyObject* d) {
622
+ return CALL_UNBOUND_METHOD(PyDict_Type, "items", d);
623
+ }
624
+
625
+
626
+ /////////////// dict_setdefault.proto ///////////////
627
+
628
+ static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value); /*proto*/
629
+
630
+ /////////////// dict_setdefault ///////////////
631
+
632
+ static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value) {
633
+ PyObject* value;
634
+ #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030C0000
635
+ PyObject *args[] = {d, key, default_value};
636
+ value = PyObject_VectorcallMethod(PYIDENT("setdefault"), args, 3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
637
+ #elif CYTHON_COMPILING_IN_LIMITED_API
638
+ value = PyObject_CallMethodObjArgs(d, PYIDENT("setdefault"), key, default_value, NULL);
639
+ #elif PY_VERSION_HEX >= 0x030d0000
640
+ PyDict_SetDefaultRef(d, key, default_value, &value);
641
+ #else
642
+ value = PyDict_SetDefault(d, key, default_value);
643
+ if (unlikely(!value)) return NULL;
644
+ Py_INCREF(value);
645
+ #endif
646
+ return value;
647
+ }
648
+
649
+
650
+ //////////////////// pyfrozenset_new.proto ////////////////////
651
+
652
+ static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it);
653
+
654
+ //////////////////// pyfrozenset_new ////////////////////
655
+ //@requires: ObjectHandling.c::PyObjectCallNoArg
656
+
657
+ static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it) {
658
+ if (it) {
659
+ PyObject* result;
660
+ #if CYTHON_COMPILING_IN_PYPY
661
+ // PyPy currently lacks PyFrozenSet_CheckExact() and PyFrozenSet_New()
662
+ PyObject* args;
663
+ args = PyTuple_Pack(1, it);
664
+ if (unlikely(!args))
665
+ return NULL;
666
+ result = PyObject_Call((PyObject*)&PyFrozenSet_Type, args, NULL);
667
+ Py_DECREF(args);
668
+ return result;
669
+ #else
670
+ if (PyFrozenSet_CheckExact(it)) {
671
+ Py_INCREF(it);
672
+ return it;
673
+ }
674
+ result = PyFrozenSet_New(it);
675
+ if (unlikely(!result))
676
+ return NULL;
677
+ if ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000)
678
+ #if CYTHON_COMPILING_IN_LIMITED_API
679
+ || __Pyx_get_runtime_version() >= 0x030A0000
680
+ #endif
681
+ )
682
+ return result;
683
+ {
684
+ Py_ssize_t size = __Pyx_PySet_GET_SIZE(result);
685
+ if (likely(size > 0))
686
+ return result;
687
+ #if !CYTHON_ASSUME_SAFE_SIZE
688
+ if (unlikely(size < 0)) {
689
+ Py_DECREF(result);
690
+ return NULL;
691
+ }
692
+ #endif
693
+ }
694
+ // empty frozenset is a singleton (on Python <3.10)
695
+ // seems wasteful, but CPython does the same
696
+ Py_DECREF(result);
697
+ #endif
698
+ }
699
+ return __Pyx_PyObject_CallNoArg((PyObject*) &PyFrozenSet_Type);
700
+ }
701
+
702
+
703
+ //////////////////// PySet_Update.proto ////////////////////
704
+
705
+ static CYTHON_INLINE int __Pyx_PySet_Update(PyObject* set, PyObject* it); /*proto*/
706
+
707
+ //////////////////// PySet_Update ////////////////////
708
+
709
+ static CYTHON_INLINE int __Pyx_PySet_Update(PyObject* set, PyObject* it) {
710
+ PyObject *retval;
711
+ #if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
712
+ if (PyAnySet_Check(it)) {
713
+ Py_ssize_t size = __Pyx_PySet_GET_SIZE(it);
714
+ #if !CYTHON_ASSUME_SAFE_SIZE
715
+ if (unlikely(size < 0)) return -1;
716
+ #endif
717
+ if (size == 0)
718
+ return 0;
719
+ // fast and safe case: CPython will update our result set and return it
720
+ retval = PySet_Type.tp_as_number->nb_inplace_or(set, it);
721
+ if (likely(retval == set)) {
722
+ Py_DECREF(retval);
723
+ return 0;
724
+ }
725
+ if (unlikely(!retval))
726
+ return -1;
727
+ // unusual result, fall through to set.update() call below
728
+ Py_DECREF(retval);
729
+ }
730
+ #endif
731
+ retval = CALL_UNBOUND_METHOD(PySet_Type, "update", set, it);
732
+ if (unlikely(!retval)) return -1;
733
+ Py_DECREF(retval);
734
+ return 0;
735
+ }
736
+
737
+ //////////////////// PyRange_Check.proto ////////////////////
738
+
739
+ #if CYTHON_COMPILING_IN_PYPY && !defined(PyRange_Check)
740
+ #define PyRange_Check(obj) __Pyx_TypeCheck((obj), &PyRange_Type)
741
+ #endif
742
+
743
+
744
+ ///////////////// memoryview_get_from_buffer.proto ////////////////////
745
+
746
+ #if !CYTHON_COMPILING_IN_LIMITED_API
747
+ #define __Pyx_PyMemoryView_Get_{{name}}(o) PyMemoryView_GET_BUFFER(o)->{{name}}
748
+ #else
749
+ {{py:
750
+ out_types = dict(
751
+ ndim='int', readonly='int',
752
+ len='Py_ssize_t', itemsize='Py_ssize_t')
753
+ }} // can't get format like this unfortunately. It's unicode via getattr
754
+ {{py: out_type = out_types[name]}}
755
+ static {{out_type}} __Pyx_PyMemoryView_Get_{{name}}(PyObject *obj); /* proto */
756
+ #endif
757
+
758
+ ////////////// memoryview_get_from_buffer /////////////////////////
759
+
760
+ #if !CYTHON_COMPILING_IN_LIMITED_API
761
+ #else
762
+ {{py:
763
+ out_types = dict(
764
+ ndim='int', readonly='int',
765
+ len='Py_ssize_t', itemsize='Py_ssize_t')
766
+ }}
767
+ {{py: out_type = out_types[name]}}
768
+ static {{out_type}} __Pyx_PyMemoryView_Get_{{name}}(PyObject *obj) {
769
+ {{out_type}} result;
770
+ PyObject *attr = PyObject_GetAttr(obj, PYIDENT("{{name}}"));
771
+ if (!attr) {
772
+ goto bad;
773
+ }
774
+ {{if out_type == 'int'}}
775
+ // I'm not worrying about overflow here because
776
+ // ultimately it comes from a C struct that's an int
777
+ result = PyLong_AsLong(attr);
778
+ {{elif out_type == 'Py_ssize_t'}}
779
+ result = PyLong_AsSsize_t(attr);
780
+ {{endif}}
781
+ Py_DECREF(attr);
782
+ return result;
783
+
784
+ bad:
785
+ Py_XDECREF(attr);
786
+ return -1;
787
+ }
788
+ #endif
789
+
790
+ ////////////// PySliceAccessors.proto /////////////////////////
791
+
792
+ #if CYTHON_COMPILING_IN_LIMITED_API
793
+ #define __Pyx_PySlice_Start(o) PyObject_GetAttr(o, PYIDENT("start"))
794
+ #define __Pyx_PySlice_Stop(o) PyObject_GetAttr(o, PYIDENT("stop"))
795
+ #define __Pyx_PySlice_Step(o) PyObject_GetAttr(o, PYIDENT("step"))
796
+ #elif CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
797
+ // Graal defines it's own accessor functions
798
+ #define __Pyx_PySlice_Start(o) GraalPySlice_Start(o)
799
+ #define __Pyx_PySlice_Stop(o) GraalPySlice_Stop(o)
800
+ #define __Pyx_PySlice_Step(o) GraalPySlice_Step(o)
801
+ #elif CYTHON_COMPILING_IN_GRAAL
802
+ // Remove when GraalPy 24 goes EOL
803
+ #define __Pyx_PySlice_Start(o) __Pyx_NewRef(PySlice_Start((PySliceObject*)o))
804
+ #define __Pyx_PySlice_Stop(o) __Pyx_NewRef(PySlice_Stop((PySliceObject*)o))
805
+ #define __Pyx_PySlice_Step(o) __Pyx_NewRef(PySlice_Step((PySliceObject*)o))
806
+ #else
807
+ #define __Pyx_PySlice_Start(o) __Pyx_NewRef(((PySliceObject*)o)->start)
808
+ #define __Pyx_PySlice_Stop(o) __Pyx_NewRef(((PySliceObject*)o)->stop)
809
+ #define __Pyx_PySlice_Step(o) __Pyx_NewRef(((PySliceObject*)o)->step)
810
+ #endif