python-datamodel 0.10.1__cp313-cp313-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.
- datamodel/__init__.py +13 -0
- datamodel/abstract.py +383 -0
- datamodel/adaptive/__init__.py +0 -0
- datamodel/adaptive/models.py +598 -0
- datamodel/aliases/__init__.py +26 -0
- datamodel/base.py +180 -0
- datamodel/converters.c +43471 -0
- datamodel/converters.cp313-win32.pyd +0 -0
- datamodel/converters.html +17387 -0
- datamodel/converters.pyx +1489 -0
- datamodel/exceptions.c +13455 -0
- datamodel/exceptions.cp313-win32.pyd +0 -0
- datamodel/exceptions.html +1261 -0
- datamodel/exceptions.pxd +13 -0
- datamodel/exceptions.pyx +50 -0
- datamodel/fields.cp313-win32.pyd +0 -0
- datamodel/fields.cpp +17401 -0
- datamodel/fields.html +3912 -0
- datamodel/fields.pyx +309 -0
- datamodel/functions.cp313-win32.pyd +0 -0
- datamodel/functions.cpp +9068 -0
- datamodel/functions.html +1766 -0
- datamodel/functions.pxd +9 -0
- datamodel/functions.pyx +82 -0
- datamodel/jsonld/__init__.py +45 -0
- datamodel/jsonld/models.py +500 -0
- datamodel/libs/__init__.py +1 -0
- datamodel/libs/mapping.c +15067 -0
- datamodel/libs/mapping.cp313-win32.pyd +0 -0
- datamodel/libs/mapping.html +2618 -0
- datamodel/libs/mapping.pxd +11 -0
- datamodel/libs/mapping.pyx +135 -0
- datamodel/libs/mutables.py +127 -0
- datamodel/models.py +814 -0
- datamodel/parsers/__init__.py +0 -0
- datamodel/parsers/encoders.py +15 -0
- datamodel/parsers/json.cp313-win32.pyd +0 -0
- datamodel/parsers/json.cpp +17004 -0
- datamodel/parsers/json.html +3365 -0
- datamodel/parsers/json.pyx +250 -0
- datamodel/profiler.py +21 -0
- datamodel/py.typed +0 -0
- datamodel/rs_core/Cargo.toml +17 -0
- datamodel/rs_core/src/lib.rs +294 -0
- datamodel/rs_parsers/Cargo.toml +22 -0
- datamodel/rs_parsers/src/lib.rs +571 -0
- datamodel/rs_parsers.cp313-win32.pyd +0 -0
- datamodel/rs_validators/Cargo.toml +17 -0
- datamodel/rs_validators/src/lib.rs +0 -0
- datamodel/typedefs/__init__.py +9 -0
- datamodel/typedefs/singleton.c +9169 -0
- datamodel/typedefs/singleton.cp313-win32.pyd +0 -0
- datamodel/typedefs/singleton.html +629 -0
- datamodel/typedefs/singleton.pxd +9 -0
- datamodel/typedefs/singleton.pyx +24 -0
- datamodel/typedefs/types.c +11716 -0
- datamodel/typedefs/types.cp313-win32.pyd +0 -0
- datamodel/typedefs/types.html +732 -0
- datamodel/typedefs/types.pxd +11 -0
- datamodel/typedefs/types.pyx +39 -0
- datamodel/types.c +7165 -0
- datamodel/types.cp313-win32.pyd +0 -0
- datamodel/types.html +716 -0
- datamodel/types.pyx +100 -0
- datamodel/validation.cp313-win32.pyd +0 -0
- datamodel/validation.cpp +17085 -0
- datamodel/validation.html +4769 -0
- datamodel/validation.pyx +315 -0
- datamodel/version.py +13 -0
- examples/nn/examples.py +311 -0
- examples/nn/stores.py +151 -0
- examples/tests/sp_types.py +294 -0
- examples/tests/speed_dates.py +26 -0
- python_datamodel-0.10.1.dist-info/LICENSE +29 -0
- python_datamodel-0.10.1.dist-info/METADATA +320 -0
- python_datamodel-0.10.1.dist-info/RECORD +78 -0
- python_datamodel-0.10.1.dist-info/WHEEL +5 -0
- python_datamodel-0.10.1.dist-info/top_level.txt +7 -0
datamodel/functions.html
ADDED
|
@@ -0,0 +1,1766 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<!-- Generated by Cython 3.0.11 -->
|
|
3
|
+
<html>
|
|
4
|
+
<head>
|
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
6
|
+
<title>Cython: functions.pyx</title>
|
|
7
|
+
<style type="text/css">
|
|
8
|
+
|
|
9
|
+
body.cython { font-family: courier; font-size: 12; }
|
|
10
|
+
|
|
11
|
+
.cython.tag { }
|
|
12
|
+
.cython.line { color: #000000; margin: 0em }
|
|
13
|
+
.cython.code { font-size: 9; color: #444444; display: none; margin: 0px 0px 0px 8px; border-left: 8px none; }
|
|
14
|
+
|
|
15
|
+
.cython.line .run { background-color: #B0FFB0; }
|
|
16
|
+
.cython.line .mis { background-color: #FFB0B0; }
|
|
17
|
+
.cython.code.run { border-left: 8px solid #B0FFB0; }
|
|
18
|
+
.cython.code.mis { border-left: 8px solid #FFB0B0; }
|
|
19
|
+
|
|
20
|
+
.cython.code .py_c_api { color: red; }
|
|
21
|
+
.cython.code .py_macro_api { color: #FF7000; }
|
|
22
|
+
.cython.code .pyx_c_api { color: #FF3000; }
|
|
23
|
+
.cython.code .pyx_macro_api { color: #FF7000; }
|
|
24
|
+
.cython.code .refnanny { color: #FFA000; }
|
|
25
|
+
.cython.code .trace { color: #FFA000; }
|
|
26
|
+
.cython.code .error_goto { color: #FFA000; }
|
|
27
|
+
|
|
28
|
+
.cython.code .coerce { color: #008000; border: 1px dotted #008000 }
|
|
29
|
+
.cython.code .py_attr { color: #FF0000; font-weight: bold; }
|
|
30
|
+
.cython.code .c_attr { color: #0000FF; }
|
|
31
|
+
.cython.code .py_call { color: #FF0000; font-weight: bold; }
|
|
32
|
+
.cython.code .c_call { color: #0000FF; }
|
|
33
|
+
|
|
34
|
+
.cython.score-0 {background-color: #FFFFff;}
|
|
35
|
+
.cython.score-1 {background-color: #FFFFe7;}
|
|
36
|
+
.cython.score-2 {background-color: #FFFFd4;}
|
|
37
|
+
.cython.score-3 {background-color: #FFFFc4;}
|
|
38
|
+
.cython.score-4 {background-color: #FFFFb6;}
|
|
39
|
+
.cython.score-5 {background-color: #FFFFaa;}
|
|
40
|
+
.cython.score-6 {background-color: #FFFF9f;}
|
|
41
|
+
.cython.score-7 {background-color: #FFFF96;}
|
|
42
|
+
.cython.score-8 {background-color: #FFFF8d;}
|
|
43
|
+
.cython.score-9 {background-color: #FFFF86;}
|
|
44
|
+
.cython.score-10 {background-color: #FFFF7f;}
|
|
45
|
+
.cython.score-11 {background-color: #FFFF79;}
|
|
46
|
+
.cython.score-12 {background-color: #FFFF73;}
|
|
47
|
+
.cython.score-13 {background-color: #FFFF6e;}
|
|
48
|
+
.cython.score-14 {background-color: #FFFF6a;}
|
|
49
|
+
.cython.score-15 {background-color: #FFFF66;}
|
|
50
|
+
.cython.score-16 {background-color: #FFFF62;}
|
|
51
|
+
.cython.score-17 {background-color: #FFFF5e;}
|
|
52
|
+
.cython.score-18 {background-color: #FFFF5b;}
|
|
53
|
+
.cython.score-19 {background-color: #FFFF57;}
|
|
54
|
+
.cython.score-20 {background-color: #FFFF55;}
|
|
55
|
+
.cython.score-21 {background-color: #FFFF52;}
|
|
56
|
+
.cython.score-22 {background-color: #FFFF4f;}
|
|
57
|
+
.cython.score-23 {background-color: #FFFF4d;}
|
|
58
|
+
.cython.score-24 {background-color: #FFFF4b;}
|
|
59
|
+
.cython.score-25 {background-color: #FFFF48;}
|
|
60
|
+
.cython.score-26 {background-color: #FFFF46;}
|
|
61
|
+
.cython.score-27 {background-color: #FFFF44;}
|
|
62
|
+
.cython.score-28 {background-color: #FFFF43;}
|
|
63
|
+
.cython.score-29 {background-color: #FFFF41;}
|
|
64
|
+
.cython.score-30 {background-color: #FFFF3f;}
|
|
65
|
+
.cython.score-31 {background-color: #FFFF3e;}
|
|
66
|
+
.cython.score-32 {background-color: #FFFF3c;}
|
|
67
|
+
.cython.score-33 {background-color: #FFFF3b;}
|
|
68
|
+
.cython.score-34 {background-color: #FFFF39;}
|
|
69
|
+
.cython.score-35 {background-color: #FFFF38;}
|
|
70
|
+
.cython.score-36 {background-color: #FFFF37;}
|
|
71
|
+
.cython.score-37 {background-color: #FFFF36;}
|
|
72
|
+
.cython.score-38 {background-color: #FFFF35;}
|
|
73
|
+
.cython.score-39 {background-color: #FFFF34;}
|
|
74
|
+
.cython.score-40 {background-color: #FFFF33;}
|
|
75
|
+
.cython.score-41 {background-color: #FFFF32;}
|
|
76
|
+
.cython.score-42 {background-color: #FFFF31;}
|
|
77
|
+
.cython.score-43 {background-color: #FFFF30;}
|
|
78
|
+
.cython.score-44 {background-color: #FFFF2f;}
|
|
79
|
+
.cython.score-45 {background-color: #FFFF2e;}
|
|
80
|
+
.cython.score-46 {background-color: #FFFF2d;}
|
|
81
|
+
.cython.score-47 {background-color: #FFFF2c;}
|
|
82
|
+
.cython.score-48 {background-color: #FFFF2b;}
|
|
83
|
+
.cython.score-49 {background-color: #FFFF2b;}
|
|
84
|
+
.cython.score-50 {background-color: #FFFF2a;}
|
|
85
|
+
.cython.score-51 {background-color: #FFFF29;}
|
|
86
|
+
.cython.score-52 {background-color: #FFFF29;}
|
|
87
|
+
.cython.score-53 {background-color: #FFFF28;}
|
|
88
|
+
.cython.score-54 {background-color: #FFFF27;}
|
|
89
|
+
.cython.score-55 {background-color: #FFFF27;}
|
|
90
|
+
.cython.score-56 {background-color: #FFFF26;}
|
|
91
|
+
.cython.score-57 {background-color: #FFFF26;}
|
|
92
|
+
.cython.score-58 {background-color: #FFFF25;}
|
|
93
|
+
.cython.score-59 {background-color: #FFFF24;}
|
|
94
|
+
.cython.score-60 {background-color: #FFFF24;}
|
|
95
|
+
.cython.score-61 {background-color: #FFFF23;}
|
|
96
|
+
.cython.score-62 {background-color: #FFFF23;}
|
|
97
|
+
.cython.score-63 {background-color: #FFFF22;}
|
|
98
|
+
.cython.score-64 {background-color: #FFFF22;}
|
|
99
|
+
.cython.score-65 {background-color: #FFFF22;}
|
|
100
|
+
.cython.score-66 {background-color: #FFFF21;}
|
|
101
|
+
.cython.score-67 {background-color: #FFFF21;}
|
|
102
|
+
.cython.score-68 {background-color: #FFFF20;}
|
|
103
|
+
.cython.score-69 {background-color: #FFFF20;}
|
|
104
|
+
.cython.score-70 {background-color: #FFFF1f;}
|
|
105
|
+
.cython.score-71 {background-color: #FFFF1f;}
|
|
106
|
+
.cython.score-72 {background-color: #FFFF1f;}
|
|
107
|
+
.cython.score-73 {background-color: #FFFF1e;}
|
|
108
|
+
.cython.score-74 {background-color: #FFFF1e;}
|
|
109
|
+
.cython.score-75 {background-color: #FFFF1e;}
|
|
110
|
+
.cython.score-76 {background-color: #FFFF1d;}
|
|
111
|
+
.cython.score-77 {background-color: #FFFF1d;}
|
|
112
|
+
.cython.score-78 {background-color: #FFFF1c;}
|
|
113
|
+
.cython.score-79 {background-color: #FFFF1c;}
|
|
114
|
+
.cython.score-80 {background-color: #FFFF1c;}
|
|
115
|
+
.cython.score-81 {background-color: #FFFF1c;}
|
|
116
|
+
.cython.score-82 {background-color: #FFFF1b;}
|
|
117
|
+
.cython.score-83 {background-color: #FFFF1b;}
|
|
118
|
+
.cython.score-84 {background-color: #FFFF1b;}
|
|
119
|
+
.cython.score-85 {background-color: #FFFF1a;}
|
|
120
|
+
.cython.score-86 {background-color: #FFFF1a;}
|
|
121
|
+
.cython.score-87 {background-color: #FFFF1a;}
|
|
122
|
+
.cython.score-88 {background-color: #FFFF1a;}
|
|
123
|
+
.cython.score-89 {background-color: #FFFF19;}
|
|
124
|
+
.cython.score-90 {background-color: #FFFF19;}
|
|
125
|
+
.cython.score-91 {background-color: #FFFF19;}
|
|
126
|
+
.cython.score-92 {background-color: #FFFF19;}
|
|
127
|
+
.cython.score-93 {background-color: #FFFF18;}
|
|
128
|
+
.cython.score-94 {background-color: #FFFF18;}
|
|
129
|
+
.cython.score-95 {background-color: #FFFF18;}
|
|
130
|
+
.cython.score-96 {background-color: #FFFF18;}
|
|
131
|
+
.cython.score-97 {background-color: #FFFF17;}
|
|
132
|
+
.cython.score-98 {background-color: #FFFF17;}
|
|
133
|
+
.cython.score-99 {background-color: #FFFF17;}
|
|
134
|
+
.cython.score-100 {background-color: #FFFF17;}
|
|
135
|
+
.cython.score-101 {background-color: #FFFF16;}
|
|
136
|
+
.cython.score-102 {background-color: #FFFF16;}
|
|
137
|
+
.cython.score-103 {background-color: #FFFF16;}
|
|
138
|
+
.cython.score-104 {background-color: #FFFF16;}
|
|
139
|
+
.cython.score-105 {background-color: #FFFF16;}
|
|
140
|
+
.cython.score-106 {background-color: #FFFF15;}
|
|
141
|
+
.cython.score-107 {background-color: #FFFF15;}
|
|
142
|
+
.cython.score-108 {background-color: #FFFF15;}
|
|
143
|
+
.cython.score-109 {background-color: #FFFF15;}
|
|
144
|
+
.cython.score-110 {background-color: #FFFF15;}
|
|
145
|
+
.cython.score-111 {background-color: #FFFF15;}
|
|
146
|
+
.cython.score-112 {background-color: #FFFF14;}
|
|
147
|
+
.cython.score-113 {background-color: #FFFF14;}
|
|
148
|
+
.cython.score-114 {background-color: #FFFF14;}
|
|
149
|
+
.cython.score-115 {background-color: #FFFF14;}
|
|
150
|
+
.cython.score-116 {background-color: #FFFF14;}
|
|
151
|
+
.cython.score-117 {background-color: #FFFF14;}
|
|
152
|
+
.cython.score-118 {background-color: #FFFF13;}
|
|
153
|
+
.cython.score-119 {background-color: #FFFF13;}
|
|
154
|
+
.cython.score-120 {background-color: #FFFF13;}
|
|
155
|
+
.cython.score-121 {background-color: #FFFF13;}
|
|
156
|
+
.cython.score-122 {background-color: #FFFF13;}
|
|
157
|
+
.cython.score-123 {background-color: #FFFF13;}
|
|
158
|
+
.cython.score-124 {background-color: #FFFF13;}
|
|
159
|
+
.cython.score-125 {background-color: #FFFF12;}
|
|
160
|
+
.cython.score-126 {background-color: #FFFF12;}
|
|
161
|
+
.cython.score-127 {background-color: #FFFF12;}
|
|
162
|
+
.cython.score-128 {background-color: #FFFF12;}
|
|
163
|
+
.cython.score-129 {background-color: #FFFF12;}
|
|
164
|
+
.cython.score-130 {background-color: #FFFF12;}
|
|
165
|
+
.cython.score-131 {background-color: #FFFF12;}
|
|
166
|
+
.cython.score-132 {background-color: #FFFF11;}
|
|
167
|
+
.cython.score-133 {background-color: #FFFF11;}
|
|
168
|
+
.cython.score-134 {background-color: #FFFF11;}
|
|
169
|
+
.cython.score-135 {background-color: #FFFF11;}
|
|
170
|
+
.cython.score-136 {background-color: #FFFF11;}
|
|
171
|
+
.cython.score-137 {background-color: #FFFF11;}
|
|
172
|
+
.cython.score-138 {background-color: #FFFF11;}
|
|
173
|
+
.cython.score-139 {background-color: #FFFF11;}
|
|
174
|
+
.cython.score-140 {background-color: #FFFF11;}
|
|
175
|
+
.cython.score-141 {background-color: #FFFF10;}
|
|
176
|
+
.cython.score-142 {background-color: #FFFF10;}
|
|
177
|
+
.cython.score-143 {background-color: #FFFF10;}
|
|
178
|
+
.cython.score-144 {background-color: #FFFF10;}
|
|
179
|
+
.cython.score-145 {background-color: #FFFF10;}
|
|
180
|
+
.cython.score-146 {background-color: #FFFF10;}
|
|
181
|
+
.cython.score-147 {background-color: #FFFF10;}
|
|
182
|
+
.cython.score-148 {background-color: #FFFF10;}
|
|
183
|
+
.cython.score-149 {background-color: #FFFF10;}
|
|
184
|
+
.cython.score-150 {background-color: #FFFF0f;}
|
|
185
|
+
.cython.score-151 {background-color: #FFFF0f;}
|
|
186
|
+
.cython.score-152 {background-color: #FFFF0f;}
|
|
187
|
+
.cython.score-153 {background-color: #FFFF0f;}
|
|
188
|
+
.cython.score-154 {background-color: #FFFF0f;}
|
|
189
|
+
.cython.score-155 {background-color: #FFFF0f;}
|
|
190
|
+
.cython.score-156 {background-color: #FFFF0f;}
|
|
191
|
+
.cython.score-157 {background-color: #FFFF0f;}
|
|
192
|
+
.cython.score-158 {background-color: #FFFF0f;}
|
|
193
|
+
.cython.score-159 {background-color: #FFFF0f;}
|
|
194
|
+
.cython.score-160 {background-color: #FFFF0f;}
|
|
195
|
+
.cython.score-161 {background-color: #FFFF0e;}
|
|
196
|
+
.cython.score-162 {background-color: #FFFF0e;}
|
|
197
|
+
.cython.score-163 {background-color: #FFFF0e;}
|
|
198
|
+
.cython.score-164 {background-color: #FFFF0e;}
|
|
199
|
+
.cython.score-165 {background-color: #FFFF0e;}
|
|
200
|
+
.cython.score-166 {background-color: #FFFF0e;}
|
|
201
|
+
.cython.score-167 {background-color: #FFFF0e;}
|
|
202
|
+
.cython.score-168 {background-color: #FFFF0e;}
|
|
203
|
+
.cython.score-169 {background-color: #FFFF0e;}
|
|
204
|
+
.cython.score-170 {background-color: #FFFF0e;}
|
|
205
|
+
.cython.score-171 {background-color: #FFFF0e;}
|
|
206
|
+
.cython.score-172 {background-color: #FFFF0e;}
|
|
207
|
+
.cython.score-173 {background-color: #FFFF0d;}
|
|
208
|
+
.cython.score-174 {background-color: #FFFF0d;}
|
|
209
|
+
.cython.score-175 {background-color: #FFFF0d;}
|
|
210
|
+
.cython.score-176 {background-color: #FFFF0d;}
|
|
211
|
+
.cython.score-177 {background-color: #FFFF0d;}
|
|
212
|
+
.cython.score-178 {background-color: #FFFF0d;}
|
|
213
|
+
.cython.score-179 {background-color: #FFFF0d;}
|
|
214
|
+
.cython.score-180 {background-color: #FFFF0d;}
|
|
215
|
+
.cython.score-181 {background-color: #FFFF0d;}
|
|
216
|
+
.cython.score-182 {background-color: #FFFF0d;}
|
|
217
|
+
.cython.score-183 {background-color: #FFFF0d;}
|
|
218
|
+
.cython.score-184 {background-color: #FFFF0d;}
|
|
219
|
+
.cython.score-185 {background-color: #FFFF0d;}
|
|
220
|
+
.cython.score-186 {background-color: #FFFF0d;}
|
|
221
|
+
.cython.score-187 {background-color: #FFFF0c;}
|
|
222
|
+
.cython.score-188 {background-color: #FFFF0c;}
|
|
223
|
+
.cython.score-189 {background-color: #FFFF0c;}
|
|
224
|
+
.cython.score-190 {background-color: #FFFF0c;}
|
|
225
|
+
.cython.score-191 {background-color: #FFFF0c;}
|
|
226
|
+
.cython.score-192 {background-color: #FFFF0c;}
|
|
227
|
+
.cython.score-193 {background-color: #FFFF0c;}
|
|
228
|
+
.cython.score-194 {background-color: #FFFF0c;}
|
|
229
|
+
.cython.score-195 {background-color: #FFFF0c;}
|
|
230
|
+
.cython.score-196 {background-color: #FFFF0c;}
|
|
231
|
+
.cython.score-197 {background-color: #FFFF0c;}
|
|
232
|
+
.cython.score-198 {background-color: #FFFF0c;}
|
|
233
|
+
.cython.score-199 {background-color: #FFFF0c;}
|
|
234
|
+
.cython.score-200 {background-color: #FFFF0c;}
|
|
235
|
+
.cython.score-201 {background-color: #FFFF0c;}
|
|
236
|
+
.cython.score-202 {background-color: #FFFF0c;}
|
|
237
|
+
.cython.score-203 {background-color: #FFFF0b;}
|
|
238
|
+
.cython.score-204 {background-color: #FFFF0b;}
|
|
239
|
+
.cython.score-205 {background-color: #FFFF0b;}
|
|
240
|
+
.cython.score-206 {background-color: #FFFF0b;}
|
|
241
|
+
.cython.score-207 {background-color: #FFFF0b;}
|
|
242
|
+
.cython.score-208 {background-color: #FFFF0b;}
|
|
243
|
+
.cython.score-209 {background-color: #FFFF0b;}
|
|
244
|
+
.cython.score-210 {background-color: #FFFF0b;}
|
|
245
|
+
.cython.score-211 {background-color: #FFFF0b;}
|
|
246
|
+
.cython.score-212 {background-color: #FFFF0b;}
|
|
247
|
+
.cython.score-213 {background-color: #FFFF0b;}
|
|
248
|
+
.cython.score-214 {background-color: #FFFF0b;}
|
|
249
|
+
.cython.score-215 {background-color: #FFFF0b;}
|
|
250
|
+
.cython.score-216 {background-color: #FFFF0b;}
|
|
251
|
+
.cython.score-217 {background-color: #FFFF0b;}
|
|
252
|
+
.cython.score-218 {background-color: #FFFF0b;}
|
|
253
|
+
.cython.score-219 {background-color: #FFFF0b;}
|
|
254
|
+
.cython.score-220 {background-color: #FFFF0b;}
|
|
255
|
+
.cython.score-221 {background-color: #FFFF0b;}
|
|
256
|
+
.cython.score-222 {background-color: #FFFF0a;}
|
|
257
|
+
.cython.score-223 {background-color: #FFFF0a;}
|
|
258
|
+
.cython.score-224 {background-color: #FFFF0a;}
|
|
259
|
+
.cython.score-225 {background-color: #FFFF0a;}
|
|
260
|
+
.cython.score-226 {background-color: #FFFF0a;}
|
|
261
|
+
.cython.score-227 {background-color: #FFFF0a;}
|
|
262
|
+
.cython.score-228 {background-color: #FFFF0a;}
|
|
263
|
+
.cython.score-229 {background-color: #FFFF0a;}
|
|
264
|
+
.cython.score-230 {background-color: #FFFF0a;}
|
|
265
|
+
.cython.score-231 {background-color: #FFFF0a;}
|
|
266
|
+
.cython.score-232 {background-color: #FFFF0a;}
|
|
267
|
+
.cython.score-233 {background-color: #FFFF0a;}
|
|
268
|
+
.cython.score-234 {background-color: #FFFF0a;}
|
|
269
|
+
.cython.score-235 {background-color: #FFFF0a;}
|
|
270
|
+
.cython.score-236 {background-color: #FFFF0a;}
|
|
271
|
+
.cython.score-237 {background-color: #FFFF0a;}
|
|
272
|
+
.cython.score-238 {background-color: #FFFF0a;}
|
|
273
|
+
.cython.score-239 {background-color: #FFFF0a;}
|
|
274
|
+
.cython.score-240 {background-color: #FFFF0a;}
|
|
275
|
+
.cython.score-241 {background-color: #FFFF0a;}
|
|
276
|
+
.cython.score-242 {background-color: #FFFF0a;}
|
|
277
|
+
.cython.score-243 {background-color: #FFFF0a;}
|
|
278
|
+
.cython.score-244 {background-color: #FFFF0a;}
|
|
279
|
+
.cython.score-245 {background-color: #FFFF0a;}
|
|
280
|
+
.cython.score-246 {background-color: #FFFF09;}
|
|
281
|
+
.cython.score-247 {background-color: #FFFF09;}
|
|
282
|
+
.cython.score-248 {background-color: #FFFF09;}
|
|
283
|
+
.cython.score-249 {background-color: #FFFF09;}
|
|
284
|
+
.cython.score-250 {background-color: #FFFF09;}
|
|
285
|
+
.cython.score-251 {background-color: #FFFF09;}
|
|
286
|
+
.cython.score-252 {background-color: #FFFF09;}
|
|
287
|
+
.cython.score-253 {background-color: #FFFF09;}
|
|
288
|
+
.cython.score-254 {background-color: #FFFF09;}
|
|
289
|
+
</style>
|
|
290
|
+
</head>
|
|
291
|
+
<body class="cython">
|
|
292
|
+
<p><span style="border-bottom: solid 1px grey;">Generated by Cython 3.0.11</span></p>
|
|
293
|
+
<p>
|
|
294
|
+
<span style="background-color: #FFFF00">Yellow lines</span> hint at Python interaction.<br />
|
|
295
|
+
Click on a line that starts with a "<code>+</code>" to see the C code that Cython generated for it.
|
|
296
|
+
</p>
|
|
297
|
+
<p>Raw output: <a href="functions.cpp">functions.cpp</a></p>
|
|
298
|
+
<div class="cython"><pre class="cython line score-8" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">01</span>: # cython: language_level=3, embedsignature=True, boundscheck=False, wraparound=True, initializedcheck=False</pre>
|
|
299
|
+
<pre class='cython code score-8 '> __pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyDict_NewPresized</span>(0);<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)</span>
|
|
300
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
|
|
301
|
+
if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) <span class='error_goto'>__PYX_ERR(0, 1, __pyx_L1_error)</span>
|
|
302
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
|
|
303
|
+
</pre><pre class="cython line score-0"> <span class="">02</span>: # Copyright (C) 2018-present Jesus Lara</pre>
|
|
304
|
+
<pre class="cython line score-0"> <span class="">03</span>: #</pre>
|
|
305
|
+
<pre class="cython line score-53" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">04</span>: from typing import get_args, get_origin, Union, Optional</pre>
|
|
306
|
+
<pre class='cython code score-53 '> __pyx_t_2 = <span class='py_c_api'>PyList_New</span>(4);<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error)</span>
|
|
307
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
|
|
308
|
+
<span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_n_s_get_args);
|
|
309
|
+
<span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_n_s_get_args);
|
|
310
|
+
if (<span class='pyx_c_api'>__Pyx_PyList_SET_ITEM</span>(__pyx_t_2, 0, __pyx_n_s_get_args)) <span class='error_goto'>__PYX_ERR(0, 4, __pyx_L1_error)</span>;
|
|
311
|
+
<span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_n_s_get_origin);
|
|
312
|
+
<span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_n_s_get_origin);
|
|
313
|
+
if (<span class='pyx_c_api'>__Pyx_PyList_SET_ITEM</span>(__pyx_t_2, 1, __pyx_n_s_get_origin)) <span class='error_goto'>__PYX_ERR(0, 4, __pyx_L1_error)</span>;
|
|
314
|
+
<span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_n_s_Union);
|
|
315
|
+
<span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_n_s_Union);
|
|
316
|
+
if (<span class='pyx_c_api'>__Pyx_PyList_SET_ITEM</span>(__pyx_t_2, 2, __pyx_n_s_Union)) <span class='error_goto'>__PYX_ERR(0, 4, __pyx_L1_error)</span>;
|
|
317
|
+
<span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_n_s_Optional);
|
|
318
|
+
<span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_n_s_Optional);
|
|
319
|
+
if (<span class='pyx_c_api'>__Pyx_PyList_SET_ITEM</span>(__pyx_t_2, 3, __pyx_n_s_Optional)) <span class='error_goto'>__PYX_ERR(0, 4, __pyx_L1_error)</span>;
|
|
320
|
+
__pyx_t_3 = <span class='pyx_c_api'>__Pyx_Import</span>(__pyx_n_s_typing, __pyx_t_2, 0);<span class='error_goto'> if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error)</span>
|
|
321
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
|
|
322
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
|
|
323
|
+
__pyx_t_2 = <span class='pyx_c_api'>__Pyx_ImportFrom</span>(__pyx_t_3, __pyx_n_s_get_args);<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error)</span>
|
|
324
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
|
|
325
|
+
if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_get_args, __pyx_t_2) < 0) <span class='error_goto'>__PYX_ERR(0, 4, __pyx_L1_error)</span>
|
|
326
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
|
|
327
|
+
__pyx_t_2 = <span class='pyx_c_api'>__Pyx_ImportFrom</span>(__pyx_t_3, __pyx_n_s_get_origin);<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error)</span>
|
|
328
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
|
|
329
|
+
if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_get_origin, __pyx_t_2) < 0) <span class='error_goto'>__PYX_ERR(0, 4, __pyx_L1_error)</span>
|
|
330
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
|
|
331
|
+
__pyx_t_2 = <span class='pyx_c_api'>__Pyx_ImportFrom</span>(__pyx_t_3, __pyx_n_s_Union);<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error)</span>
|
|
332
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
|
|
333
|
+
if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_Union, __pyx_t_2) < 0) <span class='error_goto'>__PYX_ERR(0, 4, __pyx_L1_error)</span>
|
|
334
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
|
|
335
|
+
__pyx_t_2 = <span class='pyx_c_api'>__Pyx_ImportFrom</span>(__pyx_t_3, __pyx_n_s_Optional);<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error)</span>
|
|
336
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
|
|
337
|
+
if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_Optional, __pyx_t_2) < 0) <span class='error_goto'>__PYX_ERR(0, 4, __pyx_L1_error)</span>
|
|
338
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
|
|
339
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
|
|
340
|
+
</pre><pre class="cython line score-20" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">05</span>: from collections.abc import Iterable</pre>
|
|
341
|
+
<pre class='cython code score-20 '> __pyx_t_3 = <span class='py_c_api'>PyList_New</span>(1);<span class='error_goto'> if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error)</span>
|
|
342
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
|
|
343
|
+
<span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_n_s_Iterable);
|
|
344
|
+
<span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_n_s_Iterable);
|
|
345
|
+
if (<span class='pyx_c_api'>__Pyx_PyList_SET_ITEM</span>(__pyx_t_3, 0, __pyx_n_s_Iterable)) <span class='error_goto'>__PYX_ERR(0, 5, __pyx_L1_error)</span>;
|
|
346
|
+
__pyx_t_2 = <span class='pyx_c_api'>__Pyx_Import</span>(__pyx_n_s_collections_abc, __pyx_t_3, 0);<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error)</span>
|
|
347
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
|
|
348
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
|
|
349
|
+
__pyx_t_3 = <span class='pyx_c_api'>__Pyx_ImportFrom</span>(__pyx_t_2, __pyx_n_s_Iterable);<span class='error_goto'> if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error)</span>
|
|
350
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
|
|
351
|
+
if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_Iterable, __pyx_t_3) < 0) <span class='error_goto'>__PYX_ERR(0, 5, __pyx_L1_error)</span>
|
|
352
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
|
|
353
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
|
|
354
|
+
</pre><pre class="cython line score-0"> <span class="">06</span>: from libcpp cimport bool as bool_t</pre>
|
|
355
|
+
<pre class="cython line score-0"> <span class="">07</span>: from cpython.object cimport (</pre>
|
|
356
|
+
<pre class="cython line score-0"> <span class="">08</span>: PyObject_IsInstance,</pre>
|
|
357
|
+
<pre class="cython line score-0"> <span class="">09</span>: PyObject_IsSubclass,</pre>
|
|
358
|
+
<pre class="cython line score-0"> <span class="">10</span>: PyObject_HasAttr,</pre>
|
|
359
|
+
<pre class="cython line score-0"> <span class="">11</span>: )</pre>
|
|
360
|
+
<pre class="cython line score-20" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">12</span>: from uuid import UUID</pre>
|
|
361
|
+
<pre class='cython code score-20 '> __pyx_t_2 = <span class='py_c_api'>PyList_New</span>(1);<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error)</span>
|
|
362
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
|
|
363
|
+
<span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_n_s_UUID);
|
|
364
|
+
<span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_n_s_UUID);
|
|
365
|
+
if (<span class='pyx_c_api'>__Pyx_PyList_SET_ITEM</span>(__pyx_t_2, 0, __pyx_n_s_UUID)) <span class='error_goto'>__PYX_ERR(0, 12, __pyx_L1_error)</span>;
|
|
366
|
+
__pyx_t_3 = <span class='pyx_c_api'>__Pyx_Import</span>(__pyx_n_s_uuid, __pyx_t_2, 0);<span class='error_goto'> if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 12, __pyx_L1_error)</span>
|
|
367
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
|
|
368
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
|
|
369
|
+
__pyx_t_2 = <span class='pyx_c_api'>__Pyx_ImportFrom</span>(__pyx_t_3, __pyx_n_s_UUID);<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error)</span>
|
|
370
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
|
|
371
|
+
if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_UUID, __pyx_t_2) < 0) <span class='error_goto'>__PYX_ERR(0, 12, __pyx_L1_error)</span>
|
|
372
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
|
|
373
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
|
|
374
|
+
</pre><pre class="cython line score-13" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">13</span>: import asyncpg.pgproto.pgproto as pgproto</pre>
|
|
375
|
+
<pre class='cython code score-13 '> __pyx_t_3 = <span class='pyx_c_api'>__Pyx_ImportDottedModule</span>(__pyx_n_s_asyncpg_pgproto_pgproto, __pyx_tuple__3);<span class='error_goto'> if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 13, __pyx_L1_error)</span>
|
|
376
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
|
|
377
|
+
if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_pgproto, __pyx_t_3) < 0) <span class='error_goto'>__PYX_ERR(0, 13, __pyx_L1_error)</span>
|
|
378
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
|
|
379
|
+
/* … */
|
|
380
|
+
__pyx_tuple__3 = <span class='py_c_api'>PyTuple_Pack</span>(3, __pyx_n_s_asyncpg, __pyx_n_s_pgproto, __pyx_n_s_pgproto);<span class='error_goto'> if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 13, __pyx_L1_error)</span>
|
|
381
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_tuple__3);
|
|
382
|
+
<span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_tuple__3);
|
|
383
|
+
</pre><pre class="cython line score-20" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">14</span>: from decimal import Decimal</pre>
|
|
384
|
+
<pre class='cython code score-20 '> __pyx_t_3 = <span class='py_c_api'>PyList_New</span>(1);<span class='error_goto'> if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 14, __pyx_L1_error)</span>
|
|
385
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
|
|
386
|
+
<span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_n_s_Decimal);
|
|
387
|
+
<span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_n_s_Decimal);
|
|
388
|
+
if (<span class='pyx_c_api'>__Pyx_PyList_SET_ITEM</span>(__pyx_t_3, 0, __pyx_n_s_Decimal)) <span class='error_goto'>__PYX_ERR(0, 14, __pyx_L1_error)</span>;
|
|
389
|
+
__pyx_t_2 = <span class='pyx_c_api'>__Pyx_Import</span>(__pyx_n_s_decimal, __pyx_t_3, 0);<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error)</span>
|
|
390
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
|
|
391
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
|
|
392
|
+
__pyx_t_3 = <span class='pyx_c_api'>__Pyx_ImportFrom</span>(__pyx_t_2, __pyx_n_s_Decimal);<span class='error_goto'> if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 14, __pyx_L1_error)</span>
|
|
393
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
|
|
394
|
+
if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_Decimal, __pyx_t_3) < 0) <span class='error_goto'>__PYX_ERR(0, 14, __pyx_L1_error)</span>
|
|
395
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
|
|
396
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
|
|
397
|
+
</pre><pre class="cython line score-8" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">15</span>: import datetime</pre>
|
|
398
|
+
<pre class='cython code score-8 '> __pyx_t_2 = <span class='pyx_c_api'>__Pyx_ImportDottedModule</span>(__pyx_n_s_datetime, NULL);<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error)</span>
|
|
399
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
|
|
400
|
+
if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_datetime, __pyx_t_2) < 0) <span class='error_goto'>__PYX_ERR(0, 15, __pyx_L1_error)</span>
|
|
401
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
|
|
402
|
+
</pre><pre class="cython line score-8" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">16</span>: import types</pre>
|
|
403
|
+
<pre class='cython code score-8 '> __pyx_t_2 = <span class='pyx_c_api'>__Pyx_ImportDottedModule</span>(__pyx_n_s_types, NULL);<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error)</span>
|
|
404
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
|
|
405
|
+
if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_types, __pyx_t_2) < 0) <span class='error_goto'>__PYX_ERR(0, 16, __pyx_L1_error)</span>
|
|
406
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
|
|
407
|
+
</pre><pre class="cython line score-20" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">17</span>: from functools import partial</pre>
|
|
408
|
+
<pre class='cython code score-20 '> __pyx_t_2 = <span class='py_c_api'>PyList_New</span>(1);<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error)</span>
|
|
409
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
|
|
410
|
+
<span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_n_s_partial);
|
|
411
|
+
<span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_n_s_partial);
|
|
412
|
+
if (<span class='pyx_c_api'>__Pyx_PyList_SET_ITEM</span>(__pyx_t_2, 0, __pyx_n_s_partial)) <span class='error_goto'>__PYX_ERR(0, 17, __pyx_L1_error)</span>;
|
|
413
|
+
__pyx_t_3 = <span class='pyx_c_api'>__Pyx_Import</span>(__pyx_n_s_functools, __pyx_t_2, 0);<span class='error_goto'> if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 17, __pyx_L1_error)</span>
|
|
414
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
|
|
415
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
|
|
416
|
+
__pyx_t_2 = <span class='pyx_c_api'>__Pyx_ImportFrom</span>(__pyx_t_3, __pyx_n_s_partial);<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error)</span>
|
|
417
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
|
|
418
|
+
if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_partial, __pyx_t_2) < 0) <span class='error_goto'>__PYX_ERR(0, 17, __pyx_L1_error)</span>
|
|
419
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
|
|
420
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
|
|
421
|
+
</pre><pre class="cython line score-20" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">18</span>: from dataclasses import _MISSING_TYPE</pre>
|
|
422
|
+
<pre class='cython code score-20 '> __pyx_t_3 = <span class='py_c_api'>PyList_New</span>(1);<span class='error_goto'> if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 18, __pyx_L1_error)</span>
|
|
423
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
|
|
424
|
+
<span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_n_s_MISSING_TYPE);
|
|
425
|
+
<span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_n_s_MISSING_TYPE);
|
|
426
|
+
if (<span class='pyx_c_api'>__Pyx_PyList_SET_ITEM</span>(__pyx_t_3, 0, __pyx_n_s_MISSING_TYPE)) <span class='error_goto'>__PYX_ERR(0, 18, __pyx_L1_error)</span>;
|
|
427
|
+
__pyx_t_2 = <span class='pyx_c_api'>__Pyx_Import</span>(__pyx_n_s_dataclasses, __pyx_t_3, 0);<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error)</span>
|
|
428
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
|
|
429
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
|
|
430
|
+
__pyx_t_3 = <span class='pyx_c_api'>__Pyx_ImportFrom</span>(__pyx_t_2, __pyx_n_s_MISSING_TYPE);<span class='error_goto'> if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 18, __pyx_L1_error)</span>
|
|
431
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
|
|
432
|
+
if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_MISSING_TYPE, __pyx_t_3) < 0) <span class='error_goto'>__PYX_ERR(0, 18, __pyx_L1_error)</span>
|
|
433
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
|
|
434
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
|
|
435
|
+
</pre><pre class="cython line score-0"> <span class="">19</span>: </pre>
|
|
436
|
+
<pre class="cython line score-0"> <span class="">20</span>: </pre>
|
|
437
|
+
<pre class="cython line score-63" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">21</span>: cpdef bool_t is_iterable(object value):</pre>
|
|
438
|
+
<pre class='cython code score-63 '>static PyObject *__pyx_pw_9datamodel_9functions_1is_iterable(PyObject *__pyx_self,
|
|
439
|
+
#if CYTHON_METH_FASTCALL
|
|
440
|
+
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
|
441
|
+
#else
|
|
442
|
+
PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
443
|
+
#endif
|
|
444
|
+
); /*proto*/
|
|
445
|
+
static bool __pyx_f_9datamodel_9functions_is_iterable(PyObject *__pyx_v_value, CYTHON_UNUSED int __pyx_skip_dispatch) {
|
|
446
|
+
bool __pyx_r;
|
|
447
|
+
/* … */
|
|
448
|
+
/* function exit code */
|
|
449
|
+
__pyx_L1_error:;
|
|
450
|
+
<span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_2);
|
|
451
|
+
<span class='pyx_c_api'>__Pyx_AddTraceback</span>("datamodel.functions.is_iterable", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
452
|
+
__pyx_r = -1;
|
|
453
|
+
__pyx_L0:;
|
|
454
|
+
<span class='refnanny'>__Pyx_RefNannyFinishContext</span>();
|
|
455
|
+
return __pyx_r;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
/* Python wrapper */
|
|
459
|
+
static PyObject *__pyx_pw_9datamodel_9functions_1is_iterable(PyObject *__pyx_self,
|
|
460
|
+
#if CYTHON_METH_FASTCALL
|
|
461
|
+
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
|
462
|
+
#else
|
|
463
|
+
PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
464
|
+
#endif
|
|
465
|
+
); /*proto*/
|
|
466
|
+
<span class='py_macro_api'>PyDoc_STRVAR</span>(__pyx_doc_9datamodel_9functions_is_iterable, "is_iterable(value) -> bool\nReturns True if value is an iterable.");
|
|
467
|
+
static PyMethodDef __pyx_mdef_9datamodel_9functions_1is_iterable = {"is_iterable", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9datamodel_9functions_1is_iterable, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9datamodel_9functions_is_iterable};
|
|
468
|
+
static PyObject *__pyx_pw_9datamodel_9functions_1is_iterable(PyObject *__pyx_self,
|
|
469
|
+
#if CYTHON_METH_FASTCALL
|
|
470
|
+
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
|
471
|
+
#else
|
|
472
|
+
PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
473
|
+
#endif
|
|
474
|
+
) {
|
|
475
|
+
PyObject *__pyx_v_value = 0;
|
|
476
|
+
#if !CYTHON_METH_FASTCALL
|
|
477
|
+
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
|
|
478
|
+
#endif
|
|
479
|
+
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
|
|
480
|
+
PyObject *__pyx_r = 0;
|
|
481
|
+
<span class='refnanny'>__Pyx_RefNannyDeclarations</span>
|
|
482
|
+
<span class='refnanny'>__Pyx_RefNannySetupContext</span>("is_iterable (wrapper)", 0);
|
|
483
|
+
#if !CYTHON_METH_FASTCALL
|
|
484
|
+
#if CYTHON_ASSUME_SAFE_MACROS
|
|
485
|
+
__pyx_nargs = <span class='py_macro_api'>PyTuple_GET_SIZE</span>(__pyx_args);
|
|
486
|
+
#else
|
|
487
|
+
__pyx_nargs = <span class='py_c_api'>PyTuple_Size</span>(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
|
|
488
|
+
#endif
|
|
489
|
+
#endif
|
|
490
|
+
__pyx_kwvalues = <span class='pyx_c_api'>__Pyx_KwValues_FASTCALL</span>(__pyx_args, __pyx_nargs);
|
|
491
|
+
{
|
|
492
|
+
PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,0};
|
|
493
|
+
PyObject* values[1] = {0};
|
|
494
|
+
if (__pyx_kwds) {
|
|
495
|
+
Py_ssize_t kw_args;
|
|
496
|
+
switch (__pyx_nargs) {
|
|
497
|
+
case 1: values[0] = <span class='pyx_c_api'>__Pyx_Arg_FASTCALL</span>(__pyx_args, 0);
|
|
498
|
+
CYTHON_FALLTHROUGH;
|
|
499
|
+
case 0: break;
|
|
500
|
+
default: goto __pyx_L5_argtuple_error;
|
|
501
|
+
}
|
|
502
|
+
kw_args = <span class='pyx_c_api'>__Pyx_NumKwargs_FASTCALL</span>(__pyx_kwds);
|
|
503
|
+
switch (__pyx_nargs) {
|
|
504
|
+
case 0:
|
|
505
|
+
if (likely((values[0] = <span class='pyx_c_api'>__Pyx_GetKwValue_FASTCALL</span>(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) {
|
|
506
|
+
(void)<span class='pyx_c_api'>__Pyx_Arg_NewRef_FASTCALL</span>(values[0]);
|
|
507
|
+
kw_args--;
|
|
508
|
+
}
|
|
509
|
+
else if (unlikely(<span class='py_c_api'>PyErr_Occurred</span>())) <span class='error_goto'>__PYX_ERR(0, 21, __pyx_L3_error)</span>
|
|
510
|
+
else goto __pyx_L5_argtuple_error;
|
|
511
|
+
}
|
|
512
|
+
if (unlikely(kw_args > 0)) {
|
|
513
|
+
const Py_ssize_t kwd_pos_args = __pyx_nargs;
|
|
514
|
+
if (unlikely(<span class='pyx_c_api'>__Pyx_ParseOptionalKeywords</span>(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_iterable") < 0)) <span class='error_goto'>__PYX_ERR(0, 21, __pyx_L3_error)</span>
|
|
515
|
+
}
|
|
516
|
+
} else if (unlikely(__pyx_nargs != 1)) {
|
|
517
|
+
goto __pyx_L5_argtuple_error;
|
|
518
|
+
} else {
|
|
519
|
+
values[0] = <span class='pyx_c_api'>__Pyx_Arg_FASTCALL</span>(__pyx_args, 0);
|
|
520
|
+
}
|
|
521
|
+
__pyx_v_value = values[0];
|
|
522
|
+
}
|
|
523
|
+
goto __pyx_L6_skip;
|
|
524
|
+
__pyx_L5_argtuple_error:;
|
|
525
|
+
<span class='pyx_c_api'>__Pyx_RaiseArgtupleInvalid</span>("is_iterable", 1, 1, 1, __pyx_nargs); <span class='error_goto'>__PYX_ERR(0, 21, __pyx_L3_error)</span>
|
|
526
|
+
__pyx_L6_skip:;
|
|
527
|
+
goto __pyx_L4_argument_unpacking_done;
|
|
528
|
+
__pyx_L3_error:;
|
|
529
|
+
{
|
|
530
|
+
Py_ssize_t __pyx_temp;
|
|
531
|
+
for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
|
|
532
|
+
<span class='pyx_c_api'>__Pyx_Arg_XDECREF_FASTCALL</span>(values[__pyx_temp]);
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
<span class='pyx_c_api'>__Pyx_AddTraceback</span>("datamodel.functions.is_iterable", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
536
|
+
<span class='refnanny'>__Pyx_RefNannyFinishContext</span>();
|
|
537
|
+
return NULL;
|
|
538
|
+
__pyx_L4_argument_unpacking_done:;
|
|
539
|
+
__pyx_r = __pyx_pf_9datamodel_9functions_is_iterable(__pyx_self, __pyx_v_value);
|
|
540
|
+
int __pyx_lineno = 0;
|
|
541
|
+
const char *__pyx_filename = NULL;
|
|
542
|
+
int __pyx_clineno = 0;
|
|
543
|
+
|
|
544
|
+
/* function exit code */
|
|
545
|
+
{
|
|
546
|
+
Py_ssize_t __pyx_temp;
|
|
547
|
+
for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
|
|
548
|
+
<span class='pyx_c_api'>__Pyx_Arg_XDECREF_FASTCALL</span>(values[__pyx_temp]);
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
<span class='refnanny'>__Pyx_RefNannyFinishContext</span>();
|
|
552
|
+
return __pyx_r;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
static PyObject *__pyx_pf_9datamodel_9functions_is_iterable(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value) {
|
|
556
|
+
PyObject *__pyx_r = NULL;
|
|
557
|
+
<span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_r);
|
|
558
|
+
__pyx_t_1 = __pyx_f_9datamodel_9functions_is_iterable(__pyx_v_value, 0); if (unlikely(__pyx_t_1 == ((bool)-1) && <span class='py_c_api'>PyErr_Occurred</span>())) <span class='error_goto'>__PYX_ERR(0, 21, __pyx_L1_error)</span>
|
|
559
|
+
__pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyBool_FromLong</span>(__pyx_t_1);<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error)</span>
|
|
560
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
|
|
561
|
+
__pyx_r = __pyx_t_2;
|
|
562
|
+
__pyx_t_2 = 0;
|
|
563
|
+
goto __pyx_L0;
|
|
564
|
+
|
|
565
|
+
/* function exit code */
|
|
566
|
+
__pyx_L1_error:;
|
|
567
|
+
<span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_2);
|
|
568
|
+
<span class='pyx_c_api'>__Pyx_AddTraceback</span>("datamodel.functions.is_iterable", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
569
|
+
__pyx_r = NULL;
|
|
570
|
+
__pyx_L0:;
|
|
571
|
+
<span class='refnanny'>__Pyx_XGIVEREF</span>(__pyx_r);
|
|
572
|
+
<span class='refnanny'>__Pyx_RefNannyFinishContext</span>();
|
|
573
|
+
return __pyx_r;
|
|
574
|
+
}
|
|
575
|
+
/* … */
|
|
576
|
+
__pyx_tuple__5 = <span class='py_c_api'>PyTuple_Pack</span>(1, __pyx_n_s_value);<span class='error_goto'> if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 21, __pyx_L1_error)</span>
|
|
577
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_tuple__5);
|
|
578
|
+
<span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_tuple__5);
|
|
579
|
+
/* … */
|
|
580
|
+
__pyx_t_2 = <span class='pyx_c_api'>__Pyx_CyFunction_New</span>(&__pyx_mdef_9datamodel_9functions_1is_iterable, 0, __pyx_n_s_is_iterable, NULL, __pyx_n_s_datamodel_functions, __pyx_d, ((PyObject *)__pyx_codeobj__6));<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error)</span>
|
|
581
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
|
|
582
|
+
if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_is_iterable, __pyx_t_2) < 0) <span class='error_goto'>__PYX_ERR(0, 21, __pyx_L1_error)</span>
|
|
583
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
|
|
584
|
+
__pyx_codeobj__6 = (PyObject*)<span class='pyx_c_api'>__Pyx_PyCode_New</span>(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_datamodel_functions_pyx, __pyx_n_s_is_iterable, 21, __pyx_empty_bytes);<span class='error_goto'> if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 21, __pyx_L1_error)</span>
|
|
585
|
+
</pre><pre class="cython line score-0"> <span class="">22</span>: """Returns True if value is an iterable."""</pre>
|
|
586
|
+
<pre class="cython line score-18" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">23</span>: if isinstance(value, Iterable) and not isinstance(value, (str, bytes)):</pre>
|
|
587
|
+
<pre class='cython code score-18 '> <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_t_2, __pyx_n_s_Iterable);<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error)</span>
|
|
588
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
|
|
589
|
+
__pyx_t_3 = <span class='py_c_api'>PyObject_IsInstance</span>(__pyx_v_value, __pyx_t_2);<span class='error_goto'> if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 23, __pyx_L1_error)</span>
|
|
590
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
|
|
591
|
+
if (__pyx_t_3) {
|
|
592
|
+
} else {
|
|
593
|
+
__pyx_t_1 = __pyx_t_3;
|
|
594
|
+
goto __pyx_L4_bool_binop_done;
|
|
595
|
+
}
|
|
596
|
+
__pyx_t_4 = <span class='py_c_api'>PyUnicode_Check</span>(__pyx_v_value);
|
|
597
|
+
if (!__pyx_t_4) {
|
|
598
|
+
} else {
|
|
599
|
+
__pyx_t_3 = __pyx_t_4;
|
|
600
|
+
goto __pyx_L6_bool_binop_done;
|
|
601
|
+
}
|
|
602
|
+
__pyx_t_4 = <span class='py_c_api'>PyBytes_Check</span>(__pyx_v_value);
|
|
603
|
+
__pyx_t_3 = __pyx_t_4;
|
|
604
|
+
__pyx_L6_bool_binop_done:;
|
|
605
|
+
__pyx_t_4 = (!__pyx_t_3);
|
|
606
|
+
__pyx_t_1 = __pyx_t_4;
|
|
607
|
+
__pyx_L4_bool_binop_done:;
|
|
608
|
+
if (__pyx_t_1) {
|
|
609
|
+
/* … */
|
|
610
|
+
}
|
|
611
|
+
</pre><pre class="cython line score-0" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">24</span>: return True</pre>
|
|
612
|
+
<pre class='cython code score-0 '> __pyx_r = 1;
|
|
613
|
+
goto __pyx_L0;
|
|
614
|
+
</pre><pre class="cython line score-0" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">25</span>: return False</pre>
|
|
615
|
+
<pre class='cython code score-0 '> __pyx_r = 0;
|
|
616
|
+
goto __pyx_L0;
|
|
617
|
+
</pre><pre class="cython line score-0"> <span class="">26</span>: </pre>
|
|
618
|
+
<pre class="cython line score-0"> <span class="">27</span>: </pre>
|
|
619
|
+
<pre class="cython line score-60" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">28</span>: cpdef bool_t is_primitive(object value):</pre>
|
|
620
|
+
<pre class='cython code score-60 '>static PyObject *__pyx_pw_9datamodel_9functions_3is_primitive(PyObject *__pyx_self,
|
|
621
|
+
#if CYTHON_METH_FASTCALL
|
|
622
|
+
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
|
623
|
+
#else
|
|
624
|
+
PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
625
|
+
#endif
|
|
626
|
+
); /*proto*/
|
|
627
|
+
static bool __pyx_f_9datamodel_9functions_is_primitive(PyObject *__pyx_v_value, CYTHON_UNUSED int __pyx_skip_dispatch) {
|
|
628
|
+
bool __pyx_r;
|
|
629
|
+
/* … */
|
|
630
|
+
/* function exit code */
|
|
631
|
+
__pyx_L1_error:;
|
|
632
|
+
<span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_1);
|
|
633
|
+
<span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_3);
|
|
634
|
+
<span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_5);
|
|
635
|
+
<span class='pyx_c_api'>__Pyx_AddTraceback</span>("datamodel.functions.is_primitive", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
636
|
+
__pyx_r = -1;
|
|
637
|
+
__pyx_L0:;
|
|
638
|
+
<span class='refnanny'>__Pyx_RefNannyFinishContext</span>();
|
|
639
|
+
return __pyx_r;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
/* Python wrapper */
|
|
643
|
+
static PyObject *__pyx_pw_9datamodel_9functions_3is_primitive(PyObject *__pyx_self,
|
|
644
|
+
#if CYTHON_METH_FASTCALL
|
|
645
|
+
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
|
646
|
+
#else
|
|
647
|
+
PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
648
|
+
#endif
|
|
649
|
+
); /*proto*/
|
|
650
|
+
<span class='py_macro_api'>PyDoc_STRVAR</span>(__pyx_doc_9datamodel_9functions_2is_primitive, "is_primitive(value) -> bool\nReturns True if value is a primitive type.");
|
|
651
|
+
static PyMethodDef __pyx_mdef_9datamodel_9functions_3is_primitive = {"is_primitive", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9datamodel_9functions_3is_primitive, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9datamodel_9functions_2is_primitive};
|
|
652
|
+
static PyObject *__pyx_pw_9datamodel_9functions_3is_primitive(PyObject *__pyx_self,
|
|
653
|
+
#if CYTHON_METH_FASTCALL
|
|
654
|
+
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
|
655
|
+
#else
|
|
656
|
+
PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
657
|
+
#endif
|
|
658
|
+
) {
|
|
659
|
+
PyObject *__pyx_v_value = 0;
|
|
660
|
+
#if !CYTHON_METH_FASTCALL
|
|
661
|
+
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
|
|
662
|
+
#endif
|
|
663
|
+
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
|
|
664
|
+
PyObject *__pyx_r = 0;
|
|
665
|
+
<span class='refnanny'>__Pyx_RefNannyDeclarations</span>
|
|
666
|
+
<span class='refnanny'>__Pyx_RefNannySetupContext</span>("is_primitive (wrapper)", 0);
|
|
667
|
+
#if !CYTHON_METH_FASTCALL
|
|
668
|
+
#if CYTHON_ASSUME_SAFE_MACROS
|
|
669
|
+
__pyx_nargs = <span class='py_macro_api'>PyTuple_GET_SIZE</span>(__pyx_args);
|
|
670
|
+
#else
|
|
671
|
+
__pyx_nargs = <span class='py_c_api'>PyTuple_Size</span>(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
|
|
672
|
+
#endif
|
|
673
|
+
#endif
|
|
674
|
+
__pyx_kwvalues = <span class='pyx_c_api'>__Pyx_KwValues_FASTCALL</span>(__pyx_args, __pyx_nargs);
|
|
675
|
+
{
|
|
676
|
+
PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,0};
|
|
677
|
+
PyObject* values[1] = {0};
|
|
678
|
+
if (__pyx_kwds) {
|
|
679
|
+
Py_ssize_t kw_args;
|
|
680
|
+
switch (__pyx_nargs) {
|
|
681
|
+
case 1: values[0] = <span class='pyx_c_api'>__Pyx_Arg_FASTCALL</span>(__pyx_args, 0);
|
|
682
|
+
CYTHON_FALLTHROUGH;
|
|
683
|
+
case 0: break;
|
|
684
|
+
default: goto __pyx_L5_argtuple_error;
|
|
685
|
+
}
|
|
686
|
+
kw_args = <span class='pyx_c_api'>__Pyx_NumKwargs_FASTCALL</span>(__pyx_kwds);
|
|
687
|
+
switch (__pyx_nargs) {
|
|
688
|
+
case 0:
|
|
689
|
+
if (likely((values[0] = <span class='pyx_c_api'>__Pyx_GetKwValue_FASTCALL</span>(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) {
|
|
690
|
+
(void)<span class='pyx_c_api'>__Pyx_Arg_NewRef_FASTCALL</span>(values[0]);
|
|
691
|
+
kw_args--;
|
|
692
|
+
}
|
|
693
|
+
else if (unlikely(<span class='py_c_api'>PyErr_Occurred</span>())) <span class='error_goto'>__PYX_ERR(0, 28, __pyx_L3_error)</span>
|
|
694
|
+
else goto __pyx_L5_argtuple_error;
|
|
695
|
+
}
|
|
696
|
+
if (unlikely(kw_args > 0)) {
|
|
697
|
+
const Py_ssize_t kwd_pos_args = __pyx_nargs;
|
|
698
|
+
if (unlikely(<span class='pyx_c_api'>__Pyx_ParseOptionalKeywords</span>(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_primitive") < 0)) <span class='error_goto'>__PYX_ERR(0, 28, __pyx_L3_error)</span>
|
|
699
|
+
}
|
|
700
|
+
} else if (unlikely(__pyx_nargs != 1)) {
|
|
701
|
+
goto __pyx_L5_argtuple_error;
|
|
702
|
+
} else {
|
|
703
|
+
values[0] = <span class='pyx_c_api'>__Pyx_Arg_FASTCALL</span>(__pyx_args, 0);
|
|
704
|
+
}
|
|
705
|
+
__pyx_v_value = values[0];
|
|
706
|
+
}
|
|
707
|
+
goto __pyx_L6_skip;
|
|
708
|
+
__pyx_L5_argtuple_error:;
|
|
709
|
+
<span class='pyx_c_api'>__Pyx_RaiseArgtupleInvalid</span>("is_primitive", 1, 1, 1, __pyx_nargs); <span class='error_goto'>__PYX_ERR(0, 28, __pyx_L3_error)</span>
|
|
710
|
+
__pyx_L6_skip:;
|
|
711
|
+
goto __pyx_L4_argument_unpacking_done;
|
|
712
|
+
__pyx_L3_error:;
|
|
713
|
+
{
|
|
714
|
+
Py_ssize_t __pyx_temp;
|
|
715
|
+
for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
|
|
716
|
+
<span class='pyx_c_api'>__Pyx_Arg_XDECREF_FASTCALL</span>(values[__pyx_temp]);
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
<span class='pyx_c_api'>__Pyx_AddTraceback</span>("datamodel.functions.is_primitive", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
720
|
+
<span class='refnanny'>__Pyx_RefNannyFinishContext</span>();
|
|
721
|
+
return NULL;
|
|
722
|
+
__pyx_L4_argument_unpacking_done:;
|
|
723
|
+
__pyx_r = __pyx_pf_9datamodel_9functions_2is_primitive(__pyx_self, __pyx_v_value);
|
|
724
|
+
int __pyx_lineno = 0;
|
|
725
|
+
const char *__pyx_filename = NULL;
|
|
726
|
+
int __pyx_clineno = 0;
|
|
727
|
+
|
|
728
|
+
/* function exit code */
|
|
729
|
+
{
|
|
730
|
+
Py_ssize_t __pyx_temp;
|
|
731
|
+
for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
|
|
732
|
+
<span class='pyx_c_api'>__Pyx_Arg_XDECREF_FASTCALL</span>(values[__pyx_temp]);
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
<span class='refnanny'>__Pyx_RefNannyFinishContext</span>();
|
|
736
|
+
return __pyx_r;
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
static PyObject *__pyx_pf_9datamodel_9functions_2is_primitive(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value) {
|
|
740
|
+
PyObject *__pyx_r = NULL;
|
|
741
|
+
<span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_r);
|
|
742
|
+
__pyx_t_1 = __pyx_f_9datamodel_9functions_is_primitive(__pyx_v_value, 0); if (unlikely(__pyx_t_1 == ((bool)-1) && <span class='py_c_api'>PyErr_Occurred</span>())) <span class='error_goto'>__PYX_ERR(0, 28, __pyx_L1_error)</span>
|
|
743
|
+
__pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyBool_FromLong</span>(__pyx_t_1);<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)</span>
|
|
744
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
|
|
745
|
+
__pyx_r = __pyx_t_2;
|
|
746
|
+
__pyx_t_2 = 0;
|
|
747
|
+
goto __pyx_L0;
|
|
748
|
+
|
|
749
|
+
/* function exit code */
|
|
750
|
+
__pyx_L1_error:;
|
|
751
|
+
<span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_2);
|
|
752
|
+
<span class='pyx_c_api'>__Pyx_AddTraceback</span>("datamodel.functions.is_primitive", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
753
|
+
__pyx_r = NULL;
|
|
754
|
+
__pyx_L0:;
|
|
755
|
+
<span class='refnanny'>__Pyx_XGIVEREF</span>(__pyx_r);
|
|
756
|
+
<span class='refnanny'>__Pyx_RefNannyFinishContext</span>();
|
|
757
|
+
return __pyx_r;
|
|
758
|
+
}
|
|
759
|
+
/* … */
|
|
760
|
+
__pyx_t_2 = <span class='pyx_c_api'>__Pyx_CyFunction_New</span>(&__pyx_mdef_9datamodel_9functions_3is_primitive, 0, __pyx_n_s_is_primitive, NULL, __pyx_n_s_datamodel_functions, __pyx_d, ((PyObject *)__pyx_codeobj__7));<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)</span>
|
|
761
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
|
|
762
|
+
if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_is_primitive, __pyx_t_2) < 0) <span class='error_goto'>__PYX_ERR(0, 28, __pyx_L1_error)</span>
|
|
763
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
|
|
764
|
+
/* … */
|
|
765
|
+
__pyx_codeobj__7 = (PyObject*)<span class='pyx_c_api'>__Pyx_PyCode_New</span>(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_datamodel_functions_pyx, __pyx_n_s_is_primitive, 28, __pyx_empty_bytes);<span class='error_goto'> if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 28, __pyx_L1_error)</span>
|
|
766
|
+
</pre><pre class="cython line score-0"> <span class="">29</span>: """Returns True if value is a primitive type."""</pre>
|
|
767
|
+
<pre class="cython line score-38" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">30</span>: return value in (</pre>
|
|
768
|
+
<pre class='cython code score-38 '> <span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_v_value);
|
|
769
|
+
__pyx_t_1 = __pyx_v_value;
|
|
770
|
+
/* … */
|
|
771
|
+
__pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyObject_IsTrue</span>(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) <span class='error_goto'>__PYX_ERR(0, 30, __pyx_L1_error)</span>
|
|
772
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
|
|
773
|
+
if (!__pyx_t_4) {
|
|
774
|
+
} else {
|
|
775
|
+
__pyx_t_2 = __pyx_t_4;
|
|
776
|
+
goto __pyx_L3_bool_binop_done;
|
|
777
|
+
}
|
|
778
|
+
/* … */
|
|
779
|
+
__pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyObject_IsTrue</span>(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) <span class='error_goto'>__PYX_ERR(0, 30, __pyx_L1_error)</span>
|
|
780
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
|
|
781
|
+
if (!__pyx_t_4) {
|
|
782
|
+
} else {
|
|
783
|
+
__pyx_t_2 = __pyx_t_4;
|
|
784
|
+
goto __pyx_L3_bool_binop_done;
|
|
785
|
+
}
|
|
786
|
+
/* … */
|
|
787
|
+
__pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyObject_IsTrue</span>(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) <span class='error_goto'>__PYX_ERR(0, 30, __pyx_L1_error)</span>
|
|
788
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
|
|
789
|
+
if (!__pyx_t_4) {
|
|
790
|
+
} else {
|
|
791
|
+
__pyx_t_2 = __pyx_t_4;
|
|
792
|
+
goto __pyx_L3_bool_binop_done;
|
|
793
|
+
}
|
|
794
|
+
/* … */
|
|
795
|
+
__pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyObject_IsTrue</span>(__pyx_t_5); if (unlikely((__pyx_t_4 < 0))) <span class='error_goto'>__PYX_ERR(0, 30, __pyx_L1_error)</span>
|
|
796
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_5); __pyx_t_5 = 0;
|
|
797
|
+
if (!__pyx_t_4) {
|
|
798
|
+
} else {
|
|
799
|
+
__pyx_t_2 = __pyx_t_4;
|
|
800
|
+
goto __pyx_L3_bool_binop_done;
|
|
801
|
+
}
|
|
802
|
+
/* … */
|
|
803
|
+
__pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyObject_IsTrue</span>(__pyx_t_5); if (unlikely((__pyx_t_4 < 0))) <span class='error_goto'>__PYX_ERR(0, 30, __pyx_L1_error)</span>
|
|
804
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_5); __pyx_t_5 = 0;
|
|
805
|
+
if (!__pyx_t_4) {
|
|
806
|
+
} else {
|
|
807
|
+
__pyx_t_2 = __pyx_t_4;
|
|
808
|
+
goto __pyx_L3_bool_binop_done;
|
|
809
|
+
}
|
|
810
|
+
/* … */
|
|
811
|
+
__pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyObject_IsTrue</span>(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) <span class='error_goto'>__PYX_ERR(0, 30, __pyx_L1_error)</span>
|
|
812
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
|
|
813
|
+
if (!__pyx_t_4) {
|
|
814
|
+
} else {
|
|
815
|
+
__pyx_t_2 = __pyx_t_4;
|
|
816
|
+
goto __pyx_L3_bool_binop_done;
|
|
817
|
+
}
|
|
818
|
+
/* … */
|
|
819
|
+
__pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyObject_IsTrue</span>(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) <span class='error_goto'>__PYX_ERR(0, 30, __pyx_L1_error)</span>
|
|
820
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
|
|
821
|
+
if (!__pyx_t_4) {
|
|
822
|
+
} else {
|
|
823
|
+
__pyx_t_2 = __pyx_t_4;
|
|
824
|
+
goto __pyx_L3_bool_binop_done;
|
|
825
|
+
}
|
|
826
|
+
/* … */
|
|
827
|
+
__pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyObject_IsTrue</span>(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) <span class='error_goto'>__PYX_ERR(0, 30, __pyx_L1_error)</span>
|
|
828
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
|
|
829
|
+
if (!__pyx_t_4) {
|
|
830
|
+
} else {
|
|
831
|
+
__pyx_t_2 = __pyx_t_4;
|
|
832
|
+
goto __pyx_L3_bool_binop_done;
|
|
833
|
+
}
|
|
834
|
+
/* … */
|
|
835
|
+
__pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyObject_IsTrue</span>(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) <span class='error_goto'>__PYX_ERR(0, 30, __pyx_L1_error)</span>
|
|
836
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
|
|
837
|
+
if (!__pyx_t_4) {
|
|
838
|
+
} else {
|
|
839
|
+
__pyx_t_2 = __pyx_t_4;
|
|
840
|
+
goto __pyx_L3_bool_binop_done;
|
|
841
|
+
}
|
|
842
|
+
/* … */
|
|
843
|
+
__pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyObject_IsTrue</span>(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) <span class='error_goto'>__PYX_ERR(0, 30, __pyx_L1_error)</span>
|
|
844
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
|
|
845
|
+
if (!__pyx_t_4) {
|
|
846
|
+
} else {
|
|
847
|
+
__pyx_t_2 = __pyx_t_4;
|
|
848
|
+
goto __pyx_L3_bool_binop_done;
|
|
849
|
+
}
|
|
850
|
+
/* … */
|
|
851
|
+
__pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyObject_IsTrue</span>(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) <span class='error_goto'>__PYX_ERR(0, 30, __pyx_L1_error)</span>
|
|
852
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
|
|
853
|
+
if (!__pyx_t_4) {
|
|
854
|
+
} else {
|
|
855
|
+
__pyx_t_2 = __pyx_t_4;
|
|
856
|
+
goto __pyx_L3_bool_binop_done;
|
|
857
|
+
}
|
|
858
|
+
/* … */
|
|
859
|
+
__pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyObject_IsTrue</span>(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) <span class='error_goto'>__PYX_ERR(0, 30, __pyx_L1_error)</span>
|
|
860
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
|
|
861
|
+
__pyx_t_2 = __pyx_t_4;
|
|
862
|
+
__pyx_L3_bool_binop_done:;
|
|
863
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
|
|
864
|
+
__pyx_r = __pyx_t_2;
|
|
865
|
+
goto __pyx_L0;
|
|
866
|
+
</pre><pre class="cython line score-5" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">31</span>: int,</pre>
|
|
867
|
+
<pre class='cython code score-5 '> __pyx_t_3 = <span class='py_c_api'>PyObject_RichCompare</span>(__pyx_t_1, ((PyObject *)(&PyInt_Type)), Py_EQ); <span class='refnanny'>__Pyx_XGOTREF</span>(__pyx_t_3);<span class='error_goto'> if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error)</span>
|
|
868
|
+
</pre><pre class="cython line score-5" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">32</span>: float,</pre>
|
|
869
|
+
<pre class='cython code score-5 '> __pyx_t_3 = <span class='py_c_api'>PyObject_RichCompare</span>(__pyx_t_1, ((PyObject *)(&PyFloat_Type)), Py_EQ); <span class='refnanny'>__Pyx_XGOTREF</span>(__pyx_t_3);<span class='error_goto'> if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error)</span>
|
|
870
|
+
</pre><pre class="cython line score-5" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">33</span>: str,</pre>
|
|
871
|
+
<pre class='cython code score-5 '> __pyx_t_3 = <span class='py_c_api'>PyObject_RichCompare</span>(__pyx_t_1, ((PyObject *)(&PyUnicode_Type)), Py_EQ); <span class='refnanny'>__Pyx_XGOTREF</span>(__pyx_t_3);<span class='error_goto'> if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error)</span>
|
|
872
|
+
</pre><pre class="cython line score-8" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">34</span>: UUID,</pre>
|
|
873
|
+
<pre class='cython code score-8 '> <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_t_3, __pyx_n_s_UUID);<span class='error_goto'> if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 34, __pyx_L1_error)</span>
|
|
874
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
|
|
875
|
+
__pyx_t_5 = <span class='py_c_api'>PyObject_RichCompare</span>(__pyx_t_1, __pyx_t_3, Py_EQ); <span class='refnanny'>__Pyx_XGOTREF</span>(__pyx_t_5);<span class='error_goto'> if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 30, __pyx_L1_error)</span>
|
|
876
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
|
|
877
|
+
</pre><pre class="cython line score-11" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">35</span>: pgproto.UUID,</pre>
|
|
878
|
+
<pre class='cython code score-11 '> <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_t_5, __pyx_n_s_pgproto);<span class='error_goto'> if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 35, __pyx_L1_error)</span>
|
|
879
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_5);
|
|
880
|
+
__pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_5, __pyx_n_s_UUID);<span class='error_goto'> if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 35, __pyx_L1_error)</span>
|
|
881
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
|
|
882
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_5); __pyx_t_5 = 0;
|
|
883
|
+
__pyx_t_5 = <span class='py_c_api'>PyObject_RichCompare</span>(__pyx_t_1, __pyx_t_3, Py_EQ); <span class='refnanny'>__Pyx_XGOTREF</span>(__pyx_t_5);<span class='error_goto'> if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 30, __pyx_L1_error)</span>
|
|
884
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
|
|
885
|
+
</pre><pre class="cython line score-8" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">36</span>: Decimal,</pre>
|
|
886
|
+
<pre class='cython code score-8 '> <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_t_5, __pyx_n_s_Decimal);<span class='error_goto'> if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 36, __pyx_L1_error)</span>
|
|
887
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_5);
|
|
888
|
+
__pyx_t_3 = <span class='py_c_api'>PyObject_RichCompare</span>(__pyx_t_1, __pyx_t_5, Py_EQ); <span class='refnanny'>__Pyx_XGOTREF</span>(__pyx_t_3);<span class='error_goto'> if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error)</span>
|
|
889
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_5); __pyx_t_5 = 0;
|
|
890
|
+
</pre><pre class="cython line score-5" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">37</span>: bool,</pre>
|
|
891
|
+
<pre class='cython code score-5 '> __pyx_t_3 = <span class='py_c_api'>PyObject_RichCompare</span>(__pyx_t_1, ((PyObject*)&PyBool_Type), Py_EQ); <span class='refnanny'>__Pyx_XGOTREF</span>(__pyx_t_3);<span class='error_goto'> if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error)</span>
|
|
892
|
+
</pre><pre class="cython line score-5" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">38</span>: bytes,</pre>
|
|
893
|
+
<pre class='cython code score-5 '> __pyx_t_3 = <span class='py_c_api'>PyObject_RichCompare</span>(__pyx_t_1, ((PyObject *)(&PyBytes_Type)), Py_EQ); <span class='refnanny'>__Pyx_XGOTREF</span>(__pyx_t_3);<span class='error_goto'> if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error)</span>
|
|
894
|
+
</pre><pre class="cython line score-11" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">39</span>: datetime.date,</pre>
|
|
895
|
+
<pre class='cython code score-11 '> <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_t_3, __pyx_n_s_datetime);<span class='error_goto'> if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 39, __pyx_L1_error)</span>
|
|
896
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
|
|
897
|
+
__pyx_t_5 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_3, __pyx_n_s_date);<span class='error_goto'> if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 39, __pyx_L1_error)</span>
|
|
898
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_5);
|
|
899
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
|
|
900
|
+
__pyx_t_3 = <span class='py_c_api'>PyObject_RichCompare</span>(__pyx_t_1, __pyx_t_5, Py_EQ); <span class='refnanny'>__Pyx_XGOTREF</span>(__pyx_t_3);<span class='error_goto'> if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error)</span>
|
|
901
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_5); __pyx_t_5 = 0;
|
|
902
|
+
</pre><pre class="cython line score-11" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">40</span>: datetime.datetime,</pre>
|
|
903
|
+
<pre class='cython code score-11 '> <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_t_3, __pyx_n_s_datetime);<span class='error_goto'> if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 40, __pyx_L1_error)</span>
|
|
904
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
|
|
905
|
+
__pyx_t_5 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_3, __pyx_n_s_datetime);<span class='error_goto'> if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 40, __pyx_L1_error)</span>
|
|
906
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_5);
|
|
907
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
|
|
908
|
+
__pyx_t_3 = <span class='py_c_api'>PyObject_RichCompare</span>(__pyx_t_1, __pyx_t_5, Py_EQ); <span class='refnanny'>__Pyx_XGOTREF</span>(__pyx_t_3);<span class='error_goto'> if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error)</span>
|
|
909
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_5); __pyx_t_5 = 0;
|
|
910
|
+
</pre><pre class="cython line score-11" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">41</span>: datetime.time,</pre>
|
|
911
|
+
<pre class='cython code score-11 '> <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_t_3, __pyx_n_s_datetime);<span class='error_goto'> if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 41, __pyx_L1_error)</span>
|
|
912
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
|
|
913
|
+
__pyx_t_5 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_3, __pyx_n_s_time);<span class='error_goto'> if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 41, __pyx_L1_error)</span>
|
|
914
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_5);
|
|
915
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
|
|
916
|
+
__pyx_t_3 = <span class='py_c_api'>PyObject_RichCompare</span>(__pyx_t_1, __pyx_t_5, Py_EQ); <span class='refnanny'>__Pyx_XGOTREF</span>(__pyx_t_3);<span class='error_goto'> if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error)</span>
|
|
917
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_5); __pyx_t_5 = 0;
|
|
918
|
+
</pre><pre class="cython line score-11" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">42</span>: datetime.timedelta</pre>
|
|
919
|
+
<pre class='cython code score-11 '> <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_t_3, __pyx_n_s_datetime);<span class='error_goto'> if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error)</span>
|
|
920
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
|
|
921
|
+
__pyx_t_5 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_3, __pyx_n_s_timedelta);<span class='error_goto'> if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 42, __pyx_L1_error)</span>
|
|
922
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_5);
|
|
923
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
|
|
924
|
+
__pyx_t_3 = <span class='py_c_api'>PyObject_RichCompare</span>(__pyx_t_1, __pyx_t_5, Py_EQ); <span class='refnanny'>__Pyx_XGOTREF</span>(__pyx_t_3);<span class='error_goto'> if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error)</span>
|
|
925
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_5); __pyx_t_5 = 0;
|
|
926
|
+
</pre><pre class="cython line score-0"> <span class="">43</span>: )</pre>
|
|
927
|
+
<pre class="cython line score-0"> <span class="">44</span>: </pre>
|
|
928
|
+
<pre class="cython line score-0"> <span class="">45</span>: </pre>
|
|
929
|
+
<pre class="cython line score-66" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">46</span>: cpdef bool_t is_dataclass(object obj):</pre>
|
|
930
|
+
<pre class='cython code score-66 '>static PyObject *__pyx_pw_9datamodel_9functions_5is_dataclass(PyObject *__pyx_self,
|
|
931
|
+
#if CYTHON_METH_FASTCALL
|
|
932
|
+
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
|
933
|
+
#else
|
|
934
|
+
PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
935
|
+
#endif
|
|
936
|
+
); /*proto*/
|
|
937
|
+
static bool __pyx_f_9datamodel_9functions_is_dataclass(PyObject *__pyx_v_obj, CYTHON_UNUSED int __pyx_skip_dispatch) {
|
|
938
|
+
PyObject *__pyx_v_cls = NULL;
|
|
939
|
+
bool __pyx_r;
|
|
940
|
+
/* … */
|
|
941
|
+
/* function exit code */
|
|
942
|
+
__pyx_L1_error:;
|
|
943
|
+
<span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_1);
|
|
944
|
+
<span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_4);
|
|
945
|
+
<span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_5);
|
|
946
|
+
<span class='pyx_c_api'>__Pyx_AddTraceback</span>("datamodel.functions.is_dataclass", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
947
|
+
__pyx_r = -1;
|
|
948
|
+
__pyx_L0:;
|
|
949
|
+
<span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_v_cls);
|
|
950
|
+
<span class='refnanny'>__Pyx_RefNannyFinishContext</span>();
|
|
951
|
+
return __pyx_r;
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
/* Python wrapper */
|
|
955
|
+
static PyObject *__pyx_pw_9datamodel_9functions_5is_dataclass(PyObject *__pyx_self,
|
|
956
|
+
#if CYTHON_METH_FASTCALL
|
|
957
|
+
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
|
958
|
+
#else
|
|
959
|
+
PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
960
|
+
#endif
|
|
961
|
+
); /*proto*/
|
|
962
|
+
<span class='py_macro_api'>PyDoc_STRVAR</span>(__pyx_doc_9datamodel_9functions_4is_dataclass, "is_dataclass(obj) -> bool\nReturns True if obj is a dataclass or an instance of a\n dataclass.");
|
|
963
|
+
static PyMethodDef __pyx_mdef_9datamodel_9functions_5is_dataclass = {"is_dataclass", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9datamodel_9functions_5is_dataclass, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9datamodel_9functions_4is_dataclass};
|
|
964
|
+
static PyObject *__pyx_pw_9datamodel_9functions_5is_dataclass(PyObject *__pyx_self,
|
|
965
|
+
#if CYTHON_METH_FASTCALL
|
|
966
|
+
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
|
967
|
+
#else
|
|
968
|
+
PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
969
|
+
#endif
|
|
970
|
+
) {
|
|
971
|
+
PyObject *__pyx_v_obj = 0;
|
|
972
|
+
#if !CYTHON_METH_FASTCALL
|
|
973
|
+
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
|
|
974
|
+
#endif
|
|
975
|
+
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
|
|
976
|
+
PyObject *__pyx_r = 0;
|
|
977
|
+
<span class='refnanny'>__Pyx_RefNannyDeclarations</span>
|
|
978
|
+
<span class='refnanny'>__Pyx_RefNannySetupContext</span>("is_dataclass (wrapper)", 0);
|
|
979
|
+
#if !CYTHON_METH_FASTCALL
|
|
980
|
+
#if CYTHON_ASSUME_SAFE_MACROS
|
|
981
|
+
__pyx_nargs = <span class='py_macro_api'>PyTuple_GET_SIZE</span>(__pyx_args);
|
|
982
|
+
#else
|
|
983
|
+
__pyx_nargs = <span class='py_c_api'>PyTuple_Size</span>(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
|
|
984
|
+
#endif
|
|
985
|
+
#endif
|
|
986
|
+
__pyx_kwvalues = <span class='pyx_c_api'>__Pyx_KwValues_FASTCALL</span>(__pyx_args, __pyx_nargs);
|
|
987
|
+
{
|
|
988
|
+
PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,0};
|
|
989
|
+
PyObject* values[1] = {0};
|
|
990
|
+
if (__pyx_kwds) {
|
|
991
|
+
Py_ssize_t kw_args;
|
|
992
|
+
switch (__pyx_nargs) {
|
|
993
|
+
case 1: values[0] = <span class='pyx_c_api'>__Pyx_Arg_FASTCALL</span>(__pyx_args, 0);
|
|
994
|
+
CYTHON_FALLTHROUGH;
|
|
995
|
+
case 0: break;
|
|
996
|
+
default: goto __pyx_L5_argtuple_error;
|
|
997
|
+
}
|
|
998
|
+
kw_args = <span class='pyx_c_api'>__Pyx_NumKwargs_FASTCALL</span>(__pyx_kwds);
|
|
999
|
+
switch (__pyx_nargs) {
|
|
1000
|
+
case 0:
|
|
1001
|
+
if (likely((values[0] = <span class='pyx_c_api'>__Pyx_GetKwValue_FASTCALL</span>(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_obj)) != 0)) {
|
|
1002
|
+
(void)<span class='pyx_c_api'>__Pyx_Arg_NewRef_FASTCALL</span>(values[0]);
|
|
1003
|
+
kw_args--;
|
|
1004
|
+
}
|
|
1005
|
+
else if (unlikely(<span class='py_c_api'>PyErr_Occurred</span>())) <span class='error_goto'>__PYX_ERR(0, 46, __pyx_L3_error)</span>
|
|
1006
|
+
else goto __pyx_L5_argtuple_error;
|
|
1007
|
+
}
|
|
1008
|
+
if (unlikely(kw_args > 0)) {
|
|
1009
|
+
const Py_ssize_t kwd_pos_args = __pyx_nargs;
|
|
1010
|
+
if (unlikely(<span class='pyx_c_api'>__Pyx_ParseOptionalKeywords</span>(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_dataclass") < 0)) <span class='error_goto'>__PYX_ERR(0, 46, __pyx_L3_error)</span>
|
|
1011
|
+
}
|
|
1012
|
+
} else if (unlikely(__pyx_nargs != 1)) {
|
|
1013
|
+
goto __pyx_L5_argtuple_error;
|
|
1014
|
+
} else {
|
|
1015
|
+
values[0] = <span class='pyx_c_api'>__Pyx_Arg_FASTCALL</span>(__pyx_args, 0);
|
|
1016
|
+
}
|
|
1017
|
+
__pyx_v_obj = values[0];
|
|
1018
|
+
}
|
|
1019
|
+
goto __pyx_L6_skip;
|
|
1020
|
+
__pyx_L5_argtuple_error:;
|
|
1021
|
+
<span class='pyx_c_api'>__Pyx_RaiseArgtupleInvalid</span>("is_dataclass", 1, 1, 1, __pyx_nargs); <span class='error_goto'>__PYX_ERR(0, 46, __pyx_L3_error)</span>
|
|
1022
|
+
__pyx_L6_skip:;
|
|
1023
|
+
goto __pyx_L4_argument_unpacking_done;
|
|
1024
|
+
__pyx_L3_error:;
|
|
1025
|
+
{
|
|
1026
|
+
Py_ssize_t __pyx_temp;
|
|
1027
|
+
for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
|
|
1028
|
+
<span class='pyx_c_api'>__Pyx_Arg_XDECREF_FASTCALL</span>(values[__pyx_temp]);
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
<span class='pyx_c_api'>__Pyx_AddTraceback</span>("datamodel.functions.is_dataclass", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
1032
|
+
<span class='refnanny'>__Pyx_RefNannyFinishContext</span>();
|
|
1033
|
+
return NULL;
|
|
1034
|
+
__pyx_L4_argument_unpacking_done:;
|
|
1035
|
+
__pyx_r = __pyx_pf_9datamodel_9functions_4is_dataclass(__pyx_self, __pyx_v_obj);
|
|
1036
|
+
int __pyx_lineno = 0;
|
|
1037
|
+
const char *__pyx_filename = NULL;
|
|
1038
|
+
int __pyx_clineno = 0;
|
|
1039
|
+
|
|
1040
|
+
/* function exit code */
|
|
1041
|
+
{
|
|
1042
|
+
Py_ssize_t __pyx_temp;
|
|
1043
|
+
for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
|
|
1044
|
+
<span class='pyx_c_api'>__Pyx_Arg_XDECREF_FASTCALL</span>(values[__pyx_temp]);
|
|
1045
|
+
}
|
|
1046
|
+
}
|
|
1047
|
+
<span class='refnanny'>__Pyx_RefNannyFinishContext</span>();
|
|
1048
|
+
return __pyx_r;
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
static PyObject *__pyx_pf_9datamodel_9functions_4is_dataclass(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
|
|
1052
|
+
PyObject *__pyx_r = NULL;
|
|
1053
|
+
<span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_r);
|
|
1054
|
+
__pyx_t_1 = __pyx_f_9datamodel_9functions_is_dataclass(__pyx_v_obj, 0); if (unlikely(__pyx_t_1 == ((bool)-1) && <span class='py_c_api'>PyErr_Occurred</span>())) <span class='error_goto'>__PYX_ERR(0, 46, __pyx_L1_error)</span>
|
|
1055
|
+
__pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyBool_FromLong</span>(__pyx_t_1);<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error)</span>
|
|
1056
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
|
|
1057
|
+
__pyx_r = __pyx_t_2;
|
|
1058
|
+
__pyx_t_2 = 0;
|
|
1059
|
+
goto __pyx_L0;
|
|
1060
|
+
|
|
1061
|
+
/* function exit code */
|
|
1062
|
+
__pyx_L1_error:;
|
|
1063
|
+
<span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_2);
|
|
1064
|
+
<span class='pyx_c_api'>__Pyx_AddTraceback</span>("datamodel.functions.is_dataclass", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
1065
|
+
__pyx_r = NULL;
|
|
1066
|
+
__pyx_L0:;
|
|
1067
|
+
<span class='refnanny'>__Pyx_XGIVEREF</span>(__pyx_r);
|
|
1068
|
+
<span class='refnanny'>__Pyx_RefNannyFinishContext</span>();
|
|
1069
|
+
return __pyx_r;
|
|
1070
|
+
}
|
|
1071
|
+
/* … */
|
|
1072
|
+
__pyx_tuple__8 = <span class='py_c_api'>PyTuple_Pack</span>(1, __pyx_n_s_obj);<span class='error_goto'> if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 46, __pyx_L1_error)</span>
|
|
1073
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_tuple__8);
|
|
1074
|
+
<span class='refnanny'>__Pyx_GIVEREF</span>(__pyx_tuple__8);
|
|
1075
|
+
/* … */
|
|
1076
|
+
__pyx_t_2 = <span class='pyx_c_api'>__Pyx_CyFunction_New</span>(&__pyx_mdef_9datamodel_9functions_5is_dataclass, 0, __pyx_n_s_is_dataclass, NULL, __pyx_n_s_datamodel_functions, __pyx_d, ((PyObject *)__pyx_codeobj__9));<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error)</span>
|
|
1077
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
|
|
1078
|
+
if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_is_dataclass, __pyx_t_2) < 0) <span class='error_goto'>__PYX_ERR(0, 46, __pyx_L1_error)</span>
|
|
1079
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
|
|
1080
|
+
__pyx_codeobj__9 = (PyObject*)<span class='pyx_c_api'>__Pyx_PyCode_New</span>(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_datamodel_functions_pyx, __pyx_n_s_is_dataclass, 46, __pyx_empty_bytes);<span class='error_goto'> if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 46, __pyx_L1_error)</span>
|
|
1081
|
+
</pre><pre class="cython line score-0"> <span class="">47</span>: """Returns True if obj is a dataclass or an instance of a</pre>
|
|
1082
|
+
<pre class="cython line score-0"> <span class="">48</span>: dataclass."""</pre>
|
|
1083
|
+
<pre class="cython line score-18" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">49</span>: cls = obj if isinstance(obj, type) and not isinstance(obj, types.GenericAlias) else type(obj)</pre>
|
|
1084
|
+
<pre class='cython code score-18 '> __pyx_t_3 = <span class='py_c_api'>PyType_Check</span>(__pyx_v_obj);
|
|
1085
|
+
if (__pyx_t_3) {
|
|
1086
|
+
} else {
|
|
1087
|
+
__pyx_t_2 = __pyx_t_3;
|
|
1088
|
+
goto __pyx_L3_bool_binop_done;
|
|
1089
|
+
}
|
|
1090
|
+
<span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_t_4, __pyx_n_s_types);<span class='error_goto'> if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 49, __pyx_L1_error)</span>
|
|
1091
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
|
|
1092
|
+
__pyx_t_5 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_4, __pyx_n_s_GenericAlias);<span class='error_goto'> if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 49, __pyx_L1_error)</span>
|
|
1093
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_5);
|
|
1094
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
|
|
1095
|
+
__pyx_t_3 = <span class='py_c_api'>PyObject_IsInstance</span>(__pyx_v_obj, __pyx_t_5);<span class='error_goto'> if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 49, __pyx_L1_error)</span>
|
|
1096
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_5); __pyx_t_5 = 0;
|
|
1097
|
+
__pyx_t_6 = (!__pyx_t_3);
|
|
1098
|
+
__pyx_t_2 = __pyx_t_6;
|
|
1099
|
+
__pyx_L3_bool_binop_done:;
|
|
1100
|
+
if (__pyx_t_2) {
|
|
1101
|
+
<span class='pyx_macro_api'>__Pyx_INCREF</span>(__pyx_v_obj);
|
|
1102
|
+
__pyx_t_1 = __pyx_v_obj;
|
|
1103
|
+
} else {
|
|
1104
|
+
<span class='pyx_macro_api'>__Pyx_INCREF</span>(((PyObject *)Py_TYPE(__pyx_v_obj)));
|
|
1105
|
+
__pyx_t_1 = ((PyObject *)Py_TYPE(__pyx_v_obj));
|
|
1106
|
+
}
|
|
1107
|
+
__pyx_v_cls = __pyx_t_1;
|
|
1108
|
+
__pyx_t_1 = 0;
|
|
1109
|
+
</pre><pre class="cython line score-5" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">50</span>: return PyObject_HasAttr(cls, '__dataclass_fields__')</pre>
|
|
1110
|
+
<pre class='cython code score-5 '> __pyx_r = <span class='py_c_api'>PyObject_HasAttr</span>(__pyx_v_cls, __pyx_n_u_dataclass_fields);
|
|
1111
|
+
goto __pyx_L0;
|
|
1112
|
+
</pre><pre class="cython line score-0"> <span class="">51</span>: </pre>
|
|
1113
|
+
<pre class="cython line score-0"> <span class="">52</span>: </pre>
|
|
1114
|
+
<pre class="cython line score-60" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">53</span>: cpdef bool_t is_function(object value):</pre>
|
|
1115
|
+
<pre class='cython code score-60 '>static PyObject *__pyx_pw_9datamodel_9functions_7is_function(PyObject *__pyx_self,
|
|
1116
|
+
#if CYTHON_METH_FASTCALL
|
|
1117
|
+
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
|
1118
|
+
#else
|
|
1119
|
+
PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
1120
|
+
#endif
|
|
1121
|
+
); /*proto*/
|
|
1122
|
+
static bool __pyx_f_9datamodel_9functions_is_function(PyObject *__pyx_v_value, CYTHON_UNUSED int __pyx_skip_dispatch) {
|
|
1123
|
+
bool __pyx_r;
|
|
1124
|
+
/* … */
|
|
1125
|
+
/* function exit code */
|
|
1126
|
+
__pyx_L1_error:;
|
|
1127
|
+
<span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_1);
|
|
1128
|
+
<span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_2);
|
|
1129
|
+
<span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_3);
|
|
1130
|
+
<span class='pyx_c_api'>__Pyx_AddTraceback</span>("datamodel.functions.is_function", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
1131
|
+
__pyx_r = -1;
|
|
1132
|
+
__pyx_L0:;
|
|
1133
|
+
<span class='refnanny'>__Pyx_RefNannyFinishContext</span>();
|
|
1134
|
+
return __pyx_r;
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
/* Python wrapper */
|
|
1138
|
+
static PyObject *__pyx_pw_9datamodel_9functions_7is_function(PyObject *__pyx_self,
|
|
1139
|
+
#if CYTHON_METH_FASTCALL
|
|
1140
|
+
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
|
1141
|
+
#else
|
|
1142
|
+
PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
1143
|
+
#endif
|
|
1144
|
+
); /*proto*/
|
|
1145
|
+
<span class='py_macro_api'>PyDoc_STRVAR</span>(__pyx_doc_9datamodel_9functions_6is_function, "is_function(value) -> bool\nReturns True if value is a function.");
|
|
1146
|
+
static PyMethodDef __pyx_mdef_9datamodel_9functions_7is_function = {"is_function", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9datamodel_9functions_7is_function, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9datamodel_9functions_6is_function};
|
|
1147
|
+
static PyObject *__pyx_pw_9datamodel_9functions_7is_function(PyObject *__pyx_self,
|
|
1148
|
+
#if CYTHON_METH_FASTCALL
|
|
1149
|
+
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
|
1150
|
+
#else
|
|
1151
|
+
PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
1152
|
+
#endif
|
|
1153
|
+
) {
|
|
1154
|
+
PyObject *__pyx_v_value = 0;
|
|
1155
|
+
#if !CYTHON_METH_FASTCALL
|
|
1156
|
+
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
|
|
1157
|
+
#endif
|
|
1158
|
+
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
|
|
1159
|
+
PyObject *__pyx_r = 0;
|
|
1160
|
+
<span class='refnanny'>__Pyx_RefNannyDeclarations</span>
|
|
1161
|
+
<span class='refnanny'>__Pyx_RefNannySetupContext</span>("is_function (wrapper)", 0);
|
|
1162
|
+
#if !CYTHON_METH_FASTCALL
|
|
1163
|
+
#if CYTHON_ASSUME_SAFE_MACROS
|
|
1164
|
+
__pyx_nargs = <span class='py_macro_api'>PyTuple_GET_SIZE</span>(__pyx_args);
|
|
1165
|
+
#else
|
|
1166
|
+
__pyx_nargs = <span class='py_c_api'>PyTuple_Size</span>(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
|
|
1167
|
+
#endif
|
|
1168
|
+
#endif
|
|
1169
|
+
__pyx_kwvalues = <span class='pyx_c_api'>__Pyx_KwValues_FASTCALL</span>(__pyx_args, __pyx_nargs);
|
|
1170
|
+
{
|
|
1171
|
+
PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,0};
|
|
1172
|
+
PyObject* values[1] = {0};
|
|
1173
|
+
if (__pyx_kwds) {
|
|
1174
|
+
Py_ssize_t kw_args;
|
|
1175
|
+
switch (__pyx_nargs) {
|
|
1176
|
+
case 1: values[0] = <span class='pyx_c_api'>__Pyx_Arg_FASTCALL</span>(__pyx_args, 0);
|
|
1177
|
+
CYTHON_FALLTHROUGH;
|
|
1178
|
+
case 0: break;
|
|
1179
|
+
default: goto __pyx_L5_argtuple_error;
|
|
1180
|
+
}
|
|
1181
|
+
kw_args = <span class='pyx_c_api'>__Pyx_NumKwargs_FASTCALL</span>(__pyx_kwds);
|
|
1182
|
+
switch (__pyx_nargs) {
|
|
1183
|
+
case 0:
|
|
1184
|
+
if (likely((values[0] = <span class='pyx_c_api'>__Pyx_GetKwValue_FASTCALL</span>(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) {
|
|
1185
|
+
(void)<span class='pyx_c_api'>__Pyx_Arg_NewRef_FASTCALL</span>(values[0]);
|
|
1186
|
+
kw_args--;
|
|
1187
|
+
}
|
|
1188
|
+
else if (unlikely(<span class='py_c_api'>PyErr_Occurred</span>())) <span class='error_goto'>__PYX_ERR(0, 53, __pyx_L3_error)</span>
|
|
1189
|
+
else goto __pyx_L5_argtuple_error;
|
|
1190
|
+
}
|
|
1191
|
+
if (unlikely(kw_args > 0)) {
|
|
1192
|
+
const Py_ssize_t kwd_pos_args = __pyx_nargs;
|
|
1193
|
+
if (unlikely(<span class='pyx_c_api'>__Pyx_ParseOptionalKeywords</span>(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_function") < 0)) <span class='error_goto'>__PYX_ERR(0, 53, __pyx_L3_error)</span>
|
|
1194
|
+
}
|
|
1195
|
+
} else if (unlikely(__pyx_nargs != 1)) {
|
|
1196
|
+
goto __pyx_L5_argtuple_error;
|
|
1197
|
+
} else {
|
|
1198
|
+
values[0] = <span class='pyx_c_api'>__Pyx_Arg_FASTCALL</span>(__pyx_args, 0);
|
|
1199
|
+
}
|
|
1200
|
+
__pyx_v_value = values[0];
|
|
1201
|
+
}
|
|
1202
|
+
goto __pyx_L6_skip;
|
|
1203
|
+
__pyx_L5_argtuple_error:;
|
|
1204
|
+
<span class='pyx_c_api'>__Pyx_RaiseArgtupleInvalid</span>("is_function", 1, 1, 1, __pyx_nargs); <span class='error_goto'>__PYX_ERR(0, 53, __pyx_L3_error)</span>
|
|
1205
|
+
__pyx_L6_skip:;
|
|
1206
|
+
goto __pyx_L4_argument_unpacking_done;
|
|
1207
|
+
__pyx_L3_error:;
|
|
1208
|
+
{
|
|
1209
|
+
Py_ssize_t __pyx_temp;
|
|
1210
|
+
for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
|
|
1211
|
+
<span class='pyx_c_api'>__Pyx_Arg_XDECREF_FASTCALL</span>(values[__pyx_temp]);
|
|
1212
|
+
}
|
|
1213
|
+
}
|
|
1214
|
+
<span class='pyx_c_api'>__Pyx_AddTraceback</span>("datamodel.functions.is_function", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
1215
|
+
<span class='refnanny'>__Pyx_RefNannyFinishContext</span>();
|
|
1216
|
+
return NULL;
|
|
1217
|
+
__pyx_L4_argument_unpacking_done:;
|
|
1218
|
+
__pyx_r = __pyx_pf_9datamodel_9functions_6is_function(__pyx_self, __pyx_v_value);
|
|
1219
|
+
int __pyx_lineno = 0;
|
|
1220
|
+
const char *__pyx_filename = NULL;
|
|
1221
|
+
int __pyx_clineno = 0;
|
|
1222
|
+
|
|
1223
|
+
/* function exit code */
|
|
1224
|
+
{
|
|
1225
|
+
Py_ssize_t __pyx_temp;
|
|
1226
|
+
for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
|
|
1227
|
+
<span class='pyx_c_api'>__Pyx_Arg_XDECREF_FASTCALL</span>(values[__pyx_temp]);
|
|
1228
|
+
}
|
|
1229
|
+
}
|
|
1230
|
+
<span class='refnanny'>__Pyx_RefNannyFinishContext</span>();
|
|
1231
|
+
return __pyx_r;
|
|
1232
|
+
}
|
|
1233
|
+
|
|
1234
|
+
static PyObject *__pyx_pf_9datamodel_9functions_6is_function(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value) {
|
|
1235
|
+
PyObject *__pyx_r = NULL;
|
|
1236
|
+
<span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_r);
|
|
1237
|
+
__pyx_t_1 = __pyx_f_9datamodel_9functions_is_function(__pyx_v_value, 0); if (unlikely(__pyx_t_1 == ((bool)-1) && <span class='py_c_api'>PyErr_Occurred</span>())) <span class='error_goto'>__PYX_ERR(0, 53, __pyx_L1_error)</span>
|
|
1238
|
+
__pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyBool_FromLong</span>(__pyx_t_1);<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error)</span>
|
|
1239
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
|
|
1240
|
+
__pyx_r = __pyx_t_2;
|
|
1241
|
+
__pyx_t_2 = 0;
|
|
1242
|
+
goto __pyx_L0;
|
|
1243
|
+
|
|
1244
|
+
/* function exit code */
|
|
1245
|
+
__pyx_L1_error:;
|
|
1246
|
+
<span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_2);
|
|
1247
|
+
<span class='pyx_c_api'>__Pyx_AddTraceback</span>("datamodel.functions.is_function", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
1248
|
+
__pyx_r = NULL;
|
|
1249
|
+
__pyx_L0:;
|
|
1250
|
+
<span class='refnanny'>__Pyx_XGIVEREF</span>(__pyx_r);
|
|
1251
|
+
<span class='refnanny'>__Pyx_RefNannyFinishContext</span>();
|
|
1252
|
+
return __pyx_r;
|
|
1253
|
+
}
|
|
1254
|
+
/* … */
|
|
1255
|
+
__pyx_t_2 = <span class='pyx_c_api'>__Pyx_CyFunction_New</span>(&__pyx_mdef_9datamodel_9functions_7is_function, 0, __pyx_n_s_is_function, NULL, __pyx_n_s_datamodel_functions, __pyx_d, ((PyObject *)__pyx_codeobj__10));<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error)</span>
|
|
1256
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
|
|
1257
|
+
if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_is_function, __pyx_t_2) < 0) <span class='error_goto'>__PYX_ERR(0, 53, __pyx_L1_error)</span>
|
|
1258
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
|
|
1259
|
+
/* … */
|
|
1260
|
+
__pyx_codeobj__10 = (PyObject*)<span class='pyx_c_api'>__Pyx_PyCode_New</span>(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_datamodel_functions_pyx, __pyx_n_s_is_function, 53, __pyx_empty_bytes);<span class='error_goto'> if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 53, __pyx_L1_error)</span>
|
|
1261
|
+
</pre><pre class="cython line score-0"> <span class="">54</span>: """Returns True if value is a function."""</pre>
|
|
1262
|
+
<pre class="cython line score-30" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">55</span>: return isinstance(value, (types.BuiltinFunctionType, types.FunctionType, partial))</pre>
|
|
1263
|
+
<pre class='cython code score-30 '> <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_t_1, __pyx_n_s_types);<span class='error_goto'> if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error)</span>
|
|
1264
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
|
|
1265
|
+
__pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_1, __pyx_n_s_BuiltinFunctionType);<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error)</span>
|
|
1266
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
|
|
1267
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
|
|
1268
|
+
<span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_t_1, __pyx_n_s_types);<span class='error_goto'> if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error)</span>
|
|
1269
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
|
|
1270
|
+
__pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_GetAttrStr</span>(__pyx_t_1, __pyx_n_s_FunctionType);<span class='error_goto'> if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 55, __pyx_L1_error)</span>
|
|
1271
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
|
|
1272
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
|
|
1273
|
+
<span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_t_1, __pyx_n_s_partial);<span class='error_goto'> if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error)</span>
|
|
1274
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_1);
|
|
1275
|
+
__pyx_t_5 = <span class='py_c_api'>PyObject_IsInstance</span>(__pyx_v_value, __pyx_t_2);
|
|
1276
|
+
if (!__pyx_t_5) {
|
|
1277
|
+
} else {
|
|
1278
|
+
__pyx_t_4 = __pyx_t_5;
|
|
1279
|
+
goto __pyx_L3_bool_binop_done;
|
|
1280
|
+
}
|
|
1281
|
+
__pyx_t_5 = <span class='py_c_api'>PyObject_IsInstance</span>(__pyx_v_value, __pyx_t_3);
|
|
1282
|
+
if (!__pyx_t_5) {
|
|
1283
|
+
} else {
|
|
1284
|
+
__pyx_t_4 = __pyx_t_5;
|
|
1285
|
+
goto __pyx_L3_bool_binop_done;
|
|
1286
|
+
}
|
|
1287
|
+
__pyx_t_5 = <span class='py_c_api'>PyObject_IsInstance</span>(__pyx_v_value, __pyx_t_1);
|
|
1288
|
+
__pyx_t_4 = __pyx_t_5;
|
|
1289
|
+
__pyx_L3_bool_binop_done:;
|
|
1290
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_1); __pyx_t_1 = 0;
|
|
1291
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
|
|
1292
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
|
|
1293
|
+
__pyx_r = __pyx_t_4;
|
|
1294
|
+
goto __pyx_L0;
|
|
1295
|
+
</pre><pre class="cython line score-0"> <span class="">56</span>: </pre>
|
|
1296
|
+
<pre class="cython line score-0"> <span class="">57</span>: </pre>
|
|
1297
|
+
<pre class="cython line score-59" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">58</span>: cpdef bool_t is_callable(object value):</pre>
|
|
1298
|
+
<pre class='cython code score-59 '>static PyObject *__pyx_pw_9datamodel_9functions_9is_callable(PyObject *__pyx_self,
|
|
1299
|
+
#if CYTHON_METH_FASTCALL
|
|
1300
|
+
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
|
1301
|
+
#else
|
|
1302
|
+
PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
1303
|
+
#endif
|
|
1304
|
+
); /*proto*/
|
|
1305
|
+
static bool __pyx_f_9datamodel_9functions_is_callable(PyObject *__pyx_v_value, CYTHON_UNUSED int __pyx_skip_dispatch) {
|
|
1306
|
+
bool __pyx_r;
|
|
1307
|
+
/* … */
|
|
1308
|
+
/* function exit code */
|
|
1309
|
+
__pyx_L1_error:;
|
|
1310
|
+
<span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_3);
|
|
1311
|
+
<span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_4);
|
|
1312
|
+
<span class='pyx_c_api'>__Pyx_AddTraceback</span>("datamodel.functions.is_callable", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
1313
|
+
__pyx_r = -1;
|
|
1314
|
+
__pyx_L0:;
|
|
1315
|
+
<span class='refnanny'>__Pyx_RefNannyFinishContext</span>();
|
|
1316
|
+
return __pyx_r;
|
|
1317
|
+
}
|
|
1318
|
+
|
|
1319
|
+
/* Python wrapper */
|
|
1320
|
+
static PyObject *__pyx_pw_9datamodel_9functions_9is_callable(PyObject *__pyx_self,
|
|
1321
|
+
#if CYTHON_METH_FASTCALL
|
|
1322
|
+
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
|
1323
|
+
#else
|
|
1324
|
+
PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
1325
|
+
#endif
|
|
1326
|
+
); /*proto*/
|
|
1327
|
+
<span class='py_macro_api'>PyDoc_STRVAR</span>(__pyx_doc_9datamodel_9functions_8is_callable, "is_callable(value) -> bool\nReturns True if value is a callable object.");
|
|
1328
|
+
static PyMethodDef __pyx_mdef_9datamodel_9functions_9is_callable = {"is_callable", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9datamodel_9functions_9is_callable, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9datamodel_9functions_8is_callable};
|
|
1329
|
+
static PyObject *__pyx_pw_9datamodel_9functions_9is_callable(PyObject *__pyx_self,
|
|
1330
|
+
#if CYTHON_METH_FASTCALL
|
|
1331
|
+
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
|
1332
|
+
#else
|
|
1333
|
+
PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
1334
|
+
#endif
|
|
1335
|
+
) {
|
|
1336
|
+
PyObject *__pyx_v_value = 0;
|
|
1337
|
+
#if !CYTHON_METH_FASTCALL
|
|
1338
|
+
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
|
|
1339
|
+
#endif
|
|
1340
|
+
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
|
|
1341
|
+
PyObject *__pyx_r = 0;
|
|
1342
|
+
<span class='refnanny'>__Pyx_RefNannyDeclarations</span>
|
|
1343
|
+
<span class='refnanny'>__Pyx_RefNannySetupContext</span>("is_callable (wrapper)", 0);
|
|
1344
|
+
#if !CYTHON_METH_FASTCALL
|
|
1345
|
+
#if CYTHON_ASSUME_SAFE_MACROS
|
|
1346
|
+
__pyx_nargs = <span class='py_macro_api'>PyTuple_GET_SIZE</span>(__pyx_args);
|
|
1347
|
+
#else
|
|
1348
|
+
__pyx_nargs = <span class='py_c_api'>PyTuple_Size</span>(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
|
|
1349
|
+
#endif
|
|
1350
|
+
#endif
|
|
1351
|
+
__pyx_kwvalues = <span class='pyx_c_api'>__Pyx_KwValues_FASTCALL</span>(__pyx_args, __pyx_nargs);
|
|
1352
|
+
{
|
|
1353
|
+
PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,0};
|
|
1354
|
+
PyObject* values[1] = {0};
|
|
1355
|
+
if (__pyx_kwds) {
|
|
1356
|
+
Py_ssize_t kw_args;
|
|
1357
|
+
switch (__pyx_nargs) {
|
|
1358
|
+
case 1: values[0] = <span class='pyx_c_api'>__Pyx_Arg_FASTCALL</span>(__pyx_args, 0);
|
|
1359
|
+
CYTHON_FALLTHROUGH;
|
|
1360
|
+
case 0: break;
|
|
1361
|
+
default: goto __pyx_L5_argtuple_error;
|
|
1362
|
+
}
|
|
1363
|
+
kw_args = <span class='pyx_c_api'>__Pyx_NumKwargs_FASTCALL</span>(__pyx_kwds);
|
|
1364
|
+
switch (__pyx_nargs) {
|
|
1365
|
+
case 0:
|
|
1366
|
+
if (likely((values[0] = <span class='pyx_c_api'>__Pyx_GetKwValue_FASTCALL</span>(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) {
|
|
1367
|
+
(void)<span class='pyx_c_api'>__Pyx_Arg_NewRef_FASTCALL</span>(values[0]);
|
|
1368
|
+
kw_args--;
|
|
1369
|
+
}
|
|
1370
|
+
else if (unlikely(<span class='py_c_api'>PyErr_Occurred</span>())) <span class='error_goto'>__PYX_ERR(0, 58, __pyx_L3_error)</span>
|
|
1371
|
+
else goto __pyx_L5_argtuple_error;
|
|
1372
|
+
}
|
|
1373
|
+
if (unlikely(kw_args > 0)) {
|
|
1374
|
+
const Py_ssize_t kwd_pos_args = __pyx_nargs;
|
|
1375
|
+
if (unlikely(<span class='pyx_c_api'>__Pyx_ParseOptionalKeywords</span>(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_callable") < 0)) <span class='error_goto'>__PYX_ERR(0, 58, __pyx_L3_error)</span>
|
|
1376
|
+
}
|
|
1377
|
+
} else if (unlikely(__pyx_nargs != 1)) {
|
|
1378
|
+
goto __pyx_L5_argtuple_error;
|
|
1379
|
+
} else {
|
|
1380
|
+
values[0] = <span class='pyx_c_api'>__Pyx_Arg_FASTCALL</span>(__pyx_args, 0);
|
|
1381
|
+
}
|
|
1382
|
+
__pyx_v_value = values[0];
|
|
1383
|
+
}
|
|
1384
|
+
goto __pyx_L6_skip;
|
|
1385
|
+
__pyx_L5_argtuple_error:;
|
|
1386
|
+
<span class='pyx_c_api'>__Pyx_RaiseArgtupleInvalid</span>("is_callable", 1, 1, 1, __pyx_nargs); <span class='error_goto'>__PYX_ERR(0, 58, __pyx_L3_error)</span>
|
|
1387
|
+
__pyx_L6_skip:;
|
|
1388
|
+
goto __pyx_L4_argument_unpacking_done;
|
|
1389
|
+
__pyx_L3_error:;
|
|
1390
|
+
{
|
|
1391
|
+
Py_ssize_t __pyx_temp;
|
|
1392
|
+
for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
|
|
1393
|
+
<span class='pyx_c_api'>__Pyx_Arg_XDECREF_FASTCALL</span>(values[__pyx_temp]);
|
|
1394
|
+
}
|
|
1395
|
+
}
|
|
1396
|
+
<span class='pyx_c_api'>__Pyx_AddTraceback</span>("datamodel.functions.is_callable", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
1397
|
+
<span class='refnanny'>__Pyx_RefNannyFinishContext</span>();
|
|
1398
|
+
return NULL;
|
|
1399
|
+
__pyx_L4_argument_unpacking_done:;
|
|
1400
|
+
__pyx_r = __pyx_pf_9datamodel_9functions_8is_callable(__pyx_self, __pyx_v_value);
|
|
1401
|
+
int __pyx_lineno = 0;
|
|
1402
|
+
const char *__pyx_filename = NULL;
|
|
1403
|
+
int __pyx_clineno = 0;
|
|
1404
|
+
|
|
1405
|
+
/* function exit code */
|
|
1406
|
+
{
|
|
1407
|
+
Py_ssize_t __pyx_temp;
|
|
1408
|
+
for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
|
|
1409
|
+
<span class='pyx_c_api'>__Pyx_Arg_XDECREF_FASTCALL</span>(values[__pyx_temp]);
|
|
1410
|
+
}
|
|
1411
|
+
}
|
|
1412
|
+
<span class='refnanny'>__Pyx_RefNannyFinishContext</span>();
|
|
1413
|
+
return __pyx_r;
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1416
|
+
static PyObject *__pyx_pf_9datamodel_9functions_8is_callable(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value) {
|
|
1417
|
+
PyObject *__pyx_r = NULL;
|
|
1418
|
+
<span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_r);
|
|
1419
|
+
__pyx_t_1 = __pyx_f_9datamodel_9functions_is_callable(__pyx_v_value, 0); if (unlikely(__pyx_t_1 == ((bool)-1) && <span class='py_c_api'>PyErr_Occurred</span>())) <span class='error_goto'>__PYX_ERR(0, 58, __pyx_L1_error)</span>
|
|
1420
|
+
__pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyBool_FromLong</span>(__pyx_t_1);<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L1_error)</span>
|
|
1421
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
|
|
1422
|
+
__pyx_r = __pyx_t_2;
|
|
1423
|
+
__pyx_t_2 = 0;
|
|
1424
|
+
goto __pyx_L0;
|
|
1425
|
+
|
|
1426
|
+
/* function exit code */
|
|
1427
|
+
__pyx_L1_error:;
|
|
1428
|
+
<span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_2);
|
|
1429
|
+
<span class='pyx_c_api'>__Pyx_AddTraceback</span>("datamodel.functions.is_callable", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
1430
|
+
__pyx_r = NULL;
|
|
1431
|
+
__pyx_L0:;
|
|
1432
|
+
<span class='refnanny'>__Pyx_XGIVEREF</span>(__pyx_r);
|
|
1433
|
+
<span class='refnanny'>__Pyx_RefNannyFinishContext</span>();
|
|
1434
|
+
return __pyx_r;
|
|
1435
|
+
}
|
|
1436
|
+
/* … */
|
|
1437
|
+
__pyx_t_2 = <span class='pyx_c_api'>__Pyx_CyFunction_New</span>(&__pyx_mdef_9datamodel_9functions_9is_callable, 0, __pyx_n_s_is_callable, NULL, __pyx_n_s_datamodel_functions, __pyx_d, ((PyObject *)__pyx_codeobj__11));<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L1_error)</span>
|
|
1438
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
|
|
1439
|
+
if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_is_callable, __pyx_t_2) < 0) <span class='error_goto'>__PYX_ERR(0, 58, __pyx_L1_error)</span>
|
|
1440
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
|
|
1441
|
+
/* … */
|
|
1442
|
+
__pyx_codeobj__11 = (PyObject*)<span class='pyx_c_api'>__Pyx_PyCode_New</span>(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_datamodel_functions_pyx, __pyx_n_s_is_callable, 58, __pyx_empty_bytes);<span class='error_goto'> if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 58, __pyx_L1_error)</span>
|
|
1443
|
+
</pre><pre class="cython line score-0"> <span class="">59</span>: """Returns True if value is a callable object."""</pre>
|
|
1444
|
+
<pre class="cython line score-11" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">60</span>: if value is None or value == _MISSING_TYPE:</pre>
|
|
1445
|
+
<pre class='cython code score-11 '> __pyx_t_2 = (__pyx_v_value == Py_None);
|
|
1446
|
+
if (!__pyx_t_2) {
|
|
1447
|
+
} else {
|
|
1448
|
+
__pyx_t_1 = __pyx_t_2;
|
|
1449
|
+
goto __pyx_L4_bool_binop_done;
|
|
1450
|
+
}
|
|
1451
|
+
<span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_t_3, __pyx_n_s_MISSING_TYPE);<span class='error_goto'> if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 60, __pyx_L1_error)</span>
|
|
1452
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_3);
|
|
1453
|
+
__pyx_t_4 = <span class='py_c_api'>PyObject_RichCompare</span>(__pyx_v_value, __pyx_t_3, Py_EQ); <span class='refnanny'>__Pyx_XGOTREF</span>(__pyx_t_4);<span class='error_goto'> if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 60, __pyx_L1_error)</span>
|
|
1454
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_3); __pyx_t_3 = 0;
|
|
1455
|
+
__pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyObject_IsTrue</span>(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) <span class='error_goto'>__PYX_ERR(0, 60, __pyx_L1_error)</span>
|
|
1456
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
|
|
1457
|
+
__pyx_t_1 = __pyx_t_2;
|
|
1458
|
+
__pyx_L4_bool_binop_done:;
|
|
1459
|
+
if (__pyx_t_1) {
|
|
1460
|
+
/* … */
|
|
1461
|
+
}
|
|
1462
|
+
</pre><pre class="cython line score-0" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">61</span>: return False</pre>
|
|
1463
|
+
<pre class='cython code score-0 '> __pyx_r = 0;
|
|
1464
|
+
goto __pyx_L0;
|
|
1465
|
+
</pre><pre class="cython line score-5" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">62</span>: if is_function(value):</pre>
|
|
1466
|
+
<pre class='cython code score-5 '> __pyx_t_5 = __pyx_f_9datamodel_9functions_is_function(__pyx_v_value, 0); if (unlikely(__pyx_t_5 == ((bool)-1) && <span class='py_c_api'>PyErr_Occurred</span>())) <span class='error_goto'>__PYX_ERR(0, 62, __pyx_L1_error)</span>
|
|
1467
|
+
__pyx_t_1 = (__pyx_t_5 != 0);
|
|
1468
|
+
if (__pyx_t_1) {
|
|
1469
|
+
/* … */
|
|
1470
|
+
}
|
|
1471
|
+
</pre><pre class="cython line score-2" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">63</span>: return callable(value)</pre>
|
|
1472
|
+
<pre class='cython code score-2 '> __pyx_t_1 = <span class='pyx_c_api'>__Pyx_PyCallable_Check</span>(__pyx_v_value);<span class='error_goto'> if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 63, __pyx_L1_error)</span>
|
|
1473
|
+
__pyx_r = __pyx_t_1;
|
|
1474
|
+
goto __pyx_L0;
|
|
1475
|
+
</pre><pre class="cython line score-0" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">64</span>: return False</pre>
|
|
1476
|
+
<pre class='cython code score-0 '> __pyx_r = 0;
|
|
1477
|
+
goto __pyx_L0;
|
|
1478
|
+
</pre><pre class="cython line score-0"> <span class="">65</span>: </pre>
|
|
1479
|
+
<pre class="cython line score-57" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">66</span>: cpdef bool_t is_empty(object value):</pre>
|
|
1480
|
+
<pre class='cython code score-57 '>static PyObject *__pyx_pw_9datamodel_9functions_11is_empty(PyObject *__pyx_self,
|
|
1481
|
+
#if CYTHON_METH_FASTCALL
|
|
1482
|
+
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
|
1483
|
+
#else
|
|
1484
|
+
PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
1485
|
+
#endif
|
|
1486
|
+
); /*proto*/
|
|
1487
|
+
static bool __pyx_f_9datamodel_9functions_is_empty(PyObject *__pyx_v_value, CYTHON_UNUSED int __pyx_skip_dispatch) {
|
|
1488
|
+
bool __pyx_v_result;
|
|
1489
|
+
bool __pyx_r;
|
|
1490
|
+
/* … */
|
|
1491
|
+
/* function exit code */
|
|
1492
|
+
__pyx_L1_error:;
|
|
1493
|
+
<span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_2);
|
|
1494
|
+
<span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_4);
|
|
1495
|
+
<span class='pyx_c_api'>__Pyx_AddTraceback</span>("datamodel.functions.is_empty", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
1496
|
+
__pyx_r = -1;
|
|
1497
|
+
__pyx_L0:;
|
|
1498
|
+
<span class='refnanny'>__Pyx_RefNannyFinishContext</span>();
|
|
1499
|
+
return __pyx_r;
|
|
1500
|
+
}
|
|
1501
|
+
|
|
1502
|
+
/* Python wrapper */
|
|
1503
|
+
static PyObject *__pyx_pw_9datamodel_9functions_11is_empty(PyObject *__pyx_self,
|
|
1504
|
+
#if CYTHON_METH_FASTCALL
|
|
1505
|
+
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
|
1506
|
+
#else
|
|
1507
|
+
PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
1508
|
+
#endif
|
|
1509
|
+
); /*proto*/
|
|
1510
|
+
<span class='py_macro_api'>PyDoc_STRVAR</span>(__pyx_doc_9datamodel_9functions_10is_empty, "is_empty(value) -> bool");
|
|
1511
|
+
static PyMethodDef __pyx_mdef_9datamodel_9functions_11is_empty = {"is_empty", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9datamodel_9functions_11is_empty, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9datamodel_9functions_10is_empty};
|
|
1512
|
+
static PyObject *__pyx_pw_9datamodel_9functions_11is_empty(PyObject *__pyx_self,
|
|
1513
|
+
#if CYTHON_METH_FASTCALL
|
|
1514
|
+
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
|
1515
|
+
#else
|
|
1516
|
+
PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
1517
|
+
#endif
|
|
1518
|
+
) {
|
|
1519
|
+
PyObject *__pyx_v_value = 0;
|
|
1520
|
+
#if !CYTHON_METH_FASTCALL
|
|
1521
|
+
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
|
|
1522
|
+
#endif
|
|
1523
|
+
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
|
|
1524
|
+
PyObject *__pyx_r = 0;
|
|
1525
|
+
<span class='refnanny'>__Pyx_RefNannyDeclarations</span>
|
|
1526
|
+
<span class='refnanny'>__Pyx_RefNannySetupContext</span>("is_empty (wrapper)", 0);
|
|
1527
|
+
#if !CYTHON_METH_FASTCALL
|
|
1528
|
+
#if CYTHON_ASSUME_SAFE_MACROS
|
|
1529
|
+
__pyx_nargs = <span class='py_macro_api'>PyTuple_GET_SIZE</span>(__pyx_args);
|
|
1530
|
+
#else
|
|
1531
|
+
__pyx_nargs = <span class='py_c_api'>PyTuple_Size</span>(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
|
|
1532
|
+
#endif
|
|
1533
|
+
#endif
|
|
1534
|
+
__pyx_kwvalues = <span class='pyx_c_api'>__Pyx_KwValues_FASTCALL</span>(__pyx_args, __pyx_nargs);
|
|
1535
|
+
{
|
|
1536
|
+
PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,0};
|
|
1537
|
+
PyObject* values[1] = {0};
|
|
1538
|
+
if (__pyx_kwds) {
|
|
1539
|
+
Py_ssize_t kw_args;
|
|
1540
|
+
switch (__pyx_nargs) {
|
|
1541
|
+
case 1: values[0] = <span class='pyx_c_api'>__Pyx_Arg_FASTCALL</span>(__pyx_args, 0);
|
|
1542
|
+
CYTHON_FALLTHROUGH;
|
|
1543
|
+
case 0: break;
|
|
1544
|
+
default: goto __pyx_L5_argtuple_error;
|
|
1545
|
+
}
|
|
1546
|
+
kw_args = <span class='pyx_c_api'>__Pyx_NumKwargs_FASTCALL</span>(__pyx_kwds);
|
|
1547
|
+
switch (__pyx_nargs) {
|
|
1548
|
+
case 0:
|
|
1549
|
+
if (likely((values[0] = <span class='pyx_c_api'>__Pyx_GetKwValue_FASTCALL</span>(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) {
|
|
1550
|
+
(void)<span class='pyx_c_api'>__Pyx_Arg_NewRef_FASTCALL</span>(values[0]);
|
|
1551
|
+
kw_args--;
|
|
1552
|
+
}
|
|
1553
|
+
else if (unlikely(<span class='py_c_api'>PyErr_Occurred</span>())) <span class='error_goto'>__PYX_ERR(0, 66, __pyx_L3_error)</span>
|
|
1554
|
+
else goto __pyx_L5_argtuple_error;
|
|
1555
|
+
}
|
|
1556
|
+
if (unlikely(kw_args > 0)) {
|
|
1557
|
+
const Py_ssize_t kwd_pos_args = __pyx_nargs;
|
|
1558
|
+
if (unlikely(<span class='pyx_c_api'>__Pyx_ParseOptionalKeywords</span>(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "is_empty") < 0)) <span class='error_goto'>__PYX_ERR(0, 66, __pyx_L3_error)</span>
|
|
1559
|
+
}
|
|
1560
|
+
} else if (unlikely(__pyx_nargs != 1)) {
|
|
1561
|
+
goto __pyx_L5_argtuple_error;
|
|
1562
|
+
} else {
|
|
1563
|
+
values[0] = <span class='pyx_c_api'>__Pyx_Arg_FASTCALL</span>(__pyx_args, 0);
|
|
1564
|
+
}
|
|
1565
|
+
__pyx_v_value = values[0];
|
|
1566
|
+
}
|
|
1567
|
+
goto __pyx_L6_skip;
|
|
1568
|
+
__pyx_L5_argtuple_error:;
|
|
1569
|
+
<span class='pyx_c_api'>__Pyx_RaiseArgtupleInvalid</span>("is_empty", 1, 1, 1, __pyx_nargs); <span class='error_goto'>__PYX_ERR(0, 66, __pyx_L3_error)</span>
|
|
1570
|
+
__pyx_L6_skip:;
|
|
1571
|
+
goto __pyx_L4_argument_unpacking_done;
|
|
1572
|
+
__pyx_L3_error:;
|
|
1573
|
+
{
|
|
1574
|
+
Py_ssize_t __pyx_temp;
|
|
1575
|
+
for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
|
|
1576
|
+
<span class='pyx_c_api'>__Pyx_Arg_XDECREF_FASTCALL</span>(values[__pyx_temp]);
|
|
1577
|
+
}
|
|
1578
|
+
}
|
|
1579
|
+
<span class='pyx_c_api'>__Pyx_AddTraceback</span>("datamodel.functions.is_empty", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
1580
|
+
<span class='refnanny'>__Pyx_RefNannyFinishContext</span>();
|
|
1581
|
+
return NULL;
|
|
1582
|
+
__pyx_L4_argument_unpacking_done:;
|
|
1583
|
+
__pyx_r = __pyx_pf_9datamodel_9functions_10is_empty(__pyx_self, __pyx_v_value);
|
|
1584
|
+
int __pyx_lineno = 0;
|
|
1585
|
+
const char *__pyx_filename = NULL;
|
|
1586
|
+
int __pyx_clineno = 0;
|
|
1587
|
+
|
|
1588
|
+
/* function exit code */
|
|
1589
|
+
{
|
|
1590
|
+
Py_ssize_t __pyx_temp;
|
|
1591
|
+
for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
|
|
1592
|
+
<span class='pyx_c_api'>__Pyx_Arg_XDECREF_FASTCALL</span>(values[__pyx_temp]);
|
|
1593
|
+
}
|
|
1594
|
+
}
|
|
1595
|
+
<span class='refnanny'>__Pyx_RefNannyFinishContext</span>();
|
|
1596
|
+
return __pyx_r;
|
|
1597
|
+
}
|
|
1598
|
+
|
|
1599
|
+
static PyObject *__pyx_pf_9datamodel_9functions_10is_empty(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value) {
|
|
1600
|
+
PyObject *__pyx_r = NULL;
|
|
1601
|
+
<span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_r);
|
|
1602
|
+
__pyx_t_1 = __pyx_f_9datamodel_9functions_is_empty(__pyx_v_value, 0); if (unlikely(__pyx_t_1 == ((bool)-1) && <span class='py_c_api'>PyErr_Occurred</span>())) <span class='error_goto'>__PYX_ERR(0, 66, __pyx_L1_error)</span>
|
|
1603
|
+
__pyx_t_2 = <span class='pyx_c_api'>__Pyx_PyBool_FromLong</span>(__pyx_t_1);<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 66, __pyx_L1_error)</span>
|
|
1604
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
|
|
1605
|
+
__pyx_r = __pyx_t_2;
|
|
1606
|
+
__pyx_t_2 = 0;
|
|
1607
|
+
goto __pyx_L0;
|
|
1608
|
+
|
|
1609
|
+
/* function exit code */
|
|
1610
|
+
__pyx_L1_error:;
|
|
1611
|
+
<span class='pyx_macro_api'>__Pyx_XDECREF</span>(__pyx_t_2);
|
|
1612
|
+
<span class='pyx_c_api'>__Pyx_AddTraceback</span>("datamodel.functions.is_empty", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
1613
|
+
__pyx_r = NULL;
|
|
1614
|
+
__pyx_L0:;
|
|
1615
|
+
<span class='refnanny'>__Pyx_XGIVEREF</span>(__pyx_r);
|
|
1616
|
+
<span class='refnanny'>__Pyx_RefNannyFinishContext</span>();
|
|
1617
|
+
return __pyx_r;
|
|
1618
|
+
}
|
|
1619
|
+
/* … */
|
|
1620
|
+
__pyx_t_2 = <span class='pyx_c_api'>__Pyx_CyFunction_New</span>(&__pyx_mdef_9datamodel_9functions_11is_empty, 0, __pyx_n_s_is_empty, NULL, __pyx_n_s_datamodel_functions, __pyx_d, ((PyObject *)__pyx_codeobj__12));<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 66, __pyx_L1_error)</span>
|
|
1621
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
|
|
1622
|
+
if (<span class='py_c_api'>PyDict_SetItem</span>(__pyx_d, __pyx_n_s_is_empty, __pyx_t_2) < 0) <span class='error_goto'>__PYX_ERR(0, 66, __pyx_L1_error)</span>
|
|
1623
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
|
|
1624
|
+
</pre><pre class="cython line score-0" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">67</span>: cdef bool_t result = False</pre>
|
|
1625
|
+
<pre class='cython code score-0 '> __pyx_v_result = 0;
|
|
1626
|
+
</pre><pre class="cython line score-0" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">68</span>: if value is None:</pre>
|
|
1627
|
+
<pre class='cython code score-0 '> __pyx_t_1 = (__pyx_v_value == Py_None);
|
|
1628
|
+
if (__pyx_t_1) {
|
|
1629
|
+
/* … */
|
|
1630
|
+
}
|
|
1631
|
+
</pre><pre class="cython line score-0" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">69</span>: return True</pre>
|
|
1632
|
+
<pre class='cython code score-0 '> __pyx_r = 1;
|
|
1633
|
+
goto __pyx_L0;
|
|
1634
|
+
</pre><pre class="cython line score-19" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">70</span>: if isinstance(value, _MISSING_TYPE) or value == _MISSING_TYPE:</pre>
|
|
1635
|
+
<pre class='cython code score-19 '> <span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_t_2, __pyx_n_s_MISSING_TYPE);<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error)</span>
|
|
1636
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
|
|
1637
|
+
__pyx_t_3 = <span class='py_c_api'>PyObject_IsInstance</span>(__pyx_v_value, __pyx_t_2);<span class='error_goto'> if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 70, __pyx_L1_error)</span>
|
|
1638
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
|
|
1639
|
+
if (!__pyx_t_3) {
|
|
1640
|
+
} else {
|
|
1641
|
+
__pyx_t_1 = __pyx_t_3;
|
|
1642
|
+
goto __pyx_L5_bool_binop_done;
|
|
1643
|
+
}
|
|
1644
|
+
<span class='pyx_c_api'>__Pyx_GetModuleGlobalName</span>(__pyx_t_2, __pyx_n_s_MISSING_TYPE);<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error)</span>
|
|
1645
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
|
|
1646
|
+
__pyx_t_4 = <span class='py_c_api'>PyObject_RichCompare</span>(__pyx_v_value, __pyx_t_2, Py_EQ); <span class='refnanny'>__Pyx_XGOTREF</span>(__pyx_t_4);<span class='error_goto'> if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 70, __pyx_L1_error)</span>
|
|
1647
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
|
|
1648
|
+
__pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_IsTrue</span>(__pyx_t_4); if (unlikely((__pyx_t_3 < 0))) <span class='error_goto'>__PYX_ERR(0, 70, __pyx_L1_error)</span>
|
|
1649
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
|
|
1650
|
+
__pyx_t_1 = __pyx_t_3;
|
|
1651
|
+
__pyx_L5_bool_binop_done:;
|
|
1652
|
+
if (__pyx_t_1) {
|
|
1653
|
+
/* … */
|
|
1654
|
+
goto __pyx_L4;
|
|
1655
|
+
}
|
|
1656
|
+
</pre><pre class="cython line score-0" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">71</span>: result = True</pre>
|
|
1657
|
+
<pre class='cython code score-0 '> __pyx_v_result = 1;
|
|
1658
|
+
</pre><pre class="cython line score-7" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">72</span>: elif isinstance(value, str) and value == '':</pre>
|
|
1659
|
+
<pre class='cython code score-7 '> __pyx_t_3 = <span class='py_c_api'>PyUnicode_Check</span>(__pyx_v_value);
|
|
1660
|
+
if (__pyx_t_3) {
|
|
1661
|
+
} else {
|
|
1662
|
+
__pyx_t_1 = __pyx_t_3;
|
|
1663
|
+
goto __pyx_L7_bool_binop_done;
|
|
1664
|
+
}
|
|
1665
|
+
__pyx_t_3 = (<span class='pyx_c_api'>__Pyx_PyUnicode_Equals</span>(__pyx_v_value, __pyx_kp_u_, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) <span class='error_goto'>__PYX_ERR(0, 72, __pyx_L1_error)</span>
|
|
1666
|
+
__pyx_t_1 = __pyx_t_3;
|
|
1667
|
+
__pyx_L7_bool_binop_done:;
|
|
1668
|
+
if (__pyx_t_1) {
|
|
1669
|
+
/* … */
|
|
1670
|
+
goto __pyx_L4;
|
|
1671
|
+
}
|
|
1672
|
+
</pre><pre class="cython line score-0" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">73</span>: result = True</pre>
|
|
1673
|
+
<pre class='cython code score-0 '> __pyx_v_result = 1;
|
|
1674
|
+
</pre><pre class="cython line score-12" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">74</span>: elif isinstance(value, (int, float)) and value == 0:</pre>
|
|
1675
|
+
<pre class='cython code score-12 '> __pyx_t_5 = <span class='py_c_api'>PyInt_Check</span>(__pyx_v_value);
|
|
1676
|
+
if (!__pyx_t_5) {
|
|
1677
|
+
} else {
|
|
1678
|
+
__pyx_t_3 = __pyx_t_5;
|
|
1679
|
+
goto __pyx_L11_bool_binop_done;
|
|
1680
|
+
}
|
|
1681
|
+
__pyx_t_5 = <span class='py_c_api'>PyFloat_Check</span>(__pyx_v_value);
|
|
1682
|
+
__pyx_t_3 = __pyx_t_5;
|
|
1683
|
+
__pyx_L11_bool_binop_done:;
|
|
1684
|
+
if (__pyx_t_3) {
|
|
1685
|
+
} else {
|
|
1686
|
+
__pyx_t_1 = __pyx_t_3;
|
|
1687
|
+
goto __pyx_L9_bool_binop_done;
|
|
1688
|
+
}
|
|
1689
|
+
__pyx_t_3 = (<span class='pyx_c_api'>__Pyx_PyInt_BoolEqObjC</span>(__pyx_v_value, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_3 < 0))) <span class='error_goto'>__PYX_ERR(0, 74, __pyx_L1_error)</span>
|
|
1690
|
+
__pyx_t_1 = __pyx_t_3;
|
|
1691
|
+
__pyx_L9_bool_binop_done:;
|
|
1692
|
+
if (__pyx_t_1) {
|
|
1693
|
+
/* … */
|
|
1694
|
+
goto __pyx_L4;
|
|
1695
|
+
}
|
|
1696
|
+
</pre><pre class="cython line score-0" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">75</span>: result = False</pre>
|
|
1697
|
+
<pre class='cython code score-0 '> __pyx_v_result = 0;
|
|
1698
|
+
</pre><pre class="cython line score-16" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">76</span>: elif isinstance(value, dict) and value == {}:</pre>
|
|
1699
|
+
<pre class='cython code score-16 '> __pyx_t_3 = <span class='py_c_api'>PyDict_Check</span>(__pyx_v_value);
|
|
1700
|
+
if (__pyx_t_3) {
|
|
1701
|
+
} else {
|
|
1702
|
+
__pyx_t_1 = __pyx_t_3;
|
|
1703
|
+
goto __pyx_L13_bool_binop_done;
|
|
1704
|
+
}
|
|
1705
|
+
__pyx_t_4 = <span class='pyx_c_api'>__Pyx_PyDict_NewPresized</span>(0);<span class='error_goto'> if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 76, __pyx_L1_error)</span>
|
|
1706
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_4);
|
|
1707
|
+
__pyx_t_2 = <span class='py_c_api'>PyObject_RichCompare</span>(__pyx_v_value, __pyx_t_4, Py_EQ); <span class='refnanny'>__Pyx_XGOTREF</span>(__pyx_t_2);<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error)</span>
|
|
1708
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
|
|
1709
|
+
__pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_IsTrue</span>(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) <span class='error_goto'>__PYX_ERR(0, 76, __pyx_L1_error)</span>
|
|
1710
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
|
|
1711
|
+
__pyx_t_1 = __pyx_t_3;
|
|
1712
|
+
__pyx_L13_bool_binop_done:;
|
|
1713
|
+
if (__pyx_t_1) {
|
|
1714
|
+
/* … */
|
|
1715
|
+
goto __pyx_L4;
|
|
1716
|
+
}
|
|
1717
|
+
</pre><pre class="cython line score-0" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">77</span>: result = False</pre>
|
|
1718
|
+
<pre class='cython code score-0 '> __pyx_v_result = 0;
|
|
1719
|
+
</pre><pre class="cython line score-29" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">78</span>: elif isinstance(value, (list, tuple, set)) and value == []:</pre>
|
|
1720
|
+
<pre class='cython code score-29 '> __pyx_t_5 = <span class='py_c_api'>PyList_Check</span>(__pyx_v_value);
|
|
1721
|
+
if (!__pyx_t_5) {
|
|
1722
|
+
} else {
|
|
1723
|
+
__pyx_t_3 = __pyx_t_5;
|
|
1724
|
+
goto __pyx_L17_bool_binop_done;
|
|
1725
|
+
}
|
|
1726
|
+
__pyx_t_5 = <span class='py_c_api'>PyTuple_Check</span>(__pyx_v_value);
|
|
1727
|
+
if (!__pyx_t_5) {
|
|
1728
|
+
} else {
|
|
1729
|
+
__pyx_t_3 = __pyx_t_5;
|
|
1730
|
+
goto __pyx_L17_bool_binop_done;
|
|
1731
|
+
}
|
|
1732
|
+
__pyx_t_5 = <span class='py_c_api'>PySet_Check</span>(__pyx_v_value);
|
|
1733
|
+
__pyx_t_3 = __pyx_t_5;
|
|
1734
|
+
__pyx_L17_bool_binop_done:;
|
|
1735
|
+
if (__pyx_t_3) {
|
|
1736
|
+
} else {
|
|
1737
|
+
__pyx_t_1 = __pyx_t_3;
|
|
1738
|
+
goto __pyx_L15_bool_binop_done;
|
|
1739
|
+
}
|
|
1740
|
+
__pyx_t_2 = <span class='py_c_api'>PyList_New</span>(0);<span class='error_goto'> if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 78, __pyx_L1_error)</span>
|
|
1741
|
+
<span class='refnanny'>__Pyx_GOTREF</span>(__pyx_t_2);
|
|
1742
|
+
__pyx_t_4 = <span class='py_c_api'>PyObject_RichCompare</span>(__pyx_v_value, __pyx_t_2, Py_EQ); <span class='refnanny'>__Pyx_XGOTREF</span>(__pyx_t_4);<span class='error_goto'> if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 78, __pyx_L1_error)</span>
|
|
1743
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_2); __pyx_t_2 = 0;
|
|
1744
|
+
__pyx_t_3 = <span class='pyx_c_api'>__Pyx_PyObject_IsTrue</span>(__pyx_t_4); if (unlikely((__pyx_t_3 < 0))) <span class='error_goto'>__PYX_ERR(0, 78, __pyx_L1_error)</span>
|
|
1745
|
+
<span class='pyx_macro_api'>__Pyx_DECREF</span>(__pyx_t_4); __pyx_t_4 = 0;
|
|
1746
|
+
__pyx_t_1 = __pyx_t_3;
|
|
1747
|
+
__pyx_L15_bool_binop_done:;
|
|
1748
|
+
if (__pyx_t_1) {
|
|
1749
|
+
/* … */
|
|
1750
|
+
goto __pyx_L4;
|
|
1751
|
+
}
|
|
1752
|
+
</pre><pre class="cython line score-0" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">79</span>: result = False</pre>
|
|
1753
|
+
<pre class='cython code score-0 '> __pyx_v_result = 0;
|
|
1754
|
+
</pre><pre class="cython line score-2" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">80</span>: elif not value:</pre>
|
|
1755
|
+
<pre class='cython code score-2 '> __pyx_t_1 = <span class='pyx_c_api'>__Pyx_PyObject_IsTrue</span>(__pyx_v_value); if (unlikely((__pyx_t_1 < 0))) <span class='error_goto'>__PYX_ERR(0, 80, __pyx_L1_error)</span>
|
|
1756
|
+
__pyx_t_3 = (!__pyx_t_1);
|
|
1757
|
+
if (__pyx_t_3) {
|
|
1758
|
+
/* … */
|
|
1759
|
+
}
|
|
1760
|
+
__pyx_L4:;
|
|
1761
|
+
</pre><pre class="cython line score-0" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">81</span>: result = True</pre>
|
|
1762
|
+
<pre class='cython code score-0 '> __pyx_v_result = 1;
|
|
1763
|
+
</pre><pre class="cython line score-0" onclick="(function(s){s.display=s.display==='block'?'none':'block'})(this.nextElementSibling.style)">+<span class="">82</span>: return result</pre>
|
|
1764
|
+
<pre class='cython code score-0 '> __pyx_r = __pyx_v_result;
|
|
1765
|
+
goto __pyx_L0;
|
|
1766
|
+
</pre></div></body></html>
|