ManimPango 0.4.3__cp39-cp39-win32.whl → 1.0.0a2__cp39-cp39-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 (83) hide show
  1. {ManimPango-0.4.3.dist-info → ManimPango-1.0.0a2.dist-info}/METADATA +2 -2
  2. ManimPango-1.0.0a2.dist-info/RECORD +85 -0
  3. {ManimPango-0.4.3.dist-info → ManimPango-1.0.0a2.dist-info}/WHEEL +1 -1
  4. manimpango/__init__.py +5 -7
  5. manimpango/_distributor_init.py +36 -0
  6. manimpango/_version.py +1 -1
  7. manimpango/attributes/__init__.py +324 -0
  8. manimpango/attributes/attributes.pxi +219 -0
  9. manimpango/buffer.pxi +15 -0
  10. manimpango/cmanimpango.c +10025 -0
  11. manimpango/cmanimpango.cp39-win32.pyd +0 -0
  12. manimpango/enums.c +3721 -0
  13. manimpango/enums.cp39-win32.pyd +0 -0
  14. manimpango/enums.pyx +1 -10
  15. manimpango/exceptions.py +5 -0
  16. manimpango/fonts/__init__.py +153 -0
  17. manimpango/fonts/_font_desc.c +7576 -0
  18. manimpango/fonts/_font_desc.cp39-win32.pyd +0 -0
  19. manimpango/fonts/_font_desc.pxd +5 -0
  20. manimpango/fonts/_font_desc.pyi +25 -0
  21. manimpango/fonts/_font_desc.pyx +114 -0
  22. manimpango/fonts/enums.c +3628 -0
  23. manimpango/fonts/enums.cp39-win32.pyd +0 -0
  24. manimpango/fonts/enums.pyi +23 -0
  25. manimpango/fonts/enums.pyx +84 -0
  26. manimpango/{cairo.pxd → include/cairo.pxd} +21 -0
  27. manimpango/include/glib.pxd +36 -0
  28. manimpango/{pango.pxd → include/pango.pxd} +61 -0
  29. manimpango/include/pango_attributes.pxd +184 -0
  30. manimpango/layout/__init__.py +266 -0
  31. manimpango/layout/_layout.c +8630 -0
  32. manimpango/layout/_layout.cp39-win32.pyd +0 -0
  33. manimpango/layout/_layout.pyx +60 -0
  34. manimpango/layout/layout.pxi +52 -0
  35. manimpango/register_font.c +5016 -0
  36. manimpango/register_font.cp39-win32.pyd +0 -0
  37. manimpango/renderer/__init__.py +5 -0
  38. manimpango/renderer/cairo_utils.pxi +72 -0
  39. manimpango/renderer/image_renderer.c +12319 -0
  40. manimpango/renderer/image_renderer.cp39-win32.pyd +0 -0
  41. manimpango/renderer/image_renderer.pxd +23 -0
  42. manimpango/renderer/image_renderer.pyi +21 -0
  43. manimpango/renderer/image_renderer.pyx +219 -0
  44. manimpango/renderer/svg_renderer.c +10671 -0
  45. manimpango/renderer/svg_renderer.cp39-win32.pyd +0 -0
  46. manimpango/renderer/svg_renderer.pxd +23 -0
  47. manimpango/renderer/svg_renderer.pyi +17 -0
  48. manimpango/renderer/svg_renderer.pyx +174 -0
  49. manimpango/utils/__init__.py +3 -0
  50. manimpango/utils/_utils.cp39-win32.pyd +0 -0
  51. manimpango/utils/_utils.pyi +2 -0
  52. manimpango/utils/utils.c +3533 -0
  53. manimpango/{utils.py → utils/utils.py} +3 -1
  54. manimpango/utils/utils.pyx +27 -0
  55. ManimPango-0.4.3.dist-info/RECORD +0 -44
  56. manimpango/glib.pxd +0 -13
  57. {ManimPango-0.4.3.dist-info → ManimPango-1.0.0a2.dist-info}/LICENSE +0 -0
  58. {ManimPango-0.4.3.dist-info → ManimPango-1.0.0a2.dist-info}/LICENSE.win32 +0 -0
  59. {ManimPango-0.4.3.dist-info → ManimPango-1.0.0a2.dist-info}/top_level.txt +0 -0
  60. /manimpango/{CORE_MANIM_cairo-2.dll → .libs/CORE_MANIM_cairo-2.dll} +0 -0
  61. /manimpango/{CORE_MANIM_cairo-gobject-2.dll → .libs/CORE_MANIM_cairo-gobject-2.dll} +0 -0
  62. /manimpango/{CORE_MANIM_cairo-script-interpreter-2.dll → .libs/CORE_MANIM_cairo-script-interpreter-2.dll} +0 -0
  63. /manimpango/{CORE_MANIM_expat.dll → .libs/CORE_MANIM_expat.dll} +0 -0
  64. /manimpango/{CORE_MANIM_ffi-7.dll → .libs/CORE_MANIM_ffi-7.dll} +0 -0
  65. /manimpango/{CORE_MANIM_fontconfig-1.dll → .libs/CORE_MANIM_fontconfig-1.dll} +0 -0
  66. /manimpango/{CORE_MANIM_freetype-6.dll → .libs/CORE_MANIM_freetype-6.dll} +0 -0
  67. /manimpango/{CORE_MANIM_fribidi-0.dll → .libs/CORE_MANIM_fribidi-0.dll} +0 -0
  68. /manimpango/{CORE_MANIM_gio-2.0-0.dll → .libs/CORE_MANIM_gio-2.0-0.dll} +0 -0
  69. /manimpango/{CORE_MANIM_glib-2.0-0.dll → .libs/CORE_MANIM_glib-2.0-0.dll} +0 -0
  70. /manimpango/{CORE_MANIM_gmodule-2.0-0.dll → .libs/CORE_MANIM_gmodule-2.0-0.dll} +0 -0
  71. /manimpango/{CORE_MANIM_gobject-2.0-0.dll → .libs/CORE_MANIM_gobject-2.0-0.dll} +0 -0
  72. /manimpango/{CORE_MANIM_gthread-2.0-0.dll → .libs/CORE_MANIM_gthread-2.0-0.dll} +0 -0
  73. /manimpango/{CORE_MANIM_harfbuzz-gobject.dll → .libs/CORE_MANIM_harfbuzz-gobject.dll} +0 -0
  74. /manimpango/{CORE_MANIM_harfbuzz-subset.dll → .libs/CORE_MANIM_harfbuzz-subset.dll} +0 -0
  75. /manimpango/{CORE_MANIM_harfbuzz.dll → .libs/CORE_MANIM_harfbuzz.dll} +0 -0
  76. /manimpango/{CORE_MANIM_intl-8.dll → .libs/CORE_MANIM_intl-8.dll} +0 -0
  77. /manimpango/{CORE_MANIM_pango-1.0-0.dll → .libs/CORE_MANIM_pango-1.0-0.dll} +0 -0
  78. /manimpango/{CORE_MANIM_pangocairo-1.0-0.dll → .libs/CORE_MANIM_pangocairo-1.0-0.dll} +0 -0
  79. /manimpango/{CORE_MANIM_pangoft2-1.0-0.dll → .libs/CORE_MANIM_pangoft2-1.0-0.dll} +0 -0
  80. /manimpango/{CORE_MANIM_pangowin32-1.0-0.dll → .libs/CORE_MANIM_pangowin32-1.0-0.dll} +0 -0
  81. /manimpango/{CORE_MANIM_pixman-1-0.dll → .libs/CORE_MANIM_pixman-1-0.dll} +0 -0
  82. /manimpango/{CORE_MANIM_png16-16.dll → .libs/CORE_MANIM_png16-16.dll} +0 -0
  83. /manimpango/{CORE_MANIM_z.dll → .libs/CORE_MANIM_z.dll} +0 -0
