1 /* Generated by Cython 0.29.23 */
2
3 #ifndef PY_SSIZE_T_CLEAN
4 #define PY_SSIZE_T_CLEAN
5 #endif /* PY_SSIZE_T_CLEAN */
6 #include "Python.h"
7 #ifndef Py_PYTHON_H
8 #error Python headers needed to compile C extensions, please install development version of Python.
9 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
10 #error Cython requires Python 2.6+ or Python 3.3+.
11 #else
12 #define CYTHON_ABI "0_29_23"
13 #define CYTHON_HEX_VERSION 0x001D17F0
14 #define CYTHON_FUTURE_DIVISION 1
15 #include <stddef.h>
16 #ifndef offsetof
17 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
18 #endif
19 #if !defined(WIN32) && !defined(MS_WINDOWS)
20 #ifndef __stdcall
21 #define __stdcall
22 #endif
23 #ifndef __cdecl
24 #define __cdecl
25 #endif
26 #ifndef __fastcall
27 #define __fastcall
28 #endif
29 #endif
30 #ifndef DL_IMPORT
31 #define DL_IMPORT(t) t
32 #endif
33 #ifndef DL_EXPORT
34 #define DL_EXPORT(t) t
35 #endif
36 #define __PYX_COMMA ,
37 #ifndef HAVE_LONG_LONG
38 #if PY_VERSION_HEX >= 0x02070000
39 #define HAVE_LONG_LONG
40 #endif
41 #endif
42 #ifndef PY_LONG_LONG
43 #define PY_LONG_LONG LONG_LONG
44 #endif
45 #ifndef Py_HUGE_VAL
46 #define Py_HUGE_VAL HUGE_VAL
47 #endif
48 #ifdef PYPY_VERSION
49 #define CYTHON_COMPILING_IN_PYPY 1
50 #define CYTHON_COMPILING_IN_PYSTON 0
51 #define CYTHON_COMPILING_IN_CPYTHON 0
52 #undef CYTHON_USE_TYPE_SLOTS
53 #define CYTHON_USE_TYPE_SLOTS 0
54 #undef CYTHON_USE_PYTYPE_LOOKUP
55 #define CYTHON_USE_PYTYPE_LOOKUP 0
56 #if PY_VERSION_HEX < 0x03050000
57 #undef CYTHON_USE_ASYNC_SLOTS
58 #define CYTHON_USE_ASYNC_SLOTS 0
59 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
60 #define CYTHON_USE_ASYNC_SLOTS 1
61 #endif
62 #undef CYTHON_USE_PYLIST_INTERNALS
63 #define CYTHON_USE_PYLIST_INTERNALS 0
64 #undef CYTHON_USE_UNICODE_INTERNALS
65 #define CYTHON_USE_UNICODE_INTERNALS 0
66 #undef CYTHON_USE_UNICODE_WRITER
67 #define CYTHON_USE_UNICODE_WRITER 0
68 #undef CYTHON_USE_PYLONG_INTERNALS
69 #define CYTHON_USE_PYLONG_INTERNALS 0
70 #undef CYTHON_AVOID_BORROWED_REFS
71 #define CYTHON_AVOID_BORROWED_REFS 1
72 #undef CYTHON_ASSUME_SAFE_MACROS
73 #define CYTHON_ASSUME_SAFE_MACROS 0
74 #undef CYTHON_UNPACK_METHODS
75 #define CYTHON_UNPACK_METHODS 0
76 #undef CYTHON_FAST_THREAD_STATE
77 #define CYTHON_FAST_THREAD_STATE 0
78 #undef CYTHON_FAST_PYCALL
79 #define CYTHON_FAST_PYCALL 0
80 #undef CYTHON_PEP489_MULTI_PHASE_INIT
81 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
82 #undef CYTHON_USE_TP_FINALIZE
83 #define CYTHON_USE_TP_FINALIZE 0
84 #undef CYTHON_USE_DICT_VERSIONS
85 #define CYTHON_USE_DICT_VERSIONS 0
86 #undef CYTHON_USE_EXC_INFO_STACK
87 #define CYTHON_USE_EXC_INFO_STACK 0
88 #elif defined(PYSTON_VERSION)
89 #define CYTHON_COMPILING_IN_PYPY 0
90 #define CYTHON_COMPILING_IN_PYSTON 1
91 #define CYTHON_COMPILING_IN_CPYTHON 0
92 #ifndef CYTHON_USE_TYPE_SLOTS
93 #define CYTHON_USE_TYPE_SLOTS 1
94 #endif
95 #undef CYTHON_USE_PYTYPE_LOOKUP
96 #define CYTHON_USE_PYTYPE_LOOKUP 0
97 #undef CYTHON_USE_ASYNC_SLOTS
98 #define CYTHON_USE_ASYNC_SLOTS 0
99 #undef CYTHON_USE_PYLIST_INTERNALS
100 #define CYTHON_USE_PYLIST_INTERNALS 0
101 #ifndef CYTHON_USE_UNICODE_INTERNALS
102 #define CYTHON_USE_UNICODE_INTERNALS 1
103 #endif
104 #undef CYTHON_USE_UNICODE_WRITER
105 #define CYTHON_USE_UNICODE_WRITER 0
106 #undef CYTHON_USE_PYLONG_INTERNALS
107 #define CYTHON_USE_PYLONG_INTERNALS 0
108 #ifndef CYTHON_AVOID_BORROWED_REFS
109 #define CYTHON_AVOID_BORROWED_REFS 0
110 #endif
111 #ifndef CYTHON_ASSUME_SAFE_MACROS
112 #define CYTHON_ASSUME_SAFE_MACROS 1
113 #endif
114 #ifndef CYTHON_UNPACK_METHODS
115 #define CYTHON_UNPACK_METHODS 1
116 #endif
117 #undef CYTHON_FAST_THREAD_STATE
118 #define CYTHON_FAST_THREAD_STATE 0
119 #undef CYTHON_FAST_PYCALL
120 #define CYTHON_FAST_PYCALL 0
121 #undef CYTHON_PEP489_MULTI_PHASE_INIT
122 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
123 #undef CYTHON_USE_TP_FINALIZE
124 #define CYTHON_USE_TP_FINALIZE 0
125 #undef CYTHON_USE_DICT_VERSIONS
126 #define CYTHON_USE_DICT_VERSIONS 0
127 #undef CYTHON_USE_EXC_INFO_STACK
128 #define CYTHON_USE_EXC_INFO_STACK 0
129 #else
130 #define CYTHON_COMPILING_IN_PYPY 0
131 #define CYTHON_COMPILING_IN_PYSTON 0
132 #define CYTHON_COMPILING_IN_CPYTHON 1
133 #ifndef CYTHON_USE_TYPE_SLOTS
134 #define CYTHON_USE_TYPE_SLOTS 1
135 #endif
136 #if PY_VERSION_HEX < 0x02070000
137 #undef CYTHON_USE_PYTYPE_LOOKUP
138 #define CYTHON_USE_PYTYPE_LOOKUP 0
139 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
140 #define CYTHON_USE_PYTYPE_LOOKUP 1
141 #endif
142 #if PY_MAJOR_VERSION < 3
143 #undef CYTHON_USE_ASYNC_SLOTS
144 #define CYTHON_USE_ASYNC_SLOTS 0
145 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
146 #define CYTHON_USE_ASYNC_SLOTS 1
147 #endif
148 #if PY_VERSION_HEX < 0x02070000
149 #undef CYTHON_USE_PYLONG_INTERNALS
150 #define CYTHON_USE_PYLONG_INTERNALS 0
151 #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
152 #define CYTHON_USE_PYLONG_INTERNALS 1
153 #endif
154 #ifndef CYTHON_USE_PYLIST_INTERNALS
155 #define CYTHON_USE_PYLIST_INTERNALS 1
156 #endif
157 #ifndef CYTHON_USE_UNICODE_INTERNALS
158 #define CYTHON_USE_UNICODE_INTERNALS 1
159 #endif
160 #if PY_VERSION_HEX < 0x030300F0
161 #undef CYTHON_USE_UNICODE_WRITER
162 #define CYTHON_USE_UNICODE_WRITER 0
163 #elif !defined(CYTHON_USE_UNICODE_WRITER)
164 #define CYTHON_USE_UNICODE_WRITER 1
165 #endif
166 #ifndef CYTHON_AVOID_BORROWED_REFS
167 #define CYTHON_AVOID_BORROWED_REFS 0
168 #endif
169 #ifndef CYTHON_ASSUME_SAFE_MACROS
170 #define CYTHON_ASSUME_SAFE_MACROS 1
171 #endif
172 #ifndef CYTHON_UNPACK_METHODS
173 #define CYTHON_UNPACK_METHODS 1
174 #endif
175 #ifndef CYTHON_FAST_THREAD_STATE
176 #define CYTHON_FAST_THREAD_STATE 1
177 #endif
178 #ifndef CYTHON_FAST_PYCALL
179 #define CYTHON_FAST_PYCALL 1
180 #endif
181 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
182 #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
183 #endif
184 #ifndef CYTHON_USE_TP_FINALIZE
185 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
186 #endif
187 #ifndef CYTHON_USE_DICT_VERSIONS
188 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
189 #endif
190 #ifndef CYTHON_USE_EXC_INFO_STACK
191 #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
192 #endif
193 #endif
194 #if !defined(CYTHON_FAST_PYCCALL)
195 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
196 #endif
197 #if CYTHON_USE_PYLONG_INTERNALS
198 #include "longintrepr.h"
199 #undef SHIFT
200 #undef BASE
201 #undef MASK
202 #ifdef SIZEOF_VOID_P
203 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
204 #endif
205 #endif
206 #ifndef __has_attribute
207 #define __has_attribute(x) 0
208 #endif
209 #ifndef __has_cpp_attribute
210 #define __has_cpp_attribute(x) 0
211 #endif
212 #ifndef CYTHON_RESTRICT
213 #if defined(__GNUC__)
214 #define CYTHON_RESTRICT __restrict__
215 #elif defined(_MSC_VER) && _MSC_VER >= 1400
216 #define CYTHON_RESTRICT __restrict
217 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
218 #define CYTHON_RESTRICT restrict
219 #else
220 #define CYTHON_RESTRICT
221 #endif
222 #endif
223 #ifndef CYTHON_UNUSED
224 # if defined(__GNUC__)
225 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
226 # define CYTHON_UNUSED __attribute__ ((__unused__))
227 # else
228 # define CYTHON_UNUSED
229 # endif
230 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
231 # define CYTHON_UNUSED __attribute__ ((__unused__))
232 # else
233 # define CYTHON_UNUSED
234 # endif
235 #endif
236 #ifndef CYTHON_MAYBE_UNUSED_VAR
237 # if defined(__cplusplus)
CYTHON_MAYBE_UNUSED_VAR(const T &)238 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
239 # else
240 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
241 # endif
242 #endif
243 #ifndef CYTHON_NCP_UNUSED
244 # if CYTHON_COMPILING_IN_CPYTHON
245 # define CYTHON_NCP_UNUSED
246 # else
247 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
248 # endif
249 #endif
250 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
251 #ifdef _MSC_VER
252 #ifndef _MSC_STDINT_H_
253 #if _MSC_VER < 1300
254 typedef unsigned char uint8_t;
255 typedef unsigned int uint32_t;
256 #else
257 typedef unsigned __int8 uint8_t;
258 typedef unsigned __int32 uint32_t;
259 #endif
260 #endif
261 #else
262 #include <stdint.h>
263 #endif
264 #ifndef CYTHON_FALLTHROUGH
265 #if defined(__cplusplus) && __cplusplus >= 201103L
266 #if __has_cpp_attribute(fallthrough)
267 #define CYTHON_FALLTHROUGH [[fallthrough]]
268 #elif __has_cpp_attribute(clang::fallthrough)
269 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
270 #elif __has_cpp_attribute(gnu::fallthrough)
271 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
272 #endif
273 #endif
274 #ifndef CYTHON_FALLTHROUGH
275 #if __has_attribute(fallthrough)
276 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
277 #else
278 #define CYTHON_FALLTHROUGH
279 #endif
280 #endif
281 #if defined(__clang__ ) && defined(__apple_build_version__)
282 #if __apple_build_version__ < 7000000
283 #undef CYTHON_FALLTHROUGH
284 #define CYTHON_FALLTHROUGH
285 #endif
286 #endif
287 #endif
288
289 #ifndef CYTHON_INLINE
290 #if defined(__clang__)
291 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
292 #elif defined(__GNUC__)
293 #define CYTHON_INLINE __inline__
294 #elif defined(_MSC_VER)
295 #define CYTHON_INLINE __inline
296 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
297 #define CYTHON_INLINE inline
298 #else
299 #define CYTHON_INLINE
300 #endif
301 #endif
302
303 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
304 #define Py_OptimizeFlag 0
305 #endif
306 #define __PYX_BUILD_PY_SSIZE_T "n"
307 #define CYTHON_FORMAT_SSIZE_T "z"
308 #if PY_MAJOR_VERSION < 3
309 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
310 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
311 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
312 #define __Pyx_DefaultClassType PyClass_Type
313 #else
314 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
315 #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
316 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
317 PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
318 #else
319 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
320 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
321 #endif
322 #define __Pyx_DefaultClassType PyType_Type
323 #endif
324 #ifndef Py_TPFLAGS_CHECKTYPES
325 #define Py_TPFLAGS_CHECKTYPES 0
326 #endif
327 #ifndef Py_TPFLAGS_HAVE_INDEX
328 #define Py_TPFLAGS_HAVE_INDEX 0
329 #endif
330 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
331 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
332 #endif
333 #ifndef Py_TPFLAGS_HAVE_FINALIZE
334 #define Py_TPFLAGS_HAVE_FINALIZE 0
335 #endif
336 #ifndef METH_STACKLESS
337 #define METH_STACKLESS 0
338 #endif
339 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
340 #ifndef METH_FASTCALL
341 #define METH_FASTCALL 0x80
342 #endif
343 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
344 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
345 Py_ssize_t nargs, PyObject *kwnames);
346 #else
347 #define __Pyx_PyCFunctionFast _PyCFunctionFast
348 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
349 #endif
350 #if CYTHON_FAST_PYCCALL
351 #define __Pyx_PyFastCFunction_Check(func)\
352 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
353 #else
354 #define __Pyx_PyFastCFunction_Check(func) 0
355 #endif
356 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
357 #define PyObject_Malloc(s) PyMem_Malloc(s)
358 #define PyObject_Free(p) PyMem_Free(p)
359 #define PyObject_Realloc(p) PyMem_Realloc(p)
360 #endif
361 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
362 #define PyMem_RawMalloc(n) PyMem_Malloc(n)
363 #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
364 #define PyMem_RawFree(p) PyMem_Free(p)
365 #endif
366 #if CYTHON_COMPILING_IN_PYSTON
367 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
368 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
369 #else
370 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
371 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
372 #endif
373 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
374 #define __Pyx_PyThreadState_Current PyThreadState_GET()
375 #elif PY_VERSION_HEX >= 0x03060000
376 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
377 #elif PY_VERSION_HEX >= 0x03000000
378 #define __Pyx_PyThreadState_Current PyThreadState_GET()
379 #else
380 #define __Pyx_PyThreadState_Current _PyThreadState_Current
381 #endif
382 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
383 #include "pythread.h"
384 #define Py_tss_NEEDS_INIT 0
385 typedef int Py_tss_t;
PyThread_tss_create(Py_tss_t * key)386 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
387 *key = PyThread_create_key();
388 return 0;
389 }
PyThread_tss_alloc(void)390 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
391 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
392 *key = Py_tss_NEEDS_INIT;
393 return key;
394 }
PyThread_tss_free(Py_tss_t * key)395 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
396 PyObject_Free(key);
397 }
PyThread_tss_is_created(Py_tss_t * key)398 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
399 return *key != Py_tss_NEEDS_INIT;
400 }
PyThread_tss_delete(Py_tss_t * key)401 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
402 PyThread_delete_key(*key);
403 *key = Py_tss_NEEDS_INIT;
404 }
PyThread_tss_set(Py_tss_t * key,void * value)405 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
406 return PyThread_set_key_value(*key, value);
407 }
PyThread_tss_get(Py_tss_t * key)408 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
409 return PyThread_get_key_value(*key);
410 }
411 #endif
412 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
413 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
414 #else
415 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
416 #endif
417 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
418 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
419 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
420 #else
421 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
422 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
423 #endif
424 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
425 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
426 #else
427 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
428 #endif
429 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
430 #define CYTHON_PEP393_ENABLED 1
431 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
432 0 : _PyUnicode_Ready((PyObject *)(op)))
433 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
434 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
435 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
436 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
437 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
438 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
439 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
440 #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
441 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
442 #else
443 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
444 #endif
445 #else
446 #define CYTHON_PEP393_ENABLED 0
447 #define PyUnicode_1BYTE_KIND 1
448 #define PyUnicode_2BYTE_KIND 2
449 #define PyUnicode_4BYTE_KIND 4
450 #define __Pyx_PyUnicode_READY(op) (0)
451 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
452 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
453 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
454 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
455 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
456 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
457 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
458 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
459 #endif
460 #if CYTHON_COMPILING_IN_PYPY
461 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
462 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
463 #else
464 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
465 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
466 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
467 #endif
468 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
469 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
470 #endif
471 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
472 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
473 #endif
474 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
475 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
476 #endif
477 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
478 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
479 #if PY_MAJOR_VERSION >= 3
480 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
481 #else
482 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
483 #endif
484 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
485 #define PyObject_ASCII(o) PyObject_Repr(o)
486 #endif
487 #if PY_MAJOR_VERSION >= 3
488 #define PyBaseString_Type PyUnicode_Type
489 #define PyStringObject PyUnicodeObject
490 #define PyString_Type PyUnicode_Type
491 #define PyString_Check PyUnicode_Check
492 #define PyString_CheckExact PyUnicode_CheckExact
493 #ifndef PyObject_Unicode
494 #define PyObject_Unicode PyObject_Str
495 #endif
496 #endif
497 #if PY_MAJOR_VERSION >= 3
498 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
499 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
500 #else
501 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
502 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
503 #endif
504 #ifndef PySet_CheckExact
505 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
506 #endif
507 #if PY_VERSION_HEX >= 0x030900A4
508 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
509 #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
510 #else
511 #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
512 #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
513 #endif
514 #if CYTHON_ASSUME_SAFE_MACROS
515 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
516 #else
517 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
518 #endif
519 #if PY_MAJOR_VERSION >= 3
520 #define PyIntObject PyLongObject
521 #define PyInt_Type PyLong_Type
522 #define PyInt_Check(op) PyLong_Check(op)
523 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
524 #define PyInt_FromString PyLong_FromString
525 #define PyInt_FromUnicode PyLong_FromUnicode
526 #define PyInt_FromLong PyLong_FromLong
527 #define PyInt_FromSize_t PyLong_FromSize_t
528 #define PyInt_FromSsize_t PyLong_FromSsize_t
529 #define PyInt_AsLong PyLong_AsLong
530 #define PyInt_AS_LONG PyLong_AS_LONG
531 #define PyInt_AsSsize_t PyLong_AsSsize_t
532 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
533 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
534 #define PyNumber_Int PyNumber_Long
535 #endif
536 #if PY_MAJOR_VERSION >= 3
537 #define PyBoolObject PyLongObject
538 #endif
539 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
540 #ifndef PyUnicode_InternFromString
541 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
542 #endif
543 #endif
544 #if PY_VERSION_HEX < 0x030200A4
545 typedef long Py_hash_t;
546 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
547 #define __Pyx_PyInt_AsHash_t PyInt_AsLong
548 #else
549 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
550 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
551 #endif
552 #if PY_MAJOR_VERSION >= 3
553 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
554 #else
555 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
556 #endif
557 #if CYTHON_USE_ASYNC_SLOTS
558 #if PY_VERSION_HEX >= 0x030500B1
559 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
560 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
561 #else
562 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
563 #endif
564 #else
565 #define __Pyx_PyType_AsAsync(obj) NULL
566 #endif
567 #ifndef __Pyx_PyAsyncMethodsStruct
568 typedef struct {
569 unaryfunc am_await;
570 unaryfunc am_aiter;
571 unaryfunc am_anext;
572 } __Pyx_PyAsyncMethodsStruct;
573 #endif
574
575 #if defined(WIN32) || defined(MS_WINDOWS)
576 #define _USE_MATH_DEFINES
577 #endif
578 #include <math.h>
579 #ifdef NAN
580 #define __PYX_NAN() ((float) NAN)
581 #else
__PYX_NAN()582 static CYTHON_INLINE float __PYX_NAN() {
583 float value;
584 memset(&value, 0xFF, sizeof(value));
585 return value;
586 }
587 #endif
588 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
589 #define __Pyx_truncl trunc
590 #else
591 #define __Pyx_truncl truncl
592 #endif
593
594 #define __PYX_MARK_ERR_POS(f_index, lineno) \
595 { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
596 #define __PYX_ERR(f_index, lineno, Ln_error) \
597 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
598
599 #ifndef __PYX_EXTERN_C
600 #ifdef __cplusplus
601 #define __PYX_EXTERN_C extern "C"
602 #else
603 #define __PYX_EXTERN_C extern
604 #endif
605 #endif
606
607 #define __PYX_HAVE__borg__item
608 #define __PYX_HAVE_API__borg__item
609 /* Early includes */
610 #ifdef _OPENMP
611 #include <omp.h>
612 #endif /* _OPENMP */
613
614 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
615 #define CYTHON_WITHOUT_ASSERTIONS
616 #endif
617
618 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
619 const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
620
621 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
622 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
623 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
624 #define __PYX_DEFAULT_STRING_ENCODING ""
625 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
626 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
627 #define __Pyx_uchar_cast(c) ((unsigned char)c)
628 #define __Pyx_long_cast(x) ((long)x)
629 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
630 (sizeof(type) < sizeof(Py_ssize_t)) ||\
631 (sizeof(type) > sizeof(Py_ssize_t) &&\
632 likely(v < (type)PY_SSIZE_T_MAX ||\
633 v == (type)PY_SSIZE_T_MAX) &&\
634 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
635 v == (type)PY_SSIZE_T_MIN))) ||\
636 (sizeof(type) == sizeof(Py_ssize_t) &&\
637 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
638 v == (type)PY_SSIZE_T_MAX))) )
__Pyx_is_valid_index(Py_ssize_t i,Py_ssize_t limit)639 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
640 return (size_t) i < (size_t) limit;
641 }
642 #if defined (__cplusplus) && __cplusplus >= 201103L
643 #include <cstdlib>
644 #define __Pyx_sst_abs(value) std::abs(value)
645 #elif SIZEOF_INT >= SIZEOF_SIZE_T
646 #define __Pyx_sst_abs(value) abs(value)
647 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
648 #define __Pyx_sst_abs(value) labs(value)
649 #elif defined (_MSC_VER)
650 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
651 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
652 #define __Pyx_sst_abs(value) llabs(value)
653 #elif defined (__GNUC__)
654 #define __Pyx_sst_abs(value) __builtin_llabs(value)
655 #else
656 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
657 #endif
658 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
659 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
660 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
661 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
662 #define __Pyx_PyBytes_FromString PyBytes_FromString
663 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
664 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
665 #if PY_MAJOR_VERSION < 3
666 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
667 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
668 #else
669 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
670 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
671 #endif
672 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
673 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
674 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
675 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
676 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
677 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
678 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
679 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
680 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
681 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
682 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
683 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
684 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
685 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
686 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
687 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
__Pyx_Py_UNICODE_strlen(const Py_UNICODE * u)688 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
689 const Py_UNICODE *u_end = u;
690 while (*u_end++) ;
691 return (size_t)(u_end - u - 1);
692 }
693 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
694 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
695 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
696 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
697 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
698 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
699 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
700 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
701 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
702 #define __Pyx_PySequence_Tuple(obj)\
703 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
704 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
705 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
706 #if CYTHON_ASSUME_SAFE_MACROS
707 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
708 #else
709 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
710 #endif
711 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
712 #if PY_MAJOR_VERSION >= 3
713 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
714 #else
715 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
716 #endif
717 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
718 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
719 static int __Pyx_sys_getdefaultencoding_not_ascii;
__Pyx_init_sys_getdefaultencoding_params(void)720 static int __Pyx_init_sys_getdefaultencoding_params(void) {
721 PyObject* sys;
722 PyObject* default_encoding = NULL;
723 PyObject* ascii_chars_u = NULL;
724 PyObject* ascii_chars_b = NULL;
725 const char* default_encoding_c;
726 sys = PyImport_ImportModule("sys");
727 if (!sys) goto bad;
728 default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
729 Py_DECREF(sys);
730 if (!default_encoding) goto bad;
731 default_encoding_c = PyBytes_AsString(default_encoding);
732 if (!default_encoding_c) goto bad;
733 if (strcmp(default_encoding_c, "ascii") == 0) {
734 __Pyx_sys_getdefaultencoding_not_ascii = 0;
735 } else {
736 char ascii_chars[128];
737 int c;
738 for (c = 0; c < 128; c++) {
739 ascii_chars[c] = c;
740 }
741 __Pyx_sys_getdefaultencoding_not_ascii = 1;
742 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
743 if (!ascii_chars_u) goto bad;
744 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
745 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
746 PyErr_Format(
747 PyExc_ValueError,
748 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
749 default_encoding_c);
750 goto bad;
751 }
752 Py_DECREF(ascii_chars_u);
753 Py_DECREF(ascii_chars_b);
754 }
755 Py_DECREF(default_encoding);
756 return 0;
757 bad:
758 Py_XDECREF(default_encoding);
759 Py_XDECREF(ascii_chars_u);
760 Py_XDECREF(ascii_chars_b);
761 return -1;
762 }
763 #endif
764 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
765 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
766 #else
767 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
768 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
769 static char* __PYX_DEFAULT_STRING_ENCODING;
__Pyx_init_sys_getdefaultencoding_params(void)770 static int __Pyx_init_sys_getdefaultencoding_params(void) {
771 PyObject* sys;
772 PyObject* default_encoding = NULL;
773 char* default_encoding_c;
774 sys = PyImport_ImportModule("sys");
775 if (!sys) goto bad;
776 default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
777 Py_DECREF(sys);
778 if (!default_encoding) goto bad;
779 default_encoding_c = PyBytes_AsString(default_encoding);
780 if (!default_encoding_c) goto bad;
781 __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
782 if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
783 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
784 Py_DECREF(default_encoding);
785 return 0;
786 bad:
787 Py_XDECREF(default_encoding);
788 return -1;
789 }
790 #endif
791 #endif
792
793
794 /* Test for GCC > 2.95 */
795 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
796 #define likely(x) __builtin_expect(!!(x), 1)
797 #define unlikely(x) __builtin_expect(!!(x), 0)
798 #else /* !__GNUC__ or GCC < 2.95 */
799 #define likely(x) (x)
800 #define unlikely(x) (x)
801 #endif /* __GNUC__ */
__Pyx_pretend_to_initialize(void * ptr)802 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
803
804 static PyObject *__pyx_m = NULL;
805 static PyObject *__pyx_d;
806 static PyObject *__pyx_b;
807 static PyObject *__pyx_cython_runtime = NULL;
808 static PyObject *__pyx_empty_tuple;
809 static PyObject *__pyx_empty_bytes;
810 static PyObject *__pyx_empty_unicode;
811 static int __pyx_lineno;
812 static int __pyx_clineno = 0;
813 static const char * __pyx_cfilenm= __FILE__;
814 static const char *__pyx_filename;
815
816
817 static const char *__pyx_f[] = {
818 "src/borg/item.pyx",
819 };
820
821 /*--- Type declarations ---*/
822 struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property;
823 struct __pyx_obj_4borg_4item___pyx_scope_struct_1_get_size;
824 struct __pyx_obj_4borg_4item___pyx_scope_struct_2_genexpr;
825
826 /* "borg/item.pyx":94
827 *
828 * @staticmethod
829 * def _make_property(key, value_type, value_type_name=None, encode=None, decode=None): # <<<<<<<<<<<<<<
830 * """return a property that deals with self._dict[key]"""
831 * assert isinstance(key, str)
832 */
833 struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property {
834 PyObject_HEAD
835 PyObject *__pyx_v_attr_error_msg;
836 PyObject *__pyx_v_decode;
837 PyObject *__pyx_v_encode;
838 PyObject *__pyx_v_key;
839 PyObject *__pyx_v_type_error_msg;
840 PyObject *__pyx_v_value_type;
841 };
842
843
844 /* "borg/item.pyx":191
845 * part = PropDict._make_property('part', int)
846 *
847 * def get_size(self, hardlink_masters=None, memorize=False, compressed=False, from_chunks=False): # <<<<<<<<<<<<<<
848 * """
849 * Determine the (uncompressed or compressed) size of this item.
850 */
851 struct __pyx_obj_4borg_4item___pyx_scope_struct_1_get_size {
852 PyObject_HEAD
853 PyObject *__pyx_v_attr;
854 PyObject *__pyx_v_chunks;
855 };
856
857
858 /* "borg/item.pyx":233
859 * if chunks is None:
860 * return 0
861 * size = sum(getattr(ChunkListEntry(*chunk), attr) for chunk in chunks) # <<<<<<<<<<<<<<
862 * # if requested, memorize the precomputed (c)size for items that have an own chunks list:
863 * if memorize and having_chunks:
864 */
865 struct __pyx_obj_4borg_4item___pyx_scope_struct_2_genexpr {
866 PyObject_HEAD
867 struct __pyx_obj_4borg_4item___pyx_scope_struct_1_get_size *__pyx_outer_scope;
868 PyObject *__pyx_v_chunk;
869 PyObject *__pyx_t_0;
870 Py_ssize_t __pyx_t_1;
871 PyObject *(*__pyx_t_2)(PyObject *);
872 };
873
874
875 /* --- Runtime support code (head) --- */
876 /* Refnanny.proto */
877 #ifndef CYTHON_REFNANNY
878 #define CYTHON_REFNANNY 0
879 #endif
880 #if CYTHON_REFNANNY
881 typedef struct {
882 void (*INCREF)(void*, PyObject*, int);
883 void (*DECREF)(void*, PyObject*, int);
884 void (*GOTREF)(void*, PyObject*, int);
885 void (*GIVEREF)(void*, PyObject*, int);
886 void* (*SetupContext)(const char*, int, const char*);
887 void (*FinishContext)(void**);
888 } __Pyx_RefNannyAPIStruct;
889 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
890 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
891 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
892 #ifdef WITH_THREAD
893 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
894 if (acquire_gil) {\
895 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
896 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
897 PyGILState_Release(__pyx_gilstate_save);\
898 } else {\
899 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
900 }
901 #else
902 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
903 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
904 #endif
905 #define __Pyx_RefNannyFinishContext()\
906 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
907 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
908 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
909 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
910 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
911 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
912 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
913 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
914 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
915 #else
916 #define __Pyx_RefNannyDeclarations
917 #define __Pyx_RefNannySetupContext(name, acquire_gil)
918 #define __Pyx_RefNannyFinishContext()
919 #define __Pyx_INCREF(r) Py_INCREF(r)
920 #define __Pyx_DECREF(r) Py_DECREF(r)
921 #define __Pyx_GOTREF(r)
922 #define __Pyx_GIVEREF(r)
923 #define __Pyx_XINCREF(r) Py_XINCREF(r)
924 #define __Pyx_XDECREF(r) Py_XDECREF(r)
925 #define __Pyx_XGOTREF(r)
926 #define __Pyx_XGIVEREF(r)
927 #endif
928 #define __Pyx_XDECREF_SET(r, v) do {\
929 PyObject *tmp = (PyObject *) r;\
930 r = v; __Pyx_XDECREF(tmp);\
931 } while (0)
932 #define __Pyx_DECREF_SET(r, v) do {\
933 PyObject *tmp = (PyObject *) r;\
934 r = v; __Pyx_DECREF(tmp);\
935 } while (0)
936 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
937 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
938
939 /* PyObjectGetAttrStr.proto */
940 #if CYTHON_USE_TYPE_SLOTS
941 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
942 #else
943 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
944 #endif
945
946 /* GetBuiltinName.proto */
947 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
948
949 /* RaiseDoubleKeywords.proto */
950 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
951
952 /* ParseKeywords.proto */
953 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
954 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
955 const char* function_name);
956
957 /* RaiseArgTupleInvalid.proto */
958 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
959 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
960
961 /* PyObjectSetAttrStr.proto */
962 #if CYTHON_USE_TYPE_SLOTS
963 #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
964 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
965 #else
966 #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
967 #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
968 #endif
969
970 /* PyCFunctionFastCall.proto */
971 #if CYTHON_FAST_PYCCALL
972 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
973 #else
974 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
975 #endif
976
977 /* PyFunctionFastCall.proto */
978 #if CYTHON_FAST_PYCALL
979 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
980 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
981 #if 1 || PY_VERSION_HEX < 0x030600B1
982 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
983 #else
984 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
985 #endif
986 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
987 (sizeof(char [1 - 2*!(cond)]) - 1)
988 #ifndef Py_MEMBER_SIZE
989 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
990 #endif
991 static size_t __pyx_pyframe_localsplus_offset = 0;
992 #include "frameobject.h"
993 #define __Pxy_PyFrame_Initialize_Offsets()\
994 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
995 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
996 #define __Pyx_PyFrame_GetLocalsplus(frame)\
997 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
998 #endif
999
1000 /* PyObjectCall.proto */
1001 #if CYTHON_COMPILING_IN_CPYTHON
1002 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1003 #else
1004 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1005 #endif
1006
1007 /* PyObjectCall2Args.proto */
1008 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
1009
1010 /* PyObjectCallMethO.proto */
1011 #if CYTHON_COMPILING_IN_CPYTHON
1012 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1013 #endif
1014
1015 /* PyObjectCallOneArg.proto */
1016 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1017
1018 /* PyThreadStateGet.proto */
1019 #if CYTHON_FAST_THREAD_STATE
1020 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1021 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1022 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1023 #else
1024 #define __Pyx_PyThreadState_declare
1025 #define __Pyx_PyThreadState_assign
1026 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1027 #endif
1028
1029 /* PyErrFetchRestore.proto */
1030 #if CYTHON_FAST_THREAD_STATE
1031 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1032 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1033 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1034 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1035 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1036 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1037 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1038 #if CYTHON_COMPILING_IN_CPYTHON
1039 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1040 #else
1041 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1042 #endif
1043 #else
1044 #define __Pyx_PyErr_Clear() PyErr_Clear()
1045 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1046 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1047 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1048 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1049 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1050 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1051 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1052 #endif
1053
1054 /* RaiseException.proto */
1055 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1056
1057 /* IterFinish.proto */
1058 static CYTHON_INLINE int __Pyx_IterFinish(void);
1059
1060 /* PyObjectCallNoArg.proto */
1061 #if CYTHON_COMPILING_IN_CPYTHON
1062 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1063 #else
1064 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1065 #endif
1066
1067 /* PyObjectGetMethod.proto */
1068 static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
1069
1070 /* PyObjectCallMethod0.proto */
1071 static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);
1072
1073 /* RaiseNeedMoreValuesToUnpack.proto */
1074 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1075
1076 /* RaiseTooManyValuesToUnpack.proto */
1077 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1078
1079 /* UnpackItemEndCheck.proto */
1080 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
1081
1082 /* RaiseNoneIterError.proto */
1083 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
1084
1085 /* UnpackTupleError.proto */
1086 static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index);
1087
1088 /* UnpackTuple2.proto */
1089 #define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\
1090 (likely(is_tuple || PyTuple_Check(tuple)) ?\
1091 (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\
1092 __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\
1093 (__Pyx_UnpackTupleError(tuple, 2), -1)) :\
1094 __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple))
1095 static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
1096 PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple);
1097 static int __Pyx_unpack_tuple2_generic(
1098 PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple);
1099
1100 /* dict_iter.proto */
1101 static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name,
1102 Py_ssize_t* p_orig_length, int* p_is_dict);
1103 static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos,
1104 PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict);
1105
1106 /* PyObjectFormatAndDecref.proto */
1107 static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f);
1108 static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f);
1109
1110 /* IncludeStringH.proto */
1111 #include <string.h>
1112
1113 /* JoinPyUnicode.proto */
1114 static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
1115 Py_UCS4 max_char);
1116
1117 /* PyDictVersioning.proto */
1118 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1119 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1120 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1121 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1122 (version_var) = __PYX_GET_DICT_VERSION(dict);\
1123 (cache_var) = (value);
1124 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1125 static PY_UINT64_T __pyx_dict_version = 0;\
1126 static PyObject *__pyx_dict_cached_value = NULL;\
1127 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1128 (VAR) = __pyx_dict_cached_value;\
1129 } else {\
1130 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1131 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1132 }\
1133 }
1134 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1135 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1136 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1137 #else
1138 #define __PYX_GET_DICT_VERSION(dict) (0)
1139 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1140 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1141 #endif
1142
1143 /* GetModuleGlobalName.proto */
1144 #if CYTHON_USE_DICT_VERSIONS
1145 #define __Pyx_GetModuleGlobalName(var, name) {\
1146 static PY_UINT64_T __pyx_dict_version = 0;\
1147 static PyObject *__pyx_dict_cached_value = NULL;\
1148 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1149 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1150 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1151 }
1152 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1153 PY_UINT64_T __pyx_dict_version;\
1154 PyObject *__pyx_dict_cached_value;\
1155 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1156 }
1157 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1158 #else
1159 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1160 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1161 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1162 #endif
1163
1164 /* PySequenceContains.proto */
__Pyx_PySequence_ContainsTF(PyObject * item,PyObject * seq,int eq)1165 static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
1166 int result = PySequence_Contains(seq, item);
1167 return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
1168 }
1169
1170 /* PyErrExceptionMatches.proto */
1171 #if CYTHON_FAST_THREAD_STATE
1172 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1173 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1174 #else
1175 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1176 #endif
1177
1178 /* GetAttr.proto */
1179 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1180
1181 /* GetAttr3.proto */
1182 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
1183
1184 /* None.proto */
1185 static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname);
1186
1187 /* GetItemInt.proto */
1188 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1189 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1190 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1191 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1192 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1193 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1194 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1195 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1196 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1197 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1198 int wraparound, int boundscheck);
1199 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1200 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1201 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1202 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1203 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1204 int wraparound, int boundscheck);
1205 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1206 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1207 int is_list, int wraparound, int boundscheck);
1208
1209 /* ObjectGetItem.proto */
1210 #if CYTHON_USE_TYPE_SLOTS
1211 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1212 #else
1213 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1214 #endif
1215
1216 /* GetTopmostException.proto */
1217 #if CYTHON_USE_EXC_INFO_STACK
1218 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1219 #endif
1220
1221 /* SaveResetException.proto */
1222 #if CYTHON_FAST_THREAD_STATE
1223 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1224 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1225 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1226 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1227 #else
1228 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1229 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1230 #endif
1231
1232 /* GetException.proto */
1233 #if CYTHON_FAST_THREAD_STATE
1234 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1235 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1236 #else
1237 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1238 #endif
1239
1240 /* FetchCommonType.proto */
1241 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
1242
1243 /* CythonFunctionShared.proto */
1244 #define __Pyx_CyFunction_USED 1
1245 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
1246 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
1247 #define __Pyx_CYFUNCTION_CCLASS 0x04
1248 #define __Pyx_CyFunction_GetClosure(f)\
1249 (((__pyx_CyFunctionObject *) (f))->func_closure)
1250 #define __Pyx_CyFunction_GetClassObj(f)\
1251 (((__pyx_CyFunctionObject *) (f))->func_classobj)
1252 #define __Pyx_CyFunction_Defaults(type, f)\
1253 ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
1254 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
1255 ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
1256 typedef struct {
1257 PyCFunctionObject func;
1258 #if PY_VERSION_HEX < 0x030500A0
1259 PyObject *func_weakreflist;
1260 #endif
1261 PyObject *func_dict;
1262 PyObject *func_name;
1263 PyObject *func_qualname;
1264 PyObject *func_doc;
1265 PyObject *func_globals;
1266 PyObject *func_code;
1267 PyObject *func_closure;
1268 PyObject *func_classobj;
1269 void *defaults;
1270 int defaults_pyobjects;
1271 size_t defaults_size; // used by FusedFunction for copying defaults
1272 int flags;
1273 PyObject *defaults_tuple;
1274 PyObject *defaults_kwdict;
1275 PyObject *(*defaults_getter)(PyObject *);
1276 PyObject *func_annotations;
1277 } __pyx_CyFunctionObject;
1278 static PyTypeObject *__pyx_CyFunctionType = 0;
1279 #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
1280 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
1281 int flags, PyObject* qualname,
1282 PyObject *self,
1283 PyObject *module, PyObject *globals,
1284 PyObject* code);
1285 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
1286 size_t size,
1287 int pyobjects);
1288 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
1289 PyObject *tuple);
1290 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
1291 PyObject *dict);
1292 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
1293 PyObject *dict);
1294 static int __pyx_CyFunction_init(void);
1295
1296 /* CythonFunction.proto */
1297 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
1298 int flags, PyObject* qualname,
1299 PyObject *closure,
1300 PyObject *module, PyObject *globals,
1301 PyObject* code);
1302
1303 /* PyObject_GenericGetAttrNoDict.proto */
1304 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1305 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1306 #else
1307 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1308 #endif
1309
1310 /* Import.proto */
1311 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1312
1313 /* ImportFrom.proto */
1314 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1315
1316 /* SetNameInClass.proto */
1317 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
1318 #define __Pyx_SetNameInClass(ns, name, value)\
1319 (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
1320 #elif CYTHON_COMPILING_IN_CPYTHON
1321 #define __Pyx_SetNameInClass(ns, name, value)\
1322 (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
1323 #else
1324 #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value)
1325 #endif
1326
1327 /* CalculateMetaclass.proto */
1328 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
1329
1330 /* Py3ClassCreate.proto */
1331 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
1332 PyObject *mkw, PyObject *modname, PyObject *doc);
1333 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
1334 PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);
1335
1336 /* CLineInTraceback.proto */
1337 #ifdef CYTHON_CLINE_IN_TRACEBACK
1338 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1339 #else
1340 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1341 #endif
1342
1343 /* CodeObjectCache.proto */
1344 typedef struct {
1345 PyCodeObject* code_object;
1346 int code_line;
1347 } __Pyx_CodeObjectCacheEntry;
1348 struct __Pyx_CodeObjectCache {
1349 int count;
1350 int max_count;
1351 __Pyx_CodeObjectCacheEntry* entries;
1352 };
1353 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1354 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
1355 static PyCodeObject *__pyx_find_code_object(int code_line);
1356 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
1357
1358 /* AddTraceback.proto */
1359 static void __Pyx_AddTraceback(const char *funcname, int c_line,
1360 int py_line, const char *filename);
1361
1362 /* GCCDiagnostics.proto */
1363 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
1364 #define __Pyx_HAS_GCC_DIAGNOSTIC
1365 #endif
1366
1367 /* CIntToPy.proto */
1368 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
1369
1370 /* CIntFromPy.proto */
1371 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
1372
1373 /* CIntFromPy.proto */
1374 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
1375
1376 /* FastTypeChecks.proto */
1377 #if CYTHON_COMPILING_IN_CPYTHON
1378 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1379 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1380 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1381 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1382 #else
1383 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1384 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1385 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1386 #endif
1387 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1388
1389 /* SwapException.proto */
1390 #if CYTHON_FAST_THREAD_STATE
1391 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
1392 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1393 #else
1394 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
1395 #endif
1396
1397 /* PyObjectCallMethod1.proto */
1398 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
1399
1400 /* CoroutineBase.proto */
1401 typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyThreadState *, PyObject *);
1402 #if CYTHON_USE_EXC_INFO_STACK
1403 #define __Pyx_ExcInfoStruct _PyErr_StackItem
1404 #else
1405 typedef struct {
1406 PyObject *exc_type;
1407 PyObject *exc_value;
1408 PyObject *exc_traceback;
1409 } __Pyx_ExcInfoStruct;
1410 #endif
1411 typedef struct {
1412 PyObject_HEAD
1413 __pyx_coroutine_body_t body;
1414 PyObject *closure;
1415 __Pyx_ExcInfoStruct gi_exc_state;
1416 PyObject *gi_weakreflist;
1417 PyObject *classobj;
1418 PyObject *yieldfrom;
1419 PyObject *gi_name;
1420 PyObject *gi_qualname;
1421 PyObject *gi_modulename;
1422 PyObject *gi_code;
1423 int resume_label;
1424 char is_running;
1425 } __pyx_CoroutineObject;
1426 static __pyx_CoroutineObject *__Pyx__Coroutine_New(
1427 PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
1428 PyObject *name, PyObject *qualname, PyObject *module_name);
1429 static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
1430 __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
1431 PyObject *name, PyObject *qualname, PyObject *module_name);
1432 static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self);
1433 static int __Pyx_Coroutine_clear(PyObject *self);
1434 static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value);
1435 static PyObject *__Pyx_Coroutine_Close(PyObject *self);
1436 static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
1437 #if CYTHON_USE_EXC_INFO_STACK
1438 #define __Pyx_Coroutine_SwapException(self)
1439 #define __Pyx_Coroutine_ResetAndClearException(self) __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state)
1440 #else
1441 #define __Pyx_Coroutine_SwapException(self) {\
1442 __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\
1443 __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\
1444 }
1445 #define __Pyx_Coroutine_ResetAndClearException(self) {\
1446 __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\
1447 (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\
1448 }
1449 #endif
1450 #if CYTHON_FAST_THREAD_STATE
1451 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
1452 __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue)
1453 #else
1454 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
1455 __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue)
1456 #endif
1457 static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue);
1458 static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state);
1459
1460 /* PatchModuleWithCoroutine.proto */
1461 static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code);
1462
1463 /* PatchGeneratorABC.proto */
1464 static int __Pyx_patch_abc(void);
1465
1466 /* Generator.proto */
1467 #define __Pyx_Generator_USED
1468 static PyTypeObject *__pyx_GeneratorType = 0;
1469 #define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType)
1470 #define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\
1471 __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name)
1472 static PyObject *__Pyx_Generator_Next(PyObject *self);
1473 static int __pyx_Generator_init(void);
1474
1475 /* CheckBinaryVersion.proto */
1476 static int __Pyx_check_binary_version(void);
1477
1478 /* InitStrings.proto */
1479 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1480
1481
1482 /* Module declarations from 'borg.item' */
1483 static PyTypeObject *__pyx_ptype_4borg_4item___pyx_scope_struct___make_property = 0;
1484 static PyTypeObject *__pyx_ptype_4borg_4item___pyx_scope_struct_1_get_size = 0;
1485 static PyTypeObject *__pyx_ptype_4borg_4item___pyx_scope_struct_2_genexpr = 0;
1486 #define __Pyx_MODULE_NAME "borg.item"
1487 extern int __pyx_module_is_main_borg__item;
1488 int __pyx_module_is_main_borg__item = 0;
1489
1490 /* Implementation of 'borg.item' */
1491 static PyObject *__pyx_builtin_staticmethod;
1492 static PyObject *__pyx_builtin_TypeError;
1493 static PyObject *__pyx_builtin_ValueError;
1494 static PyObject *__pyx_builtin_property;
1495 static PyObject *__pyx_builtin_KeyError;
1496 static PyObject *__pyx_builtin_AttributeError;
1497 static PyObject *__pyx_builtin_sum;
1498 static const char __pyx_k_d[] = "d";
1499 static const char __pyx_k_k[] = "k";
1500 static const char __pyx_k_v[] = "v";
1501 static const char __pyx_k__3[] = ")";
1502 static const char __pyx_k__5[] = " (";
1503 static const char __pyx_k_eq[] = "__eq__";
1504 static const char __pyx_k_kw[] = "kw";
1505 static const char __pyx_k_Key[] = "Key";
1506 static const char __pyx_k__38[] = "_";
1507 static const char __pyx_k_del[] = "_del";
1508 static const char __pyx_k_doc[] = "doc";
1509 static const char __pyx_k_get[] = "_get";
1510 static const char __pyx_k_gid[] = "gid";
1511 static const char __pyx_k_key[] = "key";
1512 static const char __pyx_k_set[] = "_set";
1513 static const char __pyx_k_sum[] = "sum";
1514 static const char __pyx_k_uid[] = "uid";
1515 static const char __pyx_k_Item[] = "Item";
1516 static const char __pyx_k_args[] = "args";
1517 static const char __pyx_k_attr[] = "attr";
1518 static const char __pyx_k_data[] = "data";
1519 static const char __pyx_k_dict[] = "_dict";
1520 static const char __pyx_k_hash[] = "hash";
1521 static const char __pyx_k_init[] = "__init__";
1522 static const char __pyx_k_main[] = "__main__";
1523 static const char __pyx_k_mode[] = "mode";
1524 static const char __pyx_k_name[] = "__name__";
1525 static const char __pyx_k_part[] = "part";
1526 static const char __pyx_k_path[] = "path";
1527 static const char __pyx_k_rdev[] = "rdev";
1528 static const char __pyx_k_repr[] = "__repr__";
1529 static const char __pyx_k_salt[] = "salt";
1530 static const char __pyx_k_self[] = "self";
1531 static const char __pyx_k_send[] = "send";
1532 static const char __pyx_k_size[] = "size";
1533 static const char __pyx_k_stat[] = "stat";
1534 static const char __pyx_k_test[] = "__test__";
1535 static const char __pyx_k_time[] = "time";
1536 static const char __pyx_k_user[] = "user";
1537 static const char __pyx_k_atime[] = "atime";
1538 static const char __pyx_k_class[] = "__class__";
1539 static const char __pyx_k_close[] = "close";
1540 static const char __pyx_k_csize[] = "csize";
1541 static const char __pyx_k_ctime[] = "ctime";
1542 static const char __pyx_k_doc_2[] = "__doc__";
1543 static const char __pyx_k_get_2[] = "get";
1544 static const char __pyx_k_group[] = "group";
1545 static const char __pyx_k_items[] = "items";
1546 static const char __pyx_k_mtime[] = "mtime";
1547 static const char __pyx_k_nlink[] = "nlink";
1548 static const char __pyx_k_other[] = "other";
1549 static const char __pyx_k_slots[] = "__slots__";
1550 static const char __pyx_k_throw[] = "throw";
1551 static const char __pyx_k_value[] = "value";
1552 static const char __pyx_k_1_1_03[] = "1.1_03";
1553 static const char __pyx_k_bigint[] = "bigint";
1554 static const char __pyx_k_chunks[] = "chunks";
1555 static const char __pyx_k_config[] = "config";
1556 static const char __pyx_k_decode[] = "decode";
1557 static const char __pyx_k_encode[] = "encode";
1558 static const char __pyx_k_id_key[] = "id_key";
1559 static const char __pyx_k_import[] = "__import__";
1560 static const char __pyx_k_master[] = "master";
1561 static const char __pyx_k_module[] = "__module__";
1562 static const char __pyx_k_name_2[] = "name";
1563 static const char __pyx_k_source[] = "source";
1564 static const char __pyx_k_update[] = "update";
1565 static const char __pyx_k_xattrs[] = "xattrs";
1566 static const char __pyx_k_S_ISLNK[] = "S_ISLNK";
1567 static const char __pyx_k_as_dict[] = "as_dict";
1568 static const char __pyx_k_cmdline[] = "cmdline";
1569 static const char __pyx_k_comment[] = "comment";
1570 static const char __pyx_k_default[] = "default";
1571 static const char __pyx_k_deleted[] = "deleted";
1572 static const char __pyx_k_enc_key[] = "enc_key";
1573 static const char __pyx_k_genexpr[] = "genexpr";
1574 static const char __pyx_k_helpers[] = "helpers";
1575 static const char __pyx_k_prepare[] = "__prepare__";
1576 static const char __pyx_k_version[] = "version";
1577 static const char __pyx_k_KeyError[] = "KeyError";
1578 static const char __pyx_k_PropDict[] = "PropDict";
1579 static const char __pyx_k_acl_nfs4[] = "acl_nfs4";
1580 static const char __pyx_k_archives[] = "archives";
1581 static const char __pyx_k_bsdflags[] = "bsdflags";
1582 static const char __pyx_k_contains[] = "__contains__";
1583 static const char __pyx_k_get_size[] = "get_size";
1584 static const char __pyx_k_hostname[] = "hostname";
1585 static const char __pyx_k_memorize[] = "memorize";
1586 static const char __pyx_k_property[] = "property";
1587 static const char __pyx_k_qualname[] = "__qualname__";
1588 static const char __pyx_k_time_end[] = "time_end";
1589 static const char __pyx_k_username[] = "username";
1590 static const char __pyx_k_ITEM_KEYS[] = "ITEM_KEYS";
1591 static const char __pyx_k_TypeError[] = "TypeError";
1592 static const char __pyx_k_algorithm[] = "algorithm";
1593 static const char __pyx_k_birthtime[] = "birthtime";
1594 static const char __pyx_k_borg_item[] = "borg.item";
1595 static const char __pyx_k_check_key[] = "_check_key";
1596 static const char __pyx_k_constants[] = "constants";
1597 static const char __pyx_k_data_dict[] = "data_dict";
1598 static const char __pyx_k_item_keys[] = "item_keys";
1599 static const char __pyx_k_metaclass[] = "__metaclass__";
1600 static const char __pyx_k_timestamp[] = "timestamp";
1601 static const char __pyx_k_StableDict[] = "StableDict";
1602 static const char __pyx_k_VALID_KEYS[] = "VALID_KEYS";
1603 static const char __pyx_k_ValueError[] = "ValueError";
1604 static const char __pyx_k_acl_access[] = "acl_access";
1605 static const char __pyx_k_chunk_seed[] = "chunk_seed";
1606 static const char __pyx_k_compressed[] = "compressed";
1607 static const char __pyx_k_iterations[] = "iterations";
1608 static const char __pyx_k_namedtuple[] = "namedtuple";
1609 static const char __pyx_k_value_type[] = "value_type";
1610 static const char __pyx_k_API_VERSION[] = "API_VERSION";
1611 static const char __pyx_k_ArchiveItem[] = "ArchiveItem";
1612 static const char __pyx_k_acl_default[] = "acl_default";
1613 static const char __pyx_k_collections[] = "collections";
1614 static const char __pyx_k_from_chunks[] = "from_chunks";
1615 static const char __pyx_k_safe_decode[] = "safe_decode";
1616 static const char __pyx_k_safe_encode[] = "safe_encode";
1617 static const char __pyx_k_ARCHIVE_KEYS[] = "ARCHIVE_KEYS";
1618 static const char __pyx_k_EncryptedKey[] = "EncryptedKey";
1619 static const char __pyx_k_ManifestItem[] = "ManifestItem";
1620 static const char __pyx_k_PropDict_get[] = "PropDict.get";
1621 static const char __pyx_k_acl_extended[] = "acl_extended";
1622 static const char __pyx_k_enc_hmac_key[] = "enc_hmac_key";
1623 static const char __pyx_k_list_or_None[] = "list or None";
1624 static const char __pyx_k_staticmethod[] = "staticmethod";
1625 static const char __pyx_k_tam_required[] = "tam_required";
1626 static const char __pyx_k_Item_get_size[] = "Item.get_size";
1627 static const char __pyx_k_PropDict___eq[] = "PropDict.__eq__";
1628 static const char __pyx_k_bigint_to_int[] = "bigint_to_int";
1629 static const char __pyx_k_having_chunks[] = "having_chunks";
1630 static const char __pyx_k_id_size_csize[] = "id size csize";
1631 static const char __pyx_k_int_to_bigint[] = "int_to_bigint";
1632 static const char __pyx_k_internal_dict[] = "internal_dict";
1633 static const char __pyx_k_make_property[] = "_make_property";
1634 static const char __pyx_k_recreate_args[] = "recreate_args";
1635 static const char __pyx_k_repository_id[] = "repository_id";
1636 static const char __pyx_k_value_must_be[] = " value must be ";
1637 static const char __pyx_k_AttributeError[] = "AttributeError";
1638 static const char __pyx_k_ChunkListEntry[] = "ChunkListEntry";
1639 static const char __pyx_k_attr_error_msg[] = "attr_error_msg";
1640 static const char __pyx_k_chunker_params[] = "chunker_params";
1641 static const char __pyx_k_chunks_healthy[] = "chunks_healthy";
1642 static const char __pyx_k_type_error_msg[] = "type_error_msg";
1643 static const char __pyx_k_PropDict___init[] = "PropDict.__init__";
1644 static const char __pyx_k_PropDict___repr[] = "PropDict.__repr__";
1645 static const char __pyx_k_PropDict_update[] = "PropDict.update";
1646 static const char __pyx_k_hardlink_master[] = "hardlink_master";
1647 static const char __pyx_k_internal_dict_2[] = "(internal_dict=";
1648 static const char __pyx_k_key_must_be_str[] = "key must be str";
1649 static const char __pyx_k_update_internal[] = "update_internal";
1650 static const char __pyx_k_value_type_name[] = "value_type_name";
1651 static const char __pyx_k_PropDict_as_dict[] = "PropDict.as_dict";
1652 static const char __pyx_k_hardlink_masters[] = "hardlink_masters";
1653 static const char __pyx_k_recreate_cmdline[] = "recreate_cmdline";
1654 static const char __pyx_k_src_borg_item_pyx[] = "src/borg/item.pyx";
1655 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
1656 static const char __pyx_k_recreate_source_id[] = "recreate_source_id";
1657 static const char __pyx_k_PropDict___contains[] = "PropDict.__contains__";
1658 static const char __pyx_k_PropDict__check_key[] = "PropDict._check_key";
1659 static const char __pyx_k_attribute_s_not_found[] = "attribute %s not found";
1660 static const char __pyx_k_surrogate_escaped_str[] = "surrogate-escaped str";
1661 static const char __pyx_k_PropDict__make_property[] = "PropDict._make_property";
1662 static const char __pyx_k_recreate_partial_chunks[] = "recreate_partial_chunks";
1663 static const char __pyx_k_PropDict_update_internal[] = "PropDict.update_internal";
1664 static const char __pyx_k_data_dict_must_be_a_dict[] = "data_dict must be a dict";
1665 static const char __pyx_k_key_s_is_not_a_valid_key[] = "key '%s' is not a valid key";
1666 static const char __pyx_k_Item_get_size_locals_genexpr[] = "Item.get_size.<locals>.genexpr";
1667 static const char __pyx_k_internal_dict_must_be_a_dict[] = "internal_dict must be a dict";
1668 static const char __pyx_k_surrogate_escaped_str_or_None[] = "surrogate-escaped str or None";
1669 static const char __pyx_k_PropDict__make_property_locals[] = "PropDict._make_property.<locals>._get";
1670 static const char __pyx_k_ArchiveItem_abstraction_that_de[] = "\n ArchiveItem abstraction that deals with validation and the low-level details internally:\n\n An ArchiveItem is created either from msgpack unpacker output, from another dict, from kwargs or\n built step-by-step by setting attributes.\n\n msgpack gives us a dict with bytes-typed keys, just give it to ArchiveItem(d) and use arch.xxx later.\n\n If a ArchiveItem shall be serialized, give as_dict() method output to msgpack packer.\n ";
1671 static const char __pyx_k_EncryptedKey_abstraction_that_d[] = "\n EncryptedKey abstraction that deals with validation and the low-level details internally:\n\n A EncryptedKey is created either from msgpack unpacker output, from another dict, from kwargs or\n built step-by-step by setting attributes.\n\n msgpack gives us a dict with bytes-typed keys, just give it to EncryptedKey(d) and use enc_key.xxx later.\n\n If a EncryptedKey shall be serialized, give as_dict() method output to msgpack packer.\n ";
1672 static const char __pyx_k_Item_abstraction_that_deals_wit[] = "\n Item abstraction that deals with validation and the low-level details internally:\n\n Items are created either from msgpack unpacker output, from another dict, from kwargs or\n built step-by-step by setting attributes.\n\n msgpack gives us a dict with bytes-typed keys, just give it to Item(internal_dict=d) and use item.key_name later.\n msgpack gives us byte-typed values for stuff that should be str, we automatically decode when getting\n such a property and encode when setting it.\n\n If an Item shall be serialized, give as_dict() method output to msgpack packer.\n\n A bug in Attic up to and including release 0.13 added a (meaningless) 'acl' key to every item.\n We must never re-use this key. See test_attic013_acl_bug for details.\n ";
1673 static const char __pyx_k_Key_abstraction_that_deals_with[] = "\n Key abstraction that deals with validation and the low-level details internally:\n\n A Key is created either from msgpack unpacker output, from another dict, from kwargs or\n built step-by-step by setting attributes.\n\n msgpack gives us a dict with bytes-typed keys, just give it to Key(d) and use key.xxx later.\n\n If a Key shall be serialized, give as_dict() method output to msgpack packer.\n ";
1674 static const char __pyx_k_Manage_a_dictionary_via_propert[] = "\n Manage a dictionary via properties.\n\n - initialization by giving a dict or kw args\n - on initialization, normalize dict keys to be str type\n - access dict via properties, like: x.key_name\n - membership check via: 'key_name' in x\n - optionally, encode when setting a value\n - optionally, decode when getting a value\n - be safe against typos in key names: check against VALID_KEYS\n - when setting a value: check type of value\n\n When \"packing\" a dict, ie. you have a dict with some data and want to convert it into an instance,\n then use eg. Item({'a': 1, ...}). This way all keys in your dictionary are validated.\n\n When \"unpacking\", that is you've read a dictionary with some data from somewhere (eg. msgpack),\n then use eg. Item(internal_dict={...}). This does not validate the keys, therefore unknown keys\n are ignored instead of causing an error.\n ";
1675 static const char __pyx_k_ManifestItem_abstraction_that_d[] = "\n ManifestItem abstraction that deals with validation and the low-level details internally:\n\n A ManifestItem is created either from msgpack unpacker output, from another dict, from kwargs or\n built step-by-step by setting attributes.\n\n msgpack gives us a dict with bytes-typed keys, just give it to ManifestItem(d) and use manifest.xxx later.\n\n If a ManifestItem shall be serialized, give as_dict() method output to msgpack packer.\n ";
1676 static const char __pyx_k_Item_does_not_have_a_csize_field[] = "Item does not have a csize field.";
1677 static const char __pyx_k_PropDict__make_property_locals_2[] = "PropDict._make_property.<locals>._set";
1678 static const char __pyx_k_PropDict__make_property_locals_3[] = "PropDict._make_property.<locals>._del";
1679 static PyObject *__pyx_kp_u_1_1_03;
1680 static PyObject *__pyx_n_s_API_VERSION;
1681 static PyObject *__pyx_n_s_ARCHIVE_KEYS;
1682 static PyObject *__pyx_n_s_ArchiveItem;
1683 static PyObject *__pyx_kp_s_ArchiveItem_abstraction_that_de;
1684 static PyObject *__pyx_n_s_AttributeError;
1685 static PyObject *__pyx_n_s_ChunkListEntry;
1686 static PyObject *__pyx_n_u_ChunkListEntry;
1687 static PyObject *__pyx_n_s_EncryptedKey;
1688 static PyObject *__pyx_kp_s_EncryptedKey_abstraction_that_d;
1689 static PyObject *__pyx_n_s_ITEM_KEYS;
1690 static PyObject *__pyx_n_s_Item;
1691 static PyObject *__pyx_kp_s_Item_abstraction_that_deals_wit;
1692 static PyObject *__pyx_kp_u_Item_does_not_have_a_csize_field;
1693 static PyObject *__pyx_n_s_Item_get_size;
1694 static PyObject *__pyx_n_s_Item_get_size_locals_genexpr;
1695 static PyObject *__pyx_n_s_Key;
1696 static PyObject *__pyx_n_s_KeyError;
1697 static PyObject *__pyx_kp_s_Key_abstraction_that_deals_with;
1698 static PyObject *__pyx_kp_s_Manage_a_dictionary_via_propert;
1699 static PyObject *__pyx_n_s_ManifestItem;
1700 static PyObject *__pyx_kp_s_ManifestItem_abstraction_that_d;
1701 static PyObject *__pyx_n_s_PropDict;
1702 static PyObject *__pyx_n_s_PropDict___contains;
1703 static PyObject *__pyx_n_s_PropDict___eq;
1704 static PyObject *__pyx_n_s_PropDict___init;
1705 static PyObject *__pyx_n_s_PropDict___repr;
1706 static PyObject *__pyx_n_s_PropDict__check_key;
1707 static PyObject *__pyx_n_s_PropDict__make_property;
1708 static PyObject *__pyx_n_s_PropDict__make_property_locals;
1709 static PyObject *__pyx_n_s_PropDict__make_property_locals_2;
1710 static PyObject *__pyx_n_s_PropDict__make_property_locals_3;
1711 static PyObject *__pyx_n_s_PropDict_as_dict;
1712 static PyObject *__pyx_n_s_PropDict_get;
1713 static PyObject *__pyx_n_s_PropDict_update;
1714 static PyObject *__pyx_n_s_PropDict_update_internal;
1715 static PyObject *__pyx_n_s_S_ISLNK;
1716 static PyObject *__pyx_n_s_StableDict;
1717 static PyObject *__pyx_n_s_TypeError;
1718 static PyObject *__pyx_n_s_VALID_KEYS;
1719 static PyObject *__pyx_n_s_ValueError;
1720 static PyObject *__pyx_kp_u__3;
1721 static PyObject *__pyx_n_s__38;
1722 static PyObject *__pyx_kp_u__5;
1723 static PyObject *__pyx_n_s_acl_access;
1724 static PyObject *__pyx_n_u_acl_access;
1725 static PyObject *__pyx_n_s_acl_default;
1726 static PyObject *__pyx_n_u_acl_default;
1727 static PyObject *__pyx_n_s_acl_extended;
1728 static PyObject *__pyx_n_u_acl_extended;
1729 static PyObject *__pyx_n_s_acl_nfs4;
1730 static PyObject *__pyx_n_u_acl_nfs4;
1731 static PyObject *__pyx_n_s_algorithm;
1732 static PyObject *__pyx_n_u_algorithm;
1733 static PyObject *__pyx_n_s_archives;
1734 static PyObject *__pyx_n_u_archives;
1735 static PyObject *__pyx_n_s_args;
1736 static PyObject *__pyx_n_s_as_dict;
1737 static PyObject *__pyx_n_s_atime;
1738 static PyObject *__pyx_n_u_atime;
1739 static PyObject *__pyx_n_s_attr;
1740 static PyObject *__pyx_n_s_attr_error_msg;
1741 static PyObject *__pyx_kp_u_attribute_s_not_found;
1742 static PyObject *__pyx_n_u_bigint;
1743 static PyObject *__pyx_n_s_bigint_to_int;
1744 static PyObject *__pyx_n_s_birthtime;
1745 static PyObject *__pyx_n_u_birthtime;
1746 static PyObject *__pyx_n_s_borg_item;
1747 static PyObject *__pyx_n_s_bsdflags;
1748 static PyObject *__pyx_n_u_bsdflags;
1749 static PyObject *__pyx_n_s_check_key;
1750 static PyObject *__pyx_n_s_chunk_seed;
1751 static PyObject *__pyx_n_u_chunk_seed;
1752 static PyObject *__pyx_n_s_chunker_params;
1753 static PyObject *__pyx_n_u_chunker_params;
1754 static PyObject *__pyx_n_s_chunks;
1755 static PyObject *__pyx_n_u_chunks;
1756 static PyObject *__pyx_n_s_chunks_healthy;
1757 static PyObject *__pyx_n_u_chunks_healthy;
1758 static PyObject *__pyx_n_s_class;
1759 static PyObject *__pyx_n_s_cline_in_traceback;
1760 static PyObject *__pyx_n_s_close;
1761 static PyObject *__pyx_n_s_cmdline;
1762 static PyObject *__pyx_n_u_cmdline;
1763 static PyObject *__pyx_n_s_collections;
1764 static PyObject *__pyx_n_s_comment;
1765 static PyObject *__pyx_n_u_comment;
1766 static PyObject *__pyx_n_s_compressed;
1767 static PyObject *__pyx_n_s_config;
1768 static PyObject *__pyx_n_u_config;
1769 static PyObject *__pyx_n_s_constants;
1770 static PyObject *__pyx_n_s_contains;
1771 static PyObject *__pyx_n_u_csize;
1772 static PyObject *__pyx_n_s_ctime;
1773 static PyObject *__pyx_n_u_ctime;
1774 static PyObject *__pyx_n_s_d;
1775 static PyObject *__pyx_n_s_data;
1776 static PyObject *__pyx_n_u_data;
1777 static PyObject *__pyx_n_s_data_dict;
1778 static PyObject *__pyx_kp_u_data_dict_must_be_a_dict;
1779 static PyObject *__pyx_n_s_decode;
1780 static PyObject *__pyx_n_s_default;
1781 static PyObject *__pyx_n_s_del;
1782 static PyObject *__pyx_n_s_deleted;
1783 static PyObject *__pyx_n_u_deleted;
1784 static PyObject *__pyx_n_s_dict;
1785 static PyObject *__pyx_n_u_dict;
1786 static PyObject *__pyx_n_s_doc;
1787 static PyObject *__pyx_n_s_doc_2;
1788 static PyObject *__pyx_n_s_enc_hmac_key;
1789 static PyObject *__pyx_n_u_enc_hmac_key;
1790 static PyObject *__pyx_n_s_enc_key;
1791 static PyObject *__pyx_n_u_enc_key;
1792 static PyObject *__pyx_n_s_encode;
1793 static PyObject *__pyx_n_s_eq;
1794 static PyObject *__pyx_n_s_from_chunks;
1795 static PyObject *__pyx_n_s_genexpr;
1796 static PyObject *__pyx_n_s_get;
1797 static PyObject *__pyx_n_s_get_2;
1798 static PyObject *__pyx_n_s_get_size;
1799 static PyObject *__pyx_n_s_gid;
1800 static PyObject *__pyx_n_u_gid;
1801 static PyObject *__pyx_n_s_group;
1802 static PyObject *__pyx_n_u_group;
1803 static PyObject *__pyx_n_s_hardlink_master;
1804 static PyObject *__pyx_n_u_hardlink_master;
1805 static PyObject *__pyx_n_s_hardlink_masters;
1806 static PyObject *__pyx_n_s_hash;
1807 static PyObject *__pyx_n_u_hash;
1808 static PyObject *__pyx_n_s_having_chunks;
1809 static PyObject *__pyx_n_s_helpers;
1810 static PyObject *__pyx_n_s_hostname;
1811 static PyObject *__pyx_n_u_hostname;
1812 static PyObject *__pyx_n_s_id_key;
1813 static PyObject *__pyx_n_u_id_key;
1814 static PyObject *__pyx_kp_u_id_size_csize;
1815 static PyObject *__pyx_n_s_import;
1816 static PyObject *__pyx_n_s_init;
1817 static PyObject *__pyx_n_s_int_to_bigint;
1818 static PyObject *__pyx_n_s_internal_dict;
1819 static PyObject *__pyx_kp_u_internal_dict_2;
1820 static PyObject *__pyx_kp_u_internal_dict_must_be_a_dict;
1821 static PyObject *__pyx_n_s_item_keys;
1822 static PyObject *__pyx_n_u_item_keys;
1823 static PyObject *__pyx_n_s_items;
1824 static PyObject *__pyx_n_u_items;
1825 static PyObject *__pyx_n_s_iterations;
1826 static PyObject *__pyx_n_u_iterations;
1827 static PyObject *__pyx_n_s_k;
1828 static PyObject *__pyx_n_s_key;
1829 static PyObject *__pyx_kp_u_key_must_be_str;
1830 static PyObject *__pyx_kp_u_key_s_is_not_a_valid_key;
1831 static PyObject *__pyx_n_s_kw;
1832 static PyObject *__pyx_kp_u_list_or_None;
1833 static PyObject *__pyx_n_s_main;
1834 static PyObject *__pyx_n_s_make_property;
1835 static PyObject *__pyx_n_s_master;
1836 static PyObject *__pyx_n_s_memorize;
1837 static PyObject *__pyx_n_s_metaclass;
1838 static PyObject *__pyx_n_s_mode;
1839 static PyObject *__pyx_n_u_mode;
1840 static PyObject *__pyx_n_s_module;
1841 static PyObject *__pyx_n_s_mtime;
1842 static PyObject *__pyx_n_u_mtime;
1843 static PyObject *__pyx_n_s_name;
1844 static PyObject *__pyx_n_s_name_2;
1845 static PyObject *__pyx_n_u_name_2;
1846 static PyObject *__pyx_n_s_namedtuple;
1847 static PyObject *__pyx_n_s_nlink;
1848 static PyObject *__pyx_n_u_nlink;
1849 static PyObject *__pyx_n_s_other;
1850 static PyObject *__pyx_n_s_part;
1851 static PyObject *__pyx_n_u_part;
1852 static PyObject *__pyx_n_s_path;
1853 static PyObject *__pyx_n_u_path;
1854 static PyObject *__pyx_n_s_prepare;
1855 static PyObject *__pyx_n_s_property;
1856 static PyObject *__pyx_n_s_qualname;
1857 static PyObject *__pyx_n_s_rdev;
1858 static PyObject *__pyx_n_u_rdev;
1859 static PyObject *__pyx_n_s_recreate_args;
1860 static PyObject *__pyx_n_u_recreate_args;
1861 static PyObject *__pyx_n_s_recreate_cmdline;
1862 static PyObject *__pyx_n_u_recreate_cmdline;
1863 static PyObject *__pyx_n_s_recreate_partial_chunks;
1864 static PyObject *__pyx_n_u_recreate_partial_chunks;
1865 static PyObject *__pyx_n_s_recreate_source_id;
1866 static PyObject *__pyx_n_u_recreate_source_id;
1867 static PyObject *__pyx_n_s_repository_id;
1868 static PyObject *__pyx_n_u_repository_id;
1869 static PyObject *__pyx_n_s_repr;
1870 static PyObject *__pyx_n_s_safe_decode;
1871 static PyObject *__pyx_n_s_safe_encode;
1872 static PyObject *__pyx_n_s_salt;
1873 static PyObject *__pyx_n_u_salt;
1874 static PyObject *__pyx_n_s_self;
1875 static PyObject *__pyx_n_s_send;
1876 static PyObject *__pyx_n_s_set;
1877 static PyObject *__pyx_n_s_size;
1878 static PyObject *__pyx_n_u_size;
1879 static PyObject *__pyx_n_s_slots;
1880 static PyObject *__pyx_n_s_source;
1881 static PyObject *__pyx_n_u_source;
1882 static PyObject *__pyx_kp_s_src_borg_item_pyx;
1883 static PyObject *__pyx_n_s_stat;
1884 static PyObject *__pyx_n_s_staticmethod;
1885 static PyObject *__pyx_n_s_sum;
1886 static PyObject *__pyx_kp_u_surrogate_escaped_str;
1887 static PyObject *__pyx_kp_u_surrogate_escaped_str_or_None;
1888 static PyObject *__pyx_n_s_tam_required;
1889 static PyObject *__pyx_n_u_tam_required;
1890 static PyObject *__pyx_n_s_test;
1891 static PyObject *__pyx_n_s_throw;
1892 static PyObject *__pyx_n_s_time;
1893 static PyObject *__pyx_n_u_time;
1894 static PyObject *__pyx_n_s_time_end;
1895 static PyObject *__pyx_n_u_time_end;
1896 static PyObject *__pyx_n_s_timestamp;
1897 static PyObject *__pyx_n_u_timestamp;
1898 static PyObject *__pyx_n_s_type_error_msg;
1899 static PyObject *__pyx_n_s_uid;
1900 static PyObject *__pyx_n_u_uid;
1901 static PyObject *__pyx_n_s_update;
1902 static PyObject *__pyx_n_s_update_internal;
1903 static PyObject *__pyx_n_s_user;
1904 static PyObject *__pyx_n_u_user;
1905 static PyObject *__pyx_n_s_username;
1906 static PyObject *__pyx_n_u_username;
1907 static PyObject *__pyx_n_s_v;
1908 static PyObject *__pyx_n_s_value;
1909 static PyObject *__pyx_kp_u_value_must_be;
1910 static PyObject *__pyx_n_s_value_type;
1911 static PyObject *__pyx_n_s_value_type_name;
1912 static PyObject *__pyx_n_s_version;
1913 static PyObject *__pyx_n_u_version;
1914 static PyObject *__pyx_n_s_xattrs;
1915 static PyObject *__pyx_n_u_xattrs;
1916 static PyObject *__pyx_pf_4borg_4item_8PropDict___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data_dict, PyObject *__pyx_v_internal_dict, PyObject *__pyx_v_kw); /* proto */
1917 static PyObject *__pyx_pf_4borg_4item_8PropDict_2update(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_d); /* proto */
1918 static PyObject *__pyx_pf_4borg_4item_8PropDict_4update_internal(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_d); /* proto */
1919 static PyObject *__pyx_pf_4borg_4item_8PropDict_6__eq__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
1920 static PyObject *__pyx_pf_4borg_4item_8PropDict_8__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
1921 static PyObject *__pyx_pf_4borg_4item_8PropDict_10as_dict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
1922 static PyObject *__pyx_pf_4borg_4item_8PropDict_12_check_key(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
1923 static PyObject *__pyx_pf_4borg_4item_8PropDict_14__contains__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
1924 static PyObject *__pyx_pf_4borg_4item_8PropDict_16get(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_default); /* proto */
1925 static PyObject *__pyx_pf_4borg_4item_8PropDict_14_make_property__get(PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
1926 static PyObject *__pyx_pf_4borg_4item_8PropDict_14_make_property_2_set(PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
1927 static PyObject *__pyx_pf_4borg_4item_8PropDict_14_make_property_4_del(PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
1928 static PyObject *__pyx_pf_4borg_4item_8PropDict_18_make_property(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value_type, PyObject *__pyx_v_value_type_name, PyObject *__pyx_v_encode, PyObject *__pyx_v_decode); /* proto */
1929 static PyObject *__pyx_pf_4borg_4item_4Item_8get_size_genexpr(PyObject *__pyx_self); /* proto */
1930 static PyObject *__pyx_pf_4borg_4item_4Item_get_size(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_hardlink_masters, PyObject *__pyx_v_memorize, PyObject *__pyx_v_compressed, PyObject *__pyx_v_from_chunks); /* proto */
1931 static PyObject *__pyx_tp_new_4borg_4item___pyx_scope_struct___make_property(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
1932 static PyObject *__pyx_tp_new_4borg_4item___pyx_scope_struct_1_get_size(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
1933 static PyObject *__pyx_tp_new_4borg_4item___pyx_scope_struct_2_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
1934 static PyObject *__pyx_int_0;
1935 static PyObject *__pyx_tuple_;
1936 static PyObject *__pyx_tuple__2;
1937 static PyObject *__pyx_tuple__4;
1938 static PyObject *__pyx_tuple__6;
1939 static PyObject *__pyx_tuple__8;
1940 static PyObject *__pyx_tuple__10;
1941 static PyObject *__pyx_tuple__12;
1942 static PyObject *__pyx_tuple__13;
1943 static PyObject *__pyx_tuple__14;
1944 static PyObject *__pyx_tuple__16;
1945 static PyObject *__pyx_tuple__17;
1946 static PyObject *__pyx_tuple__19;
1947 static PyObject *__pyx_tuple__21;
1948 static PyObject *__pyx_tuple__23;
1949 static PyObject *__pyx_tuple__25;
1950 static PyObject *__pyx_tuple__27;
1951 static PyObject *__pyx_tuple__29;
1952 static PyObject *__pyx_tuple__31;
1953 static PyObject *__pyx_tuple__33;
1954 static PyObject *__pyx_tuple__34;
1955 static PyObject *__pyx_tuple__36;
1956 static PyObject *__pyx_tuple__37;
1957 static PyObject *__pyx_tuple__39;
1958 static PyObject *__pyx_tuple__41;
1959 static PyObject *__pyx_codeobj__7;
1960 static PyObject *__pyx_codeobj__9;
1961 static PyObject *__pyx_codeobj__11;
1962 static PyObject *__pyx_codeobj__15;
1963 static PyObject *__pyx_codeobj__18;
1964 static PyObject *__pyx_codeobj__20;
1965 static PyObject *__pyx_codeobj__22;
1966 static PyObject *__pyx_codeobj__24;
1967 static PyObject *__pyx_codeobj__26;
1968 static PyObject *__pyx_codeobj__28;
1969 static PyObject *__pyx_codeobj__30;
1970 static PyObject *__pyx_codeobj__32;
1971 static PyObject *__pyx_codeobj__35;
1972 static PyObject *__pyx_codeobj__40;
1973 /* Late includes */
1974
1975 /* "borg/item.pyx":38
1976 * __slots__ = ("_dict", ) # avoid setting attributes not supported by properties
1977 *
1978 * def __init__(self, data_dict=None, internal_dict=None, **kw): # <<<<<<<<<<<<<<
1979 * self._dict = {}
1980 * if internal_dict is None:
1981 */
1982
1983 /* Python wrapper */
1984 static PyObject *__pyx_pw_4borg_4item_8PropDict_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
1985 static PyMethodDef __pyx_mdef_4borg_4item_8PropDict_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4borg_4item_8PropDict_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_4borg_4item_8PropDict_1__init__(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)1986 static PyObject *__pyx_pw_4borg_4item_8PropDict_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1987 PyObject *__pyx_v_self = 0;
1988 PyObject *__pyx_v_data_dict = 0;
1989 PyObject *__pyx_v_internal_dict = 0;
1990 PyObject *__pyx_v_kw = 0;
1991 int __pyx_lineno = 0;
1992 const char *__pyx_filename = NULL;
1993 int __pyx_clineno = 0;
1994 PyObject *__pyx_r = 0;
1995 __Pyx_RefNannyDeclarations
1996 __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
1997 __pyx_v_kw = PyDict_New(); if (unlikely(!__pyx_v_kw)) return NULL;
1998 __Pyx_GOTREF(__pyx_v_kw);
1999 {
2000 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_data_dict,&__pyx_n_s_internal_dict,0};
2001 PyObject* values[3] = {0,0,0};
2002 values[1] = ((PyObject *)((PyObject *)Py_None));
2003 values[2] = ((PyObject *)((PyObject *)Py_None));
2004 if (unlikely(__pyx_kwds)) {
2005 Py_ssize_t kw_args;
2006 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2007 switch (pos_args) {
2008 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2009 CYTHON_FALLTHROUGH;
2010 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2011 CYTHON_FALLTHROUGH;
2012 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2013 CYTHON_FALLTHROUGH;
2014 case 0: break;
2015 default: goto __pyx_L5_argtuple_error;
2016 }
2017 kw_args = PyDict_Size(__pyx_kwds);
2018 switch (pos_args) {
2019 case 0:
2020 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
2021 else goto __pyx_L5_argtuple_error;
2022 CYTHON_FALLTHROUGH;
2023 case 1:
2024 if (kw_args > 0) {
2025 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data_dict);
2026 if (value) { values[1] = value; kw_args--; }
2027 }
2028 CYTHON_FALLTHROUGH;
2029 case 2:
2030 if (kw_args > 0) {
2031 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_internal_dict);
2032 if (value) { values[2] = value; kw_args--; }
2033 }
2034 }
2035 if (unlikely(kw_args > 0)) {
2036 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 38, __pyx_L3_error)
2037 }
2038 } else {
2039 switch (PyTuple_GET_SIZE(__pyx_args)) {
2040 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2041 CYTHON_FALLTHROUGH;
2042 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2043 CYTHON_FALLTHROUGH;
2044 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2045 break;
2046 default: goto __pyx_L5_argtuple_error;
2047 }
2048 }
2049 __pyx_v_self = values[0];
2050 __pyx_v_data_dict = values[1];
2051 __pyx_v_internal_dict = values[2];
2052 }
2053 goto __pyx_L4_argument_unpacking_done;
2054 __pyx_L5_argtuple_error:;
2055 __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 38, __pyx_L3_error)
2056 __pyx_L3_error:;
2057 __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
2058 __Pyx_AddTraceback("borg.item.PropDict.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2059 __Pyx_RefNannyFinishContext();
2060 return NULL;
2061 __pyx_L4_argument_unpacking_done:;
2062 __pyx_r = __pyx_pf_4borg_4item_8PropDict___init__(__pyx_self, __pyx_v_self, __pyx_v_data_dict, __pyx_v_internal_dict, __pyx_v_kw);
2063
2064 /* function exit code */
2065 __Pyx_XDECREF(__pyx_v_kw);
2066 __Pyx_RefNannyFinishContext();
2067 return __pyx_r;
2068 }
2069
__pyx_pf_4borg_4item_8PropDict___init__(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_self,PyObject * __pyx_v_data_dict,PyObject * __pyx_v_internal_dict,PyObject * __pyx_v_kw)2070 static PyObject *__pyx_pf_4borg_4item_8PropDict___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data_dict, PyObject *__pyx_v_internal_dict, PyObject *__pyx_v_kw) {
2071 PyObject *__pyx_v_data = NULL;
2072 PyObject *__pyx_r = NULL;
2073 __Pyx_RefNannyDeclarations
2074 PyObject *__pyx_t_1 = NULL;
2075 int __pyx_t_2;
2076 int __pyx_t_3;
2077 PyObject *__pyx_t_4 = NULL;
2078 PyObject *__pyx_t_5 = NULL;
2079 int __pyx_lineno = 0;
2080 const char *__pyx_filename = NULL;
2081 int __pyx_clineno = 0;
2082 __Pyx_RefNannySetupContext("__init__", 0);
2083
2084 /* "borg/item.pyx":39
2085 *
2086 * def __init__(self, data_dict=None, internal_dict=None, **kw):
2087 * self._dict = {} # <<<<<<<<<<<<<<
2088 * if internal_dict is None:
2089 * pass # nothing to do
2090 */
2091 __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error)
2092 __Pyx_GOTREF(__pyx_t_1);
2093 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_dict, __pyx_t_1) < 0) __PYX_ERR(0, 39, __pyx_L1_error)
2094 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2095
2096 /* "borg/item.pyx":40
2097 * def __init__(self, data_dict=None, internal_dict=None, **kw):
2098 * self._dict = {}
2099 * if internal_dict is None: # <<<<<<<<<<<<<<
2100 * pass # nothing to do
2101 * elif isinstance(internal_dict, dict):
2102 */
2103 __pyx_t_2 = (__pyx_v_internal_dict == Py_None);
2104 __pyx_t_3 = (__pyx_t_2 != 0);
2105 if (__pyx_t_3) {
2106 goto __pyx_L3;
2107 }
2108
2109 /* "borg/item.pyx":42
2110 * if internal_dict is None:
2111 * pass # nothing to do
2112 * elif isinstance(internal_dict, dict): # <<<<<<<<<<<<<<
2113 * self.update_internal(internal_dict)
2114 * else:
2115 */
2116 __pyx_t_3 = PyDict_Check(__pyx_v_internal_dict);
2117 __pyx_t_2 = (__pyx_t_3 != 0);
2118 if (likely(__pyx_t_2)) {
2119
2120 /* "borg/item.pyx":43
2121 * pass # nothing to do
2122 * elif isinstance(internal_dict, dict):
2123 * self.update_internal(internal_dict) # <<<<<<<<<<<<<<
2124 * else:
2125 * raise TypeError("internal_dict must be a dict")
2126 */
2127 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_update_internal); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 43, __pyx_L1_error)
2128 __Pyx_GOTREF(__pyx_t_4);
2129 __pyx_t_5 = NULL;
2130 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
2131 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
2132 if (likely(__pyx_t_5)) {
2133 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
2134 __Pyx_INCREF(__pyx_t_5);
2135 __Pyx_INCREF(function);
2136 __Pyx_DECREF_SET(__pyx_t_4, function);
2137 }
2138 }
2139 __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_internal_dict) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_internal_dict);
2140 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
2141 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
2142 __Pyx_GOTREF(__pyx_t_1);
2143 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2144 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2145
2146 /* "borg/item.pyx":42
2147 * if internal_dict is None:
2148 * pass # nothing to do
2149 * elif isinstance(internal_dict, dict): # <<<<<<<<<<<<<<
2150 * self.update_internal(internal_dict)
2151 * else:
2152 */
2153 goto __pyx_L3;
2154 }
2155
2156 /* "borg/item.pyx":45
2157 * self.update_internal(internal_dict)
2158 * else:
2159 * raise TypeError("internal_dict must be a dict") # <<<<<<<<<<<<<<
2160 * if data_dict is None:
2161 * data = kw
2162 */
2163 /*else*/ {
2164 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error)
2165 __Pyx_GOTREF(__pyx_t_1);
2166 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
2167 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2168 __PYX_ERR(0, 45, __pyx_L1_error)
2169 }
2170 __pyx_L3:;
2171
2172 /* "borg/item.pyx":46
2173 * else:
2174 * raise TypeError("internal_dict must be a dict")
2175 * if data_dict is None: # <<<<<<<<<<<<<<
2176 * data = kw
2177 * elif isinstance(data_dict, dict):
2178 */
2179 __pyx_t_2 = (__pyx_v_data_dict == Py_None);
2180 __pyx_t_3 = (__pyx_t_2 != 0);
2181 if (__pyx_t_3) {
2182
2183 /* "borg/item.pyx":47
2184 * raise TypeError("internal_dict must be a dict")
2185 * if data_dict is None:
2186 * data = kw # <<<<<<<<<<<<<<
2187 * elif isinstance(data_dict, dict):
2188 * data = data_dict
2189 */
2190 __Pyx_INCREF(__pyx_v_kw);
2191 __pyx_v_data = __pyx_v_kw;
2192
2193 /* "borg/item.pyx":46
2194 * else:
2195 * raise TypeError("internal_dict must be a dict")
2196 * if data_dict is None: # <<<<<<<<<<<<<<
2197 * data = kw
2198 * elif isinstance(data_dict, dict):
2199 */
2200 goto __pyx_L4;
2201 }
2202
2203 /* "borg/item.pyx":48
2204 * if data_dict is None:
2205 * data = kw
2206 * elif isinstance(data_dict, dict): # <<<<<<<<<<<<<<
2207 * data = data_dict
2208 * else:
2209 */
2210 __pyx_t_3 = PyDict_Check(__pyx_v_data_dict);
2211 __pyx_t_2 = (__pyx_t_3 != 0);
2212 if (likely(__pyx_t_2)) {
2213
2214 /* "borg/item.pyx":49
2215 * data = kw
2216 * elif isinstance(data_dict, dict):
2217 * data = data_dict # <<<<<<<<<<<<<<
2218 * else:
2219 * raise TypeError("data_dict must be a dict")
2220 */
2221 __Pyx_INCREF(__pyx_v_data_dict);
2222 __pyx_v_data = __pyx_v_data_dict;
2223
2224 /* "borg/item.pyx":48
2225 * if data_dict is None:
2226 * data = kw
2227 * elif isinstance(data_dict, dict): # <<<<<<<<<<<<<<
2228 * data = data_dict
2229 * else:
2230 */
2231 goto __pyx_L4;
2232 }
2233
2234 /* "borg/item.pyx":51
2235 * data = data_dict
2236 * else:
2237 * raise TypeError("data_dict must be a dict") # <<<<<<<<<<<<<<
2238 * if data:
2239 * self.update(data)
2240 */
2241 /*else*/ {
2242 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error)
2243 __Pyx_GOTREF(__pyx_t_1);
2244 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
2245 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2246 __PYX_ERR(0, 51, __pyx_L1_error)
2247 }
2248 __pyx_L4:;
2249
2250 /* "borg/item.pyx":52
2251 * else:
2252 * raise TypeError("data_dict must be a dict")
2253 * if data: # <<<<<<<<<<<<<<
2254 * self.update(data)
2255 *
2256 */
2257 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_data); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 52, __pyx_L1_error)
2258 if (__pyx_t_2) {
2259
2260 /* "borg/item.pyx":53
2261 * raise TypeError("data_dict must be a dict")
2262 * if data:
2263 * self.update(data) # <<<<<<<<<<<<<<
2264 *
2265 * def update(self, d):
2266 */
2267 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_update); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 53, __pyx_L1_error)
2268 __Pyx_GOTREF(__pyx_t_4);
2269 __pyx_t_5 = NULL;
2270 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
2271 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
2272 if (likely(__pyx_t_5)) {
2273 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
2274 __Pyx_INCREF(__pyx_t_5);
2275 __Pyx_INCREF(function);
2276 __Pyx_DECREF_SET(__pyx_t_4, function);
2277 }
2278 }
2279 __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_data) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_data);
2280 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
2281 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error)
2282 __Pyx_GOTREF(__pyx_t_1);
2283 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2284 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2285
2286 /* "borg/item.pyx":52
2287 * else:
2288 * raise TypeError("data_dict must be a dict")
2289 * if data: # <<<<<<<<<<<<<<
2290 * self.update(data)
2291 *
2292 */
2293 }
2294
2295 /* "borg/item.pyx":38
2296 * __slots__ = ("_dict", ) # avoid setting attributes not supported by properties
2297 *
2298 * def __init__(self, data_dict=None, internal_dict=None, **kw): # <<<<<<<<<<<<<<
2299 * self._dict = {}
2300 * if internal_dict is None:
2301 */
2302
2303 /* function exit code */
2304 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2305 goto __pyx_L0;
2306 __pyx_L1_error:;
2307 __Pyx_XDECREF(__pyx_t_1);
2308 __Pyx_XDECREF(__pyx_t_4);
2309 __Pyx_XDECREF(__pyx_t_5);
2310 __Pyx_AddTraceback("borg.item.PropDict.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2311 __pyx_r = NULL;
2312 __pyx_L0:;
2313 __Pyx_XDECREF(__pyx_v_data);
2314 __Pyx_XGIVEREF(__pyx_r);
2315 __Pyx_RefNannyFinishContext();
2316 return __pyx_r;
2317 }
2318
2319 /* "borg/item.pyx":55
2320 * self.update(data)
2321 *
2322 * def update(self, d): # <<<<<<<<<<<<<<
2323 * for k, v in d.items():
2324 * if isinstance(k, bytes):
2325 */
2326
2327 /* Python wrapper */
2328 static PyObject *__pyx_pw_4borg_4item_8PropDict_3update(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2329 static PyMethodDef __pyx_mdef_4borg_4item_8PropDict_3update = {"update", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4borg_4item_8PropDict_3update, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_4borg_4item_8PropDict_3update(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)2330 static PyObject *__pyx_pw_4borg_4item_8PropDict_3update(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2331 PyObject *__pyx_v_self = 0;
2332 PyObject *__pyx_v_d = 0;
2333 int __pyx_lineno = 0;
2334 const char *__pyx_filename = NULL;
2335 int __pyx_clineno = 0;
2336 PyObject *__pyx_r = 0;
2337 __Pyx_RefNannyDeclarations
2338 __Pyx_RefNannySetupContext("update (wrapper)", 0);
2339 {
2340 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_d,0};
2341 PyObject* values[2] = {0,0};
2342 if (unlikely(__pyx_kwds)) {
2343 Py_ssize_t kw_args;
2344 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2345 switch (pos_args) {
2346 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2347 CYTHON_FALLTHROUGH;
2348 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2349 CYTHON_FALLTHROUGH;
2350 case 0: break;
2351 default: goto __pyx_L5_argtuple_error;
2352 }
2353 kw_args = PyDict_Size(__pyx_kwds);
2354 switch (pos_args) {
2355 case 0:
2356 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
2357 else goto __pyx_L5_argtuple_error;
2358 CYTHON_FALLTHROUGH;
2359 case 1:
2360 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
2361 else {
2362 __Pyx_RaiseArgtupleInvalid("update", 1, 2, 2, 1); __PYX_ERR(0, 55, __pyx_L3_error)
2363 }
2364 }
2365 if (unlikely(kw_args > 0)) {
2366 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "update") < 0)) __PYX_ERR(0, 55, __pyx_L3_error)
2367 }
2368 } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
2369 goto __pyx_L5_argtuple_error;
2370 } else {
2371 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2372 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2373 }
2374 __pyx_v_self = values[0];
2375 __pyx_v_d = values[1];
2376 }
2377 goto __pyx_L4_argument_unpacking_done;
2378 __pyx_L5_argtuple_error:;
2379 __Pyx_RaiseArgtupleInvalid("update", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 55, __pyx_L3_error)
2380 __pyx_L3_error:;
2381 __Pyx_AddTraceback("borg.item.PropDict.update", __pyx_clineno, __pyx_lineno, __pyx_filename);
2382 __Pyx_RefNannyFinishContext();
2383 return NULL;
2384 __pyx_L4_argument_unpacking_done:;
2385 __pyx_r = __pyx_pf_4borg_4item_8PropDict_2update(__pyx_self, __pyx_v_self, __pyx_v_d);
2386
2387 /* function exit code */
2388 __Pyx_RefNannyFinishContext();
2389 return __pyx_r;
2390 }
2391
__pyx_pf_4borg_4item_8PropDict_2update(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_self,PyObject * __pyx_v_d)2392 static PyObject *__pyx_pf_4borg_4item_8PropDict_2update(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_d) {
2393 PyObject *__pyx_v_k = NULL;
2394 PyObject *__pyx_v_v = NULL;
2395 PyObject *__pyx_r = NULL;
2396 __Pyx_RefNannyDeclarations
2397 PyObject *__pyx_t_1 = NULL;
2398 Py_ssize_t __pyx_t_2;
2399 Py_ssize_t __pyx_t_3;
2400 int __pyx_t_4;
2401 PyObject *__pyx_t_5 = NULL;
2402 PyObject *__pyx_t_6 = NULL;
2403 int __pyx_t_7;
2404 int __pyx_t_8;
2405 int __pyx_t_9;
2406 PyObject *__pyx_t_10 = NULL;
2407 int __pyx_t_11;
2408 int __pyx_lineno = 0;
2409 const char *__pyx_filename = NULL;
2410 int __pyx_clineno = 0;
2411 __Pyx_RefNannySetupContext("update", 0);
2412
2413 /* "borg/item.pyx":56
2414 *
2415 * def update(self, d):
2416 * for k, v in d.items(): # <<<<<<<<<<<<<<
2417 * if isinstance(k, bytes):
2418 * k = k.decode()
2419 */
2420 __pyx_t_2 = 0;
2421 if (unlikely(__pyx_v_d == Py_None)) {
2422 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
2423 __PYX_ERR(0, 56, __pyx_L1_error)
2424 }
2425 __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_d, 0, __pyx_n_s_items, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 56, __pyx_L1_error)
2426 __Pyx_GOTREF(__pyx_t_5);
2427 __Pyx_XDECREF(__pyx_t_1);
2428 __pyx_t_1 = __pyx_t_5;
2429 __pyx_t_5 = 0;
2430 while (1) {
2431 __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4);
2432 if (unlikely(__pyx_t_7 == 0)) break;
2433 if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 56, __pyx_L1_error)
2434 __Pyx_GOTREF(__pyx_t_5);
2435 __Pyx_GOTREF(__pyx_t_6);
2436 __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_5);
2437 __pyx_t_5 = 0;
2438 __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_6);
2439 __pyx_t_6 = 0;
2440
2441 /* "borg/item.pyx":57
2442 * def update(self, d):
2443 * for k, v in d.items():
2444 * if isinstance(k, bytes): # <<<<<<<<<<<<<<
2445 * k = k.decode()
2446 * setattr(self, self._check_key(k), v)
2447 */
2448 __pyx_t_8 = PyBytes_Check(__pyx_v_k);
2449 __pyx_t_9 = (__pyx_t_8 != 0);
2450 if (__pyx_t_9) {
2451
2452 /* "borg/item.pyx":58
2453 * for k, v in d.items():
2454 * if isinstance(k, bytes):
2455 * k = k.decode() # <<<<<<<<<<<<<<
2456 * setattr(self, self._check_key(k), v)
2457 *
2458 */
2459 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_k, __pyx_n_s_decode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 58, __pyx_L1_error)
2460 __Pyx_GOTREF(__pyx_t_5);
2461 __pyx_t_10 = NULL;
2462 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
2463 __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5);
2464 if (likely(__pyx_t_10)) {
2465 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
2466 __Pyx_INCREF(__pyx_t_10);
2467 __Pyx_INCREF(function);
2468 __Pyx_DECREF_SET(__pyx_t_5, function);
2469 }
2470 }
2471 __pyx_t_6 = (__pyx_t_10) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_10) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
2472 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
2473 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 58, __pyx_L1_error)
2474 __Pyx_GOTREF(__pyx_t_6);
2475 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2476 __Pyx_DECREF_SET(__pyx_v_k, __pyx_t_6);
2477 __pyx_t_6 = 0;
2478
2479 /* "borg/item.pyx":57
2480 * def update(self, d):
2481 * for k, v in d.items():
2482 * if isinstance(k, bytes): # <<<<<<<<<<<<<<
2483 * k = k.decode()
2484 * setattr(self, self._check_key(k), v)
2485 */
2486 }
2487
2488 /* "borg/item.pyx":59
2489 * if isinstance(k, bytes):
2490 * k = k.decode()
2491 * setattr(self, self._check_key(k), v) # <<<<<<<<<<<<<<
2492 *
2493 * def update_internal(self, d):
2494 */
2495 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_check_key); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 59, __pyx_L1_error)
2496 __Pyx_GOTREF(__pyx_t_5);
2497 __pyx_t_10 = NULL;
2498 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
2499 __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5);
2500 if (likely(__pyx_t_10)) {
2501 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
2502 __Pyx_INCREF(__pyx_t_10);
2503 __Pyx_INCREF(function);
2504 __Pyx_DECREF_SET(__pyx_t_5, function);
2505 }
2506 }
2507 __pyx_t_6 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_10, __pyx_v_k) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_k);
2508 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
2509 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 59, __pyx_L1_error)
2510 __Pyx_GOTREF(__pyx_t_6);
2511 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2512 __pyx_t_11 = PyObject_SetAttr(__pyx_v_self, __pyx_t_6, __pyx_v_v); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 59, __pyx_L1_error)
2513 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2514 }
2515 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2516
2517 /* "borg/item.pyx":55
2518 * self.update(data)
2519 *
2520 * def update(self, d): # <<<<<<<<<<<<<<
2521 * for k, v in d.items():
2522 * if isinstance(k, bytes):
2523 */
2524
2525 /* function exit code */
2526 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2527 goto __pyx_L0;
2528 __pyx_L1_error:;
2529 __Pyx_XDECREF(__pyx_t_1);
2530 __Pyx_XDECREF(__pyx_t_5);
2531 __Pyx_XDECREF(__pyx_t_6);
2532 __Pyx_XDECREF(__pyx_t_10);
2533 __Pyx_AddTraceback("borg.item.PropDict.update", __pyx_clineno, __pyx_lineno, __pyx_filename);
2534 __pyx_r = NULL;
2535 __pyx_L0:;
2536 __Pyx_XDECREF(__pyx_v_k);
2537 __Pyx_XDECREF(__pyx_v_v);
2538 __Pyx_XGIVEREF(__pyx_r);
2539 __Pyx_RefNannyFinishContext();
2540 return __pyx_r;
2541 }
2542
2543 /* "borg/item.pyx":61
2544 * setattr(self, self._check_key(k), v)
2545 *
2546 * def update_internal(self, d): # <<<<<<<<<<<<<<
2547 * for k, v in d.items():
2548 * if isinstance(k, bytes):
2549 */
2550
2551 /* Python wrapper */
2552 static PyObject *__pyx_pw_4borg_4item_8PropDict_5update_internal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2553 static PyMethodDef __pyx_mdef_4borg_4item_8PropDict_5update_internal = {"update_internal", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4borg_4item_8PropDict_5update_internal, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_4borg_4item_8PropDict_5update_internal(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)2554 static PyObject *__pyx_pw_4borg_4item_8PropDict_5update_internal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2555 PyObject *__pyx_v_self = 0;
2556 PyObject *__pyx_v_d = 0;
2557 int __pyx_lineno = 0;
2558 const char *__pyx_filename = NULL;
2559 int __pyx_clineno = 0;
2560 PyObject *__pyx_r = 0;
2561 __Pyx_RefNannyDeclarations
2562 __Pyx_RefNannySetupContext("update_internal (wrapper)", 0);
2563 {
2564 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_d,0};
2565 PyObject* values[2] = {0,0};
2566 if (unlikely(__pyx_kwds)) {
2567 Py_ssize_t kw_args;
2568 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2569 switch (pos_args) {
2570 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2571 CYTHON_FALLTHROUGH;
2572 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2573 CYTHON_FALLTHROUGH;
2574 case 0: break;
2575 default: goto __pyx_L5_argtuple_error;
2576 }
2577 kw_args = PyDict_Size(__pyx_kwds);
2578 switch (pos_args) {
2579 case 0:
2580 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
2581 else goto __pyx_L5_argtuple_error;
2582 CYTHON_FALLTHROUGH;
2583 case 1:
2584 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
2585 else {
2586 __Pyx_RaiseArgtupleInvalid("update_internal", 1, 2, 2, 1); __PYX_ERR(0, 61, __pyx_L3_error)
2587 }
2588 }
2589 if (unlikely(kw_args > 0)) {
2590 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "update_internal") < 0)) __PYX_ERR(0, 61, __pyx_L3_error)
2591 }
2592 } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
2593 goto __pyx_L5_argtuple_error;
2594 } else {
2595 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2596 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2597 }
2598 __pyx_v_self = values[0];
2599 __pyx_v_d = values[1];
2600 }
2601 goto __pyx_L4_argument_unpacking_done;
2602 __pyx_L5_argtuple_error:;
2603 __Pyx_RaiseArgtupleInvalid("update_internal", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 61, __pyx_L3_error)
2604 __pyx_L3_error:;
2605 __Pyx_AddTraceback("borg.item.PropDict.update_internal", __pyx_clineno, __pyx_lineno, __pyx_filename);
2606 __Pyx_RefNannyFinishContext();
2607 return NULL;
2608 __pyx_L4_argument_unpacking_done:;
2609 __pyx_r = __pyx_pf_4borg_4item_8PropDict_4update_internal(__pyx_self, __pyx_v_self, __pyx_v_d);
2610
2611 /* function exit code */
2612 __Pyx_RefNannyFinishContext();
2613 return __pyx_r;
2614 }
2615
__pyx_pf_4borg_4item_8PropDict_4update_internal(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_self,PyObject * __pyx_v_d)2616 static PyObject *__pyx_pf_4borg_4item_8PropDict_4update_internal(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_d) {
2617 PyObject *__pyx_v_k = NULL;
2618 PyObject *__pyx_v_v = NULL;
2619 PyObject *__pyx_r = NULL;
2620 __Pyx_RefNannyDeclarations
2621 PyObject *__pyx_t_1 = NULL;
2622 Py_ssize_t __pyx_t_2;
2623 Py_ssize_t __pyx_t_3;
2624 int __pyx_t_4;
2625 PyObject *__pyx_t_5 = NULL;
2626 PyObject *__pyx_t_6 = NULL;
2627 int __pyx_t_7;
2628 int __pyx_t_8;
2629 int __pyx_t_9;
2630 PyObject *__pyx_t_10 = NULL;
2631 int __pyx_lineno = 0;
2632 const char *__pyx_filename = NULL;
2633 int __pyx_clineno = 0;
2634 __Pyx_RefNannySetupContext("update_internal", 0);
2635
2636 /* "borg/item.pyx":62
2637 *
2638 * def update_internal(self, d):
2639 * for k, v in d.items(): # <<<<<<<<<<<<<<
2640 * if isinstance(k, bytes):
2641 * k = k.decode()
2642 */
2643 __pyx_t_2 = 0;
2644 if (unlikely(__pyx_v_d == Py_None)) {
2645 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
2646 __PYX_ERR(0, 62, __pyx_L1_error)
2647 }
2648 __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_d, 0, __pyx_n_s_items, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 62, __pyx_L1_error)
2649 __Pyx_GOTREF(__pyx_t_5);
2650 __Pyx_XDECREF(__pyx_t_1);
2651 __pyx_t_1 = __pyx_t_5;
2652 __pyx_t_5 = 0;
2653 while (1) {
2654 __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4);
2655 if (unlikely(__pyx_t_7 == 0)) break;
2656 if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 62, __pyx_L1_error)
2657 __Pyx_GOTREF(__pyx_t_5);
2658 __Pyx_GOTREF(__pyx_t_6);
2659 __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_5);
2660 __pyx_t_5 = 0;
2661 __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_6);
2662 __pyx_t_6 = 0;
2663
2664 /* "borg/item.pyx":63
2665 * def update_internal(self, d):
2666 * for k, v in d.items():
2667 * if isinstance(k, bytes): # <<<<<<<<<<<<<<
2668 * k = k.decode()
2669 * self._dict[k] = v
2670 */
2671 __pyx_t_8 = PyBytes_Check(__pyx_v_k);
2672 __pyx_t_9 = (__pyx_t_8 != 0);
2673 if (__pyx_t_9) {
2674
2675 /* "borg/item.pyx":64
2676 * for k, v in d.items():
2677 * if isinstance(k, bytes):
2678 * k = k.decode() # <<<<<<<<<<<<<<
2679 * self._dict[k] = v
2680 *
2681 */
2682 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_k, __pyx_n_s_decode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 64, __pyx_L1_error)
2683 __Pyx_GOTREF(__pyx_t_5);
2684 __pyx_t_10 = NULL;
2685 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
2686 __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5);
2687 if (likely(__pyx_t_10)) {
2688 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
2689 __Pyx_INCREF(__pyx_t_10);
2690 __Pyx_INCREF(function);
2691 __Pyx_DECREF_SET(__pyx_t_5, function);
2692 }
2693 }
2694 __pyx_t_6 = (__pyx_t_10) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_10) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
2695 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
2696 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 64, __pyx_L1_error)
2697 __Pyx_GOTREF(__pyx_t_6);
2698 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2699 __Pyx_DECREF_SET(__pyx_v_k, __pyx_t_6);
2700 __pyx_t_6 = 0;
2701
2702 /* "borg/item.pyx":63
2703 * def update_internal(self, d):
2704 * for k, v in d.items():
2705 * if isinstance(k, bytes): # <<<<<<<<<<<<<<
2706 * k = k.decode()
2707 * self._dict[k] = v
2708 */
2709 }
2710
2711 /* "borg/item.pyx":65
2712 * if isinstance(k, bytes):
2713 * k = k.decode()
2714 * self._dict[k] = v # <<<<<<<<<<<<<<
2715 *
2716 * def __eq__(self, other):
2717 */
2718 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 65, __pyx_L1_error)
2719 __Pyx_GOTREF(__pyx_t_6);
2720 if (unlikely(PyObject_SetItem(__pyx_t_6, __pyx_v_k, __pyx_v_v) < 0)) __PYX_ERR(0, 65, __pyx_L1_error)
2721 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2722 }
2723 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2724
2725 /* "borg/item.pyx":61
2726 * setattr(self, self._check_key(k), v)
2727 *
2728 * def update_internal(self, d): # <<<<<<<<<<<<<<
2729 * for k, v in d.items():
2730 * if isinstance(k, bytes):
2731 */
2732
2733 /* function exit code */
2734 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2735 goto __pyx_L0;
2736 __pyx_L1_error:;
2737 __Pyx_XDECREF(__pyx_t_1);
2738 __Pyx_XDECREF(__pyx_t_5);
2739 __Pyx_XDECREF(__pyx_t_6);
2740 __Pyx_XDECREF(__pyx_t_10);
2741 __Pyx_AddTraceback("borg.item.PropDict.update_internal", __pyx_clineno, __pyx_lineno, __pyx_filename);
2742 __pyx_r = NULL;
2743 __pyx_L0:;
2744 __Pyx_XDECREF(__pyx_v_k);
2745 __Pyx_XDECREF(__pyx_v_v);
2746 __Pyx_XGIVEREF(__pyx_r);
2747 __Pyx_RefNannyFinishContext();
2748 return __pyx_r;
2749 }
2750
2751 /* "borg/item.pyx":67
2752 * self._dict[k] = v
2753 *
2754 * def __eq__(self, other): # <<<<<<<<<<<<<<
2755 * return self.as_dict() == other.as_dict()
2756 *
2757 */
2758
2759 /* Python wrapper */
2760 static PyObject *__pyx_pw_4borg_4item_8PropDict_7__eq__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2761 static PyMethodDef __pyx_mdef_4borg_4item_8PropDict_7__eq__ = {"__eq__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4borg_4item_8PropDict_7__eq__, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_4borg_4item_8PropDict_7__eq__(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)2762 static PyObject *__pyx_pw_4borg_4item_8PropDict_7__eq__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2763 PyObject *__pyx_v_self = 0;
2764 PyObject *__pyx_v_other = 0;
2765 int __pyx_lineno = 0;
2766 const char *__pyx_filename = NULL;
2767 int __pyx_clineno = 0;
2768 PyObject *__pyx_r = 0;
2769 __Pyx_RefNannyDeclarations
2770 __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
2771 {
2772 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other,0};
2773 PyObject* values[2] = {0,0};
2774 if (unlikely(__pyx_kwds)) {
2775 Py_ssize_t kw_args;
2776 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2777 switch (pos_args) {
2778 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2779 CYTHON_FALLTHROUGH;
2780 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2781 CYTHON_FALLTHROUGH;
2782 case 0: break;
2783 default: goto __pyx_L5_argtuple_error;
2784 }
2785 kw_args = PyDict_Size(__pyx_kwds);
2786 switch (pos_args) {
2787 case 0:
2788 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
2789 else goto __pyx_L5_argtuple_error;
2790 CYTHON_FALLTHROUGH;
2791 case 1:
2792 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
2793 else {
2794 __Pyx_RaiseArgtupleInvalid("__eq__", 1, 2, 2, 1); __PYX_ERR(0, 67, __pyx_L3_error)
2795 }
2796 }
2797 if (unlikely(kw_args > 0)) {
2798 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__eq__") < 0)) __PYX_ERR(0, 67, __pyx_L3_error)
2799 }
2800 } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
2801 goto __pyx_L5_argtuple_error;
2802 } else {
2803 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2804 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2805 }
2806 __pyx_v_self = values[0];
2807 __pyx_v_other = values[1];
2808 }
2809 goto __pyx_L4_argument_unpacking_done;
2810 __pyx_L5_argtuple_error:;
2811 __Pyx_RaiseArgtupleInvalid("__eq__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 67, __pyx_L3_error)
2812 __pyx_L3_error:;
2813 __Pyx_AddTraceback("borg.item.PropDict.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2814 __Pyx_RefNannyFinishContext();
2815 return NULL;
2816 __pyx_L4_argument_unpacking_done:;
2817 __pyx_r = __pyx_pf_4borg_4item_8PropDict_6__eq__(__pyx_self, __pyx_v_self, __pyx_v_other);
2818
2819 /* function exit code */
2820 __Pyx_RefNannyFinishContext();
2821 return __pyx_r;
2822 }
2823
__pyx_pf_4borg_4item_8PropDict_6__eq__(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_self,PyObject * __pyx_v_other)2824 static PyObject *__pyx_pf_4borg_4item_8PropDict_6__eq__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
2825 PyObject *__pyx_r = NULL;
2826 __Pyx_RefNannyDeclarations
2827 PyObject *__pyx_t_1 = NULL;
2828 PyObject *__pyx_t_2 = NULL;
2829 PyObject *__pyx_t_3 = NULL;
2830 PyObject *__pyx_t_4 = NULL;
2831 int __pyx_lineno = 0;
2832 const char *__pyx_filename = NULL;
2833 int __pyx_clineno = 0;
2834 __Pyx_RefNannySetupContext("__eq__", 0);
2835
2836 /* "borg/item.pyx":68
2837 *
2838 * def __eq__(self, other):
2839 * return self.as_dict() == other.as_dict() # <<<<<<<<<<<<<<
2840 *
2841 * def __repr__(self):
2842 */
2843 __Pyx_XDECREF(__pyx_r);
2844 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_as_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 68, __pyx_L1_error)
2845 __Pyx_GOTREF(__pyx_t_2);
2846 __pyx_t_3 = NULL;
2847 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
2848 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
2849 if (likely(__pyx_t_3)) {
2850 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
2851 __Pyx_INCREF(__pyx_t_3);
2852 __Pyx_INCREF(function);
2853 __Pyx_DECREF_SET(__pyx_t_2, function);
2854 }
2855 }
2856 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
2857 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
2858 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error)
2859 __Pyx_GOTREF(__pyx_t_1);
2860 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2861 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_as_dict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 68, __pyx_L1_error)
2862 __Pyx_GOTREF(__pyx_t_3);
2863 __pyx_t_4 = NULL;
2864 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
2865 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
2866 if (likely(__pyx_t_4)) {
2867 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
2868 __Pyx_INCREF(__pyx_t_4);
2869 __Pyx_INCREF(function);
2870 __Pyx_DECREF_SET(__pyx_t_3, function);
2871 }
2872 }
2873 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
2874 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
2875 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 68, __pyx_L1_error)
2876 __Pyx_GOTREF(__pyx_t_2);
2877 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2878 __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 68, __pyx_L1_error)
2879 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2880 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2881 __pyx_r = __pyx_t_3;
2882 __pyx_t_3 = 0;
2883 goto __pyx_L0;
2884
2885 /* "borg/item.pyx":67
2886 * self._dict[k] = v
2887 *
2888 * def __eq__(self, other): # <<<<<<<<<<<<<<
2889 * return self.as_dict() == other.as_dict()
2890 *
2891 */
2892
2893 /* function exit code */
2894 __pyx_L1_error:;
2895 __Pyx_XDECREF(__pyx_t_1);
2896 __Pyx_XDECREF(__pyx_t_2);
2897 __Pyx_XDECREF(__pyx_t_3);
2898 __Pyx_XDECREF(__pyx_t_4);
2899 __Pyx_AddTraceback("borg.item.PropDict.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2900 __pyx_r = NULL;
2901 __pyx_L0:;
2902 __Pyx_XGIVEREF(__pyx_r);
2903 __Pyx_RefNannyFinishContext();
2904 return __pyx_r;
2905 }
2906
2907 /* "borg/item.pyx":70
2908 * return self.as_dict() == other.as_dict()
2909 *
2910 * def __repr__(self): # <<<<<<<<<<<<<<
2911 * return '%s(internal_dict=%r)' % (self.__class__.__name__, self._dict)
2912 *
2913 */
2914
2915 /* Python wrapper */
2916 static PyObject *__pyx_pw_4borg_4item_8PropDict_9__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
2917 static PyMethodDef __pyx_mdef_4borg_4item_8PropDict_9__repr__ = {"__repr__", (PyCFunction)__pyx_pw_4borg_4item_8PropDict_9__repr__, METH_O, 0};
__pyx_pw_4borg_4item_8PropDict_9__repr__(PyObject * __pyx_self,PyObject * __pyx_v_self)2918 static PyObject *__pyx_pw_4borg_4item_8PropDict_9__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
2919 PyObject *__pyx_r = 0;
2920 __Pyx_RefNannyDeclarations
2921 __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
2922 __pyx_r = __pyx_pf_4borg_4item_8PropDict_8__repr__(__pyx_self, ((PyObject *)__pyx_v_self));
2923
2924 /* function exit code */
2925 __Pyx_RefNannyFinishContext();
2926 return __pyx_r;
2927 }
2928
__pyx_pf_4borg_4item_8PropDict_8__repr__(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_self)2929 static PyObject *__pyx_pf_4borg_4item_8PropDict_8__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
2930 PyObject *__pyx_r = NULL;
2931 __Pyx_RefNannyDeclarations
2932 PyObject *__pyx_t_1 = NULL;
2933 Py_ssize_t __pyx_t_2;
2934 Py_UCS4 __pyx_t_3;
2935 PyObject *__pyx_t_4 = NULL;
2936 PyObject *__pyx_t_5 = NULL;
2937 int __pyx_lineno = 0;
2938 const char *__pyx_filename = NULL;
2939 int __pyx_clineno = 0;
2940 __Pyx_RefNannySetupContext("__repr__", 0);
2941
2942 /* "borg/item.pyx":71
2943 *
2944 * def __repr__(self):
2945 * return '%s(internal_dict=%r)' % (self.__class__.__name__, self._dict) # <<<<<<<<<<<<<<
2946 *
2947 * def as_dict(self):
2948 */
2949 __Pyx_XDECREF(__pyx_r);
2950 __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error)
2951 __Pyx_GOTREF(__pyx_t_1);
2952 __pyx_t_2 = 0;
2953 __pyx_t_3 = 127;
2954 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 71, __pyx_L1_error)
2955 __Pyx_GOTREF(__pyx_t_4);
2956 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 71, __pyx_L1_error)
2957 __Pyx_GOTREF(__pyx_t_5);
2958 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2959 __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_5), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 71, __pyx_L1_error)
2960 __Pyx_GOTREF(__pyx_t_4);
2961 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2962 __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
2963 __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
2964 __Pyx_GIVEREF(__pyx_t_4);
2965 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
2966 __pyx_t_4 = 0;
2967 __Pyx_INCREF(__pyx_kp_u_internal_dict_2);
2968 __pyx_t_2 += 15;
2969 __Pyx_GIVEREF(__pyx_kp_u_internal_dict_2);
2970 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_internal_dict_2);
2971 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 71, __pyx_L1_error)
2972 __Pyx_GOTREF(__pyx_t_4);
2973 __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 71, __pyx_L1_error)
2974 __Pyx_GOTREF(__pyx_t_5);
2975 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2976 __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
2977 __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
2978 __Pyx_GIVEREF(__pyx_t_5);
2979 PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_5);
2980 __pyx_t_5 = 0;
2981 __Pyx_INCREF(__pyx_kp_u__3);
2982 __pyx_t_2 += 1;
2983 __Pyx_GIVEREF(__pyx_kp_u__3);
2984 PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u__3);
2985 __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 4, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 71, __pyx_L1_error)
2986 __Pyx_GOTREF(__pyx_t_5);
2987 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2988 __pyx_r = __pyx_t_5;
2989 __pyx_t_5 = 0;
2990 goto __pyx_L0;
2991
2992 /* "borg/item.pyx":70
2993 * return self.as_dict() == other.as_dict()
2994 *
2995 * def __repr__(self): # <<<<<<<<<<<<<<
2996 * return '%s(internal_dict=%r)' % (self.__class__.__name__, self._dict)
2997 *
2998 */
2999
3000 /* function exit code */
3001 __pyx_L1_error:;
3002 __Pyx_XDECREF(__pyx_t_1);
3003 __Pyx_XDECREF(__pyx_t_4);
3004 __Pyx_XDECREF(__pyx_t_5);
3005 __Pyx_AddTraceback("borg.item.PropDict.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3006 __pyx_r = NULL;
3007 __pyx_L0:;
3008 __Pyx_XGIVEREF(__pyx_r);
3009 __Pyx_RefNannyFinishContext();
3010 return __pyx_r;
3011 }
3012
3013 /* "borg/item.pyx":73
3014 * return '%s(internal_dict=%r)' % (self.__class__.__name__, self._dict)
3015 *
3016 * def as_dict(self): # <<<<<<<<<<<<<<
3017 * """return the internal dictionary"""
3018 * return StableDict(self._dict)
3019 */
3020
3021 /* Python wrapper */
3022 static PyObject *__pyx_pw_4borg_4item_8PropDict_11as_dict(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
3023 static char __pyx_doc_4borg_4item_8PropDict_10as_dict[] = "return the internal dictionary";
3024 static PyMethodDef __pyx_mdef_4borg_4item_8PropDict_11as_dict = {"as_dict", (PyCFunction)__pyx_pw_4borg_4item_8PropDict_11as_dict, METH_O, __pyx_doc_4borg_4item_8PropDict_10as_dict};
__pyx_pw_4borg_4item_8PropDict_11as_dict(PyObject * __pyx_self,PyObject * __pyx_v_self)3025 static PyObject *__pyx_pw_4borg_4item_8PropDict_11as_dict(PyObject *__pyx_self, PyObject *__pyx_v_self) {
3026 PyObject *__pyx_r = 0;
3027 __Pyx_RefNannyDeclarations
3028 __Pyx_RefNannySetupContext("as_dict (wrapper)", 0);
3029 __pyx_r = __pyx_pf_4borg_4item_8PropDict_10as_dict(__pyx_self, ((PyObject *)__pyx_v_self));
3030
3031 /* function exit code */
3032 __Pyx_RefNannyFinishContext();
3033 return __pyx_r;
3034 }
3035
__pyx_pf_4borg_4item_8PropDict_10as_dict(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_self)3036 static PyObject *__pyx_pf_4borg_4item_8PropDict_10as_dict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
3037 PyObject *__pyx_r = NULL;
3038 __Pyx_RefNannyDeclarations
3039 PyObject *__pyx_t_1 = NULL;
3040 PyObject *__pyx_t_2 = NULL;
3041 PyObject *__pyx_t_3 = NULL;
3042 PyObject *__pyx_t_4 = NULL;
3043 int __pyx_lineno = 0;
3044 const char *__pyx_filename = NULL;
3045 int __pyx_clineno = 0;
3046 __Pyx_RefNannySetupContext("as_dict", 0);
3047
3048 /* "borg/item.pyx":75
3049 * def as_dict(self):
3050 * """return the internal dictionary"""
3051 * return StableDict(self._dict) # <<<<<<<<<<<<<<
3052 *
3053 * def _check_key(self, key):
3054 */
3055 __Pyx_XDECREF(__pyx_r);
3056 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_StableDict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __pyx_L1_error)
3057 __Pyx_GOTREF(__pyx_t_2);
3058 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 75, __pyx_L1_error)
3059 __Pyx_GOTREF(__pyx_t_3);
3060 __pyx_t_4 = NULL;
3061 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
3062 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
3063 if (likely(__pyx_t_4)) {
3064 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3065 __Pyx_INCREF(__pyx_t_4);
3066 __Pyx_INCREF(function);
3067 __Pyx_DECREF_SET(__pyx_t_2, function);
3068 }
3069 }
3070 __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
3071 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3072 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3073 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error)
3074 __Pyx_GOTREF(__pyx_t_1);
3075 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3076 __pyx_r = __pyx_t_1;
3077 __pyx_t_1 = 0;
3078 goto __pyx_L0;
3079
3080 /* "borg/item.pyx":73
3081 * return '%s(internal_dict=%r)' % (self.__class__.__name__, self._dict)
3082 *
3083 * def as_dict(self): # <<<<<<<<<<<<<<
3084 * """return the internal dictionary"""
3085 * return StableDict(self._dict)
3086 */
3087
3088 /* function exit code */
3089 __pyx_L1_error:;
3090 __Pyx_XDECREF(__pyx_t_1);
3091 __Pyx_XDECREF(__pyx_t_2);
3092 __Pyx_XDECREF(__pyx_t_3);
3093 __Pyx_XDECREF(__pyx_t_4);
3094 __Pyx_AddTraceback("borg.item.PropDict.as_dict", __pyx_clineno, __pyx_lineno, __pyx_filename);
3095 __pyx_r = NULL;
3096 __pyx_L0:;
3097 __Pyx_XGIVEREF(__pyx_r);
3098 __Pyx_RefNannyFinishContext();
3099 return __pyx_r;
3100 }
3101
3102 /* "borg/item.pyx":77
3103 * return StableDict(self._dict)
3104 *
3105 * def _check_key(self, key): # <<<<<<<<<<<<<<
3106 * """make sure key is of type str and known"""
3107 * if not isinstance(key, str):
3108 */
3109
3110 /* Python wrapper */
3111 static PyObject *__pyx_pw_4borg_4item_8PropDict_13_check_key(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3112 static char __pyx_doc_4borg_4item_8PropDict_12_check_key[] = "make sure key is of type str and known";
3113 static PyMethodDef __pyx_mdef_4borg_4item_8PropDict_13_check_key = {"_check_key", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4borg_4item_8PropDict_13_check_key, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4borg_4item_8PropDict_12_check_key};
__pyx_pw_4borg_4item_8PropDict_13_check_key(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)3114 static PyObject *__pyx_pw_4borg_4item_8PropDict_13_check_key(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3115 PyObject *__pyx_v_self = 0;
3116 PyObject *__pyx_v_key = 0;
3117 int __pyx_lineno = 0;
3118 const char *__pyx_filename = NULL;
3119 int __pyx_clineno = 0;
3120 PyObject *__pyx_r = 0;
3121 __Pyx_RefNannyDeclarations
3122 __Pyx_RefNannySetupContext("_check_key (wrapper)", 0);
3123 {
3124 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,0};
3125 PyObject* values[2] = {0,0};
3126 if (unlikely(__pyx_kwds)) {
3127 Py_ssize_t kw_args;
3128 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3129 switch (pos_args) {
3130 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3131 CYTHON_FALLTHROUGH;
3132 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3133 CYTHON_FALLTHROUGH;
3134 case 0: break;
3135 default: goto __pyx_L5_argtuple_error;
3136 }
3137 kw_args = PyDict_Size(__pyx_kwds);
3138 switch (pos_args) {
3139 case 0:
3140 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
3141 else goto __pyx_L5_argtuple_error;
3142 CYTHON_FALLTHROUGH;
3143 case 1:
3144 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
3145 else {
3146 __Pyx_RaiseArgtupleInvalid("_check_key", 1, 2, 2, 1); __PYX_ERR(0, 77, __pyx_L3_error)
3147 }
3148 }
3149 if (unlikely(kw_args > 0)) {
3150 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_check_key") < 0)) __PYX_ERR(0, 77, __pyx_L3_error)
3151 }
3152 } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
3153 goto __pyx_L5_argtuple_error;
3154 } else {
3155 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3156 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3157 }
3158 __pyx_v_self = values[0];
3159 __pyx_v_key = values[1];
3160 }
3161 goto __pyx_L4_argument_unpacking_done;
3162 __pyx_L5_argtuple_error:;
3163 __Pyx_RaiseArgtupleInvalid("_check_key", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 77, __pyx_L3_error)
3164 __pyx_L3_error:;
3165 __Pyx_AddTraceback("borg.item.PropDict._check_key", __pyx_clineno, __pyx_lineno, __pyx_filename);
3166 __Pyx_RefNannyFinishContext();
3167 return NULL;
3168 __pyx_L4_argument_unpacking_done:;
3169 __pyx_r = __pyx_pf_4borg_4item_8PropDict_12_check_key(__pyx_self, __pyx_v_self, __pyx_v_key);
3170
3171 /* function exit code */
3172 __Pyx_RefNannyFinishContext();
3173 return __pyx_r;
3174 }
3175
__pyx_pf_4borg_4item_8PropDict_12_check_key(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_self,PyObject * __pyx_v_key)3176 static PyObject *__pyx_pf_4borg_4item_8PropDict_12_check_key(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
3177 PyObject *__pyx_r = NULL;
3178 __Pyx_RefNannyDeclarations
3179 int __pyx_t_1;
3180 int __pyx_t_2;
3181 PyObject *__pyx_t_3 = NULL;
3182 PyObject *__pyx_t_4 = NULL;
3183 int __pyx_lineno = 0;
3184 const char *__pyx_filename = NULL;
3185 int __pyx_clineno = 0;
3186 __Pyx_RefNannySetupContext("_check_key", 0);
3187
3188 /* "borg/item.pyx":79
3189 * def _check_key(self, key):
3190 * """make sure key is of type str and known"""
3191 * if not isinstance(key, str): # <<<<<<<<<<<<<<
3192 * raise TypeError("key must be str")
3193 * if key not in self.VALID_KEYS:
3194 */
3195 __pyx_t_1 = PyUnicode_Check(__pyx_v_key);
3196 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
3197 if (unlikely(__pyx_t_2)) {
3198
3199 /* "borg/item.pyx":80
3200 * """make sure key is of type str and known"""
3201 * if not isinstance(key, str):
3202 * raise TypeError("key must be str") # <<<<<<<<<<<<<<
3203 * if key not in self.VALID_KEYS:
3204 * raise ValueError("key '%s' is not a valid key" % key)
3205 */
3206 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L1_error)
3207 __Pyx_GOTREF(__pyx_t_3);
3208 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
3209 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3210 __PYX_ERR(0, 80, __pyx_L1_error)
3211
3212 /* "borg/item.pyx":79
3213 * def _check_key(self, key):
3214 * """make sure key is of type str and known"""
3215 * if not isinstance(key, str): # <<<<<<<<<<<<<<
3216 * raise TypeError("key must be str")
3217 * if key not in self.VALID_KEYS:
3218 */
3219 }
3220
3221 /* "borg/item.pyx":81
3222 * if not isinstance(key, str):
3223 * raise TypeError("key must be str")
3224 * if key not in self.VALID_KEYS: # <<<<<<<<<<<<<<
3225 * raise ValueError("key '%s' is not a valid key" % key)
3226 * return key
3227 */
3228 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_VALID_KEYS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 81, __pyx_L1_error)
3229 __Pyx_GOTREF(__pyx_t_3);
3230 __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_key, __pyx_t_3, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 81, __pyx_L1_error)
3231 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3232 __pyx_t_1 = (__pyx_t_2 != 0);
3233 if (unlikely(__pyx_t_1)) {
3234
3235 /* "borg/item.pyx":82
3236 * raise TypeError("key must be str")
3237 * if key not in self.VALID_KEYS:
3238 * raise ValueError("key '%s' is not a valid key" % key) # <<<<<<<<<<<<<<
3239 * return key
3240 *
3241 */
3242 __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_key_s_is_not_a_valid_key, __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 82, __pyx_L1_error)
3243 __Pyx_GOTREF(__pyx_t_3);
3244 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 82, __pyx_L1_error)
3245 __Pyx_GOTREF(__pyx_t_4);
3246 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3247 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
3248 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3249 __PYX_ERR(0, 82, __pyx_L1_error)
3250
3251 /* "borg/item.pyx":81
3252 * if not isinstance(key, str):
3253 * raise TypeError("key must be str")
3254 * if key not in self.VALID_KEYS: # <<<<<<<<<<<<<<
3255 * raise ValueError("key '%s' is not a valid key" % key)
3256 * return key
3257 */
3258 }
3259
3260 /* "borg/item.pyx":83
3261 * if key not in self.VALID_KEYS:
3262 * raise ValueError("key '%s' is not a valid key" % key)
3263 * return key # <<<<<<<<<<<<<<
3264 *
3265 * def __contains__(self, key):
3266 */
3267 __Pyx_XDECREF(__pyx_r);
3268 __Pyx_INCREF(__pyx_v_key);
3269 __pyx_r = __pyx_v_key;
3270 goto __pyx_L0;
3271
3272 /* "borg/item.pyx":77
3273 * return StableDict(self._dict)
3274 *
3275 * def _check_key(self, key): # <<<<<<<<<<<<<<
3276 * """make sure key is of type str and known"""
3277 * if not isinstance(key, str):
3278 */
3279
3280 /* function exit code */
3281 __pyx_L1_error:;
3282 __Pyx_XDECREF(__pyx_t_3);
3283 __Pyx_XDECREF(__pyx_t_4);
3284 __Pyx_AddTraceback("borg.item.PropDict._check_key", __pyx_clineno, __pyx_lineno, __pyx_filename);
3285 __pyx_r = NULL;
3286 __pyx_L0:;
3287 __Pyx_XGIVEREF(__pyx_r);
3288 __Pyx_RefNannyFinishContext();
3289 return __pyx_r;
3290 }
3291
3292 /* "borg/item.pyx":85
3293 * return key
3294 *
3295 * def __contains__(self, key): # <<<<<<<<<<<<<<
3296 * """do we have this key?"""
3297 * return self._check_key(key) in self._dict
3298 */
3299
3300 /* Python wrapper */
3301 static PyObject *__pyx_pw_4borg_4item_8PropDict_15__contains__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3302 static char __pyx_doc_4borg_4item_8PropDict_14__contains__[] = "do we have this key?";
3303 static PyMethodDef __pyx_mdef_4borg_4item_8PropDict_15__contains__ = {"__contains__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4borg_4item_8PropDict_15__contains__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4borg_4item_8PropDict_14__contains__};
__pyx_pw_4borg_4item_8PropDict_15__contains__(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)3304 static PyObject *__pyx_pw_4borg_4item_8PropDict_15__contains__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3305 PyObject *__pyx_v_self = 0;
3306 PyObject *__pyx_v_key = 0;
3307 int __pyx_lineno = 0;
3308 const char *__pyx_filename = NULL;
3309 int __pyx_clineno = 0;
3310 PyObject *__pyx_r = 0;
3311 __Pyx_RefNannyDeclarations
3312 __Pyx_RefNannySetupContext("__contains__ (wrapper)", 0);
3313 {
3314 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,0};
3315 PyObject* values[2] = {0,0};
3316 if (unlikely(__pyx_kwds)) {
3317 Py_ssize_t kw_args;
3318 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3319 switch (pos_args) {
3320 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3321 CYTHON_FALLTHROUGH;
3322 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3323 CYTHON_FALLTHROUGH;
3324 case 0: break;
3325 default: goto __pyx_L5_argtuple_error;
3326 }
3327 kw_args = PyDict_Size(__pyx_kwds);
3328 switch (pos_args) {
3329 case 0:
3330 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
3331 else goto __pyx_L5_argtuple_error;
3332 CYTHON_FALLTHROUGH;
3333 case 1:
3334 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
3335 else {
3336 __Pyx_RaiseArgtupleInvalid("__contains__", 1, 2, 2, 1); __PYX_ERR(0, 85, __pyx_L3_error)
3337 }
3338 }
3339 if (unlikely(kw_args > 0)) {
3340 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__contains__") < 0)) __PYX_ERR(0, 85, __pyx_L3_error)
3341 }
3342 } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
3343 goto __pyx_L5_argtuple_error;
3344 } else {
3345 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3346 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3347 }
3348 __pyx_v_self = values[0];
3349 __pyx_v_key = values[1];
3350 }
3351 goto __pyx_L4_argument_unpacking_done;
3352 __pyx_L5_argtuple_error:;
3353 __Pyx_RaiseArgtupleInvalid("__contains__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 85, __pyx_L3_error)
3354 __pyx_L3_error:;
3355 __Pyx_AddTraceback("borg.item.PropDict.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3356 __Pyx_RefNannyFinishContext();
3357 return NULL;
3358 __pyx_L4_argument_unpacking_done:;
3359 __pyx_r = __pyx_pf_4borg_4item_8PropDict_14__contains__(__pyx_self, __pyx_v_self, __pyx_v_key);
3360
3361 /* function exit code */
3362 __Pyx_RefNannyFinishContext();
3363 return __pyx_r;
3364 }
3365
__pyx_pf_4borg_4item_8PropDict_14__contains__(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_self,PyObject * __pyx_v_key)3366 static PyObject *__pyx_pf_4borg_4item_8PropDict_14__contains__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
3367 PyObject *__pyx_r = NULL;
3368 __Pyx_RefNannyDeclarations
3369 PyObject *__pyx_t_1 = NULL;
3370 PyObject *__pyx_t_2 = NULL;
3371 PyObject *__pyx_t_3 = NULL;
3372 int __pyx_t_4;
3373 int __pyx_lineno = 0;
3374 const char *__pyx_filename = NULL;
3375 int __pyx_clineno = 0;
3376 __Pyx_RefNannySetupContext("__contains__", 0);
3377
3378 /* "borg/item.pyx":87
3379 * def __contains__(self, key):
3380 * """do we have this key?"""
3381 * return self._check_key(key) in self._dict # <<<<<<<<<<<<<<
3382 *
3383 * def get(self, key, default=None):
3384 */
3385 __Pyx_XDECREF(__pyx_r);
3386 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_check_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error)
3387 __Pyx_GOTREF(__pyx_t_2);
3388 __pyx_t_3 = NULL;
3389 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
3390 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
3391 if (likely(__pyx_t_3)) {
3392 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3393 __Pyx_INCREF(__pyx_t_3);
3394 __Pyx_INCREF(function);
3395 __Pyx_DECREF_SET(__pyx_t_2, function);
3396 }
3397 }
3398 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key);
3399 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3400 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error)
3401 __Pyx_GOTREF(__pyx_t_1);
3402 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3403 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error)
3404 __Pyx_GOTREF(__pyx_t_2);
3405 __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 87, __pyx_L1_error)
3406 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3407 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3408 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error)
3409 __Pyx_GOTREF(__pyx_t_2);
3410 __pyx_r = __pyx_t_2;
3411 __pyx_t_2 = 0;
3412 goto __pyx_L0;
3413
3414 /* "borg/item.pyx":85
3415 * return key
3416 *
3417 * def __contains__(self, key): # <<<<<<<<<<<<<<
3418 * """do we have this key?"""
3419 * return self._check_key(key) in self._dict
3420 */
3421
3422 /* function exit code */
3423 __pyx_L1_error:;
3424 __Pyx_XDECREF(__pyx_t_1);
3425 __Pyx_XDECREF(__pyx_t_2);
3426 __Pyx_XDECREF(__pyx_t_3);
3427 __Pyx_AddTraceback("borg.item.PropDict.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3428 __pyx_r = NULL;
3429 __pyx_L0:;
3430 __Pyx_XGIVEREF(__pyx_r);
3431 __Pyx_RefNannyFinishContext();
3432 return __pyx_r;
3433 }
3434
3435 /* "borg/item.pyx":89
3436 * return self._check_key(key) in self._dict
3437 *
3438 * def get(self, key, default=None): # <<<<<<<<<<<<<<
3439 * """get value for key, return default if key does not exist"""
3440 * return getattr(self, self._check_key(key), default)
3441 */
3442
3443 /* Python wrapper */
3444 static PyObject *__pyx_pw_4borg_4item_8PropDict_17get(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3445 static char __pyx_doc_4borg_4item_8PropDict_16get[] = "get value for key, return default if key does not exist";
3446 static PyMethodDef __pyx_mdef_4borg_4item_8PropDict_17get = {"get", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4borg_4item_8PropDict_17get, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4borg_4item_8PropDict_16get};
__pyx_pw_4borg_4item_8PropDict_17get(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)3447 static PyObject *__pyx_pw_4borg_4item_8PropDict_17get(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3448 PyObject *__pyx_v_self = 0;
3449 PyObject *__pyx_v_key = 0;
3450 PyObject *__pyx_v_default = 0;
3451 int __pyx_lineno = 0;
3452 const char *__pyx_filename = NULL;
3453 int __pyx_clineno = 0;
3454 PyObject *__pyx_r = 0;
3455 __Pyx_RefNannyDeclarations
3456 __Pyx_RefNannySetupContext("get (wrapper)", 0);
3457 {
3458 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_key,&__pyx_n_s_default,0};
3459 PyObject* values[3] = {0,0,0};
3460 values[2] = ((PyObject *)((PyObject *)Py_None));
3461 if (unlikely(__pyx_kwds)) {
3462 Py_ssize_t kw_args;
3463 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3464 switch (pos_args) {
3465 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3466 CYTHON_FALLTHROUGH;
3467 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3468 CYTHON_FALLTHROUGH;
3469 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3470 CYTHON_FALLTHROUGH;
3471 case 0: break;
3472 default: goto __pyx_L5_argtuple_error;
3473 }
3474 kw_args = PyDict_Size(__pyx_kwds);
3475 switch (pos_args) {
3476 case 0:
3477 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
3478 else goto __pyx_L5_argtuple_error;
3479 CYTHON_FALLTHROUGH;
3480 case 1:
3481 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
3482 else {
3483 __Pyx_RaiseArgtupleInvalid("get", 0, 2, 3, 1); __PYX_ERR(0, 89, __pyx_L3_error)
3484 }
3485 CYTHON_FALLTHROUGH;
3486 case 2:
3487 if (kw_args > 0) {
3488 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_default);
3489 if (value) { values[2] = value; kw_args--; }
3490 }
3491 }
3492 if (unlikely(kw_args > 0)) {
3493 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) __PYX_ERR(0, 89, __pyx_L3_error)
3494 }
3495 } else {
3496 switch (PyTuple_GET_SIZE(__pyx_args)) {
3497 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3498 CYTHON_FALLTHROUGH;
3499 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3500 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3501 break;
3502 default: goto __pyx_L5_argtuple_error;
3503 }
3504 }
3505 __pyx_v_self = values[0];
3506 __pyx_v_key = values[1];
3507 __pyx_v_default = values[2];
3508 }
3509 goto __pyx_L4_argument_unpacking_done;
3510 __pyx_L5_argtuple_error:;
3511 __Pyx_RaiseArgtupleInvalid("get", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 89, __pyx_L3_error)
3512 __pyx_L3_error:;
3513 __Pyx_AddTraceback("borg.item.PropDict.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
3514 __Pyx_RefNannyFinishContext();
3515 return NULL;
3516 __pyx_L4_argument_unpacking_done:;
3517 __pyx_r = __pyx_pf_4borg_4item_8PropDict_16get(__pyx_self, __pyx_v_self, __pyx_v_key, __pyx_v_default);
3518
3519 /* function exit code */
3520 __Pyx_RefNannyFinishContext();
3521 return __pyx_r;
3522 }
3523
__pyx_pf_4borg_4item_8PropDict_16get(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_self,PyObject * __pyx_v_key,PyObject * __pyx_v_default)3524 static PyObject *__pyx_pf_4borg_4item_8PropDict_16get(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_default) {
3525 PyObject *__pyx_r = NULL;
3526 __Pyx_RefNannyDeclarations
3527 PyObject *__pyx_t_1 = NULL;
3528 PyObject *__pyx_t_2 = NULL;
3529 PyObject *__pyx_t_3 = NULL;
3530 int __pyx_lineno = 0;
3531 const char *__pyx_filename = NULL;
3532 int __pyx_clineno = 0;
3533 __Pyx_RefNannySetupContext("get", 0);
3534
3535 /* "borg/item.pyx":91
3536 * def get(self, key, default=None):
3537 * """get value for key, return default if key does not exist"""
3538 * return getattr(self, self._check_key(key), default) # <<<<<<<<<<<<<<
3539 *
3540 * @staticmethod
3541 */
3542 __Pyx_XDECREF(__pyx_r);
3543 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_check_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error)
3544 __Pyx_GOTREF(__pyx_t_2);
3545 __pyx_t_3 = NULL;
3546 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
3547 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
3548 if (likely(__pyx_t_3)) {
3549 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3550 __Pyx_INCREF(__pyx_t_3);
3551 __Pyx_INCREF(function);
3552 __Pyx_DECREF_SET(__pyx_t_2, function);
3553 }
3554 }
3555 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key);
3556 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3557 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error)
3558 __Pyx_GOTREF(__pyx_t_1);
3559 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3560 __pyx_t_2 = __Pyx_GetAttr3(__pyx_v_self, __pyx_t_1, __pyx_v_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error)
3561 __Pyx_GOTREF(__pyx_t_2);
3562 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3563 __pyx_r = __pyx_t_2;
3564 __pyx_t_2 = 0;
3565 goto __pyx_L0;
3566
3567 /* "borg/item.pyx":89
3568 * return self._check_key(key) in self._dict
3569 *
3570 * def get(self, key, default=None): # <<<<<<<<<<<<<<
3571 * """get value for key, return default if key does not exist"""
3572 * return getattr(self, self._check_key(key), default)
3573 */
3574
3575 /* function exit code */
3576 __pyx_L1_error:;
3577 __Pyx_XDECREF(__pyx_t_1);
3578 __Pyx_XDECREF(__pyx_t_2);
3579 __Pyx_XDECREF(__pyx_t_3);
3580 __Pyx_AddTraceback("borg.item.PropDict.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
3581 __pyx_r = NULL;
3582 __pyx_L0:;
3583 __Pyx_XGIVEREF(__pyx_r);
3584 __Pyx_RefNannyFinishContext();
3585 return __pyx_r;
3586 }
3587
3588 /* "borg/item.pyx":94
3589 *
3590 * @staticmethod
3591 * def _make_property(key, value_type, value_type_name=None, encode=None, decode=None): # <<<<<<<<<<<<<<
3592 * """return a property that deals with self._dict[key]"""
3593 * assert isinstance(key, str)
3594 */
3595
3596 /* Python wrapper */
3597 static PyObject *__pyx_pw_4borg_4item_8PropDict_19_make_property(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3598 static char __pyx_doc_4borg_4item_8PropDict_18_make_property[] = "return a property that deals with self._dict[key]";
3599 static PyMethodDef __pyx_mdef_4borg_4item_8PropDict_19_make_property = {"_make_property", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4borg_4item_8PropDict_19_make_property, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4borg_4item_8PropDict_18_make_property};
__pyx_pw_4borg_4item_8PropDict_19_make_property(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)3600 static PyObject *__pyx_pw_4borg_4item_8PropDict_19_make_property(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3601 PyObject *__pyx_v_key = 0;
3602 PyObject *__pyx_v_value_type = 0;
3603 PyObject *__pyx_v_value_type_name = 0;
3604 PyObject *__pyx_v_encode = 0;
3605 PyObject *__pyx_v_decode = 0;
3606 int __pyx_lineno = 0;
3607 const char *__pyx_filename = NULL;
3608 int __pyx_clineno = 0;
3609 PyObject *__pyx_r = 0;
3610 __Pyx_RefNannyDeclarations
3611 __Pyx_RefNannySetupContext("_make_property (wrapper)", 0);
3612 {
3613 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_value_type,&__pyx_n_s_value_type_name,&__pyx_n_s_encode,&__pyx_n_s_decode,0};
3614 PyObject* values[5] = {0,0,0,0,0};
3615 values[2] = ((PyObject *)((PyObject *)Py_None));
3616 values[3] = ((PyObject *)((PyObject *)Py_None));
3617 values[4] = ((PyObject *)((PyObject *)Py_None));
3618 if (unlikely(__pyx_kwds)) {
3619 Py_ssize_t kw_args;
3620 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3621 switch (pos_args) {
3622 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3623 CYTHON_FALLTHROUGH;
3624 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3625 CYTHON_FALLTHROUGH;
3626 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3627 CYTHON_FALLTHROUGH;
3628 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3629 CYTHON_FALLTHROUGH;
3630 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3631 CYTHON_FALLTHROUGH;
3632 case 0: break;
3633 default: goto __pyx_L5_argtuple_error;
3634 }
3635 kw_args = PyDict_Size(__pyx_kwds);
3636 switch (pos_args) {
3637 case 0:
3638 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
3639 else goto __pyx_L5_argtuple_error;
3640 CYTHON_FALLTHROUGH;
3641 case 1:
3642 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value_type)) != 0)) kw_args--;
3643 else {
3644 __Pyx_RaiseArgtupleInvalid("_make_property", 0, 2, 5, 1); __PYX_ERR(0, 94, __pyx_L3_error)
3645 }
3646 CYTHON_FALLTHROUGH;
3647 case 2:
3648 if (kw_args > 0) {
3649 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value_type_name);
3650 if (value) { values[2] = value; kw_args--; }
3651 }
3652 CYTHON_FALLTHROUGH;
3653 case 3:
3654 if (kw_args > 0) {
3655 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_encode);
3656 if (value) { values[3] = value; kw_args--; }
3657 }
3658 CYTHON_FALLTHROUGH;
3659 case 4:
3660 if (kw_args > 0) {
3661 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_decode);
3662 if (value) { values[4] = value; kw_args--; }
3663 }
3664 }
3665 if (unlikely(kw_args > 0)) {
3666 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_make_property") < 0)) __PYX_ERR(0, 94, __pyx_L3_error)
3667 }
3668 } else {
3669 switch (PyTuple_GET_SIZE(__pyx_args)) {
3670 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3671 CYTHON_FALLTHROUGH;
3672 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3673 CYTHON_FALLTHROUGH;
3674 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3675 CYTHON_FALLTHROUGH;
3676 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3677 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3678 break;
3679 default: goto __pyx_L5_argtuple_error;
3680 }
3681 }
3682 __pyx_v_key = values[0];
3683 __pyx_v_value_type = values[1];
3684 __pyx_v_value_type_name = values[2];
3685 __pyx_v_encode = values[3];
3686 __pyx_v_decode = values[4];
3687 }
3688 goto __pyx_L4_argument_unpacking_done;
3689 __pyx_L5_argtuple_error:;
3690 __Pyx_RaiseArgtupleInvalid("_make_property", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 94, __pyx_L3_error)
3691 __pyx_L3_error:;
3692 __Pyx_AddTraceback("borg.item.PropDict._make_property", __pyx_clineno, __pyx_lineno, __pyx_filename);
3693 __Pyx_RefNannyFinishContext();
3694 return NULL;
3695 __pyx_L4_argument_unpacking_done:;
3696 __pyx_r = __pyx_pf_4borg_4item_8PropDict_18_make_property(__pyx_self, __pyx_v_key, __pyx_v_value_type, __pyx_v_value_type_name, __pyx_v_encode, __pyx_v_decode);
3697
3698 /* function exit code */
3699 __Pyx_RefNannyFinishContext();
3700 return __pyx_r;
3701 }
3702
3703 /* "borg/item.pyx":103
3704 * attr_error_msg = "attribute %s not found" % key
3705 *
3706 * def _get(self): # <<<<<<<<<<<<<<
3707 * try:
3708 * value = self._dict[key]
3709 */
3710
3711 /* Python wrapper */
3712 static PyObject *__pyx_pw_4borg_4item_8PropDict_14_make_property_1_get(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
3713 static PyMethodDef __pyx_mdef_4borg_4item_8PropDict_14_make_property_1_get = {"_get", (PyCFunction)__pyx_pw_4borg_4item_8PropDict_14_make_property_1_get, METH_O, 0};
__pyx_pw_4borg_4item_8PropDict_14_make_property_1_get(PyObject * __pyx_self,PyObject * __pyx_v_self)3714 static PyObject *__pyx_pw_4borg_4item_8PropDict_14_make_property_1_get(PyObject *__pyx_self, PyObject *__pyx_v_self) {
3715 PyObject *__pyx_r = 0;
3716 __Pyx_RefNannyDeclarations
3717 __Pyx_RefNannySetupContext("_get (wrapper)", 0);
3718 __pyx_r = __pyx_pf_4borg_4item_8PropDict_14_make_property__get(__pyx_self, ((PyObject *)__pyx_v_self));
3719
3720 /* function exit code */
3721 __Pyx_RefNannyFinishContext();
3722 return __pyx_r;
3723 }
3724
__pyx_pf_4borg_4item_8PropDict_14_make_property__get(PyObject * __pyx_self,PyObject * __pyx_v_self)3725 static PyObject *__pyx_pf_4borg_4item_8PropDict_14_make_property__get(PyObject *__pyx_self, PyObject *__pyx_v_self) {
3726 struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property *__pyx_cur_scope;
3727 struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property *__pyx_outer_scope;
3728 PyObject *__pyx_v_value = NULL;
3729 PyObject *__pyx_r = NULL;
3730 __Pyx_RefNannyDeclarations
3731 PyObject *__pyx_t_1 = NULL;
3732 PyObject *__pyx_t_2 = NULL;
3733 PyObject *__pyx_t_3 = NULL;
3734 PyObject *__pyx_t_4 = NULL;
3735 PyObject *__pyx_t_5 = NULL;
3736 int __pyx_t_6;
3737 PyObject *__pyx_t_7 = NULL;
3738 PyObject *__pyx_t_8 = NULL;
3739 int __pyx_t_9;
3740 int __pyx_t_10;
3741 int __pyx_lineno = 0;
3742 const char *__pyx_filename = NULL;
3743 int __pyx_clineno = 0;
3744 __Pyx_RefNannySetupContext("_get", 0);
3745 __pyx_outer_scope = (struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property *) __Pyx_CyFunction_GetClosure(__pyx_self);
3746 __pyx_cur_scope = __pyx_outer_scope;
3747
3748 /* "borg/item.pyx":104
3749 *
3750 * def _get(self):
3751 * try: # <<<<<<<<<<<<<<
3752 * value = self._dict[key]
3753 * except KeyError:
3754 */
3755 {
3756 __Pyx_PyThreadState_declare
3757 __Pyx_PyThreadState_assign
3758 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
3759 __Pyx_XGOTREF(__pyx_t_1);
3760 __Pyx_XGOTREF(__pyx_t_2);
3761 __Pyx_XGOTREF(__pyx_t_3);
3762 /*try:*/ {
3763
3764 /* "borg/item.pyx":105
3765 * def _get(self):
3766 * try:
3767 * value = self._dict[key] # <<<<<<<<<<<<<<
3768 * except KeyError:
3769 * raise AttributeError(attr_error_msg) from None
3770 */
3771 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 105, __pyx_L3_error)
3772 __Pyx_GOTREF(__pyx_t_4);
3773 if (unlikely(!__pyx_cur_scope->__pyx_v_key)) { __Pyx_RaiseClosureNameError("key"); __PYX_ERR(0, 105, __pyx_L3_error) }
3774 __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_cur_scope->__pyx_v_key); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 105, __pyx_L3_error)
3775 __Pyx_GOTREF(__pyx_t_5);
3776 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3777 __pyx_v_value = __pyx_t_5;
3778 __pyx_t_5 = 0;
3779
3780 /* "borg/item.pyx":104
3781 *
3782 * def _get(self):
3783 * try: # <<<<<<<<<<<<<<
3784 * value = self._dict[key]
3785 * except KeyError:
3786 */
3787 }
3788 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
3789 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3790 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3791 goto __pyx_L8_try_end;
3792 __pyx_L3_error:;
3793 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3794 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3795
3796 /* "borg/item.pyx":106
3797 * try:
3798 * value = self._dict[key]
3799 * except KeyError: # <<<<<<<<<<<<<<
3800 * raise AttributeError(attr_error_msg) from None
3801 * if decode is not None:
3802 */
3803 __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
3804 if (__pyx_t_6) {
3805 __Pyx_AddTraceback("borg.item.PropDict._make_property._get", __pyx_clineno, __pyx_lineno, __pyx_filename);
3806 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) __PYX_ERR(0, 106, __pyx_L5_except_error)
3807 __Pyx_GOTREF(__pyx_t_5);
3808 __Pyx_GOTREF(__pyx_t_4);
3809 __Pyx_GOTREF(__pyx_t_7);
3810
3811 /* "borg/item.pyx":107
3812 * value = self._dict[key]
3813 * except KeyError:
3814 * raise AttributeError(attr_error_msg) from None # <<<<<<<<<<<<<<
3815 * if decode is not None:
3816 * value = decode(value)
3817 */
3818 if (unlikely(!__pyx_cur_scope->__pyx_v_attr_error_msg)) { __Pyx_RaiseClosureNameError("attr_error_msg"); __PYX_ERR(0, 107, __pyx_L5_except_error) }
3819 __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AttributeError, __pyx_cur_scope->__pyx_v_attr_error_msg); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 107, __pyx_L5_except_error)
3820 __Pyx_GOTREF(__pyx_t_8);
3821 __Pyx_Raise(__pyx_t_8, 0, 0, Py_None);
3822 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3823 __PYX_ERR(0, 107, __pyx_L5_except_error)
3824 }
3825 goto __pyx_L5_except_error;
3826 __pyx_L5_except_error:;
3827
3828 /* "borg/item.pyx":104
3829 *
3830 * def _get(self):
3831 * try: # <<<<<<<<<<<<<<
3832 * value = self._dict[key]
3833 * except KeyError:
3834 */
3835 __Pyx_XGIVEREF(__pyx_t_1);
3836 __Pyx_XGIVEREF(__pyx_t_2);
3837 __Pyx_XGIVEREF(__pyx_t_3);
3838 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
3839 goto __pyx_L1_error;
3840 __pyx_L8_try_end:;
3841 }
3842
3843 /* "borg/item.pyx":108
3844 * except KeyError:
3845 * raise AttributeError(attr_error_msg) from None
3846 * if decode is not None: # <<<<<<<<<<<<<<
3847 * value = decode(value)
3848 * return value
3849 */
3850 if (unlikely(!__pyx_cur_scope->__pyx_v_decode)) { __Pyx_RaiseClosureNameError("decode"); __PYX_ERR(0, 108, __pyx_L1_error) }
3851 __pyx_t_9 = (__pyx_cur_scope->__pyx_v_decode != Py_None);
3852 __pyx_t_10 = (__pyx_t_9 != 0);
3853 if (__pyx_t_10) {
3854
3855 /* "borg/item.pyx":109
3856 * raise AttributeError(attr_error_msg) from None
3857 * if decode is not None:
3858 * value = decode(value) # <<<<<<<<<<<<<<
3859 * return value
3860 *
3861 */
3862 if (unlikely(!__pyx_cur_scope->__pyx_v_decode)) { __Pyx_RaiseClosureNameError("decode"); __PYX_ERR(0, 109, __pyx_L1_error) }
3863 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_decode);
3864 __pyx_t_4 = __pyx_cur_scope->__pyx_v_decode; __pyx_t_5 = NULL;
3865 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
3866 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
3867 if (likely(__pyx_t_5)) {
3868 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
3869 __Pyx_INCREF(__pyx_t_5);
3870 __Pyx_INCREF(function);
3871 __Pyx_DECREF_SET(__pyx_t_4, function);
3872 }
3873 }
3874 __pyx_t_7 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_value);
3875 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3876 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 109, __pyx_L1_error)
3877 __Pyx_GOTREF(__pyx_t_7);
3878 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3879 __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_7);
3880 __pyx_t_7 = 0;
3881
3882 /* "borg/item.pyx":108
3883 * except KeyError:
3884 * raise AttributeError(attr_error_msg) from None
3885 * if decode is not None: # <<<<<<<<<<<<<<
3886 * value = decode(value)
3887 * return value
3888 */
3889 }
3890
3891 /* "borg/item.pyx":110
3892 * if decode is not None:
3893 * value = decode(value)
3894 * return value # <<<<<<<<<<<<<<
3895 *
3896 * def _set(self, value):
3897 */
3898 __Pyx_XDECREF(__pyx_r);
3899 __Pyx_INCREF(__pyx_v_value);
3900 __pyx_r = __pyx_v_value;
3901 goto __pyx_L0;
3902
3903 /* "borg/item.pyx":103
3904 * attr_error_msg = "attribute %s not found" % key
3905 *
3906 * def _get(self): # <<<<<<<<<<<<<<
3907 * try:
3908 * value = self._dict[key]
3909 */
3910
3911 /* function exit code */
3912 __pyx_L1_error:;
3913 __Pyx_XDECREF(__pyx_t_4);
3914 __Pyx_XDECREF(__pyx_t_5);
3915 __Pyx_XDECREF(__pyx_t_7);
3916 __Pyx_XDECREF(__pyx_t_8);
3917 __Pyx_AddTraceback("borg.item.PropDict._make_property._get", __pyx_clineno, __pyx_lineno, __pyx_filename);
3918 __pyx_r = NULL;
3919 __pyx_L0:;
3920 __Pyx_XDECREF(__pyx_v_value);
3921 __Pyx_XGIVEREF(__pyx_r);
3922 __Pyx_RefNannyFinishContext();
3923 return __pyx_r;
3924 }
3925
3926 /* "borg/item.pyx":112
3927 * return value
3928 *
3929 * def _set(self, value): # <<<<<<<<<<<<<<
3930 * if not isinstance(value, value_type):
3931 * raise TypeError(type_error_msg)
3932 */
3933
3934 /* Python wrapper */
3935 static PyObject *__pyx_pw_4borg_4item_8PropDict_14_make_property_3_set(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3936 static PyMethodDef __pyx_mdef_4borg_4item_8PropDict_14_make_property_3_set = {"_set", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4borg_4item_8PropDict_14_make_property_3_set, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_4borg_4item_8PropDict_14_make_property_3_set(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)3937 static PyObject *__pyx_pw_4borg_4item_8PropDict_14_make_property_3_set(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3938 PyObject *__pyx_v_self = 0;
3939 PyObject *__pyx_v_value = 0;
3940 int __pyx_lineno = 0;
3941 const char *__pyx_filename = NULL;
3942 int __pyx_clineno = 0;
3943 PyObject *__pyx_r = 0;
3944 __Pyx_RefNannyDeclarations
3945 __Pyx_RefNannySetupContext("_set (wrapper)", 0);
3946 {
3947 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_value,0};
3948 PyObject* values[2] = {0,0};
3949 if (unlikely(__pyx_kwds)) {
3950 Py_ssize_t kw_args;
3951 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3952 switch (pos_args) {
3953 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3954 CYTHON_FALLTHROUGH;
3955 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3956 CYTHON_FALLTHROUGH;
3957 case 0: break;
3958 default: goto __pyx_L5_argtuple_error;
3959 }
3960 kw_args = PyDict_Size(__pyx_kwds);
3961 switch (pos_args) {
3962 case 0:
3963 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
3964 else goto __pyx_L5_argtuple_error;
3965 CYTHON_FALLTHROUGH;
3966 case 1:
3967 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
3968 else {
3969 __Pyx_RaiseArgtupleInvalid("_set", 1, 2, 2, 1); __PYX_ERR(0, 112, __pyx_L3_error)
3970 }
3971 }
3972 if (unlikely(kw_args > 0)) {
3973 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_set") < 0)) __PYX_ERR(0, 112, __pyx_L3_error)
3974 }
3975 } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
3976 goto __pyx_L5_argtuple_error;
3977 } else {
3978 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3979 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3980 }
3981 __pyx_v_self = values[0];
3982 __pyx_v_value = values[1];
3983 }
3984 goto __pyx_L4_argument_unpacking_done;
3985 __pyx_L5_argtuple_error:;
3986 __Pyx_RaiseArgtupleInvalid("_set", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 112, __pyx_L3_error)
3987 __pyx_L3_error:;
3988 __Pyx_AddTraceback("borg.item.PropDict._make_property._set", __pyx_clineno, __pyx_lineno, __pyx_filename);
3989 __Pyx_RefNannyFinishContext();
3990 return NULL;
3991 __pyx_L4_argument_unpacking_done:;
3992 __pyx_r = __pyx_pf_4borg_4item_8PropDict_14_make_property_2_set(__pyx_self, __pyx_v_self, __pyx_v_value);
3993
3994 /* function exit code */
3995 __Pyx_RefNannyFinishContext();
3996 return __pyx_r;
3997 }
3998
__pyx_pf_4borg_4item_8PropDict_14_make_property_2_set(PyObject * __pyx_self,PyObject * __pyx_v_self,PyObject * __pyx_v_value)3999 static PyObject *__pyx_pf_4borg_4item_8PropDict_14_make_property_2_set(PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
4000 struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property *__pyx_cur_scope;
4001 struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property *__pyx_outer_scope;
4002 PyObject *__pyx_r = NULL;
4003 __Pyx_RefNannyDeclarations
4004 PyObject *__pyx_t_1 = NULL;
4005 int __pyx_t_2;
4006 int __pyx_t_3;
4007 PyObject *__pyx_t_4 = NULL;
4008 PyObject *__pyx_t_5 = NULL;
4009 int __pyx_lineno = 0;
4010 const char *__pyx_filename = NULL;
4011 int __pyx_clineno = 0;
4012 __Pyx_RefNannySetupContext("_set", 0);
4013 __pyx_outer_scope = (struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property *) __Pyx_CyFunction_GetClosure(__pyx_self);
4014 __pyx_cur_scope = __pyx_outer_scope;
4015 __Pyx_INCREF(__pyx_v_value);
4016
4017 /* "borg/item.pyx":113
4018 *
4019 * def _set(self, value):
4020 * if not isinstance(value, value_type): # <<<<<<<<<<<<<<
4021 * raise TypeError(type_error_msg)
4022 * if encode is not None:
4023 */
4024 if (unlikely(!__pyx_cur_scope->__pyx_v_value_type)) { __Pyx_RaiseClosureNameError("value_type"); __PYX_ERR(0, 113, __pyx_L1_error) }
4025 __pyx_t_1 = __pyx_cur_scope->__pyx_v_value_type;
4026 __Pyx_INCREF(__pyx_t_1);
4027 __pyx_t_2 = PyObject_IsInstance(__pyx_v_value, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 113, __pyx_L1_error)
4028 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4029 __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0);
4030 if (unlikely(__pyx_t_3)) {
4031
4032 /* "borg/item.pyx":114
4033 * def _set(self, value):
4034 * if not isinstance(value, value_type):
4035 * raise TypeError(type_error_msg) # <<<<<<<<<<<<<<
4036 * if encode is not None:
4037 * value = encode(value)
4038 */
4039 if (unlikely(!__pyx_cur_scope->__pyx_v_type_error_msg)) { __Pyx_RaiseClosureNameError("type_error_msg"); __PYX_ERR(0, 114, __pyx_L1_error) }
4040 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_cur_scope->__pyx_v_type_error_msg); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error)
4041 __Pyx_GOTREF(__pyx_t_1);
4042 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
4043 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4044 __PYX_ERR(0, 114, __pyx_L1_error)
4045
4046 /* "borg/item.pyx":113
4047 *
4048 * def _set(self, value):
4049 * if not isinstance(value, value_type): # <<<<<<<<<<<<<<
4050 * raise TypeError(type_error_msg)
4051 * if encode is not None:
4052 */
4053 }
4054
4055 /* "borg/item.pyx":115
4056 * if not isinstance(value, value_type):
4057 * raise TypeError(type_error_msg)
4058 * if encode is not None: # <<<<<<<<<<<<<<
4059 * value = encode(value)
4060 * self._dict[key] = value
4061 */
4062 if (unlikely(!__pyx_cur_scope->__pyx_v_encode)) { __Pyx_RaiseClosureNameError("encode"); __PYX_ERR(0, 115, __pyx_L1_error) }
4063 __pyx_t_3 = (__pyx_cur_scope->__pyx_v_encode != Py_None);
4064 __pyx_t_2 = (__pyx_t_3 != 0);
4065 if (__pyx_t_2) {
4066
4067 /* "borg/item.pyx":116
4068 * raise TypeError(type_error_msg)
4069 * if encode is not None:
4070 * value = encode(value) # <<<<<<<<<<<<<<
4071 * self._dict[key] = value
4072 *
4073 */
4074 if (unlikely(!__pyx_cur_scope->__pyx_v_encode)) { __Pyx_RaiseClosureNameError("encode"); __PYX_ERR(0, 116, __pyx_L1_error) }
4075 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_encode);
4076 __pyx_t_4 = __pyx_cur_scope->__pyx_v_encode; __pyx_t_5 = NULL;
4077 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
4078 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
4079 if (likely(__pyx_t_5)) {
4080 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
4081 __Pyx_INCREF(__pyx_t_5);
4082 __Pyx_INCREF(function);
4083 __Pyx_DECREF_SET(__pyx_t_4, function);
4084 }
4085 }
4086 __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_value);
4087 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4088 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error)
4089 __Pyx_GOTREF(__pyx_t_1);
4090 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4091 __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_1);
4092 __pyx_t_1 = 0;
4093
4094 /* "borg/item.pyx":115
4095 * if not isinstance(value, value_type):
4096 * raise TypeError(type_error_msg)
4097 * if encode is not None: # <<<<<<<<<<<<<<
4098 * value = encode(value)
4099 * self._dict[key] = value
4100 */
4101 }
4102
4103 /* "borg/item.pyx":117
4104 * if encode is not None:
4105 * value = encode(value)
4106 * self._dict[key] = value # <<<<<<<<<<<<<<
4107 *
4108 * def _del(self):
4109 */
4110 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error)
4111 __Pyx_GOTREF(__pyx_t_1);
4112 if (unlikely(!__pyx_cur_scope->__pyx_v_key)) { __Pyx_RaiseClosureNameError("key"); __PYX_ERR(0, 117, __pyx_L1_error) }
4113 if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_cur_scope->__pyx_v_key, __pyx_v_value) < 0)) __PYX_ERR(0, 117, __pyx_L1_error)
4114 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4115
4116 /* "borg/item.pyx":112
4117 * return value
4118 *
4119 * def _set(self, value): # <<<<<<<<<<<<<<
4120 * if not isinstance(value, value_type):
4121 * raise TypeError(type_error_msg)
4122 */
4123
4124 /* function exit code */
4125 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4126 goto __pyx_L0;
4127 __pyx_L1_error:;
4128 __Pyx_XDECREF(__pyx_t_1);
4129 __Pyx_XDECREF(__pyx_t_4);
4130 __Pyx_XDECREF(__pyx_t_5);
4131 __Pyx_AddTraceback("borg.item.PropDict._make_property._set", __pyx_clineno, __pyx_lineno, __pyx_filename);
4132 __pyx_r = NULL;
4133 __pyx_L0:;
4134 __Pyx_XDECREF(__pyx_v_value);
4135 __Pyx_XGIVEREF(__pyx_r);
4136 __Pyx_RefNannyFinishContext();
4137 return __pyx_r;
4138 }
4139
4140 /* "borg/item.pyx":119
4141 * self._dict[key] = value
4142 *
4143 * def _del(self): # <<<<<<<<<<<<<<
4144 * try:
4145 * del self._dict[key]
4146 */
4147
4148 /* Python wrapper */
4149 static PyObject *__pyx_pw_4borg_4item_8PropDict_14_make_property_5_del(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
4150 static PyMethodDef __pyx_mdef_4borg_4item_8PropDict_14_make_property_5_del = {"_del", (PyCFunction)__pyx_pw_4borg_4item_8PropDict_14_make_property_5_del, METH_O, 0};
__pyx_pw_4borg_4item_8PropDict_14_make_property_5_del(PyObject * __pyx_self,PyObject * __pyx_v_self)4151 static PyObject *__pyx_pw_4borg_4item_8PropDict_14_make_property_5_del(PyObject *__pyx_self, PyObject *__pyx_v_self) {
4152 PyObject *__pyx_r = 0;
4153 __Pyx_RefNannyDeclarations
4154 __Pyx_RefNannySetupContext("_del (wrapper)", 0);
4155 __pyx_r = __pyx_pf_4borg_4item_8PropDict_14_make_property_4_del(__pyx_self, ((PyObject *)__pyx_v_self));
4156
4157 /* function exit code */
4158 __Pyx_RefNannyFinishContext();
4159 return __pyx_r;
4160 }
4161
__pyx_pf_4borg_4item_8PropDict_14_make_property_4_del(PyObject * __pyx_self,PyObject * __pyx_v_self)4162 static PyObject *__pyx_pf_4borg_4item_8PropDict_14_make_property_4_del(PyObject *__pyx_self, PyObject *__pyx_v_self) {
4163 struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property *__pyx_cur_scope;
4164 struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property *__pyx_outer_scope;
4165 PyObject *__pyx_r = NULL;
4166 __Pyx_RefNannyDeclarations
4167 PyObject *__pyx_t_1 = NULL;
4168 PyObject *__pyx_t_2 = NULL;
4169 PyObject *__pyx_t_3 = NULL;
4170 PyObject *__pyx_t_4 = NULL;
4171 int __pyx_t_5;
4172 PyObject *__pyx_t_6 = NULL;
4173 PyObject *__pyx_t_7 = NULL;
4174 PyObject *__pyx_t_8 = NULL;
4175 int __pyx_lineno = 0;
4176 const char *__pyx_filename = NULL;
4177 int __pyx_clineno = 0;
4178 __Pyx_RefNannySetupContext("_del", 0);
4179 __pyx_outer_scope = (struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property *) __Pyx_CyFunction_GetClosure(__pyx_self);
4180 __pyx_cur_scope = __pyx_outer_scope;
4181
4182 /* "borg/item.pyx":120
4183 *
4184 * def _del(self):
4185 * try: # <<<<<<<<<<<<<<
4186 * del self._dict[key]
4187 * except KeyError:
4188 */
4189 {
4190 __Pyx_PyThreadState_declare
4191 __Pyx_PyThreadState_assign
4192 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
4193 __Pyx_XGOTREF(__pyx_t_1);
4194 __Pyx_XGOTREF(__pyx_t_2);
4195 __Pyx_XGOTREF(__pyx_t_3);
4196 /*try:*/ {
4197
4198 /* "borg/item.pyx":121
4199 * def _del(self):
4200 * try:
4201 * del self._dict[key] # <<<<<<<<<<<<<<
4202 * except KeyError:
4203 * raise AttributeError(attr_error_msg) from None
4204 */
4205 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 121, __pyx_L3_error)
4206 __Pyx_GOTREF(__pyx_t_4);
4207 if (unlikely(!__pyx_cur_scope->__pyx_v_key)) { __Pyx_RaiseClosureNameError("key"); __PYX_ERR(0, 121, __pyx_L3_error) }
4208 if (unlikely(PyObject_DelItem(__pyx_t_4, __pyx_cur_scope->__pyx_v_key) < 0)) __PYX_ERR(0, 121, __pyx_L3_error)
4209 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4210
4211 /* "borg/item.pyx":120
4212 *
4213 * def _del(self):
4214 * try: # <<<<<<<<<<<<<<
4215 * del self._dict[key]
4216 * except KeyError:
4217 */
4218 }
4219 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
4220 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4221 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4222 goto __pyx_L8_try_end;
4223 __pyx_L3_error:;
4224 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4225
4226 /* "borg/item.pyx":122
4227 * try:
4228 * del self._dict[key]
4229 * except KeyError: # <<<<<<<<<<<<<<
4230 * raise AttributeError(attr_error_msg) from None
4231 *
4232 */
4233 __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
4234 if (__pyx_t_5) {
4235 __Pyx_AddTraceback("borg.item.PropDict._make_property._del", __pyx_clineno, __pyx_lineno, __pyx_filename);
4236 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 122, __pyx_L5_except_error)
4237 __Pyx_GOTREF(__pyx_t_4);
4238 __Pyx_GOTREF(__pyx_t_6);
4239 __Pyx_GOTREF(__pyx_t_7);
4240
4241 /* "borg/item.pyx":123
4242 * del self._dict[key]
4243 * except KeyError:
4244 * raise AttributeError(attr_error_msg) from None # <<<<<<<<<<<<<<
4245 *
4246 * return property(_get, _set, _del, doc=doc)
4247 */
4248 if (unlikely(!__pyx_cur_scope->__pyx_v_attr_error_msg)) { __Pyx_RaiseClosureNameError("attr_error_msg"); __PYX_ERR(0, 123, __pyx_L5_except_error) }
4249 __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_AttributeError, __pyx_cur_scope->__pyx_v_attr_error_msg); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 123, __pyx_L5_except_error)
4250 __Pyx_GOTREF(__pyx_t_8);
4251 __Pyx_Raise(__pyx_t_8, 0, 0, Py_None);
4252 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4253 __PYX_ERR(0, 123, __pyx_L5_except_error)
4254 }
4255 goto __pyx_L5_except_error;
4256 __pyx_L5_except_error:;
4257
4258 /* "borg/item.pyx":120
4259 *
4260 * def _del(self):
4261 * try: # <<<<<<<<<<<<<<
4262 * del self._dict[key]
4263 * except KeyError:
4264 */
4265 __Pyx_XGIVEREF(__pyx_t_1);
4266 __Pyx_XGIVEREF(__pyx_t_2);
4267 __Pyx_XGIVEREF(__pyx_t_3);
4268 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
4269 goto __pyx_L1_error;
4270 __pyx_L8_try_end:;
4271 }
4272
4273 /* "borg/item.pyx":119
4274 * self._dict[key] = value
4275 *
4276 * def _del(self): # <<<<<<<<<<<<<<
4277 * try:
4278 * del self._dict[key]
4279 */
4280
4281 /* function exit code */
4282 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4283 goto __pyx_L0;
4284 __pyx_L1_error:;
4285 __Pyx_XDECREF(__pyx_t_4);
4286 __Pyx_XDECREF(__pyx_t_6);
4287 __Pyx_XDECREF(__pyx_t_7);
4288 __Pyx_XDECREF(__pyx_t_8);
4289 __Pyx_AddTraceback("borg.item.PropDict._make_property._del", __pyx_clineno, __pyx_lineno, __pyx_filename);
4290 __pyx_r = NULL;
4291 __pyx_L0:;
4292 __Pyx_XGIVEREF(__pyx_r);
4293 __Pyx_RefNannyFinishContext();
4294 return __pyx_r;
4295 }
4296
4297 /* "borg/item.pyx":94
4298 *
4299 * @staticmethod
4300 * def _make_property(key, value_type, value_type_name=None, encode=None, decode=None): # <<<<<<<<<<<<<<
4301 * """return a property that deals with self._dict[key]"""
4302 * assert isinstance(key, str)
4303 */
4304
__pyx_pf_4borg_4item_8PropDict_18_make_property(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_key,PyObject * __pyx_v_value_type,PyObject * __pyx_v_value_type_name,PyObject * __pyx_v_encode,PyObject * __pyx_v_decode)4305 static PyObject *__pyx_pf_4borg_4item_8PropDict_18_make_property(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value_type, PyObject *__pyx_v_value_type_name, PyObject *__pyx_v_encode, PyObject *__pyx_v_decode) {
4306 struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property *__pyx_cur_scope;
4307 PyObject *__pyx_v_doc = NULL;
4308 PyObject *__pyx_v__get = 0;
4309 PyObject *__pyx_v__set = 0;
4310 PyObject *__pyx_v__del = 0;
4311 PyObject *__pyx_r = NULL;
4312 __Pyx_RefNannyDeclarations
4313 PyObject *__pyx_t_1 = NULL;
4314 int __pyx_t_2;
4315 int __pyx_t_3;
4316 Py_ssize_t __pyx_t_4;
4317 Py_UCS4 __pyx_t_5;
4318 PyObject *__pyx_t_6 = NULL;
4319 PyObject *__pyx_t_7 = NULL;
4320 int __pyx_lineno = 0;
4321 const char *__pyx_filename = NULL;
4322 int __pyx_clineno = 0;
4323 __Pyx_RefNannySetupContext("_make_property", 0);
4324 __pyx_cur_scope = (struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property *)__pyx_tp_new_4borg_4item___pyx_scope_struct___make_property(__pyx_ptype_4borg_4item___pyx_scope_struct___make_property, __pyx_empty_tuple, NULL);
4325 if (unlikely(!__pyx_cur_scope)) {
4326 __pyx_cur_scope = ((struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property *)Py_None);
4327 __Pyx_INCREF(Py_None);
4328 __PYX_ERR(0, 94, __pyx_L1_error)
4329 } else {
4330 __Pyx_GOTREF(__pyx_cur_scope);
4331 }
4332 __pyx_cur_scope->__pyx_v_key = __pyx_v_key;
4333 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_key);
4334 __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_key);
4335 __pyx_cur_scope->__pyx_v_value_type = __pyx_v_value_type;
4336 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value_type);
4337 __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_value_type);
4338 __pyx_cur_scope->__pyx_v_encode = __pyx_v_encode;
4339 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_encode);
4340 __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_encode);
4341 __pyx_cur_scope->__pyx_v_decode = __pyx_v_decode;
4342 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_decode);
4343 __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_decode);
4344 __Pyx_INCREF(__pyx_v_value_type_name);
4345
4346 /* "borg/item.pyx":96
4347 * def _make_property(key, value_type, value_type_name=None, encode=None, decode=None):
4348 * """return a property that deals with self._dict[key]"""
4349 * assert isinstance(key, str) # <<<<<<<<<<<<<<
4350 * if value_type_name is None:
4351 * value_type_name = value_type.__name__
4352 */
4353 #ifndef CYTHON_WITHOUT_ASSERTIONS
4354 if (unlikely(!Py_OptimizeFlag)) {
4355 __pyx_t_1 = __pyx_cur_scope->__pyx_v_key;
4356 __Pyx_INCREF(__pyx_t_1);
4357 __pyx_t_2 = PyUnicode_Check(__pyx_t_1);
4358 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4359 if (unlikely(!(__pyx_t_2 != 0))) {
4360 PyErr_SetNone(PyExc_AssertionError);
4361 __PYX_ERR(0, 96, __pyx_L1_error)
4362 }
4363 }
4364 #endif
4365
4366 /* "borg/item.pyx":97
4367 * """return a property that deals with self._dict[key]"""
4368 * assert isinstance(key, str)
4369 * if value_type_name is None: # <<<<<<<<<<<<<<
4370 * value_type_name = value_type.__name__
4371 * doc = "%s (%s)" % (key, value_type_name)
4372 */
4373 __pyx_t_2 = (__pyx_v_value_type_name == Py_None);
4374 __pyx_t_3 = (__pyx_t_2 != 0);
4375 if (__pyx_t_3) {
4376
4377 /* "borg/item.pyx":98
4378 * assert isinstance(key, str)
4379 * if value_type_name is None:
4380 * value_type_name = value_type.__name__ # <<<<<<<<<<<<<<
4381 * doc = "%s (%s)" % (key, value_type_name)
4382 * type_error_msg = "%s value must be %s" % (key, value_type_name)
4383 */
4384 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_value_type, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error)
4385 __Pyx_GOTREF(__pyx_t_1);
4386 __Pyx_DECREF_SET(__pyx_v_value_type_name, __pyx_t_1);
4387 __pyx_t_1 = 0;
4388
4389 /* "borg/item.pyx":97
4390 * """return a property that deals with self._dict[key]"""
4391 * assert isinstance(key, str)
4392 * if value_type_name is None: # <<<<<<<<<<<<<<
4393 * value_type_name = value_type.__name__
4394 * doc = "%s (%s)" % (key, value_type_name)
4395 */
4396 }
4397
4398 /* "borg/item.pyx":99
4399 * if value_type_name is None:
4400 * value_type_name = value_type.__name__
4401 * doc = "%s (%s)" % (key, value_type_name) # <<<<<<<<<<<<<<
4402 * type_error_msg = "%s value must be %s" % (key, value_type_name)
4403 * attr_error_msg = "attribute %s not found" % key
4404 */
4405 __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error)
4406 __Pyx_GOTREF(__pyx_t_1);
4407 __pyx_t_4 = 0;
4408 __pyx_t_5 = 127;
4409 __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_cur_scope->__pyx_v_key), __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 99, __pyx_L1_error)
4410 __Pyx_GOTREF(__pyx_t_6);
4411 __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_5;
4412 __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
4413 __Pyx_GIVEREF(__pyx_t_6);
4414 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
4415 __pyx_t_6 = 0;
4416 __Pyx_INCREF(__pyx_kp_u__5);
4417 __pyx_t_4 += 2;
4418 __Pyx_GIVEREF(__pyx_kp_u__5);
4419 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u__5);
4420 __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_value_type_name), __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 99, __pyx_L1_error)
4421 __Pyx_GOTREF(__pyx_t_6);
4422 __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_5;
4423 __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
4424 __Pyx_GIVEREF(__pyx_t_6);
4425 PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_6);
4426 __pyx_t_6 = 0;
4427 __Pyx_INCREF(__pyx_kp_u__3);
4428 __pyx_t_4 += 1;
4429 __Pyx_GIVEREF(__pyx_kp_u__3);
4430 PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u__3);
4431 __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_1, 4, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 99, __pyx_L1_error)
4432 __Pyx_GOTREF(__pyx_t_6);
4433 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4434 __pyx_v_doc = ((PyObject*)__pyx_t_6);
4435 __pyx_t_6 = 0;
4436
4437 /* "borg/item.pyx":100
4438 * value_type_name = value_type.__name__
4439 * doc = "%s (%s)" % (key, value_type_name)
4440 * type_error_msg = "%s value must be %s" % (key, value_type_name) # <<<<<<<<<<<<<<
4441 * attr_error_msg = "attribute %s not found" % key
4442 *
4443 */
4444 __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 100, __pyx_L1_error)
4445 __Pyx_GOTREF(__pyx_t_6);
4446 __pyx_t_4 = 0;
4447 __pyx_t_5 = 127;
4448 __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_cur_scope->__pyx_v_key), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error)
4449 __Pyx_GOTREF(__pyx_t_1);
4450 __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_5;
4451 __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
4452 __Pyx_GIVEREF(__pyx_t_1);
4453 PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
4454 __pyx_t_1 = 0;
4455 __Pyx_INCREF(__pyx_kp_u_value_must_be);
4456 __pyx_t_4 += 15;
4457 __Pyx_GIVEREF(__pyx_kp_u_value_must_be);
4458 PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_kp_u_value_must_be);
4459 __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_value_type_name), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error)
4460 __Pyx_GOTREF(__pyx_t_1);
4461 __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_5;
4462 __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
4463 __Pyx_GIVEREF(__pyx_t_1);
4464 PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_1);
4465 __pyx_t_1 = 0;
4466 __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_6, 3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error)
4467 __Pyx_GOTREF(__pyx_t_1);
4468 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4469 __Pyx_GIVEREF(__pyx_t_1);
4470 __pyx_cur_scope->__pyx_v_type_error_msg = ((PyObject*)__pyx_t_1);
4471 __pyx_t_1 = 0;
4472
4473 /* "borg/item.pyx":101
4474 * doc = "%s (%s)" % (key, value_type_name)
4475 * type_error_msg = "%s value must be %s" % (key, value_type_name)
4476 * attr_error_msg = "attribute %s not found" % key # <<<<<<<<<<<<<<
4477 *
4478 * def _get(self):
4479 */
4480 __pyx_t_1 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_attribute_s_not_found, __pyx_cur_scope->__pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 101, __pyx_L1_error)
4481 __Pyx_GOTREF(__pyx_t_1);
4482 __Pyx_GIVEREF(__pyx_t_1);
4483 __pyx_cur_scope->__pyx_v_attr_error_msg = ((PyObject*)__pyx_t_1);
4484 __pyx_t_1 = 0;
4485
4486 /* "borg/item.pyx":103
4487 * attr_error_msg = "attribute %s not found" % key
4488 *
4489 * def _get(self): # <<<<<<<<<<<<<<
4490 * try:
4491 * value = self._dict[key]
4492 */
4493 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_4item_8PropDict_14_make_property_1_get, 0, __pyx_n_s_PropDict__make_property_locals, ((PyObject*)__pyx_cur_scope), __pyx_n_s_borg_item, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error)
4494 __Pyx_GOTREF(__pyx_t_1);
4495 __pyx_v__get = __pyx_t_1;
4496 __pyx_t_1 = 0;
4497
4498 /* "borg/item.pyx":112
4499 * return value
4500 *
4501 * def _set(self, value): # <<<<<<<<<<<<<<
4502 * if not isinstance(value, value_type):
4503 * raise TypeError(type_error_msg)
4504 */
4505 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_4item_8PropDict_14_make_property_3_set, 0, __pyx_n_s_PropDict__make_property_locals_2, ((PyObject*)__pyx_cur_scope), __pyx_n_s_borg_item, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error)
4506 __Pyx_GOTREF(__pyx_t_1);
4507 __pyx_v__set = __pyx_t_1;
4508 __pyx_t_1 = 0;
4509
4510 /* "borg/item.pyx":119
4511 * self._dict[key] = value
4512 *
4513 * def _del(self): # <<<<<<<<<<<<<<
4514 * try:
4515 * del self._dict[key]
4516 */
4517 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_4item_8PropDict_14_make_property_5_del, 0, __pyx_n_s_PropDict__make_property_locals_3, ((PyObject*)__pyx_cur_scope), __pyx_n_s_borg_item, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
4518 __Pyx_GOTREF(__pyx_t_1);
4519 __pyx_v__del = __pyx_t_1;
4520 __pyx_t_1 = 0;
4521
4522 /* "borg/item.pyx":125
4523 * raise AttributeError(attr_error_msg) from None
4524 *
4525 * return property(_get, _set, _del, doc=doc) # <<<<<<<<<<<<<<
4526 *
4527 *
4528 */
4529 __Pyx_XDECREF(__pyx_r);
4530 __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error)
4531 __Pyx_GOTREF(__pyx_t_1);
4532 __Pyx_INCREF(__pyx_v__get);
4533 __Pyx_GIVEREF(__pyx_v__get);
4534 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__get);
4535 __Pyx_INCREF(__pyx_v__set);
4536 __Pyx_GIVEREF(__pyx_v__set);
4537 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v__set);
4538 __Pyx_INCREF(__pyx_v__del);
4539 __Pyx_GIVEREF(__pyx_v__del);
4540 PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v__del);
4541 __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 125, __pyx_L1_error)
4542 __Pyx_GOTREF(__pyx_t_6);
4543 if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_doc, __pyx_v_doc) < 0) __PYX_ERR(0, 125, __pyx_L1_error)
4544 __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 125, __pyx_L1_error)
4545 __Pyx_GOTREF(__pyx_t_7);
4546 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4547 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4548 __pyx_r = __pyx_t_7;
4549 __pyx_t_7 = 0;
4550 goto __pyx_L0;
4551
4552 /* "borg/item.pyx":94
4553 *
4554 * @staticmethod
4555 * def _make_property(key, value_type, value_type_name=None, encode=None, decode=None): # <<<<<<<<<<<<<<
4556 * """return a property that deals with self._dict[key]"""
4557 * assert isinstance(key, str)
4558 */
4559
4560 /* function exit code */
4561 __pyx_L1_error:;
4562 __Pyx_XDECREF(__pyx_t_1);
4563 __Pyx_XDECREF(__pyx_t_6);
4564 __Pyx_XDECREF(__pyx_t_7);
4565 __Pyx_AddTraceback("borg.item.PropDict._make_property", __pyx_clineno, __pyx_lineno, __pyx_filename);
4566 __pyx_r = NULL;
4567 __pyx_L0:;
4568 __Pyx_XDECREF(__pyx_v_doc);
4569 __Pyx_XDECREF(__pyx_v__get);
4570 __Pyx_XDECREF(__pyx_v__set);
4571 __Pyx_XDECREF(__pyx_v__del);
4572 __Pyx_XDECREF(__pyx_v_value_type_name);
4573 __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
4574 __Pyx_XGIVEREF(__pyx_r);
4575 __Pyx_RefNannyFinishContext();
4576 return __pyx_r;
4577 }
4578
4579 /* "borg/item.pyx":191
4580 * part = PropDict._make_property('part', int)
4581 *
4582 * def get_size(self, hardlink_masters=None, memorize=False, compressed=False, from_chunks=False): # <<<<<<<<<<<<<<
4583 * """
4584 * Determine the (uncompressed or compressed) size of this item.
4585 */
4586
4587 /* Python wrapper */
4588 static PyObject *__pyx_pw_4borg_4item_4Item_1get_size(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4589 static char __pyx_doc_4borg_4item_4Item_get_size[] = "\n Determine the (uncompressed or compressed) size of this item.\n\n For hardlink slaves, the size is computed via the hardlink master's\n chunk list, if available (otherwise size will be returned as 0).\n\n If memorize is True, the computed size value will be stored into the item.\n ";
4590 static PyMethodDef __pyx_mdef_4borg_4item_4Item_1get_size = {"get_size", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4borg_4item_4Item_1get_size, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4borg_4item_4Item_get_size};
__pyx_pw_4borg_4item_4Item_1get_size(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)4591 static PyObject *__pyx_pw_4borg_4item_4Item_1get_size(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4592 PyObject *__pyx_v_self = 0;
4593 PyObject *__pyx_v_hardlink_masters = 0;
4594 PyObject *__pyx_v_memorize = 0;
4595 PyObject *__pyx_v_compressed = 0;
4596 PyObject *__pyx_v_from_chunks = 0;
4597 int __pyx_lineno = 0;
4598 const char *__pyx_filename = NULL;
4599 int __pyx_clineno = 0;
4600 PyObject *__pyx_r = 0;
4601 __Pyx_RefNannyDeclarations
4602 __Pyx_RefNannySetupContext("get_size (wrapper)", 0);
4603 {
4604 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_hardlink_masters,&__pyx_n_s_memorize,&__pyx_n_s_compressed,&__pyx_n_s_from_chunks,0};
4605 PyObject* values[5] = {0,0,0,0,0};
4606 values[1] = ((PyObject *)((PyObject *)Py_None));
4607 values[2] = ((PyObject *)((PyObject *)Py_False));
4608 values[3] = ((PyObject *)((PyObject *)Py_False));
4609 values[4] = ((PyObject *)((PyObject *)Py_False));
4610 if (unlikely(__pyx_kwds)) {
4611 Py_ssize_t kw_args;
4612 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4613 switch (pos_args) {
4614 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4615 CYTHON_FALLTHROUGH;
4616 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4617 CYTHON_FALLTHROUGH;
4618 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4619 CYTHON_FALLTHROUGH;
4620 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4621 CYTHON_FALLTHROUGH;
4622 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4623 CYTHON_FALLTHROUGH;
4624 case 0: break;
4625 default: goto __pyx_L5_argtuple_error;
4626 }
4627 kw_args = PyDict_Size(__pyx_kwds);
4628 switch (pos_args) {
4629 case 0:
4630 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
4631 else goto __pyx_L5_argtuple_error;
4632 CYTHON_FALLTHROUGH;
4633 case 1:
4634 if (kw_args > 0) {
4635 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hardlink_masters);
4636 if (value) { values[1] = value; kw_args--; }
4637 }
4638 CYTHON_FALLTHROUGH;
4639 case 2:
4640 if (kw_args > 0) {
4641 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memorize);
4642 if (value) { values[2] = value; kw_args--; }
4643 }
4644 CYTHON_FALLTHROUGH;
4645 case 3:
4646 if (kw_args > 0) {
4647 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_compressed);
4648 if (value) { values[3] = value; kw_args--; }
4649 }
4650 CYTHON_FALLTHROUGH;
4651 case 4:
4652 if (kw_args > 0) {
4653 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_from_chunks);
4654 if (value) { values[4] = value; kw_args--; }
4655 }
4656 }
4657 if (unlikely(kw_args > 0)) {
4658 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_size") < 0)) __PYX_ERR(0, 191, __pyx_L3_error)
4659 }
4660 } else {
4661 switch (PyTuple_GET_SIZE(__pyx_args)) {
4662 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4663 CYTHON_FALLTHROUGH;
4664 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4665 CYTHON_FALLTHROUGH;
4666 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4667 CYTHON_FALLTHROUGH;
4668 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4669 CYTHON_FALLTHROUGH;
4670 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4671 break;
4672 default: goto __pyx_L5_argtuple_error;
4673 }
4674 }
4675 __pyx_v_self = values[0];
4676 __pyx_v_hardlink_masters = values[1];
4677 __pyx_v_memorize = values[2];
4678 __pyx_v_compressed = values[3];
4679 __pyx_v_from_chunks = values[4];
4680 }
4681 goto __pyx_L4_argument_unpacking_done;
4682 __pyx_L5_argtuple_error:;
4683 __Pyx_RaiseArgtupleInvalid("get_size", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 191, __pyx_L3_error)
4684 __pyx_L3_error:;
4685 __Pyx_AddTraceback("borg.item.Item.get_size", __pyx_clineno, __pyx_lineno, __pyx_filename);
4686 __Pyx_RefNannyFinishContext();
4687 return NULL;
4688 __pyx_L4_argument_unpacking_done:;
4689 __pyx_r = __pyx_pf_4borg_4item_4Item_get_size(__pyx_self, __pyx_v_self, __pyx_v_hardlink_masters, __pyx_v_memorize, __pyx_v_compressed, __pyx_v_from_chunks);
4690
4691 /* function exit code */
4692 __Pyx_RefNannyFinishContext();
4693 return __pyx_r;
4694 }
4695 static PyObject *__pyx_gb_4borg_4item_4Item_8get_size_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
4696
4697 /* "borg/item.pyx":233
4698 * if chunks is None:
4699 * return 0
4700 * size = sum(getattr(ChunkListEntry(*chunk), attr) for chunk in chunks) # <<<<<<<<<<<<<<
4701 * # if requested, memorize the precomputed (c)size for items that have an own chunks list:
4702 * if memorize and having_chunks:
4703 */
4704
__pyx_pf_4borg_4item_4Item_8get_size_genexpr(PyObject * __pyx_self)4705 static PyObject *__pyx_pf_4borg_4item_4Item_8get_size_genexpr(PyObject *__pyx_self) {
4706 struct __pyx_obj_4borg_4item___pyx_scope_struct_2_genexpr *__pyx_cur_scope;
4707 PyObject *__pyx_r = NULL;
4708 __Pyx_RefNannyDeclarations
4709 int __pyx_lineno = 0;
4710 const char *__pyx_filename = NULL;
4711 int __pyx_clineno = 0;
4712 __Pyx_RefNannySetupContext("genexpr", 0);
4713 __pyx_cur_scope = (struct __pyx_obj_4borg_4item___pyx_scope_struct_2_genexpr *)__pyx_tp_new_4borg_4item___pyx_scope_struct_2_genexpr(__pyx_ptype_4borg_4item___pyx_scope_struct_2_genexpr, __pyx_empty_tuple, NULL);
4714 if (unlikely(!__pyx_cur_scope)) {
4715 __pyx_cur_scope = ((struct __pyx_obj_4borg_4item___pyx_scope_struct_2_genexpr *)Py_None);
4716 __Pyx_INCREF(Py_None);
4717 __PYX_ERR(0, 233, __pyx_L1_error)
4718 } else {
4719 __Pyx_GOTREF(__pyx_cur_scope);
4720 }
4721 __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_4borg_4item___pyx_scope_struct_1_get_size *) __pyx_self;
4722 __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
4723 __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
4724 {
4725 __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4borg_4item_4Item_8get_size_2generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Item_get_size_locals_genexpr, __pyx_n_s_borg_item); if (unlikely(!gen)) __PYX_ERR(0, 233, __pyx_L1_error)
4726 __Pyx_DECREF(__pyx_cur_scope);
4727 __Pyx_RefNannyFinishContext();
4728 return (PyObject *) gen;
4729 }
4730
4731 /* function exit code */
4732 __pyx_L1_error:;
4733 __Pyx_AddTraceback("borg.item.Item.get_size.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
4734 __pyx_r = NULL;
4735 __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
4736 __Pyx_XGIVEREF(__pyx_r);
4737 __Pyx_RefNannyFinishContext();
4738 return __pyx_r;
4739 }
4740
__pyx_gb_4borg_4item_4Item_8get_size_2generator(__pyx_CoroutineObject * __pyx_generator,CYTHON_UNUSED PyThreadState * __pyx_tstate,PyObject * __pyx_sent_value)4741 static PyObject *__pyx_gb_4borg_4item_4Item_8get_size_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
4742 {
4743 struct __pyx_obj_4borg_4item___pyx_scope_struct_2_genexpr *__pyx_cur_scope = ((struct __pyx_obj_4borg_4item___pyx_scope_struct_2_genexpr *)__pyx_generator->closure);
4744 PyObject *__pyx_r = NULL;
4745 PyObject *__pyx_t_1 = NULL;
4746 Py_ssize_t __pyx_t_2;
4747 PyObject *(*__pyx_t_3)(PyObject *);
4748 PyObject *__pyx_t_4 = NULL;
4749 PyObject *__pyx_t_5 = NULL;
4750 PyObject *__pyx_t_6 = NULL;
4751 int __pyx_lineno = 0;
4752 const char *__pyx_filename = NULL;
4753 int __pyx_clineno = 0;
4754 __Pyx_RefNannyDeclarations
4755 __Pyx_RefNannySetupContext("genexpr", 0);
4756 switch (__pyx_generator->resume_label) {
4757 case 0: goto __pyx_L3_first_run;
4758 case 1: goto __pyx_L6_resume_from_yield;
4759 default: /* CPython raises the right error here */
4760 __Pyx_RefNannyFinishContext();
4761 return NULL;
4762 }
4763 __pyx_L3_first_run:;
4764 if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 233, __pyx_L1_error)
4765 if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_chunks)) { __Pyx_RaiseClosureNameError("chunks"); __PYX_ERR(0, 233, __pyx_L1_error) }
4766 if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_chunks)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_chunks)) {
4767 __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_chunks; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
4768 __pyx_t_3 = NULL;
4769 } else {
4770 __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_chunks); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error)
4771 __Pyx_GOTREF(__pyx_t_1);
4772 __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L1_error)
4773 }
4774 for (;;) {
4775 if (likely(!__pyx_t_3)) {
4776 if (likely(PyList_CheckExact(__pyx_t_1))) {
4777 if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
4778 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4779 __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 233, __pyx_L1_error)
4780 #else
4781 __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 233, __pyx_L1_error)
4782 __Pyx_GOTREF(__pyx_t_4);
4783 #endif
4784 } else {
4785 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
4786 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4787 __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 233, __pyx_L1_error)
4788 #else
4789 __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 233, __pyx_L1_error)
4790 __Pyx_GOTREF(__pyx_t_4);
4791 #endif
4792 }
4793 } else {
4794 __pyx_t_4 = __pyx_t_3(__pyx_t_1);
4795 if (unlikely(!__pyx_t_4)) {
4796 PyObject* exc_type = PyErr_Occurred();
4797 if (exc_type) {
4798 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
4799 else __PYX_ERR(0, 233, __pyx_L1_error)
4800 }
4801 break;
4802 }
4803 __Pyx_GOTREF(__pyx_t_4);
4804 }
4805 __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_chunk);
4806 __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_chunk, __pyx_t_4);
4807 __Pyx_GIVEREF(__pyx_t_4);
4808 __pyx_t_4 = 0;
4809 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ChunkListEntry); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 233, __pyx_L1_error)
4810 __Pyx_GOTREF(__pyx_t_4);
4811 __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_cur_scope->__pyx_v_chunk); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 233, __pyx_L1_error)
4812 __Pyx_GOTREF(__pyx_t_5);
4813 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 233, __pyx_L1_error)
4814 __Pyx_GOTREF(__pyx_t_6);
4815 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4816 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4817 if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_attr)) { __Pyx_RaiseClosureNameError("attr"); __PYX_ERR(0, 233, __pyx_L1_error) }
4818 __pyx_t_5 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_attr;
4819 __Pyx_INCREF(__pyx_t_5);
4820 __pyx_t_4 = __Pyx_GetAttr(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 233, __pyx_L1_error)
4821 __Pyx_GOTREF(__pyx_t_4);
4822 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4823 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4824 __pyx_r = __pyx_t_4;
4825 __pyx_t_4 = 0;
4826 __Pyx_XGIVEREF(__pyx_t_1);
4827 __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
4828 __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
4829 __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
4830 __Pyx_XGIVEREF(__pyx_r);
4831 __Pyx_RefNannyFinishContext();
4832 __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
4833 /* return from generator, yielding value */
4834 __pyx_generator->resume_label = 1;
4835 return __pyx_r;
4836 __pyx_L6_resume_from_yield:;
4837 __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
4838 __pyx_cur_scope->__pyx_t_0 = 0;
4839 __Pyx_XGOTREF(__pyx_t_1);
4840 __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
4841 __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
4842 if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 233, __pyx_L1_error)
4843 }
4844 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4845 CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
4846
4847 /* function exit code */
4848 PyErr_SetNone(PyExc_StopIteration);
4849 goto __pyx_L0;
4850 __pyx_L1_error:;
4851 __Pyx_XDECREF(__pyx_t_1);
4852 __Pyx_XDECREF(__pyx_t_4);
4853 __Pyx_XDECREF(__pyx_t_5);
4854 __Pyx_XDECREF(__pyx_t_6);
4855 __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
4856 __pyx_L0:;
4857 __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
4858 #if !CYTHON_USE_EXC_INFO_STACK
4859 __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
4860 #endif
4861 __pyx_generator->resume_label = -1;
4862 __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
4863 __Pyx_RefNannyFinishContext();
4864 return __pyx_r;
4865 }
4866
4867 /* "borg/item.pyx":191
4868 * part = PropDict._make_property('part', int)
4869 *
4870 * def get_size(self, hardlink_masters=None, memorize=False, compressed=False, from_chunks=False): # <<<<<<<<<<<<<<
4871 * """
4872 * Determine the (uncompressed or compressed) size of this item.
4873 */
4874
__pyx_pf_4borg_4item_4Item_get_size(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_self,PyObject * __pyx_v_hardlink_masters,PyObject * __pyx_v_memorize,PyObject * __pyx_v_compressed,PyObject * __pyx_v_from_chunks)4875 static PyObject *__pyx_pf_4borg_4item_4Item_get_size(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_hardlink_masters, PyObject *__pyx_v_memorize, PyObject *__pyx_v_compressed, PyObject *__pyx_v_from_chunks) {
4876 struct __pyx_obj_4borg_4item___pyx_scope_struct_1_get_size *__pyx_cur_scope;
4877 PyObject *__pyx_v_size = NULL;
4878 int __pyx_v_having_chunks;
4879 PyObject *__pyx_v_master = NULL;
4880 CYTHON_UNUSED PyObject *__pyx_v__ = NULL;
4881 PyObject *__pyx_r = NULL;
4882 __Pyx_RefNannyDeclarations
4883 PyObject *__pyx_t_1 = NULL;
4884 int __pyx_t_2;
4885 int __pyx_t_3;
4886 PyObject *__pyx_t_4 = NULL;
4887 PyObject *__pyx_t_5 = NULL;
4888 PyObject *__pyx_t_6 = NULL;
4889 PyObject *__pyx_t_7 = NULL;
4890 int __pyx_t_8;
4891 PyObject *__pyx_t_9 = NULL;
4892 PyObject *__pyx_t_10 = NULL;
4893 PyObject *__pyx_t_11 = NULL;
4894 PyObject *__pyx_t_12 = NULL;
4895 PyObject *__pyx_t_13 = NULL;
4896 Py_ssize_t __pyx_t_14;
4897 PyObject *__pyx_t_15 = NULL;
4898 PyObject *__pyx_t_16 = NULL;
4899 PyObject *__pyx_t_17 = NULL;
4900 PyObject *__pyx_t_18 = NULL;
4901 PyObject *__pyx_t_19 = NULL;
4902 PyObject *__pyx_t_20 = NULL;
4903 PyObject *__pyx_t_21 = NULL;
4904 PyObject *__pyx_t_22 = NULL;
4905 PyObject *__pyx_t_23 = NULL;
4906 PyObject *(*__pyx_t_24)(PyObject *);
4907 int __pyx_t_25;
4908 int __pyx_lineno = 0;
4909 const char *__pyx_filename = NULL;
4910 int __pyx_clineno = 0;
4911 __Pyx_RefNannySetupContext("get_size", 0);
4912 __pyx_cur_scope = (struct __pyx_obj_4borg_4item___pyx_scope_struct_1_get_size *)__pyx_tp_new_4borg_4item___pyx_scope_struct_1_get_size(__pyx_ptype_4borg_4item___pyx_scope_struct_1_get_size, __pyx_empty_tuple, NULL);
4913 if (unlikely(!__pyx_cur_scope)) {
4914 __pyx_cur_scope = ((struct __pyx_obj_4borg_4item___pyx_scope_struct_1_get_size *)Py_None);
4915 __Pyx_INCREF(Py_None);
4916 __PYX_ERR(0, 191, __pyx_L1_error)
4917 } else {
4918 __Pyx_GOTREF(__pyx_cur_scope);
4919 }
4920
4921 /* "borg/item.pyx":200
4922 * If memorize is True, the computed size value will be stored into the item.
4923 * """
4924 * attr = 'csize' if compressed else 'size' # <<<<<<<<<<<<<<
4925 * assert not (compressed and memorize), 'Item does not have a csize field.'
4926 * try:
4927 */
4928 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_compressed); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 200, __pyx_L1_error)
4929 if (__pyx_t_2) {
4930 __Pyx_INCREF(__pyx_n_u_csize);
4931 __pyx_t_1 = __pyx_n_u_csize;
4932 } else {
4933 __Pyx_INCREF(__pyx_n_u_size);
4934 __pyx_t_1 = __pyx_n_u_size;
4935 }
4936 __Pyx_GIVEREF(__pyx_t_1);
4937 __pyx_cur_scope->__pyx_v_attr = ((PyObject*)__pyx_t_1);
4938 __pyx_t_1 = 0;
4939
4940 /* "borg/item.pyx":201
4941 * """
4942 * attr = 'csize' if compressed else 'size'
4943 * assert not (compressed and memorize), 'Item does not have a csize field.' # <<<<<<<<<<<<<<
4944 * try:
4945 * if from_chunks:
4946 */
4947 #ifndef CYTHON_WITHOUT_ASSERTIONS
4948 if (unlikely(!Py_OptimizeFlag)) {
4949 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_compressed); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 201, __pyx_L1_error)
4950 if (__pyx_t_3) {
4951 } else {
4952 __pyx_t_2 = __pyx_t_3;
4953 goto __pyx_L3_bool_binop_done;
4954 }
4955 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_memorize); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 201, __pyx_L1_error)
4956 __pyx_t_2 = __pyx_t_3;
4957 __pyx_L3_bool_binop_done:;
4958 if (unlikely(!((!__pyx_t_2) != 0))) {
4959 PyErr_SetObject(PyExc_AssertionError, __pyx_kp_u_Item_does_not_have_a_csize_field);
4960 __PYX_ERR(0, 201, __pyx_L1_error)
4961 }
4962 }
4963 #endif
4964
4965 /* "borg/item.pyx":202
4966 * attr = 'csize' if compressed else 'size'
4967 * assert not (compressed and memorize), 'Item does not have a csize field.'
4968 * try: # <<<<<<<<<<<<<<
4969 * if from_chunks:
4970 * raise AttributeError
4971 */
4972 {
4973 __Pyx_PyThreadState_declare
4974 __Pyx_PyThreadState_assign
4975 __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
4976 __Pyx_XGOTREF(__pyx_t_4);
4977 __Pyx_XGOTREF(__pyx_t_5);
4978 __Pyx_XGOTREF(__pyx_t_6);
4979 /*try:*/ {
4980
4981 /* "borg/item.pyx":203
4982 * assert not (compressed and memorize), 'Item does not have a csize field.'
4983 * try:
4984 * if from_chunks: # <<<<<<<<<<<<<<
4985 * raise AttributeError
4986 * size = getattr(self, attr)
4987 */
4988 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_from_chunks); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 203, __pyx_L5_error)
4989 if (unlikely(__pyx_t_2)) {
4990
4991 /* "borg/item.pyx":204
4992 * try:
4993 * if from_chunks:
4994 * raise AttributeError # <<<<<<<<<<<<<<
4995 * size = getattr(self, attr)
4996 * except AttributeError:
4997 */
4998 __Pyx_Raise(__pyx_builtin_AttributeError, 0, 0, 0);
4999 __PYX_ERR(0, 204, __pyx_L5_error)
5000
5001 /* "borg/item.pyx":203
5002 * assert not (compressed and memorize), 'Item does not have a csize field.'
5003 * try:
5004 * if from_chunks: # <<<<<<<<<<<<<<
5005 * raise AttributeError
5006 * size = getattr(self, attr)
5007 */
5008 }
5009
5010 /* "borg/item.pyx":205
5011 * if from_chunks:
5012 * raise AttributeError
5013 * size = getattr(self, attr) # <<<<<<<<<<<<<<
5014 * except AttributeError:
5015 * if stat.S_ISLNK(self.mode):
5016 */
5017 __pyx_t_1 = __pyx_cur_scope->__pyx_v_attr;
5018 __Pyx_INCREF(__pyx_t_1);
5019 __pyx_t_7 = __Pyx_GetAttr(__pyx_v_self, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 205, __pyx_L5_error)
5020 __Pyx_GOTREF(__pyx_t_7);
5021 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5022 __pyx_v_size = __pyx_t_7;
5023 __pyx_t_7 = 0;
5024
5025 /* "borg/item.pyx":202
5026 * attr = 'csize' if compressed else 'size'
5027 * assert not (compressed and memorize), 'Item does not have a csize field.'
5028 * try: # <<<<<<<<<<<<<<
5029 * if from_chunks:
5030 * raise AttributeError
5031 */
5032 }
5033 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
5034 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
5035 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
5036 goto __pyx_L10_try_end;
5037 __pyx_L5_error:;
5038 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5039 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
5040
5041 /* "borg/item.pyx":206
5042 * raise AttributeError
5043 * size = getattr(self, attr)
5044 * except AttributeError: # <<<<<<<<<<<<<<
5045 * if stat.S_ISLNK(self.mode):
5046 * # get out of here quickly. symlinks have no own chunks, their fs size is the length of the target name.
5047 */
5048 __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
5049 if (__pyx_t_8) {
5050 __Pyx_AddTraceback("borg.item.Item.get_size", __pyx_clineno, __pyx_lineno, __pyx_filename);
5051 if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_1, &__pyx_t_9) < 0) __PYX_ERR(0, 206, __pyx_L7_except_error)
5052 __Pyx_GOTREF(__pyx_t_7);
5053 __Pyx_GOTREF(__pyx_t_1);
5054 __Pyx_GOTREF(__pyx_t_9);
5055
5056 /* "borg/item.pyx":207
5057 * size = getattr(self, attr)
5058 * except AttributeError:
5059 * if stat.S_ISLNK(self.mode): # <<<<<<<<<<<<<<
5060 * # get out of here quickly. symlinks have no own chunks, their fs size is the length of the target name.
5061 * # also, there is the dual-use issue of .source (#2343), so don't confuse it with a hardlink slave.
5062 */
5063 __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_stat); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 207, __pyx_L7_except_error)
5064 __Pyx_GOTREF(__pyx_t_11);
5065 __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_S_ISLNK); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 207, __pyx_L7_except_error)
5066 __Pyx_GOTREF(__pyx_t_12);
5067 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5068 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 207, __pyx_L7_except_error)
5069 __Pyx_GOTREF(__pyx_t_11);
5070 __pyx_t_13 = NULL;
5071 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
5072 __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
5073 if (likely(__pyx_t_13)) {
5074 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
5075 __Pyx_INCREF(__pyx_t_13);
5076 __Pyx_INCREF(function);
5077 __Pyx_DECREF_SET(__pyx_t_12, function);
5078 }
5079 }
5080 __pyx_t_10 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_13, __pyx_t_11) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_11);
5081 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
5082 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5083 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 207, __pyx_L7_except_error)
5084 __Pyx_GOTREF(__pyx_t_10);
5085 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5086 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 207, __pyx_L7_except_error)
5087 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5088 if (__pyx_t_2) {
5089
5090 /* "borg/item.pyx":210
5091 * # get out of here quickly. symlinks have no own chunks, their fs size is the length of the target name.
5092 * # also, there is the dual-use issue of .source (#2343), so don't confuse it with a hardlink slave.
5093 * return len(self.source) # <<<<<<<<<<<<<<
5094 * # no precomputed (c)size value available, compute it:
5095 * try:
5096 */
5097 __Pyx_XDECREF(__pyx_r);
5098 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_source); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 210, __pyx_L7_except_error)
5099 __Pyx_GOTREF(__pyx_t_10);
5100 __pyx_t_14 = PyObject_Length(__pyx_t_10); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 210, __pyx_L7_except_error)
5101 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5102 __pyx_t_10 = PyInt_FromSsize_t(__pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 210, __pyx_L7_except_error)
5103 __Pyx_GOTREF(__pyx_t_10);
5104 __pyx_r = __pyx_t_10;
5105 __pyx_t_10 = 0;
5106 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5107 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5108 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5109 goto __pyx_L8_except_return;
5110
5111 /* "borg/item.pyx":207
5112 * size = getattr(self, attr)
5113 * except AttributeError:
5114 * if stat.S_ISLNK(self.mode): # <<<<<<<<<<<<<<
5115 * # get out of here quickly. symlinks have no own chunks, their fs size is the length of the target name.
5116 * # also, there is the dual-use issue of .source (#2343), so don't confuse it with a hardlink slave.
5117 */
5118 }
5119
5120 /* "borg/item.pyx":212
5121 * return len(self.source)
5122 * # no precomputed (c)size value available, compute it:
5123 * try: # <<<<<<<<<<<<<<
5124 * chunks = getattr(self, 'chunks')
5125 * having_chunks = True
5126 */
5127 {
5128 __Pyx_PyThreadState_declare
5129 __Pyx_PyThreadState_assign
5130 __Pyx_ExceptionSave(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
5131 __Pyx_XGOTREF(__pyx_t_15);
5132 __Pyx_XGOTREF(__pyx_t_16);
5133 __Pyx_XGOTREF(__pyx_t_17);
5134 /*try:*/ {
5135
5136 /* "borg/item.pyx":213
5137 * # no precomputed (c)size value available, compute it:
5138 * try:
5139 * chunks = getattr(self, 'chunks') # <<<<<<<<<<<<<<
5140 * having_chunks = True
5141 * except AttributeError:
5142 */
5143 __pyx_t_10 = __Pyx_GetAttr(__pyx_v_self, __pyx_n_u_chunks); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 213, __pyx_L15_error)
5144 __Pyx_GOTREF(__pyx_t_10);
5145 __Pyx_GIVEREF(__pyx_t_10);
5146 __pyx_cur_scope->__pyx_v_chunks = __pyx_t_10;
5147 __pyx_t_10 = 0;
5148
5149 /* "borg/item.pyx":214
5150 * try:
5151 * chunks = getattr(self, 'chunks')
5152 * having_chunks = True # <<<<<<<<<<<<<<
5153 * except AttributeError:
5154 * having_chunks = False
5155 */
5156 __pyx_v_having_chunks = 1;
5157
5158 /* "borg/item.pyx":212
5159 * return len(self.source)
5160 * # no precomputed (c)size value available, compute it:
5161 * try: # <<<<<<<<<<<<<<
5162 * chunks = getattr(self, 'chunks')
5163 * having_chunks = True
5164 */
5165 }
5166 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
5167 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
5168 __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
5169 goto __pyx_L22_try_end;
5170 __pyx_L15_error:;
5171 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
5172 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
5173 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
5174 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
5175
5176 /* "borg/item.pyx":215
5177 * chunks = getattr(self, 'chunks')
5178 * having_chunks = True
5179 * except AttributeError: # <<<<<<<<<<<<<<
5180 * having_chunks = False
5181 * # this item has no (own) chunks list, but if this is a hardlink slave
5182 */
5183 __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
5184 if (__pyx_t_8) {
5185 __Pyx_AddTraceback("borg.item.Item.get_size", __pyx_clineno, __pyx_lineno, __pyx_filename);
5186 if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_12, &__pyx_t_11) < 0) __PYX_ERR(0, 215, __pyx_L17_except_error)
5187 __Pyx_GOTREF(__pyx_t_10);
5188 __Pyx_GOTREF(__pyx_t_12);
5189 __Pyx_GOTREF(__pyx_t_11);
5190
5191 /* "borg/item.pyx":216
5192 * having_chunks = True
5193 * except AttributeError:
5194 * having_chunks = False # <<<<<<<<<<<<<<
5195 * # this item has no (own) chunks list, but if this is a hardlink slave
5196 * # and we know the master, we can still compute the size.
5197 */
5198 __pyx_v_having_chunks = 0;
5199
5200 /* "borg/item.pyx":219
5201 * # this item has no (own) chunks list, but if this is a hardlink slave
5202 * # and we know the master, we can still compute the size.
5203 * if hardlink_masters is None: # <<<<<<<<<<<<<<
5204 * chunks = None
5205 * else:
5206 */
5207 __pyx_t_2 = (__pyx_v_hardlink_masters == Py_None);
5208 __pyx_t_3 = (__pyx_t_2 != 0);
5209 if (__pyx_t_3) {
5210
5211 /* "borg/item.pyx":220
5212 * # and we know the master, we can still compute the size.
5213 * if hardlink_masters is None:
5214 * chunks = None # <<<<<<<<<<<<<<
5215 * else:
5216 * try:
5217 */
5218 __Pyx_INCREF(Py_None);
5219 __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_chunks);
5220 __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_chunks, Py_None);
5221 __Pyx_GIVEREF(Py_None);
5222
5223 /* "borg/item.pyx":219
5224 * # this item has no (own) chunks list, but if this is a hardlink slave
5225 * # and we know the master, we can still compute the size.
5226 * if hardlink_masters is None: # <<<<<<<<<<<<<<
5227 * chunks = None
5228 * else:
5229 */
5230 goto __pyx_L25;
5231 }
5232
5233 /* "borg/item.pyx":222
5234 * chunks = None
5235 * else:
5236 * try: # <<<<<<<<<<<<<<
5237 * master = getattr(self, 'source')
5238 * except AttributeError:
5239 */
5240 /*else*/ {
5241 {
5242 __Pyx_PyThreadState_declare
5243 __Pyx_PyThreadState_assign
5244 __Pyx_ExceptionSave(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
5245 __Pyx_XGOTREF(__pyx_t_18);
5246 __Pyx_XGOTREF(__pyx_t_19);
5247 __Pyx_XGOTREF(__pyx_t_20);
5248 /*try:*/ {
5249
5250 /* "borg/item.pyx":223
5251 * else:
5252 * try:
5253 * master = getattr(self, 'source') # <<<<<<<<<<<<<<
5254 * except AttributeError:
5255 * # not a hardlink slave, likely a directory or special file w/o chunks
5256 */
5257 __pyx_t_13 = __Pyx_GetAttr(__pyx_v_self, __pyx_n_u_source); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 223, __pyx_L26_error)
5258 __Pyx_GOTREF(__pyx_t_13);
5259 __pyx_v_master = __pyx_t_13;
5260 __pyx_t_13 = 0;
5261
5262 /* "borg/item.pyx":222
5263 * chunks = None
5264 * else:
5265 * try: # <<<<<<<<<<<<<<
5266 * master = getattr(self, 'source')
5267 * except AttributeError:
5268 */
5269 }
5270
5271 /* "borg/item.pyx":230
5272 * # hardlink slave, try to fetch hardlink master's chunks list
5273 * # todo: put precomputed size into hardlink_masters' values and use it, if present
5274 * chunks, _ = hardlink_masters.get(master, (None, None)) # <<<<<<<<<<<<<<
5275 * if chunks is None:
5276 * return 0
5277 */
5278 /*else:*/ {
5279 __pyx_t_21 = __Pyx_PyObject_GetAttrStr(__pyx_v_hardlink_masters, __pyx_n_s_get_2); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 230, __pyx_L28_except_error)
5280 __Pyx_GOTREF(__pyx_t_21);
5281 __pyx_t_22 = NULL;
5282 __pyx_t_8 = 0;
5283 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_21))) {
5284 __pyx_t_22 = PyMethod_GET_SELF(__pyx_t_21);
5285 if (likely(__pyx_t_22)) {
5286 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_21);
5287 __Pyx_INCREF(__pyx_t_22);
5288 __Pyx_INCREF(function);
5289 __Pyx_DECREF_SET(__pyx_t_21, function);
5290 __pyx_t_8 = 1;
5291 }
5292 }
5293 #if CYTHON_FAST_PYCALL
5294 if (PyFunction_Check(__pyx_t_21)) {
5295 PyObject *__pyx_temp[3] = {__pyx_t_22, __pyx_v_master, __pyx_tuple__12};
5296 __pyx_t_13 = __Pyx_PyFunction_FastCall(__pyx_t_21, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 230, __pyx_L28_except_error)
5297 __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
5298 __Pyx_GOTREF(__pyx_t_13);
5299 } else
5300 #endif
5301 #if CYTHON_FAST_PYCCALL
5302 if (__Pyx_PyFastCFunction_Check(__pyx_t_21)) {
5303 PyObject *__pyx_temp[3] = {__pyx_t_22, __pyx_v_master, __pyx_tuple__12};
5304 __pyx_t_13 = __Pyx_PyCFunction_FastCall(__pyx_t_21, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 230, __pyx_L28_except_error)
5305 __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
5306 __Pyx_GOTREF(__pyx_t_13);
5307 } else
5308 #endif
5309 {
5310 __pyx_t_23 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 230, __pyx_L28_except_error)
5311 __Pyx_GOTREF(__pyx_t_23);
5312 if (__pyx_t_22) {
5313 __Pyx_GIVEREF(__pyx_t_22); PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_t_22); __pyx_t_22 = NULL;
5314 }
5315 __Pyx_INCREF(__pyx_v_master);
5316 __Pyx_GIVEREF(__pyx_v_master);
5317 PyTuple_SET_ITEM(__pyx_t_23, 0+__pyx_t_8, __pyx_v_master);
5318 __Pyx_INCREF(__pyx_tuple__12);
5319 __Pyx_GIVEREF(__pyx_tuple__12);
5320 PyTuple_SET_ITEM(__pyx_t_23, 1+__pyx_t_8, __pyx_tuple__12);
5321 __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_21, __pyx_t_23, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 230, __pyx_L28_except_error)
5322 __Pyx_GOTREF(__pyx_t_13);
5323 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
5324 }
5325 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
5326 if ((likely(PyTuple_CheckExact(__pyx_t_13))) || (PyList_CheckExact(__pyx_t_13))) {
5327 PyObject* sequence = __pyx_t_13;
5328 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
5329 if (unlikely(size != 2)) {
5330 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
5331 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
5332 __PYX_ERR(0, 230, __pyx_L28_except_error)
5333 }
5334 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5335 if (likely(PyTuple_CheckExact(sequence))) {
5336 __pyx_t_21 = PyTuple_GET_ITEM(sequence, 0);
5337 __pyx_t_23 = PyTuple_GET_ITEM(sequence, 1);
5338 } else {
5339 __pyx_t_21 = PyList_GET_ITEM(sequence, 0);
5340 __pyx_t_23 = PyList_GET_ITEM(sequence, 1);
5341 }
5342 __Pyx_INCREF(__pyx_t_21);
5343 __Pyx_INCREF(__pyx_t_23);
5344 #else
5345 __pyx_t_21 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 230, __pyx_L28_except_error)
5346 __Pyx_GOTREF(__pyx_t_21);
5347 __pyx_t_23 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 230, __pyx_L28_except_error)
5348 __Pyx_GOTREF(__pyx_t_23);
5349 #endif
5350 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5351 } else {
5352 Py_ssize_t index = -1;
5353 __pyx_t_22 = PyObject_GetIter(__pyx_t_13); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 230, __pyx_L28_except_error)
5354 __Pyx_GOTREF(__pyx_t_22);
5355 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5356 __pyx_t_24 = Py_TYPE(__pyx_t_22)->tp_iternext;
5357 index = 0; __pyx_t_21 = __pyx_t_24(__pyx_t_22); if (unlikely(!__pyx_t_21)) goto __pyx_L34_unpacking_failed;
5358 __Pyx_GOTREF(__pyx_t_21);
5359 index = 1; __pyx_t_23 = __pyx_t_24(__pyx_t_22); if (unlikely(!__pyx_t_23)) goto __pyx_L34_unpacking_failed;
5360 __Pyx_GOTREF(__pyx_t_23);
5361 if (__Pyx_IternextUnpackEndCheck(__pyx_t_24(__pyx_t_22), 2) < 0) __PYX_ERR(0, 230, __pyx_L28_except_error)
5362 __pyx_t_24 = NULL;
5363 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
5364 goto __pyx_L35_unpacking_done;
5365 __pyx_L34_unpacking_failed:;
5366 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
5367 __pyx_t_24 = NULL;
5368 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
5369 __PYX_ERR(0, 230, __pyx_L28_except_error)
5370 __pyx_L35_unpacking_done:;
5371 }
5372 __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_chunks);
5373 __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_chunks, __pyx_t_21);
5374 __Pyx_GIVEREF(__pyx_t_21);
5375 __pyx_t_21 = 0;
5376 __pyx_v__ = __pyx_t_23;
5377 __pyx_t_23 = 0;
5378 }
5379 __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
5380 __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
5381 __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
5382 goto __pyx_L33_try_end;
5383 __pyx_L26_error:;
5384 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
5385
5386 /* "borg/item.pyx":224
5387 * try:
5388 * master = getattr(self, 'source')
5389 * except AttributeError: # <<<<<<<<<<<<<<
5390 * # not a hardlink slave, likely a directory or special file w/o chunks
5391 * chunks = None
5392 */
5393 __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
5394 if (__pyx_t_8) {
5395 __Pyx_AddTraceback("borg.item.Item.get_size", __pyx_clineno, __pyx_lineno, __pyx_filename);
5396 if (__Pyx_GetException(&__pyx_t_13, &__pyx_t_23, &__pyx_t_21) < 0) __PYX_ERR(0, 224, __pyx_L28_except_error)
5397 __Pyx_GOTREF(__pyx_t_13);
5398 __Pyx_GOTREF(__pyx_t_23);
5399 __Pyx_GOTREF(__pyx_t_21);
5400
5401 /* "borg/item.pyx":226
5402 * except AttributeError:
5403 * # not a hardlink slave, likely a directory or special file w/o chunks
5404 * chunks = None # <<<<<<<<<<<<<<
5405 * else:
5406 * # hardlink slave, try to fetch hardlink master's chunks list
5407 */
5408 __Pyx_INCREF(Py_None);
5409 __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_chunks);
5410 __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_chunks, Py_None);
5411 __Pyx_GIVEREF(Py_None);
5412 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
5413 __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
5414 __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
5415 goto __pyx_L27_exception_handled;
5416 }
5417 goto __pyx_L28_except_error;
5418 __pyx_L28_except_error:;
5419
5420 /* "borg/item.pyx":222
5421 * chunks = None
5422 * else:
5423 * try: # <<<<<<<<<<<<<<
5424 * master = getattr(self, 'source')
5425 * except AttributeError:
5426 */
5427 __Pyx_XGIVEREF(__pyx_t_18);
5428 __Pyx_XGIVEREF(__pyx_t_19);
5429 __Pyx_XGIVEREF(__pyx_t_20);
5430 __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
5431 goto __pyx_L17_except_error;
5432 __pyx_L27_exception_handled:;
5433 __Pyx_XGIVEREF(__pyx_t_18);
5434 __Pyx_XGIVEREF(__pyx_t_19);
5435 __Pyx_XGIVEREF(__pyx_t_20);
5436 __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
5437 __pyx_L33_try_end:;
5438 }
5439 }
5440 __pyx_L25:;
5441
5442 /* "borg/item.pyx":231
5443 * # todo: put precomputed size into hardlink_masters' values and use it, if present
5444 * chunks, _ = hardlink_masters.get(master, (None, None))
5445 * if chunks is None: # <<<<<<<<<<<<<<
5446 * return 0
5447 * size = sum(getattr(ChunkListEntry(*chunk), attr) for chunk in chunks)
5448 */
5449 __pyx_t_3 = (__pyx_cur_scope->__pyx_v_chunks == Py_None);
5450 __pyx_t_2 = (__pyx_t_3 != 0);
5451 if (__pyx_t_2) {
5452
5453 /* "borg/item.pyx":232
5454 * chunks, _ = hardlink_masters.get(master, (None, None))
5455 * if chunks is None:
5456 * return 0 # <<<<<<<<<<<<<<
5457 * size = sum(getattr(ChunkListEntry(*chunk), attr) for chunk in chunks)
5458 * # if requested, memorize the precomputed (c)size for items that have an own chunks list:
5459 */
5460 __Pyx_XDECREF(__pyx_r);
5461 __Pyx_INCREF(__pyx_int_0);
5462 __pyx_r = __pyx_int_0;
5463 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5464 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5465 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5466 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5467 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5468 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5469 goto __pyx_L18_except_return;
5470
5471 /* "borg/item.pyx":231
5472 * # todo: put precomputed size into hardlink_masters' values and use it, if present
5473 * chunks, _ = hardlink_masters.get(master, (None, None))
5474 * if chunks is None: # <<<<<<<<<<<<<<
5475 * return 0
5476 * size = sum(getattr(ChunkListEntry(*chunk), attr) for chunk in chunks)
5477 */
5478 }
5479 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
5480 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
5481 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
5482 goto __pyx_L16_exception_handled;
5483 }
5484 goto __pyx_L17_except_error;
5485 __pyx_L17_except_error:;
5486
5487 /* "borg/item.pyx":212
5488 * return len(self.source)
5489 * # no precomputed (c)size value available, compute it:
5490 * try: # <<<<<<<<<<<<<<
5491 * chunks = getattr(self, 'chunks')
5492 * having_chunks = True
5493 */
5494 __Pyx_XGIVEREF(__pyx_t_15);
5495 __Pyx_XGIVEREF(__pyx_t_16);
5496 __Pyx_XGIVEREF(__pyx_t_17);
5497 __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
5498 goto __pyx_L7_except_error;
5499 __pyx_L18_except_return:;
5500 __Pyx_XGIVEREF(__pyx_t_15);
5501 __Pyx_XGIVEREF(__pyx_t_16);
5502 __Pyx_XGIVEREF(__pyx_t_17);
5503 __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
5504 goto __pyx_L8_except_return;
5505 __pyx_L16_exception_handled:;
5506 __Pyx_XGIVEREF(__pyx_t_15);
5507 __Pyx_XGIVEREF(__pyx_t_16);
5508 __Pyx_XGIVEREF(__pyx_t_17);
5509 __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
5510 __pyx_L22_try_end:;
5511 }
5512
5513 /* "borg/item.pyx":233
5514 * if chunks is None:
5515 * return 0
5516 * size = sum(getattr(ChunkListEntry(*chunk), attr) for chunk in chunks) # <<<<<<<<<<<<<<
5517 * # if requested, memorize the precomputed (c)size for items that have an own chunks list:
5518 * if memorize and having_chunks:
5519 */
5520 __pyx_t_11 = __pyx_pf_4borg_4item_4Item_8get_size_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 233, __pyx_L7_except_error)
5521 __Pyx_GOTREF(__pyx_t_11);
5522 __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 233, __pyx_L7_except_error)
5523 __Pyx_GOTREF(__pyx_t_12);
5524 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5525 __Pyx_XDECREF_SET(__pyx_v_size, __pyx_t_12);
5526 __pyx_t_12 = 0;
5527
5528 /* "borg/item.pyx":235
5529 * size = sum(getattr(ChunkListEntry(*chunk), attr) for chunk in chunks)
5530 * # if requested, memorize the precomputed (c)size for items that have an own chunks list:
5531 * if memorize and having_chunks: # <<<<<<<<<<<<<<
5532 * setattr(self, attr, size)
5533 * return size
5534 */
5535 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_memorize); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 235, __pyx_L7_except_error)
5536 if (__pyx_t_3) {
5537 } else {
5538 __pyx_t_2 = __pyx_t_3;
5539 goto __pyx_L40_bool_binop_done;
5540 }
5541 __pyx_t_3 = (__pyx_v_having_chunks != 0);
5542 __pyx_t_2 = __pyx_t_3;
5543 __pyx_L40_bool_binop_done:;
5544 if (__pyx_t_2) {
5545
5546 /* "borg/item.pyx":236
5547 * # if requested, memorize the precomputed (c)size for items that have an own chunks list:
5548 * if memorize and having_chunks:
5549 * setattr(self, attr, size) # <<<<<<<<<<<<<<
5550 * return size
5551 *
5552 */
5553 __pyx_t_12 = __pyx_cur_scope->__pyx_v_attr;
5554 __Pyx_INCREF(__pyx_t_12);
5555 __pyx_t_25 = PyObject_SetAttr(__pyx_v_self, __pyx_t_12, __pyx_v_size); if (unlikely(__pyx_t_25 == ((int)-1))) __PYX_ERR(0, 236, __pyx_L7_except_error)
5556 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5557
5558 /* "borg/item.pyx":235
5559 * size = sum(getattr(ChunkListEntry(*chunk), attr) for chunk in chunks)
5560 * # if requested, memorize the precomputed (c)size for items that have an own chunks list:
5561 * if memorize and having_chunks: # <<<<<<<<<<<<<<
5562 * setattr(self, attr, size)
5563 * return size
5564 */
5565 }
5566 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
5567 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5568 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5569 goto __pyx_L6_exception_handled;
5570 }
5571 goto __pyx_L7_except_error;
5572 __pyx_L7_except_error:;
5573
5574 /* "borg/item.pyx":202
5575 * attr = 'csize' if compressed else 'size'
5576 * assert not (compressed and memorize), 'Item does not have a csize field.'
5577 * try: # <<<<<<<<<<<<<<
5578 * if from_chunks:
5579 * raise AttributeError
5580 */
5581 __Pyx_XGIVEREF(__pyx_t_4);
5582 __Pyx_XGIVEREF(__pyx_t_5);
5583 __Pyx_XGIVEREF(__pyx_t_6);
5584 __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
5585 goto __pyx_L1_error;
5586 __pyx_L8_except_return:;
5587 __Pyx_XGIVEREF(__pyx_t_4);
5588 __Pyx_XGIVEREF(__pyx_t_5);
5589 __Pyx_XGIVEREF(__pyx_t_6);
5590 __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
5591 goto __pyx_L0;
5592 __pyx_L6_exception_handled:;
5593 __Pyx_XGIVEREF(__pyx_t_4);
5594 __Pyx_XGIVEREF(__pyx_t_5);
5595 __Pyx_XGIVEREF(__pyx_t_6);
5596 __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
5597 __pyx_L10_try_end:;
5598 }
5599
5600 /* "borg/item.pyx":237
5601 * if memorize and having_chunks:
5602 * setattr(self, attr, size)
5603 * return size # <<<<<<<<<<<<<<
5604 *
5605 *
5606 */
5607 __Pyx_XDECREF(__pyx_r);
5608 __Pyx_INCREF(__pyx_v_size);
5609 __pyx_r = __pyx_v_size;
5610 goto __pyx_L0;
5611
5612 /* "borg/item.pyx":191
5613 * part = PropDict._make_property('part', int)
5614 *
5615 * def get_size(self, hardlink_masters=None, memorize=False, compressed=False, from_chunks=False): # <<<<<<<<<<<<<<
5616 * """
5617 * Determine the (uncompressed or compressed) size of this item.
5618 */
5619
5620 /* function exit code */
5621 __pyx_L1_error:;
5622 __Pyx_XDECREF(__pyx_t_1);
5623 __Pyx_XDECREF(__pyx_t_7);
5624 __Pyx_XDECREF(__pyx_t_9);
5625 __Pyx_XDECREF(__pyx_t_10);
5626 __Pyx_XDECREF(__pyx_t_11);
5627 __Pyx_XDECREF(__pyx_t_12);
5628 __Pyx_XDECREF(__pyx_t_13);
5629 __Pyx_XDECREF(__pyx_t_21);
5630 __Pyx_XDECREF(__pyx_t_22);
5631 __Pyx_XDECREF(__pyx_t_23);
5632 __Pyx_AddTraceback("borg.item.Item.get_size", __pyx_clineno, __pyx_lineno, __pyx_filename);
5633 __pyx_r = NULL;
5634 __pyx_L0:;
5635 __Pyx_XDECREF(__pyx_v_size);
5636 __Pyx_XDECREF(__pyx_v_master);
5637 __Pyx_XDECREF(__pyx_v__);
5638 __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
5639 __Pyx_XGIVEREF(__pyx_r);
5640 __Pyx_RefNannyFinishContext();
5641 return __pyx_r;
5642 }
5643
5644 static struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property *__pyx_freelist_4borg_4item___pyx_scope_struct___make_property[8];
5645 static int __pyx_freecount_4borg_4item___pyx_scope_struct___make_property = 0;
5646
__pyx_tp_new_4borg_4item___pyx_scope_struct___make_property(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)5647 static PyObject *__pyx_tp_new_4borg_4item___pyx_scope_struct___make_property(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
5648 PyObject *o;
5649 if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_4borg_4item___pyx_scope_struct___make_property > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property)))) {
5650 o = (PyObject*)__pyx_freelist_4borg_4item___pyx_scope_struct___make_property[--__pyx_freecount_4borg_4item___pyx_scope_struct___make_property];
5651 memset(o, 0, sizeof(struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property));
5652 (void) PyObject_INIT(o, t);
5653 PyObject_GC_Track(o);
5654 } else {
5655 o = (*t->tp_alloc)(t, 0);
5656 if (unlikely(!o)) return 0;
5657 }
5658 return o;
5659 }
5660
__pyx_tp_dealloc_4borg_4item___pyx_scope_struct___make_property(PyObject * o)5661 static void __pyx_tp_dealloc_4borg_4item___pyx_scope_struct___make_property(PyObject *o) {
5662 struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property *p = (struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property *)o;
5663 PyObject_GC_UnTrack(o);
5664 Py_CLEAR(p->__pyx_v_attr_error_msg);
5665 Py_CLEAR(p->__pyx_v_decode);
5666 Py_CLEAR(p->__pyx_v_encode);
5667 Py_CLEAR(p->__pyx_v_key);
5668 Py_CLEAR(p->__pyx_v_type_error_msg);
5669 Py_CLEAR(p->__pyx_v_value_type);
5670 if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_4borg_4item___pyx_scope_struct___make_property < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property)))) {
5671 __pyx_freelist_4borg_4item___pyx_scope_struct___make_property[__pyx_freecount_4borg_4item___pyx_scope_struct___make_property++] = ((struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property *)o);
5672 } else {
5673 (*Py_TYPE(o)->tp_free)(o);
5674 }
5675 }
5676
__pyx_tp_traverse_4borg_4item___pyx_scope_struct___make_property(PyObject * o,visitproc v,void * a)5677 static int __pyx_tp_traverse_4borg_4item___pyx_scope_struct___make_property(PyObject *o, visitproc v, void *a) {
5678 int e;
5679 struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property *p = (struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property *)o;
5680 if (p->__pyx_v_decode) {
5681 e = (*v)(p->__pyx_v_decode, a); if (e) return e;
5682 }
5683 if (p->__pyx_v_encode) {
5684 e = (*v)(p->__pyx_v_encode, a); if (e) return e;
5685 }
5686 if (p->__pyx_v_key) {
5687 e = (*v)(p->__pyx_v_key, a); if (e) return e;
5688 }
5689 if (p->__pyx_v_value_type) {
5690 e = (*v)(p->__pyx_v_value_type, a); if (e) return e;
5691 }
5692 return 0;
5693 }
5694
__pyx_tp_clear_4borg_4item___pyx_scope_struct___make_property(PyObject * o)5695 static int __pyx_tp_clear_4borg_4item___pyx_scope_struct___make_property(PyObject *o) {
5696 PyObject* tmp;
5697 struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property *p = (struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property *)o;
5698 tmp = ((PyObject*)p->__pyx_v_decode);
5699 p->__pyx_v_decode = Py_None; Py_INCREF(Py_None);
5700 Py_XDECREF(tmp);
5701 tmp = ((PyObject*)p->__pyx_v_encode);
5702 p->__pyx_v_encode = Py_None; Py_INCREF(Py_None);
5703 Py_XDECREF(tmp);
5704 tmp = ((PyObject*)p->__pyx_v_key);
5705 p->__pyx_v_key = Py_None; Py_INCREF(Py_None);
5706 Py_XDECREF(tmp);
5707 tmp = ((PyObject*)p->__pyx_v_value_type);
5708 p->__pyx_v_value_type = Py_None; Py_INCREF(Py_None);
5709 Py_XDECREF(tmp);
5710 return 0;
5711 }
5712
5713 static PyTypeObject __pyx_type_4borg_4item___pyx_scope_struct___make_property = {
5714 PyVarObject_HEAD_INIT(0, 0)
5715 "borg.item.__pyx_scope_struct___make_property", /*tp_name*/
5716 sizeof(struct __pyx_obj_4borg_4item___pyx_scope_struct___make_property), /*tp_basicsize*/
5717 0, /*tp_itemsize*/
5718 __pyx_tp_dealloc_4borg_4item___pyx_scope_struct___make_property, /*tp_dealloc*/
5719 #if PY_VERSION_HEX < 0x030800b4
5720 0, /*tp_print*/
5721 #endif
5722 #if PY_VERSION_HEX >= 0x030800b4
5723 0, /*tp_vectorcall_offset*/
5724 #endif
5725 0, /*tp_getattr*/
5726 0, /*tp_setattr*/
5727 #if PY_MAJOR_VERSION < 3
5728 0, /*tp_compare*/
5729 #endif
5730 #if PY_MAJOR_VERSION >= 3
5731 0, /*tp_as_async*/
5732 #endif
5733 0, /*tp_repr*/
5734 0, /*tp_as_number*/
5735 0, /*tp_as_sequence*/
5736 0, /*tp_as_mapping*/
5737 0, /*tp_hash*/
5738 0, /*tp_call*/
5739 0, /*tp_str*/
5740 0, /*tp_getattro*/
5741 0, /*tp_setattro*/
5742 0, /*tp_as_buffer*/
5743 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
5744 0, /*tp_doc*/
5745 __pyx_tp_traverse_4borg_4item___pyx_scope_struct___make_property, /*tp_traverse*/
5746 __pyx_tp_clear_4borg_4item___pyx_scope_struct___make_property, /*tp_clear*/
5747 0, /*tp_richcompare*/
5748 0, /*tp_weaklistoffset*/
5749 0, /*tp_iter*/
5750 0, /*tp_iternext*/
5751 0, /*tp_methods*/
5752 0, /*tp_members*/
5753 0, /*tp_getset*/
5754 0, /*tp_base*/
5755 0, /*tp_dict*/
5756 0, /*tp_descr_get*/
5757 0, /*tp_descr_set*/
5758 0, /*tp_dictoffset*/
5759 0, /*tp_init*/
5760 0, /*tp_alloc*/
5761 __pyx_tp_new_4borg_4item___pyx_scope_struct___make_property, /*tp_new*/
5762 0, /*tp_free*/
5763 0, /*tp_is_gc*/
5764 0, /*tp_bases*/
5765 0, /*tp_mro*/
5766 0, /*tp_cache*/
5767 0, /*tp_subclasses*/
5768 0, /*tp_weaklist*/
5769 0, /*tp_del*/
5770 0, /*tp_version_tag*/
5771 #if PY_VERSION_HEX >= 0x030400a1
5772 0, /*tp_finalize*/
5773 #endif
5774 #if PY_VERSION_HEX >= 0x030800b1
5775 0, /*tp_vectorcall*/
5776 #endif
5777 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
5778 0, /*tp_print*/
5779 #endif
5780 };
5781
5782 static struct __pyx_obj_4borg_4item___pyx_scope_struct_1_get_size *__pyx_freelist_4borg_4item___pyx_scope_struct_1_get_size[8];
5783 static int __pyx_freecount_4borg_4item___pyx_scope_struct_1_get_size = 0;
5784
__pyx_tp_new_4borg_4item___pyx_scope_struct_1_get_size(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)5785 static PyObject *__pyx_tp_new_4borg_4item___pyx_scope_struct_1_get_size(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
5786 PyObject *o;
5787 if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_4borg_4item___pyx_scope_struct_1_get_size > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4borg_4item___pyx_scope_struct_1_get_size)))) {
5788 o = (PyObject*)__pyx_freelist_4borg_4item___pyx_scope_struct_1_get_size[--__pyx_freecount_4borg_4item___pyx_scope_struct_1_get_size];
5789 memset(o, 0, sizeof(struct __pyx_obj_4borg_4item___pyx_scope_struct_1_get_size));
5790 (void) PyObject_INIT(o, t);
5791 PyObject_GC_Track(o);
5792 } else {
5793 o = (*t->tp_alloc)(t, 0);
5794 if (unlikely(!o)) return 0;
5795 }
5796 return o;
5797 }
5798
__pyx_tp_dealloc_4borg_4item___pyx_scope_struct_1_get_size(PyObject * o)5799 static void __pyx_tp_dealloc_4borg_4item___pyx_scope_struct_1_get_size(PyObject *o) {
5800 struct __pyx_obj_4borg_4item___pyx_scope_struct_1_get_size *p = (struct __pyx_obj_4borg_4item___pyx_scope_struct_1_get_size *)o;
5801 PyObject_GC_UnTrack(o);
5802 Py_CLEAR(p->__pyx_v_attr);
5803 Py_CLEAR(p->__pyx_v_chunks);
5804 if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_4borg_4item___pyx_scope_struct_1_get_size < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4borg_4item___pyx_scope_struct_1_get_size)))) {
5805 __pyx_freelist_4borg_4item___pyx_scope_struct_1_get_size[__pyx_freecount_4borg_4item___pyx_scope_struct_1_get_size++] = ((struct __pyx_obj_4borg_4item___pyx_scope_struct_1_get_size *)o);
5806 } else {
5807 (*Py_TYPE(o)->tp_free)(o);
5808 }
5809 }
5810
__pyx_tp_traverse_4borg_4item___pyx_scope_struct_1_get_size(PyObject * o,visitproc v,void * a)5811 static int __pyx_tp_traverse_4borg_4item___pyx_scope_struct_1_get_size(PyObject *o, visitproc v, void *a) {
5812 int e;
5813 struct __pyx_obj_4borg_4item___pyx_scope_struct_1_get_size *p = (struct __pyx_obj_4borg_4item___pyx_scope_struct_1_get_size *)o;
5814 if (p->__pyx_v_chunks) {
5815 e = (*v)(p->__pyx_v_chunks, a); if (e) return e;
5816 }
5817 return 0;
5818 }
5819
__pyx_tp_clear_4borg_4item___pyx_scope_struct_1_get_size(PyObject * o)5820 static int __pyx_tp_clear_4borg_4item___pyx_scope_struct_1_get_size(PyObject *o) {
5821 PyObject* tmp;
5822 struct __pyx_obj_4borg_4item___pyx_scope_struct_1_get_size *p = (struct __pyx_obj_4borg_4item___pyx_scope_struct_1_get_size *)o;
5823 tmp = ((PyObject*)p->__pyx_v_chunks);
5824 p->__pyx_v_chunks = Py_None; Py_INCREF(Py_None);
5825 Py_XDECREF(tmp);
5826 return 0;
5827 }
5828
5829 static PyTypeObject __pyx_type_4borg_4item___pyx_scope_struct_1_get_size = {
5830 PyVarObject_HEAD_INIT(0, 0)
5831 "borg.item.__pyx_scope_struct_1_get_size", /*tp_name*/
5832 sizeof(struct __pyx_obj_4borg_4item___pyx_scope_struct_1_get_size), /*tp_basicsize*/
5833 0, /*tp_itemsize*/
5834 __pyx_tp_dealloc_4borg_4item___pyx_scope_struct_1_get_size, /*tp_dealloc*/
5835 #if PY_VERSION_HEX < 0x030800b4
5836 0, /*tp_print*/
5837 #endif
5838 #if PY_VERSION_HEX >= 0x030800b4
5839 0, /*tp_vectorcall_offset*/
5840 #endif
5841 0, /*tp_getattr*/
5842 0, /*tp_setattr*/
5843 #if PY_MAJOR_VERSION < 3
5844 0, /*tp_compare*/
5845 #endif
5846 #if PY_MAJOR_VERSION >= 3
5847 0, /*tp_as_async*/
5848 #endif
5849 0, /*tp_repr*/
5850 0, /*tp_as_number*/
5851 0, /*tp_as_sequence*/
5852 0, /*tp_as_mapping*/
5853 0, /*tp_hash*/
5854 0, /*tp_call*/
5855 0, /*tp_str*/
5856 0, /*tp_getattro*/
5857 0, /*tp_setattro*/
5858 0, /*tp_as_buffer*/
5859 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
5860 0, /*tp_doc*/
5861 __pyx_tp_traverse_4borg_4item___pyx_scope_struct_1_get_size, /*tp_traverse*/
5862 __pyx_tp_clear_4borg_4item___pyx_scope_struct_1_get_size, /*tp_clear*/
5863 0, /*tp_richcompare*/
5864 0, /*tp_weaklistoffset*/
5865 0, /*tp_iter*/
5866 0, /*tp_iternext*/
5867 0, /*tp_methods*/
5868 0, /*tp_members*/
5869 0, /*tp_getset*/
5870 0, /*tp_base*/
5871 0, /*tp_dict*/
5872 0, /*tp_descr_get*/
5873 0, /*tp_descr_set*/
5874 0, /*tp_dictoffset*/
5875 0, /*tp_init*/
5876 0, /*tp_alloc*/
5877 __pyx_tp_new_4borg_4item___pyx_scope_struct_1_get_size, /*tp_new*/
5878 0, /*tp_free*/
5879 0, /*tp_is_gc*/
5880 0, /*tp_bases*/
5881 0, /*tp_mro*/
5882 0, /*tp_cache*/
5883 0, /*tp_subclasses*/
5884 0, /*tp_weaklist*/
5885 0, /*tp_del*/
5886 0, /*tp_version_tag*/
5887 #if PY_VERSION_HEX >= 0x030400a1
5888 0, /*tp_finalize*/
5889 #endif
5890 #if PY_VERSION_HEX >= 0x030800b1
5891 0, /*tp_vectorcall*/
5892 #endif
5893 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
5894 0, /*tp_print*/
5895 #endif
5896 };
5897
5898 static struct __pyx_obj_4borg_4item___pyx_scope_struct_2_genexpr *__pyx_freelist_4borg_4item___pyx_scope_struct_2_genexpr[8];
5899 static int __pyx_freecount_4borg_4item___pyx_scope_struct_2_genexpr = 0;
5900
__pyx_tp_new_4borg_4item___pyx_scope_struct_2_genexpr(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)5901 static PyObject *__pyx_tp_new_4borg_4item___pyx_scope_struct_2_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
5902 PyObject *o;
5903 if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_4borg_4item___pyx_scope_struct_2_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4borg_4item___pyx_scope_struct_2_genexpr)))) {
5904 o = (PyObject*)__pyx_freelist_4borg_4item___pyx_scope_struct_2_genexpr[--__pyx_freecount_4borg_4item___pyx_scope_struct_2_genexpr];
5905 memset(o, 0, sizeof(struct __pyx_obj_4borg_4item___pyx_scope_struct_2_genexpr));
5906 (void) PyObject_INIT(o, t);
5907 PyObject_GC_Track(o);
5908 } else {
5909 o = (*t->tp_alloc)(t, 0);
5910 if (unlikely(!o)) return 0;
5911 }
5912 return o;
5913 }
5914
__pyx_tp_dealloc_4borg_4item___pyx_scope_struct_2_genexpr(PyObject * o)5915 static void __pyx_tp_dealloc_4borg_4item___pyx_scope_struct_2_genexpr(PyObject *o) {
5916 struct __pyx_obj_4borg_4item___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_4borg_4item___pyx_scope_struct_2_genexpr *)o;
5917 PyObject_GC_UnTrack(o);
5918 Py_CLEAR(p->__pyx_outer_scope);
5919 Py_CLEAR(p->__pyx_v_chunk);
5920 Py_CLEAR(p->__pyx_t_0);
5921 if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_4borg_4item___pyx_scope_struct_2_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4borg_4item___pyx_scope_struct_2_genexpr)))) {
5922 __pyx_freelist_4borg_4item___pyx_scope_struct_2_genexpr[__pyx_freecount_4borg_4item___pyx_scope_struct_2_genexpr++] = ((struct __pyx_obj_4borg_4item___pyx_scope_struct_2_genexpr *)o);
5923 } else {
5924 (*Py_TYPE(o)->tp_free)(o);
5925 }
5926 }
5927
__pyx_tp_traverse_4borg_4item___pyx_scope_struct_2_genexpr(PyObject * o,visitproc v,void * a)5928 static int __pyx_tp_traverse_4borg_4item___pyx_scope_struct_2_genexpr(PyObject *o, visitproc v, void *a) {
5929 int e;
5930 struct __pyx_obj_4borg_4item___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_4borg_4item___pyx_scope_struct_2_genexpr *)o;
5931 if (p->__pyx_outer_scope) {
5932 e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
5933 }
5934 if (p->__pyx_v_chunk) {
5935 e = (*v)(p->__pyx_v_chunk, a); if (e) return e;
5936 }
5937 if (p->__pyx_t_0) {
5938 e = (*v)(p->__pyx_t_0, a); if (e) return e;
5939 }
5940 return 0;
5941 }
5942
5943 static PyTypeObject __pyx_type_4borg_4item___pyx_scope_struct_2_genexpr = {
5944 PyVarObject_HEAD_INIT(0, 0)
5945 "borg.item.__pyx_scope_struct_2_genexpr", /*tp_name*/
5946 sizeof(struct __pyx_obj_4borg_4item___pyx_scope_struct_2_genexpr), /*tp_basicsize*/
5947 0, /*tp_itemsize*/
5948 __pyx_tp_dealloc_4borg_4item___pyx_scope_struct_2_genexpr, /*tp_dealloc*/
5949 #if PY_VERSION_HEX < 0x030800b4
5950 0, /*tp_print*/
5951 #endif
5952 #if PY_VERSION_HEX >= 0x030800b4
5953 0, /*tp_vectorcall_offset*/
5954 #endif
5955 0, /*tp_getattr*/
5956 0, /*tp_setattr*/
5957 #if PY_MAJOR_VERSION < 3
5958 0, /*tp_compare*/
5959 #endif
5960 #if PY_MAJOR_VERSION >= 3
5961 0, /*tp_as_async*/
5962 #endif
5963 0, /*tp_repr*/
5964 0, /*tp_as_number*/
5965 0, /*tp_as_sequence*/
5966 0, /*tp_as_mapping*/
5967 0, /*tp_hash*/
5968 0, /*tp_call*/
5969 0, /*tp_str*/
5970 0, /*tp_getattro*/
5971 0, /*tp_setattro*/
5972 0, /*tp_as_buffer*/
5973 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
5974 0, /*tp_doc*/
5975 __pyx_tp_traverse_4borg_4item___pyx_scope_struct_2_genexpr, /*tp_traverse*/
5976 0, /*tp_clear*/
5977 0, /*tp_richcompare*/
5978 0, /*tp_weaklistoffset*/
5979 0, /*tp_iter*/
5980 0, /*tp_iternext*/
5981 0, /*tp_methods*/
5982 0, /*tp_members*/
5983 0, /*tp_getset*/
5984 0, /*tp_base*/
5985 0, /*tp_dict*/
5986 0, /*tp_descr_get*/
5987 0, /*tp_descr_set*/
5988 0, /*tp_dictoffset*/
5989 0, /*tp_init*/
5990 0, /*tp_alloc*/
5991 __pyx_tp_new_4borg_4item___pyx_scope_struct_2_genexpr, /*tp_new*/
5992 0, /*tp_free*/
5993 0, /*tp_is_gc*/
5994 0, /*tp_bases*/
5995 0, /*tp_mro*/
5996 0, /*tp_cache*/
5997 0, /*tp_subclasses*/
5998 0, /*tp_weaklist*/
5999 0, /*tp_del*/
6000 0, /*tp_version_tag*/
6001 #if PY_VERSION_HEX >= 0x030400a1
6002 0, /*tp_finalize*/
6003 #endif
6004 #if PY_VERSION_HEX >= 0x030800b1
6005 0, /*tp_vectorcall*/
6006 #endif
6007 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
6008 0, /*tp_print*/
6009 #endif
6010 };
6011
6012 static PyMethodDef __pyx_methods[] = {
6013 {0, 0, 0, 0}
6014 };
6015
6016 #if PY_MAJOR_VERSION >= 3
6017 #if CYTHON_PEP489_MULTI_PHASE_INIT
6018 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
6019 static int __pyx_pymod_exec_item(PyObject* module); /*proto*/
6020 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
6021 {Py_mod_create, (void*)__pyx_pymod_create},
6022 {Py_mod_exec, (void*)__pyx_pymod_exec_item},
6023 {0, NULL}
6024 };
6025 #endif
6026
6027 static struct PyModuleDef __pyx_moduledef = {
6028 PyModuleDef_HEAD_INIT,
6029 "item",
6030 0, /* m_doc */
6031 #if CYTHON_PEP489_MULTI_PHASE_INIT
6032 0, /* m_size */
6033 #else
6034 -1, /* m_size */
6035 #endif
6036 __pyx_methods /* m_methods */,
6037 #if CYTHON_PEP489_MULTI_PHASE_INIT
6038 __pyx_moduledef_slots, /* m_slots */
6039 #else
6040 NULL, /* m_reload */
6041 #endif
6042 NULL, /* m_traverse */
6043 NULL, /* m_clear */
6044 NULL /* m_free */
6045 };
6046 #endif
6047 #ifndef CYTHON_SMALL_CODE
6048 #if defined(__clang__)
6049 #define CYTHON_SMALL_CODE
6050 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
6051 #define CYTHON_SMALL_CODE __attribute__((cold))
6052 #else
6053 #define CYTHON_SMALL_CODE
6054 #endif
6055 #endif
6056
6057 static __Pyx_StringTabEntry __pyx_string_tab[] = {
6058 {&__pyx_kp_u_1_1_03, __pyx_k_1_1_03, sizeof(__pyx_k_1_1_03), 0, 1, 0, 0},
6059 {&__pyx_n_s_API_VERSION, __pyx_k_API_VERSION, sizeof(__pyx_k_API_VERSION), 0, 0, 1, 1},
6060 {&__pyx_n_s_ARCHIVE_KEYS, __pyx_k_ARCHIVE_KEYS, sizeof(__pyx_k_ARCHIVE_KEYS), 0, 0, 1, 1},
6061 {&__pyx_n_s_ArchiveItem, __pyx_k_ArchiveItem, sizeof(__pyx_k_ArchiveItem), 0, 0, 1, 1},
6062 {&__pyx_kp_s_ArchiveItem_abstraction_that_de, __pyx_k_ArchiveItem_abstraction_that_de, sizeof(__pyx_k_ArchiveItem_abstraction_that_de), 0, 0, 1, 0},
6063 {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1},
6064 {&__pyx_n_s_ChunkListEntry, __pyx_k_ChunkListEntry, sizeof(__pyx_k_ChunkListEntry), 0, 0, 1, 1},
6065 {&__pyx_n_u_ChunkListEntry, __pyx_k_ChunkListEntry, sizeof(__pyx_k_ChunkListEntry), 0, 1, 0, 1},
6066 {&__pyx_n_s_EncryptedKey, __pyx_k_EncryptedKey, sizeof(__pyx_k_EncryptedKey), 0, 0, 1, 1},
6067 {&__pyx_kp_s_EncryptedKey_abstraction_that_d, __pyx_k_EncryptedKey_abstraction_that_d, sizeof(__pyx_k_EncryptedKey_abstraction_that_d), 0, 0, 1, 0},
6068 {&__pyx_n_s_ITEM_KEYS, __pyx_k_ITEM_KEYS, sizeof(__pyx_k_ITEM_KEYS), 0, 0, 1, 1},
6069 {&__pyx_n_s_Item, __pyx_k_Item, sizeof(__pyx_k_Item), 0, 0, 1, 1},
6070 {&__pyx_kp_s_Item_abstraction_that_deals_wit, __pyx_k_Item_abstraction_that_deals_wit, sizeof(__pyx_k_Item_abstraction_that_deals_wit), 0, 0, 1, 0},
6071 {&__pyx_kp_u_Item_does_not_have_a_csize_field, __pyx_k_Item_does_not_have_a_csize_field, sizeof(__pyx_k_Item_does_not_have_a_csize_field), 0, 1, 0, 0},
6072 {&__pyx_n_s_Item_get_size, __pyx_k_Item_get_size, sizeof(__pyx_k_Item_get_size), 0, 0, 1, 1},
6073 {&__pyx_n_s_Item_get_size_locals_genexpr, __pyx_k_Item_get_size_locals_genexpr, sizeof(__pyx_k_Item_get_size_locals_genexpr), 0, 0, 1, 1},
6074 {&__pyx_n_s_Key, __pyx_k_Key, sizeof(__pyx_k_Key), 0, 0, 1, 1},
6075 {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1},
6076 {&__pyx_kp_s_Key_abstraction_that_deals_with, __pyx_k_Key_abstraction_that_deals_with, sizeof(__pyx_k_Key_abstraction_that_deals_with), 0, 0, 1, 0},
6077 {&__pyx_kp_s_Manage_a_dictionary_via_propert, __pyx_k_Manage_a_dictionary_via_propert, sizeof(__pyx_k_Manage_a_dictionary_via_propert), 0, 0, 1, 0},
6078 {&__pyx_n_s_ManifestItem, __pyx_k_ManifestItem, sizeof(__pyx_k_ManifestItem), 0, 0, 1, 1},
6079 {&__pyx_kp_s_ManifestItem_abstraction_that_d, __pyx_k_ManifestItem_abstraction_that_d, sizeof(__pyx_k_ManifestItem_abstraction_that_d), 0, 0, 1, 0},
6080 {&__pyx_n_s_PropDict, __pyx_k_PropDict, sizeof(__pyx_k_PropDict), 0, 0, 1, 1},
6081 {&__pyx_n_s_PropDict___contains, __pyx_k_PropDict___contains, sizeof(__pyx_k_PropDict___contains), 0, 0, 1, 1},
6082 {&__pyx_n_s_PropDict___eq, __pyx_k_PropDict___eq, sizeof(__pyx_k_PropDict___eq), 0, 0, 1, 1},
6083 {&__pyx_n_s_PropDict___init, __pyx_k_PropDict___init, sizeof(__pyx_k_PropDict___init), 0, 0, 1, 1},
6084 {&__pyx_n_s_PropDict___repr, __pyx_k_PropDict___repr, sizeof(__pyx_k_PropDict___repr), 0, 0, 1, 1},
6085 {&__pyx_n_s_PropDict__check_key, __pyx_k_PropDict__check_key, sizeof(__pyx_k_PropDict__check_key), 0, 0, 1, 1},
6086 {&__pyx_n_s_PropDict__make_property, __pyx_k_PropDict__make_property, sizeof(__pyx_k_PropDict__make_property), 0, 0, 1, 1},
6087 {&__pyx_n_s_PropDict__make_property_locals, __pyx_k_PropDict__make_property_locals, sizeof(__pyx_k_PropDict__make_property_locals), 0, 0, 1, 1},
6088 {&__pyx_n_s_PropDict__make_property_locals_2, __pyx_k_PropDict__make_property_locals_2, sizeof(__pyx_k_PropDict__make_property_locals_2), 0, 0, 1, 1},
6089 {&__pyx_n_s_PropDict__make_property_locals_3, __pyx_k_PropDict__make_property_locals_3, sizeof(__pyx_k_PropDict__make_property_locals_3), 0, 0, 1, 1},
6090 {&__pyx_n_s_PropDict_as_dict, __pyx_k_PropDict_as_dict, sizeof(__pyx_k_PropDict_as_dict), 0, 0, 1, 1},
6091 {&__pyx_n_s_PropDict_get, __pyx_k_PropDict_get, sizeof(__pyx_k_PropDict_get), 0, 0, 1, 1},
6092 {&__pyx_n_s_PropDict_update, __pyx_k_PropDict_update, sizeof(__pyx_k_PropDict_update), 0, 0, 1, 1},
6093 {&__pyx_n_s_PropDict_update_internal, __pyx_k_PropDict_update_internal, sizeof(__pyx_k_PropDict_update_internal), 0, 0, 1, 1},
6094 {&__pyx_n_s_S_ISLNK, __pyx_k_S_ISLNK, sizeof(__pyx_k_S_ISLNK), 0, 0, 1, 1},
6095 {&__pyx_n_s_StableDict, __pyx_k_StableDict, sizeof(__pyx_k_StableDict), 0, 0, 1, 1},
6096 {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
6097 {&__pyx_n_s_VALID_KEYS, __pyx_k_VALID_KEYS, sizeof(__pyx_k_VALID_KEYS), 0, 0, 1, 1},
6098 {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
6099 {&__pyx_kp_u__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 0},
6100 {&__pyx_n_s__38, __pyx_k__38, sizeof(__pyx_k__38), 0, 0, 1, 1},
6101 {&__pyx_kp_u__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 1, 0, 0},
6102 {&__pyx_n_s_acl_access, __pyx_k_acl_access, sizeof(__pyx_k_acl_access), 0, 0, 1, 1},
6103 {&__pyx_n_u_acl_access, __pyx_k_acl_access, sizeof(__pyx_k_acl_access), 0, 1, 0, 1},
6104 {&__pyx_n_s_acl_default, __pyx_k_acl_default, sizeof(__pyx_k_acl_default), 0, 0, 1, 1},
6105 {&__pyx_n_u_acl_default, __pyx_k_acl_default, sizeof(__pyx_k_acl_default), 0, 1, 0, 1},
6106 {&__pyx_n_s_acl_extended, __pyx_k_acl_extended, sizeof(__pyx_k_acl_extended), 0, 0, 1, 1},
6107 {&__pyx_n_u_acl_extended, __pyx_k_acl_extended, sizeof(__pyx_k_acl_extended), 0, 1, 0, 1},
6108 {&__pyx_n_s_acl_nfs4, __pyx_k_acl_nfs4, sizeof(__pyx_k_acl_nfs4), 0, 0, 1, 1},
6109 {&__pyx_n_u_acl_nfs4, __pyx_k_acl_nfs4, sizeof(__pyx_k_acl_nfs4), 0, 1, 0, 1},
6110 {&__pyx_n_s_algorithm, __pyx_k_algorithm, sizeof(__pyx_k_algorithm), 0, 0, 1, 1},
6111 {&__pyx_n_u_algorithm, __pyx_k_algorithm, sizeof(__pyx_k_algorithm), 0, 1, 0, 1},
6112 {&__pyx_n_s_archives, __pyx_k_archives, sizeof(__pyx_k_archives), 0, 0, 1, 1},
6113 {&__pyx_n_u_archives, __pyx_k_archives, sizeof(__pyx_k_archives), 0, 1, 0, 1},
6114 {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
6115 {&__pyx_n_s_as_dict, __pyx_k_as_dict, sizeof(__pyx_k_as_dict), 0, 0, 1, 1},
6116 {&__pyx_n_s_atime, __pyx_k_atime, sizeof(__pyx_k_atime), 0, 0, 1, 1},
6117 {&__pyx_n_u_atime, __pyx_k_atime, sizeof(__pyx_k_atime), 0, 1, 0, 1},
6118 {&__pyx_n_s_attr, __pyx_k_attr, sizeof(__pyx_k_attr), 0, 0, 1, 1},
6119 {&__pyx_n_s_attr_error_msg, __pyx_k_attr_error_msg, sizeof(__pyx_k_attr_error_msg), 0, 0, 1, 1},
6120 {&__pyx_kp_u_attribute_s_not_found, __pyx_k_attribute_s_not_found, sizeof(__pyx_k_attribute_s_not_found), 0, 1, 0, 0},
6121 {&__pyx_n_u_bigint, __pyx_k_bigint, sizeof(__pyx_k_bigint), 0, 1, 0, 1},
6122 {&__pyx_n_s_bigint_to_int, __pyx_k_bigint_to_int, sizeof(__pyx_k_bigint_to_int), 0, 0, 1, 1},
6123 {&__pyx_n_s_birthtime, __pyx_k_birthtime, sizeof(__pyx_k_birthtime), 0, 0, 1, 1},
6124 {&__pyx_n_u_birthtime, __pyx_k_birthtime, sizeof(__pyx_k_birthtime), 0, 1, 0, 1},
6125 {&__pyx_n_s_borg_item, __pyx_k_borg_item, sizeof(__pyx_k_borg_item), 0, 0, 1, 1},
6126 {&__pyx_n_s_bsdflags, __pyx_k_bsdflags, sizeof(__pyx_k_bsdflags), 0, 0, 1, 1},
6127 {&__pyx_n_u_bsdflags, __pyx_k_bsdflags, sizeof(__pyx_k_bsdflags), 0, 1, 0, 1},
6128 {&__pyx_n_s_check_key, __pyx_k_check_key, sizeof(__pyx_k_check_key), 0, 0, 1, 1},
6129 {&__pyx_n_s_chunk_seed, __pyx_k_chunk_seed, sizeof(__pyx_k_chunk_seed), 0, 0, 1, 1},
6130 {&__pyx_n_u_chunk_seed, __pyx_k_chunk_seed, sizeof(__pyx_k_chunk_seed), 0, 1, 0, 1},
6131 {&__pyx_n_s_chunker_params, __pyx_k_chunker_params, sizeof(__pyx_k_chunker_params), 0, 0, 1, 1},
6132 {&__pyx_n_u_chunker_params, __pyx_k_chunker_params, sizeof(__pyx_k_chunker_params), 0, 1, 0, 1},
6133 {&__pyx_n_s_chunks, __pyx_k_chunks, sizeof(__pyx_k_chunks), 0, 0, 1, 1},
6134 {&__pyx_n_u_chunks, __pyx_k_chunks, sizeof(__pyx_k_chunks), 0, 1, 0, 1},
6135 {&__pyx_n_s_chunks_healthy, __pyx_k_chunks_healthy, sizeof(__pyx_k_chunks_healthy), 0, 0, 1, 1},
6136 {&__pyx_n_u_chunks_healthy, __pyx_k_chunks_healthy, sizeof(__pyx_k_chunks_healthy), 0, 1, 0, 1},
6137 {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
6138 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
6139 {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
6140 {&__pyx_n_s_cmdline, __pyx_k_cmdline, sizeof(__pyx_k_cmdline), 0, 0, 1, 1},
6141 {&__pyx_n_u_cmdline, __pyx_k_cmdline, sizeof(__pyx_k_cmdline), 0, 1, 0, 1},
6142 {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1},
6143 {&__pyx_n_s_comment, __pyx_k_comment, sizeof(__pyx_k_comment), 0, 0, 1, 1},
6144 {&__pyx_n_u_comment, __pyx_k_comment, sizeof(__pyx_k_comment), 0, 1, 0, 1},
6145 {&__pyx_n_s_compressed, __pyx_k_compressed, sizeof(__pyx_k_compressed), 0, 0, 1, 1},
6146 {&__pyx_n_s_config, __pyx_k_config, sizeof(__pyx_k_config), 0, 0, 1, 1},
6147 {&__pyx_n_u_config, __pyx_k_config, sizeof(__pyx_k_config), 0, 1, 0, 1},
6148 {&__pyx_n_s_constants, __pyx_k_constants, sizeof(__pyx_k_constants), 0, 0, 1, 1},
6149 {&__pyx_n_s_contains, __pyx_k_contains, sizeof(__pyx_k_contains), 0, 0, 1, 1},
6150 {&__pyx_n_u_csize, __pyx_k_csize, sizeof(__pyx_k_csize), 0, 1, 0, 1},
6151 {&__pyx_n_s_ctime, __pyx_k_ctime, sizeof(__pyx_k_ctime), 0, 0, 1, 1},
6152 {&__pyx_n_u_ctime, __pyx_k_ctime, sizeof(__pyx_k_ctime), 0, 1, 0, 1},
6153 {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1},
6154 {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
6155 {&__pyx_n_u_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 1, 0, 1},
6156 {&__pyx_n_s_data_dict, __pyx_k_data_dict, sizeof(__pyx_k_data_dict), 0, 0, 1, 1},
6157 {&__pyx_kp_u_data_dict_must_be_a_dict, __pyx_k_data_dict_must_be_a_dict, sizeof(__pyx_k_data_dict_must_be_a_dict), 0, 1, 0, 0},
6158 {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1},
6159 {&__pyx_n_s_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 1, 1},
6160 {&__pyx_n_s_del, __pyx_k_del, sizeof(__pyx_k_del), 0, 0, 1, 1},
6161 {&__pyx_n_s_deleted, __pyx_k_deleted, sizeof(__pyx_k_deleted), 0, 0, 1, 1},
6162 {&__pyx_n_u_deleted, __pyx_k_deleted, sizeof(__pyx_k_deleted), 0, 1, 0, 1},
6163 {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
6164 {&__pyx_n_u_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 1, 0, 1},
6165 {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
6166 {&__pyx_n_s_doc_2, __pyx_k_doc_2, sizeof(__pyx_k_doc_2), 0, 0, 1, 1},
6167 {&__pyx_n_s_enc_hmac_key, __pyx_k_enc_hmac_key, sizeof(__pyx_k_enc_hmac_key), 0, 0, 1, 1},
6168 {&__pyx_n_u_enc_hmac_key, __pyx_k_enc_hmac_key, sizeof(__pyx_k_enc_hmac_key), 0, 1, 0, 1},
6169 {&__pyx_n_s_enc_key, __pyx_k_enc_key, sizeof(__pyx_k_enc_key), 0, 0, 1, 1},
6170 {&__pyx_n_u_enc_key, __pyx_k_enc_key, sizeof(__pyx_k_enc_key), 0, 1, 0, 1},
6171 {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
6172 {&__pyx_n_s_eq, __pyx_k_eq, sizeof(__pyx_k_eq), 0, 0, 1, 1},
6173 {&__pyx_n_s_from_chunks, __pyx_k_from_chunks, sizeof(__pyx_k_from_chunks), 0, 0, 1, 1},
6174 {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1},
6175 {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
6176 {&__pyx_n_s_get_2, __pyx_k_get_2, sizeof(__pyx_k_get_2), 0, 0, 1, 1},
6177 {&__pyx_n_s_get_size, __pyx_k_get_size, sizeof(__pyx_k_get_size), 0, 0, 1, 1},
6178 {&__pyx_n_s_gid, __pyx_k_gid, sizeof(__pyx_k_gid), 0, 0, 1, 1},
6179 {&__pyx_n_u_gid, __pyx_k_gid, sizeof(__pyx_k_gid), 0, 1, 0, 1},
6180 {&__pyx_n_s_group, __pyx_k_group, sizeof(__pyx_k_group), 0, 0, 1, 1},
6181 {&__pyx_n_u_group, __pyx_k_group, sizeof(__pyx_k_group), 0, 1, 0, 1},
6182 {&__pyx_n_s_hardlink_master, __pyx_k_hardlink_master, sizeof(__pyx_k_hardlink_master), 0, 0, 1, 1},
6183 {&__pyx_n_u_hardlink_master, __pyx_k_hardlink_master, sizeof(__pyx_k_hardlink_master), 0, 1, 0, 1},
6184 {&__pyx_n_s_hardlink_masters, __pyx_k_hardlink_masters, sizeof(__pyx_k_hardlink_masters), 0, 0, 1, 1},
6185 {&__pyx_n_s_hash, __pyx_k_hash, sizeof(__pyx_k_hash), 0, 0, 1, 1},
6186 {&__pyx_n_u_hash, __pyx_k_hash, sizeof(__pyx_k_hash), 0, 1, 0, 1},
6187 {&__pyx_n_s_having_chunks, __pyx_k_having_chunks, sizeof(__pyx_k_having_chunks), 0, 0, 1, 1},
6188 {&__pyx_n_s_helpers, __pyx_k_helpers, sizeof(__pyx_k_helpers), 0, 0, 1, 1},
6189 {&__pyx_n_s_hostname, __pyx_k_hostname, sizeof(__pyx_k_hostname), 0, 0, 1, 1},
6190 {&__pyx_n_u_hostname, __pyx_k_hostname, sizeof(__pyx_k_hostname), 0, 1, 0, 1},
6191 {&__pyx_n_s_id_key, __pyx_k_id_key, sizeof(__pyx_k_id_key), 0, 0, 1, 1},
6192 {&__pyx_n_u_id_key, __pyx_k_id_key, sizeof(__pyx_k_id_key), 0, 1, 0, 1},
6193 {&__pyx_kp_u_id_size_csize, __pyx_k_id_size_csize, sizeof(__pyx_k_id_size_csize), 0, 1, 0, 0},
6194 {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
6195 {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
6196 {&__pyx_n_s_int_to_bigint, __pyx_k_int_to_bigint, sizeof(__pyx_k_int_to_bigint), 0, 0, 1, 1},
6197 {&__pyx_n_s_internal_dict, __pyx_k_internal_dict, sizeof(__pyx_k_internal_dict), 0, 0, 1, 1},
6198 {&__pyx_kp_u_internal_dict_2, __pyx_k_internal_dict_2, sizeof(__pyx_k_internal_dict_2), 0, 1, 0, 0},
6199 {&__pyx_kp_u_internal_dict_must_be_a_dict, __pyx_k_internal_dict_must_be_a_dict, sizeof(__pyx_k_internal_dict_must_be_a_dict), 0, 1, 0, 0},
6200 {&__pyx_n_s_item_keys, __pyx_k_item_keys, sizeof(__pyx_k_item_keys), 0, 0, 1, 1},
6201 {&__pyx_n_u_item_keys, __pyx_k_item_keys, sizeof(__pyx_k_item_keys), 0, 1, 0, 1},
6202 {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1},
6203 {&__pyx_n_u_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 1, 0, 1},
6204 {&__pyx_n_s_iterations, __pyx_k_iterations, sizeof(__pyx_k_iterations), 0, 0, 1, 1},
6205 {&__pyx_n_u_iterations, __pyx_k_iterations, sizeof(__pyx_k_iterations), 0, 1, 0, 1},
6206 {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1},
6207 {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1},
6208 {&__pyx_kp_u_key_must_be_str, __pyx_k_key_must_be_str, sizeof(__pyx_k_key_must_be_str), 0, 1, 0, 0},
6209 {&__pyx_kp_u_key_s_is_not_a_valid_key, __pyx_k_key_s_is_not_a_valid_key, sizeof(__pyx_k_key_s_is_not_a_valid_key), 0, 1, 0, 0},
6210 {&__pyx_n_s_kw, __pyx_k_kw, sizeof(__pyx_k_kw), 0, 0, 1, 1},
6211 {&__pyx_kp_u_list_or_None, __pyx_k_list_or_None, sizeof(__pyx_k_list_or_None), 0, 1, 0, 0},
6212 {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
6213 {&__pyx_n_s_make_property, __pyx_k_make_property, sizeof(__pyx_k_make_property), 0, 0, 1, 1},
6214 {&__pyx_n_s_master, __pyx_k_master, sizeof(__pyx_k_master), 0, 0, 1, 1},
6215 {&__pyx_n_s_memorize, __pyx_k_memorize, sizeof(__pyx_k_memorize), 0, 0, 1, 1},
6216 {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
6217 {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
6218 {&__pyx_n_u_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 1, 0, 1},
6219 {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
6220 {&__pyx_n_s_mtime, __pyx_k_mtime, sizeof(__pyx_k_mtime), 0, 0, 1, 1},
6221 {&__pyx_n_u_mtime, __pyx_k_mtime, sizeof(__pyx_k_mtime), 0, 1, 0, 1},
6222 {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
6223 {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
6224 {&__pyx_n_u_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 1, 0, 1},
6225 {&__pyx_n_s_namedtuple, __pyx_k_namedtuple, sizeof(__pyx_k_namedtuple), 0, 0, 1, 1},
6226 {&__pyx_n_s_nlink, __pyx_k_nlink, sizeof(__pyx_k_nlink), 0, 0, 1, 1},
6227 {&__pyx_n_u_nlink, __pyx_k_nlink, sizeof(__pyx_k_nlink), 0, 1, 0, 1},
6228 {&__pyx_n_s_other, __pyx_k_other, sizeof(__pyx_k_other), 0, 0, 1, 1},
6229 {&__pyx_n_s_part, __pyx_k_part, sizeof(__pyx_k_part), 0, 0, 1, 1},
6230 {&__pyx_n_u_part, __pyx_k_part, sizeof(__pyx_k_part), 0, 1, 0, 1},
6231 {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1},
6232 {&__pyx_n_u_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 1, 0, 1},
6233 {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
6234 {&__pyx_n_s_property, __pyx_k_property, sizeof(__pyx_k_property), 0, 0, 1, 1},
6235 {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
6236 {&__pyx_n_s_rdev, __pyx_k_rdev, sizeof(__pyx_k_rdev), 0, 0, 1, 1},
6237 {&__pyx_n_u_rdev, __pyx_k_rdev, sizeof(__pyx_k_rdev), 0, 1, 0, 1},
6238 {&__pyx_n_s_recreate_args, __pyx_k_recreate_args, sizeof(__pyx_k_recreate_args), 0, 0, 1, 1},
6239 {&__pyx_n_u_recreate_args, __pyx_k_recreate_args, sizeof(__pyx_k_recreate_args), 0, 1, 0, 1},
6240 {&__pyx_n_s_recreate_cmdline, __pyx_k_recreate_cmdline, sizeof(__pyx_k_recreate_cmdline), 0, 0, 1, 1},
6241 {&__pyx_n_u_recreate_cmdline, __pyx_k_recreate_cmdline, sizeof(__pyx_k_recreate_cmdline), 0, 1, 0, 1},
6242 {&__pyx_n_s_recreate_partial_chunks, __pyx_k_recreate_partial_chunks, sizeof(__pyx_k_recreate_partial_chunks), 0, 0, 1, 1},
6243 {&__pyx_n_u_recreate_partial_chunks, __pyx_k_recreate_partial_chunks, sizeof(__pyx_k_recreate_partial_chunks), 0, 1, 0, 1},
6244 {&__pyx_n_s_recreate_source_id, __pyx_k_recreate_source_id, sizeof(__pyx_k_recreate_source_id), 0, 0, 1, 1},
6245 {&__pyx_n_u_recreate_source_id, __pyx_k_recreate_source_id, sizeof(__pyx_k_recreate_source_id), 0, 1, 0, 1},
6246 {&__pyx_n_s_repository_id, __pyx_k_repository_id, sizeof(__pyx_k_repository_id), 0, 0, 1, 1},
6247 {&__pyx_n_u_repository_id, __pyx_k_repository_id, sizeof(__pyx_k_repository_id), 0, 1, 0, 1},
6248 {&__pyx_n_s_repr, __pyx_k_repr, sizeof(__pyx_k_repr), 0, 0, 1, 1},
6249 {&__pyx_n_s_safe_decode, __pyx_k_safe_decode, sizeof(__pyx_k_safe_decode), 0, 0, 1, 1},
6250 {&__pyx_n_s_safe_encode, __pyx_k_safe_encode, sizeof(__pyx_k_safe_encode), 0, 0, 1, 1},
6251 {&__pyx_n_s_salt, __pyx_k_salt, sizeof(__pyx_k_salt), 0, 0, 1, 1},
6252 {&__pyx_n_u_salt, __pyx_k_salt, sizeof(__pyx_k_salt), 0, 1, 0, 1},
6253 {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
6254 {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1},
6255 {&__pyx_n_s_set, __pyx_k_set, sizeof(__pyx_k_set), 0, 0, 1, 1},
6256 {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
6257 {&__pyx_n_u_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 1, 0, 1},
6258 {&__pyx_n_s_slots, __pyx_k_slots, sizeof(__pyx_k_slots), 0, 0, 1, 1},
6259 {&__pyx_n_s_source, __pyx_k_source, sizeof(__pyx_k_source), 0, 0, 1, 1},
6260 {&__pyx_n_u_source, __pyx_k_source, sizeof(__pyx_k_source), 0, 1, 0, 1},
6261 {&__pyx_kp_s_src_borg_item_pyx, __pyx_k_src_borg_item_pyx, sizeof(__pyx_k_src_borg_item_pyx), 0, 0, 1, 0},
6262 {&__pyx_n_s_stat, __pyx_k_stat, sizeof(__pyx_k_stat), 0, 0, 1, 1},
6263 {&__pyx_n_s_staticmethod, __pyx_k_staticmethod, sizeof(__pyx_k_staticmethod), 0, 0, 1, 1},
6264 {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1},
6265 {&__pyx_kp_u_surrogate_escaped_str, __pyx_k_surrogate_escaped_str, sizeof(__pyx_k_surrogate_escaped_str), 0, 1, 0, 0},
6266 {&__pyx_kp_u_surrogate_escaped_str_or_None, __pyx_k_surrogate_escaped_str_or_None, sizeof(__pyx_k_surrogate_escaped_str_or_None), 0, 1, 0, 0},
6267 {&__pyx_n_s_tam_required, __pyx_k_tam_required, sizeof(__pyx_k_tam_required), 0, 0, 1, 1},
6268 {&__pyx_n_u_tam_required, __pyx_k_tam_required, sizeof(__pyx_k_tam_required), 0, 1, 0, 1},
6269 {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
6270 {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1},
6271 {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1},
6272 {&__pyx_n_u_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 1, 0, 1},
6273 {&__pyx_n_s_time_end, __pyx_k_time_end, sizeof(__pyx_k_time_end), 0, 0, 1, 1},
6274 {&__pyx_n_u_time_end, __pyx_k_time_end, sizeof(__pyx_k_time_end), 0, 1, 0, 1},
6275 {&__pyx_n_s_timestamp, __pyx_k_timestamp, sizeof(__pyx_k_timestamp), 0, 0, 1, 1},
6276 {&__pyx_n_u_timestamp, __pyx_k_timestamp, sizeof(__pyx_k_timestamp), 0, 1, 0, 1},
6277 {&__pyx_n_s_type_error_msg, __pyx_k_type_error_msg, sizeof(__pyx_k_type_error_msg), 0, 0, 1, 1},
6278 {&__pyx_n_s_uid, __pyx_k_uid, sizeof(__pyx_k_uid), 0, 0, 1, 1},
6279 {&__pyx_n_u_uid, __pyx_k_uid, sizeof(__pyx_k_uid), 0, 1, 0, 1},
6280 {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
6281 {&__pyx_n_s_update_internal, __pyx_k_update_internal, sizeof(__pyx_k_update_internal), 0, 0, 1, 1},
6282 {&__pyx_n_s_user, __pyx_k_user, sizeof(__pyx_k_user), 0, 0, 1, 1},
6283 {&__pyx_n_u_user, __pyx_k_user, sizeof(__pyx_k_user), 0, 1, 0, 1},
6284 {&__pyx_n_s_username, __pyx_k_username, sizeof(__pyx_k_username), 0, 0, 1, 1},
6285 {&__pyx_n_u_username, __pyx_k_username, sizeof(__pyx_k_username), 0, 1, 0, 1},
6286 {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1},
6287 {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
6288 {&__pyx_kp_u_value_must_be, __pyx_k_value_must_be, sizeof(__pyx_k_value_must_be), 0, 1, 0, 0},
6289 {&__pyx_n_s_value_type, __pyx_k_value_type, sizeof(__pyx_k_value_type), 0, 0, 1, 1},
6290 {&__pyx_n_s_value_type_name, __pyx_k_value_type_name, sizeof(__pyx_k_value_type_name), 0, 0, 1, 1},
6291 {&__pyx_n_s_version, __pyx_k_version, sizeof(__pyx_k_version), 0, 0, 1, 1},
6292 {&__pyx_n_u_version, __pyx_k_version, sizeof(__pyx_k_version), 0, 1, 0, 1},
6293 {&__pyx_n_s_xattrs, __pyx_k_xattrs, sizeof(__pyx_k_xattrs), 0, 0, 1, 1},
6294 {&__pyx_n_u_xattrs, __pyx_k_xattrs, sizeof(__pyx_k_xattrs), 0, 1, 0, 1},
6295 {0, 0, 0, 0, 0, 0, 0}
6296 };
__Pyx_InitCachedBuiltins(void)6297 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
6298 __pyx_builtin_staticmethod = __Pyx_GetBuiltinName(__pyx_n_s_staticmethod); if (!__pyx_builtin_staticmethod) __PYX_ERR(0, 93, __pyx_L1_error)
6299 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 45, __pyx_L1_error)
6300 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 82, __pyx_L1_error)
6301 __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) __PYX_ERR(0, 125, __pyx_L1_error)
6302 __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 106, __pyx_L1_error)
6303 __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 107, __pyx_L1_error)
6304 __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum); if (!__pyx_builtin_sum) __PYX_ERR(0, 233, __pyx_L1_error)
6305 return 0;
6306 __pyx_L1_error:;
6307 return -1;
6308 }
6309
__Pyx_InitCachedConstants(void)6310 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
6311 __Pyx_RefNannyDeclarations
6312 __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
6313
6314 /* "borg/item.pyx":45
6315 * self.update_internal(internal_dict)
6316 * else:
6317 * raise TypeError("internal_dict must be a dict") # <<<<<<<<<<<<<<
6318 * if data_dict is None:
6319 * data = kw
6320 */
6321 __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_internal_dict_must_be_a_dict); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 45, __pyx_L1_error)
6322 __Pyx_GOTREF(__pyx_tuple_);
6323 __Pyx_GIVEREF(__pyx_tuple_);
6324
6325 /* "borg/item.pyx":51
6326 * data = data_dict
6327 * else:
6328 * raise TypeError("data_dict must be a dict") # <<<<<<<<<<<<<<
6329 * if data:
6330 * self.update(data)
6331 */
6332 __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_data_dict_must_be_a_dict); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 51, __pyx_L1_error)
6333 __Pyx_GOTREF(__pyx_tuple__2);
6334 __Pyx_GIVEREF(__pyx_tuple__2);
6335
6336 /* "borg/item.pyx":80
6337 * """make sure key is of type str and known"""
6338 * if not isinstance(key, str):
6339 * raise TypeError("key must be str") # <<<<<<<<<<<<<<
6340 * if key not in self.VALID_KEYS:
6341 * raise ValueError("key '%s' is not a valid key" % key)
6342 */
6343 __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_key_must_be_str); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 80, __pyx_L1_error)
6344 __Pyx_GOTREF(__pyx_tuple__4);
6345 __Pyx_GIVEREF(__pyx_tuple__4);
6346
6347 /* "borg/item.pyx":103
6348 * attr_error_msg = "attribute %s not found" % key
6349 *
6350 * def _get(self): # <<<<<<<<<<<<<<
6351 * try:
6352 * value = self._dict[key]
6353 */
6354 __pyx_tuple__6 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_value); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 103, __pyx_L1_error)
6355 __Pyx_GOTREF(__pyx_tuple__6);
6356 __Pyx_GIVEREF(__pyx_tuple__6);
6357 __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_item_pyx, __pyx_n_s_get, 103, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 103, __pyx_L1_error)
6358
6359 /* "borg/item.pyx":112
6360 * return value
6361 *
6362 * def _set(self, value): # <<<<<<<<<<<<<<
6363 * if not isinstance(value, value_type):
6364 * raise TypeError(type_error_msg)
6365 */
6366 __pyx_tuple__8 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_value); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 112, __pyx_L1_error)
6367 __Pyx_GOTREF(__pyx_tuple__8);
6368 __Pyx_GIVEREF(__pyx_tuple__8);
6369 __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 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_src_borg_item_pyx, __pyx_n_s_set, 112, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 112, __pyx_L1_error)
6370
6371 /* "borg/item.pyx":119
6372 * self._dict[key] = value
6373 *
6374 * def _del(self): # <<<<<<<<<<<<<<
6375 * try:
6376 * del self._dict[key]
6377 */
6378 __pyx_tuple__10 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 119, __pyx_L1_error)
6379 __Pyx_GOTREF(__pyx_tuple__10);
6380 __Pyx_GIVEREF(__pyx_tuple__10);
6381 __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_item_pyx, __pyx_n_s_del, 119, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 119, __pyx_L1_error)
6382
6383 /* "borg/item.pyx":230
6384 * # hardlink slave, try to fetch hardlink master's chunks list
6385 * # todo: put precomputed size into hardlink_masters' values and use it, if present
6386 * chunks, _ = hardlink_masters.get(master, (None, None)) # <<<<<<<<<<<<<<
6387 * if chunks is None:
6388 * return 0
6389 */
6390 __pyx_tuple__12 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 230, __pyx_L1_error)
6391 __Pyx_GOTREF(__pyx_tuple__12);
6392 __Pyx_GIVEREF(__pyx_tuple__12);
6393
6394 /* "borg/item.pyx":36
6395 * VALID_KEYS = None # override with <set of str> in child class
6396 *
6397 * __slots__ = ("_dict", ) # avoid setting attributes not supported by properties # <<<<<<<<<<<<<<
6398 *
6399 * def __init__(self, data_dict=None, internal_dict=None, **kw):
6400 */
6401 __pyx_tuple__13 = PyTuple_Pack(1, __pyx_n_u_dict); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 36, __pyx_L1_error)
6402 __Pyx_GOTREF(__pyx_tuple__13);
6403 __Pyx_GIVEREF(__pyx_tuple__13);
6404
6405 /* "borg/item.pyx":38
6406 * __slots__ = ("_dict", ) # avoid setting attributes not supported by properties
6407 *
6408 * def __init__(self, data_dict=None, internal_dict=None, **kw): # <<<<<<<<<<<<<<
6409 * self._dict = {}
6410 * if internal_dict is None:
6411 */
6412 __pyx_tuple__14 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_data_dict, __pyx_n_s_internal_dict, __pyx_n_s_kw, __pyx_n_s_data); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 38, __pyx_L1_error)
6413 __Pyx_GOTREF(__pyx_tuple__14);
6414 __Pyx_GIVEREF(__pyx_tuple__14);
6415 __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_item_pyx, __pyx_n_s_init, 38, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 38, __pyx_L1_error)
6416 __pyx_tuple__16 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 38, __pyx_L1_error)
6417 __Pyx_GOTREF(__pyx_tuple__16);
6418 __Pyx_GIVEREF(__pyx_tuple__16);
6419
6420 /* "borg/item.pyx":55
6421 * self.update(data)
6422 *
6423 * def update(self, d): # <<<<<<<<<<<<<<
6424 * for k, v in d.items():
6425 * if isinstance(k, bytes):
6426 */
6427 __pyx_tuple__17 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_d, __pyx_n_s_k, __pyx_n_s_v); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 55, __pyx_L1_error)
6428 __Pyx_GOTREF(__pyx_tuple__17);
6429 __Pyx_GIVEREF(__pyx_tuple__17);
6430 __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_item_pyx, __pyx_n_s_update, 55, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 55, __pyx_L1_error)
6431
6432 /* "borg/item.pyx":61
6433 * setattr(self, self._check_key(k), v)
6434 *
6435 * def update_internal(self, d): # <<<<<<<<<<<<<<
6436 * for k, v in d.items():
6437 * if isinstance(k, bytes):
6438 */
6439 __pyx_tuple__19 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_d, __pyx_n_s_k, __pyx_n_s_v); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 61, __pyx_L1_error)
6440 __Pyx_GOTREF(__pyx_tuple__19);
6441 __Pyx_GIVEREF(__pyx_tuple__19);
6442 __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_item_pyx, __pyx_n_s_update_internal, 61, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 61, __pyx_L1_error)
6443
6444 /* "borg/item.pyx":67
6445 * self._dict[k] = v
6446 *
6447 * def __eq__(self, other): # <<<<<<<<<<<<<<
6448 * return self.as_dict() == other.as_dict()
6449 *
6450 */
6451 __pyx_tuple__21 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 67, __pyx_L1_error)
6452 __Pyx_GOTREF(__pyx_tuple__21);
6453 __Pyx_GIVEREF(__pyx_tuple__21);
6454 __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_item_pyx, __pyx_n_s_eq, 67, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 67, __pyx_L1_error)
6455
6456 /* "borg/item.pyx":70
6457 * return self.as_dict() == other.as_dict()
6458 *
6459 * def __repr__(self): # <<<<<<<<<<<<<<
6460 * return '%s(internal_dict=%r)' % (self.__class__.__name__, self._dict)
6461 *
6462 */
6463 __pyx_tuple__23 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 70, __pyx_L1_error)
6464 __Pyx_GOTREF(__pyx_tuple__23);
6465 __Pyx_GIVEREF(__pyx_tuple__23);
6466 __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_item_pyx, __pyx_n_s_repr, 70, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 70, __pyx_L1_error)
6467
6468 /* "borg/item.pyx":73
6469 * return '%s(internal_dict=%r)' % (self.__class__.__name__, self._dict)
6470 *
6471 * def as_dict(self): # <<<<<<<<<<<<<<
6472 * """return the internal dictionary"""
6473 * return StableDict(self._dict)
6474 */
6475 __pyx_tuple__25 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 73, __pyx_L1_error)
6476 __Pyx_GOTREF(__pyx_tuple__25);
6477 __Pyx_GIVEREF(__pyx_tuple__25);
6478 __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_item_pyx, __pyx_n_s_as_dict, 73, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 73, __pyx_L1_error)
6479
6480 /* "borg/item.pyx":77
6481 * return StableDict(self._dict)
6482 *
6483 * def _check_key(self, key): # <<<<<<<<<<<<<<
6484 * """make sure key is of type str and known"""
6485 * if not isinstance(key, str):
6486 */
6487 __pyx_tuple__27 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_key); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 77, __pyx_L1_error)
6488 __Pyx_GOTREF(__pyx_tuple__27);
6489 __Pyx_GIVEREF(__pyx_tuple__27);
6490 __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_item_pyx, __pyx_n_s_check_key, 77, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 77, __pyx_L1_error)
6491
6492 /* "borg/item.pyx":85
6493 * return key
6494 *
6495 * def __contains__(self, key): # <<<<<<<<<<<<<<
6496 * """do we have this key?"""
6497 * return self._check_key(key) in self._dict
6498 */
6499 __pyx_tuple__29 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_key); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 85, __pyx_L1_error)
6500 __Pyx_GOTREF(__pyx_tuple__29);
6501 __Pyx_GIVEREF(__pyx_tuple__29);
6502 __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_item_pyx, __pyx_n_s_contains, 85, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 85, __pyx_L1_error)
6503
6504 /* "borg/item.pyx":89
6505 * return self._check_key(key) in self._dict
6506 *
6507 * def get(self, key, default=None): # <<<<<<<<<<<<<<
6508 * """get value for key, return default if key does not exist"""
6509 * return getattr(self, self._check_key(key), default)
6510 */
6511 __pyx_tuple__31 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_default); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 89, __pyx_L1_error)
6512 __Pyx_GOTREF(__pyx_tuple__31);
6513 __Pyx_GIVEREF(__pyx_tuple__31);
6514 __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_item_pyx, __pyx_n_s_get_2, 89, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 89, __pyx_L1_error)
6515 __pyx_tuple__33 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 89, __pyx_L1_error)
6516 __Pyx_GOTREF(__pyx_tuple__33);
6517 __Pyx_GIVEREF(__pyx_tuple__33);
6518
6519 /* "borg/item.pyx":94
6520 *
6521 * @staticmethod
6522 * def _make_property(key, value_type, value_type_name=None, encode=None, decode=None): # <<<<<<<<<<<<<<
6523 * """return a property that deals with self._dict[key]"""
6524 * assert isinstance(key, str)
6525 */
6526 __pyx_tuple__34 = PyTuple_Pack(14, __pyx_n_s_key, __pyx_n_s_value_type, __pyx_n_s_value_type_name, __pyx_n_s_encode, __pyx_n_s_decode, __pyx_n_s_doc, __pyx_n_s_type_error_msg, __pyx_n_s_attr_error_msg, __pyx_n_s_get, __pyx_n_s_get, __pyx_n_s_set, __pyx_n_s_set, __pyx_n_s_del, __pyx_n_s_del); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 94, __pyx_L1_error)
6527 __Pyx_GOTREF(__pyx_tuple__34);
6528 __Pyx_GIVEREF(__pyx_tuple__34);
6529 __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(5, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_item_pyx, __pyx_n_s_make_property, 94, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 94, __pyx_L1_error)
6530 __pyx_tuple__36 = PyTuple_Pack(3, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 94, __pyx_L1_error)
6531 __Pyx_GOTREF(__pyx_tuple__36);
6532 __Pyx_GIVEREF(__pyx_tuple__36);
6533
6534 /* "borg/item.pyx":128
6535 *
6536 *
6537 * ChunkListEntry = namedtuple('ChunkListEntry', 'id size csize') # <<<<<<<<<<<<<<
6538 *
6539 * class Item(PropDict):
6540 */
6541 __pyx_tuple__37 = PyTuple_Pack(2, __pyx_n_u_ChunkListEntry, __pyx_kp_u_id_size_csize); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 128, __pyx_L1_error)
6542 __Pyx_GOTREF(__pyx_tuple__37);
6543 __Pyx_GIVEREF(__pyx_tuple__37);
6544
6545 /* "borg/item.pyx":191
6546 * part = PropDict._make_property('part', int)
6547 *
6548 * def get_size(self, hardlink_masters=None, memorize=False, compressed=False, from_chunks=False): # <<<<<<<<<<<<<<
6549 * """
6550 * Determine the (uncompressed or compressed) size of this item.
6551 */
6552 __pyx_tuple__39 = PyTuple_Pack(13, __pyx_n_s_self, __pyx_n_s_hardlink_masters, __pyx_n_s_memorize, __pyx_n_s_compressed, __pyx_n_s_from_chunks, __pyx_n_s_attr, __pyx_n_s_size, __pyx_n_s_chunks, __pyx_n_s_having_chunks, __pyx_n_s_master, __pyx_n_s__38, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 191, __pyx_L1_error)
6553 __Pyx_GOTREF(__pyx_tuple__39);
6554 __Pyx_GIVEREF(__pyx_tuple__39);
6555 __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(5, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_borg_item_pyx, __pyx_n_s_get_size, 191, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 191, __pyx_L1_error)
6556 __pyx_tuple__41 = PyTuple_Pack(4, ((PyObject *)Py_None), ((PyObject *)Py_False), ((PyObject *)Py_False), ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 191, __pyx_L1_error)
6557 __Pyx_GOTREF(__pyx_tuple__41);
6558 __Pyx_GIVEREF(__pyx_tuple__41);
6559 __Pyx_RefNannyFinishContext();
6560 return 0;
6561 __pyx_L1_error:;
6562 __Pyx_RefNannyFinishContext();
6563 return -1;
6564 }
6565
__Pyx_InitGlobals(void)6566 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
6567 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
6568 __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
6569 return 0;
6570 __pyx_L1_error:;
6571 return -1;
6572 }
6573
6574 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
6575 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
6576 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
6577 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
6578 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
6579 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
6580 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
6581
__Pyx_modinit_global_init_code(void)6582 static int __Pyx_modinit_global_init_code(void) {
6583 __Pyx_RefNannyDeclarations
6584 __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
6585 /*--- Global init code ---*/
6586 __Pyx_RefNannyFinishContext();
6587 return 0;
6588 }
6589
__Pyx_modinit_variable_export_code(void)6590 static int __Pyx_modinit_variable_export_code(void) {
6591 __Pyx_RefNannyDeclarations
6592 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
6593 /*--- Variable export code ---*/
6594 __Pyx_RefNannyFinishContext();
6595 return 0;
6596 }
6597
__Pyx_modinit_function_export_code(void)6598 static int __Pyx_modinit_function_export_code(void) {
6599 __Pyx_RefNannyDeclarations
6600 __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
6601 /*--- Function export code ---*/
6602 __Pyx_RefNannyFinishContext();
6603 return 0;
6604 }
6605
__Pyx_modinit_type_init_code(void)6606 static int __Pyx_modinit_type_init_code(void) {
6607 __Pyx_RefNannyDeclarations
6608 int __pyx_lineno = 0;
6609 const char *__pyx_filename = NULL;
6610 int __pyx_clineno = 0;
6611 __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
6612 /*--- Type init code ---*/
6613 if (PyType_Ready(&__pyx_type_4borg_4item___pyx_scope_struct___make_property) < 0) __PYX_ERR(0, 94, __pyx_L1_error)
6614 #if PY_VERSION_HEX < 0x030800B1
6615 __pyx_type_4borg_4item___pyx_scope_struct___make_property.tp_print = 0;
6616 #endif
6617 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4borg_4item___pyx_scope_struct___make_property.tp_dictoffset && __pyx_type_4borg_4item___pyx_scope_struct___make_property.tp_getattro == PyObject_GenericGetAttr)) {
6618 __pyx_type_4borg_4item___pyx_scope_struct___make_property.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
6619 }
6620 __pyx_ptype_4borg_4item___pyx_scope_struct___make_property = &__pyx_type_4borg_4item___pyx_scope_struct___make_property;
6621 if (PyType_Ready(&__pyx_type_4borg_4item___pyx_scope_struct_1_get_size) < 0) __PYX_ERR(0, 191, __pyx_L1_error)
6622 #if PY_VERSION_HEX < 0x030800B1
6623 __pyx_type_4borg_4item___pyx_scope_struct_1_get_size.tp_print = 0;
6624 #endif
6625 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4borg_4item___pyx_scope_struct_1_get_size.tp_dictoffset && __pyx_type_4borg_4item___pyx_scope_struct_1_get_size.tp_getattro == PyObject_GenericGetAttr)) {
6626 __pyx_type_4borg_4item___pyx_scope_struct_1_get_size.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
6627 }
6628 __pyx_ptype_4borg_4item___pyx_scope_struct_1_get_size = &__pyx_type_4borg_4item___pyx_scope_struct_1_get_size;
6629 if (PyType_Ready(&__pyx_type_4borg_4item___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(0, 233, __pyx_L1_error)
6630 #if PY_VERSION_HEX < 0x030800B1
6631 __pyx_type_4borg_4item___pyx_scope_struct_2_genexpr.tp_print = 0;
6632 #endif
6633 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4borg_4item___pyx_scope_struct_2_genexpr.tp_dictoffset && __pyx_type_4borg_4item___pyx_scope_struct_2_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
6634 __pyx_type_4borg_4item___pyx_scope_struct_2_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
6635 }
6636 __pyx_ptype_4borg_4item___pyx_scope_struct_2_genexpr = &__pyx_type_4borg_4item___pyx_scope_struct_2_genexpr;
6637 __Pyx_RefNannyFinishContext();
6638 return 0;
6639 __pyx_L1_error:;
6640 __Pyx_RefNannyFinishContext();
6641 return -1;
6642 }
6643
__Pyx_modinit_type_import_code(void)6644 static int __Pyx_modinit_type_import_code(void) {
6645 __Pyx_RefNannyDeclarations
6646 __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
6647 /*--- Type import code ---*/
6648 __Pyx_RefNannyFinishContext();
6649 return 0;
6650 }
6651
__Pyx_modinit_variable_import_code(void)6652 static int __Pyx_modinit_variable_import_code(void) {
6653 __Pyx_RefNannyDeclarations
6654 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
6655 /*--- Variable import code ---*/
6656 __Pyx_RefNannyFinishContext();
6657 return 0;
6658 }
6659
__Pyx_modinit_function_import_code(void)6660 static int __Pyx_modinit_function_import_code(void) {
6661 __Pyx_RefNannyDeclarations
6662 __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
6663 /*--- Function import code ---*/
6664 __Pyx_RefNannyFinishContext();
6665 return 0;
6666 }
6667
6668
6669 #ifndef CYTHON_NO_PYINIT_EXPORT
6670 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
6671 #elif PY_MAJOR_VERSION < 3
6672 #ifdef __cplusplus
6673 #define __Pyx_PyMODINIT_FUNC extern "C" void
6674 #else
6675 #define __Pyx_PyMODINIT_FUNC void
6676 #endif
6677 #else
6678 #ifdef __cplusplus
6679 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
6680 #else
6681 #define __Pyx_PyMODINIT_FUNC PyObject *
6682 #endif
6683 #endif
6684
6685
6686 #if PY_MAJOR_VERSION < 3
6687 __Pyx_PyMODINIT_FUNC inititem(void) CYTHON_SMALL_CODE; /*proto*/
inititem(void)6688 __Pyx_PyMODINIT_FUNC inititem(void)
6689 #else
6690 __Pyx_PyMODINIT_FUNC PyInit_item(void) CYTHON_SMALL_CODE; /*proto*/
6691 __Pyx_PyMODINIT_FUNC PyInit_item(void)
6692 #if CYTHON_PEP489_MULTI_PHASE_INIT
6693 {
6694 return PyModuleDef_Init(&__pyx_moduledef);
6695 }
6696 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
6697 #if PY_VERSION_HEX >= 0x030700A1
6698 static PY_INT64_T main_interpreter_id = -1;
6699 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
6700 if (main_interpreter_id == -1) {
6701 main_interpreter_id = current_id;
6702 return (unlikely(current_id == -1)) ? -1 : 0;
6703 } else if (unlikely(main_interpreter_id != current_id))
6704 #else
6705 static PyInterpreterState *main_interpreter = NULL;
6706 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
6707 if (!main_interpreter) {
6708 main_interpreter = current_interpreter;
6709 } else if (unlikely(main_interpreter != current_interpreter))
6710 #endif
6711 {
6712 PyErr_SetString(
6713 PyExc_ImportError,
6714 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
6715 return -1;
6716 }
6717 return 0;
6718 }
6719 static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
6720 PyObject *value = PyObject_GetAttrString(spec, from_name);
6721 int result = 0;
6722 if (likely(value)) {
6723 if (allow_none || value != Py_None) {
6724 result = PyDict_SetItemString(moddict, to_name, value);
6725 }
6726 Py_DECREF(value);
6727 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
6728 PyErr_Clear();
6729 } else {
6730 result = -1;
6731 }
6732 return result;
6733 }
6734 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
6735 PyObject *module = NULL, *moddict, *modname;
6736 if (__Pyx_check_single_interpreter())
6737 return NULL;
6738 if (__pyx_m)
6739 return __Pyx_NewRef(__pyx_m);
6740 modname = PyObject_GetAttrString(spec, "name");
6741 if (unlikely(!modname)) goto bad;
6742 module = PyModule_NewObject(modname);
6743 Py_DECREF(modname);
6744 if (unlikely(!module)) goto bad;
6745 moddict = PyModule_GetDict(module);
6746 if (unlikely(!moddict)) goto bad;
6747 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
6748 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
6749 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
6750 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
6751 return module;
6752 bad:
6753 Py_XDECREF(module);
6754 return NULL;
6755 }
6756
6757
6758 static CYTHON_SMALL_CODE int __pyx_pymod_exec_item(PyObject *__pyx_pyinit_module)
6759 #endif
6760 #endif
6761 {
6762 PyObject *__pyx_t_1 = NULL;
6763 PyObject *__pyx_t_2 = NULL;
6764 PyObject *__pyx_t_3 = NULL;
6765 PyObject *__pyx_t_4 = NULL;
6766 PyObject *__pyx_t_5 = NULL;
6767 PyObject *__pyx_t_6 = NULL;
6768 PyObject *__pyx_t_7 = NULL;
6769 int __pyx_t_8;
6770 PyObject *__pyx_t_9 = NULL;
6771 int __pyx_lineno = 0;
6772 const char *__pyx_filename = NULL;
6773 int __pyx_clineno = 0;
6774 __Pyx_RefNannyDeclarations
6775 #if CYTHON_PEP489_MULTI_PHASE_INIT
6776 if (__pyx_m) {
6777 if (__pyx_m == __pyx_pyinit_module) return 0;
6778 PyErr_SetString(PyExc_RuntimeError, "Module 'item' has already been imported. Re-initialisation is not supported.");
6779 return -1;
6780 }
6781 #elif PY_MAJOR_VERSION >= 3
6782 if (__pyx_m) return __Pyx_NewRef(__pyx_m);
6783 #endif
6784 #if CYTHON_REFNANNY
6785 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
6786 if (!__Pyx_RefNanny) {
6787 PyErr_Clear();
6788 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
6789 if (!__Pyx_RefNanny)
6790 Py_FatalError("failed to import 'refnanny' module");
6791 }
6792 #endif
6793 __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_item(void)", 0);
6794 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6795 #ifdef __Pxy_PyFrame_Initialize_Offsets
6796 __Pxy_PyFrame_Initialize_Offsets();
6797 #endif
6798 __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
6799 __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
6800 __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
6801 #ifdef __Pyx_CyFunction_USED
6802 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6803 #endif
6804 #ifdef __Pyx_FusedFunction_USED
6805 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6806 #endif
6807 #ifdef __Pyx_Coroutine_USED
6808 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6809 #endif
6810 #ifdef __Pyx_Generator_USED
6811 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6812 #endif
6813 #ifdef __Pyx_AsyncGen_USED
6814 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6815 #endif
6816 #ifdef __Pyx_StopAsyncIteration_USED
6817 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6818 #endif
6819 /*--- Library function declarations ---*/
6820 /*--- Threads initialization code ---*/
6821 #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
6822 #ifdef WITH_THREAD /* Python build with threading support? */
6823 PyEval_InitThreads();
6824 #endif
6825 #endif
6826 /*--- Module creation code ---*/
6827 #if CYTHON_PEP489_MULTI_PHASE_INIT
6828 __pyx_m = __pyx_pyinit_module;
6829 Py_INCREF(__pyx_m);
6830 #else
6831 #if PY_MAJOR_VERSION < 3
6832 __pyx_m = Py_InitModule4("item", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
6833 #else
6834 __pyx_m = PyModule_Create(&__pyx_moduledef);
6835 #endif
6836 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
6837 #endif
6838 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
6839 Py_INCREF(__pyx_d);
6840 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
6841 Py_INCREF(__pyx_b);
6842 __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
6843 Py_INCREF(__pyx_cython_runtime);
6844 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
6845 /*--- Initialize various global constants etc. ---*/
6846 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6847 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
6848 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6849 #endif
6850 if (__pyx_module_is_main_borg__item) {
6851 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6852 }
6853 #if PY_MAJOR_VERSION >= 3
6854 {
6855 PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
6856 if (!PyDict_GetItemString(modules, "borg.item")) {
6857 if (unlikely(PyDict_SetItemString(modules, "borg.item", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
6858 }
6859 }
6860 #endif
6861 /*--- Builtin init code ---*/
6862 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6863 /*--- Constants init code ---*/
6864 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6865 /*--- Global type/function init code ---*/
6866 (void)__Pyx_modinit_global_init_code();
6867 (void)__Pyx_modinit_variable_export_code();
6868 (void)__Pyx_modinit_function_export_code();
6869 if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
6870 (void)__Pyx_modinit_type_import_code();
6871 (void)__Pyx_modinit_variable_import_code();
6872 (void)__Pyx_modinit_function_import_code();
6873 /*--- Execution code ---*/
6874 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
6875 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6876 #endif
6877
6878 /* "borg/item.pyx":3
6879 * # cython: language_level=3
6880 *
6881 * import stat # <<<<<<<<<<<<<<
6882 * from collections import namedtuple
6883 *
6884 */
6885 __pyx_t_1 = __Pyx_Import(__pyx_n_s_stat, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3, __pyx_L1_error)
6886 __Pyx_GOTREF(__pyx_t_1);
6887 if (PyDict_SetItem(__pyx_d, __pyx_n_s_stat, __pyx_t_1) < 0) __PYX_ERR(0, 3, __pyx_L1_error)
6888 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6889
6890 /* "borg/item.pyx":4
6891 *
6892 * import stat
6893 * from collections import namedtuple # <<<<<<<<<<<<<<
6894 *
6895 * from .constants import ITEM_KEYS, ARCHIVE_KEYS
6896 */
6897 __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
6898 __Pyx_GOTREF(__pyx_t_1);
6899 __Pyx_INCREF(__pyx_n_s_namedtuple);
6900 __Pyx_GIVEREF(__pyx_n_s_namedtuple);
6901 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_namedtuple);
6902 __pyx_t_2 = __Pyx_Import(__pyx_n_s_collections, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error)
6903 __Pyx_GOTREF(__pyx_t_2);
6904 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6905 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_namedtuple); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
6906 __Pyx_GOTREF(__pyx_t_1);
6907 if (PyDict_SetItem(__pyx_d, __pyx_n_s_namedtuple, __pyx_t_1) < 0) __PYX_ERR(0, 4, __pyx_L1_error)
6908 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6909 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6910
6911 /* "borg/item.pyx":6
6912 * from collections import namedtuple
6913 *
6914 * from .constants import ITEM_KEYS, ARCHIVE_KEYS # <<<<<<<<<<<<<<
6915 * from .helpers import safe_encode, safe_decode
6916 * from .helpers import bigint_to_int, int_to_bigint
6917 */
6918 __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error)
6919 __Pyx_GOTREF(__pyx_t_2);
6920 __Pyx_INCREF(__pyx_n_s_ITEM_KEYS);
6921 __Pyx_GIVEREF(__pyx_n_s_ITEM_KEYS);
6922 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_ITEM_KEYS);
6923 __Pyx_INCREF(__pyx_n_s_ARCHIVE_KEYS);
6924 __Pyx_GIVEREF(__pyx_n_s_ARCHIVE_KEYS);
6925 PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_ARCHIVE_KEYS);
6926 __pyx_t_1 = __Pyx_Import(__pyx_n_s_constants, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error)
6927 __Pyx_GOTREF(__pyx_t_1);
6928 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6929 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_ITEM_KEYS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error)
6930 __Pyx_GOTREF(__pyx_t_2);
6931 if (PyDict_SetItem(__pyx_d, __pyx_n_s_ITEM_KEYS, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error)
6932 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6933 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_ARCHIVE_KEYS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error)
6934 __Pyx_GOTREF(__pyx_t_2);
6935 if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARCHIVE_KEYS, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error)
6936 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6937 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6938
6939 /* "borg/item.pyx":7
6940 *
6941 * from .constants import ITEM_KEYS, ARCHIVE_KEYS
6942 * from .helpers import safe_encode, safe_decode # <<<<<<<<<<<<<<
6943 * from .helpers import bigint_to_int, int_to_bigint
6944 * from .helpers import StableDict
6945 */
6946 __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error)
6947 __Pyx_GOTREF(__pyx_t_1);
6948 __Pyx_INCREF(__pyx_n_s_safe_encode);
6949 __Pyx_GIVEREF(__pyx_n_s_safe_encode);
6950 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_safe_encode);
6951 __Pyx_INCREF(__pyx_n_s_safe_decode);
6952 __Pyx_GIVEREF(__pyx_n_s_safe_decode);
6953 PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_safe_decode);
6954 __pyx_t_2 = __Pyx_Import(__pyx_n_s_helpers, __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error)
6955 __Pyx_GOTREF(__pyx_t_2);
6956 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6957 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_safe_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error)
6958 __Pyx_GOTREF(__pyx_t_1);
6959 if (PyDict_SetItem(__pyx_d, __pyx_n_s_safe_encode, __pyx_t_1) < 0) __PYX_ERR(0, 7, __pyx_L1_error)
6960 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6961 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_safe_decode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error)
6962 __Pyx_GOTREF(__pyx_t_1);
6963 if (PyDict_SetItem(__pyx_d, __pyx_n_s_safe_decode, __pyx_t_1) < 0) __PYX_ERR(0, 7, __pyx_L1_error)
6964 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6965 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6966
6967 /* "borg/item.pyx":8
6968 * from .constants import ITEM_KEYS, ARCHIVE_KEYS
6969 * from .helpers import safe_encode, safe_decode
6970 * from .helpers import bigint_to_int, int_to_bigint # <<<<<<<<<<<<<<
6971 * from .helpers import StableDict
6972 *
6973 */
6974 __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error)
6975 __Pyx_GOTREF(__pyx_t_2);
6976 __Pyx_INCREF(__pyx_n_s_bigint_to_int);
6977 __Pyx_GIVEREF(__pyx_n_s_bigint_to_int);
6978 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_bigint_to_int);
6979 __Pyx_INCREF(__pyx_n_s_int_to_bigint);
6980 __Pyx_GIVEREF(__pyx_n_s_int_to_bigint);
6981 PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_int_to_bigint);
6982 __pyx_t_1 = __Pyx_Import(__pyx_n_s_helpers, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error)
6983 __Pyx_GOTREF(__pyx_t_1);
6984 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6985 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_bigint_to_int); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error)
6986 __Pyx_GOTREF(__pyx_t_2);
6987 if (PyDict_SetItem(__pyx_d, __pyx_n_s_bigint_to_int, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error)
6988 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6989 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_int_to_bigint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error)
6990 __Pyx_GOTREF(__pyx_t_2);
6991 if (PyDict_SetItem(__pyx_d, __pyx_n_s_int_to_bigint, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error)
6992 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6993 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6994
6995 /* "borg/item.pyx":9
6996 * from .helpers import safe_encode, safe_decode
6997 * from .helpers import bigint_to_int, int_to_bigint
6998 * from .helpers import StableDict # <<<<<<<<<<<<<<
6999 *
7000 * API_VERSION = '1.1_03'
7001 */
7002 __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
7003 __Pyx_GOTREF(__pyx_t_1);
7004 __Pyx_INCREF(__pyx_n_s_StableDict);
7005 __Pyx_GIVEREF(__pyx_n_s_StableDict);
7006 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_StableDict);
7007 __pyx_t_2 = __Pyx_Import(__pyx_n_s_helpers, __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error)
7008 __Pyx_GOTREF(__pyx_t_2);
7009 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7010 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_StableDict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
7011 __Pyx_GOTREF(__pyx_t_1);
7012 if (PyDict_SetItem(__pyx_d, __pyx_n_s_StableDict, __pyx_t_1) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
7013 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7014 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7015
7016 /* "borg/item.pyx":11
7017 * from .helpers import StableDict
7018 *
7019 * API_VERSION = '1.1_03' # <<<<<<<<<<<<<<
7020 *
7021 *
7022 */
7023 if (PyDict_SetItem(__pyx_d, __pyx_n_s_API_VERSION, __pyx_kp_u_1_1_03) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
7024
7025 /* "borg/item.pyx":14
7026 *
7027 *
7028 * class PropDict: # <<<<<<<<<<<<<<
7029 * """
7030 * Manage a dictionary via properties.
7031 */
7032 __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_PropDict, __pyx_n_s_PropDict, (PyObject *) NULL, __pyx_n_s_borg_item, __pyx_kp_s_Manage_a_dictionary_via_propert); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error)
7033 __Pyx_GOTREF(__pyx_t_2);
7034
7035 /* "borg/item.pyx":34
7036 * are ignored instead of causing an error.
7037 * """
7038 * VALID_KEYS = None # override with <set of str> in child class # <<<<<<<<<<<<<<
7039 *
7040 * __slots__ = ("_dict", ) # avoid setting attributes not supported by properties
7041 */
7042 if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_VALID_KEYS, Py_None) < 0) __PYX_ERR(0, 34, __pyx_L1_error)
7043
7044 /* "borg/item.pyx":36
7045 * VALID_KEYS = None # override with <set of str> in child class
7046 *
7047 * __slots__ = ("_dict", ) # avoid setting attributes not supported by properties # <<<<<<<<<<<<<<
7048 *
7049 * def __init__(self, data_dict=None, internal_dict=None, **kw):
7050 */
7051 if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_slots, __pyx_tuple__13) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
7052
7053 /* "borg/item.pyx":38
7054 * __slots__ = ("_dict", ) # avoid setting attributes not supported by properties
7055 *
7056 * def __init__(self, data_dict=None, internal_dict=None, **kw): # <<<<<<<<<<<<<<
7057 * self._dict = {}
7058 * if internal_dict is None:
7059 */
7060 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_4item_8PropDict_1__init__, 0, __pyx_n_s_PropDict___init, NULL, __pyx_n_s_borg_item, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error)
7061 __Pyx_GOTREF(__pyx_t_1);
7062 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__16);
7063 if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_1) < 0) __PYX_ERR(0, 38, __pyx_L1_error)
7064 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7065
7066 /* "borg/item.pyx":55
7067 * self.update(data)
7068 *
7069 * def update(self, d): # <<<<<<<<<<<<<<
7070 * for k, v in d.items():
7071 * if isinstance(k, bytes):
7072 */
7073 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_4item_8PropDict_3update, 0, __pyx_n_s_PropDict_update, NULL, __pyx_n_s_borg_item, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error)
7074 __Pyx_GOTREF(__pyx_t_1);
7075 if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_update, __pyx_t_1) < 0) __PYX_ERR(0, 55, __pyx_L1_error)
7076 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7077
7078 /* "borg/item.pyx":61
7079 * setattr(self, self._check_key(k), v)
7080 *
7081 * def update_internal(self, d): # <<<<<<<<<<<<<<
7082 * for k, v in d.items():
7083 * if isinstance(k, bytes):
7084 */
7085 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_4item_8PropDict_5update_internal, 0, __pyx_n_s_PropDict_update_internal, NULL, __pyx_n_s_borg_item, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error)
7086 __Pyx_GOTREF(__pyx_t_1);
7087 if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_update_internal, __pyx_t_1) < 0) __PYX_ERR(0, 61, __pyx_L1_error)
7088 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7089
7090 /* "borg/item.pyx":67
7091 * self._dict[k] = v
7092 *
7093 * def __eq__(self, other): # <<<<<<<<<<<<<<
7094 * return self.as_dict() == other.as_dict()
7095 *
7096 */
7097 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_4item_8PropDict_7__eq__, 0, __pyx_n_s_PropDict___eq, NULL, __pyx_n_s_borg_item, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error)
7098 __Pyx_GOTREF(__pyx_t_1);
7099 if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_eq, __pyx_t_1) < 0) __PYX_ERR(0, 67, __pyx_L1_error)
7100 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7101
7102 /* "borg/item.pyx":70
7103 * return self.as_dict() == other.as_dict()
7104 *
7105 * def __repr__(self): # <<<<<<<<<<<<<<
7106 * return '%s(internal_dict=%r)' % (self.__class__.__name__, self._dict)
7107 *
7108 */
7109 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_4item_8PropDict_9__repr__, 0, __pyx_n_s_PropDict___repr, NULL, __pyx_n_s_borg_item, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error)
7110 __Pyx_GOTREF(__pyx_t_1);
7111 if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_repr, __pyx_t_1) < 0) __PYX_ERR(0, 70, __pyx_L1_error)
7112 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7113
7114 /* "borg/item.pyx":73
7115 * return '%s(internal_dict=%r)' % (self.__class__.__name__, self._dict)
7116 *
7117 * def as_dict(self): # <<<<<<<<<<<<<<
7118 * """return the internal dictionary"""
7119 * return StableDict(self._dict)
7120 */
7121 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_4item_8PropDict_11as_dict, 0, __pyx_n_s_PropDict_as_dict, NULL, __pyx_n_s_borg_item, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error)
7122 __Pyx_GOTREF(__pyx_t_1);
7123 if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_as_dict, __pyx_t_1) < 0) __PYX_ERR(0, 73, __pyx_L1_error)
7124 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7125
7126 /* "borg/item.pyx":77
7127 * return StableDict(self._dict)
7128 *
7129 * def _check_key(self, key): # <<<<<<<<<<<<<<
7130 * """make sure key is of type str and known"""
7131 * if not isinstance(key, str):
7132 */
7133 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_4item_8PropDict_13_check_key, 0, __pyx_n_s_PropDict__check_key, NULL, __pyx_n_s_borg_item, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error)
7134 __Pyx_GOTREF(__pyx_t_1);
7135 if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_check_key, __pyx_t_1) < 0) __PYX_ERR(0, 77, __pyx_L1_error)
7136 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7137
7138 /* "borg/item.pyx":85
7139 * return key
7140 *
7141 * def __contains__(self, key): # <<<<<<<<<<<<<<
7142 * """do we have this key?"""
7143 * return self._check_key(key) in self._dict
7144 */
7145 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_4item_8PropDict_15__contains__, 0, __pyx_n_s_PropDict___contains, NULL, __pyx_n_s_borg_item, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 85, __pyx_L1_error)
7146 __Pyx_GOTREF(__pyx_t_1);
7147 if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_contains, __pyx_t_1) < 0) __PYX_ERR(0, 85, __pyx_L1_error)
7148 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7149
7150 /* "borg/item.pyx":89
7151 * return self._check_key(key) in self._dict
7152 *
7153 * def get(self, key, default=None): # <<<<<<<<<<<<<<
7154 * """get value for key, return default if key does not exist"""
7155 * return getattr(self, self._check_key(key), default)
7156 */
7157 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_4item_8PropDict_17get, 0, __pyx_n_s_PropDict_get, NULL, __pyx_n_s_borg_item, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error)
7158 __Pyx_GOTREF(__pyx_t_1);
7159 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__33);
7160 if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_get_2, __pyx_t_1) < 0) __PYX_ERR(0, 89, __pyx_L1_error)
7161 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7162
7163 /* "borg/item.pyx":94
7164 *
7165 * @staticmethod
7166 * def _make_property(key, value_type, value_type_name=None, encode=None, decode=None): # <<<<<<<<<<<<<<
7167 * """return a property that deals with self._dict[key]"""
7168 * assert isinstance(key, str)
7169 */
7170 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_4item_8PropDict_19_make_property, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_PropDict__make_property, NULL, __pyx_n_s_borg_item, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error)
7171 __Pyx_GOTREF(__pyx_t_1);
7172 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__36);
7173
7174 /* "borg/item.pyx":93
7175 * return getattr(self, self._check_key(key), default)
7176 *
7177 * @staticmethod # <<<<<<<<<<<<<<
7178 * def _make_property(key, value_type, value_type_name=None, encode=None, decode=None):
7179 * """return a property that deals with self._dict[key]"""
7180 */
7181 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 93, __pyx_L1_error)
7182 __Pyx_GOTREF(__pyx_t_3);
7183 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7184 if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_make_property, __pyx_t_3) < 0) __PYX_ERR(0, 94, __pyx_L1_error)
7185 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7186
7187 /* "borg/item.pyx":14
7188 *
7189 *
7190 * class PropDict: # <<<<<<<<<<<<<<
7191 * """
7192 * Manage a dictionary via properties.
7193 */
7194 __pyx_t_3 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_PropDict, __pyx_empty_tuple, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 14, __pyx_L1_error)
7195 __Pyx_GOTREF(__pyx_t_3);
7196 if (PyDict_SetItem(__pyx_d, __pyx_n_s_PropDict, __pyx_t_3) < 0) __PYX_ERR(0, 14, __pyx_L1_error)
7197 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7198 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7199
7200 /* "borg/item.pyx":128
7201 *
7202 *
7203 * ChunkListEntry = namedtuple('ChunkListEntry', 'id size csize') # <<<<<<<<<<<<<<
7204 *
7205 * class Item(PropDict):
7206 */
7207 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_namedtuple); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error)
7208 __Pyx_GOTREF(__pyx_t_2);
7209 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 128, __pyx_L1_error)
7210 __Pyx_GOTREF(__pyx_t_3);
7211 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7212 if (PyDict_SetItem(__pyx_d, __pyx_n_s_ChunkListEntry, __pyx_t_3) < 0) __PYX_ERR(0, 128, __pyx_L1_error)
7213 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7214
7215 /* "borg/item.pyx":130
7216 * ChunkListEntry = namedtuple('ChunkListEntry', 'id size csize')
7217 *
7218 * class Item(PropDict): # <<<<<<<<<<<<<<
7219 * """
7220 * Item abstraction that deals with validation and the low-level details internally:
7221 */
7222 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 130, __pyx_L1_error)
7223 __Pyx_GOTREF(__pyx_t_3);
7224 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 130, __pyx_L1_error)
7225 __Pyx_GOTREF(__pyx_t_2);
7226 __Pyx_GIVEREF(__pyx_t_3);
7227 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
7228 __pyx_t_3 = 0;
7229 __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 130, __pyx_L1_error)
7230 __Pyx_GOTREF(__pyx_t_3);
7231 __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_2, __pyx_n_s_Item, __pyx_n_s_Item, (PyObject *) NULL, __pyx_n_s_borg_item, __pyx_kp_s_Item_abstraction_that_deals_wit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 130, __pyx_L1_error)
7232 __Pyx_GOTREF(__pyx_t_1);
7233
7234 /* "borg/item.pyx":147
7235 * """
7236 *
7237 * VALID_KEYS = ITEM_KEYS | {'deleted', 'nlink', } # str-typed keys # <<<<<<<<<<<<<<
7238 *
7239 * __slots__ = ("_dict", ) # avoid setting attributes not supported by properties
7240 */
7241 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ITEM_KEYS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 147, __pyx_L1_error)
7242 __Pyx_GOTREF(__pyx_t_4);
7243 __pyx_t_5 = PySet_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 147, __pyx_L1_error)
7244 __Pyx_GOTREF(__pyx_t_5);
7245 if (PySet_Add(__pyx_t_5, __pyx_n_u_deleted) < 0) __PYX_ERR(0, 147, __pyx_L1_error)
7246 if (PySet_Add(__pyx_t_5, __pyx_n_u_nlink) < 0) __PYX_ERR(0, 147, __pyx_L1_error)
7247 __pyx_t_6 = PyNumber_Or(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 147, __pyx_L1_error)
7248 __Pyx_GOTREF(__pyx_t_6);
7249 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7250 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7251 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_VALID_KEYS, __pyx_t_6) < 0) __PYX_ERR(0, 147, __pyx_L1_error)
7252 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7253
7254 /* "borg/item.pyx":149
7255 * VALID_KEYS = ITEM_KEYS | {'deleted', 'nlink', } # str-typed keys
7256 *
7257 * __slots__ = ("_dict", ) # avoid setting attributes not supported by properties # <<<<<<<<<<<<<<
7258 *
7259 * # properties statically defined, so that IDEs can know their names:
7260 */
7261 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_slots, __pyx_tuple__13) < 0) __PYX_ERR(0, 149, __pyx_L1_error)
7262
7263 /* "borg/item.pyx":153
7264 * # properties statically defined, so that IDEs can know their names:
7265 *
7266 * path = PropDict._make_property('path', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) # <<<<<<<<<<<<<<
7267 * source = PropDict._make_property('source', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode)
7268 * user = PropDict._make_property('user', (str, type(None)), 'surrogate-escaped str or None', encode=safe_encode, decode=safe_decode)
7269 */
7270 __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 153, __pyx_L1_error)
7271 __Pyx_GOTREF(__pyx_t_6);
7272 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_make_property); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 153, __pyx_L1_error)
7273 __Pyx_GOTREF(__pyx_t_5);
7274 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7275 __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 153, __pyx_L1_error)
7276 __Pyx_GOTREF(__pyx_t_6);
7277 __Pyx_INCREF(__pyx_n_u_path);
7278 __Pyx_GIVEREF(__pyx_n_u_path);
7279 PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_n_u_path);
7280 __Pyx_INCREF(((PyObject *)(&PyUnicode_Type)));
7281 __Pyx_GIVEREF(((PyObject *)(&PyUnicode_Type)));
7282 PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)(&PyUnicode_Type)));
7283 __Pyx_INCREF(__pyx_kp_u_surrogate_escaped_str);
7284 __Pyx_GIVEREF(__pyx_kp_u_surrogate_escaped_str);
7285 PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_kp_u_surrogate_escaped_str);
7286 __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 153, __pyx_L1_error)
7287 __Pyx_GOTREF(__pyx_t_4);
7288 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_safe_encode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 153, __pyx_L1_error)
7289 __Pyx_GOTREF(__pyx_t_7);
7290 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_encode, __pyx_t_7) < 0) __PYX_ERR(0, 153, __pyx_L1_error)
7291 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7292 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_safe_decode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 153, __pyx_L1_error)
7293 __Pyx_GOTREF(__pyx_t_7);
7294 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_decode, __pyx_t_7) < 0) __PYX_ERR(0, 153, __pyx_L1_error)
7295 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7296 __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 153, __pyx_L1_error)
7297 __Pyx_GOTREF(__pyx_t_7);
7298 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7299 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7300 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7301 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_path, __pyx_t_7) < 0) __PYX_ERR(0, 153, __pyx_L1_error)
7302 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7303
7304 /* "borg/item.pyx":154
7305 *
7306 * path = PropDict._make_property('path', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode)
7307 * source = PropDict._make_property('source', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) # <<<<<<<<<<<<<<
7308 * user = PropDict._make_property('user', (str, type(None)), 'surrogate-escaped str or None', encode=safe_encode, decode=safe_decode)
7309 * group = PropDict._make_property('group', (str, type(None)), 'surrogate-escaped str or None', encode=safe_encode, decode=safe_decode)
7310 */
7311 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 154, __pyx_L1_error)
7312 __Pyx_GOTREF(__pyx_t_7);
7313 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_make_property); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 154, __pyx_L1_error)
7314 __Pyx_GOTREF(__pyx_t_4);
7315 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7316 __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 154, __pyx_L1_error)
7317 __Pyx_GOTREF(__pyx_t_7);
7318 __Pyx_INCREF(__pyx_n_u_source);
7319 __Pyx_GIVEREF(__pyx_n_u_source);
7320 PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_n_u_source);
7321 __Pyx_INCREF(((PyObject *)(&PyUnicode_Type)));
7322 __Pyx_GIVEREF(((PyObject *)(&PyUnicode_Type)));
7323 PyTuple_SET_ITEM(__pyx_t_7, 1, ((PyObject *)(&PyUnicode_Type)));
7324 __Pyx_INCREF(__pyx_kp_u_surrogate_escaped_str);
7325 __Pyx_GIVEREF(__pyx_kp_u_surrogate_escaped_str);
7326 PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_kp_u_surrogate_escaped_str);
7327 __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 154, __pyx_L1_error)
7328 __Pyx_GOTREF(__pyx_t_6);
7329 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_safe_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 154, __pyx_L1_error)
7330 __Pyx_GOTREF(__pyx_t_5);
7331 if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_encode, __pyx_t_5) < 0) __PYX_ERR(0, 154, __pyx_L1_error)
7332 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7333 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_safe_decode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 154, __pyx_L1_error)
7334 __Pyx_GOTREF(__pyx_t_5);
7335 if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_decode, __pyx_t_5) < 0) __PYX_ERR(0, 154, __pyx_L1_error)
7336 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7337 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 154, __pyx_L1_error)
7338 __Pyx_GOTREF(__pyx_t_5);
7339 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7340 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7341 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7342 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_source, __pyx_t_5) < 0) __PYX_ERR(0, 154, __pyx_L1_error)
7343 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7344
7345 /* "borg/item.pyx":155
7346 * path = PropDict._make_property('path', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode)
7347 * source = PropDict._make_property('source', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode)
7348 * user = PropDict._make_property('user', (str, type(None)), 'surrogate-escaped str or None', encode=safe_encode, decode=safe_decode) # <<<<<<<<<<<<<<
7349 * group = PropDict._make_property('group', (str, type(None)), 'surrogate-escaped str or None', encode=safe_encode, decode=safe_decode)
7350 *
7351 */
7352 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 155, __pyx_L1_error)
7353 __Pyx_GOTREF(__pyx_t_5);
7354 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_make_property); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 155, __pyx_L1_error)
7355 __Pyx_GOTREF(__pyx_t_6);
7356 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7357 __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 155, __pyx_L1_error)
7358 __Pyx_GOTREF(__pyx_t_5);
7359 __Pyx_INCREF(((PyObject *)(&PyUnicode_Type)));
7360 __Pyx_GIVEREF(((PyObject *)(&PyUnicode_Type)));
7361 PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)(&PyUnicode_Type)));
7362 __Pyx_INCREF(((PyObject *)Py_TYPE(Py_None)));
7363 __Pyx_GIVEREF(((PyObject *)Py_TYPE(Py_None)));
7364 PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)Py_TYPE(Py_None)));
7365 __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 155, __pyx_L1_error)
7366 __Pyx_GOTREF(__pyx_t_7);
7367 __Pyx_INCREF(__pyx_n_u_user);
7368 __Pyx_GIVEREF(__pyx_n_u_user);
7369 PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_n_u_user);
7370 __Pyx_GIVEREF(__pyx_t_5);
7371 PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_5);
7372 __Pyx_INCREF(__pyx_kp_u_surrogate_escaped_str_or_None);
7373 __Pyx_GIVEREF(__pyx_kp_u_surrogate_escaped_str_or_None);
7374 PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_kp_u_surrogate_escaped_str_or_None);
7375 __pyx_t_5 = 0;
7376 __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 155, __pyx_L1_error)
7377 __Pyx_GOTREF(__pyx_t_5);
7378 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_safe_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 155, __pyx_L1_error)
7379 __Pyx_GOTREF(__pyx_t_4);
7380 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_encode, __pyx_t_4) < 0) __PYX_ERR(0, 155, __pyx_L1_error)
7381 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7382 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_safe_decode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 155, __pyx_L1_error)
7383 __Pyx_GOTREF(__pyx_t_4);
7384 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_decode, __pyx_t_4) < 0) __PYX_ERR(0, 155, __pyx_L1_error)
7385 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7386 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 155, __pyx_L1_error)
7387 __Pyx_GOTREF(__pyx_t_4);
7388 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7389 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7390 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7391 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_user, __pyx_t_4) < 0) __PYX_ERR(0, 155, __pyx_L1_error)
7392 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7393
7394 /* "borg/item.pyx":156
7395 * source = PropDict._make_property('source', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode)
7396 * user = PropDict._make_property('user', (str, type(None)), 'surrogate-escaped str or None', encode=safe_encode, decode=safe_decode)
7397 * group = PropDict._make_property('group', (str, type(None)), 'surrogate-escaped str or None', encode=safe_encode, decode=safe_decode) # <<<<<<<<<<<<<<
7398 *
7399 * acl_access = PropDict._make_property('acl_access', bytes)
7400 */
7401 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 156, __pyx_L1_error)
7402 __Pyx_GOTREF(__pyx_t_4);
7403 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_make_property); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 156, __pyx_L1_error)
7404 __Pyx_GOTREF(__pyx_t_5);
7405 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7406 __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 156, __pyx_L1_error)
7407 __Pyx_GOTREF(__pyx_t_4);
7408 __Pyx_INCREF(((PyObject *)(&PyUnicode_Type)));
7409 __Pyx_GIVEREF(((PyObject *)(&PyUnicode_Type)));
7410 PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)(&PyUnicode_Type)));
7411 __Pyx_INCREF(((PyObject *)Py_TYPE(Py_None)));
7412 __Pyx_GIVEREF(((PyObject *)Py_TYPE(Py_None)));
7413 PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)Py_TYPE(Py_None)));
7414 __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 156, __pyx_L1_error)
7415 __Pyx_GOTREF(__pyx_t_7);
7416 __Pyx_INCREF(__pyx_n_u_group);
7417 __Pyx_GIVEREF(__pyx_n_u_group);
7418 PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_n_u_group);
7419 __Pyx_GIVEREF(__pyx_t_4);
7420 PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
7421 __Pyx_INCREF(__pyx_kp_u_surrogate_escaped_str_or_None);
7422 __Pyx_GIVEREF(__pyx_kp_u_surrogate_escaped_str_or_None);
7423 PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_kp_u_surrogate_escaped_str_or_None);
7424 __pyx_t_4 = 0;
7425 __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 156, __pyx_L1_error)
7426 __Pyx_GOTREF(__pyx_t_4);
7427 __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_safe_encode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 156, __pyx_L1_error)
7428 __Pyx_GOTREF(__pyx_t_6);
7429 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_encode, __pyx_t_6) < 0) __PYX_ERR(0, 156, __pyx_L1_error)
7430 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7431 __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_safe_decode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 156, __pyx_L1_error)
7432 __Pyx_GOTREF(__pyx_t_6);
7433 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_decode, __pyx_t_6) < 0) __PYX_ERR(0, 156, __pyx_L1_error)
7434 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7435 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 156, __pyx_L1_error)
7436 __Pyx_GOTREF(__pyx_t_6);
7437 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7438 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7439 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7440 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_group, __pyx_t_6) < 0) __PYX_ERR(0, 156, __pyx_L1_error)
7441 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7442
7443 /* "borg/item.pyx":158
7444 * group = PropDict._make_property('group', (str, type(None)), 'surrogate-escaped str or None', encode=safe_encode, decode=safe_decode)
7445 *
7446 * acl_access = PropDict._make_property('acl_access', bytes) # <<<<<<<<<<<<<<
7447 * acl_default = PropDict._make_property('acl_default', bytes)
7448 * acl_extended = PropDict._make_property('acl_extended', bytes)
7449 */
7450 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error)
7451 __Pyx_GOTREF(__pyx_t_4);
7452 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_make_property); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 158, __pyx_L1_error)
7453 __Pyx_GOTREF(__pyx_t_7);
7454 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7455 __pyx_t_4 = NULL;
7456 __pyx_t_8 = 0;
7457 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
7458 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
7459 if (likely(__pyx_t_4)) {
7460 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
7461 __Pyx_INCREF(__pyx_t_4);
7462 __Pyx_INCREF(function);
7463 __Pyx_DECREF_SET(__pyx_t_7, function);
7464 __pyx_t_8 = 1;
7465 }
7466 }
7467 #if CYTHON_FAST_PYCALL
7468 if (PyFunction_Check(__pyx_t_7)) {
7469 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_n_u_acl_access, ((PyObject *)(&PyBytes_Type))};
7470 __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 158, __pyx_L1_error)
7471 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7472 __Pyx_GOTREF(__pyx_t_6);
7473 } else
7474 #endif
7475 #if CYTHON_FAST_PYCCALL
7476 if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
7477 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_n_u_acl_access, ((PyObject *)(&PyBytes_Type))};
7478 __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 158, __pyx_L1_error)
7479 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7480 __Pyx_GOTREF(__pyx_t_6);
7481 } else
7482 #endif
7483 {
7484 __pyx_t_5 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 158, __pyx_L1_error)
7485 __Pyx_GOTREF(__pyx_t_5);
7486 if (__pyx_t_4) {
7487 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
7488 }
7489 __Pyx_INCREF(__pyx_n_u_acl_access);
7490 __Pyx_GIVEREF(__pyx_n_u_acl_access);
7491 PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_8, __pyx_n_u_acl_access);
7492 __Pyx_INCREF(((PyObject *)(&PyBytes_Type)));
7493 __Pyx_GIVEREF(((PyObject *)(&PyBytes_Type)));
7494 PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, ((PyObject *)(&PyBytes_Type)));
7495 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 158, __pyx_L1_error)
7496 __Pyx_GOTREF(__pyx_t_6);
7497 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7498 }
7499 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7500 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_acl_access, __pyx_t_6) < 0) __PYX_ERR(0, 158, __pyx_L1_error)
7501 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7502
7503 /* "borg/item.pyx":159
7504 *
7505 * acl_access = PropDict._make_property('acl_access', bytes)
7506 * acl_default = PropDict._make_property('acl_default', bytes) # <<<<<<<<<<<<<<
7507 * acl_extended = PropDict._make_property('acl_extended', bytes)
7508 * acl_nfs4 = PropDict._make_property('acl_nfs4', bytes)
7509 */
7510 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 159, __pyx_L1_error)
7511 __Pyx_GOTREF(__pyx_t_7);
7512 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_make_property); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 159, __pyx_L1_error)
7513 __Pyx_GOTREF(__pyx_t_5);
7514 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7515 __pyx_t_7 = NULL;
7516 __pyx_t_8 = 0;
7517 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
7518 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
7519 if (likely(__pyx_t_7)) {
7520 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
7521 __Pyx_INCREF(__pyx_t_7);
7522 __Pyx_INCREF(function);
7523 __Pyx_DECREF_SET(__pyx_t_5, function);
7524 __pyx_t_8 = 1;
7525 }
7526 }
7527 #if CYTHON_FAST_PYCALL
7528 if (PyFunction_Check(__pyx_t_5)) {
7529 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_n_u_acl_default, ((PyObject *)(&PyBytes_Type))};
7530 __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 159, __pyx_L1_error)
7531 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
7532 __Pyx_GOTREF(__pyx_t_6);
7533 } else
7534 #endif
7535 #if CYTHON_FAST_PYCCALL
7536 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
7537 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_n_u_acl_default, ((PyObject *)(&PyBytes_Type))};
7538 __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 159, __pyx_L1_error)
7539 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
7540 __Pyx_GOTREF(__pyx_t_6);
7541 } else
7542 #endif
7543 {
7544 __pyx_t_4 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error)
7545 __Pyx_GOTREF(__pyx_t_4);
7546 if (__pyx_t_7) {
7547 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); __pyx_t_7 = NULL;
7548 }
7549 __Pyx_INCREF(__pyx_n_u_acl_default);
7550 __Pyx_GIVEREF(__pyx_n_u_acl_default);
7551 PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_8, __pyx_n_u_acl_default);
7552 __Pyx_INCREF(((PyObject *)(&PyBytes_Type)));
7553 __Pyx_GIVEREF(((PyObject *)(&PyBytes_Type)));
7554 PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_8, ((PyObject *)(&PyBytes_Type)));
7555 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 159, __pyx_L1_error)
7556 __Pyx_GOTREF(__pyx_t_6);
7557 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7558 }
7559 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7560 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_acl_default, __pyx_t_6) < 0) __PYX_ERR(0, 159, __pyx_L1_error)
7561 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7562
7563 /* "borg/item.pyx":160
7564 * acl_access = PropDict._make_property('acl_access', bytes)
7565 * acl_default = PropDict._make_property('acl_default', bytes)
7566 * acl_extended = PropDict._make_property('acl_extended', bytes) # <<<<<<<<<<<<<<
7567 * acl_nfs4 = PropDict._make_property('acl_nfs4', bytes)
7568 *
7569 */
7570 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 160, __pyx_L1_error)
7571 __Pyx_GOTREF(__pyx_t_5);
7572 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_make_property); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error)
7573 __Pyx_GOTREF(__pyx_t_4);
7574 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7575 __pyx_t_5 = NULL;
7576 __pyx_t_8 = 0;
7577 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
7578 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
7579 if (likely(__pyx_t_5)) {
7580 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
7581 __Pyx_INCREF(__pyx_t_5);
7582 __Pyx_INCREF(function);
7583 __Pyx_DECREF_SET(__pyx_t_4, function);
7584 __pyx_t_8 = 1;
7585 }
7586 }
7587 #if CYTHON_FAST_PYCALL
7588 if (PyFunction_Check(__pyx_t_4)) {
7589 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_n_u_acl_extended, ((PyObject *)(&PyBytes_Type))};
7590 __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 160, __pyx_L1_error)
7591 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
7592 __Pyx_GOTREF(__pyx_t_6);
7593 } else
7594 #endif
7595 #if CYTHON_FAST_PYCCALL
7596 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
7597 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_n_u_acl_extended, ((PyObject *)(&PyBytes_Type))};
7598 __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 160, __pyx_L1_error)
7599 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
7600 __Pyx_GOTREF(__pyx_t_6);
7601 } else
7602 #endif
7603 {
7604 __pyx_t_7 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 160, __pyx_L1_error)
7605 __Pyx_GOTREF(__pyx_t_7);
7606 if (__pyx_t_5) {
7607 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
7608 }
7609 __Pyx_INCREF(__pyx_n_u_acl_extended);
7610 __Pyx_GIVEREF(__pyx_n_u_acl_extended);
7611 PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_acl_extended);
7612 __Pyx_INCREF(((PyObject *)(&PyBytes_Type)));
7613 __Pyx_GIVEREF(((PyObject *)(&PyBytes_Type)));
7614 PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, ((PyObject *)(&PyBytes_Type)));
7615 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 160, __pyx_L1_error)
7616 __Pyx_GOTREF(__pyx_t_6);
7617 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7618 }
7619 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7620 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_acl_extended, __pyx_t_6) < 0) __PYX_ERR(0, 160, __pyx_L1_error)
7621 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7622
7623 /* "borg/item.pyx":161
7624 * acl_default = PropDict._make_property('acl_default', bytes)
7625 * acl_extended = PropDict._make_property('acl_extended', bytes)
7626 * acl_nfs4 = PropDict._make_property('acl_nfs4', bytes) # <<<<<<<<<<<<<<
7627 *
7628 * mode = PropDict._make_property('mode', int)
7629 */
7630 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 161, __pyx_L1_error)
7631 __Pyx_GOTREF(__pyx_t_4);
7632 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_make_property); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 161, __pyx_L1_error)
7633 __Pyx_GOTREF(__pyx_t_7);
7634 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7635 __pyx_t_4 = NULL;
7636 __pyx_t_8 = 0;
7637 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
7638 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
7639 if (likely(__pyx_t_4)) {
7640 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
7641 __Pyx_INCREF(__pyx_t_4);
7642 __Pyx_INCREF(function);
7643 __Pyx_DECREF_SET(__pyx_t_7, function);
7644 __pyx_t_8 = 1;
7645 }
7646 }
7647 #if CYTHON_FAST_PYCALL
7648 if (PyFunction_Check(__pyx_t_7)) {
7649 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_n_u_acl_nfs4, ((PyObject *)(&PyBytes_Type))};
7650 __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 161, __pyx_L1_error)
7651 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7652 __Pyx_GOTREF(__pyx_t_6);
7653 } else
7654 #endif
7655 #if CYTHON_FAST_PYCCALL
7656 if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
7657 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_n_u_acl_nfs4, ((PyObject *)(&PyBytes_Type))};
7658 __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 161, __pyx_L1_error)
7659 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7660 __Pyx_GOTREF(__pyx_t_6);
7661 } else
7662 #endif
7663 {
7664 __pyx_t_5 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 161, __pyx_L1_error)
7665 __Pyx_GOTREF(__pyx_t_5);
7666 if (__pyx_t_4) {
7667 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
7668 }
7669 __Pyx_INCREF(__pyx_n_u_acl_nfs4);
7670 __Pyx_GIVEREF(__pyx_n_u_acl_nfs4);
7671 PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_8, __pyx_n_u_acl_nfs4);
7672 __Pyx_INCREF(((PyObject *)(&PyBytes_Type)));
7673 __Pyx_GIVEREF(((PyObject *)(&PyBytes_Type)));
7674 PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, ((PyObject *)(&PyBytes_Type)));
7675 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 161, __pyx_L1_error)
7676 __Pyx_GOTREF(__pyx_t_6);
7677 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7678 }
7679 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7680 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_acl_nfs4, __pyx_t_6) < 0) __PYX_ERR(0, 161, __pyx_L1_error)
7681 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7682
7683 /* "borg/item.pyx":163
7684 * acl_nfs4 = PropDict._make_property('acl_nfs4', bytes)
7685 *
7686 * mode = PropDict._make_property('mode', int) # <<<<<<<<<<<<<<
7687 * uid = PropDict._make_property('uid', int)
7688 * gid = PropDict._make_property('gid', int)
7689 */
7690 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 163, __pyx_L1_error)
7691 __Pyx_GOTREF(__pyx_t_7);
7692 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_make_property); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 163, __pyx_L1_error)
7693 __Pyx_GOTREF(__pyx_t_5);
7694 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7695 __pyx_t_7 = NULL;
7696 __pyx_t_8 = 0;
7697 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
7698 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
7699 if (likely(__pyx_t_7)) {
7700 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
7701 __Pyx_INCREF(__pyx_t_7);
7702 __Pyx_INCREF(function);
7703 __Pyx_DECREF_SET(__pyx_t_5, function);
7704 __pyx_t_8 = 1;
7705 }
7706 }
7707 #if CYTHON_FAST_PYCALL
7708 if (PyFunction_Check(__pyx_t_5)) {
7709 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_n_u_mode, ((PyObject *)(&PyInt_Type))};
7710 __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 163, __pyx_L1_error)
7711 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
7712 __Pyx_GOTREF(__pyx_t_6);
7713 } else
7714 #endif
7715 #if CYTHON_FAST_PYCCALL
7716 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
7717 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_n_u_mode, ((PyObject *)(&PyInt_Type))};
7718 __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 163, __pyx_L1_error)
7719 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
7720 __Pyx_GOTREF(__pyx_t_6);
7721 } else
7722 #endif
7723 {
7724 __pyx_t_4 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error)
7725 __Pyx_GOTREF(__pyx_t_4);
7726 if (__pyx_t_7) {
7727 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); __pyx_t_7 = NULL;
7728 }
7729 __Pyx_INCREF(__pyx_n_u_mode);
7730 __Pyx_GIVEREF(__pyx_n_u_mode);
7731 PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_8, __pyx_n_u_mode);
7732 __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
7733 __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
7734 PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_8, ((PyObject *)(&PyInt_Type)));
7735 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 163, __pyx_L1_error)
7736 __Pyx_GOTREF(__pyx_t_6);
7737 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7738 }
7739 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7740 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_mode, __pyx_t_6) < 0) __PYX_ERR(0, 163, __pyx_L1_error)
7741 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7742
7743 /* "borg/item.pyx":164
7744 *
7745 * mode = PropDict._make_property('mode', int)
7746 * uid = PropDict._make_property('uid', int) # <<<<<<<<<<<<<<
7747 * gid = PropDict._make_property('gid', int)
7748 * rdev = PropDict._make_property('rdev', int)
7749 */
7750 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 164, __pyx_L1_error)
7751 __Pyx_GOTREF(__pyx_t_5);
7752 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_make_property); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 164, __pyx_L1_error)
7753 __Pyx_GOTREF(__pyx_t_4);
7754 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7755 __pyx_t_5 = NULL;
7756 __pyx_t_8 = 0;
7757 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
7758 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
7759 if (likely(__pyx_t_5)) {
7760 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
7761 __Pyx_INCREF(__pyx_t_5);
7762 __Pyx_INCREF(function);
7763 __Pyx_DECREF_SET(__pyx_t_4, function);
7764 __pyx_t_8 = 1;
7765 }
7766 }
7767 #if CYTHON_FAST_PYCALL
7768 if (PyFunction_Check(__pyx_t_4)) {
7769 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_n_u_uid, ((PyObject *)(&PyInt_Type))};
7770 __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 164, __pyx_L1_error)
7771 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
7772 __Pyx_GOTREF(__pyx_t_6);
7773 } else
7774 #endif
7775 #if CYTHON_FAST_PYCCALL
7776 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
7777 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_n_u_uid, ((PyObject *)(&PyInt_Type))};
7778 __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 164, __pyx_L1_error)
7779 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
7780 __Pyx_GOTREF(__pyx_t_6);
7781 } else
7782 #endif
7783 {
7784 __pyx_t_7 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 164, __pyx_L1_error)
7785 __Pyx_GOTREF(__pyx_t_7);
7786 if (__pyx_t_5) {
7787 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
7788 }
7789 __Pyx_INCREF(__pyx_n_u_uid);
7790 __Pyx_GIVEREF(__pyx_n_u_uid);
7791 PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_uid);
7792 __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
7793 __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
7794 PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, ((PyObject *)(&PyInt_Type)));
7795 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 164, __pyx_L1_error)
7796 __Pyx_GOTREF(__pyx_t_6);
7797 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7798 }
7799 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7800 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_uid, __pyx_t_6) < 0) __PYX_ERR(0, 164, __pyx_L1_error)
7801 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7802
7803 /* "borg/item.pyx":165
7804 * mode = PropDict._make_property('mode', int)
7805 * uid = PropDict._make_property('uid', int)
7806 * gid = PropDict._make_property('gid', int) # <<<<<<<<<<<<<<
7807 * rdev = PropDict._make_property('rdev', int)
7808 * bsdflags = PropDict._make_property('bsdflags', int)
7809 */
7810 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error)
7811 __Pyx_GOTREF(__pyx_t_4);
7812 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_make_property); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 165, __pyx_L1_error)
7813 __Pyx_GOTREF(__pyx_t_7);
7814 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7815 __pyx_t_4 = NULL;
7816 __pyx_t_8 = 0;
7817 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
7818 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
7819 if (likely(__pyx_t_4)) {
7820 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
7821 __Pyx_INCREF(__pyx_t_4);
7822 __Pyx_INCREF(function);
7823 __Pyx_DECREF_SET(__pyx_t_7, function);
7824 __pyx_t_8 = 1;
7825 }
7826 }
7827 #if CYTHON_FAST_PYCALL
7828 if (PyFunction_Check(__pyx_t_7)) {
7829 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_n_u_gid, ((PyObject *)(&PyInt_Type))};
7830 __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 165, __pyx_L1_error)
7831 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7832 __Pyx_GOTREF(__pyx_t_6);
7833 } else
7834 #endif
7835 #if CYTHON_FAST_PYCCALL
7836 if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
7837 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_n_u_gid, ((PyObject *)(&PyInt_Type))};
7838 __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 165, __pyx_L1_error)
7839 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7840 __Pyx_GOTREF(__pyx_t_6);
7841 } else
7842 #endif
7843 {
7844 __pyx_t_5 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 165, __pyx_L1_error)
7845 __Pyx_GOTREF(__pyx_t_5);
7846 if (__pyx_t_4) {
7847 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
7848 }
7849 __Pyx_INCREF(__pyx_n_u_gid);
7850 __Pyx_GIVEREF(__pyx_n_u_gid);
7851 PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_8, __pyx_n_u_gid);
7852 __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
7853 __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
7854 PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, ((PyObject *)(&PyInt_Type)));
7855 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 165, __pyx_L1_error)
7856 __Pyx_GOTREF(__pyx_t_6);
7857 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7858 }
7859 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7860 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_gid, __pyx_t_6) < 0) __PYX_ERR(0, 165, __pyx_L1_error)
7861 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7862
7863 /* "borg/item.pyx":166
7864 * uid = PropDict._make_property('uid', int)
7865 * gid = PropDict._make_property('gid', int)
7866 * rdev = PropDict._make_property('rdev', int) # <<<<<<<<<<<<<<
7867 * bsdflags = PropDict._make_property('bsdflags', int)
7868 *
7869 */
7870 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 166, __pyx_L1_error)
7871 __Pyx_GOTREF(__pyx_t_7);
7872 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_make_property); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 166, __pyx_L1_error)
7873 __Pyx_GOTREF(__pyx_t_5);
7874 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7875 __pyx_t_7 = NULL;
7876 __pyx_t_8 = 0;
7877 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
7878 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
7879 if (likely(__pyx_t_7)) {
7880 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
7881 __Pyx_INCREF(__pyx_t_7);
7882 __Pyx_INCREF(function);
7883 __Pyx_DECREF_SET(__pyx_t_5, function);
7884 __pyx_t_8 = 1;
7885 }
7886 }
7887 #if CYTHON_FAST_PYCALL
7888 if (PyFunction_Check(__pyx_t_5)) {
7889 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_n_u_rdev, ((PyObject *)(&PyInt_Type))};
7890 __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 166, __pyx_L1_error)
7891 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
7892 __Pyx_GOTREF(__pyx_t_6);
7893 } else
7894 #endif
7895 #if CYTHON_FAST_PYCCALL
7896 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
7897 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_n_u_rdev, ((PyObject *)(&PyInt_Type))};
7898 __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 166, __pyx_L1_error)
7899 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
7900 __Pyx_GOTREF(__pyx_t_6);
7901 } else
7902 #endif
7903 {
7904 __pyx_t_4 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 166, __pyx_L1_error)
7905 __Pyx_GOTREF(__pyx_t_4);
7906 if (__pyx_t_7) {
7907 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); __pyx_t_7 = NULL;
7908 }
7909 __Pyx_INCREF(__pyx_n_u_rdev);
7910 __Pyx_GIVEREF(__pyx_n_u_rdev);
7911 PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_8, __pyx_n_u_rdev);
7912 __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
7913 __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
7914 PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_8, ((PyObject *)(&PyInt_Type)));
7915 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 166, __pyx_L1_error)
7916 __Pyx_GOTREF(__pyx_t_6);
7917 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7918 }
7919 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7920 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_rdev, __pyx_t_6) < 0) __PYX_ERR(0, 166, __pyx_L1_error)
7921 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7922
7923 /* "borg/item.pyx":167
7924 * gid = PropDict._make_property('gid', int)
7925 * rdev = PropDict._make_property('rdev', int)
7926 * bsdflags = PropDict._make_property('bsdflags', int) # <<<<<<<<<<<<<<
7927 *
7928 * # note: we need to keep the bigint conversion for compatibility with borg 1.0 archives.
7929 */
7930 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 167, __pyx_L1_error)
7931 __Pyx_GOTREF(__pyx_t_5);
7932 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_make_property); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error)
7933 __Pyx_GOTREF(__pyx_t_4);
7934 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7935 __pyx_t_5 = NULL;
7936 __pyx_t_8 = 0;
7937 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
7938 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
7939 if (likely(__pyx_t_5)) {
7940 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
7941 __Pyx_INCREF(__pyx_t_5);
7942 __Pyx_INCREF(function);
7943 __Pyx_DECREF_SET(__pyx_t_4, function);
7944 __pyx_t_8 = 1;
7945 }
7946 }
7947 #if CYTHON_FAST_PYCALL
7948 if (PyFunction_Check(__pyx_t_4)) {
7949 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_n_u_bsdflags, ((PyObject *)(&PyInt_Type))};
7950 __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 167, __pyx_L1_error)
7951 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
7952 __Pyx_GOTREF(__pyx_t_6);
7953 } else
7954 #endif
7955 #if CYTHON_FAST_PYCCALL
7956 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
7957 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_n_u_bsdflags, ((PyObject *)(&PyInt_Type))};
7958 __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 167, __pyx_L1_error)
7959 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
7960 __Pyx_GOTREF(__pyx_t_6);
7961 } else
7962 #endif
7963 {
7964 __pyx_t_7 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 167, __pyx_L1_error)
7965 __Pyx_GOTREF(__pyx_t_7);
7966 if (__pyx_t_5) {
7967 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
7968 }
7969 __Pyx_INCREF(__pyx_n_u_bsdflags);
7970 __Pyx_GIVEREF(__pyx_n_u_bsdflags);
7971 PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_bsdflags);
7972 __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
7973 __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
7974 PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, ((PyObject *)(&PyInt_Type)));
7975 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 167, __pyx_L1_error)
7976 __Pyx_GOTREF(__pyx_t_6);
7977 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7978 }
7979 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7980 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_bsdflags, __pyx_t_6) < 0) __PYX_ERR(0, 167, __pyx_L1_error)
7981 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7982
7983 /* "borg/item.pyx":170
7984 *
7985 * # note: we need to keep the bigint conversion for compatibility with borg 1.0 archives.
7986 * atime = PropDict._make_property('atime', int, 'bigint', encode=int_to_bigint, decode=bigint_to_int) # <<<<<<<<<<<<<<
7987 * ctime = PropDict._make_property('ctime', int, 'bigint', encode=int_to_bigint, decode=bigint_to_int)
7988 * mtime = PropDict._make_property('mtime', int, 'bigint', encode=int_to_bigint, decode=bigint_to_int)
7989 */
7990 __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 170, __pyx_L1_error)
7991 __Pyx_GOTREF(__pyx_t_6);
7992 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_make_property); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 170, __pyx_L1_error)
7993 __Pyx_GOTREF(__pyx_t_4);
7994 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7995 __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 170, __pyx_L1_error)
7996 __Pyx_GOTREF(__pyx_t_6);
7997 __Pyx_INCREF(__pyx_n_u_atime);
7998 __Pyx_GIVEREF(__pyx_n_u_atime);
7999 PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_n_u_atime);
8000 __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
8001 __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
8002 PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)(&PyInt_Type)));
8003 __Pyx_INCREF(__pyx_n_u_bigint);
8004 __Pyx_GIVEREF(__pyx_n_u_bigint);
8005 PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_n_u_bigint);
8006 __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 170, __pyx_L1_error)
8007 __Pyx_GOTREF(__pyx_t_7);
8008 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_int_to_bigint); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 170, __pyx_L1_error)
8009 __Pyx_GOTREF(__pyx_t_5);
8010 if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_encode, __pyx_t_5) < 0) __PYX_ERR(0, 170, __pyx_L1_error)
8011 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8012 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_bigint_to_int); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 170, __pyx_L1_error)
8013 __Pyx_GOTREF(__pyx_t_5);
8014 if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_decode, __pyx_t_5) < 0) __PYX_ERR(0, 170, __pyx_L1_error)
8015 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8016 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 170, __pyx_L1_error)
8017 __Pyx_GOTREF(__pyx_t_5);
8018 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8019 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8020 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8021 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_atime, __pyx_t_5) < 0) __PYX_ERR(0, 170, __pyx_L1_error)
8022 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8023
8024 /* "borg/item.pyx":171
8025 * # note: we need to keep the bigint conversion for compatibility with borg 1.0 archives.
8026 * atime = PropDict._make_property('atime', int, 'bigint', encode=int_to_bigint, decode=bigint_to_int)
8027 * ctime = PropDict._make_property('ctime', int, 'bigint', encode=int_to_bigint, decode=bigint_to_int) # <<<<<<<<<<<<<<
8028 * mtime = PropDict._make_property('mtime', int, 'bigint', encode=int_to_bigint, decode=bigint_to_int)
8029 * birthtime = PropDict._make_property('birthtime', int, 'bigint', encode=int_to_bigint, decode=bigint_to_int)
8030 */
8031 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 171, __pyx_L1_error)
8032 __Pyx_GOTREF(__pyx_t_5);
8033 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_make_property); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 171, __pyx_L1_error)
8034 __Pyx_GOTREF(__pyx_t_7);
8035 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8036 __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 171, __pyx_L1_error)
8037 __Pyx_GOTREF(__pyx_t_5);
8038 __Pyx_INCREF(__pyx_n_u_ctime);
8039 __Pyx_GIVEREF(__pyx_n_u_ctime);
8040 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_n_u_ctime);
8041 __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
8042 __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
8043 PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)(&PyInt_Type)));
8044 __Pyx_INCREF(__pyx_n_u_bigint);
8045 __Pyx_GIVEREF(__pyx_n_u_bigint);
8046 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_n_u_bigint);
8047 __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 171, __pyx_L1_error)
8048 __Pyx_GOTREF(__pyx_t_6);
8049 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_int_to_bigint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error)
8050 __Pyx_GOTREF(__pyx_t_4);
8051 if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_encode, __pyx_t_4) < 0) __PYX_ERR(0, 171, __pyx_L1_error)
8052 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8053 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_bigint_to_int); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error)
8054 __Pyx_GOTREF(__pyx_t_4);
8055 if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_decode, __pyx_t_4) < 0) __PYX_ERR(0, 171, __pyx_L1_error)
8056 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8057 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error)
8058 __Pyx_GOTREF(__pyx_t_4);
8059 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8060 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8061 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8062 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_ctime, __pyx_t_4) < 0) __PYX_ERR(0, 171, __pyx_L1_error)
8063 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8064
8065 /* "borg/item.pyx":172
8066 * atime = PropDict._make_property('atime', int, 'bigint', encode=int_to_bigint, decode=bigint_to_int)
8067 * ctime = PropDict._make_property('ctime', int, 'bigint', encode=int_to_bigint, decode=bigint_to_int)
8068 * mtime = PropDict._make_property('mtime', int, 'bigint', encode=int_to_bigint, decode=bigint_to_int) # <<<<<<<<<<<<<<
8069 * birthtime = PropDict._make_property('birthtime', int, 'bigint', encode=int_to_bigint, decode=bigint_to_int)
8070 *
8071 */
8072 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __pyx_L1_error)
8073 __Pyx_GOTREF(__pyx_t_4);
8074 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_make_property); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 172, __pyx_L1_error)
8075 __Pyx_GOTREF(__pyx_t_6);
8076 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8077 __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __pyx_L1_error)
8078 __Pyx_GOTREF(__pyx_t_4);
8079 __Pyx_INCREF(__pyx_n_u_mtime);
8080 __Pyx_GIVEREF(__pyx_n_u_mtime);
8081 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_n_u_mtime);
8082 __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
8083 __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
8084 PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)(&PyInt_Type)));
8085 __Pyx_INCREF(__pyx_n_u_bigint);
8086 __Pyx_GIVEREF(__pyx_n_u_bigint);
8087 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_n_u_bigint);
8088 __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 172, __pyx_L1_error)
8089 __Pyx_GOTREF(__pyx_t_5);
8090 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_int_to_bigint); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 172, __pyx_L1_error)
8091 __Pyx_GOTREF(__pyx_t_7);
8092 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_encode, __pyx_t_7) < 0) __PYX_ERR(0, 172, __pyx_L1_error)
8093 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8094 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_bigint_to_int); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 172, __pyx_L1_error)
8095 __Pyx_GOTREF(__pyx_t_7);
8096 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_decode, __pyx_t_7) < 0) __PYX_ERR(0, 172, __pyx_L1_error)
8097 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8098 __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 172, __pyx_L1_error)
8099 __Pyx_GOTREF(__pyx_t_7);
8100 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8101 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8102 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8103 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_mtime, __pyx_t_7) < 0) __PYX_ERR(0, 172, __pyx_L1_error)
8104 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8105
8106 /* "borg/item.pyx":173
8107 * ctime = PropDict._make_property('ctime', int, 'bigint', encode=int_to_bigint, decode=bigint_to_int)
8108 * mtime = PropDict._make_property('mtime', int, 'bigint', encode=int_to_bigint, decode=bigint_to_int)
8109 * birthtime = PropDict._make_property('birthtime', int, 'bigint', encode=int_to_bigint, decode=bigint_to_int) # <<<<<<<<<<<<<<
8110 *
8111 * # size is only present for items with a chunk list and then it is sum(chunk_sizes)
8112 */
8113 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 173, __pyx_L1_error)
8114 __Pyx_GOTREF(__pyx_t_7);
8115 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_make_property); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 173, __pyx_L1_error)
8116 __Pyx_GOTREF(__pyx_t_5);
8117 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8118 __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 173, __pyx_L1_error)
8119 __Pyx_GOTREF(__pyx_t_7);
8120 __Pyx_INCREF(__pyx_n_u_birthtime);
8121 __Pyx_GIVEREF(__pyx_n_u_birthtime);
8122 PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_n_u_birthtime);
8123 __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
8124 __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
8125 PyTuple_SET_ITEM(__pyx_t_7, 1, ((PyObject *)(&PyInt_Type)));
8126 __Pyx_INCREF(__pyx_n_u_bigint);
8127 __Pyx_GIVEREF(__pyx_n_u_bigint);
8128 PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_n_u_bigint);
8129 __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 173, __pyx_L1_error)
8130 __Pyx_GOTREF(__pyx_t_4);
8131 __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_int_to_bigint); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 173, __pyx_L1_error)
8132 __Pyx_GOTREF(__pyx_t_6);
8133 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_encode, __pyx_t_6) < 0) __PYX_ERR(0, 173, __pyx_L1_error)
8134 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8135 __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_bigint_to_int); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 173, __pyx_L1_error)
8136 __Pyx_GOTREF(__pyx_t_6);
8137 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_decode, __pyx_t_6) < 0) __PYX_ERR(0, 173, __pyx_L1_error)
8138 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8139 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 173, __pyx_L1_error)
8140 __Pyx_GOTREF(__pyx_t_6);
8141 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8142 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8143 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8144 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_birthtime, __pyx_t_6) < 0) __PYX_ERR(0, 173, __pyx_L1_error)
8145 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8146
8147 /* "borg/item.pyx":177
8148 * # size is only present for items with a chunk list and then it is sum(chunk_sizes)
8149 * # compatibility note: this is a new feature, in old archives size will be missing.
8150 * size = PropDict._make_property('size', int) # <<<<<<<<<<<<<<
8151 *
8152 * hardlink_master = PropDict._make_property('hardlink_master', bool)
8153 */
8154 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 177, __pyx_L1_error)
8155 __Pyx_GOTREF(__pyx_t_4);
8156 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_make_property); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 177, __pyx_L1_error)
8157 __Pyx_GOTREF(__pyx_t_7);
8158 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8159 __pyx_t_4 = NULL;
8160 __pyx_t_8 = 0;
8161 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
8162 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
8163 if (likely(__pyx_t_4)) {
8164 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
8165 __Pyx_INCREF(__pyx_t_4);
8166 __Pyx_INCREF(function);
8167 __Pyx_DECREF_SET(__pyx_t_7, function);
8168 __pyx_t_8 = 1;
8169 }
8170 }
8171 #if CYTHON_FAST_PYCALL
8172 if (PyFunction_Check(__pyx_t_7)) {
8173 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_n_u_size, ((PyObject *)(&PyInt_Type))};
8174 __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 177, __pyx_L1_error)
8175 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8176 __Pyx_GOTREF(__pyx_t_6);
8177 } else
8178 #endif
8179 #if CYTHON_FAST_PYCCALL
8180 if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
8181 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_n_u_size, ((PyObject *)(&PyInt_Type))};
8182 __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 177, __pyx_L1_error)
8183 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8184 __Pyx_GOTREF(__pyx_t_6);
8185 } else
8186 #endif
8187 {
8188 __pyx_t_5 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 177, __pyx_L1_error)
8189 __Pyx_GOTREF(__pyx_t_5);
8190 if (__pyx_t_4) {
8191 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
8192 }
8193 __Pyx_INCREF(__pyx_n_u_size);
8194 __Pyx_GIVEREF(__pyx_n_u_size);
8195 PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_8, __pyx_n_u_size);
8196 __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
8197 __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
8198 PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, ((PyObject *)(&PyInt_Type)));
8199 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 177, __pyx_L1_error)
8200 __Pyx_GOTREF(__pyx_t_6);
8201 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8202 }
8203 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8204 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_size, __pyx_t_6) < 0) __PYX_ERR(0, 177, __pyx_L1_error)
8205 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8206
8207 /* "borg/item.pyx":179
8208 * size = PropDict._make_property('size', int)
8209 *
8210 * hardlink_master = PropDict._make_property('hardlink_master', bool) # <<<<<<<<<<<<<<
8211 *
8212 * chunks = PropDict._make_property('chunks', (list, type(None)), 'list or None')
8213 */
8214 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 179, __pyx_L1_error)
8215 __Pyx_GOTREF(__pyx_t_7);
8216 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_make_property); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 179, __pyx_L1_error)
8217 __Pyx_GOTREF(__pyx_t_5);
8218 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8219 __pyx_t_7 = NULL;
8220 __pyx_t_8 = 0;
8221 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
8222 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
8223 if (likely(__pyx_t_7)) {
8224 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
8225 __Pyx_INCREF(__pyx_t_7);
8226 __Pyx_INCREF(function);
8227 __Pyx_DECREF_SET(__pyx_t_5, function);
8228 __pyx_t_8 = 1;
8229 }
8230 }
8231 #if CYTHON_FAST_PYCALL
8232 if (PyFunction_Check(__pyx_t_5)) {
8233 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_n_u_hardlink_master, ((PyObject*)&PyBool_Type)};
8234 __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 179, __pyx_L1_error)
8235 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
8236 __Pyx_GOTREF(__pyx_t_6);
8237 } else
8238 #endif
8239 #if CYTHON_FAST_PYCCALL
8240 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
8241 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_n_u_hardlink_master, ((PyObject*)&PyBool_Type)};
8242 __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 179, __pyx_L1_error)
8243 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
8244 __Pyx_GOTREF(__pyx_t_6);
8245 } else
8246 #endif
8247 {
8248 __pyx_t_4 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 179, __pyx_L1_error)
8249 __Pyx_GOTREF(__pyx_t_4);
8250 if (__pyx_t_7) {
8251 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); __pyx_t_7 = NULL;
8252 }
8253 __Pyx_INCREF(__pyx_n_u_hardlink_master);
8254 __Pyx_GIVEREF(__pyx_n_u_hardlink_master);
8255 PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_8, __pyx_n_u_hardlink_master);
8256 __Pyx_INCREF(((PyObject*)&PyBool_Type));
8257 __Pyx_GIVEREF(((PyObject*)&PyBool_Type));
8258 PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_8, ((PyObject*)&PyBool_Type));
8259 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 179, __pyx_L1_error)
8260 __Pyx_GOTREF(__pyx_t_6);
8261 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8262 }
8263 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8264 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_hardlink_master, __pyx_t_6) < 0) __PYX_ERR(0, 179, __pyx_L1_error)
8265 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8266
8267 /* "borg/item.pyx":181
8268 * hardlink_master = PropDict._make_property('hardlink_master', bool)
8269 *
8270 * chunks = PropDict._make_property('chunks', (list, type(None)), 'list or None') # <<<<<<<<<<<<<<
8271 * chunks_healthy = PropDict._make_property('chunks_healthy', (list, type(None)), 'list or None')
8272 *
8273 */
8274 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 181, __pyx_L1_error)
8275 __Pyx_GOTREF(__pyx_t_5);
8276 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_make_property); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error)
8277 __Pyx_GOTREF(__pyx_t_4);
8278 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8279 __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 181, __pyx_L1_error)
8280 __Pyx_GOTREF(__pyx_t_5);
8281 __Pyx_INCREF(((PyObject *)(&PyList_Type)));
8282 __Pyx_GIVEREF(((PyObject *)(&PyList_Type)));
8283 PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)(&PyList_Type)));
8284 __Pyx_INCREF(((PyObject *)Py_TYPE(Py_None)));
8285 __Pyx_GIVEREF(((PyObject *)Py_TYPE(Py_None)));
8286 PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)Py_TYPE(Py_None)));
8287 __pyx_t_7 = NULL;
8288 __pyx_t_8 = 0;
8289 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
8290 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
8291 if (likely(__pyx_t_7)) {
8292 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
8293 __Pyx_INCREF(__pyx_t_7);
8294 __Pyx_INCREF(function);
8295 __Pyx_DECREF_SET(__pyx_t_4, function);
8296 __pyx_t_8 = 1;
8297 }
8298 }
8299 #if CYTHON_FAST_PYCALL
8300 if (PyFunction_Check(__pyx_t_4)) {
8301 PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_n_u_chunks, __pyx_t_5, __pyx_kp_u_list_or_None};
8302 __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 181, __pyx_L1_error)
8303 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
8304 __Pyx_GOTREF(__pyx_t_6);
8305 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8306 } else
8307 #endif
8308 #if CYTHON_FAST_PYCCALL
8309 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
8310 PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_n_u_chunks, __pyx_t_5, __pyx_kp_u_list_or_None};
8311 __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 181, __pyx_L1_error)
8312 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
8313 __Pyx_GOTREF(__pyx_t_6);
8314 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8315 } else
8316 #endif
8317 {
8318 __pyx_t_9 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 181, __pyx_L1_error)
8319 __Pyx_GOTREF(__pyx_t_9);
8320 if (__pyx_t_7) {
8321 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
8322 }
8323 __Pyx_INCREF(__pyx_n_u_chunks);
8324 __Pyx_GIVEREF(__pyx_n_u_chunks);
8325 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_n_u_chunks);
8326 __Pyx_GIVEREF(__pyx_t_5);
8327 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_5);
8328 __Pyx_INCREF(__pyx_kp_u_list_or_None);
8329 __Pyx_GIVEREF(__pyx_kp_u_list_or_None);
8330 PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_kp_u_list_or_None);
8331 __pyx_t_5 = 0;
8332 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 181, __pyx_L1_error)
8333 __Pyx_GOTREF(__pyx_t_6);
8334 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8335 }
8336 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8337 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_chunks, __pyx_t_6) < 0) __PYX_ERR(0, 181, __pyx_L1_error)
8338 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8339
8340 /* "borg/item.pyx":182
8341 *
8342 * chunks = PropDict._make_property('chunks', (list, type(None)), 'list or None')
8343 * chunks_healthy = PropDict._make_property('chunks_healthy', (list, type(None)), 'list or None') # <<<<<<<<<<<<<<
8344 *
8345 * xattrs = PropDict._make_property('xattrs', StableDict)
8346 */
8347 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 182, __pyx_L1_error)
8348 __Pyx_GOTREF(__pyx_t_4);
8349 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_make_property); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 182, __pyx_L1_error)
8350 __Pyx_GOTREF(__pyx_t_9);
8351 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8352 __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 182, __pyx_L1_error)
8353 __Pyx_GOTREF(__pyx_t_4);
8354 __Pyx_INCREF(((PyObject *)(&PyList_Type)));
8355 __Pyx_GIVEREF(((PyObject *)(&PyList_Type)));
8356 PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)(&PyList_Type)));
8357 __Pyx_INCREF(((PyObject *)Py_TYPE(Py_None)));
8358 __Pyx_GIVEREF(((PyObject *)Py_TYPE(Py_None)));
8359 PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)Py_TYPE(Py_None)));
8360 __pyx_t_5 = NULL;
8361 __pyx_t_8 = 0;
8362 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
8363 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9);
8364 if (likely(__pyx_t_5)) {
8365 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
8366 __Pyx_INCREF(__pyx_t_5);
8367 __Pyx_INCREF(function);
8368 __Pyx_DECREF_SET(__pyx_t_9, function);
8369 __pyx_t_8 = 1;
8370 }
8371 }
8372 #if CYTHON_FAST_PYCALL
8373 if (PyFunction_Check(__pyx_t_9)) {
8374 PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_n_u_chunks_healthy, __pyx_t_4, __pyx_kp_u_list_or_None};
8375 __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 182, __pyx_L1_error)
8376 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
8377 __Pyx_GOTREF(__pyx_t_6);
8378 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8379 } else
8380 #endif
8381 #if CYTHON_FAST_PYCCALL
8382 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
8383 PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_n_u_chunks_healthy, __pyx_t_4, __pyx_kp_u_list_or_None};
8384 __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 182, __pyx_L1_error)
8385 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
8386 __Pyx_GOTREF(__pyx_t_6);
8387 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8388 } else
8389 #endif
8390 {
8391 __pyx_t_7 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 182, __pyx_L1_error)
8392 __Pyx_GOTREF(__pyx_t_7);
8393 if (__pyx_t_5) {
8394 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
8395 }
8396 __Pyx_INCREF(__pyx_n_u_chunks_healthy);
8397 __Pyx_GIVEREF(__pyx_n_u_chunks_healthy);
8398 PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_chunks_healthy);
8399 __Pyx_GIVEREF(__pyx_t_4);
8400 PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_t_4);
8401 __Pyx_INCREF(__pyx_kp_u_list_or_None);
8402 __Pyx_GIVEREF(__pyx_kp_u_list_or_None);
8403 PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_kp_u_list_or_None);
8404 __pyx_t_4 = 0;
8405 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 182, __pyx_L1_error)
8406 __Pyx_GOTREF(__pyx_t_6);
8407 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8408 }
8409 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8410 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_chunks_healthy, __pyx_t_6) < 0) __PYX_ERR(0, 182, __pyx_L1_error)
8411 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8412
8413 /* "borg/item.pyx":184
8414 * chunks_healthy = PropDict._make_property('chunks_healthy', (list, type(None)), 'list or None')
8415 *
8416 * xattrs = PropDict._make_property('xattrs', StableDict) # <<<<<<<<<<<<<<
8417 *
8418 * deleted = PropDict._make_property('deleted', bool)
8419 */
8420 __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 184, __pyx_L1_error)
8421 __Pyx_GOTREF(__pyx_t_9);
8422 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_make_property); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 184, __pyx_L1_error)
8423 __Pyx_GOTREF(__pyx_t_7);
8424 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8425 __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_StableDict); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 184, __pyx_L1_error)
8426 __Pyx_GOTREF(__pyx_t_9);
8427 __pyx_t_4 = NULL;
8428 __pyx_t_8 = 0;
8429 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
8430 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
8431 if (likely(__pyx_t_4)) {
8432 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
8433 __Pyx_INCREF(__pyx_t_4);
8434 __Pyx_INCREF(function);
8435 __Pyx_DECREF_SET(__pyx_t_7, function);
8436 __pyx_t_8 = 1;
8437 }
8438 }
8439 #if CYTHON_FAST_PYCALL
8440 if (PyFunction_Check(__pyx_t_7)) {
8441 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_n_u_xattrs, __pyx_t_9};
8442 __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 184, __pyx_L1_error)
8443 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8444 __Pyx_GOTREF(__pyx_t_6);
8445 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8446 } else
8447 #endif
8448 #if CYTHON_FAST_PYCCALL
8449 if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
8450 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_n_u_xattrs, __pyx_t_9};
8451 __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 184, __pyx_L1_error)
8452 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8453 __Pyx_GOTREF(__pyx_t_6);
8454 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8455 } else
8456 #endif
8457 {
8458 __pyx_t_5 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 184, __pyx_L1_error)
8459 __Pyx_GOTREF(__pyx_t_5);
8460 if (__pyx_t_4) {
8461 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
8462 }
8463 __Pyx_INCREF(__pyx_n_u_xattrs);
8464 __Pyx_GIVEREF(__pyx_n_u_xattrs);
8465 PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_8, __pyx_n_u_xattrs);
8466 __Pyx_GIVEREF(__pyx_t_9);
8467 PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, __pyx_t_9);
8468 __pyx_t_9 = 0;
8469 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 184, __pyx_L1_error)
8470 __Pyx_GOTREF(__pyx_t_6);
8471 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8472 }
8473 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8474 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_xattrs, __pyx_t_6) < 0) __PYX_ERR(0, 184, __pyx_L1_error)
8475 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8476
8477 /* "borg/item.pyx":186
8478 * xattrs = PropDict._make_property('xattrs', StableDict)
8479 *
8480 * deleted = PropDict._make_property('deleted', bool) # <<<<<<<<<<<<<<
8481 * nlink = PropDict._make_property('nlink', int)
8482 *
8483 */
8484 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 186, __pyx_L1_error)
8485 __Pyx_GOTREF(__pyx_t_7);
8486 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_make_property); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 186, __pyx_L1_error)
8487 __Pyx_GOTREF(__pyx_t_5);
8488 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8489 __pyx_t_7 = NULL;
8490 __pyx_t_8 = 0;
8491 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
8492 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
8493 if (likely(__pyx_t_7)) {
8494 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
8495 __Pyx_INCREF(__pyx_t_7);
8496 __Pyx_INCREF(function);
8497 __Pyx_DECREF_SET(__pyx_t_5, function);
8498 __pyx_t_8 = 1;
8499 }
8500 }
8501 #if CYTHON_FAST_PYCALL
8502 if (PyFunction_Check(__pyx_t_5)) {
8503 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_n_u_deleted, ((PyObject*)&PyBool_Type)};
8504 __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 186, __pyx_L1_error)
8505 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
8506 __Pyx_GOTREF(__pyx_t_6);
8507 } else
8508 #endif
8509 #if CYTHON_FAST_PYCCALL
8510 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
8511 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_n_u_deleted, ((PyObject*)&PyBool_Type)};
8512 __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 186, __pyx_L1_error)
8513 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
8514 __Pyx_GOTREF(__pyx_t_6);
8515 } else
8516 #endif
8517 {
8518 __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 186, __pyx_L1_error)
8519 __Pyx_GOTREF(__pyx_t_9);
8520 if (__pyx_t_7) {
8521 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
8522 }
8523 __Pyx_INCREF(__pyx_n_u_deleted);
8524 __Pyx_GIVEREF(__pyx_n_u_deleted);
8525 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_n_u_deleted);
8526 __Pyx_INCREF(((PyObject*)&PyBool_Type));
8527 __Pyx_GIVEREF(((PyObject*)&PyBool_Type));
8528 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, ((PyObject*)&PyBool_Type));
8529 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 186, __pyx_L1_error)
8530 __Pyx_GOTREF(__pyx_t_6);
8531 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8532 }
8533 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8534 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_deleted, __pyx_t_6) < 0) __PYX_ERR(0, 186, __pyx_L1_error)
8535 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8536
8537 /* "borg/item.pyx":187
8538 *
8539 * deleted = PropDict._make_property('deleted', bool)
8540 * nlink = PropDict._make_property('nlink', int) # <<<<<<<<<<<<<<
8541 *
8542 * part = PropDict._make_property('part', int)
8543 */
8544 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 187, __pyx_L1_error)
8545 __Pyx_GOTREF(__pyx_t_5);
8546 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_make_property); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 187, __pyx_L1_error)
8547 __Pyx_GOTREF(__pyx_t_9);
8548 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8549 __pyx_t_5 = NULL;
8550 __pyx_t_8 = 0;
8551 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
8552 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9);
8553 if (likely(__pyx_t_5)) {
8554 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
8555 __Pyx_INCREF(__pyx_t_5);
8556 __Pyx_INCREF(function);
8557 __Pyx_DECREF_SET(__pyx_t_9, function);
8558 __pyx_t_8 = 1;
8559 }
8560 }
8561 #if CYTHON_FAST_PYCALL
8562 if (PyFunction_Check(__pyx_t_9)) {
8563 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_n_u_nlink, ((PyObject *)(&PyInt_Type))};
8564 __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 187, __pyx_L1_error)
8565 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
8566 __Pyx_GOTREF(__pyx_t_6);
8567 } else
8568 #endif
8569 #if CYTHON_FAST_PYCCALL
8570 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
8571 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_n_u_nlink, ((PyObject *)(&PyInt_Type))};
8572 __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 187, __pyx_L1_error)
8573 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
8574 __Pyx_GOTREF(__pyx_t_6);
8575 } else
8576 #endif
8577 {
8578 __pyx_t_7 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 187, __pyx_L1_error)
8579 __Pyx_GOTREF(__pyx_t_7);
8580 if (__pyx_t_5) {
8581 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
8582 }
8583 __Pyx_INCREF(__pyx_n_u_nlink);
8584 __Pyx_GIVEREF(__pyx_n_u_nlink);
8585 PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_n_u_nlink);
8586 __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
8587 __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
8588 PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, ((PyObject *)(&PyInt_Type)));
8589 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 187, __pyx_L1_error)
8590 __Pyx_GOTREF(__pyx_t_6);
8591 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8592 }
8593 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8594 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_nlink, __pyx_t_6) < 0) __PYX_ERR(0, 187, __pyx_L1_error)
8595 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8596
8597 /* "borg/item.pyx":189
8598 * nlink = PropDict._make_property('nlink', int)
8599 *
8600 * part = PropDict._make_property('part', int) # <<<<<<<<<<<<<<
8601 *
8602 * def get_size(self, hardlink_masters=None, memorize=False, compressed=False, from_chunks=False):
8603 */
8604 __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 189, __pyx_L1_error)
8605 __Pyx_GOTREF(__pyx_t_9);
8606 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_make_property); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 189, __pyx_L1_error)
8607 __Pyx_GOTREF(__pyx_t_7);
8608 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8609 __pyx_t_9 = NULL;
8610 __pyx_t_8 = 0;
8611 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
8612 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
8613 if (likely(__pyx_t_9)) {
8614 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
8615 __Pyx_INCREF(__pyx_t_9);
8616 __Pyx_INCREF(function);
8617 __Pyx_DECREF_SET(__pyx_t_7, function);
8618 __pyx_t_8 = 1;
8619 }
8620 }
8621 #if CYTHON_FAST_PYCALL
8622 if (PyFunction_Check(__pyx_t_7)) {
8623 PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_n_u_part, ((PyObject *)(&PyInt_Type))};
8624 __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 189, __pyx_L1_error)
8625 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
8626 __Pyx_GOTREF(__pyx_t_6);
8627 } else
8628 #endif
8629 #if CYTHON_FAST_PYCCALL
8630 if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
8631 PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_n_u_part, ((PyObject *)(&PyInt_Type))};
8632 __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 189, __pyx_L1_error)
8633 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
8634 __Pyx_GOTREF(__pyx_t_6);
8635 } else
8636 #endif
8637 {
8638 __pyx_t_5 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 189, __pyx_L1_error)
8639 __Pyx_GOTREF(__pyx_t_5);
8640 if (__pyx_t_9) {
8641 __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9); __pyx_t_9 = NULL;
8642 }
8643 __Pyx_INCREF(__pyx_n_u_part);
8644 __Pyx_GIVEREF(__pyx_n_u_part);
8645 PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_8, __pyx_n_u_part);
8646 __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
8647 __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
8648 PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, ((PyObject *)(&PyInt_Type)));
8649 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 189, __pyx_L1_error)
8650 __Pyx_GOTREF(__pyx_t_6);
8651 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8652 }
8653 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8654 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_part, __pyx_t_6) < 0) __PYX_ERR(0, 189, __pyx_L1_error)
8655 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8656
8657 /* "borg/item.pyx":191
8658 * part = PropDict._make_property('part', int)
8659 *
8660 * def get_size(self, hardlink_masters=None, memorize=False, compressed=False, from_chunks=False): # <<<<<<<<<<<<<<
8661 * """
8662 * Determine the (uncompressed or compressed) size of this item.
8663 */
8664 __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_4borg_4item_4Item_1get_size, 0, __pyx_n_s_Item_get_size, NULL, __pyx_n_s_borg_item, __pyx_d, ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 191, __pyx_L1_error)
8665 __Pyx_GOTREF(__pyx_t_6);
8666 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_tuple__41);
8667 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_get_size, __pyx_t_6) < 0) __PYX_ERR(0, 191, __pyx_L1_error)
8668 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8669
8670 /* "borg/item.pyx":130
8671 * ChunkListEntry = namedtuple('ChunkListEntry', 'id size csize')
8672 *
8673 * class Item(PropDict): # <<<<<<<<<<<<<<
8674 * """
8675 * Item abstraction that deals with validation and the low-level details internally:
8676 */
8677 __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_Item, __pyx_t_2, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 130, __pyx_L1_error)
8678 __Pyx_GOTREF(__pyx_t_6);
8679 if (PyDict_SetItem(__pyx_d, __pyx_n_s_Item, __pyx_t_6) < 0) __PYX_ERR(0, 130, __pyx_L1_error)
8680 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8681 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8682 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8683 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8684
8685 /* "borg/item.pyx":240
8686 *
8687 *
8688 * class EncryptedKey(PropDict): # <<<<<<<<<<<<<<
8689 * """
8690 * EncryptedKey abstraction that deals with validation and the low-level details internally:
8691 */
8692 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error)
8693 __Pyx_GOTREF(__pyx_t_2);
8694 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 240, __pyx_L1_error)
8695 __Pyx_GOTREF(__pyx_t_3);
8696 __Pyx_GIVEREF(__pyx_t_2);
8697 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
8698 __pyx_t_2 = 0;
8699 __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error)
8700 __Pyx_GOTREF(__pyx_t_2);
8701 __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_3, __pyx_n_s_EncryptedKey, __pyx_n_s_EncryptedKey, (PyObject *) NULL, __pyx_n_s_borg_item, __pyx_kp_s_EncryptedKey_abstraction_that_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error)
8702 __Pyx_GOTREF(__pyx_t_1);
8703
8704 /* "borg/item.pyx":252
8705 * """
8706 *
8707 * VALID_KEYS = {'version', 'algorithm', 'iterations', 'salt', 'hash', 'data'} # str-typed keys # <<<<<<<<<<<<<<
8708 *
8709 * __slots__ = ("_dict", ) # avoid setting attributes not supported by properties
8710 */
8711 __pyx_t_6 = PySet_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 252, __pyx_L1_error)
8712 __Pyx_GOTREF(__pyx_t_6);
8713 if (PySet_Add(__pyx_t_6, __pyx_n_u_version) < 0) __PYX_ERR(0, 252, __pyx_L1_error)
8714 if (PySet_Add(__pyx_t_6, __pyx_n_u_algorithm) < 0) __PYX_ERR(0, 252, __pyx_L1_error)
8715 if (PySet_Add(__pyx_t_6, __pyx_n_u_iterations) < 0) __PYX_ERR(0, 252, __pyx_L1_error)
8716 if (PySet_Add(__pyx_t_6, __pyx_n_u_salt) < 0) __PYX_ERR(0, 252, __pyx_L1_error)
8717 if (PySet_Add(__pyx_t_6, __pyx_n_u_hash) < 0) __PYX_ERR(0, 252, __pyx_L1_error)
8718 if (PySet_Add(__pyx_t_6, __pyx_n_u_data) < 0) __PYX_ERR(0, 252, __pyx_L1_error)
8719 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_VALID_KEYS, __pyx_t_6) < 0) __PYX_ERR(0, 252, __pyx_L1_error)
8720 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8721
8722 /* "borg/item.pyx":254
8723 * VALID_KEYS = {'version', 'algorithm', 'iterations', 'salt', 'hash', 'data'} # str-typed keys
8724 *
8725 * __slots__ = ("_dict", ) # avoid setting attributes not supported by properties # <<<<<<<<<<<<<<
8726 *
8727 * version = PropDict._make_property('version', int)
8728 */
8729 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_slots, __pyx_tuple__13) < 0) __PYX_ERR(0, 254, __pyx_L1_error)
8730
8731 /* "borg/item.pyx":256
8732 * __slots__ = ("_dict", ) # avoid setting attributes not supported by properties
8733 *
8734 * version = PropDict._make_property('version', int) # <<<<<<<<<<<<<<
8735 * algorithm = PropDict._make_property('algorithm', str, encode=str.encode, decode=bytes.decode)
8736 * iterations = PropDict._make_property('iterations', int)
8737 */
8738 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 256, __pyx_L1_error)
8739 __Pyx_GOTREF(__pyx_t_7);
8740 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_make_property); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 256, __pyx_L1_error)
8741 __Pyx_GOTREF(__pyx_t_5);
8742 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8743 __pyx_t_7 = NULL;
8744 __pyx_t_8 = 0;
8745 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
8746 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
8747 if (likely(__pyx_t_7)) {
8748 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
8749 __Pyx_INCREF(__pyx_t_7);
8750 __Pyx_INCREF(function);
8751 __Pyx_DECREF_SET(__pyx_t_5, function);
8752 __pyx_t_8 = 1;
8753 }
8754 }
8755 #if CYTHON_FAST_PYCALL
8756 if (PyFunction_Check(__pyx_t_5)) {
8757 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_n_u_version, ((PyObject *)(&PyInt_Type))};
8758 __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 256, __pyx_L1_error)
8759 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
8760 __Pyx_GOTREF(__pyx_t_6);
8761 } else
8762 #endif
8763 #if CYTHON_FAST_PYCCALL
8764 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
8765 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_n_u_version, ((PyObject *)(&PyInt_Type))};
8766 __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 256, __pyx_L1_error)
8767 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
8768 __Pyx_GOTREF(__pyx_t_6);
8769 } else
8770 #endif
8771 {
8772 __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 256, __pyx_L1_error)
8773 __Pyx_GOTREF(__pyx_t_9);
8774 if (__pyx_t_7) {
8775 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
8776 }
8777 __Pyx_INCREF(__pyx_n_u_version);
8778 __Pyx_GIVEREF(__pyx_n_u_version);
8779 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_n_u_version);
8780 __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
8781 __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
8782 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, ((PyObject *)(&PyInt_Type)));
8783 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 256, __pyx_L1_error)
8784 __Pyx_GOTREF(__pyx_t_6);
8785 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8786 }
8787 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8788 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_version, __pyx_t_6) < 0) __PYX_ERR(0, 256, __pyx_L1_error)
8789 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8790
8791 /* "borg/item.pyx":257
8792 *
8793 * version = PropDict._make_property('version', int)
8794 * algorithm = PropDict._make_property('algorithm', str, encode=str.encode, decode=bytes.decode) # <<<<<<<<<<<<<<
8795 * iterations = PropDict._make_property('iterations', int)
8796 * salt = PropDict._make_property('salt', bytes)
8797 */
8798 __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 257, __pyx_L1_error)
8799 __Pyx_GOTREF(__pyx_t_6);
8800 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_make_property); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 257, __pyx_L1_error)
8801 __Pyx_GOTREF(__pyx_t_5);
8802 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8803 __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 257, __pyx_L1_error)
8804 __Pyx_GOTREF(__pyx_t_6);
8805 __Pyx_INCREF(__pyx_n_u_algorithm);
8806 __Pyx_GIVEREF(__pyx_n_u_algorithm);
8807 PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_n_u_algorithm);
8808 __Pyx_INCREF(((PyObject *)(&PyUnicode_Type)));
8809 __Pyx_GIVEREF(((PyObject *)(&PyUnicode_Type)));
8810 PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)(&PyUnicode_Type)));
8811 __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 257, __pyx_L1_error)
8812 __Pyx_GOTREF(__pyx_t_9);
8813 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyUnicode_Type)), __pyx_n_s_encode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 257, __pyx_L1_error)
8814 __Pyx_GOTREF(__pyx_t_7);
8815 if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_encode, __pyx_t_7) < 0) __PYX_ERR(0, 257, __pyx_L1_error)
8816 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8817 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyBytes_Type)), __pyx_n_s_decode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 257, __pyx_L1_error)
8818 __Pyx_GOTREF(__pyx_t_7);
8819 if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_decode, __pyx_t_7) < 0) __PYX_ERR(0, 257, __pyx_L1_error)
8820 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8821 __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 257, __pyx_L1_error)
8822 __Pyx_GOTREF(__pyx_t_7);
8823 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8824 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8825 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8826 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_algorithm, __pyx_t_7) < 0) __PYX_ERR(0, 257, __pyx_L1_error)
8827 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8828
8829 /* "borg/item.pyx":258
8830 * version = PropDict._make_property('version', int)
8831 * algorithm = PropDict._make_property('algorithm', str, encode=str.encode, decode=bytes.decode)
8832 * iterations = PropDict._make_property('iterations', int) # <<<<<<<<<<<<<<
8833 * salt = PropDict._make_property('salt', bytes)
8834 * hash = PropDict._make_property('hash', bytes)
8835 */
8836 __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 258, __pyx_L1_error)
8837 __Pyx_GOTREF(__pyx_t_9);
8838 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_make_property); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 258, __pyx_L1_error)
8839 __Pyx_GOTREF(__pyx_t_6);
8840 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8841 __pyx_t_9 = NULL;
8842 __pyx_t_8 = 0;
8843 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
8844 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
8845 if (likely(__pyx_t_9)) {
8846 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
8847 __Pyx_INCREF(__pyx_t_9);
8848 __Pyx_INCREF(function);
8849 __Pyx_DECREF_SET(__pyx_t_6, function);
8850 __pyx_t_8 = 1;
8851 }
8852 }
8853 #if CYTHON_FAST_PYCALL
8854 if (PyFunction_Check(__pyx_t_6)) {
8855 PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_n_u_iterations, ((PyObject *)(&PyInt_Type))};
8856 __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 258, __pyx_L1_error)
8857 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
8858 __Pyx_GOTREF(__pyx_t_7);
8859 } else
8860 #endif
8861 #if CYTHON_FAST_PYCCALL
8862 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
8863 PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_n_u_iterations, ((PyObject *)(&PyInt_Type))};
8864 __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 258, __pyx_L1_error)
8865 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
8866 __Pyx_GOTREF(__pyx_t_7);
8867 } else
8868 #endif
8869 {
8870 __pyx_t_5 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 258, __pyx_L1_error)
8871 __Pyx_GOTREF(__pyx_t_5);
8872 if (__pyx_t_9) {
8873 __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9); __pyx_t_9 = NULL;
8874 }
8875 __Pyx_INCREF(__pyx_n_u_iterations);
8876 __Pyx_GIVEREF(__pyx_n_u_iterations);
8877 PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_8, __pyx_n_u_iterations);
8878 __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
8879 __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
8880 PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, ((PyObject *)(&PyInt_Type)));
8881 __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 258, __pyx_L1_error)
8882 __Pyx_GOTREF(__pyx_t_7);
8883 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8884 }
8885 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8886 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_iterations, __pyx_t_7) < 0) __PYX_ERR(0, 258, __pyx_L1_error)
8887 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8888
8889 /* "borg/item.pyx":259
8890 * algorithm = PropDict._make_property('algorithm', str, encode=str.encode, decode=bytes.decode)
8891 * iterations = PropDict._make_property('iterations', int)
8892 * salt = PropDict._make_property('salt', bytes) # <<<<<<<<<<<<<<
8893 * hash = PropDict._make_property('hash', bytes)
8894 * data = PropDict._make_property('data', bytes)
8895 */
8896 __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 259, __pyx_L1_error)
8897 __Pyx_GOTREF(__pyx_t_6);
8898 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_make_property); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 259, __pyx_L1_error)
8899 __Pyx_GOTREF(__pyx_t_5);
8900 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8901 __pyx_t_6 = NULL;
8902 __pyx_t_8 = 0;
8903 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
8904 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
8905 if (likely(__pyx_t_6)) {
8906 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
8907 __Pyx_INCREF(__pyx_t_6);
8908 __Pyx_INCREF(function);
8909 __Pyx_DECREF_SET(__pyx_t_5, function);
8910 __pyx_t_8 = 1;
8911 }
8912 }
8913 #if CYTHON_FAST_PYCALL
8914 if (PyFunction_Check(__pyx_t_5)) {
8915 PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_n_u_salt, ((PyObject *)(&PyBytes_Type))};
8916 __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 259, __pyx_L1_error)
8917 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8918 __Pyx_GOTREF(__pyx_t_7);
8919 } else
8920 #endif
8921 #if CYTHON_FAST_PYCCALL
8922 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
8923 PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_n_u_salt, ((PyObject *)(&PyBytes_Type))};
8924 __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 259, __pyx_L1_error)
8925 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8926 __Pyx_GOTREF(__pyx_t_7);
8927 } else
8928 #endif
8929 {
8930 __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 259, __pyx_L1_error)
8931 __Pyx_GOTREF(__pyx_t_9);
8932 if (__pyx_t_6) {
8933 __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL;
8934 }
8935 __Pyx_INCREF(__pyx_n_u_salt);
8936 __Pyx_GIVEREF(__pyx_n_u_salt);
8937 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_n_u_salt);
8938 __Pyx_INCREF(((PyObject *)(&PyBytes_Type)));
8939 __Pyx_GIVEREF(((PyObject *)(&PyBytes_Type)));
8940 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, ((PyObject *)(&PyBytes_Type)));
8941 __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 259, __pyx_L1_error)
8942 __Pyx_GOTREF(__pyx_t_7);
8943 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8944 }
8945 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8946 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_salt, __pyx_t_7) < 0) __PYX_ERR(0, 259, __pyx_L1_error)
8947 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8948
8949 /* "borg/item.pyx":260
8950 * iterations = PropDict._make_property('iterations', int)
8951 * salt = PropDict._make_property('salt', bytes)
8952 * hash = PropDict._make_property('hash', bytes) # <<<<<<<<<<<<<<
8953 * data = PropDict._make_property('data', bytes)
8954 *
8955 */
8956 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 260, __pyx_L1_error)
8957 __Pyx_GOTREF(__pyx_t_5);
8958 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_make_property); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 260, __pyx_L1_error)
8959 __Pyx_GOTREF(__pyx_t_9);
8960 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8961 __pyx_t_5 = NULL;
8962 __pyx_t_8 = 0;
8963 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
8964 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9);
8965 if (likely(__pyx_t_5)) {
8966 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
8967 __Pyx_INCREF(__pyx_t_5);
8968 __Pyx_INCREF(function);
8969 __Pyx_DECREF_SET(__pyx_t_9, function);
8970 __pyx_t_8 = 1;
8971 }
8972 }
8973 #if CYTHON_FAST_PYCALL
8974 if (PyFunction_Check(__pyx_t_9)) {
8975 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_n_u_hash, ((PyObject *)(&PyBytes_Type))};
8976 __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 260, __pyx_L1_error)
8977 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
8978 __Pyx_GOTREF(__pyx_t_7);
8979 } else
8980 #endif
8981 #if CYTHON_FAST_PYCCALL
8982 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
8983 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_n_u_hash, ((PyObject *)(&PyBytes_Type))};
8984 __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 260, __pyx_L1_error)
8985 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
8986 __Pyx_GOTREF(__pyx_t_7);
8987 } else
8988 #endif
8989 {
8990 __pyx_t_6 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 260, __pyx_L1_error)
8991 __Pyx_GOTREF(__pyx_t_6);
8992 if (__pyx_t_5) {
8993 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
8994 }
8995 __Pyx_INCREF(__pyx_n_u_hash);
8996 __Pyx_GIVEREF(__pyx_n_u_hash);
8997 PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_hash);
8998 __Pyx_INCREF(((PyObject *)(&PyBytes_Type)));
8999 __Pyx_GIVEREF(((PyObject *)(&PyBytes_Type)));
9000 PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, ((PyObject *)(&PyBytes_Type)));
9001 __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 260, __pyx_L1_error)
9002 __Pyx_GOTREF(__pyx_t_7);
9003 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9004 }
9005 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9006 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_hash, __pyx_t_7) < 0) __PYX_ERR(0, 260, __pyx_L1_error)
9007 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9008
9009 /* "borg/item.pyx":261
9010 * salt = PropDict._make_property('salt', bytes)
9011 * hash = PropDict._make_property('hash', bytes)
9012 * data = PropDict._make_property('data', bytes) # <<<<<<<<<<<<<<
9013 *
9014 *
9015 */
9016 __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 261, __pyx_L1_error)
9017 __Pyx_GOTREF(__pyx_t_9);
9018 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_make_property); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 261, __pyx_L1_error)
9019 __Pyx_GOTREF(__pyx_t_6);
9020 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9021 __pyx_t_9 = NULL;
9022 __pyx_t_8 = 0;
9023 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
9024 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
9025 if (likely(__pyx_t_9)) {
9026 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
9027 __Pyx_INCREF(__pyx_t_9);
9028 __Pyx_INCREF(function);
9029 __Pyx_DECREF_SET(__pyx_t_6, function);
9030 __pyx_t_8 = 1;
9031 }
9032 }
9033 #if CYTHON_FAST_PYCALL
9034 if (PyFunction_Check(__pyx_t_6)) {
9035 PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_n_u_data, ((PyObject *)(&PyBytes_Type))};
9036 __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 261, __pyx_L1_error)
9037 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
9038 __Pyx_GOTREF(__pyx_t_7);
9039 } else
9040 #endif
9041 #if CYTHON_FAST_PYCCALL
9042 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
9043 PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_n_u_data, ((PyObject *)(&PyBytes_Type))};
9044 __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 261, __pyx_L1_error)
9045 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
9046 __Pyx_GOTREF(__pyx_t_7);
9047 } else
9048 #endif
9049 {
9050 __pyx_t_5 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 261, __pyx_L1_error)
9051 __Pyx_GOTREF(__pyx_t_5);
9052 if (__pyx_t_9) {
9053 __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9); __pyx_t_9 = NULL;
9054 }
9055 __Pyx_INCREF(__pyx_n_u_data);
9056 __Pyx_GIVEREF(__pyx_n_u_data);
9057 PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_8, __pyx_n_u_data);
9058 __Pyx_INCREF(((PyObject *)(&PyBytes_Type)));
9059 __Pyx_GIVEREF(((PyObject *)(&PyBytes_Type)));
9060 PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, ((PyObject *)(&PyBytes_Type)));
9061 __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 261, __pyx_L1_error)
9062 __Pyx_GOTREF(__pyx_t_7);
9063 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9064 }
9065 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9066 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_data, __pyx_t_7) < 0) __PYX_ERR(0, 261, __pyx_L1_error)
9067 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9068
9069 /* "borg/item.pyx":240
9070 *
9071 *
9072 * class EncryptedKey(PropDict): # <<<<<<<<<<<<<<
9073 * """
9074 * EncryptedKey abstraction that deals with validation and the low-level details internally:
9075 */
9076 __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_EncryptedKey, __pyx_t_3, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 240, __pyx_L1_error)
9077 __Pyx_GOTREF(__pyx_t_7);
9078 if (PyDict_SetItem(__pyx_d, __pyx_n_s_EncryptedKey, __pyx_t_7) < 0) __PYX_ERR(0, 240, __pyx_L1_error)
9079 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9080 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9081 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9082 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9083
9084 /* "borg/item.pyx":264
9085 *
9086 *
9087 * class Key(PropDict): # <<<<<<<<<<<<<<
9088 * """
9089 * Key abstraction that deals with validation and the low-level details internally:
9090 */
9091 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 264, __pyx_L1_error)
9092 __Pyx_GOTREF(__pyx_t_3);
9093 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __pyx_L1_error)
9094 __Pyx_GOTREF(__pyx_t_2);
9095 __Pyx_GIVEREF(__pyx_t_3);
9096 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
9097 __pyx_t_3 = 0;
9098 __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 264, __pyx_L1_error)
9099 __Pyx_GOTREF(__pyx_t_3);
9100 __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_2, __pyx_n_s_Key, __pyx_n_s_Key, (PyObject *) NULL, __pyx_n_s_borg_item, __pyx_kp_s_Key_abstraction_that_deals_with); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 264, __pyx_L1_error)
9101 __Pyx_GOTREF(__pyx_t_1);
9102
9103 /* "borg/item.pyx":276
9104 * """
9105 *
9106 * VALID_KEYS = {'version', 'repository_id', 'enc_key', 'enc_hmac_key', 'id_key', 'chunk_seed', 'tam_required'} # str-typed keys # <<<<<<<<<<<<<<
9107 *
9108 * __slots__ = ("_dict", ) # avoid setting attributes not supported by properties
9109 */
9110 __pyx_t_7 = PySet_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 276, __pyx_L1_error)
9111 __Pyx_GOTREF(__pyx_t_7);
9112 if (PySet_Add(__pyx_t_7, __pyx_n_u_version) < 0) __PYX_ERR(0, 276, __pyx_L1_error)
9113 if (PySet_Add(__pyx_t_7, __pyx_n_u_repository_id) < 0) __PYX_ERR(0, 276, __pyx_L1_error)
9114 if (PySet_Add(__pyx_t_7, __pyx_n_u_enc_key) < 0) __PYX_ERR(0, 276, __pyx_L1_error)
9115 if (PySet_Add(__pyx_t_7, __pyx_n_u_enc_hmac_key) < 0) __PYX_ERR(0, 276, __pyx_L1_error)
9116 if (PySet_Add(__pyx_t_7, __pyx_n_u_id_key) < 0) __PYX_ERR(0, 276, __pyx_L1_error)
9117 if (PySet_Add(__pyx_t_7, __pyx_n_u_chunk_seed) < 0) __PYX_ERR(0, 276, __pyx_L1_error)
9118 if (PySet_Add(__pyx_t_7, __pyx_n_u_tam_required) < 0) __PYX_ERR(0, 276, __pyx_L1_error)
9119 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_VALID_KEYS, __pyx_t_7) < 0) __PYX_ERR(0, 276, __pyx_L1_error)
9120 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9121
9122 /* "borg/item.pyx":278
9123 * VALID_KEYS = {'version', 'repository_id', 'enc_key', 'enc_hmac_key', 'id_key', 'chunk_seed', 'tam_required'} # str-typed keys
9124 *
9125 * __slots__ = ("_dict", ) # avoid setting attributes not supported by properties # <<<<<<<<<<<<<<
9126 *
9127 * version = PropDict._make_property('version', int)
9128 */
9129 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_slots, __pyx_tuple__13) < 0) __PYX_ERR(0, 278, __pyx_L1_error)
9130
9131 /* "borg/item.pyx":280
9132 * __slots__ = ("_dict", ) # avoid setting attributes not supported by properties
9133 *
9134 * version = PropDict._make_property('version', int) # <<<<<<<<<<<<<<
9135 * repository_id = PropDict._make_property('repository_id', bytes)
9136 * enc_key = PropDict._make_property('enc_key', bytes)
9137 */
9138 __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 280, __pyx_L1_error)
9139 __Pyx_GOTREF(__pyx_t_6);
9140 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_make_property); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 280, __pyx_L1_error)
9141 __Pyx_GOTREF(__pyx_t_5);
9142 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9143 __pyx_t_6 = NULL;
9144 __pyx_t_8 = 0;
9145 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
9146 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
9147 if (likely(__pyx_t_6)) {
9148 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
9149 __Pyx_INCREF(__pyx_t_6);
9150 __Pyx_INCREF(function);
9151 __Pyx_DECREF_SET(__pyx_t_5, function);
9152 __pyx_t_8 = 1;
9153 }
9154 }
9155 #if CYTHON_FAST_PYCALL
9156 if (PyFunction_Check(__pyx_t_5)) {
9157 PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_n_u_version, ((PyObject *)(&PyInt_Type))};
9158 __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 280, __pyx_L1_error)
9159 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9160 __Pyx_GOTREF(__pyx_t_7);
9161 } else
9162 #endif
9163 #if CYTHON_FAST_PYCCALL
9164 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
9165 PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_n_u_version, ((PyObject *)(&PyInt_Type))};
9166 __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 280, __pyx_L1_error)
9167 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9168 __Pyx_GOTREF(__pyx_t_7);
9169 } else
9170 #endif
9171 {
9172 __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 280, __pyx_L1_error)
9173 __Pyx_GOTREF(__pyx_t_9);
9174 if (__pyx_t_6) {
9175 __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL;
9176 }
9177 __Pyx_INCREF(__pyx_n_u_version);
9178 __Pyx_GIVEREF(__pyx_n_u_version);
9179 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_n_u_version);
9180 __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
9181 __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
9182 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, ((PyObject *)(&PyInt_Type)));
9183 __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 280, __pyx_L1_error)
9184 __Pyx_GOTREF(__pyx_t_7);
9185 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9186 }
9187 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9188 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_version, __pyx_t_7) < 0) __PYX_ERR(0, 280, __pyx_L1_error)
9189 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9190
9191 /* "borg/item.pyx":281
9192 *
9193 * version = PropDict._make_property('version', int)
9194 * repository_id = PropDict._make_property('repository_id', bytes) # <<<<<<<<<<<<<<
9195 * enc_key = PropDict._make_property('enc_key', bytes)
9196 * enc_hmac_key = PropDict._make_property('enc_hmac_key', bytes)
9197 */
9198 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 281, __pyx_L1_error)
9199 __Pyx_GOTREF(__pyx_t_5);
9200 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_make_property); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 281, __pyx_L1_error)
9201 __Pyx_GOTREF(__pyx_t_9);
9202 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9203 __pyx_t_5 = NULL;
9204 __pyx_t_8 = 0;
9205 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
9206 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9);
9207 if (likely(__pyx_t_5)) {
9208 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
9209 __Pyx_INCREF(__pyx_t_5);
9210 __Pyx_INCREF(function);
9211 __Pyx_DECREF_SET(__pyx_t_9, function);
9212 __pyx_t_8 = 1;
9213 }
9214 }
9215 #if CYTHON_FAST_PYCALL
9216 if (PyFunction_Check(__pyx_t_9)) {
9217 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_n_u_repository_id, ((PyObject *)(&PyBytes_Type))};
9218 __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 281, __pyx_L1_error)
9219 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9220 __Pyx_GOTREF(__pyx_t_7);
9221 } else
9222 #endif
9223 #if CYTHON_FAST_PYCCALL
9224 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
9225 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_n_u_repository_id, ((PyObject *)(&PyBytes_Type))};
9226 __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 281, __pyx_L1_error)
9227 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9228 __Pyx_GOTREF(__pyx_t_7);
9229 } else
9230 #endif
9231 {
9232 __pyx_t_6 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 281, __pyx_L1_error)
9233 __Pyx_GOTREF(__pyx_t_6);
9234 if (__pyx_t_5) {
9235 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
9236 }
9237 __Pyx_INCREF(__pyx_n_u_repository_id);
9238 __Pyx_GIVEREF(__pyx_n_u_repository_id);
9239 PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_repository_id);
9240 __Pyx_INCREF(((PyObject *)(&PyBytes_Type)));
9241 __Pyx_GIVEREF(((PyObject *)(&PyBytes_Type)));
9242 PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, ((PyObject *)(&PyBytes_Type)));
9243 __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 281, __pyx_L1_error)
9244 __Pyx_GOTREF(__pyx_t_7);
9245 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9246 }
9247 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9248 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_repository_id, __pyx_t_7) < 0) __PYX_ERR(0, 281, __pyx_L1_error)
9249 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9250
9251 /* "borg/item.pyx":282
9252 * version = PropDict._make_property('version', int)
9253 * repository_id = PropDict._make_property('repository_id', bytes)
9254 * enc_key = PropDict._make_property('enc_key', bytes) # <<<<<<<<<<<<<<
9255 * enc_hmac_key = PropDict._make_property('enc_hmac_key', bytes)
9256 * id_key = PropDict._make_property('id_key', bytes)
9257 */
9258 __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 282, __pyx_L1_error)
9259 __Pyx_GOTREF(__pyx_t_9);
9260 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_make_property); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 282, __pyx_L1_error)
9261 __Pyx_GOTREF(__pyx_t_6);
9262 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9263 __pyx_t_9 = NULL;
9264 __pyx_t_8 = 0;
9265 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
9266 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
9267 if (likely(__pyx_t_9)) {
9268 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
9269 __Pyx_INCREF(__pyx_t_9);
9270 __Pyx_INCREF(function);
9271 __Pyx_DECREF_SET(__pyx_t_6, function);
9272 __pyx_t_8 = 1;
9273 }
9274 }
9275 #if CYTHON_FAST_PYCALL
9276 if (PyFunction_Check(__pyx_t_6)) {
9277 PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_n_u_enc_key, ((PyObject *)(&PyBytes_Type))};
9278 __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 282, __pyx_L1_error)
9279 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
9280 __Pyx_GOTREF(__pyx_t_7);
9281 } else
9282 #endif
9283 #if CYTHON_FAST_PYCCALL
9284 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
9285 PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_n_u_enc_key, ((PyObject *)(&PyBytes_Type))};
9286 __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 282, __pyx_L1_error)
9287 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
9288 __Pyx_GOTREF(__pyx_t_7);
9289 } else
9290 #endif
9291 {
9292 __pyx_t_5 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 282, __pyx_L1_error)
9293 __Pyx_GOTREF(__pyx_t_5);
9294 if (__pyx_t_9) {
9295 __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9); __pyx_t_9 = NULL;
9296 }
9297 __Pyx_INCREF(__pyx_n_u_enc_key);
9298 __Pyx_GIVEREF(__pyx_n_u_enc_key);
9299 PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_8, __pyx_n_u_enc_key);
9300 __Pyx_INCREF(((PyObject *)(&PyBytes_Type)));
9301 __Pyx_GIVEREF(((PyObject *)(&PyBytes_Type)));
9302 PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, ((PyObject *)(&PyBytes_Type)));
9303 __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 282, __pyx_L1_error)
9304 __Pyx_GOTREF(__pyx_t_7);
9305 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9306 }
9307 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9308 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_enc_key, __pyx_t_7) < 0) __PYX_ERR(0, 282, __pyx_L1_error)
9309 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9310
9311 /* "borg/item.pyx":283
9312 * repository_id = PropDict._make_property('repository_id', bytes)
9313 * enc_key = PropDict._make_property('enc_key', bytes)
9314 * enc_hmac_key = PropDict._make_property('enc_hmac_key', bytes) # <<<<<<<<<<<<<<
9315 * id_key = PropDict._make_property('id_key', bytes)
9316 * chunk_seed = PropDict._make_property('chunk_seed', int)
9317 */
9318 __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 283, __pyx_L1_error)
9319 __Pyx_GOTREF(__pyx_t_6);
9320 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_make_property); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 283, __pyx_L1_error)
9321 __Pyx_GOTREF(__pyx_t_5);
9322 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9323 __pyx_t_6 = NULL;
9324 __pyx_t_8 = 0;
9325 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
9326 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
9327 if (likely(__pyx_t_6)) {
9328 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
9329 __Pyx_INCREF(__pyx_t_6);
9330 __Pyx_INCREF(function);
9331 __Pyx_DECREF_SET(__pyx_t_5, function);
9332 __pyx_t_8 = 1;
9333 }
9334 }
9335 #if CYTHON_FAST_PYCALL
9336 if (PyFunction_Check(__pyx_t_5)) {
9337 PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_n_u_enc_hmac_key, ((PyObject *)(&PyBytes_Type))};
9338 __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 283, __pyx_L1_error)
9339 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9340 __Pyx_GOTREF(__pyx_t_7);
9341 } else
9342 #endif
9343 #if CYTHON_FAST_PYCCALL
9344 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
9345 PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_n_u_enc_hmac_key, ((PyObject *)(&PyBytes_Type))};
9346 __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 283, __pyx_L1_error)
9347 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9348 __Pyx_GOTREF(__pyx_t_7);
9349 } else
9350 #endif
9351 {
9352 __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 283, __pyx_L1_error)
9353 __Pyx_GOTREF(__pyx_t_9);
9354 if (__pyx_t_6) {
9355 __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL;
9356 }
9357 __Pyx_INCREF(__pyx_n_u_enc_hmac_key);
9358 __Pyx_GIVEREF(__pyx_n_u_enc_hmac_key);
9359 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_n_u_enc_hmac_key);
9360 __Pyx_INCREF(((PyObject *)(&PyBytes_Type)));
9361 __Pyx_GIVEREF(((PyObject *)(&PyBytes_Type)));
9362 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, ((PyObject *)(&PyBytes_Type)));
9363 __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 283, __pyx_L1_error)
9364 __Pyx_GOTREF(__pyx_t_7);
9365 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9366 }
9367 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9368 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_enc_hmac_key, __pyx_t_7) < 0) __PYX_ERR(0, 283, __pyx_L1_error)
9369 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9370
9371 /* "borg/item.pyx":284
9372 * enc_key = PropDict._make_property('enc_key', bytes)
9373 * enc_hmac_key = PropDict._make_property('enc_hmac_key', bytes)
9374 * id_key = PropDict._make_property('id_key', bytes) # <<<<<<<<<<<<<<
9375 * chunk_seed = PropDict._make_property('chunk_seed', int)
9376 * tam_required = PropDict._make_property('tam_required', bool)
9377 */
9378 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 284, __pyx_L1_error)
9379 __Pyx_GOTREF(__pyx_t_5);
9380 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_make_property); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 284, __pyx_L1_error)
9381 __Pyx_GOTREF(__pyx_t_9);
9382 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9383 __pyx_t_5 = NULL;
9384 __pyx_t_8 = 0;
9385 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
9386 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9);
9387 if (likely(__pyx_t_5)) {
9388 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
9389 __Pyx_INCREF(__pyx_t_5);
9390 __Pyx_INCREF(function);
9391 __Pyx_DECREF_SET(__pyx_t_9, function);
9392 __pyx_t_8 = 1;
9393 }
9394 }
9395 #if CYTHON_FAST_PYCALL
9396 if (PyFunction_Check(__pyx_t_9)) {
9397 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_n_u_id_key, ((PyObject *)(&PyBytes_Type))};
9398 __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 284, __pyx_L1_error)
9399 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9400 __Pyx_GOTREF(__pyx_t_7);
9401 } else
9402 #endif
9403 #if CYTHON_FAST_PYCCALL
9404 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
9405 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_n_u_id_key, ((PyObject *)(&PyBytes_Type))};
9406 __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 284, __pyx_L1_error)
9407 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9408 __Pyx_GOTREF(__pyx_t_7);
9409 } else
9410 #endif
9411 {
9412 __pyx_t_6 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 284, __pyx_L1_error)
9413 __Pyx_GOTREF(__pyx_t_6);
9414 if (__pyx_t_5) {
9415 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
9416 }
9417 __Pyx_INCREF(__pyx_n_u_id_key);
9418 __Pyx_GIVEREF(__pyx_n_u_id_key);
9419 PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_id_key);
9420 __Pyx_INCREF(((PyObject *)(&PyBytes_Type)));
9421 __Pyx_GIVEREF(((PyObject *)(&PyBytes_Type)));
9422 PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, ((PyObject *)(&PyBytes_Type)));
9423 __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 284, __pyx_L1_error)
9424 __Pyx_GOTREF(__pyx_t_7);
9425 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9426 }
9427 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9428 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_id_key, __pyx_t_7) < 0) __PYX_ERR(0, 284, __pyx_L1_error)
9429 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9430
9431 /* "borg/item.pyx":285
9432 * enc_hmac_key = PropDict._make_property('enc_hmac_key', bytes)
9433 * id_key = PropDict._make_property('id_key', bytes)
9434 * chunk_seed = PropDict._make_property('chunk_seed', int) # <<<<<<<<<<<<<<
9435 * tam_required = PropDict._make_property('tam_required', bool)
9436 *
9437 */
9438 __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 285, __pyx_L1_error)
9439 __Pyx_GOTREF(__pyx_t_9);
9440 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_make_property); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 285, __pyx_L1_error)
9441 __Pyx_GOTREF(__pyx_t_6);
9442 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9443 __pyx_t_9 = NULL;
9444 __pyx_t_8 = 0;
9445 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
9446 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
9447 if (likely(__pyx_t_9)) {
9448 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
9449 __Pyx_INCREF(__pyx_t_9);
9450 __Pyx_INCREF(function);
9451 __Pyx_DECREF_SET(__pyx_t_6, function);
9452 __pyx_t_8 = 1;
9453 }
9454 }
9455 #if CYTHON_FAST_PYCALL
9456 if (PyFunction_Check(__pyx_t_6)) {
9457 PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_n_u_chunk_seed, ((PyObject *)(&PyInt_Type))};
9458 __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 285, __pyx_L1_error)
9459 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
9460 __Pyx_GOTREF(__pyx_t_7);
9461 } else
9462 #endif
9463 #if CYTHON_FAST_PYCCALL
9464 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
9465 PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_n_u_chunk_seed, ((PyObject *)(&PyInt_Type))};
9466 __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 285, __pyx_L1_error)
9467 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
9468 __Pyx_GOTREF(__pyx_t_7);
9469 } else
9470 #endif
9471 {
9472 __pyx_t_5 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 285, __pyx_L1_error)
9473 __Pyx_GOTREF(__pyx_t_5);
9474 if (__pyx_t_9) {
9475 __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9); __pyx_t_9 = NULL;
9476 }
9477 __Pyx_INCREF(__pyx_n_u_chunk_seed);
9478 __Pyx_GIVEREF(__pyx_n_u_chunk_seed);
9479 PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_8, __pyx_n_u_chunk_seed);
9480 __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
9481 __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
9482 PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, ((PyObject *)(&PyInt_Type)));
9483 __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 285, __pyx_L1_error)
9484 __Pyx_GOTREF(__pyx_t_7);
9485 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9486 }
9487 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9488 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_chunk_seed, __pyx_t_7) < 0) __PYX_ERR(0, 285, __pyx_L1_error)
9489 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9490
9491 /* "borg/item.pyx":286
9492 * id_key = PropDict._make_property('id_key', bytes)
9493 * chunk_seed = PropDict._make_property('chunk_seed', int)
9494 * tam_required = PropDict._make_property('tam_required', bool) # <<<<<<<<<<<<<<
9495 *
9496 *
9497 */
9498 __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 286, __pyx_L1_error)
9499 __Pyx_GOTREF(__pyx_t_6);
9500 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_make_property); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 286, __pyx_L1_error)
9501 __Pyx_GOTREF(__pyx_t_5);
9502 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9503 __pyx_t_6 = NULL;
9504 __pyx_t_8 = 0;
9505 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
9506 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
9507 if (likely(__pyx_t_6)) {
9508 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
9509 __Pyx_INCREF(__pyx_t_6);
9510 __Pyx_INCREF(function);
9511 __Pyx_DECREF_SET(__pyx_t_5, function);
9512 __pyx_t_8 = 1;
9513 }
9514 }
9515 #if CYTHON_FAST_PYCALL
9516 if (PyFunction_Check(__pyx_t_5)) {
9517 PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_n_u_tam_required, ((PyObject*)&PyBool_Type)};
9518 __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 286, __pyx_L1_error)
9519 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9520 __Pyx_GOTREF(__pyx_t_7);
9521 } else
9522 #endif
9523 #if CYTHON_FAST_PYCCALL
9524 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
9525 PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_n_u_tam_required, ((PyObject*)&PyBool_Type)};
9526 __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 286, __pyx_L1_error)
9527 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9528 __Pyx_GOTREF(__pyx_t_7);
9529 } else
9530 #endif
9531 {
9532 __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 286, __pyx_L1_error)
9533 __Pyx_GOTREF(__pyx_t_9);
9534 if (__pyx_t_6) {
9535 __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL;
9536 }
9537 __Pyx_INCREF(__pyx_n_u_tam_required);
9538 __Pyx_GIVEREF(__pyx_n_u_tam_required);
9539 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_n_u_tam_required);
9540 __Pyx_INCREF(((PyObject*)&PyBool_Type));
9541 __Pyx_GIVEREF(((PyObject*)&PyBool_Type));
9542 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, ((PyObject*)&PyBool_Type));
9543 __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 286, __pyx_L1_error)
9544 __Pyx_GOTREF(__pyx_t_7);
9545 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9546 }
9547 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9548 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_tam_required, __pyx_t_7) < 0) __PYX_ERR(0, 286, __pyx_L1_error)
9549 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9550
9551 /* "borg/item.pyx":264
9552 *
9553 *
9554 * class Key(PropDict): # <<<<<<<<<<<<<<
9555 * """
9556 * Key abstraction that deals with validation and the low-level details internally:
9557 */
9558 __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_Key, __pyx_t_2, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 264, __pyx_L1_error)
9559 __Pyx_GOTREF(__pyx_t_7);
9560 if (PyDict_SetItem(__pyx_d, __pyx_n_s_Key, __pyx_t_7) < 0) __PYX_ERR(0, 264, __pyx_L1_error)
9561 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9562 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9563 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9564 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9565
9566 /* "borg/item.pyx":289
9567 *
9568 *
9569 * class ArchiveItem(PropDict): # <<<<<<<<<<<<<<
9570 * """
9571 * ArchiveItem abstraction that deals with validation and the low-level details internally:
9572 */
9573 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 289, __pyx_L1_error)
9574 __Pyx_GOTREF(__pyx_t_2);
9575 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 289, __pyx_L1_error)
9576 __Pyx_GOTREF(__pyx_t_3);
9577 __Pyx_GIVEREF(__pyx_t_2);
9578 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
9579 __pyx_t_2 = 0;
9580 __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 289, __pyx_L1_error)
9581 __Pyx_GOTREF(__pyx_t_2);
9582 __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_3, __pyx_n_s_ArchiveItem, __pyx_n_s_ArchiveItem, (PyObject *) NULL, __pyx_n_s_borg_item, __pyx_kp_s_ArchiveItem_abstraction_that_de); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 289, __pyx_L1_error)
9583 __Pyx_GOTREF(__pyx_t_1);
9584
9585 /* "borg/item.pyx":301
9586 * """
9587 *
9588 * VALID_KEYS = ARCHIVE_KEYS # str-typed keys # <<<<<<<<<<<<<<
9589 *
9590 * __slots__ = ("_dict", ) # avoid setting attributes not supported by properties
9591 */
9592 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ARCHIVE_KEYS); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 301, __pyx_L1_error)
9593 __Pyx_GOTREF(__pyx_t_7);
9594 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_VALID_KEYS, __pyx_t_7) < 0) __PYX_ERR(0, 301, __pyx_L1_error)
9595 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9596
9597 /* "borg/item.pyx":303
9598 * VALID_KEYS = ARCHIVE_KEYS # str-typed keys
9599 *
9600 * __slots__ = ("_dict", ) # avoid setting attributes not supported by properties # <<<<<<<<<<<<<<
9601 *
9602 * version = PropDict._make_property('version', int)
9603 */
9604 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_slots, __pyx_tuple__13) < 0) __PYX_ERR(0, 303, __pyx_L1_error)
9605
9606 /* "borg/item.pyx":305
9607 * __slots__ = ("_dict", ) # avoid setting attributes not supported by properties
9608 *
9609 * version = PropDict._make_property('version', int) # <<<<<<<<<<<<<<
9610 * name = PropDict._make_property('name', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode)
9611 * items = PropDict._make_property('items', list)
9612 */
9613 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 305, __pyx_L1_error)
9614 __Pyx_GOTREF(__pyx_t_5);
9615 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_make_property); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 305, __pyx_L1_error)
9616 __Pyx_GOTREF(__pyx_t_9);
9617 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9618 __pyx_t_5 = NULL;
9619 __pyx_t_8 = 0;
9620 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
9621 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9);
9622 if (likely(__pyx_t_5)) {
9623 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
9624 __Pyx_INCREF(__pyx_t_5);
9625 __Pyx_INCREF(function);
9626 __Pyx_DECREF_SET(__pyx_t_9, function);
9627 __pyx_t_8 = 1;
9628 }
9629 }
9630 #if CYTHON_FAST_PYCALL
9631 if (PyFunction_Check(__pyx_t_9)) {
9632 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_n_u_version, ((PyObject *)(&PyInt_Type))};
9633 __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 305, __pyx_L1_error)
9634 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9635 __Pyx_GOTREF(__pyx_t_7);
9636 } else
9637 #endif
9638 #if CYTHON_FAST_PYCCALL
9639 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
9640 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_n_u_version, ((PyObject *)(&PyInt_Type))};
9641 __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 305, __pyx_L1_error)
9642 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9643 __Pyx_GOTREF(__pyx_t_7);
9644 } else
9645 #endif
9646 {
9647 __pyx_t_6 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 305, __pyx_L1_error)
9648 __Pyx_GOTREF(__pyx_t_6);
9649 if (__pyx_t_5) {
9650 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
9651 }
9652 __Pyx_INCREF(__pyx_n_u_version);
9653 __Pyx_GIVEREF(__pyx_n_u_version);
9654 PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_version);
9655 __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
9656 __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
9657 PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, ((PyObject *)(&PyInt_Type)));
9658 __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 305, __pyx_L1_error)
9659 __Pyx_GOTREF(__pyx_t_7);
9660 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9661 }
9662 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9663 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_version, __pyx_t_7) < 0) __PYX_ERR(0, 305, __pyx_L1_error)
9664 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9665
9666 /* "borg/item.pyx":306
9667 *
9668 * version = PropDict._make_property('version', int)
9669 * name = PropDict._make_property('name', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) # <<<<<<<<<<<<<<
9670 * items = PropDict._make_property('items', list)
9671 * cmdline = PropDict._make_property('cmdline', list) # list of s-e-str
9672 */
9673 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 306, __pyx_L1_error)
9674 __Pyx_GOTREF(__pyx_t_7);
9675 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_make_property); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 306, __pyx_L1_error)
9676 __Pyx_GOTREF(__pyx_t_9);
9677 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9678 __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 306, __pyx_L1_error)
9679 __Pyx_GOTREF(__pyx_t_7);
9680 __Pyx_INCREF(__pyx_n_u_name_2);
9681 __Pyx_GIVEREF(__pyx_n_u_name_2);
9682 PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_n_u_name_2);
9683 __Pyx_INCREF(((PyObject *)(&PyUnicode_Type)));
9684 __Pyx_GIVEREF(((PyObject *)(&PyUnicode_Type)));
9685 PyTuple_SET_ITEM(__pyx_t_7, 1, ((PyObject *)(&PyUnicode_Type)));
9686 __Pyx_INCREF(__pyx_kp_u_surrogate_escaped_str);
9687 __Pyx_GIVEREF(__pyx_kp_u_surrogate_escaped_str);
9688 PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_kp_u_surrogate_escaped_str);
9689 __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 306, __pyx_L1_error)
9690 __Pyx_GOTREF(__pyx_t_6);
9691 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_safe_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 306, __pyx_L1_error)
9692 __Pyx_GOTREF(__pyx_t_5);
9693 if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_encode, __pyx_t_5) < 0) __PYX_ERR(0, 306, __pyx_L1_error)
9694 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9695 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_safe_decode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 306, __pyx_L1_error)
9696 __Pyx_GOTREF(__pyx_t_5);
9697 if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_decode, __pyx_t_5) < 0) __PYX_ERR(0, 306, __pyx_L1_error)
9698 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9699 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 306, __pyx_L1_error)
9700 __Pyx_GOTREF(__pyx_t_5);
9701 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9702 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9703 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9704 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_name_2, __pyx_t_5) < 0) __PYX_ERR(0, 306, __pyx_L1_error)
9705 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9706
9707 /* "borg/item.pyx":307
9708 * version = PropDict._make_property('version', int)
9709 * name = PropDict._make_property('name', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode)
9710 * items = PropDict._make_property('items', list) # <<<<<<<<<<<<<<
9711 * cmdline = PropDict._make_property('cmdline', list) # list of s-e-str
9712 * hostname = PropDict._make_property('hostname', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode)
9713 */
9714 __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 307, __pyx_L1_error)
9715 __Pyx_GOTREF(__pyx_t_6);
9716 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_make_property); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 307, __pyx_L1_error)
9717 __Pyx_GOTREF(__pyx_t_7);
9718 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9719 __pyx_t_6 = NULL;
9720 __pyx_t_8 = 0;
9721 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
9722 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
9723 if (likely(__pyx_t_6)) {
9724 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
9725 __Pyx_INCREF(__pyx_t_6);
9726 __Pyx_INCREF(function);
9727 __Pyx_DECREF_SET(__pyx_t_7, function);
9728 __pyx_t_8 = 1;
9729 }
9730 }
9731 #if CYTHON_FAST_PYCALL
9732 if (PyFunction_Check(__pyx_t_7)) {
9733 PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_n_u_items, ((PyObject *)(&PyList_Type))};
9734 __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 307, __pyx_L1_error)
9735 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9736 __Pyx_GOTREF(__pyx_t_5);
9737 } else
9738 #endif
9739 #if CYTHON_FAST_PYCCALL
9740 if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
9741 PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_n_u_items, ((PyObject *)(&PyList_Type))};
9742 __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 307, __pyx_L1_error)
9743 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9744 __Pyx_GOTREF(__pyx_t_5);
9745 } else
9746 #endif
9747 {
9748 __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 307, __pyx_L1_error)
9749 __Pyx_GOTREF(__pyx_t_9);
9750 if (__pyx_t_6) {
9751 __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL;
9752 }
9753 __Pyx_INCREF(__pyx_n_u_items);
9754 __Pyx_GIVEREF(__pyx_n_u_items);
9755 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_n_u_items);
9756 __Pyx_INCREF(((PyObject *)(&PyList_Type)));
9757 __Pyx_GIVEREF(((PyObject *)(&PyList_Type)));
9758 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, ((PyObject *)(&PyList_Type)));
9759 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 307, __pyx_L1_error)
9760 __Pyx_GOTREF(__pyx_t_5);
9761 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9762 }
9763 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9764 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_items, __pyx_t_5) < 0) __PYX_ERR(0, 307, __pyx_L1_error)
9765 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9766
9767 /* "borg/item.pyx":308
9768 * name = PropDict._make_property('name', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode)
9769 * items = PropDict._make_property('items', list)
9770 * cmdline = PropDict._make_property('cmdline', list) # list of s-e-str # <<<<<<<<<<<<<<
9771 * hostname = PropDict._make_property('hostname', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode)
9772 * username = PropDict._make_property('username', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode)
9773 */
9774 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 308, __pyx_L1_error)
9775 __Pyx_GOTREF(__pyx_t_7);
9776 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_make_property); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 308, __pyx_L1_error)
9777 __Pyx_GOTREF(__pyx_t_9);
9778 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9779 __pyx_t_7 = NULL;
9780 __pyx_t_8 = 0;
9781 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
9782 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9);
9783 if (likely(__pyx_t_7)) {
9784 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
9785 __Pyx_INCREF(__pyx_t_7);
9786 __Pyx_INCREF(function);
9787 __Pyx_DECREF_SET(__pyx_t_9, function);
9788 __pyx_t_8 = 1;
9789 }
9790 }
9791 #if CYTHON_FAST_PYCALL
9792 if (PyFunction_Check(__pyx_t_9)) {
9793 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_n_u_cmdline, ((PyObject *)(&PyList_Type))};
9794 __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 308, __pyx_L1_error)
9795 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
9796 __Pyx_GOTREF(__pyx_t_5);
9797 } else
9798 #endif
9799 #if CYTHON_FAST_PYCCALL
9800 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
9801 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_n_u_cmdline, ((PyObject *)(&PyList_Type))};
9802 __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 308, __pyx_L1_error)
9803 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
9804 __Pyx_GOTREF(__pyx_t_5);
9805 } else
9806 #endif
9807 {
9808 __pyx_t_6 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 308, __pyx_L1_error)
9809 __Pyx_GOTREF(__pyx_t_6);
9810 if (__pyx_t_7) {
9811 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = NULL;
9812 }
9813 __Pyx_INCREF(__pyx_n_u_cmdline);
9814 __Pyx_GIVEREF(__pyx_n_u_cmdline);
9815 PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_cmdline);
9816 __Pyx_INCREF(((PyObject *)(&PyList_Type)));
9817 __Pyx_GIVEREF(((PyObject *)(&PyList_Type)));
9818 PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, ((PyObject *)(&PyList_Type)));
9819 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 308, __pyx_L1_error)
9820 __Pyx_GOTREF(__pyx_t_5);
9821 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9822 }
9823 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9824 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_cmdline, __pyx_t_5) < 0) __PYX_ERR(0, 308, __pyx_L1_error)
9825 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9826
9827 /* "borg/item.pyx":309
9828 * items = PropDict._make_property('items', list)
9829 * cmdline = PropDict._make_property('cmdline', list) # list of s-e-str
9830 * hostname = PropDict._make_property('hostname', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) # <<<<<<<<<<<<<<
9831 * username = PropDict._make_property('username', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode)
9832 * time = PropDict._make_property('time', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode)
9833 */
9834 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 309, __pyx_L1_error)
9835 __Pyx_GOTREF(__pyx_t_5);
9836 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_make_property); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 309, __pyx_L1_error)
9837 __Pyx_GOTREF(__pyx_t_9);
9838 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9839 __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 309, __pyx_L1_error)
9840 __Pyx_GOTREF(__pyx_t_5);
9841 __Pyx_INCREF(__pyx_n_u_hostname);
9842 __Pyx_GIVEREF(__pyx_n_u_hostname);
9843 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_n_u_hostname);
9844 __Pyx_INCREF(((PyObject *)(&PyUnicode_Type)));
9845 __Pyx_GIVEREF(((PyObject *)(&PyUnicode_Type)));
9846 PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)(&PyUnicode_Type)));
9847 __Pyx_INCREF(__pyx_kp_u_surrogate_escaped_str);
9848 __Pyx_GIVEREF(__pyx_kp_u_surrogate_escaped_str);
9849 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u_surrogate_escaped_str);
9850 __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 309, __pyx_L1_error)
9851 __Pyx_GOTREF(__pyx_t_6);
9852 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_safe_encode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 309, __pyx_L1_error)
9853 __Pyx_GOTREF(__pyx_t_7);
9854 if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_encode, __pyx_t_7) < 0) __PYX_ERR(0, 309, __pyx_L1_error)
9855 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9856 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_safe_decode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 309, __pyx_L1_error)
9857 __Pyx_GOTREF(__pyx_t_7);
9858 if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_decode, __pyx_t_7) < 0) __PYX_ERR(0, 309, __pyx_L1_error)
9859 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9860 __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 309, __pyx_L1_error)
9861 __Pyx_GOTREF(__pyx_t_7);
9862 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9863 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9864 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9865 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_hostname, __pyx_t_7) < 0) __PYX_ERR(0, 309, __pyx_L1_error)
9866 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9867
9868 /* "borg/item.pyx":310
9869 * cmdline = PropDict._make_property('cmdline', list) # list of s-e-str
9870 * hostname = PropDict._make_property('hostname', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode)
9871 * username = PropDict._make_property('username', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) # <<<<<<<<<<<<<<
9872 * time = PropDict._make_property('time', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode)
9873 * time_end = PropDict._make_property('time_end', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode)
9874 */
9875 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 310, __pyx_L1_error)
9876 __Pyx_GOTREF(__pyx_t_7);
9877 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_make_property); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 310, __pyx_L1_error)
9878 __Pyx_GOTREF(__pyx_t_6);
9879 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9880 __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 310, __pyx_L1_error)
9881 __Pyx_GOTREF(__pyx_t_7);
9882 __Pyx_INCREF(__pyx_n_u_username);
9883 __Pyx_GIVEREF(__pyx_n_u_username);
9884 PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_n_u_username);
9885 __Pyx_INCREF(((PyObject *)(&PyUnicode_Type)));
9886 __Pyx_GIVEREF(((PyObject *)(&PyUnicode_Type)));
9887 PyTuple_SET_ITEM(__pyx_t_7, 1, ((PyObject *)(&PyUnicode_Type)));
9888 __Pyx_INCREF(__pyx_kp_u_surrogate_escaped_str);
9889 __Pyx_GIVEREF(__pyx_kp_u_surrogate_escaped_str);
9890 PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_kp_u_surrogate_escaped_str);
9891 __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 310, __pyx_L1_error)
9892 __Pyx_GOTREF(__pyx_t_5);
9893 __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_safe_encode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 310, __pyx_L1_error)
9894 __Pyx_GOTREF(__pyx_t_9);
9895 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_encode, __pyx_t_9) < 0) __PYX_ERR(0, 310, __pyx_L1_error)
9896 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9897 __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_safe_decode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 310, __pyx_L1_error)
9898 __Pyx_GOTREF(__pyx_t_9);
9899 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_decode, __pyx_t_9) < 0) __PYX_ERR(0, 310, __pyx_L1_error)
9900 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9901 __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 310, __pyx_L1_error)
9902 __Pyx_GOTREF(__pyx_t_9);
9903 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9904 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9905 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9906 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_username, __pyx_t_9) < 0) __PYX_ERR(0, 310, __pyx_L1_error)
9907 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9908
9909 /* "borg/item.pyx":311
9910 * hostname = PropDict._make_property('hostname', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode)
9911 * username = PropDict._make_property('username', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode)
9912 * time = PropDict._make_property('time', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) # <<<<<<<<<<<<<<
9913 * time_end = PropDict._make_property('time_end', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode)
9914 * comment = PropDict._make_property('comment', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode)
9915 */
9916 __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 311, __pyx_L1_error)
9917 __Pyx_GOTREF(__pyx_t_9);
9918 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_make_property); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 311, __pyx_L1_error)
9919 __Pyx_GOTREF(__pyx_t_5);
9920 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9921 __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 311, __pyx_L1_error)
9922 __Pyx_GOTREF(__pyx_t_9);
9923 __Pyx_INCREF(__pyx_n_u_time);
9924 __Pyx_GIVEREF(__pyx_n_u_time);
9925 PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_n_u_time);
9926 __Pyx_INCREF(((PyObject *)(&PyUnicode_Type)));
9927 __Pyx_GIVEREF(((PyObject *)(&PyUnicode_Type)));
9928 PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)(&PyUnicode_Type)));
9929 __Pyx_INCREF(__pyx_kp_u_surrogate_escaped_str);
9930 __Pyx_GIVEREF(__pyx_kp_u_surrogate_escaped_str);
9931 PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_kp_u_surrogate_escaped_str);
9932 __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 311, __pyx_L1_error)
9933 __Pyx_GOTREF(__pyx_t_7);
9934 __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_safe_encode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 311, __pyx_L1_error)
9935 __Pyx_GOTREF(__pyx_t_6);
9936 if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_encode, __pyx_t_6) < 0) __PYX_ERR(0, 311, __pyx_L1_error)
9937 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9938 __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_safe_decode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 311, __pyx_L1_error)
9939 __Pyx_GOTREF(__pyx_t_6);
9940 if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_decode, __pyx_t_6) < 0) __PYX_ERR(0, 311, __pyx_L1_error)
9941 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9942 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 311, __pyx_L1_error)
9943 __Pyx_GOTREF(__pyx_t_6);
9944 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9945 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9946 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9947 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_time, __pyx_t_6) < 0) __PYX_ERR(0, 311, __pyx_L1_error)
9948 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9949
9950 /* "borg/item.pyx":312
9951 * username = PropDict._make_property('username', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode)
9952 * time = PropDict._make_property('time', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode)
9953 * time_end = PropDict._make_property('time_end', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) # <<<<<<<<<<<<<<
9954 * comment = PropDict._make_property('comment', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode)
9955 * chunker_params = PropDict._make_property('chunker_params', tuple)
9956 */
9957 __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 312, __pyx_L1_error)
9958 __Pyx_GOTREF(__pyx_t_6);
9959 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_make_property); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 312, __pyx_L1_error)
9960 __Pyx_GOTREF(__pyx_t_7);
9961 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9962 __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 312, __pyx_L1_error)
9963 __Pyx_GOTREF(__pyx_t_6);
9964 __Pyx_INCREF(__pyx_n_u_time_end);
9965 __Pyx_GIVEREF(__pyx_n_u_time_end);
9966 PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_n_u_time_end);
9967 __Pyx_INCREF(((PyObject *)(&PyUnicode_Type)));
9968 __Pyx_GIVEREF(((PyObject *)(&PyUnicode_Type)));
9969 PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)(&PyUnicode_Type)));
9970 __Pyx_INCREF(__pyx_kp_u_surrogate_escaped_str);
9971 __Pyx_GIVEREF(__pyx_kp_u_surrogate_escaped_str);
9972 PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_kp_u_surrogate_escaped_str);
9973 __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 312, __pyx_L1_error)
9974 __Pyx_GOTREF(__pyx_t_9);
9975 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_safe_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 312, __pyx_L1_error)
9976 __Pyx_GOTREF(__pyx_t_5);
9977 if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_encode, __pyx_t_5) < 0) __PYX_ERR(0, 312, __pyx_L1_error)
9978 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9979 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_safe_decode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 312, __pyx_L1_error)
9980 __Pyx_GOTREF(__pyx_t_5);
9981 if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_decode, __pyx_t_5) < 0) __PYX_ERR(0, 312, __pyx_L1_error)
9982 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9983 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 312, __pyx_L1_error)
9984 __Pyx_GOTREF(__pyx_t_5);
9985 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9986 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9987 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9988 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_time_end, __pyx_t_5) < 0) __PYX_ERR(0, 312, __pyx_L1_error)
9989 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9990
9991 /* "borg/item.pyx":313
9992 * time = PropDict._make_property('time', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode)
9993 * time_end = PropDict._make_property('time_end', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode)
9994 * comment = PropDict._make_property('comment', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) # <<<<<<<<<<<<<<
9995 * chunker_params = PropDict._make_property('chunker_params', tuple)
9996 * recreate_cmdline = PropDict._make_property('recreate_cmdline', list) # list of s-e-str
9997 */
9998 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 313, __pyx_L1_error)
9999 __Pyx_GOTREF(__pyx_t_5);
10000 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_make_property); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 313, __pyx_L1_error)
10001 __Pyx_GOTREF(__pyx_t_9);
10002 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10003 __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 313, __pyx_L1_error)
10004 __Pyx_GOTREF(__pyx_t_5);
10005 __Pyx_INCREF(__pyx_n_u_comment);
10006 __Pyx_GIVEREF(__pyx_n_u_comment);
10007 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_n_u_comment);
10008 __Pyx_INCREF(((PyObject *)(&PyUnicode_Type)));
10009 __Pyx_GIVEREF(((PyObject *)(&PyUnicode_Type)));
10010 PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)(&PyUnicode_Type)));
10011 __Pyx_INCREF(__pyx_kp_u_surrogate_escaped_str);
10012 __Pyx_GIVEREF(__pyx_kp_u_surrogate_escaped_str);
10013 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u_surrogate_escaped_str);
10014 __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 313, __pyx_L1_error)
10015 __Pyx_GOTREF(__pyx_t_6);
10016 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_safe_encode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 313, __pyx_L1_error)
10017 __Pyx_GOTREF(__pyx_t_7);
10018 if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_encode, __pyx_t_7) < 0) __PYX_ERR(0, 313, __pyx_L1_error)
10019 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10020 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_safe_decode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 313, __pyx_L1_error)
10021 __Pyx_GOTREF(__pyx_t_7);
10022 if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_decode, __pyx_t_7) < 0) __PYX_ERR(0, 313, __pyx_L1_error)
10023 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10024 __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 313, __pyx_L1_error)
10025 __Pyx_GOTREF(__pyx_t_7);
10026 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
10027 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10028 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10029 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_comment, __pyx_t_7) < 0) __PYX_ERR(0, 313, __pyx_L1_error)
10030 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10031
10032 /* "borg/item.pyx":314
10033 * time_end = PropDict._make_property('time_end', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode)
10034 * comment = PropDict._make_property('comment', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode)
10035 * chunker_params = PropDict._make_property('chunker_params', tuple) # <<<<<<<<<<<<<<
10036 * recreate_cmdline = PropDict._make_property('recreate_cmdline', list) # list of s-e-str
10037 * # recreate_source_id, recreate_args, recreate_partial_chunks were used in 1.1.0b1 .. b2
10038 */
10039 __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 314, __pyx_L1_error)
10040 __Pyx_GOTREF(__pyx_t_6);
10041 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_make_property); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 314, __pyx_L1_error)
10042 __Pyx_GOTREF(__pyx_t_5);
10043 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10044 __pyx_t_6 = NULL;
10045 __pyx_t_8 = 0;
10046 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
10047 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
10048 if (likely(__pyx_t_6)) {
10049 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
10050 __Pyx_INCREF(__pyx_t_6);
10051 __Pyx_INCREF(function);
10052 __Pyx_DECREF_SET(__pyx_t_5, function);
10053 __pyx_t_8 = 1;
10054 }
10055 }
10056 #if CYTHON_FAST_PYCALL
10057 if (PyFunction_Check(__pyx_t_5)) {
10058 PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_n_u_chunker_params, ((PyObject *)(&PyTuple_Type))};
10059 __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 314, __pyx_L1_error)
10060 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
10061 __Pyx_GOTREF(__pyx_t_7);
10062 } else
10063 #endif
10064 #if CYTHON_FAST_PYCCALL
10065 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
10066 PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_n_u_chunker_params, ((PyObject *)(&PyTuple_Type))};
10067 __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 314, __pyx_L1_error)
10068 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
10069 __Pyx_GOTREF(__pyx_t_7);
10070 } else
10071 #endif
10072 {
10073 __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 314, __pyx_L1_error)
10074 __Pyx_GOTREF(__pyx_t_9);
10075 if (__pyx_t_6) {
10076 __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL;
10077 }
10078 __Pyx_INCREF(__pyx_n_u_chunker_params);
10079 __Pyx_GIVEREF(__pyx_n_u_chunker_params);
10080 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_n_u_chunker_params);
10081 __Pyx_INCREF(((PyObject *)(&PyTuple_Type)));
10082 __Pyx_GIVEREF(((PyObject *)(&PyTuple_Type)));
10083 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, ((PyObject *)(&PyTuple_Type)));
10084 __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 314, __pyx_L1_error)
10085 __Pyx_GOTREF(__pyx_t_7);
10086 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
10087 }
10088 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10089 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_chunker_params, __pyx_t_7) < 0) __PYX_ERR(0, 314, __pyx_L1_error)
10090 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10091
10092 /* "borg/item.pyx":315
10093 * comment = PropDict._make_property('comment', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode)
10094 * chunker_params = PropDict._make_property('chunker_params', tuple)
10095 * recreate_cmdline = PropDict._make_property('recreate_cmdline', list) # list of s-e-str # <<<<<<<<<<<<<<
10096 * # recreate_source_id, recreate_args, recreate_partial_chunks were used in 1.1.0b1 .. b2
10097 * recreate_source_id = PropDict._make_property('recreate_source_id', bytes)
10098 */
10099 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 315, __pyx_L1_error)
10100 __Pyx_GOTREF(__pyx_t_5);
10101 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_make_property); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 315, __pyx_L1_error)
10102 __Pyx_GOTREF(__pyx_t_9);
10103 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10104 __pyx_t_5 = NULL;
10105 __pyx_t_8 = 0;
10106 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
10107 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9);
10108 if (likely(__pyx_t_5)) {
10109 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
10110 __Pyx_INCREF(__pyx_t_5);
10111 __Pyx_INCREF(function);
10112 __Pyx_DECREF_SET(__pyx_t_9, function);
10113 __pyx_t_8 = 1;
10114 }
10115 }
10116 #if CYTHON_FAST_PYCALL
10117 if (PyFunction_Check(__pyx_t_9)) {
10118 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_n_u_recreate_cmdline, ((PyObject *)(&PyList_Type))};
10119 __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 315, __pyx_L1_error)
10120 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10121 __Pyx_GOTREF(__pyx_t_7);
10122 } else
10123 #endif
10124 #if CYTHON_FAST_PYCCALL
10125 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
10126 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_n_u_recreate_cmdline, ((PyObject *)(&PyList_Type))};
10127 __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 315, __pyx_L1_error)
10128 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10129 __Pyx_GOTREF(__pyx_t_7);
10130 } else
10131 #endif
10132 {
10133 __pyx_t_6 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 315, __pyx_L1_error)
10134 __Pyx_GOTREF(__pyx_t_6);
10135 if (__pyx_t_5) {
10136 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
10137 }
10138 __Pyx_INCREF(__pyx_n_u_recreate_cmdline);
10139 __Pyx_GIVEREF(__pyx_n_u_recreate_cmdline);
10140 PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_recreate_cmdline);
10141 __Pyx_INCREF(((PyObject *)(&PyList_Type)));
10142 __Pyx_GIVEREF(((PyObject *)(&PyList_Type)));
10143 PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, ((PyObject *)(&PyList_Type)));
10144 __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 315, __pyx_L1_error)
10145 __Pyx_GOTREF(__pyx_t_7);
10146 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10147 }
10148 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
10149 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_recreate_cmdline, __pyx_t_7) < 0) __PYX_ERR(0, 315, __pyx_L1_error)
10150 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10151
10152 /* "borg/item.pyx":317
10153 * recreate_cmdline = PropDict._make_property('recreate_cmdline', list) # list of s-e-str
10154 * # recreate_source_id, recreate_args, recreate_partial_chunks were used in 1.1.0b1 .. b2
10155 * recreate_source_id = PropDict._make_property('recreate_source_id', bytes) # <<<<<<<<<<<<<<
10156 * recreate_args = PropDict._make_property('recreate_args', list) # list of s-e-str
10157 * recreate_partial_chunks = PropDict._make_property('recreate_partial_chunks', list) # list of tuples
10158 */
10159 __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 317, __pyx_L1_error)
10160 __Pyx_GOTREF(__pyx_t_9);
10161 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_make_property); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 317, __pyx_L1_error)
10162 __Pyx_GOTREF(__pyx_t_6);
10163 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
10164 __pyx_t_9 = NULL;
10165 __pyx_t_8 = 0;
10166 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
10167 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
10168 if (likely(__pyx_t_9)) {
10169 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
10170 __Pyx_INCREF(__pyx_t_9);
10171 __Pyx_INCREF(function);
10172 __Pyx_DECREF_SET(__pyx_t_6, function);
10173 __pyx_t_8 = 1;
10174 }
10175 }
10176 #if CYTHON_FAST_PYCALL
10177 if (PyFunction_Check(__pyx_t_6)) {
10178 PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_n_u_recreate_source_id, ((PyObject *)(&PyBytes_Type))};
10179 __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 317, __pyx_L1_error)
10180 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
10181 __Pyx_GOTREF(__pyx_t_7);
10182 } else
10183 #endif
10184 #if CYTHON_FAST_PYCCALL
10185 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
10186 PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_n_u_recreate_source_id, ((PyObject *)(&PyBytes_Type))};
10187 __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 317, __pyx_L1_error)
10188 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
10189 __Pyx_GOTREF(__pyx_t_7);
10190 } else
10191 #endif
10192 {
10193 __pyx_t_5 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 317, __pyx_L1_error)
10194 __Pyx_GOTREF(__pyx_t_5);
10195 if (__pyx_t_9) {
10196 __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9); __pyx_t_9 = NULL;
10197 }
10198 __Pyx_INCREF(__pyx_n_u_recreate_source_id);
10199 __Pyx_GIVEREF(__pyx_n_u_recreate_source_id);
10200 PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_8, __pyx_n_u_recreate_source_id);
10201 __Pyx_INCREF(((PyObject *)(&PyBytes_Type)));
10202 __Pyx_GIVEREF(((PyObject *)(&PyBytes_Type)));
10203 PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, ((PyObject *)(&PyBytes_Type)));
10204 __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 317, __pyx_L1_error)
10205 __Pyx_GOTREF(__pyx_t_7);
10206 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10207 }
10208 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10209 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_recreate_source_id, __pyx_t_7) < 0) __PYX_ERR(0, 317, __pyx_L1_error)
10210 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10211
10212 /* "borg/item.pyx":318
10213 * # recreate_source_id, recreate_args, recreate_partial_chunks were used in 1.1.0b1 .. b2
10214 * recreate_source_id = PropDict._make_property('recreate_source_id', bytes)
10215 * recreate_args = PropDict._make_property('recreate_args', list) # list of s-e-str # <<<<<<<<<<<<<<
10216 * recreate_partial_chunks = PropDict._make_property('recreate_partial_chunks', list) # list of tuples
10217 *
10218 */
10219 __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 318, __pyx_L1_error)
10220 __Pyx_GOTREF(__pyx_t_6);
10221 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_make_property); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 318, __pyx_L1_error)
10222 __Pyx_GOTREF(__pyx_t_5);
10223 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10224 __pyx_t_6 = NULL;
10225 __pyx_t_8 = 0;
10226 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
10227 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
10228 if (likely(__pyx_t_6)) {
10229 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
10230 __Pyx_INCREF(__pyx_t_6);
10231 __Pyx_INCREF(function);
10232 __Pyx_DECREF_SET(__pyx_t_5, function);
10233 __pyx_t_8 = 1;
10234 }
10235 }
10236 #if CYTHON_FAST_PYCALL
10237 if (PyFunction_Check(__pyx_t_5)) {
10238 PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_n_u_recreate_args, ((PyObject *)(&PyList_Type))};
10239 __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 318, __pyx_L1_error)
10240 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
10241 __Pyx_GOTREF(__pyx_t_7);
10242 } else
10243 #endif
10244 #if CYTHON_FAST_PYCCALL
10245 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
10246 PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_n_u_recreate_args, ((PyObject *)(&PyList_Type))};
10247 __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 318, __pyx_L1_error)
10248 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
10249 __Pyx_GOTREF(__pyx_t_7);
10250 } else
10251 #endif
10252 {
10253 __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 318, __pyx_L1_error)
10254 __Pyx_GOTREF(__pyx_t_9);
10255 if (__pyx_t_6) {
10256 __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL;
10257 }
10258 __Pyx_INCREF(__pyx_n_u_recreate_args);
10259 __Pyx_GIVEREF(__pyx_n_u_recreate_args);
10260 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_n_u_recreate_args);
10261 __Pyx_INCREF(((PyObject *)(&PyList_Type)));
10262 __Pyx_GIVEREF(((PyObject *)(&PyList_Type)));
10263 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, ((PyObject *)(&PyList_Type)));
10264 __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 318, __pyx_L1_error)
10265 __Pyx_GOTREF(__pyx_t_7);
10266 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
10267 }
10268 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10269 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_recreate_args, __pyx_t_7) < 0) __PYX_ERR(0, 318, __pyx_L1_error)
10270 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10271
10272 /* "borg/item.pyx":319
10273 * recreate_source_id = PropDict._make_property('recreate_source_id', bytes)
10274 * recreate_args = PropDict._make_property('recreate_args', list) # list of s-e-str
10275 * recreate_partial_chunks = PropDict._make_property('recreate_partial_chunks', list) # list of tuples # <<<<<<<<<<<<<<
10276 *
10277 *
10278 */
10279 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 319, __pyx_L1_error)
10280 __Pyx_GOTREF(__pyx_t_5);
10281 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_make_property); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 319, __pyx_L1_error)
10282 __Pyx_GOTREF(__pyx_t_9);
10283 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10284 __pyx_t_5 = NULL;
10285 __pyx_t_8 = 0;
10286 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
10287 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9);
10288 if (likely(__pyx_t_5)) {
10289 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
10290 __Pyx_INCREF(__pyx_t_5);
10291 __Pyx_INCREF(function);
10292 __Pyx_DECREF_SET(__pyx_t_9, function);
10293 __pyx_t_8 = 1;
10294 }
10295 }
10296 #if CYTHON_FAST_PYCALL
10297 if (PyFunction_Check(__pyx_t_9)) {
10298 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_n_u_recreate_partial_chunks, ((PyObject *)(&PyList_Type))};
10299 __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 319, __pyx_L1_error)
10300 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10301 __Pyx_GOTREF(__pyx_t_7);
10302 } else
10303 #endif
10304 #if CYTHON_FAST_PYCCALL
10305 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
10306 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_n_u_recreate_partial_chunks, ((PyObject *)(&PyList_Type))};
10307 __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 319, __pyx_L1_error)
10308 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10309 __Pyx_GOTREF(__pyx_t_7);
10310 } else
10311 #endif
10312 {
10313 __pyx_t_6 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 319, __pyx_L1_error)
10314 __Pyx_GOTREF(__pyx_t_6);
10315 if (__pyx_t_5) {
10316 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
10317 }
10318 __Pyx_INCREF(__pyx_n_u_recreate_partial_chunks);
10319 __Pyx_GIVEREF(__pyx_n_u_recreate_partial_chunks);
10320 PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_n_u_recreate_partial_chunks);
10321 __Pyx_INCREF(((PyObject *)(&PyList_Type)));
10322 __Pyx_GIVEREF(((PyObject *)(&PyList_Type)));
10323 PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, ((PyObject *)(&PyList_Type)));
10324 __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 319, __pyx_L1_error)
10325 __Pyx_GOTREF(__pyx_t_7);
10326 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10327 }
10328 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
10329 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_recreate_partial_chunks, __pyx_t_7) < 0) __PYX_ERR(0, 319, __pyx_L1_error)
10330 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10331
10332 /* "borg/item.pyx":289
10333 *
10334 *
10335 * class ArchiveItem(PropDict): # <<<<<<<<<<<<<<
10336 * """
10337 * ArchiveItem abstraction that deals with validation and the low-level details internally:
10338 */
10339 __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_ArchiveItem, __pyx_t_3, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 289, __pyx_L1_error)
10340 __Pyx_GOTREF(__pyx_t_7);
10341 if (PyDict_SetItem(__pyx_d, __pyx_n_s_ArchiveItem, __pyx_t_7) < 0) __PYX_ERR(0, 289, __pyx_L1_error)
10342 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10343 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10344 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10345 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10346
10347 /* "borg/item.pyx":322
10348 *
10349 *
10350 * class ManifestItem(PropDict): # <<<<<<<<<<<<<<
10351 * """
10352 * ManifestItem abstraction that deals with validation and the low-level details internally:
10353 */
10354 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 322, __pyx_L1_error)
10355 __Pyx_GOTREF(__pyx_t_3);
10356 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 322, __pyx_L1_error)
10357 __Pyx_GOTREF(__pyx_t_2);
10358 __Pyx_GIVEREF(__pyx_t_3);
10359 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
10360 __pyx_t_3 = 0;
10361 __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 322, __pyx_L1_error)
10362 __Pyx_GOTREF(__pyx_t_3);
10363 __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_2, __pyx_n_s_ManifestItem, __pyx_n_s_ManifestItem, (PyObject *) NULL, __pyx_n_s_borg_item, __pyx_kp_s_ManifestItem_abstraction_that_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error)
10364 __Pyx_GOTREF(__pyx_t_1);
10365
10366 /* "borg/item.pyx":334
10367 * """
10368 *
10369 * VALID_KEYS = {'version', 'archives', 'timestamp', 'config', 'item_keys', } # str-typed keys # <<<<<<<<<<<<<<
10370 *
10371 * __slots__ = ("_dict", ) # avoid setting attributes not supported by properties
10372 */
10373 __pyx_t_7 = PySet_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 334, __pyx_L1_error)
10374 __Pyx_GOTREF(__pyx_t_7);
10375 if (PySet_Add(__pyx_t_7, __pyx_n_u_version) < 0) __PYX_ERR(0, 334, __pyx_L1_error)
10376 if (PySet_Add(__pyx_t_7, __pyx_n_u_archives) < 0) __PYX_ERR(0, 334, __pyx_L1_error)
10377 if (PySet_Add(__pyx_t_7, __pyx_n_u_timestamp) < 0) __PYX_ERR(0, 334, __pyx_L1_error)
10378 if (PySet_Add(__pyx_t_7, __pyx_n_u_config) < 0) __PYX_ERR(0, 334, __pyx_L1_error)
10379 if (PySet_Add(__pyx_t_7, __pyx_n_u_item_keys) < 0) __PYX_ERR(0, 334, __pyx_L1_error)
10380 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_VALID_KEYS, __pyx_t_7) < 0) __PYX_ERR(0, 334, __pyx_L1_error)
10381 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10382
10383 /* "borg/item.pyx":336
10384 * VALID_KEYS = {'version', 'archives', 'timestamp', 'config', 'item_keys', } # str-typed keys
10385 *
10386 * __slots__ = ("_dict", ) # avoid setting attributes not supported by properties # <<<<<<<<<<<<<<
10387 *
10388 * version = PropDict._make_property('version', int)
10389 */
10390 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_slots, __pyx_tuple__13) < 0) __PYX_ERR(0, 336, __pyx_L1_error)
10391
10392 /* "borg/item.pyx":338
10393 * __slots__ = ("_dict", ) # avoid setting attributes not supported by properties
10394 *
10395 * version = PropDict._make_property('version', int) # <<<<<<<<<<<<<<
10396 * archives = PropDict._make_property('archives', dict) # name -> dict
10397 * timestamp = PropDict._make_property('timestamp', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode)
10398 */
10399 __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 338, __pyx_L1_error)
10400 __Pyx_GOTREF(__pyx_t_9);
10401 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_make_property); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 338, __pyx_L1_error)
10402 __Pyx_GOTREF(__pyx_t_6);
10403 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
10404 __pyx_t_9 = NULL;
10405 __pyx_t_8 = 0;
10406 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
10407 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
10408 if (likely(__pyx_t_9)) {
10409 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
10410 __Pyx_INCREF(__pyx_t_9);
10411 __Pyx_INCREF(function);
10412 __Pyx_DECREF_SET(__pyx_t_6, function);
10413 __pyx_t_8 = 1;
10414 }
10415 }
10416 #if CYTHON_FAST_PYCALL
10417 if (PyFunction_Check(__pyx_t_6)) {
10418 PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_n_u_version, ((PyObject *)(&PyInt_Type))};
10419 __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 338, __pyx_L1_error)
10420 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
10421 __Pyx_GOTREF(__pyx_t_7);
10422 } else
10423 #endif
10424 #if CYTHON_FAST_PYCCALL
10425 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
10426 PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_n_u_version, ((PyObject *)(&PyInt_Type))};
10427 __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 338, __pyx_L1_error)
10428 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
10429 __Pyx_GOTREF(__pyx_t_7);
10430 } else
10431 #endif
10432 {
10433 __pyx_t_5 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 338, __pyx_L1_error)
10434 __Pyx_GOTREF(__pyx_t_5);
10435 if (__pyx_t_9) {
10436 __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9); __pyx_t_9 = NULL;
10437 }
10438 __Pyx_INCREF(__pyx_n_u_version);
10439 __Pyx_GIVEREF(__pyx_n_u_version);
10440 PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_8, __pyx_n_u_version);
10441 __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
10442 __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
10443 PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, ((PyObject *)(&PyInt_Type)));
10444 __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 338, __pyx_L1_error)
10445 __Pyx_GOTREF(__pyx_t_7);
10446 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10447 }
10448 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10449 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_version, __pyx_t_7) < 0) __PYX_ERR(0, 338, __pyx_L1_error)
10450 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10451
10452 /* "borg/item.pyx":339
10453 *
10454 * version = PropDict._make_property('version', int)
10455 * archives = PropDict._make_property('archives', dict) # name -> dict # <<<<<<<<<<<<<<
10456 * timestamp = PropDict._make_property('timestamp', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode)
10457 * config = PropDict._make_property('config', dict)
10458 */
10459 __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 339, __pyx_L1_error)
10460 __Pyx_GOTREF(__pyx_t_6);
10461 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_make_property); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 339, __pyx_L1_error)
10462 __Pyx_GOTREF(__pyx_t_5);
10463 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10464 __pyx_t_6 = NULL;
10465 __pyx_t_8 = 0;
10466 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
10467 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
10468 if (likely(__pyx_t_6)) {
10469 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
10470 __Pyx_INCREF(__pyx_t_6);
10471 __Pyx_INCREF(function);
10472 __Pyx_DECREF_SET(__pyx_t_5, function);
10473 __pyx_t_8 = 1;
10474 }
10475 }
10476 #if CYTHON_FAST_PYCALL
10477 if (PyFunction_Check(__pyx_t_5)) {
10478 PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_n_u_archives, ((PyObject *)(&PyDict_Type))};
10479 __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 339, __pyx_L1_error)
10480 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
10481 __Pyx_GOTREF(__pyx_t_7);
10482 } else
10483 #endif
10484 #if CYTHON_FAST_PYCCALL
10485 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
10486 PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_n_u_archives, ((PyObject *)(&PyDict_Type))};
10487 __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 339, __pyx_L1_error)
10488 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
10489 __Pyx_GOTREF(__pyx_t_7);
10490 } else
10491 #endif
10492 {
10493 __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 339, __pyx_L1_error)
10494 __Pyx_GOTREF(__pyx_t_9);
10495 if (__pyx_t_6) {
10496 __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL;
10497 }
10498 __Pyx_INCREF(__pyx_n_u_archives);
10499 __Pyx_GIVEREF(__pyx_n_u_archives);
10500 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_n_u_archives);
10501 __Pyx_INCREF(((PyObject *)(&PyDict_Type)));
10502 __Pyx_GIVEREF(((PyObject *)(&PyDict_Type)));
10503 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, ((PyObject *)(&PyDict_Type)));
10504 __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 339, __pyx_L1_error)
10505 __Pyx_GOTREF(__pyx_t_7);
10506 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
10507 }
10508 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10509 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_archives, __pyx_t_7) < 0) __PYX_ERR(0, 339, __pyx_L1_error)
10510 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10511
10512 /* "borg/item.pyx":340
10513 * version = PropDict._make_property('version', int)
10514 * archives = PropDict._make_property('archives', dict) # name -> dict
10515 * timestamp = PropDict._make_property('timestamp', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode) # <<<<<<<<<<<<<<
10516 * config = PropDict._make_property('config', dict)
10517 * item_keys = PropDict._make_property('item_keys', tuple)
10518 */
10519 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 340, __pyx_L1_error)
10520 __Pyx_GOTREF(__pyx_t_7);
10521 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_make_property); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 340, __pyx_L1_error)
10522 __Pyx_GOTREF(__pyx_t_5);
10523 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10524 __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 340, __pyx_L1_error)
10525 __Pyx_GOTREF(__pyx_t_7);
10526 __Pyx_INCREF(__pyx_n_u_timestamp);
10527 __Pyx_GIVEREF(__pyx_n_u_timestamp);
10528 PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_n_u_timestamp);
10529 __Pyx_INCREF(((PyObject *)(&PyUnicode_Type)));
10530 __Pyx_GIVEREF(((PyObject *)(&PyUnicode_Type)));
10531 PyTuple_SET_ITEM(__pyx_t_7, 1, ((PyObject *)(&PyUnicode_Type)));
10532 __Pyx_INCREF(__pyx_kp_u_surrogate_escaped_str);
10533 __Pyx_GIVEREF(__pyx_kp_u_surrogate_escaped_str);
10534 PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_kp_u_surrogate_escaped_str);
10535 __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 340, __pyx_L1_error)
10536 __Pyx_GOTREF(__pyx_t_9);
10537 __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_safe_encode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 340, __pyx_L1_error)
10538 __Pyx_GOTREF(__pyx_t_6);
10539 if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_encode, __pyx_t_6) < 0) __PYX_ERR(0, 340, __pyx_L1_error)
10540 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10541 __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_safe_decode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 340, __pyx_L1_error)
10542 __Pyx_GOTREF(__pyx_t_6);
10543 if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_decode, __pyx_t_6) < 0) __PYX_ERR(0, 340, __pyx_L1_error)
10544 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10545 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 340, __pyx_L1_error)
10546 __Pyx_GOTREF(__pyx_t_6);
10547 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10548 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10549 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
10550 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_timestamp, __pyx_t_6) < 0) __PYX_ERR(0, 340, __pyx_L1_error)
10551 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10552
10553 /* "borg/item.pyx":341
10554 * archives = PropDict._make_property('archives', dict) # name -> dict
10555 * timestamp = PropDict._make_property('timestamp', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode)
10556 * config = PropDict._make_property('config', dict) # <<<<<<<<<<<<<<
10557 * item_keys = PropDict._make_property('item_keys', tuple)
10558 */
10559 __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 341, __pyx_L1_error)
10560 __Pyx_GOTREF(__pyx_t_9);
10561 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_make_property); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 341, __pyx_L1_error)
10562 __Pyx_GOTREF(__pyx_t_7);
10563 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
10564 __pyx_t_9 = NULL;
10565 __pyx_t_8 = 0;
10566 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
10567 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
10568 if (likely(__pyx_t_9)) {
10569 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
10570 __Pyx_INCREF(__pyx_t_9);
10571 __Pyx_INCREF(function);
10572 __Pyx_DECREF_SET(__pyx_t_7, function);
10573 __pyx_t_8 = 1;
10574 }
10575 }
10576 #if CYTHON_FAST_PYCALL
10577 if (PyFunction_Check(__pyx_t_7)) {
10578 PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_n_u_config, ((PyObject *)(&PyDict_Type))};
10579 __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 341, __pyx_L1_error)
10580 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
10581 __Pyx_GOTREF(__pyx_t_6);
10582 } else
10583 #endif
10584 #if CYTHON_FAST_PYCCALL
10585 if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
10586 PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_n_u_config, ((PyObject *)(&PyDict_Type))};
10587 __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 341, __pyx_L1_error)
10588 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
10589 __Pyx_GOTREF(__pyx_t_6);
10590 } else
10591 #endif
10592 {
10593 __pyx_t_5 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 341, __pyx_L1_error)
10594 __Pyx_GOTREF(__pyx_t_5);
10595 if (__pyx_t_9) {
10596 __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9); __pyx_t_9 = NULL;
10597 }
10598 __Pyx_INCREF(__pyx_n_u_config);
10599 __Pyx_GIVEREF(__pyx_n_u_config);
10600 PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_8, __pyx_n_u_config);
10601 __Pyx_INCREF(((PyObject *)(&PyDict_Type)));
10602 __Pyx_GIVEREF(((PyObject *)(&PyDict_Type)));
10603 PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, ((PyObject *)(&PyDict_Type)));
10604 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 341, __pyx_L1_error)
10605 __Pyx_GOTREF(__pyx_t_6);
10606 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10607 }
10608 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10609 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_config, __pyx_t_6) < 0) __PYX_ERR(0, 341, __pyx_L1_error)
10610 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10611
10612 /* "borg/item.pyx":342
10613 * timestamp = PropDict._make_property('timestamp', str, 'surrogate-escaped str', encode=safe_encode, decode=safe_decode)
10614 * config = PropDict._make_property('config', dict)
10615 * item_keys = PropDict._make_property('item_keys', tuple) # <<<<<<<<<<<<<<
10616 */
10617 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_PropDict); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 342, __pyx_L1_error)
10618 __Pyx_GOTREF(__pyx_t_7);
10619 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_make_property); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 342, __pyx_L1_error)
10620 __Pyx_GOTREF(__pyx_t_5);
10621 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10622 __pyx_t_7 = NULL;
10623 __pyx_t_8 = 0;
10624 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
10625 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
10626 if (likely(__pyx_t_7)) {
10627 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
10628 __Pyx_INCREF(__pyx_t_7);
10629 __Pyx_INCREF(function);
10630 __Pyx_DECREF_SET(__pyx_t_5, function);
10631 __pyx_t_8 = 1;
10632 }
10633 }
10634 #if CYTHON_FAST_PYCALL
10635 if (PyFunction_Check(__pyx_t_5)) {
10636 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_n_u_item_keys, ((PyObject *)(&PyTuple_Type))};
10637 __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 342, __pyx_L1_error)
10638 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10639 __Pyx_GOTREF(__pyx_t_6);
10640 } else
10641 #endif
10642 #if CYTHON_FAST_PYCCALL
10643 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
10644 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_n_u_item_keys, ((PyObject *)(&PyTuple_Type))};
10645 __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 342, __pyx_L1_error)
10646 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10647 __Pyx_GOTREF(__pyx_t_6);
10648 } else
10649 #endif
10650 {
10651 __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 342, __pyx_L1_error)
10652 __Pyx_GOTREF(__pyx_t_9);
10653 if (__pyx_t_7) {
10654 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
10655 }
10656 __Pyx_INCREF(__pyx_n_u_item_keys);
10657 __Pyx_GIVEREF(__pyx_n_u_item_keys);
10658 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_n_u_item_keys);
10659 __Pyx_INCREF(((PyObject *)(&PyTuple_Type)));
10660 __Pyx_GIVEREF(((PyObject *)(&PyTuple_Type)));
10661 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, ((PyObject *)(&PyTuple_Type)));
10662 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 342, __pyx_L1_error)
10663 __Pyx_GOTREF(__pyx_t_6);
10664 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
10665 }
10666 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10667 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_item_keys, __pyx_t_6) < 0) __PYX_ERR(0, 342, __pyx_L1_error)
10668 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10669
10670 /* "borg/item.pyx":322
10671 *
10672 *
10673 * class ManifestItem(PropDict): # <<<<<<<<<<<<<<
10674 * """
10675 * ManifestItem abstraction that deals with validation and the low-level details internally:
10676 */
10677 __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_ManifestItem, __pyx_t_2, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 322, __pyx_L1_error)
10678 __Pyx_GOTREF(__pyx_t_6);
10679 if (PyDict_SetItem(__pyx_d, __pyx_n_s_ManifestItem, __pyx_t_6) < 0) __PYX_ERR(0, 322, __pyx_L1_error)
10680 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10681 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10682 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10683 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10684
10685 /* "borg/item.pyx":1
10686 * # cython: language_level=3 # <<<<<<<<<<<<<<
10687 *
10688 * import stat
10689 */
10690 __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
10691 __Pyx_GOTREF(__pyx_t_2);
10692 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
10693 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10694
10695 /*--- Wrapped vars code ---*/
10696
10697 goto __pyx_L0;
10698 __pyx_L1_error:;
10699 __Pyx_XDECREF(__pyx_t_1);
10700 __Pyx_XDECREF(__pyx_t_2);
10701 __Pyx_XDECREF(__pyx_t_3);
10702 __Pyx_XDECREF(__pyx_t_4);
10703 __Pyx_XDECREF(__pyx_t_5);
10704 __Pyx_XDECREF(__pyx_t_6);
10705 __Pyx_XDECREF(__pyx_t_7);
10706 __Pyx_XDECREF(__pyx_t_9);
10707 if (__pyx_m) {
10708 if (__pyx_d) {
10709 __Pyx_AddTraceback("init borg.item", __pyx_clineno, __pyx_lineno, __pyx_filename);
10710 }
10711 Py_CLEAR(__pyx_m);
10712 } else if (!PyErr_Occurred()) {
10713 PyErr_SetString(PyExc_ImportError, "init borg.item");
10714 }
10715 __pyx_L0:;
10716 __Pyx_RefNannyFinishContext();
10717 #if CYTHON_PEP489_MULTI_PHASE_INIT
10718 return (__pyx_m != NULL) ? 0 : -1;
10719 #elif PY_MAJOR_VERSION >= 3
10720 return __pyx_m;
10721 #else
10722 return;
10723 #endif
10724 }
10725
10726 /* --- Runtime support code --- */
10727 /* Refnanny */
10728 #if CYTHON_REFNANNY
__Pyx_RefNannyImportAPI(const char * modname)10729 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
10730 PyObject *m = NULL, *p = NULL;
10731 void *r = NULL;
10732 m = PyImport_ImportModule(modname);
10733 if (!m) goto end;
10734 p = PyObject_GetAttrString(m, "RefNannyAPI");
10735 if (!p) goto end;
10736 r = PyLong_AsVoidPtr(p);
10737 end:
10738 Py_XDECREF(p);
10739 Py_XDECREF(m);
10740 return (__Pyx_RefNannyAPIStruct *)r;
10741 }
10742 #endif
10743
10744 /* PyObjectGetAttrStr */
10745 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetAttrStr(PyObject * obj,PyObject * attr_name)10746 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
10747 PyTypeObject* tp = Py_TYPE(obj);
10748 if (likely(tp->tp_getattro))
10749 return tp->tp_getattro(obj, attr_name);
10750 #if PY_MAJOR_VERSION < 3
10751 if (likely(tp->tp_getattr))
10752 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
10753 #endif
10754 return PyObject_GetAttr(obj, attr_name);
10755 }
10756 #endif
10757
10758 /* GetBuiltinName */
__Pyx_GetBuiltinName(PyObject * name)10759 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
10760 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
10761 if (unlikely(!result)) {
10762 PyErr_Format(PyExc_NameError,
10763 #if PY_MAJOR_VERSION >= 3
10764 "name '%U' is not defined", name);
10765 #else
10766 "name '%.200s' is not defined", PyString_AS_STRING(name));
10767 #endif
10768 }
10769 return result;
10770 }
10771
10772 /* RaiseDoubleKeywords */
__Pyx_RaiseDoubleKeywordsError(const char * func_name,PyObject * kw_name)10773 static void __Pyx_RaiseDoubleKeywordsError(
10774 const char* func_name,
10775 PyObject* kw_name)
10776 {
10777 PyErr_Format(PyExc_TypeError,
10778 #if PY_MAJOR_VERSION >= 3
10779 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
10780 #else
10781 "%s() got multiple values for keyword argument '%s'", func_name,
10782 PyString_AsString(kw_name));
10783 #endif
10784 }
10785
10786 /* ParseKeywords */
__Pyx_ParseOptionalKeywords(PyObject * kwds,PyObject ** argnames[],PyObject * kwds2,PyObject * values[],Py_ssize_t num_pos_args,const char * function_name)10787 static int __Pyx_ParseOptionalKeywords(
10788 PyObject *kwds,
10789 PyObject **argnames[],
10790 PyObject *kwds2,
10791 PyObject *values[],
10792 Py_ssize_t num_pos_args,
10793 const char* function_name)
10794 {
10795 PyObject *key = 0, *value = 0;
10796 Py_ssize_t pos = 0;
10797 PyObject*** name;
10798 PyObject*** first_kw_arg = argnames + num_pos_args;
10799 while (PyDict_Next(kwds, &pos, &key, &value)) {
10800 name = first_kw_arg;
10801 while (*name && (**name != key)) name++;
10802 if (*name) {
10803 values[name-argnames] = value;
10804 continue;
10805 }
10806 name = first_kw_arg;
10807 #if PY_MAJOR_VERSION < 3
10808 if (likely(PyString_Check(key))) {
10809 while (*name) {
10810 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
10811 && _PyString_Eq(**name, key)) {
10812 values[name-argnames] = value;
10813 break;
10814 }
10815 name++;
10816 }
10817 if (*name) continue;
10818 else {
10819 PyObject*** argname = argnames;
10820 while (argname != first_kw_arg) {
10821 if ((**argname == key) || (
10822 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
10823 && _PyString_Eq(**argname, key))) {
10824 goto arg_passed_twice;
10825 }
10826 argname++;
10827 }
10828 }
10829 } else
10830 #endif
10831 if (likely(PyUnicode_Check(key))) {
10832 while (*name) {
10833 int cmp = (**name == key) ? 0 :
10834 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
10835 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
10836 #endif
10837 PyUnicode_Compare(**name, key);
10838 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
10839 if (cmp == 0) {
10840 values[name-argnames] = value;
10841 break;
10842 }
10843 name++;
10844 }
10845 if (*name) continue;
10846 else {
10847 PyObject*** argname = argnames;
10848 while (argname != first_kw_arg) {
10849 int cmp = (**argname == key) ? 0 :
10850 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
10851 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
10852 #endif
10853 PyUnicode_Compare(**argname, key);
10854 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
10855 if (cmp == 0) goto arg_passed_twice;
10856 argname++;
10857 }
10858 }
10859 } else
10860 goto invalid_keyword_type;
10861 if (kwds2) {
10862 if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
10863 } else {
10864 goto invalid_keyword;
10865 }
10866 }
10867 return 0;
10868 arg_passed_twice:
10869 __Pyx_RaiseDoubleKeywordsError(function_name, key);
10870 goto bad;
10871 invalid_keyword_type:
10872 PyErr_Format(PyExc_TypeError,
10873 "%.200s() keywords must be strings", function_name);
10874 goto bad;
10875 invalid_keyword:
10876 PyErr_Format(PyExc_TypeError,
10877 #if PY_MAJOR_VERSION < 3
10878 "%.200s() got an unexpected keyword argument '%.200s'",
10879 function_name, PyString_AsString(key));
10880 #else
10881 "%s() got an unexpected keyword argument '%U'",
10882 function_name, key);
10883 #endif
10884 bad:
10885 return -1;
10886 }
10887
10888 /* RaiseArgTupleInvalid */
__Pyx_RaiseArgtupleInvalid(const char * func_name,int exact,Py_ssize_t num_min,Py_ssize_t num_max,Py_ssize_t num_found)10889 static void __Pyx_RaiseArgtupleInvalid(
10890 const char* func_name,
10891 int exact,
10892 Py_ssize_t num_min,
10893 Py_ssize_t num_max,
10894 Py_ssize_t num_found)
10895 {
10896 Py_ssize_t num_expected;
10897 const char *more_or_less;
10898 if (num_found < num_min) {
10899 num_expected = num_min;
10900 more_or_less = "at least";
10901 } else {
10902 num_expected = num_max;
10903 more_or_less = "at most";
10904 }
10905 if (exact) {
10906 more_or_less = "exactly";
10907 }
10908 PyErr_Format(PyExc_TypeError,
10909 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
10910 func_name, more_or_less, num_expected,
10911 (num_expected == 1) ? "" : "s", num_found);
10912 }
10913
10914 /* PyObjectSetAttrStr */
10915 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_SetAttrStr(PyObject * obj,PyObject * attr_name,PyObject * value)10916 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
10917 PyTypeObject* tp = Py_TYPE(obj);
10918 if (likely(tp->tp_setattro))
10919 return tp->tp_setattro(obj, attr_name, value);
10920 #if PY_MAJOR_VERSION < 3
10921 if (likely(tp->tp_setattr))
10922 return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
10923 #endif
10924 return PyObject_SetAttr(obj, attr_name, value);
10925 }
10926 #endif
10927
10928 /* PyCFunctionFastCall */
10929 #if CYTHON_FAST_PYCCALL
__Pyx_PyCFunction_FastCall(PyObject * func_obj,PyObject ** args,Py_ssize_t nargs)10930 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
10931 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
10932 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
10933 PyObject *self = PyCFunction_GET_SELF(func);
10934 int flags = PyCFunction_GET_FLAGS(func);
10935 assert(PyCFunction_Check(func));
10936 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
10937 assert(nargs >= 0);
10938 assert(nargs == 0 || args != NULL);
10939 /* _PyCFunction_FastCallDict() must not be called with an exception set,
10940 because it may clear it (directly or indirectly) and so the
10941 caller loses its exception */
10942 assert(!PyErr_Occurred());
10943 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
10944 return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
10945 } else {
10946 return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
10947 }
10948 }
10949 #endif
10950
10951 /* PyFunctionFastCall */
10952 #if CYTHON_FAST_PYCALL
__Pyx_PyFunction_FastCallNoKw(PyCodeObject * co,PyObject ** args,Py_ssize_t na,PyObject * globals)10953 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
10954 PyObject *globals) {
10955 PyFrameObject *f;
10956 PyThreadState *tstate = __Pyx_PyThreadState_Current;
10957 PyObject **fastlocals;
10958 Py_ssize_t i;
10959 PyObject *result;
10960 assert(globals != NULL);
10961 /* XXX Perhaps we should create a specialized
10962 PyFrame_New() that doesn't take locals, but does
10963 take builtins without sanity checking them.
10964 */
10965 assert(tstate != NULL);
10966 f = PyFrame_New(tstate, co, globals, NULL);
10967 if (f == NULL) {
10968 return NULL;
10969 }
10970 fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
10971 for (i = 0; i < na; i++) {
10972 Py_INCREF(*args);
10973 fastlocals[i] = *args++;
10974 }
10975 result = PyEval_EvalFrameEx(f,0);
10976 ++tstate->recursion_depth;
10977 Py_DECREF(f);
10978 --tstate->recursion_depth;
10979 return result;
10980 }
10981 #if 1 || PY_VERSION_HEX < 0x030600B1
__Pyx_PyFunction_FastCallDict(PyObject * func,PyObject ** args,Py_ssize_t nargs,PyObject * kwargs)10982 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
10983 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
10984 PyObject *globals = PyFunction_GET_GLOBALS(func);
10985 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
10986 PyObject *closure;
10987 #if PY_MAJOR_VERSION >= 3
10988 PyObject *kwdefs;
10989 #endif
10990 PyObject *kwtuple, **k;
10991 PyObject **d;
10992 Py_ssize_t nd;
10993 Py_ssize_t nk;
10994 PyObject *result;
10995 assert(kwargs == NULL || PyDict_Check(kwargs));
10996 nk = kwargs ? PyDict_Size(kwargs) : 0;
10997 if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
10998 return NULL;
10999 }
11000 if (
11001 #if PY_MAJOR_VERSION >= 3
11002 co->co_kwonlyargcount == 0 &&
11003 #endif
11004 likely(kwargs == NULL || nk == 0) &&
11005 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
11006 if (argdefs == NULL && co->co_argcount == nargs) {
11007 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
11008 goto done;
11009 }
11010 else if (nargs == 0 && argdefs != NULL
11011 && co->co_argcount == Py_SIZE(argdefs)) {
11012 /* function called with no arguments, but all parameters have
11013 a default value: use default values as arguments .*/
11014 args = &PyTuple_GET_ITEM(argdefs, 0);
11015 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
11016 goto done;
11017 }
11018 }
11019 if (kwargs != NULL) {
11020 Py_ssize_t pos, i;
11021 kwtuple = PyTuple_New(2 * nk);
11022 if (kwtuple == NULL) {
11023 result = NULL;
11024 goto done;
11025 }
11026 k = &PyTuple_GET_ITEM(kwtuple, 0);
11027 pos = i = 0;
11028 while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
11029 Py_INCREF(k[i]);
11030 Py_INCREF(k[i+1]);
11031 i += 2;
11032 }
11033 nk = i / 2;
11034 }
11035 else {
11036 kwtuple = NULL;
11037 k = NULL;
11038 }
11039 closure = PyFunction_GET_CLOSURE(func);
11040 #if PY_MAJOR_VERSION >= 3
11041 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
11042 #endif
11043 if (argdefs != NULL) {
11044 d = &PyTuple_GET_ITEM(argdefs, 0);
11045 nd = Py_SIZE(argdefs);
11046 }
11047 else {
11048 d = NULL;
11049 nd = 0;
11050 }
11051 #if PY_MAJOR_VERSION >= 3
11052 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
11053 args, (int)nargs,
11054 k, (int)nk,
11055 d, (int)nd, kwdefs, closure);
11056 #else
11057 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
11058 args, (int)nargs,
11059 k, (int)nk,
11060 d, (int)nd, closure);
11061 #endif
11062 Py_XDECREF(kwtuple);
11063 done:
11064 Py_LeaveRecursiveCall();
11065 return result;
11066 }
11067 #endif
11068 #endif
11069
11070 /* PyObjectCall */
11071 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_Call(PyObject * func,PyObject * arg,PyObject * kw)11072 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
11073 PyObject *result;
11074 ternaryfunc call = func->ob_type->tp_call;
11075 if (unlikely(!call))
11076 return PyObject_Call(func, arg, kw);
11077 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
11078 return NULL;
11079 result = (*call)(func, arg, kw);
11080 Py_LeaveRecursiveCall();
11081 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
11082 PyErr_SetString(
11083 PyExc_SystemError,
11084 "NULL result without error in PyObject_Call");
11085 }
11086 return result;
11087 }
11088 #endif
11089
11090 /* PyObjectCall2Args */
__Pyx_PyObject_Call2Args(PyObject * function,PyObject * arg1,PyObject * arg2)11091 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
11092 PyObject *args, *result = NULL;
11093 #if CYTHON_FAST_PYCALL
11094 if (PyFunction_Check(function)) {
11095 PyObject *args[2] = {arg1, arg2};
11096 return __Pyx_PyFunction_FastCall(function, args, 2);
11097 }
11098 #endif
11099 #if CYTHON_FAST_PYCCALL
11100 if (__Pyx_PyFastCFunction_Check(function)) {
11101 PyObject *args[2] = {arg1, arg2};
11102 return __Pyx_PyCFunction_FastCall(function, args, 2);
11103 }
11104 #endif
11105 args = PyTuple_New(2);
11106 if (unlikely(!args)) goto done;
11107 Py_INCREF(arg1);
11108 PyTuple_SET_ITEM(args, 0, arg1);
11109 Py_INCREF(arg2);
11110 PyTuple_SET_ITEM(args, 1, arg2);
11111 Py_INCREF(function);
11112 result = __Pyx_PyObject_Call(function, args, NULL);
11113 Py_DECREF(args);
11114 Py_DECREF(function);
11115 done:
11116 return result;
11117 }
11118
11119 /* PyObjectCallMethO */
11120 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_CallMethO(PyObject * func,PyObject * arg)11121 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
11122 PyObject *self, *result;
11123 PyCFunction cfunc;
11124 cfunc = PyCFunction_GET_FUNCTION(func);
11125 self = PyCFunction_GET_SELF(func);
11126 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
11127 return NULL;
11128 result = cfunc(self, arg);
11129 Py_LeaveRecursiveCall();
11130 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
11131 PyErr_SetString(
11132 PyExc_SystemError,
11133 "NULL result without error in PyObject_Call");
11134 }
11135 return result;
11136 }
11137 #endif
11138
11139 /* PyObjectCallOneArg */
11140 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx__PyObject_CallOneArg(PyObject * func,PyObject * arg)11141 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
11142 PyObject *result;
11143 PyObject *args = PyTuple_New(1);
11144 if (unlikely(!args)) return NULL;
11145 Py_INCREF(arg);
11146 PyTuple_SET_ITEM(args, 0, arg);
11147 result = __Pyx_PyObject_Call(func, args, NULL);
11148 Py_DECREF(args);
11149 return result;
11150 }
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)11151 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
11152 #if CYTHON_FAST_PYCALL
11153 if (PyFunction_Check(func)) {
11154 return __Pyx_PyFunction_FastCall(func, &arg, 1);
11155 }
11156 #endif
11157 if (likely(PyCFunction_Check(func))) {
11158 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
11159 return __Pyx_PyObject_CallMethO(func, arg);
11160 #if CYTHON_FAST_PYCCALL
11161 } else if (__Pyx_PyFastCFunction_Check(func)) {
11162 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
11163 #endif
11164 }
11165 }
11166 return __Pyx__PyObject_CallOneArg(func, arg);
11167 }
11168 #else
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)11169 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
11170 PyObject *result;
11171 PyObject *args = PyTuple_Pack(1, arg);
11172 if (unlikely(!args)) return NULL;
11173 result = __Pyx_PyObject_Call(func, args, NULL);
11174 Py_DECREF(args);
11175 return result;
11176 }
11177 #endif
11178
11179 /* PyErrFetchRestore */
11180 #if CYTHON_FAST_THREAD_STATE
__Pyx_ErrRestoreInState(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)11181 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
11182 PyObject *tmp_type, *tmp_value, *tmp_tb;
11183 tmp_type = tstate->curexc_type;
11184 tmp_value = tstate->curexc_value;
11185 tmp_tb = tstate->curexc_traceback;
11186 tstate->curexc_type = type;
11187 tstate->curexc_value = value;
11188 tstate->curexc_traceback = tb;
11189 Py_XDECREF(tmp_type);
11190 Py_XDECREF(tmp_value);
11191 Py_XDECREF(tmp_tb);
11192 }
__Pyx_ErrFetchInState(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)11193 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
11194 *type = tstate->curexc_type;
11195 *value = tstate->curexc_value;
11196 *tb = tstate->curexc_traceback;
11197 tstate->curexc_type = 0;
11198 tstate->curexc_value = 0;
11199 tstate->curexc_traceback = 0;
11200 }
11201 #endif
11202
11203 /* RaiseException */
11204 #if PY_MAJOR_VERSION < 3
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,CYTHON_UNUSED PyObject * cause)11205 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
11206 CYTHON_UNUSED PyObject *cause) {
11207 __Pyx_PyThreadState_declare
11208 Py_XINCREF(type);
11209 if (!value || value == Py_None)
11210 value = NULL;
11211 else
11212 Py_INCREF(value);
11213 if (!tb || tb == Py_None)
11214 tb = NULL;
11215 else {
11216 Py_INCREF(tb);
11217 if (!PyTraceBack_Check(tb)) {
11218 PyErr_SetString(PyExc_TypeError,
11219 "raise: arg 3 must be a traceback or None");
11220 goto raise_error;
11221 }
11222 }
11223 if (PyType_Check(type)) {
11224 #if CYTHON_COMPILING_IN_PYPY
11225 if (!value) {
11226 Py_INCREF(Py_None);
11227 value = Py_None;
11228 }
11229 #endif
11230 PyErr_NormalizeException(&type, &value, &tb);
11231 } else {
11232 if (value) {
11233 PyErr_SetString(PyExc_TypeError,
11234 "instance exception may not have a separate value");
11235 goto raise_error;
11236 }
11237 value = type;
11238 type = (PyObject*) Py_TYPE(type);
11239 Py_INCREF(type);
11240 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
11241 PyErr_SetString(PyExc_TypeError,
11242 "raise: exception class must be a subclass of BaseException");
11243 goto raise_error;
11244 }
11245 }
11246 __Pyx_PyThreadState_assign
11247 __Pyx_ErrRestore(type, value, tb);
11248 return;
11249 raise_error:
11250 Py_XDECREF(value);
11251 Py_XDECREF(type);
11252 Py_XDECREF(tb);
11253 return;
11254 }
11255 #else
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,PyObject * cause)11256 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
11257 PyObject* owned_instance = NULL;
11258 if (tb == Py_None) {
11259 tb = 0;
11260 } else if (tb && !PyTraceBack_Check(tb)) {
11261 PyErr_SetString(PyExc_TypeError,
11262 "raise: arg 3 must be a traceback or None");
11263 goto bad;
11264 }
11265 if (value == Py_None)
11266 value = 0;
11267 if (PyExceptionInstance_Check(type)) {
11268 if (value) {
11269 PyErr_SetString(PyExc_TypeError,
11270 "instance exception may not have a separate value");
11271 goto bad;
11272 }
11273 value = type;
11274 type = (PyObject*) Py_TYPE(value);
11275 } else if (PyExceptionClass_Check(type)) {
11276 PyObject *instance_class = NULL;
11277 if (value && PyExceptionInstance_Check(value)) {
11278 instance_class = (PyObject*) Py_TYPE(value);
11279 if (instance_class != type) {
11280 int is_subclass = PyObject_IsSubclass(instance_class, type);
11281 if (!is_subclass) {
11282 instance_class = NULL;
11283 } else if (unlikely(is_subclass == -1)) {
11284 goto bad;
11285 } else {
11286 type = instance_class;
11287 }
11288 }
11289 }
11290 if (!instance_class) {
11291 PyObject *args;
11292 if (!value)
11293 args = PyTuple_New(0);
11294 else if (PyTuple_Check(value)) {
11295 Py_INCREF(value);
11296 args = value;
11297 } else
11298 args = PyTuple_Pack(1, value);
11299 if (!args)
11300 goto bad;
11301 owned_instance = PyObject_Call(type, args, NULL);
11302 Py_DECREF(args);
11303 if (!owned_instance)
11304 goto bad;
11305 value = owned_instance;
11306 if (!PyExceptionInstance_Check(value)) {
11307 PyErr_Format(PyExc_TypeError,
11308 "calling %R should have returned an instance of "
11309 "BaseException, not %R",
11310 type, Py_TYPE(value));
11311 goto bad;
11312 }
11313 }
11314 } else {
11315 PyErr_SetString(PyExc_TypeError,
11316 "raise: exception class must be a subclass of BaseException");
11317 goto bad;
11318 }
11319 if (cause) {
11320 PyObject *fixed_cause;
11321 if (cause == Py_None) {
11322 fixed_cause = NULL;
11323 } else if (PyExceptionClass_Check(cause)) {
11324 fixed_cause = PyObject_CallObject(cause, NULL);
11325 if (fixed_cause == NULL)
11326 goto bad;
11327 } else if (PyExceptionInstance_Check(cause)) {
11328 fixed_cause = cause;
11329 Py_INCREF(fixed_cause);
11330 } else {
11331 PyErr_SetString(PyExc_TypeError,
11332 "exception causes must derive from "
11333 "BaseException");
11334 goto bad;
11335 }
11336 PyException_SetCause(value, fixed_cause);
11337 }
11338 PyErr_SetObject(type, value);
11339 if (tb) {
11340 #if CYTHON_COMPILING_IN_PYPY
11341 PyObject *tmp_type, *tmp_value, *tmp_tb;
11342 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
11343 Py_INCREF(tb);
11344 PyErr_Restore(tmp_type, tmp_value, tb);
11345 Py_XDECREF(tmp_tb);
11346 #else
11347 PyThreadState *tstate = __Pyx_PyThreadState_Current;
11348 PyObject* tmp_tb = tstate->curexc_traceback;
11349 if (tb != tmp_tb) {
11350 Py_INCREF(tb);
11351 tstate->curexc_traceback = tb;
11352 Py_XDECREF(tmp_tb);
11353 }
11354 #endif
11355 }
11356 bad:
11357 Py_XDECREF(owned_instance);
11358 return;
11359 }
11360 #endif
11361
11362 /* IterFinish */
__Pyx_IterFinish(void)11363 static CYTHON_INLINE int __Pyx_IterFinish(void) {
11364 #if CYTHON_FAST_THREAD_STATE
11365 PyThreadState *tstate = __Pyx_PyThreadState_Current;
11366 PyObject* exc_type = tstate->curexc_type;
11367 if (unlikely(exc_type)) {
11368 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
11369 PyObject *exc_value, *exc_tb;
11370 exc_value = tstate->curexc_value;
11371 exc_tb = tstate->curexc_traceback;
11372 tstate->curexc_type = 0;
11373 tstate->curexc_value = 0;
11374 tstate->curexc_traceback = 0;
11375 Py_DECREF(exc_type);
11376 Py_XDECREF(exc_value);
11377 Py_XDECREF(exc_tb);
11378 return 0;
11379 } else {
11380 return -1;
11381 }
11382 }
11383 return 0;
11384 #else
11385 if (unlikely(PyErr_Occurred())) {
11386 if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
11387 PyErr_Clear();
11388 return 0;
11389 } else {
11390 return -1;
11391 }
11392 }
11393 return 0;
11394 #endif
11395 }
11396
11397 /* PyObjectCallNoArg */
11398 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_CallNoArg(PyObject * func)11399 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
11400 #if CYTHON_FAST_PYCALL
11401 if (PyFunction_Check(func)) {
11402 return __Pyx_PyFunction_FastCall(func, NULL, 0);
11403 }
11404 #endif
11405 #ifdef __Pyx_CyFunction_USED
11406 if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
11407 #else
11408 if (likely(PyCFunction_Check(func)))
11409 #endif
11410 {
11411 if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
11412 return __Pyx_PyObject_CallMethO(func, NULL);
11413 }
11414 }
11415 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
11416 }
11417 #endif
11418
11419 /* PyObjectGetMethod */
__Pyx_PyObject_GetMethod(PyObject * obj,PyObject * name,PyObject ** method)11420 static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
11421 PyObject *attr;
11422 #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
11423 PyTypeObject *tp = Py_TYPE(obj);
11424 PyObject *descr;
11425 descrgetfunc f = NULL;
11426 PyObject **dictptr, *dict;
11427 int meth_found = 0;
11428 assert (*method == NULL);
11429 if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
11430 attr = __Pyx_PyObject_GetAttrStr(obj, name);
11431 goto try_unpack;
11432 }
11433 if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
11434 return 0;
11435 }
11436 descr = _PyType_Lookup(tp, name);
11437 if (likely(descr != NULL)) {
11438 Py_INCREF(descr);
11439 #if PY_MAJOR_VERSION >= 3
11440 #ifdef __Pyx_CyFunction_USED
11441 if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
11442 #else
11443 if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type)))
11444 #endif
11445 #else
11446 #ifdef __Pyx_CyFunction_USED
11447 if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
11448 #else
11449 if (likely(PyFunction_Check(descr)))
11450 #endif
11451 #endif
11452 {
11453 meth_found = 1;
11454 } else {
11455 f = Py_TYPE(descr)->tp_descr_get;
11456 if (f != NULL && PyDescr_IsData(descr)) {
11457 attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
11458 Py_DECREF(descr);
11459 goto try_unpack;
11460 }
11461 }
11462 }
11463 dictptr = _PyObject_GetDictPtr(obj);
11464 if (dictptr != NULL && (dict = *dictptr) != NULL) {
11465 Py_INCREF(dict);
11466 attr = __Pyx_PyDict_GetItemStr(dict, name);
11467 if (attr != NULL) {
11468 Py_INCREF(attr);
11469 Py_DECREF(dict);
11470 Py_XDECREF(descr);
11471 goto try_unpack;
11472 }
11473 Py_DECREF(dict);
11474 }
11475 if (meth_found) {
11476 *method = descr;
11477 return 1;
11478 }
11479 if (f != NULL) {
11480 attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
11481 Py_DECREF(descr);
11482 goto try_unpack;
11483 }
11484 if (descr != NULL) {
11485 *method = descr;
11486 return 0;
11487 }
11488 PyErr_Format(PyExc_AttributeError,
11489 #if PY_MAJOR_VERSION >= 3
11490 "'%.50s' object has no attribute '%U'",
11491 tp->tp_name, name);
11492 #else
11493 "'%.50s' object has no attribute '%.400s'",
11494 tp->tp_name, PyString_AS_STRING(name));
11495 #endif
11496 return 0;
11497 #else
11498 attr = __Pyx_PyObject_GetAttrStr(obj, name);
11499 goto try_unpack;
11500 #endif
11501 try_unpack:
11502 #if CYTHON_UNPACK_METHODS
11503 if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
11504 PyObject *function = PyMethod_GET_FUNCTION(attr);
11505 Py_INCREF(function);
11506 Py_DECREF(attr);
11507 *method = function;
11508 return 1;
11509 }
11510 #endif
11511 *method = attr;
11512 return 0;
11513 }
11514
11515 /* PyObjectCallMethod0 */
__Pyx_PyObject_CallMethod0(PyObject * obj,PyObject * method_name)11516 static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
11517 PyObject *method = NULL, *result = NULL;
11518 int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
11519 if (likely(is_method)) {
11520 result = __Pyx_PyObject_CallOneArg(method, obj);
11521 Py_DECREF(method);
11522 return result;
11523 }
11524 if (unlikely(!method)) goto bad;
11525 result = __Pyx_PyObject_CallNoArg(method);
11526 Py_DECREF(method);
11527 bad:
11528 return result;
11529 }
11530
11531 /* RaiseNeedMoreValuesToUnpack */
__Pyx_RaiseNeedMoreValuesError(Py_ssize_t index)11532 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
11533 PyErr_Format(PyExc_ValueError,
11534 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
11535 index, (index == 1) ? "" : "s");
11536 }
11537
11538 /* RaiseTooManyValuesToUnpack */
__Pyx_RaiseTooManyValuesError(Py_ssize_t expected)11539 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
11540 PyErr_Format(PyExc_ValueError,
11541 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
11542 }
11543
11544 /* UnpackItemEndCheck */
__Pyx_IternextUnpackEndCheck(PyObject * retval,Py_ssize_t expected)11545 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
11546 if (unlikely(retval)) {
11547 Py_DECREF(retval);
11548 __Pyx_RaiseTooManyValuesError(expected);
11549 return -1;
11550 } else {
11551 return __Pyx_IterFinish();
11552 }
11553 return 0;
11554 }
11555
11556 /* RaiseNoneIterError */
__Pyx_RaiseNoneNotIterableError(void)11557 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
11558 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
11559 }
11560
11561 /* UnpackTupleError */
__Pyx_UnpackTupleError(PyObject * t,Py_ssize_t index)11562 static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
11563 if (t == Py_None) {
11564 __Pyx_RaiseNoneNotIterableError();
11565 } else if (PyTuple_GET_SIZE(t) < index) {
11566 __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
11567 } else {
11568 __Pyx_RaiseTooManyValuesError(index);
11569 }
11570 }
11571
11572 /* UnpackTuple2 */
__Pyx_unpack_tuple2_exact(PyObject * tuple,PyObject ** pvalue1,PyObject ** pvalue2,int decref_tuple)11573 static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
11574 PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) {
11575 PyObject *value1 = NULL, *value2 = NULL;
11576 #if CYTHON_COMPILING_IN_PYPY
11577 value1 = PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad;
11578 value2 = PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad;
11579 #else
11580 value1 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(value1);
11581 value2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(value2);
11582 #endif
11583 if (decref_tuple) {
11584 Py_DECREF(tuple);
11585 }
11586 *pvalue1 = value1;
11587 *pvalue2 = value2;
11588 return 0;
11589 #if CYTHON_COMPILING_IN_PYPY
11590 bad:
11591 Py_XDECREF(value1);
11592 Py_XDECREF(value2);
11593 if (decref_tuple) { Py_XDECREF(tuple); }
11594 return -1;
11595 #endif
11596 }
__Pyx_unpack_tuple2_generic(PyObject * tuple,PyObject ** pvalue1,PyObject ** pvalue2,int has_known_size,int decref_tuple)11597 static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
11598 int has_known_size, int decref_tuple) {
11599 Py_ssize_t index;
11600 PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
11601 iternextfunc iternext;
11602 iter = PyObject_GetIter(tuple);
11603 if (unlikely(!iter)) goto bad;
11604 if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
11605 iternext = Py_TYPE(iter)->tp_iternext;
11606 value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
11607 value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
11608 if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
11609 Py_DECREF(iter);
11610 *pvalue1 = value1;
11611 *pvalue2 = value2;
11612 return 0;
11613 unpacking_failed:
11614 if (!has_known_size && __Pyx_IterFinish() == 0)
11615 __Pyx_RaiseNeedMoreValuesError(index);
11616 bad:
11617 Py_XDECREF(iter);
11618 Py_XDECREF(value1);
11619 Py_XDECREF(value2);
11620 if (decref_tuple) { Py_XDECREF(tuple); }
11621 return -1;
11622 }
11623
11624 /* dict_iter */
__Pyx_dict_iterator(PyObject * iterable,int is_dict,PyObject * method_name,Py_ssize_t * p_orig_length,int * p_source_is_dict)11625 static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
11626 Py_ssize_t* p_orig_length, int* p_source_is_dict) {
11627 is_dict = is_dict || likely(PyDict_CheckExact(iterable));
11628 *p_source_is_dict = is_dict;
11629 if (is_dict) {
11630 #if !CYTHON_COMPILING_IN_PYPY
11631 *p_orig_length = PyDict_Size(iterable);
11632 Py_INCREF(iterable);
11633 return iterable;
11634 #elif PY_MAJOR_VERSION >= 3
11635 static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL;
11636 PyObject **pp = NULL;
11637 if (method_name) {
11638 const char *name = PyUnicode_AsUTF8(method_name);
11639 if (strcmp(name, "iteritems") == 0) pp = &py_items;
11640 else if (strcmp(name, "iterkeys") == 0) pp = &py_keys;
11641 else if (strcmp(name, "itervalues") == 0) pp = &py_values;
11642 if (pp) {
11643 if (!*pp) {
11644 *pp = PyUnicode_FromString(name + 4);
11645 if (!*pp)
11646 return NULL;
11647 }
11648 method_name = *pp;
11649 }
11650 }
11651 #endif
11652 }
11653 *p_orig_length = 0;
11654 if (method_name) {
11655 PyObject* iter;
11656 iterable = __Pyx_PyObject_CallMethod0(iterable, method_name);
11657 if (!iterable)
11658 return NULL;
11659 #if !CYTHON_COMPILING_IN_PYPY
11660 if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable))
11661 return iterable;
11662 #endif
11663 iter = PyObject_GetIter(iterable);
11664 Py_DECREF(iterable);
11665 return iter;
11666 }
11667 return PyObject_GetIter(iterable);
11668 }
__Pyx_dict_iter_next(PyObject * iter_obj,CYTHON_NCP_UNUSED Py_ssize_t orig_length,CYTHON_NCP_UNUSED Py_ssize_t * ppos,PyObject ** pkey,PyObject ** pvalue,PyObject ** pitem,int source_is_dict)11669 static CYTHON_INLINE int __Pyx_dict_iter_next(
11670 PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos,
11671 PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) {
11672 PyObject* next_item;
11673 #if !CYTHON_COMPILING_IN_PYPY
11674 if (source_is_dict) {
11675 PyObject *key, *value;
11676 if (unlikely(orig_length != PyDict_Size(iter_obj))) {
11677 PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration");
11678 return -1;
11679 }
11680 if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) {
11681 return 0;
11682 }
11683 if (pitem) {
11684 PyObject* tuple = PyTuple_New(2);
11685 if (unlikely(!tuple)) {
11686 return -1;
11687 }
11688 Py_INCREF(key);
11689 Py_INCREF(value);
11690 PyTuple_SET_ITEM(tuple, 0, key);
11691 PyTuple_SET_ITEM(tuple, 1, value);
11692 *pitem = tuple;
11693 } else {
11694 if (pkey) {
11695 Py_INCREF(key);
11696 *pkey = key;
11697 }
11698 if (pvalue) {
11699 Py_INCREF(value);
11700 *pvalue = value;
11701 }
11702 }
11703 return 1;
11704 } else if (PyTuple_CheckExact(iter_obj)) {
11705 Py_ssize_t pos = *ppos;
11706 if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0;
11707 *ppos = pos + 1;
11708 next_item = PyTuple_GET_ITEM(iter_obj, pos);
11709 Py_INCREF(next_item);
11710 } else if (PyList_CheckExact(iter_obj)) {
11711 Py_ssize_t pos = *ppos;
11712 if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0;
11713 *ppos = pos + 1;
11714 next_item = PyList_GET_ITEM(iter_obj, pos);
11715 Py_INCREF(next_item);
11716 } else
11717 #endif
11718 {
11719 next_item = PyIter_Next(iter_obj);
11720 if (unlikely(!next_item)) {
11721 return __Pyx_IterFinish();
11722 }
11723 }
11724 if (pitem) {
11725 *pitem = next_item;
11726 } else if (pkey && pvalue) {
11727 if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1))
11728 return -1;
11729 } else if (pkey) {
11730 *pkey = next_item;
11731 } else {
11732 *pvalue = next_item;
11733 }
11734 return 1;
11735 }
11736
11737 /* PyObjectFormatAndDecref */
__Pyx_PyObject_FormatSimpleAndDecref(PyObject * s,PyObject * f)11738 static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) {
11739 if (unlikely(!s)) return NULL;
11740 if (likely(PyUnicode_CheckExact(s))) return s;
11741 #if PY_MAJOR_VERSION < 3
11742 if (likely(PyString_CheckExact(s))) {
11743 PyObject *result = PyUnicode_FromEncodedObject(s, NULL, "strict");
11744 Py_DECREF(s);
11745 return result;
11746 }
11747 #endif
11748 return __Pyx_PyObject_FormatAndDecref(s, f);
11749 }
__Pyx_PyObject_FormatAndDecref(PyObject * s,PyObject * f)11750 static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) {
11751 PyObject *result = PyObject_Format(s, f);
11752 Py_DECREF(s);
11753 return result;
11754 }
11755
11756 /* JoinPyUnicode */
__Pyx_PyUnicode_Join(PyObject * value_tuple,Py_ssize_t value_count,Py_ssize_t result_ulength,CYTHON_UNUSED Py_UCS4 max_char)11757 static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
11758 CYTHON_UNUSED Py_UCS4 max_char) {
11759 #if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11760 PyObject *result_uval;
11761 int result_ukind;
11762 Py_ssize_t i, char_pos;
11763 void *result_udata;
11764 #if CYTHON_PEP393_ENABLED
11765 result_uval = PyUnicode_New(result_ulength, max_char);
11766 if (unlikely(!result_uval)) return NULL;
11767 result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND;
11768 result_udata = PyUnicode_DATA(result_uval);
11769 #else
11770 result_uval = PyUnicode_FromUnicode(NULL, result_ulength);
11771 if (unlikely(!result_uval)) return NULL;
11772 result_ukind = sizeof(Py_UNICODE);
11773 result_udata = PyUnicode_AS_UNICODE(result_uval);
11774 #endif
11775 char_pos = 0;
11776 for (i=0; i < value_count; i++) {
11777 int ukind;
11778 Py_ssize_t ulength;
11779 void *udata;
11780 PyObject *uval = PyTuple_GET_ITEM(value_tuple, i);
11781 if (unlikely(__Pyx_PyUnicode_READY(uval)))
11782 goto bad;
11783 ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
11784 if (unlikely(!ulength))
11785 continue;
11786 if (unlikely(char_pos + ulength < 0))
11787 goto overflow;
11788 ukind = __Pyx_PyUnicode_KIND(uval);
11789 udata = __Pyx_PyUnicode_DATA(uval);
11790 if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) {
11791 memcpy((char *)result_udata + char_pos * result_ukind, udata, (size_t) (ulength * result_ukind));
11792 } else {
11793 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters)
11794 _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
11795 #else
11796 Py_ssize_t j;
11797 for (j=0; j < ulength; j++) {
11798 Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
11799 __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
11800 }
11801 #endif
11802 }
11803 char_pos += ulength;
11804 }
11805 return result_uval;
11806 overflow:
11807 PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string");
11808 bad:
11809 Py_DECREF(result_uval);
11810 return NULL;
11811 #else
11812 result_ulength++;
11813 value_count++;
11814 return PyUnicode_Join(__pyx_empty_unicode, value_tuple);
11815 #endif
11816 }
11817
11818 /* PyDictVersioning */
11819 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
__Pyx_get_tp_dict_version(PyObject * obj)11820 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
11821 PyObject *dict = Py_TYPE(obj)->tp_dict;
11822 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
11823 }
__Pyx_get_object_dict_version(PyObject * obj)11824 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
11825 PyObject **dictptr = NULL;
11826 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
11827 if (offset) {
11828 #if CYTHON_COMPILING_IN_CPYTHON
11829 dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
11830 #else
11831 dictptr = _PyObject_GetDictPtr(obj);
11832 #endif
11833 }
11834 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
11835 }
__Pyx_object_dict_version_matches(PyObject * obj,PY_UINT64_T tp_dict_version,PY_UINT64_T obj_dict_version)11836 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
11837 PyObject *dict = Py_TYPE(obj)->tp_dict;
11838 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
11839 return 0;
11840 return obj_dict_version == __Pyx_get_object_dict_version(obj);
11841 }
11842 #endif
11843
11844 /* GetModuleGlobalName */
11845 #if CYTHON_USE_DICT_VERSIONS
__Pyx__GetModuleGlobalName(PyObject * name,PY_UINT64_T * dict_version,PyObject ** dict_cached_value)11846 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
11847 #else
11848 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
11849 #endif
11850 {
11851 PyObject *result;
11852 #if !CYTHON_AVOID_BORROWED_REFS
11853 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
11854 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
11855 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
11856 if (likely(result)) {
11857 return __Pyx_NewRef(result);
11858 } else if (unlikely(PyErr_Occurred())) {
11859 return NULL;
11860 }
11861 #else
11862 result = PyDict_GetItem(__pyx_d, name);
11863 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
11864 if (likely(result)) {
11865 return __Pyx_NewRef(result);
11866 }
11867 #endif
11868 #else
11869 result = PyObject_GetItem(__pyx_d, name);
11870 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
11871 if (likely(result)) {
11872 return __Pyx_NewRef(result);
11873 }
11874 PyErr_Clear();
11875 #endif
11876 return __Pyx_GetBuiltinName(name);
11877 }
11878
11879 /* PyErrExceptionMatches */
11880 #if CYTHON_FAST_THREAD_STATE
__Pyx_PyErr_ExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)11881 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
11882 Py_ssize_t i, n;
11883 n = PyTuple_GET_SIZE(tuple);
11884 #if PY_MAJOR_VERSION >= 3
11885 for (i=0; i<n; i++) {
11886 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
11887 }
11888 #endif
11889 for (i=0; i<n; i++) {
11890 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
11891 }
11892 return 0;
11893 }
__Pyx_PyErr_ExceptionMatchesInState(PyThreadState * tstate,PyObject * err)11894 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
11895 PyObject *exc_type = tstate->curexc_type;
11896 if (exc_type == err) return 1;
11897 if (unlikely(!exc_type)) return 0;
11898 if (unlikely(PyTuple_Check(err)))
11899 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
11900 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
11901 }
11902 #endif
11903
11904 /* GetAttr */
__Pyx_GetAttr(PyObject * o,PyObject * n)11905 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
11906 #if CYTHON_USE_TYPE_SLOTS
11907 #if PY_MAJOR_VERSION >= 3
11908 if (likely(PyUnicode_Check(n)))
11909 #else
11910 if (likely(PyString_Check(n)))
11911 #endif
11912 return __Pyx_PyObject_GetAttrStr(o, n);
11913 #endif
11914 return PyObject_GetAttr(o, n);
11915 }
11916
11917 /* GetAttr3 */
__Pyx_GetAttr3Default(PyObject * d)11918 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
11919 __Pyx_PyThreadState_declare
11920 __Pyx_PyThreadState_assign
11921 if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
11922 return NULL;
11923 __Pyx_PyErr_Clear();
11924 Py_INCREF(d);
11925 return d;
11926 }
__Pyx_GetAttr3(PyObject * o,PyObject * n,PyObject * d)11927 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
11928 PyObject *r = __Pyx_GetAttr(o, n);
11929 return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
11930 }
11931
11932 /* None */
__Pyx_RaiseClosureNameError(const char * varname)11933 static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
11934 PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
11935 }
11936
11937 /* GetItemInt */
__Pyx_GetItemInt_Generic(PyObject * o,PyObject * j)11938 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
11939 PyObject *r;
11940 if (!j) return NULL;
11941 r = PyObject_GetItem(o, j);
11942 Py_DECREF(j);
11943 return r;
11944 }
__Pyx_GetItemInt_List_Fast(PyObject * o,Py_ssize_t i,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)11945 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
11946 CYTHON_NCP_UNUSED int wraparound,
11947 CYTHON_NCP_UNUSED int boundscheck) {
11948 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11949 Py_ssize_t wrapped_i = i;
11950 if (wraparound & unlikely(i < 0)) {
11951 wrapped_i += PyList_GET_SIZE(o);
11952 }
11953 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
11954 PyObject *r = PyList_GET_ITEM(o, wrapped_i);
11955 Py_INCREF(r);
11956 return r;
11957 }
11958 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
11959 #else
11960 return PySequence_GetItem(o, i);
11961 #endif
11962 }
__Pyx_GetItemInt_Tuple_Fast(PyObject * o,Py_ssize_t i,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)11963 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
11964 CYTHON_NCP_UNUSED int wraparound,
11965 CYTHON_NCP_UNUSED int boundscheck) {
11966 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11967 Py_ssize_t wrapped_i = i;
11968 if (wraparound & unlikely(i < 0)) {
11969 wrapped_i += PyTuple_GET_SIZE(o);
11970 }
11971 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
11972 PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
11973 Py_INCREF(r);
11974 return r;
11975 }
11976 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
11977 #else
11978 return PySequence_GetItem(o, i);
11979 #endif
11980 }
__Pyx_GetItemInt_Fast(PyObject * o,Py_ssize_t i,int is_list,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)11981 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
11982 CYTHON_NCP_UNUSED int wraparound,
11983 CYTHON_NCP_UNUSED int boundscheck) {
11984 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
11985 if (is_list || PyList_CheckExact(o)) {
11986 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
11987 if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
11988 PyObject *r = PyList_GET_ITEM(o, n);
11989 Py_INCREF(r);
11990 return r;
11991 }
11992 }
11993 else if (PyTuple_CheckExact(o)) {
11994 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
11995 if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
11996 PyObject *r = PyTuple_GET_ITEM(o, n);
11997 Py_INCREF(r);
11998 return r;
11999 }
12000 } else {
12001 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
12002 if (likely(m && m->sq_item)) {
12003 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
12004 Py_ssize_t l = m->sq_length(o);
12005 if (likely(l >= 0)) {
12006 i += l;
12007 } else {
12008 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
12009 return NULL;
12010 PyErr_Clear();
12011 }
12012 }
12013 return m->sq_item(o, i);
12014 }
12015 }
12016 #else
12017 if (is_list || PySequence_Check(o)) {
12018 return PySequence_GetItem(o, i);
12019 }
12020 #endif
12021 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
12022 }
12023
12024 /* ObjectGetItem */
12025 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetIndex(PyObject * obj,PyObject * index)12026 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
12027 PyObject *runerr;
12028 Py_ssize_t key_value;
12029 PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
12030 if (unlikely(!(m && m->sq_item))) {
12031 PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
12032 return NULL;
12033 }
12034 key_value = __Pyx_PyIndex_AsSsize_t(index);
12035 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
12036 return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
12037 }
12038 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
12039 PyErr_Clear();
12040 PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
12041 }
12042 return NULL;
12043 }
__Pyx_PyObject_GetItem(PyObject * obj,PyObject * key)12044 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
12045 PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
12046 if (likely(m && m->mp_subscript)) {
12047 return m->mp_subscript(obj, key);
12048 }
12049 return __Pyx_PyObject_GetIndex(obj, key);
12050 }
12051 #endif
12052
12053 /* GetTopmostException */
12054 #if CYTHON_USE_EXC_INFO_STACK
12055 static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState * tstate)12056 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
12057 {
12058 _PyErr_StackItem *exc_info = tstate->exc_info;
12059 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
12060 exc_info->previous_item != NULL)
12061 {
12062 exc_info = exc_info->previous_item;
12063 }
12064 return exc_info;
12065 }
12066 #endif
12067
12068 /* SaveResetException */
12069 #if CYTHON_FAST_THREAD_STATE
__Pyx__ExceptionSave(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)12070 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
12071 #if CYTHON_USE_EXC_INFO_STACK
12072 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
12073 *type = exc_info->exc_type;
12074 *value = exc_info->exc_value;
12075 *tb = exc_info->exc_traceback;
12076 #else
12077 *type = tstate->exc_type;
12078 *value = tstate->exc_value;
12079 *tb = tstate->exc_traceback;
12080 #endif
12081 Py_XINCREF(*type);
12082 Py_XINCREF(*value);
12083 Py_XINCREF(*tb);
12084 }
__Pyx__ExceptionReset(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)12085 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
12086 PyObject *tmp_type, *tmp_value, *tmp_tb;
12087 #if CYTHON_USE_EXC_INFO_STACK
12088 _PyErr_StackItem *exc_info = tstate->exc_info;
12089 tmp_type = exc_info->exc_type;
12090 tmp_value = exc_info->exc_value;
12091 tmp_tb = exc_info->exc_traceback;
12092 exc_info->exc_type = type;
12093 exc_info->exc_value = value;
12094 exc_info->exc_traceback = tb;
12095 #else
12096 tmp_type = tstate->exc_type;
12097 tmp_value = tstate->exc_value;
12098 tmp_tb = tstate->exc_traceback;
12099 tstate->exc_type = type;
12100 tstate->exc_value = value;
12101 tstate->exc_traceback = tb;
12102 #endif
12103 Py_XDECREF(tmp_type);
12104 Py_XDECREF(tmp_value);
12105 Py_XDECREF(tmp_tb);
12106 }
12107 #endif
12108
12109 /* GetException */
12110 #if CYTHON_FAST_THREAD_STATE
__Pyx__GetException(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)12111 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
12112 #else
12113 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
12114 #endif
12115 {
12116 PyObject *local_type, *local_value, *local_tb;
12117 #if CYTHON_FAST_THREAD_STATE
12118 PyObject *tmp_type, *tmp_value, *tmp_tb;
12119 local_type = tstate->curexc_type;
12120 local_value = tstate->curexc_value;
12121 local_tb = tstate->curexc_traceback;
12122 tstate->curexc_type = 0;
12123 tstate->curexc_value = 0;
12124 tstate->curexc_traceback = 0;
12125 #else
12126 PyErr_Fetch(&local_type, &local_value, &local_tb);
12127 #endif
12128 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
12129 #if CYTHON_FAST_THREAD_STATE
12130 if (unlikely(tstate->curexc_type))
12131 #else
12132 if (unlikely(PyErr_Occurred()))
12133 #endif
12134 goto bad;
12135 #if PY_MAJOR_VERSION >= 3
12136 if (local_tb) {
12137 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
12138 goto bad;
12139 }
12140 #endif
12141 Py_XINCREF(local_tb);
12142 Py_XINCREF(local_type);
12143 Py_XINCREF(local_value);
12144 *type = local_type;
12145 *value = local_value;
12146 *tb = local_tb;
12147 #if CYTHON_FAST_THREAD_STATE
12148 #if CYTHON_USE_EXC_INFO_STACK
12149 {
12150 _PyErr_StackItem *exc_info = tstate->exc_info;
12151 tmp_type = exc_info->exc_type;
12152 tmp_value = exc_info->exc_value;
12153 tmp_tb = exc_info->exc_traceback;
12154 exc_info->exc_type = local_type;
12155 exc_info->exc_value = local_value;
12156 exc_info->exc_traceback = local_tb;
12157 }
12158 #else
12159 tmp_type = tstate->exc_type;
12160 tmp_value = tstate->exc_value;
12161 tmp_tb = tstate->exc_traceback;
12162 tstate->exc_type = local_type;
12163 tstate->exc_value = local_value;
12164 tstate->exc_traceback = local_tb;
12165 #endif
12166 Py_XDECREF(tmp_type);
12167 Py_XDECREF(tmp_value);
12168 Py_XDECREF(tmp_tb);
12169 #else
12170 PyErr_SetExcInfo(local_type, local_value, local_tb);
12171 #endif
12172 return 0;
12173 bad:
12174 *type = 0;
12175 *value = 0;
12176 *tb = 0;
12177 Py_XDECREF(local_type);
12178 Py_XDECREF(local_value);
12179 Py_XDECREF(local_tb);
12180 return -1;
12181 }
12182
12183 /* FetchCommonType */
__Pyx_FetchCommonType(PyTypeObject * type)12184 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
12185 PyObject* fake_module;
12186 PyTypeObject* cached_type = NULL;
12187 fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
12188 if (!fake_module) return NULL;
12189 Py_INCREF(fake_module);
12190 cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
12191 if (cached_type) {
12192 if (!PyType_Check((PyObject*)cached_type)) {
12193 PyErr_Format(PyExc_TypeError,
12194 "Shared Cython type %.200s is not a type object",
12195 type->tp_name);
12196 goto bad;
12197 }
12198 if (cached_type->tp_basicsize != type->tp_basicsize) {
12199 PyErr_Format(PyExc_TypeError,
12200 "Shared Cython type %.200s has the wrong size, try recompiling",
12201 type->tp_name);
12202 goto bad;
12203 }
12204 } else {
12205 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
12206 PyErr_Clear();
12207 if (PyType_Ready(type) < 0) goto bad;
12208 if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
12209 goto bad;
12210 Py_INCREF(type);
12211 cached_type = type;
12212 }
12213 done:
12214 Py_DECREF(fake_module);
12215 return cached_type;
12216 bad:
12217 Py_XDECREF(cached_type);
12218 cached_type = NULL;
12219 goto done;
12220 }
12221
12222 /* CythonFunctionShared */
12223 #include <structmember.h>
12224 static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject * op,CYTHON_UNUSED void * closure)12225 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
12226 {
12227 if (unlikely(op->func_doc == NULL)) {
12228 if (op->func.m_ml->ml_doc) {
12229 #if PY_MAJOR_VERSION >= 3
12230 op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
12231 #else
12232 op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
12233 #endif
12234 if (unlikely(op->func_doc == NULL))
12235 return NULL;
12236 } else {
12237 Py_INCREF(Py_None);
12238 return Py_None;
12239 }
12240 }
12241 Py_INCREF(op->func_doc);
12242 return op->func_doc;
12243 }
12244 static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject * op,PyObject * value,CYTHON_UNUSED void * context)12245 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
12246 {
12247 PyObject *tmp = op->func_doc;
12248 if (value == NULL) {
12249 value = Py_None;
12250 }
12251 Py_INCREF(value);
12252 op->func_doc = value;
12253 Py_XDECREF(tmp);
12254 return 0;
12255 }
12256 static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject * op,CYTHON_UNUSED void * context)12257 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
12258 {
12259 if (unlikely(op->func_name == NULL)) {
12260 #if PY_MAJOR_VERSION >= 3
12261 op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
12262 #else
12263 op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
12264 #endif
12265 if (unlikely(op->func_name == NULL))
12266 return NULL;
12267 }
12268 Py_INCREF(op->func_name);
12269 return op->func_name;
12270 }
12271 static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject * op,PyObject * value,CYTHON_UNUSED void * context)12272 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
12273 {
12274 PyObject *tmp;
12275 #if PY_MAJOR_VERSION >= 3
12276 if (unlikely(value == NULL || !PyUnicode_Check(value)))
12277 #else
12278 if (unlikely(value == NULL || !PyString_Check(value)))
12279 #endif
12280 {
12281 PyErr_SetString(PyExc_TypeError,
12282 "__name__ must be set to a string object");
12283 return -1;
12284 }
12285 tmp = op->func_name;
12286 Py_INCREF(value);
12287 op->func_name = value;
12288 Py_XDECREF(tmp);
12289 return 0;
12290 }
12291 static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject * op,CYTHON_UNUSED void * context)12292 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
12293 {
12294 Py_INCREF(op->func_qualname);
12295 return op->func_qualname;
12296 }
12297 static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject * op,PyObject * value,CYTHON_UNUSED void * context)12298 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
12299 {
12300 PyObject *tmp;
12301 #if PY_MAJOR_VERSION >= 3
12302 if (unlikely(value == NULL || !PyUnicode_Check(value)))
12303 #else
12304 if (unlikely(value == NULL || !PyString_Check(value)))
12305 #endif
12306 {
12307 PyErr_SetString(PyExc_TypeError,
12308 "__qualname__ must be set to a string object");
12309 return -1;
12310 }
12311 tmp = op->func_qualname;
12312 Py_INCREF(value);
12313 op->func_qualname = value;
12314 Py_XDECREF(tmp);
12315 return 0;
12316 }
12317 static PyObject *
__Pyx_CyFunction_get_self(__pyx_CyFunctionObject * m,CYTHON_UNUSED void * closure)12318 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
12319 {
12320 PyObject *self;
12321 self = m->func_closure;
12322 if (self == NULL)
12323 self = Py_None;
12324 Py_INCREF(self);
12325 return self;
12326 }
12327 static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject * op,CYTHON_UNUSED void * context)12328 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
12329 {
12330 if (unlikely(op->func_dict == NULL)) {
12331 op->func_dict = PyDict_New();
12332 if (unlikely(op->func_dict == NULL))
12333 return NULL;
12334 }
12335 Py_INCREF(op->func_dict);
12336 return op->func_dict;
12337 }
12338 static int
__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject * op,PyObject * value,CYTHON_UNUSED void * context)12339 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
12340 {
12341 PyObject *tmp;
12342 if (unlikely(value == NULL)) {
12343 PyErr_SetString(PyExc_TypeError,
12344 "function's dictionary may not be deleted");
12345 return -1;
12346 }
12347 if (unlikely(!PyDict_Check(value))) {
12348 PyErr_SetString(PyExc_TypeError,
12349 "setting function's dictionary to a non-dict");
12350 return -1;
12351 }
12352 tmp = op->func_dict;
12353 Py_INCREF(value);
12354 op->func_dict = value;
12355 Py_XDECREF(tmp);
12356 return 0;
12357 }
12358 static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject * op,CYTHON_UNUSED void * context)12359 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
12360 {
12361 Py_INCREF(op->func_globals);
12362 return op->func_globals;
12363 }
12364 static PyObject *
__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject * op,CYTHON_UNUSED void * context)12365 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
12366 {
12367 Py_INCREF(Py_None);
12368 return Py_None;
12369 }
12370 static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject * op,CYTHON_UNUSED void * context)12371 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
12372 {
12373 PyObject* result = (op->func_code) ? op->func_code : Py_None;
12374 Py_INCREF(result);
12375 return result;
12376 }
12377 static int
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject * op)12378 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
12379 int result = 0;
12380 PyObject *res = op->defaults_getter((PyObject *) op);
12381 if (unlikely(!res))
12382 return -1;
12383 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12384 op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
12385 Py_INCREF(op->defaults_tuple);
12386 op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
12387 Py_INCREF(op->defaults_kwdict);
12388 #else
12389 op->defaults_tuple = PySequence_ITEM(res, 0);
12390 if (unlikely(!op->defaults_tuple)) result = -1;
12391 else {
12392 op->defaults_kwdict = PySequence_ITEM(res, 1);
12393 if (unlikely(!op->defaults_kwdict)) result = -1;
12394 }
12395 #endif
12396 Py_DECREF(res);
12397 return result;
12398 }
12399 static int
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject * op,PyObject * value,CYTHON_UNUSED void * context)12400 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
12401 PyObject* tmp;
12402 if (!value) {
12403 value = Py_None;
12404 } else if (value != Py_None && !PyTuple_Check(value)) {
12405 PyErr_SetString(PyExc_TypeError,
12406 "__defaults__ must be set to a tuple object");
12407 return -1;
12408 }
12409 Py_INCREF(value);
12410 tmp = op->defaults_tuple;
12411 op->defaults_tuple = value;
12412 Py_XDECREF(tmp);
12413 return 0;
12414 }
12415 static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject * op,CYTHON_UNUSED void * context)12416 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
12417 PyObject* result = op->defaults_tuple;
12418 if (unlikely(!result)) {
12419 if (op->defaults_getter) {
12420 if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
12421 result = op->defaults_tuple;
12422 } else {
12423 result = Py_None;
12424 }
12425 }
12426 Py_INCREF(result);
12427 return result;
12428 }
12429 static int
__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject * op,PyObject * value,CYTHON_UNUSED void * context)12430 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
12431 PyObject* tmp;
12432 if (!value) {
12433 value = Py_None;
12434 } else if (value != Py_None && !PyDict_Check(value)) {
12435 PyErr_SetString(PyExc_TypeError,
12436 "__kwdefaults__ must be set to a dict object");
12437 return -1;
12438 }
12439 Py_INCREF(value);
12440 tmp = op->defaults_kwdict;
12441 op->defaults_kwdict = value;
12442 Py_XDECREF(tmp);
12443 return 0;
12444 }
12445 static PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject * op,CYTHON_UNUSED void * context)12446 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
12447 PyObject* result = op->defaults_kwdict;
12448 if (unlikely(!result)) {
12449 if (op->defaults_getter) {
12450 if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
12451 result = op->defaults_kwdict;
12452 } else {
12453 result = Py_None;
12454 }
12455 }
12456 Py_INCREF(result);
12457 return result;
12458 }
12459 static int
__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject * op,PyObject * value,CYTHON_UNUSED void * context)12460 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
12461 PyObject* tmp;
12462 if (!value || value == Py_None) {
12463 value = NULL;
12464 } else if (!PyDict_Check(value)) {
12465 PyErr_SetString(PyExc_TypeError,
12466 "__annotations__ must be set to a dict object");
12467 return -1;
12468 }
12469 Py_XINCREF(value);
12470 tmp = op->func_annotations;
12471 op->func_annotations = value;
12472 Py_XDECREF(tmp);
12473 return 0;
12474 }
12475 static PyObject *
__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject * op,CYTHON_UNUSED void * context)12476 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
12477 PyObject* result = op->func_annotations;
12478 if (unlikely(!result)) {
12479 result = PyDict_New();
12480 if (unlikely(!result)) return NULL;
12481 op->func_annotations = result;
12482 }
12483 Py_INCREF(result);
12484 return result;
12485 }
12486 static PyGetSetDef __pyx_CyFunction_getsets[] = {
12487 {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
12488 {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
12489 {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
12490 {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
12491 {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
12492 {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
12493 {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
12494 {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
12495 {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
12496 {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
12497 {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
12498 {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
12499 {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
12500 {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
12501 {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
12502 {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
12503 {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
12504 {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
12505 {0, 0, 0, 0, 0}
12506 };
12507 static PyMemberDef __pyx_CyFunction_members[] = {
12508 {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
12509 {0, 0, 0, 0, 0}
12510 };
12511 static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject * m,CYTHON_UNUSED PyObject * args)12512 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
12513 {
12514 #if PY_MAJOR_VERSION >= 3
12515 return PyUnicode_FromString(m->func.m_ml->ml_name);
12516 #else
12517 return PyString_FromString(m->func.m_ml->ml_name);
12518 #endif
12519 }
12520 static PyMethodDef __pyx_CyFunction_methods[] = {
12521 {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
12522 {0, 0, 0, 0}
12523 };
12524 #if PY_VERSION_HEX < 0x030500A0
12525 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
12526 #else
12527 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
12528 #endif
__Pyx_CyFunction_Init(__pyx_CyFunctionObject * op,PyMethodDef * ml,int flags,PyObject * qualname,PyObject * closure,PyObject * module,PyObject * globals,PyObject * code)12529 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
12530 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
12531 if (unlikely(op == NULL))
12532 return NULL;
12533 op->flags = flags;
12534 __Pyx_CyFunction_weakreflist(op) = NULL;
12535 op->func.m_ml = ml;
12536 op->func.m_self = (PyObject *) op;
12537 Py_XINCREF(closure);
12538 op->func_closure = closure;
12539 Py_XINCREF(module);
12540 op->func.m_module = module;
12541 op->func_dict = NULL;
12542 op->func_name = NULL;
12543 Py_INCREF(qualname);
12544 op->func_qualname = qualname;
12545 op->func_doc = NULL;
12546 op->func_classobj = NULL;
12547 op->func_globals = globals;
12548 Py_INCREF(op->func_globals);
12549 Py_XINCREF(code);
12550 op->func_code = code;
12551 op->defaults_pyobjects = 0;
12552 op->defaults_size = 0;
12553 op->defaults = NULL;
12554 op->defaults_tuple = NULL;
12555 op->defaults_kwdict = NULL;
12556 op->defaults_getter = NULL;
12557 op->func_annotations = NULL;
12558 return (PyObject *) op;
12559 }
12560 static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject * m)12561 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
12562 {
12563 Py_CLEAR(m->func_closure);
12564 Py_CLEAR(m->func.m_module);
12565 Py_CLEAR(m->func_dict);
12566 Py_CLEAR(m->func_name);
12567 Py_CLEAR(m->func_qualname);
12568 Py_CLEAR(m->func_doc);
12569 Py_CLEAR(m->func_globals);
12570 Py_CLEAR(m->func_code);
12571 Py_CLEAR(m->func_classobj);
12572 Py_CLEAR(m->defaults_tuple);
12573 Py_CLEAR(m->defaults_kwdict);
12574 Py_CLEAR(m->func_annotations);
12575 if (m->defaults) {
12576 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
12577 int i;
12578 for (i = 0; i < m->defaults_pyobjects; i++)
12579 Py_XDECREF(pydefaults[i]);
12580 PyObject_Free(m->defaults);
12581 m->defaults = NULL;
12582 }
12583 return 0;
12584 }
__Pyx__CyFunction_dealloc(__pyx_CyFunctionObject * m)12585 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
12586 {
12587 if (__Pyx_CyFunction_weakreflist(m) != NULL)
12588 PyObject_ClearWeakRefs((PyObject *) m);
12589 __Pyx_CyFunction_clear(m);
12590 PyObject_GC_Del(m);
12591 }
__Pyx_CyFunction_dealloc(__pyx_CyFunctionObject * m)12592 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
12593 {
12594 PyObject_GC_UnTrack(m);
12595 __Pyx__CyFunction_dealloc(m);
12596 }
__Pyx_CyFunction_traverse(__pyx_CyFunctionObject * m,visitproc visit,void * arg)12597 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
12598 {
12599 Py_VISIT(m->func_closure);
12600 Py_VISIT(m->func.m_module);
12601 Py_VISIT(m->func_dict);
12602 Py_VISIT(m->func_name);
12603 Py_VISIT(m->func_qualname);
12604 Py_VISIT(m->func_doc);
12605 Py_VISIT(m->func_globals);
12606 Py_VISIT(m->func_code);
12607 Py_VISIT(m->func_classobj);
12608 Py_VISIT(m->defaults_tuple);
12609 Py_VISIT(m->defaults_kwdict);
12610 if (m->defaults) {
12611 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
12612 int i;
12613 for (i = 0; i < m->defaults_pyobjects; i++)
12614 Py_VISIT(pydefaults[i]);
12615 }
12616 return 0;
12617 }
__Pyx_CyFunction_descr_get(PyObject * func,PyObject * obj,PyObject * type)12618 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
12619 {
12620 #if PY_MAJOR_VERSION < 3
12621 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
12622 if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
12623 Py_INCREF(func);
12624 return func;
12625 }
12626 if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
12627 if (type == NULL)
12628 type = (PyObject *)(Py_TYPE(obj));
12629 return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
12630 }
12631 if (obj == Py_None)
12632 obj = NULL;
12633 #endif
12634 return __Pyx_PyMethod_New(func, obj, type);
12635 }
12636 static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject * op)12637 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
12638 {
12639 #if PY_MAJOR_VERSION >= 3
12640 return PyUnicode_FromFormat("<cyfunction %U at %p>",
12641 op->func_qualname, (void *)op);
12642 #else
12643 return PyString_FromFormat("<cyfunction %s at %p>",
12644 PyString_AsString(op->func_qualname), (void *)op);
12645 #endif
12646 }
__Pyx_CyFunction_CallMethod(PyObject * func,PyObject * self,PyObject * arg,PyObject * kw)12647 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
12648 PyCFunctionObject* f = (PyCFunctionObject*)func;
12649 PyCFunction meth = f->m_ml->ml_meth;
12650 Py_ssize_t size;
12651 switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
12652 case METH_VARARGS:
12653 if (likely(kw == NULL || PyDict_Size(kw) == 0))
12654 return (*meth)(self, arg);
12655 break;
12656 case METH_VARARGS | METH_KEYWORDS:
12657 return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
12658 case METH_NOARGS:
12659 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
12660 size = PyTuple_GET_SIZE(arg);
12661 if (likely(size == 0))
12662 return (*meth)(self, NULL);
12663 PyErr_Format(PyExc_TypeError,
12664 "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
12665 f->m_ml->ml_name, size);
12666 return NULL;
12667 }
12668 break;
12669 case METH_O:
12670 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
12671 size = PyTuple_GET_SIZE(arg);
12672 if (likely(size == 1)) {
12673 PyObject *result, *arg0;
12674 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12675 arg0 = PyTuple_GET_ITEM(arg, 0);
12676 #else
12677 arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
12678 #endif
12679 result = (*meth)(self, arg0);
12680 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
12681 Py_DECREF(arg0);
12682 #endif
12683 return result;
12684 }
12685 PyErr_Format(PyExc_TypeError,
12686 "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
12687 f->m_ml->ml_name, size);
12688 return NULL;
12689 }
12690 break;
12691 default:
12692 PyErr_SetString(PyExc_SystemError, "Bad call flags in "
12693 "__Pyx_CyFunction_Call. METH_OLDARGS is no "
12694 "longer supported!");
12695 return NULL;
12696 }
12697 PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
12698 f->m_ml->ml_name);
12699 return NULL;
12700 }
__Pyx_CyFunction_Call(PyObject * func,PyObject * arg,PyObject * kw)12701 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
12702 return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
12703 }
__Pyx_CyFunction_CallAsMethod(PyObject * func,PyObject * args,PyObject * kw)12704 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
12705 PyObject *result;
12706 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
12707 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
12708 Py_ssize_t argc;
12709 PyObject *new_args;
12710 PyObject *self;
12711 argc = PyTuple_GET_SIZE(args);
12712 new_args = PyTuple_GetSlice(args, 1, argc);
12713 if (unlikely(!new_args))
12714 return NULL;
12715 self = PyTuple_GetItem(args, 0);
12716 if (unlikely(!self)) {
12717 Py_DECREF(new_args);
12718 return NULL;
12719 }
12720 result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
12721 Py_DECREF(new_args);
12722 } else {
12723 result = __Pyx_CyFunction_Call(func, args, kw);
12724 }
12725 return result;
12726 }
12727 static PyTypeObject __pyx_CyFunctionType_type = {
12728 PyVarObject_HEAD_INIT(0, 0)
12729 "cython_function_or_method",
12730 sizeof(__pyx_CyFunctionObject),
12731 0,
12732 (destructor) __Pyx_CyFunction_dealloc,
12733 0,
12734 0,
12735 0,
12736 #if PY_MAJOR_VERSION < 3
12737 0,
12738 #else
12739 0,
12740 #endif
12741 (reprfunc) __Pyx_CyFunction_repr,
12742 0,
12743 0,
12744 0,
12745 0,
12746 __Pyx_CyFunction_CallAsMethod,
12747 0,
12748 0,
12749 0,
12750 0,
12751 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
12752 0,
12753 (traverseproc) __Pyx_CyFunction_traverse,
12754 (inquiry) __Pyx_CyFunction_clear,
12755 0,
12756 #if PY_VERSION_HEX < 0x030500A0
12757 offsetof(__pyx_CyFunctionObject, func_weakreflist),
12758 #else
12759 offsetof(PyCFunctionObject, m_weakreflist),
12760 #endif
12761 0,
12762 0,
12763 __pyx_CyFunction_methods,
12764 __pyx_CyFunction_members,
12765 __pyx_CyFunction_getsets,
12766 0,
12767 0,
12768 __Pyx_CyFunction_descr_get,
12769 0,
12770 offsetof(__pyx_CyFunctionObject, func_dict),
12771 0,
12772 0,
12773 0,
12774 0,
12775 0,
12776 0,
12777 0,
12778 0,
12779 0,
12780 0,
12781 0,
12782 0,
12783 #if PY_VERSION_HEX >= 0x030400a1
12784 0,
12785 #endif
12786 #if PY_VERSION_HEX >= 0x030800b1
12787 0,
12788 #endif
12789 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
12790 0,
12791 #endif
12792 };
__pyx_CyFunction_init(void)12793 static int __pyx_CyFunction_init(void) {
12794 __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
12795 if (unlikely(__pyx_CyFunctionType == NULL)) {
12796 return -1;
12797 }
12798 return 0;
12799 }
__Pyx_CyFunction_InitDefaults(PyObject * func,size_t size,int pyobjects)12800 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
12801 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
12802 m->defaults = PyObject_Malloc(size);
12803 if (unlikely(!m->defaults))
12804 return PyErr_NoMemory();
12805 memset(m->defaults, 0, size);
12806 m->defaults_pyobjects = pyobjects;
12807 m->defaults_size = size;
12808 return m->defaults;
12809 }
__Pyx_CyFunction_SetDefaultsTuple(PyObject * func,PyObject * tuple)12810 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
12811 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
12812 m->defaults_tuple = tuple;
12813 Py_INCREF(tuple);
12814 }
__Pyx_CyFunction_SetDefaultsKwDict(PyObject * func,PyObject * dict)12815 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
12816 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
12817 m->defaults_kwdict = dict;
12818 Py_INCREF(dict);
12819 }
__Pyx_CyFunction_SetAnnotationsDict(PyObject * func,PyObject * dict)12820 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
12821 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
12822 m->func_annotations = dict;
12823 Py_INCREF(dict);
12824 }
12825
12826 /* CythonFunction */
__Pyx_CyFunction_New(PyMethodDef * ml,int flags,PyObject * qualname,PyObject * closure,PyObject * module,PyObject * globals,PyObject * code)12827 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
12828 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
12829 PyObject *op = __Pyx_CyFunction_Init(
12830 PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
12831 ml, flags, qualname, closure, module, globals, code
12832 );
12833 if (likely(op)) {
12834 PyObject_GC_Track(op);
12835 }
12836 return op;
12837 }
12838
12839 /* PyObject_GenericGetAttrNoDict */
12840 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
__Pyx_RaiseGenericGetAttributeError(PyTypeObject * tp,PyObject * attr_name)12841 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
12842 PyErr_Format(PyExc_AttributeError,
12843 #if PY_MAJOR_VERSION >= 3
12844 "'%.50s' object has no attribute '%U'",
12845 tp->tp_name, attr_name);
12846 #else
12847 "'%.50s' object has no attribute '%.400s'",
12848 tp->tp_name, PyString_AS_STRING(attr_name));
12849 #endif
12850 return NULL;
12851 }
__Pyx_PyObject_GenericGetAttrNoDict(PyObject * obj,PyObject * attr_name)12852 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
12853 PyObject *descr;
12854 PyTypeObject *tp = Py_TYPE(obj);
12855 if (unlikely(!PyString_Check(attr_name))) {
12856 return PyObject_GenericGetAttr(obj, attr_name);
12857 }
12858 assert(!tp->tp_dictoffset);
12859 descr = _PyType_Lookup(tp, attr_name);
12860 if (unlikely(!descr)) {
12861 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
12862 }
12863 Py_INCREF(descr);
12864 #if PY_MAJOR_VERSION < 3
12865 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
12866 #endif
12867 {
12868 descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
12869 if (unlikely(f)) {
12870 PyObject *res = f(descr, obj, (PyObject *)tp);
12871 Py_DECREF(descr);
12872 return res;
12873 }
12874 }
12875 return descr;
12876 }
12877 #endif
12878
12879 /* Import */
__Pyx_Import(PyObject * name,PyObject * from_list,int level)12880 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
12881 PyObject *empty_list = 0;
12882 PyObject *module = 0;
12883 PyObject *global_dict = 0;
12884 PyObject *empty_dict = 0;
12885 PyObject *list;
12886 #if PY_MAJOR_VERSION < 3
12887 PyObject *py_import;
12888 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
12889 if (!py_import)
12890 goto bad;
12891 #endif
12892 if (from_list)
12893 list = from_list;
12894 else {
12895 empty_list = PyList_New(0);
12896 if (!empty_list)
12897 goto bad;
12898 list = empty_list;
12899 }
12900 global_dict = PyModule_GetDict(__pyx_m);
12901 if (!global_dict)
12902 goto bad;
12903 empty_dict = PyDict_New();
12904 if (!empty_dict)
12905 goto bad;
12906 {
12907 #if PY_MAJOR_VERSION >= 3
12908 if (level == -1) {
12909 if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
12910 module = PyImport_ImportModuleLevelObject(
12911 name, global_dict, empty_dict, list, 1);
12912 if (!module) {
12913 if (!PyErr_ExceptionMatches(PyExc_ImportError))
12914 goto bad;
12915 PyErr_Clear();
12916 }
12917 }
12918 level = 0;
12919 }
12920 #endif
12921 if (!module) {
12922 #if PY_MAJOR_VERSION < 3
12923 PyObject *py_level = PyInt_FromLong(level);
12924 if (!py_level)
12925 goto bad;
12926 module = PyObject_CallFunctionObjArgs(py_import,
12927 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
12928 Py_DECREF(py_level);
12929 #else
12930 module = PyImport_ImportModuleLevelObject(
12931 name, global_dict, empty_dict, list, level);
12932 #endif
12933 }
12934 }
12935 bad:
12936 #if PY_MAJOR_VERSION < 3
12937 Py_XDECREF(py_import);
12938 #endif
12939 Py_XDECREF(empty_list);
12940 Py_XDECREF(empty_dict);
12941 return module;
12942 }
12943
12944 /* ImportFrom */
__Pyx_ImportFrom(PyObject * module,PyObject * name)12945 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
12946 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
12947 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
12948 PyErr_Format(PyExc_ImportError,
12949 #if PY_MAJOR_VERSION < 3
12950 "cannot import name %.230s", PyString_AS_STRING(name));
12951 #else
12952 "cannot import name %S", name);
12953 #endif
12954 }
12955 return value;
12956 }
12957
12958 /* CalculateMetaclass */
__Pyx_CalculateMetaclass(PyTypeObject * metaclass,PyObject * bases)12959 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
12960 Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
12961 for (i=0; i < nbases; i++) {
12962 PyTypeObject *tmptype;
12963 PyObject *tmp = PyTuple_GET_ITEM(bases, i);
12964 tmptype = Py_TYPE(tmp);
12965 #if PY_MAJOR_VERSION < 3
12966 if (tmptype == &PyClass_Type)
12967 continue;
12968 #endif
12969 if (!metaclass) {
12970 metaclass = tmptype;
12971 continue;
12972 }
12973 if (PyType_IsSubtype(metaclass, tmptype))
12974 continue;
12975 if (PyType_IsSubtype(tmptype, metaclass)) {
12976 metaclass = tmptype;
12977 continue;
12978 }
12979 PyErr_SetString(PyExc_TypeError,
12980 "metaclass conflict: "
12981 "the metaclass of a derived class "
12982 "must be a (non-strict) subclass "
12983 "of the metaclasses of all its bases");
12984 return NULL;
12985 }
12986 if (!metaclass) {
12987 #if PY_MAJOR_VERSION < 3
12988 metaclass = &PyClass_Type;
12989 #else
12990 metaclass = &PyType_Type;
12991 #endif
12992 }
12993 Py_INCREF((PyObject*) metaclass);
12994 return (PyObject*) metaclass;
12995 }
12996
12997 /* Py3ClassCreate */
__Pyx_Py3MetaclassPrepare(PyObject * metaclass,PyObject * bases,PyObject * name,PyObject * qualname,PyObject * mkw,PyObject * modname,PyObject * doc)12998 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
12999 PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
13000 PyObject *ns;
13001 if (metaclass) {
13002 PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
13003 if (prep) {
13004 PyObject *pargs = PyTuple_Pack(2, name, bases);
13005 if (unlikely(!pargs)) {
13006 Py_DECREF(prep);
13007 return NULL;
13008 }
13009 ns = PyObject_Call(prep, pargs, mkw);
13010 Py_DECREF(prep);
13011 Py_DECREF(pargs);
13012 } else {
13013 if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
13014 return NULL;
13015 PyErr_Clear();
13016 ns = PyDict_New();
13017 }
13018 } else {
13019 ns = PyDict_New();
13020 }
13021 if (unlikely(!ns))
13022 return NULL;
13023 if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
13024 if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
13025 if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc_2, doc) < 0)) goto bad;
13026 return ns;
13027 bad:
13028 Py_DECREF(ns);
13029 return NULL;
13030 }
__Pyx_Py3ClassCreate(PyObject * metaclass,PyObject * name,PyObject * bases,PyObject * dict,PyObject * mkw,int calculate_metaclass,int allow_py2_metaclass)13031 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
13032 PyObject *dict, PyObject *mkw,
13033 int calculate_metaclass, int allow_py2_metaclass) {
13034 PyObject *result, *margs;
13035 PyObject *owned_metaclass = NULL;
13036 if (allow_py2_metaclass) {
13037 owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
13038 if (owned_metaclass) {
13039 metaclass = owned_metaclass;
13040 } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
13041 PyErr_Clear();
13042 } else {
13043 return NULL;
13044 }
13045 }
13046 if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
13047 metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
13048 Py_XDECREF(owned_metaclass);
13049 if (unlikely(!metaclass))
13050 return NULL;
13051 owned_metaclass = metaclass;
13052 }
13053 margs = PyTuple_Pack(3, name, bases, dict);
13054 if (unlikely(!margs)) {
13055 result = NULL;
13056 } else {
13057 result = PyObject_Call(metaclass, margs, mkw);
13058 Py_DECREF(margs);
13059 }
13060 Py_XDECREF(owned_metaclass);
13061 return result;
13062 }
13063
13064 /* CLineInTraceback */
13065 #ifndef CYTHON_CLINE_IN_TRACEBACK
__Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState * tstate,int c_line)13066 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
13067 PyObject *use_cline;
13068 PyObject *ptype, *pvalue, *ptraceback;
13069 #if CYTHON_COMPILING_IN_CPYTHON
13070 PyObject **cython_runtime_dict;
13071 #endif
13072 if (unlikely(!__pyx_cython_runtime)) {
13073 return c_line;
13074 }
13075 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
13076 #if CYTHON_COMPILING_IN_CPYTHON
13077 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
13078 if (likely(cython_runtime_dict)) {
13079 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
13080 use_cline, *cython_runtime_dict,
13081 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
13082 } else
13083 #endif
13084 {
13085 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
13086 if (use_cline_obj) {
13087 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
13088 Py_DECREF(use_cline_obj);
13089 } else {
13090 PyErr_Clear();
13091 use_cline = NULL;
13092 }
13093 }
13094 if (!use_cline) {
13095 c_line = 0;
13096 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
13097 }
13098 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
13099 c_line = 0;
13100 }
13101 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
13102 return c_line;
13103 }
13104 #endif
13105
13106 /* CodeObjectCache */
__pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry * entries,int count,int code_line)13107 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
13108 int start = 0, mid = 0, end = count - 1;
13109 if (end >= 0 && code_line > entries[end].code_line) {
13110 return count;
13111 }
13112 while (start < end) {
13113 mid = start + (end - start) / 2;
13114 if (code_line < entries[mid].code_line) {
13115 end = mid;
13116 } else if (code_line > entries[mid].code_line) {
13117 start = mid + 1;
13118 } else {
13119 return mid;
13120 }
13121 }
13122 if (code_line <= entries[mid].code_line) {
13123 return mid;
13124 } else {
13125 return mid + 1;
13126 }
13127 }
__pyx_find_code_object(int code_line)13128 static PyCodeObject *__pyx_find_code_object(int code_line) {
13129 PyCodeObject* code_object;
13130 int pos;
13131 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
13132 return NULL;
13133 }
13134 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
13135 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
13136 return NULL;
13137 }
13138 code_object = __pyx_code_cache.entries[pos].code_object;
13139 Py_INCREF(code_object);
13140 return code_object;
13141 }
__pyx_insert_code_object(int code_line,PyCodeObject * code_object)13142 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
13143 int pos, i;
13144 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
13145 if (unlikely(!code_line)) {
13146 return;
13147 }
13148 if (unlikely(!entries)) {
13149 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
13150 if (likely(entries)) {
13151 __pyx_code_cache.entries = entries;
13152 __pyx_code_cache.max_count = 64;
13153 __pyx_code_cache.count = 1;
13154 entries[0].code_line = code_line;
13155 entries[0].code_object = code_object;
13156 Py_INCREF(code_object);
13157 }
13158 return;
13159 }
13160 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
13161 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
13162 PyCodeObject* tmp = entries[pos].code_object;
13163 entries[pos].code_object = code_object;
13164 Py_DECREF(tmp);
13165 return;
13166 }
13167 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
13168 int new_max = __pyx_code_cache.max_count + 64;
13169 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
13170 __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
13171 if (unlikely(!entries)) {
13172 return;
13173 }
13174 __pyx_code_cache.entries = entries;
13175 __pyx_code_cache.max_count = new_max;
13176 }
13177 for (i=__pyx_code_cache.count; i>pos; i--) {
13178 entries[i] = entries[i-1];
13179 }
13180 entries[pos].code_line = code_line;
13181 entries[pos].code_object = code_object;
13182 __pyx_code_cache.count++;
13183 Py_INCREF(code_object);
13184 }
13185
13186 /* AddTraceback */
13187 #include "compile.h"
13188 #include "frameobject.h"
13189 #include "traceback.h"
__Pyx_CreateCodeObjectForTraceback(const char * funcname,int c_line,int py_line,const char * filename)13190 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
13191 const char *funcname, int c_line,
13192 int py_line, const char *filename) {
13193 PyCodeObject *py_code = 0;
13194 PyObject *py_srcfile = 0;
13195 PyObject *py_funcname = 0;
13196 #if PY_MAJOR_VERSION < 3
13197 py_srcfile = PyString_FromString(filename);
13198 #else
13199 py_srcfile = PyUnicode_FromString(filename);
13200 #endif
13201 if (!py_srcfile) goto bad;
13202 if (c_line) {
13203 #if PY_MAJOR_VERSION < 3
13204 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
13205 #else
13206 py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
13207 #endif
13208 }
13209 else {
13210 #if PY_MAJOR_VERSION < 3
13211 py_funcname = PyString_FromString(funcname);
13212 #else
13213 py_funcname = PyUnicode_FromString(funcname);
13214 #endif
13215 }
13216 if (!py_funcname) goto bad;
13217 py_code = __Pyx_PyCode_New(
13218 0,
13219 0,
13220 0,
13221 0,
13222 0,
13223 __pyx_empty_bytes, /*PyObject *code,*/
13224 __pyx_empty_tuple, /*PyObject *consts,*/
13225 __pyx_empty_tuple, /*PyObject *names,*/
13226 __pyx_empty_tuple, /*PyObject *varnames,*/
13227 __pyx_empty_tuple, /*PyObject *freevars,*/
13228 __pyx_empty_tuple, /*PyObject *cellvars,*/
13229 py_srcfile, /*PyObject *filename,*/
13230 py_funcname, /*PyObject *name,*/
13231 py_line,
13232 __pyx_empty_bytes /*PyObject *lnotab*/
13233 );
13234 Py_DECREF(py_srcfile);
13235 Py_DECREF(py_funcname);
13236 return py_code;
13237 bad:
13238 Py_XDECREF(py_srcfile);
13239 Py_XDECREF(py_funcname);
13240 return NULL;
13241 }
__Pyx_AddTraceback(const char * funcname,int c_line,int py_line,const char * filename)13242 static void __Pyx_AddTraceback(const char *funcname, int c_line,
13243 int py_line, const char *filename) {
13244 PyCodeObject *py_code = 0;
13245 PyFrameObject *py_frame = 0;
13246 PyThreadState *tstate = __Pyx_PyThreadState_Current;
13247 if (c_line) {
13248 c_line = __Pyx_CLineForTraceback(tstate, c_line);
13249 }
13250 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
13251 if (!py_code) {
13252 py_code = __Pyx_CreateCodeObjectForTraceback(
13253 funcname, c_line, py_line, filename);
13254 if (!py_code) goto bad;
13255 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
13256 }
13257 py_frame = PyFrame_New(
13258 tstate, /*PyThreadState *tstate,*/
13259 py_code, /*PyCodeObject *code,*/
13260 __pyx_d, /*PyObject *globals,*/
13261 0 /*PyObject *locals*/
13262 );
13263 if (!py_frame) goto bad;
13264 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
13265 PyTraceBack_Here(py_frame);
13266 bad:
13267 Py_XDECREF(py_code);
13268 Py_XDECREF(py_frame);
13269 }
13270
13271 /* CIntToPy */
__Pyx_PyInt_From_long(long value)13272 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
13273 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
13274 #pragma GCC diagnostic push
13275 #pragma GCC diagnostic ignored "-Wconversion"
13276 #endif
13277 const long neg_one = (long) -1, const_zero = (long) 0;
13278 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
13279 #pragma GCC diagnostic pop
13280 #endif
13281 const int is_unsigned = neg_one > const_zero;
13282 if (is_unsigned) {
13283 if (sizeof(long) < sizeof(long)) {
13284 return PyInt_FromLong((long) value);
13285 } else if (sizeof(long) <= sizeof(unsigned long)) {
13286 return PyLong_FromUnsignedLong((unsigned long) value);
13287 #ifdef HAVE_LONG_LONG
13288 } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
13289 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
13290 #endif
13291 }
13292 } else {
13293 if (sizeof(long) <= sizeof(long)) {
13294 return PyInt_FromLong((long) value);
13295 #ifdef HAVE_LONG_LONG
13296 } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
13297 return PyLong_FromLongLong((PY_LONG_LONG) value);
13298 #endif
13299 }
13300 }
13301 {
13302 int one = 1; int little = (int)*(unsigned char *)&one;
13303 unsigned char *bytes = (unsigned char *)&value;
13304 return _PyLong_FromByteArray(bytes, sizeof(long),
13305 little, !is_unsigned);
13306 }
13307 }
13308
13309 /* CIntFromPyVerify */
13310 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
13311 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
13312 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
13313 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
13314 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
13315 {\
13316 func_type value = func_value;\
13317 if (sizeof(target_type) < sizeof(func_type)) {\
13318 if (unlikely(value != (func_type) (target_type) value)) {\
13319 func_type zero = 0;\
13320 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
13321 return (target_type) -1;\
13322 if (is_unsigned && unlikely(value < zero))\
13323 goto raise_neg_overflow;\
13324 else\
13325 goto raise_overflow;\
13326 }\
13327 }\
13328 return (target_type) value;\
13329 }
13330
13331 /* CIntFromPy */
__Pyx_PyInt_As_long(PyObject * x)13332 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
13333 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
13334 #pragma GCC diagnostic push
13335 #pragma GCC diagnostic ignored "-Wconversion"
13336 #endif
13337 const long neg_one = (long) -1, const_zero = (long) 0;
13338 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
13339 #pragma GCC diagnostic pop
13340 #endif
13341 const int is_unsigned = neg_one > const_zero;
13342 #if PY_MAJOR_VERSION < 3
13343 if (likely(PyInt_Check(x))) {
13344 if (sizeof(long) < sizeof(long)) {
13345 __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
13346 } else {
13347 long val = PyInt_AS_LONG(x);
13348 if (is_unsigned && unlikely(val < 0)) {
13349 goto raise_neg_overflow;
13350 }
13351 return (long) val;
13352 }
13353 } else
13354 #endif
13355 if (likely(PyLong_Check(x))) {
13356 if (is_unsigned) {
13357 #if CYTHON_USE_PYLONG_INTERNALS
13358 const digit* digits = ((PyLongObject*)x)->ob_digit;
13359 switch (Py_SIZE(x)) {
13360 case 0: return (long) 0;
13361 case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
13362 case 2:
13363 if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
13364 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
13365 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
13366 } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
13367 return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
13368 }
13369 }
13370 break;
13371 case 3:
13372 if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
13373 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
13374 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
13375 } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
13376 return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
13377 }
13378 }
13379 break;
13380 case 4:
13381 if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
13382 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
13383 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
13384 } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
13385 return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
13386 }
13387 }
13388 break;
13389 }
13390 #endif
13391 #if CYTHON_COMPILING_IN_CPYTHON
13392 if (unlikely(Py_SIZE(x) < 0)) {
13393 goto raise_neg_overflow;
13394 }
13395 #else
13396 {
13397 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
13398 if (unlikely(result < 0))
13399 return (long) -1;
13400 if (unlikely(result == 1))
13401 goto raise_neg_overflow;
13402 }
13403 #endif
13404 if (sizeof(long) <= sizeof(unsigned long)) {
13405 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
13406 #ifdef HAVE_LONG_LONG
13407 } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
13408 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
13409 #endif
13410 }
13411 } else {
13412 #if CYTHON_USE_PYLONG_INTERNALS
13413 const digit* digits = ((PyLongObject*)x)->ob_digit;
13414 switch (Py_SIZE(x)) {
13415 case 0: return (long) 0;
13416 case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
13417 case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
13418 case -2:
13419 if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
13420 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
13421 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
13422 } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
13423 return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
13424 }
13425 }
13426 break;
13427 case 2:
13428 if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
13429 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
13430 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
13431 } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
13432 return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
13433 }
13434 }
13435 break;
13436 case -3:
13437 if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
13438 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
13439 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
13440 } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
13441 return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
13442 }
13443 }
13444 break;
13445 case 3:
13446 if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
13447 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
13448 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
13449 } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
13450 return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
13451 }
13452 }
13453 break;
13454 case -4:
13455 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
13456 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
13457 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
13458 } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
13459 return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
13460 }
13461 }
13462 break;
13463 case 4:
13464 if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
13465 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
13466 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
13467 } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
13468 return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
13469 }
13470 }
13471 break;
13472 }
13473 #endif
13474 if (sizeof(long) <= sizeof(long)) {
13475 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
13476 #ifdef HAVE_LONG_LONG
13477 } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
13478 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
13479 #endif
13480 }
13481 }
13482 {
13483 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
13484 PyErr_SetString(PyExc_RuntimeError,
13485 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
13486 #else
13487 long val;
13488 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
13489 #if PY_MAJOR_VERSION < 3
13490 if (likely(v) && !PyLong_Check(v)) {
13491 PyObject *tmp = v;
13492 v = PyNumber_Long(tmp);
13493 Py_DECREF(tmp);
13494 }
13495 #endif
13496 if (likely(v)) {
13497 int one = 1; int is_little = (int)*(unsigned char *)&one;
13498 unsigned char *bytes = (unsigned char *)&val;
13499 int ret = _PyLong_AsByteArray((PyLongObject *)v,
13500 bytes, sizeof(val),
13501 is_little, !is_unsigned);
13502 Py_DECREF(v);
13503 if (likely(!ret))
13504 return val;
13505 }
13506 #endif
13507 return (long) -1;
13508 }
13509 } else {
13510 long val;
13511 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
13512 if (!tmp) return (long) -1;
13513 val = __Pyx_PyInt_As_long(tmp);
13514 Py_DECREF(tmp);
13515 return val;
13516 }
13517 raise_overflow:
13518 PyErr_SetString(PyExc_OverflowError,
13519 "value too large to convert to long");
13520 return (long) -1;
13521 raise_neg_overflow:
13522 PyErr_SetString(PyExc_OverflowError,
13523 "can't convert negative value to long");
13524 return (long) -1;
13525 }
13526
13527 /* CIntFromPy */
__Pyx_PyInt_As_int(PyObject * x)13528 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
13529 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
13530 #pragma GCC diagnostic push
13531 #pragma GCC diagnostic ignored "-Wconversion"
13532 #endif
13533 const int neg_one = (int) -1, const_zero = (int) 0;
13534 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
13535 #pragma GCC diagnostic pop
13536 #endif
13537 const int is_unsigned = neg_one > const_zero;
13538 #if PY_MAJOR_VERSION < 3
13539 if (likely(PyInt_Check(x))) {
13540 if (sizeof(int) < sizeof(long)) {
13541 __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
13542 } else {
13543 long val = PyInt_AS_LONG(x);
13544 if (is_unsigned && unlikely(val < 0)) {
13545 goto raise_neg_overflow;
13546 }
13547 return (int) val;
13548 }
13549 } else
13550 #endif
13551 if (likely(PyLong_Check(x))) {
13552 if (is_unsigned) {
13553 #if CYTHON_USE_PYLONG_INTERNALS
13554 const digit* digits = ((PyLongObject*)x)->ob_digit;
13555 switch (Py_SIZE(x)) {
13556 case 0: return (int) 0;
13557 case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
13558 case 2:
13559 if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
13560 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
13561 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
13562 } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
13563 return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
13564 }
13565 }
13566 break;
13567 case 3:
13568 if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
13569 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
13570 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
13571 } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
13572 return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
13573 }
13574 }
13575 break;
13576 case 4:
13577 if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
13578 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
13579 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
13580 } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
13581 return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
13582 }
13583 }
13584 break;
13585 }
13586 #endif
13587 #if CYTHON_COMPILING_IN_CPYTHON
13588 if (unlikely(Py_SIZE(x) < 0)) {
13589 goto raise_neg_overflow;
13590 }
13591 #else
13592 {
13593 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
13594 if (unlikely(result < 0))
13595 return (int) -1;
13596 if (unlikely(result == 1))
13597 goto raise_neg_overflow;
13598 }
13599 #endif
13600 if (sizeof(int) <= sizeof(unsigned long)) {
13601 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
13602 #ifdef HAVE_LONG_LONG
13603 } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
13604 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
13605 #endif
13606 }
13607 } else {
13608 #if CYTHON_USE_PYLONG_INTERNALS
13609 const digit* digits = ((PyLongObject*)x)->ob_digit;
13610 switch (Py_SIZE(x)) {
13611 case 0: return (int) 0;
13612 case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
13613 case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
13614 case -2:
13615 if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
13616 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
13617 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
13618 } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
13619 return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
13620 }
13621 }
13622 break;
13623 case 2:
13624 if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
13625 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
13626 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
13627 } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
13628 return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
13629 }
13630 }
13631 break;
13632 case -3:
13633 if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
13634 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
13635 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
13636 } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
13637 return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
13638 }
13639 }
13640 break;
13641 case 3:
13642 if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
13643 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
13644 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
13645 } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
13646 return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
13647 }
13648 }
13649 break;
13650 case -4:
13651 if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
13652 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
13653 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
13654 } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
13655 return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
13656 }
13657 }
13658 break;
13659 case 4:
13660 if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
13661 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
13662 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
13663 } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
13664 return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
13665 }
13666 }
13667 break;
13668 }
13669 #endif
13670 if (sizeof(int) <= sizeof(long)) {
13671 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
13672 #ifdef HAVE_LONG_LONG
13673 } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
13674 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
13675 #endif
13676 }
13677 }
13678 {
13679 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
13680 PyErr_SetString(PyExc_RuntimeError,
13681 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
13682 #else
13683 int val;
13684 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
13685 #if PY_MAJOR_VERSION < 3
13686 if (likely(v) && !PyLong_Check(v)) {
13687 PyObject *tmp = v;
13688 v = PyNumber_Long(tmp);
13689 Py_DECREF(tmp);
13690 }
13691 #endif
13692 if (likely(v)) {
13693 int one = 1; int is_little = (int)*(unsigned char *)&one;
13694 unsigned char *bytes = (unsigned char *)&val;
13695 int ret = _PyLong_AsByteArray((PyLongObject *)v,
13696 bytes, sizeof(val),
13697 is_little, !is_unsigned);
13698 Py_DECREF(v);
13699 if (likely(!ret))
13700 return val;
13701 }
13702 #endif
13703 return (int) -1;
13704 }
13705 } else {
13706 int val;
13707 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
13708 if (!tmp) return (int) -1;
13709 val = __Pyx_PyInt_As_int(tmp);
13710 Py_DECREF(tmp);
13711 return val;
13712 }
13713 raise_overflow:
13714 PyErr_SetString(PyExc_OverflowError,
13715 "value too large to convert to int");
13716 return (int) -1;
13717 raise_neg_overflow:
13718 PyErr_SetString(PyExc_OverflowError,
13719 "can't convert negative value to int");
13720 return (int) -1;
13721 }
13722
13723 /* FastTypeChecks */
13724 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_InBases(PyTypeObject * a,PyTypeObject * b)13725 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
13726 while (a) {
13727 a = a->tp_base;
13728 if (a == b)
13729 return 1;
13730 }
13731 return b == &PyBaseObject_Type;
13732 }
__Pyx_IsSubtype(PyTypeObject * a,PyTypeObject * b)13733 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
13734 PyObject *mro;
13735 if (a == b) return 1;
13736 mro = a->tp_mro;
13737 if (likely(mro)) {
13738 Py_ssize_t i, n;
13739 n = PyTuple_GET_SIZE(mro);
13740 for (i = 0; i < n; i++) {
13741 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
13742 return 1;
13743 }
13744 return 0;
13745 }
13746 return __Pyx_InBases(a, b);
13747 }
13748 #if PY_MAJOR_VERSION == 2
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)13749 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
13750 PyObject *exception, *value, *tb;
13751 int res;
13752 __Pyx_PyThreadState_declare
13753 __Pyx_PyThreadState_assign
13754 __Pyx_ErrFetch(&exception, &value, &tb);
13755 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
13756 if (unlikely(res == -1)) {
13757 PyErr_WriteUnraisable(err);
13758 res = 0;
13759 }
13760 if (!res) {
13761 res = PyObject_IsSubclass(err, exc_type2);
13762 if (unlikely(res == -1)) {
13763 PyErr_WriteUnraisable(err);
13764 res = 0;
13765 }
13766 }
13767 __Pyx_ErrRestore(exception, value, tb);
13768 return res;
13769 }
13770 #else
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)13771 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
13772 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
13773 if (!res) {
13774 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
13775 }
13776 return res;
13777 }
13778 #endif
__Pyx_PyErr_GivenExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)13779 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
13780 Py_ssize_t i, n;
13781 assert(PyExceptionClass_Check(exc_type));
13782 n = PyTuple_GET_SIZE(tuple);
13783 #if PY_MAJOR_VERSION >= 3
13784 for (i=0; i<n; i++) {
13785 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
13786 }
13787 #endif
13788 for (i=0; i<n; i++) {
13789 PyObject *t = PyTuple_GET_ITEM(tuple, i);
13790 #if PY_MAJOR_VERSION < 3
13791 if (likely(exc_type == t)) return 1;
13792 #endif
13793 if (likely(PyExceptionClass_Check(t))) {
13794 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
13795 } else {
13796 }
13797 }
13798 return 0;
13799 }
__Pyx_PyErr_GivenExceptionMatches(PyObject * err,PyObject * exc_type)13800 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
13801 if (likely(err == exc_type)) return 1;
13802 if (likely(PyExceptionClass_Check(err))) {
13803 if (likely(PyExceptionClass_Check(exc_type))) {
13804 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
13805 } else if (likely(PyTuple_Check(exc_type))) {
13806 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
13807 } else {
13808 }
13809 }
13810 return PyErr_GivenExceptionMatches(err, exc_type);
13811 }
__Pyx_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)13812 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
13813 assert(PyExceptionClass_Check(exc_type1));
13814 assert(PyExceptionClass_Check(exc_type2));
13815 if (likely(err == exc_type1 || err == exc_type2)) return 1;
13816 if (likely(PyExceptionClass_Check(err))) {
13817 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
13818 }
13819 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
13820 }
13821 #endif
13822
13823 /* SwapException */
13824 #if CYTHON_FAST_THREAD_STATE
__Pyx__ExceptionSwap(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)13825 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
13826 PyObject *tmp_type, *tmp_value, *tmp_tb;
13827 #if CYTHON_USE_EXC_INFO_STACK
13828 _PyErr_StackItem *exc_info = tstate->exc_info;
13829 tmp_type = exc_info->exc_type;
13830 tmp_value = exc_info->exc_value;
13831 tmp_tb = exc_info->exc_traceback;
13832 exc_info->exc_type = *type;
13833 exc_info->exc_value = *value;
13834 exc_info->exc_traceback = *tb;
13835 #else
13836 tmp_type = tstate->exc_type;
13837 tmp_value = tstate->exc_value;
13838 tmp_tb = tstate->exc_traceback;
13839 tstate->exc_type = *type;
13840 tstate->exc_value = *value;
13841 tstate->exc_traceback = *tb;
13842 #endif
13843 *type = tmp_type;
13844 *value = tmp_value;
13845 *tb = tmp_tb;
13846 }
13847 #else
__Pyx_ExceptionSwap(PyObject ** type,PyObject ** value,PyObject ** tb)13848 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
13849 PyObject *tmp_type, *tmp_value, *tmp_tb;
13850 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
13851 PyErr_SetExcInfo(*type, *value, *tb);
13852 *type = tmp_type;
13853 *value = tmp_value;
13854 *tb = tmp_tb;
13855 }
13856 #endif
13857
13858 /* PyObjectCallMethod1 */
__Pyx__PyObject_CallMethod1(PyObject * method,PyObject * arg)13859 static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
13860 PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
13861 Py_DECREF(method);
13862 return result;
13863 }
__Pyx_PyObject_CallMethod1(PyObject * obj,PyObject * method_name,PyObject * arg)13864 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
13865 PyObject *method = NULL, *result;
13866 int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
13867 if (likely(is_method)) {
13868 result = __Pyx_PyObject_Call2Args(method, obj, arg);
13869 Py_DECREF(method);
13870 return result;
13871 }
13872 if (unlikely(!method)) return NULL;
13873 return __Pyx__PyObject_CallMethod1(method, arg);
13874 }
13875
13876 /* CoroutineBase */
13877 #include <structmember.h>
13878 #include <frameobject.h>
13879 #define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
__Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState * __pyx_tstate,PyObject ** pvalue)13880 static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject **pvalue) {
13881 PyObject *et, *ev, *tb;
13882 PyObject *value = NULL;
13883 __Pyx_ErrFetch(&et, &ev, &tb);
13884 if (!et) {
13885 Py_XDECREF(tb);
13886 Py_XDECREF(ev);
13887 Py_INCREF(Py_None);
13888 *pvalue = Py_None;
13889 return 0;
13890 }
13891 if (likely(et == PyExc_StopIteration)) {
13892 if (!ev) {
13893 Py_INCREF(Py_None);
13894 value = Py_None;
13895 }
13896 #if PY_VERSION_HEX >= 0x030300A0
13897 else if (Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) {
13898 value = ((PyStopIterationObject *)ev)->value;
13899 Py_INCREF(value);
13900 Py_DECREF(ev);
13901 }
13902 #endif
13903 else if (unlikely(PyTuple_Check(ev))) {
13904 if (PyTuple_GET_SIZE(ev) >= 1) {
13905 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13906 value = PyTuple_GET_ITEM(ev, 0);
13907 Py_INCREF(value);
13908 #else
13909 value = PySequence_ITEM(ev, 0);
13910 #endif
13911 } else {
13912 Py_INCREF(Py_None);
13913 value = Py_None;
13914 }
13915 Py_DECREF(ev);
13916 }
13917 else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
13918 value = ev;
13919 }
13920 if (likely(value)) {
13921 Py_XDECREF(tb);
13922 Py_DECREF(et);
13923 *pvalue = value;
13924 return 0;
13925 }
13926 } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
13927 __Pyx_ErrRestore(et, ev, tb);
13928 return -1;
13929 }
13930 PyErr_NormalizeException(&et, &ev, &tb);
13931 if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
13932 __Pyx_ErrRestore(et, ev, tb);
13933 return -1;
13934 }
13935 Py_XDECREF(tb);
13936 Py_DECREF(et);
13937 #if PY_VERSION_HEX >= 0x030300A0
13938 value = ((PyStopIterationObject *)ev)->value;
13939 Py_INCREF(value);
13940 Py_DECREF(ev);
13941 #else
13942 {
13943 PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args);
13944 Py_DECREF(ev);
13945 if (likely(args)) {
13946 value = PySequence_GetItem(args, 0);
13947 Py_DECREF(args);
13948 }
13949 if (unlikely(!value)) {
13950 __Pyx_ErrRestore(NULL, NULL, NULL);
13951 Py_INCREF(Py_None);
13952 value = Py_None;
13953 }
13954 }
13955 #endif
13956 *pvalue = value;
13957 return 0;
13958 }
13959 static CYTHON_INLINE
__Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct * exc_state)13960 void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) {
13961 PyObject *t, *v, *tb;
13962 t = exc_state->exc_type;
13963 v = exc_state->exc_value;
13964 tb = exc_state->exc_traceback;
13965 exc_state->exc_type = NULL;
13966 exc_state->exc_value = NULL;
13967 exc_state->exc_traceback = NULL;
13968 Py_XDECREF(t);
13969 Py_XDECREF(v);
13970 Py_XDECREF(tb);
13971 }
13972 #define __Pyx_Coroutine_AlreadyRunningError(gen) (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL)
__Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject * gen)13973 static void __Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject *gen) {
13974 const char *msg;
13975 if ((0)) {
13976 #ifdef __Pyx_Coroutine_USED
13977 } else if (__Pyx_Coroutine_Check((PyObject*)gen)) {
13978 msg = "coroutine already executing";
13979 #endif
13980 #ifdef __Pyx_AsyncGen_USED
13981 } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
13982 msg = "async generator already executing";
13983 #endif
13984 } else {
13985 msg = "generator already executing";
13986 }
13987 PyErr_SetString(PyExc_ValueError, msg);
13988 }
13989 #define __Pyx_Coroutine_NotStartedError(gen) (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL)
__Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject * gen)13990 static void __Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject *gen) {
13991 const char *msg;
13992 if ((0)) {
13993 #ifdef __Pyx_Coroutine_USED
13994 } else if (__Pyx_Coroutine_Check(gen)) {
13995 msg = "can't send non-None value to a just-started coroutine";
13996 #endif
13997 #ifdef __Pyx_AsyncGen_USED
13998 } else if (__Pyx_AsyncGen_CheckExact(gen)) {
13999 msg = "can't send non-None value to a just-started async generator";
14000 #endif
14001 } else {
14002 msg = "can't send non-None value to a just-started generator";
14003 }
14004 PyErr_SetString(PyExc_TypeError, msg);
14005 }
14006 #define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing) (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL)
__Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject * gen,PyObject * value,CYTHON_UNUSED int closing)14007 static void __Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject *gen, PyObject *value, CYTHON_UNUSED int closing) {
14008 #ifdef __Pyx_Coroutine_USED
14009 if (!closing && __Pyx_Coroutine_Check(gen)) {
14010 PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine");
14011 } else
14012 #endif
14013 if (value) {
14014 #ifdef __Pyx_AsyncGen_USED
14015 if (__Pyx_AsyncGen_CheckExact(gen))
14016 PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration);
14017 else
14018 #endif
14019 PyErr_SetNone(PyExc_StopIteration);
14020 }
14021 }
14022 static
__Pyx_Coroutine_SendEx(__pyx_CoroutineObject * self,PyObject * value,int closing)14023 PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) {
14024 __Pyx_PyThreadState_declare
14025 PyThreadState *tstate;
14026 __Pyx_ExcInfoStruct *exc_state;
14027 PyObject *retval;
14028 assert(!self->is_running);
14029 if (unlikely(self->resume_label == 0)) {
14030 if (unlikely(value && value != Py_None)) {
14031 return __Pyx_Coroutine_NotStartedError((PyObject*)self);
14032 }
14033 }
14034 if (unlikely(self->resume_label == -1)) {
14035 return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing);
14036 }
14037 #if CYTHON_FAST_THREAD_STATE
14038 __Pyx_PyThreadState_assign
14039 tstate = __pyx_tstate;
14040 #else
14041 tstate = __Pyx_PyThreadState_Current;
14042 #endif
14043 exc_state = &self->gi_exc_state;
14044 if (exc_state->exc_type) {
14045 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
14046 #else
14047 if (exc_state->exc_traceback) {
14048 PyTracebackObject *tb = (PyTracebackObject *) exc_state->exc_traceback;
14049 PyFrameObject *f = tb->tb_frame;
14050 Py_XINCREF(tstate->frame);
14051 assert(f->f_back == NULL);
14052 f->f_back = tstate->frame;
14053 }
14054 #endif
14055 }
14056 #if CYTHON_USE_EXC_INFO_STACK
14057 exc_state->previous_item = tstate->exc_info;
14058 tstate->exc_info = exc_state;
14059 #else
14060 if (exc_state->exc_type) {
14061 __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
14062 } else {
14063 __Pyx_Coroutine_ExceptionClear(exc_state);
14064 __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
14065 }
14066 #endif
14067 self->is_running = 1;
14068 retval = self->body((PyObject *) self, tstate, value);
14069 self->is_running = 0;
14070 #if CYTHON_USE_EXC_INFO_STACK
14071 exc_state = &self->gi_exc_state;
14072 tstate->exc_info = exc_state->previous_item;
14073 exc_state->previous_item = NULL;
14074 __Pyx_Coroutine_ResetFrameBackpointer(exc_state);
14075 #endif
14076 return retval;
14077 }
__Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct * exc_state)14078 static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) {
14079 PyObject *exc_tb = exc_state->exc_traceback;
14080 if (likely(exc_tb)) {
14081 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
14082 #else
14083 PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
14084 PyFrameObject *f = tb->tb_frame;
14085 Py_CLEAR(f->f_back);
14086 #endif
14087 }
14088 }
14089 static CYTHON_INLINE
__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject * gen,PyObject * retval)14090 PyObject *__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject* gen, PyObject *retval) {
14091 if (unlikely(!retval)) {
14092 __Pyx_PyThreadState_declare
14093 __Pyx_PyThreadState_assign
14094 if (!__Pyx_PyErr_Occurred()) {
14095 PyObject *exc = PyExc_StopIteration;
14096 #ifdef __Pyx_AsyncGen_USED
14097 if (__Pyx_AsyncGen_CheckExact(gen))
14098 exc = __Pyx_PyExc_StopAsyncIteration;
14099 #endif
14100 __Pyx_PyErr_SetNone(exc);
14101 }
14102 }
14103 return retval;
14104 }
14105 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
14106 static CYTHON_INLINE
__Pyx_PyGen_Send(PyGenObject * gen,PyObject * arg)14107 PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) {
14108 #if PY_VERSION_HEX <= 0x030A00A1
14109 return _PyGen_Send(gen, arg);
14110 #else
14111 PyObject *result;
14112 if (PyIter_Send((PyObject*)gen, arg ? arg : Py_None, &result) == PYGEN_RETURN) {
14113 if (PyAsyncGen_CheckExact(gen)) {
14114 assert(result == Py_None);
14115 PyErr_SetNone(PyExc_StopAsyncIteration);
14116 }
14117 else if (result == Py_None) {
14118 PyErr_SetNone(PyExc_StopIteration);
14119 }
14120 else {
14121 _PyGen_SetStopIterationValue(result);
14122 }
14123 Py_CLEAR(result);
14124 }
14125 return result;
14126 #endif
14127 }
14128 #endif
14129 static CYTHON_INLINE
__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject * gen)14130 PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
14131 PyObject *ret;
14132 PyObject *val = NULL;
14133 __Pyx_Coroutine_Undelegate(gen);
14134 __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
14135 ret = __Pyx_Coroutine_SendEx(gen, val, 0);
14136 Py_XDECREF(val);
14137 return ret;
14138 }
__Pyx_Coroutine_Send(PyObject * self,PyObject * value)14139 static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
14140 PyObject *retval;
14141 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
14142 PyObject *yf = gen->yieldfrom;
14143 if (unlikely(gen->is_running))
14144 return __Pyx_Coroutine_AlreadyRunningError(gen);
14145 if (yf) {
14146 PyObject *ret;
14147 gen->is_running = 1;
14148 #ifdef __Pyx_Generator_USED
14149 if (__Pyx_Generator_CheckExact(yf)) {
14150 ret = __Pyx_Coroutine_Send(yf, value);
14151 } else
14152 #endif
14153 #ifdef __Pyx_Coroutine_USED
14154 if (__Pyx_Coroutine_Check(yf)) {
14155 ret = __Pyx_Coroutine_Send(yf, value);
14156 } else
14157 #endif
14158 #ifdef __Pyx_AsyncGen_USED
14159 if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
14160 ret = __Pyx_async_gen_asend_send(yf, value);
14161 } else
14162 #endif
14163 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
14164 if (PyGen_CheckExact(yf)) {
14165 ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
14166 } else
14167 #endif
14168 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
14169 if (PyCoro_CheckExact(yf)) {
14170 ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
14171 } else
14172 #endif
14173 {
14174 if (value == Py_None)
14175 ret = Py_TYPE(yf)->tp_iternext(yf);
14176 else
14177 ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
14178 }
14179 gen->is_running = 0;
14180 if (likely(ret)) {
14181 return ret;
14182 }
14183 retval = __Pyx_Coroutine_FinishDelegation(gen);
14184 } else {
14185 retval = __Pyx_Coroutine_SendEx(gen, value, 0);
14186 }
14187 return __Pyx_Coroutine_MethodReturn(self, retval);
14188 }
__Pyx_Coroutine_CloseIter(__pyx_CoroutineObject * gen,PyObject * yf)14189 static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
14190 PyObject *retval = NULL;
14191 int err = 0;
14192 #ifdef __Pyx_Generator_USED
14193 if (__Pyx_Generator_CheckExact(yf)) {
14194 retval = __Pyx_Coroutine_Close(yf);
14195 if (!retval)
14196 return -1;
14197 } else
14198 #endif
14199 #ifdef __Pyx_Coroutine_USED
14200 if (__Pyx_Coroutine_Check(yf)) {
14201 retval = __Pyx_Coroutine_Close(yf);
14202 if (!retval)
14203 return -1;
14204 } else
14205 if (__Pyx_CoroutineAwait_CheckExact(yf)) {
14206 retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL);
14207 if (!retval)
14208 return -1;
14209 } else
14210 #endif
14211 #ifdef __Pyx_AsyncGen_USED
14212 if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
14213 retval = __Pyx_async_gen_asend_close(yf, NULL);
14214 } else
14215 if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
14216 retval = __Pyx_async_gen_athrow_close(yf, NULL);
14217 } else
14218 #endif
14219 {
14220 PyObject *meth;
14221 gen->is_running = 1;
14222 meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close);
14223 if (unlikely(!meth)) {
14224 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
14225 PyErr_WriteUnraisable(yf);
14226 }
14227 PyErr_Clear();
14228 } else {
14229 retval = PyObject_CallFunction(meth, NULL);
14230 Py_DECREF(meth);
14231 if (!retval)
14232 err = -1;
14233 }
14234 gen->is_running = 0;
14235 }
14236 Py_XDECREF(retval);
14237 return err;
14238 }
__Pyx_Generator_Next(PyObject * self)14239 static PyObject *__Pyx_Generator_Next(PyObject *self) {
14240 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
14241 PyObject *yf = gen->yieldfrom;
14242 if (unlikely(gen->is_running))
14243 return __Pyx_Coroutine_AlreadyRunningError(gen);
14244 if (yf) {
14245 PyObject *ret;
14246 gen->is_running = 1;
14247 #ifdef __Pyx_Generator_USED
14248 if (__Pyx_Generator_CheckExact(yf)) {
14249 ret = __Pyx_Generator_Next(yf);
14250 } else
14251 #endif
14252 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
14253 if (PyGen_CheckExact(yf)) {
14254 ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL);
14255 } else
14256 #endif
14257 #ifdef __Pyx_Coroutine_USED
14258 if (__Pyx_Coroutine_Check(yf)) {
14259 ret = __Pyx_Coroutine_Send(yf, Py_None);
14260 } else
14261 #endif
14262 ret = Py_TYPE(yf)->tp_iternext(yf);
14263 gen->is_running = 0;
14264 if (likely(ret)) {
14265 return ret;
14266 }
14267 return __Pyx_Coroutine_FinishDelegation(gen);
14268 }
14269 return __Pyx_Coroutine_SendEx(gen, Py_None, 0);
14270 }
__Pyx_Coroutine_Close_Method(PyObject * self,CYTHON_UNUSED PyObject * arg)14271 static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, CYTHON_UNUSED PyObject *arg) {
14272 return __Pyx_Coroutine_Close(self);
14273 }
__Pyx_Coroutine_Close(PyObject * self)14274 static PyObject *__Pyx_Coroutine_Close(PyObject *self) {
14275 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
14276 PyObject *retval, *raised_exception;
14277 PyObject *yf = gen->yieldfrom;
14278 int err = 0;
14279 if (unlikely(gen->is_running))
14280 return __Pyx_Coroutine_AlreadyRunningError(gen);
14281 if (yf) {
14282 Py_INCREF(yf);
14283 err = __Pyx_Coroutine_CloseIter(gen, yf);
14284 __Pyx_Coroutine_Undelegate(gen);
14285 Py_DECREF(yf);
14286 }
14287 if (err == 0)
14288 PyErr_SetNone(PyExc_GeneratorExit);
14289 retval = __Pyx_Coroutine_SendEx(gen, NULL, 1);
14290 if (unlikely(retval)) {
14291 const char *msg;
14292 Py_DECREF(retval);
14293 if ((0)) {
14294 #ifdef __Pyx_Coroutine_USED
14295 } else if (__Pyx_Coroutine_Check(self)) {
14296 msg = "coroutine ignored GeneratorExit";
14297 #endif
14298 #ifdef __Pyx_AsyncGen_USED
14299 } else if (__Pyx_AsyncGen_CheckExact(self)) {
14300 #if PY_VERSION_HEX < 0x03060000
14301 msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)";
14302 #else
14303 msg = "async generator ignored GeneratorExit";
14304 #endif
14305 #endif
14306 } else {
14307 msg = "generator ignored GeneratorExit";
14308 }
14309 PyErr_SetString(PyExc_RuntimeError, msg);
14310 return NULL;
14311 }
14312 raised_exception = PyErr_Occurred();
14313 if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) {
14314 if (raised_exception) PyErr_Clear();
14315 Py_INCREF(Py_None);
14316 return Py_None;
14317 }
14318 return NULL;
14319 }
__Pyx__Coroutine_Throw(PyObject * self,PyObject * typ,PyObject * val,PyObject * tb,PyObject * args,int close_on_genexit)14320 static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb,
14321 PyObject *args, int close_on_genexit) {
14322 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
14323 PyObject *yf = gen->yieldfrom;
14324 if (unlikely(gen->is_running))
14325 return __Pyx_Coroutine_AlreadyRunningError(gen);
14326 if (yf) {
14327 PyObject *ret;
14328 Py_INCREF(yf);
14329 if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
14330 int err = __Pyx_Coroutine_CloseIter(gen, yf);
14331 Py_DECREF(yf);
14332 __Pyx_Coroutine_Undelegate(gen);
14333 if (err < 0)
14334 return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
14335 goto throw_here;
14336 }
14337 gen->is_running = 1;
14338 if (0
14339 #ifdef __Pyx_Generator_USED
14340 || __Pyx_Generator_CheckExact(yf)
14341 #endif
14342 #ifdef __Pyx_Coroutine_USED
14343 || __Pyx_Coroutine_Check(yf)
14344 #endif
14345 ) {
14346 ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
14347 #ifdef __Pyx_Coroutine_USED
14348 } else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
14349 ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
14350 #endif
14351 } else {
14352 PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw);
14353 if (unlikely(!meth)) {
14354 Py_DECREF(yf);
14355 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
14356 gen->is_running = 0;
14357 return NULL;
14358 }
14359 PyErr_Clear();
14360 __Pyx_Coroutine_Undelegate(gen);
14361 gen->is_running = 0;
14362 goto throw_here;
14363 }
14364 if (likely(args)) {
14365 ret = PyObject_CallObject(meth, args);
14366 } else {
14367 ret = PyObject_CallFunctionObjArgs(meth, typ, val, tb, NULL);
14368 }
14369 Py_DECREF(meth);
14370 }
14371 gen->is_running = 0;
14372 Py_DECREF(yf);
14373 if (!ret) {
14374 ret = __Pyx_Coroutine_FinishDelegation(gen);
14375 }
14376 return __Pyx_Coroutine_MethodReturn(self, ret);
14377 }
14378 throw_here:
14379 __Pyx_Raise(typ, val, tb, NULL);
14380 return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
14381 }
__Pyx_Coroutine_Throw(PyObject * self,PyObject * args)14382 static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
14383 PyObject *typ;
14384 PyObject *val = NULL;
14385 PyObject *tb = NULL;
14386 if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))
14387 return NULL;
14388 return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1);
14389 }
__Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct * exc_state,visitproc visit,void * arg)14390 static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) {
14391 Py_VISIT(exc_state->exc_type);
14392 Py_VISIT(exc_state->exc_value);
14393 Py_VISIT(exc_state->exc_traceback);
14394 return 0;
14395 }
__Pyx_Coroutine_traverse(__pyx_CoroutineObject * gen,visitproc visit,void * arg)14396 static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) {
14397 Py_VISIT(gen->closure);
14398 Py_VISIT(gen->classobj);
14399 Py_VISIT(gen->yieldfrom);
14400 return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg);
14401 }
__Pyx_Coroutine_clear(PyObject * self)14402 static int __Pyx_Coroutine_clear(PyObject *self) {
14403 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
14404 Py_CLEAR(gen->closure);
14405 Py_CLEAR(gen->classobj);
14406 Py_CLEAR(gen->yieldfrom);
14407 __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state);
14408 #ifdef __Pyx_AsyncGen_USED
14409 if (__Pyx_AsyncGen_CheckExact(self)) {
14410 Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
14411 }
14412 #endif
14413 Py_CLEAR(gen->gi_code);
14414 Py_CLEAR(gen->gi_name);
14415 Py_CLEAR(gen->gi_qualname);
14416 Py_CLEAR(gen->gi_modulename);
14417 return 0;
14418 }
__Pyx_Coroutine_dealloc(PyObject * self)14419 static void __Pyx_Coroutine_dealloc(PyObject *self) {
14420 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
14421 PyObject_GC_UnTrack(gen);
14422 if (gen->gi_weakreflist != NULL)
14423 PyObject_ClearWeakRefs(self);
14424 if (gen->resume_label >= 0) {
14425 PyObject_GC_Track(self);
14426 #if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE
14427 if (PyObject_CallFinalizerFromDealloc(self))
14428 #else
14429 Py_TYPE(gen)->tp_del(self);
14430 if (self->ob_refcnt > 0)
14431 #endif
14432 {
14433 return;
14434 }
14435 PyObject_GC_UnTrack(self);
14436 }
14437 #ifdef __Pyx_AsyncGen_USED
14438 if (__Pyx_AsyncGen_CheckExact(self)) {
14439 /* We have to handle this case for asynchronous generators
14440 right here, because this code has to be between UNTRACK
14441 and GC_Del. */
14442 Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer);
14443 }
14444 #endif
14445 __Pyx_Coroutine_clear(self);
14446 PyObject_GC_Del(gen);
14447 }
__Pyx_Coroutine_del(PyObject * self)14448 static void __Pyx_Coroutine_del(PyObject *self) {
14449 PyObject *error_type, *error_value, *error_traceback;
14450 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
14451 __Pyx_PyThreadState_declare
14452 if (gen->resume_label < 0) {
14453 return;
14454 }
14455 #if !CYTHON_USE_TP_FINALIZE
14456 assert(self->ob_refcnt == 0);
14457 __Pyx_SET_REFCNT(self, 1);
14458 #endif
14459 __Pyx_PyThreadState_assign
14460 __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
14461 #ifdef __Pyx_AsyncGen_USED
14462 if (__Pyx_AsyncGen_CheckExact(self)) {
14463 __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self;
14464 PyObject *finalizer = agen->ag_finalizer;
14465 if (finalizer && !agen->ag_closed) {
14466 PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self);
14467 if (unlikely(!res)) {
14468 PyErr_WriteUnraisable(self);
14469 } else {
14470 Py_DECREF(res);
14471 }
14472 __Pyx_ErrRestore(error_type, error_value, error_traceback);
14473 return;
14474 }
14475 }
14476 #endif
14477 if (unlikely(gen->resume_label == 0 && !error_value)) {
14478 #ifdef __Pyx_Coroutine_USED
14479 #ifdef __Pyx_Generator_USED
14480 if (!__Pyx_Generator_CheckExact(self))
14481 #endif
14482 {
14483 PyObject_GC_UnTrack(self);
14484 #if PY_MAJOR_VERSION >= 3 || defined(PyErr_WarnFormat)
14485 if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
14486 PyErr_WriteUnraisable(self);
14487 #else
14488 {PyObject *msg;
14489 char *cmsg;
14490 #if CYTHON_COMPILING_IN_PYPY
14491 msg = NULL;
14492 cmsg = (char*) "coroutine was never awaited";
14493 #else
14494 char *cname;
14495 PyObject *qualname;
14496 qualname = gen->gi_qualname;
14497 cname = PyString_AS_STRING(qualname);
14498 msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname);
14499 if (unlikely(!msg)) {
14500 PyErr_Clear();
14501 cmsg = (char*) "coroutine was never awaited";
14502 } else {
14503 cmsg = PyString_AS_STRING(msg);
14504 }
14505 #endif
14506 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0))
14507 PyErr_WriteUnraisable(self);
14508 Py_XDECREF(msg);}
14509 #endif
14510 PyObject_GC_Track(self);
14511 }
14512 #endif
14513 } else {
14514 PyObject *res = __Pyx_Coroutine_Close(self);
14515 if (unlikely(!res)) {
14516 if (PyErr_Occurred())
14517 PyErr_WriteUnraisable(self);
14518 } else {
14519 Py_DECREF(res);
14520 }
14521 }
14522 __Pyx_ErrRestore(error_type, error_value, error_traceback);
14523 #if !CYTHON_USE_TP_FINALIZE
14524 assert(self->ob_refcnt > 0);
14525 if (--self->ob_refcnt == 0) {
14526 return;
14527 }
14528 {
14529 Py_ssize_t refcnt = self->ob_refcnt;
14530 _Py_NewReference(self);
14531 __Pyx_SET_REFCNT(self, refcnt);
14532 }
14533 #if CYTHON_COMPILING_IN_CPYTHON
14534 assert(PyType_IS_GC(self->ob_type) &&
14535 _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
14536 _Py_DEC_REFTOTAL;
14537 #endif
14538 #ifdef COUNT_ALLOCS
14539 --Py_TYPE(self)->tp_frees;
14540 --Py_TYPE(self)->tp_allocs;
14541 #endif
14542 #endif
14543 }
14544 static PyObject *
__Pyx_Coroutine_get_name(__pyx_CoroutineObject * self,CYTHON_UNUSED void * context)14545 __Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
14546 {
14547 PyObject *name = self->gi_name;
14548 if (unlikely(!name)) name = Py_None;
14549 Py_INCREF(name);
14550 return name;
14551 }
14552 static int
__Pyx_Coroutine_set_name(__pyx_CoroutineObject * self,PyObject * value,CYTHON_UNUSED void * context)14553 __Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context)
14554 {
14555 PyObject *tmp;
14556 #if PY_MAJOR_VERSION >= 3
14557 if (unlikely(value == NULL || !PyUnicode_Check(value)))
14558 #else
14559 if (unlikely(value == NULL || !PyString_Check(value)))
14560 #endif
14561 {
14562 PyErr_SetString(PyExc_TypeError,
14563 "__name__ must be set to a string object");
14564 return -1;
14565 }
14566 tmp = self->gi_name;
14567 Py_INCREF(value);
14568 self->gi_name = value;
14569 Py_XDECREF(tmp);
14570 return 0;
14571 }
14572 static PyObject *
__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject * self,CYTHON_UNUSED void * context)14573 __Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
14574 {
14575 PyObject *name = self->gi_qualname;
14576 if (unlikely(!name)) name = Py_None;
14577 Py_INCREF(name);
14578 return name;
14579 }
14580 static int
__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject * self,PyObject * value,CYTHON_UNUSED void * context)14581 __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context)
14582 {
14583 PyObject *tmp;
14584 #if PY_MAJOR_VERSION >= 3
14585 if (unlikely(value == NULL || !PyUnicode_Check(value)))
14586 #else
14587 if (unlikely(value == NULL || !PyString_Check(value)))
14588 #endif
14589 {
14590 PyErr_SetString(PyExc_TypeError,
14591 "__qualname__ must be set to a string object");
14592 return -1;
14593 }
14594 tmp = self->gi_qualname;
14595 Py_INCREF(value);
14596 self->gi_qualname = value;
14597 Py_XDECREF(tmp);
14598 return 0;
14599 }
__Pyx__Coroutine_New(PyTypeObject * type,__pyx_coroutine_body_t body,PyObject * code,PyObject * closure,PyObject * name,PyObject * qualname,PyObject * module_name)14600 static __pyx_CoroutineObject *__Pyx__Coroutine_New(
14601 PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
14602 PyObject *name, PyObject *qualname, PyObject *module_name) {
14603 __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
14604 if (unlikely(!gen))
14605 return NULL;
14606 return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name);
14607 }
__Pyx__Coroutine_NewInit(__pyx_CoroutineObject * gen,__pyx_coroutine_body_t body,PyObject * code,PyObject * closure,PyObject * name,PyObject * qualname,PyObject * module_name)14608 static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
14609 __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
14610 PyObject *name, PyObject *qualname, PyObject *module_name) {
14611 gen->body = body;
14612 gen->closure = closure;
14613 Py_XINCREF(closure);
14614 gen->is_running = 0;
14615 gen->resume_label = 0;
14616 gen->classobj = NULL;
14617 gen->yieldfrom = NULL;
14618 gen->gi_exc_state.exc_type = NULL;
14619 gen->gi_exc_state.exc_value = NULL;
14620 gen->gi_exc_state.exc_traceback = NULL;
14621 #if CYTHON_USE_EXC_INFO_STACK
14622 gen->gi_exc_state.previous_item = NULL;
14623 #endif
14624 gen->gi_weakreflist = NULL;
14625 Py_XINCREF(qualname);
14626 gen->gi_qualname = qualname;
14627 Py_XINCREF(name);
14628 gen->gi_name = name;
14629 Py_XINCREF(module_name);
14630 gen->gi_modulename = module_name;
14631 Py_XINCREF(code);
14632 gen->gi_code = code;
14633 PyObject_GC_Track(gen);
14634 return gen;
14635 }
14636
14637 /* PatchModuleWithCoroutine */
__Pyx_Coroutine_patch_module(PyObject * module,const char * py_code)14638 static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) {
14639 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
14640 int result;
14641 PyObject *globals, *result_obj;
14642 globals = PyDict_New(); if (unlikely(!globals)) goto ignore;
14643 result = PyDict_SetItemString(globals, "_cython_coroutine_type",
14644 #ifdef __Pyx_Coroutine_USED
14645 (PyObject*)__pyx_CoroutineType);
14646 #else
14647 Py_None);
14648 #endif
14649 if (unlikely(result < 0)) goto ignore;
14650 result = PyDict_SetItemString(globals, "_cython_generator_type",
14651 #ifdef __Pyx_Generator_USED
14652 (PyObject*)__pyx_GeneratorType);
14653 #else
14654 Py_None);
14655 #endif
14656 if (unlikely(result < 0)) goto ignore;
14657 if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore;
14658 if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore;
14659 result_obj = PyRun_String(py_code, Py_file_input, globals, globals);
14660 if (unlikely(!result_obj)) goto ignore;
14661 Py_DECREF(result_obj);
14662 Py_DECREF(globals);
14663 return module;
14664 ignore:
14665 Py_XDECREF(globals);
14666 PyErr_WriteUnraisable(module);
14667 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) {
14668 Py_DECREF(module);
14669 module = NULL;
14670 }
14671 #else
14672 py_code++;
14673 #endif
14674 return module;
14675 }
14676
14677 /* PatchGeneratorABC */
14678 #ifndef CYTHON_REGISTER_ABCS
14679 #define CYTHON_REGISTER_ABCS 1
14680 #endif
14681 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
14682 static PyObject* __Pyx_patch_abc_module(PyObject *module);
__Pyx_patch_abc_module(PyObject * module)14683 static PyObject* __Pyx_patch_abc_module(PyObject *module) {
14684 module = __Pyx_Coroutine_patch_module(
14685 module, ""
14686 "if _cython_generator_type is not None:\n"
14687 " try: Generator = _module.Generator\n"
14688 " except AttributeError: pass\n"
14689 " else: Generator.register(_cython_generator_type)\n"
14690 "if _cython_coroutine_type is not None:\n"
14691 " try: Coroutine = _module.Coroutine\n"
14692 " except AttributeError: pass\n"
14693 " else: Coroutine.register(_cython_coroutine_type)\n"
14694 );
14695 return module;
14696 }
14697 #endif
__Pyx_patch_abc(void)14698 static int __Pyx_patch_abc(void) {
14699 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
14700 static int abc_patched = 0;
14701 if (CYTHON_REGISTER_ABCS && !abc_patched) {
14702 PyObject *module;
14703 module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections");
14704 if (!module) {
14705 PyErr_WriteUnraisable(NULL);
14706 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
14707 ((PY_MAJOR_VERSION >= 3) ?
14708 "Cython module failed to register with collections.abc module" :
14709 "Cython module failed to register with collections module"), 1) < 0)) {
14710 return -1;
14711 }
14712 } else {
14713 module = __Pyx_patch_abc_module(module);
14714 abc_patched = 1;
14715 if (unlikely(!module))
14716 return -1;
14717 Py_DECREF(module);
14718 }
14719 module = PyImport_ImportModule("backports_abc");
14720 if (module) {
14721 module = __Pyx_patch_abc_module(module);
14722 Py_XDECREF(module);
14723 }
14724 if (!module) {
14725 PyErr_Clear();
14726 }
14727 }
14728 #else
14729 if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL);
14730 #endif
14731 return 0;
14732 }
14733
14734 /* Generator */
14735 static PyMethodDef __pyx_Generator_methods[] = {
14736 {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
14737 (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
14738 {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
14739 (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
14740 {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS,
14741 (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")},
14742 {0, 0, 0, 0}
14743 };
14744 static PyMemberDef __pyx_Generator_memberlist[] = {
14745 {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL},
14746 {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
14747 (char*) PyDoc_STR("object being iterated by 'yield from', or None")},
14748 {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
14749 {0, 0, 0, 0, 0}
14750 };
14751 static PyGetSetDef __pyx_Generator_getsets[] = {
14752 {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
14753 (char*) PyDoc_STR("name of the generator"), 0},
14754 {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
14755 (char*) PyDoc_STR("qualified name of the generator"), 0},
14756 {0, 0, 0, 0, 0}
14757 };
14758 static PyTypeObject __pyx_GeneratorType_type = {
14759 PyVarObject_HEAD_INIT(0, 0)
14760 "generator",
14761 sizeof(__pyx_CoroutineObject),
14762 0,
14763 (destructor) __Pyx_Coroutine_dealloc,
14764 0,
14765 0,
14766 0,
14767 0,
14768 0,
14769 0,
14770 0,
14771 0,
14772 0,
14773 0,
14774 0,
14775 0,
14776 0,
14777 0,
14778 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
14779 0,
14780 (traverseproc) __Pyx_Coroutine_traverse,
14781 0,
14782 0,
14783 offsetof(__pyx_CoroutineObject, gi_weakreflist),
14784 0,
14785 (iternextfunc) __Pyx_Generator_Next,
14786 __pyx_Generator_methods,
14787 __pyx_Generator_memberlist,
14788 __pyx_Generator_getsets,
14789 0,
14790 0,
14791 0,
14792 0,
14793 0,
14794 0,
14795 0,
14796 0,
14797 0,
14798 0,
14799 0,
14800 0,
14801 0,
14802 0,
14803 0,
14804 #if CYTHON_USE_TP_FINALIZE
14805 0,
14806 #else
14807 __Pyx_Coroutine_del,
14808 #endif
14809 0,
14810 #if CYTHON_USE_TP_FINALIZE
14811 __Pyx_Coroutine_del,
14812 #elif PY_VERSION_HEX >= 0x030400a1
14813 0,
14814 #endif
14815 #if PY_VERSION_HEX >= 0x030800b1
14816 0,
14817 #endif
14818 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
14819 0,
14820 #endif
14821 };
__pyx_Generator_init(void)14822 static int __pyx_Generator_init(void) {
14823 __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
14824 __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
14825 __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
14826 if (unlikely(!__pyx_GeneratorType)) {
14827 return -1;
14828 }
14829 return 0;
14830 }
14831
14832 /* CheckBinaryVersion */
__Pyx_check_binary_version(void)14833 static int __Pyx_check_binary_version(void) {
14834 char ctversion[4], rtversion[4];
14835 PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
14836 PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
14837 if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
14838 char message[200];
14839 PyOS_snprintf(message, sizeof(message),
14840 "compiletime version %s of module '%.100s' "
14841 "does not match runtime version %s",
14842 ctversion, __Pyx_MODULE_NAME, rtversion);
14843 return PyErr_WarnEx(NULL, message, 1);
14844 }
14845 return 0;
14846 }
14847
14848 /* InitStrings */
__Pyx_InitStrings(__Pyx_StringTabEntry * t)14849 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
14850 while (t->p) {
14851 #if PY_MAJOR_VERSION < 3
14852 if (t->is_unicode) {
14853 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
14854 } else if (t->intern) {
14855 *t->p = PyString_InternFromString(t->s);
14856 } else {
14857 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
14858 }
14859 #else
14860 if (t->is_unicode | t->is_str) {
14861 if (t->intern) {
14862 *t->p = PyUnicode_InternFromString(t->s);
14863 } else if (t->encoding) {
14864 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
14865 } else {
14866 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
14867 }
14868 } else {
14869 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
14870 }
14871 #endif
14872 if (!*t->p)
14873 return -1;
14874 if (PyObject_Hash(*t->p) == -1)
14875 return -1;
14876 ++t;
14877 }
14878 return 0;
14879 }
14880
__Pyx_PyUnicode_FromString(const char * c_str)14881 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
14882 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
14883 }
__Pyx_PyObject_AsString(PyObject * o)14884 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
14885 Py_ssize_t ignore;
14886 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
14887 }
14888 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
14889 #if !CYTHON_PEP393_ENABLED
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)14890 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
14891 char* defenc_c;
14892 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
14893 if (!defenc) return NULL;
14894 defenc_c = PyBytes_AS_STRING(defenc);
14895 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
14896 {
14897 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
14898 char* c;
14899 for (c = defenc_c; c < end; c++) {
14900 if ((unsigned char) (*c) >= 128) {
14901 PyUnicode_AsASCIIString(o);
14902 return NULL;
14903 }
14904 }
14905 }
14906 #endif
14907 *length = PyBytes_GET_SIZE(defenc);
14908 return defenc_c;
14909 }
14910 #else
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)14911 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
14912 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
14913 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
14914 if (likely(PyUnicode_IS_ASCII(o))) {
14915 *length = PyUnicode_GET_LENGTH(o);
14916 return PyUnicode_AsUTF8(o);
14917 } else {
14918 PyUnicode_AsASCIIString(o);
14919 return NULL;
14920 }
14921 #else
14922 return PyUnicode_AsUTF8AndSize(o, length);
14923 #endif
14924 }
14925 #endif
14926 #endif
__Pyx_PyObject_AsStringAndSize(PyObject * o,Py_ssize_t * length)14927 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
14928 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
14929 if (
14930 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
14931 __Pyx_sys_getdefaultencoding_not_ascii &&
14932 #endif
14933 PyUnicode_Check(o)) {
14934 return __Pyx_PyUnicode_AsStringAndSize(o, length);
14935 } else
14936 #endif
14937 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
14938 if (PyByteArray_Check(o)) {
14939 *length = PyByteArray_GET_SIZE(o);
14940 return PyByteArray_AS_STRING(o);
14941 } else
14942 #endif
14943 {
14944 char* result;
14945 int r = PyBytes_AsStringAndSize(o, &result, length);
14946 if (unlikely(r < 0)) {
14947 return NULL;
14948 } else {
14949 return result;
14950 }
14951 }
14952 }
__Pyx_PyObject_IsTrue(PyObject * x)14953 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
14954 int is_true = x == Py_True;
14955 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
14956 else return PyObject_IsTrue(x);
14957 }
__Pyx_PyObject_IsTrueAndDecref(PyObject * x)14958 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
14959 int retval;
14960 if (unlikely(!x)) return -1;
14961 retval = __Pyx_PyObject_IsTrue(x);
14962 Py_DECREF(x);
14963 return retval;
14964 }
__Pyx_PyNumber_IntOrLongWrongResultType(PyObject * result,const char * type_name)14965 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
14966 #if PY_MAJOR_VERSION >= 3
14967 if (PyLong_Check(result)) {
14968 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
14969 "__int__ returned non-int (type %.200s). "
14970 "The ability to return an instance of a strict subclass of int "
14971 "is deprecated, and may be removed in a future version of Python.",
14972 Py_TYPE(result)->tp_name)) {
14973 Py_DECREF(result);
14974 return NULL;
14975 }
14976 return result;
14977 }
14978 #endif
14979 PyErr_Format(PyExc_TypeError,
14980 "__%.4s__ returned non-%.4s (type %.200s)",
14981 type_name, type_name, Py_TYPE(result)->tp_name);
14982 Py_DECREF(result);
14983 return NULL;
14984 }
__Pyx_PyNumber_IntOrLong(PyObject * x)14985 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
14986 #if CYTHON_USE_TYPE_SLOTS
14987 PyNumberMethods *m;
14988 #endif
14989 const char *name = NULL;
14990 PyObject *res = NULL;
14991 #if PY_MAJOR_VERSION < 3
14992 if (likely(PyInt_Check(x) || PyLong_Check(x)))
14993 #else
14994 if (likely(PyLong_Check(x)))
14995 #endif
14996 return __Pyx_NewRef(x);
14997 #if CYTHON_USE_TYPE_SLOTS
14998 m = Py_TYPE(x)->tp_as_number;
14999 #if PY_MAJOR_VERSION < 3
15000 if (m && m->nb_int) {
15001 name = "int";
15002 res = m->nb_int(x);
15003 }
15004 else if (m && m->nb_long) {
15005 name = "long";
15006 res = m->nb_long(x);
15007 }
15008 #else
15009 if (likely(m && m->nb_int)) {
15010 name = "int";
15011 res = m->nb_int(x);
15012 }
15013 #endif
15014 #else
15015 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
15016 res = PyNumber_Int(x);
15017 }
15018 #endif
15019 if (likely(res)) {
15020 #if PY_MAJOR_VERSION < 3
15021 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
15022 #else
15023 if (unlikely(!PyLong_CheckExact(res))) {
15024 #endif
15025 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
15026 }
15027 }
15028 else if (!PyErr_Occurred()) {
15029 PyErr_SetString(PyExc_TypeError,
15030 "an integer is required");
15031 }
15032 return res;
15033 }
15034 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
15035 Py_ssize_t ival;
15036 PyObject *x;
15037 #if PY_MAJOR_VERSION < 3
15038 if (likely(PyInt_CheckExact(b))) {
15039 if (sizeof(Py_ssize_t) >= sizeof(long))
15040 return PyInt_AS_LONG(b);
15041 else
15042 return PyInt_AsSsize_t(b);
15043 }
15044 #endif
15045 if (likely(PyLong_CheckExact(b))) {
15046 #if CYTHON_USE_PYLONG_INTERNALS
15047 const digit* digits = ((PyLongObject*)b)->ob_digit;
15048 const Py_ssize_t size = Py_SIZE(b);
15049 if (likely(__Pyx_sst_abs(size) <= 1)) {
15050 ival = likely(size) ? digits[0] : 0;
15051 if (size == -1) ival = -ival;
15052 return ival;
15053 } else {
15054 switch (size) {
15055 case 2:
15056 if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
15057 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
15058 }
15059 break;
15060 case -2:
15061 if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
15062 return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
15063 }
15064 break;
15065 case 3:
15066 if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
15067 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
15068 }
15069 break;
15070 case -3:
15071 if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
15072 return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
15073 }
15074 break;
15075 case 4:
15076 if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
15077 return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
15078 }
15079 break;
15080 case -4:
15081 if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
15082 return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
15083 }
15084 break;
15085 }
15086 }
15087 #endif
15088 return PyLong_AsSsize_t(b);
15089 }
15090 x = PyNumber_Index(b);
15091 if (!x) return -1;
15092 ival = PyInt_AsSsize_t(x);
15093 Py_DECREF(x);
15094 return ival;
15095 }
15096 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
15097 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
15098 }
15099 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
15100 return PyInt_FromSize_t(ival);
15101 }
15102
15103
15104 #endif /* Py_PYTHON_H */
15105