1 /* Generated by Cython 0.29.21 */
2 
3 #define PY_SSIZE_T_CLEAN
4 #include "Python.h"
5 #ifndef Py_PYTHON_H
6     #error Python headers needed to compile C extensions, please install development version of Python.
7 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
8     #error Cython requires Python 2.6+ or Python 3.3+.
9 #else
10 #define CYTHON_ABI "0_29_21"
11 #define CYTHON_HEX_VERSION 0x001D15F0
12 #define CYTHON_FUTURE_DIVISION 1
13 #include <stddef.h>
14 #ifndef offsetof
15   #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
16 #endif
17 #if !defined(WIN32) && !defined(MS_WINDOWS)
18   #ifndef __stdcall
19     #define __stdcall
20   #endif
21   #ifndef __cdecl
22     #define __cdecl
23   #endif
24   #ifndef __fastcall
25     #define __fastcall
26   #endif
27 #endif
28 #ifndef DL_IMPORT
29   #define DL_IMPORT(t) t
30 #endif
31 #ifndef DL_EXPORT
32   #define DL_EXPORT(t) t
33 #endif
34 #define __PYX_COMMA ,
35 #ifndef HAVE_LONG_LONG
36   #if PY_VERSION_HEX >= 0x02070000
37     #define HAVE_LONG_LONG
38   #endif
39 #endif
40 #ifndef PY_LONG_LONG
41   #define PY_LONG_LONG LONG_LONG
42 #endif
43 #ifndef Py_HUGE_VAL
44   #define Py_HUGE_VAL HUGE_VAL
45 #endif
46 #ifdef PYPY_VERSION
47   #define CYTHON_COMPILING_IN_PYPY 1
48   #define CYTHON_COMPILING_IN_PYSTON 0
49   #define CYTHON_COMPILING_IN_CPYTHON 0
50   #undef CYTHON_USE_TYPE_SLOTS
51   #define CYTHON_USE_TYPE_SLOTS 0
52   #undef CYTHON_USE_PYTYPE_LOOKUP
53   #define CYTHON_USE_PYTYPE_LOOKUP 0
54   #if PY_VERSION_HEX < 0x03050000
55     #undef CYTHON_USE_ASYNC_SLOTS
56     #define CYTHON_USE_ASYNC_SLOTS 0
57   #elif !defined(CYTHON_USE_ASYNC_SLOTS)
58     #define CYTHON_USE_ASYNC_SLOTS 1
59   #endif
60   #undef CYTHON_USE_PYLIST_INTERNALS
61   #define CYTHON_USE_PYLIST_INTERNALS 0
62   #undef CYTHON_USE_UNICODE_INTERNALS
63   #define CYTHON_USE_UNICODE_INTERNALS 0
64   #undef CYTHON_USE_UNICODE_WRITER
65   #define CYTHON_USE_UNICODE_WRITER 0
66   #undef CYTHON_USE_PYLONG_INTERNALS
67   #define CYTHON_USE_PYLONG_INTERNALS 0
68   #undef CYTHON_AVOID_BORROWED_REFS
69   #define CYTHON_AVOID_BORROWED_REFS 1
70   #undef CYTHON_ASSUME_SAFE_MACROS
71   #define CYTHON_ASSUME_SAFE_MACROS 0
72   #undef CYTHON_UNPACK_METHODS
73   #define CYTHON_UNPACK_METHODS 0
74   #undef CYTHON_FAST_THREAD_STATE
75   #define CYTHON_FAST_THREAD_STATE 0
76   #undef CYTHON_FAST_PYCALL
77   #define CYTHON_FAST_PYCALL 0
78   #undef CYTHON_PEP489_MULTI_PHASE_INIT
79   #define CYTHON_PEP489_MULTI_PHASE_INIT 0
80   #undef CYTHON_USE_TP_FINALIZE
81   #define CYTHON_USE_TP_FINALIZE 0
82   #undef CYTHON_USE_DICT_VERSIONS
83   #define CYTHON_USE_DICT_VERSIONS 0
84   #undef CYTHON_USE_EXC_INFO_STACK
85   #define CYTHON_USE_EXC_INFO_STACK 0
86 #elif defined(PYSTON_VERSION)
87   #define CYTHON_COMPILING_IN_PYPY 0
88   #define CYTHON_COMPILING_IN_PYSTON 1
89   #define CYTHON_COMPILING_IN_CPYTHON 0
90   #ifndef CYTHON_USE_TYPE_SLOTS
91     #define CYTHON_USE_TYPE_SLOTS 1
92   #endif
93   #undef CYTHON_USE_PYTYPE_LOOKUP
94   #define CYTHON_USE_PYTYPE_LOOKUP 0
95   #undef CYTHON_USE_ASYNC_SLOTS
96   #define CYTHON_USE_ASYNC_SLOTS 0
97   #undef CYTHON_USE_PYLIST_INTERNALS
98   #define CYTHON_USE_PYLIST_INTERNALS 0
99   #ifndef CYTHON_USE_UNICODE_INTERNALS
100     #define CYTHON_USE_UNICODE_INTERNALS 1
101   #endif
102   #undef CYTHON_USE_UNICODE_WRITER
103   #define CYTHON_USE_UNICODE_WRITER 0
104   #undef CYTHON_USE_PYLONG_INTERNALS
105   #define CYTHON_USE_PYLONG_INTERNALS 0
106   #ifndef CYTHON_AVOID_BORROWED_REFS
107     #define CYTHON_AVOID_BORROWED_REFS 0
108   #endif
109   #ifndef CYTHON_ASSUME_SAFE_MACROS
110     #define CYTHON_ASSUME_SAFE_MACROS 1
111   #endif
112   #ifndef CYTHON_UNPACK_METHODS
113     #define CYTHON_UNPACK_METHODS 1
114   #endif
115   #undef CYTHON_FAST_THREAD_STATE
116   #define CYTHON_FAST_THREAD_STATE 0
117   #undef CYTHON_FAST_PYCALL
118   #define CYTHON_FAST_PYCALL 0
119   #undef CYTHON_PEP489_MULTI_PHASE_INIT
120   #define CYTHON_PEP489_MULTI_PHASE_INIT 0
121   #undef CYTHON_USE_TP_FINALIZE
122   #define CYTHON_USE_TP_FINALIZE 0
123   #undef CYTHON_USE_DICT_VERSIONS
124   #define CYTHON_USE_DICT_VERSIONS 0
125   #undef CYTHON_USE_EXC_INFO_STACK
126   #define CYTHON_USE_EXC_INFO_STACK 0
127 #else
128   #define CYTHON_COMPILING_IN_PYPY 0
129   #define CYTHON_COMPILING_IN_PYSTON 0
130   #define CYTHON_COMPILING_IN_CPYTHON 1
131   #ifndef CYTHON_USE_TYPE_SLOTS
132     #define CYTHON_USE_TYPE_SLOTS 1
133   #endif
134   #if PY_VERSION_HEX < 0x02070000
135     #undef CYTHON_USE_PYTYPE_LOOKUP
136     #define CYTHON_USE_PYTYPE_LOOKUP 0
137   #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
138     #define CYTHON_USE_PYTYPE_LOOKUP 1
139   #endif
140   #if PY_MAJOR_VERSION < 3
141     #undef CYTHON_USE_ASYNC_SLOTS
142     #define CYTHON_USE_ASYNC_SLOTS 0
143   #elif !defined(CYTHON_USE_ASYNC_SLOTS)
144     #define CYTHON_USE_ASYNC_SLOTS 1
145   #endif
146   #if PY_VERSION_HEX < 0x02070000
147     #undef CYTHON_USE_PYLONG_INTERNALS
148     #define CYTHON_USE_PYLONG_INTERNALS 0
149   #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
150     #define CYTHON_USE_PYLONG_INTERNALS 1
151   #endif
152   #ifndef CYTHON_USE_PYLIST_INTERNALS
153     #define CYTHON_USE_PYLIST_INTERNALS 1
154   #endif
155   #ifndef CYTHON_USE_UNICODE_INTERNALS
156     #define CYTHON_USE_UNICODE_INTERNALS 1
157   #endif
158   #if PY_VERSION_HEX < 0x030300F0
159     #undef CYTHON_USE_UNICODE_WRITER
160     #define CYTHON_USE_UNICODE_WRITER 0
161   #elif !defined(CYTHON_USE_UNICODE_WRITER)
162     #define CYTHON_USE_UNICODE_WRITER 1
163   #endif
164   #ifndef CYTHON_AVOID_BORROWED_REFS
165     #define CYTHON_AVOID_BORROWED_REFS 0
166   #endif
167   #ifndef CYTHON_ASSUME_SAFE_MACROS
168     #define CYTHON_ASSUME_SAFE_MACROS 1
169   #endif
170   #ifndef CYTHON_UNPACK_METHODS
171     #define CYTHON_UNPACK_METHODS 1
172   #endif
173   #ifndef CYTHON_FAST_THREAD_STATE
174     #define CYTHON_FAST_THREAD_STATE 1
175   #endif
176   #ifndef CYTHON_FAST_PYCALL
177     #define CYTHON_FAST_PYCALL 1
178   #endif
179   #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
180     #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
181   #endif
182   #ifndef CYTHON_USE_TP_FINALIZE
183     #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
184   #endif
185   #ifndef CYTHON_USE_DICT_VERSIONS
186     #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
187   #endif
188   #ifndef CYTHON_USE_EXC_INFO_STACK
189     #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
190   #endif
191 #endif
192 #if !defined(CYTHON_FAST_PYCCALL)
193 #define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
194 #endif
195 #if CYTHON_USE_PYLONG_INTERNALS
196   #include "longintrepr.h"
197   #undef SHIFT
198   #undef BASE
199   #undef MASK
200   #ifdef SIZEOF_VOID_P
201     enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
202   #endif
203 #endif
204 #ifndef __has_attribute
205   #define __has_attribute(x) 0
206 #endif
207 #ifndef __has_cpp_attribute
208   #define __has_cpp_attribute(x) 0
209 #endif
210 #ifndef CYTHON_RESTRICT
211   #if defined(__GNUC__)
212     #define CYTHON_RESTRICT __restrict__
213   #elif defined(_MSC_VER) && _MSC_VER >= 1400
214     #define CYTHON_RESTRICT __restrict
215   #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
216     #define CYTHON_RESTRICT restrict
217   #else
218     #define CYTHON_RESTRICT
219   #endif
220 #endif
221 #ifndef CYTHON_UNUSED
222 # if defined(__GNUC__)
223 #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
224 #     define CYTHON_UNUSED __attribute__ ((__unused__))
225 #   else
226 #     define CYTHON_UNUSED
227 #   endif
228 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
229 #   define CYTHON_UNUSED __attribute__ ((__unused__))
230 # else
231 #   define CYTHON_UNUSED
232 # endif
233 #endif
234 #ifndef CYTHON_MAYBE_UNUSED_VAR
235 #  if defined(__cplusplus)
CYTHON_MAYBE_UNUSED_VAR(const T &)236      template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
237 #  else
238 #    define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
239 #  endif
240 #endif
241 #ifndef CYTHON_NCP_UNUSED
242 # if CYTHON_COMPILING_IN_CPYTHON
243 #  define CYTHON_NCP_UNUSED
244 # else
245 #  define CYTHON_NCP_UNUSED CYTHON_UNUSED
246 # endif
247 #endif
248 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
249 #ifdef _MSC_VER
250     #ifndef _MSC_STDINT_H_
251         #if _MSC_VER < 1300
252            typedef unsigned char     uint8_t;
253            typedef unsigned int      uint32_t;
254         #else
255            typedef unsigned __int8   uint8_t;
256            typedef unsigned __int32  uint32_t;
257         #endif
258     #endif
259 #else
260    #include <stdint.h>
261 #endif
262 #ifndef CYTHON_FALLTHROUGH
263   #if defined(__cplusplus) && __cplusplus >= 201103L
264     #if __has_cpp_attribute(fallthrough)
265       #define CYTHON_FALLTHROUGH [[fallthrough]]
266     #elif __has_cpp_attribute(clang::fallthrough)
267       #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
268     #elif __has_cpp_attribute(gnu::fallthrough)
269       #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
270     #endif
271   #endif
272   #ifndef CYTHON_FALLTHROUGH
273     #if __has_attribute(fallthrough)
274       #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
275     #else
276       #define CYTHON_FALLTHROUGH
277     #endif
278   #endif
279   #if defined(__clang__ ) && defined(__apple_build_version__)
280     #if __apple_build_version__ < 7000000
281       #undef  CYTHON_FALLTHROUGH
282       #define CYTHON_FALLTHROUGH
283     #endif
284   #endif
285 #endif
286 
287 #ifndef CYTHON_INLINE
288   #if defined(__clang__)
289     #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
290   #elif defined(__GNUC__)
291     #define CYTHON_INLINE __inline__
292   #elif defined(_MSC_VER)
293     #define CYTHON_INLINE __inline
294   #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
295     #define CYTHON_INLINE inline
296   #else
297     #define CYTHON_INLINE
298   #endif
299 #endif
300 
301 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
302   #define Py_OptimizeFlag 0
303 #endif
304 #define __PYX_BUILD_PY_SSIZE_T "n"
305 #define CYTHON_FORMAT_SSIZE_T "z"
306 #if PY_MAJOR_VERSION < 3
307   #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
308   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
309           PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
310   #define __Pyx_DefaultClassType PyClass_Type
311 #else
312   #define __Pyx_BUILTIN_MODULE_NAME "builtins"
313 #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
314   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
315           PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
316 #else
317   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
318           PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
319 #endif
320   #define __Pyx_DefaultClassType PyType_Type
321 #endif
322 #ifndef Py_TPFLAGS_CHECKTYPES
323   #define Py_TPFLAGS_CHECKTYPES 0
324 #endif
325 #ifndef Py_TPFLAGS_HAVE_INDEX
326   #define Py_TPFLAGS_HAVE_INDEX 0
327 #endif
328 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
329   #define Py_TPFLAGS_HAVE_NEWBUFFER 0
330 #endif
331 #ifndef Py_TPFLAGS_HAVE_FINALIZE
332   #define Py_TPFLAGS_HAVE_FINALIZE 0
333 #endif
334 #ifndef METH_STACKLESS
335   #define METH_STACKLESS 0
336 #endif
337 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
338   #ifndef METH_FASTCALL
339      #define METH_FASTCALL 0x80
340   #endif
341   typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
342   typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
343                                                           Py_ssize_t nargs, PyObject *kwnames);
344 #else
345   #define __Pyx_PyCFunctionFast _PyCFunctionFast
346   #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
347 #endif
348 #if CYTHON_FAST_PYCCALL
349 #define __Pyx_PyFastCFunction_Check(func)\
350     ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
351 #else
352 #define __Pyx_PyFastCFunction_Check(func) 0
353 #endif
354 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
355   #define PyObject_Malloc(s)   PyMem_Malloc(s)
356   #define PyObject_Free(p)     PyMem_Free(p)
357   #define PyObject_Realloc(p)  PyMem_Realloc(p)
358 #endif
359 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
360   #define PyMem_RawMalloc(n)           PyMem_Malloc(n)
361   #define PyMem_RawRealloc(p, n)       PyMem_Realloc(p, n)
362   #define PyMem_RawFree(p)             PyMem_Free(p)
363 #endif
364 #if CYTHON_COMPILING_IN_PYSTON
365   #define __Pyx_PyCode_HasFreeVars(co)  PyCode_HasFreeVars(co)
366   #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
367 #else
368   #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
369   #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
370 #endif
371 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
372   #define __Pyx_PyThreadState_Current PyThreadState_GET()
373 #elif PY_VERSION_HEX >= 0x03060000
374   #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
375 #elif PY_VERSION_HEX >= 0x03000000
376   #define __Pyx_PyThreadState_Current PyThreadState_GET()
377 #else
378   #define __Pyx_PyThreadState_Current _PyThreadState_Current
379 #endif
380 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
381 #include "pythread.h"
382 #define Py_tss_NEEDS_INIT 0
383 typedef int Py_tss_t;
PyThread_tss_create(Py_tss_t * key)384 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
385   *key = PyThread_create_key();
386   return 0;
387 }
PyThread_tss_alloc(void)388 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
389   Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
390   *key = Py_tss_NEEDS_INIT;
391   return key;
392 }
PyThread_tss_free(Py_tss_t * key)393 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
394   PyObject_Free(key);
395 }
PyThread_tss_is_created(Py_tss_t * key)396 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
397   return *key != Py_tss_NEEDS_INIT;
398 }
PyThread_tss_delete(Py_tss_t * key)399 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
400   PyThread_delete_key(*key);
401   *key = Py_tss_NEEDS_INIT;
402 }
PyThread_tss_set(Py_tss_t * key,void * value)403 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
404   return PyThread_set_key_value(*key, value);
405 }
PyThread_tss_get(Py_tss_t * key)406 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
407   return PyThread_get_key_value(*key);
408 }
409 #endif
410 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
411 #define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
412 #else
413 #define __Pyx_PyDict_NewPresized(n)  PyDict_New()
414 #endif
415 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
416   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
417   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
418 #else
419   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
420   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
421 #endif
422 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
423 #define __Pyx_PyDict_GetItemStr(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
424 #else
425 #define __Pyx_PyDict_GetItemStr(dict, name)  PyDict_GetItem(dict, name)
426 #endif
427 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
428   #define CYTHON_PEP393_ENABLED 1
429   #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
430                                               0 : _PyUnicode_Ready((PyObject *)(op)))
431   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
432   #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
433   #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
434   #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
435   #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
436   #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
437   #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, ch)
438   #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
439   #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
440   #else
441   #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_LENGTH(u))
442   #endif
443 #else
444   #define CYTHON_PEP393_ENABLED 0
445   #define PyUnicode_1BYTE_KIND  1
446   #define PyUnicode_2BYTE_KIND  2
447   #define PyUnicode_4BYTE_KIND  4
448   #define __Pyx_PyUnicode_READY(op)       (0)
449   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
450   #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
451   #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
452   #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
453   #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
454   #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
455   #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
456   #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_SIZE(u))
457 #endif
458 #if CYTHON_COMPILING_IN_PYPY
459   #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
460   #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
461 #else
462   #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
463   #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
464       PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
465 #endif
466 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
467   #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
468 #endif
469 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
470   #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
471 #endif
472 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
473   #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
474 #endif
475 #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))
476 #define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
477 #if PY_MAJOR_VERSION >= 3
478   #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
479 #else
480   #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
481 #endif
482 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
483   #define PyObject_ASCII(o)            PyObject_Repr(o)
484 #endif
485 #if PY_MAJOR_VERSION >= 3
486   #define PyBaseString_Type            PyUnicode_Type
487   #define PyStringObject               PyUnicodeObject
488   #define PyString_Type                PyUnicode_Type
489   #define PyString_Check               PyUnicode_Check
490   #define PyString_CheckExact          PyUnicode_CheckExact
491 #ifndef PyObject_Unicode
492   #define PyObject_Unicode             PyObject_Str
493 #endif
494 #endif
495 #if PY_MAJOR_VERSION >= 3
496   #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
497   #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
498 #else
499   #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
500   #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
501 #endif
502 #ifndef PySet_CheckExact
503   #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
504 #endif
505 #if PY_VERSION_HEX >= 0x030900A4
506   #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
507   #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
508 #else
509   #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
510   #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
511 #endif
512 #if CYTHON_ASSUME_SAFE_MACROS
513   #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
514 #else
515   #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
516 #endif
517 #if PY_MAJOR_VERSION >= 3
518   #define PyIntObject                  PyLongObject
519   #define PyInt_Type                   PyLong_Type
520   #define PyInt_Check(op)              PyLong_Check(op)
521   #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
522   #define PyInt_FromString             PyLong_FromString
523   #define PyInt_FromUnicode            PyLong_FromUnicode
524   #define PyInt_FromLong               PyLong_FromLong
525   #define PyInt_FromSize_t             PyLong_FromSize_t
526   #define PyInt_FromSsize_t            PyLong_FromSsize_t
527   #define PyInt_AsLong                 PyLong_AsLong
528   #define PyInt_AS_LONG                PyLong_AS_LONG
529   #define PyInt_AsSsize_t              PyLong_AsSsize_t
530   #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
531   #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
532   #define PyNumber_Int                 PyNumber_Long
533 #endif
534 #if PY_MAJOR_VERSION >= 3
535   #define PyBoolObject                 PyLongObject
536 #endif
537 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
538   #ifndef PyUnicode_InternFromString
539     #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
540   #endif
541 #endif
542 #if PY_VERSION_HEX < 0x030200A4
543   typedef long Py_hash_t;
544   #define __Pyx_PyInt_FromHash_t PyInt_FromLong
545   #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
546 #else
547   #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
548   #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
549 #endif
550 #if PY_MAJOR_VERSION >= 3
551   #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
552 #else
553   #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
554 #endif
555 #if CYTHON_USE_ASYNC_SLOTS
556   #if PY_VERSION_HEX >= 0x030500B1
557     #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
558     #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
559   #else
560     #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
561   #endif
562 #else
563   #define __Pyx_PyType_AsAsync(obj) NULL
564 #endif
565 #ifndef __Pyx_PyAsyncMethodsStruct
566     typedef struct {
567         unaryfunc am_await;
568         unaryfunc am_aiter;
569         unaryfunc am_anext;
570     } __Pyx_PyAsyncMethodsStruct;
571 #endif
572 
573 #if defined(WIN32) || defined(MS_WINDOWS)
574   #define _USE_MATH_DEFINES
575 #endif
576 #include <math.h>
577 #ifdef NAN
578 #define __PYX_NAN() ((float) NAN)
579 #else
__PYX_NAN()580 static CYTHON_INLINE float __PYX_NAN() {
581   float value;
582   memset(&value, 0xFF, sizeof(value));
583   return value;
584 }
585 #endif
586 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
587 #define __Pyx_truncl trunc
588 #else
589 #define __Pyx_truncl truncl
590 #endif
591 
592 #define __PYX_MARK_ERR_POS(f_index, lineno) \
593     { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
594 #define __PYX_ERR(f_index, lineno, Ln_error) \
595     { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
596 
597 #ifndef __PYX_EXTERN_C
598   #ifdef __cplusplus
599     #define __PYX_EXTERN_C extern "C"
600   #else
601     #define __PYX_EXTERN_C extern
602   #endif
603 #endif
604 
605 #define __PYX_HAVE__fastavro___six
606 #define __PYX_HAVE_API__fastavro___six
607 /* Early includes */
608 #ifdef _OPENMP
609 #include <omp.h>
610 #endif /* _OPENMP */
611 
612 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
613 #define CYTHON_WITHOUT_ASSERTIONS
614 #endif
615 
616 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
617                 const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
618 
619 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
620 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
621 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
622 #define __PYX_DEFAULT_STRING_ENCODING ""
623 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
624 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
625 #define __Pyx_uchar_cast(c) ((unsigned char)c)
626 #define __Pyx_long_cast(x) ((long)x)
627 #define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
628     (sizeof(type) < sizeof(Py_ssize_t))  ||\
629     (sizeof(type) > sizeof(Py_ssize_t) &&\
630           likely(v < (type)PY_SSIZE_T_MAX ||\
631                  v == (type)PY_SSIZE_T_MAX)  &&\
632           (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
633                                 v == (type)PY_SSIZE_T_MIN)))  ||\
634     (sizeof(type) == sizeof(Py_ssize_t) &&\
635           (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
636                                v == (type)PY_SSIZE_T_MAX)))  )
__Pyx_is_valid_index(Py_ssize_t i,Py_ssize_t limit)637 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
638     return (size_t) i < (size_t) limit;
639 }
640 #if defined (__cplusplus) && __cplusplus >= 201103L
641     #include <cstdlib>
642     #define __Pyx_sst_abs(value) std::abs(value)
643 #elif SIZEOF_INT >= SIZEOF_SIZE_T
644     #define __Pyx_sst_abs(value) abs(value)
645 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
646     #define __Pyx_sst_abs(value) labs(value)
647 #elif defined (_MSC_VER)
648     #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
649 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
650     #define __Pyx_sst_abs(value) llabs(value)
651 #elif defined (__GNUC__)
652     #define __Pyx_sst_abs(value) __builtin_llabs(value)
653 #else
654     #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
655 #endif
656 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
657 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
658 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
659 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
660 #define __Pyx_PyBytes_FromString        PyBytes_FromString
661 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
662 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
663 #if PY_MAJOR_VERSION < 3
664     #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
665     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
666 #else
667     #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
668     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
669 #endif
670 #define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AS_STRING(s))
671 #define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AS_STRING(s))
672 #define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AS_STRING(s))
673 #define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AS_STRING(s))
674 #define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AS_STRING(s))
675 #define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AS_STRING(s))
676 #define __Pyx_PyObject_AsWritableString(s)    ((char*) __Pyx_PyObject_AsString(s))
677 #define __Pyx_PyObject_AsWritableSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
678 #define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
679 #define __Pyx_PyObject_AsSString(s)    ((const signed char*) __Pyx_PyObject_AsString(s))
680 #define __Pyx_PyObject_AsUString(s)    ((const unsigned char*) __Pyx_PyObject_AsString(s))
681 #define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
682 #define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
683 #define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
684 #define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
685 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
__Pyx_Py_UNICODE_strlen(const Py_UNICODE * u)686 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
687     const Py_UNICODE *u_end = u;
688     while (*u_end++) ;
689     return (size_t)(u_end - u - 1);
690 }
691 #define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
692 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
693 #define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
694 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
695 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
696 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
697 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
698 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
699 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
700 #define __Pyx_PySequence_Tuple(obj)\
701     (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
702 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
703 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
704 #if CYTHON_ASSUME_SAFE_MACROS
705 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
706 #else
707 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
708 #endif
709 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
710 #if PY_MAJOR_VERSION >= 3
711 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
712 #else
713 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
714 #endif
715 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
716 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
717 static int __Pyx_sys_getdefaultencoding_not_ascii;
__Pyx_init_sys_getdefaultencoding_params(void)718 static int __Pyx_init_sys_getdefaultencoding_params(void) {
719     PyObject* sys;
720     PyObject* default_encoding = NULL;
721     PyObject* ascii_chars_u = NULL;
722     PyObject* ascii_chars_b = NULL;
723     const char* default_encoding_c;
724     sys = PyImport_ImportModule("sys");
725     if (!sys) goto bad;
726     default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
727     Py_DECREF(sys);
728     if (!default_encoding) goto bad;
729     default_encoding_c = PyBytes_AsString(default_encoding);
730     if (!default_encoding_c) goto bad;
731     if (strcmp(default_encoding_c, "ascii") == 0) {
732         __Pyx_sys_getdefaultencoding_not_ascii = 0;
733     } else {
734         char ascii_chars[128];
735         int c;
736         for (c = 0; c < 128; c++) {
737             ascii_chars[c] = c;
738         }
739         __Pyx_sys_getdefaultencoding_not_ascii = 1;
740         ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
741         if (!ascii_chars_u) goto bad;
742         ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
743         if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
744             PyErr_Format(
745                 PyExc_ValueError,
746                 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
747                 default_encoding_c);
748             goto bad;
749         }
750         Py_DECREF(ascii_chars_u);
751         Py_DECREF(ascii_chars_b);
752     }
753     Py_DECREF(default_encoding);
754     return 0;
755 bad:
756     Py_XDECREF(default_encoding);
757     Py_XDECREF(ascii_chars_u);
758     Py_XDECREF(ascii_chars_b);
759     return -1;
760 }
761 #endif
762 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
763 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
764 #else
765 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
766 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
767 static char* __PYX_DEFAULT_STRING_ENCODING;
__Pyx_init_sys_getdefaultencoding_params(void)768 static int __Pyx_init_sys_getdefaultencoding_params(void) {
769     PyObject* sys;
770     PyObject* default_encoding = NULL;
771     char* default_encoding_c;
772     sys = PyImport_ImportModule("sys");
773     if (!sys) goto bad;
774     default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
775     Py_DECREF(sys);
776     if (!default_encoding) goto bad;
777     default_encoding_c = PyBytes_AsString(default_encoding);
778     if (!default_encoding_c) goto bad;
779     __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
780     if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
781     strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
782     Py_DECREF(default_encoding);
783     return 0;
784 bad:
785     Py_XDECREF(default_encoding);
786     return -1;
787 }
788 #endif
789 #endif
790 
791 
792 /* Test for GCC > 2.95 */
793 #if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
794   #define likely(x)   __builtin_expect(!!(x), 1)
795   #define unlikely(x) __builtin_expect(!!(x), 0)
796 #else /* !__GNUC__ or GCC < 2.95 */
797   #define likely(x)   (x)
798   #define unlikely(x) (x)
799 #endif /* __GNUC__ */
__Pyx_pretend_to_initialize(void * ptr)800 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
801 
802 static PyObject *__pyx_m = NULL;
803 static PyObject *__pyx_d;
804 static PyObject *__pyx_b;
805 static PyObject *__pyx_cython_runtime = NULL;
806 static PyObject *__pyx_empty_tuple;
807 static PyObject *__pyx_empty_bytes;
808 static PyObject *__pyx_empty_unicode;
809 static int __pyx_lineno;
810 static int __pyx_clineno = 0;
811 static const char * __pyx_cfilenm= __FILE__;
812 static const char *__pyx_filename;
813 
814 
815 static const char *__pyx_f[] = {
816   "fastavro/_six.pyx",
817 };
818 
819 /*--- Type declarations ---*/
820 
821 /* --- Runtime support code (head) --- */
822 /* Refnanny.proto */
823 #ifndef CYTHON_REFNANNY
824   #define CYTHON_REFNANNY 0
825 #endif
826 #if CYTHON_REFNANNY
827   typedef struct {
828     void (*INCREF)(void*, PyObject*, int);
829     void (*DECREF)(void*, PyObject*, int);
830     void (*GOTREF)(void*, PyObject*, int);
831     void (*GIVEREF)(void*, PyObject*, int);
832     void* (*SetupContext)(const char*, int, const char*);
833     void (*FinishContext)(void**);
834   } __Pyx_RefNannyAPIStruct;
835   static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
836   static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
837   #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
838 #ifdef WITH_THREAD
839   #define __Pyx_RefNannySetupContext(name, acquire_gil)\
840           if (acquire_gil) {\
841               PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
842               __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
843               PyGILState_Release(__pyx_gilstate_save);\
844           } else {\
845               __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
846           }
847 #else
848   #define __Pyx_RefNannySetupContext(name, acquire_gil)\
849           __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
850 #endif
851   #define __Pyx_RefNannyFinishContext()\
852           __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
853   #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
854   #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
855   #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
856   #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
857   #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
858   #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
859   #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
860   #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
861 #else
862   #define __Pyx_RefNannyDeclarations
863   #define __Pyx_RefNannySetupContext(name, acquire_gil)
864   #define __Pyx_RefNannyFinishContext()
865   #define __Pyx_INCREF(r) Py_INCREF(r)
866   #define __Pyx_DECREF(r) Py_DECREF(r)
867   #define __Pyx_GOTREF(r)
868   #define __Pyx_GIVEREF(r)
869   #define __Pyx_XINCREF(r) Py_XINCREF(r)
870   #define __Pyx_XDECREF(r) Py_XDECREF(r)
871   #define __Pyx_XGOTREF(r)
872   #define __Pyx_XGIVEREF(r)
873 #endif
874 #define __Pyx_XDECREF_SET(r, v) do {\
875         PyObject *tmp = (PyObject *) r;\
876         r = v; __Pyx_XDECREF(tmp);\
877     } while (0)
878 #define __Pyx_DECREF_SET(r, v) do {\
879         PyObject *tmp = (PyObject *) r;\
880         r = v; __Pyx_DECREF(tmp);\
881     } while (0)
882 #define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
883 #define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
884 
885 /* PyObjectGetAttrStr.proto */
886 #if CYTHON_USE_TYPE_SLOTS
887 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
888 #else
889 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
890 #endif
891 
892 /* GetBuiltinName.proto */
893 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
894 
895 /* RaiseDoubleKeywords.proto */
896 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
897 
898 /* ParseKeywords.proto */
899 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
900     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
901     const char* function_name);
902 
903 /* RaiseArgTupleInvalid.proto */
904 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
905     Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
906 
907 /* PyCFunctionFastCall.proto */
908 #if CYTHON_FAST_PYCCALL
909 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
910 #else
911 #define __Pyx_PyCFunction_FastCall(func, args, nargs)  (assert(0), NULL)
912 #endif
913 
914 /* PyFunctionFastCall.proto */
915 #if CYTHON_FAST_PYCALL
916 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
917     __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
918 #if 1 || PY_VERSION_HEX < 0x030600B1
919 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
920 #else
921 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
922 #endif
923 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
924     (sizeof(char [1 - 2*!(cond)]) - 1)
925 #ifndef Py_MEMBER_SIZE
926 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
927 #endif
928   static size_t __pyx_pyframe_localsplus_offset = 0;
929   #include "frameobject.h"
930   #define __Pxy_PyFrame_Initialize_Offsets()\
931     ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
932      (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
933   #define __Pyx_PyFrame_GetLocalsplus(frame)\
934     (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
935 #endif
936 
937 /* PyObjectCall.proto */
938 #if CYTHON_COMPILING_IN_CPYTHON
939 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
940 #else
941 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
942 #endif
943 
944 /* PyObjectCall2Args.proto */
945 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
946 
947 /* PyObjectCallMethO.proto */
948 #if CYTHON_COMPILING_IN_CPYTHON
949 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
950 #endif
951 
952 /* PyObjectCallOneArg.proto */
953 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
954 
955 /* PyDictVersioning.proto */
956 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
957 #define __PYX_DICT_VERSION_INIT  ((PY_UINT64_T) -1)
958 #define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
959 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
960     (version_var) = __PYX_GET_DICT_VERSION(dict);\
961     (cache_var) = (value);
962 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
963     static PY_UINT64_T __pyx_dict_version = 0;\
964     static PyObject *__pyx_dict_cached_value = NULL;\
965     if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
966         (VAR) = __pyx_dict_cached_value;\
967     } else {\
968         (VAR) = __pyx_dict_cached_value = (LOOKUP);\
969         __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
970     }\
971 }
972 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
973 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
974 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
975 #else
976 #define __PYX_GET_DICT_VERSION(dict)  (0)
977 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
978 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP)  (VAR) = (LOOKUP);
979 #endif
980 
981 /* GetModuleGlobalName.proto */
982 #if CYTHON_USE_DICT_VERSIONS
983 #define __Pyx_GetModuleGlobalName(var, name)  {\
984     static PY_UINT64_T __pyx_dict_version = 0;\
985     static PyObject *__pyx_dict_cached_value = NULL;\
986     (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
987         (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
988         __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
989 }
990 #define __Pyx_GetModuleGlobalNameUncached(var, name)  {\
991     PY_UINT64_T __pyx_dict_version;\
992     PyObject *__pyx_dict_cached_value;\
993     (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
994 }
995 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
996 #else
997 #define __Pyx_GetModuleGlobalName(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
998 #define __Pyx_GetModuleGlobalNameUncached(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
999 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1000 #endif
1001 
1002 /* PyObjectCallNoArg.proto */
1003 #if CYTHON_COMPILING_IN_CPYTHON
1004 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1005 #else
1006 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1007 #endif
1008 
1009 /* PyIntBinop.proto */
1010 #if !CYTHON_COMPILING_IN_PYPY
1011 static PyObject* __Pyx_PyInt_AndObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
1012 #else
1013 #define __Pyx_PyInt_AndObjC(op1, op2, intval, inplace, zerodivision_check)\
1014     (inplace ? PyNumber_InPlaceAnd(op1, op2) : PyNumber_And(op1, op2))
1015 #endif
1016 
1017 /* GetItemInt.proto */
1018 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1019     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1020     __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1021     (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1022                __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1023 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1024     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1025     __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1026     (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1027 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1028                                                               int wraparound, int boundscheck);
1029 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1030     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1031     __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1032     (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1033 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1034                                                               int wraparound, int boundscheck);
1035 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1036 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1037                                                      int is_list, int wraparound, int boundscheck);
1038 
1039 /* PyIntCompare.proto */
1040 static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, long intval, long inplace);
1041 
1042 /* PyErrExceptionMatches.proto */
1043 #if CYTHON_FAST_THREAD_STATE
1044 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1045 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1046 #else
1047 #define __Pyx_PyErr_ExceptionMatches(err)  PyErr_ExceptionMatches(err)
1048 #endif
1049 
1050 /* PyThreadStateGet.proto */
1051 #if CYTHON_FAST_THREAD_STATE
1052 #define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
1053 #define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
1054 #define __Pyx_PyErr_Occurred()  __pyx_tstate->curexc_type
1055 #else
1056 #define __Pyx_PyThreadState_declare
1057 #define __Pyx_PyThreadState_assign
1058 #define __Pyx_PyErr_Occurred()  PyErr_Occurred()
1059 #endif
1060 
1061 /* PyErrFetchRestore.proto */
1062 #if CYTHON_FAST_THREAD_STATE
1063 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1064 #define __Pyx_ErrRestoreWithState(type, value, tb)  __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1065 #define __Pyx_ErrFetchWithState(type, value, tb)    __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1066 #define __Pyx_ErrRestore(type, value, tb)  __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1067 #define __Pyx_ErrFetch(type, value, tb)    __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1068 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1069 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1070 #if CYTHON_COMPILING_IN_CPYTHON
1071 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1072 #else
1073 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1074 #endif
1075 #else
1076 #define __Pyx_PyErr_Clear() PyErr_Clear()
1077 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1078 #define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
1079 #define __Pyx_ErrFetchWithState(type, value, tb)  PyErr_Fetch(type, value, tb)
1080 #define __Pyx_ErrRestoreInState(tstate, type, value, tb)  PyErr_Restore(type, value, tb)
1081 #define __Pyx_ErrFetchInState(tstate, type, value, tb)  PyErr_Fetch(type, value, tb)
1082 #define __Pyx_ErrRestore(type, value, tb)  PyErr_Restore(type, value, tb)
1083 #define __Pyx_ErrFetch(type, value, tb)  PyErr_Fetch(type, value, tb)
1084 #endif
1085 
1086 /* GetAttr.proto */
1087 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1088 
1089 /* GetAttr3.proto */
1090 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
1091 
1092 /* IncludeStringH.proto */
1093 #include <string.h>
1094 
1095 /* BytesEquals.proto */
1096 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
1097 
1098 /* UnicodeEquals.proto */
1099 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
1100 
1101 /* StrEquals.proto */
1102 #if PY_MAJOR_VERSION >= 3
1103 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
1104 #else
1105 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
1106 #endif
1107 
1108 /* RaiseException.proto */
1109 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1110 
1111 /* IterFinish.proto */
1112 static CYTHON_INLINE int __Pyx_IterFinish(void);
1113 
1114 /* PyObjectGetMethod.proto */
1115 static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
1116 
1117 /* PyObjectCallMethod0.proto */
1118 static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);
1119 
1120 /* RaiseNeedMoreValuesToUnpack.proto */
1121 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1122 
1123 /* RaiseTooManyValuesToUnpack.proto */
1124 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1125 
1126 /* UnpackItemEndCheck.proto */
1127 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
1128 
1129 /* RaiseNoneIterError.proto */
1130 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
1131 
1132 /* UnpackTupleError.proto */
1133 static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index);
1134 
1135 /* UnpackTuple2.proto */
1136 #define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\
1137     (likely(is_tuple || PyTuple_Check(tuple)) ?\
1138         (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\
1139             __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\
1140             (__Pyx_UnpackTupleError(tuple, 2), -1)) :\
1141         __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple))
1142 static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
1143     PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple);
1144 static int __Pyx_unpack_tuple2_generic(
1145     PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple);
1146 
1147 /* dict_iter.proto */
1148 static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name,
1149                                                    Py_ssize_t* p_orig_length, int* p_is_dict);
1150 static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos,
1151                                               PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict);
1152 
1153 /* MergeKeywords.proto */
1154 static int __Pyx_MergeKeywords(PyObject *kwdict, PyObject *source_mapping);
1155 
1156 /* UnicodeAsUCS4.proto */
1157 static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject*);
1158 
1159 /* object_ord.proto */
1160 #if PY_MAJOR_VERSION >= 3
1161 #define __Pyx_PyObject_Ord(c)\
1162     (likely(PyUnicode_Check(c)) ? (long)__Pyx_PyUnicode_AsPy_UCS4(c) : __Pyx__PyObject_Ord(c))
1163 #else
1164 #define __Pyx_PyObject_Ord(c) __Pyx__PyObject_Ord(c)
1165 #endif
1166 static long __Pyx__PyObject_Ord(PyObject* c);
1167 
1168 /* FetchCommonType.proto */
1169 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
1170 
1171 /* CythonFunctionShared.proto */
1172 #define __Pyx_CyFunction_USED 1
1173 #define __Pyx_CYFUNCTION_STATICMETHOD  0x01
1174 #define __Pyx_CYFUNCTION_CLASSMETHOD   0x02
1175 #define __Pyx_CYFUNCTION_CCLASS        0x04
1176 #define __Pyx_CyFunction_GetClosure(f)\
1177     (((__pyx_CyFunctionObject *) (f))->func_closure)
1178 #define __Pyx_CyFunction_GetClassObj(f)\
1179     (((__pyx_CyFunctionObject *) (f))->func_classobj)
1180 #define __Pyx_CyFunction_Defaults(type, f)\
1181     ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
1182 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
1183     ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
1184 typedef struct {
1185     PyCFunctionObject func;
1186 #if PY_VERSION_HEX < 0x030500A0
1187     PyObject *func_weakreflist;
1188 #endif
1189     PyObject *func_dict;
1190     PyObject *func_name;
1191     PyObject *func_qualname;
1192     PyObject *func_doc;
1193     PyObject *func_globals;
1194     PyObject *func_code;
1195     PyObject *func_closure;
1196     PyObject *func_classobj;
1197     void *defaults;
1198     int defaults_pyobjects;
1199     size_t defaults_size;  // used by FusedFunction for copying defaults
1200     int flags;
1201     PyObject *defaults_tuple;
1202     PyObject *defaults_kwdict;
1203     PyObject *(*defaults_getter)(PyObject *);
1204     PyObject *func_annotations;
1205 } __pyx_CyFunctionObject;
1206 static PyTypeObject *__pyx_CyFunctionType = 0;
1207 #define __Pyx_CyFunction_Check(obj)  (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
1208 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
1209                                       int flags, PyObject* qualname,
1210                                       PyObject *self,
1211                                       PyObject *module, PyObject *globals,
1212                                       PyObject* code);
1213 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
1214                                                          size_t size,
1215                                                          int pyobjects);
1216 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
1217                                                             PyObject *tuple);
1218 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
1219                                                              PyObject *dict);
1220 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
1221                                                               PyObject *dict);
1222 static int __pyx_CyFunction_init(void);
1223 
1224 /* CythonFunction.proto */
1225 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
1226                                       int flags, PyObject* qualname,
1227                                       PyObject *closure,
1228                                       PyObject *module, PyObject *globals,
1229                                       PyObject* code);
1230 
1231 /* GetTopmostException.proto */
1232 #if CYTHON_USE_EXC_INFO_STACK
1233 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1234 #endif
1235 
1236 /* SaveResetException.proto */
1237 #if CYTHON_FAST_THREAD_STATE
1238 #define __Pyx_ExceptionSave(type, value, tb)  __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1239 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1240 #define __Pyx_ExceptionReset(type, value, tb)  __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1241 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1242 #else
1243 #define __Pyx_ExceptionSave(type, value, tb)   PyErr_GetExcInfo(type, value, tb)
1244 #define __Pyx_ExceptionReset(type, value, tb)  PyErr_SetExcInfo(type, value, tb)
1245 #endif
1246 
1247 /* GetException.proto */
1248 #if CYTHON_FAST_THREAD_STATE
1249 #define __Pyx_GetException(type, value, tb)  __Pyx__GetException(__pyx_tstate, type, value, tb)
1250 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1251 #else
1252 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1253 #endif
1254 
1255 /* PySequenceContains.proto */
__Pyx_PySequence_ContainsTF(PyObject * item,PyObject * seq,int eq)1256 static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
1257     int result = PySequence_Contains(seq, item);
1258     return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
1259 }
1260 
1261 /* PyNumberPow2.proto */
1262 #define __Pyx_PyNumber_InPlacePowerOf2(a, b, c) __Pyx__PyNumber_PowerOf2(a, b, c, 1)
1263 #define __Pyx_PyNumber_PowerOf2(a, b, c) __Pyx__PyNumber_PowerOf2(a, b, c, 0)
1264 static PyObject* __Pyx__PyNumber_PowerOf2(PyObject *two, PyObject *exp, PyObject *none, int inplace);
1265 
1266 /* PyIntBinop.proto */
1267 #if !CYTHON_COMPILING_IN_PYPY
1268 static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
1269 #else
1270 #define __Pyx_PyInt_SubtractObjC(op1, op2, intval, inplace, zerodivision_check)\
1271     (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2))
1272 #endif
1273 
1274 /* PyExec.proto */
1275 static PyObject* __Pyx_PyExec3(PyObject*, PyObject*, PyObject*);
1276 static CYTHON_INLINE PyObject* __Pyx_PyExec2(PyObject*, PyObject*);
1277 
1278 /* Import.proto */
1279 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1280 
1281 /* ImportFrom.proto */
1282 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1283 
1284 /* CLineInTraceback.proto */
1285 #ifdef CYTHON_CLINE_IN_TRACEBACK
1286 #define __Pyx_CLineForTraceback(tstate, c_line)  (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1287 #else
1288 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1289 #endif
1290 
1291 /* CodeObjectCache.proto */
1292 typedef struct {
1293     PyCodeObject* code_object;
1294     int code_line;
1295 } __Pyx_CodeObjectCacheEntry;
1296 struct __Pyx_CodeObjectCache {
1297     int count;
1298     int max_count;
1299     __Pyx_CodeObjectCacheEntry* entries;
1300 };
1301 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1302 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
1303 static PyCodeObject *__pyx_find_code_object(int code_line);
1304 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
1305 
1306 /* AddTraceback.proto */
1307 static void __Pyx_AddTraceback(const char *funcname, int c_line,
1308                                int py_line, const char *filename);
1309 
1310 /* CIntToPy.proto */
1311 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
1312 
1313 /* CIntFromPy.proto */
1314 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
1315 
1316 /* CIntFromPy.proto */
1317 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
1318 
1319 /* FastTypeChecks.proto */
1320 #if CYTHON_COMPILING_IN_CPYTHON
1321 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1322 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1323 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1324 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1325 #else
1326 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1327 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1328 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1329 #endif
1330 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1331 
1332 /* CheckBinaryVersion.proto */
1333 static int __Pyx_check_binary_version(void);
1334 
1335 /* InitStrings.proto */
1336 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1337 
1338 
1339 /* Module declarations from 'fastavro._six' */
1340 #define __Pyx_MODULE_NAME "fastavro._six"
1341 extern int __pyx_module_is_main_fastavro___six;
1342 int __pyx_module_is_main_fastavro___six = 0;
1343 
1344 /* Implementation of 'fastavro._six' */
1345 static PyObject *__pyx_builtin_range;
1346 static PyObject *__pyx_builtin_ValueError;
1347 static PyObject *__pyx_builtin_chr;
1348 static PyObject *__pyx_builtin_map;
1349 static PyObject *__pyx_builtin_AttributeError;
1350 static PyObject *__pyx_builtin_OSError;
1351 static PyObject *__pyx_builtin_IOError;
1352 static const char __pyx_k_0[] = "0";
1353 static const char __pyx_k_a[] = "a";
1354 static const char __pyx_k_b[] = "!b";
1355 static const char __pyx_k_n[] = "n";
1356 static const char __pyx_k_x[] = "%x";
1357 static const char __pyx_k__3[] = "";
1358 static const char __pyx_k__6[] = "+";
1359 static const char __pyx_k_io[] = "io";
1360 static const char __pyx_k_Err[] = "Err";
1361 static const char __pyx_k_big[] = "big";
1362 static const char __pyx_k_chr[] = "chr";
1363 static const char __pyx_k_hex[] = "hex";
1364 static const char __pyx_k_map[] = "map";
1365 static const char __pyx_k_msg[] = "msg";
1366 static const char __pyx_k_num[] = "num";
1367 static const char __pyx_k_obj[] = "obj";
1368 static const char __pyx_k_sys[] = "sys";
1369 static const char __pyx_k_bits[] = "bits";
1370 static const char __pyx_k_btou[] = "btou";
1371 static const char __pyx_k_data[] = "data";
1372 static const char __pyx_k_dump[] = "dump";
1373 static const char __pyx_k_json[] = "json";
1374 static const char __pyx_k_keys[] = "keys";
1375 static const char __pyx_k_long[] = "long";
1376 static const char __pyx_k_main[] = "__main__";
1377 static const char __pyx_k_mode[] = "mode";
1378 static const char __pyx_k_name[] = "name";
1379 static const char __pyx_k_read[] = "read";
1380 static const char __pyx_k_tell[] = "tell";
1381 static const char __pyx_k_test[] = "__test__";
1382 static const char __pyx_k_utob[] = "utob";
1383 static const char __pyx_k_UTF_8[] = "UTF-8";
1384 static const char __pyx_k_datum[] = "datum";
1385 static const char __pyx_k_items[] = "items";
1386 static const char __pyx_k_range[] = "range";
1387 static const char __pyx_k_decode[] = "decode";
1388 static const char __pyx_k_encode[] = "encode";
1389 static const char __pyx_k_fstint[] = "fstint";
1390 static const char __pyx_k_import[] = "__import__";
1391 static const char __pyx_k_is_str[] = "is_str";
1392 static const char __pyx_k_kwargs[] = "kwargs";
1393 static const char __pyx_k_locals[] = "_locals";
1394 static const char __pyx_k_name_2[] = "__name__";
1395 static const char __pyx_k_outenc[] = "_outenc";
1396 static const char __pyx_k_output[] = "output";
1397 static const char __pyx_k_signed[] = "signed";
1398 static const char __pyx_k_stdout[] = "stdout";
1399 static const char __pyx_k_struct[] = "struct";
1400 static const char __pyx_k_unpack[] = "unpack";
1401 static const char __pyx_k_values[] = "values";
1402 static const char __pyx_k_xrange[] = "xrange";
1403 static const char __pyx_k_BytesIO[] = "BytesIO";
1404 static const char __pyx_k_IOError[] = "IOError";
1405 static const char __pyx_k_OSError[] = "OSError";
1406 static const char __pyx_k_bitsize[] = "bitsize";
1407 static const char __pyx_k_hex_str[] = "hex_str";
1408 static const char __pyx_k_mk_bits[] = "mk_bits";
1409 static const char __pyx_k_reraise[] = "reraise";
1410 static const char __pyx_k_MemoryIO[] = "MemoryIO";
1411 static const char __pyx_k_StringIO[] = "StringIO";
1412 static const char __pyx_k_builtins[] = "__builtins__";
1413 static const char __pyx_k_encoding[] = "encoding";
1414 static const char __pyx_k_exc_info[] = "exc_info";
1415 static const char __pyx_k_iterkeys[] = "iterkeys";
1416 static const char __pyx_k_py2_btou[] = "py2_btou";
1417 static const char __pyx_k_py2_utob[] = "py2_utob";
1418 static const char __pyx_k_py3_btou[] = "py3_btou";
1419 static const char __pyx_k_py3_utob[] = "py3_utob";
1420 static const char __pyx_k_readable[] = "readable";
1421 static const char __pyx_k_seekable[] = "seekable";
1422 static const char __pyx_k_stdout_2[] = "<stdout>";
1423 static const char __pyx_k_str2ints[] = "str2ints";
1424 static const char __pyx_k_to_bytes[] = "to_bytes";
1425 static const char __pyx_k_byteorder[] = "byteorder";
1426 static const char __pyx_k_bytes_req[] = "bytes_req";
1427 static const char __pyx_k_cStringIO[] = "cStringIO";
1428 static const char __pyx_k_file_like[] = "file_like";
1429 static const char __pyx_k_iteritems[] = "iteritems";
1430 static const char __pyx_k_json_dump[] = "json_dump";
1431 static const char __pyx_k_traceback[] = "traceback";
1432 static const char __pyx_k_ValueError[] = "ValueError";
1433 static const char __pyx_k_appendable[] = "appendable";
1434 static const char __pyx_k_encoding_2[] = "_encoding";
1435 static const char __pyx_k_from_bytes[] = "from_bytes";
1436 static const char __pyx_k_itervalues[] = "itervalues";
1437 static const char __pyx_k_py2_fstint[] = "py2_fstint";
1438 static const char __pyx_k_py2_is_str[] = "py2_is_str";
1439 static const char __pyx_k_py3_fstint[] = "py3_fstint";
1440 static const char __pyx_k_py3_is_str[] = "py3_is_str";
1441 static const char __pyx_k_readable_2[] = "_readable";
1442 static const char __pyx_k_py2_mk_bits[] = "py2_mk_bits";
1443 static const char __pyx_k_py2_reraise[] = "py2_reraise";
1444 static const char __pyx_k_py3_mk_bits[] = "py3_mk_bits";
1445 static const char __pyx_k_py3_reraise[] = "py3_reraise";
1446 static const char __pyx_k_py2_iterkeys[] = "py2_iterkeys";
1447 static const char __pyx_k_py2_str2ints[] = "py2_str2ints";
1448 static const char __pyx_k_py3_iterkeys[] = "py3_iterkeys";
1449 static const char __pyx_k_version_info[] = "version_info";
1450 static const char __pyx_k_fastavro__six[] = "fastavro._six";
1451 static const char __pyx_k_py2_iteritems[] = "py2_iteritems";
1452 static const char __pyx_k_py2_json_dump[] = "py2_json_dump";
1453 static const char __pyx_k_py3_iteritems[] = "py3_iteritems";
1454 static const char __pyx_k_py3_json_dump[] = "py3_json_dump";
1455 static const char __pyx_k_AttributeError[] = "AttributeError";
1456 static const char __pyx_k_py2_appendable[] = "py2_appendable";
1457 static const char __pyx_k_py2_itervalues[] = "py2_itervalues";
1458 static const char __pyx_k_py3_appendable[] = "py3_appendable";
1459 static const char __pyx_k_py3_bytes2ints[] = "py3_bytes2ints";
1460 static const char __pyx_k_py3_itervalues[] = "py3_itervalues";
1461 static const char __pyx_k_with_traceback[] = "with_traceback";
1462 static const char __pyx_k_a_mode_not_just_a[] = "'a+' mode, not just 'a'";
1463 static const char __pyx_k_fastavro__six_pyx[] = "fastavro/_six.pyx";
1464 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
1465 static const char __pyx_k_be_signed_bytes_to_int[] = "be_signed_bytes_to_int";
1466 static const char __pyx_k_int_to_be_signed_bytes[] = "int_to_be_signed_bytes";
1467 static const char __pyx_k_raise_Err_msg_traceback[] = "raise Err, msg, traceback";
1468 static const char __pyx_k_py2_be_signed_bytes_to_int[] = "py2_be_signed_bytes_to_int";
1469 static const char __pyx_k_py2_int_to_be_signed_bytes[] = "py2_int_to_be_signed_bytes";
1470 static const char __pyx_k_py2_str2ints_locals_lambda[] = "py2_str2ints.<locals>.<lambda>";
1471 static const char __pyx_k_py3_be_signed_bytes_to_int[] = "py3_be_signed_bytes_to_int";
1472 static const char __pyx_k_py3_int_to_be_signed_bytes[] = "py3_int_to_be_signed_bytes";
1473 static const char __pyx_k_Compatiblity_for_Python_versions[] = "Compatiblity for Python versions.\n\nSome of this code is \"lifted\" from CherryPy.\n";
1474 static const char __pyx_k_When_appending_to_an_avro_file_y[] = "When appending to an avro file you must use the ";
1475 static PyObject *__pyx_kp_s_0;
1476 static PyObject *__pyx_n_s_AttributeError;
1477 static PyObject *__pyx_n_s_BytesIO;
1478 static PyObject *__pyx_n_s_Err;
1479 static PyObject *__pyx_n_s_IOError;
1480 static PyObject *__pyx_n_s_MemoryIO;
1481 static PyObject *__pyx_n_s_OSError;
1482 static PyObject *__pyx_n_s_StringIO;
1483 static PyObject *__pyx_kp_s_UTF_8;
1484 static PyObject *__pyx_n_s_ValueError;
1485 static PyObject *__pyx_kp_s_When_appending_to_an_avro_file_y;
1486 static PyObject *__pyx_kp_s__3;
1487 static PyObject *__pyx_kp_s__6;
1488 static PyObject *__pyx_n_s_a;
1489 static PyObject *__pyx_kp_s_a_mode_not_just_a;
1490 static PyObject *__pyx_n_s_appendable;
1491 static PyObject *__pyx_kp_s_b;
1492 static PyObject *__pyx_n_s_be_signed_bytes_to_int;
1493 static PyObject *__pyx_n_s_big;
1494 static PyObject *__pyx_n_s_bits;
1495 static PyObject *__pyx_n_s_bitsize;
1496 static PyObject *__pyx_n_s_btou;
1497 static PyObject *__pyx_n_s_builtins;
1498 static PyObject *__pyx_n_s_byteorder;
1499 static PyObject *__pyx_n_s_bytes_req;
1500 static PyObject *__pyx_n_s_cStringIO;
1501 static PyObject *__pyx_n_s_chr;
1502 static PyObject *__pyx_n_s_cline_in_traceback;
1503 static PyObject *__pyx_n_s_data;
1504 static PyObject *__pyx_n_s_datum;
1505 static PyObject *__pyx_n_s_decode;
1506 static PyObject *__pyx_n_s_dump;
1507 static PyObject *__pyx_n_s_encode;
1508 static PyObject *__pyx_n_s_encoding;
1509 static PyObject *__pyx_n_s_encoding_2;
1510 static PyObject *__pyx_n_s_exc_info;
1511 static PyObject *__pyx_n_s_fastavro__six;
1512 static PyObject *__pyx_kp_s_fastavro__six_pyx;
1513 static PyObject *__pyx_n_s_file_like;
1514 static PyObject *__pyx_n_s_from_bytes;
1515 static PyObject *__pyx_n_s_fstint;
1516 static PyObject *__pyx_n_s_hex;
1517 static PyObject *__pyx_n_s_hex_str;
1518 static PyObject *__pyx_n_s_import;
1519 static PyObject *__pyx_n_s_int_to_be_signed_bytes;
1520 static PyObject *__pyx_n_s_io;
1521 static PyObject *__pyx_n_s_is_str;
1522 static PyObject *__pyx_n_s_items;
1523 static PyObject *__pyx_n_s_iteritems;
1524 static PyObject *__pyx_n_s_iterkeys;
1525 static PyObject *__pyx_n_s_itervalues;
1526 static PyObject *__pyx_n_s_json;
1527 static PyObject *__pyx_n_s_json_dump;
1528 static PyObject *__pyx_n_s_keys;
1529 static PyObject *__pyx_n_s_kwargs;
1530 static PyObject *__pyx_n_s_locals;
1531 static PyObject *__pyx_n_s_long;
1532 static PyObject *__pyx_n_s_main;
1533 static PyObject *__pyx_n_s_map;
1534 static PyObject *__pyx_n_s_mk_bits;
1535 static PyObject *__pyx_n_s_mode;
1536 static PyObject *__pyx_n_s_msg;
1537 static PyObject *__pyx_n_s_n;
1538 static PyObject *__pyx_n_s_name;
1539 static PyObject *__pyx_n_s_name_2;
1540 static PyObject *__pyx_n_s_num;
1541 static PyObject *__pyx_n_s_obj;
1542 static PyObject *__pyx_n_s_outenc;
1543 static PyObject *__pyx_n_s_output;
1544 static PyObject *__pyx_n_s_py2_appendable;
1545 static PyObject *__pyx_n_s_py2_be_signed_bytes_to_int;
1546 static PyObject *__pyx_n_s_py2_btou;
1547 static PyObject *__pyx_n_s_py2_fstint;
1548 static PyObject *__pyx_n_s_py2_int_to_be_signed_bytes;
1549 static PyObject *__pyx_n_s_py2_is_str;
1550 static PyObject *__pyx_n_s_py2_iteritems;
1551 static PyObject *__pyx_n_s_py2_iterkeys;
1552 static PyObject *__pyx_n_s_py2_itervalues;
1553 static PyObject *__pyx_n_s_py2_json_dump;
1554 static PyObject *__pyx_n_s_py2_mk_bits;
1555 static PyObject *__pyx_n_s_py2_reraise;
1556 static PyObject *__pyx_n_s_py2_str2ints;
1557 static PyObject *__pyx_n_s_py2_str2ints_locals_lambda;
1558 static PyObject *__pyx_n_s_py2_utob;
1559 static PyObject *__pyx_n_s_py3_appendable;
1560 static PyObject *__pyx_n_s_py3_be_signed_bytes_to_int;
1561 static PyObject *__pyx_n_s_py3_btou;
1562 static PyObject *__pyx_n_s_py3_bytes2ints;
1563 static PyObject *__pyx_n_s_py3_fstint;
1564 static PyObject *__pyx_n_s_py3_int_to_be_signed_bytes;
1565 static PyObject *__pyx_n_s_py3_is_str;
1566 static PyObject *__pyx_n_s_py3_iteritems;
1567 static PyObject *__pyx_n_s_py3_iterkeys;
1568 static PyObject *__pyx_n_s_py3_itervalues;
1569 static PyObject *__pyx_n_s_py3_json_dump;
1570 static PyObject *__pyx_n_s_py3_mk_bits;
1571 static PyObject *__pyx_n_s_py3_reraise;
1572 static PyObject *__pyx_n_s_py3_utob;
1573 static PyObject *__pyx_kp_s_raise_Err_msg_traceback;
1574 static PyObject *__pyx_n_s_range;
1575 static PyObject *__pyx_n_s_read;
1576 static PyObject *__pyx_n_s_readable;
1577 static PyObject *__pyx_n_s_readable_2;
1578 static PyObject *__pyx_n_s_reraise;
1579 static PyObject *__pyx_n_s_seekable;
1580 static PyObject *__pyx_n_s_signed;
1581 static PyObject *__pyx_n_s_stdout;
1582 static PyObject *__pyx_kp_s_stdout_2;
1583 static PyObject *__pyx_n_s_str2ints;
1584 static PyObject *__pyx_n_s_struct;
1585 static PyObject *__pyx_n_s_sys;
1586 static PyObject *__pyx_n_s_tell;
1587 static PyObject *__pyx_n_s_test;
1588 static PyObject *__pyx_n_s_to_bytes;
1589 static PyObject *__pyx_n_s_traceback;
1590 static PyObject *__pyx_n_s_unpack;
1591 static PyObject *__pyx_n_s_utob;
1592 static PyObject *__pyx_n_s_values;
1593 static PyObject *__pyx_n_s_version_info;
1594 static PyObject *__pyx_n_s_with_traceback;
1595 static PyObject *__pyx_kp_s_x;
1596 static PyObject *__pyx_n_s_xrange;
1597 static PyObject *__pyx_pf_8fastavro_4_six_py3_btou(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_n, PyObject *__pyx_v_encoding); /* proto */
1598 static PyObject *__pyx_pf_8fastavro_4_six_2py3_utob(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_n, PyObject *__pyx_v_encoding); /* proto */
1599 static PyObject *__pyx_pf_8fastavro_4_six_4py3_json_dump(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_kwargs); /* proto */
1600 static PyObject *__pyx_pf_8fastavro_4_six_6py3_iterkeys(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */
1601 static PyObject *__pyx_pf_8fastavro_4_six_8py3_itervalues(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */
1602 static PyObject *__pyx_pf_8fastavro_4_six_10py3_iteritems(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */
1603 static PyObject *__pyx_pf_8fastavro_4_six_12py3_is_str(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */
1604 static PyObject *__pyx_pf_8fastavro_4_six_14py3_mk_bits(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_bits); /* proto */
1605 static PyObject *__pyx_pf_8fastavro_4_six_16py3_bytes2ints(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_datum); /* proto */
1606 static PyObject *__pyx_pf_8fastavro_4_six_18py3_fstint(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_datum); /* proto */
1607 static PyObject *__pyx_pf_8fastavro_4_six_20py3_appendable(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_like); /* proto */
1608 static PyObject *__pyx_pf_8fastavro_4_six_22py3_int_to_be_signed_bytes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_num, PyObject *__pyx_v_bytes_req); /* proto */
1609 static PyObject *__pyx_pf_8fastavro_4_six_24py3_be_signed_bytes_to_int(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data); /* proto */
1610 static PyObject *__pyx_pf_8fastavro_4_six_26py3_reraise(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_Err, PyObject *__pyx_v_msg); /* proto */
1611 static PyObject *__pyx_pf_8fastavro_4_six_28py2_btou(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_n, PyObject *__pyx_v_encoding); /* proto */
1612 static PyObject *__pyx_pf_8fastavro_4_six_30py2_utob(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_n, PyObject *__pyx_v_encoding); /* proto */
1613 static PyObject *__pyx_pf_8fastavro_4_six_32py2_json_dump(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_kwargs); /* proto */
1614 static PyObject *__pyx_pf_8fastavro_4_six_34py2_iterkeys(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */
1615 static PyObject *__pyx_pf_8fastavro_4_six_36py2_itervalues(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */
1616 static PyObject *__pyx_pf_8fastavro_4_six_38py2_iteritems(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */
1617 static PyObject *__pyx_pf_8fastavro_4_six_40py2_is_str(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */
1618 static PyObject *__pyx_pf_8fastavro_4_six_42py2_mk_bits(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_bits); /* proto */
1619 static PyObject *__pyx_lambda_funcdef_lambda(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
1620 static PyObject *__pyx_pf_8fastavro_4_six_44py2_str2ints(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_datum); /* proto */
1621 static PyObject *__pyx_pf_8fastavro_4_six_46py2_fstint(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_datum); /* proto */
1622 static PyObject *__pyx_pf_8fastavro_4_six_48_readable(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_like); /* proto */
1623 static PyObject *__pyx_pf_8fastavro_4_six_50py2_appendable(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_like); /* proto */
1624 static PyObject *__pyx_pf_8fastavro_4_six_52py2_int_to_be_signed_bytes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_num, PyObject *__pyx_v_bytes_req); /* proto */
1625 static PyObject *__pyx_pf_8fastavro_4_six_54py2_be_signed_bytes_to_int(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data); /* proto */
1626 static PyObject *__pyx_pf_8fastavro_4_six_56py2_reraise(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_Err, PyObject *__pyx_v_msg); /* proto */
1627 static PyObject *__pyx_int_0;
1628 static PyObject *__pyx_int_1;
1629 static PyObject *__pyx_int_2;
1630 static PyObject *__pyx_int_3;
1631 static PyObject *__pyx_int_8;
1632 static PyObject *__pyx_int_16;
1633 static PyObject *__pyx_int_255;
1634 static PyObject *__pyx_k_;
1635 static PyObject *__pyx_k__2;
1636 static PyObject *__pyx_k__4;
1637 static PyObject *__pyx_k__5;
1638 static PyObject *__pyx_tuple__7;
1639 static PyObject *__pyx_tuple__8;
1640 static PyObject *__pyx_tuple__10;
1641 static PyObject *__pyx_tuple__12;
1642 static PyObject *__pyx_tuple__14;
1643 static PyObject *__pyx_tuple__16;
1644 static PyObject *__pyx_tuple__18;
1645 static PyObject *__pyx_tuple__20;
1646 static PyObject *__pyx_tuple__22;
1647 static PyObject *__pyx_tuple__24;
1648 static PyObject *__pyx_tuple__26;
1649 static PyObject *__pyx_tuple__28;
1650 static PyObject *__pyx_tuple__30;
1651 static PyObject *__pyx_tuple__32;
1652 static PyObject *__pyx_tuple__34;
1653 static PyObject *__pyx_tuple__36;
1654 static PyObject *__pyx_tuple__38;
1655 static PyObject *__pyx_tuple__40;
1656 static PyObject *__pyx_tuple__42;
1657 static PyObject *__pyx_tuple__44;
1658 static PyObject *__pyx_tuple__46;
1659 static PyObject *__pyx_tuple__48;
1660 static PyObject *__pyx_tuple__50;
1661 static PyObject *__pyx_tuple__52;
1662 static PyObject *__pyx_tuple__54;
1663 static PyObject *__pyx_tuple__56;
1664 static PyObject *__pyx_tuple__58;
1665 static PyObject *__pyx_tuple__60;
1666 static PyObject *__pyx_tuple__62;
1667 static PyObject *__pyx_tuple__64;
1668 static PyObject *__pyx_codeobj__9;
1669 static PyObject *__pyx_codeobj__11;
1670 static PyObject *__pyx_codeobj__13;
1671 static PyObject *__pyx_codeobj__15;
1672 static PyObject *__pyx_codeobj__17;
1673 static PyObject *__pyx_codeobj__19;
1674 static PyObject *__pyx_codeobj__21;
1675 static PyObject *__pyx_codeobj__23;
1676 static PyObject *__pyx_codeobj__25;
1677 static PyObject *__pyx_codeobj__27;
1678 static PyObject *__pyx_codeobj__29;
1679 static PyObject *__pyx_codeobj__31;
1680 static PyObject *__pyx_codeobj__33;
1681 static PyObject *__pyx_codeobj__35;
1682 static PyObject *__pyx_codeobj__37;
1683 static PyObject *__pyx_codeobj__39;
1684 static PyObject *__pyx_codeobj__41;
1685 static PyObject *__pyx_codeobj__43;
1686 static PyObject *__pyx_codeobj__45;
1687 static PyObject *__pyx_codeobj__47;
1688 static PyObject *__pyx_codeobj__49;
1689 static PyObject *__pyx_codeobj__51;
1690 static PyObject *__pyx_codeobj__53;
1691 static PyObject *__pyx_codeobj__55;
1692 static PyObject *__pyx_codeobj__57;
1693 static PyObject *__pyx_codeobj__59;
1694 static PyObject *__pyx_codeobj__61;
1695 static PyObject *__pyx_codeobj__63;
1696 static PyObject *__pyx_codeobj__65;
1697 /* Late includes */
1698 
1699 /* "fastavro/_six.pyx":21
1700  *     xrange = range
1701  *
1702  *     def py3_btou(n, encoding=_encoding):             # <<<<<<<<<<<<<<
1703  *         return n.decode(encoding)
1704  *
1705  */
1706 
1707 /* Python wrapper */
1708 static PyObject *__pyx_pw_8fastavro_4_six_1py3_btou(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
1709 static PyMethodDef __pyx_mdef_8fastavro_4_six_1py3_btou = {"py3_btou", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8fastavro_4_six_1py3_btou, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_8fastavro_4_six_1py3_btou(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)1710 static PyObject *__pyx_pw_8fastavro_4_six_1py3_btou(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1711   PyObject *__pyx_v_n = 0;
1712   PyObject *__pyx_v_encoding = 0;
1713   int __pyx_lineno = 0;
1714   const char *__pyx_filename = NULL;
1715   int __pyx_clineno = 0;
1716   PyObject *__pyx_r = 0;
1717   __Pyx_RefNannyDeclarations
1718   __Pyx_RefNannySetupContext("py3_btou (wrapper)", 0);
1719   {
1720     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_encoding,0};
1721     PyObject* values[2] = {0,0};
1722     values[1] = __pyx_k_;
1723     if (unlikely(__pyx_kwds)) {
1724       Py_ssize_t kw_args;
1725       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
1726       switch (pos_args) {
1727         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1728         CYTHON_FALLTHROUGH;
1729         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1730         CYTHON_FALLTHROUGH;
1731         case  0: break;
1732         default: goto __pyx_L5_argtuple_error;
1733       }
1734       kw_args = PyDict_Size(__pyx_kwds);
1735       switch (pos_args) {
1736         case  0:
1737         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
1738         else goto __pyx_L5_argtuple_error;
1739         CYTHON_FALLTHROUGH;
1740         case  1:
1741         if (kw_args > 0) {
1742           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_encoding);
1743           if (value) { values[1] = value; kw_args--; }
1744         }
1745       }
1746       if (unlikely(kw_args > 0)) {
1747         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "py3_btou") < 0)) __PYX_ERR(0, 21, __pyx_L3_error)
1748       }
1749     } else {
1750       switch (PyTuple_GET_SIZE(__pyx_args)) {
1751         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1752         CYTHON_FALLTHROUGH;
1753         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1754         break;
1755         default: goto __pyx_L5_argtuple_error;
1756       }
1757     }
1758     __pyx_v_n = values[0];
1759     __pyx_v_encoding = values[1];
1760   }
1761   goto __pyx_L4_argument_unpacking_done;
1762   __pyx_L5_argtuple_error:;
1763   __Pyx_RaiseArgtupleInvalid("py3_btou", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 21, __pyx_L3_error)
1764   __pyx_L3_error:;
1765   __Pyx_AddTraceback("fastavro._six.py3_btou", __pyx_clineno, __pyx_lineno, __pyx_filename);
1766   __Pyx_RefNannyFinishContext();
1767   return NULL;
1768   __pyx_L4_argument_unpacking_done:;
1769   __pyx_r = __pyx_pf_8fastavro_4_six_py3_btou(__pyx_self, __pyx_v_n, __pyx_v_encoding);
1770 
1771   /* function exit code */
1772   __Pyx_RefNannyFinishContext();
1773   return __pyx_r;
1774 }
1775 
__pyx_pf_8fastavro_4_six_py3_btou(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_n,PyObject * __pyx_v_encoding)1776 static PyObject *__pyx_pf_8fastavro_4_six_py3_btou(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_n, PyObject *__pyx_v_encoding) {
1777   PyObject *__pyx_r = NULL;
1778   __Pyx_RefNannyDeclarations
1779   PyObject *__pyx_t_1 = NULL;
1780   PyObject *__pyx_t_2 = NULL;
1781   PyObject *__pyx_t_3 = NULL;
1782   int __pyx_lineno = 0;
1783   const char *__pyx_filename = NULL;
1784   int __pyx_clineno = 0;
1785   __Pyx_RefNannySetupContext("py3_btou", 0);
1786 
1787   /* "fastavro/_six.pyx":22
1788  *
1789  *     def py3_btou(n, encoding=_encoding):
1790  *         return n.decode(encoding)             # <<<<<<<<<<<<<<
1791  *
1792  *     def py3_utob(n, encoding=_encoding):
1793  */
1794   __Pyx_XDECREF(__pyx_r);
1795   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_n, __pyx_n_s_decode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error)
1796   __Pyx_GOTREF(__pyx_t_2);
1797   __pyx_t_3 = NULL;
1798   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
1799     __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
1800     if (likely(__pyx_t_3)) {
1801       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
1802       __Pyx_INCREF(__pyx_t_3);
1803       __Pyx_INCREF(function);
1804       __Pyx_DECREF_SET(__pyx_t_2, function);
1805     }
1806   }
1807   __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_encoding) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_encoding);
1808   __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
1809   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error)
1810   __Pyx_GOTREF(__pyx_t_1);
1811   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1812   __pyx_r = __pyx_t_1;
1813   __pyx_t_1 = 0;
1814   goto __pyx_L0;
1815 
1816   /* "fastavro/_six.pyx":21
1817  *     xrange = range
1818  *
1819  *     def py3_btou(n, encoding=_encoding):             # <<<<<<<<<<<<<<
1820  *         return n.decode(encoding)
1821  *
1822  */
1823 
1824   /* function exit code */
1825   __pyx_L1_error:;
1826   __Pyx_XDECREF(__pyx_t_1);
1827   __Pyx_XDECREF(__pyx_t_2);
1828   __Pyx_XDECREF(__pyx_t_3);
1829   __Pyx_AddTraceback("fastavro._six.py3_btou", __pyx_clineno, __pyx_lineno, __pyx_filename);
1830   __pyx_r = NULL;
1831   __pyx_L0:;
1832   __Pyx_XGIVEREF(__pyx_r);
1833   __Pyx_RefNannyFinishContext();
1834   return __pyx_r;
1835 }
1836 
1837 /* "fastavro/_six.pyx":24
1838  *         return n.decode(encoding)
1839  *
1840  *     def py3_utob(n, encoding=_encoding):             # <<<<<<<<<<<<<<
1841  *         return bytes(n, encoding)
1842  *
1843  */
1844 
1845 /* Python wrapper */
1846 static PyObject *__pyx_pw_8fastavro_4_six_3py3_utob(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
1847 static PyMethodDef __pyx_mdef_8fastavro_4_six_3py3_utob = {"py3_utob", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8fastavro_4_six_3py3_utob, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_8fastavro_4_six_3py3_utob(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)1848 static PyObject *__pyx_pw_8fastavro_4_six_3py3_utob(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1849   PyObject *__pyx_v_n = 0;
1850   PyObject *__pyx_v_encoding = 0;
1851   int __pyx_lineno = 0;
1852   const char *__pyx_filename = NULL;
1853   int __pyx_clineno = 0;
1854   PyObject *__pyx_r = 0;
1855   __Pyx_RefNannyDeclarations
1856   __Pyx_RefNannySetupContext("py3_utob (wrapper)", 0);
1857   {
1858     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_encoding,0};
1859     PyObject* values[2] = {0,0};
1860     values[1] = __pyx_k__2;
1861     if (unlikely(__pyx_kwds)) {
1862       Py_ssize_t kw_args;
1863       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
1864       switch (pos_args) {
1865         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1866         CYTHON_FALLTHROUGH;
1867         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1868         CYTHON_FALLTHROUGH;
1869         case  0: break;
1870         default: goto __pyx_L5_argtuple_error;
1871       }
1872       kw_args = PyDict_Size(__pyx_kwds);
1873       switch (pos_args) {
1874         case  0:
1875         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
1876         else goto __pyx_L5_argtuple_error;
1877         CYTHON_FALLTHROUGH;
1878         case  1:
1879         if (kw_args > 0) {
1880           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_encoding);
1881           if (value) { values[1] = value; kw_args--; }
1882         }
1883       }
1884       if (unlikely(kw_args > 0)) {
1885         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "py3_utob") < 0)) __PYX_ERR(0, 24, __pyx_L3_error)
1886       }
1887     } else {
1888       switch (PyTuple_GET_SIZE(__pyx_args)) {
1889         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1890         CYTHON_FALLTHROUGH;
1891         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1892         break;
1893         default: goto __pyx_L5_argtuple_error;
1894       }
1895     }
1896     __pyx_v_n = values[0];
1897     __pyx_v_encoding = values[1];
1898   }
1899   goto __pyx_L4_argument_unpacking_done;
1900   __pyx_L5_argtuple_error:;
1901   __Pyx_RaiseArgtupleInvalid("py3_utob", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 24, __pyx_L3_error)
1902   __pyx_L3_error:;
1903   __Pyx_AddTraceback("fastavro._six.py3_utob", __pyx_clineno, __pyx_lineno, __pyx_filename);
1904   __Pyx_RefNannyFinishContext();
1905   return NULL;
1906   __pyx_L4_argument_unpacking_done:;
1907   __pyx_r = __pyx_pf_8fastavro_4_six_2py3_utob(__pyx_self, __pyx_v_n, __pyx_v_encoding);
1908 
1909   /* function exit code */
1910   __Pyx_RefNannyFinishContext();
1911   return __pyx_r;
1912 }
1913 
__pyx_pf_8fastavro_4_six_2py3_utob(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_n,PyObject * __pyx_v_encoding)1914 static PyObject *__pyx_pf_8fastavro_4_six_2py3_utob(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_n, PyObject *__pyx_v_encoding) {
1915   PyObject *__pyx_r = NULL;
1916   __Pyx_RefNannyDeclarations
1917   PyObject *__pyx_t_1 = NULL;
1918   PyObject *__pyx_t_2 = NULL;
1919   int __pyx_lineno = 0;
1920   const char *__pyx_filename = NULL;
1921   int __pyx_clineno = 0;
1922   __Pyx_RefNannySetupContext("py3_utob", 0);
1923 
1924   /* "fastavro/_six.pyx":25
1925  *
1926  *     def py3_utob(n, encoding=_encoding):
1927  *         return bytes(n, encoding)             # <<<<<<<<<<<<<<
1928  *
1929  *     def py3_json_dump(obj, **kwargs):
1930  */
1931   __Pyx_XDECREF(__pyx_r);
1932   __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
1933   __Pyx_GOTREF(__pyx_t_1);
1934   __Pyx_INCREF(__pyx_v_n);
1935   __Pyx_GIVEREF(__pyx_v_n);
1936   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_n);
1937   __Pyx_INCREF(__pyx_v_encoding);
1938   __Pyx_GIVEREF(__pyx_v_encoding);
1939   PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_encoding);
1940   __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyBytes_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error)
1941   __Pyx_GOTREF(__pyx_t_2);
1942   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1943   __pyx_r = __pyx_t_2;
1944   __pyx_t_2 = 0;
1945   goto __pyx_L0;
1946 
1947   /* "fastavro/_six.pyx":24
1948  *         return n.decode(encoding)
1949  *
1950  *     def py3_utob(n, encoding=_encoding):             # <<<<<<<<<<<<<<
1951  *         return bytes(n, encoding)
1952  *
1953  */
1954 
1955   /* function exit code */
1956   __pyx_L1_error:;
1957   __Pyx_XDECREF(__pyx_t_1);
1958   __Pyx_XDECREF(__pyx_t_2);
1959   __Pyx_AddTraceback("fastavro._six.py3_utob", __pyx_clineno, __pyx_lineno, __pyx_filename);
1960   __pyx_r = NULL;
1961   __pyx_L0:;
1962   __Pyx_XGIVEREF(__pyx_r);
1963   __Pyx_RefNannyFinishContext();
1964   return __pyx_r;
1965 }
1966 
1967 /* "fastavro/_six.pyx":27
1968  *         return bytes(n, encoding)
1969  *
1970  *     def py3_json_dump(obj, **kwargs):             # <<<<<<<<<<<<<<
1971  *         json.dump(obj, sys.stdout, **kwargs)
1972  *
1973  */
1974 
1975 /* Python wrapper */
1976 static PyObject *__pyx_pw_8fastavro_4_six_5py3_json_dump(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
1977 static PyMethodDef __pyx_mdef_8fastavro_4_six_5py3_json_dump = {"py3_json_dump", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8fastavro_4_six_5py3_json_dump, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_8fastavro_4_six_5py3_json_dump(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)1978 static PyObject *__pyx_pw_8fastavro_4_six_5py3_json_dump(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1979   PyObject *__pyx_v_obj = 0;
1980   PyObject *__pyx_v_kwargs = 0;
1981   int __pyx_lineno = 0;
1982   const char *__pyx_filename = NULL;
1983   int __pyx_clineno = 0;
1984   PyObject *__pyx_r = 0;
1985   __Pyx_RefNannyDeclarations
1986   __Pyx_RefNannySetupContext("py3_json_dump (wrapper)", 0);
1987   __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
1988   __Pyx_GOTREF(__pyx_v_kwargs);
1989   {
1990     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,0};
1991     PyObject* values[1] = {0};
1992     if (unlikely(__pyx_kwds)) {
1993       Py_ssize_t kw_args;
1994       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
1995       switch (pos_args) {
1996         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1997         CYTHON_FALLTHROUGH;
1998         case  0: break;
1999         default: goto __pyx_L5_argtuple_error;
2000       }
2001       kw_args = PyDict_Size(__pyx_kwds);
2002       switch (pos_args) {
2003         case  0:
2004         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
2005         else goto __pyx_L5_argtuple_error;
2006       }
2007       if (unlikely(kw_args > 0)) {
2008         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "py3_json_dump") < 0)) __PYX_ERR(0, 27, __pyx_L3_error)
2009       }
2010     } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
2011       goto __pyx_L5_argtuple_error;
2012     } else {
2013       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2014     }
2015     __pyx_v_obj = values[0];
2016   }
2017   goto __pyx_L4_argument_unpacking_done;
2018   __pyx_L5_argtuple_error:;
2019   __Pyx_RaiseArgtupleInvalid("py3_json_dump", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 27, __pyx_L3_error)
2020   __pyx_L3_error:;
2021   __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
2022   __Pyx_AddTraceback("fastavro._six.py3_json_dump", __pyx_clineno, __pyx_lineno, __pyx_filename);
2023   __Pyx_RefNannyFinishContext();
2024   return NULL;
2025   __pyx_L4_argument_unpacking_done:;
2026   __pyx_r = __pyx_pf_8fastavro_4_six_4py3_json_dump(__pyx_self, __pyx_v_obj, __pyx_v_kwargs);
2027 
2028   /* function exit code */
2029   __Pyx_XDECREF(__pyx_v_kwargs);
2030   __Pyx_RefNannyFinishContext();
2031   return __pyx_r;
2032 }
2033 
__pyx_pf_8fastavro_4_six_4py3_json_dump(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_obj,PyObject * __pyx_v_kwargs)2034 static PyObject *__pyx_pf_8fastavro_4_six_4py3_json_dump(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_kwargs) {
2035   PyObject *__pyx_r = NULL;
2036   __Pyx_RefNannyDeclarations
2037   PyObject *__pyx_t_1 = NULL;
2038   PyObject *__pyx_t_2 = NULL;
2039   PyObject *__pyx_t_3 = NULL;
2040   int __pyx_lineno = 0;
2041   const char *__pyx_filename = NULL;
2042   int __pyx_clineno = 0;
2043   __Pyx_RefNannySetupContext("py3_json_dump", 0);
2044 
2045   /* "fastavro/_six.pyx":28
2046  *
2047  *     def py3_json_dump(obj, **kwargs):
2048  *         json.dump(obj, sys.stdout, **kwargs)             # <<<<<<<<<<<<<<
2049  *
2050  *     def py3_iterkeys(obj):
2051  */
2052   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_json); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
2053   __Pyx_GOTREF(__pyx_t_1);
2054   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dump); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
2055   __Pyx_GOTREF(__pyx_t_2);
2056   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2057   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
2058   __Pyx_GOTREF(__pyx_t_1);
2059   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stdout); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error)
2060   __Pyx_GOTREF(__pyx_t_3);
2061   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2062   __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
2063   __Pyx_GOTREF(__pyx_t_1);
2064   __Pyx_INCREF(__pyx_v_obj);
2065   __Pyx_GIVEREF(__pyx_v_obj);
2066   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_obj);
2067   __Pyx_GIVEREF(__pyx_t_3);
2068   PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
2069   __pyx_t_3 = 0;
2070   __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error)
2071   __Pyx_GOTREF(__pyx_t_3);
2072   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2073   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2074   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2075 
2076   /* "fastavro/_six.pyx":27
2077  *         return bytes(n, encoding)
2078  *
2079  *     def py3_json_dump(obj, **kwargs):             # <<<<<<<<<<<<<<
2080  *         json.dump(obj, sys.stdout, **kwargs)
2081  *
2082  */
2083 
2084   /* function exit code */
2085   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2086   goto __pyx_L0;
2087   __pyx_L1_error:;
2088   __Pyx_XDECREF(__pyx_t_1);
2089   __Pyx_XDECREF(__pyx_t_2);
2090   __Pyx_XDECREF(__pyx_t_3);
2091   __Pyx_AddTraceback("fastavro._six.py3_json_dump", __pyx_clineno, __pyx_lineno, __pyx_filename);
2092   __pyx_r = NULL;
2093   __pyx_L0:;
2094   __Pyx_XGIVEREF(__pyx_r);
2095   __Pyx_RefNannyFinishContext();
2096   return __pyx_r;
2097 }
2098 
2099 /* "fastavro/_six.pyx":30
2100  *         json.dump(obj, sys.stdout, **kwargs)
2101  *
2102  *     def py3_iterkeys(obj):             # <<<<<<<<<<<<<<
2103  *         return obj.keys()
2104  *
2105  */
2106 
2107 /* Python wrapper */
2108 static PyObject *__pyx_pw_8fastavro_4_six_7py3_iterkeys(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/
2109 static PyMethodDef __pyx_mdef_8fastavro_4_six_7py3_iterkeys = {"py3_iterkeys", (PyCFunction)__pyx_pw_8fastavro_4_six_7py3_iterkeys, METH_O, 0};
__pyx_pw_8fastavro_4_six_7py3_iterkeys(PyObject * __pyx_self,PyObject * __pyx_v_obj)2110 static PyObject *__pyx_pw_8fastavro_4_six_7py3_iterkeys(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
2111   PyObject *__pyx_r = 0;
2112   __Pyx_RefNannyDeclarations
2113   __Pyx_RefNannySetupContext("py3_iterkeys (wrapper)", 0);
2114   __pyx_r = __pyx_pf_8fastavro_4_six_6py3_iterkeys(__pyx_self, ((PyObject *)__pyx_v_obj));
2115 
2116   /* function exit code */
2117   __Pyx_RefNannyFinishContext();
2118   return __pyx_r;
2119 }
2120 
__pyx_pf_8fastavro_4_six_6py3_iterkeys(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_obj)2121 static PyObject *__pyx_pf_8fastavro_4_six_6py3_iterkeys(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
2122   PyObject *__pyx_r = NULL;
2123   __Pyx_RefNannyDeclarations
2124   PyObject *__pyx_t_1 = NULL;
2125   PyObject *__pyx_t_2 = NULL;
2126   PyObject *__pyx_t_3 = NULL;
2127   int __pyx_lineno = 0;
2128   const char *__pyx_filename = NULL;
2129   int __pyx_clineno = 0;
2130   __Pyx_RefNannySetupContext("py3_iterkeys", 0);
2131 
2132   /* "fastavro/_six.pyx":31
2133  *
2134  *     def py3_iterkeys(obj):
2135  *         return obj.keys()             # <<<<<<<<<<<<<<
2136  *
2137  *     def py3_itervalues(obj):
2138  */
2139   __Pyx_XDECREF(__pyx_r);
2140   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_keys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error)
2141   __Pyx_GOTREF(__pyx_t_2);
2142   __pyx_t_3 = NULL;
2143   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
2144     __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
2145     if (likely(__pyx_t_3)) {
2146       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
2147       __Pyx_INCREF(__pyx_t_3);
2148       __Pyx_INCREF(function);
2149       __Pyx_DECREF_SET(__pyx_t_2, function);
2150     }
2151   }
2152   __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
2153   __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
2154   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error)
2155   __Pyx_GOTREF(__pyx_t_1);
2156   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2157   __pyx_r = __pyx_t_1;
2158   __pyx_t_1 = 0;
2159   goto __pyx_L0;
2160 
2161   /* "fastavro/_six.pyx":30
2162  *         json.dump(obj, sys.stdout, **kwargs)
2163  *
2164  *     def py3_iterkeys(obj):             # <<<<<<<<<<<<<<
2165  *         return obj.keys()
2166  *
2167  */
2168 
2169   /* function exit code */
2170   __pyx_L1_error:;
2171   __Pyx_XDECREF(__pyx_t_1);
2172   __Pyx_XDECREF(__pyx_t_2);
2173   __Pyx_XDECREF(__pyx_t_3);
2174   __Pyx_AddTraceback("fastavro._six.py3_iterkeys", __pyx_clineno, __pyx_lineno, __pyx_filename);
2175   __pyx_r = NULL;
2176   __pyx_L0:;
2177   __Pyx_XGIVEREF(__pyx_r);
2178   __Pyx_RefNannyFinishContext();
2179   return __pyx_r;
2180 }
2181 
2182 /* "fastavro/_six.pyx":33
2183  *         return obj.keys()
2184  *
2185  *     def py3_itervalues(obj):             # <<<<<<<<<<<<<<
2186  *         return obj.values()
2187  *
2188  */
2189 
2190 /* Python wrapper */
2191 static PyObject *__pyx_pw_8fastavro_4_six_9py3_itervalues(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/
2192 static PyMethodDef __pyx_mdef_8fastavro_4_six_9py3_itervalues = {"py3_itervalues", (PyCFunction)__pyx_pw_8fastavro_4_six_9py3_itervalues, METH_O, 0};
__pyx_pw_8fastavro_4_six_9py3_itervalues(PyObject * __pyx_self,PyObject * __pyx_v_obj)2193 static PyObject *__pyx_pw_8fastavro_4_six_9py3_itervalues(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
2194   PyObject *__pyx_r = 0;
2195   __Pyx_RefNannyDeclarations
2196   __Pyx_RefNannySetupContext("py3_itervalues (wrapper)", 0);
2197   __pyx_r = __pyx_pf_8fastavro_4_six_8py3_itervalues(__pyx_self, ((PyObject *)__pyx_v_obj));
2198 
2199   /* function exit code */
2200   __Pyx_RefNannyFinishContext();
2201   return __pyx_r;
2202 }
2203 
__pyx_pf_8fastavro_4_six_8py3_itervalues(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_obj)2204 static PyObject *__pyx_pf_8fastavro_4_six_8py3_itervalues(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
2205   PyObject *__pyx_r = NULL;
2206   __Pyx_RefNannyDeclarations
2207   PyObject *__pyx_t_1 = NULL;
2208   PyObject *__pyx_t_2 = NULL;
2209   PyObject *__pyx_t_3 = NULL;
2210   int __pyx_lineno = 0;
2211   const char *__pyx_filename = NULL;
2212   int __pyx_clineno = 0;
2213   __Pyx_RefNannySetupContext("py3_itervalues", 0);
2214 
2215   /* "fastavro/_six.pyx":34
2216  *
2217  *     def py3_itervalues(obj):
2218  *         return obj.values()             # <<<<<<<<<<<<<<
2219  *
2220  *     def py3_iteritems(obj):
2221  */
2222   __Pyx_XDECREF(__pyx_r);
2223   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_values); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error)
2224   __Pyx_GOTREF(__pyx_t_2);
2225   __pyx_t_3 = NULL;
2226   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
2227     __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
2228     if (likely(__pyx_t_3)) {
2229       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
2230       __Pyx_INCREF(__pyx_t_3);
2231       __Pyx_INCREF(function);
2232       __Pyx_DECREF_SET(__pyx_t_2, function);
2233     }
2234   }
2235   __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
2236   __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
2237   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error)
2238   __Pyx_GOTREF(__pyx_t_1);
2239   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2240   __pyx_r = __pyx_t_1;
2241   __pyx_t_1 = 0;
2242   goto __pyx_L0;
2243 
2244   /* "fastavro/_six.pyx":33
2245  *         return obj.keys()
2246  *
2247  *     def py3_itervalues(obj):             # <<<<<<<<<<<<<<
2248  *         return obj.values()
2249  *
2250  */
2251 
2252   /* function exit code */
2253   __pyx_L1_error:;
2254   __Pyx_XDECREF(__pyx_t_1);
2255   __Pyx_XDECREF(__pyx_t_2);
2256   __Pyx_XDECREF(__pyx_t_3);
2257   __Pyx_AddTraceback("fastavro._six.py3_itervalues", __pyx_clineno, __pyx_lineno, __pyx_filename);
2258   __pyx_r = NULL;
2259   __pyx_L0:;
2260   __Pyx_XGIVEREF(__pyx_r);
2261   __Pyx_RefNannyFinishContext();
2262   return __pyx_r;
2263 }
2264 
2265 /* "fastavro/_six.pyx":36
2266  *         return obj.values()
2267  *
2268  *     def py3_iteritems(obj):             # <<<<<<<<<<<<<<
2269  *         return obj.items()
2270  *
2271  */
2272 
2273 /* Python wrapper */
2274 static PyObject *__pyx_pw_8fastavro_4_six_11py3_iteritems(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/
2275 static PyMethodDef __pyx_mdef_8fastavro_4_six_11py3_iteritems = {"py3_iteritems", (PyCFunction)__pyx_pw_8fastavro_4_six_11py3_iteritems, METH_O, 0};
__pyx_pw_8fastavro_4_six_11py3_iteritems(PyObject * __pyx_self,PyObject * __pyx_v_obj)2276 static PyObject *__pyx_pw_8fastavro_4_six_11py3_iteritems(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
2277   PyObject *__pyx_r = 0;
2278   __Pyx_RefNannyDeclarations
2279   __Pyx_RefNannySetupContext("py3_iteritems (wrapper)", 0);
2280   __pyx_r = __pyx_pf_8fastavro_4_six_10py3_iteritems(__pyx_self, ((PyObject *)__pyx_v_obj));
2281 
2282   /* function exit code */
2283   __Pyx_RefNannyFinishContext();
2284   return __pyx_r;
2285 }
2286 
__pyx_pf_8fastavro_4_six_10py3_iteritems(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_obj)2287 static PyObject *__pyx_pf_8fastavro_4_six_10py3_iteritems(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
2288   PyObject *__pyx_r = NULL;
2289   __Pyx_RefNannyDeclarations
2290   PyObject *__pyx_t_1 = NULL;
2291   PyObject *__pyx_t_2 = NULL;
2292   PyObject *__pyx_t_3 = NULL;
2293   int __pyx_lineno = 0;
2294   const char *__pyx_filename = NULL;
2295   int __pyx_clineno = 0;
2296   __Pyx_RefNannySetupContext("py3_iteritems", 0);
2297 
2298   /* "fastavro/_six.pyx":37
2299  *
2300  *     def py3_iteritems(obj):
2301  *         return obj.items()             # <<<<<<<<<<<<<<
2302  *
2303  *     def py3_is_str(obj):
2304  */
2305   __Pyx_XDECREF(__pyx_r);
2306   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_items); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error)
2307   __Pyx_GOTREF(__pyx_t_2);
2308   __pyx_t_3 = NULL;
2309   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
2310     __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
2311     if (likely(__pyx_t_3)) {
2312       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
2313       __Pyx_INCREF(__pyx_t_3);
2314       __Pyx_INCREF(function);
2315       __Pyx_DECREF_SET(__pyx_t_2, function);
2316     }
2317   }
2318   __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
2319   __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
2320   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error)
2321   __Pyx_GOTREF(__pyx_t_1);
2322   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2323   __pyx_r = __pyx_t_1;
2324   __pyx_t_1 = 0;
2325   goto __pyx_L0;
2326 
2327   /* "fastavro/_six.pyx":36
2328  *         return obj.values()
2329  *
2330  *     def py3_iteritems(obj):             # <<<<<<<<<<<<<<
2331  *         return obj.items()
2332  *
2333  */
2334 
2335   /* function exit code */
2336   __pyx_L1_error:;
2337   __Pyx_XDECREF(__pyx_t_1);
2338   __Pyx_XDECREF(__pyx_t_2);
2339   __Pyx_XDECREF(__pyx_t_3);
2340   __Pyx_AddTraceback("fastavro._six.py3_iteritems", __pyx_clineno, __pyx_lineno, __pyx_filename);
2341   __pyx_r = NULL;
2342   __pyx_L0:;
2343   __Pyx_XGIVEREF(__pyx_r);
2344   __Pyx_RefNannyFinishContext();
2345   return __pyx_r;
2346 }
2347 
2348 /* "fastavro/_six.pyx":39
2349  *         return obj.items()
2350  *
2351  *     def py3_is_str(obj):             # <<<<<<<<<<<<<<
2352  *         return isinstance(obj, str)
2353  *
2354  */
2355 
2356 /* Python wrapper */
2357 static PyObject *__pyx_pw_8fastavro_4_six_13py3_is_str(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/
2358 static PyMethodDef __pyx_mdef_8fastavro_4_six_13py3_is_str = {"py3_is_str", (PyCFunction)__pyx_pw_8fastavro_4_six_13py3_is_str, METH_O, 0};
__pyx_pw_8fastavro_4_six_13py3_is_str(PyObject * __pyx_self,PyObject * __pyx_v_obj)2359 static PyObject *__pyx_pw_8fastavro_4_six_13py3_is_str(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
2360   PyObject *__pyx_r = 0;
2361   __Pyx_RefNannyDeclarations
2362   __Pyx_RefNannySetupContext("py3_is_str (wrapper)", 0);
2363   __pyx_r = __pyx_pf_8fastavro_4_six_12py3_is_str(__pyx_self, ((PyObject *)__pyx_v_obj));
2364 
2365   /* function exit code */
2366   __Pyx_RefNannyFinishContext();
2367   return __pyx_r;
2368 }
2369 
__pyx_pf_8fastavro_4_six_12py3_is_str(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_obj)2370 static PyObject *__pyx_pf_8fastavro_4_six_12py3_is_str(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
2371   PyObject *__pyx_r = NULL;
2372   __Pyx_RefNannyDeclarations
2373   int __pyx_t_1;
2374   PyObject *__pyx_t_2 = NULL;
2375   int __pyx_lineno = 0;
2376   const char *__pyx_filename = NULL;
2377   int __pyx_clineno = 0;
2378   __Pyx_RefNannySetupContext("py3_is_str", 0);
2379 
2380   /* "fastavro/_six.pyx":40
2381  *
2382  *     def py3_is_str(obj):
2383  *         return isinstance(obj, str)             # <<<<<<<<<<<<<<
2384  *
2385  *     def py3_mk_bits(bits):
2386  */
2387   __Pyx_XDECREF(__pyx_r);
2388   __pyx_t_1 = PyString_Check(__pyx_v_obj);
2389   __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error)
2390   __Pyx_GOTREF(__pyx_t_2);
2391   __pyx_r = __pyx_t_2;
2392   __pyx_t_2 = 0;
2393   goto __pyx_L0;
2394 
2395   /* "fastavro/_six.pyx":39
2396  *         return obj.items()
2397  *
2398  *     def py3_is_str(obj):             # <<<<<<<<<<<<<<
2399  *         return isinstance(obj, str)
2400  *
2401  */
2402 
2403   /* function exit code */
2404   __pyx_L1_error:;
2405   __Pyx_XDECREF(__pyx_t_2);
2406   __Pyx_AddTraceback("fastavro._six.py3_is_str", __pyx_clineno, __pyx_lineno, __pyx_filename);
2407   __pyx_r = NULL;
2408   __pyx_L0:;
2409   __Pyx_XGIVEREF(__pyx_r);
2410   __Pyx_RefNannyFinishContext();
2411   return __pyx_r;
2412 }
2413 
2414 /* "fastavro/_six.pyx":42
2415  *         return isinstance(obj, str)
2416  *
2417  *     def py3_mk_bits(bits):             # <<<<<<<<<<<<<<
2418  *         return bytes([bits & 0xff])
2419  *
2420  */
2421 
2422 /* Python wrapper */
2423 static PyObject *__pyx_pw_8fastavro_4_six_15py3_mk_bits(PyObject *__pyx_self, PyObject *__pyx_v_bits); /*proto*/
2424 static PyMethodDef __pyx_mdef_8fastavro_4_six_15py3_mk_bits = {"py3_mk_bits", (PyCFunction)__pyx_pw_8fastavro_4_six_15py3_mk_bits, METH_O, 0};
__pyx_pw_8fastavro_4_six_15py3_mk_bits(PyObject * __pyx_self,PyObject * __pyx_v_bits)2425 static PyObject *__pyx_pw_8fastavro_4_six_15py3_mk_bits(PyObject *__pyx_self, PyObject *__pyx_v_bits) {
2426   PyObject *__pyx_r = 0;
2427   __Pyx_RefNannyDeclarations
2428   __Pyx_RefNannySetupContext("py3_mk_bits (wrapper)", 0);
2429   __pyx_r = __pyx_pf_8fastavro_4_six_14py3_mk_bits(__pyx_self, ((PyObject *)__pyx_v_bits));
2430 
2431   /* function exit code */
2432   __Pyx_RefNannyFinishContext();
2433   return __pyx_r;
2434 }
2435 
__pyx_pf_8fastavro_4_six_14py3_mk_bits(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_bits)2436 static PyObject *__pyx_pf_8fastavro_4_six_14py3_mk_bits(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_bits) {
2437   PyObject *__pyx_r = NULL;
2438   __Pyx_RefNannyDeclarations
2439   PyObject *__pyx_t_1 = NULL;
2440   PyObject *__pyx_t_2 = NULL;
2441   int __pyx_lineno = 0;
2442   const char *__pyx_filename = NULL;
2443   int __pyx_clineno = 0;
2444   __Pyx_RefNannySetupContext("py3_mk_bits", 0);
2445 
2446   /* "fastavro/_six.pyx":43
2447  *
2448  *     def py3_mk_bits(bits):
2449  *         return bytes([bits & 0xff])             # <<<<<<<<<<<<<<
2450  *
2451  *     def py3_bytes2ints(datum):
2452  */
2453   __Pyx_XDECREF(__pyx_r);
2454   __pyx_t_1 = __Pyx_PyInt_AndObjC(__pyx_v_bits, __pyx_int_255, 0xff, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
2455   __Pyx_GOTREF(__pyx_t_1);
2456   __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error)
2457   __Pyx_GOTREF(__pyx_t_2);
2458   __Pyx_GIVEREF(__pyx_t_1);
2459   PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
2460   __pyx_t_1 = 0;
2461   __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyBytes_Type)), __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
2462   __Pyx_GOTREF(__pyx_t_1);
2463   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2464   __pyx_r = __pyx_t_1;
2465   __pyx_t_1 = 0;
2466   goto __pyx_L0;
2467 
2468   /* "fastavro/_six.pyx":42
2469  *         return isinstance(obj, str)
2470  *
2471  *     def py3_mk_bits(bits):             # <<<<<<<<<<<<<<
2472  *         return bytes([bits & 0xff])
2473  *
2474  */
2475 
2476   /* function exit code */
2477   __pyx_L1_error:;
2478   __Pyx_XDECREF(__pyx_t_1);
2479   __Pyx_XDECREF(__pyx_t_2);
2480   __Pyx_AddTraceback("fastavro._six.py3_mk_bits", __pyx_clineno, __pyx_lineno, __pyx_filename);
2481   __pyx_r = NULL;
2482   __pyx_L0:;
2483   __Pyx_XGIVEREF(__pyx_r);
2484   __Pyx_RefNannyFinishContext();
2485   return __pyx_r;
2486 }
2487 
2488 /* "fastavro/_six.pyx":45
2489  *         return bytes([bits & 0xff])
2490  *
2491  *     def py3_bytes2ints(datum):             # <<<<<<<<<<<<<<
2492  *         return list(datum)
2493  *
2494  */
2495 
2496 /* Python wrapper */
2497 static PyObject *__pyx_pw_8fastavro_4_six_17py3_bytes2ints(PyObject *__pyx_self, PyObject *__pyx_v_datum); /*proto*/
2498 static PyMethodDef __pyx_mdef_8fastavro_4_six_17py3_bytes2ints = {"py3_bytes2ints", (PyCFunction)__pyx_pw_8fastavro_4_six_17py3_bytes2ints, METH_O, 0};
__pyx_pw_8fastavro_4_six_17py3_bytes2ints(PyObject * __pyx_self,PyObject * __pyx_v_datum)2499 static PyObject *__pyx_pw_8fastavro_4_six_17py3_bytes2ints(PyObject *__pyx_self, PyObject *__pyx_v_datum) {
2500   PyObject *__pyx_r = 0;
2501   __Pyx_RefNannyDeclarations
2502   __Pyx_RefNannySetupContext("py3_bytes2ints (wrapper)", 0);
2503   __pyx_r = __pyx_pf_8fastavro_4_six_16py3_bytes2ints(__pyx_self, ((PyObject *)__pyx_v_datum));
2504 
2505   /* function exit code */
2506   __Pyx_RefNannyFinishContext();
2507   return __pyx_r;
2508 }
2509 
__pyx_pf_8fastavro_4_six_16py3_bytes2ints(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_datum)2510 static PyObject *__pyx_pf_8fastavro_4_six_16py3_bytes2ints(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_datum) {
2511   PyObject *__pyx_r = NULL;
2512   __Pyx_RefNannyDeclarations
2513   PyObject *__pyx_t_1 = NULL;
2514   int __pyx_lineno = 0;
2515   const char *__pyx_filename = NULL;
2516   int __pyx_clineno = 0;
2517   __Pyx_RefNannySetupContext("py3_bytes2ints", 0);
2518 
2519   /* "fastavro/_six.pyx":46
2520  *
2521  *     def py3_bytes2ints(datum):
2522  *         return list(datum)             # <<<<<<<<<<<<<<
2523  *
2524  *     def py3_fstint(datum):
2525  */
2526   __Pyx_XDECREF(__pyx_r);
2527   __pyx_t_1 = PySequence_List(__pyx_v_datum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error)
2528   __Pyx_GOTREF(__pyx_t_1);
2529   __pyx_r = __pyx_t_1;
2530   __pyx_t_1 = 0;
2531   goto __pyx_L0;
2532 
2533   /* "fastavro/_six.pyx":45
2534  *         return bytes([bits & 0xff])
2535  *
2536  *     def py3_bytes2ints(datum):             # <<<<<<<<<<<<<<
2537  *         return list(datum)
2538  *
2539  */
2540 
2541   /* function exit code */
2542   __pyx_L1_error:;
2543   __Pyx_XDECREF(__pyx_t_1);
2544   __Pyx_AddTraceback("fastavro._six.py3_bytes2ints", __pyx_clineno, __pyx_lineno, __pyx_filename);
2545   __pyx_r = NULL;
2546   __pyx_L0:;
2547   __Pyx_XGIVEREF(__pyx_r);
2548   __Pyx_RefNannyFinishContext();
2549   return __pyx_r;
2550 }
2551 
2552 /* "fastavro/_six.pyx":48
2553  *         return list(datum)
2554  *
2555  *     def py3_fstint(datum):             # <<<<<<<<<<<<<<
2556  *         return datum[0]
2557  *
2558  */
2559 
2560 /* Python wrapper */
2561 static PyObject *__pyx_pw_8fastavro_4_six_19py3_fstint(PyObject *__pyx_self, PyObject *__pyx_v_datum); /*proto*/
2562 static PyMethodDef __pyx_mdef_8fastavro_4_six_19py3_fstint = {"py3_fstint", (PyCFunction)__pyx_pw_8fastavro_4_six_19py3_fstint, METH_O, 0};
__pyx_pw_8fastavro_4_six_19py3_fstint(PyObject * __pyx_self,PyObject * __pyx_v_datum)2563 static PyObject *__pyx_pw_8fastavro_4_six_19py3_fstint(PyObject *__pyx_self, PyObject *__pyx_v_datum) {
2564   PyObject *__pyx_r = 0;
2565   __Pyx_RefNannyDeclarations
2566   __Pyx_RefNannySetupContext("py3_fstint (wrapper)", 0);
2567   __pyx_r = __pyx_pf_8fastavro_4_six_18py3_fstint(__pyx_self, ((PyObject *)__pyx_v_datum));
2568 
2569   /* function exit code */
2570   __Pyx_RefNannyFinishContext();
2571   return __pyx_r;
2572 }
2573 
__pyx_pf_8fastavro_4_six_18py3_fstint(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_datum)2574 static PyObject *__pyx_pf_8fastavro_4_six_18py3_fstint(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_datum) {
2575   PyObject *__pyx_r = NULL;
2576   __Pyx_RefNannyDeclarations
2577   PyObject *__pyx_t_1 = NULL;
2578   int __pyx_lineno = 0;
2579   const char *__pyx_filename = NULL;
2580   int __pyx_clineno = 0;
2581   __Pyx_RefNannySetupContext("py3_fstint", 0);
2582 
2583   /* "fastavro/_six.pyx":49
2584  *
2585  *     def py3_fstint(datum):
2586  *         return datum[0]             # <<<<<<<<<<<<<<
2587  *
2588  *     def py3_appendable(file_like):
2589  */
2590   __Pyx_XDECREF(__pyx_r);
2591   __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_datum, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error)
2592   __Pyx_GOTREF(__pyx_t_1);
2593   __pyx_r = __pyx_t_1;
2594   __pyx_t_1 = 0;
2595   goto __pyx_L0;
2596 
2597   /* "fastavro/_six.pyx":48
2598  *         return list(datum)
2599  *
2600  *     def py3_fstint(datum):             # <<<<<<<<<<<<<<
2601  *         return datum[0]
2602  *
2603  */
2604 
2605   /* function exit code */
2606   __pyx_L1_error:;
2607   __Pyx_XDECREF(__pyx_t_1);
2608   __Pyx_AddTraceback("fastavro._six.py3_fstint", __pyx_clineno, __pyx_lineno, __pyx_filename);
2609   __pyx_r = NULL;
2610   __pyx_L0:;
2611   __Pyx_XGIVEREF(__pyx_r);
2612   __Pyx_RefNannyFinishContext();
2613   return __pyx_r;
2614 }
2615 
2616 /* "fastavro/_six.pyx":51
2617  *         return datum[0]
2618  *
2619  *     def py3_appendable(file_like):             # <<<<<<<<<<<<<<
2620  *         if file_like.seekable() and file_like.tell() != 0:
2621  *             if "<stdout>" == getattr(file_like, "name", ""):
2622  */
2623 
2624 /* Python wrapper */
2625 static PyObject *__pyx_pw_8fastavro_4_six_21py3_appendable(PyObject *__pyx_self, PyObject *__pyx_v_file_like); /*proto*/
2626 static PyMethodDef __pyx_mdef_8fastavro_4_six_21py3_appendable = {"py3_appendable", (PyCFunction)__pyx_pw_8fastavro_4_six_21py3_appendable, METH_O, 0};
__pyx_pw_8fastavro_4_six_21py3_appendable(PyObject * __pyx_self,PyObject * __pyx_v_file_like)2627 static PyObject *__pyx_pw_8fastavro_4_six_21py3_appendable(PyObject *__pyx_self, PyObject *__pyx_v_file_like) {
2628   PyObject *__pyx_r = 0;
2629   __Pyx_RefNannyDeclarations
2630   __Pyx_RefNannySetupContext("py3_appendable (wrapper)", 0);
2631   __pyx_r = __pyx_pf_8fastavro_4_six_20py3_appendable(__pyx_self, ((PyObject *)__pyx_v_file_like));
2632 
2633   /* function exit code */
2634   __Pyx_RefNannyFinishContext();
2635   return __pyx_r;
2636 }
2637 
__pyx_pf_8fastavro_4_six_20py3_appendable(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_file_like)2638 static PyObject *__pyx_pf_8fastavro_4_six_20py3_appendable(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_like) {
2639   PyObject *__pyx_r = NULL;
2640   __Pyx_RefNannyDeclarations
2641   int __pyx_t_1;
2642   PyObject *__pyx_t_2 = NULL;
2643   PyObject *__pyx_t_3 = NULL;
2644   PyObject *__pyx_t_4 = NULL;
2645   int __pyx_t_5;
2646   int __pyx_lineno = 0;
2647   const char *__pyx_filename = NULL;
2648   int __pyx_clineno = 0;
2649   __Pyx_RefNannySetupContext("py3_appendable", 0);
2650 
2651   /* "fastavro/_six.pyx":52
2652  *
2653  *     def py3_appendable(file_like):
2654  *         if file_like.seekable() and file_like.tell() != 0:             # <<<<<<<<<<<<<<
2655  *             if "<stdout>" == getattr(file_like, "name", ""):
2656  *                 # In OSX, sys.stdout is seekable and has a non-zero tell() but
2657  */
2658   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_file_like, __pyx_n_s_seekable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 52, __pyx_L1_error)
2659   __Pyx_GOTREF(__pyx_t_3);
2660   __pyx_t_4 = NULL;
2661   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
2662     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
2663     if (likely(__pyx_t_4)) {
2664       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
2665       __Pyx_INCREF(__pyx_t_4);
2666       __Pyx_INCREF(function);
2667       __Pyx_DECREF_SET(__pyx_t_3, function);
2668     }
2669   }
2670   __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
2671   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
2672   if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error)
2673   __Pyx_GOTREF(__pyx_t_2);
2674   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2675   __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 52, __pyx_L1_error)
2676   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2677   if (__pyx_t_5) {
2678   } else {
2679     __pyx_t_1 = __pyx_t_5;
2680     goto __pyx_L4_bool_binop_done;
2681   }
2682   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_file_like, __pyx_n_s_tell); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 52, __pyx_L1_error)
2683   __Pyx_GOTREF(__pyx_t_3);
2684   __pyx_t_4 = NULL;
2685   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
2686     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
2687     if (likely(__pyx_t_4)) {
2688       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
2689       __Pyx_INCREF(__pyx_t_4);
2690       __Pyx_INCREF(function);
2691       __Pyx_DECREF_SET(__pyx_t_3, function);
2692     }
2693   }
2694   __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
2695   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
2696   if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error)
2697   __Pyx_GOTREF(__pyx_t_2);
2698   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2699   __pyx_t_3 = __Pyx_PyInt_NeObjC(__pyx_t_2, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 52, __pyx_L1_error)
2700   __Pyx_GOTREF(__pyx_t_3);
2701   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2702   __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 52, __pyx_L1_error)
2703   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2704   __pyx_t_1 = __pyx_t_5;
2705   __pyx_L4_bool_binop_done:;
2706   if (__pyx_t_1) {
2707 
2708     /* "fastavro/_six.pyx":53
2709  *     def py3_appendable(file_like):
2710  *         if file_like.seekable() and file_like.tell() != 0:
2711  *             if "<stdout>" == getattr(file_like, "name", ""):             # <<<<<<<<<<<<<<
2712  *                 # In OSX, sys.stdout is seekable and has a non-zero tell() but
2713  *                 # we wouldn't want to append to a stdout. In the python REPL,
2714  */
2715     __pyx_t_3 = __Pyx_GetAttr3(__pyx_v_file_like, __pyx_n_s_name, __pyx_kp_s__3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 53, __pyx_L1_error)
2716     __Pyx_GOTREF(__pyx_t_3);
2717     __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_kp_s_stdout_2, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 53, __pyx_L1_error)
2718     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2719     if (__pyx_t_1) {
2720 
2721       /* "fastavro/_six.pyx":57
2722  *                 # we wouldn't want to append to a stdout. In the python REPL,
2723  *                 # sys.stdout is named `<stdout>`
2724  *                 return False             # <<<<<<<<<<<<<<
2725  *             if file_like.readable():
2726  *                 return True
2727  */
2728       __Pyx_XDECREF(__pyx_r);
2729       __Pyx_INCREF(Py_False);
2730       __pyx_r = Py_False;
2731       goto __pyx_L0;
2732 
2733       /* "fastavro/_six.pyx":53
2734  *     def py3_appendable(file_like):
2735  *         if file_like.seekable() and file_like.tell() != 0:
2736  *             if "<stdout>" == getattr(file_like, "name", ""):             # <<<<<<<<<<<<<<
2737  *                 # In OSX, sys.stdout is seekable and has a non-zero tell() but
2738  *                 # we wouldn't want to append to a stdout. In the python REPL,
2739  */
2740     }
2741 
2742     /* "fastavro/_six.pyx":58
2743  *                 # sys.stdout is named `<stdout>`
2744  *                 return False
2745  *             if file_like.readable():             # <<<<<<<<<<<<<<
2746  *                 return True
2747  *             else:
2748  */
2749     __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_file_like, __pyx_n_s_readable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L1_error)
2750     __Pyx_GOTREF(__pyx_t_2);
2751     __pyx_t_4 = NULL;
2752     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
2753       __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
2754       if (likely(__pyx_t_4)) {
2755         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
2756         __Pyx_INCREF(__pyx_t_4);
2757         __Pyx_INCREF(function);
2758         __Pyx_DECREF_SET(__pyx_t_2, function);
2759       }
2760     }
2761     __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
2762     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
2763     if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 58, __pyx_L1_error)
2764     __Pyx_GOTREF(__pyx_t_3);
2765     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2766     __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 58, __pyx_L1_error)
2767     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2768     if (likely(__pyx_t_1)) {
2769 
2770       /* "fastavro/_six.pyx":59
2771  *                 return False
2772  *             if file_like.readable():
2773  *                 return True             # <<<<<<<<<<<<<<
2774  *             else:
2775  *                 raise ValueError(
2776  */
2777       __Pyx_XDECREF(__pyx_r);
2778       __Pyx_INCREF(Py_True);
2779       __pyx_r = Py_True;
2780       goto __pyx_L0;
2781 
2782       /* "fastavro/_six.pyx":58
2783  *                 # sys.stdout is named `<stdout>`
2784  *                 return False
2785  *             if file_like.readable():             # <<<<<<<<<<<<<<
2786  *                 return True
2787  *             else:
2788  */
2789     }
2790 
2791     /* "fastavro/_six.pyx":61
2792  *                 return True
2793  *             else:
2794  *                 raise ValueError(             # <<<<<<<<<<<<<<
2795  *                     "When appending to an avro file you must use the "
2796  *                     + "'a+' mode, not just 'a'"
2797  */
2798     /*else*/ {
2799 
2800       /* "fastavro/_six.pyx":63
2801  *                 raise ValueError(
2802  *                     "When appending to an avro file you must use the "
2803  *                     + "'a+' mode, not just 'a'"             # <<<<<<<<<<<<<<
2804  *                 )
2805  *         else:
2806  */
2807       __pyx_t_3 = PyNumber_Add(__pyx_kp_s_When_appending_to_an_avro_file_y, __pyx_kp_s_a_mode_not_just_a); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 63, __pyx_L1_error)
2808       __Pyx_GOTREF(__pyx_t_3);
2809 
2810       /* "fastavro/_six.pyx":61
2811  *                 return True
2812  *             else:
2813  *                 raise ValueError(             # <<<<<<<<<<<<<<
2814  *                     "When appending to an avro file you must use the "
2815  *                     + "'a+' mode, not just 'a'"
2816  */
2817       __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error)
2818       __Pyx_GOTREF(__pyx_t_2);
2819       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2820       __Pyx_Raise(__pyx_t_2, 0, 0, 0);
2821       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2822       __PYX_ERR(0, 61, __pyx_L1_error)
2823     }
2824 
2825     /* "fastavro/_six.pyx":52
2826  *
2827  *     def py3_appendable(file_like):
2828  *         if file_like.seekable() and file_like.tell() != 0:             # <<<<<<<<<<<<<<
2829  *             if "<stdout>" == getattr(file_like, "name", ""):
2830  *                 # In OSX, sys.stdout is seekable and has a non-zero tell() but
2831  */
2832   }
2833 
2834   /* "fastavro/_six.pyx":66
2835  *                 )
2836  *         else:
2837  *             return False             # <<<<<<<<<<<<<<
2838  *
2839  *     def py3_int_to_be_signed_bytes(num, bytes_req):
2840  */
2841   /*else*/ {
2842     __Pyx_XDECREF(__pyx_r);
2843     __Pyx_INCREF(Py_False);
2844     __pyx_r = Py_False;
2845     goto __pyx_L0;
2846   }
2847 
2848   /* "fastavro/_six.pyx":51
2849  *         return datum[0]
2850  *
2851  *     def py3_appendable(file_like):             # <<<<<<<<<<<<<<
2852  *         if file_like.seekable() and file_like.tell() != 0:
2853  *             if "<stdout>" == getattr(file_like, "name", ""):
2854  */
2855 
2856   /* function exit code */
2857   __pyx_L1_error:;
2858   __Pyx_XDECREF(__pyx_t_2);
2859   __Pyx_XDECREF(__pyx_t_3);
2860   __Pyx_XDECREF(__pyx_t_4);
2861   __Pyx_AddTraceback("fastavro._six.py3_appendable", __pyx_clineno, __pyx_lineno, __pyx_filename);
2862   __pyx_r = NULL;
2863   __pyx_L0:;
2864   __Pyx_XGIVEREF(__pyx_r);
2865   __Pyx_RefNannyFinishContext();
2866   return __pyx_r;
2867 }
2868 
2869 /* "fastavro/_six.pyx":68
2870  *             return False
2871  *
2872  *     def py3_int_to_be_signed_bytes(num, bytes_req):             # <<<<<<<<<<<<<<
2873  *         return num.to_bytes(bytes_req, byteorder='big', signed=True)
2874  *
2875  */
2876 
2877 /* Python wrapper */
2878 static PyObject *__pyx_pw_8fastavro_4_six_23py3_int_to_be_signed_bytes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2879 static PyMethodDef __pyx_mdef_8fastavro_4_six_23py3_int_to_be_signed_bytes = {"py3_int_to_be_signed_bytes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8fastavro_4_six_23py3_int_to_be_signed_bytes, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_8fastavro_4_six_23py3_int_to_be_signed_bytes(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)2880 static PyObject *__pyx_pw_8fastavro_4_six_23py3_int_to_be_signed_bytes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2881   PyObject *__pyx_v_num = 0;
2882   PyObject *__pyx_v_bytes_req = 0;
2883   int __pyx_lineno = 0;
2884   const char *__pyx_filename = NULL;
2885   int __pyx_clineno = 0;
2886   PyObject *__pyx_r = 0;
2887   __Pyx_RefNannyDeclarations
2888   __Pyx_RefNannySetupContext("py3_int_to_be_signed_bytes (wrapper)", 0);
2889   {
2890     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_num,&__pyx_n_s_bytes_req,0};
2891     PyObject* values[2] = {0,0};
2892     if (unlikely(__pyx_kwds)) {
2893       Py_ssize_t kw_args;
2894       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2895       switch (pos_args) {
2896         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2897         CYTHON_FALLTHROUGH;
2898         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2899         CYTHON_FALLTHROUGH;
2900         case  0: break;
2901         default: goto __pyx_L5_argtuple_error;
2902       }
2903       kw_args = PyDict_Size(__pyx_kwds);
2904       switch (pos_args) {
2905         case  0:
2906         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_num)) != 0)) kw_args--;
2907         else goto __pyx_L5_argtuple_error;
2908         CYTHON_FALLTHROUGH;
2909         case  1:
2910         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bytes_req)) != 0)) kw_args--;
2911         else {
2912           __Pyx_RaiseArgtupleInvalid("py3_int_to_be_signed_bytes", 1, 2, 2, 1); __PYX_ERR(0, 68, __pyx_L3_error)
2913         }
2914       }
2915       if (unlikely(kw_args > 0)) {
2916         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "py3_int_to_be_signed_bytes") < 0)) __PYX_ERR(0, 68, __pyx_L3_error)
2917       }
2918     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
2919       goto __pyx_L5_argtuple_error;
2920     } else {
2921       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2922       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2923     }
2924     __pyx_v_num = values[0];
2925     __pyx_v_bytes_req = values[1];
2926   }
2927   goto __pyx_L4_argument_unpacking_done;
2928   __pyx_L5_argtuple_error:;
2929   __Pyx_RaiseArgtupleInvalid("py3_int_to_be_signed_bytes", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 68, __pyx_L3_error)
2930   __pyx_L3_error:;
2931   __Pyx_AddTraceback("fastavro._six.py3_int_to_be_signed_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename);
2932   __Pyx_RefNannyFinishContext();
2933   return NULL;
2934   __pyx_L4_argument_unpacking_done:;
2935   __pyx_r = __pyx_pf_8fastavro_4_six_22py3_int_to_be_signed_bytes(__pyx_self, __pyx_v_num, __pyx_v_bytes_req);
2936 
2937   /* function exit code */
2938   __Pyx_RefNannyFinishContext();
2939   return __pyx_r;
2940 }
2941 
__pyx_pf_8fastavro_4_six_22py3_int_to_be_signed_bytes(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_num,PyObject * __pyx_v_bytes_req)2942 static PyObject *__pyx_pf_8fastavro_4_six_22py3_int_to_be_signed_bytes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_num, PyObject *__pyx_v_bytes_req) {
2943   PyObject *__pyx_r = NULL;
2944   __Pyx_RefNannyDeclarations
2945   PyObject *__pyx_t_1 = NULL;
2946   PyObject *__pyx_t_2 = NULL;
2947   PyObject *__pyx_t_3 = NULL;
2948   PyObject *__pyx_t_4 = NULL;
2949   int __pyx_lineno = 0;
2950   const char *__pyx_filename = NULL;
2951   int __pyx_clineno = 0;
2952   __Pyx_RefNannySetupContext("py3_int_to_be_signed_bytes", 0);
2953 
2954   /* "fastavro/_six.pyx":69
2955  *
2956  *     def py3_int_to_be_signed_bytes(num, bytes_req):
2957  *         return num.to_bytes(bytes_req, byteorder='big', signed=True)             # <<<<<<<<<<<<<<
2958  *
2959  *     def py3_be_signed_bytes_to_int(data):
2960  */
2961   __Pyx_XDECREF(__pyx_r);
2962   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_num, __pyx_n_s_to_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error)
2963   __Pyx_GOTREF(__pyx_t_1);
2964   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error)
2965   __Pyx_GOTREF(__pyx_t_2);
2966   __Pyx_INCREF(__pyx_v_bytes_req);
2967   __Pyx_GIVEREF(__pyx_v_bytes_req);
2968   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_bytes_req);
2969   __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 69, __pyx_L1_error)
2970   __Pyx_GOTREF(__pyx_t_3);
2971   if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_byteorder, __pyx_n_s_big) < 0) __PYX_ERR(0, 69, __pyx_L1_error)
2972   if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_signed, Py_True) < 0) __PYX_ERR(0, 69, __pyx_L1_error)
2973   __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 69, __pyx_L1_error)
2974   __Pyx_GOTREF(__pyx_t_4);
2975   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2976   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2977   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2978   __pyx_r = __pyx_t_4;
2979   __pyx_t_4 = 0;
2980   goto __pyx_L0;
2981 
2982   /* "fastavro/_six.pyx":68
2983  *             return False
2984  *
2985  *     def py3_int_to_be_signed_bytes(num, bytes_req):             # <<<<<<<<<<<<<<
2986  *         return num.to_bytes(bytes_req, byteorder='big', signed=True)
2987  *
2988  */
2989 
2990   /* function exit code */
2991   __pyx_L1_error:;
2992   __Pyx_XDECREF(__pyx_t_1);
2993   __Pyx_XDECREF(__pyx_t_2);
2994   __Pyx_XDECREF(__pyx_t_3);
2995   __Pyx_XDECREF(__pyx_t_4);
2996   __Pyx_AddTraceback("fastavro._six.py3_int_to_be_signed_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename);
2997   __pyx_r = NULL;
2998   __pyx_L0:;
2999   __Pyx_XGIVEREF(__pyx_r);
3000   __Pyx_RefNannyFinishContext();
3001   return __pyx_r;
3002 }
3003 
3004 /* "fastavro/_six.pyx":71
3005  *         return num.to_bytes(bytes_req, byteorder='big', signed=True)
3006  *
3007  *     def py3_be_signed_bytes_to_int(data):             # <<<<<<<<<<<<<<
3008  *         return int.from_bytes(data, byteorder='big', signed=True)
3009  *
3010  */
3011 
3012 /* Python wrapper */
3013 static PyObject *__pyx_pw_8fastavro_4_six_25py3_be_signed_bytes_to_int(PyObject *__pyx_self, PyObject *__pyx_v_data); /*proto*/
3014 static PyMethodDef __pyx_mdef_8fastavro_4_six_25py3_be_signed_bytes_to_int = {"py3_be_signed_bytes_to_int", (PyCFunction)__pyx_pw_8fastavro_4_six_25py3_be_signed_bytes_to_int, METH_O, 0};
__pyx_pw_8fastavro_4_six_25py3_be_signed_bytes_to_int(PyObject * __pyx_self,PyObject * __pyx_v_data)3015 static PyObject *__pyx_pw_8fastavro_4_six_25py3_be_signed_bytes_to_int(PyObject *__pyx_self, PyObject *__pyx_v_data) {
3016   PyObject *__pyx_r = 0;
3017   __Pyx_RefNannyDeclarations
3018   __Pyx_RefNannySetupContext("py3_be_signed_bytes_to_int (wrapper)", 0);
3019   __pyx_r = __pyx_pf_8fastavro_4_six_24py3_be_signed_bytes_to_int(__pyx_self, ((PyObject *)__pyx_v_data));
3020 
3021   /* function exit code */
3022   __Pyx_RefNannyFinishContext();
3023   return __pyx_r;
3024 }
3025 
__pyx_pf_8fastavro_4_six_24py3_be_signed_bytes_to_int(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_data)3026 static PyObject *__pyx_pf_8fastavro_4_six_24py3_be_signed_bytes_to_int(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data) {
3027   PyObject *__pyx_r = NULL;
3028   __Pyx_RefNannyDeclarations
3029   PyObject *__pyx_t_1 = NULL;
3030   PyObject *__pyx_t_2 = NULL;
3031   PyObject *__pyx_t_3 = NULL;
3032   PyObject *__pyx_t_4 = NULL;
3033   int __pyx_lineno = 0;
3034   const char *__pyx_filename = NULL;
3035   int __pyx_clineno = 0;
3036   __Pyx_RefNannySetupContext("py3_be_signed_bytes_to_int", 0);
3037 
3038   /* "fastavro/_six.pyx":72
3039  *
3040  *     def py3_be_signed_bytes_to_int(data):
3041  *         return int.from_bytes(data, byteorder='big', signed=True)             # <<<<<<<<<<<<<<
3042  *
3043  *     def py3_reraise(Err, msg):
3044  */
3045   __Pyx_XDECREF(__pyx_r);
3046   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyInt_Type)), __pyx_n_s_from_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error)
3047   __Pyx_GOTREF(__pyx_t_1);
3048   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 72, __pyx_L1_error)
3049   __Pyx_GOTREF(__pyx_t_2);
3050   __Pyx_INCREF(__pyx_v_data);
3051   __Pyx_GIVEREF(__pyx_v_data);
3052   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_data);
3053   __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error)
3054   __Pyx_GOTREF(__pyx_t_3);
3055   if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_byteorder, __pyx_n_s_big) < 0) __PYX_ERR(0, 72, __pyx_L1_error)
3056   if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_signed, Py_True) < 0) __PYX_ERR(0, 72, __pyx_L1_error)
3057   __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error)
3058   __Pyx_GOTREF(__pyx_t_4);
3059   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3060   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3061   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3062   __pyx_r = __pyx_t_4;
3063   __pyx_t_4 = 0;
3064   goto __pyx_L0;
3065 
3066   /* "fastavro/_six.pyx":71
3067  *         return num.to_bytes(bytes_req, byteorder='big', signed=True)
3068  *
3069  *     def py3_be_signed_bytes_to_int(data):             # <<<<<<<<<<<<<<
3070  *         return int.from_bytes(data, byteorder='big', signed=True)
3071  *
3072  */
3073 
3074   /* function exit code */
3075   __pyx_L1_error:;
3076   __Pyx_XDECREF(__pyx_t_1);
3077   __Pyx_XDECREF(__pyx_t_2);
3078   __Pyx_XDECREF(__pyx_t_3);
3079   __Pyx_XDECREF(__pyx_t_4);
3080   __Pyx_AddTraceback("fastavro._six.py3_be_signed_bytes_to_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
3081   __pyx_r = NULL;
3082   __pyx_L0:;
3083   __Pyx_XGIVEREF(__pyx_r);
3084   __Pyx_RefNannyFinishContext();
3085   return __pyx_r;
3086 }
3087 
3088 /* "fastavro/_six.pyx":74
3089  *         return int.from_bytes(data, byteorder='big', signed=True)
3090  *
3091  *     def py3_reraise(Err, msg):             # <<<<<<<<<<<<<<
3092  *         raise Err(msg).with_traceback(sys.exc_info()[2])
3093  *
3094  */
3095 
3096 /* Python wrapper */
3097 static PyObject *__pyx_pw_8fastavro_4_six_27py3_reraise(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3098 static PyMethodDef __pyx_mdef_8fastavro_4_six_27py3_reraise = {"py3_reraise", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8fastavro_4_six_27py3_reraise, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_8fastavro_4_six_27py3_reraise(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)3099 static PyObject *__pyx_pw_8fastavro_4_six_27py3_reraise(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3100   PyObject *__pyx_v_Err = 0;
3101   PyObject *__pyx_v_msg = 0;
3102   int __pyx_lineno = 0;
3103   const char *__pyx_filename = NULL;
3104   int __pyx_clineno = 0;
3105   PyObject *__pyx_r = 0;
3106   __Pyx_RefNannyDeclarations
3107   __Pyx_RefNannySetupContext("py3_reraise (wrapper)", 0);
3108   {
3109     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_Err,&__pyx_n_s_msg,0};
3110     PyObject* values[2] = {0,0};
3111     if (unlikely(__pyx_kwds)) {
3112       Py_ssize_t kw_args;
3113       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3114       switch (pos_args) {
3115         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3116         CYTHON_FALLTHROUGH;
3117         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3118         CYTHON_FALLTHROUGH;
3119         case  0: break;
3120         default: goto __pyx_L5_argtuple_error;
3121       }
3122       kw_args = PyDict_Size(__pyx_kwds);
3123       switch (pos_args) {
3124         case  0:
3125         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Err)) != 0)) kw_args--;
3126         else goto __pyx_L5_argtuple_error;
3127         CYTHON_FALLTHROUGH;
3128         case  1:
3129         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_msg)) != 0)) kw_args--;
3130         else {
3131           __Pyx_RaiseArgtupleInvalid("py3_reraise", 1, 2, 2, 1); __PYX_ERR(0, 74, __pyx_L3_error)
3132         }
3133       }
3134       if (unlikely(kw_args > 0)) {
3135         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "py3_reraise") < 0)) __PYX_ERR(0, 74, __pyx_L3_error)
3136       }
3137     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
3138       goto __pyx_L5_argtuple_error;
3139     } else {
3140       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3141       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3142     }
3143     __pyx_v_Err = values[0];
3144     __pyx_v_msg = values[1];
3145   }
3146   goto __pyx_L4_argument_unpacking_done;
3147   __pyx_L5_argtuple_error:;
3148   __Pyx_RaiseArgtupleInvalid("py3_reraise", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 74, __pyx_L3_error)
3149   __pyx_L3_error:;
3150   __Pyx_AddTraceback("fastavro._six.py3_reraise", __pyx_clineno, __pyx_lineno, __pyx_filename);
3151   __Pyx_RefNannyFinishContext();
3152   return NULL;
3153   __pyx_L4_argument_unpacking_done:;
3154   __pyx_r = __pyx_pf_8fastavro_4_six_26py3_reraise(__pyx_self, __pyx_v_Err, __pyx_v_msg);
3155 
3156   /* function exit code */
3157   __Pyx_RefNannyFinishContext();
3158   return __pyx_r;
3159 }
3160 
__pyx_pf_8fastavro_4_six_26py3_reraise(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_Err,PyObject * __pyx_v_msg)3161 static PyObject *__pyx_pf_8fastavro_4_six_26py3_reraise(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_Err, PyObject *__pyx_v_msg) {
3162   PyObject *__pyx_r = NULL;
3163   __Pyx_RefNannyDeclarations
3164   PyObject *__pyx_t_1 = NULL;
3165   PyObject *__pyx_t_2 = NULL;
3166   PyObject *__pyx_t_3 = NULL;
3167   PyObject *__pyx_t_4 = NULL;
3168   PyObject *__pyx_t_5 = NULL;
3169   int __pyx_lineno = 0;
3170   const char *__pyx_filename = NULL;
3171   int __pyx_clineno = 0;
3172   __Pyx_RefNannySetupContext("py3_reraise", 0);
3173 
3174   /* "fastavro/_six.pyx":75
3175  *
3176  *     def py3_reraise(Err, msg):
3177  *         raise Err(msg).with_traceback(sys.exc_info()[2])             # <<<<<<<<<<<<<<
3178  *
3179  *
3180  */
3181   __Pyx_INCREF(__pyx_v_Err);
3182   __pyx_t_3 = __pyx_v_Err; __pyx_t_4 = NULL;
3183   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3184     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
3185     if (likely(__pyx_t_4)) {
3186       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3187       __Pyx_INCREF(__pyx_t_4);
3188       __Pyx_INCREF(function);
3189       __Pyx_DECREF_SET(__pyx_t_3, function);
3190     }
3191   }
3192   __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_msg) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_msg);
3193   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3194   if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __pyx_L1_error)
3195   __Pyx_GOTREF(__pyx_t_2);
3196   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3197   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_with_traceback); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 75, __pyx_L1_error)
3198   __Pyx_GOTREF(__pyx_t_3);
3199   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3200   __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_sys); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 75, __pyx_L1_error)
3201   __Pyx_GOTREF(__pyx_t_4);
3202   __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 75, __pyx_L1_error)
3203   __Pyx_GOTREF(__pyx_t_5);
3204   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3205   __pyx_t_4 = NULL;
3206   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
3207     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
3208     if (likely(__pyx_t_4)) {
3209       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
3210       __Pyx_INCREF(__pyx_t_4);
3211       __Pyx_INCREF(function);
3212       __Pyx_DECREF_SET(__pyx_t_5, function);
3213     }
3214   }
3215   __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
3216   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3217   if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __pyx_L1_error)
3218   __Pyx_GOTREF(__pyx_t_2);
3219   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3220   __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_2, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 75, __pyx_L1_error)
3221   __Pyx_GOTREF(__pyx_t_5);
3222   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3223   __pyx_t_2 = NULL;
3224   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3225     __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
3226     if (likely(__pyx_t_2)) {
3227       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3228       __Pyx_INCREF(__pyx_t_2);
3229       __Pyx_INCREF(function);
3230       __Pyx_DECREF_SET(__pyx_t_3, function);
3231     }
3232   }
3233   __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5);
3234   __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3235   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3236   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error)
3237   __Pyx_GOTREF(__pyx_t_1);
3238   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3239   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3240   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3241   __PYX_ERR(0, 75, __pyx_L1_error)
3242 
3243   /* "fastavro/_six.pyx":74
3244  *         return int.from_bytes(data, byteorder='big', signed=True)
3245  *
3246  *     def py3_reraise(Err, msg):             # <<<<<<<<<<<<<<
3247  *         raise Err(msg).with_traceback(sys.exc_info()[2])
3248  *
3249  */
3250 
3251   /* function exit code */
3252   __pyx_L1_error:;
3253   __Pyx_XDECREF(__pyx_t_1);
3254   __Pyx_XDECREF(__pyx_t_2);
3255   __Pyx_XDECREF(__pyx_t_3);
3256   __Pyx_XDECREF(__pyx_t_4);
3257   __Pyx_XDECREF(__pyx_t_5);
3258   __Pyx_AddTraceback("fastavro._six.py3_reraise", __pyx_clineno, __pyx_lineno, __pyx_filename);
3259   __pyx_r = NULL;
3260   __Pyx_XGIVEREF(__pyx_r);
3261   __Pyx_RefNannyFinishContext();
3262   return __pyx_r;
3263 }
3264 
3265 /* "fastavro/_six.pyx":83
3266  *     xrange = xrange
3267  *
3268  *     def py2_btou(n, encoding=_encoding):             # <<<<<<<<<<<<<<
3269  *         return unicode(n, encoding)  # noqa
3270  *
3271  */
3272 
3273 /* Python wrapper */
3274 static PyObject *__pyx_pw_8fastavro_4_six_29py2_btou(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3275 static PyMethodDef __pyx_mdef_8fastavro_4_six_29py2_btou = {"py2_btou", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8fastavro_4_six_29py2_btou, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_8fastavro_4_six_29py2_btou(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)3276 static PyObject *__pyx_pw_8fastavro_4_six_29py2_btou(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3277   PyObject *__pyx_v_n = 0;
3278   PyObject *__pyx_v_encoding = 0;
3279   int __pyx_lineno = 0;
3280   const char *__pyx_filename = NULL;
3281   int __pyx_clineno = 0;
3282   PyObject *__pyx_r = 0;
3283   __Pyx_RefNannyDeclarations
3284   __Pyx_RefNannySetupContext("py2_btou (wrapper)", 0);
3285   {
3286     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_encoding,0};
3287     PyObject* values[2] = {0,0};
3288     values[1] = __pyx_k__4;
3289     if (unlikely(__pyx_kwds)) {
3290       Py_ssize_t kw_args;
3291       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3292       switch (pos_args) {
3293         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3294         CYTHON_FALLTHROUGH;
3295         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3296         CYTHON_FALLTHROUGH;
3297         case  0: break;
3298         default: goto __pyx_L5_argtuple_error;
3299       }
3300       kw_args = PyDict_Size(__pyx_kwds);
3301       switch (pos_args) {
3302         case  0:
3303         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
3304         else goto __pyx_L5_argtuple_error;
3305         CYTHON_FALLTHROUGH;
3306         case  1:
3307         if (kw_args > 0) {
3308           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_encoding);
3309           if (value) { values[1] = value; kw_args--; }
3310         }
3311       }
3312       if (unlikely(kw_args > 0)) {
3313         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "py2_btou") < 0)) __PYX_ERR(0, 83, __pyx_L3_error)
3314       }
3315     } else {
3316       switch (PyTuple_GET_SIZE(__pyx_args)) {
3317         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3318         CYTHON_FALLTHROUGH;
3319         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3320         break;
3321         default: goto __pyx_L5_argtuple_error;
3322       }
3323     }
3324     __pyx_v_n = values[0];
3325     __pyx_v_encoding = values[1];
3326   }
3327   goto __pyx_L4_argument_unpacking_done;
3328   __pyx_L5_argtuple_error:;
3329   __Pyx_RaiseArgtupleInvalid("py2_btou", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 83, __pyx_L3_error)
3330   __pyx_L3_error:;
3331   __Pyx_AddTraceback("fastavro._six.py2_btou", __pyx_clineno, __pyx_lineno, __pyx_filename);
3332   __Pyx_RefNannyFinishContext();
3333   return NULL;
3334   __pyx_L4_argument_unpacking_done:;
3335   __pyx_r = __pyx_pf_8fastavro_4_six_28py2_btou(__pyx_self, __pyx_v_n, __pyx_v_encoding);
3336 
3337   /* function exit code */
3338   __Pyx_RefNannyFinishContext();
3339   return __pyx_r;
3340 }
3341 
__pyx_pf_8fastavro_4_six_28py2_btou(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_n,PyObject * __pyx_v_encoding)3342 static PyObject *__pyx_pf_8fastavro_4_six_28py2_btou(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_n, PyObject *__pyx_v_encoding) {
3343   PyObject *__pyx_r = NULL;
3344   __Pyx_RefNannyDeclarations
3345   PyObject *__pyx_t_1 = NULL;
3346   PyObject *__pyx_t_2 = NULL;
3347   int __pyx_lineno = 0;
3348   const char *__pyx_filename = NULL;
3349   int __pyx_clineno = 0;
3350   __Pyx_RefNannySetupContext("py2_btou", 0);
3351 
3352   /* "fastavro/_six.pyx":84
3353  *
3354  *     def py2_btou(n, encoding=_encoding):
3355  *         return unicode(n, encoding)  # noqa             # <<<<<<<<<<<<<<
3356  *
3357  *     def py2_utob(n, encoding=_encoding):
3358  */
3359   __Pyx_XDECREF(__pyx_r);
3360   __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
3361   __Pyx_GOTREF(__pyx_t_1);
3362   __Pyx_INCREF(__pyx_v_n);
3363   __Pyx_GIVEREF(__pyx_v_n);
3364   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_n);
3365   __Pyx_INCREF(__pyx_v_encoding);
3366   __Pyx_GIVEREF(__pyx_v_encoding);
3367   PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_encoding);
3368   __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error)
3369   __Pyx_GOTREF(__pyx_t_2);
3370   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3371   __pyx_r = __pyx_t_2;
3372   __pyx_t_2 = 0;
3373   goto __pyx_L0;
3374 
3375   /* "fastavro/_six.pyx":83
3376  *     xrange = xrange
3377  *
3378  *     def py2_btou(n, encoding=_encoding):             # <<<<<<<<<<<<<<
3379  *         return unicode(n, encoding)  # noqa
3380  *
3381  */
3382 
3383   /* function exit code */
3384   __pyx_L1_error:;
3385   __Pyx_XDECREF(__pyx_t_1);
3386   __Pyx_XDECREF(__pyx_t_2);
3387   __Pyx_AddTraceback("fastavro._six.py2_btou", __pyx_clineno, __pyx_lineno, __pyx_filename);
3388   __pyx_r = NULL;
3389   __pyx_L0:;
3390   __Pyx_XGIVEREF(__pyx_r);
3391   __Pyx_RefNannyFinishContext();
3392   return __pyx_r;
3393 }
3394 
3395 /* "fastavro/_six.pyx":86
3396  *         return unicode(n, encoding)  # noqa
3397  *
3398  *     def py2_utob(n, encoding=_encoding):             # <<<<<<<<<<<<<<
3399  *         return n.encode(encoding)
3400  *
3401  */
3402 
3403 /* Python wrapper */
3404 static PyObject *__pyx_pw_8fastavro_4_six_31py2_utob(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3405 static PyMethodDef __pyx_mdef_8fastavro_4_six_31py2_utob = {"py2_utob", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8fastavro_4_six_31py2_utob, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_8fastavro_4_six_31py2_utob(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)3406 static PyObject *__pyx_pw_8fastavro_4_six_31py2_utob(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3407   PyObject *__pyx_v_n = 0;
3408   PyObject *__pyx_v_encoding = 0;
3409   int __pyx_lineno = 0;
3410   const char *__pyx_filename = NULL;
3411   int __pyx_clineno = 0;
3412   PyObject *__pyx_r = 0;
3413   __Pyx_RefNannyDeclarations
3414   __Pyx_RefNannySetupContext("py2_utob (wrapper)", 0);
3415   {
3416     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_encoding,0};
3417     PyObject* values[2] = {0,0};
3418     values[1] = __pyx_k__5;
3419     if (unlikely(__pyx_kwds)) {
3420       Py_ssize_t kw_args;
3421       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3422       switch (pos_args) {
3423         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3424         CYTHON_FALLTHROUGH;
3425         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3426         CYTHON_FALLTHROUGH;
3427         case  0: break;
3428         default: goto __pyx_L5_argtuple_error;
3429       }
3430       kw_args = PyDict_Size(__pyx_kwds);
3431       switch (pos_args) {
3432         case  0:
3433         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
3434         else goto __pyx_L5_argtuple_error;
3435         CYTHON_FALLTHROUGH;
3436         case  1:
3437         if (kw_args > 0) {
3438           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_encoding);
3439           if (value) { values[1] = value; kw_args--; }
3440         }
3441       }
3442       if (unlikely(kw_args > 0)) {
3443         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "py2_utob") < 0)) __PYX_ERR(0, 86, __pyx_L3_error)
3444       }
3445     } else {
3446       switch (PyTuple_GET_SIZE(__pyx_args)) {
3447         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3448         CYTHON_FALLTHROUGH;
3449         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3450         break;
3451         default: goto __pyx_L5_argtuple_error;
3452       }
3453     }
3454     __pyx_v_n = values[0];
3455     __pyx_v_encoding = values[1];
3456   }
3457   goto __pyx_L4_argument_unpacking_done;
3458   __pyx_L5_argtuple_error:;
3459   __Pyx_RaiseArgtupleInvalid("py2_utob", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 86, __pyx_L3_error)
3460   __pyx_L3_error:;
3461   __Pyx_AddTraceback("fastavro._six.py2_utob", __pyx_clineno, __pyx_lineno, __pyx_filename);
3462   __Pyx_RefNannyFinishContext();
3463   return NULL;
3464   __pyx_L4_argument_unpacking_done:;
3465   __pyx_r = __pyx_pf_8fastavro_4_six_30py2_utob(__pyx_self, __pyx_v_n, __pyx_v_encoding);
3466 
3467   /* function exit code */
3468   __Pyx_RefNannyFinishContext();
3469   return __pyx_r;
3470 }
3471 
__pyx_pf_8fastavro_4_six_30py2_utob(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_n,PyObject * __pyx_v_encoding)3472 static PyObject *__pyx_pf_8fastavro_4_six_30py2_utob(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_n, PyObject *__pyx_v_encoding) {
3473   PyObject *__pyx_r = NULL;
3474   __Pyx_RefNannyDeclarations
3475   PyObject *__pyx_t_1 = NULL;
3476   PyObject *__pyx_t_2 = NULL;
3477   PyObject *__pyx_t_3 = NULL;
3478   int __pyx_lineno = 0;
3479   const char *__pyx_filename = NULL;
3480   int __pyx_clineno = 0;
3481   __Pyx_RefNannySetupContext("py2_utob", 0);
3482 
3483   /* "fastavro/_six.pyx":87
3484  *
3485  *     def py2_utob(n, encoding=_encoding):
3486  *         return n.encode(encoding)             # <<<<<<<<<<<<<<
3487  *
3488  *     _outenc = getattr(sys.stdout, 'encoding', None) or _encoding
3489  */
3490   __Pyx_XDECREF(__pyx_r);
3491   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_n, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error)
3492   __Pyx_GOTREF(__pyx_t_2);
3493   __pyx_t_3 = NULL;
3494   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
3495     __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
3496     if (likely(__pyx_t_3)) {
3497       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3498       __Pyx_INCREF(__pyx_t_3);
3499       __Pyx_INCREF(function);
3500       __Pyx_DECREF_SET(__pyx_t_2, function);
3501     }
3502   }
3503   __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_encoding) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_encoding);
3504   __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3505   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error)
3506   __Pyx_GOTREF(__pyx_t_1);
3507   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3508   __pyx_r = __pyx_t_1;
3509   __pyx_t_1 = 0;
3510   goto __pyx_L0;
3511 
3512   /* "fastavro/_six.pyx":86
3513  *         return unicode(n, encoding)  # noqa
3514  *
3515  *     def py2_utob(n, encoding=_encoding):             # <<<<<<<<<<<<<<
3516  *         return n.encode(encoding)
3517  *
3518  */
3519 
3520   /* function exit code */
3521   __pyx_L1_error:;
3522   __Pyx_XDECREF(__pyx_t_1);
3523   __Pyx_XDECREF(__pyx_t_2);
3524   __Pyx_XDECREF(__pyx_t_3);
3525   __Pyx_AddTraceback("fastavro._six.py2_utob", __pyx_clineno, __pyx_lineno, __pyx_filename);
3526   __pyx_r = NULL;
3527   __pyx_L0:;
3528   __Pyx_XGIVEREF(__pyx_r);
3529   __Pyx_RefNannyFinishContext();
3530   return __pyx_r;
3531 }
3532 
3533 /* "fastavro/_six.pyx":91
3534  *     _outenc = getattr(sys.stdout, 'encoding', None) or _encoding
3535  *
3536  *     def py2_json_dump(obj, **kwargs):             # <<<<<<<<<<<<<<
3537  *         json.dump(obj, sys.stdout, encoding=_outenc, **kwargs)
3538  *
3539  */
3540 
3541 /* Python wrapper */
3542 static PyObject *__pyx_pw_8fastavro_4_six_33py2_json_dump(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3543 static PyMethodDef __pyx_mdef_8fastavro_4_six_33py2_json_dump = {"py2_json_dump", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8fastavro_4_six_33py2_json_dump, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_8fastavro_4_six_33py2_json_dump(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)3544 static PyObject *__pyx_pw_8fastavro_4_six_33py2_json_dump(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3545   PyObject *__pyx_v_obj = 0;
3546   PyObject *__pyx_v_kwargs = 0;
3547   int __pyx_lineno = 0;
3548   const char *__pyx_filename = NULL;
3549   int __pyx_clineno = 0;
3550   PyObject *__pyx_r = 0;
3551   __Pyx_RefNannyDeclarations
3552   __Pyx_RefNannySetupContext("py2_json_dump (wrapper)", 0);
3553   __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
3554   __Pyx_GOTREF(__pyx_v_kwargs);
3555   {
3556     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,0};
3557     PyObject* values[1] = {0};
3558     if (unlikely(__pyx_kwds)) {
3559       Py_ssize_t kw_args;
3560       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3561       switch (pos_args) {
3562         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3563         CYTHON_FALLTHROUGH;
3564         case  0: break;
3565         default: goto __pyx_L5_argtuple_error;
3566       }
3567       kw_args = PyDict_Size(__pyx_kwds);
3568       switch (pos_args) {
3569         case  0:
3570         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
3571         else goto __pyx_L5_argtuple_error;
3572       }
3573       if (unlikely(kw_args > 0)) {
3574         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "py2_json_dump") < 0)) __PYX_ERR(0, 91, __pyx_L3_error)
3575       }
3576     } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
3577       goto __pyx_L5_argtuple_error;
3578     } else {
3579       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3580     }
3581     __pyx_v_obj = values[0];
3582   }
3583   goto __pyx_L4_argument_unpacking_done;
3584   __pyx_L5_argtuple_error:;
3585   __Pyx_RaiseArgtupleInvalid("py2_json_dump", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 91, __pyx_L3_error)
3586   __pyx_L3_error:;
3587   __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
3588   __Pyx_AddTraceback("fastavro._six.py2_json_dump", __pyx_clineno, __pyx_lineno, __pyx_filename);
3589   __Pyx_RefNannyFinishContext();
3590   return NULL;
3591   __pyx_L4_argument_unpacking_done:;
3592   __pyx_r = __pyx_pf_8fastavro_4_six_32py2_json_dump(__pyx_self, __pyx_v_obj, __pyx_v_kwargs);
3593 
3594   /* function exit code */
3595   __Pyx_XDECREF(__pyx_v_kwargs);
3596   __Pyx_RefNannyFinishContext();
3597   return __pyx_r;
3598 }
3599 
__pyx_pf_8fastavro_4_six_32py2_json_dump(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_obj,PyObject * __pyx_v_kwargs)3600 static PyObject *__pyx_pf_8fastavro_4_six_32py2_json_dump(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_kwargs) {
3601   PyObject *__pyx_r = NULL;
3602   __Pyx_RefNannyDeclarations
3603   PyObject *__pyx_t_1 = NULL;
3604   PyObject *__pyx_t_2 = NULL;
3605   PyObject *__pyx_t_3 = NULL;
3606   PyObject *__pyx_t_4 = NULL;
3607   PyObject *__pyx_t_5 = NULL;
3608   int __pyx_lineno = 0;
3609   const char *__pyx_filename = NULL;
3610   int __pyx_clineno = 0;
3611   __Pyx_RefNannySetupContext("py2_json_dump", 0);
3612 
3613   /* "fastavro/_six.pyx":92
3614  *
3615  *     def py2_json_dump(obj, **kwargs):
3616  *         json.dump(obj, sys.stdout, encoding=_outenc, **kwargs)             # <<<<<<<<<<<<<<
3617  *
3618  *     def py2_iterkeys(obj):
3619  */
3620   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_json); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error)
3621   __Pyx_GOTREF(__pyx_t_1);
3622   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dump); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error)
3623   __Pyx_GOTREF(__pyx_t_2);
3624   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3625   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error)
3626   __Pyx_GOTREF(__pyx_t_1);
3627   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stdout); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 92, __pyx_L1_error)
3628   __Pyx_GOTREF(__pyx_t_3);
3629   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3630   __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error)
3631   __Pyx_GOTREF(__pyx_t_1);
3632   __Pyx_INCREF(__pyx_v_obj);
3633   __Pyx_GIVEREF(__pyx_v_obj);
3634   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_obj);
3635   __Pyx_GIVEREF(__pyx_t_3);
3636   PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
3637   __pyx_t_3 = 0;
3638   __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 92, __pyx_L1_error)
3639   __Pyx_GOTREF(__pyx_t_4);
3640   __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_outenc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 92, __pyx_L1_error)
3641   __Pyx_GOTREF(__pyx_t_5);
3642   if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_encoding, __pyx_t_5) < 0) __PYX_ERR(0, 92, __pyx_L1_error)
3643   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3644   __pyx_t_3 = __pyx_t_4;
3645   __pyx_t_4 = 0;
3646   if (__Pyx_MergeKeywords(__pyx_t_3, __pyx_v_kwargs) < 0) __PYX_ERR(0, 92, __pyx_L1_error)
3647   __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 92, __pyx_L1_error)
3648   __Pyx_GOTREF(__pyx_t_4);
3649   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3650   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3651   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3652   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3653 
3654   /* "fastavro/_six.pyx":91
3655  *     _outenc = getattr(sys.stdout, 'encoding', None) or _encoding
3656  *
3657  *     def py2_json_dump(obj, **kwargs):             # <<<<<<<<<<<<<<
3658  *         json.dump(obj, sys.stdout, encoding=_outenc, **kwargs)
3659  *
3660  */
3661 
3662   /* function exit code */
3663   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3664   goto __pyx_L0;
3665   __pyx_L1_error:;
3666   __Pyx_XDECREF(__pyx_t_1);
3667   __Pyx_XDECREF(__pyx_t_2);
3668   __Pyx_XDECREF(__pyx_t_3);
3669   __Pyx_XDECREF(__pyx_t_4);
3670   __Pyx_XDECREF(__pyx_t_5);
3671   __Pyx_AddTraceback("fastavro._six.py2_json_dump", __pyx_clineno, __pyx_lineno, __pyx_filename);
3672   __pyx_r = NULL;
3673   __pyx_L0:;
3674   __Pyx_XGIVEREF(__pyx_r);
3675   __Pyx_RefNannyFinishContext();
3676   return __pyx_r;
3677 }
3678 
3679 /* "fastavro/_six.pyx":94
3680  *         json.dump(obj, sys.stdout, encoding=_outenc, **kwargs)
3681  *
3682  *     def py2_iterkeys(obj):             # <<<<<<<<<<<<<<
3683  *         return obj.iterkeys()
3684  *
3685  */
3686 
3687 /* Python wrapper */
3688 static PyObject *__pyx_pw_8fastavro_4_six_35py2_iterkeys(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/
3689 static PyMethodDef __pyx_mdef_8fastavro_4_six_35py2_iterkeys = {"py2_iterkeys", (PyCFunction)__pyx_pw_8fastavro_4_six_35py2_iterkeys, METH_O, 0};
__pyx_pw_8fastavro_4_six_35py2_iterkeys(PyObject * __pyx_self,PyObject * __pyx_v_obj)3690 static PyObject *__pyx_pw_8fastavro_4_six_35py2_iterkeys(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
3691   PyObject *__pyx_r = 0;
3692   __Pyx_RefNannyDeclarations
3693   __Pyx_RefNannySetupContext("py2_iterkeys (wrapper)", 0);
3694   __pyx_r = __pyx_pf_8fastavro_4_six_34py2_iterkeys(__pyx_self, ((PyObject *)__pyx_v_obj));
3695 
3696   /* function exit code */
3697   __Pyx_RefNannyFinishContext();
3698   return __pyx_r;
3699 }
3700 
__pyx_pf_8fastavro_4_six_34py2_iterkeys(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_obj)3701 static PyObject *__pyx_pf_8fastavro_4_six_34py2_iterkeys(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
3702   PyObject *__pyx_r = NULL;
3703   __Pyx_RefNannyDeclarations
3704   PyObject *__pyx_t_1 = NULL;
3705   PyObject *__pyx_t_2 = NULL;
3706   PyObject *__pyx_t_3 = NULL;
3707   int __pyx_lineno = 0;
3708   const char *__pyx_filename = NULL;
3709   int __pyx_clineno = 0;
3710   __Pyx_RefNannySetupContext("py2_iterkeys", 0);
3711 
3712   /* "fastavro/_six.pyx":95
3713  *
3714  *     def py2_iterkeys(obj):
3715  *         return obj.iterkeys()             # <<<<<<<<<<<<<<
3716  *
3717  *     def py2_itervalues(obj):
3718  */
3719   __Pyx_XDECREF(__pyx_r);
3720   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_iterkeys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L1_error)
3721   __Pyx_GOTREF(__pyx_t_2);
3722   __pyx_t_3 = NULL;
3723   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
3724     __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
3725     if (likely(__pyx_t_3)) {
3726       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3727       __Pyx_INCREF(__pyx_t_3);
3728       __Pyx_INCREF(function);
3729       __Pyx_DECREF_SET(__pyx_t_2, function);
3730     }
3731   }
3732   __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
3733   __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3734   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error)
3735   __Pyx_GOTREF(__pyx_t_1);
3736   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3737   __pyx_r = __pyx_t_1;
3738   __pyx_t_1 = 0;
3739   goto __pyx_L0;
3740 
3741   /* "fastavro/_six.pyx":94
3742  *         json.dump(obj, sys.stdout, encoding=_outenc, **kwargs)
3743  *
3744  *     def py2_iterkeys(obj):             # <<<<<<<<<<<<<<
3745  *         return obj.iterkeys()
3746  *
3747  */
3748 
3749   /* function exit code */
3750   __pyx_L1_error:;
3751   __Pyx_XDECREF(__pyx_t_1);
3752   __Pyx_XDECREF(__pyx_t_2);
3753   __Pyx_XDECREF(__pyx_t_3);
3754   __Pyx_AddTraceback("fastavro._six.py2_iterkeys", __pyx_clineno, __pyx_lineno, __pyx_filename);
3755   __pyx_r = NULL;
3756   __pyx_L0:;
3757   __Pyx_XGIVEREF(__pyx_r);
3758   __Pyx_RefNannyFinishContext();
3759   return __pyx_r;
3760 }
3761 
3762 /* "fastavro/_six.pyx":97
3763  *         return obj.iterkeys()
3764  *
3765  *     def py2_itervalues(obj):             # <<<<<<<<<<<<<<
3766  *         return obj.itervalues()
3767  *
3768  */
3769 
3770 /* Python wrapper */
3771 static PyObject *__pyx_pw_8fastavro_4_six_37py2_itervalues(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/
3772 static PyMethodDef __pyx_mdef_8fastavro_4_six_37py2_itervalues = {"py2_itervalues", (PyCFunction)__pyx_pw_8fastavro_4_six_37py2_itervalues, METH_O, 0};
__pyx_pw_8fastavro_4_six_37py2_itervalues(PyObject * __pyx_self,PyObject * __pyx_v_obj)3773 static PyObject *__pyx_pw_8fastavro_4_six_37py2_itervalues(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
3774   PyObject *__pyx_r = 0;
3775   __Pyx_RefNannyDeclarations
3776   __Pyx_RefNannySetupContext("py2_itervalues (wrapper)", 0);
3777   __pyx_r = __pyx_pf_8fastavro_4_six_36py2_itervalues(__pyx_self, ((PyObject *)__pyx_v_obj));
3778 
3779   /* function exit code */
3780   __Pyx_RefNannyFinishContext();
3781   return __pyx_r;
3782 }
3783 
__pyx_pf_8fastavro_4_six_36py2_itervalues(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_obj)3784 static PyObject *__pyx_pf_8fastavro_4_six_36py2_itervalues(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
3785   PyObject *__pyx_r = NULL;
3786   __Pyx_RefNannyDeclarations
3787   PyObject *__pyx_t_1 = NULL;
3788   PyObject *__pyx_t_2 = NULL;
3789   PyObject *__pyx_t_3 = NULL;
3790   int __pyx_lineno = 0;
3791   const char *__pyx_filename = NULL;
3792   int __pyx_clineno = 0;
3793   __Pyx_RefNannySetupContext("py2_itervalues", 0);
3794 
3795   /* "fastavro/_six.pyx":98
3796  *
3797  *     def py2_itervalues(obj):
3798  *         return obj.itervalues()             # <<<<<<<<<<<<<<
3799  *
3800  *     def py2_iteritems(obj):
3801  */
3802   __Pyx_XDECREF(__pyx_r);
3803   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_itervalues); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error)
3804   __Pyx_GOTREF(__pyx_t_2);
3805   __pyx_t_3 = NULL;
3806   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
3807     __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
3808     if (likely(__pyx_t_3)) {
3809       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3810       __Pyx_INCREF(__pyx_t_3);
3811       __Pyx_INCREF(function);
3812       __Pyx_DECREF_SET(__pyx_t_2, function);
3813     }
3814   }
3815   __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
3816   __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3817   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error)
3818   __Pyx_GOTREF(__pyx_t_1);
3819   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3820   __pyx_r = __pyx_t_1;
3821   __pyx_t_1 = 0;
3822   goto __pyx_L0;
3823 
3824   /* "fastavro/_six.pyx":97
3825  *         return obj.iterkeys()
3826  *
3827  *     def py2_itervalues(obj):             # <<<<<<<<<<<<<<
3828  *         return obj.itervalues()
3829  *
3830  */
3831 
3832   /* function exit code */
3833   __pyx_L1_error:;
3834   __Pyx_XDECREF(__pyx_t_1);
3835   __Pyx_XDECREF(__pyx_t_2);
3836   __Pyx_XDECREF(__pyx_t_3);
3837   __Pyx_AddTraceback("fastavro._six.py2_itervalues", __pyx_clineno, __pyx_lineno, __pyx_filename);
3838   __pyx_r = NULL;
3839   __pyx_L0:;
3840   __Pyx_XGIVEREF(__pyx_r);
3841   __Pyx_RefNannyFinishContext();
3842   return __pyx_r;
3843 }
3844 
3845 /* "fastavro/_six.pyx":100
3846  *         return obj.itervalues()
3847  *
3848  *     def py2_iteritems(obj):             # <<<<<<<<<<<<<<
3849  *         return obj.iteritems()
3850  *
3851  */
3852 
3853 /* Python wrapper */
3854 static PyObject *__pyx_pw_8fastavro_4_six_39py2_iteritems(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/
3855 static PyMethodDef __pyx_mdef_8fastavro_4_six_39py2_iteritems = {"py2_iteritems", (PyCFunction)__pyx_pw_8fastavro_4_six_39py2_iteritems, METH_O, 0};
__pyx_pw_8fastavro_4_six_39py2_iteritems(PyObject * __pyx_self,PyObject * __pyx_v_obj)3856 static PyObject *__pyx_pw_8fastavro_4_six_39py2_iteritems(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
3857   PyObject *__pyx_r = 0;
3858   __Pyx_RefNannyDeclarations
3859   __Pyx_RefNannySetupContext("py2_iteritems (wrapper)", 0);
3860   __pyx_r = __pyx_pf_8fastavro_4_six_38py2_iteritems(__pyx_self, ((PyObject *)__pyx_v_obj));
3861 
3862   /* function exit code */
3863   __Pyx_RefNannyFinishContext();
3864   return __pyx_r;
3865 }
3866 
__pyx_pf_8fastavro_4_six_38py2_iteritems(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_obj)3867 static PyObject *__pyx_pf_8fastavro_4_six_38py2_iteritems(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
3868   PyObject *__pyx_r = NULL;
3869   __Pyx_RefNannyDeclarations
3870   PyObject *__pyx_t_1 = NULL;
3871   PyObject *__pyx_t_2 = NULL;
3872   PyObject *__pyx_t_3 = NULL;
3873   int __pyx_lineno = 0;
3874   const char *__pyx_filename = NULL;
3875   int __pyx_clineno = 0;
3876   __Pyx_RefNannySetupContext("py2_iteritems", 0);
3877 
3878   /* "fastavro/_six.pyx":101
3879  *
3880  *     def py2_iteritems(obj):
3881  *         return obj.iteritems()             # <<<<<<<<<<<<<<
3882  *
3883  *     def py2_is_str(obj):
3884  */
3885   __Pyx_XDECREF(__pyx_r);
3886   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_iteritems); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error)
3887   __Pyx_GOTREF(__pyx_t_2);
3888   __pyx_t_3 = NULL;
3889   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
3890     __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
3891     if (likely(__pyx_t_3)) {
3892       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3893       __Pyx_INCREF(__pyx_t_3);
3894       __Pyx_INCREF(function);
3895       __Pyx_DECREF_SET(__pyx_t_2, function);
3896     }
3897   }
3898   __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
3899   __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3900   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 101, __pyx_L1_error)
3901   __Pyx_GOTREF(__pyx_t_1);
3902   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3903   __pyx_r = __pyx_t_1;
3904   __pyx_t_1 = 0;
3905   goto __pyx_L0;
3906 
3907   /* "fastavro/_six.pyx":100
3908  *         return obj.itervalues()
3909  *
3910  *     def py2_iteritems(obj):             # <<<<<<<<<<<<<<
3911  *         return obj.iteritems()
3912  *
3913  */
3914 
3915   /* function exit code */
3916   __pyx_L1_error:;
3917   __Pyx_XDECREF(__pyx_t_1);
3918   __Pyx_XDECREF(__pyx_t_2);
3919   __Pyx_XDECREF(__pyx_t_3);
3920   __Pyx_AddTraceback("fastavro._six.py2_iteritems", __pyx_clineno, __pyx_lineno, __pyx_filename);
3921   __pyx_r = NULL;
3922   __pyx_L0:;
3923   __Pyx_XGIVEREF(__pyx_r);
3924   __Pyx_RefNannyFinishContext();
3925   return __pyx_r;
3926 }
3927 
3928 /* "fastavro/_six.pyx":103
3929  *         return obj.iteritems()
3930  *
3931  *     def py2_is_str(obj):             # <<<<<<<<<<<<<<
3932  *         return isinstance(obj, basestring)  # noqa
3933  *
3934  */
3935 
3936 /* Python wrapper */
3937 static PyObject *__pyx_pw_8fastavro_4_six_41py2_is_str(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/
3938 static PyMethodDef __pyx_mdef_8fastavro_4_six_41py2_is_str = {"py2_is_str", (PyCFunction)__pyx_pw_8fastavro_4_six_41py2_is_str, METH_O, 0};
__pyx_pw_8fastavro_4_six_41py2_is_str(PyObject * __pyx_self,PyObject * __pyx_v_obj)3939 static PyObject *__pyx_pw_8fastavro_4_six_41py2_is_str(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
3940   PyObject *__pyx_r = 0;
3941   __Pyx_RefNannyDeclarations
3942   __Pyx_RefNannySetupContext("py2_is_str (wrapper)", 0);
3943   __pyx_r = __pyx_pf_8fastavro_4_six_40py2_is_str(__pyx_self, ((PyObject *)__pyx_v_obj));
3944 
3945   /* function exit code */
3946   __Pyx_RefNannyFinishContext();
3947   return __pyx_r;
3948 }
3949 
__pyx_pf_8fastavro_4_six_40py2_is_str(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_obj)3950 static PyObject *__pyx_pf_8fastavro_4_six_40py2_is_str(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
3951   PyObject *__pyx_r = NULL;
3952   __Pyx_RefNannyDeclarations
3953   int __pyx_t_1;
3954   PyObject *__pyx_t_2 = NULL;
3955   int __pyx_lineno = 0;
3956   const char *__pyx_filename = NULL;
3957   int __pyx_clineno = 0;
3958   __Pyx_RefNannySetupContext("py2_is_str", 0);
3959 
3960   /* "fastavro/_six.pyx":104
3961  *
3962  *     def py2_is_str(obj):
3963  *         return isinstance(obj, basestring)  # noqa             # <<<<<<<<<<<<<<
3964  *
3965  *     def py2_mk_bits(bits):
3966  */
3967   __Pyx_XDECREF(__pyx_r);
3968   __pyx_t_1 = __Pyx_PyBaseString_Check(__pyx_v_obj);
3969   __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error)
3970   __Pyx_GOTREF(__pyx_t_2);
3971   __pyx_r = __pyx_t_2;
3972   __pyx_t_2 = 0;
3973   goto __pyx_L0;
3974 
3975   /* "fastavro/_six.pyx":103
3976  *         return obj.iteritems()
3977  *
3978  *     def py2_is_str(obj):             # <<<<<<<<<<<<<<
3979  *         return isinstance(obj, basestring)  # noqa
3980  *
3981  */
3982 
3983   /* function exit code */
3984   __pyx_L1_error:;
3985   __Pyx_XDECREF(__pyx_t_2);
3986   __Pyx_AddTraceback("fastavro._six.py2_is_str", __pyx_clineno, __pyx_lineno, __pyx_filename);
3987   __pyx_r = NULL;
3988   __pyx_L0:;
3989   __Pyx_XGIVEREF(__pyx_r);
3990   __Pyx_RefNannyFinishContext();
3991   return __pyx_r;
3992 }
3993 
3994 /* "fastavro/_six.pyx":106
3995  *         return isinstance(obj, basestring)  # noqa
3996  *
3997  *     def py2_mk_bits(bits):             # <<<<<<<<<<<<<<
3998  *         return chr(bits & 0xff)
3999  *
4000  */
4001 
4002 /* Python wrapper */
4003 static PyObject *__pyx_pw_8fastavro_4_six_43py2_mk_bits(PyObject *__pyx_self, PyObject *__pyx_v_bits); /*proto*/
4004 static PyMethodDef __pyx_mdef_8fastavro_4_six_43py2_mk_bits = {"py2_mk_bits", (PyCFunction)__pyx_pw_8fastavro_4_six_43py2_mk_bits, METH_O, 0};
__pyx_pw_8fastavro_4_six_43py2_mk_bits(PyObject * __pyx_self,PyObject * __pyx_v_bits)4005 static PyObject *__pyx_pw_8fastavro_4_six_43py2_mk_bits(PyObject *__pyx_self, PyObject *__pyx_v_bits) {
4006   PyObject *__pyx_r = 0;
4007   __Pyx_RefNannyDeclarations
4008   __Pyx_RefNannySetupContext("py2_mk_bits (wrapper)", 0);
4009   __pyx_r = __pyx_pf_8fastavro_4_six_42py2_mk_bits(__pyx_self, ((PyObject *)__pyx_v_bits));
4010 
4011   /* function exit code */
4012   __Pyx_RefNannyFinishContext();
4013   return __pyx_r;
4014 }
4015 
__pyx_pf_8fastavro_4_six_42py2_mk_bits(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_bits)4016 static PyObject *__pyx_pf_8fastavro_4_six_42py2_mk_bits(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_bits) {
4017   PyObject *__pyx_r = NULL;
4018   __Pyx_RefNannyDeclarations
4019   PyObject *__pyx_t_1 = NULL;
4020   PyObject *__pyx_t_2 = NULL;
4021   int __pyx_lineno = 0;
4022   const char *__pyx_filename = NULL;
4023   int __pyx_clineno = 0;
4024   __Pyx_RefNannySetupContext("py2_mk_bits", 0);
4025 
4026   /* "fastavro/_six.pyx":107
4027  *
4028  *     def py2_mk_bits(bits):
4029  *         return chr(bits & 0xff)             # <<<<<<<<<<<<<<
4030  *
4031  *     def py2_str2ints(datum):
4032  */
4033   __Pyx_XDECREF(__pyx_r);
4034   __pyx_t_1 = __Pyx_PyInt_AndObjC(__pyx_v_bits, __pyx_int_255, 0xff, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error)
4035   __Pyx_GOTREF(__pyx_t_1);
4036   __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error)
4037   __Pyx_GOTREF(__pyx_t_2);
4038   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4039   __pyx_r = __pyx_t_2;
4040   __pyx_t_2 = 0;
4041   goto __pyx_L0;
4042 
4043   /* "fastavro/_six.pyx":106
4044  *         return isinstance(obj, basestring)  # noqa
4045  *
4046  *     def py2_mk_bits(bits):             # <<<<<<<<<<<<<<
4047  *         return chr(bits & 0xff)
4048  *
4049  */
4050 
4051   /* function exit code */
4052   __pyx_L1_error:;
4053   __Pyx_XDECREF(__pyx_t_1);
4054   __Pyx_XDECREF(__pyx_t_2);
4055   __Pyx_AddTraceback("fastavro._six.py2_mk_bits", __pyx_clineno, __pyx_lineno, __pyx_filename);
4056   __pyx_r = NULL;
4057   __pyx_L0:;
4058   __Pyx_XGIVEREF(__pyx_r);
4059   __Pyx_RefNannyFinishContext();
4060   return __pyx_r;
4061 }
4062 
4063 /* "fastavro/_six.pyx":109
4064  *         return chr(bits & 0xff)
4065  *
4066  *     def py2_str2ints(datum):             # <<<<<<<<<<<<<<
4067  *         return map(lambda x: ord(x), datum)
4068  *
4069  */
4070 
4071 /* Python wrapper */
4072 static PyObject *__pyx_pw_8fastavro_4_six_45py2_str2ints(PyObject *__pyx_self, PyObject *__pyx_v_datum); /*proto*/
4073 static PyMethodDef __pyx_mdef_8fastavro_4_six_45py2_str2ints = {"py2_str2ints", (PyCFunction)__pyx_pw_8fastavro_4_six_45py2_str2ints, METH_O, 0};
__pyx_pw_8fastavro_4_six_45py2_str2ints(PyObject * __pyx_self,PyObject * __pyx_v_datum)4074 static PyObject *__pyx_pw_8fastavro_4_six_45py2_str2ints(PyObject *__pyx_self, PyObject *__pyx_v_datum) {
4075   PyObject *__pyx_r = 0;
4076   __Pyx_RefNannyDeclarations
4077   __Pyx_RefNannySetupContext("py2_str2ints (wrapper)", 0);
4078   __pyx_r = __pyx_pf_8fastavro_4_six_44py2_str2ints(__pyx_self, ((PyObject *)__pyx_v_datum));
4079 
4080   /* function exit code */
4081   __Pyx_RefNannyFinishContext();
4082   return __pyx_r;
4083 }
4084 
4085 /* "fastavro/_six.pyx":110
4086  *
4087  *     def py2_str2ints(datum):
4088  *         return map(lambda x: ord(x), datum)             # <<<<<<<<<<<<<<
4089  *
4090  *     def py2_fstint(datum):
4091  */
4092 
4093 /* Python wrapper */
4094 static PyObject *__pyx_pw_8fastavro_4_six_12py2_str2ints_lambda(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
4095 static PyMethodDef __pyx_mdef_8fastavro_4_six_12py2_str2ints_lambda = {"lambda", (PyCFunction)__pyx_pw_8fastavro_4_six_12py2_str2ints_lambda, METH_O, 0};
__pyx_pw_8fastavro_4_six_12py2_str2ints_lambda(PyObject * __pyx_self,PyObject * __pyx_v_x)4096 static PyObject *__pyx_pw_8fastavro_4_six_12py2_str2ints_lambda(PyObject *__pyx_self, PyObject *__pyx_v_x) {
4097   PyObject *__pyx_r = 0;
4098   __Pyx_RefNannyDeclarations
4099   __Pyx_RefNannySetupContext("lambda (wrapper)", 0);
4100   __pyx_r = __pyx_lambda_funcdef_lambda(__pyx_self, ((PyObject *)__pyx_v_x));
4101 
4102   /* function exit code */
4103   __Pyx_RefNannyFinishContext();
4104   return __pyx_r;
4105 }
4106 
__pyx_lambda_funcdef_lambda(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_x)4107 static PyObject *__pyx_lambda_funcdef_lambda(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) {
4108   PyObject *__pyx_r = NULL;
4109   __Pyx_RefNannyDeclarations
4110   long __pyx_t_1;
4111   PyObject *__pyx_t_2 = NULL;
4112   int __pyx_lineno = 0;
4113   const char *__pyx_filename = NULL;
4114   int __pyx_clineno = 0;
4115   __Pyx_RefNannySetupContext("lambda", 0);
4116   __Pyx_XDECREF(__pyx_r);
4117   __pyx_t_1 = __Pyx_PyObject_Ord(__pyx_v_x); if (unlikely(__pyx_t_1 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 110, __pyx_L1_error)
4118   __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error)
4119   __Pyx_GOTREF(__pyx_t_2);
4120   __pyx_r = __pyx_t_2;
4121   __pyx_t_2 = 0;
4122   goto __pyx_L0;
4123 
4124   /* function exit code */
4125   __pyx_L1_error:;
4126   __Pyx_XDECREF(__pyx_t_2);
4127   __Pyx_AddTraceback("fastavro._six.py2_str2ints.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename);
4128   __pyx_r = NULL;
4129   __pyx_L0:;
4130   __Pyx_XGIVEREF(__pyx_r);
4131   __Pyx_RefNannyFinishContext();
4132   return __pyx_r;
4133 }
4134 
4135 /* "fastavro/_six.pyx":109
4136  *         return chr(bits & 0xff)
4137  *
4138  *     def py2_str2ints(datum):             # <<<<<<<<<<<<<<
4139  *         return map(lambda x: ord(x), datum)
4140  *
4141  */
4142 
__pyx_pf_8fastavro_4_six_44py2_str2ints(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_datum)4143 static PyObject *__pyx_pf_8fastavro_4_six_44py2_str2ints(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_datum) {
4144   PyObject *__pyx_r = NULL;
4145   __Pyx_RefNannyDeclarations
4146   PyObject *__pyx_t_1 = NULL;
4147   PyObject *__pyx_t_2 = NULL;
4148   int __pyx_lineno = 0;
4149   const char *__pyx_filename = NULL;
4150   int __pyx_clineno = 0;
4151   __Pyx_RefNannySetupContext("py2_str2ints", 0);
4152 
4153   /* "fastavro/_six.pyx":110
4154  *
4155  *     def py2_str2ints(datum):
4156  *         return map(lambda x: ord(x), datum)             # <<<<<<<<<<<<<<
4157  *
4158  *     def py2_fstint(datum):
4159  */
4160   __Pyx_XDECREF(__pyx_r);
4161   __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_8fastavro_4_six_12py2_str2ints_lambda, 0, __pyx_n_s_py2_str2ints_locals_lambda, NULL, __pyx_n_s_fastavro__six, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error)
4162   __Pyx_GOTREF(__pyx_t_1);
4163   __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error)
4164   __Pyx_GOTREF(__pyx_t_2);
4165   __Pyx_GIVEREF(__pyx_t_1);
4166   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
4167   __Pyx_INCREF(__pyx_v_datum);
4168   __Pyx_GIVEREF(__pyx_v_datum);
4169   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_datum);
4170   __pyx_t_1 = 0;
4171   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error)
4172   __Pyx_GOTREF(__pyx_t_1);
4173   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4174   __pyx_r = __pyx_t_1;
4175   __pyx_t_1 = 0;
4176   goto __pyx_L0;
4177 
4178   /* "fastavro/_six.pyx":109
4179  *         return chr(bits & 0xff)
4180  *
4181  *     def py2_str2ints(datum):             # <<<<<<<<<<<<<<
4182  *         return map(lambda x: ord(x), datum)
4183  *
4184  */
4185 
4186   /* function exit code */
4187   __pyx_L1_error:;
4188   __Pyx_XDECREF(__pyx_t_1);
4189   __Pyx_XDECREF(__pyx_t_2);
4190   __Pyx_AddTraceback("fastavro._six.py2_str2ints", __pyx_clineno, __pyx_lineno, __pyx_filename);
4191   __pyx_r = NULL;
4192   __pyx_L0:;
4193   __Pyx_XGIVEREF(__pyx_r);
4194   __Pyx_RefNannyFinishContext();
4195   return __pyx_r;
4196 }
4197 
4198 /* "fastavro/_six.pyx":112
4199  *         return map(lambda x: ord(x), datum)
4200  *
4201  *     def py2_fstint(datum):             # <<<<<<<<<<<<<<
4202  *         return unpack('!b', datum[0])[0]
4203  *
4204  */
4205 
4206 /* Python wrapper */
4207 static PyObject *__pyx_pw_8fastavro_4_six_47py2_fstint(PyObject *__pyx_self, PyObject *__pyx_v_datum); /*proto*/
4208 static PyMethodDef __pyx_mdef_8fastavro_4_six_47py2_fstint = {"py2_fstint", (PyCFunction)__pyx_pw_8fastavro_4_six_47py2_fstint, METH_O, 0};
__pyx_pw_8fastavro_4_six_47py2_fstint(PyObject * __pyx_self,PyObject * __pyx_v_datum)4209 static PyObject *__pyx_pw_8fastavro_4_six_47py2_fstint(PyObject *__pyx_self, PyObject *__pyx_v_datum) {
4210   PyObject *__pyx_r = 0;
4211   __Pyx_RefNannyDeclarations
4212   __Pyx_RefNannySetupContext("py2_fstint (wrapper)", 0);
4213   __pyx_r = __pyx_pf_8fastavro_4_six_46py2_fstint(__pyx_self, ((PyObject *)__pyx_v_datum));
4214 
4215   /* function exit code */
4216   __Pyx_RefNannyFinishContext();
4217   return __pyx_r;
4218 }
4219 
__pyx_pf_8fastavro_4_six_46py2_fstint(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_datum)4220 static PyObject *__pyx_pf_8fastavro_4_six_46py2_fstint(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_datum) {
4221   PyObject *__pyx_r = NULL;
4222   __Pyx_RefNannyDeclarations
4223   PyObject *__pyx_t_1 = NULL;
4224   PyObject *__pyx_t_2 = NULL;
4225   PyObject *__pyx_t_3 = NULL;
4226   PyObject *__pyx_t_4 = NULL;
4227   int __pyx_t_5;
4228   PyObject *__pyx_t_6 = NULL;
4229   int __pyx_lineno = 0;
4230   const char *__pyx_filename = NULL;
4231   int __pyx_clineno = 0;
4232   __Pyx_RefNannySetupContext("py2_fstint", 0);
4233 
4234   /* "fastavro/_six.pyx":113
4235  *
4236  *     def py2_fstint(datum):
4237  *         return unpack('!b', datum[0])[0]             # <<<<<<<<<<<<<<
4238  *
4239  *     def _readable(file_like):
4240  */
4241   __Pyx_XDECREF(__pyx_r);
4242   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_unpack); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
4243   __Pyx_GOTREF(__pyx_t_2);
4244   __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_datum, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error)
4245   __Pyx_GOTREF(__pyx_t_3);
4246   __pyx_t_4 = NULL;
4247   __pyx_t_5 = 0;
4248   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
4249     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
4250     if (likely(__pyx_t_4)) {
4251       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
4252       __Pyx_INCREF(__pyx_t_4);
4253       __Pyx_INCREF(function);
4254       __Pyx_DECREF_SET(__pyx_t_2, function);
4255       __pyx_t_5 = 1;
4256     }
4257   }
4258   #if CYTHON_FAST_PYCALL
4259   if (PyFunction_Check(__pyx_t_2)) {
4260     PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_kp_s_b, __pyx_t_3};
4261     __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error)
4262     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4263     __Pyx_GOTREF(__pyx_t_1);
4264     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4265   } else
4266   #endif
4267   #if CYTHON_FAST_PYCCALL
4268   if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
4269     PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_kp_s_b, __pyx_t_3};
4270     __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error)
4271     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4272     __Pyx_GOTREF(__pyx_t_1);
4273     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4274   } else
4275   #endif
4276   {
4277     __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 113, __pyx_L1_error)
4278     __Pyx_GOTREF(__pyx_t_6);
4279     if (__pyx_t_4) {
4280       __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
4281     }
4282     __Pyx_INCREF(__pyx_kp_s_b);
4283     __Pyx_GIVEREF(__pyx_kp_s_b);
4284     PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_kp_s_b);
4285     __Pyx_GIVEREF(__pyx_t_3);
4286     PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_3);
4287     __pyx_t_3 = 0;
4288     __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error)
4289     __Pyx_GOTREF(__pyx_t_1);
4290     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4291   }
4292   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4293   __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
4294   __Pyx_GOTREF(__pyx_t_2);
4295   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4296   __pyx_r = __pyx_t_2;
4297   __pyx_t_2 = 0;
4298   goto __pyx_L0;
4299 
4300   /* "fastavro/_six.pyx":112
4301  *         return map(lambda x: ord(x), datum)
4302  *
4303  *     def py2_fstint(datum):             # <<<<<<<<<<<<<<
4304  *         return unpack('!b', datum[0])[0]
4305  *
4306  */
4307 
4308   /* function exit code */
4309   __pyx_L1_error:;
4310   __Pyx_XDECREF(__pyx_t_1);
4311   __Pyx_XDECREF(__pyx_t_2);
4312   __Pyx_XDECREF(__pyx_t_3);
4313   __Pyx_XDECREF(__pyx_t_4);
4314   __Pyx_XDECREF(__pyx_t_6);
4315   __Pyx_AddTraceback("fastavro._six.py2_fstint", __pyx_clineno, __pyx_lineno, __pyx_filename);
4316   __pyx_r = NULL;
4317   __pyx_L0:;
4318   __Pyx_XGIVEREF(__pyx_r);
4319   __Pyx_RefNannyFinishContext();
4320   return __pyx_r;
4321 }
4322 
4323 /* "fastavro/_six.pyx":115
4324  *         return unpack('!b', datum[0])[0]
4325  *
4326  *     def _readable(file_like):             # <<<<<<<<<<<<<<
4327  *         try:
4328  *             file_like.read()
4329  */
4330 
4331 /* Python wrapper */
4332 static PyObject *__pyx_pw_8fastavro_4_six_49_readable(PyObject *__pyx_self, PyObject *__pyx_v_file_like); /*proto*/
4333 static PyMethodDef __pyx_mdef_8fastavro_4_six_49_readable = {"_readable", (PyCFunction)__pyx_pw_8fastavro_4_six_49_readable, METH_O, 0};
__pyx_pw_8fastavro_4_six_49_readable(PyObject * __pyx_self,PyObject * __pyx_v_file_like)4334 static PyObject *__pyx_pw_8fastavro_4_six_49_readable(PyObject *__pyx_self, PyObject *__pyx_v_file_like) {
4335   PyObject *__pyx_r = 0;
4336   __Pyx_RefNannyDeclarations
4337   __Pyx_RefNannySetupContext("_readable (wrapper)", 0);
4338   __pyx_r = __pyx_pf_8fastavro_4_six_48_readable(__pyx_self, ((PyObject *)__pyx_v_file_like));
4339 
4340   /* function exit code */
4341   __Pyx_RefNannyFinishContext();
4342   return __pyx_r;
4343 }
4344 
__pyx_pf_8fastavro_4_six_48_readable(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_file_like)4345 static PyObject *__pyx_pf_8fastavro_4_six_48_readable(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_like) {
4346   PyObject *__pyx_r = NULL;
4347   __Pyx_RefNannyDeclarations
4348   PyObject *__pyx_t_1 = NULL;
4349   PyObject *__pyx_t_2 = NULL;
4350   PyObject *__pyx_t_3 = NULL;
4351   PyObject *__pyx_t_4 = NULL;
4352   PyObject *__pyx_t_5 = NULL;
4353   PyObject *__pyx_t_6 = NULL;
4354   int __pyx_t_7;
4355   int __pyx_lineno = 0;
4356   const char *__pyx_filename = NULL;
4357   int __pyx_clineno = 0;
4358   __Pyx_RefNannySetupContext("_readable", 0);
4359 
4360   /* "fastavro/_six.pyx":116
4361  *
4362  *     def _readable(file_like):
4363  *         try:             # <<<<<<<<<<<<<<
4364  *             file_like.read()
4365  *         except Exception:
4366  */
4367   {
4368     __Pyx_PyThreadState_declare
4369     __Pyx_PyThreadState_assign
4370     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
4371     __Pyx_XGOTREF(__pyx_t_1);
4372     __Pyx_XGOTREF(__pyx_t_2);
4373     __Pyx_XGOTREF(__pyx_t_3);
4374     /*try:*/ {
4375 
4376       /* "fastavro/_six.pyx":117
4377  *     def _readable(file_like):
4378  *         try:
4379  *             file_like.read()             # <<<<<<<<<<<<<<
4380  *         except Exception:
4381  *             return False
4382  */
4383       __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_file_like, __pyx_n_s_read); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 117, __pyx_L3_error)
4384       __Pyx_GOTREF(__pyx_t_5);
4385       __pyx_t_6 = NULL;
4386       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
4387         __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
4388         if (likely(__pyx_t_6)) {
4389           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
4390           __Pyx_INCREF(__pyx_t_6);
4391           __Pyx_INCREF(function);
4392           __Pyx_DECREF_SET(__pyx_t_5, function);
4393         }
4394       }
4395       __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
4396       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
4397       if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 117, __pyx_L3_error)
4398       __Pyx_GOTREF(__pyx_t_4);
4399       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4400       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4401 
4402       /* "fastavro/_six.pyx":116
4403  *
4404  *     def _readable(file_like):
4405  *         try:             # <<<<<<<<<<<<<<
4406  *             file_like.read()
4407  *         except Exception:
4408  */
4409     }
4410     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
4411     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4412     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4413     goto __pyx_L8_try_end;
4414     __pyx_L3_error:;
4415     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4416     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4417     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
4418 
4419     /* "fastavro/_six.pyx":118
4420  *         try:
4421  *             file_like.read()
4422  *         except Exception:             # <<<<<<<<<<<<<<
4423  *             return False
4424  *         return True
4425  */
4426     __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
4427     if (__pyx_t_7) {
4428       __Pyx_AddTraceback("fastavro._six._readable", __pyx_clineno, __pyx_lineno, __pyx_filename);
4429       if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(0, 118, __pyx_L5_except_error)
4430       __Pyx_GOTREF(__pyx_t_4);
4431       __Pyx_GOTREF(__pyx_t_5);
4432       __Pyx_GOTREF(__pyx_t_6);
4433 
4434       /* "fastavro/_six.pyx":119
4435  *             file_like.read()
4436  *         except Exception:
4437  *             return False             # <<<<<<<<<<<<<<
4438  *         return True
4439  *
4440  */
4441       __Pyx_XDECREF(__pyx_r);
4442       __Pyx_INCREF(Py_False);
4443       __pyx_r = Py_False;
4444       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4445       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4446       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4447       goto __pyx_L6_except_return;
4448     }
4449     goto __pyx_L5_except_error;
4450     __pyx_L5_except_error:;
4451 
4452     /* "fastavro/_six.pyx":116
4453  *
4454  *     def _readable(file_like):
4455  *         try:             # <<<<<<<<<<<<<<
4456  *             file_like.read()
4457  *         except Exception:
4458  */
4459     __Pyx_XGIVEREF(__pyx_t_1);
4460     __Pyx_XGIVEREF(__pyx_t_2);
4461     __Pyx_XGIVEREF(__pyx_t_3);
4462     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
4463     goto __pyx_L1_error;
4464     __pyx_L6_except_return:;
4465     __Pyx_XGIVEREF(__pyx_t_1);
4466     __Pyx_XGIVEREF(__pyx_t_2);
4467     __Pyx_XGIVEREF(__pyx_t_3);
4468     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
4469     goto __pyx_L0;
4470     __pyx_L8_try_end:;
4471   }
4472 
4473   /* "fastavro/_six.pyx":120
4474  *         except Exception:
4475  *             return False
4476  *         return True             # <<<<<<<<<<<<<<
4477  *
4478  *     def py2_appendable(file_like):
4479  */
4480   __Pyx_XDECREF(__pyx_r);
4481   __Pyx_INCREF(Py_True);
4482   __pyx_r = Py_True;
4483   goto __pyx_L0;
4484 
4485   /* "fastavro/_six.pyx":115
4486  *         return unpack('!b', datum[0])[0]
4487  *
4488  *     def _readable(file_like):             # <<<<<<<<<<<<<<
4489  *         try:
4490  *             file_like.read()
4491  */
4492 
4493   /* function exit code */
4494   __pyx_L1_error:;
4495   __Pyx_XDECREF(__pyx_t_4);
4496   __Pyx_XDECREF(__pyx_t_5);
4497   __Pyx_XDECREF(__pyx_t_6);
4498   __Pyx_AddTraceback("fastavro._six._readable", __pyx_clineno, __pyx_lineno, __pyx_filename);
4499   __pyx_r = NULL;
4500   __pyx_L0:;
4501   __Pyx_XGIVEREF(__pyx_r);
4502   __Pyx_RefNannyFinishContext();
4503   return __pyx_r;
4504 }
4505 
4506 /* "fastavro/_six.pyx":122
4507  *         return True
4508  *
4509  *     def py2_appendable(file_like):             # <<<<<<<<<<<<<<
4510  *         # On Python 2 things are a mess. We basically just rely on looking at
4511  *         # the mode. If that doesn't exist (like in the case of an io.BytesIO)
4512  */
4513 
4514 /* Python wrapper */
4515 static PyObject *__pyx_pw_8fastavro_4_six_51py2_appendable(PyObject *__pyx_self, PyObject *__pyx_v_file_like); /*proto*/
4516 static PyMethodDef __pyx_mdef_8fastavro_4_six_51py2_appendable = {"py2_appendable", (PyCFunction)__pyx_pw_8fastavro_4_six_51py2_appendable, METH_O, 0};
__pyx_pw_8fastavro_4_six_51py2_appendable(PyObject * __pyx_self,PyObject * __pyx_v_file_like)4517 static PyObject *__pyx_pw_8fastavro_4_six_51py2_appendable(PyObject *__pyx_self, PyObject *__pyx_v_file_like) {
4518   PyObject *__pyx_r = 0;
4519   __Pyx_RefNannyDeclarations
4520   __Pyx_RefNannySetupContext("py2_appendable (wrapper)", 0);
4521   __pyx_r = __pyx_pf_8fastavro_4_six_50py2_appendable(__pyx_self, ((PyObject *)__pyx_v_file_like));
4522 
4523   /* function exit code */
4524   __Pyx_RefNannyFinishContext();
4525   return __pyx_r;
4526 }
4527 
__pyx_pf_8fastavro_4_six_50py2_appendable(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_file_like)4528 static PyObject *__pyx_pf_8fastavro_4_six_50py2_appendable(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file_like) {
4529   PyObject *__pyx_r = NULL;
4530   __Pyx_RefNannyDeclarations
4531   PyObject *__pyx_t_1 = NULL;
4532   PyObject *__pyx_t_2 = NULL;
4533   PyObject *__pyx_t_3 = NULL;
4534   PyObject *__pyx_t_4 = NULL;
4535   int __pyx_t_5;
4536   PyObject *__pyx_t_6 = NULL;
4537   PyObject *__pyx_t_7 = NULL;
4538   PyObject *__pyx_t_8 = NULL;
4539   PyObject *__pyx_t_9 = NULL;
4540   PyObject *__pyx_t_10 = NULL;
4541   int __pyx_t_11;
4542   PyObject *__pyx_t_12 = NULL;
4543   PyObject *__pyx_t_13 = NULL;
4544   PyObject *__pyx_t_14 = NULL;
4545   int __pyx_t_15;
4546   int __pyx_lineno = 0;
4547   const char *__pyx_filename = NULL;
4548   int __pyx_clineno = 0;
4549   __Pyx_RefNannySetupContext("py2_appendable", 0);
4550 
4551   /* "fastavro/_six.pyx":126
4552  *         # the mode. If that doesn't exist (like in the case of an io.BytesIO)
4553  *         # then we check the position and readablility.
4554  *         try:             # <<<<<<<<<<<<<<
4555  *             file_like.mode
4556  *         except AttributeError:
4557  */
4558   {
4559     __Pyx_PyThreadState_declare
4560     __Pyx_PyThreadState_assign
4561     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
4562     __Pyx_XGOTREF(__pyx_t_1);
4563     __Pyx_XGOTREF(__pyx_t_2);
4564     __Pyx_XGOTREF(__pyx_t_3);
4565     /*try:*/ {
4566 
4567       /* "fastavro/_six.pyx":127
4568  *         # then we check the position and readablility.
4569  *         try:
4570  *             file_like.mode             # <<<<<<<<<<<<<<
4571  *         except AttributeError:
4572  *             # This is probably some io stream so we rely on its tell() working
4573  */
4574       __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_file_like, __pyx_n_s_mode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 127, __pyx_L3_error)
4575       __Pyx_GOTREF(__pyx_t_4);
4576       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4577 
4578       /* "fastavro/_six.pyx":126
4579  *         # the mode. If that doesn't exist (like in the case of an io.BytesIO)
4580  *         # then we check the position and readablility.
4581  *         try:             # <<<<<<<<<<<<<<
4582  *             file_like.mode
4583  *         except AttributeError:
4584  */
4585     }
4586     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
4587     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4588     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4589     goto __pyx_L8_try_end;
4590     __pyx_L3_error:;
4591     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4592 
4593     /* "fastavro/_six.pyx":128
4594  *         try:
4595  *             file_like.mode
4596  *         except AttributeError:             # <<<<<<<<<<<<<<
4597  *             # This is probably some io stream so we rely on its tell() working
4598  *             try:
4599  */
4600     __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
4601     if (__pyx_t_5) {
4602       __Pyx_AddTraceback("fastavro._six.py2_appendable", __pyx_clineno, __pyx_lineno, __pyx_filename);
4603       if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 128, __pyx_L5_except_error)
4604       __Pyx_GOTREF(__pyx_t_4);
4605       __Pyx_GOTREF(__pyx_t_6);
4606       __Pyx_GOTREF(__pyx_t_7);
4607 
4608       /* "fastavro/_six.pyx":130
4609  *         except AttributeError:
4610  *             # This is probably some io stream so we rely on its tell() working
4611  *             try:             # <<<<<<<<<<<<<<
4612  *                 if file_like.tell() != 0 and _readable(file_like):
4613  *                     return True
4614  */
4615       {
4616         __Pyx_PyThreadState_declare
4617         __Pyx_PyThreadState_assign
4618         __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
4619         __Pyx_XGOTREF(__pyx_t_8);
4620         __Pyx_XGOTREF(__pyx_t_9);
4621         __Pyx_XGOTREF(__pyx_t_10);
4622         /*try:*/ {
4623 
4624           /* "fastavro/_six.pyx":131
4625  *             # This is probably some io stream so we rely on its tell() working
4626  *             try:
4627  *                 if file_like.tell() != 0 and _readable(file_like):             # <<<<<<<<<<<<<<
4628  *                     return True
4629  *             except (OSError, IOError):
4630  */
4631           __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_file_like, __pyx_n_s_tell); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 131, __pyx_L11_error)
4632           __Pyx_GOTREF(__pyx_t_13);
4633           __pyx_t_14 = NULL;
4634           if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
4635             __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13);
4636             if (likely(__pyx_t_14)) {
4637               PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
4638               __Pyx_INCREF(__pyx_t_14);
4639               __Pyx_INCREF(function);
4640               __Pyx_DECREF_SET(__pyx_t_13, function);
4641             }
4642           }
4643           __pyx_t_12 = (__pyx_t_14) ? __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_14) : __Pyx_PyObject_CallNoArg(__pyx_t_13);
4644           __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
4645           if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 131, __pyx_L11_error)
4646           __Pyx_GOTREF(__pyx_t_12);
4647           __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4648           __pyx_t_13 = __Pyx_PyInt_NeObjC(__pyx_t_12, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 131, __pyx_L11_error)
4649           __Pyx_GOTREF(__pyx_t_13);
4650           __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4651           __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_15 < 0)) __PYX_ERR(0, 131, __pyx_L11_error)
4652           __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4653           if (__pyx_t_15) {
4654           } else {
4655             __pyx_t_11 = __pyx_t_15;
4656             goto __pyx_L20_bool_binop_done;
4657           }
4658           __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_readable_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 131, __pyx_L11_error)
4659           __Pyx_GOTREF(__pyx_t_12);
4660           __pyx_t_14 = NULL;
4661           if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
4662             __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_12);
4663             if (likely(__pyx_t_14)) {
4664               PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
4665               __Pyx_INCREF(__pyx_t_14);
4666               __Pyx_INCREF(function);
4667               __Pyx_DECREF_SET(__pyx_t_12, function);
4668             }
4669           }
4670           __pyx_t_13 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_14, __pyx_v_file_like) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_v_file_like);
4671           __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
4672           if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 131, __pyx_L11_error)
4673           __Pyx_GOTREF(__pyx_t_13);
4674           __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4675           __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_15 < 0)) __PYX_ERR(0, 131, __pyx_L11_error)
4676           __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4677           __pyx_t_11 = __pyx_t_15;
4678           __pyx_L20_bool_binop_done:;
4679           if (__pyx_t_11) {
4680 
4681             /* "fastavro/_six.pyx":132
4682  *             try:
4683  *                 if file_like.tell() != 0 and _readable(file_like):
4684  *                     return True             # <<<<<<<<<<<<<<
4685  *             except (OSError, IOError):
4686  *                 pass
4687  */
4688             __Pyx_XDECREF(__pyx_r);
4689             __Pyx_INCREF(Py_True);
4690             __pyx_r = Py_True;
4691             __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4692             __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4693             __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4694             goto __pyx_L15_try_return;
4695 
4696             /* "fastavro/_six.pyx":131
4697  *             # This is probably some io stream so we rely on its tell() working
4698  *             try:
4699  *                 if file_like.tell() != 0 and _readable(file_like):             # <<<<<<<<<<<<<<
4700  *                     return True
4701  *             except (OSError, IOError):
4702  */
4703           }
4704 
4705           /* "fastavro/_six.pyx":130
4706  *         except AttributeError:
4707  *             # This is probably some io stream so we rely on its tell() working
4708  *             try:             # <<<<<<<<<<<<<<
4709  *                 if file_like.tell() != 0 and _readable(file_like):
4710  *                     return True
4711  */
4712         }
4713         __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
4714         __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
4715         __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
4716         goto __pyx_L18_try_end;
4717         __pyx_L11_error:;
4718         __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
4719         __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
4720         __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
4721 
4722         /* "fastavro/_six.pyx":133
4723  *                 if file_like.tell() != 0 and _readable(file_like):
4724  *                     return True
4725  *             except (OSError, IOError):             # <<<<<<<<<<<<<<
4726  *                 pass
4727  *             return False
4728  */
4729         __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_OSError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_IOError);
4730         if (__pyx_t_5) {
4731           __Pyx_ErrRestore(0,0,0);
4732           goto __pyx_L12_exception_handled;
4733         }
4734         goto __pyx_L13_except_error;
4735         __pyx_L13_except_error:;
4736 
4737         /* "fastavro/_six.pyx":130
4738  *         except AttributeError:
4739  *             # This is probably some io stream so we rely on its tell() working
4740  *             try:             # <<<<<<<<<<<<<<
4741  *                 if file_like.tell() != 0 and _readable(file_like):
4742  *                     return True
4743  */
4744         __Pyx_XGIVEREF(__pyx_t_8);
4745         __Pyx_XGIVEREF(__pyx_t_9);
4746         __Pyx_XGIVEREF(__pyx_t_10);
4747         __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
4748         goto __pyx_L5_except_error;
4749         __pyx_L15_try_return:;
4750         __Pyx_XGIVEREF(__pyx_t_8);
4751         __Pyx_XGIVEREF(__pyx_t_9);
4752         __Pyx_XGIVEREF(__pyx_t_10);
4753         __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
4754         goto __pyx_L6_except_return;
4755         __pyx_L12_exception_handled:;
4756         __Pyx_XGIVEREF(__pyx_t_8);
4757         __Pyx_XGIVEREF(__pyx_t_9);
4758         __Pyx_XGIVEREF(__pyx_t_10);
4759         __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
4760         __pyx_L18_try_end:;
4761       }
4762 
4763       /* "fastavro/_six.pyx":135
4764  *             except (OSError, IOError):
4765  *                 pass
4766  *             return False             # <<<<<<<<<<<<<<
4767  *
4768  *         if "a" in file_like.mode:
4769  */
4770       __Pyx_XDECREF(__pyx_r);
4771       __Pyx_INCREF(Py_False);
4772       __pyx_r = Py_False;
4773       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4774       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4775       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4776       goto __pyx_L6_except_return;
4777     }
4778     goto __pyx_L5_except_error;
4779     __pyx_L5_except_error:;
4780 
4781     /* "fastavro/_six.pyx":126
4782  *         # the mode. If that doesn't exist (like in the case of an io.BytesIO)
4783  *         # then we check the position and readablility.
4784  *         try:             # <<<<<<<<<<<<<<
4785  *             file_like.mode
4786  *         except AttributeError:
4787  */
4788     __Pyx_XGIVEREF(__pyx_t_1);
4789     __Pyx_XGIVEREF(__pyx_t_2);
4790     __Pyx_XGIVEREF(__pyx_t_3);
4791     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
4792     goto __pyx_L1_error;
4793     __pyx_L6_except_return:;
4794     __Pyx_XGIVEREF(__pyx_t_1);
4795     __Pyx_XGIVEREF(__pyx_t_2);
4796     __Pyx_XGIVEREF(__pyx_t_3);
4797     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
4798     goto __pyx_L0;
4799     __pyx_L8_try_end:;
4800   }
4801 
4802   /* "fastavro/_six.pyx":137
4803  *             return False
4804  *
4805  *         if "a" in file_like.mode:             # <<<<<<<<<<<<<<
4806  *             if "+" in file_like.mode:
4807  *                 return True
4808  */
4809   __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_file_like, __pyx_n_s_mode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 137, __pyx_L1_error)
4810   __Pyx_GOTREF(__pyx_t_7);
4811   __pyx_t_11 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_a, __pyx_t_7, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 137, __pyx_L1_error)
4812   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4813   __pyx_t_15 = (__pyx_t_11 != 0);
4814   if (__pyx_t_15) {
4815 
4816     /* "fastavro/_six.pyx":138
4817  *
4818  *         if "a" in file_like.mode:
4819  *             if "+" in file_like.mode:             # <<<<<<<<<<<<<<
4820  *                 return True
4821  *             else:
4822  */
4823     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_file_like, __pyx_n_s_mode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 138, __pyx_L1_error)
4824     __Pyx_GOTREF(__pyx_t_7);
4825     __pyx_t_15 = (__Pyx_PySequence_ContainsTF(__pyx_kp_s__6, __pyx_t_7, Py_EQ)); if (unlikely(__pyx_t_15 < 0)) __PYX_ERR(0, 138, __pyx_L1_error)
4826     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4827     __pyx_t_11 = (__pyx_t_15 != 0);
4828     if (likely(__pyx_t_11)) {
4829 
4830       /* "fastavro/_six.pyx":139
4831  *         if "a" in file_like.mode:
4832  *             if "+" in file_like.mode:
4833  *                 return True             # <<<<<<<<<<<<<<
4834  *             else:
4835  *                 raise ValueError(
4836  */
4837       __Pyx_XDECREF(__pyx_r);
4838       __Pyx_INCREF(Py_True);
4839       __pyx_r = Py_True;
4840       goto __pyx_L0;
4841 
4842       /* "fastavro/_six.pyx":138
4843  *
4844  *         if "a" in file_like.mode:
4845  *             if "+" in file_like.mode:             # <<<<<<<<<<<<<<
4846  *                 return True
4847  *             else:
4848  */
4849     }
4850 
4851     /* "fastavro/_six.pyx":141
4852  *                 return True
4853  *             else:
4854  *                 raise ValueError(             # <<<<<<<<<<<<<<
4855  *                     "When appending to an avro file you must use the "
4856  *                     + "'a+' mode, not just 'a'"
4857  */
4858     /*else*/ {
4859 
4860       /* "fastavro/_six.pyx":143
4861  *                 raise ValueError(
4862  *                     "When appending to an avro file you must use the "
4863  *                     + "'a+' mode, not just 'a'"             # <<<<<<<<<<<<<<
4864  *                 )
4865  *         else:
4866  */
4867       __pyx_t_7 = PyNumber_Add(__pyx_kp_s_When_appending_to_an_avro_file_y, __pyx_kp_s_a_mode_not_just_a); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 143, __pyx_L1_error)
4868       __Pyx_GOTREF(__pyx_t_7);
4869 
4870       /* "fastavro/_six.pyx":141
4871  *                 return True
4872  *             else:
4873  *                 raise ValueError(             # <<<<<<<<<<<<<<
4874  *                     "When appending to an avro file you must use the "
4875  *                     + "'a+' mode, not just 'a'"
4876  */
4877       __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 141, __pyx_L1_error)
4878       __Pyx_GOTREF(__pyx_t_6);
4879       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4880       __Pyx_Raise(__pyx_t_6, 0, 0, 0);
4881       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4882       __PYX_ERR(0, 141, __pyx_L1_error)
4883     }
4884 
4885     /* "fastavro/_six.pyx":137
4886  *             return False
4887  *
4888  *         if "a" in file_like.mode:             # <<<<<<<<<<<<<<
4889  *             if "+" in file_like.mode:
4890  *                 return True
4891  */
4892   }
4893 
4894   /* "fastavro/_six.pyx":146
4895  *                 )
4896  *         else:
4897  *             return False             # <<<<<<<<<<<<<<
4898  *
4899  *     def py2_int_to_be_signed_bytes(num, bytes_req):
4900  */
4901   /*else*/ {
4902     __Pyx_XDECREF(__pyx_r);
4903     __Pyx_INCREF(Py_False);
4904     __pyx_r = Py_False;
4905     goto __pyx_L0;
4906   }
4907 
4908   /* "fastavro/_six.pyx":122
4909  *         return True
4910  *
4911  *     def py2_appendable(file_like):             # <<<<<<<<<<<<<<
4912  *         # On Python 2 things are a mess. We basically just rely on looking at
4913  *         # the mode. If that doesn't exist (like in the case of an io.BytesIO)
4914  */
4915 
4916   /* function exit code */
4917   __pyx_L1_error:;
4918   __Pyx_XDECREF(__pyx_t_4);
4919   __Pyx_XDECREF(__pyx_t_6);
4920   __Pyx_XDECREF(__pyx_t_7);
4921   __Pyx_XDECREF(__pyx_t_12);
4922   __Pyx_XDECREF(__pyx_t_13);
4923   __Pyx_XDECREF(__pyx_t_14);
4924   __Pyx_AddTraceback("fastavro._six.py2_appendable", __pyx_clineno, __pyx_lineno, __pyx_filename);
4925   __pyx_r = NULL;
4926   __pyx_L0:;
4927   __Pyx_XGIVEREF(__pyx_r);
4928   __Pyx_RefNannyFinishContext();
4929   return __pyx_r;
4930 }
4931 
4932 /* "fastavro/_six.pyx":148
4933  *             return False
4934  *
4935  *     def py2_int_to_be_signed_bytes(num, bytes_req):             # <<<<<<<<<<<<<<
4936  *         if num < 0:
4937  *             num = 2 ** (8 * bytes_req) + num
4938  */
4939 
4940 /* Python wrapper */
4941 static PyObject *__pyx_pw_8fastavro_4_six_53py2_int_to_be_signed_bytes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4942 static PyMethodDef __pyx_mdef_8fastavro_4_six_53py2_int_to_be_signed_bytes = {"py2_int_to_be_signed_bytes", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8fastavro_4_six_53py2_int_to_be_signed_bytes, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_8fastavro_4_six_53py2_int_to_be_signed_bytes(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)4943 static PyObject *__pyx_pw_8fastavro_4_six_53py2_int_to_be_signed_bytes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4944   PyObject *__pyx_v_num = 0;
4945   PyObject *__pyx_v_bytes_req = 0;
4946   int __pyx_lineno = 0;
4947   const char *__pyx_filename = NULL;
4948   int __pyx_clineno = 0;
4949   PyObject *__pyx_r = 0;
4950   __Pyx_RefNannyDeclarations
4951   __Pyx_RefNannySetupContext("py2_int_to_be_signed_bytes (wrapper)", 0);
4952   {
4953     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_num,&__pyx_n_s_bytes_req,0};
4954     PyObject* values[2] = {0,0};
4955     if (unlikely(__pyx_kwds)) {
4956       Py_ssize_t kw_args;
4957       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4958       switch (pos_args) {
4959         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4960         CYTHON_FALLTHROUGH;
4961         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4962         CYTHON_FALLTHROUGH;
4963         case  0: break;
4964         default: goto __pyx_L5_argtuple_error;
4965       }
4966       kw_args = PyDict_Size(__pyx_kwds);
4967       switch (pos_args) {
4968         case  0:
4969         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_num)) != 0)) kw_args--;
4970         else goto __pyx_L5_argtuple_error;
4971         CYTHON_FALLTHROUGH;
4972         case  1:
4973         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bytes_req)) != 0)) kw_args--;
4974         else {
4975           __Pyx_RaiseArgtupleInvalid("py2_int_to_be_signed_bytes", 1, 2, 2, 1); __PYX_ERR(0, 148, __pyx_L3_error)
4976         }
4977       }
4978       if (unlikely(kw_args > 0)) {
4979         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "py2_int_to_be_signed_bytes") < 0)) __PYX_ERR(0, 148, __pyx_L3_error)
4980       }
4981     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
4982       goto __pyx_L5_argtuple_error;
4983     } else {
4984       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4985       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4986     }
4987     __pyx_v_num = values[0];
4988     __pyx_v_bytes_req = values[1];
4989   }
4990   goto __pyx_L4_argument_unpacking_done;
4991   __pyx_L5_argtuple_error:;
4992   __Pyx_RaiseArgtupleInvalid("py2_int_to_be_signed_bytes", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 148, __pyx_L3_error)
4993   __pyx_L3_error:;
4994   __Pyx_AddTraceback("fastavro._six.py2_int_to_be_signed_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename);
4995   __Pyx_RefNannyFinishContext();
4996   return NULL;
4997   __pyx_L4_argument_unpacking_done:;
4998   __pyx_r = __pyx_pf_8fastavro_4_six_52py2_int_to_be_signed_bytes(__pyx_self, __pyx_v_num, __pyx_v_bytes_req);
4999 
5000   /* function exit code */
5001   __Pyx_RefNannyFinishContext();
5002   return __pyx_r;
5003 }
5004 
__pyx_pf_8fastavro_4_six_52py2_int_to_be_signed_bytes(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_num,PyObject * __pyx_v_bytes_req)5005 static PyObject *__pyx_pf_8fastavro_4_six_52py2_int_to_be_signed_bytes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_num, PyObject *__pyx_v_bytes_req) {
5006   PyObject *__pyx_v_hex_str = NULL;
5007   PyObject *__pyx_r = NULL;
5008   __Pyx_RefNannyDeclarations
5009   PyObject *__pyx_t_1 = NULL;
5010   int __pyx_t_2;
5011   PyObject *__pyx_t_3 = NULL;
5012   Py_ssize_t __pyx_t_4;
5013   PyObject *__pyx_t_5 = NULL;
5014   int __pyx_lineno = 0;
5015   const char *__pyx_filename = NULL;
5016   int __pyx_clineno = 0;
5017   __Pyx_RefNannySetupContext("py2_int_to_be_signed_bytes", 0);
5018   __Pyx_INCREF(__pyx_v_num);
5019 
5020   /* "fastavro/_six.pyx":149
5021  *
5022  *     def py2_int_to_be_signed_bytes(num, bytes_req):
5023  *         if num < 0:             # <<<<<<<<<<<<<<
5024  *             num = 2 ** (8 * bytes_req) + num
5025  *         hex_str = '%x' % num
5026  */
5027   __pyx_t_1 = PyObject_RichCompare(__pyx_v_num, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error)
5028   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 149, __pyx_L1_error)
5029   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5030   if (__pyx_t_2) {
5031 
5032     /* "fastavro/_six.pyx":150
5033  *     def py2_int_to_be_signed_bytes(num, bytes_req):
5034  *         if num < 0:
5035  *             num = 2 ** (8 * bytes_req) + num             # <<<<<<<<<<<<<<
5036  *         hex_str = '%x' % num
5037  *         hex_str = ((bytes_req * 2) - len(hex_str)) * '0' + hex_str
5038  */
5039     __pyx_t_1 = PyNumber_Multiply(__pyx_int_8, __pyx_v_bytes_req); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 150, __pyx_L1_error)
5040     __Pyx_GOTREF(__pyx_t_1);
5041     __pyx_t_3 = __Pyx_PyNumber_PowerOf2(__pyx_int_2, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 150, __pyx_L1_error)
5042     __Pyx_GOTREF(__pyx_t_3);
5043     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5044     __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_v_num); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 150, __pyx_L1_error)
5045     __Pyx_GOTREF(__pyx_t_1);
5046     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5047     __Pyx_DECREF_SET(__pyx_v_num, __pyx_t_1);
5048     __pyx_t_1 = 0;
5049 
5050     /* "fastavro/_six.pyx":149
5051  *
5052  *     def py2_int_to_be_signed_bytes(num, bytes_req):
5053  *         if num < 0:             # <<<<<<<<<<<<<<
5054  *             num = 2 ** (8 * bytes_req) + num
5055  *         hex_str = '%x' % num
5056  */
5057   }
5058 
5059   /* "fastavro/_six.pyx":151
5060  *         if num < 0:
5061  *             num = 2 ** (8 * bytes_req) + num
5062  *         hex_str = '%x' % num             # <<<<<<<<<<<<<<
5063  *         hex_str = ((bytes_req * 2) - len(hex_str)) * '0' + hex_str
5064  *         return hex_str.decode('hex')
5065  */
5066   __pyx_t_1 = __Pyx_PyString_FormatSafe(__pyx_kp_s_x, __pyx_v_num); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error)
5067   __Pyx_GOTREF(__pyx_t_1);
5068   __pyx_v_hex_str = __pyx_t_1;
5069   __pyx_t_1 = 0;
5070 
5071   /* "fastavro/_six.pyx":152
5072  *             num = 2 ** (8 * bytes_req) + num
5073  *         hex_str = '%x' % num
5074  *         hex_str = ((bytes_req * 2) - len(hex_str)) * '0' + hex_str             # <<<<<<<<<<<<<<
5075  *         return hex_str.decode('hex')
5076  *
5077  */
5078   __pyx_t_1 = PyNumber_Multiply(__pyx_v_bytes_req, __pyx_int_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error)
5079   __Pyx_GOTREF(__pyx_t_1);
5080   __pyx_t_4 = PyObject_Length(__pyx_v_hex_str); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 152, __pyx_L1_error)
5081   __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 152, __pyx_L1_error)
5082   __Pyx_GOTREF(__pyx_t_3);
5083   __pyx_t_5 = PyNumber_Subtract(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 152, __pyx_L1_error)
5084   __Pyx_GOTREF(__pyx_t_5);
5085   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5086   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5087   __pyx_t_3 = PyNumber_Multiply(__pyx_t_5, __pyx_kp_s_0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 152, __pyx_L1_error)
5088   __Pyx_GOTREF(__pyx_t_3);
5089   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5090   __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_v_hex_str); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 152, __pyx_L1_error)
5091   __Pyx_GOTREF(__pyx_t_5);
5092   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5093   __Pyx_DECREF_SET(__pyx_v_hex_str, __pyx_t_5);
5094   __pyx_t_5 = 0;
5095 
5096   /* "fastavro/_six.pyx":153
5097  *         hex_str = '%x' % num
5098  *         hex_str = ((bytes_req * 2) - len(hex_str)) * '0' + hex_str
5099  *         return hex_str.decode('hex')             # <<<<<<<<<<<<<<
5100  *
5101  *     def py2_be_signed_bytes_to_int(data):
5102  */
5103   __Pyx_XDECREF(__pyx_r);
5104   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_hex_str, __pyx_n_s_decode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 153, __pyx_L1_error)
5105   __Pyx_GOTREF(__pyx_t_3);
5106   __pyx_t_1 = NULL;
5107   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
5108     __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
5109     if (likely(__pyx_t_1)) {
5110       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
5111       __Pyx_INCREF(__pyx_t_1);
5112       __Pyx_INCREF(function);
5113       __Pyx_DECREF_SET(__pyx_t_3, function);
5114     }
5115   }
5116   __pyx_t_5 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_n_s_hex) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_n_s_hex);
5117   __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5118   if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 153, __pyx_L1_error)
5119   __Pyx_GOTREF(__pyx_t_5);
5120   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5121   __pyx_r = __pyx_t_5;
5122   __pyx_t_5 = 0;
5123   goto __pyx_L0;
5124 
5125   /* "fastavro/_six.pyx":148
5126  *             return False
5127  *
5128  *     def py2_int_to_be_signed_bytes(num, bytes_req):             # <<<<<<<<<<<<<<
5129  *         if num < 0:
5130  *             num = 2 ** (8 * bytes_req) + num
5131  */
5132 
5133   /* function exit code */
5134   __pyx_L1_error:;
5135   __Pyx_XDECREF(__pyx_t_1);
5136   __Pyx_XDECREF(__pyx_t_3);
5137   __Pyx_XDECREF(__pyx_t_5);
5138   __Pyx_AddTraceback("fastavro._six.py2_int_to_be_signed_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename);
5139   __pyx_r = NULL;
5140   __pyx_L0:;
5141   __Pyx_XDECREF(__pyx_v_hex_str);
5142   __Pyx_XDECREF(__pyx_v_num);
5143   __Pyx_XGIVEREF(__pyx_r);
5144   __Pyx_RefNannyFinishContext();
5145   return __pyx_r;
5146 }
5147 
5148 /* "fastavro/_six.pyx":155
5149  *         return hex_str.decode('hex')
5150  *
5151  *     def py2_be_signed_bytes_to_int(data):             # <<<<<<<<<<<<<<
5152  *         output = int(data.encode('hex'), 16)
5153  *         bitsize = len(data) * 8
5154  */
5155 
5156 /* Python wrapper */
5157 static PyObject *__pyx_pw_8fastavro_4_six_55py2_be_signed_bytes_to_int(PyObject *__pyx_self, PyObject *__pyx_v_data); /*proto*/
5158 static PyMethodDef __pyx_mdef_8fastavro_4_six_55py2_be_signed_bytes_to_int = {"py2_be_signed_bytes_to_int", (PyCFunction)__pyx_pw_8fastavro_4_six_55py2_be_signed_bytes_to_int, METH_O, 0};
__pyx_pw_8fastavro_4_six_55py2_be_signed_bytes_to_int(PyObject * __pyx_self,PyObject * __pyx_v_data)5159 static PyObject *__pyx_pw_8fastavro_4_six_55py2_be_signed_bytes_to_int(PyObject *__pyx_self, PyObject *__pyx_v_data) {
5160   PyObject *__pyx_r = 0;
5161   __Pyx_RefNannyDeclarations
5162   __Pyx_RefNannySetupContext("py2_be_signed_bytes_to_int (wrapper)", 0);
5163   __pyx_r = __pyx_pf_8fastavro_4_six_54py2_be_signed_bytes_to_int(__pyx_self, ((PyObject *)__pyx_v_data));
5164 
5165   /* function exit code */
5166   __Pyx_RefNannyFinishContext();
5167   return __pyx_r;
5168 }
5169 
__pyx_pf_8fastavro_4_six_54py2_be_signed_bytes_to_int(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_data)5170 static PyObject *__pyx_pf_8fastavro_4_six_54py2_be_signed_bytes_to_int(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data) {
5171   PyObject *__pyx_v_output = NULL;
5172   PyObject *__pyx_v_bitsize = NULL;
5173   PyObject *__pyx_r = NULL;
5174   __Pyx_RefNannyDeclarations
5175   PyObject *__pyx_t_1 = NULL;
5176   PyObject *__pyx_t_2 = NULL;
5177   PyObject *__pyx_t_3 = NULL;
5178   Py_ssize_t __pyx_t_4;
5179   int __pyx_t_5;
5180   int __pyx_lineno = 0;
5181   const char *__pyx_filename = NULL;
5182   int __pyx_clineno = 0;
5183   __Pyx_RefNannySetupContext("py2_be_signed_bytes_to_int", 0);
5184 
5185   /* "fastavro/_six.pyx":156
5186  *
5187  *     def py2_be_signed_bytes_to_int(data):
5188  *         output = int(data.encode('hex'), 16)             # <<<<<<<<<<<<<<
5189  *         bitsize = len(data) * 8
5190  *         if output < (2 ** (bitsize - 1)):
5191  */
5192   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 156, __pyx_L1_error)
5193   __Pyx_GOTREF(__pyx_t_2);
5194   __pyx_t_3 = NULL;
5195   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
5196     __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
5197     if (likely(__pyx_t_3)) {
5198       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
5199       __Pyx_INCREF(__pyx_t_3);
5200       __Pyx_INCREF(function);
5201       __Pyx_DECREF_SET(__pyx_t_2, function);
5202     }
5203   }
5204   __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_n_s_hex) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_n_s_hex);
5205   __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5206   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error)
5207   __Pyx_GOTREF(__pyx_t_1);
5208   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5209   __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 156, __pyx_L1_error)
5210   __Pyx_GOTREF(__pyx_t_2);
5211   __Pyx_GIVEREF(__pyx_t_1);
5212   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
5213   __Pyx_INCREF(__pyx_int_16);
5214   __Pyx_GIVEREF(__pyx_int_16);
5215   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_16);
5216   __pyx_t_1 = 0;
5217   __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyInt_Type)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error)
5218   __Pyx_GOTREF(__pyx_t_1);
5219   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5220   __pyx_v_output = __pyx_t_1;
5221   __pyx_t_1 = 0;
5222 
5223   /* "fastavro/_six.pyx":157
5224  *     def py2_be_signed_bytes_to_int(data):
5225  *         output = int(data.encode('hex'), 16)
5226  *         bitsize = len(data) * 8             # <<<<<<<<<<<<<<
5227  *         if output < (2 ** (bitsize - 1)):
5228  *             return output
5229  */
5230   __pyx_t_4 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 157, __pyx_L1_error)
5231   __pyx_t_1 = PyInt_FromSsize_t((__pyx_t_4 * 8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error)
5232   __Pyx_GOTREF(__pyx_t_1);
5233   __pyx_v_bitsize = __pyx_t_1;
5234   __pyx_t_1 = 0;
5235 
5236   /* "fastavro/_six.pyx":158
5237  *         output = int(data.encode('hex'), 16)
5238  *         bitsize = len(data) * 8
5239  *         if output < (2 ** (bitsize - 1)):             # <<<<<<<<<<<<<<
5240  *             return output
5241  *         return output - (2 ** bitsize)
5242  */
5243   __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_bitsize, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error)
5244   __Pyx_GOTREF(__pyx_t_1);
5245   __pyx_t_2 = __Pyx_PyNumber_PowerOf2(__pyx_int_2, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error)
5246   __Pyx_GOTREF(__pyx_t_2);
5247   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5248   __pyx_t_1 = PyObject_RichCompare(__pyx_v_output, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error)
5249   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5250   __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 158, __pyx_L1_error)
5251   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5252   if (__pyx_t_5) {
5253 
5254     /* "fastavro/_six.pyx":159
5255  *         bitsize = len(data) * 8
5256  *         if output < (2 ** (bitsize - 1)):
5257  *             return output             # <<<<<<<<<<<<<<
5258  *         return output - (2 ** bitsize)
5259  *
5260  */
5261     __Pyx_XDECREF(__pyx_r);
5262     __Pyx_INCREF(__pyx_v_output);
5263     __pyx_r = __pyx_v_output;
5264     goto __pyx_L0;
5265 
5266     /* "fastavro/_six.pyx":158
5267  *         output = int(data.encode('hex'), 16)
5268  *         bitsize = len(data) * 8
5269  *         if output < (2 ** (bitsize - 1)):             # <<<<<<<<<<<<<<
5270  *             return output
5271  *         return output - (2 ** bitsize)
5272  */
5273   }
5274 
5275   /* "fastavro/_six.pyx":160
5276  *         if output < (2 ** (bitsize - 1)):
5277  *             return output
5278  *         return output - (2 ** bitsize)             # <<<<<<<<<<<<<<
5279  *
5280  *     def py2_reraise(Err, msg):
5281  */
5282   __Pyx_XDECREF(__pyx_r);
5283   __pyx_t_1 = __Pyx_PyNumber_PowerOf2(__pyx_int_2, __pyx_v_bitsize, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error)
5284   __Pyx_GOTREF(__pyx_t_1);
5285   __pyx_t_2 = PyNumber_Subtract(__pyx_v_output, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error)
5286   __Pyx_GOTREF(__pyx_t_2);
5287   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5288   __pyx_r = __pyx_t_2;
5289   __pyx_t_2 = 0;
5290   goto __pyx_L0;
5291 
5292   /* "fastavro/_six.pyx":155
5293  *         return hex_str.decode('hex')
5294  *
5295  *     def py2_be_signed_bytes_to_int(data):             # <<<<<<<<<<<<<<
5296  *         output = int(data.encode('hex'), 16)
5297  *         bitsize = len(data) * 8
5298  */
5299 
5300   /* function exit code */
5301   __pyx_L1_error:;
5302   __Pyx_XDECREF(__pyx_t_1);
5303   __Pyx_XDECREF(__pyx_t_2);
5304   __Pyx_XDECREF(__pyx_t_3);
5305   __Pyx_AddTraceback("fastavro._six.py2_be_signed_bytes_to_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
5306   __pyx_r = NULL;
5307   __pyx_L0:;
5308   __Pyx_XDECREF(__pyx_v_output);
5309   __Pyx_XDECREF(__pyx_v_bitsize);
5310   __Pyx_XGIVEREF(__pyx_r);
5311   __Pyx_RefNannyFinishContext();
5312   return __pyx_r;
5313 }
5314 
5315 /* "fastavro/_six.pyx":162
5316  *         return output - (2 ** bitsize)
5317  *
5318  *     def py2_reraise(Err, msg):             # <<<<<<<<<<<<<<
5319  *         traceback = sys.exc_info()[2]
5320  *         _locals = {'Err': Err, 'msg': msg, 'traceback': traceback}
5321  */
5322 
5323 /* Python wrapper */
5324 static PyObject *__pyx_pw_8fastavro_4_six_57py2_reraise(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5325 static PyMethodDef __pyx_mdef_8fastavro_4_six_57py2_reraise = {"py2_reraise", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8fastavro_4_six_57py2_reraise, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_8fastavro_4_six_57py2_reraise(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)5326 static PyObject *__pyx_pw_8fastavro_4_six_57py2_reraise(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5327   PyObject *__pyx_v_Err = 0;
5328   PyObject *__pyx_v_msg = 0;
5329   int __pyx_lineno = 0;
5330   const char *__pyx_filename = NULL;
5331   int __pyx_clineno = 0;
5332   PyObject *__pyx_r = 0;
5333   __Pyx_RefNannyDeclarations
5334   __Pyx_RefNannySetupContext("py2_reraise (wrapper)", 0);
5335   {
5336     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_Err,&__pyx_n_s_msg,0};
5337     PyObject* values[2] = {0,0};
5338     if (unlikely(__pyx_kwds)) {
5339       Py_ssize_t kw_args;
5340       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5341       switch (pos_args) {
5342         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5343         CYTHON_FALLTHROUGH;
5344         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5345         CYTHON_FALLTHROUGH;
5346         case  0: break;
5347         default: goto __pyx_L5_argtuple_error;
5348       }
5349       kw_args = PyDict_Size(__pyx_kwds);
5350       switch (pos_args) {
5351         case  0:
5352         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Err)) != 0)) kw_args--;
5353         else goto __pyx_L5_argtuple_error;
5354         CYTHON_FALLTHROUGH;
5355         case  1:
5356         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_msg)) != 0)) kw_args--;
5357         else {
5358           __Pyx_RaiseArgtupleInvalid("py2_reraise", 1, 2, 2, 1); __PYX_ERR(0, 162, __pyx_L3_error)
5359         }
5360       }
5361       if (unlikely(kw_args > 0)) {
5362         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "py2_reraise") < 0)) __PYX_ERR(0, 162, __pyx_L3_error)
5363       }
5364     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5365       goto __pyx_L5_argtuple_error;
5366     } else {
5367       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5368       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5369     }
5370     __pyx_v_Err = values[0];
5371     __pyx_v_msg = values[1];
5372   }
5373   goto __pyx_L4_argument_unpacking_done;
5374   __pyx_L5_argtuple_error:;
5375   __Pyx_RaiseArgtupleInvalid("py2_reraise", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 162, __pyx_L3_error)
5376   __pyx_L3_error:;
5377   __Pyx_AddTraceback("fastavro._six.py2_reraise", __pyx_clineno, __pyx_lineno, __pyx_filename);
5378   __Pyx_RefNannyFinishContext();
5379   return NULL;
5380   __pyx_L4_argument_unpacking_done:;
5381   __pyx_r = __pyx_pf_8fastavro_4_six_56py2_reraise(__pyx_self, __pyx_v_Err, __pyx_v_msg);
5382 
5383   /* function exit code */
5384   __Pyx_RefNannyFinishContext();
5385   return __pyx_r;
5386 }
5387 
__pyx_pf_8fastavro_4_six_56py2_reraise(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_Err,PyObject * __pyx_v_msg)5388 static PyObject *__pyx_pf_8fastavro_4_six_56py2_reraise(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_Err, PyObject *__pyx_v_msg) {
5389   PyObject *__pyx_v_traceback = NULL;
5390   PyObject *__pyx_v__locals = NULL;
5391   PyObject *__pyx_r = NULL;
5392   __Pyx_RefNannyDeclarations
5393   PyObject *__pyx_t_1 = NULL;
5394   PyObject *__pyx_t_2 = NULL;
5395   PyObject *__pyx_t_3 = NULL;
5396   int __pyx_lineno = 0;
5397   const char *__pyx_filename = NULL;
5398   int __pyx_clineno = 0;
5399   __Pyx_RefNannySetupContext("py2_reraise", 0);
5400 
5401   /* "fastavro/_six.pyx":163
5402  *
5403  *     def py2_reraise(Err, msg):
5404  *         traceback = sys.exc_info()[2]             # <<<<<<<<<<<<<<
5405  *         _locals = {'Err': Err, 'msg': msg, 'traceback': traceback}
5406  *         exec('raise Err, msg, traceback', _locals)
5407  */
5408   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error)
5409   __Pyx_GOTREF(__pyx_t_2);
5410   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error)
5411   __Pyx_GOTREF(__pyx_t_3);
5412   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5413   __pyx_t_2 = NULL;
5414   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
5415     __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
5416     if (likely(__pyx_t_2)) {
5417       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
5418       __Pyx_INCREF(__pyx_t_2);
5419       __Pyx_INCREF(function);
5420       __Pyx_DECREF_SET(__pyx_t_3, function);
5421     }
5422   }
5423   __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
5424   __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5425   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error)
5426   __Pyx_GOTREF(__pyx_t_1);
5427   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5428   __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error)
5429   __Pyx_GOTREF(__pyx_t_3);
5430   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5431   __pyx_v_traceback = __pyx_t_3;
5432   __pyx_t_3 = 0;
5433 
5434   /* "fastavro/_six.pyx":164
5435  *     def py2_reraise(Err, msg):
5436  *         traceback = sys.exc_info()[2]
5437  *         _locals = {'Err': Err, 'msg': msg, 'traceback': traceback}             # <<<<<<<<<<<<<<
5438  *         exec('raise Err, msg, traceback', _locals)
5439  *
5440  */
5441   __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L1_error)
5442   __Pyx_GOTREF(__pyx_t_3);
5443   if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_Err, __pyx_v_Err) < 0) __PYX_ERR(0, 164, __pyx_L1_error)
5444   if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_msg, __pyx_v_msg) < 0) __PYX_ERR(0, 164, __pyx_L1_error)
5445   if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_traceback, __pyx_v_traceback) < 0) __PYX_ERR(0, 164, __pyx_L1_error)
5446   __pyx_v__locals = ((PyObject*)__pyx_t_3);
5447   __pyx_t_3 = 0;
5448 
5449   /* "fastavro/_six.pyx":165
5450  *         traceback = sys.exc_info()[2]
5451  *         _locals = {'Err': Err, 'msg': msg, 'traceback': traceback}
5452  *         exec('raise Err, msg, traceback', _locals)             # <<<<<<<<<<<<<<
5453  *
5454  * # We do it this way and not just redifine function since Cython do not like it
5455  */
5456   __pyx_t_3 = __Pyx_PyExec2(__pyx_kp_s_raise_Err_msg_traceback, __pyx_v__locals); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error)
5457   __Pyx_GOTREF(__pyx_t_3);
5458   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5459 
5460   /* "fastavro/_six.pyx":162
5461  *         return output - (2 ** bitsize)
5462  *
5463  *     def py2_reraise(Err, msg):             # <<<<<<<<<<<<<<
5464  *         traceback = sys.exc_info()[2]
5465  *         _locals = {'Err': Err, 'msg': msg, 'traceback': traceback}
5466  */
5467 
5468   /* function exit code */
5469   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5470   goto __pyx_L0;
5471   __pyx_L1_error:;
5472   __Pyx_XDECREF(__pyx_t_1);
5473   __Pyx_XDECREF(__pyx_t_2);
5474   __Pyx_XDECREF(__pyx_t_3);
5475   __Pyx_AddTraceback("fastavro._six.py2_reraise", __pyx_clineno, __pyx_lineno, __pyx_filename);
5476   __pyx_r = NULL;
5477   __pyx_L0:;
5478   __Pyx_XDECREF(__pyx_v_traceback);
5479   __Pyx_XDECREF(__pyx_v__locals);
5480   __Pyx_XGIVEREF(__pyx_r);
5481   __Pyx_RefNannyFinishContext();
5482   return __pyx_r;
5483 }
5484 
5485 static PyMethodDef __pyx_methods[] = {
5486   {0, 0, 0, 0}
5487 };
5488 
5489 #if PY_MAJOR_VERSION >= 3
5490 #if CYTHON_PEP489_MULTI_PHASE_INIT
5491 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
5492 static int __pyx_pymod_exec__six(PyObject* module); /*proto*/
5493 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
5494   {Py_mod_create, (void*)__pyx_pymod_create},
5495   {Py_mod_exec, (void*)__pyx_pymod_exec__six},
5496   {0, NULL}
5497 };
5498 #endif
5499 
5500 static struct PyModuleDef __pyx_moduledef = {
5501     PyModuleDef_HEAD_INIT,
5502     "_six",
5503     __pyx_k_Compatiblity_for_Python_versions, /* m_doc */
5504   #if CYTHON_PEP489_MULTI_PHASE_INIT
5505     0, /* m_size */
5506   #else
5507     -1, /* m_size */
5508   #endif
5509     __pyx_methods /* m_methods */,
5510   #if CYTHON_PEP489_MULTI_PHASE_INIT
5511     __pyx_moduledef_slots, /* m_slots */
5512   #else
5513     NULL, /* m_reload */
5514   #endif
5515     NULL, /* m_traverse */
5516     NULL, /* m_clear */
5517     NULL /* m_free */
5518 };
5519 #endif
5520 #ifndef CYTHON_SMALL_CODE
5521 #if defined(__clang__)
5522     #define CYTHON_SMALL_CODE
5523 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
5524     #define CYTHON_SMALL_CODE __attribute__((cold))
5525 #else
5526     #define CYTHON_SMALL_CODE
5527 #endif
5528 #endif
5529 
5530 static __Pyx_StringTabEntry __pyx_string_tab[] = {
5531   {&__pyx_kp_s_0, __pyx_k_0, sizeof(__pyx_k_0), 0, 0, 1, 0},
5532   {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1},
5533   {&__pyx_n_s_BytesIO, __pyx_k_BytesIO, sizeof(__pyx_k_BytesIO), 0, 0, 1, 1},
5534   {&__pyx_n_s_Err, __pyx_k_Err, sizeof(__pyx_k_Err), 0, 0, 1, 1},
5535   {&__pyx_n_s_IOError, __pyx_k_IOError, sizeof(__pyx_k_IOError), 0, 0, 1, 1},
5536   {&__pyx_n_s_MemoryIO, __pyx_k_MemoryIO, sizeof(__pyx_k_MemoryIO), 0, 0, 1, 1},
5537   {&__pyx_n_s_OSError, __pyx_k_OSError, sizeof(__pyx_k_OSError), 0, 0, 1, 1},
5538   {&__pyx_n_s_StringIO, __pyx_k_StringIO, sizeof(__pyx_k_StringIO), 0, 0, 1, 1},
5539   {&__pyx_kp_s_UTF_8, __pyx_k_UTF_8, sizeof(__pyx_k_UTF_8), 0, 0, 1, 0},
5540   {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
5541   {&__pyx_kp_s_When_appending_to_an_avro_file_y, __pyx_k_When_appending_to_an_avro_file_y, sizeof(__pyx_k_When_appending_to_an_avro_file_y), 0, 0, 1, 0},
5542   {&__pyx_kp_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 0},
5543   {&__pyx_kp_s__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 0, 1, 0},
5544   {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1},
5545   {&__pyx_kp_s_a_mode_not_just_a, __pyx_k_a_mode_not_just_a, sizeof(__pyx_k_a_mode_not_just_a), 0, 0, 1, 0},
5546   {&__pyx_n_s_appendable, __pyx_k_appendable, sizeof(__pyx_k_appendable), 0, 0, 1, 1},
5547   {&__pyx_kp_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 0},
5548   {&__pyx_n_s_be_signed_bytes_to_int, __pyx_k_be_signed_bytes_to_int, sizeof(__pyx_k_be_signed_bytes_to_int), 0, 0, 1, 1},
5549   {&__pyx_n_s_big, __pyx_k_big, sizeof(__pyx_k_big), 0, 0, 1, 1},
5550   {&__pyx_n_s_bits, __pyx_k_bits, sizeof(__pyx_k_bits), 0, 0, 1, 1},
5551   {&__pyx_n_s_bitsize, __pyx_k_bitsize, sizeof(__pyx_k_bitsize), 0, 0, 1, 1},
5552   {&__pyx_n_s_btou, __pyx_k_btou, sizeof(__pyx_k_btou), 0, 0, 1, 1},
5553   {&__pyx_n_s_builtins, __pyx_k_builtins, sizeof(__pyx_k_builtins), 0, 0, 1, 1},
5554   {&__pyx_n_s_byteorder, __pyx_k_byteorder, sizeof(__pyx_k_byteorder), 0, 0, 1, 1},
5555   {&__pyx_n_s_bytes_req, __pyx_k_bytes_req, sizeof(__pyx_k_bytes_req), 0, 0, 1, 1},
5556   {&__pyx_n_s_cStringIO, __pyx_k_cStringIO, sizeof(__pyx_k_cStringIO), 0, 0, 1, 1},
5557   {&__pyx_n_s_chr, __pyx_k_chr, sizeof(__pyx_k_chr), 0, 0, 1, 1},
5558   {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
5559   {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
5560   {&__pyx_n_s_datum, __pyx_k_datum, sizeof(__pyx_k_datum), 0, 0, 1, 1},
5561   {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1},
5562   {&__pyx_n_s_dump, __pyx_k_dump, sizeof(__pyx_k_dump), 0, 0, 1, 1},
5563   {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
5564   {&__pyx_n_s_encoding, __pyx_k_encoding, sizeof(__pyx_k_encoding), 0, 0, 1, 1},
5565   {&__pyx_n_s_encoding_2, __pyx_k_encoding_2, sizeof(__pyx_k_encoding_2), 0, 0, 1, 1},
5566   {&__pyx_n_s_exc_info, __pyx_k_exc_info, sizeof(__pyx_k_exc_info), 0, 0, 1, 1},
5567   {&__pyx_n_s_fastavro__six, __pyx_k_fastavro__six, sizeof(__pyx_k_fastavro__six), 0, 0, 1, 1},
5568   {&__pyx_kp_s_fastavro__six_pyx, __pyx_k_fastavro__six_pyx, sizeof(__pyx_k_fastavro__six_pyx), 0, 0, 1, 0},
5569   {&__pyx_n_s_file_like, __pyx_k_file_like, sizeof(__pyx_k_file_like), 0, 0, 1, 1},
5570   {&__pyx_n_s_from_bytes, __pyx_k_from_bytes, sizeof(__pyx_k_from_bytes), 0, 0, 1, 1},
5571   {&__pyx_n_s_fstint, __pyx_k_fstint, sizeof(__pyx_k_fstint), 0, 0, 1, 1},
5572   {&__pyx_n_s_hex, __pyx_k_hex, sizeof(__pyx_k_hex), 0, 0, 1, 1},
5573   {&__pyx_n_s_hex_str, __pyx_k_hex_str, sizeof(__pyx_k_hex_str), 0, 0, 1, 1},
5574   {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
5575   {&__pyx_n_s_int_to_be_signed_bytes, __pyx_k_int_to_be_signed_bytes, sizeof(__pyx_k_int_to_be_signed_bytes), 0, 0, 1, 1},
5576   {&__pyx_n_s_io, __pyx_k_io, sizeof(__pyx_k_io), 0, 0, 1, 1},
5577   {&__pyx_n_s_is_str, __pyx_k_is_str, sizeof(__pyx_k_is_str), 0, 0, 1, 1},
5578   {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1},
5579   {&__pyx_n_s_iteritems, __pyx_k_iteritems, sizeof(__pyx_k_iteritems), 0, 0, 1, 1},
5580   {&__pyx_n_s_iterkeys, __pyx_k_iterkeys, sizeof(__pyx_k_iterkeys), 0, 0, 1, 1},
5581   {&__pyx_n_s_itervalues, __pyx_k_itervalues, sizeof(__pyx_k_itervalues), 0, 0, 1, 1},
5582   {&__pyx_n_s_json, __pyx_k_json, sizeof(__pyx_k_json), 0, 0, 1, 1},
5583   {&__pyx_n_s_json_dump, __pyx_k_json_dump, sizeof(__pyx_k_json_dump), 0, 0, 1, 1},
5584   {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1},
5585   {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1},
5586   {&__pyx_n_s_locals, __pyx_k_locals, sizeof(__pyx_k_locals), 0, 0, 1, 1},
5587   {&__pyx_n_s_long, __pyx_k_long, sizeof(__pyx_k_long), 0, 0, 1, 1},
5588   {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
5589   {&__pyx_n_s_map, __pyx_k_map, sizeof(__pyx_k_map), 0, 0, 1, 1},
5590   {&__pyx_n_s_mk_bits, __pyx_k_mk_bits, sizeof(__pyx_k_mk_bits), 0, 0, 1, 1},
5591   {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
5592   {&__pyx_n_s_msg, __pyx_k_msg, sizeof(__pyx_k_msg), 0, 0, 1, 1},
5593   {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
5594   {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
5595   {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
5596   {&__pyx_n_s_num, __pyx_k_num, sizeof(__pyx_k_num), 0, 0, 1, 1},
5597   {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
5598   {&__pyx_n_s_outenc, __pyx_k_outenc, sizeof(__pyx_k_outenc), 0, 0, 1, 1},
5599   {&__pyx_n_s_output, __pyx_k_output, sizeof(__pyx_k_output), 0, 0, 1, 1},
5600   {&__pyx_n_s_py2_appendable, __pyx_k_py2_appendable, sizeof(__pyx_k_py2_appendable), 0, 0, 1, 1},
5601   {&__pyx_n_s_py2_be_signed_bytes_to_int, __pyx_k_py2_be_signed_bytes_to_int, sizeof(__pyx_k_py2_be_signed_bytes_to_int), 0, 0, 1, 1},
5602   {&__pyx_n_s_py2_btou, __pyx_k_py2_btou, sizeof(__pyx_k_py2_btou), 0, 0, 1, 1},
5603   {&__pyx_n_s_py2_fstint, __pyx_k_py2_fstint, sizeof(__pyx_k_py2_fstint), 0, 0, 1, 1},
5604   {&__pyx_n_s_py2_int_to_be_signed_bytes, __pyx_k_py2_int_to_be_signed_bytes, sizeof(__pyx_k_py2_int_to_be_signed_bytes), 0, 0, 1, 1},
5605   {&__pyx_n_s_py2_is_str, __pyx_k_py2_is_str, sizeof(__pyx_k_py2_is_str), 0, 0, 1, 1},
5606   {&__pyx_n_s_py2_iteritems, __pyx_k_py2_iteritems, sizeof(__pyx_k_py2_iteritems), 0, 0, 1, 1},
5607   {&__pyx_n_s_py2_iterkeys, __pyx_k_py2_iterkeys, sizeof(__pyx_k_py2_iterkeys), 0, 0, 1, 1},
5608   {&__pyx_n_s_py2_itervalues, __pyx_k_py2_itervalues, sizeof(__pyx_k_py2_itervalues), 0, 0, 1, 1},
5609   {&__pyx_n_s_py2_json_dump, __pyx_k_py2_json_dump, sizeof(__pyx_k_py2_json_dump), 0, 0, 1, 1},
5610   {&__pyx_n_s_py2_mk_bits, __pyx_k_py2_mk_bits, sizeof(__pyx_k_py2_mk_bits), 0, 0, 1, 1},
5611   {&__pyx_n_s_py2_reraise, __pyx_k_py2_reraise, sizeof(__pyx_k_py2_reraise), 0, 0, 1, 1},
5612   {&__pyx_n_s_py2_str2ints, __pyx_k_py2_str2ints, sizeof(__pyx_k_py2_str2ints), 0, 0, 1, 1},
5613   {&__pyx_n_s_py2_str2ints_locals_lambda, __pyx_k_py2_str2ints_locals_lambda, sizeof(__pyx_k_py2_str2ints_locals_lambda), 0, 0, 1, 1},
5614   {&__pyx_n_s_py2_utob, __pyx_k_py2_utob, sizeof(__pyx_k_py2_utob), 0, 0, 1, 1},
5615   {&__pyx_n_s_py3_appendable, __pyx_k_py3_appendable, sizeof(__pyx_k_py3_appendable), 0, 0, 1, 1},
5616   {&__pyx_n_s_py3_be_signed_bytes_to_int, __pyx_k_py3_be_signed_bytes_to_int, sizeof(__pyx_k_py3_be_signed_bytes_to_int), 0, 0, 1, 1},
5617   {&__pyx_n_s_py3_btou, __pyx_k_py3_btou, sizeof(__pyx_k_py3_btou), 0, 0, 1, 1},
5618   {&__pyx_n_s_py3_bytes2ints, __pyx_k_py3_bytes2ints, sizeof(__pyx_k_py3_bytes2ints), 0, 0, 1, 1},
5619   {&__pyx_n_s_py3_fstint, __pyx_k_py3_fstint, sizeof(__pyx_k_py3_fstint), 0, 0, 1, 1},
5620   {&__pyx_n_s_py3_int_to_be_signed_bytes, __pyx_k_py3_int_to_be_signed_bytes, sizeof(__pyx_k_py3_int_to_be_signed_bytes), 0, 0, 1, 1},
5621   {&__pyx_n_s_py3_is_str, __pyx_k_py3_is_str, sizeof(__pyx_k_py3_is_str), 0, 0, 1, 1},
5622   {&__pyx_n_s_py3_iteritems, __pyx_k_py3_iteritems, sizeof(__pyx_k_py3_iteritems), 0, 0, 1, 1},
5623   {&__pyx_n_s_py3_iterkeys, __pyx_k_py3_iterkeys, sizeof(__pyx_k_py3_iterkeys), 0, 0, 1, 1},
5624   {&__pyx_n_s_py3_itervalues, __pyx_k_py3_itervalues, sizeof(__pyx_k_py3_itervalues), 0, 0, 1, 1},
5625   {&__pyx_n_s_py3_json_dump, __pyx_k_py3_json_dump, sizeof(__pyx_k_py3_json_dump), 0, 0, 1, 1},
5626   {&__pyx_n_s_py3_mk_bits, __pyx_k_py3_mk_bits, sizeof(__pyx_k_py3_mk_bits), 0, 0, 1, 1},
5627   {&__pyx_n_s_py3_reraise, __pyx_k_py3_reraise, sizeof(__pyx_k_py3_reraise), 0, 0, 1, 1},
5628   {&__pyx_n_s_py3_utob, __pyx_k_py3_utob, sizeof(__pyx_k_py3_utob), 0, 0, 1, 1},
5629   {&__pyx_kp_s_raise_Err_msg_traceback, __pyx_k_raise_Err_msg_traceback, sizeof(__pyx_k_raise_Err_msg_traceback), 0, 0, 1, 0},
5630   {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
5631   {&__pyx_n_s_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 0, 1, 1},
5632   {&__pyx_n_s_readable, __pyx_k_readable, sizeof(__pyx_k_readable), 0, 0, 1, 1},
5633   {&__pyx_n_s_readable_2, __pyx_k_readable_2, sizeof(__pyx_k_readable_2), 0, 0, 1, 1},
5634   {&__pyx_n_s_reraise, __pyx_k_reraise, sizeof(__pyx_k_reraise), 0, 0, 1, 1},
5635   {&__pyx_n_s_seekable, __pyx_k_seekable, sizeof(__pyx_k_seekable), 0, 0, 1, 1},
5636   {&__pyx_n_s_signed, __pyx_k_signed, sizeof(__pyx_k_signed), 0, 0, 1, 1},
5637   {&__pyx_n_s_stdout, __pyx_k_stdout, sizeof(__pyx_k_stdout), 0, 0, 1, 1},
5638   {&__pyx_kp_s_stdout_2, __pyx_k_stdout_2, sizeof(__pyx_k_stdout_2), 0, 0, 1, 0},
5639   {&__pyx_n_s_str2ints, __pyx_k_str2ints, sizeof(__pyx_k_str2ints), 0, 0, 1, 1},
5640   {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
5641   {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
5642   {&__pyx_n_s_tell, __pyx_k_tell, sizeof(__pyx_k_tell), 0, 0, 1, 1},
5643   {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
5644   {&__pyx_n_s_to_bytes, __pyx_k_to_bytes, sizeof(__pyx_k_to_bytes), 0, 0, 1, 1},
5645   {&__pyx_n_s_traceback, __pyx_k_traceback, sizeof(__pyx_k_traceback), 0, 0, 1, 1},
5646   {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
5647   {&__pyx_n_s_utob, __pyx_k_utob, sizeof(__pyx_k_utob), 0, 0, 1, 1},
5648   {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1},
5649   {&__pyx_n_s_version_info, __pyx_k_version_info, sizeof(__pyx_k_version_info), 0, 0, 1, 1},
5650   {&__pyx_n_s_with_traceback, __pyx_k_with_traceback, sizeof(__pyx_k_with_traceback), 0, 0, 1, 1},
5651   {&__pyx_kp_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 0},
5652   {&__pyx_n_s_xrange, __pyx_k_xrange, sizeof(__pyx_k_xrange), 0, 0, 1, 1},
5653   {0, 0, 0, 0, 0, 0, 0}
5654 };
__Pyx_InitCachedBuiltins(void)5655 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
5656   __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 19, __pyx_L1_error)
5657   __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 61, __pyx_L1_error)
5658   __pyx_builtin_chr = __Pyx_GetBuiltinName(__pyx_n_s_chr); if (!__pyx_builtin_chr) __PYX_ERR(0, 107, __pyx_L1_error)
5659   __pyx_builtin_map = __Pyx_GetBuiltinName(__pyx_n_s_map); if (!__pyx_builtin_map) __PYX_ERR(0, 110, __pyx_L1_error)
5660   __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 128, __pyx_L1_error)
5661   __pyx_builtin_OSError = __Pyx_GetBuiltinName(__pyx_n_s_OSError); if (!__pyx_builtin_OSError) __PYX_ERR(0, 133, __pyx_L1_error)
5662   __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) __PYX_ERR(0, 133, __pyx_L1_error)
5663   return 0;
5664   __pyx_L1_error:;
5665   return -1;
5666 }
5667 
__Pyx_InitCachedConstants(void)5668 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
5669   __Pyx_RefNannyDeclarations
5670   __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
5671 
5672   /* "fastavro/_six.pyx":16
5673  * _encoding = 'UTF-8'
5674  *
5675  * if sys.version_info >= (3, 0):             # <<<<<<<<<<<<<<
5676  *     from io import BytesIO as MemoryIO
5677  *     from io import StringIO as StringIO
5678  */
5679   __pyx_tuple__7 = PyTuple_Pack(2, __pyx_int_3, __pyx_int_0); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 16, __pyx_L1_error)
5680   __Pyx_GOTREF(__pyx_tuple__7);
5681   __Pyx_GIVEREF(__pyx_tuple__7);
5682 
5683   /* "fastavro/_six.pyx":21
5684  *     xrange = range
5685  *
5686  *     def py3_btou(n, encoding=_encoding):             # <<<<<<<<<<<<<<
5687  *         return n.decode(encoding)
5688  *
5689  */
5690   __pyx_tuple__8 = PyTuple_Pack(2, __pyx_n_s_n, __pyx_n_s_encoding); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 21, __pyx_L1_error)
5691   __Pyx_GOTREF(__pyx_tuple__8);
5692   __Pyx_GIVEREF(__pyx_tuple__8);
5693   __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_fastavro__six_pyx, __pyx_n_s_py3_btou, 21, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 21, __pyx_L1_error)
5694 
5695   /* "fastavro/_six.pyx":24
5696  *         return n.decode(encoding)
5697  *
5698  *     def py3_utob(n, encoding=_encoding):             # <<<<<<<<<<<<<<
5699  *         return bytes(n, encoding)
5700  *
5701  */
5702   __pyx_tuple__10 = PyTuple_Pack(2, __pyx_n_s_n, __pyx_n_s_encoding); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 24, __pyx_L1_error)
5703   __Pyx_GOTREF(__pyx_tuple__10);
5704   __Pyx_GIVEREF(__pyx_tuple__10);
5705   __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 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_fastavro__six_pyx, __pyx_n_s_py3_utob, 24, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 24, __pyx_L1_error)
5706 
5707   /* "fastavro/_six.pyx":27
5708  *         return bytes(n, encoding)
5709  *
5710  *     def py3_json_dump(obj, **kwargs):             # <<<<<<<<<<<<<<
5711  *         json.dump(obj, sys.stdout, **kwargs)
5712  *
5713  */
5714   __pyx_tuple__12 = PyTuple_Pack(2, __pyx_n_s_obj, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 27, __pyx_L1_error)
5715   __Pyx_GOTREF(__pyx_tuple__12);
5716   __Pyx_GIVEREF(__pyx_tuple__12);
5717   __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastavro__six_pyx, __pyx_n_s_py3_json_dump, 27, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 27, __pyx_L1_error)
5718 
5719   /* "fastavro/_six.pyx":30
5720  *         json.dump(obj, sys.stdout, **kwargs)
5721  *
5722  *     def py3_iterkeys(obj):             # <<<<<<<<<<<<<<
5723  *         return obj.keys()
5724  *
5725  */
5726   __pyx_tuple__14 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 30, __pyx_L1_error)
5727   __Pyx_GOTREF(__pyx_tuple__14);
5728   __Pyx_GIVEREF(__pyx_tuple__14);
5729   __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastavro__six_pyx, __pyx_n_s_py3_iterkeys, 30, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 30, __pyx_L1_error)
5730 
5731   /* "fastavro/_six.pyx":33
5732  *         return obj.keys()
5733  *
5734  *     def py3_itervalues(obj):             # <<<<<<<<<<<<<<
5735  *         return obj.values()
5736  *
5737  */
5738   __pyx_tuple__16 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 33, __pyx_L1_error)
5739   __Pyx_GOTREF(__pyx_tuple__16);
5740   __Pyx_GIVEREF(__pyx_tuple__16);
5741   __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastavro__six_pyx, __pyx_n_s_py3_itervalues, 33, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 33, __pyx_L1_error)
5742 
5743   /* "fastavro/_six.pyx":36
5744  *         return obj.values()
5745  *
5746  *     def py3_iteritems(obj):             # <<<<<<<<<<<<<<
5747  *         return obj.items()
5748  *
5749  */
5750   __pyx_tuple__18 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 36, __pyx_L1_error)
5751   __Pyx_GOTREF(__pyx_tuple__18);
5752   __Pyx_GIVEREF(__pyx_tuple__18);
5753   __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastavro__six_pyx, __pyx_n_s_py3_iteritems, 36, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 36, __pyx_L1_error)
5754 
5755   /* "fastavro/_six.pyx":39
5756  *         return obj.items()
5757  *
5758  *     def py3_is_str(obj):             # <<<<<<<<<<<<<<
5759  *         return isinstance(obj, str)
5760  *
5761  */
5762   __pyx_tuple__20 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 39, __pyx_L1_error)
5763   __Pyx_GOTREF(__pyx_tuple__20);
5764   __Pyx_GIVEREF(__pyx_tuple__20);
5765   __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastavro__six_pyx, __pyx_n_s_py3_is_str, 39, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 39, __pyx_L1_error)
5766 
5767   /* "fastavro/_six.pyx":42
5768  *         return isinstance(obj, str)
5769  *
5770  *     def py3_mk_bits(bits):             # <<<<<<<<<<<<<<
5771  *         return bytes([bits & 0xff])
5772  *
5773  */
5774   __pyx_tuple__22 = PyTuple_Pack(1, __pyx_n_s_bits); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 42, __pyx_L1_error)
5775   __Pyx_GOTREF(__pyx_tuple__22);
5776   __Pyx_GIVEREF(__pyx_tuple__22);
5777   __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastavro__six_pyx, __pyx_n_s_py3_mk_bits, 42, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 42, __pyx_L1_error)
5778 
5779   /* "fastavro/_six.pyx":45
5780  *         return bytes([bits & 0xff])
5781  *
5782  *     def py3_bytes2ints(datum):             # <<<<<<<<<<<<<<
5783  *         return list(datum)
5784  *
5785  */
5786   __pyx_tuple__24 = PyTuple_Pack(1, __pyx_n_s_datum); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 45, __pyx_L1_error)
5787   __Pyx_GOTREF(__pyx_tuple__24);
5788   __Pyx_GIVEREF(__pyx_tuple__24);
5789   __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastavro__six_pyx, __pyx_n_s_py3_bytes2ints, 45, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 45, __pyx_L1_error)
5790 
5791   /* "fastavro/_six.pyx":48
5792  *         return list(datum)
5793  *
5794  *     def py3_fstint(datum):             # <<<<<<<<<<<<<<
5795  *         return datum[0]
5796  *
5797  */
5798   __pyx_tuple__26 = PyTuple_Pack(1, __pyx_n_s_datum); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 48, __pyx_L1_error)
5799   __Pyx_GOTREF(__pyx_tuple__26);
5800   __Pyx_GIVEREF(__pyx_tuple__26);
5801   __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastavro__six_pyx, __pyx_n_s_py3_fstint, 48, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 48, __pyx_L1_error)
5802 
5803   /* "fastavro/_six.pyx":51
5804  *         return datum[0]
5805  *
5806  *     def py3_appendable(file_like):             # <<<<<<<<<<<<<<
5807  *         if file_like.seekable() and file_like.tell() != 0:
5808  *             if "<stdout>" == getattr(file_like, "name", ""):
5809  */
5810   __pyx_tuple__28 = PyTuple_Pack(1, __pyx_n_s_file_like); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 51, __pyx_L1_error)
5811   __Pyx_GOTREF(__pyx_tuple__28);
5812   __Pyx_GIVEREF(__pyx_tuple__28);
5813   __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastavro__six_pyx, __pyx_n_s_py3_appendable, 51, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 51, __pyx_L1_error)
5814 
5815   /* "fastavro/_six.pyx":68
5816  *             return False
5817  *
5818  *     def py3_int_to_be_signed_bytes(num, bytes_req):             # <<<<<<<<<<<<<<
5819  *         return num.to_bytes(bytes_req, byteorder='big', signed=True)
5820  *
5821  */
5822   __pyx_tuple__30 = PyTuple_Pack(2, __pyx_n_s_num, __pyx_n_s_bytes_req); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 68, __pyx_L1_error)
5823   __Pyx_GOTREF(__pyx_tuple__30);
5824   __Pyx_GIVEREF(__pyx_tuple__30);
5825   __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastavro__six_pyx, __pyx_n_s_py3_int_to_be_signed_bytes, 68, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 68, __pyx_L1_error)
5826 
5827   /* "fastavro/_six.pyx":71
5828  *         return num.to_bytes(bytes_req, byteorder='big', signed=True)
5829  *
5830  *     def py3_be_signed_bytes_to_int(data):             # <<<<<<<<<<<<<<
5831  *         return int.from_bytes(data, byteorder='big', signed=True)
5832  *
5833  */
5834   __pyx_tuple__32 = PyTuple_Pack(1, __pyx_n_s_data); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 71, __pyx_L1_error)
5835   __Pyx_GOTREF(__pyx_tuple__32);
5836   __Pyx_GIVEREF(__pyx_tuple__32);
5837   __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastavro__six_pyx, __pyx_n_s_py3_be_signed_bytes_to_int, 71, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 71, __pyx_L1_error)
5838 
5839   /* "fastavro/_six.pyx":74
5840  *         return int.from_bytes(data, byteorder='big', signed=True)
5841  *
5842  *     def py3_reraise(Err, msg):             # <<<<<<<<<<<<<<
5843  *         raise Err(msg).with_traceback(sys.exc_info()[2])
5844  *
5845  */
5846   __pyx_tuple__34 = PyTuple_Pack(2, __pyx_n_s_Err, __pyx_n_s_msg); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 74, __pyx_L1_error)
5847   __Pyx_GOTREF(__pyx_tuple__34);
5848   __Pyx_GIVEREF(__pyx_tuple__34);
5849   __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 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_fastavro__six_pyx, __pyx_n_s_py3_reraise, 74, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 74, __pyx_L1_error)
5850 
5851   /* "fastavro/_six.pyx":83
5852  *     xrange = xrange
5853  *
5854  *     def py2_btou(n, encoding=_encoding):             # <<<<<<<<<<<<<<
5855  *         return unicode(n, encoding)  # noqa
5856  *
5857  */
5858   __pyx_tuple__36 = PyTuple_Pack(2, __pyx_n_s_n, __pyx_n_s_encoding); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 83, __pyx_L1_error)
5859   __Pyx_GOTREF(__pyx_tuple__36);
5860   __Pyx_GIVEREF(__pyx_tuple__36);
5861   __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastavro__six_pyx, __pyx_n_s_py2_btou, 83, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 83, __pyx_L1_error)
5862 
5863   /* "fastavro/_six.pyx":86
5864  *         return unicode(n, encoding)  # noqa
5865  *
5866  *     def py2_utob(n, encoding=_encoding):             # <<<<<<<<<<<<<<
5867  *         return n.encode(encoding)
5868  *
5869  */
5870   __pyx_tuple__38 = PyTuple_Pack(2, __pyx_n_s_n, __pyx_n_s_encoding); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 86, __pyx_L1_error)
5871   __Pyx_GOTREF(__pyx_tuple__38);
5872   __Pyx_GIVEREF(__pyx_tuple__38);
5873   __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastavro__six_pyx, __pyx_n_s_py2_utob, 86, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 86, __pyx_L1_error)
5874 
5875   /* "fastavro/_six.pyx":91
5876  *     _outenc = getattr(sys.stdout, 'encoding', None) or _encoding
5877  *
5878  *     def py2_json_dump(obj, **kwargs):             # <<<<<<<<<<<<<<
5879  *         json.dump(obj, sys.stdout, encoding=_outenc, **kwargs)
5880  *
5881  */
5882   __pyx_tuple__40 = PyTuple_Pack(2, __pyx_n_s_obj, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 91, __pyx_L1_error)
5883   __Pyx_GOTREF(__pyx_tuple__40);
5884   __Pyx_GIVEREF(__pyx_tuple__40);
5885   __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastavro__six_pyx, __pyx_n_s_py2_json_dump, 91, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 91, __pyx_L1_error)
5886 
5887   /* "fastavro/_six.pyx":94
5888  *         json.dump(obj, sys.stdout, encoding=_outenc, **kwargs)
5889  *
5890  *     def py2_iterkeys(obj):             # <<<<<<<<<<<<<<
5891  *         return obj.iterkeys()
5892  *
5893  */
5894   __pyx_tuple__42 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 94, __pyx_L1_error)
5895   __Pyx_GOTREF(__pyx_tuple__42);
5896   __Pyx_GIVEREF(__pyx_tuple__42);
5897   __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastavro__six_pyx, __pyx_n_s_py2_iterkeys, 94, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 94, __pyx_L1_error)
5898 
5899   /* "fastavro/_six.pyx":97
5900  *         return obj.iterkeys()
5901  *
5902  *     def py2_itervalues(obj):             # <<<<<<<<<<<<<<
5903  *         return obj.itervalues()
5904  *
5905  */
5906   __pyx_tuple__44 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 97, __pyx_L1_error)
5907   __Pyx_GOTREF(__pyx_tuple__44);
5908   __Pyx_GIVEREF(__pyx_tuple__44);
5909   __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastavro__six_pyx, __pyx_n_s_py2_itervalues, 97, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 97, __pyx_L1_error)
5910 
5911   /* "fastavro/_six.pyx":100
5912  *         return obj.itervalues()
5913  *
5914  *     def py2_iteritems(obj):             # <<<<<<<<<<<<<<
5915  *         return obj.iteritems()
5916  *
5917  */
5918   __pyx_tuple__46 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 100, __pyx_L1_error)
5919   __Pyx_GOTREF(__pyx_tuple__46);
5920   __Pyx_GIVEREF(__pyx_tuple__46);
5921   __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastavro__six_pyx, __pyx_n_s_py2_iteritems, 100, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 100, __pyx_L1_error)
5922 
5923   /* "fastavro/_six.pyx":103
5924  *         return obj.iteritems()
5925  *
5926  *     def py2_is_str(obj):             # <<<<<<<<<<<<<<
5927  *         return isinstance(obj, basestring)  # noqa
5928  *
5929  */
5930   __pyx_tuple__48 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 103, __pyx_L1_error)
5931   __Pyx_GOTREF(__pyx_tuple__48);
5932   __Pyx_GIVEREF(__pyx_tuple__48);
5933   __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastavro__six_pyx, __pyx_n_s_py2_is_str, 103, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 103, __pyx_L1_error)
5934 
5935   /* "fastavro/_six.pyx":106
5936  *         return isinstance(obj, basestring)  # noqa
5937  *
5938  *     def py2_mk_bits(bits):             # <<<<<<<<<<<<<<
5939  *         return chr(bits & 0xff)
5940  *
5941  */
5942   __pyx_tuple__50 = PyTuple_Pack(1, __pyx_n_s_bits); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 106, __pyx_L1_error)
5943   __Pyx_GOTREF(__pyx_tuple__50);
5944   __Pyx_GIVEREF(__pyx_tuple__50);
5945   __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastavro__six_pyx, __pyx_n_s_py2_mk_bits, 106, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 106, __pyx_L1_error)
5946 
5947   /* "fastavro/_six.pyx":109
5948  *         return chr(bits & 0xff)
5949  *
5950  *     def py2_str2ints(datum):             # <<<<<<<<<<<<<<
5951  *         return map(lambda x: ord(x), datum)
5952  *
5953  */
5954   __pyx_tuple__52 = PyTuple_Pack(1, __pyx_n_s_datum); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 109, __pyx_L1_error)
5955   __Pyx_GOTREF(__pyx_tuple__52);
5956   __Pyx_GIVEREF(__pyx_tuple__52);
5957   __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastavro__six_pyx, __pyx_n_s_py2_str2ints, 109, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 109, __pyx_L1_error)
5958 
5959   /* "fastavro/_six.pyx":112
5960  *         return map(lambda x: ord(x), datum)
5961  *
5962  *     def py2_fstint(datum):             # <<<<<<<<<<<<<<
5963  *         return unpack('!b', datum[0])[0]
5964  *
5965  */
5966   __pyx_tuple__54 = PyTuple_Pack(1, __pyx_n_s_datum); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 112, __pyx_L1_error)
5967   __Pyx_GOTREF(__pyx_tuple__54);
5968   __Pyx_GIVEREF(__pyx_tuple__54);
5969   __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastavro__six_pyx, __pyx_n_s_py2_fstint, 112, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 112, __pyx_L1_error)
5970 
5971   /* "fastavro/_six.pyx":115
5972  *         return unpack('!b', datum[0])[0]
5973  *
5974  *     def _readable(file_like):             # <<<<<<<<<<<<<<
5975  *         try:
5976  *             file_like.read()
5977  */
5978   __pyx_tuple__56 = PyTuple_Pack(1, __pyx_n_s_file_like); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 115, __pyx_L1_error)
5979   __Pyx_GOTREF(__pyx_tuple__56);
5980   __Pyx_GIVEREF(__pyx_tuple__56);
5981   __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastavro__six_pyx, __pyx_n_s_readable_2, 115, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 115, __pyx_L1_error)
5982 
5983   /* "fastavro/_six.pyx":122
5984  *         return True
5985  *
5986  *     def py2_appendable(file_like):             # <<<<<<<<<<<<<<
5987  *         # On Python 2 things are a mess. We basically just rely on looking at
5988  *         # the mode. If that doesn't exist (like in the case of an io.BytesIO)
5989  */
5990   __pyx_tuple__58 = PyTuple_Pack(1, __pyx_n_s_file_like); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 122, __pyx_L1_error)
5991   __Pyx_GOTREF(__pyx_tuple__58);
5992   __Pyx_GIVEREF(__pyx_tuple__58);
5993   __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastavro__six_pyx, __pyx_n_s_py2_appendable, 122, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 122, __pyx_L1_error)
5994 
5995   /* "fastavro/_six.pyx":148
5996  *             return False
5997  *
5998  *     def py2_int_to_be_signed_bytes(num, bytes_req):             # <<<<<<<<<<<<<<
5999  *         if num < 0:
6000  *             num = 2 ** (8 * bytes_req) + num
6001  */
6002   __pyx_tuple__60 = PyTuple_Pack(3, __pyx_n_s_num, __pyx_n_s_bytes_req, __pyx_n_s_hex_str); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 148, __pyx_L1_error)
6003   __Pyx_GOTREF(__pyx_tuple__60);
6004   __Pyx_GIVEREF(__pyx_tuple__60);
6005   __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastavro__six_pyx, __pyx_n_s_py2_int_to_be_signed_bytes, 148, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(0, 148, __pyx_L1_error)
6006 
6007   /* "fastavro/_six.pyx":155
6008  *         return hex_str.decode('hex')
6009  *
6010  *     def py2_be_signed_bytes_to_int(data):             # <<<<<<<<<<<<<<
6011  *         output = int(data.encode('hex'), 16)
6012  *         bitsize = len(data) * 8
6013  */
6014   __pyx_tuple__62 = PyTuple_Pack(3, __pyx_n_s_data, __pyx_n_s_output, __pyx_n_s_bitsize); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 155, __pyx_L1_error)
6015   __Pyx_GOTREF(__pyx_tuple__62);
6016   __Pyx_GIVEREF(__pyx_tuple__62);
6017   __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastavro__six_pyx, __pyx_n_s_py2_be_signed_bytes_to_int, 155, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(0, 155, __pyx_L1_error)
6018 
6019   /* "fastavro/_six.pyx":162
6020  *         return output - (2 ** bitsize)
6021  *
6022  *     def py2_reraise(Err, msg):             # <<<<<<<<<<<<<<
6023  *         traceback = sys.exc_info()[2]
6024  *         _locals = {'Err': Err, 'msg': msg, 'traceback': traceback}
6025  */
6026   __pyx_tuple__64 = PyTuple_Pack(4, __pyx_n_s_Err, __pyx_n_s_msg, __pyx_n_s_traceback, __pyx_n_s_locals); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 162, __pyx_L1_error)
6027   __Pyx_GOTREF(__pyx_tuple__64);
6028   __Pyx_GIVEREF(__pyx_tuple__64);
6029   __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastavro__six_pyx, __pyx_n_s_py2_reraise, 162, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 162, __pyx_L1_error)
6030   __Pyx_RefNannyFinishContext();
6031   return 0;
6032   __pyx_L1_error:;
6033   __Pyx_RefNannyFinishContext();
6034   return -1;
6035 }
6036 
__Pyx_InitGlobals(void)6037 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
6038   if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
6039   __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
6040   __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
6041   __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
6042   __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
6043   __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) __PYX_ERR(0, 1, __pyx_L1_error)
6044   __pyx_int_16 = PyInt_FromLong(16); if (unlikely(!__pyx_int_16)) __PYX_ERR(0, 1, __pyx_L1_error)
6045   __pyx_int_255 = PyInt_FromLong(255); if (unlikely(!__pyx_int_255)) __PYX_ERR(0, 1, __pyx_L1_error)
6046   return 0;
6047   __pyx_L1_error:;
6048   return -1;
6049 }
6050 
6051 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
6052 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
6053 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
6054 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
6055 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
6056 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
6057 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
6058 
__Pyx_modinit_global_init_code(void)6059 static int __Pyx_modinit_global_init_code(void) {
6060   __Pyx_RefNannyDeclarations
6061   __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
6062   /*--- Global init code ---*/
6063   __Pyx_RefNannyFinishContext();
6064   return 0;
6065 }
6066 
__Pyx_modinit_variable_export_code(void)6067 static int __Pyx_modinit_variable_export_code(void) {
6068   __Pyx_RefNannyDeclarations
6069   __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
6070   /*--- Variable export code ---*/
6071   __Pyx_RefNannyFinishContext();
6072   return 0;
6073 }
6074 
__Pyx_modinit_function_export_code(void)6075 static int __Pyx_modinit_function_export_code(void) {
6076   __Pyx_RefNannyDeclarations
6077   __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
6078   /*--- Function export code ---*/
6079   __Pyx_RefNannyFinishContext();
6080   return 0;
6081 }
6082 
__Pyx_modinit_type_init_code(void)6083 static int __Pyx_modinit_type_init_code(void) {
6084   __Pyx_RefNannyDeclarations
6085   __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
6086   /*--- Type init code ---*/
6087   __Pyx_RefNannyFinishContext();
6088   return 0;
6089 }
6090 
__Pyx_modinit_type_import_code(void)6091 static int __Pyx_modinit_type_import_code(void) {
6092   __Pyx_RefNannyDeclarations
6093   __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
6094   /*--- Type import code ---*/
6095   __Pyx_RefNannyFinishContext();
6096   return 0;
6097 }
6098 
__Pyx_modinit_variable_import_code(void)6099 static int __Pyx_modinit_variable_import_code(void) {
6100   __Pyx_RefNannyDeclarations
6101   __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
6102   /*--- Variable import code ---*/
6103   __Pyx_RefNannyFinishContext();
6104   return 0;
6105 }
6106 
__Pyx_modinit_function_import_code(void)6107 static int __Pyx_modinit_function_import_code(void) {
6108   __Pyx_RefNannyDeclarations
6109   __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
6110   /*--- Function import code ---*/
6111   __Pyx_RefNannyFinishContext();
6112   return 0;
6113 }
6114 
6115 
6116 #ifndef CYTHON_NO_PYINIT_EXPORT
6117 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
6118 #elif PY_MAJOR_VERSION < 3
6119 #ifdef __cplusplus
6120 #define __Pyx_PyMODINIT_FUNC extern "C" void
6121 #else
6122 #define __Pyx_PyMODINIT_FUNC void
6123 #endif
6124 #else
6125 #ifdef __cplusplus
6126 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
6127 #else
6128 #define __Pyx_PyMODINIT_FUNC PyObject *
6129 #endif
6130 #endif
6131 
6132 
6133 #if PY_MAJOR_VERSION < 3
6134 __Pyx_PyMODINIT_FUNC init_six(void) CYTHON_SMALL_CODE; /*proto*/
init_six(void)6135 __Pyx_PyMODINIT_FUNC init_six(void)
6136 #else
6137 __Pyx_PyMODINIT_FUNC PyInit__six(void) CYTHON_SMALL_CODE; /*proto*/
6138 __Pyx_PyMODINIT_FUNC PyInit__six(void)
6139 #if CYTHON_PEP489_MULTI_PHASE_INIT
6140 {
6141   return PyModuleDef_Init(&__pyx_moduledef);
6142 }
6143 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
6144     #if PY_VERSION_HEX >= 0x030700A1
6145     static PY_INT64_T main_interpreter_id = -1;
6146     PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
6147     if (main_interpreter_id == -1) {
6148         main_interpreter_id = current_id;
6149         return (unlikely(current_id == -1)) ? -1 : 0;
6150     } else if (unlikely(main_interpreter_id != current_id))
6151     #else
6152     static PyInterpreterState *main_interpreter = NULL;
6153     PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
6154     if (!main_interpreter) {
6155         main_interpreter = current_interpreter;
6156     } else if (unlikely(main_interpreter != current_interpreter))
6157     #endif
6158     {
6159         PyErr_SetString(
6160             PyExc_ImportError,
6161             "Interpreter change detected - this module can only be loaded into one interpreter per process.");
6162         return -1;
6163     }
6164     return 0;
6165 }
6166 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) {
6167     PyObject *value = PyObject_GetAttrString(spec, from_name);
6168     int result = 0;
6169     if (likely(value)) {
6170         if (allow_none || value != Py_None) {
6171             result = PyDict_SetItemString(moddict, to_name, value);
6172         }
6173         Py_DECREF(value);
6174     } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
6175         PyErr_Clear();
6176     } else {
6177         result = -1;
6178     }
6179     return result;
6180 }
6181 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
6182     PyObject *module = NULL, *moddict, *modname;
6183     if (__Pyx_check_single_interpreter())
6184         return NULL;
6185     if (__pyx_m)
6186         return __Pyx_NewRef(__pyx_m);
6187     modname = PyObject_GetAttrString(spec, "name");
6188     if (unlikely(!modname)) goto bad;
6189     module = PyModule_NewObject(modname);
6190     Py_DECREF(modname);
6191     if (unlikely(!module)) goto bad;
6192     moddict = PyModule_GetDict(module);
6193     if (unlikely(!moddict)) goto bad;
6194     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
6195     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
6196     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
6197     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
6198     return module;
6199 bad:
6200     Py_XDECREF(module);
6201     return NULL;
6202 }
6203 
6204 
6205 static CYTHON_SMALL_CODE int __pyx_pymod_exec__six(PyObject *__pyx_pyinit_module)
6206 #endif
6207 #endif
6208 {
6209   PyObject *__pyx_t_1 = NULL;
6210   PyObject *__pyx_t_2 = NULL;
6211   int __pyx_t_3;
6212   PyObject *__pyx_t_4 = NULL;
6213   int __pyx_lineno = 0;
6214   const char *__pyx_filename = NULL;
6215   int __pyx_clineno = 0;
6216   __Pyx_RefNannyDeclarations
6217   #if CYTHON_PEP489_MULTI_PHASE_INIT
6218   if (__pyx_m) {
6219     if (__pyx_m == __pyx_pyinit_module) return 0;
6220     PyErr_SetString(PyExc_RuntimeError, "Module '_six' has already been imported. Re-initialisation is not supported.");
6221     return -1;
6222   }
6223   #elif PY_MAJOR_VERSION >= 3
6224   if (__pyx_m) return __Pyx_NewRef(__pyx_m);
6225   #endif
6226   #if CYTHON_REFNANNY
6227 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
6228 if (!__Pyx_RefNanny) {
6229   PyErr_Clear();
6230   __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
6231   if (!__Pyx_RefNanny)
6232       Py_FatalError("failed to import 'refnanny' module");
6233 }
6234 #endif
6235   __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__six(void)", 0);
6236   if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6237   #ifdef __Pxy_PyFrame_Initialize_Offsets
6238   __Pxy_PyFrame_Initialize_Offsets();
6239   #endif
6240   __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
6241   __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
6242   __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
6243   #ifdef __Pyx_CyFunction_USED
6244   if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6245   #endif
6246   #ifdef __Pyx_FusedFunction_USED
6247   if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6248   #endif
6249   #ifdef __Pyx_Coroutine_USED
6250   if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6251   #endif
6252   #ifdef __Pyx_Generator_USED
6253   if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6254   #endif
6255   #ifdef __Pyx_AsyncGen_USED
6256   if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6257   #endif
6258   #ifdef __Pyx_StopAsyncIteration_USED
6259   if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6260   #endif
6261   /*--- Library function declarations ---*/
6262   /*--- Threads initialization code ---*/
6263   #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
6264   #ifdef WITH_THREAD /* Python build with threading support? */
6265   PyEval_InitThreads();
6266   #endif
6267   #endif
6268   /*--- Module creation code ---*/
6269   #if CYTHON_PEP489_MULTI_PHASE_INIT
6270   __pyx_m = __pyx_pyinit_module;
6271   Py_INCREF(__pyx_m);
6272   #else
6273   #if PY_MAJOR_VERSION < 3
6274   __pyx_m = Py_InitModule4("_six", __pyx_methods, __pyx_k_Compatiblity_for_Python_versions, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
6275   #else
6276   __pyx_m = PyModule_Create(&__pyx_moduledef);
6277   #endif
6278   if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
6279   #endif
6280   __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
6281   Py_INCREF(__pyx_d);
6282   __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
6283   Py_INCREF(__pyx_b);
6284   __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
6285   Py_INCREF(__pyx_cython_runtime);
6286   if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
6287   /*--- Initialize various global constants etc. ---*/
6288   if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6289   #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
6290   if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6291   #endif
6292   if (__pyx_module_is_main_fastavro___six) {
6293     if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6294   }
6295   #if PY_MAJOR_VERSION >= 3
6296   {
6297     PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
6298     if (!PyDict_GetItemString(modules, "fastavro._six")) {
6299       if (unlikely(PyDict_SetItemString(modules, "fastavro._six", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
6300     }
6301   }
6302   #endif
6303   /*--- Builtin init code ---*/
6304   if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6305   /*--- Constants init code ---*/
6306   if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6307   /*--- Global type/function init code ---*/
6308   (void)__Pyx_modinit_global_init_code();
6309   (void)__Pyx_modinit_variable_export_code();
6310   (void)__Pyx_modinit_function_export_code();
6311   (void)__Pyx_modinit_type_init_code();
6312   (void)__Pyx_modinit_type_import_code();
6313   (void)__Pyx_modinit_variable_import_code();
6314   (void)__Pyx_modinit_function_import_code();
6315   /*--- Execution code ---*/
6316   #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
6317   if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6318   #endif
6319 
6320   /* "fastavro/_six.pyx":9
6321  * '''
6322  * from __future__ import absolute_import
6323  * import sys             # <<<<<<<<<<<<<<
6324  * from struct import unpack
6325  *
6326  */
6327   __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
6328   __Pyx_GOTREF(__pyx_t_1);
6329   if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
6330   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6331 
6332   /* "fastavro/_six.pyx":10
6333  * from __future__ import absolute_import
6334  * import sys
6335  * from struct import unpack             # <<<<<<<<<<<<<<
6336  *
6337  * import json
6338  */
6339   __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
6340   __Pyx_GOTREF(__pyx_t_1);
6341   __Pyx_INCREF(__pyx_n_s_unpack);
6342   __Pyx_GIVEREF(__pyx_n_s_unpack);
6343   PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_unpack);
6344   __pyx_t_2 = __Pyx_Import(__pyx_n_s_struct, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error)
6345   __Pyx_GOTREF(__pyx_t_2);
6346   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6347   __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_unpack); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
6348   __Pyx_GOTREF(__pyx_t_1);
6349   if (PyDict_SetItem(__pyx_d, __pyx_n_s_unpack, __pyx_t_1) < 0) __PYX_ERR(0, 10, __pyx_L1_error)
6350   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6351   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6352 
6353   /* "fastavro/_six.pyx":12
6354  * from struct import unpack
6355  *
6356  * import json             # <<<<<<<<<<<<<<
6357  *
6358  * _encoding = 'UTF-8'
6359  */
6360   __pyx_t_2 = __Pyx_Import(__pyx_n_s_json, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error)
6361   __Pyx_GOTREF(__pyx_t_2);
6362   if (PyDict_SetItem(__pyx_d, __pyx_n_s_json, __pyx_t_2) < 0) __PYX_ERR(0, 12, __pyx_L1_error)
6363   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6364 
6365   /* "fastavro/_six.pyx":14
6366  * import json
6367  *
6368  * _encoding = 'UTF-8'             # <<<<<<<<<<<<<<
6369  *
6370  * if sys.version_info >= (3, 0):
6371  */
6372   if (PyDict_SetItem(__pyx_d, __pyx_n_s_encoding_2, __pyx_kp_s_UTF_8) < 0) __PYX_ERR(0, 14, __pyx_L1_error)
6373 
6374   /* "fastavro/_six.pyx":16
6375  * _encoding = 'UTF-8'
6376  *
6377  * if sys.version_info >= (3, 0):             # <<<<<<<<<<<<<<
6378  *     from io import BytesIO as MemoryIO
6379  *     from io import StringIO as StringIO
6380  */
6381   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error)
6382   __Pyx_GOTREF(__pyx_t_2);
6383   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_version_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
6384   __Pyx_GOTREF(__pyx_t_1);
6385   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6386   __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_tuple__7, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error)
6387   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6388   __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 16, __pyx_L1_error)
6389   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6390   if (__pyx_t_3) {
6391 
6392     /* "fastavro/_six.pyx":17
6393  *
6394  * if sys.version_info >= (3, 0):
6395  *     from io import BytesIO as MemoryIO             # <<<<<<<<<<<<<<
6396  *     from io import StringIO as StringIO
6397  *     xrange = range
6398  */
6399     __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error)
6400     __Pyx_GOTREF(__pyx_t_2);
6401     __Pyx_INCREF(__pyx_n_s_BytesIO);
6402     __Pyx_GIVEREF(__pyx_n_s_BytesIO);
6403     PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_BytesIO);
6404     __pyx_t_1 = __Pyx_Import(__pyx_n_s_io, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error)
6405     __Pyx_GOTREF(__pyx_t_1);
6406     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6407     __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_BytesIO); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error)
6408     __Pyx_GOTREF(__pyx_t_2);
6409     if (PyDict_SetItem(__pyx_d, __pyx_n_s_MemoryIO, __pyx_t_2) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
6410     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6411     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6412 
6413     /* "fastavro/_six.pyx":18
6414  * if sys.version_info >= (3, 0):
6415  *     from io import BytesIO as MemoryIO
6416  *     from io import StringIO as StringIO             # <<<<<<<<<<<<<<
6417  *     xrange = range
6418  *
6419  */
6420     __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error)
6421     __Pyx_GOTREF(__pyx_t_1);
6422     __Pyx_INCREF(__pyx_n_s_StringIO);
6423     __Pyx_GIVEREF(__pyx_n_s_StringIO);
6424     PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_StringIO);
6425     __pyx_t_2 = __Pyx_Import(__pyx_n_s_io, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error)
6426     __Pyx_GOTREF(__pyx_t_2);
6427     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6428     __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_StringIO); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error)
6429     __Pyx_GOTREF(__pyx_t_1);
6430     if (PyDict_SetItem(__pyx_d, __pyx_n_s_StringIO, __pyx_t_1) < 0) __PYX_ERR(0, 18, __pyx_L1_error)
6431     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6432     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6433 
6434     /* "fastavro/_six.pyx":19
6435  *     from io import BytesIO as MemoryIO
6436  *     from io import StringIO as StringIO
6437  *     xrange = range             # <<<<<<<<<<<<<<
6438  *
6439  *     def py3_btou(n, encoding=_encoding):
6440  */
6441     if (PyDict_SetItem(__pyx_d, __pyx_n_s_xrange, __pyx_builtin_range) < 0) __PYX_ERR(0, 19, __pyx_L1_error)
6442 
6443     /* "fastavro/_six.pyx":21
6444  *     xrange = range
6445  *
6446  *     def py3_btou(n, encoding=_encoding):             # <<<<<<<<<<<<<<
6447  *         return n.decode(encoding)
6448  *
6449  */
6450     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encoding_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error)
6451     __Pyx_GOTREF(__pyx_t_2);
6452     __pyx_k_ = __pyx_t_2;
6453     __Pyx_GIVEREF(__pyx_t_2);
6454     __pyx_t_2 = 0;
6455     __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8fastavro_4_six_1py3_btou, NULL, __pyx_n_s_fastavro__six); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error)
6456     __Pyx_GOTREF(__pyx_t_2);
6457     if (PyDict_SetItem(__pyx_d, __pyx_n_s_py3_btou, __pyx_t_2) < 0) __PYX_ERR(0, 21, __pyx_L1_error)
6458     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6459 
6460     /* "fastavro/_six.pyx":24
6461  *         return n.decode(encoding)
6462  *
6463  *     def py3_utob(n, encoding=_encoding):             # <<<<<<<<<<<<<<
6464  *         return bytes(n, encoding)
6465  *
6466  */
6467     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encoding_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
6468     __Pyx_GOTREF(__pyx_t_2);
6469     __pyx_k__2 = __pyx_t_2;
6470     __Pyx_GIVEREF(__pyx_t_2);
6471     __pyx_t_2 = 0;
6472     __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8fastavro_4_six_3py3_utob, NULL, __pyx_n_s_fastavro__six); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
6473     __Pyx_GOTREF(__pyx_t_2);
6474     if (PyDict_SetItem(__pyx_d, __pyx_n_s_py3_utob, __pyx_t_2) < 0) __PYX_ERR(0, 24, __pyx_L1_error)
6475     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6476 
6477     /* "fastavro/_six.pyx":27
6478  *         return bytes(n, encoding)
6479  *
6480  *     def py3_json_dump(obj, **kwargs):             # <<<<<<<<<<<<<<
6481  *         json.dump(obj, sys.stdout, **kwargs)
6482  *
6483  */
6484     __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8fastavro_4_six_5py3_json_dump, NULL, __pyx_n_s_fastavro__six); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
6485     __Pyx_GOTREF(__pyx_t_2);
6486     if (PyDict_SetItem(__pyx_d, __pyx_n_s_py3_json_dump, __pyx_t_2) < 0) __PYX_ERR(0, 27, __pyx_L1_error)
6487     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6488 
6489     /* "fastavro/_six.pyx":30
6490  *         json.dump(obj, sys.stdout, **kwargs)
6491  *
6492  *     def py3_iterkeys(obj):             # <<<<<<<<<<<<<<
6493  *         return obj.keys()
6494  *
6495  */
6496     __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8fastavro_4_six_7py3_iterkeys, NULL, __pyx_n_s_fastavro__six); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error)
6497     __Pyx_GOTREF(__pyx_t_2);
6498     if (PyDict_SetItem(__pyx_d, __pyx_n_s_py3_iterkeys, __pyx_t_2) < 0) __PYX_ERR(0, 30, __pyx_L1_error)
6499     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6500 
6501     /* "fastavro/_six.pyx":33
6502  *         return obj.keys()
6503  *
6504  *     def py3_itervalues(obj):             # <<<<<<<<<<<<<<
6505  *         return obj.values()
6506  *
6507  */
6508     __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8fastavro_4_six_9py3_itervalues, NULL, __pyx_n_s_fastavro__six); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error)
6509     __Pyx_GOTREF(__pyx_t_2);
6510     if (PyDict_SetItem(__pyx_d, __pyx_n_s_py3_itervalues, __pyx_t_2) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
6511     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6512 
6513     /* "fastavro/_six.pyx":36
6514  *         return obj.values()
6515  *
6516  *     def py3_iteritems(obj):             # <<<<<<<<<<<<<<
6517  *         return obj.items()
6518  *
6519  */
6520     __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8fastavro_4_six_11py3_iteritems, NULL, __pyx_n_s_fastavro__six); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error)
6521     __Pyx_GOTREF(__pyx_t_2);
6522     if (PyDict_SetItem(__pyx_d, __pyx_n_s_py3_iteritems, __pyx_t_2) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
6523     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6524 
6525     /* "fastavro/_six.pyx":39
6526  *         return obj.items()
6527  *
6528  *     def py3_is_str(obj):             # <<<<<<<<<<<<<<
6529  *         return isinstance(obj, str)
6530  *
6531  */
6532     __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8fastavro_4_six_13py3_is_str, NULL, __pyx_n_s_fastavro__six); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error)
6533     __Pyx_GOTREF(__pyx_t_2);
6534     if (PyDict_SetItem(__pyx_d, __pyx_n_s_py3_is_str, __pyx_t_2) < 0) __PYX_ERR(0, 39, __pyx_L1_error)
6535     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6536 
6537     /* "fastavro/_six.pyx":42
6538  *         return isinstance(obj, str)
6539  *
6540  *     def py3_mk_bits(bits):             # <<<<<<<<<<<<<<
6541  *         return bytes([bits & 0xff])
6542  *
6543  */
6544     __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8fastavro_4_six_15py3_mk_bits, NULL, __pyx_n_s_fastavro__six); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error)
6545     __Pyx_GOTREF(__pyx_t_2);
6546     if (PyDict_SetItem(__pyx_d, __pyx_n_s_py3_mk_bits, __pyx_t_2) < 0) __PYX_ERR(0, 42, __pyx_L1_error)
6547     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6548 
6549     /* "fastavro/_six.pyx":45
6550  *         return bytes([bits & 0xff])
6551  *
6552  *     def py3_bytes2ints(datum):             # <<<<<<<<<<<<<<
6553  *         return list(datum)
6554  *
6555  */
6556     __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8fastavro_4_six_17py3_bytes2ints, NULL, __pyx_n_s_fastavro__six); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error)
6557     __Pyx_GOTREF(__pyx_t_2);
6558     if (PyDict_SetItem(__pyx_d, __pyx_n_s_py3_bytes2ints, __pyx_t_2) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
6559     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6560 
6561     /* "fastavro/_six.pyx":48
6562  *         return list(datum)
6563  *
6564  *     def py3_fstint(datum):             # <<<<<<<<<<<<<<
6565  *         return datum[0]
6566  *
6567  */
6568     __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8fastavro_4_six_19py3_fstint, NULL, __pyx_n_s_fastavro__six); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error)
6569     __Pyx_GOTREF(__pyx_t_2);
6570     if (PyDict_SetItem(__pyx_d, __pyx_n_s_py3_fstint, __pyx_t_2) < 0) __PYX_ERR(0, 48, __pyx_L1_error)
6571     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6572 
6573     /* "fastavro/_six.pyx":51
6574  *         return datum[0]
6575  *
6576  *     def py3_appendable(file_like):             # <<<<<<<<<<<<<<
6577  *         if file_like.seekable() and file_like.tell() != 0:
6578  *             if "<stdout>" == getattr(file_like, "name", ""):
6579  */
6580     __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8fastavro_4_six_21py3_appendable, NULL, __pyx_n_s_fastavro__six); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error)
6581     __Pyx_GOTREF(__pyx_t_2);
6582     if (PyDict_SetItem(__pyx_d, __pyx_n_s_py3_appendable, __pyx_t_2) < 0) __PYX_ERR(0, 51, __pyx_L1_error)
6583     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6584 
6585     /* "fastavro/_six.pyx":68
6586  *             return False
6587  *
6588  *     def py3_int_to_be_signed_bytes(num, bytes_req):             # <<<<<<<<<<<<<<
6589  *         return num.to_bytes(bytes_req, byteorder='big', signed=True)
6590  *
6591  */
6592     __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8fastavro_4_six_23py3_int_to_be_signed_bytes, NULL, __pyx_n_s_fastavro__six); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 68, __pyx_L1_error)
6593     __Pyx_GOTREF(__pyx_t_2);
6594     if (PyDict_SetItem(__pyx_d, __pyx_n_s_py3_int_to_be_signed_bytes, __pyx_t_2) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
6595     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6596 
6597     /* "fastavro/_six.pyx":71
6598  *         return num.to_bytes(bytes_req, byteorder='big', signed=True)
6599  *
6600  *     def py3_be_signed_bytes_to_int(data):             # <<<<<<<<<<<<<<
6601  *         return int.from_bytes(data, byteorder='big', signed=True)
6602  *
6603  */
6604     __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8fastavro_4_six_25py3_be_signed_bytes_to_int, NULL, __pyx_n_s_fastavro__six); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error)
6605     __Pyx_GOTREF(__pyx_t_2);
6606     if (PyDict_SetItem(__pyx_d, __pyx_n_s_py3_be_signed_bytes_to_int, __pyx_t_2) < 0) __PYX_ERR(0, 71, __pyx_L1_error)
6607     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6608 
6609     /* "fastavro/_six.pyx":74
6610  *         return int.from_bytes(data, byteorder='big', signed=True)
6611  *
6612  *     def py3_reraise(Err, msg):             # <<<<<<<<<<<<<<
6613  *         raise Err(msg).with_traceback(sys.exc_info()[2])
6614  *
6615  */
6616     __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8fastavro_4_six_27py3_reraise, NULL, __pyx_n_s_fastavro__six); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 74, __pyx_L1_error)
6617     __Pyx_GOTREF(__pyx_t_2);
6618     if (PyDict_SetItem(__pyx_d, __pyx_n_s_py3_reraise, __pyx_t_2) < 0) __PYX_ERR(0, 74, __pyx_L1_error)
6619     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6620 
6621     /* "fastavro/_six.pyx":16
6622  * _encoding = 'UTF-8'
6623  *
6624  * if sys.version_info >= (3, 0):             # <<<<<<<<<<<<<<
6625  *     from io import BytesIO as MemoryIO
6626  *     from io import StringIO as StringIO
6627  */
6628     goto __pyx_L2;
6629   }
6630 
6631   /* "fastavro/_six.pyx":79
6632  *
6633  * else:  # Python 2x
6634  *     from cStringIO import StringIO as MemoryIO  # noqa             # <<<<<<<<<<<<<<
6635  *     from cStringIO import StringIO as StringIO  # noqa
6636  *     xrange = xrange
6637  */
6638   /*else*/ {
6639     __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 79, __pyx_L1_error)
6640     __Pyx_GOTREF(__pyx_t_2);
6641     __Pyx_INCREF(__pyx_n_s_StringIO);
6642     __Pyx_GIVEREF(__pyx_n_s_StringIO);
6643     PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_StringIO);
6644     __pyx_t_1 = __Pyx_Import(__pyx_n_s_cStringIO, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error)
6645     __Pyx_GOTREF(__pyx_t_1);
6646     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6647     __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_StringIO); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 79, __pyx_L1_error)
6648     __Pyx_GOTREF(__pyx_t_2);
6649     if (PyDict_SetItem(__pyx_d, __pyx_n_s_MemoryIO, __pyx_t_2) < 0) __PYX_ERR(0, 79, __pyx_L1_error)
6650     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6651     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6652 
6653     /* "fastavro/_six.pyx":80
6654  * else:  # Python 2x
6655  *     from cStringIO import StringIO as MemoryIO  # noqa
6656  *     from cStringIO import StringIO as StringIO  # noqa             # <<<<<<<<<<<<<<
6657  *     xrange = xrange
6658  *
6659  */
6660     __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error)
6661     __Pyx_GOTREF(__pyx_t_1);
6662     __Pyx_INCREF(__pyx_n_s_StringIO);
6663     __Pyx_GIVEREF(__pyx_n_s_StringIO);
6664     PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_StringIO);
6665     __pyx_t_2 = __Pyx_Import(__pyx_n_s_cStringIO, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L1_error)
6666     __Pyx_GOTREF(__pyx_t_2);
6667     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6668     __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_StringIO); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error)
6669     __Pyx_GOTREF(__pyx_t_1);
6670     if (PyDict_SetItem(__pyx_d, __pyx_n_s_StringIO, __pyx_t_1) < 0) __PYX_ERR(0, 80, __pyx_L1_error)
6671     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6672     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6673 
6674     /* "fastavro/_six.pyx":81
6675  *     from cStringIO import StringIO as MemoryIO  # noqa
6676  *     from cStringIO import StringIO as StringIO  # noqa
6677  *     xrange = xrange             # <<<<<<<<<<<<<<
6678  *
6679  *     def py2_btou(n, encoding=_encoding):
6680  */
6681     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_xrange); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error)
6682     __Pyx_GOTREF(__pyx_t_2);
6683     if (PyDict_SetItem(__pyx_d, __pyx_n_s_xrange, __pyx_t_2) < 0) __PYX_ERR(0, 81, __pyx_L1_error)
6684     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6685 
6686     /* "fastavro/_six.pyx":83
6687  *     xrange = xrange
6688  *
6689  *     def py2_btou(n, encoding=_encoding):             # <<<<<<<<<<<<<<
6690  *         return unicode(n, encoding)  # noqa
6691  *
6692  */
6693     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encoding_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error)
6694     __Pyx_GOTREF(__pyx_t_2);
6695     __pyx_k__4 = __pyx_t_2;
6696     __Pyx_GIVEREF(__pyx_t_2);
6697     __pyx_t_2 = 0;
6698     __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8fastavro_4_six_29py2_btou, NULL, __pyx_n_s_fastavro__six); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error)
6699     __Pyx_GOTREF(__pyx_t_2);
6700     if (PyDict_SetItem(__pyx_d, __pyx_n_s_py2_btou, __pyx_t_2) < 0) __PYX_ERR(0, 83, __pyx_L1_error)
6701     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6702 
6703     /* "fastavro/_six.pyx":86
6704  *         return unicode(n, encoding)  # noqa
6705  *
6706  *     def py2_utob(n, encoding=_encoding):             # <<<<<<<<<<<<<<
6707  *         return n.encode(encoding)
6708  *
6709  */
6710     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encoding_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error)
6711     __Pyx_GOTREF(__pyx_t_2);
6712     __pyx_k__5 = __pyx_t_2;
6713     __Pyx_GIVEREF(__pyx_t_2);
6714     __pyx_t_2 = 0;
6715     __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8fastavro_4_six_31py2_utob, NULL, __pyx_n_s_fastavro__six); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error)
6716     __Pyx_GOTREF(__pyx_t_2);
6717     if (PyDict_SetItem(__pyx_d, __pyx_n_s_py2_utob, __pyx_t_2) < 0) __PYX_ERR(0, 86, __pyx_L1_error)
6718     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6719 
6720     /* "fastavro/_six.pyx":89
6721  *         return n.encode(encoding)
6722  *
6723  *     _outenc = getattr(sys.stdout, 'encoding', None) or _encoding             # <<<<<<<<<<<<<<
6724  *
6725  *     def py2_json_dump(obj, **kwargs):
6726  */
6727     __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error)
6728     __Pyx_GOTREF(__pyx_t_1);
6729     __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stdout); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 89, __pyx_L1_error)
6730     __Pyx_GOTREF(__pyx_t_4);
6731     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6732     __pyx_t_1 = __Pyx_GetAttr3(__pyx_t_4, __pyx_n_s_encoding, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error)
6733     __Pyx_GOTREF(__pyx_t_1);
6734     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6735     __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 89, __pyx_L1_error)
6736     if (!__pyx_t_3) {
6737       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6738     } else {
6739       __Pyx_INCREF(__pyx_t_1);
6740       __pyx_t_2 = __pyx_t_1;
6741       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6742       goto __pyx_L3_bool_binop_done;
6743     }
6744     __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_encoding_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error)
6745     __Pyx_GOTREF(__pyx_t_1);
6746     __Pyx_INCREF(__pyx_t_1);
6747     __pyx_t_2 = __pyx_t_1;
6748     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6749     __pyx_L3_bool_binop_done:;
6750     if (PyDict_SetItem(__pyx_d, __pyx_n_s_outenc, __pyx_t_2) < 0) __PYX_ERR(0, 89, __pyx_L1_error)
6751     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6752 
6753     /* "fastavro/_six.pyx":91
6754  *     _outenc = getattr(sys.stdout, 'encoding', None) or _encoding
6755  *
6756  *     def py2_json_dump(obj, **kwargs):             # <<<<<<<<<<<<<<
6757  *         json.dump(obj, sys.stdout, encoding=_outenc, **kwargs)
6758  *
6759  */
6760     __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8fastavro_4_six_33py2_json_dump, NULL, __pyx_n_s_fastavro__six); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error)
6761     __Pyx_GOTREF(__pyx_t_2);
6762     if (PyDict_SetItem(__pyx_d, __pyx_n_s_py2_json_dump, __pyx_t_2) < 0) __PYX_ERR(0, 91, __pyx_L1_error)
6763     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6764 
6765     /* "fastavro/_six.pyx":94
6766  *         json.dump(obj, sys.stdout, encoding=_outenc, **kwargs)
6767  *
6768  *     def py2_iterkeys(obj):             # <<<<<<<<<<<<<<
6769  *         return obj.iterkeys()
6770  *
6771  */
6772     __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8fastavro_4_six_35py2_iterkeys, NULL, __pyx_n_s_fastavro__six); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error)
6773     __Pyx_GOTREF(__pyx_t_2);
6774     if (PyDict_SetItem(__pyx_d, __pyx_n_s_py2_iterkeys, __pyx_t_2) < 0) __PYX_ERR(0, 94, __pyx_L1_error)
6775     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6776 
6777     /* "fastavro/_six.pyx":97
6778  *         return obj.iterkeys()
6779  *
6780  *     def py2_itervalues(obj):             # <<<<<<<<<<<<<<
6781  *         return obj.itervalues()
6782  *
6783  */
6784     __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8fastavro_4_six_37py2_itervalues, NULL, __pyx_n_s_fastavro__six); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
6785     __Pyx_GOTREF(__pyx_t_2);
6786     if (PyDict_SetItem(__pyx_d, __pyx_n_s_py2_itervalues, __pyx_t_2) < 0) __PYX_ERR(0, 97, __pyx_L1_error)
6787     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6788 
6789     /* "fastavro/_six.pyx":100
6790  *         return obj.itervalues()
6791  *
6792  *     def py2_iteritems(obj):             # <<<<<<<<<<<<<<
6793  *         return obj.iteritems()
6794  *
6795  */
6796     __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8fastavro_4_six_39py2_iteritems, NULL, __pyx_n_s_fastavro__six); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error)
6797     __Pyx_GOTREF(__pyx_t_2);
6798     if (PyDict_SetItem(__pyx_d, __pyx_n_s_py2_iteritems, __pyx_t_2) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
6799     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6800 
6801     /* "fastavro/_six.pyx":103
6802  *         return obj.iteritems()
6803  *
6804  *     def py2_is_str(obj):             # <<<<<<<<<<<<<<
6805  *         return isinstance(obj, basestring)  # noqa
6806  *
6807  */
6808     __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8fastavro_4_six_41py2_is_str, NULL, __pyx_n_s_fastavro__six); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error)
6809     __Pyx_GOTREF(__pyx_t_2);
6810     if (PyDict_SetItem(__pyx_d, __pyx_n_s_py2_is_str, __pyx_t_2) < 0) __PYX_ERR(0, 103, __pyx_L1_error)
6811     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6812 
6813     /* "fastavro/_six.pyx":106
6814  *         return isinstance(obj, basestring)  # noqa
6815  *
6816  *     def py2_mk_bits(bits):             # <<<<<<<<<<<<<<
6817  *         return chr(bits & 0xff)
6818  *
6819  */
6820     __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8fastavro_4_six_43py2_mk_bits, NULL, __pyx_n_s_fastavro__six); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error)
6821     __Pyx_GOTREF(__pyx_t_2);
6822     if (PyDict_SetItem(__pyx_d, __pyx_n_s_py2_mk_bits, __pyx_t_2) < 0) __PYX_ERR(0, 106, __pyx_L1_error)
6823     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6824 
6825     /* "fastavro/_six.pyx":109
6826  *         return chr(bits & 0xff)
6827  *
6828  *     def py2_str2ints(datum):             # <<<<<<<<<<<<<<
6829  *         return map(lambda x: ord(x), datum)
6830  *
6831  */
6832     __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8fastavro_4_six_45py2_str2ints, NULL, __pyx_n_s_fastavro__six); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __pyx_L1_error)
6833     __Pyx_GOTREF(__pyx_t_2);
6834     if (PyDict_SetItem(__pyx_d, __pyx_n_s_py2_str2ints, __pyx_t_2) < 0) __PYX_ERR(0, 109, __pyx_L1_error)
6835     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6836 
6837     /* "fastavro/_six.pyx":112
6838  *         return map(lambda x: ord(x), datum)
6839  *
6840  *     def py2_fstint(datum):             # <<<<<<<<<<<<<<
6841  *         return unpack('!b', datum[0])[0]
6842  *
6843  */
6844     __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8fastavro_4_six_47py2_fstint, NULL, __pyx_n_s_fastavro__six); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error)
6845     __Pyx_GOTREF(__pyx_t_2);
6846     if (PyDict_SetItem(__pyx_d, __pyx_n_s_py2_fstint, __pyx_t_2) < 0) __PYX_ERR(0, 112, __pyx_L1_error)
6847     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6848 
6849     /* "fastavro/_six.pyx":115
6850  *         return unpack('!b', datum[0])[0]
6851  *
6852  *     def _readable(file_like):             # <<<<<<<<<<<<<<
6853  *         try:
6854  *             file_like.read()
6855  */
6856     __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8fastavro_4_six_49_readable, NULL, __pyx_n_s_fastavro__six); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L1_error)
6857     __Pyx_GOTREF(__pyx_t_2);
6858     if (PyDict_SetItem(__pyx_d, __pyx_n_s_readable_2, __pyx_t_2) < 0) __PYX_ERR(0, 115, __pyx_L1_error)
6859     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6860 
6861     /* "fastavro/_six.pyx":122
6862  *         return True
6863  *
6864  *     def py2_appendable(file_like):             # <<<<<<<<<<<<<<
6865  *         # On Python 2 things are a mess. We basically just rely on looking at
6866  *         # the mode. If that doesn't exist (like in the case of an io.BytesIO)
6867  */
6868     __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8fastavro_4_six_51py2_appendable, NULL, __pyx_n_s_fastavro__six); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error)
6869     __Pyx_GOTREF(__pyx_t_2);
6870     if (PyDict_SetItem(__pyx_d, __pyx_n_s_py2_appendable, __pyx_t_2) < 0) __PYX_ERR(0, 122, __pyx_L1_error)
6871     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6872 
6873     /* "fastavro/_six.pyx":148
6874  *             return False
6875  *
6876  *     def py2_int_to_be_signed_bytes(num, bytes_req):             # <<<<<<<<<<<<<<
6877  *         if num < 0:
6878  *             num = 2 ** (8 * bytes_req) + num
6879  */
6880     __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8fastavro_4_six_53py2_int_to_be_signed_bytes, NULL, __pyx_n_s_fastavro__six); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 148, __pyx_L1_error)
6881     __Pyx_GOTREF(__pyx_t_2);
6882     if (PyDict_SetItem(__pyx_d, __pyx_n_s_py2_int_to_be_signed_bytes, __pyx_t_2) < 0) __PYX_ERR(0, 148, __pyx_L1_error)
6883     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6884 
6885     /* "fastavro/_six.pyx":155
6886  *         return hex_str.decode('hex')
6887  *
6888  *     def py2_be_signed_bytes_to_int(data):             # <<<<<<<<<<<<<<
6889  *         output = int(data.encode('hex'), 16)
6890  *         bitsize = len(data) * 8
6891  */
6892     __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8fastavro_4_six_55py2_be_signed_bytes_to_int, NULL, __pyx_n_s_fastavro__six); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error)
6893     __Pyx_GOTREF(__pyx_t_2);
6894     if (PyDict_SetItem(__pyx_d, __pyx_n_s_py2_be_signed_bytes_to_int, __pyx_t_2) < 0) __PYX_ERR(0, 155, __pyx_L1_error)
6895     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6896 
6897     /* "fastavro/_six.pyx":162
6898  *         return output - (2 ** bitsize)
6899  *
6900  *     def py2_reraise(Err, msg):             # <<<<<<<<<<<<<<
6901  *         traceback = sys.exc_info()[2]
6902  *         _locals = {'Err': Err, 'msg': msg, 'traceback': traceback}
6903  */
6904     __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8fastavro_4_six_57py2_reraise, NULL, __pyx_n_s_fastavro__six); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error)
6905     __Pyx_GOTREF(__pyx_t_2);
6906     if (PyDict_SetItem(__pyx_d, __pyx_n_s_py2_reraise, __pyx_t_2) < 0) __PYX_ERR(0, 162, __pyx_L1_error)
6907     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6908   }
6909   __pyx_L2:;
6910 
6911   /* "fastavro/_six.pyx":168
6912  *
6913  * # We do it this way and not just redifine function since Cython do not like it
6914  * if sys.version_info >= (3, 0):             # <<<<<<<<<<<<<<
6915  *     btou = py3_btou
6916  *     utob = py3_utob
6917  */
6918   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L1_error)
6919   __Pyx_GOTREF(__pyx_t_2);
6920   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_version_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error)
6921   __Pyx_GOTREF(__pyx_t_1);
6922   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6923   __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_tuple__7, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L1_error)
6924   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6925   __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 168, __pyx_L1_error)
6926   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6927   if (__pyx_t_3) {
6928 
6929     /* "fastavro/_six.pyx":169
6930  * # We do it this way and not just redifine function since Cython do not like it
6931  * if sys.version_info >= (3, 0):
6932  *     btou = py3_btou             # <<<<<<<<<<<<<<
6933  *     utob = py3_utob
6934  *     json_dump = py3_json_dump
6935  */
6936     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_py3_btou); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error)
6937     __Pyx_GOTREF(__pyx_t_2);
6938     if (PyDict_SetItem(__pyx_d, __pyx_n_s_btou, __pyx_t_2) < 0) __PYX_ERR(0, 169, __pyx_L1_error)
6939     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6940 
6941     /* "fastavro/_six.pyx":170
6942  * if sys.version_info >= (3, 0):
6943  *     btou = py3_btou
6944  *     utob = py3_utob             # <<<<<<<<<<<<<<
6945  *     json_dump = py3_json_dump
6946  *     long = int
6947  */
6948     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_py3_utob); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 170, __pyx_L1_error)
6949     __Pyx_GOTREF(__pyx_t_2);
6950     if (PyDict_SetItem(__pyx_d, __pyx_n_s_utob, __pyx_t_2) < 0) __PYX_ERR(0, 170, __pyx_L1_error)
6951     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6952 
6953     /* "fastavro/_six.pyx":171
6954  *     btou = py3_btou
6955  *     utob = py3_utob
6956  *     json_dump = py3_json_dump             # <<<<<<<<<<<<<<
6957  *     long = int
6958  *     iterkeys = py3_iterkeys
6959  */
6960     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_py3_json_dump); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error)
6961     __Pyx_GOTREF(__pyx_t_2);
6962     if (PyDict_SetItem(__pyx_d, __pyx_n_s_json_dump, __pyx_t_2) < 0) __PYX_ERR(0, 171, __pyx_L1_error)
6963     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6964 
6965     /* "fastavro/_six.pyx":172
6966  *     utob = py3_utob
6967  *     json_dump = py3_json_dump
6968  *     long = int             # <<<<<<<<<<<<<<
6969  *     iterkeys = py3_iterkeys
6970  *     itervalues = py3_itervalues
6971  */
6972     if (PyDict_SetItem(__pyx_d, __pyx_n_s_long, ((PyObject *)(&PyInt_Type))) < 0) __PYX_ERR(0, 172, __pyx_L1_error)
6973 
6974     /* "fastavro/_six.pyx":173
6975  *     json_dump = py3_json_dump
6976  *     long = int
6977  *     iterkeys = py3_iterkeys             # <<<<<<<<<<<<<<
6978  *     itervalues = py3_itervalues
6979  *     iteritems = py3_iteritems
6980  */
6981     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_py3_iterkeys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 173, __pyx_L1_error)
6982     __Pyx_GOTREF(__pyx_t_2);
6983     if (PyDict_SetItem(__pyx_d, __pyx_n_s_iterkeys, __pyx_t_2) < 0) __PYX_ERR(0, 173, __pyx_L1_error)
6984     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6985 
6986     /* "fastavro/_six.pyx":174
6987  *     long = int
6988  *     iterkeys = py3_iterkeys
6989  *     itervalues = py3_itervalues             # <<<<<<<<<<<<<<
6990  *     iteritems = py3_iteritems
6991  *     is_str = py3_is_str
6992  */
6993     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_py3_itervalues); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error)
6994     __Pyx_GOTREF(__pyx_t_2);
6995     if (PyDict_SetItem(__pyx_d, __pyx_n_s_itervalues, __pyx_t_2) < 0) __PYX_ERR(0, 174, __pyx_L1_error)
6996     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6997 
6998     /* "fastavro/_six.pyx":175
6999  *     iterkeys = py3_iterkeys
7000  *     itervalues = py3_itervalues
7001  *     iteritems = py3_iteritems             # <<<<<<<<<<<<<<
7002  *     is_str = py3_is_str
7003  *     mk_bits = py3_mk_bits
7004  */
7005     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_py3_iteritems); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 175, __pyx_L1_error)
7006     __Pyx_GOTREF(__pyx_t_2);
7007     if (PyDict_SetItem(__pyx_d, __pyx_n_s_iteritems, __pyx_t_2) < 0) __PYX_ERR(0, 175, __pyx_L1_error)
7008     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7009 
7010     /* "fastavro/_six.pyx":176
7011  *     itervalues = py3_itervalues
7012  *     iteritems = py3_iteritems
7013  *     is_str = py3_is_str             # <<<<<<<<<<<<<<
7014  *     mk_bits = py3_mk_bits
7015  *     str2ints = py3_bytes2ints
7016  */
7017     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_py3_is_str); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 176, __pyx_L1_error)
7018     __Pyx_GOTREF(__pyx_t_2);
7019     if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_str, __pyx_t_2) < 0) __PYX_ERR(0, 176, __pyx_L1_error)
7020     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7021 
7022     /* "fastavro/_six.pyx":177
7023  *     iteritems = py3_iteritems
7024  *     is_str = py3_is_str
7025  *     mk_bits = py3_mk_bits             # <<<<<<<<<<<<<<
7026  *     str2ints = py3_bytes2ints
7027  *     fstint = py3_fstint
7028  */
7029     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_py3_mk_bits); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 177, __pyx_L1_error)
7030     __Pyx_GOTREF(__pyx_t_2);
7031     if (PyDict_SetItem(__pyx_d, __pyx_n_s_mk_bits, __pyx_t_2) < 0) __PYX_ERR(0, 177, __pyx_L1_error)
7032     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7033 
7034     /* "fastavro/_six.pyx":178
7035  *     is_str = py3_is_str
7036  *     mk_bits = py3_mk_bits
7037  *     str2ints = py3_bytes2ints             # <<<<<<<<<<<<<<
7038  *     fstint = py3_fstint
7039  *     appendable = py3_appendable
7040  */
7041     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_py3_bytes2ints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error)
7042     __Pyx_GOTREF(__pyx_t_2);
7043     if (PyDict_SetItem(__pyx_d, __pyx_n_s_str2ints, __pyx_t_2) < 0) __PYX_ERR(0, 178, __pyx_L1_error)
7044     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7045 
7046     /* "fastavro/_six.pyx":179
7047  *     mk_bits = py3_mk_bits
7048  *     str2ints = py3_bytes2ints
7049  *     fstint = py3_fstint             # <<<<<<<<<<<<<<
7050  *     appendable = py3_appendable
7051  *     int_to_be_signed_bytes = py3_int_to_be_signed_bytes
7052  */
7053     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_py3_fstint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error)
7054     __Pyx_GOTREF(__pyx_t_2);
7055     if (PyDict_SetItem(__pyx_d, __pyx_n_s_fstint, __pyx_t_2) < 0) __PYX_ERR(0, 179, __pyx_L1_error)
7056     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7057 
7058     /* "fastavro/_six.pyx":180
7059  *     str2ints = py3_bytes2ints
7060  *     fstint = py3_fstint
7061  *     appendable = py3_appendable             # <<<<<<<<<<<<<<
7062  *     int_to_be_signed_bytes = py3_int_to_be_signed_bytes
7063  *     be_signed_bytes_to_int = py3_be_signed_bytes_to_int
7064  */
7065     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_py3_appendable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 180, __pyx_L1_error)
7066     __Pyx_GOTREF(__pyx_t_2);
7067     if (PyDict_SetItem(__pyx_d, __pyx_n_s_appendable, __pyx_t_2) < 0) __PYX_ERR(0, 180, __pyx_L1_error)
7068     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7069 
7070     /* "fastavro/_six.pyx":181
7071  *     fstint = py3_fstint
7072  *     appendable = py3_appendable
7073  *     int_to_be_signed_bytes = py3_int_to_be_signed_bytes             # <<<<<<<<<<<<<<
7074  *     be_signed_bytes_to_int = py3_be_signed_bytes_to_int
7075  *     reraise = py3_reraise
7076  */
7077     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_py3_int_to_be_signed_bytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error)
7078     __Pyx_GOTREF(__pyx_t_2);
7079     if (PyDict_SetItem(__pyx_d, __pyx_n_s_int_to_be_signed_bytes, __pyx_t_2) < 0) __PYX_ERR(0, 181, __pyx_L1_error)
7080     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7081 
7082     /* "fastavro/_six.pyx":182
7083  *     appendable = py3_appendable
7084  *     int_to_be_signed_bytes = py3_int_to_be_signed_bytes
7085  *     be_signed_bytes_to_int = py3_be_signed_bytes_to_int             # <<<<<<<<<<<<<<
7086  *     reraise = py3_reraise
7087  * else:
7088  */
7089     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_py3_be_signed_bytes_to_int); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 182, __pyx_L1_error)
7090     __Pyx_GOTREF(__pyx_t_2);
7091     if (PyDict_SetItem(__pyx_d, __pyx_n_s_be_signed_bytes_to_int, __pyx_t_2) < 0) __PYX_ERR(0, 182, __pyx_L1_error)
7092     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7093 
7094     /* "fastavro/_six.pyx":183
7095  *     int_to_be_signed_bytes = py3_int_to_be_signed_bytes
7096  *     be_signed_bytes_to_int = py3_be_signed_bytes_to_int
7097  *     reraise = py3_reraise             # <<<<<<<<<<<<<<
7098  * else:
7099  *     btou = py2_btou
7100  */
7101     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_py3_reraise); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __pyx_L1_error)
7102     __Pyx_GOTREF(__pyx_t_2);
7103     if (PyDict_SetItem(__pyx_d, __pyx_n_s_reraise, __pyx_t_2) < 0) __PYX_ERR(0, 183, __pyx_L1_error)
7104     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7105 
7106     /* "fastavro/_six.pyx":168
7107  *
7108  * # We do it this way and not just redifine function since Cython do not like it
7109  * if sys.version_info >= (3, 0):             # <<<<<<<<<<<<<<
7110  *     btou = py3_btou
7111  *     utob = py3_utob
7112  */
7113     goto __pyx_L5;
7114   }
7115 
7116   /* "fastavro/_six.pyx":185
7117  *     reraise = py3_reraise
7118  * else:
7119  *     btou = py2_btou             # <<<<<<<<<<<<<<
7120  *     utob = py2_utob
7121  *     json_dump = py2_json_dump
7122  */
7123   /*else*/ {
7124     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_py2_btou); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L1_error)
7125     __Pyx_GOTREF(__pyx_t_2);
7126     if (PyDict_SetItem(__pyx_d, __pyx_n_s_btou, __pyx_t_2) < 0) __PYX_ERR(0, 185, __pyx_L1_error)
7127     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7128 
7129     /* "fastavro/_six.pyx":186
7130  * else:
7131  *     btou = py2_btou
7132  *     utob = py2_utob             # <<<<<<<<<<<<<<
7133  *     json_dump = py2_json_dump
7134  *     iterkeys = py2_iterkeys
7135  */
7136     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_py2_utob); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 186, __pyx_L1_error)
7137     __Pyx_GOTREF(__pyx_t_2);
7138     if (PyDict_SetItem(__pyx_d, __pyx_n_s_utob, __pyx_t_2) < 0) __PYX_ERR(0, 186, __pyx_L1_error)
7139     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7140 
7141     /* "fastavro/_six.pyx":187
7142  *     btou = py2_btou
7143  *     utob = py2_utob
7144  *     json_dump = py2_json_dump             # <<<<<<<<<<<<<<
7145  *     iterkeys = py2_iterkeys
7146  *     itervalues = py2_itervalues
7147  */
7148     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_py2_json_dump); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error)
7149     __Pyx_GOTREF(__pyx_t_2);
7150     if (PyDict_SetItem(__pyx_d, __pyx_n_s_json_dump, __pyx_t_2) < 0) __PYX_ERR(0, 187, __pyx_L1_error)
7151     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7152 
7153     /* "fastavro/_six.pyx":188
7154  *     utob = py2_utob
7155  *     json_dump = py2_json_dump
7156  *     iterkeys = py2_iterkeys             # <<<<<<<<<<<<<<
7157  *     itervalues = py2_itervalues
7158  *     iteritems = py2_iteritems
7159  */
7160     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_py2_iterkeys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error)
7161     __Pyx_GOTREF(__pyx_t_2);
7162     if (PyDict_SetItem(__pyx_d, __pyx_n_s_iterkeys, __pyx_t_2) < 0) __PYX_ERR(0, 188, __pyx_L1_error)
7163     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7164 
7165     /* "fastavro/_six.pyx":189
7166  *     json_dump = py2_json_dump
7167  *     iterkeys = py2_iterkeys
7168  *     itervalues = py2_itervalues             # <<<<<<<<<<<<<<
7169  *     iteritems = py2_iteritems
7170  *     long = long
7171  */
7172     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_py2_itervalues); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 189, __pyx_L1_error)
7173     __Pyx_GOTREF(__pyx_t_2);
7174     if (PyDict_SetItem(__pyx_d, __pyx_n_s_itervalues, __pyx_t_2) < 0) __PYX_ERR(0, 189, __pyx_L1_error)
7175     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7176 
7177     /* "fastavro/_six.pyx":190
7178  *     iterkeys = py2_iterkeys
7179  *     itervalues = py2_itervalues
7180  *     iteritems = py2_iteritems             # <<<<<<<<<<<<<<
7181  *     long = long
7182  *     is_str = py2_is_str
7183  */
7184     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_py2_iteritems); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error)
7185     __Pyx_GOTREF(__pyx_t_2);
7186     if (PyDict_SetItem(__pyx_d, __pyx_n_s_iteritems, __pyx_t_2) < 0) __PYX_ERR(0, 190, __pyx_L1_error)
7187     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7188 
7189     /* "fastavro/_six.pyx":191
7190  *     itervalues = py2_itervalues
7191  *     iteritems = py2_iteritems
7192  *     long = long             # <<<<<<<<<<<<<<
7193  *     is_str = py2_is_str
7194  *     mk_bits = py2_mk_bits
7195  */
7196     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_long); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error)
7197     __Pyx_GOTREF(__pyx_t_2);
7198     if (PyDict_SetItem(__pyx_d, __pyx_n_s_long, __pyx_t_2) < 0) __PYX_ERR(0, 191, __pyx_L1_error)
7199     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7200 
7201     /* "fastavro/_six.pyx":192
7202  *     iteritems = py2_iteritems
7203  *     long = long
7204  *     is_str = py2_is_str             # <<<<<<<<<<<<<<
7205  *     mk_bits = py2_mk_bits
7206  *     str2ints = py2_str2ints
7207  */
7208     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_py2_is_str); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 192, __pyx_L1_error)
7209     __Pyx_GOTREF(__pyx_t_2);
7210     if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_str, __pyx_t_2) < 0) __PYX_ERR(0, 192, __pyx_L1_error)
7211     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7212 
7213     /* "fastavro/_six.pyx":193
7214  *     long = long
7215  *     is_str = py2_is_str
7216  *     mk_bits = py2_mk_bits             # <<<<<<<<<<<<<<
7217  *     str2ints = py2_str2ints
7218  *     fstint = py2_fstint
7219  */
7220     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_py2_mk_bits); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error)
7221     __Pyx_GOTREF(__pyx_t_2);
7222     if (PyDict_SetItem(__pyx_d, __pyx_n_s_mk_bits, __pyx_t_2) < 0) __PYX_ERR(0, 193, __pyx_L1_error)
7223     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7224 
7225     /* "fastavro/_six.pyx":194
7226  *     is_str = py2_is_str
7227  *     mk_bits = py2_mk_bits
7228  *     str2ints = py2_str2ints             # <<<<<<<<<<<<<<
7229  *     fstint = py2_fstint
7230  *     appendable = py2_appendable
7231  */
7232     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_py2_str2ints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 194, __pyx_L1_error)
7233     __Pyx_GOTREF(__pyx_t_2);
7234     if (PyDict_SetItem(__pyx_d, __pyx_n_s_str2ints, __pyx_t_2) < 0) __PYX_ERR(0, 194, __pyx_L1_error)
7235     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7236 
7237     /* "fastavro/_six.pyx":195
7238  *     mk_bits = py2_mk_bits
7239  *     str2ints = py2_str2ints
7240  *     fstint = py2_fstint             # <<<<<<<<<<<<<<
7241  *     appendable = py2_appendable
7242  *     int_to_be_signed_bytes = py2_int_to_be_signed_bytes
7243  */
7244     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_py2_fstint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 195, __pyx_L1_error)
7245     __Pyx_GOTREF(__pyx_t_2);
7246     if (PyDict_SetItem(__pyx_d, __pyx_n_s_fstint, __pyx_t_2) < 0) __PYX_ERR(0, 195, __pyx_L1_error)
7247     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7248 
7249     /* "fastavro/_six.pyx":196
7250  *     str2ints = py2_str2ints
7251  *     fstint = py2_fstint
7252  *     appendable = py2_appendable             # <<<<<<<<<<<<<<
7253  *     int_to_be_signed_bytes = py2_int_to_be_signed_bytes
7254  *     be_signed_bytes_to_int = py2_be_signed_bytes_to_int
7255  */
7256     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_py2_appendable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 196, __pyx_L1_error)
7257     __Pyx_GOTREF(__pyx_t_2);
7258     if (PyDict_SetItem(__pyx_d, __pyx_n_s_appendable, __pyx_t_2) < 0) __PYX_ERR(0, 196, __pyx_L1_error)
7259     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7260 
7261     /* "fastavro/_six.pyx":197
7262  *     fstint = py2_fstint
7263  *     appendable = py2_appendable
7264  *     int_to_be_signed_bytes = py2_int_to_be_signed_bytes             # <<<<<<<<<<<<<<
7265  *     be_signed_bytes_to_int = py2_be_signed_bytes_to_int
7266  *     reraise = py2_reraise
7267  */
7268     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_py2_int_to_be_signed_bytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error)
7269     __Pyx_GOTREF(__pyx_t_2);
7270     if (PyDict_SetItem(__pyx_d, __pyx_n_s_int_to_be_signed_bytes, __pyx_t_2) < 0) __PYX_ERR(0, 197, __pyx_L1_error)
7271     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7272 
7273     /* "fastavro/_six.pyx":198
7274  *     appendable = py2_appendable
7275  *     int_to_be_signed_bytes = py2_int_to_be_signed_bytes
7276  *     be_signed_bytes_to_int = py2_be_signed_bytes_to_int             # <<<<<<<<<<<<<<
7277  *     reraise = py2_reraise
7278  */
7279     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_py2_be_signed_bytes_to_int); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __pyx_L1_error)
7280     __Pyx_GOTREF(__pyx_t_2);
7281     if (PyDict_SetItem(__pyx_d, __pyx_n_s_be_signed_bytes_to_int, __pyx_t_2) < 0) __PYX_ERR(0, 198, __pyx_L1_error)
7282     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7283 
7284     /* "fastavro/_six.pyx":199
7285  *     int_to_be_signed_bytes = py2_int_to_be_signed_bytes
7286  *     be_signed_bytes_to_int = py2_be_signed_bytes_to_int
7287  *     reraise = py2_reraise             # <<<<<<<<<<<<<<
7288  */
7289     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_py2_reraise); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 199, __pyx_L1_error)
7290     __Pyx_GOTREF(__pyx_t_2);
7291     if (PyDict_SetItem(__pyx_d, __pyx_n_s_reraise, __pyx_t_2) < 0) __PYX_ERR(0, 199, __pyx_L1_error)
7292     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7293   }
7294   __pyx_L5:;
7295 
7296   /* "fastavro/_six.pyx":1
7297  * # cython: language_level=3str             # <<<<<<<<<<<<<<
7298  * # cython: auto_cpdef=True
7299  *
7300  */
7301   __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
7302   __Pyx_GOTREF(__pyx_t_2);
7303   if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
7304   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7305 
7306   /*--- Wrapped vars code ---*/
7307 
7308   goto __pyx_L0;
7309   __pyx_L1_error:;
7310   __Pyx_XDECREF(__pyx_t_1);
7311   __Pyx_XDECREF(__pyx_t_2);
7312   __Pyx_XDECREF(__pyx_t_4);
7313   if (__pyx_m) {
7314     if (__pyx_d) {
7315       __Pyx_AddTraceback("init fastavro._six", __pyx_clineno, __pyx_lineno, __pyx_filename);
7316     }
7317     Py_CLEAR(__pyx_m);
7318   } else if (!PyErr_Occurred()) {
7319     PyErr_SetString(PyExc_ImportError, "init fastavro._six");
7320   }
7321   __pyx_L0:;
7322   __Pyx_RefNannyFinishContext();
7323   #if CYTHON_PEP489_MULTI_PHASE_INIT
7324   return (__pyx_m != NULL) ? 0 : -1;
7325   #elif PY_MAJOR_VERSION >= 3
7326   return __pyx_m;
7327   #else
7328   return;
7329   #endif
7330 }
7331 
7332 /* --- Runtime support code --- */
7333 /* Refnanny */
7334 #if CYTHON_REFNANNY
__Pyx_RefNannyImportAPI(const char * modname)7335 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
7336     PyObject *m = NULL, *p = NULL;
7337     void *r = NULL;
7338     m = PyImport_ImportModule(modname);
7339     if (!m) goto end;
7340     p = PyObject_GetAttrString(m, "RefNannyAPI");
7341     if (!p) goto end;
7342     r = PyLong_AsVoidPtr(p);
7343 end:
7344     Py_XDECREF(p);
7345     Py_XDECREF(m);
7346     return (__Pyx_RefNannyAPIStruct *)r;
7347 }
7348 #endif
7349 
7350 /* PyObjectGetAttrStr */
7351 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetAttrStr(PyObject * obj,PyObject * attr_name)7352 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
7353     PyTypeObject* tp = Py_TYPE(obj);
7354     if (likely(tp->tp_getattro))
7355         return tp->tp_getattro(obj, attr_name);
7356 #if PY_MAJOR_VERSION < 3
7357     if (likely(tp->tp_getattr))
7358         return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
7359 #endif
7360     return PyObject_GetAttr(obj, attr_name);
7361 }
7362 #endif
7363 
7364 /* GetBuiltinName */
__Pyx_GetBuiltinName(PyObject * name)7365 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
7366     PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
7367     if (unlikely(!result)) {
7368         PyErr_Format(PyExc_NameError,
7369 #if PY_MAJOR_VERSION >= 3
7370             "name '%U' is not defined", name);
7371 #else
7372             "name '%.200s' is not defined", PyString_AS_STRING(name));
7373 #endif
7374     }
7375     return result;
7376 }
7377 
7378 /* RaiseDoubleKeywords */
__Pyx_RaiseDoubleKeywordsError(const char * func_name,PyObject * kw_name)7379 static void __Pyx_RaiseDoubleKeywordsError(
7380     const char* func_name,
7381     PyObject* kw_name)
7382 {
7383     PyErr_Format(PyExc_TypeError,
7384         #if PY_MAJOR_VERSION >= 3
7385         "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
7386         #else
7387         "%s() got multiple values for keyword argument '%s'", func_name,
7388         PyString_AsString(kw_name));
7389         #endif
7390 }
7391 
7392 /* ParseKeywords */
__Pyx_ParseOptionalKeywords(PyObject * kwds,PyObject ** argnames[],PyObject * kwds2,PyObject * values[],Py_ssize_t num_pos_args,const char * function_name)7393 static int __Pyx_ParseOptionalKeywords(
7394     PyObject *kwds,
7395     PyObject **argnames[],
7396     PyObject *kwds2,
7397     PyObject *values[],
7398     Py_ssize_t num_pos_args,
7399     const char* function_name)
7400 {
7401     PyObject *key = 0, *value = 0;
7402     Py_ssize_t pos = 0;
7403     PyObject*** name;
7404     PyObject*** first_kw_arg = argnames + num_pos_args;
7405     while (PyDict_Next(kwds, &pos, &key, &value)) {
7406         name = first_kw_arg;
7407         while (*name && (**name != key)) name++;
7408         if (*name) {
7409             values[name-argnames] = value;
7410             continue;
7411         }
7412         name = first_kw_arg;
7413         #if PY_MAJOR_VERSION < 3
7414         if (likely(PyString_Check(key))) {
7415             while (*name) {
7416                 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
7417                         && _PyString_Eq(**name, key)) {
7418                     values[name-argnames] = value;
7419                     break;
7420                 }
7421                 name++;
7422             }
7423             if (*name) continue;
7424             else {
7425                 PyObject*** argname = argnames;
7426                 while (argname != first_kw_arg) {
7427                     if ((**argname == key) || (
7428                             (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
7429                              && _PyString_Eq(**argname, key))) {
7430                         goto arg_passed_twice;
7431                     }
7432                     argname++;
7433                 }
7434             }
7435         } else
7436         #endif
7437         if (likely(PyUnicode_Check(key))) {
7438             while (*name) {
7439                 int cmp = (**name == key) ? 0 :
7440                 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
7441                     (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
7442                 #endif
7443                     PyUnicode_Compare(**name, key);
7444                 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
7445                 if (cmp == 0) {
7446                     values[name-argnames] = value;
7447                     break;
7448                 }
7449                 name++;
7450             }
7451             if (*name) continue;
7452             else {
7453                 PyObject*** argname = argnames;
7454                 while (argname != first_kw_arg) {
7455                     int cmp = (**argname == key) ? 0 :
7456                     #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
7457                         (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
7458                     #endif
7459                         PyUnicode_Compare(**argname, key);
7460                     if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
7461                     if (cmp == 0) goto arg_passed_twice;
7462                     argname++;
7463                 }
7464             }
7465         } else
7466             goto invalid_keyword_type;
7467         if (kwds2) {
7468             if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
7469         } else {
7470             goto invalid_keyword;
7471         }
7472     }
7473     return 0;
7474 arg_passed_twice:
7475     __Pyx_RaiseDoubleKeywordsError(function_name, key);
7476     goto bad;
7477 invalid_keyword_type:
7478     PyErr_Format(PyExc_TypeError,
7479         "%.200s() keywords must be strings", function_name);
7480     goto bad;
7481 invalid_keyword:
7482     PyErr_Format(PyExc_TypeError,
7483     #if PY_MAJOR_VERSION < 3
7484         "%.200s() got an unexpected keyword argument '%.200s'",
7485         function_name, PyString_AsString(key));
7486     #else
7487         "%s() got an unexpected keyword argument '%U'",
7488         function_name, key);
7489     #endif
7490 bad:
7491     return -1;
7492 }
7493 
7494 /* RaiseArgTupleInvalid */
__Pyx_RaiseArgtupleInvalid(const char * func_name,int exact,Py_ssize_t num_min,Py_ssize_t num_max,Py_ssize_t num_found)7495 static void __Pyx_RaiseArgtupleInvalid(
7496     const char* func_name,
7497     int exact,
7498     Py_ssize_t num_min,
7499     Py_ssize_t num_max,
7500     Py_ssize_t num_found)
7501 {
7502     Py_ssize_t num_expected;
7503     const char *more_or_less;
7504     if (num_found < num_min) {
7505         num_expected = num_min;
7506         more_or_less = "at least";
7507     } else {
7508         num_expected = num_max;
7509         more_or_less = "at most";
7510     }
7511     if (exact) {
7512         more_or_less = "exactly";
7513     }
7514     PyErr_Format(PyExc_TypeError,
7515                  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
7516                  func_name, more_or_less, num_expected,
7517                  (num_expected == 1) ? "" : "s", num_found);
7518 }
7519 
7520 /* PyCFunctionFastCall */
7521 #if CYTHON_FAST_PYCCALL
__Pyx_PyCFunction_FastCall(PyObject * func_obj,PyObject ** args,Py_ssize_t nargs)7522 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
7523     PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
7524     PyCFunction meth = PyCFunction_GET_FUNCTION(func);
7525     PyObject *self = PyCFunction_GET_SELF(func);
7526     int flags = PyCFunction_GET_FLAGS(func);
7527     assert(PyCFunction_Check(func));
7528     assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
7529     assert(nargs >= 0);
7530     assert(nargs == 0 || args != NULL);
7531     /* _PyCFunction_FastCallDict() must not be called with an exception set,
7532        because it may clear it (directly or indirectly) and so the
7533        caller loses its exception */
7534     assert(!PyErr_Occurred());
7535     if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
7536         return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
7537     } else {
7538         return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
7539     }
7540 }
7541 #endif
7542 
7543 /* PyFunctionFastCall */
7544 #if CYTHON_FAST_PYCALL
__Pyx_PyFunction_FastCallNoKw(PyCodeObject * co,PyObject ** args,Py_ssize_t na,PyObject * globals)7545 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
7546                                                PyObject *globals) {
7547     PyFrameObject *f;
7548     PyThreadState *tstate = __Pyx_PyThreadState_Current;
7549     PyObject **fastlocals;
7550     Py_ssize_t i;
7551     PyObject *result;
7552     assert(globals != NULL);
7553     /* XXX Perhaps we should create a specialized
7554        PyFrame_New() that doesn't take locals, but does
7555        take builtins without sanity checking them.
7556        */
7557     assert(tstate != NULL);
7558     f = PyFrame_New(tstate, co, globals, NULL);
7559     if (f == NULL) {
7560         return NULL;
7561     }
7562     fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
7563     for (i = 0; i < na; i++) {
7564         Py_INCREF(*args);
7565         fastlocals[i] = *args++;
7566     }
7567     result = PyEval_EvalFrameEx(f,0);
7568     ++tstate->recursion_depth;
7569     Py_DECREF(f);
7570     --tstate->recursion_depth;
7571     return result;
7572 }
7573 #if 1 || PY_VERSION_HEX < 0x030600B1
__Pyx_PyFunction_FastCallDict(PyObject * func,PyObject ** args,Py_ssize_t nargs,PyObject * kwargs)7574 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
7575     PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
7576     PyObject *globals = PyFunction_GET_GLOBALS(func);
7577     PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
7578     PyObject *closure;
7579 #if PY_MAJOR_VERSION >= 3
7580     PyObject *kwdefs;
7581 #endif
7582     PyObject *kwtuple, **k;
7583     PyObject **d;
7584     Py_ssize_t nd;
7585     Py_ssize_t nk;
7586     PyObject *result;
7587     assert(kwargs == NULL || PyDict_Check(kwargs));
7588     nk = kwargs ? PyDict_Size(kwargs) : 0;
7589     if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
7590         return NULL;
7591     }
7592     if (
7593 #if PY_MAJOR_VERSION >= 3
7594             co->co_kwonlyargcount == 0 &&
7595 #endif
7596             likely(kwargs == NULL || nk == 0) &&
7597             co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
7598         if (argdefs == NULL && co->co_argcount == nargs) {
7599             result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
7600             goto done;
7601         }
7602         else if (nargs == 0 && argdefs != NULL
7603                  && co->co_argcount == Py_SIZE(argdefs)) {
7604             /* function called with no arguments, but all parameters have
7605                a default value: use default values as arguments .*/
7606             args = &PyTuple_GET_ITEM(argdefs, 0);
7607             result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
7608             goto done;
7609         }
7610     }
7611     if (kwargs != NULL) {
7612         Py_ssize_t pos, i;
7613         kwtuple = PyTuple_New(2 * nk);
7614         if (kwtuple == NULL) {
7615             result = NULL;
7616             goto done;
7617         }
7618         k = &PyTuple_GET_ITEM(kwtuple, 0);
7619         pos = i = 0;
7620         while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
7621             Py_INCREF(k[i]);
7622             Py_INCREF(k[i+1]);
7623             i += 2;
7624         }
7625         nk = i / 2;
7626     }
7627     else {
7628         kwtuple = NULL;
7629         k = NULL;
7630     }
7631     closure = PyFunction_GET_CLOSURE(func);
7632 #if PY_MAJOR_VERSION >= 3
7633     kwdefs = PyFunction_GET_KW_DEFAULTS(func);
7634 #endif
7635     if (argdefs != NULL) {
7636         d = &PyTuple_GET_ITEM(argdefs, 0);
7637         nd = Py_SIZE(argdefs);
7638     }
7639     else {
7640         d = NULL;
7641         nd = 0;
7642     }
7643 #if PY_MAJOR_VERSION >= 3
7644     result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
7645                                args, (int)nargs,
7646                                k, (int)nk,
7647                                d, (int)nd, kwdefs, closure);
7648 #else
7649     result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
7650                                args, (int)nargs,
7651                                k, (int)nk,
7652                                d, (int)nd, closure);
7653 #endif
7654     Py_XDECREF(kwtuple);
7655 done:
7656     Py_LeaveRecursiveCall();
7657     return result;
7658 }
7659 #endif
7660 #endif
7661 
7662 /* PyObjectCall */
7663 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_Call(PyObject * func,PyObject * arg,PyObject * kw)7664 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
7665     PyObject *result;
7666     ternaryfunc call = func->ob_type->tp_call;
7667     if (unlikely(!call))
7668         return PyObject_Call(func, arg, kw);
7669     if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
7670         return NULL;
7671     result = (*call)(func, arg, kw);
7672     Py_LeaveRecursiveCall();
7673     if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
7674         PyErr_SetString(
7675             PyExc_SystemError,
7676             "NULL result without error in PyObject_Call");
7677     }
7678     return result;
7679 }
7680 #endif
7681 
7682 /* PyObjectCall2Args */
__Pyx_PyObject_Call2Args(PyObject * function,PyObject * arg1,PyObject * arg2)7683 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
7684     PyObject *args, *result = NULL;
7685     #if CYTHON_FAST_PYCALL
7686     if (PyFunction_Check(function)) {
7687         PyObject *args[2] = {arg1, arg2};
7688         return __Pyx_PyFunction_FastCall(function, args, 2);
7689     }
7690     #endif
7691     #if CYTHON_FAST_PYCCALL
7692     if (__Pyx_PyFastCFunction_Check(function)) {
7693         PyObject *args[2] = {arg1, arg2};
7694         return __Pyx_PyCFunction_FastCall(function, args, 2);
7695     }
7696     #endif
7697     args = PyTuple_New(2);
7698     if (unlikely(!args)) goto done;
7699     Py_INCREF(arg1);
7700     PyTuple_SET_ITEM(args, 0, arg1);
7701     Py_INCREF(arg2);
7702     PyTuple_SET_ITEM(args, 1, arg2);
7703     Py_INCREF(function);
7704     result = __Pyx_PyObject_Call(function, args, NULL);
7705     Py_DECREF(args);
7706     Py_DECREF(function);
7707 done:
7708     return result;
7709 }
7710 
7711 /* PyObjectCallMethO */
7712 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_CallMethO(PyObject * func,PyObject * arg)7713 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
7714     PyObject *self, *result;
7715     PyCFunction cfunc;
7716     cfunc = PyCFunction_GET_FUNCTION(func);
7717     self = PyCFunction_GET_SELF(func);
7718     if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
7719         return NULL;
7720     result = cfunc(self, arg);
7721     Py_LeaveRecursiveCall();
7722     if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
7723         PyErr_SetString(
7724             PyExc_SystemError,
7725             "NULL result without error in PyObject_Call");
7726     }
7727     return result;
7728 }
7729 #endif
7730 
7731 /* PyObjectCallOneArg */
7732 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx__PyObject_CallOneArg(PyObject * func,PyObject * arg)7733 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
7734     PyObject *result;
7735     PyObject *args = PyTuple_New(1);
7736     if (unlikely(!args)) return NULL;
7737     Py_INCREF(arg);
7738     PyTuple_SET_ITEM(args, 0, arg);
7739     result = __Pyx_PyObject_Call(func, args, NULL);
7740     Py_DECREF(args);
7741     return result;
7742 }
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)7743 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
7744 #if CYTHON_FAST_PYCALL
7745     if (PyFunction_Check(func)) {
7746         return __Pyx_PyFunction_FastCall(func, &arg, 1);
7747     }
7748 #endif
7749     if (likely(PyCFunction_Check(func))) {
7750         if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
7751             return __Pyx_PyObject_CallMethO(func, arg);
7752 #if CYTHON_FAST_PYCCALL
7753         } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
7754             return __Pyx_PyCFunction_FastCall(func, &arg, 1);
7755 #endif
7756         }
7757     }
7758     return __Pyx__PyObject_CallOneArg(func, arg);
7759 }
7760 #else
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)7761 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
7762     PyObject *result;
7763     PyObject *args = PyTuple_Pack(1, arg);
7764     if (unlikely(!args)) return NULL;
7765     result = __Pyx_PyObject_Call(func, args, NULL);
7766     Py_DECREF(args);
7767     return result;
7768 }
7769 #endif
7770 
7771 /* PyDictVersioning */
7772 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
__Pyx_get_tp_dict_version(PyObject * obj)7773 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
7774     PyObject *dict = Py_TYPE(obj)->tp_dict;
7775     return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
7776 }
__Pyx_get_object_dict_version(PyObject * obj)7777 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
7778     PyObject **dictptr = NULL;
7779     Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
7780     if (offset) {
7781 #if CYTHON_COMPILING_IN_CPYTHON
7782         dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
7783 #else
7784         dictptr = _PyObject_GetDictPtr(obj);
7785 #endif
7786     }
7787     return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
7788 }
__Pyx_object_dict_version_matches(PyObject * obj,PY_UINT64_T tp_dict_version,PY_UINT64_T obj_dict_version)7789 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
7790     PyObject *dict = Py_TYPE(obj)->tp_dict;
7791     if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
7792         return 0;
7793     return obj_dict_version == __Pyx_get_object_dict_version(obj);
7794 }
7795 #endif
7796 
7797 /* GetModuleGlobalName */
7798 #if CYTHON_USE_DICT_VERSIONS
__Pyx__GetModuleGlobalName(PyObject * name,PY_UINT64_T * dict_version,PyObject ** dict_cached_value)7799 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
7800 #else
7801 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
7802 #endif
7803 {
7804     PyObject *result;
7805 #if !CYTHON_AVOID_BORROWED_REFS
7806 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
7807     result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
7808     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
7809     if (likely(result)) {
7810         return __Pyx_NewRef(result);
7811     } else if (unlikely(PyErr_Occurred())) {
7812         return NULL;
7813     }
7814 #else
7815     result = PyDict_GetItem(__pyx_d, name);
7816     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
7817     if (likely(result)) {
7818         return __Pyx_NewRef(result);
7819     }
7820 #endif
7821 #else
7822     result = PyObject_GetItem(__pyx_d, name);
7823     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
7824     if (likely(result)) {
7825         return __Pyx_NewRef(result);
7826     }
7827     PyErr_Clear();
7828 #endif
7829     return __Pyx_GetBuiltinName(name);
7830 }
7831 
7832 /* PyObjectCallNoArg */
7833 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_CallNoArg(PyObject * func)7834 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
7835 #if CYTHON_FAST_PYCALL
7836     if (PyFunction_Check(func)) {
7837         return __Pyx_PyFunction_FastCall(func, NULL, 0);
7838     }
7839 #endif
7840 #ifdef __Pyx_CyFunction_USED
7841     if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
7842 #else
7843     if (likely(PyCFunction_Check(func)))
7844 #endif
7845     {
7846         if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
7847             return __Pyx_PyObject_CallMethO(func, NULL);
7848         }
7849     }
7850     return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
7851 }
7852 #endif
7853 
7854 /* PyIntBinop */
7855 #if !CYTHON_COMPILING_IN_PYPY
__Pyx_PyInt_AndObjC(PyObject * op1,PyObject * op2,CYTHON_UNUSED long intval,int inplace,int zerodivision_check)7856 static PyObject* __Pyx_PyInt_AndObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
7857     (void)inplace;
7858     (void)zerodivision_check;
7859     #if PY_MAJOR_VERSION < 3
7860     if (likely(PyInt_CheckExact(op1))) {
7861         const long b = intval;
7862         long a = PyInt_AS_LONG(op1);
7863             return PyInt_FromLong(a & b);
7864     }
7865     #endif
7866     #if CYTHON_USE_PYLONG_INTERNALS
7867     if (likely(PyLong_CheckExact(op1))) {
7868         const long b = intval;
7869         long a, x;
7870 #ifdef HAVE_LONG_LONG
7871         const PY_LONG_LONG llb = intval;
7872         PY_LONG_LONG lla, llx;
7873 #endif
7874         const digit* digits = ((PyLongObject*)op1)->ob_digit;
7875         const Py_ssize_t size = Py_SIZE(op1);
7876         if (likely(__Pyx_sst_abs(size) <= 1)) {
7877             a = likely(size) ? digits[0] : 0;
7878             if (size == -1) a = -a;
7879         } else {
7880             switch (size) {
7881                 case -2:
7882                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
7883                         a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
7884                         break;
7885 #ifdef HAVE_LONG_LONG
7886                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
7887                         lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
7888                         goto long_long;
7889 #endif
7890                     }
7891                     CYTHON_FALLTHROUGH;
7892                 case 2:
7893                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
7894                         a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
7895                         break;
7896 #ifdef HAVE_LONG_LONG
7897                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
7898                         lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
7899                         goto long_long;
7900 #endif
7901                     }
7902                     CYTHON_FALLTHROUGH;
7903                 case -3:
7904                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
7905                         a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
7906                         break;
7907 #ifdef HAVE_LONG_LONG
7908                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
7909                         lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
7910                         goto long_long;
7911 #endif
7912                     }
7913                     CYTHON_FALLTHROUGH;
7914                 case 3:
7915                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
7916                         a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
7917                         break;
7918 #ifdef HAVE_LONG_LONG
7919                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
7920                         lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
7921                         goto long_long;
7922 #endif
7923                     }
7924                     CYTHON_FALLTHROUGH;
7925                 case -4:
7926                     if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
7927                         a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
7928                         break;
7929 #ifdef HAVE_LONG_LONG
7930                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
7931                         lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
7932                         goto long_long;
7933 #endif
7934                     }
7935                     CYTHON_FALLTHROUGH;
7936                 case 4:
7937                     if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
7938                         a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
7939                         break;
7940 #ifdef HAVE_LONG_LONG
7941                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
7942                         lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
7943                         goto long_long;
7944 #endif
7945                     }
7946                     CYTHON_FALLTHROUGH;
7947                 default: return PyLong_Type.tp_as_number->nb_and(op1, op2);
7948             }
7949         }
7950                 x = a & b;
7951             return PyLong_FromLong(x);
7952 #ifdef HAVE_LONG_LONG
7953         long_long:
7954                 llx = lla & llb;
7955             return PyLong_FromLongLong(llx);
7956 #endif
7957 
7958 
7959     }
7960     #endif
7961     return (inplace ? PyNumber_InPlaceAnd : PyNumber_And)(op1, op2);
7962 }
7963 #endif
7964 
7965 /* GetItemInt */
__Pyx_GetItemInt_Generic(PyObject * o,PyObject * j)7966 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
7967     PyObject *r;
7968     if (!j) return NULL;
7969     r = PyObject_GetItem(o, j);
7970     Py_DECREF(j);
7971     return r;
7972 }
__Pyx_GetItemInt_List_Fast(PyObject * o,Py_ssize_t i,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)7973 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
7974                                                               CYTHON_NCP_UNUSED int wraparound,
7975                                                               CYTHON_NCP_UNUSED int boundscheck) {
7976 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7977     Py_ssize_t wrapped_i = i;
7978     if (wraparound & unlikely(i < 0)) {
7979         wrapped_i += PyList_GET_SIZE(o);
7980     }
7981     if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
7982         PyObject *r = PyList_GET_ITEM(o, wrapped_i);
7983         Py_INCREF(r);
7984         return r;
7985     }
7986     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
7987 #else
7988     return PySequence_GetItem(o, i);
7989 #endif
7990 }
__Pyx_GetItemInt_Tuple_Fast(PyObject * o,Py_ssize_t i,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)7991 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
7992                                                               CYTHON_NCP_UNUSED int wraparound,
7993                                                               CYTHON_NCP_UNUSED int boundscheck) {
7994 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7995     Py_ssize_t wrapped_i = i;
7996     if (wraparound & unlikely(i < 0)) {
7997         wrapped_i += PyTuple_GET_SIZE(o);
7998     }
7999     if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
8000         PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
8001         Py_INCREF(r);
8002         return r;
8003     }
8004     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
8005 #else
8006     return PySequence_GetItem(o, i);
8007 #endif
8008 }
__Pyx_GetItemInt_Fast(PyObject * o,Py_ssize_t i,int is_list,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)8009 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
8010                                                      CYTHON_NCP_UNUSED int wraparound,
8011                                                      CYTHON_NCP_UNUSED int boundscheck) {
8012 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
8013     if (is_list || PyList_CheckExact(o)) {
8014         Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
8015         if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
8016             PyObject *r = PyList_GET_ITEM(o, n);
8017             Py_INCREF(r);
8018             return r;
8019         }
8020     }
8021     else if (PyTuple_CheckExact(o)) {
8022         Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
8023         if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
8024             PyObject *r = PyTuple_GET_ITEM(o, n);
8025             Py_INCREF(r);
8026             return r;
8027         }
8028     } else {
8029         PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
8030         if (likely(m && m->sq_item)) {
8031             if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
8032                 Py_ssize_t l = m->sq_length(o);
8033                 if (likely(l >= 0)) {
8034                     i += l;
8035                 } else {
8036                     if (!PyErr_ExceptionMatches(PyExc_OverflowError))
8037                         return NULL;
8038                     PyErr_Clear();
8039                 }
8040             }
8041             return m->sq_item(o, i);
8042         }
8043     }
8044 #else
8045     if (is_list || PySequence_Check(o)) {
8046         return PySequence_GetItem(o, i);
8047     }
8048 #endif
8049     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
8050 }
8051 
8052 /* PyIntCompare */
__Pyx_PyInt_NeObjC(PyObject * op1,PyObject * op2,CYTHON_UNUSED long intval,CYTHON_UNUSED long inplace)8053 static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) {
8054     if (op1 == op2) {
8055         Py_RETURN_FALSE;
8056     }
8057     #if PY_MAJOR_VERSION < 3
8058     if (likely(PyInt_CheckExact(op1))) {
8059         const long b = intval;
8060         long a = PyInt_AS_LONG(op1);
8061         if (a != b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
8062     }
8063     #endif
8064     #if CYTHON_USE_PYLONG_INTERNALS
8065     if (likely(PyLong_CheckExact(op1))) {
8066         int unequal;
8067         unsigned long uintval;
8068         Py_ssize_t size = Py_SIZE(op1);
8069         const digit* digits = ((PyLongObject*)op1)->ob_digit;
8070         if (intval == 0) {
8071             if (size != 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
8072         } else if (intval < 0) {
8073             if (size >= 0)
8074                 Py_RETURN_TRUE;
8075             intval = -intval;
8076             size = -size;
8077         } else {
8078             if (size <= 0)
8079                 Py_RETURN_TRUE;
8080         }
8081         uintval = (unsigned long) intval;
8082 #if PyLong_SHIFT * 4 < SIZEOF_LONG*8
8083         if (uintval >> (PyLong_SHIFT * 4)) {
8084             unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
8085                  | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
8086         } else
8087 #endif
8088 #if PyLong_SHIFT * 3 < SIZEOF_LONG*8
8089         if (uintval >> (PyLong_SHIFT * 3)) {
8090             unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
8091                  | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
8092         } else
8093 #endif
8094 #if PyLong_SHIFT * 2 < SIZEOF_LONG*8
8095         if (uintval >> (PyLong_SHIFT * 2)) {
8096             unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
8097                  | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
8098         } else
8099 #endif
8100 #if PyLong_SHIFT * 1 < SIZEOF_LONG*8
8101         if (uintval >> (PyLong_SHIFT * 1)) {
8102             unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
8103                  | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
8104         } else
8105 #endif
8106             unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
8107         if (unequal != 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
8108     }
8109     #endif
8110     if (PyFloat_CheckExact(op1)) {
8111         const long b = intval;
8112         double a = PyFloat_AS_DOUBLE(op1);
8113         if ((double)a != (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
8114     }
8115     return (
8116         PyObject_RichCompare(op1, op2, Py_NE));
8117 }
8118 
8119 /* PyErrExceptionMatches */
8120 #if CYTHON_FAST_THREAD_STATE
__Pyx_PyErr_ExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)8121 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
8122     Py_ssize_t i, n;
8123     n = PyTuple_GET_SIZE(tuple);
8124 #if PY_MAJOR_VERSION >= 3
8125     for (i=0; i<n; i++) {
8126         if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
8127     }
8128 #endif
8129     for (i=0; i<n; i++) {
8130         if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
8131     }
8132     return 0;
8133 }
__Pyx_PyErr_ExceptionMatchesInState(PyThreadState * tstate,PyObject * err)8134 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
8135     PyObject *exc_type = tstate->curexc_type;
8136     if (exc_type == err) return 1;
8137     if (unlikely(!exc_type)) return 0;
8138     if (unlikely(PyTuple_Check(err)))
8139         return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
8140     return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
8141 }
8142 #endif
8143 
8144 /* PyErrFetchRestore */
8145 #if CYTHON_FAST_THREAD_STATE
__Pyx_ErrRestoreInState(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)8146 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
8147     PyObject *tmp_type, *tmp_value, *tmp_tb;
8148     tmp_type = tstate->curexc_type;
8149     tmp_value = tstate->curexc_value;
8150     tmp_tb = tstate->curexc_traceback;
8151     tstate->curexc_type = type;
8152     tstate->curexc_value = value;
8153     tstate->curexc_traceback = tb;
8154     Py_XDECREF(tmp_type);
8155     Py_XDECREF(tmp_value);
8156     Py_XDECREF(tmp_tb);
8157 }
__Pyx_ErrFetchInState(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)8158 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
8159     *type = tstate->curexc_type;
8160     *value = tstate->curexc_value;
8161     *tb = tstate->curexc_traceback;
8162     tstate->curexc_type = 0;
8163     tstate->curexc_value = 0;
8164     tstate->curexc_traceback = 0;
8165 }
8166 #endif
8167 
8168 /* GetAttr */
__Pyx_GetAttr(PyObject * o,PyObject * n)8169 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
8170 #if CYTHON_USE_TYPE_SLOTS
8171 #if PY_MAJOR_VERSION >= 3
8172     if (likely(PyUnicode_Check(n)))
8173 #else
8174     if (likely(PyString_Check(n)))
8175 #endif
8176         return __Pyx_PyObject_GetAttrStr(o, n);
8177 #endif
8178     return PyObject_GetAttr(o, n);
8179 }
8180 
8181 /* GetAttr3 */
__Pyx_GetAttr3Default(PyObject * d)8182 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
8183     __Pyx_PyThreadState_declare
8184     __Pyx_PyThreadState_assign
8185     if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
8186         return NULL;
8187     __Pyx_PyErr_Clear();
8188     Py_INCREF(d);
8189     return d;
8190 }
__Pyx_GetAttr3(PyObject * o,PyObject * n,PyObject * d)8191 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
8192     PyObject *r = __Pyx_GetAttr(o, n);
8193     return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
8194 }
8195 
8196 /* BytesEquals */
__Pyx_PyBytes_Equals(PyObject * s1,PyObject * s2,int equals)8197 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
8198 #if CYTHON_COMPILING_IN_PYPY
8199     return PyObject_RichCompareBool(s1, s2, equals);
8200 #else
8201     if (s1 == s2) {
8202         return (equals == Py_EQ);
8203     } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
8204         const char *ps1, *ps2;
8205         Py_ssize_t length = PyBytes_GET_SIZE(s1);
8206         if (length != PyBytes_GET_SIZE(s2))
8207             return (equals == Py_NE);
8208         ps1 = PyBytes_AS_STRING(s1);
8209         ps2 = PyBytes_AS_STRING(s2);
8210         if (ps1[0] != ps2[0]) {
8211             return (equals == Py_NE);
8212         } else if (length == 1) {
8213             return (equals == Py_EQ);
8214         } else {
8215             int result;
8216 #if CYTHON_USE_UNICODE_INTERNALS
8217             Py_hash_t hash1, hash2;
8218             hash1 = ((PyBytesObject*)s1)->ob_shash;
8219             hash2 = ((PyBytesObject*)s2)->ob_shash;
8220             if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
8221                 return (equals == Py_NE);
8222             }
8223 #endif
8224             result = memcmp(ps1, ps2, (size_t)length);
8225             return (equals == Py_EQ) ? (result == 0) : (result != 0);
8226         }
8227     } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
8228         return (equals == Py_NE);
8229     } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
8230         return (equals == Py_NE);
8231     } else {
8232         int result;
8233         PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
8234         if (!py_result)
8235             return -1;
8236         result = __Pyx_PyObject_IsTrue(py_result);
8237         Py_DECREF(py_result);
8238         return result;
8239     }
8240 #endif
8241 }
8242 
8243 /* UnicodeEquals */
__Pyx_PyUnicode_Equals(PyObject * s1,PyObject * s2,int equals)8244 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
8245 #if CYTHON_COMPILING_IN_PYPY
8246     return PyObject_RichCompareBool(s1, s2, equals);
8247 #else
8248 #if PY_MAJOR_VERSION < 3
8249     PyObject* owned_ref = NULL;
8250 #endif
8251     int s1_is_unicode, s2_is_unicode;
8252     if (s1 == s2) {
8253         goto return_eq;
8254     }
8255     s1_is_unicode = PyUnicode_CheckExact(s1);
8256     s2_is_unicode = PyUnicode_CheckExact(s2);
8257 #if PY_MAJOR_VERSION < 3
8258     if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
8259         owned_ref = PyUnicode_FromObject(s2);
8260         if (unlikely(!owned_ref))
8261             return -1;
8262         s2 = owned_ref;
8263         s2_is_unicode = 1;
8264     } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
8265         owned_ref = PyUnicode_FromObject(s1);
8266         if (unlikely(!owned_ref))
8267             return -1;
8268         s1 = owned_ref;
8269         s1_is_unicode = 1;
8270     } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
8271         return __Pyx_PyBytes_Equals(s1, s2, equals);
8272     }
8273 #endif
8274     if (s1_is_unicode & s2_is_unicode) {
8275         Py_ssize_t length;
8276         int kind;
8277         void *data1, *data2;
8278         if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
8279             return -1;
8280         length = __Pyx_PyUnicode_GET_LENGTH(s1);
8281         if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
8282             goto return_ne;
8283         }
8284 #if CYTHON_USE_UNICODE_INTERNALS
8285         {
8286             Py_hash_t hash1, hash2;
8287         #if CYTHON_PEP393_ENABLED
8288             hash1 = ((PyASCIIObject*)s1)->hash;
8289             hash2 = ((PyASCIIObject*)s2)->hash;
8290         #else
8291             hash1 = ((PyUnicodeObject*)s1)->hash;
8292             hash2 = ((PyUnicodeObject*)s2)->hash;
8293         #endif
8294             if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
8295                 goto return_ne;
8296             }
8297         }
8298 #endif
8299         kind = __Pyx_PyUnicode_KIND(s1);
8300         if (kind != __Pyx_PyUnicode_KIND(s2)) {
8301             goto return_ne;
8302         }
8303         data1 = __Pyx_PyUnicode_DATA(s1);
8304         data2 = __Pyx_PyUnicode_DATA(s2);
8305         if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
8306             goto return_ne;
8307         } else if (length == 1) {
8308             goto return_eq;
8309         } else {
8310             int result = memcmp(data1, data2, (size_t)(length * kind));
8311             #if PY_MAJOR_VERSION < 3
8312             Py_XDECREF(owned_ref);
8313             #endif
8314             return (equals == Py_EQ) ? (result == 0) : (result != 0);
8315         }
8316     } else if ((s1 == Py_None) & s2_is_unicode) {
8317         goto return_ne;
8318     } else if ((s2 == Py_None) & s1_is_unicode) {
8319         goto return_ne;
8320     } else {
8321         int result;
8322         PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
8323         #if PY_MAJOR_VERSION < 3
8324         Py_XDECREF(owned_ref);
8325         #endif
8326         if (!py_result)
8327             return -1;
8328         result = __Pyx_PyObject_IsTrue(py_result);
8329         Py_DECREF(py_result);
8330         return result;
8331     }
8332 return_eq:
8333     #if PY_MAJOR_VERSION < 3
8334     Py_XDECREF(owned_ref);
8335     #endif
8336     return (equals == Py_EQ);
8337 return_ne:
8338     #if PY_MAJOR_VERSION < 3
8339     Py_XDECREF(owned_ref);
8340     #endif
8341     return (equals == Py_NE);
8342 #endif
8343 }
8344 
8345 /* RaiseException */
8346 #if PY_MAJOR_VERSION < 3
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,CYTHON_UNUSED PyObject * cause)8347 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
8348                         CYTHON_UNUSED PyObject *cause) {
8349     __Pyx_PyThreadState_declare
8350     Py_XINCREF(type);
8351     if (!value || value == Py_None)
8352         value = NULL;
8353     else
8354         Py_INCREF(value);
8355     if (!tb || tb == Py_None)
8356         tb = NULL;
8357     else {
8358         Py_INCREF(tb);
8359         if (!PyTraceBack_Check(tb)) {
8360             PyErr_SetString(PyExc_TypeError,
8361                 "raise: arg 3 must be a traceback or None");
8362             goto raise_error;
8363         }
8364     }
8365     if (PyType_Check(type)) {
8366 #if CYTHON_COMPILING_IN_PYPY
8367         if (!value) {
8368             Py_INCREF(Py_None);
8369             value = Py_None;
8370         }
8371 #endif
8372         PyErr_NormalizeException(&type, &value, &tb);
8373     } else {
8374         if (value) {
8375             PyErr_SetString(PyExc_TypeError,
8376                 "instance exception may not have a separate value");
8377             goto raise_error;
8378         }
8379         value = type;
8380         type = (PyObject*) Py_TYPE(type);
8381         Py_INCREF(type);
8382         if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
8383             PyErr_SetString(PyExc_TypeError,
8384                 "raise: exception class must be a subclass of BaseException");
8385             goto raise_error;
8386         }
8387     }
8388     __Pyx_PyThreadState_assign
8389     __Pyx_ErrRestore(type, value, tb);
8390     return;
8391 raise_error:
8392     Py_XDECREF(value);
8393     Py_XDECREF(type);
8394     Py_XDECREF(tb);
8395     return;
8396 }
8397 #else
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,PyObject * cause)8398 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
8399     PyObject* owned_instance = NULL;
8400     if (tb == Py_None) {
8401         tb = 0;
8402     } else if (tb && !PyTraceBack_Check(tb)) {
8403         PyErr_SetString(PyExc_TypeError,
8404             "raise: arg 3 must be a traceback or None");
8405         goto bad;
8406     }
8407     if (value == Py_None)
8408         value = 0;
8409     if (PyExceptionInstance_Check(type)) {
8410         if (value) {
8411             PyErr_SetString(PyExc_TypeError,
8412                 "instance exception may not have a separate value");
8413             goto bad;
8414         }
8415         value = type;
8416         type = (PyObject*) Py_TYPE(value);
8417     } else if (PyExceptionClass_Check(type)) {
8418         PyObject *instance_class = NULL;
8419         if (value && PyExceptionInstance_Check(value)) {
8420             instance_class = (PyObject*) Py_TYPE(value);
8421             if (instance_class != type) {
8422                 int is_subclass = PyObject_IsSubclass(instance_class, type);
8423                 if (!is_subclass) {
8424                     instance_class = NULL;
8425                 } else if (unlikely(is_subclass == -1)) {
8426                     goto bad;
8427                 } else {
8428                     type = instance_class;
8429                 }
8430             }
8431         }
8432         if (!instance_class) {
8433             PyObject *args;
8434             if (!value)
8435                 args = PyTuple_New(0);
8436             else if (PyTuple_Check(value)) {
8437                 Py_INCREF(value);
8438                 args = value;
8439             } else
8440                 args = PyTuple_Pack(1, value);
8441             if (!args)
8442                 goto bad;
8443             owned_instance = PyObject_Call(type, args, NULL);
8444             Py_DECREF(args);
8445             if (!owned_instance)
8446                 goto bad;
8447             value = owned_instance;
8448             if (!PyExceptionInstance_Check(value)) {
8449                 PyErr_Format(PyExc_TypeError,
8450                              "calling %R should have returned an instance of "
8451                              "BaseException, not %R",
8452                              type, Py_TYPE(value));
8453                 goto bad;
8454             }
8455         }
8456     } else {
8457         PyErr_SetString(PyExc_TypeError,
8458             "raise: exception class must be a subclass of BaseException");
8459         goto bad;
8460     }
8461     if (cause) {
8462         PyObject *fixed_cause;
8463         if (cause == Py_None) {
8464             fixed_cause = NULL;
8465         } else if (PyExceptionClass_Check(cause)) {
8466             fixed_cause = PyObject_CallObject(cause, NULL);
8467             if (fixed_cause == NULL)
8468                 goto bad;
8469         } else if (PyExceptionInstance_Check(cause)) {
8470             fixed_cause = cause;
8471             Py_INCREF(fixed_cause);
8472         } else {
8473             PyErr_SetString(PyExc_TypeError,
8474                             "exception causes must derive from "
8475                             "BaseException");
8476             goto bad;
8477         }
8478         PyException_SetCause(value, fixed_cause);
8479     }
8480     PyErr_SetObject(type, value);
8481     if (tb) {
8482 #if CYTHON_COMPILING_IN_PYPY
8483         PyObject *tmp_type, *tmp_value, *tmp_tb;
8484         PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
8485         Py_INCREF(tb);
8486         PyErr_Restore(tmp_type, tmp_value, tb);
8487         Py_XDECREF(tmp_tb);
8488 #else
8489         PyThreadState *tstate = __Pyx_PyThreadState_Current;
8490         PyObject* tmp_tb = tstate->curexc_traceback;
8491         if (tb != tmp_tb) {
8492             Py_INCREF(tb);
8493             tstate->curexc_traceback = tb;
8494             Py_XDECREF(tmp_tb);
8495         }
8496 #endif
8497     }
8498 bad:
8499     Py_XDECREF(owned_instance);
8500     return;
8501 }
8502 #endif
8503 
8504 /* IterFinish */
__Pyx_IterFinish(void)8505 static CYTHON_INLINE int __Pyx_IterFinish(void) {
8506 #if CYTHON_FAST_THREAD_STATE
8507     PyThreadState *tstate = __Pyx_PyThreadState_Current;
8508     PyObject* exc_type = tstate->curexc_type;
8509     if (unlikely(exc_type)) {
8510         if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
8511             PyObject *exc_value, *exc_tb;
8512             exc_value = tstate->curexc_value;
8513             exc_tb = tstate->curexc_traceback;
8514             tstate->curexc_type = 0;
8515             tstate->curexc_value = 0;
8516             tstate->curexc_traceback = 0;
8517             Py_DECREF(exc_type);
8518             Py_XDECREF(exc_value);
8519             Py_XDECREF(exc_tb);
8520             return 0;
8521         } else {
8522             return -1;
8523         }
8524     }
8525     return 0;
8526 #else
8527     if (unlikely(PyErr_Occurred())) {
8528         if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
8529             PyErr_Clear();
8530             return 0;
8531         } else {
8532             return -1;
8533         }
8534     }
8535     return 0;
8536 #endif
8537 }
8538 
8539 /* PyObjectGetMethod */
__Pyx_PyObject_GetMethod(PyObject * obj,PyObject * name,PyObject ** method)8540 static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
8541     PyObject *attr;
8542 #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
8543     PyTypeObject *tp = Py_TYPE(obj);
8544     PyObject *descr;
8545     descrgetfunc f = NULL;
8546     PyObject **dictptr, *dict;
8547     int meth_found = 0;
8548     assert (*method == NULL);
8549     if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
8550         attr = __Pyx_PyObject_GetAttrStr(obj, name);
8551         goto try_unpack;
8552     }
8553     if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
8554         return 0;
8555     }
8556     descr = _PyType_Lookup(tp, name);
8557     if (likely(descr != NULL)) {
8558         Py_INCREF(descr);
8559 #if PY_MAJOR_VERSION >= 3
8560         #ifdef __Pyx_CyFunction_USED
8561         if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
8562         #else
8563         if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type)))
8564         #endif
8565 #else
8566         #ifdef __Pyx_CyFunction_USED
8567         if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
8568         #else
8569         if (likely(PyFunction_Check(descr)))
8570         #endif
8571 #endif
8572         {
8573             meth_found = 1;
8574         } else {
8575             f = Py_TYPE(descr)->tp_descr_get;
8576             if (f != NULL && PyDescr_IsData(descr)) {
8577                 attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
8578                 Py_DECREF(descr);
8579                 goto try_unpack;
8580             }
8581         }
8582     }
8583     dictptr = _PyObject_GetDictPtr(obj);
8584     if (dictptr != NULL && (dict = *dictptr) != NULL) {
8585         Py_INCREF(dict);
8586         attr = __Pyx_PyDict_GetItemStr(dict, name);
8587         if (attr != NULL) {
8588             Py_INCREF(attr);
8589             Py_DECREF(dict);
8590             Py_XDECREF(descr);
8591             goto try_unpack;
8592         }
8593         Py_DECREF(dict);
8594     }
8595     if (meth_found) {
8596         *method = descr;
8597         return 1;
8598     }
8599     if (f != NULL) {
8600         attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
8601         Py_DECREF(descr);
8602         goto try_unpack;
8603     }
8604     if (descr != NULL) {
8605         *method = descr;
8606         return 0;
8607     }
8608     PyErr_Format(PyExc_AttributeError,
8609 #if PY_MAJOR_VERSION >= 3
8610                  "'%.50s' object has no attribute '%U'",
8611                  tp->tp_name, name);
8612 #else
8613                  "'%.50s' object has no attribute '%.400s'",
8614                  tp->tp_name, PyString_AS_STRING(name));
8615 #endif
8616     return 0;
8617 #else
8618     attr = __Pyx_PyObject_GetAttrStr(obj, name);
8619     goto try_unpack;
8620 #endif
8621 try_unpack:
8622 #if CYTHON_UNPACK_METHODS
8623     if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
8624         PyObject *function = PyMethod_GET_FUNCTION(attr);
8625         Py_INCREF(function);
8626         Py_DECREF(attr);
8627         *method = function;
8628         return 1;
8629     }
8630 #endif
8631     *method = attr;
8632     return 0;
8633 }
8634 
8635 /* PyObjectCallMethod0 */
__Pyx_PyObject_CallMethod0(PyObject * obj,PyObject * method_name)8636 static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
8637     PyObject *method = NULL, *result = NULL;
8638     int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
8639     if (likely(is_method)) {
8640         result = __Pyx_PyObject_CallOneArg(method, obj);
8641         Py_DECREF(method);
8642         return result;
8643     }
8644     if (unlikely(!method)) goto bad;
8645     result = __Pyx_PyObject_CallNoArg(method);
8646     Py_DECREF(method);
8647 bad:
8648     return result;
8649 }
8650 
8651 /* RaiseNeedMoreValuesToUnpack */
__Pyx_RaiseNeedMoreValuesError(Py_ssize_t index)8652 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
8653     PyErr_Format(PyExc_ValueError,
8654                  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
8655                  index, (index == 1) ? "" : "s");
8656 }
8657 
8658 /* RaiseTooManyValuesToUnpack */
__Pyx_RaiseTooManyValuesError(Py_ssize_t expected)8659 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
8660     PyErr_Format(PyExc_ValueError,
8661                  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
8662 }
8663 
8664 /* UnpackItemEndCheck */
__Pyx_IternextUnpackEndCheck(PyObject * retval,Py_ssize_t expected)8665 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
8666     if (unlikely(retval)) {
8667         Py_DECREF(retval);
8668         __Pyx_RaiseTooManyValuesError(expected);
8669         return -1;
8670     } else {
8671         return __Pyx_IterFinish();
8672     }
8673     return 0;
8674 }
8675 
8676 /* RaiseNoneIterError */
__Pyx_RaiseNoneNotIterableError(void)8677 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
8678     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
8679 }
8680 
8681 /* UnpackTupleError */
__Pyx_UnpackTupleError(PyObject * t,Py_ssize_t index)8682 static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
8683     if (t == Py_None) {
8684       __Pyx_RaiseNoneNotIterableError();
8685     } else if (PyTuple_GET_SIZE(t) < index) {
8686       __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
8687     } else {
8688       __Pyx_RaiseTooManyValuesError(index);
8689     }
8690 }
8691 
8692 /* UnpackTuple2 */
__Pyx_unpack_tuple2_exact(PyObject * tuple,PyObject ** pvalue1,PyObject ** pvalue2,int decref_tuple)8693 static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
8694         PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) {
8695     PyObject *value1 = NULL, *value2 = NULL;
8696 #if CYTHON_COMPILING_IN_PYPY
8697     value1 = PySequence_ITEM(tuple, 0);  if (unlikely(!value1)) goto bad;
8698     value2 = PySequence_ITEM(tuple, 1);  if (unlikely(!value2)) goto bad;
8699 #else
8700     value1 = PyTuple_GET_ITEM(tuple, 0);  Py_INCREF(value1);
8701     value2 = PyTuple_GET_ITEM(tuple, 1);  Py_INCREF(value2);
8702 #endif
8703     if (decref_tuple) {
8704         Py_DECREF(tuple);
8705     }
8706     *pvalue1 = value1;
8707     *pvalue2 = value2;
8708     return 0;
8709 #if CYTHON_COMPILING_IN_PYPY
8710 bad:
8711     Py_XDECREF(value1);
8712     Py_XDECREF(value2);
8713     if (decref_tuple) { Py_XDECREF(tuple); }
8714     return -1;
8715 #endif
8716 }
__Pyx_unpack_tuple2_generic(PyObject * tuple,PyObject ** pvalue1,PyObject ** pvalue2,int has_known_size,int decref_tuple)8717 static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
8718                                        int has_known_size, int decref_tuple) {
8719     Py_ssize_t index;
8720     PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
8721     iternextfunc iternext;
8722     iter = PyObject_GetIter(tuple);
8723     if (unlikely(!iter)) goto bad;
8724     if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
8725     iternext = Py_TYPE(iter)->tp_iternext;
8726     value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
8727     value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
8728     if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
8729     Py_DECREF(iter);
8730     *pvalue1 = value1;
8731     *pvalue2 = value2;
8732     return 0;
8733 unpacking_failed:
8734     if (!has_known_size && __Pyx_IterFinish() == 0)
8735         __Pyx_RaiseNeedMoreValuesError(index);
8736 bad:
8737     Py_XDECREF(iter);
8738     Py_XDECREF(value1);
8739     Py_XDECREF(value2);
8740     if (decref_tuple) { Py_XDECREF(tuple); }
8741     return -1;
8742 }
8743 
8744 /* dict_iter */
__Pyx_dict_iterator(PyObject * iterable,int is_dict,PyObject * method_name,Py_ssize_t * p_orig_length,int * p_source_is_dict)8745 static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
8746                                                    Py_ssize_t* p_orig_length, int* p_source_is_dict) {
8747     is_dict = is_dict || likely(PyDict_CheckExact(iterable));
8748     *p_source_is_dict = is_dict;
8749     if (is_dict) {
8750 #if !CYTHON_COMPILING_IN_PYPY
8751         *p_orig_length = PyDict_Size(iterable);
8752         Py_INCREF(iterable);
8753         return iterable;
8754 #elif PY_MAJOR_VERSION >= 3
8755         static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL;
8756         PyObject **pp = NULL;
8757         if (method_name) {
8758             const char *name = PyUnicode_AsUTF8(method_name);
8759             if (strcmp(name, "iteritems") == 0) pp = &py_items;
8760             else if (strcmp(name, "iterkeys") == 0) pp = &py_keys;
8761             else if (strcmp(name, "itervalues") == 0) pp = &py_values;
8762             if (pp) {
8763                 if (!*pp) {
8764                     *pp = PyUnicode_FromString(name + 4);
8765                     if (!*pp)
8766                         return NULL;
8767                 }
8768                 method_name = *pp;
8769             }
8770         }
8771 #endif
8772     }
8773     *p_orig_length = 0;
8774     if (method_name) {
8775         PyObject* iter;
8776         iterable = __Pyx_PyObject_CallMethod0(iterable, method_name);
8777         if (!iterable)
8778             return NULL;
8779 #if !CYTHON_COMPILING_IN_PYPY
8780         if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable))
8781             return iterable;
8782 #endif
8783         iter = PyObject_GetIter(iterable);
8784         Py_DECREF(iterable);
8785         return iter;
8786     }
8787     return PyObject_GetIter(iterable);
8788 }
__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)8789 static CYTHON_INLINE int __Pyx_dict_iter_next(
8790         PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos,
8791         PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) {
8792     PyObject* next_item;
8793 #if !CYTHON_COMPILING_IN_PYPY
8794     if (source_is_dict) {
8795         PyObject *key, *value;
8796         if (unlikely(orig_length != PyDict_Size(iter_obj))) {
8797             PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration");
8798             return -1;
8799         }
8800         if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) {
8801             return 0;
8802         }
8803         if (pitem) {
8804             PyObject* tuple = PyTuple_New(2);
8805             if (unlikely(!tuple)) {
8806                 return -1;
8807             }
8808             Py_INCREF(key);
8809             Py_INCREF(value);
8810             PyTuple_SET_ITEM(tuple, 0, key);
8811             PyTuple_SET_ITEM(tuple, 1, value);
8812             *pitem = tuple;
8813         } else {
8814             if (pkey) {
8815                 Py_INCREF(key);
8816                 *pkey = key;
8817             }
8818             if (pvalue) {
8819                 Py_INCREF(value);
8820                 *pvalue = value;
8821             }
8822         }
8823         return 1;
8824     } else if (PyTuple_CheckExact(iter_obj)) {
8825         Py_ssize_t pos = *ppos;
8826         if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0;
8827         *ppos = pos + 1;
8828         next_item = PyTuple_GET_ITEM(iter_obj, pos);
8829         Py_INCREF(next_item);
8830     } else if (PyList_CheckExact(iter_obj)) {
8831         Py_ssize_t pos = *ppos;
8832         if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0;
8833         *ppos = pos + 1;
8834         next_item = PyList_GET_ITEM(iter_obj, pos);
8835         Py_INCREF(next_item);
8836     } else
8837 #endif
8838     {
8839         next_item = PyIter_Next(iter_obj);
8840         if (unlikely(!next_item)) {
8841             return __Pyx_IterFinish();
8842         }
8843     }
8844     if (pitem) {
8845         *pitem = next_item;
8846     } else if (pkey && pvalue) {
8847         if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1))
8848             return -1;
8849     } else if (pkey) {
8850         *pkey = next_item;
8851     } else {
8852         *pvalue = next_item;
8853     }
8854     return 1;
8855 }
8856 
8857 /* MergeKeywords */
__Pyx_MergeKeywords(PyObject * kwdict,PyObject * source_mapping)8858 static int __Pyx_MergeKeywords(PyObject *kwdict, PyObject *source_mapping) {
8859     PyObject *iter, *key = NULL, *value = NULL;
8860     int source_is_dict, result;
8861     Py_ssize_t orig_length, ppos = 0;
8862     iter = __Pyx_dict_iterator(source_mapping, 0, __pyx_n_s_items, &orig_length, &source_is_dict);
8863     if (unlikely(!iter)) {
8864         PyObject *args;
8865         if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
8866         PyErr_Clear();
8867         args = PyTuple_Pack(1, source_mapping);
8868         if (likely(args)) {
8869             PyObject *fallback = PyObject_Call((PyObject*)&PyDict_Type, args, NULL);
8870             Py_DECREF(args);
8871             if (likely(fallback)) {
8872                 iter = __Pyx_dict_iterator(fallback, 1, __pyx_n_s_items, &orig_length, &source_is_dict);
8873                 Py_DECREF(fallback);
8874             }
8875         }
8876         if (unlikely(!iter)) goto bad;
8877     }
8878     while (1) {
8879         result = __Pyx_dict_iter_next(iter, orig_length, &ppos, &key, &value, NULL, source_is_dict);
8880         if (unlikely(result < 0)) goto bad;
8881         if (!result) break;
8882         if (unlikely(PyDict_Contains(kwdict, key))) {
8883             __Pyx_RaiseDoubleKeywordsError("function", key);
8884             result = -1;
8885         } else {
8886             result = PyDict_SetItem(kwdict, key, value);
8887         }
8888         Py_DECREF(key);
8889         Py_DECREF(value);
8890         if (unlikely(result < 0)) goto bad;
8891     }
8892     Py_XDECREF(iter);
8893     return 0;
8894 bad:
8895     Py_XDECREF(iter);
8896     return -1;
8897 }
8898 
8899 /* UnicodeAsUCS4 */
__Pyx_PyUnicode_AsPy_UCS4(PyObject * x)8900 static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject* x) {
8901    Py_ssize_t length;
8902    #if CYTHON_PEP393_ENABLED
8903    length = PyUnicode_GET_LENGTH(x);
8904    if (likely(length == 1)) {
8905        return PyUnicode_READ_CHAR(x, 0);
8906    }
8907    #else
8908    length = PyUnicode_GET_SIZE(x);
8909    if (likely(length == 1)) {
8910        return PyUnicode_AS_UNICODE(x)[0];
8911    }
8912    #if Py_UNICODE_SIZE == 2
8913    else if (PyUnicode_GET_SIZE(x) == 2) {
8914        Py_UCS4 high_val = PyUnicode_AS_UNICODE(x)[0];
8915        if (high_val >= 0xD800 && high_val <= 0xDBFF) {
8916            Py_UCS4 low_val = PyUnicode_AS_UNICODE(x)[1];
8917            if (low_val >= 0xDC00 && low_val <= 0xDFFF) {
8918                return 0x10000 + (((high_val & ((1<<10)-1)) << 10) | (low_val & ((1<<10)-1)));
8919            }
8920        }
8921    }
8922    #endif
8923    #endif
8924    PyErr_Format(PyExc_ValueError,
8925                 "only single character unicode strings can be converted to Py_UCS4, "
8926                 "got length %" CYTHON_FORMAT_SSIZE_T "d", length);
8927    return (Py_UCS4)-1;
8928 }
8929 
8930 /* object_ord */
__Pyx__PyObject_Ord(PyObject * c)8931 static long __Pyx__PyObject_Ord(PyObject* c) {
8932     Py_ssize_t size;
8933     if (PyBytes_Check(c)) {
8934         size = PyBytes_GET_SIZE(c);
8935         if (likely(size == 1)) {
8936             return (unsigned char) PyBytes_AS_STRING(c)[0];
8937         }
8938 #if PY_MAJOR_VERSION < 3
8939     } else if (PyUnicode_Check(c)) {
8940         return (long)__Pyx_PyUnicode_AsPy_UCS4(c);
8941 #endif
8942 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
8943     } else if (PyByteArray_Check(c)) {
8944         size = PyByteArray_GET_SIZE(c);
8945         if (likely(size == 1)) {
8946             return (unsigned char) PyByteArray_AS_STRING(c)[0];
8947         }
8948 #endif
8949     } else {
8950         PyErr_Format(PyExc_TypeError,
8951             "ord() expected string of length 1, but %.200s found", c->ob_type->tp_name);
8952         return (long)(Py_UCS4)-1;
8953     }
8954     PyErr_Format(PyExc_TypeError,
8955         "ord() expected a character, but string of length %zd found", size);
8956     return (long)(Py_UCS4)-1;
8957 }
8958 
8959 /* FetchCommonType */
__Pyx_FetchCommonType(PyTypeObject * type)8960 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
8961     PyObject* fake_module;
8962     PyTypeObject* cached_type = NULL;
8963     fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
8964     if (!fake_module) return NULL;
8965     Py_INCREF(fake_module);
8966     cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
8967     if (cached_type) {
8968         if (!PyType_Check((PyObject*)cached_type)) {
8969             PyErr_Format(PyExc_TypeError,
8970                 "Shared Cython type %.200s is not a type object",
8971                 type->tp_name);
8972             goto bad;
8973         }
8974         if (cached_type->tp_basicsize != type->tp_basicsize) {
8975             PyErr_Format(PyExc_TypeError,
8976                 "Shared Cython type %.200s has the wrong size, try recompiling",
8977                 type->tp_name);
8978             goto bad;
8979         }
8980     } else {
8981         if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
8982         PyErr_Clear();
8983         if (PyType_Ready(type) < 0) goto bad;
8984         if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
8985             goto bad;
8986         Py_INCREF(type);
8987         cached_type = type;
8988     }
8989 done:
8990     Py_DECREF(fake_module);
8991     return cached_type;
8992 bad:
8993     Py_XDECREF(cached_type);
8994     cached_type = NULL;
8995     goto done;
8996 }
8997 
8998 /* CythonFunctionShared */
8999 #include <structmember.h>
9000 static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject * op,CYTHON_UNUSED void * closure)9001 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
9002 {
9003     if (unlikely(op->func_doc == NULL)) {
9004         if (op->func.m_ml->ml_doc) {
9005 #if PY_MAJOR_VERSION >= 3
9006             op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
9007 #else
9008             op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
9009 #endif
9010             if (unlikely(op->func_doc == NULL))
9011                 return NULL;
9012         } else {
9013             Py_INCREF(Py_None);
9014             return Py_None;
9015         }
9016     }
9017     Py_INCREF(op->func_doc);
9018     return op->func_doc;
9019 }
9020 static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject * op,PyObject * value,CYTHON_UNUSED void * context)9021 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
9022 {
9023     PyObject *tmp = op->func_doc;
9024     if (value == NULL) {
9025         value = Py_None;
9026     }
9027     Py_INCREF(value);
9028     op->func_doc = value;
9029     Py_XDECREF(tmp);
9030     return 0;
9031 }
9032 static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject * op,CYTHON_UNUSED void * context)9033 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
9034 {
9035     if (unlikely(op->func_name == NULL)) {
9036 #if PY_MAJOR_VERSION >= 3
9037         op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
9038 #else
9039         op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
9040 #endif
9041         if (unlikely(op->func_name == NULL))
9042             return NULL;
9043     }
9044     Py_INCREF(op->func_name);
9045     return op->func_name;
9046 }
9047 static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject * op,PyObject * value,CYTHON_UNUSED void * context)9048 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
9049 {
9050     PyObject *tmp;
9051 #if PY_MAJOR_VERSION >= 3
9052     if (unlikely(value == NULL || !PyUnicode_Check(value)))
9053 #else
9054     if (unlikely(value == NULL || !PyString_Check(value)))
9055 #endif
9056     {
9057         PyErr_SetString(PyExc_TypeError,
9058                         "__name__ must be set to a string object");
9059         return -1;
9060     }
9061     tmp = op->func_name;
9062     Py_INCREF(value);
9063     op->func_name = value;
9064     Py_XDECREF(tmp);
9065     return 0;
9066 }
9067 static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject * op,CYTHON_UNUSED void * context)9068 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
9069 {
9070     Py_INCREF(op->func_qualname);
9071     return op->func_qualname;
9072 }
9073 static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject * op,PyObject * value,CYTHON_UNUSED void * context)9074 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
9075 {
9076     PyObject *tmp;
9077 #if PY_MAJOR_VERSION >= 3
9078     if (unlikely(value == NULL || !PyUnicode_Check(value)))
9079 #else
9080     if (unlikely(value == NULL || !PyString_Check(value)))
9081 #endif
9082     {
9083         PyErr_SetString(PyExc_TypeError,
9084                         "__qualname__ must be set to a string object");
9085         return -1;
9086     }
9087     tmp = op->func_qualname;
9088     Py_INCREF(value);
9089     op->func_qualname = value;
9090     Py_XDECREF(tmp);
9091     return 0;
9092 }
9093 static PyObject *
__Pyx_CyFunction_get_self(__pyx_CyFunctionObject * m,CYTHON_UNUSED void * closure)9094 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
9095 {
9096     PyObject *self;
9097     self = m->func_closure;
9098     if (self == NULL)
9099         self = Py_None;
9100     Py_INCREF(self);
9101     return self;
9102 }
9103 static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject * op,CYTHON_UNUSED void * context)9104 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
9105 {
9106     if (unlikely(op->func_dict == NULL)) {
9107         op->func_dict = PyDict_New();
9108         if (unlikely(op->func_dict == NULL))
9109             return NULL;
9110     }
9111     Py_INCREF(op->func_dict);
9112     return op->func_dict;
9113 }
9114 static int
__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject * op,PyObject * value,CYTHON_UNUSED void * context)9115 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
9116 {
9117     PyObject *tmp;
9118     if (unlikely(value == NULL)) {
9119         PyErr_SetString(PyExc_TypeError,
9120                "function's dictionary may not be deleted");
9121         return -1;
9122     }
9123     if (unlikely(!PyDict_Check(value))) {
9124         PyErr_SetString(PyExc_TypeError,
9125                "setting function's dictionary to a non-dict");
9126         return -1;
9127     }
9128     tmp = op->func_dict;
9129     Py_INCREF(value);
9130     op->func_dict = value;
9131     Py_XDECREF(tmp);
9132     return 0;
9133 }
9134 static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject * op,CYTHON_UNUSED void * context)9135 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
9136 {
9137     Py_INCREF(op->func_globals);
9138     return op->func_globals;
9139 }
9140 static PyObject *
__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject * op,CYTHON_UNUSED void * context)9141 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
9142 {
9143     Py_INCREF(Py_None);
9144     return Py_None;
9145 }
9146 static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject * op,CYTHON_UNUSED void * context)9147 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
9148 {
9149     PyObject* result = (op->func_code) ? op->func_code : Py_None;
9150     Py_INCREF(result);
9151     return result;
9152 }
9153 static int
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject * op)9154 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
9155     int result = 0;
9156     PyObject *res = op->defaults_getter((PyObject *) op);
9157     if (unlikely(!res))
9158         return -1;
9159     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9160     op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
9161     Py_INCREF(op->defaults_tuple);
9162     op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
9163     Py_INCREF(op->defaults_kwdict);
9164     #else
9165     op->defaults_tuple = PySequence_ITEM(res, 0);
9166     if (unlikely(!op->defaults_tuple)) result = -1;
9167     else {
9168         op->defaults_kwdict = PySequence_ITEM(res, 1);
9169         if (unlikely(!op->defaults_kwdict)) result = -1;
9170     }
9171     #endif
9172     Py_DECREF(res);
9173     return result;
9174 }
9175 static int
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject * op,PyObject * value,CYTHON_UNUSED void * context)9176 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
9177     PyObject* tmp;
9178     if (!value) {
9179         value = Py_None;
9180     } else if (value != Py_None && !PyTuple_Check(value)) {
9181         PyErr_SetString(PyExc_TypeError,
9182                         "__defaults__ must be set to a tuple object");
9183         return -1;
9184     }
9185     Py_INCREF(value);
9186     tmp = op->defaults_tuple;
9187     op->defaults_tuple = value;
9188     Py_XDECREF(tmp);
9189     return 0;
9190 }
9191 static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject * op,CYTHON_UNUSED void * context)9192 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
9193     PyObject* result = op->defaults_tuple;
9194     if (unlikely(!result)) {
9195         if (op->defaults_getter) {
9196             if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
9197             result = op->defaults_tuple;
9198         } else {
9199             result = Py_None;
9200         }
9201     }
9202     Py_INCREF(result);
9203     return result;
9204 }
9205 static int
__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject * op,PyObject * value,CYTHON_UNUSED void * context)9206 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
9207     PyObject* tmp;
9208     if (!value) {
9209         value = Py_None;
9210     } else if (value != Py_None && !PyDict_Check(value)) {
9211         PyErr_SetString(PyExc_TypeError,
9212                         "__kwdefaults__ must be set to a dict object");
9213         return -1;
9214     }
9215     Py_INCREF(value);
9216     tmp = op->defaults_kwdict;
9217     op->defaults_kwdict = value;
9218     Py_XDECREF(tmp);
9219     return 0;
9220 }
9221 static PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject * op,CYTHON_UNUSED void * context)9222 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
9223     PyObject* result = op->defaults_kwdict;
9224     if (unlikely(!result)) {
9225         if (op->defaults_getter) {
9226             if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
9227             result = op->defaults_kwdict;
9228         } else {
9229             result = Py_None;
9230         }
9231     }
9232     Py_INCREF(result);
9233     return result;
9234 }
9235 static int
__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject * op,PyObject * value,CYTHON_UNUSED void * context)9236 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
9237     PyObject* tmp;
9238     if (!value || value == Py_None) {
9239         value = NULL;
9240     } else if (!PyDict_Check(value)) {
9241         PyErr_SetString(PyExc_TypeError,
9242                         "__annotations__ must be set to a dict object");
9243         return -1;
9244     }
9245     Py_XINCREF(value);
9246     tmp = op->func_annotations;
9247     op->func_annotations = value;
9248     Py_XDECREF(tmp);
9249     return 0;
9250 }
9251 static PyObject *
__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject * op,CYTHON_UNUSED void * context)9252 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
9253     PyObject* result = op->func_annotations;
9254     if (unlikely(!result)) {
9255         result = PyDict_New();
9256         if (unlikely(!result)) return NULL;
9257         op->func_annotations = result;
9258     }
9259     Py_INCREF(result);
9260     return result;
9261 }
9262 static PyGetSetDef __pyx_CyFunction_getsets[] = {
9263     {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
9264     {(char *) "__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
9265     {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
9266     {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
9267     {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
9268     {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
9269     {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
9270     {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
9271     {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
9272     {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
9273     {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
9274     {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
9275     {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
9276     {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
9277     {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
9278     {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
9279     {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
9280     {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
9281     {0, 0, 0, 0, 0}
9282 };
9283 static PyMemberDef __pyx_CyFunction_members[] = {
9284     {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
9285     {0, 0, 0,  0, 0}
9286 };
9287 static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject * m,CYTHON_UNUSED PyObject * args)9288 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
9289 {
9290 #if PY_MAJOR_VERSION >= 3
9291     return PyUnicode_FromString(m->func.m_ml->ml_name);
9292 #else
9293     return PyString_FromString(m->func.m_ml->ml_name);
9294 #endif
9295 }
9296 static PyMethodDef __pyx_CyFunction_methods[] = {
9297     {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
9298     {0, 0, 0, 0}
9299 };
9300 #if PY_VERSION_HEX < 0x030500A0
9301 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
9302 #else
9303 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
9304 #endif
__Pyx_CyFunction_Init(__pyx_CyFunctionObject * op,PyMethodDef * ml,int flags,PyObject * qualname,PyObject * closure,PyObject * module,PyObject * globals,PyObject * code)9305 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
9306                                        PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
9307     if (unlikely(op == NULL))
9308         return NULL;
9309     op->flags = flags;
9310     __Pyx_CyFunction_weakreflist(op) = NULL;
9311     op->func.m_ml = ml;
9312     op->func.m_self = (PyObject *) op;
9313     Py_XINCREF(closure);
9314     op->func_closure = closure;
9315     Py_XINCREF(module);
9316     op->func.m_module = module;
9317     op->func_dict = NULL;
9318     op->func_name = NULL;
9319     Py_INCREF(qualname);
9320     op->func_qualname = qualname;
9321     op->func_doc = NULL;
9322     op->func_classobj = NULL;
9323     op->func_globals = globals;
9324     Py_INCREF(op->func_globals);
9325     Py_XINCREF(code);
9326     op->func_code = code;
9327     op->defaults_pyobjects = 0;
9328     op->defaults_size = 0;
9329     op->defaults = NULL;
9330     op->defaults_tuple = NULL;
9331     op->defaults_kwdict = NULL;
9332     op->defaults_getter = NULL;
9333     op->func_annotations = NULL;
9334     return (PyObject *) op;
9335 }
9336 static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject * m)9337 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
9338 {
9339     Py_CLEAR(m->func_closure);
9340     Py_CLEAR(m->func.m_module);
9341     Py_CLEAR(m->func_dict);
9342     Py_CLEAR(m->func_name);
9343     Py_CLEAR(m->func_qualname);
9344     Py_CLEAR(m->func_doc);
9345     Py_CLEAR(m->func_globals);
9346     Py_CLEAR(m->func_code);
9347     Py_CLEAR(m->func_classobj);
9348     Py_CLEAR(m->defaults_tuple);
9349     Py_CLEAR(m->defaults_kwdict);
9350     Py_CLEAR(m->func_annotations);
9351     if (m->defaults) {
9352         PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
9353         int i;
9354         for (i = 0; i < m->defaults_pyobjects; i++)
9355             Py_XDECREF(pydefaults[i]);
9356         PyObject_Free(m->defaults);
9357         m->defaults = NULL;
9358     }
9359     return 0;
9360 }
__Pyx__CyFunction_dealloc(__pyx_CyFunctionObject * m)9361 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
9362 {
9363     if (__Pyx_CyFunction_weakreflist(m) != NULL)
9364         PyObject_ClearWeakRefs((PyObject *) m);
9365     __Pyx_CyFunction_clear(m);
9366     PyObject_GC_Del(m);
9367 }
__Pyx_CyFunction_dealloc(__pyx_CyFunctionObject * m)9368 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
9369 {
9370     PyObject_GC_UnTrack(m);
9371     __Pyx__CyFunction_dealloc(m);
9372 }
__Pyx_CyFunction_traverse(__pyx_CyFunctionObject * m,visitproc visit,void * arg)9373 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
9374 {
9375     Py_VISIT(m->func_closure);
9376     Py_VISIT(m->func.m_module);
9377     Py_VISIT(m->func_dict);
9378     Py_VISIT(m->func_name);
9379     Py_VISIT(m->func_qualname);
9380     Py_VISIT(m->func_doc);
9381     Py_VISIT(m->func_globals);
9382     Py_VISIT(m->func_code);
9383     Py_VISIT(m->func_classobj);
9384     Py_VISIT(m->defaults_tuple);
9385     Py_VISIT(m->defaults_kwdict);
9386     if (m->defaults) {
9387         PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
9388         int i;
9389         for (i = 0; i < m->defaults_pyobjects; i++)
9390             Py_VISIT(pydefaults[i]);
9391     }
9392     return 0;
9393 }
__Pyx_CyFunction_descr_get(PyObject * func,PyObject * obj,PyObject * type)9394 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
9395 {
9396 #if PY_MAJOR_VERSION < 3
9397     __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
9398     if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
9399         Py_INCREF(func);
9400         return func;
9401     }
9402     if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
9403         if (type == NULL)
9404             type = (PyObject *)(Py_TYPE(obj));
9405         return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
9406     }
9407     if (obj == Py_None)
9408         obj = NULL;
9409 #endif
9410     return __Pyx_PyMethod_New(func, obj, type);
9411 }
9412 static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject * op)9413 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
9414 {
9415 #if PY_MAJOR_VERSION >= 3
9416     return PyUnicode_FromFormat("<cyfunction %U at %p>",
9417                                 op->func_qualname, (void *)op);
9418 #else
9419     return PyString_FromFormat("<cyfunction %s at %p>",
9420                                PyString_AsString(op->func_qualname), (void *)op);
9421 #endif
9422 }
__Pyx_CyFunction_CallMethod(PyObject * func,PyObject * self,PyObject * arg,PyObject * kw)9423 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
9424     PyCFunctionObject* f = (PyCFunctionObject*)func;
9425     PyCFunction meth = f->m_ml->ml_meth;
9426     Py_ssize_t size;
9427     switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
9428     case METH_VARARGS:
9429         if (likely(kw == NULL || PyDict_Size(kw) == 0))
9430             return (*meth)(self, arg);
9431         break;
9432     case METH_VARARGS | METH_KEYWORDS:
9433         return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
9434     case METH_NOARGS:
9435         if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
9436             size = PyTuple_GET_SIZE(arg);
9437             if (likely(size == 0))
9438                 return (*meth)(self, NULL);
9439             PyErr_Format(PyExc_TypeError,
9440                 "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
9441                 f->m_ml->ml_name, size);
9442             return NULL;
9443         }
9444         break;
9445     case METH_O:
9446         if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
9447             size = PyTuple_GET_SIZE(arg);
9448             if (likely(size == 1)) {
9449                 PyObject *result, *arg0;
9450                 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9451                 arg0 = PyTuple_GET_ITEM(arg, 0);
9452                 #else
9453                 arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
9454                 #endif
9455                 result = (*meth)(self, arg0);
9456                 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
9457                 Py_DECREF(arg0);
9458                 #endif
9459                 return result;
9460             }
9461             PyErr_Format(PyExc_TypeError,
9462                 "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
9463                 f->m_ml->ml_name, size);
9464             return NULL;
9465         }
9466         break;
9467     default:
9468         PyErr_SetString(PyExc_SystemError, "Bad call flags in "
9469                         "__Pyx_CyFunction_Call. METH_OLDARGS is no "
9470                         "longer supported!");
9471         return NULL;
9472     }
9473     PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
9474                  f->m_ml->ml_name);
9475     return NULL;
9476 }
__Pyx_CyFunction_Call(PyObject * func,PyObject * arg,PyObject * kw)9477 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
9478     return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
9479 }
__Pyx_CyFunction_CallAsMethod(PyObject * func,PyObject * args,PyObject * kw)9480 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
9481     PyObject *result;
9482     __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
9483     if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
9484         Py_ssize_t argc;
9485         PyObject *new_args;
9486         PyObject *self;
9487         argc = PyTuple_GET_SIZE(args);
9488         new_args = PyTuple_GetSlice(args, 1, argc);
9489         if (unlikely(!new_args))
9490             return NULL;
9491         self = PyTuple_GetItem(args, 0);
9492         if (unlikely(!self)) {
9493             Py_DECREF(new_args);
9494             return NULL;
9495         }
9496         result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
9497         Py_DECREF(new_args);
9498     } else {
9499         result = __Pyx_CyFunction_Call(func, args, kw);
9500     }
9501     return result;
9502 }
9503 static PyTypeObject __pyx_CyFunctionType_type = {
9504     PyVarObject_HEAD_INIT(0, 0)
9505     "cython_function_or_method",
9506     sizeof(__pyx_CyFunctionObject),
9507     0,
9508     (destructor) __Pyx_CyFunction_dealloc,
9509     0,
9510     0,
9511     0,
9512 #if PY_MAJOR_VERSION < 3
9513     0,
9514 #else
9515     0,
9516 #endif
9517     (reprfunc) __Pyx_CyFunction_repr,
9518     0,
9519     0,
9520     0,
9521     0,
9522     __Pyx_CyFunction_CallAsMethod,
9523     0,
9524     0,
9525     0,
9526     0,
9527     Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
9528     0,
9529     (traverseproc) __Pyx_CyFunction_traverse,
9530     (inquiry) __Pyx_CyFunction_clear,
9531     0,
9532 #if PY_VERSION_HEX < 0x030500A0
9533     offsetof(__pyx_CyFunctionObject, func_weakreflist),
9534 #else
9535     offsetof(PyCFunctionObject, m_weakreflist),
9536 #endif
9537     0,
9538     0,
9539     __pyx_CyFunction_methods,
9540     __pyx_CyFunction_members,
9541     __pyx_CyFunction_getsets,
9542     0,
9543     0,
9544     __Pyx_CyFunction_descr_get,
9545     0,
9546     offsetof(__pyx_CyFunctionObject, func_dict),
9547     0,
9548     0,
9549     0,
9550     0,
9551     0,
9552     0,
9553     0,
9554     0,
9555     0,
9556     0,
9557     0,
9558     0,
9559 #if PY_VERSION_HEX >= 0x030400a1
9560     0,
9561 #endif
9562 #if PY_VERSION_HEX >= 0x030800b1
9563     0,
9564 #endif
9565 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
9566     0,
9567 #endif
9568 };
__pyx_CyFunction_init(void)9569 static int __pyx_CyFunction_init(void) {
9570     __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
9571     if (unlikely(__pyx_CyFunctionType == NULL)) {
9572         return -1;
9573     }
9574     return 0;
9575 }
__Pyx_CyFunction_InitDefaults(PyObject * func,size_t size,int pyobjects)9576 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
9577     __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
9578     m->defaults = PyObject_Malloc(size);
9579     if (unlikely(!m->defaults))
9580         return PyErr_NoMemory();
9581     memset(m->defaults, 0, size);
9582     m->defaults_pyobjects = pyobjects;
9583     m->defaults_size = size;
9584     return m->defaults;
9585 }
__Pyx_CyFunction_SetDefaultsTuple(PyObject * func,PyObject * tuple)9586 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
9587     __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
9588     m->defaults_tuple = tuple;
9589     Py_INCREF(tuple);
9590 }
__Pyx_CyFunction_SetDefaultsKwDict(PyObject * func,PyObject * dict)9591 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
9592     __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
9593     m->defaults_kwdict = dict;
9594     Py_INCREF(dict);
9595 }
__Pyx_CyFunction_SetAnnotationsDict(PyObject * func,PyObject * dict)9596 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
9597     __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
9598     m->func_annotations = dict;
9599     Py_INCREF(dict);
9600 }
9601 
9602 /* CythonFunction */
__Pyx_CyFunction_New(PyMethodDef * ml,int flags,PyObject * qualname,PyObject * closure,PyObject * module,PyObject * globals,PyObject * code)9603 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
9604                                       PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
9605     PyObject *op = __Pyx_CyFunction_Init(
9606         PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
9607         ml, flags, qualname, closure, module, globals, code
9608     );
9609     if (likely(op)) {
9610         PyObject_GC_Track(op);
9611     }
9612     return op;
9613 }
9614 
9615 /* GetTopmostException */
9616 #if CYTHON_USE_EXC_INFO_STACK
9617 static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState * tstate)9618 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
9619 {
9620     _PyErr_StackItem *exc_info = tstate->exc_info;
9621     while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
9622            exc_info->previous_item != NULL)
9623     {
9624         exc_info = exc_info->previous_item;
9625     }
9626     return exc_info;
9627 }
9628 #endif
9629 
9630 /* SaveResetException */
9631 #if CYTHON_FAST_THREAD_STATE
__Pyx__ExceptionSave(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)9632 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
9633     #if CYTHON_USE_EXC_INFO_STACK
9634     _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
9635     *type = exc_info->exc_type;
9636     *value = exc_info->exc_value;
9637     *tb = exc_info->exc_traceback;
9638     #else
9639     *type = tstate->exc_type;
9640     *value = tstate->exc_value;
9641     *tb = tstate->exc_traceback;
9642     #endif
9643     Py_XINCREF(*type);
9644     Py_XINCREF(*value);
9645     Py_XINCREF(*tb);
9646 }
__Pyx__ExceptionReset(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)9647 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
9648     PyObject *tmp_type, *tmp_value, *tmp_tb;
9649     #if CYTHON_USE_EXC_INFO_STACK
9650     _PyErr_StackItem *exc_info = tstate->exc_info;
9651     tmp_type = exc_info->exc_type;
9652     tmp_value = exc_info->exc_value;
9653     tmp_tb = exc_info->exc_traceback;
9654     exc_info->exc_type = type;
9655     exc_info->exc_value = value;
9656     exc_info->exc_traceback = tb;
9657     #else
9658     tmp_type = tstate->exc_type;
9659     tmp_value = tstate->exc_value;
9660     tmp_tb = tstate->exc_traceback;
9661     tstate->exc_type = type;
9662     tstate->exc_value = value;
9663     tstate->exc_traceback = tb;
9664     #endif
9665     Py_XDECREF(tmp_type);
9666     Py_XDECREF(tmp_value);
9667     Py_XDECREF(tmp_tb);
9668 }
9669 #endif
9670 
9671 /* GetException */
9672 #if CYTHON_FAST_THREAD_STATE
__Pyx__GetException(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)9673 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
9674 #else
9675 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
9676 #endif
9677 {
9678     PyObject *local_type, *local_value, *local_tb;
9679 #if CYTHON_FAST_THREAD_STATE
9680     PyObject *tmp_type, *tmp_value, *tmp_tb;
9681     local_type = tstate->curexc_type;
9682     local_value = tstate->curexc_value;
9683     local_tb = tstate->curexc_traceback;
9684     tstate->curexc_type = 0;
9685     tstate->curexc_value = 0;
9686     tstate->curexc_traceback = 0;
9687 #else
9688     PyErr_Fetch(&local_type, &local_value, &local_tb);
9689 #endif
9690     PyErr_NormalizeException(&local_type, &local_value, &local_tb);
9691 #if CYTHON_FAST_THREAD_STATE
9692     if (unlikely(tstate->curexc_type))
9693 #else
9694     if (unlikely(PyErr_Occurred()))
9695 #endif
9696         goto bad;
9697     #if PY_MAJOR_VERSION >= 3
9698     if (local_tb) {
9699         if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
9700             goto bad;
9701     }
9702     #endif
9703     Py_XINCREF(local_tb);
9704     Py_XINCREF(local_type);
9705     Py_XINCREF(local_value);
9706     *type = local_type;
9707     *value = local_value;
9708     *tb = local_tb;
9709 #if CYTHON_FAST_THREAD_STATE
9710     #if CYTHON_USE_EXC_INFO_STACK
9711     {
9712         _PyErr_StackItem *exc_info = tstate->exc_info;
9713         tmp_type = exc_info->exc_type;
9714         tmp_value = exc_info->exc_value;
9715         tmp_tb = exc_info->exc_traceback;
9716         exc_info->exc_type = local_type;
9717         exc_info->exc_value = local_value;
9718         exc_info->exc_traceback = local_tb;
9719     }
9720     #else
9721     tmp_type = tstate->exc_type;
9722     tmp_value = tstate->exc_value;
9723     tmp_tb = tstate->exc_traceback;
9724     tstate->exc_type = local_type;
9725     tstate->exc_value = local_value;
9726     tstate->exc_traceback = local_tb;
9727     #endif
9728     Py_XDECREF(tmp_type);
9729     Py_XDECREF(tmp_value);
9730     Py_XDECREF(tmp_tb);
9731 #else
9732     PyErr_SetExcInfo(local_type, local_value, local_tb);
9733 #endif
9734     return 0;
9735 bad:
9736     *type = 0;
9737     *value = 0;
9738     *tb = 0;
9739     Py_XDECREF(local_type);
9740     Py_XDECREF(local_value);
9741     Py_XDECREF(local_tb);
9742     return -1;
9743 }
9744 
9745 /* PyNumberPow2 */
__Pyx__PyNumber_PowerOf2(PyObject * two,PyObject * exp,PyObject * none,int inplace)9746 static PyObject* __Pyx__PyNumber_PowerOf2(PyObject *two, PyObject *exp, PyObject *none, int inplace) {
9747 #if !CYTHON_COMPILING_IN_PYPY
9748     Py_ssize_t shiftby;
9749 #if PY_MAJOR_VERSION < 3
9750     if (likely(PyInt_CheckExact(exp))) {
9751         shiftby = PyInt_AS_LONG(exp);
9752     } else
9753 #endif
9754     if (likely(PyLong_CheckExact(exp))) {
9755         #if CYTHON_USE_PYLONG_INTERNALS
9756         const Py_ssize_t size = Py_SIZE(exp);
9757         if (likely(size == 1)) {
9758             shiftby = ((PyLongObject*)exp)->ob_digit[0];
9759         } else if (size == 0) {
9760             return PyInt_FromLong(1L);
9761         } else if (unlikely(size < 0)) {
9762             goto fallback;
9763         } else {
9764             shiftby = PyLong_AsSsize_t(exp);
9765         }
9766         #else
9767         shiftby = PyLong_AsSsize_t(exp);
9768         #endif
9769     } else {
9770         goto fallback;
9771     }
9772     if (likely(shiftby >= 0)) {
9773         if ((size_t)shiftby <= sizeof(long) * 8 - 2) {
9774             long value = 1L << shiftby;
9775             return PyInt_FromLong(value);
9776 #ifdef HAVE_LONG_LONG
9777         } else if ((size_t)shiftby <= sizeof(unsigned PY_LONG_LONG) * 8 - 1) {
9778             unsigned PY_LONG_LONG value = ((unsigned PY_LONG_LONG)1) << shiftby;
9779             return PyLong_FromUnsignedLongLong(value);
9780 #endif
9781         } else {
9782             PyObject *result, *one = PyInt_FromLong(1L);
9783             if (unlikely(!one)) return NULL;
9784             result = PyNumber_Lshift(one, exp);
9785             Py_DECREF(one);
9786             return result;
9787         }
9788     } else if (shiftby == -1 && PyErr_Occurred()) {
9789         PyErr_Clear();
9790     }
9791 fallback:
9792 #endif
9793     return (inplace ? PyNumber_InPlacePower : PyNumber_Power)(two, exp, none);
9794 }
9795 
9796 /* PyIntBinop */
9797 #if !CYTHON_COMPILING_IN_PYPY
__Pyx_PyInt_SubtractObjC(PyObject * op1,PyObject * op2,CYTHON_UNUSED long intval,int inplace,int zerodivision_check)9798 static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
9799     (void)inplace;
9800     (void)zerodivision_check;
9801     #if PY_MAJOR_VERSION < 3
9802     if (likely(PyInt_CheckExact(op1))) {
9803         const long b = intval;
9804         long x;
9805         long a = PyInt_AS_LONG(op1);
9806             x = (long)((unsigned long)a - b);
9807             if (likely((x^a) >= 0 || (x^~b) >= 0))
9808                 return PyInt_FromLong(x);
9809             return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
9810     }
9811     #endif
9812     #if CYTHON_USE_PYLONG_INTERNALS
9813     if (likely(PyLong_CheckExact(op1))) {
9814         const long b = intval;
9815         long a, x;
9816 #ifdef HAVE_LONG_LONG
9817         const PY_LONG_LONG llb = intval;
9818         PY_LONG_LONG lla, llx;
9819 #endif
9820         const digit* digits = ((PyLongObject*)op1)->ob_digit;
9821         const Py_ssize_t size = Py_SIZE(op1);
9822         if (likely(__Pyx_sst_abs(size) <= 1)) {
9823             a = likely(size) ? digits[0] : 0;
9824             if (size == -1) a = -a;
9825         } else {
9826             switch (size) {
9827                 case -2:
9828                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
9829                         a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
9830                         break;
9831 #ifdef HAVE_LONG_LONG
9832                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
9833                         lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
9834                         goto long_long;
9835 #endif
9836                     }
9837                     CYTHON_FALLTHROUGH;
9838                 case 2:
9839                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
9840                         a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
9841                         break;
9842 #ifdef HAVE_LONG_LONG
9843                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
9844                         lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
9845                         goto long_long;
9846 #endif
9847                     }
9848                     CYTHON_FALLTHROUGH;
9849                 case -3:
9850                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
9851                         a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
9852                         break;
9853 #ifdef HAVE_LONG_LONG
9854                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
9855                         lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
9856                         goto long_long;
9857 #endif
9858                     }
9859                     CYTHON_FALLTHROUGH;
9860                 case 3:
9861                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
9862                         a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
9863                         break;
9864 #ifdef HAVE_LONG_LONG
9865                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
9866                         lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
9867                         goto long_long;
9868 #endif
9869                     }
9870                     CYTHON_FALLTHROUGH;
9871                 case -4:
9872                     if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
9873                         a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
9874                         break;
9875 #ifdef HAVE_LONG_LONG
9876                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
9877                         lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
9878                         goto long_long;
9879 #endif
9880                     }
9881                     CYTHON_FALLTHROUGH;
9882                 case 4:
9883                     if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
9884                         a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
9885                         break;
9886 #ifdef HAVE_LONG_LONG
9887                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
9888                         lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
9889                         goto long_long;
9890 #endif
9891                     }
9892                     CYTHON_FALLTHROUGH;
9893                 default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
9894             }
9895         }
9896                 x = a - b;
9897             return PyLong_FromLong(x);
9898 #ifdef HAVE_LONG_LONG
9899         long_long:
9900                 llx = lla - llb;
9901             return PyLong_FromLongLong(llx);
9902 #endif
9903 
9904 
9905     }
9906     #endif
9907     if (PyFloat_CheckExact(op1)) {
9908         const long b = intval;
9909         double a = PyFloat_AS_DOUBLE(op1);
9910             double result;
9911             PyFPE_START_PROTECT("subtract", return NULL)
9912             result = ((double)a) - (double)b;
9913             PyFPE_END_PROTECT(result)
9914             return PyFloat_FromDouble(result);
9915     }
9916     return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
9917 }
9918 #endif
9919 
9920 /* PyExec */
__Pyx_PyExec2(PyObject * o,PyObject * globals)9921 static CYTHON_INLINE PyObject* __Pyx_PyExec2(PyObject* o, PyObject* globals) {
9922     return __Pyx_PyExec3(o, globals, NULL);
9923 }
__Pyx_PyExec3(PyObject * o,PyObject * globals,PyObject * locals)9924 static PyObject* __Pyx_PyExec3(PyObject* o, PyObject* globals, PyObject* locals) {
9925     PyObject* result;
9926     PyObject* s = 0;
9927     char *code = 0;
9928     if (!globals || globals == Py_None) {
9929         globals = __pyx_d;
9930     } else if (!PyDict_Check(globals)) {
9931         PyErr_Format(PyExc_TypeError, "exec() arg 2 must be a dict, not %.200s",
9932                      Py_TYPE(globals)->tp_name);
9933         goto bad;
9934     }
9935     if (!locals || locals == Py_None) {
9936         locals = globals;
9937     }
9938     if (__Pyx_PyDict_GetItemStr(globals, __pyx_n_s_builtins) == NULL) {
9939         if (PyDict_SetItem(globals, __pyx_n_s_builtins, PyEval_GetBuiltins()) < 0)
9940             goto bad;
9941     }
9942     if (PyCode_Check(o)) {
9943         if (__Pyx_PyCode_HasFreeVars((PyCodeObject *)o)) {
9944             PyErr_SetString(PyExc_TypeError,
9945                 "code object passed to exec() may not contain free variables");
9946             goto bad;
9947         }
9948         #if CYTHON_COMPILING_IN_PYPY || PY_VERSION_HEX < 0x030200B1
9949         result = PyEval_EvalCode((PyCodeObject *)o, globals, locals);
9950         #else
9951         result = PyEval_EvalCode(o, globals, locals);
9952         #endif
9953     } else {
9954         PyCompilerFlags cf;
9955         cf.cf_flags = 0;
9956 #if PY_VERSION_HEX >= 0x030800A3
9957         cf.cf_feature_version = PY_MINOR_VERSION;
9958 #endif
9959         if (PyUnicode_Check(o)) {
9960             cf.cf_flags = PyCF_SOURCE_IS_UTF8;
9961             s = PyUnicode_AsUTF8String(o);
9962             if (!s) goto bad;
9963             o = s;
9964         #if PY_MAJOR_VERSION >= 3
9965         } else if (!PyBytes_Check(o)) {
9966         #else
9967         } else if (!PyString_Check(o)) {
9968         #endif
9969             PyErr_Format(PyExc_TypeError,
9970                 "exec: arg 1 must be string, bytes or code object, got %.200s",
9971                 Py_TYPE(o)->tp_name);
9972             goto bad;
9973         }
9974         #if PY_MAJOR_VERSION >= 3
9975         code = PyBytes_AS_STRING(o);
9976         #else
9977         code = PyString_AS_STRING(o);
9978         #endif
9979         if (PyEval_MergeCompilerFlags(&cf)) {
9980             result = PyRun_StringFlags(code, Py_file_input, globals, locals, &cf);
9981         } else {
9982             result = PyRun_String(code, Py_file_input, globals, locals);
9983         }
9984         Py_XDECREF(s);
9985     }
9986     return result;
9987 bad:
9988     Py_XDECREF(s);
9989     return 0;
9990 }
9991 
9992 /* Import */
__Pyx_Import(PyObject * name,PyObject * from_list,int level)9993 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
9994     PyObject *empty_list = 0;
9995     PyObject *module = 0;
9996     PyObject *global_dict = 0;
9997     PyObject *empty_dict = 0;
9998     PyObject *list;
9999     #if PY_MAJOR_VERSION < 3
10000     PyObject *py_import;
10001     py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
10002     if (!py_import)
10003         goto bad;
10004     #endif
10005     if (from_list)
10006         list = from_list;
10007     else {
10008         empty_list = PyList_New(0);
10009         if (!empty_list)
10010             goto bad;
10011         list = empty_list;
10012     }
10013     global_dict = PyModule_GetDict(__pyx_m);
10014     if (!global_dict)
10015         goto bad;
10016     empty_dict = PyDict_New();
10017     if (!empty_dict)
10018         goto bad;
10019     {
10020         #if PY_MAJOR_VERSION >= 3
10021         if (level == -1) {
10022             if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
10023                 module = PyImport_ImportModuleLevelObject(
10024                     name, global_dict, empty_dict, list, 1);
10025                 if (!module) {
10026                     if (!PyErr_ExceptionMatches(PyExc_ImportError))
10027                         goto bad;
10028                     PyErr_Clear();
10029                 }
10030             }
10031             level = 0;
10032         }
10033         #endif
10034         if (!module) {
10035             #if PY_MAJOR_VERSION < 3
10036             PyObject *py_level = PyInt_FromLong(level);
10037             if (!py_level)
10038                 goto bad;
10039             module = PyObject_CallFunctionObjArgs(py_import,
10040                 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
10041             Py_DECREF(py_level);
10042             #else
10043             module = PyImport_ImportModuleLevelObject(
10044                 name, global_dict, empty_dict, list, level);
10045             #endif
10046         }
10047     }
10048 bad:
10049     #if PY_MAJOR_VERSION < 3
10050     Py_XDECREF(py_import);
10051     #endif
10052     Py_XDECREF(empty_list);
10053     Py_XDECREF(empty_dict);
10054     return module;
10055 }
10056 
10057 /* ImportFrom */
__Pyx_ImportFrom(PyObject * module,PyObject * name)10058 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
10059     PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
10060     if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
10061         PyErr_Format(PyExc_ImportError,
10062         #if PY_MAJOR_VERSION < 3
10063             "cannot import name %.230s", PyString_AS_STRING(name));
10064         #else
10065             "cannot import name %S", name);
10066         #endif
10067     }
10068     return value;
10069 }
10070 
10071 /* CLineInTraceback */
10072 #ifndef CYTHON_CLINE_IN_TRACEBACK
__Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState * tstate,int c_line)10073 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
10074     PyObject *use_cline;
10075     PyObject *ptype, *pvalue, *ptraceback;
10076 #if CYTHON_COMPILING_IN_CPYTHON
10077     PyObject **cython_runtime_dict;
10078 #endif
10079     if (unlikely(!__pyx_cython_runtime)) {
10080         return c_line;
10081     }
10082     __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
10083 #if CYTHON_COMPILING_IN_CPYTHON
10084     cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
10085     if (likely(cython_runtime_dict)) {
10086         __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
10087             use_cline, *cython_runtime_dict,
10088             __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
10089     } else
10090 #endif
10091     {
10092       PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
10093       if (use_cline_obj) {
10094         use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
10095         Py_DECREF(use_cline_obj);
10096       } else {
10097         PyErr_Clear();
10098         use_cline = NULL;
10099       }
10100     }
10101     if (!use_cline) {
10102         c_line = 0;
10103         PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
10104     }
10105     else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
10106         c_line = 0;
10107     }
10108     __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
10109     return c_line;
10110 }
10111 #endif
10112 
10113 /* CodeObjectCache */
__pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry * entries,int count,int code_line)10114 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
10115     int start = 0, mid = 0, end = count - 1;
10116     if (end >= 0 && code_line > entries[end].code_line) {
10117         return count;
10118     }
10119     while (start < end) {
10120         mid = start + (end - start) / 2;
10121         if (code_line < entries[mid].code_line) {
10122             end = mid;
10123         } else if (code_line > entries[mid].code_line) {
10124              start = mid + 1;
10125         } else {
10126             return mid;
10127         }
10128     }
10129     if (code_line <= entries[mid].code_line) {
10130         return mid;
10131     } else {
10132         return mid + 1;
10133     }
10134 }
__pyx_find_code_object(int code_line)10135 static PyCodeObject *__pyx_find_code_object(int code_line) {
10136     PyCodeObject* code_object;
10137     int pos;
10138     if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
10139         return NULL;
10140     }
10141     pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
10142     if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
10143         return NULL;
10144     }
10145     code_object = __pyx_code_cache.entries[pos].code_object;
10146     Py_INCREF(code_object);
10147     return code_object;
10148 }
__pyx_insert_code_object(int code_line,PyCodeObject * code_object)10149 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
10150     int pos, i;
10151     __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
10152     if (unlikely(!code_line)) {
10153         return;
10154     }
10155     if (unlikely(!entries)) {
10156         entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
10157         if (likely(entries)) {
10158             __pyx_code_cache.entries = entries;
10159             __pyx_code_cache.max_count = 64;
10160             __pyx_code_cache.count = 1;
10161             entries[0].code_line = code_line;
10162             entries[0].code_object = code_object;
10163             Py_INCREF(code_object);
10164         }
10165         return;
10166     }
10167     pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
10168     if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
10169         PyCodeObject* tmp = entries[pos].code_object;
10170         entries[pos].code_object = code_object;
10171         Py_DECREF(tmp);
10172         return;
10173     }
10174     if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
10175         int new_max = __pyx_code_cache.max_count + 64;
10176         entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
10177             __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
10178         if (unlikely(!entries)) {
10179             return;
10180         }
10181         __pyx_code_cache.entries = entries;
10182         __pyx_code_cache.max_count = new_max;
10183     }
10184     for (i=__pyx_code_cache.count; i>pos; i--) {
10185         entries[i] = entries[i-1];
10186     }
10187     entries[pos].code_line = code_line;
10188     entries[pos].code_object = code_object;
10189     __pyx_code_cache.count++;
10190     Py_INCREF(code_object);
10191 }
10192 
10193 /* AddTraceback */
10194 #include "compile.h"
10195 #include "frameobject.h"
10196 #include "traceback.h"
__Pyx_CreateCodeObjectForTraceback(const char * funcname,int c_line,int py_line,const char * filename)10197 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
10198             const char *funcname, int c_line,
10199             int py_line, const char *filename) {
10200     PyCodeObject *py_code = 0;
10201     PyObject *py_srcfile = 0;
10202     PyObject *py_funcname = 0;
10203     #if PY_MAJOR_VERSION < 3
10204     py_srcfile = PyString_FromString(filename);
10205     #else
10206     py_srcfile = PyUnicode_FromString(filename);
10207     #endif
10208     if (!py_srcfile) goto bad;
10209     if (c_line) {
10210         #if PY_MAJOR_VERSION < 3
10211         py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
10212         #else
10213         py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
10214         #endif
10215     }
10216     else {
10217         #if PY_MAJOR_VERSION < 3
10218         py_funcname = PyString_FromString(funcname);
10219         #else
10220         py_funcname = PyUnicode_FromString(funcname);
10221         #endif
10222     }
10223     if (!py_funcname) goto bad;
10224     py_code = __Pyx_PyCode_New(
10225         0,
10226         0,
10227         0,
10228         0,
10229         0,
10230         __pyx_empty_bytes, /*PyObject *code,*/
10231         __pyx_empty_tuple, /*PyObject *consts,*/
10232         __pyx_empty_tuple, /*PyObject *names,*/
10233         __pyx_empty_tuple, /*PyObject *varnames,*/
10234         __pyx_empty_tuple, /*PyObject *freevars,*/
10235         __pyx_empty_tuple, /*PyObject *cellvars,*/
10236         py_srcfile,   /*PyObject *filename,*/
10237         py_funcname,  /*PyObject *name,*/
10238         py_line,
10239         __pyx_empty_bytes  /*PyObject *lnotab*/
10240     );
10241     Py_DECREF(py_srcfile);
10242     Py_DECREF(py_funcname);
10243     return py_code;
10244 bad:
10245     Py_XDECREF(py_srcfile);
10246     Py_XDECREF(py_funcname);
10247     return NULL;
10248 }
__Pyx_AddTraceback(const char * funcname,int c_line,int py_line,const char * filename)10249 static void __Pyx_AddTraceback(const char *funcname, int c_line,
10250                                int py_line, const char *filename) {
10251     PyCodeObject *py_code = 0;
10252     PyFrameObject *py_frame = 0;
10253     PyThreadState *tstate = __Pyx_PyThreadState_Current;
10254     if (c_line) {
10255         c_line = __Pyx_CLineForTraceback(tstate, c_line);
10256     }
10257     py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
10258     if (!py_code) {
10259         py_code = __Pyx_CreateCodeObjectForTraceback(
10260             funcname, c_line, py_line, filename);
10261         if (!py_code) goto bad;
10262         __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
10263     }
10264     py_frame = PyFrame_New(
10265         tstate,            /*PyThreadState *tstate,*/
10266         py_code,           /*PyCodeObject *code,*/
10267         __pyx_d,    /*PyObject *globals,*/
10268         0                  /*PyObject *locals*/
10269     );
10270     if (!py_frame) goto bad;
10271     __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
10272     PyTraceBack_Here(py_frame);
10273 bad:
10274     Py_XDECREF(py_code);
10275     Py_XDECREF(py_frame);
10276 }
10277 
10278 /* CIntToPy */
__Pyx_PyInt_From_long(long value)10279 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
10280     const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
10281     const int is_unsigned = neg_one > const_zero;
10282     if (is_unsigned) {
10283         if (sizeof(long) < sizeof(long)) {
10284             return PyInt_FromLong((long) value);
10285         } else if (sizeof(long) <= sizeof(unsigned long)) {
10286             return PyLong_FromUnsignedLong((unsigned long) value);
10287 #ifdef HAVE_LONG_LONG
10288         } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
10289             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
10290 #endif
10291         }
10292     } else {
10293         if (sizeof(long) <= sizeof(long)) {
10294             return PyInt_FromLong((long) value);
10295 #ifdef HAVE_LONG_LONG
10296         } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
10297             return PyLong_FromLongLong((PY_LONG_LONG) value);
10298 #endif
10299         }
10300     }
10301     {
10302         int one = 1; int little = (int)*(unsigned char *)&one;
10303         unsigned char *bytes = (unsigned char *)&value;
10304         return _PyLong_FromByteArray(bytes, sizeof(long),
10305                                      little, !is_unsigned);
10306     }
10307 }
10308 
10309 /* CIntFromPyVerify */
10310 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
10311     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
10312 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
10313     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
10314 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
10315     {\
10316         func_type value = func_value;\
10317         if (sizeof(target_type) < sizeof(func_type)) {\
10318             if (unlikely(value != (func_type) (target_type) value)) {\
10319                 func_type zero = 0;\
10320                 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
10321                     return (target_type) -1;\
10322                 if (is_unsigned && unlikely(value < zero))\
10323                     goto raise_neg_overflow;\
10324                 else\
10325                     goto raise_overflow;\
10326             }\
10327         }\
10328         return (target_type) value;\
10329     }
10330 
10331 /* CIntFromPy */
__Pyx_PyInt_As_long(PyObject * x)10332 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
10333     const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
10334     const int is_unsigned = neg_one > const_zero;
10335 #if PY_MAJOR_VERSION < 3
10336     if (likely(PyInt_Check(x))) {
10337         if (sizeof(long) < sizeof(long)) {
10338             __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
10339         } else {
10340             long val = PyInt_AS_LONG(x);
10341             if (is_unsigned && unlikely(val < 0)) {
10342                 goto raise_neg_overflow;
10343             }
10344             return (long) val;
10345         }
10346     } else
10347 #endif
10348     if (likely(PyLong_Check(x))) {
10349         if (is_unsigned) {
10350 #if CYTHON_USE_PYLONG_INTERNALS
10351             const digit* digits = ((PyLongObject*)x)->ob_digit;
10352             switch (Py_SIZE(x)) {
10353                 case  0: return (long) 0;
10354                 case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
10355                 case 2:
10356                     if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
10357                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
10358                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10359                         } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
10360                             return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
10361                         }
10362                     }
10363                     break;
10364                 case 3:
10365                     if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
10366                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
10367                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10368                         } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
10369                             return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
10370                         }
10371                     }
10372                     break;
10373                 case 4:
10374                     if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
10375                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
10376                             __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])))
10377                         } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
10378                             return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
10379                         }
10380                     }
10381                     break;
10382             }
10383 #endif
10384 #if CYTHON_COMPILING_IN_CPYTHON
10385             if (unlikely(Py_SIZE(x) < 0)) {
10386                 goto raise_neg_overflow;
10387             }
10388 #else
10389             {
10390                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
10391                 if (unlikely(result < 0))
10392                     return (long) -1;
10393                 if (unlikely(result == 1))
10394                     goto raise_neg_overflow;
10395             }
10396 #endif
10397             if (sizeof(long) <= sizeof(unsigned long)) {
10398                 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
10399 #ifdef HAVE_LONG_LONG
10400             } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
10401                 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
10402 #endif
10403             }
10404         } else {
10405 #if CYTHON_USE_PYLONG_INTERNALS
10406             const digit* digits = ((PyLongObject*)x)->ob_digit;
10407             switch (Py_SIZE(x)) {
10408                 case  0: return (long) 0;
10409                 case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
10410                 case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
10411                 case -2:
10412                     if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
10413                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
10414                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10415                         } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
10416                             return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
10417                         }
10418                     }
10419                     break;
10420                 case 2:
10421                     if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
10422                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
10423                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10424                         } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
10425                             return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
10426                         }
10427                     }
10428                     break;
10429                 case -3:
10430                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
10431                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
10432                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10433                         } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
10434                             return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
10435                         }
10436                     }
10437                     break;
10438                 case 3:
10439                     if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
10440                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
10441                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10442                         } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
10443                             return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
10444                         }
10445                     }
10446                     break;
10447                 case -4:
10448                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
10449                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
10450                             __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])))
10451                         } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
10452                             return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
10453                         }
10454                     }
10455                     break;
10456                 case 4:
10457                     if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
10458                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
10459                             __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])))
10460                         } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
10461                             return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
10462                         }
10463                     }
10464                     break;
10465             }
10466 #endif
10467             if (sizeof(long) <= sizeof(long)) {
10468                 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
10469 #ifdef HAVE_LONG_LONG
10470             } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
10471                 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
10472 #endif
10473             }
10474         }
10475         {
10476 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
10477             PyErr_SetString(PyExc_RuntimeError,
10478                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
10479 #else
10480             long val;
10481             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
10482  #if PY_MAJOR_VERSION < 3
10483             if (likely(v) && !PyLong_Check(v)) {
10484                 PyObject *tmp = v;
10485                 v = PyNumber_Long(tmp);
10486                 Py_DECREF(tmp);
10487             }
10488  #endif
10489             if (likely(v)) {
10490                 int one = 1; int is_little = (int)*(unsigned char *)&one;
10491                 unsigned char *bytes = (unsigned char *)&val;
10492                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
10493                                               bytes, sizeof(val),
10494                                               is_little, !is_unsigned);
10495                 Py_DECREF(v);
10496                 if (likely(!ret))
10497                     return val;
10498             }
10499 #endif
10500             return (long) -1;
10501         }
10502     } else {
10503         long val;
10504         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
10505         if (!tmp) return (long) -1;
10506         val = __Pyx_PyInt_As_long(tmp);
10507         Py_DECREF(tmp);
10508         return val;
10509     }
10510 raise_overflow:
10511     PyErr_SetString(PyExc_OverflowError,
10512         "value too large to convert to long");
10513     return (long) -1;
10514 raise_neg_overflow:
10515     PyErr_SetString(PyExc_OverflowError,
10516         "can't convert negative value to long");
10517     return (long) -1;
10518 }
10519 
10520 /* CIntFromPy */
__Pyx_PyInt_As_int(PyObject * x)10521 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
10522     const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
10523     const int is_unsigned = neg_one > const_zero;
10524 #if PY_MAJOR_VERSION < 3
10525     if (likely(PyInt_Check(x))) {
10526         if (sizeof(int) < sizeof(long)) {
10527             __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
10528         } else {
10529             long val = PyInt_AS_LONG(x);
10530             if (is_unsigned && unlikely(val < 0)) {
10531                 goto raise_neg_overflow;
10532             }
10533             return (int) val;
10534         }
10535     } else
10536 #endif
10537     if (likely(PyLong_Check(x))) {
10538         if (is_unsigned) {
10539 #if CYTHON_USE_PYLONG_INTERNALS
10540             const digit* digits = ((PyLongObject*)x)->ob_digit;
10541             switch (Py_SIZE(x)) {
10542                 case  0: return (int) 0;
10543                 case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
10544                 case 2:
10545                     if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
10546                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
10547                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10548                         } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
10549                             return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
10550                         }
10551                     }
10552                     break;
10553                 case 3:
10554                     if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
10555                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
10556                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10557                         } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
10558                             return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
10559                         }
10560                     }
10561                     break;
10562                 case 4:
10563                     if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
10564                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
10565                             __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])))
10566                         } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
10567                             return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
10568                         }
10569                     }
10570                     break;
10571             }
10572 #endif
10573 #if CYTHON_COMPILING_IN_CPYTHON
10574             if (unlikely(Py_SIZE(x) < 0)) {
10575                 goto raise_neg_overflow;
10576             }
10577 #else
10578             {
10579                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
10580                 if (unlikely(result < 0))
10581                     return (int) -1;
10582                 if (unlikely(result == 1))
10583                     goto raise_neg_overflow;
10584             }
10585 #endif
10586             if (sizeof(int) <= sizeof(unsigned long)) {
10587                 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
10588 #ifdef HAVE_LONG_LONG
10589             } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
10590                 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
10591 #endif
10592             }
10593         } else {
10594 #if CYTHON_USE_PYLONG_INTERNALS
10595             const digit* digits = ((PyLongObject*)x)->ob_digit;
10596             switch (Py_SIZE(x)) {
10597                 case  0: return (int) 0;
10598                 case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
10599                 case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
10600                 case -2:
10601                     if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
10602                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
10603                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10604                         } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
10605                             return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
10606                         }
10607                     }
10608                     break;
10609                 case 2:
10610                     if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
10611                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
10612                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10613                         } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
10614                             return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
10615                         }
10616                     }
10617                     break;
10618                 case -3:
10619                     if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
10620                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
10621                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10622                         } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
10623                             return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
10624                         }
10625                     }
10626                     break;
10627                 case 3:
10628                     if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
10629                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
10630                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10631                         } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
10632                             return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
10633                         }
10634                     }
10635                     break;
10636                 case -4:
10637                     if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
10638                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
10639                             __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])))
10640                         } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
10641                             return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
10642                         }
10643                     }
10644                     break;
10645                 case 4:
10646                     if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
10647                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
10648                             __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])))
10649                         } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
10650                             return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
10651                         }
10652                     }
10653                     break;
10654             }
10655 #endif
10656             if (sizeof(int) <= sizeof(long)) {
10657                 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
10658 #ifdef HAVE_LONG_LONG
10659             } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
10660                 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
10661 #endif
10662             }
10663         }
10664         {
10665 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
10666             PyErr_SetString(PyExc_RuntimeError,
10667                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
10668 #else
10669             int val;
10670             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
10671  #if PY_MAJOR_VERSION < 3
10672             if (likely(v) && !PyLong_Check(v)) {
10673                 PyObject *tmp = v;
10674                 v = PyNumber_Long(tmp);
10675                 Py_DECREF(tmp);
10676             }
10677  #endif
10678             if (likely(v)) {
10679                 int one = 1; int is_little = (int)*(unsigned char *)&one;
10680                 unsigned char *bytes = (unsigned char *)&val;
10681                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
10682                                               bytes, sizeof(val),
10683                                               is_little, !is_unsigned);
10684                 Py_DECREF(v);
10685                 if (likely(!ret))
10686                     return val;
10687             }
10688 #endif
10689             return (int) -1;
10690         }
10691     } else {
10692         int val;
10693         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
10694         if (!tmp) return (int) -1;
10695         val = __Pyx_PyInt_As_int(tmp);
10696         Py_DECREF(tmp);
10697         return val;
10698     }
10699 raise_overflow:
10700     PyErr_SetString(PyExc_OverflowError,
10701         "value too large to convert to int");
10702     return (int) -1;
10703 raise_neg_overflow:
10704     PyErr_SetString(PyExc_OverflowError,
10705         "can't convert negative value to int");
10706     return (int) -1;
10707 }
10708 
10709 /* FastTypeChecks */
10710 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_InBases(PyTypeObject * a,PyTypeObject * b)10711 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
10712     while (a) {
10713         a = a->tp_base;
10714         if (a == b)
10715             return 1;
10716     }
10717     return b == &PyBaseObject_Type;
10718 }
__Pyx_IsSubtype(PyTypeObject * a,PyTypeObject * b)10719 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
10720     PyObject *mro;
10721     if (a == b) return 1;
10722     mro = a->tp_mro;
10723     if (likely(mro)) {
10724         Py_ssize_t i, n;
10725         n = PyTuple_GET_SIZE(mro);
10726         for (i = 0; i < n; i++) {
10727             if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
10728                 return 1;
10729         }
10730         return 0;
10731     }
10732     return __Pyx_InBases(a, b);
10733 }
10734 #if PY_MAJOR_VERSION == 2
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)10735 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
10736     PyObject *exception, *value, *tb;
10737     int res;
10738     __Pyx_PyThreadState_declare
10739     __Pyx_PyThreadState_assign
10740     __Pyx_ErrFetch(&exception, &value, &tb);
10741     res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
10742     if (unlikely(res == -1)) {
10743         PyErr_WriteUnraisable(err);
10744         res = 0;
10745     }
10746     if (!res) {
10747         res = PyObject_IsSubclass(err, exc_type2);
10748         if (unlikely(res == -1)) {
10749             PyErr_WriteUnraisable(err);
10750             res = 0;
10751         }
10752     }
10753     __Pyx_ErrRestore(exception, value, tb);
10754     return res;
10755 }
10756 #else
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)10757 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
10758     int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
10759     if (!res) {
10760         res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
10761     }
10762     return res;
10763 }
10764 #endif
__Pyx_PyErr_GivenExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)10765 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
10766     Py_ssize_t i, n;
10767     assert(PyExceptionClass_Check(exc_type));
10768     n = PyTuple_GET_SIZE(tuple);
10769 #if PY_MAJOR_VERSION >= 3
10770     for (i=0; i<n; i++) {
10771         if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
10772     }
10773 #endif
10774     for (i=0; i<n; i++) {
10775         PyObject *t = PyTuple_GET_ITEM(tuple, i);
10776         #if PY_MAJOR_VERSION < 3
10777         if (likely(exc_type == t)) return 1;
10778         #endif
10779         if (likely(PyExceptionClass_Check(t))) {
10780             if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
10781         } else {
10782         }
10783     }
10784     return 0;
10785 }
__Pyx_PyErr_GivenExceptionMatches(PyObject * err,PyObject * exc_type)10786 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
10787     if (likely(err == exc_type)) return 1;
10788     if (likely(PyExceptionClass_Check(err))) {
10789         if (likely(PyExceptionClass_Check(exc_type))) {
10790             return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
10791         } else if (likely(PyTuple_Check(exc_type))) {
10792             return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
10793         } else {
10794         }
10795     }
10796     return PyErr_GivenExceptionMatches(err, exc_type);
10797 }
__Pyx_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)10798 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
10799     assert(PyExceptionClass_Check(exc_type1));
10800     assert(PyExceptionClass_Check(exc_type2));
10801     if (likely(err == exc_type1 || err == exc_type2)) return 1;
10802     if (likely(PyExceptionClass_Check(err))) {
10803         return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
10804     }
10805     return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
10806 }
10807 #endif
10808 
10809 /* CheckBinaryVersion */
__Pyx_check_binary_version(void)10810 static int __Pyx_check_binary_version(void) {
10811     char ctversion[4], rtversion[4];
10812     PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
10813     PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
10814     if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
10815         char message[200];
10816         PyOS_snprintf(message, sizeof(message),
10817                       "compiletime version %s of module '%.100s' "
10818                       "does not match runtime version %s",
10819                       ctversion, __Pyx_MODULE_NAME, rtversion);
10820         return PyErr_WarnEx(NULL, message, 1);
10821     }
10822     return 0;
10823 }
10824 
10825 /* InitStrings */
__Pyx_InitStrings(__Pyx_StringTabEntry * t)10826 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
10827     while (t->p) {
10828         #if PY_MAJOR_VERSION < 3
10829         if (t->is_unicode) {
10830             *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
10831         } else if (t->intern) {
10832             *t->p = PyString_InternFromString(t->s);
10833         } else {
10834             *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
10835         }
10836         #else
10837         if (t->is_unicode | t->is_str) {
10838             if (t->intern) {
10839                 *t->p = PyUnicode_InternFromString(t->s);
10840             } else if (t->encoding) {
10841                 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
10842             } else {
10843                 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
10844             }
10845         } else {
10846             *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
10847         }
10848         #endif
10849         if (!*t->p)
10850             return -1;
10851         if (PyObject_Hash(*t->p) == -1)
10852             return -1;
10853         ++t;
10854     }
10855     return 0;
10856 }
10857 
__Pyx_PyUnicode_FromString(const char * c_str)10858 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
10859     return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
10860 }
__Pyx_PyObject_AsString(PyObject * o)10861 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
10862     Py_ssize_t ignore;
10863     return __Pyx_PyObject_AsStringAndSize(o, &ignore);
10864 }
10865 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
10866 #if !CYTHON_PEP393_ENABLED
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)10867 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
10868     char* defenc_c;
10869     PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
10870     if (!defenc) return NULL;
10871     defenc_c = PyBytes_AS_STRING(defenc);
10872 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
10873     {
10874         char* end = defenc_c + PyBytes_GET_SIZE(defenc);
10875         char* c;
10876         for (c = defenc_c; c < end; c++) {
10877             if ((unsigned char) (*c) >= 128) {
10878                 PyUnicode_AsASCIIString(o);
10879                 return NULL;
10880             }
10881         }
10882     }
10883 #endif
10884     *length = PyBytes_GET_SIZE(defenc);
10885     return defenc_c;
10886 }
10887 #else
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)10888 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
10889     if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
10890 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
10891     if (likely(PyUnicode_IS_ASCII(o))) {
10892         *length = PyUnicode_GET_LENGTH(o);
10893         return PyUnicode_AsUTF8(o);
10894     } else {
10895         PyUnicode_AsASCIIString(o);
10896         return NULL;
10897     }
10898 #else
10899     return PyUnicode_AsUTF8AndSize(o, length);
10900 #endif
10901 }
10902 #endif
10903 #endif
__Pyx_PyObject_AsStringAndSize(PyObject * o,Py_ssize_t * length)10904 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
10905 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
10906     if (
10907 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
10908             __Pyx_sys_getdefaultencoding_not_ascii &&
10909 #endif
10910             PyUnicode_Check(o)) {
10911         return __Pyx_PyUnicode_AsStringAndSize(o, length);
10912     } else
10913 #endif
10914 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
10915     if (PyByteArray_Check(o)) {
10916         *length = PyByteArray_GET_SIZE(o);
10917         return PyByteArray_AS_STRING(o);
10918     } else
10919 #endif
10920     {
10921         char* result;
10922         int r = PyBytes_AsStringAndSize(o, &result, length);
10923         if (unlikely(r < 0)) {
10924             return NULL;
10925         } else {
10926             return result;
10927         }
10928     }
10929 }
__Pyx_PyObject_IsTrue(PyObject * x)10930 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
10931    int is_true = x == Py_True;
10932    if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
10933    else return PyObject_IsTrue(x);
10934 }
__Pyx_PyObject_IsTrueAndDecref(PyObject * x)10935 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
10936     int retval;
10937     if (unlikely(!x)) return -1;
10938     retval = __Pyx_PyObject_IsTrue(x);
10939     Py_DECREF(x);
10940     return retval;
10941 }
__Pyx_PyNumber_IntOrLongWrongResultType(PyObject * result,const char * type_name)10942 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
10943 #if PY_MAJOR_VERSION >= 3
10944     if (PyLong_Check(result)) {
10945         if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
10946                 "__int__ returned non-int (type %.200s).  "
10947                 "The ability to return an instance of a strict subclass of int "
10948                 "is deprecated, and may be removed in a future version of Python.",
10949                 Py_TYPE(result)->tp_name)) {
10950             Py_DECREF(result);
10951             return NULL;
10952         }
10953         return result;
10954     }
10955 #endif
10956     PyErr_Format(PyExc_TypeError,
10957                  "__%.4s__ returned non-%.4s (type %.200s)",
10958                  type_name, type_name, Py_TYPE(result)->tp_name);
10959     Py_DECREF(result);
10960     return NULL;
10961 }
__Pyx_PyNumber_IntOrLong(PyObject * x)10962 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
10963 #if CYTHON_USE_TYPE_SLOTS
10964   PyNumberMethods *m;
10965 #endif
10966   const char *name = NULL;
10967   PyObject *res = NULL;
10968 #if PY_MAJOR_VERSION < 3
10969   if (likely(PyInt_Check(x) || PyLong_Check(x)))
10970 #else
10971   if (likely(PyLong_Check(x)))
10972 #endif
10973     return __Pyx_NewRef(x);
10974 #if CYTHON_USE_TYPE_SLOTS
10975   m = Py_TYPE(x)->tp_as_number;
10976   #if PY_MAJOR_VERSION < 3
10977   if (m && m->nb_int) {
10978     name = "int";
10979     res = m->nb_int(x);
10980   }
10981   else if (m && m->nb_long) {
10982     name = "long";
10983     res = m->nb_long(x);
10984   }
10985   #else
10986   if (likely(m && m->nb_int)) {
10987     name = "int";
10988     res = m->nb_int(x);
10989   }
10990   #endif
10991 #else
10992   if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
10993     res = PyNumber_Int(x);
10994   }
10995 #endif
10996   if (likely(res)) {
10997 #if PY_MAJOR_VERSION < 3
10998     if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
10999 #else
11000     if (unlikely(!PyLong_CheckExact(res))) {
11001 #endif
11002         return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
11003     }
11004   }
11005   else if (!PyErr_Occurred()) {
11006     PyErr_SetString(PyExc_TypeError,
11007                     "an integer is required");
11008   }
11009   return res;
11010 }
11011 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
11012   Py_ssize_t ival;
11013   PyObject *x;
11014 #if PY_MAJOR_VERSION < 3
11015   if (likely(PyInt_CheckExact(b))) {
11016     if (sizeof(Py_ssize_t) >= sizeof(long))
11017         return PyInt_AS_LONG(b);
11018     else
11019         return PyInt_AsSsize_t(b);
11020   }
11021 #endif
11022   if (likely(PyLong_CheckExact(b))) {
11023     #if CYTHON_USE_PYLONG_INTERNALS
11024     const digit* digits = ((PyLongObject*)b)->ob_digit;
11025     const Py_ssize_t size = Py_SIZE(b);
11026     if (likely(__Pyx_sst_abs(size) <= 1)) {
11027         ival = likely(size) ? digits[0] : 0;
11028         if (size == -1) ival = -ival;
11029         return ival;
11030     } else {
11031       switch (size) {
11032          case 2:
11033            if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
11034              return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
11035            }
11036            break;
11037          case -2:
11038            if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
11039              return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
11040            }
11041            break;
11042          case 3:
11043            if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
11044              return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
11045            }
11046            break;
11047          case -3:
11048            if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
11049              return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
11050            }
11051            break;
11052          case 4:
11053            if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
11054              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]));
11055            }
11056            break;
11057          case -4:
11058            if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
11059              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]));
11060            }
11061            break;
11062       }
11063     }
11064     #endif
11065     return PyLong_AsSsize_t(b);
11066   }
11067   x = PyNumber_Index(b);
11068   if (!x) return -1;
11069   ival = PyInt_AsSsize_t(x);
11070   Py_DECREF(x);
11071   return ival;
11072 }
11073 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
11074   return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
11075 }
11076 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
11077     return PyInt_FromSize_t(ival);
11078 }
11079 
11080 
11081 #endif /* Py_PYTHON_H */
11082