manimpango/enums.c ADDED
@@ -0,0 +1,3721 @@
1
+ /* Generated by Cython 0.29.34 */
2
+
3
+ /* BEGIN: Cython Metadata
4
+ {
5
+ "distutils": {
6
+ "define_macros": [
7
+ [
8
+ "UNICODE",
9
+ 1
10
+ ]
11
+ ],
12
+ "depends": [
13
+ "C:\\cibw\\vendor\\include\\cairo\\cairo-svg.h",
14
+ "C:\\cibw\\vendor\\include\\cairo\\cairo.h",
15
+ "C:\\cibw\\vendor\\include\\glib-2.0\\glib.h",
16
+ "C:\\cibw\\vendor\\include\\pango-1.0\\pango\\pango.h",
17
+ "C:\\cibw\\vendor\\include\\pango-1.0\\pango\\pangocairo.h"
18
+ ],
19
+ "include_dirs": [
20
+ "C:/cibw/vendor/include/cairo",
21
+ "C:/cibw/vendor/include/pixman-1",
22
+ "C:/cibw/vendor/include/glib-2.0",
23
+ "C:/cibw/vendor/include/harfbuzz",
24
+ "C:/cibw/vendor/include/pango-1.0",
25
+ "C:/cibw/vendor/include",
26
+ "C:/cibw/vendor/include/fribidi",
27
+ "C:/cibw/vendor/include/freetype2",
28
+ "C:/cibw/vendor/lib/glib-2.0/include"
29
+ ],
30
+ "libraries": [
31
+ "Gdi32",
32
+ "gobject-2.0",
33
+ "glib-2.0",
34
+ "fontconfig",
35
+ "harfbuzz",
36
+ "pangoft2-1.0",
37
+ "pangocairo-1.0",
38
+ "intl",
39
+ "freetype",
40
+ "pango-1.0",
41
+ "cairo"
42
+ ],
43
+ "library_dirs": [
44
+ "C:/cibw/vendor/lib"
45
+ ],
46
+ "name": "manimpango.enums",
47
+ "sources": [
48
+ "manimpango\\enums.pyx"
49
+ ]
50
+ },
51
+ "module_name": "manimpango.enums"
52
+ }
53
+ END: Cython Metadata */
54
+
55
+ #ifndef PY_SSIZE_T_CLEAN
56
+ #define PY_SSIZE_T_CLEAN
57
+ #endif /* PY_SSIZE_T_CLEAN */
58
+ #include "Python.h"
59
+ #ifndef Py_PYTHON_H
60
+ #error Python headers needed to compile C extensions, please install development version of Python.
61
+ #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
62
+ #error Cython requires Python 2.6+ or Python 3.3+.
63
+ #else
64
+ #define CYTHON_ABI "0_29_34"
65
+ #define CYTHON_HEX_VERSION 0x001D22F0
66
+ #define CYTHON_FUTURE_DIVISION 1
67
+ #include <stddef.h>
68
+ #ifndef offsetof
69
+ #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
70
+ #endif
71
+ #if !defined(WIN32) && !defined(MS_WINDOWS)
72
+ #ifndef __stdcall
73
+ #define __stdcall
74
+ #endif
75
+ #ifndef __cdecl
76
+ #define __cdecl
77
+ #endif
78
+ #ifndef __fastcall
79
+ #define __fastcall
80
+ #endif
81
+ #endif
82
+ #ifndef DL_IMPORT
83
+ #define DL_IMPORT(t) t
84
+ #endif
85
+ #ifndef DL_EXPORT
86
+ #define DL_EXPORT(t) t
87
+ #endif
88
+ #define __PYX_COMMA ,
89
+ #ifndef HAVE_LONG_LONG
90
+ #if PY_VERSION_HEX >= 0x02070000
91
+ #define HAVE_LONG_LONG
92
+ #endif
93
+ #endif
94
+ #ifndef PY_LONG_LONG
95
+ #define PY_LONG_LONG LONG_LONG
96
+ #endif
97
+ #ifndef Py_HUGE_VAL
98
+ #define Py_HUGE_VAL HUGE_VAL
99
+ #endif
100
+ #ifdef PYPY_VERSION
101
+ #define CYTHON_COMPILING_IN_PYPY 1
102
+ #define CYTHON_COMPILING_IN_PYSTON 0
103
+ #define CYTHON_COMPILING_IN_CPYTHON 0
104
+ #define CYTHON_COMPILING_IN_NOGIL 0
105
+ #undef CYTHON_USE_TYPE_SLOTS
106
+ #define CYTHON_USE_TYPE_SLOTS 0
107
+ #undef CYTHON_USE_PYTYPE_LOOKUP
108
+ #define CYTHON_USE_PYTYPE_LOOKUP 0
109
+ #if PY_VERSION_HEX < 0x03050000
110
+ #undef CYTHON_USE_ASYNC_SLOTS
111
+ #define CYTHON_USE_ASYNC_SLOTS 0
112
+ #elif !defined(CYTHON_USE_ASYNC_SLOTS)
113
+ #define CYTHON_USE_ASYNC_SLOTS 1
114
+ #endif
115
+ #undef CYTHON_USE_PYLIST_INTERNALS
116
+ #define CYTHON_USE_PYLIST_INTERNALS 0
117
+ #undef CYTHON_USE_UNICODE_INTERNALS
118
+ #define CYTHON_USE_UNICODE_INTERNALS 0
119
+ #undef CYTHON_USE_UNICODE_WRITER
120
+ #define CYTHON_USE_UNICODE_WRITER 0
121
+ #undef CYTHON_USE_PYLONG_INTERNALS
122
+ #define CYTHON_USE_PYLONG_INTERNALS 0
123
+ #undef CYTHON_AVOID_BORROWED_REFS
124
+ #define CYTHON_AVOID_BORROWED_REFS 1
125
+ #undef CYTHON_ASSUME_SAFE_MACROS
126
+ #define CYTHON_ASSUME_SAFE_MACROS 0
127
+ #undef CYTHON_UNPACK_METHODS
128
+ #define CYTHON_UNPACK_METHODS 0
129
+ #undef CYTHON_FAST_THREAD_STATE
130
+ #define CYTHON_FAST_THREAD_STATE 0
131
+ #undef CYTHON_FAST_PYCALL
132
+ #define CYTHON_FAST_PYCALL 0
133
+ #undef CYTHON_PEP489_MULTI_PHASE_INIT
134
+ #define CYTHON_PEP489_MULTI_PHASE_INIT 0
135
+ #undef CYTHON_USE_TP_FINALIZE
136
+ #define CYTHON_USE_TP_FINALIZE 0
137
+ #undef CYTHON_USE_DICT_VERSIONS
138
+ #define CYTHON_USE_DICT_VERSIONS 0
139
+ #undef CYTHON_USE_EXC_INFO_STACK
140
+ #define CYTHON_USE_EXC_INFO_STACK 0
141
+ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
142
+ #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
143
+ #endif
144
+ #elif defined(PYSTON_VERSION)
145
+ #define CYTHON_COMPILING_IN_PYPY 0
146
+ #define CYTHON_COMPILING_IN_PYSTON 1
147
+ #define CYTHON_COMPILING_IN_CPYTHON 0
148
+ #define CYTHON_COMPILING_IN_NOGIL 0
149
+ #ifndef CYTHON_USE_TYPE_SLOTS
150
+ #define CYTHON_USE_TYPE_SLOTS 1
151
+ #endif
152
+ #undef CYTHON_USE_PYTYPE_LOOKUP
153
+ #define CYTHON_USE_PYTYPE_LOOKUP 0
154
+ #undef CYTHON_USE_ASYNC_SLOTS
155
+ #define CYTHON_USE_ASYNC_SLOTS 0
156
+ #undef CYTHON_USE_PYLIST_INTERNALS
157
+ #define CYTHON_USE_PYLIST_INTERNALS 0
158
+ #ifndef CYTHON_USE_UNICODE_INTERNALS
159
+ #define CYTHON_USE_UNICODE_INTERNALS 1
160
+ #endif
161
+ #undef CYTHON_USE_UNICODE_WRITER
162
+ #define CYTHON_USE_UNICODE_WRITER 0
163
+ #undef CYTHON_USE_PYLONG_INTERNALS
164
+ #define CYTHON_USE_PYLONG_INTERNALS 0
165
+ #ifndef CYTHON_AVOID_BORROWED_REFS
166
+ #define CYTHON_AVOID_BORROWED_REFS 0
167
+ #endif
168
+ #ifndef CYTHON_ASSUME_SAFE_MACROS
169
+ #define CYTHON_ASSUME_SAFE_MACROS 1
170
+ #endif
171
+ #ifndef CYTHON_UNPACK_METHODS
172
+ #define CYTHON_UNPACK_METHODS 1
173
+ #endif
174
+ #undef CYTHON_FAST_THREAD_STATE
175
+ #define CYTHON_FAST_THREAD_STATE 0
176
+ #undef CYTHON_FAST_PYCALL
177
+ #define CYTHON_FAST_PYCALL 0
178
+ #undef CYTHON_PEP489_MULTI_PHASE_INIT
179
+ #define CYTHON_PEP489_MULTI_PHASE_INIT 0
180
+ #undef CYTHON_USE_TP_FINALIZE
181
+ #define CYTHON_USE_TP_FINALIZE 0
182
+ #undef CYTHON_USE_DICT_VERSIONS
183
+ #define CYTHON_USE_DICT_VERSIONS 0
184
+ #undef CYTHON_USE_EXC_INFO_STACK
185
+ #define CYTHON_USE_EXC_INFO_STACK 0
186
+ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
187
+ #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
188
+ #endif
189
+ #elif defined(PY_NOGIL)
190
+ #define CYTHON_COMPILING_IN_PYPY 0
191
+ #define CYTHON_COMPILING_IN_PYSTON 0
192
+ #define CYTHON_COMPILING_IN_CPYTHON 0
193
+ #define CYTHON_COMPILING_IN_NOGIL 1
194
+ #ifndef CYTHON_USE_TYPE_SLOTS
195
+ #define CYTHON_USE_TYPE_SLOTS 1
196
+ #endif
197
+ #undef CYTHON_USE_PYTYPE_LOOKUP
198
+ #define CYTHON_USE_PYTYPE_LOOKUP 0
199
+ #ifndef CYTHON_USE_ASYNC_SLOTS
200
+ #define CYTHON_USE_ASYNC_SLOTS 1
201
+ #endif
202
+ #undef CYTHON_USE_PYLIST_INTERNALS
203
+ #define CYTHON_USE_PYLIST_INTERNALS 0
204
+ #ifndef CYTHON_USE_UNICODE_INTERNALS
205
+ #define CYTHON_USE_UNICODE_INTERNALS 1
206
+ #endif
207
+ #undef CYTHON_USE_UNICODE_WRITER
208
+ #define CYTHON_USE_UNICODE_WRITER 0
209
+ #undef CYTHON_USE_PYLONG_INTERNALS
210
+ #define CYTHON_USE_PYLONG_INTERNALS 0
211
+ #ifndef CYTHON_AVOID_BORROWED_REFS
212
+ #define CYTHON_AVOID_BORROWED_REFS 0
213
+ #endif
214
+ #ifndef CYTHON_ASSUME_SAFE_MACROS
215
+ #define CYTHON_ASSUME_SAFE_MACROS 1
216
+ #endif
217
+ #ifndef CYTHON_UNPACK_METHODS
218
+ #define CYTHON_UNPACK_METHODS 1
219
+ #endif
220
+ #undef CYTHON_FAST_THREAD_STATE
221
+ #define CYTHON_FAST_THREAD_STATE 0
222
+ #undef CYTHON_FAST_PYCALL
223
+ #define CYTHON_FAST_PYCALL 0
224
+ #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
225
+ #define CYTHON_PEP489_MULTI_PHASE_INIT 1
226
+ #endif
227
+ #ifndef CYTHON_USE_TP_FINALIZE
228
+ #define CYTHON_USE_TP_FINALIZE 1
229
+ #endif
230
+ #undef CYTHON_USE_DICT_VERSIONS
231
+ #define CYTHON_USE_DICT_VERSIONS 0
232
+ #undef CYTHON_USE_EXC_INFO_STACK
233
+ #define CYTHON_USE_EXC_INFO_STACK 0
234
+ #else
235
+ #define CYTHON_COMPILING_IN_PYPY 0
236
+ #define CYTHON_COMPILING_IN_PYSTON 0
237
+ #define CYTHON_COMPILING_IN_CPYTHON 1
238
+ #define CYTHON_COMPILING_IN_NOGIL 0
239
+ #ifndef CYTHON_USE_TYPE_SLOTS
240
+ #define CYTHON_USE_TYPE_SLOTS 1
241
+ #endif
242
+ #if PY_VERSION_HEX < 0x02070000
243
+ #undef CYTHON_USE_PYTYPE_LOOKUP
244
+ #define CYTHON_USE_PYTYPE_LOOKUP 0
245
+ #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
246
+ #define CYTHON_USE_PYTYPE_LOOKUP 1
247
+ #endif
248
+ #if PY_MAJOR_VERSION < 3
249
+ #undef CYTHON_USE_ASYNC_SLOTS
250
+ #define CYTHON_USE_ASYNC_SLOTS 0
251
+ #elif !defined(CYTHON_USE_ASYNC_SLOTS)
252
+ #define CYTHON_USE_ASYNC_SLOTS 1
253
+ #endif
254
+ #if PY_VERSION_HEX < 0x02070000
255
+ #undef CYTHON_USE_PYLONG_INTERNALS
256
+ #define CYTHON_USE_PYLONG_INTERNALS 0
257
+ #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
258
+ #define CYTHON_USE_PYLONG_INTERNALS (PY_VERSION_HEX < 0x030C00A5)
259
+ #endif
260
+ #ifndef CYTHON_USE_PYLIST_INTERNALS
261
+ #define CYTHON_USE_PYLIST_INTERNALS 1
262
+ #endif
263
+ #ifndef CYTHON_USE_UNICODE_INTERNALS
264
+ #define CYTHON_USE_UNICODE_INTERNALS 1
265
+ #endif
266
+ #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
267
+ #undef CYTHON_USE_UNICODE_WRITER
268
+ #define CYTHON_USE_UNICODE_WRITER 0
269
+ #elif !defined(CYTHON_USE_UNICODE_WRITER)
270
+ #define CYTHON_USE_UNICODE_WRITER 1
271
+ #endif
272
+ #ifndef CYTHON_AVOID_BORROWED_REFS
273
+ #define CYTHON_AVOID_BORROWED_REFS 0
274
+ #endif
275
+ #ifndef CYTHON_ASSUME_SAFE_MACROS
276
+ #define CYTHON_ASSUME_SAFE_MACROS 1
277
+ #endif
278
+ #ifndef CYTHON_UNPACK_METHODS
279
+ #define CYTHON_UNPACK_METHODS 1
280
+ #endif
281
+ #if PY_VERSION_HEX >= 0x030B00A4
282
+ #undef CYTHON_FAST_THREAD_STATE
283
+ #define CYTHON_FAST_THREAD_STATE 0
284
+ #elif !defined(CYTHON_FAST_THREAD_STATE)
285
+ #define CYTHON_FAST_THREAD_STATE 1
286
+ #endif
287
+ #ifndef CYTHON_FAST_PYCALL
288
+ #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000)
289
+ #endif
290
+ #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
291
+ #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
292
+ #endif
293
+ #ifndef CYTHON_USE_TP_FINALIZE
294
+ #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
295
+ #endif
296
+ #ifndef CYTHON_USE_DICT_VERSIONS
297
+ #define CYTHON_USE_DICT_VERSIONS ((PY_VERSION_HEX >= 0x030600B1) && (PY_VERSION_HEX < 0x030C00A5))
298
+ #endif
299
+ #if PY_VERSION_HEX >= 0x030B00A4
300
+ #undef CYTHON_USE_EXC_INFO_STACK
301
+ #define CYTHON_USE_EXC_INFO_STACK 0
302
+ #elif !defined(CYTHON_USE_EXC_INFO_STACK)
303
+ #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
304
+ #endif
305
+ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
306
+ #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
307
+ #endif
308
+ #endif
309
+ #if !defined(CYTHON_FAST_PYCCALL)
310
+ #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
311
+ #endif
312
+ #if CYTHON_USE_PYLONG_INTERNALS
313
+ #if PY_MAJOR_VERSION < 3
314
+ #include "longintrepr.h"
315
+ #endif
316
+ #undef SHIFT
317
+ #undef BASE
318
+ #undef MASK
319
+ #ifdef SIZEOF_VOID_P
320
+ enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
321
+ #endif
322
+ #endif
323
+ #ifndef __has_attribute
324
+ #define __has_attribute(x) 0
325
+ #endif
326
+ #ifndef __has_cpp_attribute
327
+ #define __has_cpp_attribute(x) 0
328
+ #endif
329
+ #ifndef CYTHON_RESTRICT
330
+ #if defined(__GNUC__)
331
+ #define CYTHON_RESTRICT __restrict__
332
+ #elif defined(_MSC_VER) && _MSC_VER >= 1400
333
+ #define CYTHON_RESTRICT __restrict
334
+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
335
+ #define CYTHON_RESTRICT restrict
336
+ #else
337
+ #define CYTHON_RESTRICT
338
+ #endif
339
+ #endif
340
+ #ifndef CYTHON_UNUSED
341
+ # if defined(__GNUC__)
342
+ # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
343
+ # define CYTHON_UNUSED __attribute__ ((__unused__))
344
+ # else
345
+ # define CYTHON_UNUSED
346
+ # endif
347
+ # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
348
+ # define CYTHON_UNUSED __attribute__ ((__unused__))
349
+ # else
350
+ # define CYTHON_UNUSED
351
+ # endif
352
+ #endif
353
+ #ifndef CYTHON_MAYBE_UNUSED_VAR
354
+ # if defined(__cplusplus)
355
+ template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
356
+ # else
357
+ # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
358
+ # endif
359
+ #endif
360
+ #ifndef CYTHON_NCP_UNUSED
361
+ # if CYTHON_COMPILING_IN_CPYTHON
362
+ # define CYTHON_NCP_UNUSED
363
+ # else
364
+ # define CYTHON_NCP_UNUSED CYTHON_UNUSED
365
+ # endif
366
+ #endif
367
+ #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
368
+ #ifdef _MSC_VER
369
+ #ifndef _MSC_STDINT_H_
370
+ #if _MSC_VER < 1300
371
+ typedef unsigned char uint8_t;
372
+ typedef unsigned int uint32_t;
373
+ #else
374
+ typedef unsigned __int8 uint8_t;
375
+ typedef unsigned __int32 uint32_t;
376
+ #endif
377
+ #endif
378
+ #else
379
+ #include <stdint.h>
380
+ #endif
381
+ #ifndef CYTHON_FALLTHROUGH
382
+ #if defined(__cplusplus) && __cplusplus >= 201103L
383
+ #if __has_cpp_attribute(fallthrough)
384
+ #define CYTHON_FALLTHROUGH [[fallthrough]]
385
+ #elif __has_cpp_attribute(clang::fallthrough)
386
+ #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
387
+ #elif __has_cpp_attribute(gnu::fallthrough)
388
+ #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
389
+ #endif
390
+ #endif
391
+ #ifndef CYTHON_FALLTHROUGH
392
+ #if __has_attribute(fallthrough)
393
+ #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
394
+ #else
395
+ #define CYTHON_FALLTHROUGH
396
+ #endif
397
+ #endif
398
+ #if defined(__clang__ ) && defined(__apple_build_version__)
399
+ #if __apple_build_version__ < 7000000
400
+ #undef CYTHON_FALLTHROUGH
401
+ #define CYTHON_FALLTHROUGH
402
+ #endif
403
+ #endif
404
+ #endif
405
+
406
+ #ifndef CYTHON_INLINE
407
+ #if defined(__clang__)
408
+ #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
409
+ #elif defined(__GNUC__)
410
+ #define CYTHON_INLINE __inline__
411
+ #elif defined(_MSC_VER)
412
+ #define CYTHON_INLINE __inline
413
+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
414
+ #define CYTHON_INLINE inline
415
+ #else
416
+ #define CYTHON_INLINE
417
+ #endif
418
+ #endif
419
+
420
+ #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
421
+ #define Py_OptimizeFlag 0
422
+ #endif
423
+ #define __PYX_BUILD_PY_SSIZE_T "n"
424
+ #define CYTHON_FORMAT_SSIZE_T "z"
425
+ #if PY_MAJOR_VERSION < 3
426
+ #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
427
+ #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
428
+ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
429
+ #define __Pyx_DefaultClassType PyClass_Type
430
+ #else
431
+ #define __Pyx_BUILTIN_MODULE_NAME "builtins"
432
+ #define __Pyx_DefaultClassType PyType_Type
433
+ #if PY_VERSION_HEX >= 0x030B00A1
434
+ static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int k, int l, int s, int f,
435
+ PyObject *code, PyObject *c, PyObject* n, PyObject *v,
436
+ PyObject *fv, PyObject *cell, PyObject* fn,
437
+ PyObject *name, int fline, PyObject *lnos) {
438
+ PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;
439
+ PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;
440
+ const char *fn_cstr=NULL;
441
+ const char *name_cstr=NULL;
442
+ PyCodeObject* co=NULL;
443
+ PyObject *type, *value, *traceback;
444
+ PyErr_Fetch(&type, &value, &traceback);
445
+ if (!(kwds=PyDict_New())) goto end;
446
+ if (!(argcount=PyLong_FromLong(a))) goto end;
447
+ if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end;
448
+ if (!(posonlyargcount=PyLong_FromLong(0))) goto end;
449
+ if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end;
450
+ if (!(kwonlyargcount=PyLong_FromLong(k))) goto end;
451
+ if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end;
452
+ if (!(nlocals=PyLong_FromLong(l))) goto end;
453
+ if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end;
454
+ if (!(stacksize=PyLong_FromLong(s))) goto end;
455
+ if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end;
456
+ if (!(flags=PyLong_FromLong(f))) goto end;
457
+ if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end;
458
+ if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end;
459
+ if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end;
460
+ if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end;
461
+ if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end;
462
+ if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end;
463
+ if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end;
464
+ if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end;
465
+ if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end;
466
+ if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end;
467
+ if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end;
468
+ if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto cleanup_code_too;
469
+ if (!(empty = PyTuple_New(0))) goto cleanup_code_too; // unfortunately __pyx_empty_tuple isn't available here
470
+ if (!(call_result = PyObject_Call(replace, empty, kwds))) goto cleanup_code_too;
471
+ Py_XDECREF((PyObject*)co);
472
+ co = (PyCodeObject*)call_result;
473
+ call_result = NULL;
474
+ if (0) {
475
+ cleanup_code_too:
476
+ Py_XDECREF((PyObject*)co);
477
+ co = NULL;
478
+ }
479
+ end:
480
+ Py_XDECREF(kwds);
481
+ Py_XDECREF(argcount);
482
+ Py_XDECREF(posonlyargcount);
483
+ Py_XDECREF(kwonlyargcount);
484
+ Py_XDECREF(nlocals);
485
+ Py_XDECREF(stacksize);
486
+ Py_XDECREF(replace);
487
+ Py_XDECREF(call_result);
488
+ Py_XDECREF(empty);
489
+ if (type) {
490
+ PyErr_Restore(type, value, traceback);
491
+ }
492
+ return co;
493
+ }
494
+ #else
495
+ #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
496
+ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
497
+ #endif
498
+ #define __Pyx_DefaultClassType PyType_Type
499
+ #endif
500
+ #ifndef Py_TPFLAGS_CHECKTYPES
501
+ #define Py_TPFLAGS_CHECKTYPES 0
502
+ #endif
503
+ #ifndef Py_TPFLAGS_HAVE_INDEX
504
+ #define Py_TPFLAGS_HAVE_INDEX 0
505
+ #endif
506
+ #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
507
+ #define Py_TPFLAGS_HAVE_NEWBUFFER 0
508
+ #endif
509
+ #ifndef Py_TPFLAGS_HAVE_FINALIZE
510
+ #define Py_TPFLAGS_HAVE_FINALIZE 0
511
+ #endif
512
+ #ifndef METH_STACKLESS
513
+ #define METH_STACKLESS 0
514
+ #endif
515
+ #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
516
+ #ifndef METH_FASTCALL
517
+ #define METH_FASTCALL 0x80
518
+ #endif
519
+ typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
520
+ typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
521
+ Py_ssize_t nargs, PyObject *kwnames);
522
+ #else
523
+ #define __Pyx_PyCFunctionFast _PyCFunctionFast
524
+ #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
525
+ #endif
526
+ #if CYTHON_FAST_PYCCALL
527
+ #define __Pyx_PyFastCFunction_Check(func)\
528
+ ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
529
+ #else
530
+ #define __Pyx_PyFastCFunction_Check(func) 0
531
+ #endif
532
+ #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
533
+ #define PyObject_Malloc(s) PyMem_Malloc(s)
534
+ #define PyObject_Free(p) PyMem_Free(p)
535
+ #define PyObject_Realloc(p) PyMem_Realloc(p)
536
+ #endif
537
+ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
538
+ #define PyMem_RawMalloc(n) PyMem_Malloc(n)
539
+ #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
540
+ #define PyMem_RawFree(p) PyMem_Free(p)
541
+ #endif
542
+ #if CYTHON_COMPILING_IN_PYSTON
543
+ #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
544
+ #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
545
+ #else
546
+ #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
547
+ #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
548
+ #endif
549
+ #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
550
+ #define __Pyx_PyThreadState_Current PyThreadState_GET()
551
+ #elif PY_VERSION_HEX >= 0x03060000
552
+ #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
553
+ #elif PY_VERSION_HEX >= 0x03000000
554
+ #define __Pyx_PyThreadState_Current PyThreadState_GET()
555
+ #else
556
+ #define __Pyx_PyThreadState_Current _PyThreadState_Current
557
+ #endif
558
+ #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
559
+ #include "pythread.h"
560
+ #define Py_tss_NEEDS_INIT 0
561
+ typedef int Py_tss_t;
562
+ static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
563
+ *key = PyThread_create_key();
564
+ return 0;
565
+ }
566
+ static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
567
+ Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
568
+ *key = Py_tss_NEEDS_INIT;
569
+ return key;
570
+ }
571
+ static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
572
+ PyObject_Free(key);
573
+ }
574
+ static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
575
+ return *key != Py_tss_NEEDS_INIT;
576
+ }
577
+ static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
578
+ PyThread_delete_key(*key);
579
+ *key = Py_tss_NEEDS_INIT;
580
+ }
581
+ static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
582
+ return PyThread_set_key_value(*key, value);
583
+ }
584
+ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
585
+ return PyThread_get_key_value(*key);
586
+ }
587
+ #endif
588
+ #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
589
+ #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
590
+ #else
591
+ #define __Pyx_PyDict_NewPresized(n) PyDict_New()
592
+ #endif
593
+ #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
594
+ #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
595
+ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
596
+ #else
597
+ #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
598
+ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
599
+ #endif
600
+ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
601
+ #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
602
+ #else
603
+ #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
604
+ #endif
605
+ #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
606
+ #define CYTHON_PEP393_ENABLED 1
607
+ #if PY_VERSION_HEX >= 0x030C0000
608
+ #define __Pyx_PyUnicode_READY(op) (0)
609
+ #else
610
+ #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
611
+ 0 : _PyUnicode_Ready((PyObject *)(op)))
612
+ #endif
613
+ #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
614
+ #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
615
+ #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
616
+ #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
617
+ #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
618
+ #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
619
+ #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
620
+ #if PY_VERSION_HEX >= 0x030C0000
621
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
622
+ #else
623
+ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
624
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
625
+ #else
626
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
627
+ #endif
628
+ #endif
629
+ #else
630
+ #define CYTHON_PEP393_ENABLED 0
631
+ #define PyUnicode_1BYTE_KIND 1
632
+ #define PyUnicode_2BYTE_KIND 2
633
+ #define PyUnicode_4BYTE_KIND 4
634
+ #define __Pyx_PyUnicode_READY(op) (0)
635
+ #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
636
+ #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
637
+ #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
638
+ #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
639
+ #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
640
+ #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
641
+ #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
642
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
643
+ #endif
644
+ #if CYTHON_COMPILING_IN_PYPY
645
+ #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
646
+ #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
647
+ #else
648
+ #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
649
+ #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
650
+ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
651
+ #endif
652
+ #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
653
+ #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
654
+ #endif
655
+ #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
656
+ #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
657
+ #endif
658
+ #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
659
+ #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
660
+ #endif
661
+ #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))
662
+ #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
663
+ #if PY_MAJOR_VERSION >= 3
664
+ #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
665
+ #else
666
+ #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
667
+ #endif
668
+ #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
669
+ #define PyObject_ASCII(o) PyObject_Repr(o)
670
+ #endif
671
+ #if PY_MAJOR_VERSION >= 3
672
+ #define PyBaseString_Type PyUnicode_Type
673
+ #define PyStringObject PyUnicodeObject
674
+ #define PyString_Type PyUnicode_Type
675
+ #define PyString_Check PyUnicode_Check
676
+ #define PyString_CheckExact PyUnicode_CheckExact
677
+ #ifndef PyObject_Unicode
678
+ #define PyObject_Unicode PyObject_Str
679
+ #endif
680
+ #endif
681
+ #if PY_MAJOR_VERSION >= 3
682
+ #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
683
+ #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
684
+ #else
685
+ #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
686
+ #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
687
+ #endif
688
+ #ifndef PySet_CheckExact
689
+ #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
690
+ #endif
691
+ #if PY_VERSION_HEX >= 0x030900A4
692
+ #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
693
+ #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
694
+ #else
695
+ #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
696
+ #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
697
+ #endif
698
+ #if CYTHON_ASSUME_SAFE_MACROS
699
+ #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
700
+ #else
701
+ #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
702
+ #endif
703
+ #if PY_MAJOR_VERSION >= 3
704
+ #define PyIntObject PyLongObject
705
+ #define PyInt_Type PyLong_Type
706
+ #define PyInt_Check(op) PyLong_Check(op)
707
+ #define PyInt_CheckExact(op) PyLong_CheckExact(op)
708
+ #define PyInt_FromString PyLong_FromString
709
+ #define PyInt_FromUnicode PyLong_FromUnicode
710
+ #define PyInt_FromLong PyLong_FromLong
711
+ #define PyInt_FromSize_t PyLong_FromSize_t
712
+ #define PyInt_FromSsize_t PyLong_FromSsize_t
713
+ #define PyInt_AsLong PyLong_AsLong
714
+ #define PyInt_AS_LONG PyLong_AS_LONG
715
+ #define PyInt_AsSsize_t PyLong_AsSsize_t
716
+ #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
717
+ #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
718
+ #define PyNumber_Int PyNumber_Long
719
+ #endif
720
+ #if PY_MAJOR_VERSION >= 3
721
+ #define PyBoolObject PyLongObject
722
+ #endif
723
+ #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
724
+ #ifndef PyUnicode_InternFromString
725
+ #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
726
+ #endif
727
+ #endif
728
+ #if PY_VERSION_HEX < 0x030200A4
729
+ typedef long Py_hash_t;
730
+ #define __Pyx_PyInt_FromHash_t PyInt_FromLong
731
+ #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
732
+ #else
733
+ #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
734
+ #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
735
+ #endif
736
+ #if PY_MAJOR_VERSION >= 3
737
+ #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
738
+ #else
739
+ #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
740
+ #endif
741
+ #if CYTHON_USE_ASYNC_SLOTS
742
+ #if PY_VERSION_HEX >= 0x030500B1
743
+ #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
744
+ #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
745
+ #else
746
+ #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
747
+ #endif
748
+ #else
749
+ #define __Pyx_PyType_AsAsync(obj) NULL
750
+ #endif
751
+ #ifndef __Pyx_PyAsyncMethodsStruct
752
+ typedef struct {
753
+ unaryfunc am_await;
754
+ unaryfunc am_aiter;
755
+ unaryfunc am_anext;
756
+ } __Pyx_PyAsyncMethodsStruct;
757
+ #endif
758
+
759
+ #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
760
+ #if !defined(_USE_MATH_DEFINES)
761
+ #define _USE_MATH_DEFINES
762
+ #endif
763
+ #endif
764
+ #include <math.h>
765
+ #ifdef NAN
766
+ #define __PYX_NAN() ((float) NAN)
767
+ #else
768
+ static CYTHON_INLINE float __PYX_NAN() {
769
+ float value;
770
+ memset(&value, 0xFF, sizeof(value));
771
+ return value;
772
+ }
773
+ #endif
774
+ #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
775
+ #define __Pyx_truncl trunc
776
+ #else
777
+ #define __Pyx_truncl truncl
778
+ #endif
779
+
780
+ #define __PYX_MARK_ERR_POS(f_index, lineno) \
781
+ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
782
+ #define __PYX_ERR(f_index, lineno, Ln_error) \
783
+ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
784
+
785
+ #ifndef __PYX_EXTERN_C
786
+ #ifdef __cplusplus
787
+ #define __PYX_EXTERN_C extern "C"
788
+ #else
789
+ #define __PYX_EXTERN_C extern
790
+ #endif
791
+ #endif
792
+
793
+ #define __PYX_HAVE__manimpango__enums
794
+ #define __PYX_HAVE_API__manimpango__enums
795
+ /* Early includes */
796
+ #include "cairo.h"
797
+ #include "cairo-svg.h"
798
+ #include "glib.h"
799
+ #include "pango/pango.h"
800
+ #include "pango/pangocairo.h"
801
+
802
+ #if PANGO_VERSION_CHECK(1,44,0)
803
+ int set_line_width(PangoLayout *layout,float spacing)
804
+ {
805
+ pango_layout_set_line_spacing(layout, spacing);
806
+ return 1;
807
+ }
808
+ #else
809
+ int set_line_width(PangoLayout *layout,float spacing){return 0;}
810
+ #endif
811
+
812
+ #ifdef _OPENMP
813
+ #include <omp.h>
814
+ #endif /* _OPENMP */
815
+
816
+ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
817
+ #define CYTHON_WITHOUT_ASSERTIONS
818
+ #endif
819
+
820
+ typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
821
+ const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
822
+
823
+ #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
824
+ #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
825
+ #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
826
+ #define __PYX_DEFAULT_STRING_ENCODING ""
827
+ #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
828
+ #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
829
+ #define __Pyx_uchar_cast(c) ((unsigned char)c)
830
+ #define __Pyx_long_cast(x) ((long)x)
831
+ #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
832
+ (sizeof(type) < sizeof(Py_ssize_t)) ||\
833
+ (sizeof(type) > sizeof(Py_ssize_t) &&\
834
+ likely(v < (type)PY_SSIZE_T_MAX ||\
835
+ v == (type)PY_SSIZE_T_MAX) &&\
836
+ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
837
+ v == (type)PY_SSIZE_T_MIN))) ||\
838
+ (sizeof(type) == sizeof(Py_ssize_t) &&\
839
+ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
840
+ v == (type)PY_SSIZE_T_MAX))) )
841
+ static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
842
+ return (size_t) i < (size_t) limit;
843
+ }
844
+ #if defined (__cplusplus) && __cplusplus >= 201103L
845
+ #include <cstdlib>
846
+ #define __Pyx_sst_abs(value) std::abs(value)
847
+ #elif SIZEOF_INT >= SIZEOF_SIZE_T
848
+ #define __Pyx_sst_abs(value) abs(value)
849
+ #elif SIZEOF_LONG >= SIZEOF_SIZE_T
850
+ #define __Pyx_sst_abs(value) labs(value)
851
+ #elif defined (_MSC_VER)
852
+ #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
853
+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
854
+ #define __Pyx_sst_abs(value) llabs(value)
855
+ #elif defined (__GNUC__)
856
+ #define __Pyx_sst_abs(value) __builtin_llabs(value)
857
+ #else
858
+ #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
859
+ #endif
860
+ static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
861
+ static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
862
+ #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
863
+ #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
864
+ #define __Pyx_PyBytes_FromString PyBytes_FromString
865
+ #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
866
+ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
867
+ #if PY_MAJOR_VERSION < 3
868
+ #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
869
+ #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
870
+ #else
871
+ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
872
+ #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
873
+ #endif
874
+ #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
875
+ #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
876
+ #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
877
+ #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
878
+ #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
879
+ #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
880
+ #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
881
+ #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
882
+ #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
883
+ #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
884
+ #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
885
+ #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
886
+ #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
887
+ #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
888
+ #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
889
+ #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
890
+ static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
891
+ const Py_UNICODE *u_end = u;
892
+ while (*u_end++) ;
893
+ return (size_t)(u_end - u - 1);
894
+ }
895
+ #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
896
+ #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
897
+ #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
898
+ #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
899
+ #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
900
+ static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
901
+ static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
902
+ static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
903
+ static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
904
+ #define __Pyx_PySequence_Tuple(obj)\
905
+ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
906
+ static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
907
+ static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
908
+ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
909
+ #if CYTHON_ASSUME_SAFE_MACROS
910
+ #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
911
+ #else
912
+ #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
913
+ #endif
914
+ #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
915
+ #if PY_MAJOR_VERSION >= 3
916
+ #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
917
+ #else
918
+ #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
919
+ #endif
920
+ #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
921
+ #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
922
+ static int __Pyx_sys_getdefaultencoding_not_ascii;
923
+ static int __Pyx_init_sys_getdefaultencoding_params(void) {
924
+ PyObject* sys;
925
+ PyObject* default_encoding = NULL;
926
+ PyObject* ascii_chars_u = NULL;
927
+ PyObject* ascii_chars_b = NULL;
928
+ const char* default_encoding_c;
929
+ sys = PyImport_ImportModule("sys");
930
+ if (!sys) goto bad;
931
+ default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
932
+ Py_DECREF(sys);
933
+ if (!default_encoding) goto bad;
934
+ default_encoding_c = PyBytes_AsString(default_encoding);
935
+ if (!default_encoding_c) goto bad;
936
+ if (strcmp(default_encoding_c, "ascii") == 0) {
937
+ __Pyx_sys_getdefaultencoding_not_ascii = 0;
938
+ } else {
939
+ char ascii_chars[128];
940
+ int c;
941
+ for (c = 0; c < 128; c++) {
942
+ ascii_chars[c] = c;
943
+ }
944
+ __Pyx_sys_getdefaultencoding_not_ascii = 1;
945
+ ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
946
+ if (!ascii_chars_u) goto bad;
947
+ ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
948
+ if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
949
+ PyErr_Format(
950
+ PyExc_ValueError,
951
+ "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
952
+ default_encoding_c);
953
+ goto bad;
954
+ }
955
+ Py_DECREF(ascii_chars_u);
956
+ Py_DECREF(ascii_chars_b);
957
+ }
958
+ Py_DECREF(default_encoding);
959
+ return 0;
960
+ bad:
961
+ Py_XDECREF(default_encoding);
962
+ Py_XDECREF(ascii_chars_u);
963
+ Py_XDECREF(ascii_chars_b);
964
+ return -1;
965
+ }
966
+ #endif
967
+ #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
968
+ #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
969
+ #else
970
+ #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
971
+ #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
972
+ static char* __PYX_DEFAULT_STRING_ENCODING;
973
+ static int __Pyx_init_sys_getdefaultencoding_params(void) {
974
+ PyObject* sys;
975
+ PyObject* default_encoding = NULL;
976
+ char* default_encoding_c;
977
+ sys = PyImport_ImportModule("sys");
978
+ if (!sys) goto bad;
979
+ default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
980
+ Py_DECREF(sys);
981
+ if (!default_encoding) goto bad;
982
+ default_encoding_c = PyBytes_AsString(default_encoding);
983
+ if (!default_encoding_c) goto bad;
984
+ __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
985
+ if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
986
+ strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
987
+ Py_DECREF(default_encoding);
988
+ return 0;
989
+ bad:
990
+ Py_XDECREF(default_encoding);
991
+ return -1;
992
+ }
993
+ #endif
994
+ #endif
995
+
996
+
997
+ /* Test for GCC > 2.95 */
998
+ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
999
+ #define likely(x) __builtin_expect(!!(x), 1)
1000
+ #define unlikely(x) __builtin_expect(!!(x), 0)
1001
+ #else /* !__GNUC__ or GCC < 2.95 */
1002
+ #define likely(x) (x)
1003
+ #define unlikely(x) (x)
1004
+ #endif /* __GNUC__ */
1005
+ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
1006
+
1007
+ static PyObject *__pyx_m = NULL;
1008
+ static PyObject *__pyx_d;
1009
+ static PyObject *__pyx_b;
1010
+ static PyObject *__pyx_cython_runtime = NULL;
1011
+ static PyObject *__pyx_empty_tuple;
1012
+ static PyObject *__pyx_empty_bytes;
1013
+ static PyObject *__pyx_empty_unicode;
1014
+ static int __pyx_lineno;
1015
+ static int __pyx_clineno = 0;
1016
+ static const char * __pyx_cfilenm= __FILE__;
1017
+ static const char *__pyx_filename;
1018
+
1019
+
1020
+ static const char *__pyx_f[] = {
1021
+ "manimpango\\enums.pyx",
1022
+ };
1023
+
1024
+ /*--- Type declarations ---*/
1025
+
1026
+ /* --- Runtime support code (head) --- */
1027
+ /* Refnanny.proto */
1028
+ #ifndef CYTHON_REFNANNY
1029
+ #define CYTHON_REFNANNY 0
1030
+ #endif
1031
+ #if CYTHON_REFNANNY
1032
+ typedef struct {
1033
+ void (*INCREF)(void*, PyObject*, int);
1034
+ void (*DECREF)(void*, PyObject*, int);
1035
+ void (*GOTREF)(void*, PyObject*, int);
1036
+ void (*GIVEREF)(void*, PyObject*, int);
1037
+ void* (*SetupContext)(const char*, int, const char*);
1038
+ void (*FinishContext)(void**);
1039
+ } __Pyx_RefNannyAPIStruct;
1040
+ static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1041
+ static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1042
+ #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1043
+ #ifdef WITH_THREAD
1044
+ #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1045
+ if (acquire_gil) {\
1046
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1047
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1048
+ PyGILState_Release(__pyx_gilstate_save);\
1049
+ } else {\
1050
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1051
+ }
1052
+ #else
1053
+ #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1054
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1055
+ #endif
1056
+ #define __Pyx_RefNannyFinishContext()\
1057
+ __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1058
+ #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1059
+ #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1060
+ #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1061
+ #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1062
+ #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1063
+ #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1064
+ #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1065
+ #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1066
+ #else
1067
+ #define __Pyx_RefNannyDeclarations
1068
+ #define __Pyx_RefNannySetupContext(name, acquire_gil)
1069
+ #define __Pyx_RefNannyFinishContext()
1070
+ #define __Pyx_INCREF(r) Py_INCREF(r)
1071
+ #define __Pyx_DECREF(r) Py_DECREF(r)
1072
+ #define __Pyx_GOTREF(r)
1073
+ #define __Pyx_GIVEREF(r)
1074
+ #define __Pyx_XINCREF(r) Py_XINCREF(r)
1075
+ #define __Pyx_XDECREF(r) Py_XDECREF(r)
1076
+ #define __Pyx_XGOTREF(r)
1077
+ #define __Pyx_XGIVEREF(r)
1078
+ #endif
1079
+ #define __Pyx_XDECREF_SET(r, v) do {\
1080
+ PyObject *tmp = (PyObject *) r;\
1081
+ r = v; __Pyx_XDECREF(tmp);\
1082
+ } while (0)
1083
+ #define __Pyx_DECREF_SET(r, v) do {\
1084
+ PyObject *tmp = (PyObject *) r;\
1085
+ r = v; __Pyx_DECREF(tmp);\
1086
+ } while (0)
1087
+ #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1088
+ #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1089
+
1090
+ /* PyObjectGetAttrStr.proto */
1091
+ #if CYTHON_USE_TYPE_SLOTS
1092
+ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1093
+ #else
1094
+ #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1095
+ #endif
1096
+
1097
+ /* Import.proto */
1098
+ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1099
+
1100
+ /* ImportFrom.proto */
1101
+ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1102
+
1103
+ /* GetBuiltinName.proto */
1104
+ static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1105
+
1106
+ /* PyDictVersioning.proto */
1107
+ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1108
+ #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1109
+ #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1110
+ #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1111
+ (version_var) = __PYX_GET_DICT_VERSION(dict);\
1112
+ (cache_var) = (value);
1113
+ #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1114
+ static PY_UINT64_T __pyx_dict_version = 0;\
1115
+ static PyObject *__pyx_dict_cached_value = NULL;\
1116
+ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1117
+ (VAR) = __pyx_dict_cached_value;\
1118
+ } else {\
1119
+ (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1120
+ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1121
+ }\
1122
+ }
1123
+ static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1124
+ static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1125
+ static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1126
+ #else
1127
+ #define __PYX_GET_DICT_VERSION(dict) (0)
1128
+ #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1129
+ #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1130
+ #endif
1131
+
1132
+ /* GetModuleGlobalName.proto */
1133
+ #if CYTHON_USE_DICT_VERSIONS
1134
+ #define __Pyx_GetModuleGlobalName(var, name) do {\
1135
+ static PY_UINT64_T __pyx_dict_version = 0;\
1136
+ static PyObject *__pyx_dict_cached_value = NULL;\
1137
+ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1138
+ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1139
+ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1140
+ } while(0)
1141
+ #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\
1142
+ PY_UINT64_T __pyx_dict_version;\
1143
+ PyObject *__pyx_dict_cached_value;\
1144
+ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1145
+ } while(0)
1146
+ static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1147
+ #else
1148
+ #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1149
+ #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1150
+ static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1151
+ #endif
1152
+
1153
+ /* CalculateMetaclass.proto */
1154
+ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
1155
+
1156
+ /* SetNameInClass.proto */
1157
+ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
1158
+ #define __Pyx_SetNameInClass(ns, name, value)\
1159
+ (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
1160
+ #elif CYTHON_COMPILING_IN_CPYTHON
1161
+ #define __Pyx_SetNameInClass(ns, name, value)\
1162
+ (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
1163
+ #else
1164
+ #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value)
1165
+ #endif
1166
+
1167
+ /* Py3ClassCreate.proto */
1168
+ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
1169
+ PyObject *mkw, PyObject *modname, PyObject *doc);
1170
+ static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
1171
+ PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);
1172
+
1173
+ /* PyThreadStateGet.proto */
1174
+ #if CYTHON_FAST_THREAD_STATE
1175
+ #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1176
+ #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1177
+ #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1178
+ #else
1179
+ #define __Pyx_PyThreadState_declare
1180
+ #define __Pyx_PyThreadState_assign
1181
+ #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1182
+ #endif
1183
+
1184
+ /* PyErrFetchRestore.proto */
1185
+ #if CYTHON_FAST_THREAD_STATE
1186
+ #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1187
+ #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1188
+ #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1189
+ #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1190
+ #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1191
+ static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1192
+ static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1193
+ #if CYTHON_COMPILING_IN_CPYTHON
1194
+ #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1195
+ #else
1196
+ #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1197
+ #endif
1198
+ #else
1199
+ #define __Pyx_PyErr_Clear() PyErr_Clear()
1200
+ #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1201
+ #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1202
+ #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1203
+ #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1204
+ #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1205
+ #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1206
+ #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1207
+ #endif
1208
+
1209
+ /* CLineInTraceback.proto */
1210
+ #ifdef CYTHON_CLINE_IN_TRACEBACK
1211
+ #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1212
+ #else
1213
+ static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1214
+ #endif
1215
+
1216
+ /* CodeObjectCache.proto */
1217
+ typedef struct {
1218
+ PyCodeObject* code_object;
1219
+ int code_line;
1220
+ } __Pyx_CodeObjectCacheEntry;
1221
+ struct __Pyx_CodeObjectCache {
1222
+ int count;
1223
+ int max_count;
1224
+ __Pyx_CodeObjectCacheEntry* entries;
1225
+ };
1226
+ static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1227
+ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
1228
+ static PyCodeObject *__pyx_find_code_object(int code_line);
1229
+ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
1230
+
1231
+ /* AddTraceback.proto */
1232
+ static void __Pyx_AddTraceback(const char *funcname, int c_line,
1233
+ int py_line, const char *filename);
1234
+
1235
+ /* GCCDiagnostics.proto */
1236
+ #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
1237
+ #define __Pyx_HAS_GCC_DIAGNOSTIC
1238
+ #endif
1239
+
1240
+ /* CIntToPy.proto */
1241
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PangoStyle(PangoStyle value);
1242
+
1243
+ /* CIntToPy.proto */
1244
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PangoWeight(PangoWeight value);
1245
+
1246
+ /* CIntToPy.proto */
1247
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PangoVariant(PangoVariant value);
1248
+
1249
+ /* CIntToPy.proto */
1250
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PangoAlignment(PangoAlignment value);
1251
+
1252
+ /* CIntToPy.proto */
1253
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
1254
+
1255
+ /* CIntFromPy.proto */
1256
+ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
1257
+
1258
+ /* CIntFromPy.proto */
1259
+ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
1260
+
1261
+ /* FastTypeChecks.proto */
1262
+ #if CYTHON_COMPILING_IN_CPYTHON
1263
+ #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1264
+ static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1265
+ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1266
+ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1267
+ #else
1268
+ #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1269
+ #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1270
+ #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1271
+ #endif
1272
+ #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1273
+
1274
+ /* CheckBinaryVersion.proto */
1275
+ static int __Pyx_check_binary_version(void);
1276
+
1277
+ /* InitStrings.proto */
1278
+ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1279
+
1280
+
1281
+ /* Module declarations from 'cairo' */
1282
+
1283
+ /* Module declarations from 'glib' */
1284
+
1285
+ /* Module declarations from 'pango_attributes' */
1286
+
1287
+ /* Module declarations from 'pango' */
1288
+
1289
+ /* Module declarations from 'manimpango.enums' */
1290
+ #define __Pyx_MODULE_NAME "manimpango.enums"
1291
+ extern int __pyx_module_is_main_manimpango__enums;
1292
+ int __pyx_module_is_main_manimpango__enums = 0;
1293
+
1294
+ /* Implementation of 'manimpango.enums' */
1295
+ static const char __pyx_k_doc[] = "__doc__";
1296
+ static const char __pyx_k_BOLD[] = "BOLD";
1297
+ static const char __pyx_k_BOOK[] = "BOOK";
1298
+ static const char __pyx_k_Enum[] = "Enum";
1299
+ static const char __pyx_k_LEFT[] = "LEFT";
1300
+ static const char __pyx_k_THIN[] = "THIN";
1301
+ static const char __pyx_k_enum[] = "enum";
1302
+ static const char __pyx_k_main[] = "__main__";
1303
+ static const char __pyx_k_name[] = "__name__";
1304
+ static const char __pyx_k_test[] = "__test__";
1305
+ static const char __pyx_k_HEAVY[] = "HEAVY";
1306
+ static const char __pyx_k_LIGHT[] = "LIGHT";
1307
+ static const char __pyx_k_RIGHT[] = "RIGHT";
1308
+ static const char __pyx_k_Style[] = "Style";
1309
+ static const char __pyx_k_CENTER[] = "CENTER";
1310
+ static const char __pyx_k_ITALIC[] = "ITALIC";
1311
+ static const char __pyx_k_MEDIUM[] = "MEDIUM";
1312
+ static const char __pyx_k_NORMAL[] = "NORMAL";
1313
+ static const char __pyx_k_Weight[] = "Weight";
1314
+ static const char __pyx_k_import[] = "__import__";
1315
+ static const char __pyx_k_module[] = "__module__";
1316
+ static const char __pyx_k_OBLIQUE[] = "OBLIQUE";
1317
+ static const char __pyx_k_Variant[] = "Variant";
1318
+ static const char __pyx_k_prepare[] = "__prepare__";
1319
+ static const char __pyx_k_SEMIBOLD[] = "SEMIBOLD";
1320
+ static const char __pyx_k_qualname[] = "__qualname__";
1321
+ static const char __pyx_k_Alignment[] = "Alignment";
1322
+ static const char __pyx_k_ULTRABOLD[] = "ULTRABOLD";
1323
+ static const char __pyx_k_metaclass[] = "__metaclass__";
1324
+ static const char __pyx_k_SMALL_CAPS[] = "SMALL_CAPS";
1325
+ static const char __pyx_k_ULTRAHEAVY[] = "ULTRAHEAVY";
1326
+ static const char __pyx_k_ULTRALIGHT[] = "ULTRALIGHT";
1327
+ static const char __pyx_k_manimpango_enums[] = "manimpango.enums";
1328
+ static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
1329
+ static const char __pyx_k_An_enumeration_specifying_align[] = "\n An enumeration specifying alignment.\n ";
1330
+ static const char __pyx_k_An_enumeration_specifying_capit[] = "\n An enumeration specifying capitalization variant of the font.\n\n Attributes\n ----------\n\n NORMAL :\n A normal font.\n\n SMALL_CAPS :\n A font with the lower case characters replaced by smaller variants\n of the capital characters.\n ";
1331
+ static const char __pyx_k_An_enumeration_specifying_the_v[] = "\n An enumeration specifying the various slant styles possible for a font.\n\n Attributes\n ----------\n\n NORMAL :\n the font is upright.\n\n ITALIC :\n the font is slanted, but in a roman style.\n\n OBLIQUE:\n the font is slanted in an italic style.\n ";
1332
+ static const char __pyx_k_An_enumeration_specifying_the_w[] = "\n An enumeration specifying the weight (boldness) of a font.\n This is a numerical value ranging from 100 to 1000, but there are some predefined values\n Using numerical value other then that defined here is not supported.\n\n Attributes\n ----------\n\n NORMAL :\n the default weight (= 400)\n\n BOLD :\n the bold weight( = 700)\n\n THIN :\n the thin weight( = 100; Since: 1.24)\n\n ULTRALIGHT :\n the ultralight weight( = 200)\n\n LIGHT :\n the light weight( = 300)\n\n BOOK :\n the book weight( = 380; Since: 1.24)\n\n MEDIUM :\n the normal weight( = 500; Since: 1.24)\n\n SEMIBOLD :\n the semibold weight( = 600)\n\n ULTRABOLD :\n the ultrabold weight( = 800)\n\n HEAVY :\n the heavy weight( = 900)\n\n ULTRAHEAVY :\n the ultraheavy weight( = 1000; Since: 1.24)\n ";
1333
+ static PyObject *__pyx_n_s_Alignment;
1334
+ static PyObject *__pyx_kp_s_An_enumeration_specifying_align;
1335
+ static PyObject *__pyx_kp_s_An_enumeration_specifying_capit;
1336
+ static PyObject *__pyx_kp_s_An_enumeration_specifying_the_v;
1337
+ static PyObject *__pyx_kp_s_An_enumeration_specifying_the_w;
1338
+ static PyObject *__pyx_n_s_BOLD;
1339
+ static PyObject *__pyx_n_s_BOOK;
1340
+ static PyObject *__pyx_n_s_CENTER;
1341
+ static PyObject *__pyx_n_s_Enum;
1342
+ static PyObject *__pyx_n_s_HEAVY;
1343
+ static PyObject *__pyx_n_s_ITALIC;
1344
+ static PyObject *__pyx_n_s_LEFT;
1345
+ static PyObject *__pyx_n_s_LIGHT;
1346
+ static PyObject *__pyx_n_s_MEDIUM;
1347
+ static PyObject *__pyx_n_s_NORMAL;
1348
+ static PyObject *__pyx_n_s_OBLIQUE;
1349
+ static PyObject *__pyx_n_s_RIGHT;
1350
+ static PyObject *__pyx_n_s_SEMIBOLD;
1351
+ static PyObject *__pyx_n_s_SMALL_CAPS;
1352
+ static PyObject *__pyx_n_s_Style;
1353
+ static PyObject *__pyx_n_s_THIN;
1354
+ static PyObject *__pyx_n_s_ULTRABOLD;
1355
+ static PyObject *__pyx_n_s_ULTRAHEAVY;
1356
+ static PyObject *__pyx_n_s_ULTRALIGHT;
1357
+ static PyObject *__pyx_n_s_Variant;
1358
+ static PyObject *__pyx_n_s_Weight;
1359
+ static PyObject *__pyx_n_s_cline_in_traceback;
1360
+ static PyObject *__pyx_n_s_doc;
1361
+ static PyObject *__pyx_n_s_enum;
1362
+ static PyObject *__pyx_n_s_import;
1363
+ static PyObject *__pyx_n_s_main;
1364
+ static PyObject *__pyx_n_s_manimpango_enums;
1365
+ static PyObject *__pyx_n_s_metaclass;
1366
+ static PyObject *__pyx_n_s_module;
1367
+ static PyObject *__pyx_n_s_name;
1368
+ static PyObject *__pyx_n_s_prepare;
1369
+ static PyObject *__pyx_n_s_qualname;
1370
+ static PyObject *__pyx_n_s_test;
1371
+ /* Late includes */
1372
+
1373
+ static PyMethodDef __pyx_methods[] = {
1374
+ {0, 0, 0, 0}
1375
+ };
1376
+
1377
+ #if PY_MAJOR_VERSION >= 3
1378
+ #if CYTHON_PEP489_MULTI_PHASE_INIT
1379
+ static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
1380
+ static int __pyx_pymod_exec_enums(PyObject* module); /*proto*/
1381
+ static PyModuleDef_Slot __pyx_moduledef_slots[] = {
1382
+ {Py_mod_create, (void*)__pyx_pymod_create},
1383
+ {Py_mod_exec, (void*)__pyx_pymod_exec_enums},
1384
+ {0, NULL}
1385
+ };
1386
+ #endif
1387
+
1388
+ static struct PyModuleDef __pyx_moduledef = {
1389
+ PyModuleDef_HEAD_INIT,
1390
+ "enums",
1391
+ 0, /* m_doc */
1392
+ #if CYTHON_PEP489_MULTI_PHASE_INIT
1393
+ 0, /* m_size */
1394
+ #else
1395
+ -1, /* m_size */
1396
+ #endif
1397
+ __pyx_methods /* m_methods */,
1398
+ #if CYTHON_PEP489_MULTI_PHASE_INIT
1399
+ __pyx_moduledef_slots, /* m_slots */
1400
+ #else
1401
+ NULL, /* m_reload */
1402
+ #endif
1403
+ NULL, /* m_traverse */
1404
+ NULL, /* m_clear */
1405
+ NULL /* m_free */
1406
+ };
1407
+ #endif
1408
+ #ifndef CYTHON_SMALL_CODE
1409
+ #if defined(__clang__)
1410
+ #define CYTHON_SMALL_CODE
1411
+ #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
1412
+ #define CYTHON_SMALL_CODE __attribute__((cold))
1413
+ #else
1414
+ #define CYTHON_SMALL_CODE
1415
+ #endif
1416
+ #endif
1417
+
1418
+ static __Pyx_StringTabEntry __pyx_string_tab[] = {
1419
+ {&__pyx_n_s_Alignment, __pyx_k_Alignment, sizeof(__pyx_k_Alignment), 0, 0, 1, 1},
1420
+ {&__pyx_kp_s_An_enumeration_specifying_align, __pyx_k_An_enumeration_specifying_align, sizeof(__pyx_k_An_enumeration_specifying_align), 0, 0, 1, 0},
1421
+ {&__pyx_kp_s_An_enumeration_specifying_capit, __pyx_k_An_enumeration_specifying_capit, sizeof(__pyx_k_An_enumeration_specifying_capit), 0, 0, 1, 0},
1422
+ {&__pyx_kp_s_An_enumeration_specifying_the_v, __pyx_k_An_enumeration_specifying_the_v, sizeof(__pyx_k_An_enumeration_specifying_the_v), 0, 0, 1, 0},
1423
+ {&__pyx_kp_s_An_enumeration_specifying_the_w, __pyx_k_An_enumeration_specifying_the_w, sizeof(__pyx_k_An_enumeration_specifying_the_w), 0, 0, 1, 0},
1424
+ {&__pyx_n_s_BOLD, __pyx_k_BOLD, sizeof(__pyx_k_BOLD), 0, 0, 1, 1},
1425
+ {&__pyx_n_s_BOOK, __pyx_k_BOOK, sizeof(__pyx_k_BOOK), 0, 0, 1, 1},
1426
+ {&__pyx_n_s_CENTER, __pyx_k_CENTER, sizeof(__pyx_k_CENTER), 0, 0, 1, 1},
1427
+ {&__pyx_n_s_Enum, __pyx_k_Enum, sizeof(__pyx_k_Enum), 0, 0, 1, 1},
1428
+ {&__pyx_n_s_HEAVY, __pyx_k_HEAVY, sizeof(__pyx_k_HEAVY), 0, 0, 1, 1},
1429
+ {&__pyx_n_s_ITALIC, __pyx_k_ITALIC, sizeof(__pyx_k_ITALIC), 0, 0, 1, 1},
1430
+ {&__pyx_n_s_LEFT, __pyx_k_LEFT, sizeof(__pyx_k_LEFT), 0, 0, 1, 1},
1431
+ {&__pyx_n_s_LIGHT, __pyx_k_LIGHT, sizeof(__pyx_k_LIGHT), 0, 0, 1, 1},
1432
+ {&__pyx_n_s_MEDIUM, __pyx_k_MEDIUM, sizeof(__pyx_k_MEDIUM), 0, 0, 1, 1},
1433
+ {&__pyx_n_s_NORMAL, __pyx_k_NORMAL, sizeof(__pyx_k_NORMAL), 0, 0, 1, 1},
1434
+ {&__pyx_n_s_OBLIQUE, __pyx_k_OBLIQUE, sizeof(__pyx_k_OBLIQUE), 0, 0, 1, 1},
1435
+ {&__pyx_n_s_RIGHT, __pyx_k_RIGHT, sizeof(__pyx_k_RIGHT), 0, 0, 1, 1},
1436
+ {&__pyx_n_s_SEMIBOLD, __pyx_k_SEMIBOLD, sizeof(__pyx_k_SEMIBOLD), 0, 0, 1, 1},
1437
+ {&__pyx_n_s_SMALL_CAPS, __pyx_k_SMALL_CAPS, sizeof(__pyx_k_SMALL_CAPS), 0, 0, 1, 1},
1438
+ {&__pyx_n_s_Style, __pyx_k_Style, sizeof(__pyx_k_Style), 0, 0, 1, 1},
1439
+ {&__pyx_n_s_THIN, __pyx_k_THIN, sizeof(__pyx_k_THIN), 0, 0, 1, 1},
1440
+ {&__pyx_n_s_ULTRABOLD, __pyx_k_ULTRABOLD, sizeof(__pyx_k_ULTRABOLD), 0, 0, 1, 1},
1441
+ {&__pyx_n_s_ULTRAHEAVY, __pyx_k_ULTRAHEAVY, sizeof(__pyx_k_ULTRAHEAVY), 0, 0, 1, 1},
1442
+ {&__pyx_n_s_ULTRALIGHT, __pyx_k_ULTRALIGHT, sizeof(__pyx_k_ULTRALIGHT), 0, 0, 1, 1},
1443
+ {&__pyx_n_s_Variant, __pyx_k_Variant, sizeof(__pyx_k_Variant), 0, 0, 1, 1},
1444
+ {&__pyx_n_s_Weight, __pyx_k_Weight, sizeof(__pyx_k_Weight), 0, 0, 1, 1},
1445
+ {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
1446
+ {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
1447
+ {&__pyx_n_s_enum, __pyx_k_enum, sizeof(__pyx_k_enum), 0, 0, 1, 1},
1448
+ {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
1449
+ {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
1450
+ {&__pyx_n_s_manimpango_enums, __pyx_k_manimpango_enums, sizeof(__pyx_k_manimpango_enums), 0, 0, 1, 1},
1451
+ {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
1452
+ {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
1453
+ {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
1454
+ {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
1455
+ {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
1456
+ {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
1457
+ {0, 0, 0, 0, 0, 0, 0}
1458
+ };
1459
+ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
1460
+ return 0;
1461
+ }
1462
+
1463
+ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
1464
+ __Pyx_RefNannyDeclarations
1465
+ __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
1466
+ __Pyx_RefNannyFinishContext();
1467
+ return 0;
1468
+ }
1469
+
1470
+ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
1471
+ if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1472
+ return 0;
1473
+ __pyx_L1_error:;
1474
+ return -1;
1475
+ }
1476
+
1477
+ static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
1478
+ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
1479
+ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
1480
+ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
1481
+ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
1482
+ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
1483
+ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
1484
+
1485
+ static int __Pyx_modinit_global_init_code(void) {
1486
+ __Pyx_RefNannyDeclarations
1487
+ __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
1488
+ /*--- Global init code ---*/
1489
+ __Pyx_RefNannyFinishContext();
1490
+ return 0;
1491
+ }
1492
+
1493
+ static int __Pyx_modinit_variable_export_code(void) {
1494
+ __Pyx_RefNannyDeclarations
1495
+ __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
1496
+ /*--- Variable export code ---*/
1497
+ __Pyx_RefNannyFinishContext();
1498
+ return 0;
1499
+ }
1500
+
1501
+ static int __Pyx_modinit_function_export_code(void) {
1502
+ __Pyx_RefNannyDeclarations
1503
+ __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
1504
+ /*--- Function export code ---*/
1505
+ __Pyx_RefNannyFinishContext();
1506
+ return 0;
1507
+ }
1508
+
1509
+ static int __Pyx_modinit_type_init_code(void) {
1510
+ __Pyx_RefNannyDeclarations
1511
+ __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
1512
+ /*--- Type init code ---*/
1513
+ __Pyx_RefNannyFinishContext();
1514
+ return 0;
1515
+ }
1516
+
1517
+ static int __Pyx_modinit_type_import_code(void) {
1518
+ __Pyx_RefNannyDeclarations
1519
+ __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
1520
+ /*--- Type import code ---*/
1521
+ __Pyx_RefNannyFinishContext();
1522
+ return 0;
1523
+ }
1524
+
1525
+ static int __Pyx_modinit_variable_import_code(void) {
1526
+ __Pyx_RefNannyDeclarations
1527
+ __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
1528
+ /*--- Variable import code ---*/
1529
+ __Pyx_RefNannyFinishContext();
1530
+ return 0;
1531
+ }
1532
+
1533
+ static int __Pyx_modinit_function_import_code(void) {
1534
+ __Pyx_RefNannyDeclarations
1535
+ __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
1536
+ /*--- Function import code ---*/
1537
+ __Pyx_RefNannyFinishContext();
1538
+ return 0;
1539
+ }
1540
+
1541
+
1542
+ #ifndef CYTHON_NO_PYINIT_EXPORT
1543
+ #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
1544
+ #elif PY_MAJOR_VERSION < 3
1545
+ #ifdef __cplusplus
1546
+ #define __Pyx_PyMODINIT_FUNC extern "C" void
1547
+ #else
1548
+ #define __Pyx_PyMODINIT_FUNC void
1549
+ #endif
1550
+ #else
1551
+ #ifdef __cplusplus
1552
+ #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
1553
+ #else
1554
+ #define __Pyx_PyMODINIT_FUNC PyObject *
1555
+ #endif
1556
+ #endif
1557
+
1558
+
1559
+ #if PY_MAJOR_VERSION < 3
1560
+ __Pyx_PyMODINIT_FUNC initenums(void) CYTHON_SMALL_CODE; /*proto*/
1561
+ __Pyx_PyMODINIT_FUNC initenums(void)
1562
+ #else
1563
+ __Pyx_PyMODINIT_FUNC PyInit_enums(void) CYTHON_SMALL_CODE; /*proto*/
1564
+ __Pyx_PyMODINIT_FUNC PyInit_enums(void)
1565
+ #if CYTHON_PEP489_MULTI_PHASE_INIT
1566
+ {
1567
+ return PyModuleDef_Init(&__pyx_moduledef);
1568
+ }
1569
+ static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
1570
+ #if PY_VERSION_HEX >= 0x030700A1
1571
+ static PY_INT64_T main_interpreter_id = -1;
1572
+ PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
1573
+ if (main_interpreter_id == -1) {
1574
+ main_interpreter_id = current_id;
1575
+ return (unlikely(current_id == -1)) ? -1 : 0;
1576
+ } else if (unlikely(main_interpreter_id != current_id))
1577
+ #else
1578
+ static PyInterpreterState *main_interpreter = NULL;
1579
+ PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
1580
+ if (!main_interpreter) {
1581
+ main_interpreter = current_interpreter;
1582
+ } else if (unlikely(main_interpreter != current_interpreter))
1583
+ #endif
1584
+ {
1585
+ PyErr_SetString(
1586
+ PyExc_ImportError,
1587
+ "Interpreter change detected - this module can only be loaded into one interpreter per process.");
1588
+ return -1;
1589
+ }
1590
+ return 0;
1591
+ }
1592
+ 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) {
1593
+ PyObject *value = PyObject_GetAttrString(spec, from_name);
1594
+ int result = 0;
1595
+ if (likely(value)) {
1596
+ if (allow_none || value != Py_None) {
1597
+ result = PyDict_SetItemString(moddict, to_name, value);
1598
+ }
1599
+ Py_DECREF(value);
1600
+ } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
1601
+ PyErr_Clear();
1602
+ } else {
1603
+ result = -1;
1604
+ }
1605
+ return result;
1606
+ }
1607
+ static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
1608
+ PyObject *module = NULL, *moddict, *modname;
1609
+ if (__Pyx_check_single_interpreter())
1610
+ return NULL;
1611
+ if (__pyx_m)
1612
+ return __Pyx_NewRef(__pyx_m);
1613
+ modname = PyObject_GetAttrString(spec, "name");
1614
+ if (unlikely(!modname)) goto bad;
1615
+ module = PyModule_NewObject(modname);
1616
+ Py_DECREF(modname);
1617
+ if (unlikely(!module)) goto bad;
1618
+ moddict = PyModule_GetDict(module);
1619
+ if (unlikely(!moddict)) goto bad;
1620
+ if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
1621
+ if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
1622
+ if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
1623
+ if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
1624
+ return module;
1625
+ bad:
1626
+ Py_XDECREF(module);
1627
+ return NULL;
1628
+ }
1629
+
1630
+
1631
+ static CYTHON_SMALL_CODE int __pyx_pymod_exec_enums(PyObject *__pyx_pyinit_module)
1632
+ #endif
1633
+ #endif
1634
+ {
1635
+ PyObject *__pyx_t_1 = NULL;
1636
+ PyObject *__pyx_t_2 = NULL;
1637
+ PyObject *__pyx_t_3 = NULL;
1638
+ PyObject *__pyx_t_4 = NULL;
1639
+ int __pyx_lineno = 0;
1640
+ const char *__pyx_filename = NULL;
1641
+ int __pyx_clineno = 0;
1642
+ __Pyx_RefNannyDeclarations
1643
+ #if CYTHON_PEP489_MULTI_PHASE_INIT
1644
+ if (__pyx_m) {
1645
+ if (__pyx_m == __pyx_pyinit_module) return 0;
1646
+ PyErr_SetString(PyExc_RuntimeError, "Module 'enums' has already been imported. Re-initialisation is not supported.");
1647
+ return -1;
1648
+ }
1649
+ #elif PY_MAJOR_VERSION >= 3
1650
+ if (__pyx_m) return __Pyx_NewRef(__pyx_m);
1651
+ #endif
1652
+ #if CYTHON_REFNANNY
1653
+ __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
1654
+ if (!__Pyx_RefNanny) {
1655
+ PyErr_Clear();
1656
+ __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
1657
+ if (!__Pyx_RefNanny)
1658
+ Py_FatalError("failed to import 'refnanny' module");
1659
+ }
1660
+ #endif
1661
+ __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_enums(void)", 0);
1662
+ if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1663
+ #ifdef __Pxy_PyFrame_Initialize_Offsets
1664
+ __Pxy_PyFrame_Initialize_Offsets();
1665
+ #endif
1666
+ __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
1667
+ __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
1668
+ __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
1669
+ #ifdef __Pyx_CyFunction_USED
1670
+ if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1671
+ #endif
1672
+ #ifdef __Pyx_FusedFunction_USED
1673
+ if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1674
+ #endif
1675
+ #ifdef __Pyx_Coroutine_USED
1676
+ if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1677
+ #endif
1678
+ #ifdef __Pyx_Generator_USED
1679
+ if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1680
+ #endif
1681
+ #ifdef __Pyx_AsyncGen_USED
1682
+ if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1683
+ #endif
1684
+ #ifdef __Pyx_StopAsyncIteration_USED
1685
+ if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1686
+ #endif
1687
+ /*--- Library function declarations ---*/
1688
+ /*--- Threads initialization code ---*/
1689
+ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
1690
+ PyEval_InitThreads();
1691
+ #endif
1692
+ /*--- Module creation code ---*/
1693
+ #if CYTHON_PEP489_MULTI_PHASE_INIT
1694
+ __pyx_m = __pyx_pyinit_module;
1695
+ Py_INCREF(__pyx_m);
1696
+ #else
1697
+ #if PY_MAJOR_VERSION < 3
1698
+ __pyx_m = Py_InitModule4("enums", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
1699
+ #else
1700
+ __pyx_m = PyModule_Create(&__pyx_moduledef);
1701
+ #endif
1702
+ if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
1703
+ #endif
1704
+ __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
1705
+ Py_INCREF(__pyx_d);
1706
+ __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
1707
+ Py_INCREF(__pyx_b);
1708
+ __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
1709
+ Py_INCREF(__pyx_cython_runtime);
1710
+ if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1711
+ /*--- Initialize various global constants etc. ---*/
1712
+ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1713
+ #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
1714
+ if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1715
+ #endif
1716
+ if (__pyx_module_is_main_manimpango__enums) {
1717
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1718
+ }
1719
+ #if PY_MAJOR_VERSION >= 3
1720
+ {
1721
+ PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
1722
+ if (!PyDict_GetItemString(modules, "manimpango.enums")) {
1723
+ if (unlikely(PyDict_SetItemString(modules, "manimpango.enums", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
1724
+ }
1725
+ }
1726
+ #endif
1727
+ /*--- Builtin init code ---*/
1728
+ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1729
+ /*--- Constants init code ---*/
1730
+ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1731
+ /*--- Global type/function init code ---*/
1732
+ (void)__Pyx_modinit_global_init_code();
1733
+ (void)__Pyx_modinit_variable_export_code();
1734
+ (void)__Pyx_modinit_function_export_code();
1735
+ (void)__Pyx_modinit_type_init_code();
1736
+ (void)__Pyx_modinit_type_import_code();
1737
+ (void)__Pyx_modinit_variable_import_code();
1738
+ (void)__Pyx_modinit_function_import_code();
1739
+ /*--- Execution code ---*/
1740
+ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
1741
+ if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1742
+ #endif
1743
+
1744
+ /* "manimpango/enums.pyx":1
1745
+ * from enum import Enum # <<<<<<<<<<<<<<
1746
+ *
1747
+ * from pango cimport *
1748
+ */
1749
+ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
1750
+ __Pyx_GOTREF(__pyx_t_1);
1751
+ __Pyx_INCREF(__pyx_n_s_Enum);
1752
+ __Pyx_GIVEREF(__pyx_n_s_Enum);
1753
+ PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Enum);
1754
+ __pyx_t_2 = __Pyx_Import(__pyx_n_s_enum, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
1755
+ __Pyx_GOTREF(__pyx_t_2);
1756
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1757
+ __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Enum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
1758
+ __Pyx_GOTREF(__pyx_t_1);
1759
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_Enum, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1760
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1761
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1762
+
1763
+ /* "manimpango/enums.pyx":6
1764
+ *
1765
+ *
1766
+ * class Style(Enum): # <<<<<<<<<<<<<<
1767
+ * """
1768
+ * An enumeration specifying the various slant styles possible for a font.
1769
+ */
1770
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Enum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error)
1771
+ __Pyx_GOTREF(__pyx_t_2);
1772
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error)
1773
+ __Pyx_GOTREF(__pyx_t_1);
1774
+ __Pyx_GIVEREF(__pyx_t_2);
1775
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
1776
+ __pyx_t_2 = 0;
1777
+ __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error)
1778
+ __Pyx_GOTREF(__pyx_t_2);
1779
+ __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Style, __pyx_n_s_Style, (PyObject *) NULL, __pyx_n_s_manimpango_enums, __pyx_kp_s_An_enumeration_specifying_the_v); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error)
1780
+ __Pyx_GOTREF(__pyx_t_3);
1781
+
1782
+ /* "manimpango/enums.pyx":22
1783
+ * the font is slanted in an italic style.
1784
+ * """
1785
+ * NORMAL = PANGO_STYLE_NORMAL # <<<<<<<<<<<<<<
1786
+ * ITALIC = PANGO_STYLE_ITALIC
1787
+ * OBLIQUE = PANGO_STYLE_OBLIQUE
1788
+ */
1789
+ __pyx_t_4 = __Pyx_PyInt_From_PangoStyle(PANGO_STYLE_NORMAL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 22, __pyx_L1_error)
1790
+ __Pyx_GOTREF(__pyx_t_4);
1791
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NORMAL, __pyx_t_4) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
1792
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1793
+
1794
+ /* "manimpango/enums.pyx":23
1795
+ * """
1796
+ * NORMAL = PANGO_STYLE_NORMAL
1797
+ * ITALIC = PANGO_STYLE_ITALIC # <<<<<<<<<<<<<<
1798
+ * OBLIQUE = PANGO_STYLE_OBLIQUE
1799
+ *
1800
+ */
1801
+ __pyx_t_4 = __Pyx_PyInt_From_PangoStyle(PANGO_STYLE_ITALIC); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 23, __pyx_L1_error)
1802
+ __Pyx_GOTREF(__pyx_t_4);
1803
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ITALIC, __pyx_t_4) < 0) __PYX_ERR(0, 23, __pyx_L1_error)
1804
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1805
+
1806
+ /* "manimpango/enums.pyx":24
1807
+ * NORMAL = PANGO_STYLE_NORMAL
1808
+ * ITALIC = PANGO_STYLE_ITALIC
1809
+ * OBLIQUE = PANGO_STYLE_OBLIQUE # <<<<<<<<<<<<<<
1810
+ *
1811
+ * class Weight(Enum):
1812
+ */
1813
+ __pyx_t_4 = __Pyx_PyInt_From_PangoStyle(PANGO_STYLE_OBLIQUE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 24, __pyx_L1_error)
1814
+ __Pyx_GOTREF(__pyx_t_4);
1815
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_OBLIQUE, __pyx_t_4) < 0) __PYX_ERR(0, 24, __pyx_L1_error)
1816
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1817
+
1818
+ /* "manimpango/enums.pyx":6
1819
+ *
1820
+ *
1821
+ * class Style(Enum): # <<<<<<<<<<<<<<
1822
+ * """
1823
+ * An enumeration specifying the various slant styles possible for a font.
1824
+ */
1825
+ __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Style, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6, __pyx_L1_error)
1826
+ __Pyx_GOTREF(__pyx_t_4);
1827
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_Style, __pyx_t_4) < 0) __PYX_ERR(0, 6, __pyx_L1_error)
1828
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1829
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1830
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1831
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1832
+
1833
+ /* "manimpango/enums.pyx":26
1834
+ * OBLIQUE = PANGO_STYLE_OBLIQUE
1835
+ *
1836
+ * class Weight(Enum): # <<<<<<<<<<<<<<
1837
+ * """
1838
+ * An enumeration specifying the weight (boldness) of a font.
1839
+ */
1840
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Enum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 26, __pyx_L1_error)
1841
+ __Pyx_GOTREF(__pyx_t_1);
1842
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error)
1843
+ __Pyx_GOTREF(__pyx_t_2);
1844
+ __Pyx_GIVEREF(__pyx_t_1);
1845
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
1846
+ __pyx_t_1 = 0;
1847
+ __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 26, __pyx_L1_error)
1848
+ __Pyx_GOTREF(__pyx_t_1);
1849
+ __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Weight, __pyx_n_s_Weight, (PyObject *) NULL, __pyx_n_s_manimpango_enums, __pyx_kp_s_An_enumeration_specifying_the_w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 26, __pyx_L1_error)
1850
+ __Pyx_GOTREF(__pyx_t_3);
1851
+
1852
+ /* "manimpango/enums.pyx":68
1853
+ * the ultraheavy weight( = 1000; Since: 1.24)
1854
+ * """
1855
+ * NORMAL = PANGO_WEIGHT_NORMAL # <<<<<<<<<<<<<<
1856
+ * BOLD = PANGO_WEIGHT_BOLD
1857
+ * THIN = PANGO_WEIGHT_THIN
1858
+ */
1859
+ __pyx_t_4 = __Pyx_PyInt_From_PangoWeight(PANGO_WEIGHT_NORMAL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 68, __pyx_L1_error)
1860
+ __Pyx_GOTREF(__pyx_t_4);
1861
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NORMAL, __pyx_t_4) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
1862
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1863
+
1864
+ /* "manimpango/enums.pyx":69
1865
+ * """
1866
+ * NORMAL = PANGO_WEIGHT_NORMAL
1867
+ * BOLD = PANGO_WEIGHT_BOLD # <<<<<<<<<<<<<<
1868
+ * THIN = PANGO_WEIGHT_THIN
1869
+ * ULTRALIGHT = PANGO_WEIGHT_ULTRALIGHT
1870
+ */
1871
+ __pyx_t_4 = __Pyx_PyInt_From_PangoWeight(PANGO_WEIGHT_BOLD); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 69, __pyx_L1_error)
1872
+ __Pyx_GOTREF(__pyx_t_4);
1873
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_BOLD, __pyx_t_4) < 0) __PYX_ERR(0, 69, __pyx_L1_error)
1874
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1875
+
1876
+ /* "manimpango/enums.pyx":70
1877
+ * NORMAL = PANGO_WEIGHT_NORMAL
1878
+ * BOLD = PANGO_WEIGHT_BOLD
1879
+ * THIN = PANGO_WEIGHT_THIN # <<<<<<<<<<<<<<
1880
+ * ULTRALIGHT = PANGO_WEIGHT_ULTRALIGHT
1881
+ * LIGHT = PANGO_WEIGHT_LIGHT
1882
+ */
1883
+ __pyx_t_4 = __Pyx_PyInt_From_PangoWeight(PANGO_WEIGHT_THIN); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 70, __pyx_L1_error)
1884
+ __Pyx_GOTREF(__pyx_t_4);
1885
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_THIN, __pyx_t_4) < 0) __PYX_ERR(0, 70, __pyx_L1_error)
1886
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1887
+
1888
+ /* "manimpango/enums.pyx":71
1889
+ * BOLD = PANGO_WEIGHT_BOLD
1890
+ * THIN = PANGO_WEIGHT_THIN
1891
+ * ULTRALIGHT = PANGO_WEIGHT_ULTRALIGHT # <<<<<<<<<<<<<<
1892
+ * LIGHT = PANGO_WEIGHT_LIGHT
1893
+ * BOOK = PANGO_WEIGHT_BOOK
1894
+ */
1895
+ __pyx_t_4 = __Pyx_PyInt_From_PangoWeight(PANGO_WEIGHT_ULTRALIGHT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 71, __pyx_L1_error)
1896
+ __Pyx_GOTREF(__pyx_t_4);
1897
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ULTRALIGHT, __pyx_t_4) < 0) __PYX_ERR(0, 71, __pyx_L1_error)
1898
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1899
+
1900
+ /* "manimpango/enums.pyx":72
1901
+ * THIN = PANGO_WEIGHT_THIN
1902
+ * ULTRALIGHT = PANGO_WEIGHT_ULTRALIGHT
1903
+ * LIGHT = PANGO_WEIGHT_LIGHT # <<<<<<<<<<<<<<
1904
+ * BOOK = PANGO_WEIGHT_BOOK
1905
+ * MEDIUM = PANGO_WEIGHT_MEDIUM
1906
+ */
1907
+ __pyx_t_4 = __Pyx_PyInt_From_PangoWeight(PANGO_WEIGHT_LIGHT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error)
1908
+ __Pyx_GOTREF(__pyx_t_4);
1909
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_LIGHT, __pyx_t_4) < 0) __PYX_ERR(0, 72, __pyx_L1_error)
1910
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1911
+
1912
+ /* "manimpango/enums.pyx":73
1913
+ * ULTRALIGHT = PANGO_WEIGHT_ULTRALIGHT
1914
+ * LIGHT = PANGO_WEIGHT_LIGHT
1915
+ * BOOK = PANGO_WEIGHT_BOOK # <<<<<<<<<<<<<<
1916
+ * MEDIUM = PANGO_WEIGHT_MEDIUM
1917
+ * SEMIBOLD = PANGO_WEIGHT_SEMIBOLD
1918
+ */
1919
+ __pyx_t_4 = __Pyx_PyInt_From_PangoWeight(PANGO_WEIGHT_BOOK); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 73, __pyx_L1_error)
1920
+ __Pyx_GOTREF(__pyx_t_4);
1921
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_BOOK, __pyx_t_4) < 0) __PYX_ERR(0, 73, __pyx_L1_error)
1922
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1923
+
1924
+ /* "manimpango/enums.pyx":74
1925
+ * LIGHT = PANGO_WEIGHT_LIGHT
1926
+ * BOOK = PANGO_WEIGHT_BOOK
1927
+ * MEDIUM = PANGO_WEIGHT_MEDIUM # <<<<<<<<<<<<<<
1928
+ * SEMIBOLD = PANGO_WEIGHT_SEMIBOLD
1929
+ * ULTRABOLD = PANGO_WEIGHT_ULTRABOLD
1930
+ */
1931
+ __pyx_t_4 = __Pyx_PyInt_From_PangoWeight(PANGO_WEIGHT_MEDIUM); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 74, __pyx_L1_error)
1932
+ __Pyx_GOTREF(__pyx_t_4);
1933
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_MEDIUM, __pyx_t_4) < 0) __PYX_ERR(0, 74, __pyx_L1_error)
1934
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1935
+
1936
+ /* "manimpango/enums.pyx":75
1937
+ * BOOK = PANGO_WEIGHT_BOOK
1938
+ * MEDIUM = PANGO_WEIGHT_MEDIUM
1939
+ * SEMIBOLD = PANGO_WEIGHT_SEMIBOLD # <<<<<<<<<<<<<<
1940
+ * ULTRABOLD = PANGO_WEIGHT_ULTRABOLD
1941
+ * HEAVY = PANGO_WEIGHT_HEAVY
1942
+ */
1943
+ __pyx_t_4 = __Pyx_PyInt_From_PangoWeight(PANGO_WEIGHT_SEMIBOLD); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 75, __pyx_L1_error)
1944
+ __Pyx_GOTREF(__pyx_t_4);
1945
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_SEMIBOLD, __pyx_t_4) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
1946
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1947
+
1948
+ /* "manimpango/enums.pyx":76
1949
+ * MEDIUM = PANGO_WEIGHT_MEDIUM
1950
+ * SEMIBOLD = PANGO_WEIGHT_SEMIBOLD
1951
+ * ULTRABOLD = PANGO_WEIGHT_ULTRABOLD # <<<<<<<<<<<<<<
1952
+ * HEAVY = PANGO_WEIGHT_HEAVY
1953
+ * ULTRAHEAVY = PANGO_WEIGHT_ULTRAHEAVY
1954
+ */
1955
+ __pyx_t_4 = __Pyx_PyInt_From_PangoWeight(PANGO_WEIGHT_ULTRABOLD); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 76, __pyx_L1_error)
1956
+ __Pyx_GOTREF(__pyx_t_4);
1957
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ULTRABOLD, __pyx_t_4) < 0) __PYX_ERR(0, 76, __pyx_L1_error)
1958
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1959
+
1960
+ /* "manimpango/enums.pyx":77
1961
+ * SEMIBOLD = PANGO_WEIGHT_SEMIBOLD
1962
+ * ULTRABOLD = PANGO_WEIGHT_ULTRABOLD
1963
+ * HEAVY = PANGO_WEIGHT_HEAVY # <<<<<<<<<<<<<<
1964
+ * ULTRAHEAVY = PANGO_WEIGHT_ULTRAHEAVY
1965
+ *
1966
+ */
1967
+ __pyx_t_4 = __Pyx_PyInt_From_PangoWeight(PANGO_WEIGHT_HEAVY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L1_error)
1968
+ __Pyx_GOTREF(__pyx_t_4);
1969
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_HEAVY, __pyx_t_4) < 0) __PYX_ERR(0, 77, __pyx_L1_error)
1970
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1971
+
1972
+ /* "manimpango/enums.pyx":78
1973
+ * ULTRABOLD = PANGO_WEIGHT_ULTRABOLD
1974
+ * HEAVY = PANGO_WEIGHT_HEAVY
1975
+ * ULTRAHEAVY = PANGO_WEIGHT_ULTRAHEAVY # <<<<<<<<<<<<<<
1976
+ *
1977
+ * class Variant(Enum):
1978
+ */
1979
+ __pyx_t_4 = __Pyx_PyInt_From_PangoWeight(PANGO_WEIGHT_ULTRAHEAVY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 78, __pyx_L1_error)
1980
+ __Pyx_GOTREF(__pyx_t_4);
1981
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ULTRAHEAVY, __pyx_t_4) < 0) __PYX_ERR(0, 78, __pyx_L1_error)
1982
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1983
+
1984
+ /* "manimpango/enums.pyx":26
1985
+ * OBLIQUE = PANGO_STYLE_OBLIQUE
1986
+ *
1987
+ * class Weight(Enum): # <<<<<<<<<<<<<<
1988
+ * """
1989
+ * An enumeration specifying the weight (boldness) of a font.
1990
+ */
1991
+ __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Weight, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 26, __pyx_L1_error)
1992
+ __Pyx_GOTREF(__pyx_t_4);
1993
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_Weight, __pyx_t_4) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
1994
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1995
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1996
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1997
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1998
+
1999
+ /* "manimpango/enums.pyx":80
2000
+ * ULTRAHEAVY = PANGO_WEIGHT_ULTRAHEAVY
2001
+ *
2002
+ * class Variant(Enum): # <<<<<<<<<<<<<<
2003
+ * """
2004
+ * An enumeration specifying capitalization variant of the font.
2005
+ */
2006
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Enum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L1_error)
2007
+ __Pyx_GOTREF(__pyx_t_2);
2008
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error)
2009
+ __Pyx_GOTREF(__pyx_t_1);
2010
+ __Pyx_GIVEREF(__pyx_t_2);
2011
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
2012
+ __pyx_t_2 = 0;
2013
+ __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L1_error)
2014
+ __Pyx_GOTREF(__pyx_t_2);
2015
+ __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Variant, __pyx_n_s_Variant, (PyObject *) NULL, __pyx_n_s_manimpango_enums, __pyx_kp_s_An_enumeration_specifying_capit); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L1_error)
2016
+ __Pyx_GOTREF(__pyx_t_3);
2017
+
2018
+ /* "manimpango/enums.pyx":94
2019
+ * of the capital characters.
2020
+ * """
2021
+ * NORMAL = PANGO_VARIANT_NORMAL # <<<<<<<<<<<<<<
2022
+ * SMALL_CAPS = PANGO_VARIANT_SMALL_CAPS
2023
+ *
2024
+ */
2025
+ __pyx_t_4 = __Pyx_PyInt_From_PangoVariant(PANGO_VARIANT_NORMAL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 94, __pyx_L1_error)
2026
+ __Pyx_GOTREF(__pyx_t_4);
2027
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NORMAL, __pyx_t_4) < 0) __PYX_ERR(0, 94, __pyx_L1_error)
2028
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2029
+
2030
+ /* "manimpango/enums.pyx":95
2031
+ * """
2032
+ * NORMAL = PANGO_VARIANT_NORMAL
2033
+ * SMALL_CAPS = PANGO_VARIANT_SMALL_CAPS # <<<<<<<<<<<<<<
2034
+ *
2035
+ *
2036
+ */
2037
+ __pyx_t_4 = __Pyx_PyInt_From_PangoVariant(PANGO_VARIANT_SMALL_CAPS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 95, __pyx_L1_error)
2038
+ __Pyx_GOTREF(__pyx_t_4);
2039
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_SMALL_CAPS, __pyx_t_4) < 0) __PYX_ERR(0, 95, __pyx_L1_error)
2040
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2041
+
2042
+ /* "manimpango/enums.pyx":80
2043
+ * ULTRAHEAVY = PANGO_WEIGHT_ULTRAHEAVY
2044
+ *
2045
+ * class Variant(Enum): # <<<<<<<<<<<<<<
2046
+ * """
2047
+ * An enumeration specifying capitalization variant of the font.
2048
+ */
2049
+ __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Variant, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 80, __pyx_L1_error)
2050
+ __Pyx_GOTREF(__pyx_t_4);
2051
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_Variant, __pyx_t_4) < 0) __PYX_ERR(0, 80, __pyx_L1_error)
2052
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2053
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2054
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2055
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2056
+
2057
+ /* "manimpango/enums.pyx":98
2058
+ *
2059
+ *
2060
+ * class Alignment(Enum): # <<<<<<<<<<<<<<
2061
+ * """
2062
+ * An enumeration specifying alignment.
2063
+ */
2064
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Enum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error)
2065
+ __Pyx_GOTREF(__pyx_t_1);
2066
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error)
2067
+ __Pyx_GOTREF(__pyx_t_2);
2068
+ __Pyx_GIVEREF(__pyx_t_1);
2069
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
2070
+ __pyx_t_1 = 0;
2071
+ __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error)
2072
+ __Pyx_GOTREF(__pyx_t_1);
2073
+ __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Alignment, __pyx_n_s_Alignment, (PyObject *) NULL, __pyx_n_s_manimpango_enums, __pyx_kp_s_An_enumeration_specifying_align); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __pyx_L1_error)
2074
+ __Pyx_GOTREF(__pyx_t_3);
2075
+
2076
+ /* "manimpango/enums.pyx":102
2077
+ * An enumeration specifying alignment.
2078
+ * """
2079
+ * LEFT = PANGO_ALIGN_LEFT # <<<<<<<<<<<<<<
2080
+ * CENTER = PANGO_ALIGN_CENTER
2081
+ * RIGHT = PANGO_ALIGN_RIGHT
2082
+ */
2083
+ __pyx_t_4 = __Pyx_PyInt_From_PangoAlignment(PANGO_ALIGN_LEFT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 102, __pyx_L1_error)
2084
+ __Pyx_GOTREF(__pyx_t_4);
2085
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_LEFT, __pyx_t_4) < 0) __PYX_ERR(0, 102, __pyx_L1_error)
2086
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2087
+
2088
+ /* "manimpango/enums.pyx":103
2089
+ * """
2090
+ * LEFT = PANGO_ALIGN_LEFT
2091
+ * CENTER = PANGO_ALIGN_CENTER # <<<<<<<<<<<<<<
2092
+ * RIGHT = PANGO_ALIGN_RIGHT
2093
+ */
2094
+ __pyx_t_4 = __Pyx_PyInt_From_PangoAlignment(PANGO_ALIGN_CENTER); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 103, __pyx_L1_error)
2095
+ __Pyx_GOTREF(__pyx_t_4);
2096
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_CENTER, __pyx_t_4) < 0) __PYX_ERR(0, 103, __pyx_L1_error)
2097
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2098
+
2099
+ /* "manimpango/enums.pyx":104
2100
+ * LEFT = PANGO_ALIGN_LEFT
2101
+ * CENTER = PANGO_ALIGN_CENTER
2102
+ * RIGHT = PANGO_ALIGN_RIGHT # <<<<<<<<<<<<<<
2103
+ */
2104
+ __pyx_t_4 = __Pyx_PyInt_From_PangoAlignment(PANGO_ALIGN_RIGHT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 104, __pyx_L1_error)
2105
+ __Pyx_GOTREF(__pyx_t_4);
2106
+ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_RIGHT, __pyx_t_4) < 0) __PYX_ERR(0, 104, __pyx_L1_error)
2107
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2108
+
2109
+ /* "manimpango/enums.pyx":98
2110
+ *
2111
+ *
2112
+ * class Alignment(Enum): # <<<<<<<<<<<<<<
2113
+ * """
2114
+ * An enumeration specifying alignment.
2115
+ */
2116
+ __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Alignment, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 98, __pyx_L1_error)
2117
+ __Pyx_GOTREF(__pyx_t_4);
2118
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_Alignment, __pyx_t_4) < 0) __PYX_ERR(0, 98, __pyx_L1_error)
2119
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2120
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2121
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2122
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2123
+
2124
+ /* "manimpango/enums.pyx":1
2125
+ * from enum import Enum # <<<<<<<<<<<<<<
2126
+ *
2127
+ * from pango cimport *
2128
+ */
2129
+ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
2130
+ __Pyx_GOTREF(__pyx_t_2);
2131
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
2132
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2133
+
2134
+ /*--- Wrapped vars code ---*/
2135
+
2136
+ goto __pyx_L0;
2137
+ __pyx_L1_error:;
2138
+ __Pyx_XDECREF(__pyx_t_1);
2139
+ __Pyx_XDECREF(__pyx_t_2);
2140
+ __Pyx_XDECREF(__pyx_t_3);
2141
+ __Pyx_XDECREF(__pyx_t_4);
2142
+ if (__pyx_m) {
2143
+ if (__pyx_d) {
2144
+ __Pyx_AddTraceback("init manimpango.enums", __pyx_clineno, __pyx_lineno, __pyx_filename);
2145
+ }
2146
+ Py_CLEAR(__pyx_m);
2147
+ } else if (!PyErr_Occurred()) {
2148
+ PyErr_SetString(PyExc_ImportError, "init manimpango.enums");
2149
+ }
2150
+ __pyx_L0:;
2151
+ __Pyx_RefNannyFinishContext();
2152
+ #if CYTHON_PEP489_MULTI_PHASE_INIT
2153
+ return (__pyx_m != NULL) ? 0 : -1;
2154
+ #elif PY_MAJOR_VERSION >= 3
2155
+ return __pyx_m;
2156
+ #else
2157
+ return;
2158
+ #endif
2159
+ }
2160
+
2161
+ /* --- Runtime support code --- */
2162
+ /* Refnanny */
2163
+ #if CYTHON_REFNANNY
2164
+ static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
2165
+ PyObject *m = NULL, *p = NULL;
2166
+ void *r = NULL;
2167
+ m = PyImport_ImportModule(modname);
2168
+ if (!m) goto end;
2169
+ p = PyObject_GetAttrString(m, "RefNannyAPI");
2170
+ if (!p) goto end;
2171
+ r = PyLong_AsVoidPtr(p);
2172
+ end:
2173
+ Py_XDECREF(p);
2174
+ Py_XDECREF(m);
2175
+ return (__Pyx_RefNannyAPIStruct *)r;
2176
+ }
2177
+ #endif
2178
+
2179
+ /* PyObjectGetAttrStr */
2180
+ #if CYTHON_USE_TYPE_SLOTS
2181
+ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
2182
+ PyTypeObject* tp = Py_TYPE(obj);
2183
+ if (likely(tp->tp_getattro))
2184
+ return tp->tp_getattro(obj, attr_name);
2185
+ #if PY_MAJOR_VERSION < 3
2186
+ if (likely(tp->tp_getattr))
2187
+ return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
2188
+ #endif
2189
+ return PyObject_GetAttr(obj, attr_name);
2190
+ }
2191
+ #endif
2192
+
2193
+ /* Import */
2194
+ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
2195
+ PyObject *empty_list = 0;
2196
+ PyObject *module = 0;
2197
+ PyObject *global_dict = 0;
2198
+ PyObject *empty_dict = 0;
2199
+ PyObject *list;
2200
+ #if PY_MAJOR_VERSION < 3
2201
+ PyObject *py_import;
2202
+ py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
2203
+ if (!py_import)
2204
+ goto bad;
2205
+ #endif
2206
+ if (from_list)
2207
+ list = from_list;
2208
+ else {
2209
+ empty_list = PyList_New(0);
2210
+ if (!empty_list)
2211
+ goto bad;
2212
+ list = empty_list;
2213
+ }
2214
+ global_dict = PyModule_GetDict(__pyx_m);
2215
+ if (!global_dict)
2216
+ goto bad;
2217
+ empty_dict = PyDict_New();
2218
+ if (!empty_dict)
2219
+ goto bad;
2220
+ {
2221
+ #if PY_MAJOR_VERSION >= 3
2222
+ if (level == -1) {
2223
+ if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
2224
+ module = PyImport_ImportModuleLevelObject(
2225
+ name, global_dict, empty_dict, list, 1);
2226
+ if (!module) {
2227
+ if (!PyErr_ExceptionMatches(PyExc_ImportError))
2228
+ goto bad;
2229
+ PyErr_Clear();
2230
+ }
2231
+ }
2232
+ level = 0;
2233
+ }
2234
+ #endif
2235
+ if (!module) {
2236
+ #if PY_MAJOR_VERSION < 3
2237
+ PyObject *py_level = PyInt_FromLong(level);
2238
+ if (!py_level)
2239
+ goto bad;
2240
+ module = PyObject_CallFunctionObjArgs(py_import,
2241
+ name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
2242
+ Py_DECREF(py_level);
2243
+ #else
2244
+ module = PyImport_ImportModuleLevelObject(
2245
+ name, global_dict, empty_dict, list, level);
2246
+ #endif
2247
+ }
2248
+ }
2249
+ bad:
2250
+ #if PY_MAJOR_VERSION < 3
2251
+ Py_XDECREF(py_import);
2252
+ #endif
2253
+ Py_XDECREF(empty_list);
2254
+ Py_XDECREF(empty_dict);
2255
+ return module;
2256
+ }
2257
+
2258
+ /* ImportFrom */
2259
+ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
2260
+ PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
2261
+ if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
2262
+ PyErr_Format(PyExc_ImportError,
2263
+ #if PY_MAJOR_VERSION < 3
2264
+ "cannot import name %.230s", PyString_AS_STRING(name));
2265
+ #else
2266
+ "cannot import name %S", name);
2267
+ #endif
2268
+ }
2269
+ return value;
2270
+ }
2271
+
2272
+ /* GetBuiltinName */
2273
+ static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
2274
+ PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
2275
+ if (unlikely(!result)) {
2276
+ PyErr_Format(PyExc_NameError,
2277
+ #if PY_MAJOR_VERSION >= 3
2278
+ "name '%U' is not defined", name);
2279
+ #else
2280
+ "name '%.200s' is not defined", PyString_AS_STRING(name));
2281
+ #endif
2282
+ }
2283
+ return result;
2284
+ }
2285
+
2286
+ /* PyDictVersioning */
2287
+ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
2288
+ static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
2289
+ PyObject *dict = Py_TYPE(obj)->tp_dict;
2290
+ return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
2291
+ }
2292
+ static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
2293
+ PyObject **dictptr = NULL;
2294
+ Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
2295
+ if (offset) {
2296
+ #if CYTHON_COMPILING_IN_CPYTHON
2297
+ dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
2298
+ #else
2299
+ dictptr = _PyObject_GetDictPtr(obj);
2300
+ #endif
2301
+ }
2302
+ return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
2303
+ }
2304
+ static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
2305
+ PyObject *dict = Py_TYPE(obj)->tp_dict;
2306
+ if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
2307
+ return 0;
2308
+ return obj_dict_version == __Pyx_get_object_dict_version(obj);
2309
+ }
2310
+ #endif
2311
+
2312
+ /* GetModuleGlobalName */
2313
+ #if CYTHON_USE_DICT_VERSIONS
2314
+ static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
2315
+ #else
2316
+ static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
2317
+ #endif
2318
+ {
2319
+ PyObject *result;
2320
+ #if !CYTHON_AVOID_BORROWED_REFS
2321
+ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
2322
+ result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
2323
+ __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
2324
+ if (likely(result)) {
2325
+ return __Pyx_NewRef(result);
2326
+ } else if (unlikely(PyErr_Occurred())) {
2327
+ return NULL;
2328
+ }
2329
+ #else
2330
+ result = PyDict_GetItem(__pyx_d, name);
2331
+ __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
2332
+ if (likely(result)) {
2333
+ return __Pyx_NewRef(result);
2334
+ }
2335
+ #endif
2336
+ #else
2337
+ result = PyObject_GetItem(__pyx_d, name);
2338
+ __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
2339
+ if (likely(result)) {
2340
+ return __Pyx_NewRef(result);
2341
+ }
2342
+ PyErr_Clear();
2343
+ #endif
2344
+ return __Pyx_GetBuiltinName(name);
2345
+ }
2346
+
2347
+ /* CalculateMetaclass */
2348
+ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
2349
+ Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
2350
+ for (i=0; i < nbases; i++) {
2351
+ PyTypeObject *tmptype;
2352
+ PyObject *tmp = PyTuple_GET_ITEM(bases, i);
2353
+ tmptype = Py_TYPE(tmp);
2354
+ #if PY_MAJOR_VERSION < 3
2355
+ if (tmptype == &PyClass_Type)
2356
+ continue;
2357
+ #endif
2358
+ if (!metaclass) {
2359
+ metaclass = tmptype;
2360
+ continue;
2361
+ }
2362
+ if (PyType_IsSubtype(metaclass, tmptype))
2363
+ continue;
2364
+ if (PyType_IsSubtype(tmptype, metaclass)) {
2365
+ metaclass = tmptype;
2366
+ continue;
2367
+ }
2368
+ PyErr_SetString(PyExc_TypeError,
2369
+ "metaclass conflict: "
2370
+ "the metaclass of a derived class "
2371
+ "must be a (non-strict) subclass "
2372
+ "of the metaclasses of all its bases");
2373
+ return NULL;
2374
+ }
2375
+ if (!metaclass) {
2376
+ #if PY_MAJOR_VERSION < 3
2377
+ metaclass = &PyClass_Type;
2378
+ #else
2379
+ metaclass = &PyType_Type;
2380
+ #endif
2381
+ }
2382
+ Py_INCREF((PyObject*) metaclass);
2383
+ return (PyObject*) metaclass;
2384
+ }
2385
+
2386
+ /* Py3ClassCreate */
2387
+ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
2388
+ PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
2389
+ PyObject *ns;
2390
+ if (metaclass) {
2391
+ PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
2392
+ if (prep) {
2393
+ PyObject *pargs = PyTuple_Pack(2, name, bases);
2394
+ if (unlikely(!pargs)) {
2395
+ Py_DECREF(prep);
2396
+ return NULL;
2397
+ }
2398
+ ns = PyObject_Call(prep, pargs, mkw);
2399
+ Py_DECREF(prep);
2400
+ Py_DECREF(pargs);
2401
+ } else {
2402
+ if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
2403
+ return NULL;
2404
+ PyErr_Clear();
2405
+ ns = PyDict_New();
2406
+ }
2407
+ } else {
2408
+ ns = PyDict_New();
2409
+ }
2410
+ if (unlikely(!ns))
2411
+ return NULL;
2412
+ if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
2413
+ if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
2414
+ if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
2415
+ return ns;
2416
+ bad:
2417
+ Py_DECREF(ns);
2418
+ return NULL;
2419
+ }
2420
+ static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
2421
+ PyObject *dict, PyObject *mkw,
2422
+ int calculate_metaclass, int allow_py2_metaclass) {
2423
+ PyObject *result, *margs;
2424
+ PyObject *owned_metaclass = NULL;
2425
+ if (allow_py2_metaclass) {
2426
+ owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
2427
+ if (owned_metaclass) {
2428
+ metaclass = owned_metaclass;
2429
+ } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
2430
+ PyErr_Clear();
2431
+ } else {
2432
+ return NULL;
2433
+ }
2434
+ }
2435
+ if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
2436
+ metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
2437
+ Py_XDECREF(owned_metaclass);
2438
+ if (unlikely(!metaclass))
2439
+ return NULL;
2440
+ owned_metaclass = metaclass;
2441
+ }
2442
+ margs = PyTuple_Pack(3, name, bases, dict);
2443
+ if (unlikely(!margs)) {
2444
+ result = NULL;
2445
+ } else {
2446
+ result = PyObject_Call(metaclass, margs, mkw);
2447
+ Py_DECREF(margs);
2448
+ }
2449
+ Py_XDECREF(owned_metaclass);
2450
+ return result;
2451
+ }
2452
+
2453
+ /* PyErrFetchRestore */
2454
+ #if CYTHON_FAST_THREAD_STATE
2455
+ static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
2456
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
2457
+ tmp_type = tstate->curexc_type;
2458
+ tmp_value = tstate->curexc_value;
2459
+ tmp_tb = tstate->curexc_traceback;
2460
+ tstate->curexc_type = type;
2461
+ tstate->curexc_value = value;
2462
+ tstate->curexc_traceback = tb;
2463
+ Py_XDECREF(tmp_type);
2464
+ Py_XDECREF(tmp_value);
2465
+ Py_XDECREF(tmp_tb);
2466
+ }
2467
+ static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
2468
+ *type = tstate->curexc_type;
2469
+ *value = tstate->curexc_value;
2470
+ *tb = tstate->curexc_traceback;
2471
+ tstate->curexc_type = 0;
2472
+ tstate->curexc_value = 0;
2473
+ tstate->curexc_traceback = 0;
2474
+ }
2475
+ #endif
2476
+
2477
+ /* CLineInTraceback */
2478
+ #ifndef CYTHON_CLINE_IN_TRACEBACK
2479
+ static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) {
2480
+ PyObject *use_cline;
2481
+ PyObject *ptype, *pvalue, *ptraceback;
2482
+ #if CYTHON_COMPILING_IN_CPYTHON
2483
+ PyObject **cython_runtime_dict;
2484
+ #endif
2485
+ if (unlikely(!__pyx_cython_runtime)) {
2486
+ return c_line;
2487
+ }
2488
+ __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
2489
+ #if CYTHON_COMPILING_IN_CPYTHON
2490
+ cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
2491
+ if (likely(cython_runtime_dict)) {
2492
+ __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
2493
+ use_cline, *cython_runtime_dict,
2494
+ __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
2495
+ } else
2496
+ #endif
2497
+ {
2498
+ PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
2499
+ if (use_cline_obj) {
2500
+ use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
2501
+ Py_DECREF(use_cline_obj);
2502
+ } else {
2503
+ PyErr_Clear();
2504
+ use_cline = NULL;
2505
+ }
2506
+ }
2507
+ if (!use_cline) {
2508
+ c_line = 0;
2509
+ (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
2510
+ }
2511
+ else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
2512
+ c_line = 0;
2513
+ }
2514
+ __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
2515
+ return c_line;
2516
+ }
2517
+ #endif
2518
+
2519
+ /* CodeObjectCache */
2520
+ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
2521
+ int start = 0, mid = 0, end = count - 1;
2522
+ if (end >= 0 && code_line > entries[end].code_line) {
2523
+ return count;
2524
+ }
2525
+ while (start < end) {
2526
+ mid = start + (end - start) / 2;
2527
+ if (code_line < entries[mid].code_line) {
2528
+ end = mid;
2529
+ } else if (code_line > entries[mid].code_line) {
2530
+ start = mid + 1;
2531
+ } else {
2532
+ return mid;
2533
+ }
2534
+ }
2535
+ if (code_line <= entries[mid].code_line) {
2536
+ return mid;
2537
+ } else {
2538
+ return mid + 1;
2539
+ }
2540
+ }
2541
+ static PyCodeObject *__pyx_find_code_object(int code_line) {
2542
+ PyCodeObject* code_object;
2543
+ int pos;
2544
+ if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
2545
+ return NULL;
2546
+ }
2547
+ pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
2548
+ if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
2549
+ return NULL;
2550
+ }
2551
+ code_object = __pyx_code_cache.entries[pos].code_object;
2552
+ Py_INCREF(code_object);
2553
+ return code_object;
2554
+ }
2555
+ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
2556
+ int pos, i;
2557
+ __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
2558
+ if (unlikely(!code_line)) {
2559
+ return;
2560
+ }
2561
+ if (unlikely(!entries)) {
2562
+ entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
2563
+ if (likely(entries)) {
2564
+ __pyx_code_cache.entries = entries;
2565
+ __pyx_code_cache.max_count = 64;
2566
+ __pyx_code_cache.count = 1;
2567
+ entries[0].code_line = code_line;
2568
+ entries[0].code_object = code_object;
2569
+ Py_INCREF(code_object);
2570
+ }
2571
+ return;
2572
+ }
2573
+ pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
2574
+ if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
2575
+ PyCodeObject* tmp = entries[pos].code_object;
2576
+ entries[pos].code_object = code_object;
2577
+ Py_DECREF(tmp);
2578
+ return;
2579
+ }
2580
+ if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
2581
+ int new_max = __pyx_code_cache.max_count + 64;
2582
+ entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
2583
+ __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
2584
+ if (unlikely(!entries)) {
2585
+ return;
2586
+ }
2587
+ __pyx_code_cache.entries = entries;
2588
+ __pyx_code_cache.max_count = new_max;
2589
+ }
2590
+ for (i=__pyx_code_cache.count; i>pos; i--) {
2591
+ entries[i] = entries[i-1];
2592
+ }
2593
+ entries[pos].code_line = code_line;
2594
+ entries[pos].code_object = code_object;
2595
+ __pyx_code_cache.count++;
2596
+ Py_INCREF(code_object);
2597
+ }
2598
+
2599
+ /* AddTraceback */
2600
+ #include "compile.h"
2601
+ #include "frameobject.h"
2602
+ #include "traceback.h"
2603
+ #if PY_VERSION_HEX >= 0x030b00a6
2604
+ #ifndef Py_BUILD_CORE
2605
+ #define Py_BUILD_CORE 1
2606
+ #endif
2607
+ #include "internal/pycore_frame.h"
2608
+ #endif
2609
+ static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
2610
+ const char *funcname, int c_line,
2611
+ int py_line, const char *filename) {
2612
+ PyCodeObject *py_code = NULL;
2613
+ PyObject *py_funcname = NULL;
2614
+ #if PY_MAJOR_VERSION < 3
2615
+ PyObject *py_srcfile = NULL;
2616
+ py_srcfile = PyString_FromString(filename);
2617
+ if (!py_srcfile) goto bad;
2618
+ #endif
2619
+ if (c_line) {
2620
+ #if PY_MAJOR_VERSION < 3
2621
+ py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
2622
+ if (!py_funcname) goto bad;
2623
+ #else
2624
+ py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
2625
+ if (!py_funcname) goto bad;
2626
+ funcname = PyUnicode_AsUTF8(py_funcname);
2627
+ if (!funcname) goto bad;
2628
+ #endif
2629
+ }
2630
+ else {
2631
+ #if PY_MAJOR_VERSION < 3
2632
+ py_funcname = PyString_FromString(funcname);
2633
+ if (!py_funcname) goto bad;
2634
+ #endif
2635
+ }
2636
+ #if PY_MAJOR_VERSION < 3
2637
+ py_code = __Pyx_PyCode_New(
2638
+ 0,
2639
+ 0,
2640
+ 0,
2641
+ 0,
2642
+ 0,
2643
+ __pyx_empty_bytes, /*PyObject *code,*/
2644
+ __pyx_empty_tuple, /*PyObject *consts,*/
2645
+ __pyx_empty_tuple, /*PyObject *names,*/
2646
+ __pyx_empty_tuple, /*PyObject *varnames,*/
2647
+ __pyx_empty_tuple, /*PyObject *freevars,*/
2648
+ __pyx_empty_tuple, /*PyObject *cellvars,*/
2649
+ py_srcfile, /*PyObject *filename,*/
2650
+ py_funcname, /*PyObject *name,*/
2651
+ py_line,
2652
+ __pyx_empty_bytes /*PyObject *lnotab*/
2653
+ );
2654
+ Py_DECREF(py_srcfile);
2655
+ #else
2656
+ py_code = PyCode_NewEmpty(filename, funcname, py_line);
2657
+ #endif
2658
+ Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline
2659
+ return py_code;
2660
+ bad:
2661
+ Py_XDECREF(py_funcname);
2662
+ #if PY_MAJOR_VERSION < 3
2663
+ Py_XDECREF(py_srcfile);
2664
+ #endif
2665
+ return NULL;
2666
+ }
2667
+ static void __Pyx_AddTraceback(const char *funcname, int c_line,
2668
+ int py_line, const char *filename) {
2669
+ PyCodeObject *py_code = 0;
2670
+ PyFrameObject *py_frame = 0;
2671
+ PyThreadState *tstate = __Pyx_PyThreadState_Current;
2672
+ PyObject *ptype, *pvalue, *ptraceback;
2673
+ if (c_line) {
2674
+ c_line = __Pyx_CLineForTraceback(tstate, c_line);
2675
+ }
2676
+ py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
2677
+ if (!py_code) {
2678
+ __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
2679
+ py_code = __Pyx_CreateCodeObjectForTraceback(
2680
+ funcname, c_line, py_line, filename);
2681
+ if (!py_code) {
2682
+ /* If the code object creation fails, then we should clear the
2683
+ fetched exception references and propagate the new exception */
2684
+ Py_XDECREF(ptype);
2685
+ Py_XDECREF(pvalue);
2686
+ Py_XDECREF(ptraceback);
2687
+ goto bad;
2688
+ }
2689
+ __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
2690
+ __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
2691
+ }
2692
+ py_frame = PyFrame_New(
2693
+ tstate, /*PyThreadState *tstate,*/
2694
+ py_code, /*PyCodeObject *code,*/
2695
+ __pyx_d, /*PyObject *globals,*/
2696
+ 0 /*PyObject *locals*/
2697
+ );
2698
+ if (!py_frame) goto bad;
2699
+ __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
2700
+ PyTraceBack_Here(py_frame);
2701
+ bad:
2702
+ Py_XDECREF(py_code);
2703
+ Py_XDECREF(py_frame);
2704
+ }
2705
+
2706
+ /* CIntToPy */
2707
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PangoStyle(PangoStyle value) {
2708
+ #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
2709
+ #pragma GCC diagnostic push
2710
+ #pragma GCC diagnostic ignored "-Wconversion"
2711
+ #endif
2712
+ const PangoStyle neg_one = (PangoStyle) -1, const_zero = (PangoStyle) 0;
2713
+ #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
2714
+ #pragma GCC diagnostic pop
2715
+ #endif
2716
+ const int is_unsigned = neg_one > const_zero;
2717
+ if (is_unsigned) {
2718
+ if (sizeof(PangoStyle) < sizeof(long)) {
2719
+ return PyInt_FromLong((long) value);
2720
+ } else if (sizeof(PangoStyle) <= sizeof(unsigned long)) {
2721
+ return PyLong_FromUnsignedLong((unsigned long) value);
2722
+ #ifdef HAVE_LONG_LONG
2723
+ } else if (sizeof(PangoStyle) <= sizeof(unsigned PY_LONG_LONG)) {
2724
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
2725
+ #endif
2726
+ }
2727
+ } else {
2728
+ if (sizeof(PangoStyle) <= sizeof(long)) {
2729
+ return PyInt_FromLong((long) value);
2730
+ #ifdef HAVE_LONG_LONG
2731
+ } else if (sizeof(PangoStyle) <= sizeof(PY_LONG_LONG)) {
2732
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
2733
+ #endif
2734
+ }
2735
+ }
2736
+ {
2737
+ int one = 1; int little = (int)*(unsigned char *)&one;
2738
+ unsigned char *bytes = (unsigned char *)&value;
2739
+ return _PyLong_FromByteArray(bytes, sizeof(PangoStyle),
2740
+ little, !is_unsigned);
2741
+ }
2742
+ }
2743
+
2744
+ /* CIntToPy */
2745
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PangoWeight(PangoWeight value) {
2746
+ #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
2747
+ #pragma GCC diagnostic push
2748
+ #pragma GCC diagnostic ignored "-Wconversion"
2749
+ #endif
2750
+ const PangoWeight neg_one = (PangoWeight) -1, const_zero = (PangoWeight) 0;
2751
+ #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
2752
+ #pragma GCC diagnostic pop
2753
+ #endif
2754
+ const int is_unsigned = neg_one > const_zero;
2755
+ if (is_unsigned) {
2756
+ if (sizeof(PangoWeight) < sizeof(long)) {
2757
+ return PyInt_FromLong((long) value);
2758
+ } else if (sizeof(PangoWeight) <= sizeof(unsigned long)) {
2759
+ return PyLong_FromUnsignedLong((unsigned long) value);
2760
+ #ifdef HAVE_LONG_LONG
2761
+ } else if (sizeof(PangoWeight) <= sizeof(unsigned PY_LONG_LONG)) {
2762
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
2763
+ #endif
2764
+ }
2765
+ } else {
2766
+ if (sizeof(PangoWeight) <= sizeof(long)) {
2767
+ return PyInt_FromLong((long) value);
2768
+ #ifdef HAVE_LONG_LONG
2769
+ } else if (sizeof(PangoWeight) <= sizeof(PY_LONG_LONG)) {
2770
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
2771
+ #endif
2772
+ }
2773
+ }
2774
+ {
2775
+ int one = 1; int little = (int)*(unsigned char *)&one;
2776
+ unsigned char *bytes = (unsigned char *)&value;
2777
+ return _PyLong_FromByteArray(bytes, sizeof(PangoWeight),
2778
+ little, !is_unsigned);
2779
+ }
2780
+ }
2781
+
2782
+ /* CIntToPy */
2783
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PangoVariant(PangoVariant value) {
2784
+ #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
2785
+ #pragma GCC diagnostic push
2786
+ #pragma GCC diagnostic ignored "-Wconversion"
2787
+ #endif
2788
+ const PangoVariant neg_one = (PangoVariant) -1, const_zero = (PangoVariant) 0;
2789
+ #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
2790
+ #pragma GCC diagnostic pop
2791
+ #endif
2792
+ const int is_unsigned = neg_one > const_zero;
2793
+ if (is_unsigned) {
2794
+ if (sizeof(PangoVariant) < sizeof(long)) {
2795
+ return PyInt_FromLong((long) value);
2796
+ } else if (sizeof(PangoVariant) <= sizeof(unsigned long)) {
2797
+ return PyLong_FromUnsignedLong((unsigned long) value);
2798
+ #ifdef HAVE_LONG_LONG
2799
+ } else if (sizeof(PangoVariant) <= sizeof(unsigned PY_LONG_LONG)) {
2800
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
2801
+ #endif
2802
+ }
2803
+ } else {
2804
+ if (sizeof(PangoVariant) <= sizeof(long)) {
2805
+ return PyInt_FromLong((long) value);
2806
+ #ifdef HAVE_LONG_LONG
2807
+ } else if (sizeof(PangoVariant) <= sizeof(PY_LONG_LONG)) {
2808
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
2809
+ #endif
2810
+ }
2811
+ }
2812
+ {
2813
+ int one = 1; int little = (int)*(unsigned char *)&one;
2814
+ unsigned char *bytes = (unsigned char *)&value;
2815
+ return _PyLong_FromByteArray(bytes, sizeof(PangoVariant),
2816
+ little, !is_unsigned);
2817
+ }
2818
+ }
2819
+
2820
+ /* CIntToPy */
2821
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PangoAlignment(PangoAlignment value) {
2822
+ #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
2823
+ #pragma GCC diagnostic push
2824
+ #pragma GCC diagnostic ignored "-Wconversion"
2825
+ #endif
2826
+ const PangoAlignment neg_one = (PangoAlignment) -1, const_zero = (PangoAlignment) 0;
2827
+ #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
2828
+ #pragma GCC diagnostic pop
2829
+ #endif
2830
+ const int is_unsigned = neg_one > const_zero;
2831
+ if (is_unsigned) {
2832
+ if (sizeof(PangoAlignment) < sizeof(long)) {
2833
+ return PyInt_FromLong((long) value);
2834
+ } else if (sizeof(PangoAlignment) <= sizeof(unsigned long)) {
2835
+ return PyLong_FromUnsignedLong((unsigned long) value);
2836
+ #ifdef HAVE_LONG_LONG
2837
+ } else if (sizeof(PangoAlignment) <= sizeof(unsigned PY_LONG_LONG)) {
2838
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
2839
+ #endif
2840
+ }
2841
+ } else {
2842
+ if (sizeof(PangoAlignment) <= sizeof(long)) {
2843
+ return PyInt_FromLong((long) value);
2844
+ #ifdef HAVE_LONG_LONG
2845
+ } else if (sizeof(PangoAlignment) <= sizeof(PY_LONG_LONG)) {
2846
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
2847
+ #endif
2848
+ }
2849
+ }
2850
+ {
2851
+ int one = 1; int little = (int)*(unsigned char *)&one;
2852
+ unsigned char *bytes = (unsigned char *)&value;
2853
+ return _PyLong_FromByteArray(bytes, sizeof(PangoAlignment),
2854
+ little, !is_unsigned);
2855
+ }
2856
+ }
2857
+
2858
+ /* CIntToPy */
2859
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
2860
+ #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
2861
+ #pragma GCC diagnostic push
2862
+ #pragma GCC diagnostic ignored "-Wconversion"
2863
+ #endif
2864
+ const long neg_one = (long) -1, const_zero = (long) 0;
2865
+ #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
2866
+ #pragma GCC diagnostic pop
2867
+ #endif
2868
+ const int is_unsigned = neg_one > const_zero;
2869
+ if (is_unsigned) {
2870
+ if (sizeof(long) < sizeof(long)) {
2871
+ return PyInt_FromLong((long) value);
2872
+ } else if (sizeof(long) <= sizeof(unsigned long)) {
2873
+ return PyLong_FromUnsignedLong((unsigned long) value);
2874
+ #ifdef HAVE_LONG_LONG
2875
+ } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
2876
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
2877
+ #endif
2878
+ }
2879
+ } else {
2880
+ if (sizeof(long) <= sizeof(long)) {
2881
+ return PyInt_FromLong((long) value);
2882
+ #ifdef HAVE_LONG_LONG
2883
+ } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
2884
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
2885
+ #endif
2886
+ }
2887
+ }
2888
+ {
2889
+ int one = 1; int little = (int)*(unsigned char *)&one;
2890
+ unsigned char *bytes = (unsigned char *)&value;
2891
+ return _PyLong_FromByteArray(bytes, sizeof(long),
2892
+ little, !is_unsigned);
2893
+ }
2894
+ }
2895
+
2896
+ /* CIntFromPyVerify */
2897
+ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
2898
+ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
2899
+ #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
2900
+ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
2901
+ #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
2902
+ {\
2903
+ func_type value = func_value;\
2904
+ if (sizeof(target_type) < sizeof(func_type)) {\
2905
+ if (unlikely(value != (func_type) (target_type) value)) {\
2906
+ func_type zero = 0;\
2907
+ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
2908
+ return (target_type) -1;\
2909
+ if (is_unsigned && unlikely(value < zero))\
2910
+ goto raise_neg_overflow;\
2911
+ else\
2912
+ goto raise_overflow;\
2913
+ }\
2914
+ }\
2915
+ return (target_type) value;\
2916
+ }
2917
+
2918
+ /* CIntFromPy */
2919
+ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
2920
+ #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
2921
+ #pragma GCC diagnostic push
2922
+ #pragma GCC diagnostic ignored "-Wconversion"
2923
+ #endif
2924
+ const long neg_one = (long) -1, const_zero = (long) 0;
2925
+ #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
2926
+ #pragma GCC diagnostic pop
2927
+ #endif
2928
+ const int is_unsigned = neg_one > const_zero;
2929
+ #if PY_MAJOR_VERSION < 3
2930
+ if (likely(PyInt_Check(x))) {
2931
+ if (sizeof(long) < sizeof(long)) {
2932
+ __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
2933
+ } else {
2934
+ long val = PyInt_AS_LONG(x);
2935
+ if (is_unsigned && unlikely(val < 0)) {
2936
+ goto raise_neg_overflow;
2937
+ }
2938
+ return (long) val;
2939
+ }
2940
+ } else
2941
+ #endif
2942
+ if (likely(PyLong_Check(x))) {
2943
+ if (is_unsigned) {
2944
+ #if CYTHON_USE_PYLONG_INTERNALS
2945
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
2946
+ switch (Py_SIZE(x)) {
2947
+ case 0: return (long) 0;
2948
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
2949
+ case 2:
2950
+ if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
2951
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
2952
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
2953
+ } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
2954
+ return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
2955
+ }
2956
+ }
2957
+ break;
2958
+ case 3:
2959
+ if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
2960
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
2961
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
2962
+ } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
2963
+ return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
2964
+ }
2965
+ }
2966
+ break;
2967
+ case 4:
2968
+ if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
2969
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
2970
+ __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])))
2971
+ } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
2972
+ return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
2973
+ }
2974
+ }
2975
+ break;
2976
+ }
2977
+ #endif
2978
+ #if CYTHON_COMPILING_IN_CPYTHON
2979
+ if (unlikely(Py_SIZE(x) < 0)) {
2980
+ goto raise_neg_overflow;
2981
+ }
2982
+ #else
2983
+ {
2984
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
2985
+ if (unlikely(result < 0))
2986
+ return (long) -1;
2987
+ if (unlikely(result == 1))
2988
+ goto raise_neg_overflow;
2989
+ }
2990
+ #endif
2991
+ if (sizeof(long) <= sizeof(unsigned long)) {
2992
+ __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
2993
+ #ifdef HAVE_LONG_LONG
2994
+ } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
2995
+ __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
2996
+ #endif
2997
+ }
2998
+ } else {
2999
+ #if CYTHON_USE_PYLONG_INTERNALS
3000
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
3001
+ switch (Py_SIZE(x)) {
3002
+ case 0: return (long) 0;
3003
+ case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
3004
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
3005
+ case -2:
3006
+ if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
3007
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
3008
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
3009
+ } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
3010
+ return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
3011
+ }
3012
+ }
3013
+ break;
3014
+ case 2:
3015
+ if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
3016
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
3017
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
3018
+ } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
3019
+ return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
3020
+ }
3021
+ }
3022
+ break;
3023
+ case -3:
3024
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
3025
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
3026
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
3027
+ } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
3028
+ return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
3029
+ }
3030
+ }
3031
+ break;
3032
+ case 3:
3033
+ if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
3034
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
3035
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
3036
+ } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
3037
+ return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
3038
+ }
3039
+ }
3040
+ break;
3041
+ case -4:
3042
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
3043
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
3044
+ __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])))
3045
+ } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
3046
+ return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
3047
+ }
3048
+ }
3049
+ break;
3050
+ case 4:
3051
+ if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
3052
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
3053
+ __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])))
3054
+ } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
3055
+ return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
3056
+ }
3057
+ }
3058
+ break;
3059
+ }
3060
+ #endif
3061
+ if (sizeof(long) <= sizeof(long)) {
3062
+ __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
3063
+ #ifdef HAVE_LONG_LONG
3064
+ } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
3065
+ __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
3066
+ #endif
3067
+ }
3068
+ }
3069
+ {
3070
+ #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
3071
+ PyErr_SetString(PyExc_RuntimeError,
3072
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
3073
+ #else
3074
+ long val;
3075
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
3076
+ #if PY_MAJOR_VERSION < 3
3077
+ if (likely(v) && !PyLong_Check(v)) {
3078
+ PyObject *tmp = v;
3079
+ v = PyNumber_Long(tmp);
3080
+ Py_DECREF(tmp);
3081
+ }
3082
+ #endif
3083
+ if (likely(v)) {
3084
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
3085
+ unsigned char *bytes = (unsigned char *)&val;
3086
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
3087
+ bytes, sizeof(val),
3088
+ is_little, !is_unsigned);
3089
+ Py_DECREF(v);
3090
+ if (likely(!ret))
3091
+ return val;
3092
+ }
3093
+ #endif
3094
+ return (long) -1;
3095
+ }
3096
+ } else {
3097
+ long val;
3098
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
3099
+ if (!tmp) return (long) -1;
3100
+ val = __Pyx_PyInt_As_long(tmp);
3101
+ Py_DECREF(tmp);
3102
+ return val;
3103
+ }
3104
+ raise_overflow:
3105
+ PyErr_SetString(PyExc_OverflowError,
3106
+ "value too large to convert to long");
3107
+ return (long) -1;
3108
+ raise_neg_overflow:
3109
+ PyErr_SetString(PyExc_OverflowError,
3110
+ "can't convert negative value to long");
3111
+ return (long) -1;
3112
+ }
3113
+
3114
+ /* CIntFromPy */
3115
+ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
3116
+ #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
3117
+ #pragma GCC diagnostic push
3118
+ #pragma GCC diagnostic ignored "-Wconversion"
3119
+ #endif
3120
+ const int neg_one = (int) -1, const_zero = (int) 0;
3121
+ #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
3122
+ #pragma GCC diagnostic pop
3123
+ #endif
3124
+ const int is_unsigned = neg_one > const_zero;
3125
+ #if PY_MAJOR_VERSION < 3
3126
+ if (likely(PyInt_Check(x))) {
3127
+ if (sizeof(int) < sizeof(long)) {
3128
+ __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
3129
+ } else {
3130
+ long val = PyInt_AS_LONG(x);
3131
+ if (is_unsigned && unlikely(val < 0)) {
3132
+ goto raise_neg_overflow;
3133
+ }
3134
+ return (int) val;
3135
+ }
3136
+ } else
3137
+ #endif
3138
+ if (likely(PyLong_Check(x))) {
3139
+ if (is_unsigned) {
3140
+ #if CYTHON_USE_PYLONG_INTERNALS
3141
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
3142
+ switch (Py_SIZE(x)) {
3143
+ case 0: return (int) 0;
3144
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
3145
+ case 2:
3146
+ if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
3147
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
3148
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
3149
+ } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
3150
+ return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
3151
+ }
3152
+ }
3153
+ break;
3154
+ case 3:
3155
+ if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
3156
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
3157
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
3158
+ } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
3159
+ return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
3160
+ }
3161
+ }
3162
+ break;
3163
+ case 4:
3164
+ if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
3165
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
3166
+ __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])))
3167
+ } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
3168
+ return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
3169
+ }
3170
+ }
3171
+ break;
3172
+ }
3173
+ #endif
3174
+ #if CYTHON_COMPILING_IN_CPYTHON
3175
+ if (unlikely(Py_SIZE(x) < 0)) {
3176
+ goto raise_neg_overflow;
3177
+ }
3178
+ #else
3179
+ {
3180
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
3181
+ if (unlikely(result < 0))
3182
+ return (int) -1;
3183
+ if (unlikely(result == 1))
3184
+ goto raise_neg_overflow;
3185
+ }
3186
+ #endif
3187
+ if (sizeof(int) <= sizeof(unsigned long)) {
3188
+ __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
3189
+ #ifdef HAVE_LONG_LONG
3190
+ } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
3191
+ __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
3192
+ #endif
3193
+ }
3194
+ } else {
3195
+ #if CYTHON_USE_PYLONG_INTERNALS
3196
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
3197
+ switch (Py_SIZE(x)) {
3198
+ case 0: return (int) 0;
3199
+ case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
3200
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
3201
+ case -2:
3202
+ if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
3203
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
3204
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
3205
+ } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
3206
+ return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
3207
+ }
3208
+ }
3209
+ break;
3210
+ case 2:
3211
+ if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
3212
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
3213
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
3214
+ } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
3215
+ return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
3216
+ }
3217
+ }
3218
+ break;
3219
+ case -3:
3220
+ if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
3221
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
3222
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
3223
+ } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
3224
+ return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
3225
+ }
3226
+ }
3227
+ break;
3228
+ case 3:
3229
+ if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
3230
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
3231
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
3232
+ } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
3233
+ return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
3234
+ }
3235
+ }
3236
+ break;
3237
+ case -4:
3238
+ if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
3239
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
3240
+ __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])))
3241
+ } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
3242
+ return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
3243
+ }
3244
+ }
3245
+ break;
3246
+ case 4:
3247
+ if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
3248
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
3249
+ __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])))
3250
+ } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
3251
+ return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
3252
+ }
3253
+ }
3254
+ break;
3255
+ }
3256
+ #endif
3257
+ if (sizeof(int) <= sizeof(long)) {
3258
+ __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
3259
+ #ifdef HAVE_LONG_LONG
3260
+ } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
3261
+ __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
3262
+ #endif
3263
+ }
3264
+ }
3265
+ {
3266
+ #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
3267
+ PyErr_SetString(PyExc_RuntimeError,
3268
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
3269
+ #else
3270
+ int val;
3271
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
3272
+ #if PY_MAJOR_VERSION < 3
3273
+ if (likely(v) && !PyLong_Check(v)) {
3274
+ PyObject *tmp = v;
3275
+ v = PyNumber_Long(tmp);
3276
+ Py_DECREF(tmp);
3277
+ }
3278
+ #endif
3279
+ if (likely(v)) {
3280
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
3281
+ unsigned char *bytes = (unsigned char *)&val;
3282
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
3283
+ bytes, sizeof(val),
3284
+ is_little, !is_unsigned);
3285
+ Py_DECREF(v);
3286
+ if (likely(!ret))
3287
+ return val;
3288
+ }
3289
+ #endif
3290
+ return (int) -1;
3291
+ }
3292
+ } else {
3293
+ int val;
3294
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
3295
+ if (!tmp) return (int) -1;
3296
+ val = __Pyx_PyInt_As_int(tmp);
3297
+ Py_DECREF(tmp);
3298
+ return val;
3299
+ }
3300
+ raise_overflow:
3301
+ PyErr_SetString(PyExc_OverflowError,
3302
+ "value too large to convert to int");
3303
+ return (int) -1;
3304
+ raise_neg_overflow:
3305
+ PyErr_SetString(PyExc_OverflowError,
3306
+ "can't convert negative value to int");
3307
+ return (int) -1;
3308
+ }
3309
+
3310
+ /* FastTypeChecks */
3311
+ #if CYTHON_COMPILING_IN_CPYTHON
3312
+ static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
3313
+ while (a) {
3314
+ a = a->tp_base;
3315
+ if (a == b)
3316
+ return 1;
3317
+ }
3318
+ return b == &PyBaseObject_Type;
3319
+ }
3320
+ static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
3321
+ PyObject *mro;
3322
+ if (a == b) return 1;
3323
+ mro = a->tp_mro;
3324
+ if (likely(mro)) {
3325
+ Py_ssize_t i, n;
3326
+ n = PyTuple_GET_SIZE(mro);
3327
+ for (i = 0; i < n; i++) {
3328
+ if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
3329
+ return 1;
3330
+ }
3331
+ return 0;
3332
+ }
3333
+ return __Pyx_InBases(a, b);
3334
+ }
3335
+ #if PY_MAJOR_VERSION == 2
3336
+ static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
3337
+ PyObject *exception, *value, *tb;
3338
+ int res;
3339
+ __Pyx_PyThreadState_declare
3340
+ __Pyx_PyThreadState_assign
3341
+ __Pyx_ErrFetch(&exception, &value, &tb);
3342
+ res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
3343
+ if (unlikely(res == -1)) {
3344
+ PyErr_WriteUnraisable(err);
3345
+ res = 0;
3346
+ }
3347
+ if (!res) {
3348
+ res = PyObject_IsSubclass(err, exc_type2);
3349
+ if (unlikely(res == -1)) {
3350
+ PyErr_WriteUnraisable(err);
3351
+ res = 0;
3352
+ }
3353
+ }
3354
+ __Pyx_ErrRestore(exception, value, tb);
3355
+ return res;
3356
+ }
3357
+ #else
3358
+ static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
3359
+ int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
3360
+ if (!res) {
3361
+ res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
3362
+ }
3363
+ return res;
3364
+ }
3365
+ #endif
3366
+ static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
3367
+ Py_ssize_t i, n;
3368
+ assert(PyExceptionClass_Check(exc_type));
3369
+ n = PyTuple_GET_SIZE(tuple);
3370
+ #if PY_MAJOR_VERSION >= 3
3371
+ for (i=0; i<n; i++) {
3372
+ if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
3373
+ }
3374
+ #endif
3375
+ for (i=0; i<n; i++) {
3376
+ PyObject *t = PyTuple_GET_ITEM(tuple, i);
3377
+ #if PY_MAJOR_VERSION < 3
3378
+ if (likely(exc_type == t)) return 1;
3379
+ #endif
3380
+ if (likely(PyExceptionClass_Check(t))) {
3381
+ if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
3382
+ } else {
3383
+ }
3384
+ }
3385
+ return 0;
3386
+ }
3387
+ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
3388
+ if (likely(err == exc_type)) return 1;
3389
+ if (likely(PyExceptionClass_Check(err))) {
3390
+ if (likely(PyExceptionClass_Check(exc_type))) {
3391
+ return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
3392
+ } else if (likely(PyTuple_Check(exc_type))) {
3393
+ return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
3394
+ } else {
3395
+ }
3396
+ }
3397
+ return PyErr_GivenExceptionMatches(err, exc_type);
3398
+ }
3399
+ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
3400
+ assert(PyExceptionClass_Check(exc_type1));
3401
+ assert(PyExceptionClass_Check(exc_type2));
3402
+ if (likely(err == exc_type1 || err == exc_type2)) return 1;
3403
+ if (likely(PyExceptionClass_Check(err))) {
3404
+ return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
3405
+ }
3406
+ return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
3407
+ }
3408
+ #endif
3409
+
3410
+ /* CheckBinaryVersion */
3411
+ static int __Pyx_check_binary_version(void) {
3412
+ char ctversion[5];
3413
+ int same=1, i, found_dot;
3414
+ const char* rt_from_call = Py_GetVersion();
3415
+ PyOS_snprintf(ctversion, 5, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
3416
+ found_dot = 0;
3417
+ for (i = 0; i < 4; i++) {
3418
+ if (!ctversion[i]) {
3419
+ same = (rt_from_call[i] < '0' || rt_from_call[i] > '9');
3420
+ break;
3421
+ }
3422
+ if (rt_from_call[i] != ctversion[i]) {
3423
+ same = 0;
3424
+ break;
3425
+ }
3426
+ }
3427
+ if (!same) {
3428
+ char rtversion[5] = {'\0'};
3429
+ char message[200];
3430
+ for (i=0; i<4; ++i) {
3431
+ if (rt_from_call[i] == '.') {
3432
+ if (found_dot) break;
3433
+ found_dot = 1;
3434
+ } else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') {
3435
+ break;
3436
+ }
3437
+ rtversion[i] = rt_from_call[i];
3438
+ }
3439
+ PyOS_snprintf(message, sizeof(message),
3440
+ "compiletime version %s of module '%.100s' "
3441
+ "does not match runtime version %s",
3442
+ ctversion, __Pyx_MODULE_NAME, rtversion);
3443
+ return PyErr_WarnEx(NULL, message, 1);
3444
+ }
3445
+ return 0;
3446
+ }
3447
+
3448
+ /* InitStrings */
3449
+ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
3450
+ while (t->p) {
3451
+ #if PY_MAJOR_VERSION < 3
3452
+ if (t->is_unicode) {
3453
+ *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
3454
+ } else if (t->intern) {
3455
+ *t->p = PyString_InternFromString(t->s);
3456
+ } else {
3457
+ *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
3458
+ }
3459
+ #else
3460
+ if (t->is_unicode | t->is_str) {
3461
+ if (t->intern) {
3462
+ *t->p = PyUnicode_InternFromString(t->s);
3463
+ } else if (t->encoding) {
3464
+ *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
3465
+ } else {
3466
+ *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
3467
+ }
3468
+ } else {
3469
+ *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
3470
+ }
3471
+ #endif
3472
+ if (!*t->p)
3473
+ return -1;
3474
+ if (PyObject_Hash(*t->p) == -1)
3475
+ return -1;
3476
+ ++t;
3477
+ }
3478
+ return 0;
3479
+ }
3480
+
3481
+ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
3482
+ return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
3483
+ }
3484
+ static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
3485
+ Py_ssize_t ignore;
3486
+ return __Pyx_PyObject_AsStringAndSize(o, &ignore);
3487
+ }
3488
+ #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
3489
+ #if !CYTHON_PEP393_ENABLED
3490
+ static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
3491
+ char* defenc_c;
3492
+ PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
3493
+ if (!defenc) return NULL;
3494
+ defenc_c = PyBytes_AS_STRING(defenc);
3495
+ #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
3496
+ {
3497
+ char* end = defenc_c + PyBytes_GET_SIZE(defenc);
3498
+ char* c;
3499
+ for (c = defenc_c; c < end; c++) {
3500
+ if ((unsigned char) (*c) >= 128) {
3501
+ PyUnicode_AsASCIIString(o);
3502
+ return NULL;
3503
+ }
3504
+ }
3505
+ }
3506
+ #endif
3507
+ *length = PyBytes_GET_SIZE(defenc);
3508
+ return defenc_c;
3509
+ }
3510
+ #else
3511
+ static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
3512
+ if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
3513
+ #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
3514
+ if (likely(PyUnicode_IS_ASCII(o))) {
3515
+ *length = PyUnicode_GET_LENGTH(o);
3516
+ return PyUnicode_AsUTF8(o);
3517
+ } else {
3518
+ PyUnicode_AsASCIIString(o);
3519
+ return NULL;
3520
+ }
3521
+ #else
3522
+ return PyUnicode_AsUTF8AndSize(o, length);
3523
+ #endif
3524
+ }
3525
+ #endif
3526
+ #endif
3527
+ static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
3528
+ #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
3529
+ if (
3530
+ #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
3531
+ __Pyx_sys_getdefaultencoding_not_ascii &&
3532
+ #endif
3533
+ PyUnicode_Check(o)) {
3534
+ return __Pyx_PyUnicode_AsStringAndSize(o, length);
3535
+ } else
3536
+ #endif
3537
+ #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
3538
+ if (PyByteArray_Check(o)) {
3539
+ *length = PyByteArray_GET_SIZE(o);
3540
+ return PyByteArray_AS_STRING(o);
3541
+ } else
3542
+ #endif
3543
+ {
3544
+ char* result;
3545
+ int r = PyBytes_AsStringAndSize(o, &result, length);
3546
+ if (unlikely(r < 0)) {
3547
+ return NULL;
3548
+ } else {
3549
+ return result;
3550
+ }
3551
+ }
3552
+ }
3553
+ static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
3554
+ int is_true = x == Py_True;
3555
+ if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
3556
+ else return PyObject_IsTrue(x);
3557
+ }
3558
+ static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
3559
+ int retval;
3560
+ if (unlikely(!x)) return -1;
3561
+ retval = __Pyx_PyObject_IsTrue(x);
3562
+ Py_DECREF(x);
3563
+ return retval;
3564
+ }
3565
+ static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
3566
+ #if PY_MAJOR_VERSION >= 3
3567
+ if (PyLong_Check(result)) {
3568
+ if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
3569
+ "__int__ returned non-int (type %.200s). "
3570
+ "The ability to return an instance of a strict subclass of int "
3571
+ "is deprecated, and may be removed in a future version of Python.",
3572
+ Py_TYPE(result)->tp_name)) {
3573
+ Py_DECREF(result);
3574
+ return NULL;
3575
+ }
3576
+ return result;
3577
+ }
3578
+ #endif
3579
+ PyErr_Format(PyExc_TypeError,
3580
+ "__%.4s__ returned non-%.4s (type %.200s)",
3581
+ type_name, type_name, Py_TYPE(result)->tp_name);
3582
+ Py_DECREF(result);
3583
+ return NULL;
3584
+ }
3585
+ static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
3586
+ #if CYTHON_USE_TYPE_SLOTS
3587
+ PyNumberMethods *m;
3588
+ #endif
3589
+ const char *name = NULL;
3590
+ PyObject *res = NULL;
3591
+ #if PY_MAJOR_VERSION < 3
3592
+ if (likely(PyInt_Check(x) || PyLong_Check(x)))
3593
+ #else
3594
+ if (likely(PyLong_Check(x)))
3595
+ #endif
3596
+ return __Pyx_NewRef(x);
3597
+ #if CYTHON_USE_TYPE_SLOTS
3598
+ m = Py_TYPE(x)->tp_as_number;
3599
+ #if PY_MAJOR_VERSION < 3
3600
+ if (m && m->nb_int) {
3601
+ name = "int";
3602
+ res = m->nb_int(x);
3603
+ }
3604
+ else if (m && m->nb_long) {
3605
+ name = "long";
3606
+ res = m->nb_long(x);
3607
+ }
3608
+ #else
3609
+ if (likely(m && m->nb_int)) {
3610
+ name = "int";
3611
+ res = m->nb_int(x);
3612
+ }
3613
+ #endif
3614
+ #else
3615
+ if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
3616
+ res = PyNumber_Int(x);
3617
+ }
3618
+ #endif
3619
+ if (likely(res)) {
3620
+ #if PY_MAJOR_VERSION < 3
3621
+ if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
3622
+ #else
3623
+ if (unlikely(!PyLong_CheckExact(res))) {
3624
+ #endif
3625
+ return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
3626
+ }
3627
+ }
3628
+ else if (!PyErr_Occurred()) {
3629
+ PyErr_SetString(PyExc_TypeError,
3630
+ "an integer is required");
3631
+ }
3632
+ return res;
3633
+ }
3634
+ static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
3635
+ Py_ssize_t ival;
3636
+ PyObject *x;
3637
+ #if PY_MAJOR_VERSION < 3
3638
+ if (likely(PyInt_CheckExact(b))) {
3639
+ if (sizeof(Py_ssize_t) >= sizeof(long))
3640
+ return PyInt_AS_LONG(b);
3641
+ else
3642
+ return PyInt_AsSsize_t(b);
3643
+ }
3644
+ #endif
3645
+ if (likely(PyLong_CheckExact(b))) {
3646
+ #if CYTHON_USE_PYLONG_INTERNALS
3647
+ const digit* digits = ((PyLongObject*)b)->ob_digit;
3648
+ const Py_ssize_t size = Py_SIZE(b);
3649
+ if (likely(__Pyx_sst_abs(size) <= 1)) {
3650
+ ival = likely(size) ? digits[0] : 0;
3651
+ if (size == -1) ival = -ival;
3652
+ return ival;
3653
+ } else {
3654
+ switch (size) {
3655
+ case 2:
3656
+ if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
3657
+ return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
3658
+ }
3659
+ break;
3660
+ case -2:
3661
+ if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
3662
+ return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
3663
+ }
3664
+ break;
3665
+ case 3:
3666
+ if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
3667
+ return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
3668
+ }
3669
+ break;
3670
+ case -3:
3671
+ if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
3672
+ return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
3673
+ }
3674
+ break;
3675
+ case 4:
3676
+ if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
3677
+ 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]));
3678
+ }
3679
+ break;
3680
+ case -4:
3681
+ if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
3682
+ 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]));
3683
+ }
3684
+ break;
3685
+ }
3686
+ }
3687
+ #endif
3688
+ return PyLong_AsSsize_t(b);
3689
+ }
3690
+ x = PyNumber_Index(b);
3691
+ if (!x) return -1;
3692
+ ival = PyInt_AsSsize_t(x);
3693
+ Py_DECREF(x);
3694
+ return ival;
3695
+ }
3696
+ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
3697
+ if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
3698
+ return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
3699
+ #if PY_MAJOR_VERSION < 3
3700
+ } else if (likely(PyInt_CheckExact(o))) {
3701
+ return PyInt_AS_LONG(o);
3702
+ #endif
3703
+ } else {
3704
+ Py_ssize_t ival;
3705
+ PyObject *x;
3706
+ x = PyNumber_Index(o);
3707
+ if (!x) return -1;
3708
+ ival = PyInt_AsLong(x);
3709
+ Py_DECREF(x);
3710
+ return ival;
3711
+ }
3712
+ }
3713
+ static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
3714
+ return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
3715
+ }
3716
+ static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
3717
+ return PyInt_FromSize_t(ival);
3718
+ }
3719
+
3720
+
3721
+ #endif /* Py_PYTHON_H */