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___read
606 #define __PYX_HAVE_API__fastavro___read
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/_read.pyx",
817 };
818 
819 /* "fastavro/_read.pyx":58
820  *
821  *
822  * ctypedef int int32             # <<<<<<<<<<<<<<
823  * ctypedef unsigned int uint32
824  * ctypedef unsigned long long ulong64
825  */
826 typedef int __pyx_t_8fastavro_5_read_int32;
827 
828 /* "fastavro/_read.pyx":59
829  *
830  * ctypedef int int32
831  * ctypedef unsigned int uint32             # <<<<<<<<<<<<<<
832  * ctypedef unsigned long long ulong64
833  * ctypedef long long long64
834  */
835 typedef unsigned int __pyx_t_8fastavro_5_read_uint32;
836 
837 /* "fastavro/_read.pyx":60
838  * ctypedef int int32
839  * ctypedef unsigned int uint32
840  * ctypedef unsigned long long ulong64             # <<<<<<<<<<<<<<
841  * ctypedef long long long64
842  *
843  */
844 typedef unsigned PY_LONG_LONG __pyx_t_8fastavro_5_read_ulong64;
845 
846 /* "fastavro/_read.pyx":61
847  * ctypedef unsigned int uint32
848  * ctypedef unsigned long long ulong64
849  * ctypedef long long long64             # <<<<<<<<<<<<<<
850  *
851  *
852  */
853 typedef PY_LONG_LONG __pyx_t_8fastavro_5_read_long64;
854 
855 /*--- Type declarations ---*/
856 struct __pyx_obj_8fastavro_5_read___pyx_scope_struct___iter_avro_records;
857 struct __pyx_obj_8fastavro_5_read___pyx_scope_struct_1__iter_avro_blocks;
858 struct __pyx_obj_8fastavro_5_read___pyx_scope_struct_2___iter__;
859 struct __pyx_opt_args_8fastavro_5_read_read_timestamp_millis;
860 struct __pyx_opt_args_8fastavro_5_read_read_timestamp_micros;
861 struct __pyx_opt_args_8fastavro_5_read_read_date;
862 struct __pyx_opt_args_8fastavro_5_read_read_uuid;
863 struct __pyx_opt_args_8fastavro_5_read_read_time_millis;
864 struct __pyx_opt_args_8fastavro_5_read_read_time_micros;
865 struct __pyx_opt_args_8fastavro_5_read_read_decimal;
866 union __pyx_t_8fastavro_5_read_float_uint32;
867 union __pyx_t_8fastavro_5_read_double_ulong64;
868 struct __pyx_opt_args_8fastavro_5_read_read_array;
869 struct __pyx_opt_args_8fastavro_5_read_read_map;
870 struct __pyx_opt_args_8fastavro_5_read_read_union;
871 struct __pyx_opt_args_8fastavro_5_read_read_record;
872 struct __pyx_opt_args_8fastavro_5_read__read_data;
873 struct __pyx_opt_args_8fastavro_5_read_schemaless_reader;
874 
875 /* "fastavro/_read.pyx":149
876  *
877  *
878  * cpdef read_timestamp_millis(data, writer_schema=None, reader_schema=None):             # <<<<<<<<<<<<<<
879  *     return epoch + datetime.timedelta(microseconds=data * MLS_PER_SECOND)
880  *
881  */
882 struct __pyx_opt_args_8fastavro_5_read_read_timestamp_millis {
883   int __pyx_n;
884   PyObject *writer_schema;
885   PyObject *reader_schema;
886 };
887 
888 /* "fastavro/_read.pyx":153
889  *
890  *
891  * cpdef read_timestamp_micros(data, writer_schema=None, reader_schema=None):             # <<<<<<<<<<<<<<
892  *     return epoch + datetime.timedelta(microseconds=data)
893  *
894  */
895 struct __pyx_opt_args_8fastavro_5_read_read_timestamp_micros {
896   int __pyx_n;
897   PyObject *writer_schema;
898   PyObject *reader_schema;
899 };
900 
901 /* "fastavro/_read.pyx":157
902  *
903  *
904  * cpdef read_date(data, writer_schema=None, reader_schema=None):             # <<<<<<<<<<<<<<
905  *     return datetime.date.fromordinal(data + DAYS_SHIFT)
906  *
907  */
908 struct __pyx_opt_args_8fastavro_5_read_read_date {
909   int __pyx_n;
910   PyObject *writer_schema;
911   PyObject *reader_schema;
912 };
913 
914 /* "fastavro/_read.pyx":161
915  *
916  *
917  * cpdef read_uuid(data, writer_schema=None, reader_schema=None):             # <<<<<<<<<<<<<<
918  *     return UUID(data)
919  *
920  */
921 struct __pyx_opt_args_8fastavro_5_read_read_uuid {
922   int __pyx_n;
923   PyObject *writer_schema;
924   PyObject *reader_schema;
925 };
926 
927 /* "fastavro/_read.pyx":165
928  *
929  *
930  * cpdef read_time_millis(data, writer_schema=None, reader_schema=None):             # <<<<<<<<<<<<<<
931  *     h = int(data / MLS_PER_HOUR)
932  *     m = int(data / MLS_PER_MINUTE) % 60
933  */
934 struct __pyx_opt_args_8fastavro_5_read_read_time_millis {
935   int __pyx_n;
936   PyObject *writer_schema;
937   PyObject *reader_schema;
938 };
939 
940 /* "fastavro/_read.pyx":173
941  *
942  *
943  * cpdef read_time_micros(data, writer_schema=None, reader_schema=None):             # <<<<<<<<<<<<<<
944  *     h = int(data / MCS_PER_HOUR)
945  *     m = int(data / MCS_PER_MINUTE) % 60
946  */
947 struct __pyx_opt_args_8fastavro_5_read_read_time_micros {
948   int __pyx_n;
949   PyObject *writer_schema;
950   PyObject *reader_schema;
951 };
952 
953 /* "fastavro/_read.pyx":181
954  *
955  *
956  * cpdef read_decimal(data, writer_schema=None, reader_schema=None):             # <<<<<<<<<<<<<<
957  *     scale = writer_schema.get('scale', 0)
958  *     precision = writer_schema['precision']
959  */
960 struct __pyx_opt_args_8fastavro_5_read_read_decimal {
961   int __pyx_n;
962   PyObject *writer_schema;
963   PyObject *reader_schema;
964 };
965 
966 /* "fastavro/_read.pyx":217
967  *
968  *
969  * cdef union float_uint32:             # <<<<<<<<<<<<<<
970  *     float f
971  *     uint32 n
972  */
973 union __pyx_t_8fastavro_5_read_float_uint32 {
974   float f;
975   __pyx_t_8fastavro_5_read_uint32 n;
976 };
977 
978 /* "fastavro/_read.pyx":243
979  *
980  *
981  * cdef union double_ulong64:             # <<<<<<<<<<<<<<
982  *     double d
983  *     ulong64 n
984  */
985 union __pyx_t_8fastavro_5_read_double_ulong64 {
986   double d;
987   __pyx_t_8fastavro_5_read_ulong64 n;
988 };
989 
990 /* "fastavro/_read.pyx":310
991  *
992  * cdef read_array(
993  *     fo,             # <<<<<<<<<<<<<<
994  *     writer_schema,
995  *     named_schemas,
996  */
997 struct __pyx_opt_args_8fastavro_5_read_read_array {
998   int __pyx_n;
999   PyObject *reader_schema;
1000   PyObject *return_record_name;
1001 };
1002 
1003 /* "fastavro/_read.pyx":364
1004  *
1005  * cdef read_map(
1006  *     fo,             # <<<<<<<<<<<<<<
1007  *     writer_schema,
1008  *     named_schemas,
1009  */
1010 struct __pyx_opt_args_8fastavro_5_read_read_map {
1011   int __pyx_n;
1012   PyObject *reader_schema;
1013   PyObject *return_record_name;
1014 };
1015 
1016 /* "fastavro/_read.pyx":419
1017  *
1018  * cdef read_union(
1019  *     fo,             # <<<<<<<<<<<<<<
1020  *     writer_schema,
1021  *     named_schemas,
1022  */
1023 struct __pyx_opt_args_8fastavro_5_read_read_union {
1024   int __pyx_n;
1025   PyObject *reader_schema;
1026   PyObject *return_record_name;
1027 };
1028 
1029 /* "fastavro/_read.pyx":485
1030  *
1031  * cdef read_record(
1032  *     fo,             # <<<<<<<<<<<<<<
1033  *     writer_schema,
1034  *     named_schemas,
1035  */
1036 struct __pyx_opt_args_8fastavro_5_read_read_record {
1037   int __pyx_n;
1038   PyObject *reader_schema;
1039   PyObject *return_record_name;
1040 };
1041 
1042 /* "fastavro/_read.pyx":593
1043  *
1044  * cpdef _read_data(
1045  *     fo,             # <<<<<<<<<<<<<<
1046  *     writer_schema,
1047  *     named_schemas,
1048  */
1049 struct __pyx_opt_args_8fastavro_5_read__read_data {
1050   int __pyx_n;
1051   PyObject *reader_schema;
1052   PyObject *return_record_name;
1053 };
1054 
1055 /* "fastavro/_read.pyx":972
1056  *
1057  *
1058  * cpdef schemaless_reader(fo, writer_schema, reader_schema=None,             # <<<<<<<<<<<<<<
1059  *                         return_record_name=False):
1060  *     if writer_schema == reader_schema:
1061  */
1062 struct __pyx_opt_args_8fastavro_5_read_schemaless_reader {
1063   int __pyx_n;
1064   PyObject *reader_schema;
1065   PyObject *return_record_name;
1066 };
1067 
1068 /* "fastavro/_read.pyx":783
1069  *
1070  *
1071  * def _iter_avro_records(             # <<<<<<<<<<<<<<
1072  *     fo,
1073  *     header,
1074  */
1075 struct __pyx_obj_8fastavro_5_read___pyx_scope_struct___iter_avro_records {
1076   PyObject_HEAD
1077   __pyx_t_8fastavro_5_read_long64 __pyx_v_block_count;
1078   PyObject *__pyx_v_block_fo;
1079   PyObject *__pyx_v_codec;
1080   PyObject *__pyx_v_fo;
1081   PyObject *__pyx_v_header;
1082   __pyx_t_8fastavro_5_read_int32 __pyx_v_i;
1083   PyObject *__pyx_v_named_schemas;
1084   PyObject *__pyx_v_read_block;
1085   PyObject *__pyx_v_reader_schema;
1086   PyObject *__pyx_v_return_record_name;
1087   PyObject *__pyx_v_sync_marker;
1088   PyObject *__pyx_v_writer_schema;
1089   __pyx_t_8fastavro_5_read_long64 __pyx_t_0;
1090   __pyx_t_8fastavro_5_read_long64 __pyx_t_1;
1091   __pyx_t_8fastavro_5_read_int32 __pyx_t_2;
1092 };
1093 
1094 
1095 /* "fastavro/_read.pyx":817
1096  *
1097  *
1098  * def _iter_avro_blocks(             # <<<<<<<<<<<<<<
1099  *     fo,
1100  *     header,
1101  */
1102 struct __pyx_obj_8fastavro_5_read___pyx_scope_struct_1__iter_avro_blocks {
1103   PyObject_HEAD
1104   PyObject *__pyx_v_block_bytes;
1105   PyObject *__pyx_v_codec;
1106   PyObject *__pyx_v_fo;
1107   PyObject *__pyx_v_header;
1108   PyObject *__pyx_v_named_schemas;
1109   __pyx_t_8fastavro_5_read_long64 __pyx_v_num_block_records;
1110   PyObject *__pyx_v_offset;
1111   PyObject *__pyx_v_read_block;
1112   PyObject *__pyx_v_reader_schema;
1113   PyObject *__pyx_v_return_record_name;
1114   PyObject *__pyx_v_size;
1115   PyObject *__pyx_v_sync_marker;
1116   PyObject *__pyx_v_writer_schema;
1117 };
1118 
1119 
1120 /* "fastavro/_read.pyx":873
1121  *         self.return_record_name = return_record_name
1122  *
1123  *     def __iter__(self):             # <<<<<<<<<<<<<<
1124  *         for i in range(self.num_records):
1125  *             yield _read_data(
1126  */
1127 struct __pyx_obj_8fastavro_5_read___pyx_scope_struct_2___iter__ {
1128   PyObject_HEAD
1129   PyObject *__pyx_v_i;
1130   PyObject *__pyx_v_self;
1131   PyObject *__pyx_t_0;
1132   Py_ssize_t __pyx_t_1;
1133   PyObject *(*__pyx_t_2)(PyObject *);
1134 };
1135 
1136 
1137 /* --- Runtime support code (head) --- */
1138 /* Refnanny.proto */
1139 #ifndef CYTHON_REFNANNY
1140   #define CYTHON_REFNANNY 0
1141 #endif
1142 #if CYTHON_REFNANNY
1143   typedef struct {
1144     void (*INCREF)(void*, PyObject*, int);
1145     void (*DECREF)(void*, PyObject*, int);
1146     void (*GOTREF)(void*, PyObject*, int);
1147     void (*GIVEREF)(void*, PyObject*, int);
1148     void* (*SetupContext)(const char*, int, const char*);
1149     void (*FinishContext)(void**);
1150   } __Pyx_RefNannyAPIStruct;
1151   static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1152   static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1153   #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1154 #ifdef WITH_THREAD
1155   #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1156           if (acquire_gil) {\
1157               PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1158               __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1159               PyGILState_Release(__pyx_gilstate_save);\
1160           } else {\
1161               __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1162           }
1163 #else
1164   #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1165           __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1166 #endif
1167   #define __Pyx_RefNannyFinishContext()\
1168           __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1169   #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1170   #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1171   #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1172   #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1173   #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1174   #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1175   #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1176   #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1177 #else
1178   #define __Pyx_RefNannyDeclarations
1179   #define __Pyx_RefNannySetupContext(name, acquire_gil)
1180   #define __Pyx_RefNannyFinishContext()
1181   #define __Pyx_INCREF(r) Py_INCREF(r)
1182   #define __Pyx_DECREF(r) Py_DECREF(r)
1183   #define __Pyx_GOTREF(r)
1184   #define __Pyx_GIVEREF(r)
1185   #define __Pyx_XINCREF(r) Py_XINCREF(r)
1186   #define __Pyx_XDECREF(r) Py_XDECREF(r)
1187   #define __Pyx_XGOTREF(r)
1188   #define __Pyx_XGIVEREF(r)
1189 #endif
1190 #define __Pyx_XDECREF_SET(r, v) do {\
1191         PyObject *tmp = (PyObject *) r;\
1192         r = v; __Pyx_XDECREF(tmp);\
1193     } while (0)
1194 #define __Pyx_DECREF_SET(r, v) do {\
1195         PyObject *tmp = (PyObject *) r;\
1196         r = v; __Pyx_DECREF(tmp);\
1197     } while (0)
1198 #define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1199 #define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1200 
1201 /* PyObjectGetAttrStr.proto */
1202 #if CYTHON_USE_TYPE_SLOTS
1203 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1204 #else
1205 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1206 #endif
1207 
1208 /* GetBuiltinName.proto */
1209 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1210 
1211 /* IncludeStringH.proto */
1212 #include <string.h>
1213 
1214 /* BytesEquals.proto */
1215 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
1216 
1217 /* UnicodeEquals.proto */
1218 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
1219 
1220 /* StrEquals.proto */
1221 #if PY_MAJOR_VERSION >= 3
1222 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
1223 #else
1224 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
1225 #endif
1226 
1227 /* RaiseArgTupleInvalid.proto */
1228 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1229     Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1230 
1231 /* RaiseDoubleKeywords.proto */
1232 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1233 
1234 /* ParseKeywords.proto */
1235 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1236     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1237     const char* function_name);
1238 
1239 /* GetTopmostException.proto */
1240 #if CYTHON_USE_EXC_INFO_STACK
1241 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1242 #endif
1243 
1244 /* PyThreadStateGet.proto */
1245 #if CYTHON_FAST_THREAD_STATE
1246 #define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
1247 #define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
1248 #define __Pyx_PyErr_Occurred()  __pyx_tstate->curexc_type
1249 #else
1250 #define __Pyx_PyThreadState_declare
1251 #define __Pyx_PyThreadState_assign
1252 #define __Pyx_PyErr_Occurred()  PyErr_Occurred()
1253 #endif
1254 
1255 /* SaveResetException.proto */
1256 #if CYTHON_FAST_THREAD_STATE
1257 #define __Pyx_ExceptionSave(type, value, tb)  __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1258 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1259 #define __Pyx_ExceptionReset(type, value, tb)  __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1260 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1261 #else
1262 #define __Pyx_ExceptionSave(type, value, tb)   PyErr_GetExcInfo(type, value, tb)
1263 #define __Pyx_ExceptionReset(type, value, tb)  PyErr_SetExcInfo(type, value, tb)
1264 #endif
1265 
1266 /* PyErrFetchRestore.proto */
1267 #if CYTHON_FAST_THREAD_STATE
1268 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1269 #define __Pyx_ErrRestoreWithState(type, value, tb)  __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1270 #define __Pyx_ErrFetchWithState(type, value, tb)    __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1271 #define __Pyx_ErrRestore(type, value, tb)  __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1272 #define __Pyx_ErrFetch(type, value, tb)    __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1273 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1274 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1275 #if CYTHON_COMPILING_IN_CPYTHON
1276 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1277 #else
1278 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1279 #endif
1280 #else
1281 #define __Pyx_PyErr_Clear() PyErr_Clear()
1282 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1283 #define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
1284 #define __Pyx_ErrFetchWithState(type, value, tb)  PyErr_Fetch(type, value, tb)
1285 #define __Pyx_ErrRestoreInState(tstate, type, value, tb)  PyErr_Restore(type, value, tb)
1286 #define __Pyx_ErrFetchInState(tstate, type, value, tb)  PyErr_Fetch(type, value, tb)
1287 #define __Pyx_ErrRestore(type, value, tb)  PyErr_Restore(type, value, tb)
1288 #define __Pyx_ErrFetch(type, value, tb)  PyErr_Fetch(type, value, tb)
1289 #endif
1290 
1291 /* FastTypeChecks.proto */
1292 #if CYTHON_COMPILING_IN_CPYTHON
1293 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1294 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1295 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1296 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1297 #else
1298 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1299 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1300 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1301 #endif
1302 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1303 
1304 /* PyDictVersioning.proto */
1305 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1306 #define __PYX_DICT_VERSION_INIT  ((PY_UINT64_T) -1)
1307 #define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
1308 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1309     (version_var) = __PYX_GET_DICT_VERSION(dict);\
1310     (cache_var) = (value);
1311 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1312     static PY_UINT64_T __pyx_dict_version = 0;\
1313     static PyObject *__pyx_dict_cached_value = NULL;\
1314     if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1315         (VAR) = __pyx_dict_cached_value;\
1316     } else {\
1317         (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1318         __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1319     }\
1320 }
1321 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1322 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1323 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1324 #else
1325 #define __PYX_GET_DICT_VERSION(dict)  (0)
1326 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1327 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP)  (VAR) = (LOOKUP);
1328 #endif
1329 
1330 /* GetModuleGlobalName.proto */
1331 #if CYTHON_USE_DICT_VERSIONS
1332 #define __Pyx_GetModuleGlobalName(var, name)  {\
1333     static PY_UINT64_T __pyx_dict_version = 0;\
1334     static PyObject *__pyx_dict_cached_value = NULL;\
1335     (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1336         (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1337         __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1338 }
1339 #define __Pyx_GetModuleGlobalNameUncached(var, name)  {\
1340     PY_UINT64_T __pyx_dict_version;\
1341     PyObject *__pyx_dict_cached_value;\
1342     (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1343 }
1344 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1345 #else
1346 #define __Pyx_GetModuleGlobalName(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
1347 #define __Pyx_GetModuleGlobalNameUncached(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
1348 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1349 #endif
1350 
1351 /* PyCFunctionFastCall.proto */
1352 #if CYTHON_FAST_PYCCALL
1353 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1354 #else
1355 #define __Pyx_PyCFunction_FastCall(func, args, nargs)  (assert(0), NULL)
1356 #endif
1357 
1358 /* PyFunctionFastCall.proto */
1359 #if CYTHON_FAST_PYCALL
1360 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1361     __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1362 #if 1 || PY_VERSION_HEX < 0x030600B1
1363 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1364 #else
1365 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1366 #endif
1367 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1368     (sizeof(char [1 - 2*!(cond)]) - 1)
1369 #ifndef Py_MEMBER_SIZE
1370 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1371 #endif
1372   static size_t __pyx_pyframe_localsplus_offset = 0;
1373   #include "frameobject.h"
1374   #define __Pxy_PyFrame_Initialize_Offsets()\
1375     ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1376      (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1377   #define __Pyx_PyFrame_GetLocalsplus(frame)\
1378     (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1379 #endif
1380 
1381 /* PyObjectCall.proto */
1382 #if CYTHON_COMPILING_IN_CPYTHON
1383 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1384 #else
1385 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1386 #endif
1387 
1388 /* PyObjectCall2Args.proto */
1389 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
1390 
1391 /* PyObjectCallMethO.proto */
1392 #if CYTHON_COMPILING_IN_CPYTHON
1393 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1394 #endif
1395 
1396 /* PyObjectCallOneArg.proto */
1397 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1398 
1399 /* RaiseException.proto */
1400 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1401 
1402 /* DictGetItem.proto */
1403 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
1404 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
1405 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
1406     (likely(PyDict_CheckExact(obj)) ?\
1407      __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
1408 #else
1409 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
1410 #define __Pyx_PyObject_Dict_GetItem(obj, name)  PyObject_GetItem(obj, name)
1411 #endif
1412 
1413 /* bytes_index.proto */
1414 static CYTHON_INLINE char __Pyx_PyBytes_GetItemInt(PyObject* bytes, Py_ssize_t index, int check_bounds);
1415 
1416 /* PyIntBinop.proto */
1417 #if !CYTHON_COMPILING_IN_PYPY
1418 static PyObject* __Pyx_PyInt_RemainderObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
1419 #else
1420 #define __Pyx_PyInt_RemainderObjC(op1, op2, intval, inplace, zerodivision_check)\
1421     (inplace ? PyNumber_InPlaceRemainder(op1, op2) : PyNumber_Remainder(op1, op2))
1422 #endif
1423 
1424 /* PyObjectSetAttrStr.proto */
1425 #if CYTHON_USE_TYPE_SLOTS
1426 #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
1427 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
1428 #else
1429 #define __Pyx_PyObject_DelAttrStr(o,n)   PyObject_DelAttr(o,n)
1430 #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
1431 #endif
1432 
1433 /* GetItemInt.proto */
1434 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1435     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1436     __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1437     (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1438                __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1439 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1440     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1441     __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1442     (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1443 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1444                                                               int wraparound, int boundscheck);
1445 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1446     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1447     __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1448     (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1449 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1450                                                               int wraparound, int boundscheck);
1451 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1452 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1453                                                      int is_list, int wraparound, int boundscheck);
1454 
1455 /* PySequenceContains.proto */
__Pyx_PySequence_ContainsTF(PyObject * item,PyObject * seq,int eq)1456 static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
1457     int result = PySequence_Contains(seq, item);
1458     return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
1459 }
1460 
1461 /* ListAppend.proto */
1462 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
__Pyx_PyList_Append(PyObject * list,PyObject * x)1463 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
1464     PyListObject* L = (PyListObject*) list;
1465     Py_ssize_t len = Py_SIZE(list);
1466     if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
1467         Py_INCREF(x);
1468         PyList_SET_ITEM(list, len, x);
1469         __Pyx_SET_SIZE(list, len + 1);
1470         return 0;
1471     }
1472     return PyList_Append(list, x);
1473 }
1474 #else
1475 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
1476 #endif
1477 
1478 /* ObjectGetItem.proto */
1479 #if CYTHON_USE_TYPE_SLOTS
1480 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1481 #else
1482 #define __Pyx_PyObject_GetItem(obj, key)  PyObject_GetItem(obj, key)
1483 #endif
1484 
1485 /* dict_getitem_default.proto */
1486 static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value);
1487 
1488 /* UnpackUnboundCMethod.proto */
1489 typedef struct {
1490     PyObject *type;
1491     PyObject **method_name;
1492     PyCFunction func;
1493     PyObject *method;
1494     int flag;
1495 } __Pyx_CachedCFunction;
1496 
1497 /* CallUnboundCMethod1.proto */
1498 static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg);
1499 #if CYTHON_COMPILING_IN_CPYTHON
1500 static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg);
1501 #else
1502 #define __Pyx_CallUnboundCMethod1(cfunc, self, arg)  __Pyx__CallUnboundCMethod1(cfunc, self, arg)
1503 #endif
1504 
1505 /* CallUnboundCMethod2.proto */
1506 static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2);
1507 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1
1508 static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2);
1509 #else
1510 #define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2)  __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2)
1511 #endif
1512 
1513 /* ListCompAppend.proto */
1514 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
__Pyx_ListComp_Append(PyObject * list,PyObject * x)1515 static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
1516     PyListObject* L = (PyListObject*) list;
1517     Py_ssize_t len = Py_SIZE(list);
1518     if (likely(L->allocated > len)) {
1519         Py_INCREF(x);
1520         PyList_SET_ITEM(list, len, x);
1521         __Pyx_SET_SIZE(list, len + 1);
1522         return 0;
1523     }
1524     return PyList_Append(list, x);
1525 }
1526 #else
1527 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
1528 #endif
1529 
1530 /* RaiseTooManyValuesToUnpack.proto */
1531 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1532 
1533 /* RaiseNeedMoreValuesToUnpack.proto */
1534 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1535 
1536 /* IterFinish.proto */
1537 static CYTHON_INLINE int __Pyx_IterFinish(void);
1538 
1539 /* UnpackItemEndCheck.proto */
1540 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
1541 
1542 /* PyDictContains.proto */
__Pyx_PyDict_ContainsTF(PyObject * item,PyObject * dict,int eq)1543 static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, int eq) {
1544     int result = PyDict_Contains(dict, item);
1545     return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
1546 }
1547 
1548 /* GetException.proto */
1549 #if CYTHON_FAST_THREAD_STATE
1550 #define __Pyx_GetException(type, value, tb)  __Pyx__GetException(__pyx_tstate, type, value, tb)
1551 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1552 #else
1553 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1554 #endif
1555 
1556 /* PyIntBinop.proto */
1557 #if !CYTHON_COMPILING_IN_PYPY
1558 static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
1559 #else
1560 #define __Pyx_PyInt_SubtractObjC(op1, op2, intval, inplace, zerodivision_check)\
1561     (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2))
1562 #endif
1563 
1564 /* PyObjectCallNoArg.proto */
1565 #if CYTHON_COMPILING_IN_CPYTHON
1566 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1567 #else
1568 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1569 #endif
1570 
1571 /* PyErrExceptionMatches.proto */
1572 #if CYTHON_FAST_THREAD_STATE
1573 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1574 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1575 #else
1576 #define __Pyx_PyErr_ExceptionMatches(err)  PyErr_ExceptionMatches(err)
1577 #endif
1578 
1579 /* Import.proto */
1580 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1581 
1582 /* IterNext.proto */
1583 #define __Pyx_PyIter_Next(obj) __Pyx_PyIter_Next2(obj, NULL)
1584 static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject *, PyObject *);
1585 
1586 /* SwapException.proto */
1587 #if CYTHON_FAST_THREAD_STATE
1588 #define __Pyx_ExceptionSwap(type, value, tb)  __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
1589 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1590 #else
1591 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
1592 #endif
1593 
1594 /* PyObject_GenericGetAttrNoDict.proto */
1595 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1596 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1597 #else
1598 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1599 #endif
1600 
1601 /* ImportFrom.proto */
1602 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1603 
1604 /* CalculateMetaclass.proto */
1605 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
1606 
1607 /* Py3ClassCreate.proto */
1608 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
1609                                            PyObject *mkw, PyObject *modname, PyObject *doc);
1610 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
1611                                       PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);
1612 
1613 /* FetchCommonType.proto */
1614 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
1615 
1616 /* CythonFunctionShared.proto */
1617 #define __Pyx_CyFunction_USED 1
1618 #define __Pyx_CYFUNCTION_STATICMETHOD  0x01
1619 #define __Pyx_CYFUNCTION_CLASSMETHOD   0x02
1620 #define __Pyx_CYFUNCTION_CCLASS        0x04
1621 #define __Pyx_CyFunction_GetClosure(f)\
1622     (((__pyx_CyFunctionObject *) (f))->func_closure)
1623 #define __Pyx_CyFunction_GetClassObj(f)\
1624     (((__pyx_CyFunctionObject *) (f))->func_classobj)
1625 #define __Pyx_CyFunction_Defaults(type, f)\
1626     ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
1627 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
1628     ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
1629 typedef struct {
1630     PyCFunctionObject func;
1631 #if PY_VERSION_HEX < 0x030500A0
1632     PyObject *func_weakreflist;
1633 #endif
1634     PyObject *func_dict;
1635     PyObject *func_name;
1636     PyObject *func_qualname;
1637     PyObject *func_doc;
1638     PyObject *func_globals;
1639     PyObject *func_code;
1640     PyObject *func_closure;
1641     PyObject *func_classobj;
1642     void *defaults;
1643     int defaults_pyobjects;
1644     size_t defaults_size;  // used by FusedFunction for copying defaults
1645     int flags;
1646     PyObject *defaults_tuple;
1647     PyObject *defaults_kwdict;
1648     PyObject *(*defaults_getter)(PyObject *);
1649     PyObject *func_annotations;
1650 } __pyx_CyFunctionObject;
1651 static PyTypeObject *__pyx_CyFunctionType = 0;
1652 #define __Pyx_CyFunction_Check(obj)  (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
1653 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
1654                                       int flags, PyObject* qualname,
1655                                       PyObject *self,
1656                                       PyObject *module, PyObject *globals,
1657                                       PyObject* code);
1658 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
1659                                                          size_t size,
1660                                                          int pyobjects);
1661 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
1662                                                             PyObject *tuple);
1663 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
1664                                                              PyObject *dict);
1665 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
1666                                                               PyObject *dict);
1667 static int __pyx_CyFunction_init(void);
1668 
1669 /* CythonFunction.proto */
1670 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
1671                                       int flags, PyObject* qualname,
1672                                       PyObject *closure,
1673                                       PyObject *module, PyObject *globals,
1674                                       PyObject* code);
1675 
1676 /* SetNameInClass.proto */
1677 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
1678 #define __Pyx_SetNameInClass(ns, name, value)\
1679     (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
1680 #elif CYTHON_COMPILING_IN_CPYTHON
1681 #define __Pyx_SetNameInClass(ns, name, value)\
1682     (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
1683 #else
1684 #define __Pyx_SetNameInClass(ns, name, value)  PyObject_SetItem(ns, name, value)
1685 #endif
1686 
1687 /* CLineInTraceback.proto */
1688 #ifdef CYTHON_CLINE_IN_TRACEBACK
1689 #define __Pyx_CLineForTraceback(tstate, c_line)  (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1690 #else
1691 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1692 #endif
1693 
1694 /* CodeObjectCache.proto */
1695 typedef struct {
1696     PyCodeObject* code_object;
1697     int code_line;
1698 } __Pyx_CodeObjectCacheEntry;
1699 struct __Pyx_CodeObjectCache {
1700     int count;
1701     int max_count;
1702     __Pyx_CodeObjectCacheEntry* entries;
1703 };
1704 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1705 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
1706 static PyCodeObject *__pyx_find_code_object(int code_line);
1707 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
1708 
1709 /* AddTraceback.proto */
1710 static void __Pyx_AddTraceback(const char *funcname, int c_line,
1711                                int py_line, const char *filename);
1712 
1713 /* CIntToPy.proto */
1714 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
1715 
1716 /* CIntToPy.proto */
1717 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PY_LONG_LONG(PY_LONG_LONG value);
1718 
1719 /* CIntFromPy.proto */
1720 static CYTHON_INLINE unsigned char __Pyx_PyInt_As_unsigned_char(PyObject *);
1721 
1722 /* CIntFromPy.proto */
1723 static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_As_PY_LONG_LONG(PyObject *);
1724 
1725 /* CIntFromPy.proto */
1726 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
1727 
1728 /* CIntFromPy.proto */
1729 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
1730 
1731 /* PyObjectGetMethod.proto */
1732 static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
1733 
1734 /* PyObjectCallMethod1.proto */
1735 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
1736 
1737 /* CoroutineBase.proto */
1738 typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyThreadState *, PyObject *);
1739 #if CYTHON_USE_EXC_INFO_STACK
1740 #define __Pyx_ExcInfoStruct  _PyErr_StackItem
1741 #else
1742 typedef struct {
1743     PyObject *exc_type;
1744     PyObject *exc_value;
1745     PyObject *exc_traceback;
1746 } __Pyx_ExcInfoStruct;
1747 #endif
1748 typedef struct {
1749     PyObject_HEAD
1750     __pyx_coroutine_body_t body;
1751     PyObject *closure;
1752     __Pyx_ExcInfoStruct gi_exc_state;
1753     PyObject *gi_weakreflist;
1754     PyObject *classobj;
1755     PyObject *yieldfrom;
1756     PyObject *gi_name;
1757     PyObject *gi_qualname;
1758     PyObject *gi_modulename;
1759     PyObject *gi_code;
1760     int resume_label;
1761     char is_running;
1762 } __pyx_CoroutineObject;
1763 static __pyx_CoroutineObject *__Pyx__Coroutine_New(
1764     PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
1765     PyObject *name, PyObject *qualname, PyObject *module_name);
1766 static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
1767             __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
1768             PyObject *name, PyObject *qualname, PyObject *module_name);
1769 static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self);
1770 static int __Pyx_Coroutine_clear(PyObject *self);
1771 static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value);
1772 static PyObject *__Pyx_Coroutine_Close(PyObject *self);
1773 static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
1774 #if CYTHON_USE_EXC_INFO_STACK
1775 #define __Pyx_Coroutine_SwapException(self)
1776 #define __Pyx_Coroutine_ResetAndClearException(self)  __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state)
1777 #else
1778 #define __Pyx_Coroutine_SwapException(self) {\
1779     __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\
1780     __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\
1781     }
1782 #define __Pyx_Coroutine_ResetAndClearException(self) {\
1783     __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\
1784     (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\
1785     }
1786 #endif
1787 #if CYTHON_FAST_THREAD_STATE
1788 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
1789     __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue)
1790 #else
1791 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
1792     __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue)
1793 #endif
1794 static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue);
1795 static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state);
1796 
1797 /* PatchModuleWithCoroutine.proto */
1798 static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code);
1799 
1800 /* PatchGeneratorABC.proto */
1801 static int __Pyx_patch_abc(void);
1802 
1803 /* Generator.proto */
1804 #define __Pyx_Generator_USED
1805 static PyTypeObject *__pyx_GeneratorType = 0;
1806 #define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType)
1807 #define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\
1808     __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name)
1809 static PyObject *__Pyx_Generator_Next(PyObject *self);
1810 static int __pyx_Generator_init(void);
1811 
1812 /* CheckBinaryVersion.proto */
1813 static int __Pyx_check_binary_version(void);
1814 
1815 /* InitStrings.proto */
1816 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1817 
1818 
1819 /* Module declarations from 'fastavro._read' */
1820 static PyTypeObject *__pyx_ptype_8fastavro_5_read___pyx_scope_struct___iter_avro_records = 0;
1821 static PyTypeObject *__pyx_ptype_8fastavro_5_read___pyx_scope_struct_1__iter_avro_blocks = 0;
1822 static PyTypeObject *__pyx_ptype_8fastavro_5_read___pyx_scope_struct_2___iter__ = 0;
1823 static PyObject *__pyx_f_8fastavro_5_read_match_types(PyObject *, PyObject *, int __pyx_skip_dispatch); /*proto*/
1824 static PyObject *__pyx_f_8fastavro_5_read_match_schemas(PyObject *, PyObject *, int __pyx_skip_dispatch); /*proto*/
1825 static CYTHON_INLINE PyObject *__pyx_f_8fastavro_5_read_read_null(PyObject *); /*proto*/
1826 static CYTHON_INLINE PyObject *__pyx_f_8fastavro_5_read_read_boolean(PyObject *); /*proto*/
1827 static PyObject *__pyx_f_8fastavro_5_read_read_timestamp_millis(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_8fastavro_5_read_read_timestamp_millis *__pyx_optional_args); /*proto*/
1828 static PyObject *__pyx_f_8fastavro_5_read_read_timestamp_micros(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_8fastavro_5_read_read_timestamp_micros *__pyx_optional_args); /*proto*/
1829 static PyObject *__pyx_f_8fastavro_5_read_read_date(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_8fastavro_5_read_read_date *__pyx_optional_args); /*proto*/
1830 static PyObject *__pyx_f_8fastavro_5_read_read_uuid(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_8fastavro_5_read_read_uuid *__pyx_optional_args); /*proto*/
1831 static PyObject *__pyx_f_8fastavro_5_read_read_time_millis(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_8fastavro_5_read_read_time_millis *__pyx_optional_args); /*proto*/
1832 static PyObject *__pyx_f_8fastavro_5_read_read_time_micros(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_8fastavro_5_read_read_time_micros *__pyx_optional_args); /*proto*/
1833 static PyObject *__pyx_f_8fastavro_5_read_read_decimal(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_8fastavro_5_read_read_decimal *__pyx_optional_args); /*proto*/
1834 static __pyx_t_8fastavro_5_read_long64 __pyx_f_8fastavro_5_read_read_long(PyObject *); /*proto*/
1835 static PyObject *__pyx_f_8fastavro_5_read_read_float(PyObject *); /*proto*/
1836 static PyObject *__pyx_f_8fastavro_5_read_read_double(PyObject *); /*proto*/
1837 static PyObject *__pyx_f_8fastavro_5_read_read_bytes(PyObject *); /*proto*/
1838 static PyObject *__pyx_f_8fastavro_5_read_read_utf8(PyObject *); /*proto*/
1839 static PyObject *__pyx_f_8fastavro_5_read_read_fixed(PyObject *, PyObject *); /*proto*/
1840 static PyObject *__pyx_f_8fastavro_5_read_read_enum(PyObject *, PyObject *, PyObject *); /*proto*/
1841 static PyObject *__pyx_f_8fastavro_5_read_read_array(PyObject *, PyObject *, PyObject *, struct __pyx_opt_args_8fastavro_5_read_read_array *__pyx_optional_args); /*proto*/
1842 static PyObject *__pyx_f_8fastavro_5_read_read_map(PyObject *, PyObject *, PyObject *, struct __pyx_opt_args_8fastavro_5_read_read_map *__pyx_optional_args); /*proto*/
1843 static PyObject *__pyx_f_8fastavro_5_read_read_union(PyObject *, PyObject *, PyObject *, struct __pyx_opt_args_8fastavro_5_read_read_union *__pyx_optional_args); /*proto*/
1844 static PyObject *__pyx_f_8fastavro_5_read_read_record(PyObject *, PyObject *, PyObject *, struct __pyx_opt_args_8fastavro_5_read_read_record *__pyx_optional_args); /*proto*/
1845 static PyObject *__pyx_f_8fastavro_5_read_maybe_promote(PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch); /*proto*/
1846 static PyObject *__pyx_f_8fastavro_5_read__read_data(PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_8fastavro_5_read__read_data *__pyx_optional_args); /*proto*/
1847 static PyObject *__pyx_f_8fastavro_5_read_skip_sync(PyObject *, PyObject *, int __pyx_skip_dispatch); /*proto*/
1848 static PyObject *__pyx_f_8fastavro_5_read_null_read_block(PyObject *, int __pyx_skip_dispatch); /*proto*/
1849 static PyObject *__pyx_f_8fastavro_5_read_deflate_read_block(PyObject *, int __pyx_skip_dispatch); /*proto*/
1850 static PyObject *__pyx_f_8fastavro_5_read_bzip2_read_block(PyObject *, int __pyx_skip_dispatch); /*proto*/
1851 static PyObject *__pyx_f_8fastavro_5_read_snappy_read_block(PyObject *, int __pyx_skip_dispatch); /*proto*/
1852 static PyObject *__pyx_f_8fastavro_5_read_zstandard_read_block(PyObject *, int __pyx_skip_dispatch); /*proto*/
1853 static PyObject *__pyx_f_8fastavro_5_read_lz4_read_block(PyObject *, int __pyx_skip_dispatch); /*proto*/
1854 static PyObject *__pyx_f_8fastavro_5_read_xz_read_block(PyObject *, int __pyx_skip_dispatch); /*proto*/
1855 static PyObject *__pyx_f_8fastavro_5_read_schemaless_reader(PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_8fastavro_5_read_schemaless_reader *__pyx_optional_args); /*proto*/
1856 static PyObject *__pyx_f_8fastavro_5_read_is_avro(PyObject *, int __pyx_skip_dispatch); /*proto*/
1857 #define __Pyx_MODULE_NAME "fastavro._read"
1858 extern int __pyx_module_is_main_fastavro___read;
1859 int __pyx_module_is_main_fastavro___read = 0;
1860 
1861 /* Implementation of 'fastavro._read' */
1862 static PyObject *__pyx_builtin_ImportError;
1863 static PyObject *__pyx_builtin_property;
1864 static PyObject *__pyx_builtin_StopIteration;
1865 static PyObject *__pyx_builtin_range;
1866 static PyObject *__pyx_builtin_EOFError;
1867 static PyObject *__pyx_builtin_ValueError;
1868 static PyObject *__pyx_builtin_DeprecationWarning;
1869 static PyObject *__pyx_builtin_NotImplementedError;
1870 static PyObject *__pyx_builtin_open;
1871 static const char __pyx_k_i[] = "i";
1872 static const char __pyx_k_k[] = "k";
1873 static const char __pyx_k_v[] = "v";
1874 static const char __pyx_k_fo[] = "fo";
1875 static const char __pyx_k_rb[] = "rb";
1876 static const char __pyx_k_xz[] = "xz";
1877 static const char __pyx_k_bz2[] = "bz2";
1878 static const char __pyx_k_doc[] = "__doc__";
1879 static const char __pyx_k_get[] = "get";
1880 static const char __pyx_k_int[] = "int";
1881 static const char __pyx_k_lz4[] = "lz4";
1882 static const char __pyx_k_map[] = "map";
1883 static const char __pyx_k_six[] = "_six";
1884 static const char __pyx_k_str[] = "__str__";
1885 static const char __pyx_k_MASK[] = "MASK";
1886 static const char __pyx_k_UUID[] = "UUID";
1887 static const char __pyx_k_args[] = "args";
1888 static const char __pyx_k_btou[] = "btou";
1889 static const char __pyx_k_data[] = "data";
1890 static const char __pyx_k_date[] = "date";
1891 static const char __pyx_k_enum[] = "enum";
1892 static const char __pyx_k_init[] = "__init__";
1893 static const char __pyx_k_iter[] = "__iter__";
1894 static const char __pyx_k_json[] = "json";
1895 static const char __pyx_k_long[] = "long";
1896 static const char __pyx_k_lzma[] = "lzma";
1897 static const char __pyx_k_main[] = "__main__";
1898 static const char __pyx_k_meta[] = "meta";
1899 static const char __pyx_k_name[] = "name";
1900 static const char __pyx_k_next[] = "next";
1901 static const char __pyx_k_null[] = "null";
1902 static const char __pyx_k_open[] = "open";
1903 static const char __pyx_k_prec[] = "prec";
1904 static const char __pyx_k_read[] = "read";
1905 static const char __pyx_k_self[] = "self";
1906 static const char __pyx_k_send[] = "send";
1907 static const char __pyx_k_size[] = "size";
1908 static const char __pyx_k_sync[] = "sync";
1909 static const char __pyx_k_tell[] = "tell";
1910 static const char __pyx_k_test[] = "__test__";
1911 static const char __pyx_k_time[] = "time";
1912 static const char __pyx_k_type[] = "type";
1913 static const char __pyx_k_utob[] = "utob";
1914 static const char __pyx_k_uuid[] = "uuid";
1915 static const char __pyx_k_warn[] = "warn";
1916 static const char __pyx_k_zlib[] = "zlib";
1917 static const char __pyx_k_zstd[] = "zstd";
1918 static const char __pyx_k_Block[] = "Block";
1919 static const char __pyx_k_MAGIC[] = "MAGIC";
1920 static const char __pyx_k_array[] = "array";
1921 static const char __pyx_k_block[] = "block";
1922 static const char __pyx_k_bytes[] = "bytes";
1923 static const char __pyx_k_bzip2[] = "bzip2";
1924 static const char __pyx_k_close[] = "close";
1925 static const char __pyx_k_codec[] = "codec";
1926 static const char __pyx_k_const[] = "const";
1927 static const char __pyx_k_elems[] = "_elems";
1928 static const char __pyx_k_epoch[] = "epoch";
1929 static const char __pyx_k_error[] = "error";
1930 static const char __pyx_k_fixed[] = "fixed";
1931 static const char __pyx_k_float[] = "float";
1932 static const char __pyx_k_force[] = "_force";
1933 static const char __pyx_k_items[] = "items";
1934 static const char __pyx_k_loads[] = "loads";
1935 static const char __pyx_k_range[] = "range";
1936 static const char __pyx_k_scale[] = "scale";
1937 static const char __pyx_k_throw[] = "throw";
1938 static const char __pyx_k_union[] = "union";
1939 static const char __pyx_k_utf_8[] = "utf-8";
1940 static const char __pyx_k_double[] = "double";
1941 static const char __pyx_k_fields[] = "fields";
1942 static const char __pyx_k_header[] = "header";
1943 static const char __pyx_k_import[] = "__import__";
1944 static const char __pyx_k_is_str[] = "is_str";
1945 static const char __pyx_k_module[] = "__module__";
1946 static const char __pyx_k_name_2[] = "__name__";
1947 static const char __pyx_k_next_2[] = "__next__";
1948 static const char __pyx_k_offset[] = "offset";
1949 static const char __pyx_k_reader[] = "reader";
1950 static const char __pyx_k_record[] = "record";
1951 static const char __pyx_k_scaleb[] = "scaleb";
1952 static const char __pyx_k_schema[] = "_schema";
1953 static const char __pyx_k_snappy[] = "snappy";
1954 static const char __pyx_k_string[] = "string";
1955 static const char __pyx_k_values[] = "values";
1956 static const char __pyx_k_Context[] = "Context";
1957 static const char __pyx_k_aliases[] = "aliases";
1958 static const char __pyx_k_boolean[] = "boolean";
1959 static const char __pyx_k_bytes_2[] = "bytes_";
1960 static const char __pyx_k_decimal[] = "decimal";
1961 static const char __pyx_k_default[] = "default";
1962 static const char __pyx_k_deflate[] = "deflate";
1963 static const char __pyx_k_prepare[] = "__prepare__";
1964 static const char __pyx_k_request[] = "request";
1965 static const char __pyx_k_symbols[] = "symbols";
1966 static const char __pyx_k_EOFError[] = "EOFError";
1967 static const char __pyx_k_MemoryIO[] = "MemoryIO";
1968 static const char __pyx_k_block_fo[] = "block_fo";
1969 static const char __pyx_k_datetime[] = "datetime";
1970 static const char __pyx_k_header_2[] = "_header";
1971 static const char __pyx_k_int_date[] = "int-date";
1972 static const char __pyx_k_metadata[] = "metadata";
1973 static const char __pyx_k_property[] = "property";
1974 static const char __pyx_k_qualname[] = "__qualname__";
1975 static const char __pyx_k_r_schema[] = "r_schema";
1976 static const char __pyx_k_schema_2[] = "schema";
1977 static const char __pyx_k_timezone[] = "_timezone";
1978 static const char __pyx_k_w_schema[] = "w_schema";
1979 static const char __pyx_k_warnings[] = "warnings";
1980 static const char __pyx_k_ReadError[] = "ReadError";
1981 static const char __pyx_k_SYNC_SIZE[] = "SYNC_SIZE";
1982 static const char __pyx_k_backports[] = "backports";
1983 static const char __pyx_k_iteritems[] = "iteritems";
1984 static const char __pyx_k_lz4_block[] = "lz4.block";
1985 static const char __pyx_k_metaclass[] = "__metaclass__";
1986 static const char __pyx_k_precision[] = "precision";
1987 static const char __pyx_k_read_date[] = "read_date";
1988 static const char __pyx_k_read_uuid[] = "read_uuid";
1989 static const char __pyx_k_timedelta[] = "timedelta";
1990 static const char __pyx_k_zstandard[] = "zstandard";
1991 static const char __pyx_k_AVRO_TYPES[] = "AVRO_TYPES";
1992 static const char __pyx_k_DAYS_SHIFT[] = "DAYS_SHIFT";
1993 static const char __pyx_k_ValueError[] = "ValueError";
1994 static const char __pyx_k_avro_codec[] = "avro.codec";
1995 static const char __pyx_k_decompress[] = "decompress";
1996 static const char __pyx_k_read_block[] = "read_block";
1997 static const char __pyx_k_write_hint[] = "_write_hint";
1998 static const char __pyx_k_Block___str[] = "Block.__str__";
1999 static const char __pyx_k_ImportError[] = "ImportError";
2000 static const char __pyx_k_avro_schema[] = "avro.schema";
2001 static const char __pyx_k_block_bytes[] = "block_bytes";
2002 static const char __pyx_k_block_count[] = "block_count";
2003 static const char __pyx_k_error_union[] = "error_union";
2004 static const char __pyx_k_file_reader[] = "file_reader";
2005 static const char __pyx_k_fromordinal[] = "fromordinal";
2006 static const char __pyx_k_logicalType[] = "logicalType";
2007 static const char __pyx_k_num_records[] = "num_records";
2008 static const char __pyx_k_read_common[] = "_read_common";
2009 static const char __pyx_k_reader_type[] = "reader_type";
2010 static const char __pyx_k_string_uuid[] = "string-uuid";
2011 static const char __pyx_k_sync_marker[] = "sync_marker";
2012 static const char __pyx_k_writer_type[] = "writer_type";
2013 static const char __pyx_k_Block___init[] = "Block.__init__";
2014 static const char __pyx_k_Block___iter[] = "Block.__iter__";
2015 static const char __pyx_k_MCS_PER_HOUR[] = "MCS_PER_HOUR";
2016 static const char __pyx_k_MLS_PER_HOUR[] = "MLS_PER_HOUR";
2017 static const char __pyx_k_block_reader[] = "block_reader";
2018 static const char __pyx_k_fastavro_six[] = "fastavro.six";
2019 static const char __pyx_k_microseconds[] = "microseconds";
2020 static const char __pyx_k_parse_schema[] = "parse_schema";
2021 static const char __pyx_k_read_decimal[] = "read_decimal";
2022 static const char __pyx_k_BLOCK_READERS[] = "BLOCK_READERS";
2023 static const char __pyx_k_CYTHON_MODULE[] = "CYTHON_MODULE";
2024 static const char __pyx_k_HEADER_SCHEMA[] = "HEADER_SCHEMA";
2025 static const char __pyx_k_StopIteration[] = "StopIteration";
2026 static const char __pyx_k_bytes_decimal[] = "bytes-decimal";
2027 static const char __pyx_k_fixed_decimal[] = "fixed-decimal";
2028 static const char __pyx_k_named_schemas[] = "named_schemas";
2029 static const char __pyx_k_python_snappy[] = "python-snappy";
2030 static const char __pyx_k_reader___init[] = "reader.__init__";
2031 static const char __pyx_k_reader_schema[] = "reader_schema";
2032 static const char __pyx_k_writer_schema[] = "writer_schema";
2033 static const char __pyx_k_xz_read_block[] = "xz_read_block";
2034 static const char __pyx_k_MCS_PER_MINUTE[] = "MCS_PER_MINUTE";
2035 static const char __pyx_k_MCS_PER_SECOND[] = "MCS_PER_SECOND";
2036 static const char __pyx_k_MLS_PER_MINUTE[] = "MLS_PER_MINUTE";
2037 static const char __pyx_k_MLS_PER_SECOND[] = "MLS_PER_SECOND";
2038 static const char __pyx_k_backports_lzma[] = "backports.lzma";
2039 static const char __pyx_k_create_decimal[] = "create_decimal";
2040 static const char __pyx_k_fastavro__read[] = "fastavro._read";
2041 static const char __pyx_k_lz4_read_block[] = "lz4_read_block";
2042 static const char __pyx_k_LOGICAL_READERS[] = "LOGICAL_READERS";
2043 static const char __pyx_k_decimal_context[] = "decimal_context";
2044 static const char __pyx_k_int_time_millis[] = "int-time-millis";
2045 static const char __pyx_k_named_schemas_2[] = "_named_schemas";
2046 static const char __pyx_k_null_read_block[] = "null_read_block";
2047 static const char __pyx_k_ZstdDecompressor[] = "ZstdDecompressor";
2048 static const char __pyx_k_bzip2_read_block[] = "bzip2_read_block";
2049 static const char __pyx_k_file_reader_next[] = "file_reader.next";
2050 static const char __pyx_k_iter_avro_blocks[] = "_iter_avro_blocks";
2051 static const char __pyx_k_long_time_micros[] = "long-time-micros";
2052 static const char __pyx_k_read_time_micros[] = "read_time_micros";
2053 static const char __pyx_k_read_time_millis[] = "read_time_millis";
2054 static const char __pyx_k_iter_avro_records[] = "_iter_avro_records";
2055 static const char __pyx_k_missing_codec_lib[] = "missing_codec_lib";
2056 static const char __pyx_k_num_block_records[] = "num_block_records";
2057 static const char __pyx_k_snappy_read_block[] = "snappy_read_block";
2058 static const char __pyx_k_DeprecationWarning[] = "DeprecationWarning";
2059 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2060 static const char __pyx_k_deflate_read_block[] = "deflate_read_block";
2061 static const char __pyx_k_fastavro__read_pyx[] = "fastavro/_read.pyx";
2062 static const char __pyx_k_file_reader___init[] = "file_reader.__init__";
2063 static const char __pyx_k_file_reader___iter[] = "file_reader.__iter__";
2064 static const char __pyx_k_file_reader_schema[] = "file_reader.schema";
2065 static const char __pyx_k_return_record_name[] = "return_record_name";
2066 static const char __pyx_k_NotImplementedError[] = "NotImplementedError";
2067 static const char __pyx_k_block_reader___init[] = "block_reader.__init__";
2068 static const char __pyx_k_extract_record_type[] = "extract_record_type";
2069 static const char __pyx_k_Unrecognized_codec_r[] = "Unrecognized codec: %r";
2070 static const char __pyx_k_cannot_read_s_from_s[] = "cannot read %s from %s";
2071 static const char __pyx_k_extract_logical_type[] = "extract_logical_type";
2072 static const char __pyx_k_zstandard_read_block[] = "zstandard_read_block";
2073 static const char __pyx_k_SchemaResolutionError[] = "SchemaResolutionError";
2074 static const char __pyx_k_long_timestamp_micros[] = "long-timestamp-micros";
2075 static const char __pyx_k_long_timestamp_millis[] = "long-timestamp-millis";
2076 static const char __pyx_k_read_timestamp_micros[] = "read_timestamp_micros";
2077 static const char __pyx_k_read_timestamp_millis[] = "read_timestamp_millis";
2078 static const char __pyx_k_No_default_value_for_s[] = "No default value for %s";
2079 static const char __pyx_k_be_signed_bytes_to_int[] = "be_signed_bytes_to_int";
2080 static const char __pyx_k_Schema_mismatch_s_is_not_s[] = "Schema mismatch: %s is not %s";
2081 static const char __pyx_k_expected_sync_marker_not_found[] = "expected sync marker not found";
2082 static const char __pyx_k_s_not_found_in_reader_symbol_li[] = "%s not found in reader symbol list %s";
2083 static const char __pyx_k_Avro_block_d_bytes_d_records_cod[] = "Avro block: %d bytes, %d records, codec: %s, position %d+%d";
2084 static const char __pyx_k_Python_code_for_reading_AVRO_fil[] = "Python code for reading AVRO files";
2085 static const char __pyx_k_The_schema_attribute_is_deprecat[] = "The 'schema' attribute is deprecated. Please use 'writer_schema'";
2086 static const char __pyx_k_cannot_read_header_is_it_an_avro[] = "cannot read header - is it an avro file?";
2087 static const char __pyx_k_schema_mismatch_s_not_found_in_s[] = "schema mismatch: %s not found in %s";
2088 static PyObject *__pyx_n_s_AVRO_TYPES;
2089 static PyObject *__pyx_kp_s_Avro_block_d_bytes_d_records_cod;
2090 static PyObject *__pyx_n_s_BLOCK_READERS;
2091 static PyObject *__pyx_n_s_Block;
2092 static PyObject *__pyx_n_s_Block___init;
2093 static PyObject *__pyx_n_s_Block___iter;
2094 static PyObject *__pyx_n_s_Block___str;
2095 static PyObject *__pyx_n_s_CYTHON_MODULE;
2096 static PyObject *__pyx_n_s_Context;
2097 static PyObject *__pyx_n_s_DAYS_SHIFT;
2098 static PyObject *__pyx_n_s_DeprecationWarning;
2099 static PyObject *__pyx_n_s_EOFError;
2100 static PyObject *__pyx_n_s_HEADER_SCHEMA;
2101 static PyObject *__pyx_n_s_ImportError;
2102 static PyObject *__pyx_n_s_LOGICAL_READERS;
2103 static PyObject *__pyx_n_s_MAGIC;
2104 static PyObject *__pyx_n_s_MASK;
2105 static PyObject *__pyx_n_s_MCS_PER_HOUR;
2106 static PyObject *__pyx_n_s_MCS_PER_MINUTE;
2107 static PyObject *__pyx_n_s_MCS_PER_SECOND;
2108 static PyObject *__pyx_n_s_MLS_PER_HOUR;
2109 static PyObject *__pyx_n_s_MLS_PER_MINUTE;
2110 static PyObject *__pyx_n_s_MLS_PER_SECOND;
2111 static PyObject *__pyx_n_s_MemoryIO;
2112 static PyObject *__pyx_kp_s_No_default_value_for_s;
2113 static PyObject *__pyx_n_s_NotImplementedError;
2114 static PyObject *__pyx_n_s_ReadError;
2115 static PyObject *__pyx_n_s_SYNC_SIZE;
2116 static PyObject *__pyx_n_s_SchemaResolutionError;
2117 static PyObject *__pyx_kp_s_Schema_mismatch_s_is_not_s;
2118 static PyObject *__pyx_n_s_StopIteration;
2119 static PyObject *__pyx_kp_s_The_schema_attribute_is_deprecat;
2120 static PyObject *__pyx_n_s_UUID;
2121 static PyObject *__pyx_kp_s_Unrecognized_codec_r;
2122 static PyObject *__pyx_n_s_ValueError;
2123 static PyObject *__pyx_n_s_ZstdDecompressor;
2124 static PyObject *__pyx_n_s_aliases;
2125 static PyObject *__pyx_n_s_args;
2126 static PyObject *__pyx_n_s_array;
2127 static PyObject *__pyx_kp_s_avro_codec;
2128 static PyObject *__pyx_kp_s_avro_schema;
2129 static PyObject *__pyx_n_s_backports;
2130 static PyObject *__pyx_kp_s_backports_lzma;
2131 static PyObject *__pyx_n_s_be_signed_bytes_to_int;
2132 static PyObject *__pyx_n_s_block;
2133 static PyObject *__pyx_n_s_block_bytes;
2134 static PyObject *__pyx_n_s_block_count;
2135 static PyObject *__pyx_n_s_block_fo;
2136 static PyObject *__pyx_n_s_block_reader;
2137 static PyObject *__pyx_n_s_block_reader___init;
2138 static PyObject *__pyx_n_s_boolean;
2139 static PyObject *__pyx_n_s_btou;
2140 static PyObject *__pyx_n_s_bytes;
2141 static PyObject *__pyx_n_s_bytes_2;
2142 static PyObject *__pyx_kp_s_bytes_decimal;
2143 static PyObject *__pyx_n_s_bz2;
2144 static PyObject *__pyx_n_s_bzip2;
2145 static PyObject *__pyx_n_s_bzip2_read_block;
2146 static PyObject *__pyx_kp_s_cannot_read_header_is_it_an_avro;
2147 static PyObject *__pyx_kp_s_cannot_read_s_from_s;
2148 static PyObject *__pyx_n_s_cline_in_traceback;
2149 static PyObject *__pyx_n_s_close;
2150 static PyObject *__pyx_n_s_codec;
2151 static PyObject *__pyx_n_s_const;
2152 static PyObject *__pyx_n_s_create_decimal;
2153 static PyObject *__pyx_n_s_data;
2154 static PyObject *__pyx_n_s_date;
2155 static PyObject *__pyx_n_s_datetime;
2156 static PyObject *__pyx_n_s_decimal;
2157 static PyObject *__pyx_n_s_decimal_context;
2158 static PyObject *__pyx_n_s_decompress;
2159 static PyObject *__pyx_n_s_default;
2160 static PyObject *__pyx_n_s_deflate;
2161 static PyObject *__pyx_n_s_deflate_read_block;
2162 static PyObject *__pyx_n_s_doc;
2163 static PyObject *__pyx_n_s_double;
2164 static PyObject *__pyx_n_s_elems;
2165 static PyObject *__pyx_n_s_enum;
2166 static PyObject *__pyx_n_s_epoch;
2167 static PyObject *__pyx_n_s_error;
2168 static PyObject *__pyx_n_s_error_union;
2169 static PyObject *__pyx_kp_s_expected_sync_marker_not_found;
2170 static PyObject *__pyx_n_s_extract_logical_type;
2171 static PyObject *__pyx_n_s_extract_record_type;
2172 static PyObject *__pyx_n_s_fastavro__read;
2173 static PyObject *__pyx_kp_s_fastavro__read_pyx;
2174 static PyObject *__pyx_n_s_fastavro_six;
2175 static PyObject *__pyx_n_s_fields;
2176 static PyObject *__pyx_n_s_file_reader;
2177 static PyObject *__pyx_n_s_file_reader___init;
2178 static PyObject *__pyx_n_s_file_reader___iter;
2179 static PyObject *__pyx_n_s_file_reader_next;
2180 static PyObject *__pyx_n_s_file_reader_schema;
2181 static PyObject *__pyx_n_s_fixed;
2182 static PyObject *__pyx_kp_s_fixed_decimal;
2183 static PyObject *__pyx_n_s_float;
2184 static PyObject *__pyx_n_s_fo;
2185 static PyObject *__pyx_n_s_force;
2186 static PyObject *__pyx_n_s_fromordinal;
2187 static PyObject *__pyx_n_s_get;
2188 static PyObject *__pyx_n_s_header;
2189 static PyObject *__pyx_n_s_header_2;
2190 static PyObject *__pyx_n_s_i;
2191 static PyObject *__pyx_n_s_import;
2192 static PyObject *__pyx_n_s_init;
2193 static PyObject *__pyx_n_s_int;
2194 static PyObject *__pyx_kp_s_int_date;
2195 static PyObject *__pyx_kp_s_int_time_millis;
2196 static PyObject *__pyx_n_s_is_str;
2197 static PyObject *__pyx_n_s_items;
2198 static PyObject *__pyx_n_s_iter;
2199 static PyObject *__pyx_n_s_iter_avro_blocks;
2200 static PyObject *__pyx_n_s_iter_avro_records;
2201 static PyObject *__pyx_n_s_iteritems;
2202 static PyObject *__pyx_n_s_json;
2203 static PyObject *__pyx_n_s_k;
2204 static PyObject *__pyx_n_s_loads;
2205 static PyObject *__pyx_n_s_logicalType;
2206 static PyObject *__pyx_n_s_long;
2207 static PyObject *__pyx_kp_s_long_time_micros;
2208 static PyObject *__pyx_kp_s_long_timestamp_micros;
2209 static PyObject *__pyx_kp_s_long_timestamp_millis;
2210 static PyObject *__pyx_n_s_lz4;
2211 static PyObject *__pyx_n_s_lz4_block;
2212 static PyObject *__pyx_n_s_lz4_read_block;
2213 static PyObject *__pyx_n_s_lzma;
2214 static PyObject *__pyx_n_s_main;
2215 static PyObject *__pyx_n_s_map;
2216 static PyObject *__pyx_n_s_meta;
2217 static PyObject *__pyx_n_s_metaclass;
2218 static PyObject *__pyx_n_s_metadata;
2219 static PyObject *__pyx_n_s_microseconds;
2220 static PyObject *__pyx_n_s_missing_codec_lib;
2221 static PyObject *__pyx_n_s_module;
2222 static PyObject *__pyx_n_s_name;
2223 static PyObject *__pyx_n_s_name_2;
2224 static PyObject *__pyx_n_s_named_schemas;
2225 static PyObject *__pyx_n_s_named_schemas_2;
2226 static PyObject *__pyx_n_s_next;
2227 static PyObject *__pyx_n_s_next_2;
2228 static PyObject *__pyx_n_s_null;
2229 static PyObject *__pyx_n_s_null_read_block;
2230 static PyObject *__pyx_n_s_num_block_records;
2231 static PyObject *__pyx_n_s_num_records;
2232 static PyObject *__pyx_n_s_offset;
2233 static PyObject *__pyx_n_s_open;
2234 static PyObject *__pyx_n_s_parse_schema;
2235 static PyObject *__pyx_n_s_prec;
2236 static PyObject *__pyx_n_s_precision;
2237 static PyObject *__pyx_n_s_prepare;
2238 static PyObject *__pyx_n_s_property;
2239 static PyObject *__pyx_kp_s_python_snappy;
2240 static PyObject *__pyx_n_s_qualname;
2241 static PyObject *__pyx_n_s_r_schema;
2242 static PyObject *__pyx_n_s_range;
2243 static PyObject *__pyx_n_s_rb;
2244 static PyObject *__pyx_n_s_read;
2245 static PyObject *__pyx_n_s_read_block;
2246 static PyObject *__pyx_n_s_read_common;
2247 static PyObject *__pyx_n_s_read_date;
2248 static PyObject *__pyx_n_s_read_decimal;
2249 static PyObject *__pyx_n_s_read_time_micros;
2250 static PyObject *__pyx_n_s_read_time_millis;
2251 static PyObject *__pyx_n_s_read_timestamp_micros;
2252 static PyObject *__pyx_n_s_read_timestamp_millis;
2253 static PyObject *__pyx_n_s_read_uuid;
2254 static PyObject *__pyx_n_s_reader;
2255 static PyObject *__pyx_n_s_reader___init;
2256 static PyObject *__pyx_n_s_reader_schema;
2257 static PyObject *__pyx_n_s_reader_type;
2258 static PyObject *__pyx_n_s_record;
2259 static PyObject *__pyx_n_s_request;
2260 static PyObject *__pyx_n_s_return_record_name;
2261 static PyObject *__pyx_kp_s_s_not_found_in_reader_symbol_li;
2262 static PyObject *__pyx_n_s_scale;
2263 static PyObject *__pyx_n_s_scaleb;
2264 static PyObject *__pyx_n_s_schema;
2265 static PyObject *__pyx_n_s_schema_2;
2266 static PyObject *__pyx_kp_s_schema_mismatch_s_not_found_in_s;
2267 static PyObject *__pyx_n_s_self;
2268 static PyObject *__pyx_n_s_send;
2269 static PyObject *__pyx_n_s_six;
2270 static PyObject *__pyx_n_s_size;
2271 static PyObject *__pyx_n_s_snappy;
2272 static PyObject *__pyx_n_s_snappy_read_block;
2273 static PyObject *__pyx_n_s_str;
2274 static PyObject *__pyx_n_s_string;
2275 static PyObject *__pyx_kp_s_string_uuid;
2276 static PyObject *__pyx_n_s_symbols;
2277 static PyObject *__pyx_n_s_sync;
2278 static PyObject *__pyx_n_s_sync_marker;
2279 static PyObject *__pyx_n_s_tell;
2280 static PyObject *__pyx_n_s_test;
2281 static PyObject *__pyx_n_s_throw;
2282 static PyObject *__pyx_n_s_time;
2283 static PyObject *__pyx_n_s_timedelta;
2284 static PyObject *__pyx_n_s_timezone;
2285 static PyObject *__pyx_n_s_type;
2286 static PyObject *__pyx_n_s_union;
2287 static PyObject *__pyx_kp_s_utf_8;
2288 static PyObject *__pyx_n_s_utob;
2289 static PyObject *__pyx_n_s_uuid;
2290 static PyObject *__pyx_n_s_v;
2291 static PyObject *__pyx_n_s_values;
2292 static PyObject *__pyx_n_s_w_schema;
2293 static PyObject *__pyx_n_s_warn;
2294 static PyObject *__pyx_n_s_warnings;
2295 static PyObject *__pyx_n_s_write_hint;
2296 static PyObject *__pyx_n_s_writer_schema;
2297 static PyObject *__pyx_n_s_writer_type;
2298 static PyObject *__pyx_n_s_xz;
2299 static PyObject *__pyx_n_s_xz_read_block;
2300 static PyObject *__pyx_n_s_zlib;
2301 static PyObject *__pyx_n_s_zstandard;
2302 static PyObject *__pyx_n_s_zstandard_read_block;
2303 static PyObject *__pyx_n_s_zstd;
2304 static PyObject *__pyx_pf_8fastavro_5_read_match_types(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_writer_type, PyObject *__pyx_v_reader_type); /* proto */
2305 static PyObject *__pyx_pf_8fastavro_5_read_2match_schemas(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_w_schema, PyObject *__pyx_v_r_schema); /* proto */
2306 static PyObject *__pyx_pf_8fastavro_5_read_4read_timestamp_millis(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_writer_schema, PyObject *__pyx_v_reader_schema); /* proto */
2307 static PyObject *__pyx_pf_8fastavro_5_read_6read_timestamp_micros(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_writer_schema, PyObject *__pyx_v_reader_schema); /* proto */
2308 static PyObject *__pyx_pf_8fastavro_5_read_8read_date(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_writer_schema, PyObject *__pyx_v_reader_schema); /* proto */
2309 static PyObject *__pyx_pf_8fastavro_5_read_10read_uuid(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_writer_schema, PyObject *__pyx_v_reader_schema); /* proto */
2310 static PyObject *__pyx_pf_8fastavro_5_read_12read_time_millis(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_writer_schema, PyObject *__pyx_v_reader_schema); /* proto */
2311 static PyObject *__pyx_pf_8fastavro_5_read_14read_time_micros(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_writer_schema, PyObject *__pyx_v_reader_schema); /* proto */
2312 static PyObject *__pyx_pf_8fastavro_5_read_16read_decimal(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_writer_schema, PyObject *__pyx_v_reader_schema); /* proto */
2313 static PyObject *__pyx_pf_8fastavro_5_read_18maybe_promote(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_writer_type, PyObject *__pyx_v_reader_type); /* proto */
2314 static PyObject *__pyx_pf_8fastavro_5_read_20_read_data(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fo, PyObject *__pyx_v_writer_schema, PyObject *__pyx_v_named_schemas, PyObject *__pyx_v_reader_schema, PyObject *__pyx_v_return_record_name); /* proto */
2315 static PyObject *__pyx_pf_8fastavro_5_read_22skip_sync(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fo, PyObject *__pyx_v_sync_marker); /* proto */
2316 static PyObject *__pyx_pf_8fastavro_5_read_24null_read_block(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fo); /* proto */
2317 static PyObject *__pyx_pf_8fastavro_5_read_26deflate_read_block(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fo); /* proto */
2318 static PyObject *__pyx_pf_8fastavro_5_read_28bzip2_read_block(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fo); /* proto */
2319 static PyObject *__pyx_pf_8fastavro_5_read_30snappy_read_block(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fo); /* proto */
2320 static PyObject *__pyx_pf_8fastavro_5_read_32zstandard_read_block(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fo); /* proto */
2321 static PyObject *__pyx_pf_8fastavro_5_read_34lz4_read_block(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fo); /* proto */
2322 static PyObject *__pyx_pf_8fastavro_5_read_36xz_read_block(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fo); /* proto */
2323 static PyObject *__pyx_pf_8fastavro_5_read_38_iter_avro_records(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fo, PyObject *__pyx_v_header, PyObject *__pyx_v_codec, PyObject *__pyx_v_writer_schema, PyObject *__pyx_v_named_schemas, PyObject *__pyx_v_reader_schema, PyObject *__pyx_v_return_record_name); /* proto */
2324 static PyObject *__pyx_pf_8fastavro_5_read_41_iter_avro_blocks(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fo, PyObject *__pyx_v_header, PyObject *__pyx_v_codec, PyObject *__pyx_v_writer_schema, PyObject *__pyx_v_named_schemas, PyObject *__pyx_v_reader_schema, PyObject *__pyx_v_return_record_name); /* proto */
2325 static PyObject *__pyx_pf_8fastavro_5_read_5Block___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_bytes_, PyObject *__pyx_v_num_records, PyObject *__pyx_v_codec, PyObject *__pyx_v_reader_schema, PyObject *__pyx_v_writer_schema, PyObject *__pyx_v_named_schemas, PyObject *__pyx_v_offset, PyObject *__pyx_v_size, PyObject *__pyx_v_return_record_name); /* proto */
2326 static PyObject *__pyx_pf_8fastavro_5_read_5Block_2__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
2327 static PyObject *__pyx_pf_8fastavro_5_read_5Block_5__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
2328 static PyObject *__pyx_pf_8fastavro_5_read_11file_reader___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_fo, PyObject *__pyx_v_reader_schema, PyObject *__pyx_v_return_record_name); /* proto */
2329 static PyObject *__pyx_pf_8fastavro_5_read_11file_reader_2schema(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
2330 static PyObject *__pyx_pf_8fastavro_5_read_11file_reader_4__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
2331 static PyObject *__pyx_pf_8fastavro_5_read_11file_reader_6next(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
2332 static PyObject *__pyx_pf_8fastavro_5_read_6reader___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_fo, PyObject *__pyx_v_reader_schema, PyObject *__pyx_v_return_record_name); /* proto */
2333 static PyObject *__pyx_pf_8fastavro_5_read_12block_reader___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_fo, PyObject *__pyx_v_reader_schema, PyObject *__pyx_v_return_record_name); /* proto */
2334 static PyObject *__pyx_pf_8fastavro_5_read_44schemaless_reader(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fo, PyObject *__pyx_v_writer_schema, PyObject *__pyx_v_reader_schema, PyObject *__pyx_v_return_record_name); /* proto */
2335 static PyObject *__pyx_pf_8fastavro_5_read_46is_avro(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path_or_buffer); /* proto */
2336 static PyObject *__pyx_tp_new_8fastavro_5_read___pyx_scope_struct___iter_avro_records(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2337 static PyObject *__pyx_tp_new_8fastavro_5_read___pyx_scope_struct_1__iter_avro_blocks(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2338 static PyObject *__pyx_tp_new_8fastavro_5_read___pyx_scope_struct_2___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2339 static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get = {0, &__pyx_n_s_get, 0, 0, 0};
2340 static PyObject *__pyx_int_0;
2341 static PyObject *__pyx_int_1;
2342 static PyObject *__pyx_int_4;
2343 static PyObject *__pyx_int_8;
2344 static PyObject *__pyx_int_60;
2345 static PyObject *__pyx_int_255;
2346 static PyObject *__pyx_int_1000;
2347 static PyObject *__pyx_int_neg_15;
2348 static PyObject *__pyx_tuple_;
2349 static PyObject *__pyx_tuple__2;
2350 static PyObject *__pyx_tuple__6;
2351 static PyObject *__pyx_tuple__7;
2352 static PyObject *__pyx_tuple__8;
2353 static PyObject *__pyx_tuple__9;
2354 static PyObject *__pyx_tuple__10;
2355 static PyObject *__pyx_tuple__11;
2356 static PyObject *__pyx_tuple__12;
2357 static PyObject *__pyx_tuple__13;
2358 static PyObject *__pyx_tuple__14;
2359 static PyObject *__pyx_tuple__15;
2360 static PyObject *__pyx_tuple__17;
2361 static PyObject *__pyx_tuple__18;
2362 static PyObject *__pyx_tuple__19;
2363 static PyObject *__pyx_tuple__21;
2364 static PyObject *__pyx_tuple__23;
2365 static PyObject *__pyx_tuple__24;
2366 static PyObject *__pyx_tuple__26;
2367 static PyObject *__pyx_tuple__28;
2368 static PyObject *__pyx_tuple__30;
2369 static PyObject *__pyx_tuple__32;
2370 static PyObject *__pyx_tuple__33;
2371 static PyObject *__pyx_tuple__35;
2372 static PyObject *__pyx_codeobj__3;
2373 static PyObject *__pyx_codeobj__4;
2374 static PyObject *__pyx_codeobj__5;
2375 static PyObject *__pyx_codeobj__16;
2376 static PyObject *__pyx_codeobj__20;
2377 static PyObject *__pyx_codeobj__22;
2378 static PyObject *__pyx_codeobj__25;
2379 static PyObject *__pyx_codeobj__27;
2380 static PyObject *__pyx_codeobj__29;
2381 static PyObject *__pyx_codeobj__31;
2382 static PyObject *__pyx_codeobj__34;
2383 /* Late includes */
2384 
2385 /* "fastavro/_read.pyx":68
2386  *
2387  *
2388  * cpdef match_types(writer_type, reader_type):             # <<<<<<<<<<<<<<
2389  *     if isinstance(writer_type, list) or isinstance(reader_type, list):
2390  *         return True
2391  */
2392 
2393 static PyObject *__pyx_pw_8fastavro_5_read_1match_types(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_f_8fastavro_5_read_match_types(PyObject * __pyx_v_writer_type,PyObject * __pyx_v_reader_type,CYTHON_UNUSED int __pyx_skip_dispatch)2394 static PyObject *__pyx_f_8fastavro_5_read_match_types(PyObject *__pyx_v_writer_type, PyObject *__pyx_v_reader_type, CYTHON_UNUSED int __pyx_skip_dispatch) {
2395   PyObject *__pyx_r = NULL;
2396   __Pyx_RefNannyDeclarations
2397   int __pyx_t_1;
2398   int __pyx_t_2;
2399   int __pyx_t_3;
2400   PyObject *__pyx_t_4 = NULL;
2401   int __pyx_lineno = 0;
2402   const char *__pyx_filename = NULL;
2403   int __pyx_clineno = 0;
2404   __Pyx_RefNannySetupContext("match_types", 0);
2405 
2406   /* "fastavro/_read.pyx":69
2407  *
2408  * cpdef match_types(writer_type, reader_type):
2409  *     if isinstance(writer_type, list) or isinstance(reader_type, list):             # <<<<<<<<<<<<<<
2410  *         return True
2411  *     if isinstance(writer_type, dict) or isinstance(reader_type, dict):
2412  */
2413   __pyx_t_2 = PyList_Check(__pyx_v_writer_type);
2414   __pyx_t_3 = (__pyx_t_2 != 0);
2415   if (!__pyx_t_3) {
2416   } else {
2417     __pyx_t_1 = __pyx_t_3;
2418     goto __pyx_L4_bool_binop_done;
2419   }
2420   __pyx_t_3 = PyList_Check(__pyx_v_reader_type);
2421   __pyx_t_2 = (__pyx_t_3 != 0);
2422   __pyx_t_1 = __pyx_t_2;
2423   __pyx_L4_bool_binop_done:;
2424   if (__pyx_t_1) {
2425 
2426     /* "fastavro/_read.pyx":70
2427  * cpdef match_types(writer_type, reader_type):
2428  *     if isinstance(writer_type, list) or isinstance(reader_type, list):
2429  *         return True             # <<<<<<<<<<<<<<
2430  *     if isinstance(writer_type, dict) or isinstance(reader_type, dict):
2431  *         return match_schemas(writer_type, reader_type)
2432  */
2433     __Pyx_XDECREF(__pyx_r);
2434     __Pyx_INCREF(Py_True);
2435     __pyx_r = Py_True;
2436     goto __pyx_L0;
2437 
2438     /* "fastavro/_read.pyx":69
2439  *
2440  * cpdef match_types(writer_type, reader_type):
2441  *     if isinstance(writer_type, list) or isinstance(reader_type, list):             # <<<<<<<<<<<<<<
2442  *         return True
2443  *     if isinstance(writer_type, dict) or isinstance(reader_type, dict):
2444  */
2445   }
2446 
2447   /* "fastavro/_read.pyx":71
2448  *     if isinstance(writer_type, list) or isinstance(reader_type, list):
2449  *         return True
2450  *     if isinstance(writer_type, dict) or isinstance(reader_type, dict):             # <<<<<<<<<<<<<<
2451  *         return match_schemas(writer_type, reader_type)
2452  *     if writer_type == reader_type:
2453  */
2454   __pyx_t_2 = PyDict_Check(__pyx_v_writer_type);
2455   __pyx_t_3 = (__pyx_t_2 != 0);
2456   if (!__pyx_t_3) {
2457   } else {
2458     __pyx_t_1 = __pyx_t_3;
2459     goto __pyx_L7_bool_binop_done;
2460   }
2461   __pyx_t_3 = PyDict_Check(__pyx_v_reader_type);
2462   __pyx_t_2 = (__pyx_t_3 != 0);
2463   __pyx_t_1 = __pyx_t_2;
2464   __pyx_L7_bool_binop_done:;
2465   if (__pyx_t_1) {
2466 
2467     /* "fastavro/_read.pyx":72
2468  *         return True
2469  *     if isinstance(writer_type, dict) or isinstance(reader_type, dict):
2470  *         return match_schemas(writer_type, reader_type)             # <<<<<<<<<<<<<<
2471  *     if writer_type == reader_type:
2472  *         return True
2473  */
2474     __Pyx_XDECREF(__pyx_r);
2475     __pyx_t_4 = __pyx_f_8fastavro_5_read_match_schemas(__pyx_v_writer_type, __pyx_v_reader_type, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error)
2476     __Pyx_GOTREF(__pyx_t_4);
2477     __pyx_r = __pyx_t_4;
2478     __pyx_t_4 = 0;
2479     goto __pyx_L0;
2480 
2481     /* "fastavro/_read.pyx":71
2482  *     if isinstance(writer_type, list) or isinstance(reader_type, list):
2483  *         return True
2484  *     if isinstance(writer_type, dict) or isinstance(reader_type, dict):             # <<<<<<<<<<<<<<
2485  *         return match_schemas(writer_type, reader_type)
2486  *     if writer_type == reader_type:
2487  */
2488   }
2489 
2490   /* "fastavro/_read.pyx":73
2491  *     if isinstance(writer_type, dict) or isinstance(reader_type, dict):
2492  *         return match_schemas(writer_type, reader_type)
2493  *     if writer_type == reader_type:             # <<<<<<<<<<<<<<
2494  *         return True
2495  *     # promotion cases
2496  */
2497   __pyx_t_4 = PyObject_RichCompare(__pyx_v_writer_type, __pyx_v_reader_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 73, __pyx_L1_error)
2498   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 73, __pyx_L1_error)
2499   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2500   if (__pyx_t_1) {
2501 
2502     /* "fastavro/_read.pyx":74
2503  *         return match_schemas(writer_type, reader_type)
2504  *     if writer_type == reader_type:
2505  *         return True             # <<<<<<<<<<<<<<
2506  *     # promotion cases
2507  *     elif writer_type == 'int' and reader_type in ['long', 'float', 'double']:
2508  */
2509     __Pyx_XDECREF(__pyx_r);
2510     __Pyx_INCREF(Py_True);
2511     __pyx_r = Py_True;
2512     goto __pyx_L0;
2513 
2514     /* "fastavro/_read.pyx":73
2515  *     if isinstance(writer_type, dict) or isinstance(reader_type, dict):
2516  *         return match_schemas(writer_type, reader_type)
2517  *     if writer_type == reader_type:             # <<<<<<<<<<<<<<
2518  *         return True
2519  *     # promotion cases
2520  */
2521   }
2522 
2523   /* "fastavro/_read.pyx":76
2524  *         return True
2525  *     # promotion cases
2526  *     elif writer_type == 'int' and reader_type in ['long', 'float', 'double']:             # <<<<<<<<<<<<<<
2527  *         return True
2528  *     elif writer_type == 'long' and reader_type in ['float', 'double']:
2529  */
2530   __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_writer_type, __pyx_n_s_int, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 76, __pyx_L1_error)
2531   if (__pyx_t_2) {
2532   } else {
2533     __pyx_t_1 = __pyx_t_2;
2534     goto __pyx_L10_bool_binop_done;
2535   }
2536   __Pyx_INCREF(__pyx_v_reader_type);
2537   __pyx_t_4 = __pyx_v_reader_type;
2538   __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_long, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 76, __pyx_L1_error)
2539   if (!__pyx_t_3) {
2540   } else {
2541     __pyx_t_2 = __pyx_t_3;
2542     goto __pyx_L12_bool_binop_done;
2543   }
2544   __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_float, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 76, __pyx_L1_error)
2545   if (!__pyx_t_3) {
2546   } else {
2547     __pyx_t_2 = __pyx_t_3;
2548     goto __pyx_L12_bool_binop_done;
2549   }
2550   __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_double, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 76, __pyx_L1_error)
2551   __pyx_t_2 = __pyx_t_3;
2552   __pyx_L12_bool_binop_done:;
2553   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2554   __pyx_t_3 = (__pyx_t_2 != 0);
2555   __pyx_t_1 = __pyx_t_3;
2556   __pyx_L10_bool_binop_done:;
2557   if (__pyx_t_1) {
2558 
2559     /* "fastavro/_read.pyx":77
2560  *     # promotion cases
2561  *     elif writer_type == 'int' and reader_type in ['long', 'float', 'double']:
2562  *         return True             # <<<<<<<<<<<<<<
2563  *     elif writer_type == 'long' and reader_type in ['float', 'double']:
2564  *         return True
2565  */
2566     __Pyx_XDECREF(__pyx_r);
2567     __Pyx_INCREF(Py_True);
2568     __pyx_r = Py_True;
2569     goto __pyx_L0;
2570 
2571     /* "fastavro/_read.pyx":76
2572  *         return True
2573  *     # promotion cases
2574  *     elif writer_type == 'int' and reader_type in ['long', 'float', 'double']:             # <<<<<<<<<<<<<<
2575  *         return True
2576  *     elif writer_type == 'long' and reader_type in ['float', 'double']:
2577  */
2578   }
2579 
2580   /* "fastavro/_read.pyx":78
2581  *     elif writer_type == 'int' and reader_type in ['long', 'float', 'double']:
2582  *         return True
2583  *     elif writer_type == 'long' and reader_type in ['float', 'double']:             # <<<<<<<<<<<<<<
2584  *         return True
2585  *     elif writer_type == 'float' and reader_type == 'double':
2586  */
2587   __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_writer_type, __pyx_n_s_long, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 78, __pyx_L1_error)
2588   if (__pyx_t_3) {
2589   } else {
2590     __pyx_t_1 = __pyx_t_3;
2591     goto __pyx_L15_bool_binop_done;
2592   }
2593   __Pyx_INCREF(__pyx_v_reader_type);
2594   __pyx_t_4 = __pyx_v_reader_type;
2595   __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_float, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 78, __pyx_L1_error)
2596   if (!__pyx_t_2) {
2597   } else {
2598     __pyx_t_3 = __pyx_t_2;
2599     goto __pyx_L17_bool_binop_done;
2600   }
2601   __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_double, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 78, __pyx_L1_error)
2602   __pyx_t_3 = __pyx_t_2;
2603   __pyx_L17_bool_binop_done:;
2604   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2605   __pyx_t_2 = (__pyx_t_3 != 0);
2606   __pyx_t_1 = __pyx_t_2;
2607   __pyx_L15_bool_binop_done:;
2608   if (__pyx_t_1) {
2609 
2610     /* "fastavro/_read.pyx":79
2611  *         return True
2612  *     elif writer_type == 'long' and reader_type in ['float', 'double']:
2613  *         return True             # <<<<<<<<<<<<<<
2614  *     elif writer_type == 'float' and reader_type == 'double':
2615  *         return True
2616  */
2617     __Pyx_XDECREF(__pyx_r);
2618     __Pyx_INCREF(Py_True);
2619     __pyx_r = Py_True;
2620     goto __pyx_L0;
2621 
2622     /* "fastavro/_read.pyx":78
2623  *     elif writer_type == 'int' and reader_type in ['long', 'float', 'double']:
2624  *         return True
2625  *     elif writer_type == 'long' and reader_type in ['float', 'double']:             # <<<<<<<<<<<<<<
2626  *         return True
2627  *     elif writer_type == 'float' and reader_type == 'double':
2628  */
2629   }
2630 
2631   /* "fastavro/_read.pyx":80
2632  *     elif writer_type == 'long' and reader_type in ['float', 'double']:
2633  *         return True
2634  *     elif writer_type == 'float' and reader_type == 'double':             # <<<<<<<<<<<<<<
2635  *         return True
2636  *     elif writer_type == 'string' and reader_type == 'bytes':
2637  */
2638   __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_writer_type, __pyx_n_s_float, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 80, __pyx_L1_error)
2639   if (__pyx_t_2) {
2640   } else {
2641     __pyx_t_1 = __pyx_t_2;
2642     goto __pyx_L19_bool_binop_done;
2643   }
2644   __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_reader_type, __pyx_n_s_double, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 80, __pyx_L1_error)
2645   __pyx_t_1 = __pyx_t_2;
2646   __pyx_L19_bool_binop_done:;
2647   if (__pyx_t_1) {
2648 
2649     /* "fastavro/_read.pyx":81
2650  *         return True
2651  *     elif writer_type == 'float' and reader_type == 'double':
2652  *         return True             # <<<<<<<<<<<<<<
2653  *     elif writer_type == 'string' and reader_type == 'bytes':
2654  *         return True
2655  */
2656     __Pyx_XDECREF(__pyx_r);
2657     __Pyx_INCREF(Py_True);
2658     __pyx_r = Py_True;
2659     goto __pyx_L0;
2660 
2661     /* "fastavro/_read.pyx":80
2662  *     elif writer_type == 'long' and reader_type in ['float', 'double']:
2663  *         return True
2664  *     elif writer_type == 'float' and reader_type == 'double':             # <<<<<<<<<<<<<<
2665  *         return True
2666  *     elif writer_type == 'string' and reader_type == 'bytes':
2667  */
2668   }
2669 
2670   /* "fastavro/_read.pyx":82
2671  *     elif writer_type == 'float' and reader_type == 'double':
2672  *         return True
2673  *     elif writer_type == 'string' and reader_type == 'bytes':             # <<<<<<<<<<<<<<
2674  *         return True
2675  *     elif writer_type == 'bytes' and reader_type == 'string':
2676  */
2677   __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_writer_type, __pyx_n_s_string, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 82, __pyx_L1_error)
2678   if (__pyx_t_2) {
2679   } else {
2680     __pyx_t_1 = __pyx_t_2;
2681     goto __pyx_L21_bool_binop_done;
2682   }
2683   __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_reader_type, __pyx_n_s_bytes, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 82, __pyx_L1_error)
2684   __pyx_t_1 = __pyx_t_2;
2685   __pyx_L21_bool_binop_done:;
2686   if (__pyx_t_1) {
2687 
2688     /* "fastavro/_read.pyx":83
2689  *         return True
2690  *     elif writer_type == 'string' and reader_type == 'bytes':
2691  *         return True             # <<<<<<<<<<<<<<
2692  *     elif writer_type == 'bytes' and reader_type == 'string':
2693  *         return True
2694  */
2695     __Pyx_XDECREF(__pyx_r);
2696     __Pyx_INCREF(Py_True);
2697     __pyx_r = Py_True;
2698     goto __pyx_L0;
2699 
2700     /* "fastavro/_read.pyx":82
2701  *     elif writer_type == 'float' and reader_type == 'double':
2702  *         return True
2703  *     elif writer_type == 'string' and reader_type == 'bytes':             # <<<<<<<<<<<<<<
2704  *         return True
2705  *     elif writer_type == 'bytes' and reader_type == 'string':
2706  */
2707   }
2708 
2709   /* "fastavro/_read.pyx":84
2710  *     elif writer_type == 'string' and reader_type == 'bytes':
2711  *         return True
2712  *     elif writer_type == 'bytes' and reader_type == 'string':             # <<<<<<<<<<<<<<
2713  *         return True
2714  *     return False
2715  */
2716   __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_writer_type, __pyx_n_s_bytes, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 84, __pyx_L1_error)
2717   if (__pyx_t_2) {
2718   } else {
2719     __pyx_t_1 = __pyx_t_2;
2720     goto __pyx_L23_bool_binop_done;
2721   }
2722   __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_reader_type, __pyx_n_s_string, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 84, __pyx_L1_error)
2723   __pyx_t_1 = __pyx_t_2;
2724   __pyx_L23_bool_binop_done:;
2725   if (__pyx_t_1) {
2726 
2727     /* "fastavro/_read.pyx":85
2728  *         return True
2729  *     elif writer_type == 'bytes' and reader_type == 'string':
2730  *         return True             # <<<<<<<<<<<<<<
2731  *     return False
2732  *
2733  */
2734     __Pyx_XDECREF(__pyx_r);
2735     __Pyx_INCREF(Py_True);
2736     __pyx_r = Py_True;
2737     goto __pyx_L0;
2738 
2739     /* "fastavro/_read.pyx":84
2740  *     elif writer_type == 'string' and reader_type == 'bytes':
2741  *         return True
2742  *     elif writer_type == 'bytes' and reader_type == 'string':             # <<<<<<<<<<<<<<
2743  *         return True
2744  *     return False
2745  */
2746   }
2747 
2748   /* "fastavro/_read.pyx":86
2749  *     elif writer_type == 'bytes' and reader_type == 'string':
2750  *         return True
2751  *     return False             # <<<<<<<<<<<<<<
2752  *
2753  *
2754  */
2755   __Pyx_XDECREF(__pyx_r);
2756   __Pyx_INCREF(Py_False);
2757   __pyx_r = Py_False;
2758   goto __pyx_L0;
2759 
2760   /* "fastavro/_read.pyx":68
2761  *
2762  *
2763  * cpdef match_types(writer_type, reader_type):             # <<<<<<<<<<<<<<
2764  *     if isinstance(writer_type, list) or isinstance(reader_type, list):
2765  *         return True
2766  */
2767 
2768   /* function exit code */
2769   __pyx_L1_error:;
2770   __Pyx_XDECREF(__pyx_t_4);
2771   __Pyx_AddTraceback("fastavro._read.match_types", __pyx_clineno, __pyx_lineno, __pyx_filename);
2772   __pyx_r = 0;
2773   __pyx_L0:;
2774   __Pyx_XGIVEREF(__pyx_r);
2775   __Pyx_RefNannyFinishContext();
2776   return __pyx_r;
2777 }
2778 
2779 /* Python wrapper */
2780 static PyObject *__pyx_pw_8fastavro_5_read_1match_types(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_8fastavro_5_read_1match_types(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)2781 static PyObject *__pyx_pw_8fastavro_5_read_1match_types(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2782   PyObject *__pyx_v_writer_type = 0;
2783   PyObject *__pyx_v_reader_type = 0;
2784   int __pyx_lineno = 0;
2785   const char *__pyx_filename = NULL;
2786   int __pyx_clineno = 0;
2787   PyObject *__pyx_r = 0;
2788   __Pyx_RefNannyDeclarations
2789   __Pyx_RefNannySetupContext("match_types (wrapper)", 0);
2790   {
2791     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_writer_type,&__pyx_n_s_reader_type,0};
2792     PyObject* values[2] = {0,0};
2793     if (unlikely(__pyx_kwds)) {
2794       Py_ssize_t kw_args;
2795       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2796       switch (pos_args) {
2797         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2798         CYTHON_FALLTHROUGH;
2799         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2800         CYTHON_FALLTHROUGH;
2801         case  0: break;
2802         default: goto __pyx_L5_argtuple_error;
2803       }
2804       kw_args = PyDict_Size(__pyx_kwds);
2805       switch (pos_args) {
2806         case  0:
2807         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_writer_type)) != 0)) kw_args--;
2808         else goto __pyx_L5_argtuple_error;
2809         CYTHON_FALLTHROUGH;
2810         case  1:
2811         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_reader_type)) != 0)) kw_args--;
2812         else {
2813           __Pyx_RaiseArgtupleInvalid("match_types", 1, 2, 2, 1); __PYX_ERR(0, 68, __pyx_L3_error)
2814         }
2815       }
2816       if (unlikely(kw_args > 0)) {
2817         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "match_types") < 0)) __PYX_ERR(0, 68, __pyx_L3_error)
2818       }
2819     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
2820       goto __pyx_L5_argtuple_error;
2821     } else {
2822       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2823       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2824     }
2825     __pyx_v_writer_type = values[0];
2826     __pyx_v_reader_type = values[1];
2827   }
2828   goto __pyx_L4_argument_unpacking_done;
2829   __pyx_L5_argtuple_error:;
2830   __Pyx_RaiseArgtupleInvalid("match_types", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 68, __pyx_L3_error)
2831   __pyx_L3_error:;
2832   __Pyx_AddTraceback("fastavro._read.match_types", __pyx_clineno, __pyx_lineno, __pyx_filename);
2833   __Pyx_RefNannyFinishContext();
2834   return NULL;
2835   __pyx_L4_argument_unpacking_done:;
2836   __pyx_r = __pyx_pf_8fastavro_5_read_match_types(__pyx_self, __pyx_v_writer_type, __pyx_v_reader_type);
2837 
2838   /* function exit code */
2839   __Pyx_RefNannyFinishContext();
2840   return __pyx_r;
2841 }
2842 
__pyx_pf_8fastavro_5_read_match_types(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_writer_type,PyObject * __pyx_v_reader_type)2843 static PyObject *__pyx_pf_8fastavro_5_read_match_types(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_writer_type, PyObject *__pyx_v_reader_type) {
2844   PyObject *__pyx_r = NULL;
2845   __Pyx_RefNannyDeclarations
2846   PyObject *__pyx_t_1 = NULL;
2847   int __pyx_lineno = 0;
2848   const char *__pyx_filename = NULL;
2849   int __pyx_clineno = 0;
2850   __Pyx_RefNannySetupContext("match_types", 0);
2851   __Pyx_XDECREF(__pyx_r);
2852   __pyx_t_1 = __pyx_f_8fastavro_5_read_match_types(__pyx_v_writer_type, __pyx_v_reader_type, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error)
2853   __Pyx_GOTREF(__pyx_t_1);
2854   __pyx_r = __pyx_t_1;
2855   __pyx_t_1 = 0;
2856   goto __pyx_L0;
2857 
2858   /* function exit code */
2859   __pyx_L1_error:;
2860   __Pyx_XDECREF(__pyx_t_1);
2861   __Pyx_AddTraceback("fastavro._read.match_types", __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/_read.pyx":89
2870  *
2871  *
2872  * cpdef match_schemas(w_schema, r_schema):             # <<<<<<<<<<<<<<
2873  *     error_msg = 'Schema mismatch: %s is not %s' % (w_schema, r_schema)
2874  *     if isinstance(w_schema, list):
2875  */
2876 
2877 static PyObject *__pyx_pw_8fastavro_5_read_3match_schemas(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_f_8fastavro_5_read_match_schemas(PyObject * __pyx_v_w_schema,PyObject * __pyx_v_r_schema,CYTHON_UNUSED int __pyx_skip_dispatch)2878 static PyObject *__pyx_f_8fastavro_5_read_match_schemas(PyObject *__pyx_v_w_schema, PyObject *__pyx_v_r_schema, CYTHON_UNUSED int __pyx_skip_dispatch) {
2879   PyObject *__pyx_v_error_msg = NULL;
2880   PyObject *__pyx_v_schema = NULL;
2881   PyObject *__pyx_v_w_type = NULL;
2882   PyObject *__pyx_v_r_type = NULL;
2883   PyObject *__pyx_r = NULL;
2884   __Pyx_RefNannyDeclarations
2885   PyObject *__pyx_t_1 = NULL;
2886   PyObject *__pyx_t_2 = NULL;
2887   int __pyx_t_3;
2888   int __pyx_t_4;
2889   Py_ssize_t __pyx_t_5;
2890   PyObject *(*__pyx_t_6)(PyObject *);
2891   PyObject *__pyx_t_7 = NULL;
2892   PyObject *__pyx_t_8 = NULL;
2893   PyObject *__pyx_t_9 = NULL;
2894   PyObject *__pyx_t_10 = NULL;
2895   PyObject *__pyx_t_11 = NULL;
2896   PyObject *__pyx_t_12 = NULL;
2897   int __pyx_t_13;
2898   int __pyx_lineno = 0;
2899   const char *__pyx_filename = NULL;
2900   int __pyx_clineno = 0;
2901   __Pyx_RefNannySetupContext("match_schemas", 0);
2902 
2903   /* "fastavro/_read.pyx":90
2904  *
2905  * cpdef match_schemas(w_schema, r_schema):
2906  *     error_msg = 'Schema mismatch: %s is not %s' % (w_schema, r_schema)             # <<<<<<<<<<<<<<
2907  *     if isinstance(w_schema, list):
2908  *         # If the writer is a union, checks will happen in read_union after the
2909  */
2910   __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error)
2911   __Pyx_GOTREF(__pyx_t_1);
2912   __Pyx_INCREF(__pyx_v_w_schema);
2913   __Pyx_GIVEREF(__pyx_v_w_schema);
2914   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_w_schema);
2915   __Pyx_INCREF(__pyx_v_r_schema);
2916   __Pyx_GIVEREF(__pyx_v_r_schema);
2917   PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_r_schema);
2918   __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Schema_mismatch_s_is_not_s, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error)
2919   __Pyx_GOTREF(__pyx_t_2);
2920   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2921   __pyx_v_error_msg = ((PyObject*)__pyx_t_2);
2922   __pyx_t_2 = 0;
2923 
2924   /* "fastavro/_read.pyx":91
2925  * cpdef match_schemas(w_schema, r_schema):
2926  *     error_msg = 'Schema mismatch: %s is not %s' % (w_schema, r_schema)
2927  *     if isinstance(w_schema, list):             # <<<<<<<<<<<<<<
2928  *         # If the writer is a union, checks will happen in read_union after the
2929  *         # correct schema is known
2930  */
2931   __pyx_t_3 = PyList_Check(__pyx_v_w_schema);
2932   __pyx_t_4 = (__pyx_t_3 != 0);
2933   if (__pyx_t_4) {
2934 
2935     /* "fastavro/_read.pyx":94
2936  *         # If the writer is a union, checks will happen in read_union after the
2937  *         # correct schema is known
2938  *         return r_schema             # <<<<<<<<<<<<<<
2939  *     elif isinstance(r_schema, list):
2940  *         # If the reader is a union, ensure one of the new schemas is the same
2941  */
2942     __Pyx_XDECREF(__pyx_r);
2943     __Pyx_INCREF(__pyx_v_r_schema);
2944     __pyx_r = __pyx_v_r_schema;
2945     goto __pyx_L0;
2946 
2947     /* "fastavro/_read.pyx":91
2948  * cpdef match_schemas(w_schema, r_schema):
2949  *     error_msg = 'Schema mismatch: %s is not %s' % (w_schema, r_schema)
2950  *     if isinstance(w_schema, list):             # <<<<<<<<<<<<<<
2951  *         # If the writer is a union, checks will happen in read_union after the
2952  *         # correct schema is known
2953  */
2954   }
2955 
2956   /* "fastavro/_read.pyx":95
2957  *         # correct schema is known
2958  *         return r_schema
2959  *     elif isinstance(r_schema, list):             # <<<<<<<<<<<<<<
2960  *         # If the reader is a union, ensure one of the new schemas is the same
2961  *         # as the writer
2962  */
2963   __pyx_t_4 = PyList_Check(__pyx_v_r_schema);
2964   __pyx_t_3 = (__pyx_t_4 != 0);
2965   if (__pyx_t_3) {
2966 
2967     /* "fastavro/_read.pyx":98
2968  *         # If the reader is a union, ensure one of the new schemas is the same
2969  *         # as the writer
2970  *         for schema in r_schema:             # <<<<<<<<<<<<<<
2971  *             try:
2972  *                 if match_types(w_schema, schema):
2973  */
2974     if (likely(PyList_CheckExact(__pyx_v_r_schema)) || PyTuple_CheckExact(__pyx_v_r_schema)) {
2975       __pyx_t_2 = __pyx_v_r_schema; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
2976       __pyx_t_6 = NULL;
2977     } else {
2978       __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_r_schema); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error)
2979       __Pyx_GOTREF(__pyx_t_2);
2980       __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 98, __pyx_L1_error)
2981     }
2982     for (;;) {
2983       if (likely(!__pyx_t_6)) {
2984         if (likely(PyList_CheckExact(__pyx_t_2))) {
2985           if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
2986           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
2987           __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 98, __pyx_L1_error)
2988           #else
2989           __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error)
2990           __Pyx_GOTREF(__pyx_t_1);
2991           #endif
2992         } else {
2993           if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
2994           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
2995           __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 98, __pyx_L1_error)
2996           #else
2997           __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error)
2998           __Pyx_GOTREF(__pyx_t_1);
2999           #endif
3000         }
3001       } else {
3002         __pyx_t_1 = __pyx_t_6(__pyx_t_2);
3003         if (unlikely(!__pyx_t_1)) {
3004           PyObject* exc_type = PyErr_Occurred();
3005           if (exc_type) {
3006             if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
3007             else __PYX_ERR(0, 98, __pyx_L1_error)
3008           }
3009           break;
3010         }
3011         __Pyx_GOTREF(__pyx_t_1);
3012       }
3013       __Pyx_XDECREF_SET(__pyx_v_schema, __pyx_t_1);
3014       __pyx_t_1 = 0;
3015 
3016       /* "fastavro/_read.pyx":99
3017  *         # as the writer
3018  *         for schema in r_schema:
3019  *             try:             # <<<<<<<<<<<<<<
3020  *                 if match_types(w_schema, schema):
3021  *                     return schema
3022  */
3023       {
3024         __Pyx_PyThreadState_declare
3025         __Pyx_PyThreadState_assign
3026         __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
3027         __Pyx_XGOTREF(__pyx_t_7);
3028         __Pyx_XGOTREF(__pyx_t_8);
3029         __Pyx_XGOTREF(__pyx_t_9);
3030         /*try:*/ {
3031 
3032           /* "fastavro/_read.pyx":100
3033  *         for schema in r_schema:
3034  *             try:
3035  *                 if match_types(w_schema, schema):             # <<<<<<<<<<<<<<
3036  *                     return schema
3037  *             except SchemaResolutionError:
3038  */
3039           __pyx_t_1 = __pyx_f_8fastavro_5_read_match_types(__pyx_v_w_schema, __pyx_v_schema, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L6_error)
3040           __Pyx_GOTREF(__pyx_t_1);
3041           __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 100, __pyx_L6_error)
3042           __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3043           if (__pyx_t_3) {
3044 
3045             /* "fastavro/_read.pyx":101
3046  *             try:
3047  *                 if match_types(w_schema, schema):
3048  *                     return schema             # <<<<<<<<<<<<<<
3049  *             except SchemaResolutionError:
3050  *                 # Try to match the next schema in the union
3051  */
3052             __Pyx_XDECREF(__pyx_r);
3053             __Pyx_INCREF(__pyx_v_schema);
3054             __pyx_r = __pyx_v_schema;
3055             __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3056             goto __pyx_L10_try_return;
3057 
3058             /* "fastavro/_read.pyx":100
3059  *         for schema in r_schema:
3060  *             try:
3061  *                 if match_types(w_schema, schema):             # <<<<<<<<<<<<<<
3062  *                     return schema
3063  *             except SchemaResolutionError:
3064  */
3065           }
3066 
3067           /* "fastavro/_read.pyx":99
3068  *         # as the writer
3069  *         for schema in r_schema:
3070  *             try:             # <<<<<<<<<<<<<<
3071  *                 if match_types(w_schema, schema):
3072  *                     return schema
3073  */
3074         }
3075         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3076         __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3077         __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
3078         goto __pyx_L13_try_end;
3079         __pyx_L6_error:;
3080         __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
3081 
3082         /* "fastavro/_read.pyx":102
3083  *                 if match_types(w_schema, schema):
3084  *                     return schema
3085  *             except SchemaResolutionError:             # <<<<<<<<<<<<<<
3086  *                 # Try to match the next schema in the union
3087  *                 pass
3088  */
3089         __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_10, &__pyx_t_11);
3090         __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_SchemaResolutionError); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 102, __pyx_L8_except_error)
3091         __Pyx_GOTREF(__pyx_t_12);
3092         __pyx_t_13 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_12);
3093         __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3094         __Pyx_ErrRestore(__pyx_t_1, __pyx_t_10, __pyx_t_11);
3095         __pyx_t_1 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
3096         if (__pyx_t_13) {
3097           __Pyx_ErrRestore(0,0,0);
3098           goto __pyx_L7_exception_handled;
3099         }
3100         goto __pyx_L8_except_error;
3101         __pyx_L8_except_error:;
3102 
3103         /* "fastavro/_read.pyx":99
3104  *         # as the writer
3105  *         for schema in r_schema:
3106  *             try:             # <<<<<<<<<<<<<<
3107  *                 if match_types(w_schema, schema):
3108  *                     return schema
3109  */
3110         __Pyx_XGIVEREF(__pyx_t_7);
3111         __Pyx_XGIVEREF(__pyx_t_8);
3112         __Pyx_XGIVEREF(__pyx_t_9);
3113         __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
3114         goto __pyx_L1_error;
3115         __pyx_L10_try_return:;
3116         __Pyx_XGIVEREF(__pyx_t_7);
3117         __Pyx_XGIVEREF(__pyx_t_8);
3118         __Pyx_XGIVEREF(__pyx_t_9);
3119         __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
3120         goto __pyx_L0;
3121         __pyx_L7_exception_handled:;
3122         __Pyx_XGIVEREF(__pyx_t_7);
3123         __Pyx_XGIVEREF(__pyx_t_8);
3124         __Pyx_XGIVEREF(__pyx_t_9);
3125         __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
3126         __pyx_L13_try_end:;
3127       }
3128 
3129       /* "fastavro/_read.pyx":98
3130  *         # If the reader is a union, ensure one of the new schemas is the same
3131  *         # as the writer
3132  *         for schema in r_schema:             # <<<<<<<<<<<<<<
3133  *             try:
3134  *                 if match_types(w_schema, schema):
3135  */
3136     }
3137     /*else*/ {
3138 
3139       /* "fastavro/_read.pyx":106
3140  *                 pass
3141  *         else:
3142  *             raise SchemaResolutionError(error_msg)             # <<<<<<<<<<<<<<
3143  *     else:
3144  *         # Check for dicts as primitive types are just strings
3145  */
3146       __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_SchemaResolutionError); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 106, __pyx_L1_error)
3147       __Pyx_GOTREF(__pyx_t_10);
3148       __pyx_t_1 = NULL;
3149       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
3150         __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_10);
3151         if (likely(__pyx_t_1)) {
3152           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
3153           __Pyx_INCREF(__pyx_t_1);
3154           __Pyx_INCREF(function);
3155           __Pyx_DECREF_SET(__pyx_t_10, function);
3156         }
3157       }
3158       __pyx_t_11 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_1, __pyx_v_error_msg) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_error_msg);
3159       __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
3160       if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 106, __pyx_L1_error)
3161       __Pyx_GOTREF(__pyx_t_11);
3162       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3163       __Pyx_Raise(__pyx_t_11, 0, 0, 0);
3164       __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3165       __PYX_ERR(0, 106, __pyx_L1_error)
3166     }
3167 
3168     /* "fastavro/_read.pyx":98
3169  *         # If the reader is a union, ensure one of the new schemas is the same
3170  *         # as the writer
3171  *         for schema in r_schema:             # <<<<<<<<<<<<<<
3172  *             try:
3173  *                 if match_types(w_schema, schema):
3174  */
3175     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3176 
3177     /* "fastavro/_read.pyx":95
3178  *         # correct schema is known
3179  *         return r_schema
3180  *     elif isinstance(r_schema, list):             # <<<<<<<<<<<<<<
3181  *         # If the reader is a union, ensure one of the new schemas is the same
3182  *         # as the writer
3183  */
3184   }
3185 
3186   /* "fastavro/_read.pyx":109
3187  *     else:
3188  *         # Check for dicts as primitive types are just strings
3189  *         if isinstance(w_schema, dict):             # <<<<<<<<<<<<<<
3190  *             w_type = w_schema['type']
3191  *         else:
3192  */
3193   /*else*/ {
3194     __pyx_t_3 = PyDict_Check(__pyx_v_w_schema);
3195     __pyx_t_4 = (__pyx_t_3 != 0);
3196     if (__pyx_t_4) {
3197 
3198       /* "fastavro/_read.pyx":110
3199  *         # Check for dicts as primitive types are just strings
3200  *         if isinstance(w_schema, dict):
3201  *             w_type = w_schema['type']             # <<<<<<<<<<<<<<
3202  *         else:
3203  *             w_type = w_schema
3204  */
3205       __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_w_schema, __pyx_n_s_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error)
3206       __Pyx_GOTREF(__pyx_t_2);
3207       __pyx_v_w_type = __pyx_t_2;
3208       __pyx_t_2 = 0;
3209 
3210       /* "fastavro/_read.pyx":109
3211  *     else:
3212  *         # Check for dicts as primitive types are just strings
3213  *         if isinstance(w_schema, dict):             # <<<<<<<<<<<<<<
3214  *             w_type = w_schema['type']
3215  *         else:
3216  */
3217       goto __pyx_L16;
3218     }
3219 
3220     /* "fastavro/_read.pyx":112
3221  *             w_type = w_schema['type']
3222  *         else:
3223  *             w_type = w_schema             # <<<<<<<<<<<<<<
3224  *         if isinstance(r_schema, dict):
3225  *             r_type = r_schema['type']
3226  */
3227     /*else*/ {
3228       __Pyx_INCREF(__pyx_v_w_schema);
3229       __pyx_v_w_type = __pyx_v_w_schema;
3230     }
3231     __pyx_L16:;
3232 
3233     /* "fastavro/_read.pyx":113
3234  *         else:
3235  *             w_type = w_schema
3236  *         if isinstance(r_schema, dict):             # <<<<<<<<<<<<<<
3237  *             r_type = r_schema['type']
3238  *         else:
3239  */
3240     __pyx_t_4 = PyDict_Check(__pyx_v_r_schema);
3241     __pyx_t_3 = (__pyx_t_4 != 0);
3242     if (__pyx_t_3) {
3243 
3244       /* "fastavro/_read.pyx":114
3245  *             w_type = w_schema
3246  *         if isinstance(r_schema, dict):
3247  *             r_type = r_schema['type']             # <<<<<<<<<<<<<<
3248  *         else:
3249  *             r_type = r_schema
3250  */
3251       __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_r_schema, __pyx_n_s_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error)
3252       __Pyx_GOTREF(__pyx_t_2);
3253       __pyx_v_r_type = __pyx_t_2;
3254       __pyx_t_2 = 0;
3255 
3256       /* "fastavro/_read.pyx":113
3257  *         else:
3258  *             w_type = w_schema
3259  *         if isinstance(r_schema, dict):             # <<<<<<<<<<<<<<
3260  *             r_type = r_schema['type']
3261  *         else:
3262  */
3263       goto __pyx_L17;
3264     }
3265 
3266     /* "fastavro/_read.pyx":116
3267  *             r_type = r_schema['type']
3268  *         else:
3269  *             r_type = r_schema             # <<<<<<<<<<<<<<
3270  *
3271  *         if w_type == r_type == 'map':
3272  */
3273     /*else*/ {
3274       __Pyx_INCREF(__pyx_v_r_schema);
3275       __pyx_v_r_type = __pyx_v_r_schema;
3276     }
3277     __pyx_L17:;
3278 
3279     /* "fastavro/_read.pyx":118
3280  *             r_type = r_schema
3281  *
3282  *         if w_type == r_type == 'map':             # <<<<<<<<<<<<<<
3283  *             if match_types(w_schema['values'], r_schema['values']):
3284  *                 return r_schema
3285  */
3286     __pyx_t_2 = PyObject_RichCompare(__pyx_v_w_type, __pyx_v_r_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L1_error)
3287     if (__Pyx_PyObject_IsTrue(__pyx_t_2)) {
3288       __Pyx_DECREF(__pyx_t_2);
3289       __pyx_t_2 = PyObject_RichCompare(__pyx_v_r_type, __pyx_n_s_map, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L1_error)
3290     }
3291     __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 118, __pyx_L1_error)
3292     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3293     if (__pyx_t_3) {
3294 
3295       /* "fastavro/_read.pyx":119
3296  *
3297  *         if w_type == r_type == 'map':
3298  *             if match_types(w_schema['values'], r_schema['values']):             # <<<<<<<<<<<<<<
3299  *                 return r_schema
3300  *         elif w_type == r_type == 'array':
3301  */
3302       __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_w_schema, __pyx_n_s_values); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error)
3303       __Pyx_GOTREF(__pyx_t_2);
3304       __pyx_t_11 = __Pyx_PyObject_Dict_GetItem(__pyx_v_r_schema, __pyx_n_s_values); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 119, __pyx_L1_error)
3305       __Pyx_GOTREF(__pyx_t_11);
3306       __pyx_t_10 = __pyx_f_8fastavro_5_read_match_types(__pyx_t_2, __pyx_t_11, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 119, __pyx_L1_error)
3307       __Pyx_GOTREF(__pyx_t_10);
3308       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3309       __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3310       __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 119, __pyx_L1_error)
3311       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3312       if (__pyx_t_3) {
3313 
3314         /* "fastavro/_read.pyx":120
3315  *         if w_type == r_type == 'map':
3316  *             if match_types(w_schema['values'], r_schema['values']):
3317  *                 return r_schema             # <<<<<<<<<<<<<<
3318  *         elif w_type == r_type == 'array':
3319  *             if match_types(w_schema['items'], r_schema['items']):
3320  */
3321         __Pyx_XDECREF(__pyx_r);
3322         __Pyx_INCREF(__pyx_v_r_schema);
3323         __pyx_r = __pyx_v_r_schema;
3324         goto __pyx_L0;
3325 
3326         /* "fastavro/_read.pyx":119
3327  *
3328  *         if w_type == r_type == 'map':
3329  *             if match_types(w_schema['values'], r_schema['values']):             # <<<<<<<<<<<<<<
3330  *                 return r_schema
3331  *         elif w_type == r_type == 'array':
3332  */
3333       }
3334 
3335       /* "fastavro/_read.pyx":118
3336  *             r_type = r_schema
3337  *
3338  *         if w_type == r_type == 'map':             # <<<<<<<<<<<<<<
3339  *             if match_types(w_schema['values'], r_schema['values']):
3340  *                 return r_schema
3341  */
3342       goto __pyx_L18;
3343     }
3344 
3345     /* "fastavro/_read.pyx":121
3346  *             if match_types(w_schema['values'], r_schema['values']):
3347  *                 return r_schema
3348  *         elif w_type == r_type == 'array':             # <<<<<<<<<<<<<<
3349  *             if match_types(w_schema['items'], r_schema['items']):
3350  *                 return r_schema
3351  */
3352     __pyx_t_10 = PyObject_RichCompare(__pyx_v_w_type, __pyx_v_r_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 121, __pyx_L1_error)
3353     if (__Pyx_PyObject_IsTrue(__pyx_t_10)) {
3354       __Pyx_DECREF(__pyx_t_10);
3355       __pyx_t_10 = PyObject_RichCompare(__pyx_v_r_type, __pyx_n_s_array, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 121, __pyx_L1_error)
3356     }
3357     __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 121, __pyx_L1_error)
3358     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3359     if (__pyx_t_3) {
3360 
3361       /* "fastavro/_read.pyx":122
3362  *                 return r_schema
3363  *         elif w_type == r_type == 'array':
3364  *             if match_types(w_schema['items'], r_schema['items']):             # <<<<<<<<<<<<<<
3365  *                 return r_schema
3366  *         elif match_types(w_type, r_type):
3367  */
3368       __pyx_t_10 = __Pyx_PyObject_Dict_GetItem(__pyx_v_w_schema, __pyx_n_s_items); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 122, __pyx_L1_error)
3369       __Pyx_GOTREF(__pyx_t_10);
3370       __pyx_t_11 = __Pyx_PyObject_Dict_GetItem(__pyx_v_r_schema, __pyx_n_s_items); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 122, __pyx_L1_error)
3371       __Pyx_GOTREF(__pyx_t_11);
3372       __pyx_t_2 = __pyx_f_8fastavro_5_read_match_types(__pyx_t_10, __pyx_t_11, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error)
3373       __Pyx_GOTREF(__pyx_t_2);
3374       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3375       __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3376       __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 122, __pyx_L1_error)
3377       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3378       if (__pyx_t_3) {
3379 
3380         /* "fastavro/_read.pyx":123
3381  *         elif w_type == r_type == 'array':
3382  *             if match_types(w_schema['items'], r_schema['items']):
3383  *                 return r_schema             # <<<<<<<<<<<<<<
3384  *         elif match_types(w_type, r_type):
3385  *             return r_schema
3386  */
3387         __Pyx_XDECREF(__pyx_r);
3388         __Pyx_INCREF(__pyx_v_r_schema);
3389         __pyx_r = __pyx_v_r_schema;
3390         goto __pyx_L0;
3391 
3392         /* "fastavro/_read.pyx":122
3393  *                 return r_schema
3394  *         elif w_type == r_type == 'array':
3395  *             if match_types(w_schema['items'], r_schema['items']):             # <<<<<<<<<<<<<<
3396  *                 return r_schema
3397  *         elif match_types(w_type, r_type):
3398  */
3399       }
3400 
3401       /* "fastavro/_read.pyx":121
3402  *             if match_types(w_schema['values'], r_schema['values']):
3403  *                 return r_schema
3404  *         elif w_type == r_type == 'array':             # <<<<<<<<<<<<<<
3405  *             if match_types(w_schema['items'], r_schema['items']):
3406  *                 return r_schema
3407  */
3408       goto __pyx_L18;
3409     }
3410 
3411     /* "fastavro/_read.pyx":124
3412  *             if match_types(w_schema['items'], r_schema['items']):
3413  *                 return r_schema
3414  *         elif match_types(w_type, r_type):             # <<<<<<<<<<<<<<
3415  *             return r_schema
3416  *         raise SchemaResolutionError(error_msg)
3417  */
3418     __pyx_t_2 = __pyx_f_8fastavro_5_read_match_types(__pyx_v_w_type, __pyx_v_r_type, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error)
3419     __Pyx_GOTREF(__pyx_t_2);
3420     __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 124, __pyx_L1_error)
3421     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3422     if (__pyx_t_3) {
3423 
3424       /* "fastavro/_read.pyx":125
3425  *                 return r_schema
3426  *         elif match_types(w_type, r_type):
3427  *             return r_schema             # <<<<<<<<<<<<<<
3428  *         raise SchemaResolutionError(error_msg)
3429  *
3430  */
3431       __Pyx_XDECREF(__pyx_r);
3432       __Pyx_INCREF(__pyx_v_r_schema);
3433       __pyx_r = __pyx_v_r_schema;
3434       goto __pyx_L0;
3435 
3436       /* "fastavro/_read.pyx":124
3437  *             if match_types(w_schema['items'], r_schema['items']):
3438  *                 return r_schema
3439  *         elif match_types(w_type, r_type):             # <<<<<<<<<<<<<<
3440  *             return r_schema
3441  *         raise SchemaResolutionError(error_msg)
3442  */
3443     }
3444     __pyx_L18:;
3445 
3446     /* "fastavro/_read.pyx":126
3447  *         elif match_types(w_type, r_type):
3448  *             return r_schema
3449  *         raise SchemaResolutionError(error_msg)             # <<<<<<<<<<<<<<
3450  *
3451  *
3452  */
3453     __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_SchemaResolutionError); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 126, __pyx_L1_error)
3454     __Pyx_GOTREF(__pyx_t_11);
3455     __pyx_t_10 = NULL;
3456     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
3457       __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11);
3458       if (likely(__pyx_t_10)) {
3459         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
3460         __Pyx_INCREF(__pyx_t_10);
3461         __Pyx_INCREF(function);
3462         __Pyx_DECREF_SET(__pyx_t_11, function);
3463       }
3464     }
3465     __pyx_t_2 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_10, __pyx_v_error_msg) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_v_error_msg);
3466     __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3467     if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
3468     __Pyx_GOTREF(__pyx_t_2);
3469     __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3470     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
3471     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3472     __PYX_ERR(0, 126, __pyx_L1_error)
3473   }
3474 
3475   /* "fastavro/_read.pyx":89
3476  *
3477  *
3478  * cpdef match_schemas(w_schema, r_schema):             # <<<<<<<<<<<<<<
3479  *     error_msg = 'Schema mismatch: %s is not %s' % (w_schema, r_schema)
3480  *     if isinstance(w_schema, list):
3481  */
3482 
3483   /* function exit code */
3484   __pyx_L1_error:;
3485   __Pyx_XDECREF(__pyx_t_1);
3486   __Pyx_XDECREF(__pyx_t_2);
3487   __Pyx_XDECREF(__pyx_t_10);
3488   __Pyx_XDECREF(__pyx_t_11);
3489   __Pyx_XDECREF(__pyx_t_12);
3490   __Pyx_AddTraceback("fastavro._read.match_schemas", __pyx_clineno, __pyx_lineno, __pyx_filename);
3491   __pyx_r = 0;
3492   __pyx_L0:;
3493   __Pyx_XDECREF(__pyx_v_error_msg);
3494   __Pyx_XDECREF(__pyx_v_schema);
3495   __Pyx_XDECREF(__pyx_v_w_type);
3496   __Pyx_XDECREF(__pyx_v_r_type);
3497   __Pyx_XGIVEREF(__pyx_r);
3498   __Pyx_RefNannyFinishContext();
3499   return __pyx_r;
3500 }
3501 
3502 /* Python wrapper */
3503 static PyObject *__pyx_pw_8fastavro_5_read_3match_schemas(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_8fastavro_5_read_3match_schemas(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)3504 static PyObject *__pyx_pw_8fastavro_5_read_3match_schemas(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3505   PyObject *__pyx_v_w_schema = 0;
3506   PyObject *__pyx_v_r_schema = 0;
3507   int __pyx_lineno = 0;
3508   const char *__pyx_filename = NULL;
3509   int __pyx_clineno = 0;
3510   PyObject *__pyx_r = 0;
3511   __Pyx_RefNannyDeclarations
3512   __Pyx_RefNannySetupContext("match_schemas (wrapper)", 0);
3513   {
3514     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_w_schema,&__pyx_n_s_r_schema,0};
3515     PyObject* values[2] = {0,0};
3516     if (unlikely(__pyx_kwds)) {
3517       Py_ssize_t kw_args;
3518       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3519       switch (pos_args) {
3520         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3521         CYTHON_FALLTHROUGH;
3522         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3523         CYTHON_FALLTHROUGH;
3524         case  0: break;
3525         default: goto __pyx_L5_argtuple_error;
3526       }
3527       kw_args = PyDict_Size(__pyx_kwds);
3528       switch (pos_args) {
3529         case  0:
3530         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w_schema)) != 0)) kw_args--;
3531         else goto __pyx_L5_argtuple_error;
3532         CYTHON_FALLTHROUGH;
3533         case  1:
3534         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_r_schema)) != 0)) kw_args--;
3535         else {
3536           __Pyx_RaiseArgtupleInvalid("match_schemas", 1, 2, 2, 1); __PYX_ERR(0, 89, __pyx_L3_error)
3537         }
3538       }
3539       if (unlikely(kw_args > 0)) {
3540         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "match_schemas") < 0)) __PYX_ERR(0, 89, __pyx_L3_error)
3541       }
3542     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
3543       goto __pyx_L5_argtuple_error;
3544     } else {
3545       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3546       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3547     }
3548     __pyx_v_w_schema = values[0];
3549     __pyx_v_r_schema = values[1];
3550   }
3551   goto __pyx_L4_argument_unpacking_done;
3552   __pyx_L5_argtuple_error:;
3553   __Pyx_RaiseArgtupleInvalid("match_schemas", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 89, __pyx_L3_error)
3554   __pyx_L3_error:;
3555   __Pyx_AddTraceback("fastavro._read.match_schemas", __pyx_clineno, __pyx_lineno, __pyx_filename);
3556   __Pyx_RefNannyFinishContext();
3557   return NULL;
3558   __pyx_L4_argument_unpacking_done:;
3559   __pyx_r = __pyx_pf_8fastavro_5_read_2match_schemas(__pyx_self, __pyx_v_w_schema, __pyx_v_r_schema);
3560 
3561   /* function exit code */
3562   __Pyx_RefNannyFinishContext();
3563   return __pyx_r;
3564 }
3565 
__pyx_pf_8fastavro_5_read_2match_schemas(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_w_schema,PyObject * __pyx_v_r_schema)3566 static PyObject *__pyx_pf_8fastavro_5_read_2match_schemas(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_w_schema, PyObject *__pyx_v_r_schema) {
3567   PyObject *__pyx_r = NULL;
3568   __Pyx_RefNannyDeclarations
3569   PyObject *__pyx_t_1 = NULL;
3570   int __pyx_lineno = 0;
3571   const char *__pyx_filename = NULL;
3572   int __pyx_clineno = 0;
3573   __Pyx_RefNannySetupContext("match_schemas", 0);
3574   __Pyx_XDECREF(__pyx_r);
3575   __pyx_t_1 = __pyx_f_8fastavro_5_read_match_schemas(__pyx_v_w_schema, __pyx_v_r_schema, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error)
3576   __Pyx_GOTREF(__pyx_t_1);
3577   __pyx_r = __pyx_t_1;
3578   __pyx_t_1 = 0;
3579   goto __pyx_L0;
3580 
3581   /* function exit code */
3582   __pyx_L1_error:;
3583   __Pyx_XDECREF(__pyx_t_1);
3584   __Pyx_AddTraceback("fastavro._read.match_schemas", __pyx_clineno, __pyx_lineno, __pyx_filename);
3585   __pyx_r = NULL;
3586   __pyx_L0:;
3587   __Pyx_XGIVEREF(__pyx_r);
3588   __Pyx_RefNannyFinishContext();
3589   return __pyx_r;
3590 }
3591 
3592 /* "fastavro/_read.pyx":129
3593  *
3594  *
3595  * cdef inline read_null(fo):             # <<<<<<<<<<<<<<
3596  *     """null is written as zero bytes."""
3597  *     return None
3598  */
3599 
__pyx_f_8fastavro_5_read_read_null(CYTHON_UNUSED PyObject * __pyx_v_fo)3600 static CYTHON_INLINE PyObject *__pyx_f_8fastavro_5_read_read_null(CYTHON_UNUSED PyObject *__pyx_v_fo) {
3601   PyObject *__pyx_r = NULL;
3602   __Pyx_RefNannyDeclarations
3603   __Pyx_RefNannySetupContext("read_null", 0);
3604 
3605   /* "fastavro/_read.pyx":131
3606  * cdef inline read_null(fo):
3607  *     """null is written as zero bytes."""
3608  *     return None             # <<<<<<<<<<<<<<
3609  *
3610  *
3611  */
3612   __Pyx_XDECREF(__pyx_r);
3613   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3614   goto __pyx_L0;
3615 
3616   /* "fastavro/_read.pyx":129
3617  *
3618  *
3619  * cdef inline read_null(fo):             # <<<<<<<<<<<<<<
3620  *     """null is written as zero bytes."""
3621  *     return None
3622  */
3623 
3624   /* function exit code */
3625   __pyx_L0:;
3626   __Pyx_XGIVEREF(__pyx_r);
3627   __Pyx_RefNannyFinishContext();
3628   return __pyx_r;
3629 }
3630 
3631 /* "fastavro/_read.pyx":134
3632  *
3633  *
3634  * cdef inline read_boolean(fo):             # <<<<<<<<<<<<<<
3635  *     """A boolean is written as a single byte whose value is either 0 (false) or
3636  *     1 (true).
3637  */
3638 
__pyx_f_8fastavro_5_read_read_boolean(PyObject * __pyx_v_fo)3639 static CYTHON_INLINE PyObject *__pyx_f_8fastavro_5_read_read_boolean(PyObject *__pyx_v_fo) {
3640   unsigned char __pyx_v_ch_temp;
3641   PyObject *__pyx_v_bytes_temp = 0;
3642   PyObject *__pyx_r = NULL;
3643   __Pyx_RefNannyDeclarations
3644   PyObject *__pyx_t_1 = NULL;
3645   PyObject *__pyx_t_2 = NULL;
3646   PyObject *__pyx_t_3 = NULL;
3647   Py_ssize_t __pyx_t_4;
3648   int __pyx_t_5;
3649   char __pyx_t_6;
3650   int __pyx_lineno = 0;
3651   const char *__pyx_filename = NULL;
3652   int __pyx_clineno = 0;
3653   __Pyx_RefNannySetupContext("read_boolean", 0);
3654 
3655   /* "fastavro/_read.pyx":139
3656  *     """
3657  *     cdef unsigned char ch_temp
3658  *     cdef bytes bytes_temp = fo.read(1)             # <<<<<<<<<<<<<<
3659  *     if len(bytes_temp) == 1:
3660  *         # technically 0x01 == true and 0x00 == false, but many languages will
3661  */
3662   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_fo, __pyx_n_s_read); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error)
3663   __Pyx_GOTREF(__pyx_t_2);
3664   __pyx_t_3 = NULL;
3665   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
3666     __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
3667     if (likely(__pyx_t_3)) {
3668       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3669       __Pyx_INCREF(__pyx_t_3);
3670       __Pyx_INCREF(function);
3671       __Pyx_DECREF_SET(__pyx_t_2, function);
3672     }
3673   }
3674   __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_int_1);
3675   __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3676   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error)
3677   __Pyx_GOTREF(__pyx_t_1);
3678   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3679   if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 139, __pyx_L1_error)
3680   __pyx_v_bytes_temp = ((PyObject*)__pyx_t_1);
3681   __pyx_t_1 = 0;
3682 
3683   /* "fastavro/_read.pyx":140
3684  *     cdef unsigned char ch_temp
3685  *     cdef bytes bytes_temp = fo.read(1)
3686  *     if len(bytes_temp) == 1:             # <<<<<<<<<<<<<<
3687  *         # technically 0x01 == true and 0x00 == false, but many languages will
3688  *         # cast anything other than 0 to True and only 0 to False
3689  */
3690   if (unlikely(__pyx_v_bytes_temp == Py_None)) {
3691     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
3692     __PYX_ERR(0, 140, __pyx_L1_error)
3693   }
3694   __pyx_t_4 = PyBytes_GET_SIZE(__pyx_v_bytes_temp); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 140, __pyx_L1_error)
3695   __pyx_t_5 = ((__pyx_t_4 == 1) != 0);
3696   if (likely(__pyx_t_5)) {
3697 
3698     /* "fastavro/_read.pyx":143
3699  *         # technically 0x01 == true and 0x00 == false, but many languages will
3700  *         # cast anything other than 0 to True and only 0 to False
3701  *         ch_temp = bytes_temp[0]             # <<<<<<<<<<<<<<
3702  *         return ch_temp != 0
3703  *     else:
3704  */
3705     if (unlikely(__pyx_v_bytes_temp == Py_None)) {
3706       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
3707       __PYX_ERR(0, 143, __pyx_L1_error)
3708     }
3709     __pyx_t_6 = __Pyx_PyBytes_GetItemInt(__pyx_v_bytes_temp, 0, 1); if (unlikely(__pyx_t_6 == ((char)((char)-1)) && PyErr_Occurred())) __PYX_ERR(0, 143, __pyx_L1_error)
3710     __pyx_v_ch_temp = __pyx_t_6;
3711 
3712     /* "fastavro/_read.pyx":144
3713  *         # cast anything other than 0 to True and only 0 to False
3714  *         ch_temp = bytes_temp[0]
3715  *         return ch_temp != 0             # <<<<<<<<<<<<<<
3716  *     else:
3717  *         raise ReadError
3718  */
3719     __Pyx_XDECREF(__pyx_r);
3720     __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_ch_temp != 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error)
3721     __Pyx_GOTREF(__pyx_t_1);
3722     __pyx_r = __pyx_t_1;
3723     __pyx_t_1 = 0;
3724     goto __pyx_L0;
3725 
3726     /* "fastavro/_read.pyx":140
3727  *     cdef unsigned char ch_temp
3728  *     cdef bytes bytes_temp = fo.read(1)
3729  *     if len(bytes_temp) == 1:             # <<<<<<<<<<<<<<
3730  *         # technically 0x01 == true and 0x00 == false, but many languages will
3731  *         # cast anything other than 0 to True and only 0 to False
3732  */
3733   }
3734 
3735   /* "fastavro/_read.pyx":146
3736  *         return ch_temp != 0
3737  *     else:
3738  *         raise ReadError             # <<<<<<<<<<<<<<
3739  *
3740  *
3741  */
3742   /*else*/ {
3743     __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ReadError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error)
3744     __Pyx_GOTREF(__pyx_t_1);
3745     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3746     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3747     __PYX_ERR(0, 146, __pyx_L1_error)
3748   }
3749 
3750   /* "fastavro/_read.pyx":134
3751  *
3752  *
3753  * cdef inline read_boolean(fo):             # <<<<<<<<<<<<<<
3754  *     """A boolean is written as a single byte whose value is either 0 (false) or
3755  *     1 (true).
3756  */
3757 
3758   /* function exit code */
3759   __pyx_L1_error:;
3760   __Pyx_XDECREF(__pyx_t_1);
3761   __Pyx_XDECREF(__pyx_t_2);
3762   __Pyx_XDECREF(__pyx_t_3);
3763   __Pyx_AddTraceback("fastavro._read.read_boolean", __pyx_clineno, __pyx_lineno, __pyx_filename);
3764   __pyx_r = 0;
3765   __pyx_L0:;
3766   __Pyx_XDECREF(__pyx_v_bytes_temp);
3767   __Pyx_XGIVEREF(__pyx_r);
3768   __Pyx_RefNannyFinishContext();
3769   return __pyx_r;
3770 }
3771 
3772 /* "fastavro/_read.pyx":149
3773  *
3774  *
3775  * cpdef read_timestamp_millis(data, writer_schema=None, reader_schema=None):             # <<<<<<<<<<<<<<
3776  *     return epoch + datetime.timedelta(microseconds=data * MLS_PER_SECOND)
3777  *
3778  */
3779 
3780 static PyObject *__pyx_pw_8fastavro_5_read_5read_timestamp_millis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_f_8fastavro_5_read_read_timestamp_millis(PyObject * __pyx_v_data,CYTHON_UNUSED int __pyx_skip_dispatch,struct __pyx_opt_args_8fastavro_5_read_read_timestamp_millis * __pyx_optional_args)3781 static PyObject *__pyx_f_8fastavro_5_read_read_timestamp_millis(PyObject *__pyx_v_data, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8fastavro_5_read_read_timestamp_millis *__pyx_optional_args) {
3782   PyObject *__pyx_r = NULL;
3783   __Pyx_RefNannyDeclarations
3784   PyObject *__pyx_t_1 = NULL;
3785   PyObject *__pyx_t_2 = NULL;
3786   PyObject *__pyx_t_3 = NULL;
3787   PyObject *__pyx_t_4 = NULL;
3788   PyObject *__pyx_t_5 = NULL;
3789   int __pyx_lineno = 0;
3790   const char *__pyx_filename = NULL;
3791   int __pyx_clineno = 0;
3792   __Pyx_RefNannySetupContext("read_timestamp_millis", 0);
3793   if (__pyx_optional_args) {
3794   }
3795 
3796   /* "fastavro/_read.pyx":150
3797  *
3798  * cpdef read_timestamp_millis(data, writer_schema=None, reader_schema=None):
3799  *     return epoch + datetime.timedelta(microseconds=data * MLS_PER_SECOND)             # <<<<<<<<<<<<<<
3800  *
3801  *
3802  */
3803   __Pyx_XDECREF(__pyx_r);
3804   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_epoch); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 150, __pyx_L1_error)
3805   __Pyx_GOTREF(__pyx_t_1);
3806   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 150, __pyx_L1_error)
3807   __Pyx_GOTREF(__pyx_t_2);
3808   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 150, __pyx_L1_error)
3809   __Pyx_GOTREF(__pyx_t_3);
3810   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3811   __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 150, __pyx_L1_error)
3812   __Pyx_GOTREF(__pyx_t_2);
3813   __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_MLS_PER_SECOND); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 150, __pyx_L1_error)
3814   __Pyx_GOTREF(__pyx_t_4);
3815   __pyx_t_5 = PyNumber_Multiply(__pyx_v_data, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 150, __pyx_L1_error)
3816   __Pyx_GOTREF(__pyx_t_5);
3817   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3818   if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_microseconds, __pyx_t_5) < 0) __PYX_ERR(0, 150, __pyx_L1_error)
3819   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3820   __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 150, __pyx_L1_error)
3821   __Pyx_GOTREF(__pyx_t_5);
3822   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3823   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3824   __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 150, __pyx_L1_error)
3825   __Pyx_GOTREF(__pyx_t_2);
3826   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3827   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3828   __pyx_r = __pyx_t_2;
3829   __pyx_t_2 = 0;
3830   goto __pyx_L0;
3831 
3832   /* "fastavro/_read.pyx":149
3833  *
3834  *
3835  * cpdef read_timestamp_millis(data, writer_schema=None, reader_schema=None):             # <<<<<<<<<<<<<<
3836  *     return epoch + datetime.timedelta(microseconds=data * MLS_PER_SECOND)
3837  *
3838  */
3839 
3840   /* function exit code */
3841   __pyx_L1_error:;
3842   __Pyx_XDECREF(__pyx_t_1);
3843   __Pyx_XDECREF(__pyx_t_2);
3844   __Pyx_XDECREF(__pyx_t_3);
3845   __Pyx_XDECREF(__pyx_t_4);
3846   __Pyx_XDECREF(__pyx_t_5);
3847   __Pyx_AddTraceback("fastavro._read.read_timestamp_millis", __pyx_clineno, __pyx_lineno, __pyx_filename);
3848   __pyx_r = 0;
3849   __pyx_L0:;
3850   __Pyx_XGIVEREF(__pyx_r);
3851   __Pyx_RefNannyFinishContext();
3852   return __pyx_r;
3853 }
3854 
3855 /* Python wrapper */
3856 static PyObject *__pyx_pw_8fastavro_5_read_5read_timestamp_millis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_8fastavro_5_read_5read_timestamp_millis(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)3857 static PyObject *__pyx_pw_8fastavro_5_read_5read_timestamp_millis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3858   PyObject *__pyx_v_data = 0;
3859   PyObject *__pyx_v_writer_schema = 0;
3860   PyObject *__pyx_v_reader_schema = 0;
3861   int __pyx_lineno = 0;
3862   const char *__pyx_filename = NULL;
3863   int __pyx_clineno = 0;
3864   PyObject *__pyx_r = 0;
3865   __Pyx_RefNannyDeclarations
3866   __Pyx_RefNannySetupContext("read_timestamp_millis (wrapper)", 0);
3867   {
3868     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_writer_schema,&__pyx_n_s_reader_schema,0};
3869     PyObject* values[3] = {0,0,0};
3870     values[1] = ((PyObject *)Py_None);
3871     values[2] = ((PyObject *)Py_None);
3872     if (unlikely(__pyx_kwds)) {
3873       Py_ssize_t kw_args;
3874       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3875       switch (pos_args) {
3876         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3877         CYTHON_FALLTHROUGH;
3878         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3879         CYTHON_FALLTHROUGH;
3880         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3881         CYTHON_FALLTHROUGH;
3882         case  0: break;
3883         default: goto __pyx_L5_argtuple_error;
3884       }
3885       kw_args = PyDict_Size(__pyx_kwds);
3886       switch (pos_args) {
3887         case  0:
3888         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
3889         else goto __pyx_L5_argtuple_error;
3890         CYTHON_FALLTHROUGH;
3891         case  1:
3892         if (kw_args > 0) {
3893           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_writer_schema);
3894           if (value) { values[1] = value; kw_args--; }
3895         }
3896         CYTHON_FALLTHROUGH;
3897         case  2:
3898         if (kw_args > 0) {
3899           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_reader_schema);
3900           if (value) { values[2] = value; kw_args--; }
3901         }
3902       }
3903       if (unlikely(kw_args > 0)) {
3904         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_timestamp_millis") < 0)) __PYX_ERR(0, 149, __pyx_L3_error)
3905       }
3906     } else {
3907       switch (PyTuple_GET_SIZE(__pyx_args)) {
3908         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3909         CYTHON_FALLTHROUGH;
3910         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3911         CYTHON_FALLTHROUGH;
3912         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3913         break;
3914         default: goto __pyx_L5_argtuple_error;
3915       }
3916     }
3917     __pyx_v_data = values[0];
3918     __pyx_v_writer_schema = values[1];
3919     __pyx_v_reader_schema = values[2];
3920   }
3921   goto __pyx_L4_argument_unpacking_done;
3922   __pyx_L5_argtuple_error:;
3923   __Pyx_RaiseArgtupleInvalid("read_timestamp_millis", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 149, __pyx_L3_error)
3924   __pyx_L3_error:;
3925   __Pyx_AddTraceback("fastavro._read.read_timestamp_millis", __pyx_clineno, __pyx_lineno, __pyx_filename);
3926   __Pyx_RefNannyFinishContext();
3927   return NULL;
3928   __pyx_L4_argument_unpacking_done:;
3929   __pyx_r = __pyx_pf_8fastavro_5_read_4read_timestamp_millis(__pyx_self, __pyx_v_data, __pyx_v_writer_schema, __pyx_v_reader_schema);
3930 
3931   /* function exit code */
3932   __Pyx_RefNannyFinishContext();
3933   return __pyx_r;
3934 }
3935 
__pyx_pf_8fastavro_5_read_4read_timestamp_millis(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_data,PyObject * __pyx_v_writer_schema,PyObject * __pyx_v_reader_schema)3936 static PyObject *__pyx_pf_8fastavro_5_read_4read_timestamp_millis(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_writer_schema, PyObject *__pyx_v_reader_schema) {
3937   PyObject *__pyx_r = NULL;
3938   __Pyx_RefNannyDeclarations
3939   PyObject *__pyx_t_1 = NULL;
3940   struct __pyx_opt_args_8fastavro_5_read_read_timestamp_millis __pyx_t_2;
3941   int __pyx_lineno = 0;
3942   const char *__pyx_filename = NULL;
3943   int __pyx_clineno = 0;
3944   __Pyx_RefNannySetupContext("read_timestamp_millis", 0);
3945   __Pyx_XDECREF(__pyx_r);
3946   __pyx_t_2.__pyx_n = 2;
3947   __pyx_t_2.writer_schema = __pyx_v_writer_schema;
3948   __pyx_t_2.reader_schema = __pyx_v_reader_schema;
3949   __pyx_t_1 = __pyx_f_8fastavro_5_read_read_timestamp_millis(__pyx_v_data, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error)
3950   __Pyx_GOTREF(__pyx_t_1);
3951   __pyx_r = __pyx_t_1;
3952   __pyx_t_1 = 0;
3953   goto __pyx_L0;
3954 
3955   /* function exit code */
3956   __pyx_L1_error:;
3957   __Pyx_XDECREF(__pyx_t_1);
3958   __Pyx_AddTraceback("fastavro._read.read_timestamp_millis", __pyx_clineno, __pyx_lineno, __pyx_filename);
3959   __pyx_r = NULL;
3960   __pyx_L0:;
3961   __Pyx_XGIVEREF(__pyx_r);
3962   __Pyx_RefNannyFinishContext();
3963   return __pyx_r;
3964 }
3965 
3966 /* "fastavro/_read.pyx":153
3967  *
3968  *
3969  * cpdef read_timestamp_micros(data, writer_schema=None, reader_schema=None):             # <<<<<<<<<<<<<<
3970  *     return epoch + datetime.timedelta(microseconds=data)
3971  *
3972  */
3973 
3974 static PyObject *__pyx_pw_8fastavro_5_read_7read_timestamp_micros(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_f_8fastavro_5_read_read_timestamp_micros(PyObject * __pyx_v_data,CYTHON_UNUSED int __pyx_skip_dispatch,struct __pyx_opt_args_8fastavro_5_read_read_timestamp_micros * __pyx_optional_args)3975 static PyObject *__pyx_f_8fastavro_5_read_read_timestamp_micros(PyObject *__pyx_v_data, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8fastavro_5_read_read_timestamp_micros *__pyx_optional_args) {
3976   PyObject *__pyx_r = NULL;
3977   __Pyx_RefNannyDeclarations
3978   PyObject *__pyx_t_1 = NULL;
3979   PyObject *__pyx_t_2 = NULL;
3980   PyObject *__pyx_t_3 = NULL;
3981   PyObject *__pyx_t_4 = NULL;
3982   int __pyx_lineno = 0;
3983   const char *__pyx_filename = NULL;
3984   int __pyx_clineno = 0;
3985   __Pyx_RefNannySetupContext("read_timestamp_micros", 0);
3986   if (__pyx_optional_args) {
3987   }
3988 
3989   /* "fastavro/_read.pyx":154
3990  *
3991  * cpdef read_timestamp_micros(data, writer_schema=None, reader_schema=None):
3992  *     return epoch + datetime.timedelta(microseconds=data)             # <<<<<<<<<<<<<<
3993  *
3994  *
3995  */
3996   __Pyx_XDECREF(__pyx_r);
3997   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_epoch); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 154, __pyx_L1_error)
3998   __Pyx_GOTREF(__pyx_t_1);
3999   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 154, __pyx_L1_error)
4000   __Pyx_GOTREF(__pyx_t_2);
4001   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 154, __pyx_L1_error)
4002   __Pyx_GOTREF(__pyx_t_3);
4003   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4004   __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 154, __pyx_L1_error)
4005   __Pyx_GOTREF(__pyx_t_2);
4006   if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_microseconds, __pyx_v_data) < 0) __PYX_ERR(0, 154, __pyx_L1_error)
4007   __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 154, __pyx_L1_error)
4008   __Pyx_GOTREF(__pyx_t_4);
4009   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4010   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4011   __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 154, __pyx_L1_error)
4012   __Pyx_GOTREF(__pyx_t_2);
4013   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4014   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4015   __pyx_r = __pyx_t_2;
4016   __pyx_t_2 = 0;
4017   goto __pyx_L0;
4018 
4019   /* "fastavro/_read.pyx":153
4020  *
4021  *
4022  * cpdef read_timestamp_micros(data, writer_schema=None, reader_schema=None):             # <<<<<<<<<<<<<<
4023  *     return epoch + datetime.timedelta(microseconds=data)
4024  *
4025  */
4026 
4027   /* function exit code */
4028   __pyx_L1_error:;
4029   __Pyx_XDECREF(__pyx_t_1);
4030   __Pyx_XDECREF(__pyx_t_2);
4031   __Pyx_XDECREF(__pyx_t_3);
4032   __Pyx_XDECREF(__pyx_t_4);
4033   __Pyx_AddTraceback("fastavro._read.read_timestamp_micros", __pyx_clineno, __pyx_lineno, __pyx_filename);
4034   __pyx_r = 0;
4035   __pyx_L0:;
4036   __Pyx_XGIVEREF(__pyx_r);
4037   __Pyx_RefNannyFinishContext();
4038   return __pyx_r;
4039 }
4040 
4041 /* Python wrapper */
4042 static PyObject *__pyx_pw_8fastavro_5_read_7read_timestamp_micros(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_8fastavro_5_read_7read_timestamp_micros(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)4043 static PyObject *__pyx_pw_8fastavro_5_read_7read_timestamp_micros(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4044   PyObject *__pyx_v_data = 0;
4045   PyObject *__pyx_v_writer_schema = 0;
4046   PyObject *__pyx_v_reader_schema = 0;
4047   int __pyx_lineno = 0;
4048   const char *__pyx_filename = NULL;
4049   int __pyx_clineno = 0;
4050   PyObject *__pyx_r = 0;
4051   __Pyx_RefNannyDeclarations
4052   __Pyx_RefNannySetupContext("read_timestamp_micros (wrapper)", 0);
4053   {
4054     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_writer_schema,&__pyx_n_s_reader_schema,0};
4055     PyObject* values[3] = {0,0,0};
4056     values[1] = ((PyObject *)Py_None);
4057     values[2] = ((PyObject *)Py_None);
4058     if (unlikely(__pyx_kwds)) {
4059       Py_ssize_t kw_args;
4060       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4061       switch (pos_args) {
4062         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4063         CYTHON_FALLTHROUGH;
4064         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4065         CYTHON_FALLTHROUGH;
4066         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4067         CYTHON_FALLTHROUGH;
4068         case  0: break;
4069         default: goto __pyx_L5_argtuple_error;
4070       }
4071       kw_args = PyDict_Size(__pyx_kwds);
4072       switch (pos_args) {
4073         case  0:
4074         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
4075         else goto __pyx_L5_argtuple_error;
4076         CYTHON_FALLTHROUGH;
4077         case  1:
4078         if (kw_args > 0) {
4079           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_writer_schema);
4080           if (value) { values[1] = value; kw_args--; }
4081         }
4082         CYTHON_FALLTHROUGH;
4083         case  2:
4084         if (kw_args > 0) {
4085           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_reader_schema);
4086           if (value) { values[2] = value; kw_args--; }
4087         }
4088       }
4089       if (unlikely(kw_args > 0)) {
4090         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_timestamp_micros") < 0)) __PYX_ERR(0, 153, __pyx_L3_error)
4091       }
4092     } else {
4093       switch (PyTuple_GET_SIZE(__pyx_args)) {
4094         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4095         CYTHON_FALLTHROUGH;
4096         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4097         CYTHON_FALLTHROUGH;
4098         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4099         break;
4100         default: goto __pyx_L5_argtuple_error;
4101       }
4102     }
4103     __pyx_v_data = values[0];
4104     __pyx_v_writer_schema = values[1];
4105     __pyx_v_reader_schema = values[2];
4106   }
4107   goto __pyx_L4_argument_unpacking_done;
4108   __pyx_L5_argtuple_error:;
4109   __Pyx_RaiseArgtupleInvalid("read_timestamp_micros", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 153, __pyx_L3_error)
4110   __pyx_L3_error:;
4111   __Pyx_AddTraceback("fastavro._read.read_timestamp_micros", __pyx_clineno, __pyx_lineno, __pyx_filename);
4112   __Pyx_RefNannyFinishContext();
4113   return NULL;
4114   __pyx_L4_argument_unpacking_done:;
4115   __pyx_r = __pyx_pf_8fastavro_5_read_6read_timestamp_micros(__pyx_self, __pyx_v_data, __pyx_v_writer_schema, __pyx_v_reader_schema);
4116 
4117   /* function exit code */
4118   __Pyx_RefNannyFinishContext();
4119   return __pyx_r;
4120 }
4121 
__pyx_pf_8fastavro_5_read_6read_timestamp_micros(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_data,PyObject * __pyx_v_writer_schema,PyObject * __pyx_v_reader_schema)4122 static PyObject *__pyx_pf_8fastavro_5_read_6read_timestamp_micros(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_writer_schema, PyObject *__pyx_v_reader_schema) {
4123   PyObject *__pyx_r = NULL;
4124   __Pyx_RefNannyDeclarations
4125   PyObject *__pyx_t_1 = NULL;
4126   struct __pyx_opt_args_8fastavro_5_read_read_timestamp_micros __pyx_t_2;
4127   int __pyx_lineno = 0;
4128   const char *__pyx_filename = NULL;
4129   int __pyx_clineno = 0;
4130   __Pyx_RefNannySetupContext("read_timestamp_micros", 0);
4131   __Pyx_XDECREF(__pyx_r);
4132   __pyx_t_2.__pyx_n = 2;
4133   __pyx_t_2.writer_schema = __pyx_v_writer_schema;
4134   __pyx_t_2.reader_schema = __pyx_v_reader_schema;
4135   __pyx_t_1 = __pyx_f_8fastavro_5_read_read_timestamp_micros(__pyx_v_data, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error)
4136   __Pyx_GOTREF(__pyx_t_1);
4137   __pyx_r = __pyx_t_1;
4138   __pyx_t_1 = 0;
4139   goto __pyx_L0;
4140 
4141   /* function exit code */
4142   __pyx_L1_error:;
4143   __Pyx_XDECREF(__pyx_t_1);
4144   __Pyx_AddTraceback("fastavro._read.read_timestamp_micros", __pyx_clineno, __pyx_lineno, __pyx_filename);
4145   __pyx_r = NULL;
4146   __pyx_L0:;
4147   __Pyx_XGIVEREF(__pyx_r);
4148   __Pyx_RefNannyFinishContext();
4149   return __pyx_r;
4150 }
4151 
4152 /* "fastavro/_read.pyx":157
4153  *
4154  *
4155  * cpdef read_date(data, writer_schema=None, reader_schema=None):             # <<<<<<<<<<<<<<
4156  *     return datetime.date.fromordinal(data + DAYS_SHIFT)
4157  *
4158  */
4159 
4160 static PyObject *__pyx_pw_8fastavro_5_read_9read_date(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_f_8fastavro_5_read_read_date(PyObject * __pyx_v_data,CYTHON_UNUSED int __pyx_skip_dispatch,struct __pyx_opt_args_8fastavro_5_read_read_date * __pyx_optional_args)4161 static PyObject *__pyx_f_8fastavro_5_read_read_date(PyObject *__pyx_v_data, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8fastavro_5_read_read_date *__pyx_optional_args) {
4162   PyObject *__pyx_r = NULL;
4163   __Pyx_RefNannyDeclarations
4164   PyObject *__pyx_t_1 = NULL;
4165   PyObject *__pyx_t_2 = NULL;
4166   PyObject *__pyx_t_3 = NULL;
4167   PyObject *__pyx_t_4 = NULL;
4168   int __pyx_lineno = 0;
4169   const char *__pyx_filename = NULL;
4170   int __pyx_clineno = 0;
4171   __Pyx_RefNannySetupContext("read_date", 0);
4172   if (__pyx_optional_args) {
4173   }
4174 
4175   /* "fastavro/_read.pyx":158
4176  *
4177  * cpdef read_date(data, writer_schema=None, reader_schema=None):
4178  *     return datetime.date.fromordinal(data + DAYS_SHIFT)             # <<<<<<<<<<<<<<
4179  *
4180  *
4181  */
4182   __Pyx_XDECREF(__pyx_r);
4183   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error)
4184   __Pyx_GOTREF(__pyx_t_2);
4185   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_date); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error)
4186   __Pyx_GOTREF(__pyx_t_3);
4187   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4188   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_fromordinal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error)
4189   __Pyx_GOTREF(__pyx_t_2);
4190   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4191   __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_DAYS_SHIFT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error)
4192   __Pyx_GOTREF(__pyx_t_3);
4193   __pyx_t_4 = PyNumber_Add(__pyx_v_data, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error)
4194   __Pyx_GOTREF(__pyx_t_4);
4195   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4196   __pyx_t_3 = NULL;
4197   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
4198     __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
4199     if (likely(__pyx_t_3)) {
4200       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
4201       __Pyx_INCREF(__pyx_t_3);
4202       __Pyx_INCREF(function);
4203       __Pyx_DECREF_SET(__pyx_t_2, function);
4204     }
4205   }
4206   __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
4207   __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4208   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4209   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error)
4210   __Pyx_GOTREF(__pyx_t_1);
4211   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4212   __pyx_r = __pyx_t_1;
4213   __pyx_t_1 = 0;
4214   goto __pyx_L0;
4215 
4216   /* "fastavro/_read.pyx":157
4217  *
4218  *
4219  * cpdef read_date(data, writer_schema=None, reader_schema=None):             # <<<<<<<<<<<<<<
4220  *     return datetime.date.fromordinal(data + DAYS_SHIFT)
4221  *
4222  */
4223 
4224   /* function exit code */
4225   __pyx_L1_error:;
4226   __Pyx_XDECREF(__pyx_t_1);
4227   __Pyx_XDECREF(__pyx_t_2);
4228   __Pyx_XDECREF(__pyx_t_3);
4229   __Pyx_XDECREF(__pyx_t_4);
4230   __Pyx_AddTraceback("fastavro._read.read_date", __pyx_clineno, __pyx_lineno, __pyx_filename);
4231   __pyx_r = 0;
4232   __pyx_L0:;
4233   __Pyx_XGIVEREF(__pyx_r);
4234   __Pyx_RefNannyFinishContext();
4235   return __pyx_r;
4236 }
4237 
4238 /* Python wrapper */
4239 static PyObject *__pyx_pw_8fastavro_5_read_9read_date(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_8fastavro_5_read_9read_date(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)4240 static PyObject *__pyx_pw_8fastavro_5_read_9read_date(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4241   PyObject *__pyx_v_data = 0;
4242   PyObject *__pyx_v_writer_schema = 0;
4243   PyObject *__pyx_v_reader_schema = 0;
4244   int __pyx_lineno = 0;
4245   const char *__pyx_filename = NULL;
4246   int __pyx_clineno = 0;
4247   PyObject *__pyx_r = 0;
4248   __Pyx_RefNannyDeclarations
4249   __Pyx_RefNannySetupContext("read_date (wrapper)", 0);
4250   {
4251     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_writer_schema,&__pyx_n_s_reader_schema,0};
4252     PyObject* values[3] = {0,0,0};
4253     values[1] = ((PyObject *)Py_None);
4254     values[2] = ((PyObject *)Py_None);
4255     if (unlikely(__pyx_kwds)) {
4256       Py_ssize_t kw_args;
4257       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4258       switch (pos_args) {
4259         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4260         CYTHON_FALLTHROUGH;
4261         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4262         CYTHON_FALLTHROUGH;
4263         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4264         CYTHON_FALLTHROUGH;
4265         case  0: break;
4266         default: goto __pyx_L5_argtuple_error;
4267       }
4268       kw_args = PyDict_Size(__pyx_kwds);
4269       switch (pos_args) {
4270         case  0:
4271         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
4272         else goto __pyx_L5_argtuple_error;
4273         CYTHON_FALLTHROUGH;
4274         case  1:
4275         if (kw_args > 0) {
4276           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_writer_schema);
4277           if (value) { values[1] = value; kw_args--; }
4278         }
4279         CYTHON_FALLTHROUGH;
4280         case  2:
4281         if (kw_args > 0) {
4282           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_reader_schema);
4283           if (value) { values[2] = value; kw_args--; }
4284         }
4285       }
4286       if (unlikely(kw_args > 0)) {
4287         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_date") < 0)) __PYX_ERR(0, 157, __pyx_L3_error)
4288       }
4289     } else {
4290       switch (PyTuple_GET_SIZE(__pyx_args)) {
4291         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4292         CYTHON_FALLTHROUGH;
4293         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4294         CYTHON_FALLTHROUGH;
4295         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4296         break;
4297         default: goto __pyx_L5_argtuple_error;
4298       }
4299     }
4300     __pyx_v_data = values[0];
4301     __pyx_v_writer_schema = values[1];
4302     __pyx_v_reader_schema = values[2];
4303   }
4304   goto __pyx_L4_argument_unpacking_done;
4305   __pyx_L5_argtuple_error:;
4306   __Pyx_RaiseArgtupleInvalid("read_date", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 157, __pyx_L3_error)
4307   __pyx_L3_error:;
4308   __Pyx_AddTraceback("fastavro._read.read_date", __pyx_clineno, __pyx_lineno, __pyx_filename);
4309   __Pyx_RefNannyFinishContext();
4310   return NULL;
4311   __pyx_L4_argument_unpacking_done:;
4312   __pyx_r = __pyx_pf_8fastavro_5_read_8read_date(__pyx_self, __pyx_v_data, __pyx_v_writer_schema, __pyx_v_reader_schema);
4313 
4314   /* function exit code */
4315   __Pyx_RefNannyFinishContext();
4316   return __pyx_r;
4317 }
4318 
__pyx_pf_8fastavro_5_read_8read_date(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_data,PyObject * __pyx_v_writer_schema,PyObject * __pyx_v_reader_schema)4319 static PyObject *__pyx_pf_8fastavro_5_read_8read_date(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_writer_schema, PyObject *__pyx_v_reader_schema) {
4320   PyObject *__pyx_r = NULL;
4321   __Pyx_RefNannyDeclarations
4322   PyObject *__pyx_t_1 = NULL;
4323   struct __pyx_opt_args_8fastavro_5_read_read_date __pyx_t_2;
4324   int __pyx_lineno = 0;
4325   const char *__pyx_filename = NULL;
4326   int __pyx_clineno = 0;
4327   __Pyx_RefNannySetupContext("read_date", 0);
4328   __Pyx_XDECREF(__pyx_r);
4329   __pyx_t_2.__pyx_n = 2;
4330   __pyx_t_2.writer_schema = __pyx_v_writer_schema;
4331   __pyx_t_2.reader_schema = __pyx_v_reader_schema;
4332   __pyx_t_1 = __pyx_f_8fastavro_5_read_read_date(__pyx_v_data, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error)
4333   __Pyx_GOTREF(__pyx_t_1);
4334   __pyx_r = __pyx_t_1;
4335   __pyx_t_1 = 0;
4336   goto __pyx_L0;
4337 
4338   /* function exit code */
4339   __pyx_L1_error:;
4340   __Pyx_XDECREF(__pyx_t_1);
4341   __Pyx_AddTraceback("fastavro._read.read_date", __pyx_clineno, __pyx_lineno, __pyx_filename);
4342   __pyx_r = NULL;
4343   __pyx_L0:;
4344   __Pyx_XGIVEREF(__pyx_r);
4345   __Pyx_RefNannyFinishContext();
4346   return __pyx_r;
4347 }
4348 
4349 /* "fastavro/_read.pyx":161
4350  *
4351  *
4352  * cpdef read_uuid(data, writer_schema=None, reader_schema=None):             # <<<<<<<<<<<<<<
4353  *     return UUID(data)
4354  *
4355  */
4356 
4357 static PyObject *__pyx_pw_8fastavro_5_read_11read_uuid(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_f_8fastavro_5_read_read_uuid(PyObject * __pyx_v_data,CYTHON_UNUSED int __pyx_skip_dispatch,struct __pyx_opt_args_8fastavro_5_read_read_uuid * __pyx_optional_args)4358 static PyObject *__pyx_f_8fastavro_5_read_read_uuid(PyObject *__pyx_v_data, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8fastavro_5_read_read_uuid *__pyx_optional_args) {
4359   PyObject *__pyx_r = NULL;
4360   __Pyx_RefNannyDeclarations
4361   PyObject *__pyx_t_1 = NULL;
4362   PyObject *__pyx_t_2 = NULL;
4363   PyObject *__pyx_t_3 = NULL;
4364   int __pyx_lineno = 0;
4365   const char *__pyx_filename = NULL;
4366   int __pyx_clineno = 0;
4367   __Pyx_RefNannySetupContext("read_uuid", 0);
4368   if (__pyx_optional_args) {
4369   }
4370 
4371   /* "fastavro/_read.pyx":162
4372  *
4373  * cpdef read_uuid(data, writer_schema=None, reader_schema=None):
4374  *     return UUID(data)             # <<<<<<<<<<<<<<
4375  *
4376  *
4377  */
4378   __Pyx_XDECREF(__pyx_r);
4379   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_UUID); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error)
4380   __Pyx_GOTREF(__pyx_t_2);
4381   __pyx_t_3 = NULL;
4382   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
4383     __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
4384     if (likely(__pyx_t_3)) {
4385       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
4386       __Pyx_INCREF(__pyx_t_3);
4387       __Pyx_INCREF(function);
4388       __Pyx_DECREF_SET(__pyx_t_2, function);
4389     }
4390   }
4391   __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_data) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_data);
4392   __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4393   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error)
4394   __Pyx_GOTREF(__pyx_t_1);
4395   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4396   __pyx_r = __pyx_t_1;
4397   __pyx_t_1 = 0;
4398   goto __pyx_L0;
4399 
4400   /* "fastavro/_read.pyx":161
4401  *
4402  *
4403  * cpdef read_uuid(data, writer_schema=None, reader_schema=None):             # <<<<<<<<<<<<<<
4404  *     return UUID(data)
4405  *
4406  */
4407 
4408   /* function exit code */
4409   __pyx_L1_error:;
4410   __Pyx_XDECREF(__pyx_t_1);
4411   __Pyx_XDECREF(__pyx_t_2);
4412   __Pyx_XDECREF(__pyx_t_3);
4413   __Pyx_AddTraceback("fastavro._read.read_uuid", __pyx_clineno, __pyx_lineno, __pyx_filename);
4414   __pyx_r = 0;
4415   __pyx_L0:;
4416   __Pyx_XGIVEREF(__pyx_r);
4417   __Pyx_RefNannyFinishContext();
4418   return __pyx_r;
4419 }
4420 
4421 /* Python wrapper */
4422 static PyObject *__pyx_pw_8fastavro_5_read_11read_uuid(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_8fastavro_5_read_11read_uuid(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)4423 static PyObject *__pyx_pw_8fastavro_5_read_11read_uuid(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4424   PyObject *__pyx_v_data = 0;
4425   PyObject *__pyx_v_writer_schema = 0;
4426   PyObject *__pyx_v_reader_schema = 0;
4427   int __pyx_lineno = 0;
4428   const char *__pyx_filename = NULL;
4429   int __pyx_clineno = 0;
4430   PyObject *__pyx_r = 0;
4431   __Pyx_RefNannyDeclarations
4432   __Pyx_RefNannySetupContext("read_uuid (wrapper)", 0);
4433   {
4434     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_writer_schema,&__pyx_n_s_reader_schema,0};
4435     PyObject* values[3] = {0,0,0};
4436     values[1] = ((PyObject *)Py_None);
4437     values[2] = ((PyObject *)Py_None);
4438     if (unlikely(__pyx_kwds)) {
4439       Py_ssize_t kw_args;
4440       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4441       switch (pos_args) {
4442         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4443         CYTHON_FALLTHROUGH;
4444         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4445         CYTHON_FALLTHROUGH;
4446         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4447         CYTHON_FALLTHROUGH;
4448         case  0: break;
4449         default: goto __pyx_L5_argtuple_error;
4450       }
4451       kw_args = PyDict_Size(__pyx_kwds);
4452       switch (pos_args) {
4453         case  0:
4454         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
4455         else goto __pyx_L5_argtuple_error;
4456         CYTHON_FALLTHROUGH;
4457         case  1:
4458         if (kw_args > 0) {
4459           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_writer_schema);
4460           if (value) { values[1] = value; kw_args--; }
4461         }
4462         CYTHON_FALLTHROUGH;
4463         case  2:
4464         if (kw_args > 0) {
4465           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_reader_schema);
4466           if (value) { values[2] = value; kw_args--; }
4467         }
4468       }
4469       if (unlikely(kw_args > 0)) {
4470         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_uuid") < 0)) __PYX_ERR(0, 161, __pyx_L3_error)
4471       }
4472     } else {
4473       switch (PyTuple_GET_SIZE(__pyx_args)) {
4474         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4475         CYTHON_FALLTHROUGH;
4476         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4477         CYTHON_FALLTHROUGH;
4478         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4479         break;
4480         default: goto __pyx_L5_argtuple_error;
4481       }
4482     }
4483     __pyx_v_data = values[0];
4484     __pyx_v_writer_schema = values[1];
4485     __pyx_v_reader_schema = values[2];
4486   }
4487   goto __pyx_L4_argument_unpacking_done;
4488   __pyx_L5_argtuple_error:;
4489   __Pyx_RaiseArgtupleInvalid("read_uuid", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 161, __pyx_L3_error)
4490   __pyx_L3_error:;
4491   __Pyx_AddTraceback("fastavro._read.read_uuid", __pyx_clineno, __pyx_lineno, __pyx_filename);
4492   __Pyx_RefNannyFinishContext();
4493   return NULL;
4494   __pyx_L4_argument_unpacking_done:;
4495   __pyx_r = __pyx_pf_8fastavro_5_read_10read_uuid(__pyx_self, __pyx_v_data, __pyx_v_writer_schema, __pyx_v_reader_schema);
4496 
4497   /* function exit code */
4498   __Pyx_RefNannyFinishContext();
4499   return __pyx_r;
4500 }
4501 
__pyx_pf_8fastavro_5_read_10read_uuid(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_data,PyObject * __pyx_v_writer_schema,PyObject * __pyx_v_reader_schema)4502 static PyObject *__pyx_pf_8fastavro_5_read_10read_uuid(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_writer_schema, PyObject *__pyx_v_reader_schema) {
4503   PyObject *__pyx_r = NULL;
4504   __Pyx_RefNannyDeclarations
4505   PyObject *__pyx_t_1 = NULL;
4506   struct __pyx_opt_args_8fastavro_5_read_read_uuid __pyx_t_2;
4507   int __pyx_lineno = 0;
4508   const char *__pyx_filename = NULL;
4509   int __pyx_clineno = 0;
4510   __Pyx_RefNannySetupContext("read_uuid", 0);
4511   __Pyx_XDECREF(__pyx_r);
4512   __pyx_t_2.__pyx_n = 2;
4513   __pyx_t_2.writer_schema = __pyx_v_writer_schema;
4514   __pyx_t_2.reader_schema = __pyx_v_reader_schema;
4515   __pyx_t_1 = __pyx_f_8fastavro_5_read_read_uuid(__pyx_v_data, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error)
4516   __Pyx_GOTREF(__pyx_t_1);
4517   __pyx_r = __pyx_t_1;
4518   __pyx_t_1 = 0;
4519   goto __pyx_L0;
4520 
4521   /* function exit code */
4522   __pyx_L1_error:;
4523   __Pyx_XDECREF(__pyx_t_1);
4524   __Pyx_AddTraceback("fastavro._read.read_uuid", __pyx_clineno, __pyx_lineno, __pyx_filename);
4525   __pyx_r = NULL;
4526   __pyx_L0:;
4527   __Pyx_XGIVEREF(__pyx_r);
4528   __Pyx_RefNannyFinishContext();
4529   return __pyx_r;
4530 }
4531 
4532 /* "fastavro/_read.pyx":165
4533  *
4534  *
4535  * cpdef read_time_millis(data, writer_schema=None, reader_schema=None):             # <<<<<<<<<<<<<<
4536  *     h = int(data / MLS_PER_HOUR)
4537  *     m = int(data / MLS_PER_MINUTE) % 60
4538  */
4539 
4540 static PyObject *__pyx_pw_8fastavro_5_read_13read_time_millis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_f_8fastavro_5_read_read_time_millis(PyObject * __pyx_v_data,CYTHON_UNUSED int __pyx_skip_dispatch,struct __pyx_opt_args_8fastavro_5_read_read_time_millis * __pyx_optional_args)4541 static PyObject *__pyx_f_8fastavro_5_read_read_time_millis(PyObject *__pyx_v_data, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8fastavro_5_read_read_time_millis *__pyx_optional_args) {
4542   PyObject *__pyx_v_h = NULL;
4543   PyObject *__pyx_v_m = NULL;
4544   PyObject *__pyx_v_s = NULL;
4545   PyObject *__pyx_v_mls = NULL;
4546   PyObject *__pyx_r = NULL;
4547   __Pyx_RefNannyDeclarations
4548   PyObject *__pyx_t_1 = NULL;
4549   PyObject *__pyx_t_2 = NULL;
4550   PyObject *__pyx_t_3 = NULL;
4551   int __pyx_t_4;
4552   PyObject *__pyx_t_5 = NULL;
4553   int __pyx_lineno = 0;
4554   const char *__pyx_filename = NULL;
4555   int __pyx_clineno = 0;
4556   __Pyx_RefNannySetupContext("read_time_millis", 0);
4557   if (__pyx_optional_args) {
4558   }
4559 
4560   /* "fastavro/_read.pyx":166
4561  *
4562  * cpdef read_time_millis(data, writer_schema=None, reader_schema=None):
4563  *     h = int(data / MLS_PER_HOUR)             # <<<<<<<<<<<<<<
4564  *     m = int(data / MLS_PER_MINUTE) % 60
4565  *     s = int(data / MLS_PER_SECOND) % 60
4566  */
4567   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_MLS_PER_HOUR); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 166, __pyx_L1_error)
4568   __Pyx_GOTREF(__pyx_t_1);
4569   __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_data, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 166, __pyx_L1_error)
4570   __Pyx_GOTREF(__pyx_t_2);
4571   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4572   __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 166, __pyx_L1_error)
4573   __Pyx_GOTREF(__pyx_t_1);
4574   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4575   __pyx_v_h = __pyx_t_1;
4576   __pyx_t_1 = 0;
4577 
4578   /* "fastavro/_read.pyx":167
4579  * cpdef read_time_millis(data, writer_schema=None, reader_schema=None):
4580  *     h = int(data / MLS_PER_HOUR)
4581  *     m = int(data / MLS_PER_MINUTE) % 60             # <<<<<<<<<<<<<<
4582  *     s = int(data / MLS_PER_SECOND) % 60
4583  *     mls = int(data % MLS_PER_SECOND) * 1000
4584  */
4585   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_MLS_PER_MINUTE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error)
4586   __Pyx_GOTREF(__pyx_t_1);
4587   __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_data, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 167, __pyx_L1_error)
4588   __Pyx_GOTREF(__pyx_t_2);
4589   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4590   __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error)
4591   __Pyx_GOTREF(__pyx_t_1);
4592   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4593   __pyx_t_2 = __Pyx_PyInt_RemainderObjC(__pyx_t_1, __pyx_int_60, 60, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 167, __pyx_L1_error)
4594   __Pyx_GOTREF(__pyx_t_2);
4595   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4596   __pyx_v_m = __pyx_t_2;
4597   __pyx_t_2 = 0;
4598 
4599   /* "fastavro/_read.pyx":168
4600  *     h = int(data / MLS_PER_HOUR)
4601  *     m = int(data / MLS_PER_MINUTE) % 60
4602  *     s = int(data / MLS_PER_SECOND) % 60             # <<<<<<<<<<<<<<
4603  *     mls = int(data % MLS_PER_SECOND) * 1000
4604  *     return datetime.time(h, m, s, mls)
4605  */
4606   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_MLS_PER_SECOND); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L1_error)
4607   __Pyx_GOTREF(__pyx_t_2);
4608   __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_v_data, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error)
4609   __Pyx_GOTREF(__pyx_t_1);
4610   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4611   __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L1_error)
4612   __Pyx_GOTREF(__pyx_t_2);
4613   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4614   __pyx_t_1 = __Pyx_PyInt_RemainderObjC(__pyx_t_2, __pyx_int_60, 60, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error)
4615   __Pyx_GOTREF(__pyx_t_1);
4616   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4617   __pyx_v_s = __pyx_t_1;
4618   __pyx_t_1 = 0;
4619 
4620   /* "fastavro/_read.pyx":169
4621  *     m = int(data / MLS_PER_MINUTE) % 60
4622  *     s = int(data / MLS_PER_SECOND) % 60
4623  *     mls = int(data % MLS_PER_SECOND) * 1000             # <<<<<<<<<<<<<<
4624  *     return datetime.time(h, m, s, mls)
4625  *
4626  */
4627   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_MLS_PER_SECOND); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error)
4628   __Pyx_GOTREF(__pyx_t_1);
4629   __pyx_t_2 = PyNumber_Remainder(__pyx_v_data, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error)
4630   __Pyx_GOTREF(__pyx_t_2);
4631   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4632   __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error)
4633   __Pyx_GOTREF(__pyx_t_1);
4634   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4635   __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_int_1000); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error)
4636   __Pyx_GOTREF(__pyx_t_2);
4637   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4638   __pyx_v_mls = __pyx_t_2;
4639   __pyx_t_2 = 0;
4640 
4641   /* "fastavro/_read.pyx":170
4642  *     s = int(data / MLS_PER_SECOND) % 60
4643  *     mls = int(data % MLS_PER_SECOND) * 1000
4644  *     return datetime.time(h, m, s, mls)             # <<<<<<<<<<<<<<
4645  *
4646  *
4647  */
4648   __Pyx_XDECREF(__pyx_r);
4649   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error)
4650   __Pyx_GOTREF(__pyx_t_1);
4651   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_time); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 170, __pyx_L1_error)
4652   __Pyx_GOTREF(__pyx_t_3);
4653   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4654   __pyx_t_1 = NULL;
4655   __pyx_t_4 = 0;
4656   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4657     __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
4658     if (likely(__pyx_t_1)) {
4659       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4660       __Pyx_INCREF(__pyx_t_1);
4661       __Pyx_INCREF(function);
4662       __Pyx_DECREF_SET(__pyx_t_3, function);
4663       __pyx_t_4 = 1;
4664     }
4665   }
4666   #if CYTHON_FAST_PYCALL
4667   if (PyFunction_Check(__pyx_t_3)) {
4668     PyObject *__pyx_temp[5] = {__pyx_t_1, __pyx_v_h, __pyx_v_m, __pyx_v_s, __pyx_v_mls};
4669     __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 170, __pyx_L1_error)
4670     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
4671     __Pyx_GOTREF(__pyx_t_2);
4672   } else
4673   #endif
4674   #if CYTHON_FAST_PYCCALL
4675   if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
4676     PyObject *__pyx_temp[5] = {__pyx_t_1, __pyx_v_h, __pyx_v_m, __pyx_v_s, __pyx_v_mls};
4677     __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 170, __pyx_L1_error)
4678     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
4679     __Pyx_GOTREF(__pyx_t_2);
4680   } else
4681   #endif
4682   {
4683     __pyx_t_5 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 170, __pyx_L1_error)
4684     __Pyx_GOTREF(__pyx_t_5);
4685     if (__pyx_t_1) {
4686       __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = NULL;
4687     }
4688     __Pyx_INCREF(__pyx_v_h);
4689     __Pyx_GIVEREF(__pyx_v_h);
4690     PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_h);
4691     __Pyx_INCREF(__pyx_v_m);
4692     __Pyx_GIVEREF(__pyx_v_m);
4693     PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_m);
4694     __Pyx_INCREF(__pyx_v_s);
4695     __Pyx_GIVEREF(__pyx_v_s);
4696     PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_s);
4697     __Pyx_INCREF(__pyx_v_mls);
4698     __Pyx_GIVEREF(__pyx_v_mls);
4699     PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_mls);
4700     __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 170, __pyx_L1_error)
4701     __Pyx_GOTREF(__pyx_t_2);
4702     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4703   }
4704   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4705   __pyx_r = __pyx_t_2;
4706   __pyx_t_2 = 0;
4707   goto __pyx_L0;
4708 
4709   /* "fastavro/_read.pyx":165
4710  *
4711  *
4712  * cpdef read_time_millis(data, writer_schema=None, reader_schema=None):             # <<<<<<<<<<<<<<
4713  *     h = int(data / MLS_PER_HOUR)
4714  *     m = int(data / MLS_PER_MINUTE) % 60
4715  */
4716 
4717   /* function exit code */
4718   __pyx_L1_error:;
4719   __Pyx_XDECREF(__pyx_t_1);
4720   __Pyx_XDECREF(__pyx_t_2);
4721   __Pyx_XDECREF(__pyx_t_3);
4722   __Pyx_XDECREF(__pyx_t_5);
4723   __Pyx_AddTraceback("fastavro._read.read_time_millis", __pyx_clineno, __pyx_lineno, __pyx_filename);
4724   __pyx_r = 0;
4725   __pyx_L0:;
4726   __Pyx_XDECREF(__pyx_v_h);
4727   __Pyx_XDECREF(__pyx_v_m);
4728   __Pyx_XDECREF(__pyx_v_s);
4729   __Pyx_XDECREF(__pyx_v_mls);
4730   __Pyx_XGIVEREF(__pyx_r);
4731   __Pyx_RefNannyFinishContext();
4732   return __pyx_r;
4733 }
4734 
4735 /* Python wrapper */
4736 static PyObject *__pyx_pw_8fastavro_5_read_13read_time_millis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_8fastavro_5_read_13read_time_millis(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)4737 static PyObject *__pyx_pw_8fastavro_5_read_13read_time_millis(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4738   PyObject *__pyx_v_data = 0;
4739   PyObject *__pyx_v_writer_schema = 0;
4740   PyObject *__pyx_v_reader_schema = 0;
4741   int __pyx_lineno = 0;
4742   const char *__pyx_filename = NULL;
4743   int __pyx_clineno = 0;
4744   PyObject *__pyx_r = 0;
4745   __Pyx_RefNannyDeclarations
4746   __Pyx_RefNannySetupContext("read_time_millis (wrapper)", 0);
4747   {
4748     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_writer_schema,&__pyx_n_s_reader_schema,0};
4749     PyObject* values[3] = {0,0,0};
4750     values[1] = ((PyObject *)Py_None);
4751     values[2] = ((PyObject *)Py_None);
4752     if (unlikely(__pyx_kwds)) {
4753       Py_ssize_t kw_args;
4754       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4755       switch (pos_args) {
4756         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4757         CYTHON_FALLTHROUGH;
4758         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4759         CYTHON_FALLTHROUGH;
4760         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4761         CYTHON_FALLTHROUGH;
4762         case  0: break;
4763         default: goto __pyx_L5_argtuple_error;
4764       }
4765       kw_args = PyDict_Size(__pyx_kwds);
4766       switch (pos_args) {
4767         case  0:
4768         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
4769         else goto __pyx_L5_argtuple_error;
4770         CYTHON_FALLTHROUGH;
4771         case  1:
4772         if (kw_args > 0) {
4773           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_writer_schema);
4774           if (value) { values[1] = value; kw_args--; }
4775         }
4776         CYTHON_FALLTHROUGH;
4777         case  2:
4778         if (kw_args > 0) {
4779           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_reader_schema);
4780           if (value) { values[2] = value; kw_args--; }
4781         }
4782       }
4783       if (unlikely(kw_args > 0)) {
4784         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_time_millis") < 0)) __PYX_ERR(0, 165, __pyx_L3_error)
4785       }
4786     } else {
4787       switch (PyTuple_GET_SIZE(__pyx_args)) {
4788         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4789         CYTHON_FALLTHROUGH;
4790         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4791         CYTHON_FALLTHROUGH;
4792         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4793         break;
4794         default: goto __pyx_L5_argtuple_error;
4795       }
4796     }
4797     __pyx_v_data = values[0];
4798     __pyx_v_writer_schema = values[1];
4799     __pyx_v_reader_schema = values[2];
4800   }
4801   goto __pyx_L4_argument_unpacking_done;
4802   __pyx_L5_argtuple_error:;
4803   __Pyx_RaiseArgtupleInvalid("read_time_millis", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 165, __pyx_L3_error)
4804   __pyx_L3_error:;
4805   __Pyx_AddTraceback("fastavro._read.read_time_millis", __pyx_clineno, __pyx_lineno, __pyx_filename);
4806   __Pyx_RefNannyFinishContext();
4807   return NULL;
4808   __pyx_L4_argument_unpacking_done:;
4809   __pyx_r = __pyx_pf_8fastavro_5_read_12read_time_millis(__pyx_self, __pyx_v_data, __pyx_v_writer_schema, __pyx_v_reader_schema);
4810 
4811   /* function exit code */
4812   __Pyx_RefNannyFinishContext();
4813   return __pyx_r;
4814 }
4815 
__pyx_pf_8fastavro_5_read_12read_time_millis(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_data,PyObject * __pyx_v_writer_schema,PyObject * __pyx_v_reader_schema)4816 static PyObject *__pyx_pf_8fastavro_5_read_12read_time_millis(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_writer_schema, PyObject *__pyx_v_reader_schema) {
4817   PyObject *__pyx_r = NULL;
4818   __Pyx_RefNannyDeclarations
4819   PyObject *__pyx_t_1 = NULL;
4820   struct __pyx_opt_args_8fastavro_5_read_read_time_millis __pyx_t_2;
4821   int __pyx_lineno = 0;
4822   const char *__pyx_filename = NULL;
4823   int __pyx_clineno = 0;
4824   __Pyx_RefNannySetupContext("read_time_millis", 0);
4825   __Pyx_XDECREF(__pyx_r);
4826   __pyx_t_2.__pyx_n = 2;
4827   __pyx_t_2.writer_schema = __pyx_v_writer_schema;
4828   __pyx_t_2.reader_schema = __pyx_v_reader_schema;
4829   __pyx_t_1 = __pyx_f_8fastavro_5_read_read_time_millis(__pyx_v_data, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error)
4830   __Pyx_GOTREF(__pyx_t_1);
4831   __pyx_r = __pyx_t_1;
4832   __pyx_t_1 = 0;
4833   goto __pyx_L0;
4834 
4835   /* function exit code */
4836   __pyx_L1_error:;
4837   __Pyx_XDECREF(__pyx_t_1);
4838   __Pyx_AddTraceback("fastavro._read.read_time_millis", __pyx_clineno, __pyx_lineno, __pyx_filename);
4839   __pyx_r = NULL;
4840   __pyx_L0:;
4841   __Pyx_XGIVEREF(__pyx_r);
4842   __Pyx_RefNannyFinishContext();
4843   return __pyx_r;
4844 }
4845 
4846 /* "fastavro/_read.pyx":173
4847  *
4848  *
4849  * cpdef read_time_micros(data, writer_schema=None, reader_schema=None):             # <<<<<<<<<<<<<<
4850  *     h = int(data / MCS_PER_HOUR)
4851  *     m = int(data / MCS_PER_MINUTE) % 60
4852  */
4853 
4854 static PyObject *__pyx_pw_8fastavro_5_read_15read_time_micros(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_f_8fastavro_5_read_read_time_micros(PyObject * __pyx_v_data,CYTHON_UNUSED int __pyx_skip_dispatch,struct __pyx_opt_args_8fastavro_5_read_read_time_micros * __pyx_optional_args)4855 static PyObject *__pyx_f_8fastavro_5_read_read_time_micros(PyObject *__pyx_v_data, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8fastavro_5_read_read_time_micros *__pyx_optional_args) {
4856   PyObject *__pyx_v_h = NULL;
4857   PyObject *__pyx_v_m = NULL;
4858   PyObject *__pyx_v_s = NULL;
4859   PyObject *__pyx_v_mcs = NULL;
4860   PyObject *__pyx_r = NULL;
4861   __Pyx_RefNannyDeclarations
4862   PyObject *__pyx_t_1 = NULL;
4863   PyObject *__pyx_t_2 = NULL;
4864   PyObject *__pyx_t_3 = NULL;
4865   int __pyx_t_4;
4866   PyObject *__pyx_t_5 = NULL;
4867   int __pyx_lineno = 0;
4868   const char *__pyx_filename = NULL;
4869   int __pyx_clineno = 0;
4870   __Pyx_RefNannySetupContext("read_time_micros", 0);
4871   if (__pyx_optional_args) {
4872   }
4873 
4874   /* "fastavro/_read.pyx":174
4875  *
4876  * cpdef read_time_micros(data, writer_schema=None, reader_schema=None):
4877  *     h = int(data / MCS_PER_HOUR)             # <<<<<<<<<<<<<<
4878  *     m = int(data / MCS_PER_MINUTE) % 60
4879  *     s = int(data / MCS_PER_SECOND) % 60
4880  */
4881   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_MCS_PER_HOUR); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error)
4882   __Pyx_GOTREF(__pyx_t_1);
4883   __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_data, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error)
4884   __Pyx_GOTREF(__pyx_t_2);
4885   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4886   __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error)
4887   __Pyx_GOTREF(__pyx_t_1);
4888   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4889   __pyx_v_h = __pyx_t_1;
4890   __pyx_t_1 = 0;
4891 
4892   /* "fastavro/_read.pyx":175
4893  * cpdef read_time_micros(data, writer_schema=None, reader_schema=None):
4894  *     h = int(data / MCS_PER_HOUR)
4895  *     m = int(data / MCS_PER_MINUTE) % 60             # <<<<<<<<<<<<<<
4896  *     s = int(data / MCS_PER_SECOND) % 60
4897  *     mcs = data % MCS_PER_SECOND
4898  */
4899   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_MCS_PER_MINUTE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error)
4900   __Pyx_GOTREF(__pyx_t_1);
4901   __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_data, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 175, __pyx_L1_error)
4902   __Pyx_GOTREF(__pyx_t_2);
4903   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4904   __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error)
4905   __Pyx_GOTREF(__pyx_t_1);
4906   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4907   __pyx_t_2 = __Pyx_PyInt_RemainderObjC(__pyx_t_1, __pyx_int_60, 60, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 175, __pyx_L1_error)
4908   __Pyx_GOTREF(__pyx_t_2);
4909   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4910   __pyx_v_m = __pyx_t_2;
4911   __pyx_t_2 = 0;
4912 
4913   /* "fastavro/_read.pyx":176
4914  *     h = int(data / MCS_PER_HOUR)
4915  *     m = int(data / MCS_PER_MINUTE) % 60
4916  *     s = int(data / MCS_PER_SECOND) % 60             # <<<<<<<<<<<<<<
4917  *     mcs = data % MCS_PER_SECOND
4918  *     return datetime.time(h, m, s, mcs)
4919  */
4920   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_MCS_PER_SECOND); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 176, __pyx_L1_error)
4921   __Pyx_GOTREF(__pyx_t_2);
4922   __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_v_data, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 176, __pyx_L1_error)
4923   __Pyx_GOTREF(__pyx_t_1);
4924   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4925   __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 176, __pyx_L1_error)
4926   __Pyx_GOTREF(__pyx_t_2);
4927   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4928   __pyx_t_1 = __Pyx_PyInt_RemainderObjC(__pyx_t_2, __pyx_int_60, 60, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 176, __pyx_L1_error)
4929   __Pyx_GOTREF(__pyx_t_1);
4930   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4931   __pyx_v_s = __pyx_t_1;
4932   __pyx_t_1 = 0;
4933 
4934   /* "fastavro/_read.pyx":177
4935  *     m = int(data / MCS_PER_MINUTE) % 60
4936  *     s = int(data / MCS_PER_SECOND) % 60
4937  *     mcs = data % MCS_PER_SECOND             # <<<<<<<<<<<<<<
4938  *     return datetime.time(h, m, s, mcs)
4939  *
4940  */
4941   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_MCS_PER_SECOND); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error)
4942   __Pyx_GOTREF(__pyx_t_1);
4943   __pyx_t_2 = PyNumber_Remainder(__pyx_v_data, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 177, __pyx_L1_error)
4944   __Pyx_GOTREF(__pyx_t_2);
4945   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4946   __pyx_v_mcs = __pyx_t_2;
4947   __pyx_t_2 = 0;
4948 
4949   /* "fastavro/_read.pyx":178
4950  *     s = int(data / MCS_PER_SECOND) % 60
4951  *     mcs = data % MCS_PER_SECOND
4952  *     return datetime.time(h, m, s, mcs)             # <<<<<<<<<<<<<<
4953  *
4954  *
4955  */
4956   __Pyx_XDECREF(__pyx_r);
4957   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error)
4958   __Pyx_GOTREF(__pyx_t_1);
4959   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_time); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 178, __pyx_L1_error)
4960   __Pyx_GOTREF(__pyx_t_3);
4961   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4962   __pyx_t_1 = NULL;
4963   __pyx_t_4 = 0;
4964   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4965     __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
4966     if (likely(__pyx_t_1)) {
4967       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4968       __Pyx_INCREF(__pyx_t_1);
4969       __Pyx_INCREF(function);
4970       __Pyx_DECREF_SET(__pyx_t_3, function);
4971       __pyx_t_4 = 1;
4972     }
4973   }
4974   #if CYTHON_FAST_PYCALL
4975   if (PyFunction_Check(__pyx_t_3)) {
4976     PyObject *__pyx_temp[5] = {__pyx_t_1, __pyx_v_h, __pyx_v_m, __pyx_v_s, __pyx_v_mcs};
4977     __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error)
4978     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
4979     __Pyx_GOTREF(__pyx_t_2);
4980   } else
4981   #endif
4982   #if CYTHON_FAST_PYCCALL
4983   if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
4984     PyObject *__pyx_temp[5] = {__pyx_t_1, __pyx_v_h, __pyx_v_m, __pyx_v_s, __pyx_v_mcs};
4985     __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error)
4986     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
4987     __Pyx_GOTREF(__pyx_t_2);
4988   } else
4989   #endif
4990   {
4991     __pyx_t_5 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 178, __pyx_L1_error)
4992     __Pyx_GOTREF(__pyx_t_5);
4993     if (__pyx_t_1) {
4994       __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = NULL;
4995     }
4996     __Pyx_INCREF(__pyx_v_h);
4997     __Pyx_GIVEREF(__pyx_v_h);
4998     PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_h);
4999     __Pyx_INCREF(__pyx_v_m);
5000     __Pyx_GIVEREF(__pyx_v_m);
5001     PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_m);
5002     __Pyx_INCREF(__pyx_v_s);
5003     __Pyx_GIVEREF(__pyx_v_s);
5004     PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_s);
5005     __Pyx_INCREF(__pyx_v_mcs);
5006     __Pyx_GIVEREF(__pyx_v_mcs);
5007     PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_mcs);
5008     __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error)
5009     __Pyx_GOTREF(__pyx_t_2);
5010     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5011   }
5012   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5013   __pyx_r = __pyx_t_2;
5014   __pyx_t_2 = 0;
5015   goto __pyx_L0;
5016 
5017   /* "fastavro/_read.pyx":173
5018  *
5019  *
5020  * cpdef read_time_micros(data, writer_schema=None, reader_schema=None):             # <<<<<<<<<<<<<<
5021  *     h = int(data / MCS_PER_HOUR)
5022  *     m = int(data / MCS_PER_MINUTE) % 60
5023  */
5024 
5025   /* function exit code */
5026   __pyx_L1_error:;
5027   __Pyx_XDECREF(__pyx_t_1);
5028   __Pyx_XDECREF(__pyx_t_2);
5029   __Pyx_XDECREF(__pyx_t_3);
5030   __Pyx_XDECREF(__pyx_t_5);
5031   __Pyx_AddTraceback("fastavro._read.read_time_micros", __pyx_clineno, __pyx_lineno, __pyx_filename);
5032   __pyx_r = 0;
5033   __pyx_L0:;
5034   __Pyx_XDECREF(__pyx_v_h);
5035   __Pyx_XDECREF(__pyx_v_m);
5036   __Pyx_XDECREF(__pyx_v_s);
5037   __Pyx_XDECREF(__pyx_v_mcs);
5038   __Pyx_XGIVEREF(__pyx_r);
5039   __Pyx_RefNannyFinishContext();
5040   return __pyx_r;
5041 }
5042 
5043 /* Python wrapper */
5044 static PyObject *__pyx_pw_8fastavro_5_read_15read_time_micros(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_8fastavro_5_read_15read_time_micros(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)5045 static PyObject *__pyx_pw_8fastavro_5_read_15read_time_micros(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5046   PyObject *__pyx_v_data = 0;
5047   PyObject *__pyx_v_writer_schema = 0;
5048   PyObject *__pyx_v_reader_schema = 0;
5049   int __pyx_lineno = 0;
5050   const char *__pyx_filename = NULL;
5051   int __pyx_clineno = 0;
5052   PyObject *__pyx_r = 0;
5053   __Pyx_RefNannyDeclarations
5054   __Pyx_RefNannySetupContext("read_time_micros (wrapper)", 0);
5055   {
5056     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_writer_schema,&__pyx_n_s_reader_schema,0};
5057     PyObject* values[3] = {0,0,0};
5058     values[1] = ((PyObject *)Py_None);
5059     values[2] = ((PyObject *)Py_None);
5060     if (unlikely(__pyx_kwds)) {
5061       Py_ssize_t kw_args;
5062       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5063       switch (pos_args) {
5064         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5065         CYTHON_FALLTHROUGH;
5066         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5067         CYTHON_FALLTHROUGH;
5068         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5069         CYTHON_FALLTHROUGH;
5070         case  0: break;
5071         default: goto __pyx_L5_argtuple_error;
5072       }
5073       kw_args = PyDict_Size(__pyx_kwds);
5074       switch (pos_args) {
5075         case  0:
5076         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
5077         else goto __pyx_L5_argtuple_error;
5078         CYTHON_FALLTHROUGH;
5079         case  1:
5080         if (kw_args > 0) {
5081           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_writer_schema);
5082           if (value) { values[1] = value; kw_args--; }
5083         }
5084         CYTHON_FALLTHROUGH;
5085         case  2:
5086         if (kw_args > 0) {
5087           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_reader_schema);
5088           if (value) { values[2] = value; kw_args--; }
5089         }
5090       }
5091       if (unlikely(kw_args > 0)) {
5092         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_time_micros") < 0)) __PYX_ERR(0, 173, __pyx_L3_error)
5093       }
5094     } else {
5095       switch (PyTuple_GET_SIZE(__pyx_args)) {
5096         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5097         CYTHON_FALLTHROUGH;
5098         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5099         CYTHON_FALLTHROUGH;
5100         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5101         break;
5102         default: goto __pyx_L5_argtuple_error;
5103       }
5104     }
5105     __pyx_v_data = values[0];
5106     __pyx_v_writer_schema = values[1];
5107     __pyx_v_reader_schema = values[2];
5108   }
5109   goto __pyx_L4_argument_unpacking_done;
5110   __pyx_L5_argtuple_error:;
5111   __Pyx_RaiseArgtupleInvalid("read_time_micros", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 173, __pyx_L3_error)
5112   __pyx_L3_error:;
5113   __Pyx_AddTraceback("fastavro._read.read_time_micros", __pyx_clineno, __pyx_lineno, __pyx_filename);
5114   __Pyx_RefNannyFinishContext();
5115   return NULL;
5116   __pyx_L4_argument_unpacking_done:;
5117   __pyx_r = __pyx_pf_8fastavro_5_read_14read_time_micros(__pyx_self, __pyx_v_data, __pyx_v_writer_schema, __pyx_v_reader_schema);
5118 
5119   /* function exit code */
5120   __Pyx_RefNannyFinishContext();
5121   return __pyx_r;
5122 }
5123 
__pyx_pf_8fastavro_5_read_14read_time_micros(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_data,PyObject * __pyx_v_writer_schema,PyObject * __pyx_v_reader_schema)5124 static PyObject *__pyx_pf_8fastavro_5_read_14read_time_micros(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_writer_schema, PyObject *__pyx_v_reader_schema) {
5125   PyObject *__pyx_r = NULL;
5126   __Pyx_RefNannyDeclarations
5127   PyObject *__pyx_t_1 = NULL;
5128   struct __pyx_opt_args_8fastavro_5_read_read_time_micros __pyx_t_2;
5129   int __pyx_lineno = 0;
5130   const char *__pyx_filename = NULL;
5131   int __pyx_clineno = 0;
5132   __Pyx_RefNannySetupContext("read_time_micros", 0);
5133   __Pyx_XDECREF(__pyx_r);
5134   __pyx_t_2.__pyx_n = 2;
5135   __pyx_t_2.writer_schema = __pyx_v_writer_schema;
5136   __pyx_t_2.reader_schema = __pyx_v_reader_schema;
5137   __pyx_t_1 = __pyx_f_8fastavro_5_read_read_time_micros(__pyx_v_data, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __pyx_L1_error)
5138   __Pyx_GOTREF(__pyx_t_1);
5139   __pyx_r = __pyx_t_1;
5140   __pyx_t_1 = 0;
5141   goto __pyx_L0;
5142 
5143   /* function exit code */
5144   __pyx_L1_error:;
5145   __Pyx_XDECREF(__pyx_t_1);
5146   __Pyx_AddTraceback("fastavro._read.read_time_micros", __pyx_clineno, __pyx_lineno, __pyx_filename);
5147   __pyx_r = NULL;
5148   __pyx_L0:;
5149   __Pyx_XGIVEREF(__pyx_r);
5150   __Pyx_RefNannyFinishContext();
5151   return __pyx_r;
5152 }
5153 
5154 /* "fastavro/_read.pyx":181
5155  *
5156  *
5157  * cpdef read_decimal(data, writer_schema=None, reader_schema=None):             # <<<<<<<<<<<<<<
5158  *     scale = writer_schema.get('scale', 0)
5159  *     precision = writer_schema['precision']
5160  */
5161 
5162 static PyObject *__pyx_pw_8fastavro_5_read_17read_decimal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_f_8fastavro_5_read_read_decimal(PyObject * __pyx_v_data,CYTHON_UNUSED int __pyx_skip_dispatch,struct __pyx_opt_args_8fastavro_5_read_read_decimal * __pyx_optional_args)5163 static PyObject *__pyx_f_8fastavro_5_read_read_decimal(PyObject *__pyx_v_data, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8fastavro_5_read_read_decimal *__pyx_optional_args) {
5164   PyObject *__pyx_v_writer_schema = ((PyObject *)Py_None);
5165   PyObject *__pyx_v_scale = NULL;
5166   PyObject *__pyx_v_precision = NULL;
5167   PyObject *__pyx_v_unscaled_datum = NULL;
5168   PyObject *__pyx_r = NULL;
5169   __Pyx_RefNannyDeclarations
5170   PyObject *__pyx_t_1 = NULL;
5171   PyObject *__pyx_t_2 = NULL;
5172   PyObject *__pyx_t_3 = NULL;
5173   PyObject *__pyx_t_4 = NULL;
5174   PyObject *__pyx_t_5 = NULL;
5175   int __pyx_t_6;
5176   PyObject *__pyx_t_7 = NULL;
5177   int __pyx_lineno = 0;
5178   const char *__pyx_filename = NULL;
5179   int __pyx_clineno = 0;
5180   __Pyx_RefNannySetupContext("read_decimal", 0);
5181   if (__pyx_optional_args) {
5182     if (__pyx_optional_args->__pyx_n > 0) {
5183       __pyx_v_writer_schema = __pyx_optional_args->writer_schema;
5184     }
5185   }
5186 
5187   /* "fastavro/_read.pyx":182
5188  *
5189  * cpdef read_decimal(data, writer_schema=None, reader_schema=None):
5190  *     scale = writer_schema.get('scale', 0)             # <<<<<<<<<<<<<<
5191  *     precision = writer_schema['precision']
5192  *
5193  */
5194   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_writer_schema, __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error)
5195   __Pyx_GOTREF(__pyx_t_1);
5196   __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 182, __pyx_L1_error)
5197   __Pyx_GOTREF(__pyx_t_2);
5198   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5199   __pyx_v_scale = __pyx_t_2;
5200   __pyx_t_2 = 0;
5201 
5202   /* "fastavro/_read.pyx":183
5203  * cpdef read_decimal(data, writer_schema=None, reader_schema=None):
5204  *     scale = writer_schema.get('scale', 0)
5205  *     precision = writer_schema['precision']             # <<<<<<<<<<<<<<
5206  *
5207  *     unscaled_datum = be_signed_bytes_to_int(data)
5208  */
5209   __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_writer_schema, __pyx_n_s_precision); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __pyx_L1_error)
5210   __Pyx_GOTREF(__pyx_t_2);
5211   __pyx_v_precision = __pyx_t_2;
5212   __pyx_t_2 = 0;
5213 
5214   /* "fastavro/_read.pyx":185
5215  *     precision = writer_schema['precision']
5216  *
5217  *     unscaled_datum = be_signed_bytes_to_int(data)             # <<<<<<<<<<<<<<
5218  *
5219  *     decimal_context.prec = precision
5220  */
5221   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_be_signed_bytes_to_int); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error)
5222   __Pyx_GOTREF(__pyx_t_1);
5223   __pyx_t_3 = NULL;
5224   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
5225     __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
5226     if (likely(__pyx_t_3)) {
5227       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
5228       __Pyx_INCREF(__pyx_t_3);
5229       __Pyx_INCREF(function);
5230       __Pyx_DECREF_SET(__pyx_t_1, function);
5231     }
5232   }
5233   __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_v_data) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_data);
5234   __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5235   if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L1_error)
5236   __Pyx_GOTREF(__pyx_t_2);
5237   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5238   __pyx_v_unscaled_datum = __pyx_t_2;
5239   __pyx_t_2 = 0;
5240 
5241   /* "fastavro/_read.pyx":187
5242  *     unscaled_datum = be_signed_bytes_to_int(data)
5243  *
5244  *     decimal_context.prec = precision             # <<<<<<<<<<<<<<
5245  *     return decimal_context.create_decimal(unscaled_datum).\
5246  *         scaleb(-scale, decimal_context)
5247  */
5248   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_decimal_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error)
5249   __Pyx_GOTREF(__pyx_t_2);
5250   if (__Pyx_PyObject_SetAttrStr(__pyx_t_2, __pyx_n_s_prec, __pyx_v_precision) < 0) __PYX_ERR(0, 187, __pyx_L1_error)
5251   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5252 
5253   /* "fastavro/_read.pyx":188
5254  *
5255  *     decimal_context.prec = precision
5256  *     return decimal_context.create_decimal(unscaled_datum).\             # <<<<<<<<<<<<<<
5257  *         scaleb(-scale, decimal_context)
5258  *
5259  */
5260   __Pyx_XDECREF(__pyx_r);
5261 
5262   /* "fastavro/_read.pyx":189
5263  *     decimal_context.prec = precision
5264  *     return decimal_context.create_decimal(unscaled_datum).\
5265  *         scaleb(-scale, decimal_context)             # <<<<<<<<<<<<<<
5266  *
5267  *
5268  */
5269   __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_decimal_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 188, __pyx_L1_error)
5270   __Pyx_GOTREF(__pyx_t_3);
5271 
5272   /* "fastavro/_read.pyx":188
5273  *
5274  *     decimal_context.prec = precision
5275  *     return decimal_context.create_decimal(unscaled_datum).\             # <<<<<<<<<<<<<<
5276  *         scaleb(-scale, decimal_context)
5277  *
5278  */
5279   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_create_decimal); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 188, __pyx_L1_error)
5280   __Pyx_GOTREF(__pyx_t_4);
5281   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5282   __pyx_t_3 = NULL;
5283   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
5284     __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
5285     if (likely(__pyx_t_3)) {
5286       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
5287       __Pyx_INCREF(__pyx_t_3);
5288       __Pyx_INCREF(function);
5289       __Pyx_DECREF_SET(__pyx_t_4, function);
5290     }
5291   }
5292   __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_v_unscaled_datum) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_unscaled_datum);
5293   __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5294   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 188, __pyx_L1_error)
5295   __Pyx_GOTREF(__pyx_t_1);
5296   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5297   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_scaleb); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 188, __pyx_L1_error)
5298   __Pyx_GOTREF(__pyx_t_4);
5299   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5300 
5301   /* "fastavro/_read.pyx":189
5302  *     decimal_context.prec = precision
5303  *     return decimal_context.create_decimal(unscaled_datum).\
5304  *         scaleb(-scale, decimal_context)             # <<<<<<<<<<<<<<
5305  *
5306  *
5307  */
5308   __pyx_t_1 = PyNumber_Negative(__pyx_v_scale); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error)
5309   __Pyx_GOTREF(__pyx_t_1);
5310   __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_decimal_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 189, __pyx_L1_error)
5311   __Pyx_GOTREF(__pyx_t_3);
5312   __pyx_t_5 = NULL;
5313   __pyx_t_6 = 0;
5314   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
5315     __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
5316     if (likely(__pyx_t_5)) {
5317       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
5318       __Pyx_INCREF(__pyx_t_5);
5319       __Pyx_INCREF(function);
5320       __Pyx_DECREF_SET(__pyx_t_4, function);
5321       __pyx_t_6 = 1;
5322     }
5323   }
5324   #if CYTHON_FAST_PYCALL
5325   if (PyFunction_Check(__pyx_t_4)) {
5326     PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_t_3};
5327     __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 189, __pyx_L1_error)
5328     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
5329     __Pyx_GOTREF(__pyx_t_2);
5330     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5331     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5332   } else
5333   #endif
5334   #if CYTHON_FAST_PYCCALL
5335   if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
5336     PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_t_3};
5337     __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 189, __pyx_L1_error)
5338     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
5339     __Pyx_GOTREF(__pyx_t_2);
5340     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5341     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5342   } else
5343   #endif
5344   {
5345     __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 189, __pyx_L1_error)
5346     __Pyx_GOTREF(__pyx_t_7);
5347     if (__pyx_t_5) {
5348       __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
5349     }
5350     __Pyx_GIVEREF(__pyx_t_1);
5351     PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_1);
5352     __Pyx_GIVEREF(__pyx_t_3);
5353     PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3);
5354     __pyx_t_1 = 0;
5355     __pyx_t_3 = 0;
5356     __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 189, __pyx_L1_error)
5357     __Pyx_GOTREF(__pyx_t_2);
5358     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5359   }
5360   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5361   __pyx_r = __pyx_t_2;
5362   __pyx_t_2 = 0;
5363   goto __pyx_L0;
5364 
5365   /* "fastavro/_read.pyx":181
5366  *
5367  *
5368  * cpdef read_decimal(data, writer_schema=None, reader_schema=None):             # <<<<<<<<<<<<<<
5369  *     scale = writer_schema.get('scale', 0)
5370  *     precision = writer_schema['precision']
5371  */
5372 
5373   /* function exit code */
5374   __pyx_L1_error:;
5375   __Pyx_XDECREF(__pyx_t_1);
5376   __Pyx_XDECREF(__pyx_t_2);
5377   __Pyx_XDECREF(__pyx_t_3);
5378   __Pyx_XDECREF(__pyx_t_4);
5379   __Pyx_XDECREF(__pyx_t_5);
5380   __Pyx_XDECREF(__pyx_t_7);
5381   __Pyx_AddTraceback("fastavro._read.read_decimal", __pyx_clineno, __pyx_lineno, __pyx_filename);
5382   __pyx_r = 0;
5383   __pyx_L0:;
5384   __Pyx_XDECREF(__pyx_v_scale);
5385   __Pyx_XDECREF(__pyx_v_precision);
5386   __Pyx_XDECREF(__pyx_v_unscaled_datum);
5387   __Pyx_XGIVEREF(__pyx_r);
5388   __Pyx_RefNannyFinishContext();
5389   return __pyx_r;
5390 }
5391 
5392 /* Python wrapper */
5393 static PyObject *__pyx_pw_8fastavro_5_read_17read_decimal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_8fastavro_5_read_17read_decimal(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)5394 static PyObject *__pyx_pw_8fastavro_5_read_17read_decimal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5395   PyObject *__pyx_v_data = 0;
5396   PyObject *__pyx_v_writer_schema = 0;
5397   PyObject *__pyx_v_reader_schema = 0;
5398   int __pyx_lineno = 0;
5399   const char *__pyx_filename = NULL;
5400   int __pyx_clineno = 0;
5401   PyObject *__pyx_r = 0;
5402   __Pyx_RefNannyDeclarations
5403   __Pyx_RefNannySetupContext("read_decimal (wrapper)", 0);
5404   {
5405     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_writer_schema,&__pyx_n_s_reader_schema,0};
5406     PyObject* values[3] = {0,0,0};
5407     values[1] = ((PyObject *)Py_None);
5408     values[2] = ((PyObject *)Py_None);
5409     if (unlikely(__pyx_kwds)) {
5410       Py_ssize_t kw_args;
5411       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5412       switch (pos_args) {
5413         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5414         CYTHON_FALLTHROUGH;
5415         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5416         CYTHON_FALLTHROUGH;
5417         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5418         CYTHON_FALLTHROUGH;
5419         case  0: break;
5420         default: goto __pyx_L5_argtuple_error;
5421       }
5422       kw_args = PyDict_Size(__pyx_kwds);
5423       switch (pos_args) {
5424         case  0:
5425         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
5426         else goto __pyx_L5_argtuple_error;
5427         CYTHON_FALLTHROUGH;
5428         case  1:
5429         if (kw_args > 0) {
5430           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_writer_schema);
5431           if (value) { values[1] = value; kw_args--; }
5432         }
5433         CYTHON_FALLTHROUGH;
5434         case  2:
5435         if (kw_args > 0) {
5436           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_reader_schema);
5437           if (value) { values[2] = value; kw_args--; }
5438         }
5439       }
5440       if (unlikely(kw_args > 0)) {
5441         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_decimal") < 0)) __PYX_ERR(0, 181, __pyx_L3_error)
5442       }
5443     } else {
5444       switch (PyTuple_GET_SIZE(__pyx_args)) {
5445         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5446         CYTHON_FALLTHROUGH;
5447         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5448         CYTHON_FALLTHROUGH;
5449         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5450         break;
5451         default: goto __pyx_L5_argtuple_error;
5452       }
5453     }
5454     __pyx_v_data = values[0];
5455     __pyx_v_writer_schema = values[1];
5456     __pyx_v_reader_schema = values[2];
5457   }
5458   goto __pyx_L4_argument_unpacking_done;
5459   __pyx_L5_argtuple_error:;
5460   __Pyx_RaiseArgtupleInvalid("read_decimal", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 181, __pyx_L3_error)
5461   __pyx_L3_error:;
5462   __Pyx_AddTraceback("fastavro._read.read_decimal", __pyx_clineno, __pyx_lineno, __pyx_filename);
5463   __Pyx_RefNannyFinishContext();
5464   return NULL;
5465   __pyx_L4_argument_unpacking_done:;
5466   __pyx_r = __pyx_pf_8fastavro_5_read_16read_decimal(__pyx_self, __pyx_v_data, __pyx_v_writer_schema, __pyx_v_reader_schema);
5467 
5468   /* function exit code */
5469   __Pyx_RefNannyFinishContext();
5470   return __pyx_r;
5471 }
5472 
__pyx_pf_8fastavro_5_read_16read_decimal(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_data,PyObject * __pyx_v_writer_schema,PyObject * __pyx_v_reader_schema)5473 static PyObject *__pyx_pf_8fastavro_5_read_16read_decimal(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_writer_schema, PyObject *__pyx_v_reader_schema) {
5474   PyObject *__pyx_r = NULL;
5475   __Pyx_RefNannyDeclarations
5476   PyObject *__pyx_t_1 = NULL;
5477   struct __pyx_opt_args_8fastavro_5_read_read_decimal __pyx_t_2;
5478   int __pyx_lineno = 0;
5479   const char *__pyx_filename = NULL;
5480   int __pyx_clineno = 0;
5481   __Pyx_RefNannySetupContext("read_decimal", 0);
5482   __Pyx_XDECREF(__pyx_r);
5483   __pyx_t_2.__pyx_n = 2;
5484   __pyx_t_2.writer_schema = __pyx_v_writer_schema;
5485   __pyx_t_2.reader_schema = __pyx_v_reader_schema;
5486   __pyx_t_1 = __pyx_f_8fastavro_5_read_read_decimal(__pyx_v_data, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error)
5487   __Pyx_GOTREF(__pyx_t_1);
5488   __pyx_r = __pyx_t_1;
5489   __pyx_t_1 = 0;
5490   goto __pyx_L0;
5491 
5492   /* function exit code */
5493   __pyx_L1_error:;
5494   __Pyx_XDECREF(__pyx_t_1);
5495   __Pyx_AddTraceback("fastavro._read.read_decimal", __pyx_clineno, __pyx_lineno, __pyx_filename);
5496   __pyx_r = NULL;
5497   __pyx_L0:;
5498   __Pyx_XGIVEREF(__pyx_r);
5499   __Pyx_RefNannyFinishContext();
5500   return __pyx_r;
5501 }
5502 
5503 /* "fastavro/_read.pyx":192
5504  *
5505  *
5506  * cdef long64 read_long(fo) except? -1:             # <<<<<<<<<<<<<<
5507  *     """int and long values are written using variable-length, zig-zag
5508  *     coding."""
5509  */
5510 
__pyx_f_8fastavro_5_read_read_long(PyObject * __pyx_v_fo)5511 static __pyx_t_8fastavro_5_read_long64 __pyx_f_8fastavro_5_read_read_long(PyObject *__pyx_v_fo) {
5512   __pyx_t_8fastavro_5_read_ulong64 __pyx_v_b;
5513   __pyx_t_8fastavro_5_read_ulong64 __pyx_v_n;
5514   __pyx_t_8fastavro_5_read_int32 __pyx_v_shift;
5515   PyObject *__pyx_v_c = 0;
5516   __pyx_t_8fastavro_5_read_long64 __pyx_r;
5517   __Pyx_RefNannyDeclarations
5518   PyObject *__pyx_t_1 = NULL;
5519   PyObject *__pyx_t_2 = NULL;
5520   PyObject *__pyx_t_3 = NULL;
5521   int __pyx_t_4;
5522   int __pyx_t_5;
5523   char __pyx_t_6;
5524   int __pyx_lineno = 0;
5525   const char *__pyx_filename = NULL;
5526   int __pyx_clineno = 0;
5527   __Pyx_RefNannySetupContext("read_long", 0);
5528 
5529   /* "fastavro/_read.pyx":198
5530  *     cdef ulong64 n
5531  *     cdef int32 shift
5532  *     cdef bytes c = fo.read(1)             # <<<<<<<<<<<<<<
5533  *
5534  *     # We do EOF checking only here, since most reader start here
5535  */
5536   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_fo, __pyx_n_s_read); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __pyx_L1_error)
5537   __Pyx_GOTREF(__pyx_t_2);
5538   __pyx_t_3 = NULL;
5539   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
5540     __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
5541     if (likely(__pyx_t_3)) {
5542       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
5543       __Pyx_INCREF(__pyx_t_3);
5544       __Pyx_INCREF(function);
5545       __Pyx_DECREF_SET(__pyx_t_2, function);
5546     }
5547   }
5548   __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_int_1);
5549   __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5550   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 198, __pyx_L1_error)
5551   __Pyx_GOTREF(__pyx_t_1);
5552   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5553   if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 198, __pyx_L1_error)
5554   __pyx_v_c = ((PyObject*)__pyx_t_1);
5555   __pyx_t_1 = 0;
5556 
5557   /* "fastavro/_read.pyx":201
5558  *
5559  *     # We do EOF checking only here, since most reader start here
5560  *     if not c:             # <<<<<<<<<<<<<<
5561  *         raise StopIteration
5562  *
5563  */
5564   __pyx_t_4 = (__pyx_v_c != Py_None)&&(PyBytes_GET_SIZE(__pyx_v_c) != 0);
5565   __pyx_t_5 = ((!__pyx_t_4) != 0);
5566   if (unlikely(__pyx_t_5)) {
5567 
5568     /* "fastavro/_read.pyx":202
5569  *     # We do EOF checking only here, since most reader start here
5570  *     if not c:
5571  *         raise StopIteration             # <<<<<<<<<<<<<<
5572  *
5573  *     b = <unsigned char>(c[0])
5574  */
5575     __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
5576     __PYX_ERR(0, 202, __pyx_L1_error)
5577 
5578     /* "fastavro/_read.pyx":201
5579  *
5580  *     # We do EOF checking only here, since most reader start here
5581  *     if not c:             # <<<<<<<<<<<<<<
5582  *         raise StopIteration
5583  *
5584  */
5585   }
5586 
5587   /* "fastavro/_read.pyx":204
5588  *         raise StopIteration
5589  *
5590  *     b = <unsigned char>(c[0])             # <<<<<<<<<<<<<<
5591  *     n = b & 0x7F
5592  *     shift = 7
5593  */
5594   if (unlikely(__pyx_v_c == Py_None)) {
5595     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
5596     __PYX_ERR(0, 204, __pyx_L1_error)
5597   }
5598   __pyx_t_6 = __Pyx_PyBytes_GetItemInt(__pyx_v_c, 0, 1); if (unlikely(__pyx_t_6 == ((char)((char)-1)) && PyErr_Occurred())) __PYX_ERR(0, 204, __pyx_L1_error)
5599   __pyx_v_b = ((unsigned char)__pyx_t_6);
5600 
5601   /* "fastavro/_read.pyx":205
5602  *
5603  *     b = <unsigned char>(c[0])
5604  *     n = b & 0x7F             # <<<<<<<<<<<<<<
5605  *     shift = 7
5606  *
5607  */
5608   __pyx_v_n = (__pyx_v_b & 0x7F);
5609 
5610   /* "fastavro/_read.pyx":206
5611  *     b = <unsigned char>(c[0])
5612  *     n = b & 0x7F
5613  *     shift = 7             # <<<<<<<<<<<<<<
5614  *
5615  *     while (b & 0x80) != 0:
5616  */
5617   __pyx_v_shift = 7;
5618 
5619   /* "fastavro/_read.pyx":208
5620  *     shift = 7
5621  *
5622  *     while (b & 0x80) != 0:             # <<<<<<<<<<<<<<
5623  *         c = fo.read(1)
5624  *         b = <unsigned char>(c[0])
5625  */
5626   while (1) {
5627     __pyx_t_5 = (((__pyx_v_b & 0x80) != 0) != 0);
5628     if (!__pyx_t_5) break;
5629 
5630     /* "fastavro/_read.pyx":209
5631  *
5632  *     while (b & 0x80) != 0:
5633  *         c = fo.read(1)             # <<<<<<<<<<<<<<
5634  *         b = <unsigned char>(c[0])
5635  *         n |= (b & 0x7F) << shift
5636  */
5637     __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_fo, __pyx_n_s_read); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 209, __pyx_L1_error)
5638     __Pyx_GOTREF(__pyx_t_2);
5639     __pyx_t_3 = NULL;
5640     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
5641       __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
5642       if (likely(__pyx_t_3)) {
5643         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
5644         __Pyx_INCREF(__pyx_t_3);
5645         __Pyx_INCREF(function);
5646         __Pyx_DECREF_SET(__pyx_t_2, function);
5647       }
5648     }
5649     __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_int_1);
5650     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5651     if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error)
5652     __Pyx_GOTREF(__pyx_t_1);
5653     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5654     if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 209, __pyx_L1_error)
5655     __Pyx_DECREF_SET(__pyx_v_c, ((PyObject*)__pyx_t_1));
5656     __pyx_t_1 = 0;
5657 
5658     /* "fastavro/_read.pyx":210
5659  *     while (b & 0x80) != 0:
5660  *         c = fo.read(1)
5661  *         b = <unsigned char>(c[0])             # <<<<<<<<<<<<<<
5662  *         n |= (b & 0x7F) << shift
5663  *         shift += 7
5664  */
5665     if (unlikely(__pyx_v_c == Py_None)) {
5666       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
5667       __PYX_ERR(0, 210, __pyx_L1_error)
5668     }
5669     __pyx_t_6 = __Pyx_PyBytes_GetItemInt(__pyx_v_c, 0, 1); if (unlikely(__pyx_t_6 == ((char)((char)-1)) && PyErr_Occurred())) __PYX_ERR(0, 210, __pyx_L1_error)
5670     __pyx_v_b = ((unsigned char)__pyx_t_6);
5671 
5672     /* "fastavro/_read.pyx":211
5673  *         c = fo.read(1)
5674  *         b = <unsigned char>(c[0])
5675  *         n |= (b & 0x7F) << shift             # <<<<<<<<<<<<<<
5676  *         shift += 7
5677  *
5678  */
5679     __pyx_v_n = (__pyx_v_n | ((__pyx_v_b & 0x7F) << __pyx_v_shift));
5680 
5681     /* "fastavro/_read.pyx":212
5682  *         b = <unsigned char>(c[0])
5683  *         n |= (b & 0x7F) << shift
5684  *         shift += 7             # <<<<<<<<<<<<<<
5685  *
5686  *     return (n >> 1) ^ -(n & 1)
5687  */
5688     __pyx_v_shift = (__pyx_v_shift + 7);
5689   }
5690 
5691   /* "fastavro/_read.pyx":214
5692  *         shift += 7
5693  *
5694  *     return (n >> 1) ^ -(n & 1)             # <<<<<<<<<<<<<<
5695  *
5696  *
5697  */
5698   __pyx_r = ((__pyx_v_n >> 1) ^ (-(__pyx_v_n & 1)));
5699   goto __pyx_L0;
5700 
5701   /* "fastavro/_read.pyx":192
5702  *
5703  *
5704  * cdef long64 read_long(fo) except? -1:             # <<<<<<<<<<<<<<
5705  *     """int and long values are written using variable-length, zig-zag
5706  *     coding."""
5707  */
5708 
5709   /* function exit code */
5710   __pyx_L1_error:;
5711   __Pyx_XDECREF(__pyx_t_1);
5712   __Pyx_XDECREF(__pyx_t_2);
5713   __Pyx_XDECREF(__pyx_t_3);
5714   __Pyx_AddTraceback("fastavro._read.read_long", __pyx_clineno, __pyx_lineno, __pyx_filename);
5715   __pyx_r = -1LL;
5716   __pyx_L0:;
5717   __Pyx_XDECREF(__pyx_v_c);
5718   __Pyx_RefNannyFinishContext();
5719   return __pyx_r;
5720 }
5721 
5722 /* "fastavro/_read.pyx":222
5723  *
5724  *
5725  * cdef read_float(fo):             # <<<<<<<<<<<<<<
5726  *     """A float is written as 4 bytes.
5727  *
5728  */
5729 
__pyx_f_8fastavro_5_read_read_float(PyObject * __pyx_v_fo)5730 static PyObject *__pyx_f_8fastavro_5_read_read_float(PyObject *__pyx_v_fo) {
5731   PyObject *__pyx_v_data = 0;
5732   unsigned char __pyx_v_ch_data[4];
5733   union __pyx_t_8fastavro_5_read_float_uint32 __pyx_v_fi;
5734   PyObject *__pyx_r = NULL;
5735   __Pyx_RefNannyDeclarations
5736   PyObject *__pyx_t_1 = NULL;
5737   PyObject *__pyx_t_2 = NULL;
5738   PyObject *__pyx_t_3 = NULL;
5739   Py_ssize_t __pyx_t_4;
5740   int __pyx_t_5;
5741   unsigned char *__pyx_t_6;
5742   int __pyx_lineno = 0;
5743   const char *__pyx_filename = NULL;
5744   int __pyx_clineno = 0;
5745   __Pyx_RefNannySetupContext("read_float", 0);
5746 
5747   /* "fastavro/_read.pyx":231
5748  *     cdef unsigned char ch_data[4]
5749  *     cdef float_uint32 fi
5750  *     data = fo.read(4)             # <<<<<<<<<<<<<<
5751  *     if len(data) == 4:
5752  *         ch_data[:4] = data
5753  */
5754   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_fo, __pyx_n_s_read); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error)
5755   __Pyx_GOTREF(__pyx_t_2);
5756   __pyx_t_3 = NULL;
5757   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
5758     __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
5759     if (likely(__pyx_t_3)) {
5760       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
5761       __Pyx_INCREF(__pyx_t_3);
5762       __Pyx_INCREF(function);
5763       __Pyx_DECREF_SET(__pyx_t_2, function);
5764     }
5765   }
5766   __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_int_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_int_4);
5767   __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5768   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error)
5769   __Pyx_GOTREF(__pyx_t_1);
5770   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5771   if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 231, __pyx_L1_error)
5772   __pyx_v_data = ((PyObject*)__pyx_t_1);
5773   __pyx_t_1 = 0;
5774 
5775   /* "fastavro/_read.pyx":232
5776  *     cdef float_uint32 fi
5777  *     data = fo.read(4)
5778  *     if len(data) == 4:             # <<<<<<<<<<<<<<
5779  *         ch_data[:4] = data
5780  *         fi.n = (ch_data[0]
5781  */
5782   if (unlikely(__pyx_v_data == Py_None)) {
5783     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
5784     __PYX_ERR(0, 232, __pyx_L1_error)
5785   }
5786   __pyx_t_4 = PyBytes_GET_SIZE(__pyx_v_data); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 232, __pyx_L1_error)
5787   __pyx_t_5 = ((__pyx_t_4 == 4) != 0);
5788   if (likely(__pyx_t_5)) {
5789 
5790     /* "fastavro/_read.pyx":233
5791  *     data = fo.read(4)
5792  *     if len(data) == 4:
5793  *         ch_data[:4] = data             # <<<<<<<<<<<<<<
5794  *         fi.n = (ch_data[0]
5795  *                 | (ch_data[1] << 8)
5796  */
5797     if (unlikely(__pyx_v_data == Py_None)) {
5798       PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
5799       __PYX_ERR(0, 233, __pyx_L1_error)
5800     }
5801     __pyx_t_6 = __Pyx_PyBytes_AsWritableUString(__pyx_v_data); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 233, __pyx_L1_error)
5802     memcpy(&(__pyx_v_ch_data[0]), __pyx_t_6, sizeof(__pyx_v_ch_data[0]) * (4 - 0));
5803 
5804     /* "fastavro/_read.pyx":234
5805  *     if len(data) == 4:
5806  *         ch_data[:4] = data
5807  *         fi.n = (ch_data[0]             # <<<<<<<<<<<<<<
5808  *                 | (ch_data[1] << 8)
5809  *                 | (ch_data[2] << 16)
5810  */
5811     __pyx_v_fi.n = ((((__pyx_v_ch_data[0]) | ((__pyx_v_ch_data[1]) << 8)) | ((__pyx_v_ch_data[2]) << 16)) | ((__pyx_v_ch_data[3]) << 24));
5812 
5813     /* "fastavro/_read.pyx":238
5814  *                 | (ch_data[2] << 16)
5815  *                 | (ch_data[3] << 24))
5816  *         return fi.f             # <<<<<<<<<<<<<<
5817  *     else:
5818  *         raise ReadError
5819  */
5820     __Pyx_XDECREF(__pyx_r);
5821     __pyx_t_1 = PyFloat_FromDouble(__pyx_v_fi.f); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error)
5822     __Pyx_GOTREF(__pyx_t_1);
5823     __pyx_r = __pyx_t_1;
5824     __pyx_t_1 = 0;
5825     goto __pyx_L0;
5826 
5827     /* "fastavro/_read.pyx":232
5828  *     cdef float_uint32 fi
5829  *     data = fo.read(4)
5830  *     if len(data) == 4:             # <<<<<<<<<<<<<<
5831  *         ch_data[:4] = data
5832  *         fi.n = (ch_data[0]
5833  */
5834   }
5835 
5836   /* "fastavro/_read.pyx":240
5837  *         return fi.f
5838  *     else:
5839  *         raise ReadError             # <<<<<<<<<<<<<<
5840  *
5841  *
5842  */
5843   /*else*/ {
5844     __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ReadError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error)
5845     __Pyx_GOTREF(__pyx_t_1);
5846     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5847     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5848     __PYX_ERR(0, 240, __pyx_L1_error)
5849   }
5850 
5851   /* "fastavro/_read.pyx":222
5852  *
5853  *
5854  * cdef read_float(fo):             # <<<<<<<<<<<<<<
5855  *     """A float is written as 4 bytes.
5856  *
5857  */
5858 
5859   /* function exit code */
5860   __pyx_L1_error:;
5861   __Pyx_XDECREF(__pyx_t_1);
5862   __Pyx_XDECREF(__pyx_t_2);
5863   __Pyx_XDECREF(__pyx_t_3);
5864   __Pyx_AddTraceback("fastavro._read.read_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
5865   __pyx_r = 0;
5866   __pyx_L0:;
5867   __Pyx_XDECREF(__pyx_v_data);
5868   __Pyx_XGIVEREF(__pyx_r);
5869   __Pyx_RefNannyFinishContext();
5870   return __pyx_r;
5871 }
5872 
5873 /* "fastavro/_read.pyx":248
5874  *
5875  *
5876  * cdef read_double(fo):             # <<<<<<<<<<<<<<
5877  *     """A double is written as 8 bytes.
5878  *
5879  */
5880 
__pyx_f_8fastavro_5_read_read_double(PyObject * __pyx_v_fo)5881 static PyObject *__pyx_f_8fastavro_5_read_read_double(PyObject *__pyx_v_fo) {
5882   PyObject *__pyx_v_data = 0;
5883   unsigned char __pyx_v_ch_data[8];
5884   union __pyx_t_8fastavro_5_read_double_ulong64 __pyx_v_dl;
5885   PyObject *__pyx_r = NULL;
5886   __Pyx_RefNannyDeclarations
5887   PyObject *__pyx_t_1 = NULL;
5888   PyObject *__pyx_t_2 = NULL;
5889   PyObject *__pyx_t_3 = NULL;
5890   Py_ssize_t __pyx_t_4;
5891   int __pyx_t_5;
5892   unsigned char *__pyx_t_6;
5893   int __pyx_lineno = 0;
5894   const char *__pyx_filename = NULL;
5895   int __pyx_clineno = 0;
5896   __Pyx_RefNannySetupContext("read_double", 0);
5897 
5898   /* "fastavro/_read.pyx":257
5899  *     cdef unsigned char ch_data[8]
5900  *     cdef double_ulong64 dl
5901  *     data = fo.read(8)             # <<<<<<<<<<<<<<
5902  *     if len(data) == 8:
5903  *         ch_data[:8] = data
5904  */
5905   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_fo, __pyx_n_s_read); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error)
5906   __Pyx_GOTREF(__pyx_t_2);
5907   __pyx_t_3 = NULL;
5908   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
5909     __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
5910     if (likely(__pyx_t_3)) {
5911       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
5912       __Pyx_INCREF(__pyx_t_3);
5913       __Pyx_INCREF(function);
5914       __Pyx_DECREF_SET(__pyx_t_2, function);
5915     }
5916   }
5917   __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_int_8) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_int_8);
5918   __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5919   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __pyx_L1_error)
5920   __Pyx_GOTREF(__pyx_t_1);
5921   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5922   if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 257, __pyx_L1_error)
5923   __pyx_v_data = ((PyObject*)__pyx_t_1);
5924   __pyx_t_1 = 0;
5925 
5926   /* "fastavro/_read.pyx":258
5927  *     cdef double_ulong64 dl
5928  *     data = fo.read(8)
5929  *     if len(data) == 8:             # <<<<<<<<<<<<<<
5930  *         ch_data[:8] = data
5931  *         dl.n = (ch_data[0]
5932  */
5933   if (unlikely(__pyx_v_data == Py_None)) {
5934     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
5935     __PYX_ERR(0, 258, __pyx_L1_error)
5936   }
5937   __pyx_t_4 = PyBytes_GET_SIZE(__pyx_v_data); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 258, __pyx_L1_error)
5938   __pyx_t_5 = ((__pyx_t_4 == 8) != 0);
5939   if (likely(__pyx_t_5)) {
5940 
5941     /* "fastavro/_read.pyx":259
5942  *     data = fo.read(8)
5943  *     if len(data) == 8:
5944  *         ch_data[:8] = data             # <<<<<<<<<<<<<<
5945  *         dl.n = (ch_data[0]
5946  *                 | (<ulong64>(ch_data[1]) << 8)
5947  */
5948     if (unlikely(__pyx_v_data == Py_None)) {
5949       PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
5950       __PYX_ERR(0, 259, __pyx_L1_error)
5951     }
5952     __pyx_t_6 = __Pyx_PyBytes_AsWritableUString(__pyx_v_data); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 259, __pyx_L1_error)
5953     memcpy(&(__pyx_v_ch_data[0]), __pyx_t_6, sizeof(__pyx_v_ch_data[0]) * (8 - 0));
5954 
5955     /* "fastavro/_read.pyx":260
5956  *     if len(data) == 8:
5957  *         ch_data[:8] = data
5958  *         dl.n = (ch_data[0]             # <<<<<<<<<<<<<<
5959  *                 | (<ulong64>(ch_data[1]) << 8)
5960  *                 | (<ulong64>(ch_data[2]) << 16)
5961  */
5962     __pyx_v_dl.n = ((((((((__pyx_v_ch_data[0]) | (((__pyx_t_8fastavro_5_read_ulong64)(__pyx_v_ch_data[1])) << 8)) | (((__pyx_t_8fastavro_5_read_ulong64)(__pyx_v_ch_data[2])) << 16)) | (((__pyx_t_8fastavro_5_read_ulong64)(__pyx_v_ch_data[3])) << 24)) | (((__pyx_t_8fastavro_5_read_ulong64)(__pyx_v_ch_data[4])) << 32)) | (((__pyx_t_8fastavro_5_read_ulong64)(__pyx_v_ch_data[5])) << 40)) | (((__pyx_t_8fastavro_5_read_ulong64)(__pyx_v_ch_data[6])) << 48)) | (((__pyx_t_8fastavro_5_read_ulong64)(__pyx_v_ch_data[7])) << 56));
5963 
5964     /* "fastavro/_read.pyx":268
5965  *                 | (<ulong64>(ch_data[6]) << 48)
5966  *                 | (<ulong64>(ch_data[7]) << 56))
5967  *         return dl.d             # <<<<<<<<<<<<<<
5968  *     else:
5969  *         raise ReadError
5970  */
5971     __Pyx_XDECREF(__pyx_r);
5972     __pyx_t_1 = PyFloat_FromDouble(__pyx_v_dl.d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error)
5973     __Pyx_GOTREF(__pyx_t_1);
5974     __pyx_r = __pyx_t_1;
5975     __pyx_t_1 = 0;
5976     goto __pyx_L0;
5977 
5978     /* "fastavro/_read.pyx":258
5979  *     cdef double_ulong64 dl
5980  *     data = fo.read(8)
5981  *     if len(data) == 8:             # <<<<<<<<<<<<<<
5982  *         ch_data[:8] = data
5983  *         dl.n = (ch_data[0]
5984  */
5985   }
5986 
5987   /* "fastavro/_read.pyx":270
5988  *         return dl.d
5989  *     else:
5990  *         raise ReadError             # <<<<<<<<<<<<<<
5991  *
5992  *
5993  */
5994   /*else*/ {
5995     __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ReadError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error)
5996     __Pyx_GOTREF(__pyx_t_1);
5997     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5998     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5999     __PYX_ERR(0, 270, __pyx_L1_error)
6000   }
6001 
6002   /* "fastavro/_read.pyx":248
6003  *
6004  *
6005  * cdef read_double(fo):             # <<<<<<<<<<<<<<
6006  *     """A double is written as 8 bytes.
6007  *
6008  */
6009 
6010   /* function exit code */
6011   __pyx_L1_error:;
6012   __Pyx_XDECREF(__pyx_t_1);
6013   __Pyx_XDECREF(__pyx_t_2);
6014   __Pyx_XDECREF(__pyx_t_3);
6015   __Pyx_AddTraceback("fastavro._read.read_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
6016   __pyx_r = 0;
6017   __pyx_L0:;
6018   __Pyx_XDECREF(__pyx_v_data);
6019   __Pyx_XGIVEREF(__pyx_r);
6020   __Pyx_RefNannyFinishContext();
6021   return __pyx_r;
6022 }
6023 
6024 /* "fastavro/_read.pyx":273
6025  *
6026  *
6027  * cdef read_bytes(fo):             # <<<<<<<<<<<<<<
6028  *     """Bytes are encoded as a long followed by that many bytes of data."""
6029  *     cdef long64 size = read_long(fo)
6030  */
6031 
__pyx_f_8fastavro_5_read_read_bytes(PyObject * __pyx_v_fo)6032 static PyObject *__pyx_f_8fastavro_5_read_read_bytes(PyObject *__pyx_v_fo) {
6033   __pyx_t_8fastavro_5_read_long64 __pyx_v_size;
6034   PyObject *__pyx_r = NULL;
6035   __Pyx_RefNannyDeclarations
6036   __pyx_t_8fastavro_5_read_long64 __pyx_t_1;
6037   PyObject *__pyx_t_2 = NULL;
6038   PyObject *__pyx_t_3 = NULL;
6039   PyObject *__pyx_t_4 = NULL;
6040   PyObject *__pyx_t_5 = NULL;
6041   int __pyx_lineno = 0;
6042   const char *__pyx_filename = NULL;
6043   int __pyx_clineno = 0;
6044   __Pyx_RefNannySetupContext("read_bytes", 0);
6045 
6046   /* "fastavro/_read.pyx":275
6047  * cdef read_bytes(fo):
6048  *     """Bytes are encoded as a long followed by that many bytes of data."""
6049  *     cdef long64 size = read_long(fo)             # <<<<<<<<<<<<<<
6050  *     return fo.read(<long>size)
6051  *
6052  */
6053   __pyx_t_1 = __pyx_f_8fastavro_5_read_read_long(__pyx_v_fo); if (unlikely(__pyx_t_1 == ((__pyx_t_8fastavro_5_read_long64)-1LL) && PyErr_Occurred())) __PYX_ERR(0, 275, __pyx_L1_error)
6054   __pyx_v_size = __pyx_t_1;
6055 
6056   /* "fastavro/_read.pyx":276
6057  *     """Bytes are encoded as a long followed by that many bytes of data."""
6058  *     cdef long64 size = read_long(fo)
6059  *     return fo.read(<long>size)             # <<<<<<<<<<<<<<
6060  *
6061  *
6062  */
6063   __Pyx_XDECREF(__pyx_r);
6064   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_fo, __pyx_n_s_read); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 276, __pyx_L1_error)
6065   __Pyx_GOTREF(__pyx_t_3);
6066   __pyx_t_4 = __Pyx_PyInt_From_long(((long)__pyx_v_size)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 276, __pyx_L1_error)
6067   __Pyx_GOTREF(__pyx_t_4);
6068   __pyx_t_5 = NULL;
6069   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
6070     __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
6071     if (likely(__pyx_t_5)) {
6072       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
6073       __Pyx_INCREF(__pyx_t_5);
6074       __Pyx_INCREF(function);
6075       __Pyx_DECREF_SET(__pyx_t_3, function);
6076     }
6077   }
6078   __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
6079   __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
6080   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6081   if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 276, __pyx_L1_error)
6082   __Pyx_GOTREF(__pyx_t_2);
6083   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6084   __pyx_r = __pyx_t_2;
6085   __pyx_t_2 = 0;
6086   goto __pyx_L0;
6087 
6088   /* "fastavro/_read.pyx":273
6089  *
6090  *
6091  * cdef read_bytes(fo):             # <<<<<<<<<<<<<<
6092  *     """Bytes are encoded as a long followed by that many bytes of data."""
6093  *     cdef long64 size = read_long(fo)
6094  */
6095 
6096   /* function exit code */
6097   __pyx_L1_error:;
6098   __Pyx_XDECREF(__pyx_t_2);
6099   __Pyx_XDECREF(__pyx_t_3);
6100   __Pyx_XDECREF(__pyx_t_4);
6101   __Pyx_XDECREF(__pyx_t_5);
6102   __Pyx_AddTraceback("fastavro._read.read_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename);
6103   __pyx_r = 0;
6104   __pyx_L0:;
6105   __Pyx_XGIVEREF(__pyx_r);
6106   __Pyx_RefNannyFinishContext();
6107   return __pyx_r;
6108 }
6109 
6110 /* "fastavro/_read.pyx":279
6111  *
6112  *
6113  * cdef unicode read_utf8(fo):             # <<<<<<<<<<<<<<
6114  *     """A string is encoded as a long followed by that many bytes of UTF-8
6115  *     encoded character data.
6116  */
6117 
__pyx_f_8fastavro_5_read_read_utf8(PyObject * __pyx_v_fo)6118 static PyObject *__pyx_f_8fastavro_5_read_read_utf8(PyObject *__pyx_v_fo) {
6119   PyObject *__pyx_r = NULL;
6120   __Pyx_RefNannyDeclarations
6121   PyObject *__pyx_t_1 = NULL;
6122   PyObject *__pyx_t_2 = NULL;
6123   PyObject *__pyx_t_3 = NULL;
6124   PyObject *__pyx_t_4 = NULL;
6125   int __pyx_t_5;
6126   PyObject *__pyx_t_6 = NULL;
6127   int __pyx_lineno = 0;
6128   const char *__pyx_filename = NULL;
6129   int __pyx_clineno = 0;
6130   __Pyx_RefNannySetupContext("read_utf8", 0);
6131 
6132   /* "fastavro/_read.pyx":283
6133  *     encoded character data.
6134  *     """
6135  *     return btou(read_bytes(fo), 'utf-8')             # <<<<<<<<<<<<<<
6136  *
6137  *
6138  */
6139   __Pyx_XDECREF(__pyx_r);
6140   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_btou); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 283, __pyx_L1_error)
6141   __Pyx_GOTREF(__pyx_t_2);
6142   __pyx_t_3 = __pyx_f_8fastavro_5_read_read_bytes(__pyx_v_fo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 283, __pyx_L1_error)
6143   __Pyx_GOTREF(__pyx_t_3);
6144   __pyx_t_4 = NULL;
6145   __pyx_t_5 = 0;
6146   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
6147     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
6148     if (likely(__pyx_t_4)) {
6149       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
6150       __Pyx_INCREF(__pyx_t_4);
6151       __Pyx_INCREF(function);
6152       __Pyx_DECREF_SET(__pyx_t_2, function);
6153       __pyx_t_5 = 1;
6154     }
6155   }
6156   #if CYTHON_FAST_PYCALL
6157   if (PyFunction_Check(__pyx_t_2)) {
6158     PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_kp_s_utf_8};
6159     __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, 283, __pyx_L1_error)
6160     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6161     __Pyx_GOTREF(__pyx_t_1);
6162     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6163   } else
6164   #endif
6165   #if CYTHON_FAST_PYCCALL
6166   if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
6167     PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_kp_s_utf_8};
6168     __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, 283, __pyx_L1_error)
6169     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6170     __Pyx_GOTREF(__pyx_t_1);
6171     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6172   } else
6173   #endif
6174   {
6175     __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 283, __pyx_L1_error)
6176     __Pyx_GOTREF(__pyx_t_6);
6177     if (__pyx_t_4) {
6178       __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
6179     }
6180     __Pyx_GIVEREF(__pyx_t_3);
6181     PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_3);
6182     __Pyx_INCREF(__pyx_kp_s_utf_8);
6183     __Pyx_GIVEREF(__pyx_kp_s_utf_8);
6184     PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_kp_s_utf_8);
6185     __pyx_t_3 = 0;
6186     __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 283, __pyx_L1_error)
6187     __Pyx_GOTREF(__pyx_t_1);
6188     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6189   }
6190   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6191   if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 283, __pyx_L1_error)
6192   __pyx_r = ((PyObject*)__pyx_t_1);
6193   __pyx_t_1 = 0;
6194   goto __pyx_L0;
6195 
6196   /* "fastavro/_read.pyx":279
6197  *
6198  *
6199  * cdef unicode read_utf8(fo):             # <<<<<<<<<<<<<<
6200  *     """A string is encoded as a long followed by that many bytes of UTF-8
6201  *     encoded character data.
6202  */
6203 
6204   /* function exit code */
6205   __pyx_L1_error:;
6206   __Pyx_XDECREF(__pyx_t_1);
6207   __Pyx_XDECREF(__pyx_t_2);
6208   __Pyx_XDECREF(__pyx_t_3);
6209   __Pyx_XDECREF(__pyx_t_4);
6210   __Pyx_XDECREF(__pyx_t_6);
6211   __Pyx_AddTraceback("fastavro._read.read_utf8", __pyx_clineno, __pyx_lineno, __pyx_filename);
6212   __pyx_r = 0;
6213   __pyx_L0:;
6214   __Pyx_XGIVEREF(__pyx_r);
6215   __Pyx_RefNannyFinishContext();
6216   return __pyx_r;
6217 }
6218 
6219 /* "fastavro/_read.pyx":286
6220  *
6221  *
6222  * cdef read_fixed(fo, writer_schema):             # <<<<<<<<<<<<<<
6223  *     """Fixed instances are encoded using the number of bytes declared in the
6224  *     schema."""
6225  */
6226 
__pyx_f_8fastavro_5_read_read_fixed(PyObject * __pyx_v_fo,PyObject * __pyx_v_writer_schema)6227 static PyObject *__pyx_f_8fastavro_5_read_read_fixed(PyObject *__pyx_v_fo, PyObject *__pyx_v_writer_schema) {
6228   PyObject *__pyx_r = NULL;
6229   __Pyx_RefNannyDeclarations
6230   PyObject *__pyx_t_1 = NULL;
6231   PyObject *__pyx_t_2 = NULL;
6232   PyObject *__pyx_t_3 = NULL;
6233   PyObject *__pyx_t_4 = NULL;
6234   int __pyx_lineno = 0;
6235   const char *__pyx_filename = NULL;
6236   int __pyx_clineno = 0;
6237   __Pyx_RefNannySetupContext("read_fixed", 0);
6238 
6239   /* "fastavro/_read.pyx":289
6240  *     """Fixed instances are encoded using the number of bytes declared in the
6241  *     schema."""
6242  *     return fo.read(writer_schema['size'])             # <<<<<<<<<<<<<<
6243  *
6244  *
6245  */
6246   __Pyx_XDECREF(__pyx_r);
6247   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_fo, __pyx_n_s_read); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 289, __pyx_L1_error)
6248   __Pyx_GOTREF(__pyx_t_2);
6249   __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_writer_schema, __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 289, __pyx_L1_error)
6250   __Pyx_GOTREF(__pyx_t_3);
6251   __pyx_t_4 = NULL;
6252   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
6253     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
6254     if (likely(__pyx_t_4)) {
6255       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
6256       __Pyx_INCREF(__pyx_t_4);
6257       __Pyx_INCREF(function);
6258       __Pyx_DECREF_SET(__pyx_t_2, function);
6259     }
6260   }
6261   __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
6262   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6263   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6264   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 289, __pyx_L1_error)
6265   __Pyx_GOTREF(__pyx_t_1);
6266   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6267   __pyx_r = __pyx_t_1;
6268   __pyx_t_1 = 0;
6269   goto __pyx_L0;
6270 
6271   /* "fastavro/_read.pyx":286
6272  *
6273  *
6274  * cdef read_fixed(fo, writer_schema):             # <<<<<<<<<<<<<<
6275  *     """Fixed instances are encoded using the number of bytes declared in the
6276  *     schema."""
6277  */
6278 
6279   /* function exit code */
6280   __pyx_L1_error:;
6281   __Pyx_XDECREF(__pyx_t_1);
6282   __Pyx_XDECREF(__pyx_t_2);
6283   __Pyx_XDECREF(__pyx_t_3);
6284   __Pyx_XDECREF(__pyx_t_4);
6285   __Pyx_AddTraceback("fastavro._read.read_fixed", __pyx_clineno, __pyx_lineno, __pyx_filename);
6286   __pyx_r = 0;
6287   __pyx_L0:;
6288   __Pyx_XGIVEREF(__pyx_r);
6289   __Pyx_RefNannyFinishContext();
6290   return __pyx_r;
6291 }
6292 
6293 /* "fastavro/_read.pyx":292
6294  *
6295  *
6296  * cdef read_enum(fo, writer_schema, reader_schema):             # <<<<<<<<<<<<<<
6297  *     """An enum is encoded by a int, representing the zero-based position of the
6298  *     symbol in the schema.
6299  */
6300 
__pyx_f_8fastavro_5_read_read_enum(PyObject * __pyx_v_fo,PyObject * __pyx_v_writer_schema,PyObject * __pyx_v_reader_schema)6301 static PyObject *__pyx_f_8fastavro_5_read_read_enum(PyObject *__pyx_v_fo, PyObject *__pyx_v_writer_schema, PyObject *__pyx_v_reader_schema) {
6302   __pyx_t_8fastavro_5_read_long64 __pyx_v_index;
6303   PyObject *__pyx_v_symbol = NULL;
6304   PyObject *__pyx_v_default = NULL;
6305   PyObject *__pyx_v_symlist = NULL;
6306   PyObject *__pyx_v_msg = NULL;
6307   PyObject *__pyx_r = NULL;
6308   __Pyx_RefNannyDeclarations
6309   __pyx_t_8fastavro_5_read_long64 __pyx_t_1;
6310   PyObject *__pyx_t_2 = NULL;
6311   PyObject *__pyx_t_3 = NULL;
6312   int __pyx_t_4;
6313   int __pyx_t_5;
6314   int __pyx_t_6;
6315   PyObject *__pyx_t_7 = NULL;
6316   int __pyx_lineno = 0;
6317   const char *__pyx_filename = NULL;
6318   int __pyx_clineno = 0;
6319   __Pyx_RefNannySetupContext("read_enum", 0);
6320 
6321   /* "fastavro/_read.pyx":296
6322  *     symbol in the schema.
6323  *     """
6324  *     index = read_long(fo)             # <<<<<<<<<<<<<<
6325  *     symbol = writer_schema['symbols'][index]
6326  *     if reader_schema and symbol not in reader_schema['symbols']:
6327  */
6328   __pyx_t_1 = __pyx_f_8fastavro_5_read_read_long(__pyx_v_fo); if (unlikely(__pyx_t_1 == ((__pyx_t_8fastavro_5_read_long64)-1LL) && PyErr_Occurred())) __PYX_ERR(0, 296, __pyx_L1_error)
6329   __pyx_v_index = __pyx_t_1;
6330 
6331   /* "fastavro/_read.pyx":297
6332  *     """
6333  *     index = read_long(fo)
6334  *     symbol = writer_schema['symbols'][index]             # <<<<<<<<<<<<<<
6335  *     if reader_schema and symbol not in reader_schema['symbols']:
6336  *         default = reader_schema.get("default")
6337  */
6338   __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_writer_schema, __pyx_n_s_symbols); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 297, __pyx_L1_error)
6339   __Pyx_GOTREF(__pyx_t_2);
6340   __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_index, __pyx_t_8fastavro_5_read_long64, 1, __Pyx_PyInt_From_PY_LONG_LONG, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error)
6341   __Pyx_GOTREF(__pyx_t_3);
6342   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6343   __pyx_v_symbol = __pyx_t_3;
6344   __pyx_t_3 = 0;
6345 
6346   /* "fastavro/_read.pyx":298
6347  *     index = read_long(fo)
6348  *     symbol = writer_schema['symbols'][index]
6349  *     if reader_schema and symbol not in reader_schema['symbols']:             # <<<<<<<<<<<<<<
6350  *         default = reader_schema.get("default")
6351  *         if default:
6352  */
6353   __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_reader_schema); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 298, __pyx_L1_error)
6354   if (__pyx_t_5) {
6355   } else {
6356     __pyx_t_4 = __pyx_t_5;
6357     goto __pyx_L4_bool_binop_done;
6358   }
6359   __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_reader_schema, __pyx_n_s_symbols); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 298, __pyx_L1_error)
6360   __Pyx_GOTREF(__pyx_t_3);
6361   __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_v_symbol, __pyx_t_3, Py_NE)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 298, __pyx_L1_error)
6362   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6363   __pyx_t_6 = (__pyx_t_5 != 0);
6364   __pyx_t_4 = __pyx_t_6;
6365   __pyx_L4_bool_binop_done:;
6366   if (__pyx_t_4) {
6367 
6368     /* "fastavro/_read.pyx":299
6369  *     symbol = writer_schema['symbols'][index]
6370  *     if reader_schema and symbol not in reader_schema['symbols']:
6371  *         default = reader_schema.get("default")             # <<<<<<<<<<<<<<
6372  *         if default:
6373  *             return default
6374  */
6375     __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_reader_schema, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 299, __pyx_L1_error)
6376     __Pyx_GOTREF(__pyx_t_2);
6377     __pyx_t_7 = NULL;
6378     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
6379       __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
6380       if (likely(__pyx_t_7)) {
6381         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
6382         __Pyx_INCREF(__pyx_t_7);
6383         __Pyx_INCREF(function);
6384         __Pyx_DECREF_SET(__pyx_t_2, function);
6385       }
6386     }
6387     __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_n_s_default) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_n_s_default);
6388     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6389     if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 299, __pyx_L1_error)
6390     __Pyx_GOTREF(__pyx_t_3);
6391     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6392     __pyx_v_default = __pyx_t_3;
6393     __pyx_t_3 = 0;
6394 
6395     /* "fastavro/_read.pyx":300
6396  *     if reader_schema and symbol not in reader_schema['symbols']:
6397  *         default = reader_schema.get("default")
6398  *         if default:             # <<<<<<<<<<<<<<
6399  *             return default
6400  *         else:
6401  */
6402     __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_default); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 300, __pyx_L1_error)
6403     if (likely(__pyx_t_4)) {
6404 
6405       /* "fastavro/_read.pyx":301
6406  *         default = reader_schema.get("default")
6407  *         if default:
6408  *             return default             # <<<<<<<<<<<<<<
6409  *         else:
6410  *             symlist = reader_schema['symbols']
6411  */
6412       __Pyx_XDECREF(__pyx_r);
6413       __Pyx_INCREF(__pyx_v_default);
6414       __pyx_r = __pyx_v_default;
6415       goto __pyx_L0;
6416 
6417       /* "fastavro/_read.pyx":300
6418  *     if reader_schema and symbol not in reader_schema['symbols']:
6419  *         default = reader_schema.get("default")
6420  *         if default:             # <<<<<<<<<<<<<<
6421  *             return default
6422  *         else:
6423  */
6424     }
6425 
6426     /* "fastavro/_read.pyx":303
6427  *             return default
6428  *         else:
6429  *             symlist = reader_schema['symbols']             # <<<<<<<<<<<<<<
6430  *             msg = '%s not found in reader symbol list %s' % (symbol, symlist)
6431  *             raise SchemaResolutionError(msg)
6432  */
6433     /*else*/ {
6434       __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_reader_schema, __pyx_n_s_symbols); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 303, __pyx_L1_error)
6435       __Pyx_GOTREF(__pyx_t_3);
6436       __pyx_v_symlist = __pyx_t_3;
6437       __pyx_t_3 = 0;
6438 
6439       /* "fastavro/_read.pyx":304
6440  *         else:
6441  *             symlist = reader_schema['symbols']
6442  *             msg = '%s not found in reader symbol list %s' % (symbol, symlist)             # <<<<<<<<<<<<<<
6443  *             raise SchemaResolutionError(msg)
6444  *     return symbol
6445  */
6446       __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 304, __pyx_L1_error)
6447       __Pyx_GOTREF(__pyx_t_3);
6448       __Pyx_INCREF(__pyx_v_symbol);
6449       __Pyx_GIVEREF(__pyx_v_symbol);
6450       PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_symbol);
6451       __Pyx_INCREF(__pyx_v_symlist);
6452       __Pyx_GIVEREF(__pyx_v_symlist);
6453       PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_symlist);
6454       __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s_not_found_in_reader_symbol_li, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L1_error)
6455       __Pyx_GOTREF(__pyx_t_2);
6456       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6457       __pyx_v_msg = ((PyObject*)__pyx_t_2);
6458       __pyx_t_2 = 0;
6459 
6460       /* "fastavro/_read.pyx":305
6461  *             symlist = reader_schema['symbols']
6462  *             msg = '%s not found in reader symbol list %s' % (symbol, symlist)
6463  *             raise SchemaResolutionError(msg)             # <<<<<<<<<<<<<<
6464  *     return symbol
6465  *
6466  */
6467       __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SchemaResolutionError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 305, __pyx_L1_error)
6468       __Pyx_GOTREF(__pyx_t_3);
6469       __pyx_t_7 = NULL;
6470       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
6471         __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
6472         if (likely(__pyx_t_7)) {
6473           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
6474           __Pyx_INCREF(__pyx_t_7);
6475           __Pyx_INCREF(function);
6476           __Pyx_DECREF_SET(__pyx_t_3, function);
6477         }
6478       }
6479       __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_7, __pyx_v_msg) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_msg);
6480       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6481       if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 305, __pyx_L1_error)
6482       __Pyx_GOTREF(__pyx_t_2);
6483       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6484       __Pyx_Raise(__pyx_t_2, 0, 0, 0);
6485       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6486       __PYX_ERR(0, 305, __pyx_L1_error)
6487     }
6488 
6489     /* "fastavro/_read.pyx":298
6490  *     index = read_long(fo)
6491  *     symbol = writer_schema['symbols'][index]
6492  *     if reader_schema and symbol not in reader_schema['symbols']:             # <<<<<<<<<<<<<<
6493  *         default = reader_schema.get("default")
6494  *         if default:
6495  */
6496   }
6497 
6498   /* "fastavro/_read.pyx":306
6499  *             msg = '%s not found in reader symbol list %s' % (symbol, symlist)
6500  *             raise SchemaResolutionError(msg)
6501  *     return symbol             # <<<<<<<<<<<<<<
6502  *
6503  *
6504  */
6505   __Pyx_XDECREF(__pyx_r);
6506   __Pyx_INCREF(__pyx_v_symbol);
6507   __pyx_r = __pyx_v_symbol;
6508   goto __pyx_L0;
6509 
6510   /* "fastavro/_read.pyx":292
6511  *
6512  *
6513  * cdef read_enum(fo, writer_schema, reader_schema):             # <<<<<<<<<<<<<<
6514  *     """An enum is encoded by a int, representing the zero-based position of the
6515  *     symbol in the schema.
6516  */
6517 
6518   /* function exit code */
6519   __pyx_L1_error:;
6520   __Pyx_XDECREF(__pyx_t_2);
6521   __Pyx_XDECREF(__pyx_t_3);
6522   __Pyx_XDECREF(__pyx_t_7);
6523   __Pyx_AddTraceback("fastavro._read.read_enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
6524   __pyx_r = 0;
6525   __pyx_L0:;
6526   __Pyx_XDECREF(__pyx_v_symbol);
6527   __Pyx_XDECREF(__pyx_v_default);
6528   __Pyx_XDECREF(__pyx_v_symlist);
6529   __Pyx_XDECREF(__pyx_v_msg);
6530   __Pyx_XGIVEREF(__pyx_r);
6531   __Pyx_RefNannyFinishContext();
6532   return __pyx_r;
6533 }
6534 
6535 /* "fastavro/_read.pyx":309
6536  *
6537  *
6538  * cdef read_array(             # <<<<<<<<<<<<<<
6539  *     fo,
6540  *     writer_schema,
6541  */
6542 
__pyx_f_8fastavro_5_read_read_array(PyObject * __pyx_v_fo,PyObject * __pyx_v_writer_schema,PyObject * __pyx_v_named_schemas,struct __pyx_opt_args_8fastavro_5_read_read_array * __pyx_optional_args)6543 static PyObject *__pyx_f_8fastavro_5_read_read_array(PyObject *__pyx_v_fo, PyObject *__pyx_v_writer_schema, PyObject *__pyx_v_named_schemas, struct __pyx_opt_args_8fastavro_5_read_read_array *__pyx_optional_args) {
6544 
6545   /* "fastavro/_read.pyx":313
6546  *     writer_schema,
6547  *     named_schemas,
6548  *     reader_schema=None,             # <<<<<<<<<<<<<<
6549  *     return_record_name=False,
6550  * ):
6551  */
6552   PyObject *__pyx_v_reader_schema = ((PyObject *)Py_None);
6553 
6554   /* "fastavro/_read.pyx":314
6555  *     named_schemas,
6556  *     reader_schema=None,
6557  *     return_record_name=False,             # <<<<<<<<<<<<<<
6558  * ):
6559  *     """Arrays are encoded as a series of blocks.
6560  */
6561   PyObject *__pyx_v_return_record_name = ((PyObject *)Py_False);
6562   PyObject *__pyx_v_read_items = 0;
6563   __pyx_t_8fastavro_5_read_long64 __pyx_v_block_count;
6564   CYTHON_UNUSED __pyx_t_8fastavro_5_read_long64 __pyx_v_i;
6565   PyObject *__pyx_r = NULL;
6566   __Pyx_RefNannyDeclarations
6567   PyObject *__pyx_t_1 = NULL;
6568   __pyx_t_8fastavro_5_read_long64 __pyx_t_2;
6569   int __pyx_t_3;
6570   __pyx_t_8fastavro_5_read_long64 __pyx_t_4;
6571   __pyx_t_8fastavro_5_read_long64 __pyx_t_5;
6572   PyObject *__pyx_t_6 = NULL;
6573   PyObject *__pyx_t_7 = NULL;
6574   struct __pyx_opt_args_8fastavro_5_read__read_data __pyx_t_8;
6575   int __pyx_t_9;
6576   int __pyx_lineno = 0;
6577   const char *__pyx_filename = NULL;
6578   int __pyx_clineno = 0;
6579   __Pyx_RefNannySetupContext("read_array", 0);
6580   if (__pyx_optional_args) {
6581     if (__pyx_optional_args->__pyx_n > 0) {
6582       __pyx_v_reader_schema = __pyx_optional_args->reader_schema;
6583       if (__pyx_optional_args->__pyx_n > 1) {
6584         __pyx_v_return_record_name = __pyx_optional_args->return_record_name;
6585       }
6586     }
6587   }
6588 
6589   /* "fastavro/_read.pyx":330
6590  *     cdef long64 i
6591  *
6592  *     read_items = []             # <<<<<<<<<<<<<<
6593  *
6594  *     block_count = read_long(fo)
6595  */
6596   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 330, __pyx_L1_error)
6597   __Pyx_GOTREF(__pyx_t_1);
6598   __pyx_v_read_items = ((PyObject*)__pyx_t_1);
6599   __pyx_t_1 = 0;
6600 
6601   /* "fastavro/_read.pyx":332
6602  *     read_items = []
6603  *
6604  *     block_count = read_long(fo)             # <<<<<<<<<<<<<<
6605  *
6606  *     while block_count != 0:
6607  */
6608   __pyx_t_2 = __pyx_f_8fastavro_5_read_read_long(__pyx_v_fo); if (unlikely(__pyx_t_2 == ((__pyx_t_8fastavro_5_read_long64)-1LL) && PyErr_Occurred())) __PYX_ERR(0, 332, __pyx_L1_error)
6609   __pyx_v_block_count = __pyx_t_2;
6610 
6611   /* "fastavro/_read.pyx":334
6612  *     block_count = read_long(fo)
6613  *
6614  *     while block_count != 0:             # <<<<<<<<<<<<<<
6615  *         if block_count < 0:
6616  *             block_count = -block_count
6617  */
6618   while (1) {
6619     __pyx_t_3 = ((__pyx_v_block_count != 0) != 0);
6620     if (!__pyx_t_3) break;
6621 
6622     /* "fastavro/_read.pyx":335
6623  *
6624  *     while block_count != 0:
6625  *         if block_count < 0:             # <<<<<<<<<<<<<<
6626  *             block_count = -block_count
6627  *             # Read block size, unused
6628  */
6629     __pyx_t_3 = ((__pyx_v_block_count < 0) != 0);
6630     if (__pyx_t_3) {
6631 
6632       /* "fastavro/_read.pyx":336
6633  *     while block_count != 0:
6634  *         if block_count < 0:
6635  *             block_count = -block_count             # <<<<<<<<<<<<<<
6636  *             # Read block size, unused
6637  *             read_long(fo)
6638  */
6639       __pyx_v_block_count = (-__pyx_v_block_count);
6640 
6641       /* "fastavro/_read.pyx":338
6642  *             block_count = -block_count
6643  *             # Read block size, unused
6644  *             read_long(fo)             # <<<<<<<<<<<<<<
6645  *
6646  *         if reader_schema:
6647  */
6648       __pyx_t_2 = __pyx_f_8fastavro_5_read_read_long(__pyx_v_fo); if (unlikely(__pyx_t_2 == ((__pyx_t_8fastavro_5_read_long64)-1LL) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L1_error)
6649 
6650       /* "fastavro/_read.pyx":335
6651  *
6652  *     while block_count != 0:
6653  *         if block_count < 0:             # <<<<<<<<<<<<<<
6654  *             block_count = -block_count
6655  *             # Read block size, unused
6656  */
6657     }
6658 
6659     /* "fastavro/_read.pyx":340
6660  *             read_long(fo)
6661  *
6662  *         if reader_schema:             # <<<<<<<<<<<<<<
6663  *             for i in range(block_count):
6664  *                 read_items.append(_read_data(
6665  */
6666     __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_reader_schema); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 340, __pyx_L1_error)
6667     if (__pyx_t_3) {
6668 
6669       /* "fastavro/_read.pyx":341
6670  *
6671  *         if reader_schema:
6672  *             for i in range(block_count):             # <<<<<<<<<<<<<<
6673  *                 read_items.append(_read_data(
6674  *                     fo,
6675  */
6676       __pyx_t_2 = __pyx_v_block_count;
6677       __pyx_t_4 = __pyx_t_2;
6678       for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
6679         __pyx_v_i = __pyx_t_5;
6680 
6681         /* "fastavro/_read.pyx":344
6682  *                 read_items.append(_read_data(
6683  *                     fo,
6684  *                     writer_schema['items'],             # <<<<<<<<<<<<<<
6685  *                     named_schemas,
6686  *                     reader_schema['items'],
6687  */
6688         __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_writer_schema, __pyx_n_s_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 344, __pyx_L1_error)
6689         __Pyx_GOTREF(__pyx_t_1);
6690 
6691         /* "fastavro/_read.pyx":346
6692  *                     writer_schema['items'],
6693  *                     named_schemas,
6694  *                     reader_schema['items'],             # <<<<<<<<<<<<<<
6695  *                     return_record_name,
6696  *                 ))
6697  */
6698         __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_reader_schema, __pyx_n_s_items); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 346, __pyx_L1_error)
6699         __Pyx_GOTREF(__pyx_t_6);
6700 
6701         /* "fastavro/_read.pyx":342
6702  *         if reader_schema:
6703  *             for i in range(block_count):
6704  *                 read_items.append(_read_data(             # <<<<<<<<<<<<<<
6705  *                     fo,
6706  *                     writer_schema['items'],
6707  */
6708         __pyx_t_8.__pyx_n = 2;
6709         __pyx_t_8.reader_schema = __pyx_t_6;
6710         __pyx_t_8.return_record_name = __pyx_v_return_record_name;
6711         __pyx_t_7 = __pyx_f_8fastavro_5_read__read_data(__pyx_v_fo, __pyx_t_1, __pyx_v_named_schemas, 0, &__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 342, __pyx_L1_error)
6712         __Pyx_GOTREF(__pyx_t_7);
6713         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6714         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6715         __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_read_items, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 342, __pyx_L1_error)
6716         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6717       }
6718 
6719       /* "fastavro/_read.pyx":340
6720  *             read_long(fo)
6721  *
6722  *         if reader_schema:             # <<<<<<<<<<<<<<
6723  *             for i in range(block_count):
6724  *                 read_items.append(_read_data(
6725  */
6726       goto __pyx_L6;
6727     }
6728 
6729     /* "fastavro/_read.pyx":350
6730  *                 ))
6731  *         else:
6732  *             for i in range(block_count):             # <<<<<<<<<<<<<<
6733  *                 read_items.append(_read_data(
6734  *                     fo,
6735  */
6736     /*else*/ {
6737       __pyx_t_2 = __pyx_v_block_count;
6738       __pyx_t_4 = __pyx_t_2;
6739       for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
6740         __pyx_v_i = __pyx_t_5;
6741 
6742         /* "fastavro/_read.pyx":353
6743  *                 read_items.append(_read_data(
6744  *                     fo,
6745  *                     writer_schema['items'],             # <<<<<<<<<<<<<<
6746  *                     named_schemas,
6747  *                     None,
6748  */
6749         __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_v_writer_schema, __pyx_n_s_items); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 353, __pyx_L1_error)
6750         __Pyx_GOTREF(__pyx_t_7);
6751 
6752         /* "fastavro/_read.pyx":351
6753  *         else:
6754  *             for i in range(block_count):
6755  *                 read_items.append(_read_data(             # <<<<<<<<<<<<<<
6756  *                     fo,
6757  *                     writer_schema['items'],
6758  */
6759         __pyx_t_8.__pyx_n = 2;
6760         __pyx_t_8.reader_schema = Py_None;
6761         __pyx_t_8.return_record_name = __pyx_v_return_record_name;
6762         __pyx_t_6 = __pyx_f_8fastavro_5_read__read_data(__pyx_v_fo, __pyx_t_7, __pyx_v_named_schemas, 0, &__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 351, __pyx_L1_error)
6763         __Pyx_GOTREF(__pyx_t_6);
6764         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6765         __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_read_items, __pyx_t_6); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 351, __pyx_L1_error)
6766         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6767       }
6768     }
6769     __pyx_L6:;
6770 
6771     /* "fastavro/_read.pyx":358
6772  *                     return_record_name,
6773  *                 ))
6774  *         block_count = read_long(fo)             # <<<<<<<<<<<<<<
6775  *
6776  *     return read_items
6777  */
6778     __pyx_t_2 = __pyx_f_8fastavro_5_read_read_long(__pyx_v_fo); if (unlikely(__pyx_t_2 == ((__pyx_t_8fastavro_5_read_long64)-1LL) && PyErr_Occurred())) __PYX_ERR(0, 358, __pyx_L1_error)
6779     __pyx_v_block_count = __pyx_t_2;
6780   }
6781 
6782   /* "fastavro/_read.pyx":360
6783  *         block_count = read_long(fo)
6784  *
6785  *     return read_items             # <<<<<<<<<<<<<<
6786  *
6787  *
6788  */
6789   __Pyx_XDECREF(__pyx_r);
6790   __Pyx_INCREF(__pyx_v_read_items);
6791   __pyx_r = __pyx_v_read_items;
6792   goto __pyx_L0;
6793 
6794   /* "fastavro/_read.pyx":309
6795  *
6796  *
6797  * cdef read_array(             # <<<<<<<<<<<<<<
6798  *     fo,
6799  *     writer_schema,
6800  */
6801 
6802   /* function exit code */
6803   __pyx_L1_error:;
6804   __Pyx_XDECREF(__pyx_t_1);
6805   __Pyx_XDECREF(__pyx_t_6);
6806   __Pyx_XDECREF(__pyx_t_7);
6807   __Pyx_AddTraceback("fastavro._read.read_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
6808   __pyx_r = 0;
6809   __pyx_L0:;
6810   __Pyx_XDECREF(__pyx_v_read_items);
6811   __Pyx_XGIVEREF(__pyx_r);
6812   __Pyx_RefNannyFinishContext();
6813   return __pyx_r;
6814 }
6815 
6816 /* "fastavro/_read.pyx":363
6817  *
6818  *
6819  * cdef read_map(             # <<<<<<<<<<<<<<
6820  *     fo,
6821  *     writer_schema,
6822  */
6823 
__pyx_f_8fastavro_5_read_read_map(PyObject * __pyx_v_fo,PyObject * __pyx_v_writer_schema,PyObject * __pyx_v_named_schemas,struct __pyx_opt_args_8fastavro_5_read_read_map * __pyx_optional_args)6824 static PyObject *__pyx_f_8fastavro_5_read_read_map(PyObject *__pyx_v_fo, PyObject *__pyx_v_writer_schema, PyObject *__pyx_v_named_schemas, struct __pyx_opt_args_8fastavro_5_read_read_map *__pyx_optional_args) {
6825 
6826   /* "fastavro/_read.pyx":367
6827  *     writer_schema,
6828  *     named_schemas,
6829  *     reader_schema=None,             # <<<<<<<<<<<<<<
6830  *     return_record_name=False,
6831  * ):
6832  */
6833   PyObject *__pyx_v_reader_schema = ((PyObject *)Py_None);
6834 
6835   /* "fastavro/_read.pyx":368
6836  *     named_schemas,
6837  *     reader_schema=None,
6838  *     return_record_name=False,             # <<<<<<<<<<<<<<
6839  * ):
6840  *     """Maps are encoded as a series of blocks.
6841  */
6842   PyObject *__pyx_v_return_record_name = ((PyObject *)Py_False);
6843   PyObject *__pyx_v_read_items = 0;
6844   __pyx_t_8fastavro_5_read_long64 __pyx_v_block_count;
6845   CYTHON_UNUSED __pyx_t_8fastavro_5_read_long64 __pyx_v_i;
6846   PyObject *__pyx_v_key = 0;
6847   PyObject *__pyx_r = NULL;
6848   __Pyx_RefNannyDeclarations
6849   PyObject *__pyx_t_1 = NULL;
6850   __pyx_t_8fastavro_5_read_long64 __pyx_t_2;
6851   int __pyx_t_3;
6852   __pyx_t_8fastavro_5_read_long64 __pyx_t_4;
6853   __pyx_t_8fastavro_5_read_long64 __pyx_t_5;
6854   PyObject *__pyx_t_6 = NULL;
6855   PyObject *__pyx_t_7 = NULL;
6856   struct __pyx_opt_args_8fastavro_5_read__read_data __pyx_t_8;
6857   int __pyx_lineno = 0;
6858   const char *__pyx_filename = NULL;
6859   int __pyx_clineno = 0;
6860   __Pyx_RefNannySetupContext("read_map", 0);
6861   if (__pyx_optional_args) {
6862     if (__pyx_optional_args->__pyx_n > 0) {
6863       __pyx_v_reader_schema = __pyx_optional_args->reader_schema;
6864       if (__pyx_optional_args->__pyx_n > 1) {
6865         __pyx_v_return_record_name = __pyx_optional_args->return_record_name;
6866       }
6867     }
6868   }
6869 
6870   /* "fastavro/_read.pyx":385
6871  *     cdef unicode key
6872  *
6873  *     read_items = {}             # <<<<<<<<<<<<<<
6874  *     block_count = read_long(fo)
6875  *     while block_count != 0:
6876  */
6877   __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 385, __pyx_L1_error)
6878   __Pyx_GOTREF(__pyx_t_1);
6879   __pyx_v_read_items = ((PyObject*)__pyx_t_1);
6880   __pyx_t_1 = 0;
6881 
6882   /* "fastavro/_read.pyx":386
6883  *
6884  *     read_items = {}
6885  *     block_count = read_long(fo)             # <<<<<<<<<<<<<<
6886  *     while block_count != 0:
6887  *         if block_count < 0:
6888  */
6889   __pyx_t_2 = __pyx_f_8fastavro_5_read_read_long(__pyx_v_fo); if (unlikely(__pyx_t_2 == ((__pyx_t_8fastavro_5_read_long64)-1LL) && PyErr_Occurred())) __PYX_ERR(0, 386, __pyx_L1_error)
6890   __pyx_v_block_count = __pyx_t_2;
6891 
6892   /* "fastavro/_read.pyx":387
6893  *     read_items = {}
6894  *     block_count = read_long(fo)
6895  *     while block_count != 0:             # <<<<<<<<<<<<<<
6896  *         if block_count < 0:
6897  *             block_count = -block_count
6898  */
6899   while (1) {
6900     __pyx_t_3 = ((__pyx_v_block_count != 0) != 0);
6901     if (!__pyx_t_3) break;
6902 
6903     /* "fastavro/_read.pyx":388
6904  *     block_count = read_long(fo)
6905  *     while block_count != 0:
6906  *         if block_count < 0:             # <<<<<<<<<<<<<<
6907  *             block_count = -block_count
6908  *             # Read block size, unused
6909  */
6910     __pyx_t_3 = ((__pyx_v_block_count < 0) != 0);
6911     if (__pyx_t_3) {
6912 
6913       /* "fastavro/_read.pyx":389
6914  *     while block_count != 0:
6915  *         if block_count < 0:
6916  *             block_count = -block_count             # <<<<<<<<<<<<<<
6917  *             # Read block size, unused
6918  *             read_long(fo)
6919  */
6920       __pyx_v_block_count = (-__pyx_v_block_count);
6921 
6922       /* "fastavro/_read.pyx":391
6923  *             block_count = -block_count
6924  *             # Read block size, unused
6925  *             read_long(fo)             # <<<<<<<<<<<<<<
6926  *
6927  *         if reader_schema:
6928  */
6929       __pyx_t_2 = __pyx_f_8fastavro_5_read_read_long(__pyx_v_fo); if (unlikely(__pyx_t_2 == ((__pyx_t_8fastavro_5_read_long64)-1LL) && PyErr_Occurred())) __PYX_ERR(0, 391, __pyx_L1_error)
6930 
6931       /* "fastavro/_read.pyx":388
6932  *     block_count = read_long(fo)
6933  *     while block_count != 0:
6934  *         if block_count < 0:             # <<<<<<<<<<<<<<
6935  *             block_count = -block_count
6936  *             # Read block size, unused
6937  */
6938     }
6939 
6940     /* "fastavro/_read.pyx":393
6941  *             read_long(fo)
6942  *
6943  *         if reader_schema:             # <<<<<<<<<<<<<<
6944  *             for i in range(block_count):
6945  *                 key = read_utf8(fo)
6946  */
6947     __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_reader_schema); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 393, __pyx_L1_error)
6948     if (__pyx_t_3) {
6949 
6950       /* "fastavro/_read.pyx":394
6951  *
6952  *         if reader_schema:
6953  *             for i in range(block_count):             # <<<<<<<<<<<<<<
6954  *                 key = read_utf8(fo)
6955  *                 read_items[key] = _read_data(
6956  */
6957       __pyx_t_2 = __pyx_v_block_count;
6958       __pyx_t_4 = __pyx_t_2;
6959       for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
6960         __pyx_v_i = __pyx_t_5;
6961 
6962         /* "fastavro/_read.pyx":395
6963  *         if reader_schema:
6964  *             for i in range(block_count):
6965  *                 key = read_utf8(fo)             # <<<<<<<<<<<<<<
6966  *                 read_items[key] = _read_data(
6967  *                     fo,
6968  */
6969         __pyx_t_1 = __pyx_f_8fastavro_5_read_read_utf8(__pyx_v_fo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 395, __pyx_L1_error)
6970         __Pyx_GOTREF(__pyx_t_1);
6971         __Pyx_XDECREF_SET(__pyx_v_key, ((PyObject*)__pyx_t_1));
6972         __pyx_t_1 = 0;
6973 
6974         /* "fastavro/_read.pyx":398
6975  *                 read_items[key] = _read_data(
6976  *                     fo,
6977  *                     writer_schema['values'],             # <<<<<<<<<<<<<<
6978  *                     named_schemas,
6979  *                     reader_schema['values'],
6980  */
6981         __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_writer_schema, __pyx_n_s_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 398, __pyx_L1_error)
6982         __Pyx_GOTREF(__pyx_t_1);
6983 
6984         /* "fastavro/_read.pyx":400
6985  *                     writer_schema['values'],
6986  *                     named_schemas,
6987  *                     reader_schema['values'],             # <<<<<<<<<<<<<<
6988  *                     return_record_name,
6989  *                 )
6990  */
6991         __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_reader_schema, __pyx_n_s_values); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 400, __pyx_L1_error)
6992         __Pyx_GOTREF(__pyx_t_6);
6993 
6994         /* "fastavro/_read.pyx":396
6995  *             for i in range(block_count):
6996  *                 key = read_utf8(fo)
6997  *                 read_items[key] = _read_data(             # <<<<<<<<<<<<<<
6998  *                     fo,
6999  *                     writer_schema['values'],
7000  */
7001         __pyx_t_8.__pyx_n = 2;
7002         __pyx_t_8.reader_schema = __pyx_t_6;
7003         __pyx_t_8.return_record_name = __pyx_v_return_record_name;
7004         __pyx_t_7 = __pyx_f_8fastavro_5_read__read_data(__pyx_v_fo, __pyx_t_1, __pyx_v_named_schemas, 0, &__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 396, __pyx_L1_error)
7005         __Pyx_GOTREF(__pyx_t_7);
7006         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7007         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7008         if (unlikely(PyDict_SetItem(__pyx_v_read_items, __pyx_v_key, __pyx_t_7) < 0)) __PYX_ERR(0, 396, __pyx_L1_error)
7009         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7010       }
7011 
7012       /* "fastavro/_read.pyx":393
7013  *             read_long(fo)
7014  *
7015  *         if reader_schema:             # <<<<<<<<<<<<<<
7016  *             for i in range(block_count):
7017  *                 key = read_utf8(fo)
7018  */
7019       goto __pyx_L6;
7020     }
7021 
7022     /* "fastavro/_read.pyx":404
7023  *                 )
7024  *         else:
7025  *             for i in range(block_count):             # <<<<<<<<<<<<<<
7026  *                 key = read_utf8(fo)
7027  *                 read_items[key] = _read_data(
7028  */
7029     /*else*/ {
7030       __pyx_t_2 = __pyx_v_block_count;
7031       __pyx_t_4 = __pyx_t_2;
7032       for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
7033         __pyx_v_i = __pyx_t_5;
7034 
7035         /* "fastavro/_read.pyx":405
7036  *         else:
7037  *             for i in range(block_count):
7038  *                 key = read_utf8(fo)             # <<<<<<<<<<<<<<
7039  *                 read_items[key] = _read_data(
7040  *                     fo,
7041  */
7042         __pyx_t_7 = __pyx_f_8fastavro_5_read_read_utf8(__pyx_v_fo); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 405, __pyx_L1_error)
7043         __Pyx_GOTREF(__pyx_t_7);
7044         __Pyx_XDECREF_SET(__pyx_v_key, ((PyObject*)__pyx_t_7));
7045         __pyx_t_7 = 0;
7046 
7047         /* "fastavro/_read.pyx":408
7048  *                 read_items[key] = _read_data(
7049  *                     fo,
7050  *                     writer_schema['values'],             # <<<<<<<<<<<<<<
7051  *                     named_schemas,
7052  *                     None,
7053  */
7054         __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_v_writer_schema, __pyx_n_s_values); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 408, __pyx_L1_error)
7055         __Pyx_GOTREF(__pyx_t_7);
7056 
7057         /* "fastavro/_read.pyx":406
7058  *             for i in range(block_count):
7059  *                 key = read_utf8(fo)
7060  *                 read_items[key] = _read_data(             # <<<<<<<<<<<<<<
7061  *                     fo,
7062  *                     writer_schema['values'],
7063  */
7064         __pyx_t_8.__pyx_n = 2;
7065         __pyx_t_8.reader_schema = Py_None;
7066         __pyx_t_8.return_record_name = __pyx_v_return_record_name;
7067         __pyx_t_6 = __pyx_f_8fastavro_5_read__read_data(__pyx_v_fo, __pyx_t_7, __pyx_v_named_schemas, 0, &__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 406, __pyx_L1_error)
7068         __Pyx_GOTREF(__pyx_t_6);
7069         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7070         if (unlikely(PyDict_SetItem(__pyx_v_read_items, __pyx_v_key, __pyx_t_6) < 0)) __PYX_ERR(0, 406, __pyx_L1_error)
7071         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7072       }
7073     }
7074     __pyx_L6:;
7075 
7076     /* "fastavro/_read.pyx":413
7077  *                     return_record_name,
7078  *                 )
7079  *         block_count = read_long(fo)             # <<<<<<<<<<<<<<
7080  *
7081  *     return read_items
7082  */
7083     __pyx_t_2 = __pyx_f_8fastavro_5_read_read_long(__pyx_v_fo); if (unlikely(__pyx_t_2 == ((__pyx_t_8fastavro_5_read_long64)-1LL) && PyErr_Occurred())) __PYX_ERR(0, 413, __pyx_L1_error)
7084     __pyx_v_block_count = __pyx_t_2;
7085   }
7086 
7087   /* "fastavro/_read.pyx":415
7088  *         block_count = read_long(fo)
7089  *
7090  *     return read_items             # <<<<<<<<<<<<<<
7091  *
7092  *
7093  */
7094   __Pyx_XDECREF(__pyx_r);
7095   __Pyx_INCREF(__pyx_v_read_items);
7096   __pyx_r = __pyx_v_read_items;
7097   goto __pyx_L0;
7098 
7099   /* "fastavro/_read.pyx":363
7100  *
7101  *
7102  * cdef read_map(             # <<<<<<<<<<<<<<
7103  *     fo,
7104  *     writer_schema,
7105  */
7106 
7107   /* function exit code */
7108   __pyx_L1_error:;
7109   __Pyx_XDECREF(__pyx_t_1);
7110   __Pyx_XDECREF(__pyx_t_6);
7111   __Pyx_XDECREF(__pyx_t_7);
7112   __Pyx_AddTraceback("fastavro._read.read_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
7113   __pyx_r = 0;
7114   __pyx_L0:;
7115   __Pyx_XDECREF(__pyx_v_read_items);
7116   __Pyx_XDECREF(__pyx_v_key);
7117   __Pyx_XGIVEREF(__pyx_r);
7118   __Pyx_RefNannyFinishContext();
7119   return __pyx_r;
7120 }
7121 
7122 /* "fastavro/_read.pyx":418
7123  *
7124  *
7125  * cdef read_union(             # <<<<<<<<<<<<<<
7126  *     fo,
7127  *     writer_schema,
7128  */
7129 
__pyx_f_8fastavro_5_read_read_union(PyObject * __pyx_v_fo,PyObject * __pyx_v_writer_schema,PyObject * __pyx_v_named_schemas,struct __pyx_opt_args_8fastavro_5_read_read_union * __pyx_optional_args)7130 static PyObject *__pyx_f_8fastavro_5_read_read_union(PyObject *__pyx_v_fo, PyObject *__pyx_v_writer_schema, PyObject *__pyx_v_named_schemas, struct __pyx_opt_args_8fastavro_5_read_read_union *__pyx_optional_args) {
7131 
7132   /* "fastavro/_read.pyx":422
7133  *     writer_schema,
7134  *     named_schemas,
7135  *     reader_schema=None,             # <<<<<<<<<<<<<<
7136  *     return_record_name=False,
7137  * ):
7138  */
7139   PyObject *__pyx_v_reader_schema = ((PyObject *)Py_None);
7140 
7141   /* "fastavro/_read.pyx":423
7142  *     named_schemas,
7143  *     reader_schema=None,
7144  *     return_record_name=False,             # <<<<<<<<<<<<<<
7145  * ):
7146  *     """A union is encoded by first writing a long value indicating the
7147  */
7148   PyObject *__pyx_v_return_record_name = ((PyObject *)Py_False);
7149   __pyx_t_8fastavro_5_read_long64 __pyx_v_index;
7150   PyObject *__pyx_v_idx_schema = NULL;
7151   PyObject *__pyx_v_schema = NULL;
7152   PyObject *__pyx_v_msg = NULL;
7153   PyObject *__pyx_r = NULL;
7154   __Pyx_RefNannyDeclarations
7155   __pyx_t_8fastavro_5_read_long64 __pyx_t_1;
7156   PyObject *__pyx_t_2 = NULL;
7157   int __pyx_t_3;
7158   int __pyx_t_4;
7159   struct __pyx_opt_args_8fastavro_5_read__read_data __pyx_t_5;
7160   Py_ssize_t __pyx_t_6;
7161   PyObject *(*__pyx_t_7)(PyObject *);
7162   PyObject *__pyx_t_8 = NULL;
7163   PyObject *__pyx_t_9 = NULL;
7164   int __pyx_t_10;
7165   int __pyx_lineno = 0;
7166   const char *__pyx_filename = NULL;
7167   int __pyx_clineno = 0;
7168   __Pyx_RefNannySetupContext("read_union", 0);
7169   if (__pyx_optional_args) {
7170     if (__pyx_optional_args->__pyx_n > 0) {
7171       __pyx_v_reader_schema = __pyx_optional_args->reader_schema;
7172       if (__pyx_optional_args->__pyx_n > 1) {
7173         __pyx_v_return_record_name = __pyx_optional_args->return_record_name;
7174       }
7175     }
7176   }
7177 
7178   /* "fastavro/_read.pyx":431
7179  *     """
7180  *     # schema resolution
7181  *     index = read_long(fo)             # <<<<<<<<<<<<<<
7182  *     idx_schema = writer_schema[index]
7183  *
7184  */
7185   __pyx_t_1 = __pyx_f_8fastavro_5_read_read_long(__pyx_v_fo); if (unlikely(__pyx_t_1 == ((__pyx_t_8fastavro_5_read_long64)-1LL) && PyErr_Occurred())) __PYX_ERR(0, 431, __pyx_L1_error)
7186   __pyx_v_index = __pyx_t_1;
7187 
7188   /* "fastavro/_read.pyx":432
7189  *     # schema resolution
7190  *     index = read_long(fo)
7191  *     idx_schema = writer_schema[index]             # <<<<<<<<<<<<<<
7192  *
7193  *     if reader_schema:
7194  */
7195   __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_writer_schema, __pyx_v_index, __pyx_t_8fastavro_5_read_long64, 1, __Pyx_PyInt_From_PY_LONG_LONG, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 432, __pyx_L1_error)
7196   __Pyx_GOTREF(__pyx_t_2);
7197   __pyx_v_idx_schema = __pyx_t_2;
7198   __pyx_t_2 = 0;
7199 
7200   /* "fastavro/_read.pyx":434
7201  *     idx_schema = writer_schema[index]
7202  *
7203  *     if reader_schema:             # <<<<<<<<<<<<<<
7204  *         # Handle case where the reader schema is just a single type (not union)
7205  *         if not isinstance(reader_schema, list):
7206  */
7207   __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_reader_schema); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 434, __pyx_L1_error)
7208   if (__pyx_t_3) {
7209 
7210     /* "fastavro/_read.pyx":436
7211  *     if reader_schema:
7212  *         # Handle case where the reader schema is just a single type (not union)
7213  *         if not isinstance(reader_schema, list):             # <<<<<<<<<<<<<<
7214  *             if match_types(idx_schema, reader_schema):
7215  *                 return _read_data(
7216  */
7217     __pyx_t_3 = PyList_Check(__pyx_v_reader_schema);
7218     __pyx_t_4 = ((!(__pyx_t_3 != 0)) != 0);
7219     if (__pyx_t_4) {
7220 
7221       /* "fastavro/_read.pyx":437
7222  *         # Handle case where the reader schema is just a single type (not union)
7223  *         if not isinstance(reader_schema, list):
7224  *             if match_types(idx_schema, reader_schema):             # <<<<<<<<<<<<<<
7225  *                 return _read_data(
7226  *                     fo,
7227  */
7228       __pyx_t_2 = __pyx_f_8fastavro_5_read_match_types(__pyx_v_idx_schema, __pyx_v_reader_schema, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error)
7229       __Pyx_GOTREF(__pyx_t_2);
7230       __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 437, __pyx_L1_error)
7231       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7232       if (__pyx_t_4) {
7233 
7234         /* "fastavro/_read.pyx":438
7235  *         if not isinstance(reader_schema, list):
7236  *             if match_types(idx_schema, reader_schema):
7237  *                 return _read_data(             # <<<<<<<<<<<<<<
7238  *                     fo,
7239  *                     idx_schema,
7240  */
7241         __Pyx_XDECREF(__pyx_r);
7242 
7243         /* "fastavro/_read.pyx":443
7244  *                     named_schemas,
7245  *                     reader_schema,
7246  *                     return_record_name,             # <<<<<<<<<<<<<<
7247  *                 )
7248  *         else:
7249  */
7250         __pyx_t_5.__pyx_n = 2;
7251         __pyx_t_5.reader_schema = __pyx_v_reader_schema;
7252         __pyx_t_5.return_record_name = __pyx_v_return_record_name;
7253         __pyx_t_2 = __pyx_f_8fastavro_5_read__read_data(__pyx_v_fo, __pyx_v_idx_schema, __pyx_v_named_schemas, 0, &__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 438, __pyx_L1_error)
7254         __Pyx_GOTREF(__pyx_t_2);
7255         __pyx_r = __pyx_t_2;
7256         __pyx_t_2 = 0;
7257         goto __pyx_L0;
7258 
7259         /* "fastavro/_read.pyx":437
7260  *         # Handle case where the reader schema is just a single type (not union)
7261  *         if not isinstance(reader_schema, list):
7262  *             if match_types(idx_schema, reader_schema):             # <<<<<<<<<<<<<<
7263  *                 return _read_data(
7264  *                     fo,
7265  */
7266       }
7267 
7268       /* "fastavro/_read.pyx":436
7269  *     if reader_schema:
7270  *         # Handle case where the reader schema is just a single type (not union)
7271  *         if not isinstance(reader_schema, list):             # <<<<<<<<<<<<<<
7272  *             if match_types(idx_schema, reader_schema):
7273  *                 return _read_data(
7274  */
7275       goto __pyx_L4;
7276     }
7277 
7278     /* "fastavro/_read.pyx":446
7279  *                 )
7280  *         else:
7281  *             for schema in reader_schema:             # <<<<<<<<<<<<<<
7282  *                 if match_types(idx_schema, schema):
7283  *                     return _read_data(
7284  */
7285     /*else*/ {
7286       if (likely(PyList_CheckExact(__pyx_v_reader_schema)) || PyTuple_CheckExact(__pyx_v_reader_schema)) {
7287         __pyx_t_2 = __pyx_v_reader_schema; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0;
7288         __pyx_t_7 = NULL;
7289       } else {
7290         __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_reader_schema); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 446, __pyx_L1_error)
7291         __Pyx_GOTREF(__pyx_t_2);
7292         __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 446, __pyx_L1_error)
7293       }
7294       for (;;) {
7295         if (likely(!__pyx_t_7)) {
7296           if (likely(PyList_CheckExact(__pyx_t_2))) {
7297             if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break;
7298             #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7299             __pyx_t_8 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 446, __pyx_L1_error)
7300             #else
7301             __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 446, __pyx_L1_error)
7302             __Pyx_GOTREF(__pyx_t_8);
7303             #endif
7304           } else {
7305             if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
7306             #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7307             __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 446, __pyx_L1_error)
7308             #else
7309             __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 446, __pyx_L1_error)
7310             __Pyx_GOTREF(__pyx_t_8);
7311             #endif
7312           }
7313         } else {
7314           __pyx_t_8 = __pyx_t_7(__pyx_t_2);
7315           if (unlikely(!__pyx_t_8)) {
7316             PyObject* exc_type = PyErr_Occurred();
7317             if (exc_type) {
7318               if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
7319               else __PYX_ERR(0, 446, __pyx_L1_error)
7320             }
7321             break;
7322           }
7323           __Pyx_GOTREF(__pyx_t_8);
7324         }
7325         __Pyx_XDECREF_SET(__pyx_v_schema, __pyx_t_8);
7326         __pyx_t_8 = 0;
7327 
7328         /* "fastavro/_read.pyx":447
7329  *         else:
7330  *             for schema in reader_schema:
7331  *                 if match_types(idx_schema, schema):             # <<<<<<<<<<<<<<
7332  *                     return _read_data(
7333  *                         fo,
7334  */
7335         __pyx_t_8 = __pyx_f_8fastavro_5_read_match_types(__pyx_v_idx_schema, __pyx_v_schema, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 447, __pyx_L1_error)
7336         __Pyx_GOTREF(__pyx_t_8);
7337         __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 447, __pyx_L1_error)
7338         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7339         if (__pyx_t_4) {
7340 
7341           /* "fastavro/_read.pyx":448
7342  *             for schema in reader_schema:
7343  *                 if match_types(idx_schema, schema):
7344  *                     return _read_data(             # <<<<<<<<<<<<<<
7345  *                         fo,
7346  *                         idx_schema,
7347  */
7348           __Pyx_XDECREF(__pyx_r);
7349 
7350           /* "fastavro/_read.pyx":453
7351  *                         named_schemas,
7352  *                         schema,
7353  *                         return_record_name,             # <<<<<<<<<<<<<<
7354  *                     )
7355  *         msg = 'schema mismatch: %s not found in %s' % (writer_schema, reader_schema)
7356  */
7357           __pyx_t_5.__pyx_n = 2;
7358           __pyx_t_5.reader_schema = __pyx_v_schema;
7359           __pyx_t_5.return_record_name = __pyx_v_return_record_name;
7360           __pyx_t_8 = __pyx_f_8fastavro_5_read__read_data(__pyx_v_fo, __pyx_v_idx_schema, __pyx_v_named_schemas, 0, &__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 448, __pyx_L1_error)
7361           __Pyx_GOTREF(__pyx_t_8);
7362           __pyx_r = __pyx_t_8;
7363           __pyx_t_8 = 0;
7364           __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7365           goto __pyx_L0;
7366 
7367           /* "fastavro/_read.pyx":447
7368  *         else:
7369  *             for schema in reader_schema:
7370  *                 if match_types(idx_schema, schema):             # <<<<<<<<<<<<<<
7371  *                     return _read_data(
7372  *                         fo,
7373  */
7374         }
7375 
7376         /* "fastavro/_read.pyx":446
7377  *                 )
7378  *         else:
7379  *             for schema in reader_schema:             # <<<<<<<<<<<<<<
7380  *                 if match_types(idx_schema, schema):
7381  *                     return _read_data(
7382  */
7383       }
7384       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7385     }
7386     __pyx_L4:;
7387 
7388     /* "fastavro/_read.pyx":455
7389  *                         return_record_name,
7390  *                     )
7391  *         msg = 'schema mismatch: %s not found in %s' % (writer_schema, reader_schema)             # <<<<<<<<<<<<<<
7392  *         raise SchemaResolutionError(msg)
7393  *     else:
7394  */
7395     __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 455, __pyx_L1_error)
7396     __Pyx_GOTREF(__pyx_t_2);
7397     __Pyx_INCREF(__pyx_v_writer_schema);
7398     __Pyx_GIVEREF(__pyx_v_writer_schema);
7399     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_writer_schema);
7400     __Pyx_INCREF(__pyx_v_reader_schema);
7401     __Pyx_GIVEREF(__pyx_v_reader_schema);
7402     PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_reader_schema);
7403     __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_schema_mismatch_s_not_found_in_s, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 455, __pyx_L1_error)
7404     __Pyx_GOTREF(__pyx_t_8);
7405     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7406     __pyx_v_msg = ((PyObject*)__pyx_t_8);
7407     __pyx_t_8 = 0;
7408 
7409     /* "fastavro/_read.pyx":456
7410  *                     )
7411  *         msg = 'schema mismatch: %s not found in %s' % (writer_schema, reader_schema)
7412  *         raise SchemaResolutionError(msg)             # <<<<<<<<<<<<<<
7413  *     else:
7414  *         if return_record_name and extract_record_type(idx_schema) == 'record':
7415  */
7416     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SchemaResolutionError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 456, __pyx_L1_error)
7417     __Pyx_GOTREF(__pyx_t_2);
7418     __pyx_t_9 = NULL;
7419     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
7420       __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2);
7421       if (likely(__pyx_t_9)) {
7422         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
7423         __Pyx_INCREF(__pyx_t_9);
7424         __Pyx_INCREF(function);
7425         __Pyx_DECREF_SET(__pyx_t_2, function);
7426       }
7427     }
7428     __pyx_t_8 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_9, __pyx_v_msg) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_msg);
7429     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
7430     if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 456, __pyx_L1_error)
7431     __Pyx_GOTREF(__pyx_t_8);
7432     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7433     __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7434     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7435     __PYX_ERR(0, 456, __pyx_L1_error)
7436 
7437     /* "fastavro/_read.pyx":434
7438  *     idx_schema = writer_schema[index]
7439  *
7440  *     if reader_schema:             # <<<<<<<<<<<<<<
7441  *         # Handle case where the reader schema is just a single type (not union)
7442  *         if not isinstance(reader_schema, list):
7443  */
7444   }
7445 
7446   /* "fastavro/_read.pyx":458
7447  *         raise SchemaResolutionError(msg)
7448  *     else:
7449  *         if return_record_name and extract_record_type(idx_schema) == 'record':             # <<<<<<<<<<<<<<
7450  *             return (
7451  *                 idx_schema['name'],
7452  */
7453   /*else*/ {
7454     __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_return_record_name); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 458, __pyx_L1_error)
7455     if (__pyx_t_3) {
7456     } else {
7457       __pyx_t_4 = __pyx_t_3;
7458       goto __pyx_L10_bool_binop_done;
7459     }
7460     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_extract_record_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 458, __pyx_L1_error)
7461     __Pyx_GOTREF(__pyx_t_2);
7462     __pyx_t_9 = NULL;
7463     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
7464       __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2);
7465       if (likely(__pyx_t_9)) {
7466         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
7467         __Pyx_INCREF(__pyx_t_9);
7468         __Pyx_INCREF(function);
7469         __Pyx_DECREF_SET(__pyx_t_2, function);
7470       }
7471     }
7472     __pyx_t_8 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_9, __pyx_v_idx_schema) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_idx_schema);
7473     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
7474     if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 458, __pyx_L1_error)
7475     __Pyx_GOTREF(__pyx_t_8);
7476     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7477     __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_8, __pyx_n_s_record, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 458, __pyx_L1_error)
7478     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7479     __pyx_t_4 = __pyx_t_3;
7480     __pyx_L10_bool_binop_done:;
7481     if (__pyx_t_4) {
7482 
7483       /* "fastavro/_read.pyx":459
7484  *     else:
7485  *         if return_record_name and extract_record_type(idx_schema) == 'record':
7486  *             return (             # <<<<<<<<<<<<<<
7487  *                 idx_schema['name'],
7488  *                 _read_data(
7489  */
7490       __Pyx_XDECREF(__pyx_r);
7491 
7492       /* "fastavro/_read.pyx":460
7493  *         if return_record_name and extract_record_type(idx_schema) == 'record':
7494  *             return (
7495  *                 idx_schema['name'],             # <<<<<<<<<<<<<<
7496  *                 _read_data(
7497  *                     fo,
7498  */
7499       __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_idx_schema, __pyx_n_s_name); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 460, __pyx_L1_error)
7500       __Pyx_GOTREF(__pyx_t_8);
7501 
7502       /* "fastavro/_read.pyx":461
7503  *             return (
7504  *                 idx_schema['name'],
7505  *                 _read_data(             # <<<<<<<<<<<<<<
7506  *                     fo,
7507  *                     idx_schema,
7508  */
7509       __pyx_t_5.__pyx_n = 2;
7510       __pyx_t_5.reader_schema = Py_None;
7511       __pyx_t_5.return_record_name = __pyx_v_return_record_name;
7512       __pyx_t_2 = __pyx_f_8fastavro_5_read__read_data(__pyx_v_fo, __pyx_v_idx_schema, __pyx_v_named_schemas, 0, &__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 461, __pyx_L1_error)
7513       __Pyx_GOTREF(__pyx_t_2);
7514 
7515       /* "fastavro/_read.pyx":460
7516  *         if return_record_name and extract_record_type(idx_schema) == 'record':
7517  *             return (
7518  *                 idx_schema['name'],             # <<<<<<<<<<<<<<
7519  *                 _read_data(
7520  *                     fo,
7521  */
7522       __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 460, __pyx_L1_error)
7523       __Pyx_GOTREF(__pyx_t_9);
7524       __Pyx_GIVEREF(__pyx_t_8);
7525       PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
7526       __Pyx_GIVEREF(__pyx_t_2);
7527       PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_2);
7528       __pyx_t_8 = 0;
7529       __pyx_t_2 = 0;
7530       __pyx_r = __pyx_t_9;
7531       __pyx_t_9 = 0;
7532       goto __pyx_L0;
7533 
7534       /* "fastavro/_read.pyx":458
7535  *         raise SchemaResolutionError(msg)
7536  *     else:
7537  *         if return_record_name and extract_record_type(idx_schema) == 'record':             # <<<<<<<<<<<<<<
7538  *             return (
7539  *                 idx_schema['name'],
7540  */
7541     }
7542 
7543     /* "fastavro/_read.pyx":469
7544  *                 )
7545  *             )
7546  *         elif return_record_name and extract_record_type(idx_schema) not in AVRO_TYPES:             # <<<<<<<<<<<<<<
7547  *             # idx_schema is a named type
7548  *             return (
7549  */
7550     __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_return_record_name); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 469, __pyx_L1_error)
7551     if (__pyx_t_3) {
7552     } else {
7553       __pyx_t_4 = __pyx_t_3;
7554       goto __pyx_L12_bool_binop_done;
7555     }
7556     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_extract_record_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 469, __pyx_L1_error)
7557     __Pyx_GOTREF(__pyx_t_2);
7558     __pyx_t_8 = NULL;
7559     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
7560       __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
7561       if (likely(__pyx_t_8)) {
7562         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
7563         __Pyx_INCREF(__pyx_t_8);
7564         __Pyx_INCREF(function);
7565         __Pyx_DECREF_SET(__pyx_t_2, function);
7566       }
7567     }
7568     __pyx_t_9 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_8, __pyx_v_idx_schema) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_idx_schema);
7569     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
7570     if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 469, __pyx_L1_error)
7571     __Pyx_GOTREF(__pyx_t_9);
7572     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7573     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_AVRO_TYPES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 469, __pyx_L1_error)
7574     __Pyx_GOTREF(__pyx_t_2);
7575     __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_9, __pyx_t_2, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 469, __pyx_L1_error)
7576     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7577     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7578     __pyx_t_10 = (__pyx_t_3 != 0);
7579     __pyx_t_4 = __pyx_t_10;
7580     __pyx_L12_bool_binop_done:;
7581     if (__pyx_t_4) {
7582 
7583       /* "fastavro/_read.pyx":471
7584  *         elif return_record_name and extract_record_type(idx_schema) not in AVRO_TYPES:
7585  *             # idx_schema is a named type
7586  *             return (             # <<<<<<<<<<<<<<
7587  *                 named_schemas[idx_schema]['name'],
7588  *                 _read_data(
7589  */
7590       __Pyx_XDECREF(__pyx_r);
7591 
7592       /* "fastavro/_read.pyx":472
7593  *             # idx_schema is a named type
7594  *             return (
7595  *                 named_schemas[idx_schema]['name'],             # <<<<<<<<<<<<<<
7596  *                 _read_data(
7597  *                     fo, idx_schema, named_schemas, None, return_record_name
7598  */
7599       __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_named_schemas, __pyx_v_idx_schema); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 472, __pyx_L1_error)
7600       __Pyx_GOTREF(__pyx_t_2);
7601       __pyx_t_9 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_s_name); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 472, __pyx_L1_error)
7602       __Pyx_GOTREF(__pyx_t_9);
7603       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7604 
7605       /* "fastavro/_read.pyx":473
7606  *             return (
7607  *                 named_schemas[idx_schema]['name'],
7608  *                 _read_data(             # <<<<<<<<<<<<<<
7609  *                     fo, idx_schema, named_schemas, None, return_record_name
7610  *                 )
7611  */
7612       __pyx_t_5.__pyx_n = 2;
7613       __pyx_t_5.reader_schema = Py_None;
7614       __pyx_t_5.return_record_name = __pyx_v_return_record_name;
7615       __pyx_t_2 = __pyx_f_8fastavro_5_read__read_data(__pyx_v_fo, __pyx_v_idx_schema, __pyx_v_named_schemas, 0, &__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 473, __pyx_L1_error)
7616       __Pyx_GOTREF(__pyx_t_2);
7617 
7618       /* "fastavro/_read.pyx":472
7619  *             # idx_schema is a named type
7620  *             return (
7621  *                 named_schemas[idx_schema]['name'],             # <<<<<<<<<<<<<<
7622  *                 _read_data(
7623  *                     fo, idx_schema, named_schemas, None, return_record_name
7624  */
7625       __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 472, __pyx_L1_error)
7626       __Pyx_GOTREF(__pyx_t_8);
7627       __Pyx_GIVEREF(__pyx_t_9);
7628       PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9);
7629       __Pyx_GIVEREF(__pyx_t_2);
7630       PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_2);
7631       __pyx_t_9 = 0;
7632       __pyx_t_2 = 0;
7633       __pyx_r = __pyx_t_8;
7634       __pyx_t_8 = 0;
7635       goto __pyx_L0;
7636 
7637       /* "fastavro/_read.pyx":469
7638  *                 )
7639  *             )
7640  *         elif return_record_name and extract_record_type(idx_schema) not in AVRO_TYPES:             # <<<<<<<<<<<<<<
7641  *             # idx_schema is a named type
7642  *             return (
7643  */
7644     }
7645 
7646     /* "fastavro/_read.pyx":479
7647  *
7648  *         else:
7649  *             return _read_data(             # <<<<<<<<<<<<<<
7650  *                 fo, idx_schema, named_schemas, None, return_record_name
7651  *             )
7652  */
7653     /*else*/ {
7654       __Pyx_XDECREF(__pyx_r);
7655 
7656       /* "fastavro/_read.pyx":480
7657  *         else:
7658  *             return _read_data(
7659  *                 fo, idx_schema, named_schemas, None, return_record_name             # <<<<<<<<<<<<<<
7660  *             )
7661  *
7662  */
7663       __pyx_t_5.__pyx_n = 2;
7664       __pyx_t_5.reader_schema = Py_None;
7665       __pyx_t_5.return_record_name = __pyx_v_return_record_name;
7666       __pyx_t_8 = __pyx_f_8fastavro_5_read__read_data(__pyx_v_fo, __pyx_v_idx_schema, __pyx_v_named_schemas, 0, &__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 479, __pyx_L1_error)
7667       __Pyx_GOTREF(__pyx_t_8);
7668       __pyx_r = __pyx_t_8;
7669       __pyx_t_8 = 0;
7670       goto __pyx_L0;
7671     }
7672   }
7673 
7674   /* "fastavro/_read.pyx":418
7675  *
7676  *
7677  * cdef read_union(             # <<<<<<<<<<<<<<
7678  *     fo,
7679  *     writer_schema,
7680  */
7681 
7682   /* function exit code */
7683   __pyx_L1_error:;
7684   __Pyx_XDECREF(__pyx_t_2);
7685   __Pyx_XDECREF(__pyx_t_8);
7686   __Pyx_XDECREF(__pyx_t_9);
7687   __Pyx_AddTraceback("fastavro._read.read_union", __pyx_clineno, __pyx_lineno, __pyx_filename);
7688   __pyx_r = 0;
7689   __pyx_L0:;
7690   __Pyx_XDECREF(__pyx_v_idx_schema);
7691   __Pyx_XDECREF(__pyx_v_schema);
7692   __Pyx_XDECREF(__pyx_v_msg);
7693   __Pyx_XGIVEREF(__pyx_r);
7694   __Pyx_RefNannyFinishContext();
7695   return __pyx_r;
7696 }
7697 
7698 /* "fastavro/_read.pyx":484
7699  *
7700  *
7701  * cdef read_record(             # <<<<<<<<<<<<<<
7702  *     fo,
7703  *     writer_schema,
7704  */
7705 
__pyx_f_8fastavro_5_read_read_record(PyObject * __pyx_v_fo,PyObject * __pyx_v_writer_schema,PyObject * __pyx_v_named_schemas,struct __pyx_opt_args_8fastavro_5_read_read_record * __pyx_optional_args)7706 static PyObject *__pyx_f_8fastavro_5_read_read_record(PyObject *__pyx_v_fo, PyObject *__pyx_v_writer_schema, PyObject *__pyx_v_named_schemas, struct __pyx_opt_args_8fastavro_5_read_read_record *__pyx_optional_args) {
7707 
7708   /* "fastavro/_read.pyx":488
7709  *     writer_schema,
7710  *     named_schemas,
7711  *     reader_schema=None,             # <<<<<<<<<<<<<<
7712  *     return_record_name=False,
7713  * ):
7714  */
7715   PyObject *__pyx_v_reader_schema = ((PyObject *)Py_None);
7716 
7717   /* "fastavro/_read.pyx":489
7718  *     named_schemas,
7719  *     reader_schema=None,
7720  *     return_record_name=False,             # <<<<<<<<<<<<<<
7721  * ):
7722  *     """A record is encoded by encoding the values of its fields in the order
7723  */
7724   PyObject *__pyx_v_return_record_name = ((PyObject *)Py_False);
7725   PyObject *__pyx_v_record = NULL;
7726   PyObject *__pyx_v_field = NULL;
7727   PyObject *__pyx_v_readers_field_dict = NULL;
7728   PyObject *__pyx_v_aliases_field_dict = NULL;
7729   PyObject *__pyx_v_f = NULL;
7730   PyObject *__pyx_v_alias = NULL;
7731   PyObject *__pyx_v_readers_field = NULL;
7732   PyObject *__pyx_v_writer_fields = NULL;
7733   PyObject *__pyx_v_f_name = NULL;
7734   PyObject *__pyx_v_msg = NULL;
7735   PyObject *__pyx_7genexpr__pyx_v_f = NULL;
7736   PyObject *__pyx_r = NULL;
7737   __Pyx_RefNannyDeclarations
7738   PyObject *__pyx_t_1 = NULL;
7739   int __pyx_t_2;
7740   int __pyx_t_3;
7741   PyObject *__pyx_t_4 = NULL;
7742   Py_ssize_t __pyx_t_5;
7743   PyObject *(*__pyx_t_6)(PyObject *);
7744   PyObject *__pyx_t_7 = NULL;
7745   struct __pyx_opt_args_8fastavro_5_read__read_data __pyx_t_8;
7746   PyObject *__pyx_t_9 = NULL;
7747   PyObject *__pyx_t_10 = NULL;
7748   int __pyx_t_11;
7749   PyObject *__pyx_t_12 = NULL;
7750   Py_ssize_t __pyx_t_13;
7751   PyObject *(*__pyx_t_14)(PyObject *);
7752   PyObject *(*__pyx_t_15)(PyObject *);
7753   int __pyx_t_16;
7754   int __pyx_lineno = 0;
7755   const char *__pyx_filename = NULL;
7756   int __pyx_clineno = 0;
7757   __Pyx_RefNannySetupContext("read_record", 0);
7758   if (__pyx_optional_args) {
7759     if (__pyx_optional_args->__pyx_n > 0) {
7760       __pyx_v_reader_schema = __pyx_optional_args->reader_schema;
7761       if (__pyx_optional_args->__pyx_n > 1) {
7762         __pyx_v_return_record_name = __pyx_optional_args->return_record_name;
7763       }
7764     }
7765   }
7766 
7767   /* "fastavro/_read.pyx":509
7768  *          field's value is unset.
7769  *     """
7770  *     record = {}             # <<<<<<<<<<<<<<
7771  *     if reader_schema is None:
7772  *         for field in writer_schema['fields']:
7773  */
7774   __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 509, __pyx_L1_error)
7775   __Pyx_GOTREF(__pyx_t_1);
7776   __pyx_v_record = ((PyObject*)__pyx_t_1);
7777   __pyx_t_1 = 0;
7778 
7779   /* "fastavro/_read.pyx":510
7780  *     """
7781  *     record = {}
7782  *     if reader_schema is None:             # <<<<<<<<<<<<<<
7783  *         for field in writer_schema['fields']:
7784  *             record[field['name']] = _read_data(
7785  */
7786   __pyx_t_2 = (__pyx_v_reader_schema == Py_None);
7787   __pyx_t_3 = (__pyx_t_2 != 0);
7788   if (__pyx_t_3) {
7789 
7790     /* "fastavro/_read.pyx":511
7791  *     record = {}
7792  *     if reader_schema is None:
7793  *         for field in writer_schema['fields']:             # <<<<<<<<<<<<<<
7794  *             record[field['name']] = _read_data(
7795  *                 fo,
7796  */
7797     __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_writer_schema, __pyx_n_s_fields); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 511, __pyx_L1_error)
7798     __Pyx_GOTREF(__pyx_t_1);
7799     if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
7800       __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
7801       __pyx_t_6 = NULL;
7802     } else {
7803       __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 511, __pyx_L1_error)
7804       __Pyx_GOTREF(__pyx_t_4);
7805       __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 511, __pyx_L1_error)
7806     }
7807     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7808     for (;;) {
7809       if (likely(!__pyx_t_6)) {
7810         if (likely(PyList_CheckExact(__pyx_t_4))) {
7811           if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
7812           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7813           __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 511, __pyx_L1_error)
7814           #else
7815           __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 511, __pyx_L1_error)
7816           __Pyx_GOTREF(__pyx_t_1);
7817           #endif
7818         } else {
7819           if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
7820           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7821           __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 511, __pyx_L1_error)
7822           #else
7823           __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 511, __pyx_L1_error)
7824           __Pyx_GOTREF(__pyx_t_1);
7825           #endif
7826         }
7827       } else {
7828         __pyx_t_1 = __pyx_t_6(__pyx_t_4);
7829         if (unlikely(!__pyx_t_1)) {
7830           PyObject* exc_type = PyErr_Occurred();
7831           if (exc_type) {
7832             if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
7833             else __PYX_ERR(0, 511, __pyx_L1_error)
7834           }
7835           break;
7836         }
7837         __Pyx_GOTREF(__pyx_t_1);
7838       }
7839       __Pyx_XDECREF_SET(__pyx_v_field, __pyx_t_1);
7840       __pyx_t_1 = 0;
7841 
7842       /* "fastavro/_read.pyx":514
7843  *             record[field['name']] = _read_data(
7844  *                 fo,
7845  *                 field['type'],             # <<<<<<<<<<<<<<
7846  *                 named_schemas,
7847  *                 None,
7848  */
7849       __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_field, __pyx_n_s_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error)
7850       __Pyx_GOTREF(__pyx_t_1);
7851 
7852       /* "fastavro/_read.pyx":512
7853  *     if reader_schema is None:
7854  *         for field in writer_schema['fields']:
7855  *             record[field['name']] = _read_data(             # <<<<<<<<<<<<<<
7856  *                 fo,
7857  *                 field['type'],
7858  */
7859       __pyx_t_8.__pyx_n = 2;
7860       __pyx_t_8.reader_schema = Py_None;
7861       __pyx_t_8.return_record_name = __pyx_v_return_record_name;
7862       __pyx_t_7 = __pyx_f_8fastavro_5_read__read_data(__pyx_v_fo, __pyx_t_1, __pyx_v_named_schemas, 0, &__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 512, __pyx_L1_error)
7863       __Pyx_GOTREF(__pyx_t_7);
7864       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7865       __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_field, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error)
7866       __Pyx_GOTREF(__pyx_t_1);
7867       if (unlikely(PyDict_SetItem(__pyx_v_record, __pyx_t_1, __pyx_t_7) < 0)) __PYX_ERR(0, 512, __pyx_L1_error)
7868       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7869       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7870 
7871       /* "fastavro/_read.pyx":511
7872  *     record = {}
7873  *     if reader_schema is None:
7874  *         for field in writer_schema['fields']:             # <<<<<<<<<<<<<<
7875  *             record[field['name']] = _read_data(
7876  *                 fo,
7877  */
7878     }
7879     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7880 
7881     /* "fastavro/_read.pyx":510
7882  *     """
7883  *     record = {}
7884  *     if reader_schema is None:             # <<<<<<<<<<<<<<
7885  *         for field in writer_schema['fields']:
7886  *             record[field['name']] = _read_data(
7887  */
7888     goto __pyx_L3;
7889   }
7890 
7891   /* "fastavro/_read.pyx":520
7892  *             )
7893  *     else:
7894  *         readers_field_dict = {}             # <<<<<<<<<<<<<<
7895  *         aliases_field_dict = {}
7896  *         for f in reader_schema['fields']:
7897  */
7898   /*else*/ {
7899     __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error)
7900     __Pyx_GOTREF(__pyx_t_4);
7901     __pyx_v_readers_field_dict = ((PyObject*)__pyx_t_4);
7902     __pyx_t_4 = 0;
7903 
7904     /* "fastavro/_read.pyx":521
7905  *     else:
7906  *         readers_field_dict = {}
7907  *         aliases_field_dict = {}             # <<<<<<<<<<<<<<
7908  *         for f in reader_schema['fields']:
7909  *             readers_field_dict[f['name']] = f
7910  */
7911     __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 521, __pyx_L1_error)
7912     __Pyx_GOTREF(__pyx_t_4);
7913     __pyx_v_aliases_field_dict = ((PyObject*)__pyx_t_4);
7914     __pyx_t_4 = 0;
7915 
7916     /* "fastavro/_read.pyx":522
7917  *         readers_field_dict = {}
7918  *         aliases_field_dict = {}
7919  *         for f in reader_schema['fields']:             # <<<<<<<<<<<<<<
7920  *             readers_field_dict[f['name']] = f
7921  *             for alias in f.get('aliases', []):
7922  */
7923     __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_reader_schema, __pyx_n_s_fields); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error)
7924     __Pyx_GOTREF(__pyx_t_4);
7925     if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
7926       __pyx_t_7 = __pyx_t_4; __Pyx_INCREF(__pyx_t_7); __pyx_t_5 = 0;
7927       __pyx_t_6 = NULL;
7928     } else {
7929       __pyx_t_5 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 522, __pyx_L1_error)
7930       __Pyx_GOTREF(__pyx_t_7);
7931       __pyx_t_6 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 522, __pyx_L1_error)
7932     }
7933     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7934     for (;;) {
7935       if (likely(!__pyx_t_6)) {
7936         if (likely(PyList_CheckExact(__pyx_t_7))) {
7937           if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_7)) break;
7938           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7939           __pyx_t_4 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 522, __pyx_L1_error)
7940           #else
7941           __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error)
7942           __Pyx_GOTREF(__pyx_t_4);
7943           #endif
7944         } else {
7945           if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
7946           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7947           __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 522, __pyx_L1_error)
7948           #else
7949           __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error)
7950           __Pyx_GOTREF(__pyx_t_4);
7951           #endif
7952         }
7953       } else {
7954         __pyx_t_4 = __pyx_t_6(__pyx_t_7);
7955         if (unlikely(!__pyx_t_4)) {
7956           PyObject* exc_type = PyErr_Occurred();
7957           if (exc_type) {
7958             if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
7959             else __PYX_ERR(0, 522, __pyx_L1_error)
7960           }
7961           break;
7962         }
7963         __Pyx_GOTREF(__pyx_t_4);
7964       }
7965       __Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_4);
7966       __pyx_t_4 = 0;
7967 
7968       /* "fastavro/_read.pyx":523
7969  *         aliases_field_dict = {}
7970  *         for f in reader_schema['fields']:
7971  *             readers_field_dict[f['name']] = f             # <<<<<<<<<<<<<<
7972  *             for alias in f.get('aliases', []):
7973  *                 aliases_field_dict[alias] = f
7974  */
7975       __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_f, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 523, __pyx_L1_error)
7976       __Pyx_GOTREF(__pyx_t_4);
7977       if (unlikely(PyDict_SetItem(__pyx_v_readers_field_dict, __pyx_t_4, __pyx_v_f) < 0)) __PYX_ERR(0, 523, __pyx_L1_error)
7978       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7979 
7980       /* "fastavro/_read.pyx":524
7981  *         for f in reader_schema['fields']:
7982  *             readers_field_dict[f['name']] = f
7983  *             for alias in f.get('aliases', []):             # <<<<<<<<<<<<<<
7984  *                 aliases_field_dict[alias] = f
7985  *
7986  */
7987       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 524, __pyx_L1_error)
7988       __Pyx_GOTREF(__pyx_t_1);
7989       __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 524, __pyx_L1_error)
7990       __Pyx_GOTREF(__pyx_t_9);
7991       __pyx_t_10 = NULL;
7992       __pyx_t_11 = 0;
7993       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
7994         __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_1);
7995         if (likely(__pyx_t_10)) {
7996           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
7997           __Pyx_INCREF(__pyx_t_10);
7998           __Pyx_INCREF(function);
7999           __Pyx_DECREF_SET(__pyx_t_1, function);
8000           __pyx_t_11 = 1;
8001         }
8002       }
8003       #if CYTHON_FAST_PYCALL
8004       if (PyFunction_Check(__pyx_t_1)) {
8005         PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_n_s_aliases, __pyx_t_9};
8006         __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 524, __pyx_L1_error)
8007         __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
8008         __Pyx_GOTREF(__pyx_t_4);
8009         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8010       } else
8011       #endif
8012       #if CYTHON_FAST_PYCCALL
8013       if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
8014         PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_n_s_aliases, __pyx_t_9};
8015         __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 524, __pyx_L1_error)
8016         __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
8017         __Pyx_GOTREF(__pyx_t_4);
8018         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8019       } else
8020       #endif
8021       {
8022         __pyx_t_12 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 524, __pyx_L1_error)
8023         __Pyx_GOTREF(__pyx_t_12);
8024         if (__pyx_t_10) {
8025           __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL;
8026         }
8027         __Pyx_INCREF(__pyx_n_s_aliases);
8028         __Pyx_GIVEREF(__pyx_n_s_aliases);
8029         PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, __pyx_n_s_aliases);
8030         __Pyx_GIVEREF(__pyx_t_9);
8031         PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_t_9);
8032         __pyx_t_9 = 0;
8033         __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_12, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 524, __pyx_L1_error)
8034         __Pyx_GOTREF(__pyx_t_4);
8035         __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
8036       }
8037       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8038       if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
8039         __pyx_t_1 = __pyx_t_4; __Pyx_INCREF(__pyx_t_1); __pyx_t_13 = 0;
8040         __pyx_t_14 = NULL;
8041       } else {
8042         __pyx_t_13 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 524, __pyx_L1_error)
8043         __Pyx_GOTREF(__pyx_t_1);
8044         __pyx_t_14 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 524, __pyx_L1_error)
8045       }
8046       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8047       for (;;) {
8048         if (likely(!__pyx_t_14)) {
8049           if (likely(PyList_CheckExact(__pyx_t_1))) {
8050             if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_1)) break;
8051             #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8052             __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_13); __Pyx_INCREF(__pyx_t_4); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 524, __pyx_L1_error)
8053             #else
8054             __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 524, __pyx_L1_error)
8055             __Pyx_GOTREF(__pyx_t_4);
8056             #endif
8057           } else {
8058             if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
8059             #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8060             __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_13); __Pyx_INCREF(__pyx_t_4); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 524, __pyx_L1_error)
8061             #else
8062             __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 524, __pyx_L1_error)
8063             __Pyx_GOTREF(__pyx_t_4);
8064             #endif
8065           }
8066         } else {
8067           __pyx_t_4 = __pyx_t_14(__pyx_t_1);
8068           if (unlikely(!__pyx_t_4)) {
8069             PyObject* exc_type = PyErr_Occurred();
8070             if (exc_type) {
8071               if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
8072               else __PYX_ERR(0, 524, __pyx_L1_error)
8073             }
8074             break;
8075           }
8076           __Pyx_GOTREF(__pyx_t_4);
8077         }
8078         __Pyx_XDECREF_SET(__pyx_v_alias, __pyx_t_4);
8079         __pyx_t_4 = 0;
8080 
8081         /* "fastavro/_read.pyx":525
8082  *             readers_field_dict[f['name']] = f
8083  *             for alias in f.get('aliases', []):
8084  *                 aliases_field_dict[alias] = f             # <<<<<<<<<<<<<<
8085  *
8086  *         for field in writer_schema['fields']:
8087  */
8088         if (unlikely(PyDict_SetItem(__pyx_v_aliases_field_dict, __pyx_v_alias, __pyx_v_f) < 0)) __PYX_ERR(0, 525, __pyx_L1_error)
8089 
8090         /* "fastavro/_read.pyx":524
8091  *         for f in reader_schema['fields']:
8092  *             readers_field_dict[f['name']] = f
8093  *             for alias in f.get('aliases', []):             # <<<<<<<<<<<<<<
8094  *                 aliases_field_dict[alias] = f
8095  *
8096  */
8097       }
8098       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8099 
8100       /* "fastavro/_read.pyx":522
8101  *         readers_field_dict = {}
8102  *         aliases_field_dict = {}
8103  *         for f in reader_schema['fields']:             # <<<<<<<<<<<<<<
8104  *             readers_field_dict[f['name']] = f
8105  *             for alias in f.get('aliases', []):
8106  */
8107     }
8108     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8109 
8110     /* "fastavro/_read.pyx":527
8111  *                 aliases_field_dict[alias] = f
8112  *
8113  *         for field in writer_schema['fields']:             # <<<<<<<<<<<<<<
8114  *             readers_field = readers_field_dict.get(
8115  *                 field['name'],
8116  */
8117     __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_v_writer_schema, __pyx_n_s_fields); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 527, __pyx_L1_error)
8118     __Pyx_GOTREF(__pyx_t_7);
8119     if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
8120       __pyx_t_1 = __pyx_t_7; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0;
8121       __pyx_t_6 = NULL;
8122     } else {
8123       __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error)
8124       __Pyx_GOTREF(__pyx_t_1);
8125       __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 527, __pyx_L1_error)
8126     }
8127     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8128     for (;;) {
8129       if (likely(!__pyx_t_6)) {
8130         if (likely(PyList_CheckExact(__pyx_t_1))) {
8131           if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break;
8132           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8133           __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 527, __pyx_L1_error)
8134           #else
8135           __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 527, __pyx_L1_error)
8136           __Pyx_GOTREF(__pyx_t_7);
8137           #endif
8138         } else {
8139           if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
8140           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8141           __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 527, __pyx_L1_error)
8142           #else
8143           __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 527, __pyx_L1_error)
8144           __Pyx_GOTREF(__pyx_t_7);
8145           #endif
8146         }
8147       } else {
8148         __pyx_t_7 = __pyx_t_6(__pyx_t_1);
8149         if (unlikely(!__pyx_t_7)) {
8150           PyObject* exc_type = PyErr_Occurred();
8151           if (exc_type) {
8152             if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
8153             else __PYX_ERR(0, 527, __pyx_L1_error)
8154           }
8155           break;
8156         }
8157         __Pyx_GOTREF(__pyx_t_7);
8158       }
8159       __Pyx_XDECREF_SET(__pyx_v_field, __pyx_t_7);
8160       __pyx_t_7 = 0;
8161 
8162       /* "fastavro/_read.pyx":529
8163  *         for field in writer_schema['fields']:
8164  *             readers_field = readers_field_dict.get(
8165  *                 field['name'],             # <<<<<<<<<<<<<<
8166  *                 aliases_field_dict.get(field['name']),
8167  *             )
8168  */
8169       __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_v_field, __pyx_n_s_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 529, __pyx_L1_error)
8170       __Pyx_GOTREF(__pyx_t_7);
8171 
8172       /* "fastavro/_read.pyx":530
8173  *             readers_field = readers_field_dict.get(
8174  *                 field['name'],
8175  *                 aliases_field_dict.get(field['name']),             # <<<<<<<<<<<<<<
8176  *             )
8177  *             if readers_field:
8178  */
8179       __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_field, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 530, __pyx_L1_error)
8180       __Pyx_GOTREF(__pyx_t_4);
8181       __pyx_t_12 = __Pyx_PyDict_GetItemDefault(__pyx_v_aliases_field_dict, __pyx_t_4, Py_None); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 530, __pyx_L1_error)
8182       __Pyx_GOTREF(__pyx_t_12);
8183       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8184 
8185       /* "fastavro/_read.pyx":528
8186  *
8187  *         for field in writer_schema['fields']:
8188  *             readers_field = readers_field_dict.get(             # <<<<<<<<<<<<<<
8189  *                 field['name'],
8190  *                 aliases_field_dict.get(field['name']),
8191  */
8192       __pyx_t_4 = __Pyx_PyDict_GetItemDefault(__pyx_v_readers_field_dict, __pyx_t_7, __pyx_t_12); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 528, __pyx_L1_error)
8193       __Pyx_GOTREF(__pyx_t_4);
8194       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8195       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
8196       __Pyx_XDECREF_SET(__pyx_v_readers_field, __pyx_t_4);
8197       __pyx_t_4 = 0;
8198 
8199       /* "fastavro/_read.pyx":532
8200  *                 aliases_field_dict.get(field['name']),
8201  *             )
8202  *             if readers_field:             # <<<<<<<<<<<<<<
8203  *                 record[readers_field['name']] = _read_data(
8204  *                     fo,
8205  */
8206       __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_readers_field); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 532, __pyx_L1_error)
8207       if (__pyx_t_3) {
8208 
8209         /* "fastavro/_read.pyx":535
8210  *                 record[readers_field['name']] = _read_data(
8211  *                     fo,
8212  *                     field['type'],             # <<<<<<<<<<<<<<
8213  *                     named_schemas,
8214  *                     readers_field['type'],
8215  */
8216         __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_field, __pyx_n_s_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 535, __pyx_L1_error)
8217         __Pyx_GOTREF(__pyx_t_4);
8218 
8219         /* "fastavro/_read.pyx":537
8220  *                     field['type'],
8221  *                     named_schemas,
8222  *                     readers_field['type'],             # <<<<<<<<<<<<<<
8223  *                     return_record_name,
8224  *                 )
8225  */
8226         __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_readers_field, __pyx_n_s_type); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 537, __pyx_L1_error)
8227         __Pyx_GOTREF(__pyx_t_12);
8228 
8229         /* "fastavro/_read.pyx":533
8230  *             )
8231  *             if readers_field:
8232  *                 record[readers_field['name']] = _read_data(             # <<<<<<<<<<<<<<
8233  *                     fo,
8234  *                     field['type'],
8235  */
8236         __pyx_t_8.__pyx_n = 2;
8237         __pyx_t_8.reader_schema = __pyx_t_12;
8238         __pyx_t_8.return_record_name = __pyx_v_return_record_name;
8239         __pyx_t_7 = __pyx_f_8fastavro_5_read__read_data(__pyx_v_fo, __pyx_t_4, __pyx_v_named_schemas, 0, &__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 533, __pyx_L1_error)
8240         __Pyx_GOTREF(__pyx_t_7);
8241         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8242         __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
8243         __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_readers_field, __pyx_n_s_name); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 533, __pyx_L1_error)
8244         __Pyx_GOTREF(__pyx_t_12);
8245         if (unlikely(PyDict_SetItem(__pyx_v_record, __pyx_t_12, __pyx_t_7) < 0)) __PYX_ERR(0, 533, __pyx_L1_error)
8246         __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
8247         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8248 
8249         /* "fastavro/_read.pyx":532
8250  *                 aliases_field_dict.get(field['name']),
8251  *             )
8252  *             if readers_field:             # <<<<<<<<<<<<<<
8253  *                 record[readers_field['name']] = _read_data(
8254  *                     fo,
8255  */
8256         goto __pyx_L12;
8257       }
8258 
8259       /* "fastavro/_read.pyx":542
8260  *             else:
8261  *                 # should implement skip
8262  *                 _read_data(             # <<<<<<<<<<<<<<
8263  *                     fo,
8264  *                     field['type'],
8265  */
8266       /*else*/ {
8267 
8268         /* "fastavro/_read.pyx":544
8269  *                 _read_data(
8270  *                     fo,
8271  *                     field['type'],             # <<<<<<<<<<<<<<
8272  *                     named_schemas,
8273  *                     field['type'],
8274  */
8275         __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_v_field, __pyx_n_s_type); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 544, __pyx_L1_error)
8276         __Pyx_GOTREF(__pyx_t_7);
8277 
8278         /* "fastavro/_read.pyx":546
8279  *                     field['type'],
8280  *                     named_schemas,
8281  *                     field['type'],             # <<<<<<<<<<<<<<
8282  *                     return_record_name,
8283  *                 )
8284  */
8285         __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_field, __pyx_n_s_type); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 546, __pyx_L1_error)
8286         __Pyx_GOTREF(__pyx_t_12);
8287 
8288         /* "fastavro/_read.pyx":542
8289  *             else:
8290  *                 # should implement skip
8291  *                 _read_data(             # <<<<<<<<<<<<<<
8292  *                     fo,
8293  *                     field['type'],
8294  */
8295         __pyx_t_8.__pyx_n = 2;
8296         __pyx_t_8.reader_schema = __pyx_t_12;
8297         __pyx_t_8.return_record_name = __pyx_v_return_record_name;
8298         __pyx_t_4 = __pyx_f_8fastavro_5_read__read_data(__pyx_v_fo, __pyx_t_7, __pyx_v_named_schemas, 0, &__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 542, __pyx_L1_error)
8299         __Pyx_GOTREF(__pyx_t_4);
8300         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8301         __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
8302         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8303       }
8304       __pyx_L12:;
8305 
8306       /* "fastavro/_read.pyx":527
8307  *                 aliases_field_dict[alias] = f
8308  *
8309  *         for field in writer_schema['fields']:             # <<<<<<<<<<<<<<
8310  *             readers_field = readers_field_dict.get(
8311  *                 field['name'],
8312  */
8313     }
8314     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8315 
8316     /* "fastavro/_read.pyx":551
8317  *
8318  *         # fill in default values
8319  *         if len(readers_field_dict) > len(record):             # <<<<<<<<<<<<<<
8320  *             writer_fields = [f['name'] for f in writer_schema['fields']]
8321  *             for f_name, field in iteritems(readers_field_dict):
8322  */
8323     __pyx_t_5 = PyDict_Size(__pyx_v_readers_field_dict); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 551, __pyx_L1_error)
8324     __pyx_t_13 = PyDict_Size(__pyx_v_record); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 551, __pyx_L1_error)
8325     __pyx_t_3 = ((__pyx_t_5 > __pyx_t_13) != 0);
8326     if (__pyx_t_3) {
8327 
8328       /* "fastavro/_read.pyx":552
8329  *         # fill in default values
8330  *         if len(readers_field_dict) > len(record):
8331  *             writer_fields = [f['name'] for f in writer_schema['fields']]             # <<<<<<<<<<<<<<
8332  *             for f_name, field in iteritems(readers_field_dict):
8333  *                 if f_name not in writer_fields and f_name not in record:
8334  */
8335       { /* enter inner scope */
8336         __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 552, __pyx_L16_error)
8337         __Pyx_GOTREF(__pyx_t_1);
8338         __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_writer_schema, __pyx_n_s_fields); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 552, __pyx_L16_error)
8339         __Pyx_GOTREF(__pyx_t_4);
8340         if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
8341           __pyx_t_12 = __pyx_t_4; __Pyx_INCREF(__pyx_t_12); __pyx_t_13 = 0;
8342           __pyx_t_6 = NULL;
8343         } else {
8344           __pyx_t_13 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 552, __pyx_L16_error)
8345           __Pyx_GOTREF(__pyx_t_12);
8346           __pyx_t_6 = Py_TYPE(__pyx_t_12)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 552, __pyx_L16_error)
8347         }
8348         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8349         for (;;) {
8350           if (likely(!__pyx_t_6)) {
8351             if (likely(PyList_CheckExact(__pyx_t_12))) {
8352               if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_12)) break;
8353               #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8354               __pyx_t_4 = PyList_GET_ITEM(__pyx_t_12, __pyx_t_13); __Pyx_INCREF(__pyx_t_4); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 552, __pyx_L16_error)
8355               #else
8356               __pyx_t_4 = PySequence_ITEM(__pyx_t_12, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 552, __pyx_L16_error)
8357               __Pyx_GOTREF(__pyx_t_4);
8358               #endif
8359             } else {
8360               if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_12)) break;
8361               #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8362               __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_13); __Pyx_INCREF(__pyx_t_4); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 552, __pyx_L16_error)
8363               #else
8364               __pyx_t_4 = PySequence_ITEM(__pyx_t_12, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 552, __pyx_L16_error)
8365               __Pyx_GOTREF(__pyx_t_4);
8366               #endif
8367             }
8368           } else {
8369             __pyx_t_4 = __pyx_t_6(__pyx_t_12);
8370             if (unlikely(!__pyx_t_4)) {
8371               PyObject* exc_type = PyErr_Occurred();
8372               if (exc_type) {
8373                 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
8374                 else __PYX_ERR(0, 552, __pyx_L16_error)
8375               }
8376               break;
8377             }
8378             __Pyx_GOTREF(__pyx_t_4);
8379           }
8380           __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_f, __pyx_t_4);
8381           __pyx_t_4 = 0;
8382           __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_7genexpr__pyx_v_f, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 552, __pyx_L16_error)
8383           __Pyx_GOTREF(__pyx_t_4);
8384           if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 552, __pyx_L16_error)
8385           __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8386         }
8387         __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
8388         __Pyx_XDECREF(__pyx_7genexpr__pyx_v_f); __pyx_7genexpr__pyx_v_f = 0;
8389         goto __pyx_L19_exit_scope;
8390         __pyx_L16_error:;
8391         __Pyx_XDECREF(__pyx_7genexpr__pyx_v_f); __pyx_7genexpr__pyx_v_f = 0;
8392         goto __pyx_L1_error;
8393         __pyx_L19_exit_scope:;
8394       } /* exit inner scope */
8395       __pyx_v_writer_fields = ((PyObject*)__pyx_t_1);
8396       __pyx_t_1 = 0;
8397 
8398       /* "fastavro/_read.pyx":553
8399  *         if len(readers_field_dict) > len(record):
8400  *             writer_fields = [f['name'] for f in writer_schema['fields']]
8401  *             for f_name, field in iteritems(readers_field_dict):             # <<<<<<<<<<<<<<
8402  *                 if f_name not in writer_fields and f_name not in record:
8403  *                     if 'default' in field:
8404  */
8405       __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_iteritems); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 553, __pyx_L1_error)
8406       __Pyx_GOTREF(__pyx_t_12);
8407       __pyx_t_4 = NULL;
8408       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
8409         __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_12);
8410         if (likely(__pyx_t_4)) {
8411           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
8412           __Pyx_INCREF(__pyx_t_4);
8413           __Pyx_INCREF(function);
8414           __Pyx_DECREF_SET(__pyx_t_12, function);
8415         }
8416       }
8417       __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_4, __pyx_v_readers_field_dict) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_v_readers_field_dict);
8418       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8419       if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 553, __pyx_L1_error)
8420       __Pyx_GOTREF(__pyx_t_1);
8421       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
8422       if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
8423         __pyx_t_12 = __pyx_t_1; __Pyx_INCREF(__pyx_t_12); __pyx_t_13 = 0;
8424         __pyx_t_6 = NULL;
8425       } else {
8426         __pyx_t_13 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 553, __pyx_L1_error)
8427         __Pyx_GOTREF(__pyx_t_12);
8428         __pyx_t_6 = Py_TYPE(__pyx_t_12)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 553, __pyx_L1_error)
8429       }
8430       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8431       for (;;) {
8432         if (likely(!__pyx_t_6)) {
8433           if (likely(PyList_CheckExact(__pyx_t_12))) {
8434             if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_12)) break;
8435             #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8436             __pyx_t_1 = PyList_GET_ITEM(__pyx_t_12, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 553, __pyx_L1_error)
8437             #else
8438             __pyx_t_1 = PySequence_ITEM(__pyx_t_12, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 553, __pyx_L1_error)
8439             __Pyx_GOTREF(__pyx_t_1);
8440             #endif
8441           } else {
8442             if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_12)) break;
8443             #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8444             __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 553, __pyx_L1_error)
8445             #else
8446             __pyx_t_1 = PySequence_ITEM(__pyx_t_12, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 553, __pyx_L1_error)
8447             __Pyx_GOTREF(__pyx_t_1);
8448             #endif
8449           }
8450         } else {
8451           __pyx_t_1 = __pyx_t_6(__pyx_t_12);
8452           if (unlikely(!__pyx_t_1)) {
8453             PyObject* exc_type = PyErr_Occurred();
8454             if (exc_type) {
8455               if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
8456               else __PYX_ERR(0, 553, __pyx_L1_error)
8457             }
8458             break;
8459           }
8460           __Pyx_GOTREF(__pyx_t_1);
8461         }
8462         if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
8463           PyObject* sequence = __pyx_t_1;
8464           Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
8465           if (unlikely(size != 2)) {
8466             if (size > 2) __Pyx_RaiseTooManyValuesError(2);
8467             else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
8468             __PYX_ERR(0, 553, __pyx_L1_error)
8469           }
8470           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8471           if (likely(PyTuple_CheckExact(sequence))) {
8472             __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
8473             __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
8474           } else {
8475             __pyx_t_4 = PyList_GET_ITEM(sequence, 0);
8476             __pyx_t_7 = PyList_GET_ITEM(sequence, 1);
8477           }
8478           __Pyx_INCREF(__pyx_t_4);
8479           __Pyx_INCREF(__pyx_t_7);
8480           #else
8481           __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 553, __pyx_L1_error)
8482           __Pyx_GOTREF(__pyx_t_4);
8483           __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 553, __pyx_L1_error)
8484           __Pyx_GOTREF(__pyx_t_7);
8485           #endif
8486           __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8487         } else {
8488           Py_ssize_t index = -1;
8489           __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 553, __pyx_L1_error)
8490           __Pyx_GOTREF(__pyx_t_9);
8491           __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8492           __pyx_t_15 = Py_TYPE(__pyx_t_9)->tp_iternext;
8493           index = 0; __pyx_t_4 = __pyx_t_15(__pyx_t_9); if (unlikely(!__pyx_t_4)) goto __pyx_L22_unpacking_failed;
8494           __Pyx_GOTREF(__pyx_t_4);
8495           index = 1; __pyx_t_7 = __pyx_t_15(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L22_unpacking_failed;
8496           __Pyx_GOTREF(__pyx_t_7);
8497           if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_9), 2) < 0) __PYX_ERR(0, 553, __pyx_L1_error)
8498           __pyx_t_15 = NULL;
8499           __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8500           goto __pyx_L23_unpacking_done;
8501           __pyx_L22_unpacking_failed:;
8502           __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8503           __pyx_t_15 = NULL;
8504           if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
8505           __PYX_ERR(0, 553, __pyx_L1_error)
8506           __pyx_L23_unpacking_done:;
8507         }
8508         __Pyx_XDECREF_SET(__pyx_v_f_name, __pyx_t_4);
8509         __pyx_t_4 = 0;
8510         __Pyx_XDECREF_SET(__pyx_v_field, __pyx_t_7);
8511         __pyx_t_7 = 0;
8512 
8513         /* "fastavro/_read.pyx":554
8514  *             writer_fields = [f['name'] for f in writer_schema['fields']]
8515  *             for f_name, field in iteritems(readers_field_dict):
8516  *                 if f_name not in writer_fields and f_name not in record:             # <<<<<<<<<<<<<<
8517  *                     if 'default' in field:
8518  *                         record[field['name']] = field['default']
8519  */
8520         __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_f_name, __pyx_v_writer_fields, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 554, __pyx_L1_error)
8521         __pyx_t_16 = (__pyx_t_2 != 0);
8522         if (__pyx_t_16) {
8523         } else {
8524           __pyx_t_3 = __pyx_t_16;
8525           goto __pyx_L25_bool_binop_done;
8526         }
8527         __pyx_t_16 = (__Pyx_PyDict_ContainsTF(__pyx_v_f_name, __pyx_v_record, Py_NE)); if (unlikely(__pyx_t_16 < 0)) __PYX_ERR(0, 554, __pyx_L1_error)
8528         __pyx_t_2 = (__pyx_t_16 != 0);
8529         __pyx_t_3 = __pyx_t_2;
8530         __pyx_L25_bool_binop_done:;
8531         if (__pyx_t_3) {
8532 
8533           /* "fastavro/_read.pyx":555
8534  *             for f_name, field in iteritems(readers_field_dict):
8535  *                 if f_name not in writer_fields and f_name not in record:
8536  *                     if 'default' in field:             # <<<<<<<<<<<<<<
8537  *                         record[field['name']] = field['default']
8538  *                     else:
8539  */
8540           __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_default, __pyx_v_field, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 555, __pyx_L1_error)
8541           __pyx_t_2 = (__pyx_t_3 != 0);
8542           if (likely(__pyx_t_2)) {
8543 
8544             /* "fastavro/_read.pyx":556
8545  *                 if f_name not in writer_fields and f_name not in record:
8546  *                     if 'default' in field:
8547  *                         record[field['name']] = field['default']             # <<<<<<<<<<<<<<
8548  *                     else:
8549  *                         msg = 'No default value for %s' % field['name']
8550  */
8551             __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_field, __pyx_n_s_default); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 556, __pyx_L1_error)
8552             __Pyx_GOTREF(__pyx_t_1);
8553             __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_v_field, __pyx_n_s_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 556, __pyx_L1_error)
8554             __Pyx_GOTREF(__pyx_t_7);
8555             if (unlikely(PyDict_SetItem(__pyx_v_record, __pyx_t_7, __pyx_t_1) < 0)) __PYX_ERR(0, 556, __pyx_L1_error)
8556             __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8557             __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8558 
8559             /* "fastavro/_read.pyx":555
8560  *             for f_name, field in iteritems(readers_field_dict):
8561  *                 if f_name not in writer_fields and f_name not in record:
8562  *                     if 'default' in field:             # <<<<<<<<<<<<<<
8563  *                         record[field['name']] = field['default']
8564  *                     else:
8565  */
8566             goto __pyx_L27;
8567           }
8568 
8569           /* "fastavro/_read.pyx":558
8570  *                         record[field['name']] = field['default']
8571  *                     else:
8572  *                         msg = 'No default value for %s' % field['name']             # <<<<<<<<<<<<<<
8573  *                         raise SchemaResolutionError(msg)
8574  *
8575  */
8576           /*else*/ {
8577             __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_field, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 558, __pyx_L1_error)
8578             __Pyx_GOTREF(__pyx_t_1);
8579             __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_No_default_value_for_s, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 558, __pyx_L1_error)
8580             __Pyx_GOTREF(__pyx_t_7);
8581             __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8582             __pyx_v_msg = ((PyObject*)__pyx_t_7);
8583             __pyx_t_7 = 0;
8584 
8585             /* "fastavro/_read.pyx":559
8586  *                     else:
8587  *                         msg = 'No default value for %s' % field['name']
8588  *                         raise SchemaResolutionError(msg)             # <<<<<<<<<<<<<<
8589  *
8590  *     return record
8591  */
8592             __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_SchemaResolutionError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 559, __pyx_L1_error)
8593             __Pyx_GOTREF(__pyx_t_1);
8594             __pyx_t_4 = NULL;
8595             if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
8596               __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
8597               if (likely(__pyx_t_4)) {
8598                 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
8599                 __Pyx_INCREF(__pyx_t_4);
8600                 __Pyx_INCREF(function);
8601                 __Pyx_DECREF_SET(__pyx_t_1, function);
8602               }
8603             }
8604             __pyx_t_7 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_v_msg) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_msg);
8605             __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8606             if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 559, __pyx_L1_error)
8607             __Pyx_GOTREF(__pyx_t_7);
8608             __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8609             __Pyx_Raise(__pyx_t_7, 0, 0, 0);
8610             __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8611             __PYX_ERR(0, 559, __pyx_L1_error)
8612           }
8613           __pyx_L27:;
8614 
8615           /* "fastavro/_read.pyx":554
8616  *             writer_fields = [f['name'] for f in writer_schema['fields']]
8617  *             for f_name, field in iteritems(readers_field_dict):
8618  *                 if f_name not in writer_fields and f_name not in record:             # <<<<<<<<<<<<<<
8619  *                     if 'default' in field:
8620  *                         record[field['name']] = field['default']
8621  */
8622         }
8623 
8624         /* "fastavro/_read.pyx":553
8625  *         if len(readers_field_dict) > len(record):
8626  *             writer_fields = [f['name'] for f in writer_schema['fields']]
8627  *             for f_name, field in iteritems(readers_field_dict):             # <<<<<<<<<<<<<<
8628  *                 if f_name not in writer_fields and f_name not in record:
8629  *                     if 'default' in field:
8630  */
8631       }
8632       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
8633 
8634       /* "fastavro/_read.pyx":551
8635  *
8636  *         # fill in default values
8637  *         if len(readers_field_dict) > len(record):             # <<<<<<<<<<<<<<
8638  *             writer_fields = [f['name'] for f in writer_schema['fields']]
8639  *             for f_name, field in iteritems(readers_field_dict):
8640  */
8641     }
8642   }
8643   __pyx_L3:;
8644 
8645   /* "fastavro/_read.pyx":561
8646  *                         raise SchemaResolutionError(msg)
8647  *
8648  *     return record             # <<<<<<<<<<<<<<
8649  *
8650  *
8651  */
8652   __Pyx_XDECREF(__pyx_r);
8653   __Pyx_INCREF(__pyx_v_record);
8654   __pyx_r = __pyx_v_record;
8655   goto __pyx_L0;
8656 
8657   /* "fastavro/_read.pyx":484
8658  *
8659  *
8660  * cdef read_record(             # <<<<<<<<<<<<<<
8661  *     fo,
8662  *     writer_schema,
8663  */
8664 
8665   /* function exit code */
8666   __pyx_L1_error:;
8667   __Pyx_XDECREF(__pyx_t_1);
8668   __Pyx_XDECREF(__pyx_t_4);
8669   __Pyx_XDECREF(__pyx_t_7);
8670   __Pyx_XDECREF(__pyx_t_9);
8671   __Pyx_XDECREF(__pyx_t_10);
8672   __Pyx_XDECREF(__pyx_t_12);
8673   __Pyx_AddTraceback("fastavro._read.read_record", __pyx_clineno, __pyx_lineno, __pyx_filename);
8674   __pyx_r = 0;
8675   __pyx_L0:;
8676   __Pyx_XDECREF(__pyx_v_record);
8677   __Pyx_XDECREF(__pyx_v_field);
8678   __Pyx_XDECREF(__pyx_v_readers_field_dict);
8679   __Pyx_XDECREF(__pyx_v_aliases_field_dict);
8680   __Pyx_XDECREF(__pyx_v_f);
8681   __Pyx_XDECREF(__pyx_v_alias);
8682   __Pyx_XDECREF(__pyx_v_readers_field);
8683   __Pyx_XDECREF(__pyx_v_writer_fields);
8684   __Pyx_XDECREF(__pyx_v_f_name);
8685   __Pyx_XDECREF(__pyx_v_msg);
8686   __Pyx_XDECREF(__pyx_7genexpr__pyx_v_f);
8687   __Pyx_XGIVEREF(__pyx_r);
8688   __Pyx_RefNannyFinishContext();
8689   return __pyx_r;
8690 }
8691 
8692 /* "fastavro/_read.pyx":576
8693  *
8694  *
8695  * cpdef maybe_promote(data, writer_type, reader_type):             # <<<<<<<<<<<<<<
8696  *     if writer_type == "int":
8697  *         if reader_type == "long":
8698  */
8699 
8700 static PyObject *__pyx_pw_8fastavro_5_read_19maybe_promote(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_f_8fastavro_5_read_maybe_promote(PyObject * __pyx_v_data,PyObject * __pyx_v_writer_type,PyObject * __pyx_v_reader_type,CYTHON_UNUSED int __pyx_skip_dispatch)8701 static PyObject *__pyx_f_8fastavro_5_read_maybe_promote(PyObject *__pyx_v_data, PyObject *__pyx_v_writer_type, PyObject *__pyx_v_reader_type, CYTHON_UNUSED int __pyx_skip_dispatch) {
8702   PyObject *__pyx_r = NULL;
8703   __Pyx_RefNannyDeclarations
8704   int __pyx_t_1;
8705   PyObject *__pyx_t_2 = NULL;
8706   PyObject *__pyx_t_3 = NULL;
8707   PyObject *__pyx_t_4 = NULL;
8708   int __pyx_t_5;
8709   int __pyx_t_6;
8710   PyObject *__pyx_t_7 = NULL;
8711   int __pyx_lineno = 0;
8712   const char *__pyx_filename = NULL;
8713   int __pyx_clineno = 0;
8714   __Pyx_RefNannySetupContext("maybe_promote", 0);
8715 
8716   /* "fastavro/_read.pyx":577
8717  *
8718  * cpdef maybe_promote(data, writer_type, reader_type):
8719  *     if writer_type == "int":             # <<<<<<<<<<<<<<
8720  *         if reader_type == "long":
8721  *             return long(data)
8722  */
8723   __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_writer_type, __pyx_n_s_int, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 577, __pyx_L1_error)
8724   if (__pyx_t_1) {
8725 
8726     /* "fastavro/_read.pyx":578
8727  * cpdef maybe_promote(data, writer_type, reader_type):
8728  *     if writer_type == "int":
8729  *         if reader_type == "long":             # <<<<<<<<<<<<<<
8730  *             return long(data)
8731  *         if reader_type == "float" or reader_type == "double":
8732  */
8733     __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_reader_type, __pyx_n_s_long, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 578, __pyx_L1_error)
8734     if (__pyx_t_1) {
8735 
8736       /* "fastavro/_read.pyx":579
8737  *     if writer_type == "int":
8738  *         if reader_type == "long":
8739  *             return long(data)             # <<<<<<<<<<<<<<
8740  *         if reader_type == "float" or reader_type == "double":
8741  *             return float(data)
8742  */
8743       __Pyx_XDECREF(__pyx_r);
8744       __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_long); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 579, __pyx_L1_error)
8745       __Pyx_GOTREF(__pyx_t_3);
8746       __pyx_t_4 = NULL;
8747       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
8748         __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
8749         if (likely(__pyx_t_4)) {
8750           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
8751           __Pyx_INCREF(__pyx_t_4);
8752           __Pyx_INCREF(function);
8753           __Pyx_DECREF_SET(__pyx_t_3, function);
8754         }
8755       }
8756       __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_data) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_data);
8757       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8758       if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 579, __pyx_L1_error)
8759       __Pyx_GOTREF(__pyx_t_2);
8760       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8761       __pyx_r = __pyx_t_2;
8762       __pyx_t_2 = 0;
8763       goto __pyx_L0;
8764 
8765       /* "fastavro/_read.pyx":578
8766  * cpdef maybe_promote(data, writer_type, reader_type):
8767  *     if writer_type == "int":
8768  *         if reader_type == "long":             # <<<<<<<<<<<<<<
8769  *             return long(data)
8770  *         if reader_type == "float" or reader_type == "double":
8771  */
8772     }
8773 
8774     /* "fastavro/_read.pyx":580
8775  *         if reader_type == "long":
8776  *             return long(data)
8777  *         if reader_type == "float" or reader_type == "double":             # <<<<<<<<<<<<<<
8778  *             return float(data)
8779  *     if writer_type == "long":
8780  */
8781     __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_reader_type, __pyx_n_s_float, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 580, __pyx_L1_error)
8782     if (!__pyx_t_5) {
8783     } else {
8784       __pyx_t_1 = __pyx_t_5;
8785       goto __pyx_L6_bool_binop_done;
8786     }
8787     __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_reader_type, __pyx_n_s_double, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 580, __pyx_L1_error)
8788     __pyx_t_1 = __pyx_t_5;
8789     __pyx_L6_bool_binop_done:;
8790     if (__pyx_t_1) {
8791 
8792       /* "fastavro/_read.pyx":581
8793  *             return long(data)
8794  *         if reader_type == "float" or reader_type == "double":
8795  *             return float(data)             # <<<<<<<<<<<<<<
8796  *     if writer_type == "long":
8797  *         if reader_type == "float" or reader_type == "double":
8798  */
8799       __Pyx_XDECREF(__pyx_r);
8800       __pyx_t_2 = __Pyx_PyNumber_Float(__pyx_v_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 581, __pyx_L1_error)
8801       __Pyx_GOTREF(__pyx_t_2);
8802       __pyx_r = __pyx_t_2;
8803       __pyx_t_2 = 0;
8804       goto __pyx_L0;
8805 
8806       /* "fastavro/_read.pyx":580
8807  *         if reader_type == "long":
8808  *             return long(data)
8809  *         if reader_type == "float" or reader_type == "double":             # <<<<<<<<<<<<<<
8810  *             return float(data)
8811  *     if writer_type == "long":
8812  */
8813     }
8814 
8815     /* "fastavro/_read.pyx":577
8816  *
8817  * cpdef maybe_promote(data, writer_type, reader_type):
8818  *     if writer_type == "int":             # <<<<<<<<<<<<<<
8819  *         if reader_type == "long":
8820  *             return long(data)
8821  */
8822   }
8823 
8824   /* "fastavro/_read.pyx":582
8825  *         if reader_type == "float" or reader_type == "double":
8826  *             return float(data)
8827  *     if writer_type == "long":             # <<<<<<<<<<<<<<
8828  *         if reader_type == "float" or reader_type == "double":
8829  *             return float(data)
8830  */
8831   __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_writer_type, __pyx_n_s_long, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 582, __pyx_L1_error)
8832   if (__pyx_t_1) {
8833 
8834     /* "fastavro/_read.pyx":583
8835  *             return float(data)
8836  *     if writer_type == "long":
8837  *         if reader_type == "float" or reader_type == "double":             # <<<<<<<<<<<<<<
8838  *             return float(data)
8839  *     if writer_type == "string" and reader_type == "bytes":
8840  */
8841     __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_reader_type, __pyx_n_s_float, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 583, __pyx_L1_error)
8842     if (!__pyx_t_5) {
8843     } else {
8844       __pyx_t_1 = __pyx_t_5;
8845       goto __pyx_L10_bool_binop_done;
8846     }
8847     __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_reader_type, __pyx_n_s_double, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 583, __pyx_L1_error)
8848     __pyx_t_1 = __pyx_t_5;
8849     __pyx_L10_bool_binop_done:;
8850     if (__pyx_t_1) {
8851 
8852       /* "fastavro/_read.pyx":584
8853  *     if writer_type == "long":
8854  *         if reader_type == "float" or reader_type == "double":
8855  *             return float(data)             # <<<<<<<<<<<<<<
8856  *     if writer_type == "string" and reader_type == "bytes":
8857  *         return utob(data)
8858  */
8859       __Pyx_XDECREF(__pyx_r);
8860       __pyx_t_2 = __Pyx_PyNumber_Float(__pyx_v_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 584, __pyx_L1_error)
8861       __Pyx_GOTREF(__pyx_t_2);
8862       __pyx_r = __pyx_t_2;
8863       __pyx_t_2 = 0;
8864       goto __pyx_L0;
8865 
8866       /* "fastavro/_read.pyx":583
8867  *             return float(data)
8868  *     if writer_type == "long":
8869  *         if reader_type == "float" or reader_type == "double":             # <<<<<<<<<<<<<<
8870  *             return float(data)
8871  *     if writer_type == "string" and reader_type == "bytes":
8872  */
8873     }
8874 
8875     /* "fastavro/_read.pyx":582
8876  *         if reader_type == "float" or reader_type == "double":
8877  *             return float(data)
8878  *     if writer_type == "long":             # <<<<<<<<<<<<<<
8879  *         if reader_type == "float" or reader_type == "double":
8880  *             return float(data)
8881  */
8882   }
8883 
8884   /* "fastavro/_read.pyx":585
8885  *         if reader_type == "float" or reader_type == "double":
8886  *             return float(data)
8887  *     if writer_type == "string" and reader_type == "bytes":             # <<<<<<<<<<<<<<
8888  *         return utob(data)
8889  *     if writer_type == "bytes" and reader_type == "string":
8890  */
8891   __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_writer_type, __pyx_n_s_string, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 585, __pyx_L1_error)
8892   if (__pyx_t_5) {
8893   } else {
8894     __pyx_t_1 = __pyx_t_5;
8895     goto __pyx_L13_bool_binop_done;
8896   }
8897   __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_reader_type, __pyx_n_s_bytes, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 585, __pyx_L1_error)
8898   __pyx_t_1 = __pyx_t_5;
8899   __pyx_L13_bool_binop_done:;
8900   if (__pyx_t_1) {
8901 
8902     /* "fastavro/_read.pyx":586
8903  *             return float(data)
8904  *     if writer_type == "string" and reader_type == "bytes":
8905  *         return utob(data)             # <<<<<<<<<<<<<<
8906  *     if writer_type == "bytes" and reader_type == "string":
8907  *         return btou(data, 'utf-8')
8908  */
8909     __Pyx_XDECREF(__pyx_r);
8910     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_utob); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 586, __pyx_L1_error)
8911     __Pyx_GOTREF(__pyx_t_3);
8912     __pyx_t_4 = NULL;
8913     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
8914       __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
8915       if (likely(__pyx_t_4)) {
8916         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
8917         __Pyx_INCREF(__pyx_t_4);
8918         __Pyx_INCREF(function);
8919         __Pyx_DECREF_SET(__pyx_t_3, function);
8920       }
8921     }
8922     __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_data) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_data);
8923     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8924     if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 586, __pyx_L1_error)
8925     __Pyx_GOTREF(__pyx_t_2);
8926     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8927     __pyx_r = __pyx_t_2;
8928     __pyx_t_2 = 0;
8929     goto __pyx_L0;
8930 
8931     /* "fastavro/_read.pyx":585
8932  *         if reader_type == "float" or reader_type == "double":
8933  *             return float(data)
8934  *     if writer_type == "string" and reader_type == "bytes":             # <<<<<<<<<<<<<<
8935  *         return utob(data)
8936  *     if writer_type == "bytes" and reader_type == "string":
8937  */
8938   }
8939 
8940   /* "fastavro/_read.pyx":587
8941  *     if writer_type == "string" and reader_type == "bytes":
8942  *         return utob(data)
8943  *     if writer_type == "bytes" and reader_type == "string":             # <<<<<<<<<<<<<<
8944  *         return btou(data, 'utf-8')
8945  *     return data
8946  */
8947   __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_writer_type, __pyx_n_s_bytes, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 587, __pyx_L1_error)
8948   if (__pyx_t_5) {
8949   } else {
8950     __pyx_t_1 = __pyx_t_5;
8951     goto __pyx_L16_bool_binop_done;
8952   }
8953   __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_reader_type, __pyx_n_s_string, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 587, __pyx_L1_error)
8954   __pyx_t_1 = __pyx_t_5;
8955   __pyx_L16_bool_binop_done:;
8956   if (__pyx_t_1) {
8957 
8958     /* "fastavro/_read.pyx":588
8959  *         return utob(data)
8960  *     if writer_type == "bytes" and reader_type == "string":
8961  *         return btou(data, 'utf-8')             # <<<<<<<<<<<<<<
8962  *     return data
8963  *
8964  */
8965     __Pyx_XDECREF(__pyx_r);
8966     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_btou); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 588, __pyx_L1_error)
8967     __Pyx_GOTREF(__pyx_t_3);
8968     __pyx_t_4 = NULL;
8969     __pyx_t_6 = 0;
8970     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
8971       __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
8972       if (likely(__pyx_t_4)) {
8973         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
8974         __Pyx_INCREF(__pyx_t_4);
8975         __Pyx_INCREF(function);
8976         __Pyx_DECREF_SET(__pyx_t_3, function);
8977         __pyx_t_6 = 1;
8978       }
8979     }
8980     #if CYTHON_FAST_PYCALL
8981     if (PyFunction_Check(__pyx_t_3)) {
8982       PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_data, __pyx_kp_s_utf_8};
8983       __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 588, __pyx_L1_error)
8984       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8985       __Pyx_GOTREF(__pyx_t_2);
8986     } else
8987     #endif
8988     #if CYTHON_FAST_PYCCALL
8989     if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
8990       PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_data, __pyx_kp_s_utf_8};
8991       __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 588, __pyx_L1_error)
8992       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8993       __Pyx_GOTREF(__pyx_t_2);
8994     } else
8995     #endif
8996     {
8997       __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 588, __pyx_L1_error)
8998       __Pyx_GOTREF(__pyx_t_7);
8999       if (__pyx_t_4) {
9000         __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
9001       }
9002       __Pyx_INCREF(__pyx_v_data);
9003       __Pyx_GIVEREF(__pyx_v_data);
9004       PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_data);
9005       __Pyx_INCREF(__pyx_kp_s_utf_8);
9006       __Pyx_GIVEREF(__pyx_kp_s_utf_8);
9007       PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_kp_s_utf_8);
9008       __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 588, __pyx_L1_error)
9009       __Pyx_GOTREF(__pyx_t_2);
9010       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9011     }
9012     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9013     __pyx_r = __pyx_t_2;
9014     __pyx_t_2 = 0;
9015     goto __pyx_L0;
9016 
9017     /* "fastavro/_read.pyx":587
9018  *     if writer_type == "string" and reader_type == "bytes":
9019  *         return utob(data)
9020  *     if writer_type == "bytes" and reader_type == "string":             # <<<<<<<<<<<<<<
9021  *         return btou(data, 'utf-8')
9022  *     return data
9023  */
9024   }
9025 
9026   /* "fastavro/_read.pyx":589
9027  *     if writer_type == "bytes" and reader_type == "string":
9028  *         return btou(data, 'utf-8')
9029  *     return data             # <<<<<<<<<<<<<<
9030  *
9031  *
9032  */
9033   __Pyx_XDECREF(__pyx_r);
9034   __Pyx_INCREF(__pyx_v_data);
9035   __pyx_r = __pyx_v_data;
9036   goto __pyx_L0;
9037 
9038   /* "fastavro/_read.pyx":576
9039  *
9040  *
9041  * cpdef maybe_promote(data, writer_type, reader_type):             # <<<<<<<<<<<<<<
9042  *     if writer_type == "int":
9043  *         if reader_type == "long":
9044  */
9045 
9046   /* function exit code */
9047   __pyx_L1_error:;
9048   __Pyx_XDECREF(__pyx_t_2);
9049   __Pyx_XDECREF(__pyx_t_3);
9050   __Pyx_XDECREF(__pyx_t_4);
9051   __Pyx_XDECREF(__pyx_t_7);
9052   __Pyx_AddTraceback("fastavro._read.maybe_promote", __pyx_clineno, __pyx_lineno, __pyx_filename);
9053   __pyx_r = 0;
9054   __pyx_L0:;
9055   __Pyx_XGIVEREF(__pyx_r);
9056   __Pyx_RefNannyFinishContext();
9057   return __pyx_r;
9058 }
9059 
9060 /* Python wrapper */
9061 static PyObject *__pyx_pw_8fastavro_5_read_19maybe_promote(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_8fastavro_5_read_19maybe_promote(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)9062 static PyObject *__pyx_pw_8fastavro_5_read_19maybe_promote(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9063   PyObject *__pyx_v_data = 0;
9064   PyObject *__pyx_v_writer_type = 0;
9065   PyObject *__pyx_v_reader_type = 0;
9066   int __pyx_lineno = 0;
9067   const char *__pyx_filename = NULL;
9068   int __pyx_clineno = 0;
9069   PyObject *__pyx_r = 0;
9070   __Pyx_RefNannyDeclarations
9071   __Pyx_RefNannySetupContext("maybe_promote (wrapper)", 0);
9072   {
9073     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_writer_type,&__pyx_n_s_reader_type,0};
9074     PyObject* values[3] = {0,0,0};
9075     if (unlikely(__pyx_kwds)) {
9076       Py_ssize_t kw_args;
9077       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9078       switch (pos_args) {
9079         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9080         CYTHON_FALLTHROUGH;
9081         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9082         CYTHON_FALLTHROUGH;
9083         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9084         CYTHON_FALLTHROUGH;
9085         case  0: break;
9086         default: goto __pyx_L5_argtuple_error;
9087       }
9088       kw_args = PyDict_Size(__pyx_kwds);
9089       switch (pos_args) {
9090         case  0:
9091         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
9092         else goto __pyx_L5_argtuple_error;
9093         CYTHON_FALLTHROUGH;
9094         case  1:
9095         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_writer_type)) != 0)) kw_args--;
9096         else {
9097           __Pyx_RaiseArgtupleInvalid("maybe_promote", 1, 3, 3, 1); __PYX_ERR(0, 576, __pyx_L3_error)
9098         }
9099         CYTHON_FALLTHROUGH;
9100         case  2:
9101         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_reader_type)) != 0)) kw_args--;
9102         else {
9103           __Pyx_RaiseArgtupleInvalid("maybe_promote", 1, 3, 3, 2); __PYX_ERR(0, 576, __pyx_L3_error)
9104         }
9105       }
9106       if (unlikely(kw_args > 0)) {
9107         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "maybe_promote") < 0)) __PYX_ERR(0, 576, __pyx_L3_error)
9108       }
9109     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
9110       goto __pyx_L5_argtuple_error;
9111     } else {
9112       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9113       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9114       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9115     }
9116     __pyx_v_data = values[0];
9117     __pyx_v_writer_type = values[1];
9118     __pyx_v_reader_type = values[2];
9119   }
9120   goto __pyx_L4_argument_unpacking_done;
9121   __pyx_L5_argtuple_error:;
9122   __Pyx_RaiseArgtupleInvalid("maybe_promote", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 576, __pyx_L3_error)
9123   __pyx_L3_error:;
9124   __Pyx_AddTraceback("fastavro._read.maybe_promote", __pyx_clineno, __pyx_lineno, __pyx_filename);
9125   __Pyx_RefNannyFinishContext();
9126   return NULL;
9127   __pyx_L4_argument_unpacking_done:;
9128   __pyx_r = __pyx_pf_8fastavro_5_read_18maybe_promote(__pyx_self, __pyx_v_data, __pyx_v_writer_type, __pyx_v_reader_type);
9129 
9130   /* function exit code */
9131   __Pyx_RefNannyFinishContext();
9132   return __pyx_r;
9133 }
9134 
__pyx_pf_8fastavro_5_read_18maybe_promote(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_data,PyObject * __pyx_v_writer_type,PyObject * __pyx_v_reader_type)9135 static PyObject *__pyx_pf_8fastavro_5_read_18maybe_promote(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_writer_type, PyObject *__pyx_v_reader_type) {
9136   PyObject *__pyx_r = NULL;
9137   __Pyx_RefNannyDeclarations
9138   PyObject *__pyx_t_1 = NULL;
9139   int __pyx_lineno = 0;
9140   const char *__pyx_filename = NULL;
9141   int __pyx_clineno = 0;
9142   __Pyx_RefNannySetupContext("maybe_promote", 0);
9143   __Pyx_XDECREF(__pyx_r);
9144   __pyx_t_1 = __pyx_f_8fastavro_5_read_maybe_promote(__pyx_v_data, __pyx_v_writer_type, __pyx_v_reader_type, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 576, __pyx_L1_error)
9145   __Pyx_GOTREF(__pyx_t_1);
9146   __pyx_r = __pyx_t_1;
9147   __pyx_t_1 = 0;
9148   goto __pyx_L0;
9149 
9150   /* function exit code */
9151   __pyx_L1_error:;
9152   __Pyx_XDECREF(__pyx_t_1);
9153   __Pyx_AddTraceback("fastavro._read.maybe_promote", __pyx_clineno, __pyx_lineno, __pyx_filename);
9154   __pyx_r = NULL;
9155   __pyx_L0:;
9156   __Pyx_XGIVEREF(__pyx_r);
9157   __Pyx_RefNannyFinishContext();
9158   return __pyx_r;
9159 }
9160 
9161 /* "fastavro/_read.pyx":592
9162  *
9163  *
9164  * cpdef _read_data(             # <<<<<<<<<<<<<<
9165  *     fo,
9166  *     writer_schema,
9167  */
9168 
9169 static PyObject *__pyx_pw_8fastavro_5_read_21_read_data(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_f_8fastavro_5_read__read_data(PyObject * __pyx_v_fo,PyObject * __pyx_v_writer_schema,PyObject * __pyx_v_named_schemas,CYTHON_UNUSED int __pyx_skip_dispatch,struct __pyx_opt_args_8fastavro_5_read__read_data * __pyx_optional_args)9170 static PyObject *__pyx_f_8fastavro_5_read__read_data(PyObject *__pyx_v_fo, PyObject *__pyx_v_writer_schema, PyObject *__pyx_v_named_schemas, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8fastavro_5_read__read_data *__pyx_optional_args) {
9171 
9172   /* "fastavro/_read.pyx":596
9173  *     writer_schema,
9174  *     named_schemas,
9175  *     reader_schema=None,             # <<<<<<<<<<<<<<
9176  *     return_record_name=False,
9177  * ):
9178  */
9179   PyObject *__pyx_v_reader_schema = ((PyObject *)Py_None);
9180 
9181   /* "fastavro/_read.pyx":597
9182  *     named_schemas,
9183  *     reader_schema=None,
9184  *     return_record_name=False,             # <<<<<<<<<<<<<<
9185  * ):
9186  *     """Read data from file object according to schema."""
9187  */
9188   PyObject *__pyx_v_return_record_name = ((PyObject *)Py_False);
9189   PyObject *__pyx_v_record_type = NULL;
9190   PyObject *__pyx_v_data = NULL;
9191   PyObject *__pyx_v_logical_type = NULL;
9192   PyObject *__pyx_v_fn = NULL;
9193   PyObject *__pyx_r = NULL;
9194   __Pyx_RefNannyDeclarations
9195   PyObject *__pyx_t_1 = NULL;
9196   PyObject *__pyx_t_2 = NULL;
9197   PyObject *__pyx_t_3 = NULL;
9198   int __pyx_t_4;
9199   int __pyx_t_5;
9200   int __pyx_t_6;
9201   PyObject *__pyx_t_7 = NULL;
9202   PyObject *__pyx_t_8 = NULL;
9203   PyObject *__pyx_t_9 = NULL;
9204   __pyx_t_8fastavro_5_read_long64 __pyx_t_10;
9205   struct __pyx_opt_args_8fastavro_5_read_read_array __pyx_t_11;
9206   struct __pyx_opt_args_8fastavro_5_read_read_map __pyx_t_12;
9207   struct __pyx_opt_args_8fastavro_5_read_read_union __pyx_t_13;
9208   struct __pyx_opt_args_8fastavro_5_read_read_record __pyx_t_14;
9209   PyObject *__pyx_t_15 = NULL;
9210   struct __pyx_opt_args_8fastavro_5_read__read_data __pyx_t_16;
9211   int __pyx_t_17;
9212   PyObject *__pyx_t_18 = NULL;
9213   int __pyx_lineno = 0;
9214   const char *__pyx_filename = NULL;
9215   int __pyx_clineno = 0;
9216   __Pyx_RefNannySetupContext("_read_data", 0);
9217   if (__pyx_optional_args) {
9218     if (__pyx_optional_args->__pyx_n > 0) {
9219       __pyx_v_reader_schema = __pyx_optional_args->reader_schema;
9220       if (__pyx_optional_args->__pyx_n > 1) {
9221         __pyx_v_return_record_name = __pyx_optional_args->return_record_name;
9222       }
9223     }
9224   }
9225   __Pyx_INCREF(__pyx_v_reader_schema);
9226 
9227   /* "fastavro/_read.pyx":601
9228  *     """Read data from file object according to schema."""
9229  *
9230  *     record_type = extract_record_type(writer_schema)             # <<<<<<<<<<<<<<
9231  *
9232  *     if reader_schema and record_type in AVRO_TYPES:
9233  */
9234   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_extract_record_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 601, __pyx_L1_error)
9235   __Pyx_GOTREF(__pyx_t_2);
9236   __pyx_t_3 = NULL;
9237   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
9238     __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
9239     if (likely(__pyx_t_3)) {
9240       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
9241       __Pyx_INCREF(__pyx_t_3);
9242       __Pyx_INCREF(function);
9243       __Pyx_DECREF_SET(__pyx_t_2, function);
9244     }
9245   }
9246   __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_writer_schema) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_writer_schema);
9247   __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9248   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 601, __pyx_L1_error)
9249   __Pyx_GOTREF(__pyx_t_1);
9250   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9251   __pyx_v_record_type = __pyx_t_1;
9252   __pyx_t_1 = 0;
9253 
9254   /* "fastavro/_read.pyx":603
9255  *     record_type = extract_record_type(writer_schema)
9256  *
9257  *     if reader_schema and record_type in AVRO_TYPES:             # <<<<<<<<<<<<<<
9258  *         # If the schemas are the same, set the reader schema to None so that no
9259  *         # schema resolution is done for this call or future recursive calls
9260  */
9261   __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_reader_schema); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 603, __pyx_L1_error)
9262   if (__pyx_t_5) {
9263   } else {
9264     __pyx_t_4 = __pyx_t_5;
9265     goto __pyx_L4_bool_binop_done;
9266   }
9267   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_AVRO_TYPES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 603, __pyx_L1_error)
9268   __Pyx_GOTREF(__pyx_t_1);
9269   __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_v_record_type, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 603, __pyx_L1_error)
9270   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9271   __pyx_t_6 = (__pyx_t_5 != 0);
9272   __pyx_t_4 = __pyx_t_6;
9273   __pyx_L4_bool_binop_done:;
9274   if (__pyx_t_4) {
9275 
9276     /* "fastavro/_read.pyx":606
9277  *         # If the schemas are the same, set the reader schema to None so that no
9278  *         # schema resolution is done for this call or future recursive calls
9279  *         if writer_schema == reader_schema:             # <<<<<<<<<<<<<<
9280  *             reader_schema = None
9281  *         else:
9282  */
9283     __pyx_t_1 = PyObject_RichCompare(__pyx_v_writer_schema, __pyx_v_reader_schema, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 606, __pyx_L1_error)
9284     __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 606, __pyx_L1_error)
9285     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9286     if (__pyx_t_4) {
9287 
9288       /* "fastavro/_read.pyx":607
9289  *         # schema resolution is done for this call or future recursive calls
9290  *         if writer_schema == reader_schema:
9291  *             reader_schema = None             # <<<<<<<<<<<<<<
9292  *         else:
9293  *             reader_schema = match_schemas(writer_schema, reader_schema)
9294  */
9295       __Pyx_INCREF(Py_None);
9296       __Pyx_DECREF_SET(__pyx_v_reader_schema, Py_None);
9297 
9298       /* "fastavro/_read.pyx":606
9299  *         # If the schemas are the same, set the reader schema to None so that no
9300  *         # schema resolution is done for this call or future recursive calls
9301  *         if writer_schema == reader_schema:             # <<<<<<<<<<<<<<
9302  *             reader_schema = None
9303  *         else:
9304  */
9305       goto __pyx_L6;
9306     }
9307 
9308     /* "fastavro/_read.pyx":609
9309  *             reader_schema = None
9310  *         else:
9311  *             reader_schema = match_schemas(writer_schema, reader_schema)             # <<<<<<<<<<<<<<
9312  *
9313  *     try:
9314  */
9315     /*else*/ {
9316       __pyx_t_1 = __pyx_f_8fastavro_5_read_match_schemas(__pyx_v_writer_schema, __pyx_v_reader_schema, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 609, __pyx_L1_error)
9317       __Pyx_GOTREF(__pyx_t_1);
9318       __Pyx_DECREF_SET(__pyx_v_reader_schema, __pyx_t_1);
9319       __pyx_t_1 = 0;
9320     }
9321     __pyx_L6:;
9322 
9323     /* "fastavro/_read.pyx":603
9324  *     record_type = extract_record_type(writer_schema)
9325  *
9326  *     if reader_schema and record_type in AVRO_TYPES:             # <<<<<<<<<<<<<<
9327  *         # If the schemas are the same, set the reader schema to None so that no
9328  *         # schema resolution is done for this call or future recursive calls
9329  */
9330   }
9331 
9332   /* "fastavro/_read.pyx":611
9333  *             reader_schema = match_schemas(writer_schema, reader_schema)
9334  *
9335  *     try:             # <<<<<<<<<<<<<<
9336  *         if record_type == 'null':
9337  *             data = read_null(fo)
9338  */
9339   {
9340     __Pyx_PyThreadState_declare
9341     __Pyx_PyThreadState_assign
9342     __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
9343     __Pyx_XGOTREF(__pyx_t_7);
9344     __Pyx_XGOTREF(__pyx_t_8);
9345     __Pyx_XGOTREF(__pyx_t_9);
9346     /*try:*/ {
9347 
9348       /* "fastavro/_read.pyx":612
9349  *
9350  *     try:
9351  *         if record_type == 'null':             # <<<<<<<<<<<<<<
9352  *             data = read_null(fo)
9353  *         elif record_type == 'string':
9354  */
9355       __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_record_type, __pyx_n_s_null, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 612, __pyx_L7_error)
9356       if (__pyx_t_4) {
9357 
9358         /* "fastavro/_read.pyx":613
9359  *     try:
9360  *         if record_type == 'null':
9361  *             data = read_null(fo)             # <<<<<<<<<<<<<<
9362  *         elif record_type == 'string':
9363  *             data = read_utf8(fo)
9364  */
9365         __pyx_t_1 = __pyx_f_8fastavro_5_read_read_null(__pyx_v_fo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 613, __pyx_L7_error)
9366         __Pyx_GOTREF(__pyx_t_1);
9367         __pyx_v_data = __pyx_t_1;
9368         __pyx_t_1 = 0;
9369 
9370         /* "fastavro/_read.pyx":612
9371  *
9372  *     try:
9373  *         if record_type == 'null':             # <<<<<<<<<<<<<<
9374  *             data = read_null(fo)
9375  *         elif record_type == 'string':
9376  */
9377         goto __pyx_L13;
9378       }
9379 
9380       /* "fastavro/_read.pyx":614
9381  *         if record_type == 'null':
9382  *             data = read_null(fo)
9383  *         elif record_type == 'string':             # <<<<<<<<<<<<<<
9384  *             data = read_utf8(fo)
9385  *         elif record_type == 'int' or record_type == 'long':
9386  */
9387       __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_record_type, __pyx_n_s_string, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 614, __pyx_L7_error)
9388       if (__pyx_t_4) {
9389 
9390         /* "fastavro/_read.pyx":615
9391  *             data = read_null(fo)
9392  *         elif record_type == 'string':
9393  *             data = read_utf8(fo)             # <<<<<<<<<<<<<<
9394  *         elif record_type == 'int' or record_type == 'long':
9395  *             data = read_long(fo)
9396  */
9397         __pyx_t_1 = __pyx_f_8fastavro_5_read_read_utf8(__pyx_v_fo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 615, __pyx_L7_error)
9398         __Pyx_GOTREF(__pyx_t_1);
9399         __pyx_v_data = __pyx_t_1;
9400         __pyx_t_1 = 0;
9401 
9402         /* "fastavro/_read.pyx":614
9403  *         if record_type == 'null':
9404  *             data = read_null(fo)
9405  *         elif record_type == 'string':             # <<<<<<<<<<<<<<
9406  *             data = read_utf8(fo)
9407  *         elif record_type == 'int' or record_type == 'long':
9408  */
9409         goto __pyx_L13;
9410       }
9411 
9412       /* "fastavro/_read.pyx":616
9413  *         elif record_type == 'string':
9414  *             data = read_utf8(fo)
9415  *         elif record_type == 'int' or record_type == 'long':             # <<<<<<<<<<<<<<
9416  *             data = read_long(fo)
9417  *         elif record_type == 'float':
9418  */
9419       __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_record_type, __pyx_n_s_int, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 616, __pyx_L7_error)
9420       if (!__pyx_t_6) {
9421       } else {
9422         __pyx_t_4 = __pyx_t_6;
9423         goto __pyx_L14_bool_binop_done;
9424       }
9425       __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_record_type, __pyx_n_s_long, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 616, __pyx_L7_error)
9426       __pyx_t_4 = __pyx_t_6;
9427       __pyx_L14_bool_binop_done:;
9428       if (__pyx_t_4) {
9429 
9430         /* "fastavro/_read.pyx":617
9431  *             data = read_utf8(fo)
9432  *         elif record_type == 'int' or record_type == 'long':
9433  *             data = read_long(fo)             # <<<<<<<<<<<<<<
9434  *         elif record_type == 'float':
9435  *             data = read_float(fo)
9436  */
9437         __pyx_t_10 = __pyx_f_8fastavro_5_read_read_long(__pyx_v_fo); if (unlikely(__pyx_t_10 == ((__pyx_t_8fastavro_5_read_long64)-1LL) && PyErr_Occurred())) __PYX_ERR(0, 617, __pyx_L7_error)
9438         __pyx_t_1 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 617, __pyx_L7_error)
9439         __Pyx_GOTREF(__pyx_t_1);
9440         __pyx_v_data = __pyx_t_1;
9441         __pyx_t_1 = 0;
9442 
9443         /* "fastavro/_read.pyx":616
9444  *         elif record_type == 'string':
9445  *             data = read_utf8(fo)
9446  *         elif record_type == 'int' or record_type == 'long':             # <<<<<<<<<<<<<<
9447  *             data = read_long(fo)
9448  *         elif record_type == 'float':
9449  */
9450         goto __pyx_L13;
9451       }
9452 
9453       /* "fastavro/_read.pyx":618
9454  *         elif record_type == 'int' or record_type == 'long':
9455  *             data = read_long(fo)
9456  *         elif record_type == 'float':             # <<<<<<<<<<<<<<
9457  *             data = read_float(fo)
9458  *         elif record_type == 'double':
9459  */
9460       __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_record_type, __pyx_n_s_float, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 618, __pyx_L7_error)
9461       if (__pyx_t_4) {
9462 
9463         /* "fastavro/_read.pyx":619
9464  *             data = read_long(fo)
9465  *         elif record_type == 'float':
9466  *             data = read_float(fo)             # <<<<<<<<<<<<<<
9467  *         elif record_type == 'double':
9468  *             data = read_double(fo)
9469  */
9470         __pyx_t_1 = __pyx_f_8fastavro_5_read_read_float(__pyx_v_fo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 619, __pyx_L7_error)
9471         __Pyx_GOTREF(__pyx_t_1);
9472         __pyx_v_data = __pyx_t_1;
9473         __pyx_t_1 = 0;
9474 
9475         /* "fastavro/_read.pyx":618
9476  *         elif record_type == 'int' or record_type == 'long':
9477  *             data = read_long(fo)
9478  *         elif record_type == 'float':             # <<<<<<<<<<<<<<
9479  *             data = read_float(fo)
9480  *         elif record_type == 'double':
9481  */
9482         goto __pyx_L13;
9483       }
9484 
9485       /* "fastavro/_read.pyx":620
9486  *         elif record_type == 'float':
9487  *             data = read_float(fo)
9488  *         elif record_type == 'double':             # <<<<<<<<<<<<<<
9489  *             data = read_double(fo)
9490  *         elif record_type == 'boolean':
9491  */
9492       __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_record_type, __pyx_n_s_double, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 620, __pyx_L7_error)
9493       if (__pyx_t_4) {
9494 
9495         /* "fastavro/_read.pyx":621
9496  *             data = read_float(fo)
9497  *         elif record_type == 'double':
9498  *             data = read_double(fo)             # <<<<<<<<<<<<<<
9499  *         elif record_type == 'boolean':
9500  *             data = read_boolean(fo)
9501  */
9502         __pyx_t_1 = __pyx_f_8fastavro_5_read_read_double(__pyx_v_fo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 621, __pyx_L7_error)
9503         __Pyx_GOTREF(__pyx_t_1);
9504         __pyx_v_data = __pyx_t_1;
9505         __pyx_t_1 = 0;
9506 
9507         /* "fastavro/_read.pyx":620
9508  *         elif record_type == 'float':
9509  *             data = read_float(fo)
9510  *         elif record_type == 'double':             # <<<<<<<<<<<<<<
9511  *             data = read_double(fo)
9512  *         elif record_type == 'boolean':
9513  */
9514         goto __pyx_L13;
9515       }
9516 
9517       /* "fastavro/_read.pyx":622
9518  *         elif record_type == 'double':
9519  *             data = read_double(fo)
9520  *         elif record_type == 'boolean':             # <<<<<<<<<<<<<<
9521  *             data = read_boolean(fo)
9522  *         elif record_type == 'bytes':
9523  */
9524       __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_record_type, __pyx_n_s_boolean, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 622, __pyx_L7_error)
9525       if (__pyx_t_4) {
9526 
9527         /* "fastavro/_read.pyx":623
9528  *             data = read_double(fo)
9529  *         elif record_type == 'boolean':
9530  *             data = read_boolean(fo)             # <<<<<<<<<<<<<<
9531  *         elif record_type == 'bytes':
9532  *             data = read_bytes(fo)
9533  */
9534         __pyx_t_1 = __pyx_f_8fastavro_5_read_read_boolean(__pyx_v_fo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L7_error)
9535         __Pyx_GOTREF(__pyx_t_1);
9536         __pyx_v_data = __pyx_t_1;
9537         __pyx_t_1 = 0;
9538 
9539         /* "fastavro/_read.pyx":622
9540  *         elif record_type == 'double':
9541  *             data = read_double(fo)
9542  *         elif record_type == 'boolean':             # <<<<<<<<<<<<<<
9543  *             data = read_boolean(fo)
9544  *         elif record_type == 'bytes':
9545  */
9546         goto __pyx_L13;
9547       }
9548 
9549       /* "fastavro/_read.pyx":624
9550  *         elif record_type == 'boolean':
9551  *             data = read_boolean(fo)
9552  *         elif record_type == 'bytes':             # <<<<<<<<<<<<<<
9553  *             data = read_bytes(fo)
9554  *         elif record_type == 'fixed':
9555  */
9556       __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_record_type, __pyx_n_s_bytes, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 624, __pyx_L7_error)
9557       if (__pyx_t_4) {
9558 
9559         /* "fastavro/_read.pyx":625
9560  *             data = read_boolean(fo)
9561  *         elif record_type == 'bytes':
9562  *             data = read_bytes(fo)             # <<<<<<<<<<<<<<
9563  *         elif record_type == 'fixed':
9564  *             data = read_fixed(fo, writer_schema)
9565  */
9566         __pyx_t_1 = __pyx_f_8fastavro_5_read_read_bytes(__pyx_v_fo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 625, __pyx_L7_error)
9567         __Pyx_GOTREF(__pyx_t_1);
9568         __pyx_v_data = __pyx_t_1;
9569         __pyx_t_1 = 0;
9570 
9571         /* "fastavro/_read.pyx":624
9572  *         elif record_type == 'boolean':
9573  *             data = read_boolean(fo)
9574  *         elif record_type == 'bytes':             # <<<<<<<<<<<<<<
9575  *             data = read_bytes(fo)
9576  *         elif record_type == 'fixed':
9577  */
9578         goto __pyx_L13;
9579       }
9580 
9581       /* "fastavro/_read.pyx":626
9582  *         elif record_type == 'bytes':
9583  *             data = read_bytes(fo)
9584  *         elif record_type == 'fixed':             # <<<<<<<<<<<<<<
9585  *             data = read_fixed(fo, writer_schema)
9586  *         elif record_type == 'enum':
9587  */
9588       __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_record_type, __pyx_n_s_fixed, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 626, __pyx_L7_error)
9589       if (__pyx_t_4) {
9590 
9591         /* "fastavro/_read.pyx":627
9592  *             data = read_bytes(fo)
9593  *         elif record_type == 'fixed':
9594  *             data = read_fixed(fo, writer_schema)             # <<<<<<<<<<<<<<
9595  *         elif record_type == 'enum':
9596  *             data = read_enum(fo, writer_schema, reader_schema)
9597  */
9598         __pyx_t_1 = __pyx_f_8fastavro_5_read_read_fixed(__pyx_v_fo, __pyx_v_writer_schema); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 627, __pyx_L7_error)
9599         __Pyx_GOTREF(__pyx_t_1);
9600         __pyx_v_data = __pyx_t_1;
9601         __pyx_t_1 = 0;
9602 
9603         /* "fastavro/_read.pyx":626
9604  *         elif record_type == 'bytes':
9605  *             data = read_bytes(fo)
9606  *         elif record_type == 'fixed':             # <<<<<<<<<<<<<<
9607  *             data = read_fixed(fo, writer_schema)
9608  *         elif record_type == 'enum':
9609  */
9610         goto __pyx_L13;
9611       }
9612 
9613       /* "fastavro/_read.pyx":628
9614  *         elif record_type == 'fixed':
9615  *             data = read_fixed(fo, writer_schema)
9616  *         elif record_type == 'enum':             # <<<<<<<<<<<<<<
9617  *             data = read_enum(fo, writer_schema, reader_schema)
9618  *         elif record_type == 'array':
9619  */
9620       __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_record_type, __pyx_n_s_enum, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 628, __pyx_L7_error)
9621       if (__pyx_t_4) {
9622 
9623         /* "fastavro/_read.pyx":629
9624  *             data = read_fixed(fo, writer_schema)
9625  *         elif record_type == 'enum':
9626  *             data = read_enum(fo, writer_schema, reader_schema)             # <<<<<<<<<<<<<<
9627  *         elif record_type == 'array':
9628  *             data = read_array(
9629  */
9630         __pyx_t_1 = __pyx_f_8fastavro_5_read_read_enum(__pyx_v_fo, __pyx_v_writer_schema, __pyx_v_reader_schema); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 629, __pyx_L7_error)
9631         __Pyx_GOTREF(__pyx_t_1);
9632         __pyx_v_data = __pyx_t_1;
9633         __pyx_t_1 = 0;
9634 
9635         /* "fastavro/_read.pyx":628
9636  *         elif record_type == 'fixed':
9637  *             data = read_fixed(fo, writer_schema)
9638  *         elif record_type == 'enum':             # <<<<<<<<<<<<<<
9639  *             data = read_enum(fo, writer_schema, reader_schema)
9640  *         elif record_type == 'array':
9641  */
9642         goto __pyx_L13;
9643       }
9644 
9645       /* "fastavro/_read.pyx":630
9646  *         elif record_type == 'enum':
9647  *             data = read_enum(fo, writer_schema, reader_schema)
9648  *         elif record_type == 'array':             # <<<<<<<<<<<<<<
9649  *             data = read_array(
9650  *                 fo,
9651  */
9652       __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_record_type, __pyx_n_s_array, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 630, __pyx_L7_error)
9653       if (__pyx_t_4) {
9654 
9655         /* "fastavro/_read.pyx":631
9656  *             data = read_enum(fo, writer_schema, reader_schema)
9657  *         elif record_type == 'array':
9658  *             data = read_array(             # <<<<<<<<<<<<<<
9659  *                 fo,
9660  *                 writer_schema,
9661  */
9662         __pyx_t_11.__pyx_n = 2;
9663         __pyx_t_11.reader_schema = __pyx_v_reader_schema;
9664         __pyx_t_11.return_record_name = __pyx_v_return_record_name;
9665         __pyx_t_1 = __pyx_f_8fastavro_5_read_read_array(__pyx_v_fo, __pyx_v_writer_schema, __pyx_v_named_schemas, &__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 631, __pyx_L7_error)
9666         __Pyx_GOTREF(__pyx_t_1);
9667         __pyx_v_data = __pyx_t_1;
9668         __pyx_t_1 = 0;
9669 
9670         /* "fastavro/_read.pyx":630
9671  *         elif record_type == 'enum':
9672  *             data = read_enum(fo, writer_schema, reader_schema)
9673  *         elif record_type == 'array':             # <<<<<<<<<<<<<<
9674  *             data = read_array(
9675  *                 fo,
9676  */
9677         goto __pyx_L13;
9678       }
9679 
9680       /* "fastavro/_read.pyx":638
9681  *                 return_record_name,
9682  *             )
9683  *         elif record_type == 'map':             # <<<<<<<<<<<<<<
9684  *             data = read_map(
9685  *                 fo,
9686  */
9687       __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_record_type, __pyx_n_s_map, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 638, __pyx_L7_error)
9688       if (__pyx_t_4) {
9689 
9690         /* "fastavro/_read.pyx":639
9691  *             )
9692  *         elif record_type == 'map':
9693  *             data = read_map(             # <<<<<<<<<<<<<<
9694  *                 fo,
9695  *                 writer_schema,
9696  */
9697         __pyx_t_12.__pyx_n = 2;
9698         __pyx_t_12.reader_schema = __pyx_v_reader_schema;
9699         __pyx_t_12.return_record_name = __pyx_v_return_record_name;
9700         __pyx_t_1 = __pyx_f_8fastavro_5_read_read_map(__pyx_v_fo, __pyx_v_writer_schema, __pyx_v_named_schemas, &__pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 639, __pyx_L7_error)
9701         __Pyx_GOTREF(__pyx_t_1);
9702         __pyx_v_data = __pyx_t_1;
9703         __pyx_t_1 = 0;
9704 
9705         /* "fastavro/_read.pyx":638
9706  *                 return_record_name,
9707  *             )
9708  *         elif record_type == 'map':             # <<<<<<<<<<<<<<
9709  *             data = read_map(
9710  *                 fo,
9711  */
9712         goto __pyx_L13;
9713       }
9714 
9715       /* "fastavro/_read.pyx":646
9716  *                 return_record_name,
9717  *             )
9718  *         elif record_type == 'union' or record_type == 'error_union':             # <<<<<<<<<<<<<<
9719  *             data = read_union(
9720  *                 fo,
9721  */
9722       __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_record_type, __pyx_n_s_union, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 646, __pyx_L7_error)
9723       if (!__pyx_t_6) {
9724       } else {
9725         __pyx_t_4 = __pyx_t_6;
9726         goto __pyx_L16_bool_binop_done;
9727       }
9728       __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_record_type, __pyx_n_s_error_union, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 646, __pyx_L7_error)
9729       __pyx_t_4 = __pyx_t_6;
9730       __pyx_L16_bool_binop_done:;
9731       if (__pyx_t_4) {
9732 
9733         /* "fastavro/_read.pyx":647
9734  *             )
9735  *         elif record_type == 'union' or record_type == 'error_union':
9736  *             data = read_union(             # <<<<<<<<<<<<<<
9737  *                 fo,
9738  *                 writer_schema,
9739  */
9740         __pyx_t_13.__pyx_n = 2;
9741         __pyx_t_13.reader_schema = __pyx_v_reader_schema;
9742         __pyx_t_13.return_record_name = __pyx_v_return_record_name;
9743         __pyx_t_1 = __pyx_f_8fastavro_5_read_read_union(__pyx_v_fo, __pyx_v_writer_schema, __pyx_v_named_schemas, &__pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 647, __pyx_L7_error)
9744         __Pyx_GOTREF(__pyx_t_1);
9745         __pyx_v_data = __pyx_t_1;
9746         __pyx_t_1 = 0;
9747 
9748         /* "fastavro/_read.pyx":646
9749  *                 return_record_name,
9750  *             )
9751  *         elif record_type == 'union' or record_type == 'error_union':             # <<<<<<<<<<<<<<
9752  *             data = read_union(
9753  *                 fo,
9754  */
9755         goto __pyx_L13;
9756       }
9757 
9758       /* "fastavro/_read.pyx":654
9759  *                 return_record_name,
9760  *             )
9761  *         elif record_type == 'record' or record_type == 'error':             # <<<<<<<<<<<<<<
9762  *             data = read_record(
9763  *                 fo,
9764  */
9765       __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_record_type, __pyx_n_s_record, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 654, __pyx_L7_error)
9766       if (!__pyx_t_6) {
9767       } else {
9768         __pyx_t_4 = __pyx_t_6;
9769         goto __pyx_L18_bool_binop_done;
9770       }
9771       __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_record_type, __pyx_n_s_error, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 654, __pyx_L7_error)
9772       __pyx_t_4 = __pyx_t_6;
9773       __pyx_L18_bool_binop_done:;
9774       if (__pyx_t_4) {
9775 
9776         /* "fastavro/_read.pyx":655
9777  *             )
9778  *         elif record_type == 'record' or record_type == 'error':
9779  *             data = read_record(             # <<<<<<<<<<<<<<
9780  *                 fo,
9781  *                 writer_schema,
9782  */
9783         __pyx_t_14.__pyx_n = 2;
9784         __pyx_t_14.reader_schema = __pyx_v_reader_schema;
9785         __pyx_t_14.return_record_name = __pyx_v_return_record_name;
9786         __pyx_t_1 = __pyx_f_8fastavro_5_read_read_record(__pyx_v_fo, __pyx_v_writer_schema, __pyx_v_named_schemas, &__pyx_t_14); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 655, __pyx_L7_error)
9787         __Pyx_GOTREF(__pyx_t_1);
9788         __pyx_v_data = __pyx_t_1;
9789         __pyx_t_1 = 0;
9790 
9791         /* "fastavro/_read.pyx":654
9792  *                 return_record_name,
9793  *             )
9794  *         elif record_type == 'record' or record_type == 'error':             # <<<<<<<<<<<<<<
9795  *             data = read_record(
9796  *                 fo,
9797  */
9798         goto __pyx_L13;
9799       }
9800 
9801       /* "fastavro/_read.pyx":663
9802  *             )
9803  *         else:
9804  *             return _read_data(             # <<<<<<<<<<<<<<
9805  *                 fo,
9806  *                 named_schemas[record_type],
9807  */
9808       /*else*/ {
9809         __Pyx_XDECREF(__pyx_r);
9810 
9811         /* "fastavro/_read.pyx":665
9812  *             return _read_data(
9813  *                 fo,
9814  *                 named_schemas[record_type],             # <<<<<<<<<<<<<<
9815  *                 named_schemas,
9816  *                 named_schemas.get(reader_schema),
9817  */
9818         __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_named_schemas, __pyx_v_record_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 665, __pyx_L7_error)
9819         __Pyx_GOTREF(__pyx_t_1);
9820 
9821         /* "fastavro/_read.pyx":667
9822  *                 named_schemas[record_type],
9823  *                 named_schemas,
9824  *                 named_schemas.get(reader_schema),             # <<<<<<<<<<<<<<
9825  *                 return_record_name,
9826  *             )
9827  */
9828         __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_named_schemas, __pyx_n_s_get); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 667, __pyx_L7_error)
9829         __Pyx_GOTREF(__pyx_t_3);
9830         __pyx_t_15 = NULL;
9831         if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
9832           __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_3);
9833           if (likely(__pyx_t_15)) {
9834             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
9835             __Pyx_INCREF(__pyx_t_15);
9836             __Pyx_INCREF(function);
9837             __Pyx_DECREF_SET(__pyx_t_3, function);
9838           }
9839         }
9840         __pyx_t_2 = (__pyx_t_15) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_15, __pyx_v_reader_schema) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_reader_schema);
9841         __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
9842         if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 667, __pyx_L7_error)
9843         __Pyx_GOTREF(__pyx_t_2);
9844         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9845 
9846         /* "fastavro/_read.pyx":663
9847  *             )
9848  *         else:
9849  *             return _read_data(             # <<<<<<<<<<<<<<
9850  *                 fo,
9851  *                 named_schemas[record_type],
9852  */
9853         __pyx_t_16.__pyx_n = 2;
9854         __pyx_t_16.reader_schema = __pyx_t_2;
9855         __pyx_t_16.return_record_name = __pyx_v_return_record_name;
9856         __pyx_t_3 = __pyx_f_8fastavro_5_read__read_data(__pyx_v_fo, __pyx_t_1, __pyx_v_named_schemas, 0, &__pyx_t_16); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 663, __pyx_L7_error)
9857         __Pyx_GOTREF(__pyx_t_3);
9858         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9859         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9860         __pyx_r = __pyx_t_3;
9861         __pyx_t_3 = 0;
9862         goto __pyx_L11_try_return;
9863       }
9864       __pyx_L13:;
9865 
9866       /* "fastavro/_read.pyx":611
9867  *             reader_schema = match_schemas(writer_schema, reader_schema)
9868  *
9869  *     try:             # <<<<<<<<<<<<<<
9870  *         if record_type == 'null':
9871  *             data = read_null(fo)
9872  */
9873     }
9874     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
9875     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
9876     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
9877     goto __pyx_L12_try_end;
9878     __pyx_L7_error:;
9879     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
9880     __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
9881     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
9882     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9883 
9884     /* "fastavro/_read.pyx":670
9885  *                 return_record_name,
9886  *             )
9887  *     except ReadError:             # <<<<<<<<<<<<<<
9888  *         raise EOFError('cannot read %s from %s' % (record_type, fo))
9889  *
9890  */
9891     __Pyx_ErrFetch(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
9892     __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_ReadError); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 670, __pyx_L9_except_error)
9893     __Pyx_GOTREF(__pyx_t_15);
9894     __pyx_t_17 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_3, __pyx_t_15);
9895     __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
9896     __Pyx_ErrRestore(__pyx_t_3, __pyx_t_2, __pyx_t_1);
9897     __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0;
9898     if (__pyx_t_17) {
9899       __Pyx_AddTraceback("fastavro._read._read_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
9900       if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 670, __pyx_L9_except_error)
9901       __Pyx_GOTREF(__pyx_t_1);
9902       __Pyx_GOTREF(__pyx_t_2);
9903       __Pyx_GOTREF(__pyx_t_3);
9904 
9905       /* "fastavro/_read.pyx":671
9906  *             )
9907  *     except ReadError:
9908  *         raise EOFError('cannot read %s from %s' % (record_type, fo))             # <<<<<<<<<<<<<<
9909  *
9910  *     if 'logicalType' in writer_schema:
9911  */
9912       __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 671, __pyx_L9_except_error)
9913       __Pyx_GOTREF(__pyx_t_15);
9914       __Pyx_INCREF(__pyx_v_record_type);
9915       __Pyx_GIVEREF(__pyx_v_record_type);
9916       PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_record_type);
9917       __Pyx_INCREF(__pyx_v_fo);
9918       __Pyx_GIVEREF(__pyx_v_fo);
9919       PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_v_fo);
9920       __pyx_t_18 = __Pyx_PyString_Format(__pyx_kp_s_cannot_read_s_from_s, __pyx_t_15); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 671, __pyx_L9_except_error)
9921       __Pyx_GOTREF(__pyx_t_18);
9922       __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
9923       __pyx_t_15 = __Pyx_PyObject_CallOneArg(__pyx_builtin_EOFError, __pyx_t_18); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 671, __pyx_L9_except_error)
9924       __Pyx_GOTREF(__pyx_t_15);
9925       __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
9926       __Pyx_Raise(__pyx_t_15, 0, 0, 0);
9927       __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
9928       __PYX_ERR(0, 671, __pyx_L9_except_error)
9929     }
9930     goto __pyx_L9_except_error;
9931     __pyx_L9_except_error:;
9932 
9933     /* "fastavro/_read.pyx":611
9934  *             reader_schema = match_schemas(writer_schema, reader_schema)
9935  *
9936  *     try:             # <<<<<<<<<<<<<<
9937  *         if record_type == 'null':
9938  *             data = read_null(fo)
9939  */
9940     __Pyx_XGIVEREF(__pyx_t_7);
9941     __Pyx_XGIVEREF(__pyx_t_8);
9942     __Pyx_XGIVEREF(__pyx_t_9);
9943     __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
9944     goto __pyx_L1_error;
9945     __pyx_L11_try_return:;
9946     __Pyx_XGIVEREF(__pyx_t_7);
9947     __Pyx_XGIVEREF(__pyx_t_8);
9948     __Pyx_XGIVEREF(__pyx_t_9);
9949     __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
9950     goto __pyx_L0;
9951     __pyx_L12_try_end:;
9952   }
9953 
9954   /* "fastavro/_read.pyx":673
9955  *         raise EOFError('cannot read %s from %s' % (record_type, fo))
9956  *
9957  *     if 'logicalType' in writer_schema:             # <<<<<<<<<<<<<<
9958  *         logical_type = extract_logical_type(writer_schema)
9959  *         fn = LOGICAL_READERS.get(logical_type)
9960  */
9961   __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_logicalType, __pyx_v_writer_schema, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 673, __pyx_L1_error)
9962   __pyx_t_6 = (__pyx_t_4 != 0);
9963   if (__pyx_t_6) {
9964 
9965     /* "fastavro/_read.pyx":674
9966  *
9967  *     if 'logicalType' in writer_schema:
9968  *         logical_type = extract_logical_type(writer_schema)             # <<<<<<<<<<<<<<
9969  *         fn = LOGICAL_READERS.get(logical_type)
9970  *         if fn:
9971  */
9972     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_extract_logical_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 674, __pyx_L1_error)
9973     __Pyx_GOTREF(__pyx_t_2);
9974     __pyx_t_1 = NULL;
9975     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
9976       __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
9977       if (likely(__pyx_t_1)) {
9978         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
9979         __Pyx_INCREF(__pyx_t_1);
9980         __Pyx_INCREF(function);
9981         __Pyx_DECREF_SET(__pyx_t_2, function);
9982       }
9983     }
9984     __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_v_writer_schema) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_writer_schema);
9985     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
9986     if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 674, __pyx_L1_error)
9987     __Pyx_GOTREF(__pyx_t_3);
9988     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9989     __pyx_v_logical_type = __pyx_t_3;
9990     __pyx_t_3 = 0;
9991 
9992     /* "fastavro/_read.pyx":675
9993  *     if 'logicalType' in writer_schema:
9994  *         logical_type = extract_logical_type(writer_schema)
9995  *         fn = LOGICAL_READERS.get(logical_type)             # <<<<<<<<<<<<<<
9996  *         if fn:
9997  *             return fn(data, writer_schema, reader_schema)
9998  */
9999     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_LOGICAL_READERS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 675, __pyx_L1_error)
10000     __Pyx_GOTREF(__pyx_t_2);
10001     __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 675, __pyx_L1_error)
10002     __Pyx_GOTREF(__pyx_t_1);
10003     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10004     __pyx_t_2 = NULL;
10005     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
10006       __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
10007       if (likely(__pyx_t_2)) {
10008         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
10009         __Pyx_INCREF(__pyx_t_2);
10010         __Pyx_INCREF(function);
10011         __Pyx_DECREF_SET(__pyx_t_1, function);
10012       }
10013     }
10014     __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_v_logical_type) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_logical_type);
10015     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
10016     if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 675, __pyx_L1_error)
10017     __Pyx_GOTREF(__pyx_t_3);
10018     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10019     __pyx_v_fn = __pyx_t_3;
10020     __pyx_t_3 = 0;
10021 
10022     /* "fastavro/_read.pyx":676
10023  *         logical_type = extract_logical_type(writer_schema)
10024  *         fn = LOGICAL_READERS.get(logical_type)
10025  *         if fn:             # <<<<<<<<<<<<<<
10026  *             return fn(data, writer_schema, reader_schema)
10027  *
10028  */
10029     __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_fn); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 676, __pyx_L1_error)
10030     if (__pyx_t_6) {
10031 
10032       /* "fastavro/_read.pyx":677
10033  *         fn = LOGICAL_READERS.get(logical_type)
10034  *         if fn:
10035  *             return fn(data, writer_schema, reader_schema)             # <<<<<<<<<<<<<<
10036  *
10037  *     if reader_schema is not None:
10038  */
10039       __Pyx_XDECREF(__pyx_r);
10040       __Pyx_INCREF(__pyx_v_fn);
10041       __pyx_t_1 = __pyx_v_fn; __pyx_t_2 = NULL;
10042       __pyx_t_17 = 0;
10043       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
10044         __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
10045         if (likely(__pyx_t_2)) {
10046           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
10047           __Pyx_INCREF(__pyx_t_2);
10048           __Pyx_INCREF(function);
10049           __Pyx_DECREF_SET(__pyx_t_1, function);
10050           __pyx_t_17 = 1;
10051         }
10052       }
10053       #if CYTHON_FAST_PYCALL
10054       if (PyFunction_Check(__pyx_t_1)) {
10055         PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_data, __pyx_v_writer_schema, __pyx_v_reader_schema};
10056         __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_17, 3+__pyx_t_17); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 677, __pyx_L1_error)
10057         __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
10058         __Pyx_GOTREF(__pyx_t_3);
10059       } else
10060       #endif
10061       #if CYTHON_FAST_PYCCALL
10062       if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
10063         PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_data, __pyx_v_writer_schema, __pyx_v_reader_schema};
10064         __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_17, 3+__pyx_t_17); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 677, __pyx_L1_error)
10065         __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
10066         __Pyx_GOTREF(__pyx_t_3);
10067       } else
10068       #endif
10069       {
10070         __pyx_t_15 = PyTuple_New(3+__pyx_t_17); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 677, __pyx_L1_error)
10071         __Pyx_GOTREF(__pyx_t_15);
10072         if (__pyx_t_2) {
10073           __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_2); __pyx_t_2 = NULL;
10074         }
10075         __Pyx_INCREF(__pyx_v_data);
10076         __Pyx_GIVEREF(__pyx_v_data);
10077         PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_17, __pyx_v_data);
10078         __Pyx_INCREF(__pyx_v_writer_schema);
10079         __Pyx_GIVEREF(__pyx_v_writer_schema);
10080         PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_17, __pyx_v_writer_schema);
10081         __Pyx_INCREF(__pyx_v_reader_schema);
10082         __Pyx_GIVEREF(__pyx_v_reader_schema);
10083         PyTuple_SET_ITEM(__pyx_t_15, 2+__pyx_t_17, __pyx_v_reader_schema);
10084         __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 677, __pyx_L1_error)
10085         __Pyx_GOTREF(__pyx_t_3);
10086         __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
10087       }
10088       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10089       __pyx_r = __pyx_t_3;
10090       __pyx_t_3 = 0;
10091       goto __pyx_L0;
10092 
10093       /* "fastavro/_read.pyx":676
10094  *         logical_type = extract_logical_type(writer_schema)
10095  *         fn = LOGICAL_READERS.get(logical_type)
10096  *         if fn:             # <<<<<<<<<<<<<<
10097  *             return fn(data, writer_schema, reader_schema)
10098  *
10099  */
10100     }
10101 
10102     /* "fastavro/_read.pyx":673
10103  *         raise EOFError('cannot read %s from %s' % (record_type, fo))
10104  *
10105  *     if 'logicalType' in writer_schema:             # <<<<<<<<<<<<<<
10106  *         logical_type = extract_logical_type(writer_schema)
10107  *         fn = LOGICAL_READERS.get(logical_type)
10108  */
10109   }
10110 
10111   /* "fastavro/_read.pyx":679
10112  *             return fn(data, writer_schema, reader_schema)
10113  *
10114  *     if reader_schema is not None:             # <<<<<<<<<<<<<<
10115  *         return maybe_promote(
10116  *             data,
10117  */
10118   __pyx_t_6 = (__pyx_v_reader_schema != Py_None);
10119   __pyx_t_4 = (__pyx_t_6 != 0);
10120   if (__pyx_t_4) {
10121 
10122     /* "fastavro/_read.pyx":680
10123  *
10124  *     if reader_schema is not None:
10125  *         return maybe_promote(             # <<<<<<<<<<<<<<
10126  *             data,
10127  *             record_type,
10128  */
10129     __Pyx_XDECREF(__pyx_r);
10130 
10131     /* "fastavro/_read.pyx":683
10132  *             data,
10133  *             record_type,
10134  *             extract_record_type(reader_schema)             # <<<<<<<<<<<<<<
10135  *         )
10136  *     else:
10137  */
10138     __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_extract_record_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 683, __pyx_L1_error)
10139     __Pyx_GOTREF(__pyx_t_1);
10140     __pyx_t_15 = NULL;
10141     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
10142       __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_1);
10143       if (likely(__pyx_t_15)) {
10144         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
10145         __Pyx_INCREF(__pyx_t_15);
10146         __Pyx_INCREF(function);
10147         __Pyx_DECREF_SET(__pyx_t_1, function);
10148       }
10149     }
10150     __pyx_t_3 = (__pyx_t_15) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_15, __pyx_v_reader_schema) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_reader_schema);
10151     __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
10152     if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 683, __pyx_L1_error)
10153     __Pyx_GOTREF(__pyx_t_3);
10154     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10155 
10156     /* "fastavro/_read.pyx":680
10157  *
10158  *     if reader_schema is not None:
10159  *         return maybe_promote(             # <<<<<<<<<<<<<<
10160  *             data,
10161  *             record_type,
10162  */
10163     __pyx_t_1 = __pyx_f_8fastavro_5_read_maybe_promote(__pyx_v_data, __pyx_v_record_type, __pyx_t_3, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 680, __pyx_L1_error)
10164     __Pyx_GOTREF(__pyx_t_1);
10165     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10166     __pyx_r = __pyx_t_1;
10167     __pyx_t_1 = 0;
10168     goto __pyx_L0;
10169 
10170     /* "fastavro/_read.pyx":679
10171  *             return fn(data, writer_schema, reader_schema)
10172  *
10173  *     if reader_schema is not None:             # <<<<<<<<<<<<<<
10174  *         return maybe_promote(
10175  *             data,
10176  */
10177   }
10178 
10179   /* "fastavro/_read.pyx":686
10180  *         )
10181  *     else:
10182  *         return data             # <<<<<<<<<<<<<<
10183  *
10184  *
10185  */
10186   /*else*/ {
10187     __Pyx_XDECREF(__pyx_r);
10188     __Pyx_INCREF(__pyx_v_data);
10189     __pyx_r = __pyx_v_data;
10190     goto __pyx_L0;
10191   }
10192 
10193   /* "fastavro/_read.pyx":592
10194  *
10195  *
10196  * cpdef _read_data(             # <<<<<<<<<<<<<<
10197  *     fo,
10198  *     writer_schema,
10199  */
10200 
10201   /* function exit code */
10202   __pyx_L1_error:;
10203   __Pyx_XDECREF(__pyx_t_1);
10204   __Pyx_XDECREF(__pyx_t_2);
10205   __Pyx_XDECREF(__pyx_t_3);
10206   __Pyx_XDECREF(__pyx_t_15);
10207   __Pyx_XDECREF(__pyx_t_18);
10208   __Pyx_AddTraceback("fastavro._read._read_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
10209   __pyx_r = 0;
10210   __pyx_L0:;
10211   __Pyx_XDECREF(__pyx_v_record_type);
10212   __Pyx_XDECREF(__pyx_v_data);
10213   __Pyx_XDECREF(__pyx_v_logical_type);
10214   __Pyx_XDECREF(__pyx_v_fn);
10215   __Pyx_XDECREF(__pyx_v_reader_schema);
10216   __Pyx_XGIVEREF(__pyx_r);
10217   __Pyx_RefNannyFinishContext();
10218   return __pyx_r;
10219 }
10220 
10221 /* Python wrapper */
10222 static PyObject *__pyx_pw_8fastavro_5_read_21_read_data(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
10223 static char __pyx_doc_8fastavro_5_read_20_read_data[] = "Read data from file object according to schema.";
__pyx_pw_8fastavro_5_read_21_read_data(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)10224 static PyObject *__pyx_pw_8fastavro_5_read_21_read_data(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10225   PyObject *__pyx_v_fo = 0;
10226   PyObject *__pyx_v_writer_schema = 0;
10227   PyObject *__pyx_v_named_schemas = 0;
10228   PyObject *__pyx_v_reader_schema = 0;
10229   PyObject *__pyx_v_return_record_name = 0;
10230   int __pyx_lineno = 0;
10231   const char *__pyx_filename = NULL;
10232   int __pyx_clineno = 0;
10233   PyObject *__pyx_r = 0;
10234   __Pyx_RefNannyDeclarations
10235   __Pyx_RefNannySetupContext("_read_data (wrapper)", 0);
10236   {
10237     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fo,&__pyx_n_s_writer_schema,&__pyx_n_s_named_schemas,&__pyx_n_s_reader_schema,&__pyx_n_s_return_record_name,0};
10238     PyObject* values[5] = {0,0,0,0,0};
10239 
10240     /* "fastavro/_read.pyx":596
10241  *     writer_schema,
10242  *     named_schemas,
10243  *     reader_schema=None,             # <<<<<<<<<<<<<<
10244  *     return_record_name=False,
10245  * ):
10246  */
10247     values[3] = ((PyObject *)Py_None);
10248 
10249     /* "fastavro/_read.pyx":597
10250  *     named_schemas,
10251  *     reader_schema=None,
10252  *     return_record_name=False,             # <<<<<<<<<<<<<<
10253  * ):
10254  *     """Read data from file object according to schema."""
10255  */
10256     values[4] = ((PyObject *)Py_False);
10257     if (unlikely(__pyx_kwds)) {
10258       Py_ssize_t kw_args;
10259       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10260       switch (pos_args) {
10261         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
10262         CYTHON_FALLTHROUGH;
10263         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
10264         CYTHON_FALLTHROUGH;
10265         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10266         CYTHON_FALLTHROUGH;
10267         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10268         CYTHON_FALLTHROUGH;
10269         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10270         CYTHON_FALLTHROUGH;
10271         case  0: break;
10272         default: goto __pyx_L5_argtuple_error;
10273       }
10274       kw_args = PyDict_Size(__pyx_kwds);
10275       switch (pos_args) {
10276         case  0:
10277         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fo)) != 0)) kw_args--;
10278         else goto __pyx_L5_argtuple_error;
10279         CYTHON_FALLTHROUGH;
10280         case  1:
10281         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_writer_schema)) != 0)) kw_args--;
10282         else {
10283           __Pyx_RaiseArgtupleInvalid("_read_data", 0, 3, 5, 1); __PYX_ERR(0, 592, __pyx_L3_error)
10284         }
10285         CYTHON_FALLTHROUGH;
10286         case  2:
10287         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_named_schemas)) != 0)) kw_args--;
10288         else {
10289           __Pyx_RaiseArgtupleInvalid("_read_data", 0, 3, 5, 2); __PYX_ERR(0, 592, __pyx_L3_error)
10290         }
10291         CYTHON_FALLTHROUGH;
10292         case  3:
10293         if (kw_args > 0) {
10294           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_reader_schema);
10295           if (value) { values[3] = value; kw_args--; }
10296         }
10297         CYTHON_FALLTHROUGH;
10298         case  4:
10299         if (kw_args > 0) {
10300           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_return_record_name);
10301           if (value) { values[4] = value; kw_args--; }
10302         }
10303       }
10304       if (unlikely(kw_args > 0)) {
10305         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_read_data") < 0)) __PYX_ERR(0, 592, __pyx_L3_error)
10306       }
10307     } else {
10308       switch (PyTuple_GET_SIZE(__pyx_args)) {
10309         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
10310         CYTHON_FALLTHROUGH;
10311         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
10312         CYTHON_FALLTHROUGH;
10313         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10314         values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10315         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10316         break;
10317         default: goto __pyx_L5_argtuple_error;
10318       }
10319     }
10320     __pyx_v_fo = values[0];
10321     __pyx_v_writer_schema = values[1];
10322     __pyx_v_named_schemas = values[2];
10323     __pyx_v_reader_schema = values[3];
10324     __pyx_v_return_record_name = values[4];
10325   }
10326   goto __pyx_L4_argument_unpacking_done;
10327   __pyx_L5_argtuple_error:;
10328   __Pyx_RaiseArgtupleInvalid("_read_data", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 592, __pyx_L3_error)
10329   __pyx_L3_error:;
10330   __Pyx_AddTraceback("fastavro._read._read_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
10331   __Pyx_RefNannyFinishContext();
10332   return NULL;
10333   __pyx_L4_argument_unpacking_done:;
10334   __pyx_r = __pyx_pf_8fastavro_5_read_20_read_data(__pyx_self, __pyx_v_fo, __pyx_v_writer_schema, __pyx_v_named_schemas, __pyx_v_reader_schema, __pyx_v_return_record_name);
10335 
10336   /* "fastavro/_read.pyx":592
10337  *
10338  *
10339  * cpdef _read_data(             # <<<<<<<<<<<<<<
10340  *     fo,
10341  *     writer_schema,
10342  */
10343 
10344   /* function exit code */
10345   __Pyx_RefNannyFinishContext();
10346   return __pyx_r;
10347 }
10348 
__pyx_pf_8fastavro_5_read_20_read_data(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_fo,PyObject * __pyx_v_writer_schema,PyObject * __pyx_v_named_schemas,PyObject * __pyx_v_reader_schema,PyObject * __pyx_v_return_record_name)10349 static PyObject *__pyx_pf_8fastavro_5_read_20_read_data(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fo, PyObject *__pyx_v_writer_schema, PyObject *__pyx_v_named_schemas, PyObject *__pyx_v_reader_schema, PyObject *__pyx_v_return_record_name) {
10350   PyObject *__pyx_r = NULL;
10351   __Pyx_RefNannyDeclarations
10352   PyObject *__pyx_t_1 = NULL;
10353   struct __pyx_opt_args_8fastavro_5_read__read_data __pyx_t_2;
10354   int __pyx_lineno = 0;
10355   const char *__pyx_filename = NULL;
10356   int __pyx_clineno = 0;
10357   __Pyx_RefNannySetupContext("_read_data", 0);
10358   __Pyx_XDECREF(__pyx_r);
10359   __pyx_t_2.__pyx_n = 2;
10360   __pyx_t_2.reader_schema = __pyx_v_reader_schema;
10361   __pyx_t_2.return_record_name = __pyx_v_return_record_name;
10362   __pyx_t_1 = __pyx_f_8fastavro_5_read__read_data(__pyx_v_fo, __pyx_v_writer_schema, __pyx_v_named_schemas, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 592, __pyx_L1_error)
10363   __Pyx_GOTREF(__pyx_t_1);
10364   __pyx_r = __pyx_t_1;
10365   __pyx_t_1 = 0;
10366   goto __pyx_L0;
10367 
10368   /* function exit code */
10369   __pyx_L1_error:;
10370   __Pyx_XDECREF(__pyx_t_1);
10371   __Pyx_AddTraceback("fastavro._read._read_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
10372   __pyx_r = NULL;
10373   __pyx_L0:;
10374   __Pyx_XGIVEREF(__pyx_r);
10375   __Pyx_RefNannyFinishContext();
10376   return __pyx_r;
10377 }
10378 
10379 /* "fastavro/_read.pyx":689
10380  *
10381  *
10382  * cpdef skip_sync(fo, sync_marker):             # <<<<<<<<<<<<<<
10383  *     """Skip an expected sync marker, complaining if it doesn't match"""
10384  *     if fo.read(SYNC_SIZE) != sync_marker:
10385  */
10386 
10387 static PyObject *__pyx_pw_8fastavro_5_read_23skip_sync(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_f_8fastavro_5_read_skip_sync(PyObject * __pyx_v_fo,PyObject * __pyx_v_sync_marker,CYTHON_UNUSED int __pyx_skip_dispatch)10388 static PyObject *__pyx_f_8fastavro_5_read_skip_sync(PyObject *__pyx_v_fo, PyObject *__pyx_v_sync_marker, CYTHON_UNUSED int __pyx_skip_dispatch) {
10389   PyObject *__pyx_r = NULL;
10390   __Pyx_RefNannyDeclarations
10391   PyObject *__pyx_t_1 = NULL;
10392   PyObject *__pyx_t_2 = NULL;
10393   PyObject *__pyx_t_3 = NULL;
10394   PyObject *__pyx_t_4 = NULL;
10395   int __pyx_t_5;
10396   int __pyx_lineno = 0;
10397   const char *__pyx_filename = NULL;
10398   int __pyx_clineno = 0;
10399   __Pyx_RefNannySetupContext("skip_sync", 0);
10400 
10401   /* "fastavro/_read.pyx":691
10402  * cpdef skip_sync(fo, sync_marker):
10403  *     """Skip an expected sync marker, complaining if it doesn't match"""
10404  *     if fo.read(SYNC_SIZE) != sync_marker:             # <<<<<<<<<<<<<<
10405  *         raise ValueError('expected sync marker not found')
10406  *
10407  */
10408   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_fo, __pyx_n_s_read); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 691, __pyx_L1_error)
10409   __Pyx_GOTREF(__pyx_t_2);
10410   __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SYNC_SIZE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 691, __pyx_L1_error)
10411   __Pyx_GOTREF(__pyx_t_3);
10412   __pyx_t_4 = NULL;
10413   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
10414     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
10415     if (likely(__pyx_t_4)) {
10416       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
10417       __Pyx_INCREF(__pyx_t_4);
10418       __Pyx_INCREF(function);
10419       __Pyx_DECREF_SET(__pyx_t_2, function);
10420     }
10421   }
10422   __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
10423   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
10424   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10425   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __pyx_L1_error)
10426   __Pyx_GOTREF(__pyx_t_1);
10427   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10428   __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_v_sync_marker, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 691, __pyx_L1_error)
10429   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10430   __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 691, __pyx_L1_error)
10431   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10432   if (unlikely(__pyx_t_5)) {
10433 
10434     /* "fastavro/_read.pyx":692
10435  *     """Skip an expected sync marker, complaining if it doesn't match"""
10436  *     if fo.read(SYNC_SIZE) != sync_marker:
10437  *         raise ValueError('expected sync marker not found')             # <<<<<<<<<<<<<<
10438  *
10439  *
10440  */
10441     __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error)
10442     __Pyx_GOTREF(__pyx_t_2);
10443     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
10444     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10445     __PYX_ERR(0, 692, __pyx_L1_error)
10446 
10447     /* "fastavro/_read.pyx":691
10448  * cpdef skip_sync(fo, sync_marker):
10449  *     """Skip an expected sync marker, complaining if it doesn't match"""
10450  *     if fo.read(SYNC_SIZE) != sync_marker:             # <<<<<<<<<<<<<<
10451  *         raise ValueError('expected sync marker not found')
10452  *
10453  */
10454   }
10455 
10456   /* "fastavro/_read.pyx":689
10457  *
10458  *
10459  * cpdef skip_sync(fo, sync_marker):             # <<<<<<<<<<<<<<
10460  *     """Skip an expected sync marker, complaining if it doesn't match"""
10461  *     if fo.read(SYNC_SIZE) != sync_marker:
10462  */
10463 
10464   /* function exit code */
10465   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10466   goto __pyx_L0;
10467   __pyx_L1_error:;
10468   __Pyx_XDECREF(__pyx_t_1);
10469   __Pyx_XDECREF(__pyx_t_2);
10470   __Pyx_XDECREF(__pyx_t_3);
10471   __Pyx_XDECREF(__pyx_t_4);
10472   __Pyx_AddTraceback("fastavro._read.skip_sync", __pyx_clineno, __pyx_lineno, __pyx_filename);
10473   __pyx_r = 0;
10474   __pyx_L0:;
10475   __Pyx_XGIVEREF(__pyx_r);
10476   __Pyx_RefNannyFinishContext();
10477   return __pyx_r;
10478 }
10479 
10480 /* Python wrapper */
10481 static PyObject *__pyx_pw_8fastavro_5_read_23skip_sync(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
10482 static char __pyx_doc_8fastavro_5_read_22skip_sync[] = "Skip an expected sync marker, complaining if it doesn't match";
__pyx_pw_8fastavro_5_read_23skip_sync(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)10483 static PyObject *__pyx_pw_8fastavro_5_read_23skip_sync(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10484   PyObject *__pyx_v_fo = 0;
10485   PyObject *__pyx_v_sync_marker = 0;
10486   int __pyx_lineno = 0;
10487   const char *__pyx_filename = NULL;
10488   int __pyx_clineno = 0;
10489   PyObject *__pyx_r = 0;
10490   __Pyx_RefNannyDeclarations
10491   __Pyx_RefNannySetupContext("skip_sync (wrapper)", 0);
10492   {
10493     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fo,&__pyx_n_s_sync_marker,0};
10494     PyObject* values[2] = {0,0};
10495     if (unlikely(__pyx_kwds)) {
10496       Py_ssize_t kw_args;
10497       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10498       switch (pos_args) {
10499         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10500         CYTHON_FALLTHROUGH;
10501         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10502         CYTHON_FALLTHROUGH;
10503         case  0: break;
10504         default: goto __pyx_L5_argtuple_error;
10505       }
10506       kw_args = PyDict_Size(__pyx_kwds);
10507       switch (pos_args) {
10508         case  0:
10509         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fo)) != 0)) kw_args--;
10510         else goto __pyx_L5_argtuple_error;
10511         CYTHON_FALLTHROUGH;
10512         case  1:
10513         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sync_marker)) != 0)) kw_args--;
10514         else {
10515           __Pyx_RaiseArgtupleInvalid("skip_sync", 1, 2, 2, 1); __PYX_ERR(0, 689, __pyx_L3_error)
10516         }
10517       }
10518       if (unlikely(kw_args > 0)) {
10519         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "skip_sync") < 0)) __PYX_ERR(0, 689, __pyx_L3_error)
10520       }
10521     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
10522       goto __pyx_L5_argtuple_error;
10523     } else {
10524       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10525       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10526     }
10527     __pyx_v_fo = values[0];
10528     __pyx_v_sync_marker = values[1];
10529   }
10530   goto __pyx_L4_argument_unpacking_done;
10531   __pyx_L5_argtuple_error:;
10532   __Pyx_RaiseArgtupleInvalid("skip_sync", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 689, __pyx_L3_error)
10533   __pyx_L3_error:;
10534   __Pyx_AddTraceback("fastavro._read.skip_sync", __pyx_clineno, __pyx_lineno, __pyx_filename);
10535   __Pyx_RefNannyFinishContext();
10536   return NULL;
10537   __pyx_L4_argument_unpacking_done:;
10538   __pyx_r = __pyx_pf_8fastavro_5_read_22skip_sync(__pyx_self, __pyx_v_fo, __pyx_v_sync_marker);
10539 
10540   /* function exit code */
10541   __Pyx_RefNannyFinishContext();
10542   return __pyx_r;
10543 }
10544 
__pyx_pf_8fastavro_5_read_22skip_sync(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_fo,PyObject * __pyx_v_sync_marker)10545 static PyObject *__pyx_pf_8fastavro_5_read_22skip_sync(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fo, PyObject *__pyx_v_sync_marker) {
10546   PyObject *__pyx_r = NULL;
10547   __Pyx_RefNannyDeclarations
10548   PyObject *__pyx_t_1 = NULL;
10549   int __pyx_lineno = 0;
10550   const char *__pyx_filename = NULL;
10551   int __pyx_clineno = 0;
10552   __Pyx_RefNannySetupContext("skip_sync", 0);
10553   __Pyx_XDECREF(__pyx_r);
10554   __pyx_t_1 = __pyx_f_8fastavro_5_read_skip_sync(__pyx_v_fo, __pyx_v_sync_marker, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 689, __pyx_L1_error)
10555   __Pyx_GOTREF(__pyx_t_1);
10556   __pyx_r = __pyx_t_1;
10557   __pyx_t_1 = 0;
10558   goto __pyx_L0;
10559 
10560   /* function exit code */
10561   __pyx_L1_error:;
10562   __Pyx_XDECREF(__pyx_t_1);
10563   __Pyx_AddTraceback("fastavro._read.skip_sync", __pyx_clineno, __pyx_lineno, __pyx_filename);
10564   __pyx_r = NULL;
10565   __pyx_L0:;
10566   __Pyx_XGIVEREF(__pyx_r);
10567   __Pyx_RefNannyFinishContext();
10568   return __pyx_r;
10569 }
10570 
10571 /* "fastavro/_read.pyx":695
10572  *
10573  *
10574  * cpdef null_read_block(fo):             # <<<<<<<<<<<<<<
10575  *     """Read block in "null" codec."""
10576  *     return MemoryIO(read_bytes(fo))
10577  */
10578 
10579 static PyObject *__pyx_pw_8fastavro_5_read_25null_read_block(PyObject *__pyx_self, PyObject *__pyx_v_fo); /*proto*/
__pyx_f_8fastavro_5_read_null_read_block(PyObject * __pyx_v_fo,CYTHON_UNUSED int __pyx_skip_dispatch)10580 static PyObject *__pyx_f_8fastavro_5_read_null_read_block(PyObject *__pyx_v_fo, CYTHON_UNUSED int __pyx_skip_dispatch) {
10581   PyObject *__pyx_r = NULL;
10582   __Pyx_RefNannyDeclarations
10583   PyObject *__pyx_t_1 = NULL;
10584   PyObject *__pyx_t_2 = NULL;
10585   PyObject *__pyx_t_3 = NULL;
10586   PyObject *__pyx_t_4 = NULL;
10587   int __pyx_lineno = 0;
10588   const char *__pyx_filename = NULL;
10589   int __pyx_clineno = 0;
10590   __Pyx_RefNannySetupContext("null_read_block", 0);
10591 
10592   /* "fastavro/_read.pyx":697
10593  * cpdef null_read_block(fo):
10594  *     """Read block in "null" codec."""
10595  *     return MemoryIO(read_bytes(fo))             # <<<<<<<<<<<<<<
10596  *
10597  *
10598  */
10599   __Pyx_XDECREF(__pyx_r);
10600   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_MemoryIO); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 697, __pyx_L1_error)
10601   __Pyx_GOTREF(__pyx_t_2);
10602   __pyx_t_3 = __pyx_f_8fastavro_5_read_read_bytes(__pyx_v_fo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 697, __pyx_L1_error)
10603   __Pyx_GOTREF(__pyx_t_3);
10604   __pyx_t_4 = NULL;
10605   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
10606     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
10607     if (likely(__pyx_t_4)) {
10608       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
10609       __Pyx_INCREF(__pyx_t_4);
10610       __Pyx_INCREF(function);
10611       __Pyx_DECREF_SET(__pyx_t_2, function);
10612     }
10613   }
10614   __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
10615   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
10616   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10617   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L1_error)
10618   __Pyx_GOTREF(__pyx_t_1);
10619   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10620   __pyx_r = __pyx_t_1;
10621   __pyx_t_1 = 0;
10622   goto __pyx_L0;
10623 
10624   /* "fastavro/_read.pyx":695
10625  *
10626  *
10627  * cpdef null_read_block(fo):             # <<<<<<<<<<<<<<
10628  *     """Read block in "null" codec."""
10629  *     return MemoryIO(read_bytes(fo))
10630  */
10631 
10632   /* function exit code */
10633   __pyx_L1_error:;
10634   __Pyx_XDECREF(__pyx_t_1);
10635   __Pyx_XDECREF(__pyx_t_2);
10636   __Pyx_XDECREF(__pyx_t_3);
10637   __Pyx_XDECREF(__pyx_t_4);
10638   __Pyx_AddTraceback("fastavro._read.null_read_block", __pyx_clineno, __pyx_lineno, __pyx_filename);
10639   __pyx_r = 0;
10640   __pyx_L0:;
10641   __Pyx_XGIVEREF(__pyx_r);
10642   __Pyx_RefNannyFinishContext();
10643   return __pyx_r;
10644 }
10645 
10646 /* Python wrapper */
10647 static PyObject *__pyx_pw_8fastavro_5_read_25null_read_block(PyObject *__pyx_self, PyObject *__pyx_v_fo); /*proto*/
10648 static char __pyx_doc_8fastavro_5_read_24null_read_block[] = "Read block in \"null\" codec.";
__pyx_pw_8fastavro_5_read_25null_read_block(PyObject * __pyx_self,PyObject * __pyx_v_fo)10649 static PyObject *__pyx_pw_8fastavro_5_read_25null_read_block(PyObject *__pyx_self, PyObject *__pyx_v_fo) {
10650   PyObject *__pyx_r = 0;
10651   __Pyx_RefNannyDeclarations
10652   __Pyx_RefNannySetupContext("null_read_block (wrapper)", 0);
10653   __pyx_r = __pyx_pf_8fastavro_5_read_24null_read_block(__pyx_self, ((PyObject *)__pyx_v_fo));
10654 
10655   /* function exit code */
10656   __Pyx_RefNannyFinishContext();
10657   return __pyx_r;
10658 }
10659 
__pyx_pf_8fastavro_5_read_24null_read_block(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_fo)10660 static PyObject *__pyx_pf_8fastavro_5_read_24null_read_block(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fo) {
10661   PyObject *__pyx_r = NULL;
10662   __Pyx_RefNannyDeclarations
10663   PyObject *__pyx_t_1 = NULL;
10664   int __pyx_lineno = 0;
10665   const char *__pyx_filename = NULL;
10666   int __pyx_clineno = 0;
10667   __Pyx_RefNannySetupContext("null_read_block", 0);
10668   __Pyx_XDECREF(__pyx_r);
10669   __pyx_t_1 = __pyx_f_8fastavro_5_read_null_read_block(__pyx_v_fo, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 695, __pyx_L1_error)
10670   __Pyx_GOTREF(__pyx_t_1);
10671   __pyx_r = __pyx_t_1;
10672   __pyx_t_1 = 0;
10673   goto __pyx_L0;
10674 
10675   /* function exit code */
10676   __pyx_L1_error:;
10677   __Pyx_XDECREF(__pyx_t_1);
10678   __Pyx_AddTraceback("fastavro._read.null_read_block", __pyx_clineno, __pyx_lineno, __pyx_filename);
10679   __pyx_r = NULL;
10680   __pyx_L0:;
10681   __Pyx_XGIVEREF(__pyx_r);
10682   __Pyx_RefNannyFinishContext();
10683   return __pyx_r;
10684 }
10685 
10686 /* "fastavro/_read.pyx":700
10687  *
10688  *
10689  * cpdef deflate_read_block(fo):             # <<<<<<<<<<<<<<
10690  *     """Read block in "deflate" codec."""
10691  *     data = read_bytes(fo)
10692  */
10693 
10694 static PyObject *__pyx_pw_8fastavro_5_read_27deflate_read_block(PyObject *__pyx_self, PyObject *__pyx_v_fo); /*proto*/
__pyx_f_8fastavro_5_read_deflate_read_block(PyObject * __pyx_v_fo,CYTHON_UNUSED int __pyx_skip_dispatch)10695 static PyObject *__pyx_f_8fastavro_5_read_deflate_read_block(PyObject *__pyx_v_fo, CYTHON_UNUSED int __pyx_skip_dispatch) {
10696   PyObject *__pyx_v_data = NULL;
10697   PyObject *__pyx_r = NULL;
10698   __Pyx_RefNannyDeclarations
10699   PyObject *__pyx_t_1 = NULL;
10700   PyObject *__pyx_t_2 = NULL;
10701   PyObject *__pyx_t_3 = NULL;
10702   PyObject *__pyx_t_4 = NULL;
10703   PyObject *__pyx_t_5 = NULL;
10704   int __pyx_t_6;
10705   PyObject *__pyx_t_7 = NULL;
10706   int __pyx_lineno = 0;
10707   const char *__pyx_filename = NULL;
10708   int __pyx_clineno = 0;
10709   __Pyx_RefNannySetupContext("deflate_read_block", 0);
10710 
10711   /* "fastavro/_read.pyx":702
10712  * cpdef deflate_read_block(fo):
10713  *     """Read block in "deflate" codec."""
10714  *     data = read_bytes(fo)             # <<<<<<<<<<<<<<
10715  *     # -15 is the log of the window size; negative indicates "raw" (no
10716  *     # zlib headers) decompression.  See zlib.h.
10717  */
10718   __pyx_t_1 = __pyx_f_8fastavro_5_read_read_bytes(__pyx_v_fo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 702, __pyx_L1_error)
10719   __Pyx_GOTREF(__pyx_t_1);
10720   __pyx_v_data = __pyx_t_1;
10721   __pyx_t_1 = 0;
10722 
10723   /* "fastavro/_read.pyx":705
10724  *     # -15 is the log of the window size; negative indicates "raw" (no
10725  *     # zlib headers) decompression.  See zlib.h.
10726  *     return MemoryIO(zlib.decompress(data, -15))             # <<<<<<<<<<<<<<
10727  *
10728  *
10729  */
10730   __Pyx_XDECREF(__pyx_r);
10731   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_MemoryIO); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 705, __pyx_L1_error)
10732   __Pyx_GOTREF(__pyx_t_2);
10733   __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_zlib); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 705, __pyx_L1_error)
10734   __Pyx_GOTREF(__pyx_t_4);
10735   __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_decompress); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 705, __pyx_L1_error)
10736   __Pyx_GOTREF(__pyx_t_5);
10737   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10738   __pyx_t_4 = NULL;
10739   __pyx_t_6 = 0;
10740   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
10741     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
10742     if (likely(__pyx_t_4)) {
10743       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
10744       __Pyx_INCREF(__pyx_t_4);
10745       __Pyx_INCREF(function);
10746       __Pyx_DECREF_SET(__pyx_t_5, function);
10747       __pyx_t_6 = 1;
10748     }
10749   }
10750   #if CYTHON_FAST_PYCALL
10751   if (PyFunction_Check(__pyx_t_5)) {
10752     PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_data, __pyx_int_neg_15};
10753     __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 705, __pyx_L1_error)
10754     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
10755     __Pyx_GOTREF(__pyx_t_3);
10756   } else
10757   #endif
10758   #if CYTHON_FAST_PYCCALL
10759   if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
10760     PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_data, __pyx_int_neg_15};
10761     __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 705, __pyx_L1_error)
10762     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
10763     __Pyx_GOTREF(__pyx_t_3);
10764   } else
10765   #endif
10766   {
10767     __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 705, __pyx_L1_error)
10768     __Pyx_GOTREF(__pyx_t_7);
10769     if (__pyx_t_4) {
10770       __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
10771     }
10772     __Pyx_INCREF(__pyx_v_data);
10773     __Pyx_GIVEREF(__pyx_v_data);
10774     PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_data);
10775     __Pyx_INCREF(__pyx_int_neg_15);
10776     __Pyx_GIVEREF(__pyx_int_neg_15);
10777     PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_int_neg_15);
10778     __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 705, __pyx_L1_error)
10779     __Pyx_GOTREF(__pyx_t_3);
10780     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10781   }
10782   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10783   __pyx_t_5 = NULL;
10784   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
10785     __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
10786     if (likely(__pyx_t_5)) {
10787       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
10788       __Pyx_INCREF(__pyx_t_5);
10789       __Pyx_INCREF(function);
10790       __Pyx_DECREF_SET(__pyx_t_2, function);
10791     }
10792   }
10793   __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
10794   __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10795   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10796   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 705, __pyx_L1_error)
10797   __Pyx_GOTREF(__pyx_t_1);
10798   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10799   __pyx_r = __pyx_t_1;
10800   __pyx_t_1 = 0;
10801   goto __pyx_L0;
10802 
10803   /* "fastavro/_read.pyx":700
10804  *
10805  *
10806  * cpdef deflate_read_block(fo):             # <<<<<<<<<<<<<<
10807  *     """Read block in "deflate" codec."""
10808  *     data = read_bytes(fo)
10809  */
10810 
10811   /* function exit code */
10812   __pyx_L1_error:;
10813   __Pyx_XDECREF(__pyx_t_1);
10814   __Pyx_XDECREF(__pyx_t_2);
10815   __Pyx_XDECREF(__pyx_t_3);
10816   __Pyx_XDECREF(__pyx_t_4);
10817   __Pyx_XDECREF(__pyx_t_5);
10818   __Pyx_XDECREF(__pyx_t_7);
10819   __Pyx_AddTraceback("fastavro._read.deflate_read_block", __pyx_clineno, __pyx_lineno, __pyx_filename);
10820   __pyx_r = 0;
10821   __pyx_L0:;
10822   __Pyx_XDECREF(__pyx_v_data);
10823   __Pyx_XGIVEREF(__pyx_r);
10824   __Pyx_RefNannyFinishContext();
10825   return __pyx_r;
10826 }
10827 
10828 /* Python wrapper */
10829 static PyObject *__pyx_pw_8fastavro_5_read_27deflate_read_block(PyObject *__pyx_self, PyObject *__pyx_v_fo); /*proto*/
10830 static char __pyx_doc_8fastavro_5_read_26deflate_read_block[] = "Read block in \"deflate\" codec.";
__pyx_pw_8fastavro_5_read_27deflate_read_block(PyObject * __pyx_self,PyObject * __pyx_v_fo)10831 static PyObject *__pyx_pw_8fastavro_5_read_27deflate_read_block(PyObject *__pyx_self, PyObject *__pyx_v_fo) {
10832   PyObject *__pyx_r = 0;
10833   __Pyx_RefNannyDeclarations
10834   __Pyx_RefNannySetupContext("deflate_read_block (wrapper)", 0);
10835   __pyx_r = __pyx_pf_8fastavro_5_read_26deflate_read_block(__pyx_self, ((PyObject *)__pyx_v_fo));
10836 
10837   /* function exit code */
10838   __Pyx_RefNannyFinishContext();
10839   return __pyx_r;
10840 }
10841 
__pyx_pf_8fastavro_5_read_26deflate_read_block(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_fo)10842 static PyObject *__pyx_pf_8fastavro_5_read_26deflate_read_block(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fo) {
10843   PyObject *__pyx_r = NULL;
10844   __Pyx_RefNannyDeclarations
10845   PyObject *__pyx_t_1 = NULL;
10846   int __pyx_lineno = 0;
10847   const char *__pyx_filename = NULL;
10848   int __pyx_clineno = 0;
10849   __Pyx_RefNannySetupContext("deflate_read_block", 0);
10850   __Pyx_XDECREF(__pyx_r);
10851   __pyx_t_1 = __pyx_f_8fastavro_5_read_deflate_read_block(__pyx_v_fo, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 700, __pyx_L1_error)
10852   __Pyx_GOTREF(__pyx_t_1);
10853   __pyx_r = __pyx_t_1;
10854   __pyx_t_1 = 0;
10855   goto __pyx_L0;
10856 
10857   /* function exit code */
10858   __pyx_L1_error:;
10859   __Pyx_XDECREF(__pyx_t_1);
10860   __Pyx_AddTraceback("fastavro._read.deflate_read_block", __pyx_clineno, __pyx_lineno, __pyx_filename);
10861   __pyx_r = NULL;
10862   __pyx_L0:;
10863   __Pyx_XGIVEREF(__pyx_r);
10864   __Pyx_RefNannyFinishContext();
10865   return __pyx_r;
10866 }
10867 
10868 /* "fastavro/_read.pyx":708
10869  *
10870  *
10871  * cpdef bzip2_read_block(fo):             # <<<<<<<<<<<<<<
10872  *     """Read block in "bzip2" codec."""
10873  *     data = read_bytes(fo)
10874  */
10875 
10876 static PyObject *__pyx_pw_8fastavro_5_read_29bzip2_read_block(PyObject *__pyx_self, PyObject *__pyx_v_fo); /*proto*/
__pyx_f_8fastavro_5_read_bzip2_read_block(PyObject * __pyx_v_fo,CYTHON_UNUSED int __pyx_skip_dispatch)10877 static PyObject *__pyx_f_8fastavro_5_read_bzip2_read_block(PyObject *__pyx_v_fo, CYTHON_UNUSED int __pyx_skip_dispatch) {
10878   PyObject *__pyx_v_data = NULL;
10879   PyObject *__pyx_r = NULL;
10880   __Pyx_RefNannyDeclarations
10881   PyObject *__pyx_t_1 = NULL;
10882   PyObject *__pyx_t_2 = NULL;
10883   PyObject *__pyx_t_3 = NULL;
10884   PyObject *__pyx_t_4 = NULL;
10885   PyObject *__pyx_t_5 = NULL;
10886   int __pyx_lineno = 0;
10887   const char *__pyx_filename = NULL;
10888   int __pyx_clineno = 0;
10889   __Pyx_RefNannySetupContext("bzip2_read_block", 0);
10890 
10891   /* "fastavro/_read.pyx":710
10892  * cpdef bzip2_read_block(fo):
10893  *     """Read block in "bzip2" codec."""
10894  *     data = read_bytes(fo)             # <<<<<<<<<<<<<<
10895  *     return MemoryIO(bz2.decompress(data))
10896  *
10897  */
10898   __pyx_t_1 = __pyx_f_8fastavro_5_read_read_bytes(__pyx_v_fo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 710, __pyx_L1_error)
10899   __Pyx_GOTREF(__pyx_t_1);
10900   __pyx_v_data = __pyx_t_1;
10901   __pyx_t_1 = 0;
10902 
10903   /* "fastavro/_read.pyx":711
10904  *     """Read block in "bzip2" codec."""
10905  *     data = read_bytes(fo)
10906  *     return MemoryIO(bz2.decompress(data))             # <<<<<<<<<<<<<<
10907  *
10908  *
10909  */
10910   __Pyx_XDECREF(__pyx_r);
10911   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_MemoryIO); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 711, __pyx_L1_error)
10912   __Pyx_GOTREF(__pyx_t_2);
10913   __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_bz2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 711, __pyx_L1_error)
10914   __Pyx_GOTREF(__pyx_t_4);
10915   __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_decompress); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 711, __pyx_L1_error)
10916   __Pyx_GOTREF(__pyx_t_5);
10917   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10918   __pyx_t_4 = NULL;
10919   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
10920     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
10921     if (likely(__pyx_t_4)) {
10922       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
10923       __Pyx_INCREF(__pyx_t_4);
10924       __Pyx_INCREF(function);
10925       __Pyx_DECREF_SET(__pyx_t_5, function);
10926     }
10927   }
10928   __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_data) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_data);
10929   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
10930   if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 711, __pyx_L1_error)
10931   __Pyx_GOTREF(__pyx_t_3);
10932   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10933   __pyx_t_5 = NULL;
10934   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
10935     __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
10936     if (likely(__pyx_t_5)) {
10937       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
10938       __Pyx_INCREF(__pyx_t_5);
10939       __Pyx_INCREF(function);
10940       __Pyx_DECREF_SET(__pyx_t_2, function);
10941     }
10942   }
10943   __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
10944   __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10945   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10946   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 711, __pyx_L1_error)
10947   __Pyx_GOTREF(__pyx_t_1);
10948   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10949   __pyx_r = __pyx_t_1;
10950   __pyx_t_1 = 0;
10951   goto __pyx_L0;
10952 
10953   /* "fastavro/_read.pyx":708
10954  *
10955  *
10956  * cpdef bzip2_read_block(fo):             # <<<<<<<<<<<<<<
10957  *     """Read block in "bzip2" codec."""
10958  *     data = read_bytes(fo)
10959  */
10960 
10961   /* function exit code */
10962   __pyx_L1_error:;
10963   __Pyx_XDECREF(__pyx_t_1);
10964   __Pyx_XDECREF(__pyx_t_2);
10965   __Pyx_XDECREF(__pyx_t_3);
10966   __Pyx_XDECREF(__pyx_t_4);
10967   __Pyx_XDECREF(__pyx_t_5);
10968   __Pyx_AddTraceback("fastavro._read.bzip2_read_block", __pyx_clineno, __pyx_lineno, __pyx_filename);
10969   __pyx_r = 0;
10970   __pyx_L0:;
10971   __Pyx_XDECREF(__pyx_v_data);
10972   __Pyx_XGIVEREF(__pyx_r);
10973   __Pyx_RefNannyFinishContext();
10974   return __pyx_r;
10975 }
10976 
10977 /* Python wrapper */
10978 static PyObject *__pyx_pw_8fastavro_5_read_29bzip2_read_block(PyObject *__pyx_self, PyObject *__pyx_v_fo); /*proto*/
10979 static char __pyx_doc_8fastavro_5_read_28bzip2_read_block[] = "Read block in \"bzip2\" codec.";
__pyx_pw_8fastavro_5_read_29bzip2_read_block(PyObject * __pyx_self,PyObject * __pyx_v_fo)10980 static PyObject *__pyx_pw_8fastavro_5_read_29bzip2_read_block(PyObject *__pyx_self, PyObject *__pyx_v_fo) {
10981   PyObject *__pyx_r = 0;
10982   __Pyx_RefNannyDeclarations
10983   __Pyx_RefNannySetupContext("bzip2_read_block (wrapper)", 0);
10984   __pyx_r = __pyx_pf_8fastavro_5_read_28bzip2_read_block(__pyx_self, ((PyObject *)__pyx_v_fo));
10985 
10986   /* function exit code */
10987   __Pyx_RefNannyFinishContext();
10988   return __pyx_r;
10989 }
10990 
__pyx_pf_8fastavro_5_read_28bzip2_read_block(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_fo)10991 static PyObject *__pyx_pf_8fastavro_5_read_28bzip2_read_block(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fo) {
10992   PyObject *__pyx_r = NULL;
10993   __Pyx_RefNannyDeclarations
10994   PyObject *__pyx_t_1 = NULL;
10995   int __pyx_lineno = 0;
10996   const char *__pyx_filename = NULL;
10997   int __pyx_clineno = 0;
10998   __Pyx_RefNannySetupContext("bzip2_read_block", 0);
10999   __Pyx_XDECREF(__pyx_r);
11000   __pyx_t_1 = __pyx_f_8fastavro_5_read_bzip2_read_block(__pyx_v_fo, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 708, __pyx_L1_error)
11001   __Pyx_GOTREF(__pyx_t_1);
11002   __pyx_r = __pyx_t_1;
11003   __pyx_t_1 = 0;
11004   goto __pyx_L0;
11005 
11006   /* function exit code */
11007   __pyx_L1_error:;
11008   __Pyx_XDECREF(__pyx_t_1);
11009   __Pyx_AddTraceback("fastavro._read.bzip2_read_block", __pyx_clineno, __pyx_lineno, __pyx_filename);
11010   __pyx_r = NULL;
11011   __pyx_L0:;
11012   __Pyx_XGIVEREF(__pyx_r);
11013   __Pyx_RefNannyFinishContext();
11014   return __pyx_r;
11015 }
11016 
11017 /* "fastavro/_read.pyx":721
11018  *
11019  *
11020  * cpdef snappy_read_block(fo):             # <<<<<<<<<<<<<<
11021  *     length = read_long(fo)
11022  *     data = fo.read(length - 4)
11023  */
11024 
11025 static PyObject *__pyx_pw_8fastavro_5_read_31snappy_read_block(PyObject *__pyx_self, PyObject *__pyx_v_fo); /*proto*/
__pyx_f_8fastavro_5_read_snappy_read_block(PyObject * __pyx_v_fo,CYTHON_UNUSED int __pyx_skip_dispatch)11026 static PyObject *__pyx_f_8fastavro_5_read_snappy_read_block(PyObject *__pyx_v_fo, CYTHON_UNUSED int __pyx_skip_dispatch) {
11027   PyObject *__pyx_v_length = NULL;
11028   PyObject *__pyx_v_data = NULL;
11029   PyObject *__pyx_r = NULL;
11030   __Pyx_RefNannyDeclarations
11031   __pyx_t_8fastavro_5_read_long64 __pyx_t_1;
11032   PyObject *__pyx_t_2 = NULL;
11033   PyObject *__pyx_t_3 = NULL;
11034   PyObject *__pyx_t_4 = NULL;
11035   PyObject *__pyx_t_5 = NULL;
11036   PyObject *__pyx_t_6 = NULL;
11037   int __pyx_lineno = 0;
11038   const char *__pyx_filename = NULL;
11039   int __pyx_clineno = 0;
11040   __Pyx_RefNannySetupContext("snappy_read_block", 0);
11041 
11042   /* "fastavro/_read.pyx":722
11043  *
11044  * cpdef snappy_read_block(fo):
11045  *     length = read_long(fo)             # <<<<<<<<<<<<<<
11046  *     data = fo.read(length - 4)
11047  *     fo.read(4)  # CRC
11048  */
11049   __pyx_t_1 = __pyx_f_8fastavro_5_read_read_long(__pyx_v_fo); if (unlikely(__pyx_t_1 == ((__pyx_t_8fastavro_5_read_long64)-1LL) && PyErr_Occurred())) __PYX_ERR(0, 722, __pyx_L1_error)
11050   __pyx_t_2 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 722, __pyx_L1_error)
11051   __Pyx_GOTREF(__pyx_t_2);
11052   __pyx_v_length = __pyx_t_2;
11053   __pyx_t_2 = 0;
11054 
11055   /* "fastavro/_read.pyx":723
11056  * cpdef snappy_read_block(fo):
11057  *     length = read_long(fo)
11058  *     data = fo.read(length - 4)             # <<<<<<<<<<<<<<
11059  *     fo.read(4)  # CRC
11060  *     return MemoryIO(snappy.decompress(data))
11061  */
11062   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_fo, __pyx_n_s_read); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 723, __pyx_L1_error)
11063   __Pyx_GOTREF(__pyx_t_3);
11064   __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_length, __pyx_int_4, 4, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 723, __pyx_L1_error)
11065   __Pyx_GOTREF(__pyx_t_4);
11066   __pyx_t_5 = NULL;
11067   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11068     __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
11069     if (likely(__pyx_t_5)) {
11070       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
11071       __Pyx_INCREF(__pyx_t_5);
11072       __Pyx_INCREF(function);
11073       __Pyx_DECREF_SET(__pyx_t_3, function);
11074     }
11075   }
11076   __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
11077   __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11078   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11079   if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 723, __pyx_L1_error)
11080   __Pyx_GOTREF(__pyx_t_2);
11081   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11082   __pyx_v_data = __pyx_t_2;
11083   __pyx_t_2 = 0;
11084 
11085   /* "fastavro/_read.pyx":724
11086  *     length = read_long(fo)
11087  *     data = fo.read(length - 4)
11088  *     fo.read(4)  # CRC             # <<<<<<<<<<<<<<
11089  *     return MemoryIO(snappy.decompress(data))
11090  *
11091  */
11092   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_fo, __pyx_n_s_read); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 724, __pyx_L1_error)
11093   __Pyx_GOTREF(__pyx_t_3);
11094   __pyx_t_4 = NULL;
11095   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11096     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
11097     if (likely(__pyx_t_4)) {
11098       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
11099       __Pyx_INCREF(__pyx_t_4);
11100       __Pyx_INCREF(function);
11101       __Pyx_DECREF_SET(__pyx_t_3, function);
11102     }
11103   }
11104   __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_int_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_int_4);
11105   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11106   if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 724, __pyx_L1_error)
11107   __Pyx_GOTREF(__pyx_t_2);
11108   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11109   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11110 
11111   /* "fastavro/_read.pyx":725
11112  *     data = fo.read(length - 4)
11113  *     fo.read(4)  # CRC
11114  *     return MemoryIO(snappy.decompress(data))             # <<<<<<<<<<<<<<
11115  *
11116  *
11117  */
11118   __Pyx_XDECREF(__pyx_r);
11119   __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_MemoryIO); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 725, __pyx_L1_error)
11120   __Pyx_GOTREF(__pyx_t_3);
11121   __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_snappy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 725, __pyx_L1_error)
11122   __Pyx_GOTREF(__pyx_t_5);
11123   __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_decompress); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 725, __pyx_L1_error)
11124   __Pyx_GOTREF(__pyx_t_6);
11125   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11126   __pyx_t_5 = NULL;
11127   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
11128     __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
11129     if (likely(__pyx_t_5)) {
11130       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
11131       __Pyx_INCREF(__pyx_t_5);
11132       __Pyx_INCREF(function);
11133       __Pyx_DECREF_SET(__pyx_t_6, function);
11134     }
11135   }
11136   __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_data) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_data);
11137   __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11138   if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 725, __pyx_L1_error)
11139   __Pyx_GOTREF(__pyx_t_4);
11140   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11141   __pyx_t_6 = NULL;
11142   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
11143     __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
11144     if (likely(__pyx_t_6)) {
11145       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
11146       __Pyx_INCREF(__pyx_t_6);
11147       __Pyx_INCREF(function);
11148       __Pyx_DECREF_SET(__pyx_t_3, function);
11149     }
11150   }
11151   __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
11152   __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11153   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11154   if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error)
11155   __Pyx_GOTREF(__pyx_t_2);
11156   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11157   __pyx_r = __pyx_t_2;
11158   __pyx_t_2 = 0;
11159   goto __pyx_L0;
11160 
11161   /* "fastavro/_read.pyx":721
11162  *
11163  *
11164  * cpdef snappy_read_block(fo):             # <<<<<<<<<<<<<<
11165  *     length = read_long(fo)
11166  *     data = fo.read(length - 4)
11167  */
11168 
11169   /* function exit code */
11170   __pyx_L1_error:;
11171   __Pyx_XDECREF(__pyx_t_2);
11172   __Pyx_XDECREF(__pyx_t_3);
11173   __Pyx_XDECREF(__pyx_t_4);
11174   __Pyx_XDECREF(__pyx_t_5);
11175   __Pyx_XDECREF(__pyx_t_6);
11176   __Pyx_AddTraceback("fastavro._read.snappy_read_block", __pyx_clineno, __pyx_lineno, __pyx_filename);
11177   __pyx_r = 0;
11178   __pyx_L0:;
11179   __Pyx_XDECREF(__pyx_v_length);
11180   __Pyx_XDECREF(__pyx_v_data);
11181   __Pyx_XGIVEREF(__pyx_r);
11182   __Pyx_RefNannyFinishContext();
11183   return __pyx_r;
11184 }
11185 
11186 /* Python wrapper */
11187 static PyObject *__pyx_pw_8fastavro_5_read_31snappy_read_block(PyObject *__pyx_self, PyObject *__pyx_v_fo); /*proto*/
__pyx_pw_8fastavro_5_read_31snappy_read_block(PyObject * __pyx_self,PyObject * __pyx_v_fo)11188 static PyObject *__pyx_pw_8fastavro_5_read_31snappy_read_block(PyObject *__pyx_self, PyObject *__pyx_v_fo) {
11189   PyObject *__pyx_r = 0;
11190   __Pyx_RefNannyDeclarations
11191   __Pyx_RefNannySetupContext("snappy_read_block (wrapper)", 0);
11192   __pyx_r = __pyx_pf_8fastavro_5_read_30snappy_read_block(__pyx_self, ((PyObject *)__pyx_v_fo));
11193 
11194   /* function exit code */
11195   __Pyx_RefNannyFinishContext();
11196   return __pyx_r;
11197 }
11198 
__pyx_pf_8fastavro_5_read_30snappy_read_block(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_fo)11199 static PyObject *__pyx_pf_8fastavro_5_read_30snappy_read_block(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fo) {
11200   PyObject *__pyx_r = NULL;
11201   __Pyx_RefNannyDeclarations
11202   PyObject *__pyx_t_1 = NULL;
11203   int __pyx_lineno = 0;
11204   const char *__pyx_filename = NULL;
11205   int __pyx_clineno = 0;
11206   __Pyx_RefNannySetupContext("snappy_read_block", 0);
11207   __Pyx_XDECREF(__pyx_r);
11208   __pyx_t_1 = __pyx_f_8fastavro_5_read_snappy_read_block(__pyx_v_fo, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 721, __pyx_L1_error)
11209   __Pyx_GOTREF(__pyx_t_1);
11210   __pyx_r = __pyx_t_1;
11211   __pyx_t_1 = 0;
11212   goto __pyx_L0;
11213 
11214   /* function exit code */
11215   __pyx_L1_error:;
11216   __Pyx_XDECREF(__pyx_t_1);
11217   __Pyx_AddTraceback("fastavro._read.snappy_read_block", __pyx_clineno, __pyx_lineno, __pyx_filename);
11218   __pyx_r = NULL;
11219   __pyx_L0:;
11220   __Pyx_XGIVEREF(__pyx_r);
11221   __Pyx_RefNannyFinishContext();
11222   return __pyx_r;
11223 }
11224 
11225 /* "fastavro/_read.pyx":736
11226  *
11227  *
11228  * cpdef zstandard_read_block(fo):             # <<<<<<<<<<<<<<
11229  *     length = read_long(fo)
11230  *     data = fo.read(length)
11231  */
11232 
11233 static PyObject *__pyx_pw_8fastavro_5_read_33zstandard_read_block(PyObject *__pyx_self, PyObject *__pyx_v_fo); /*proto*/
__pyx_f_8fastavro_5_read_zstandard_read_block(PyObject * __pyx_v_fo,CYTHON_UNUSED int __pyx_skip_dispatch)11234 static PyObject *__pyx_f_8fastavro_5_read_zstandard_read_block(PyObject *__pyx_v_fo, CYTHON_UNUSED int __pyx_skip_dispatch) {
11235   __pyx_t_8fastavro_5_read_long64 __pyx_v_length;
11236   PyObject *__pyx_v_data = NULL;
11237   PyObject *__pyx_r = NULL;
11238   __Pyx_RefNannyDeclarations
11239   __pyx_t_8fastavro_5_read_long64 __pyx_t_1;
11240   PyObject *__pyx_t_2 = NULL;
11241   PyObject *__pyx_t_3 = NULL;
11242   PyObject *__pyx_t_4 = NULL;
11243   PyObject *__pyx_t_5 = NULL;
11244   PyObject *__pyx_t_6 = NULL;
11245   PyObject *__pyx_t_7 = NULL;
11246   int __pyx_lineno = 0;
11247   const char *__pyx_filename = NULL;
11248   int __pyx_clineno = 0;
11249   __Pyx_RefNannySetupContext("zstandard_read_block", 0);
11250 
11251   /* "fastavro/_read.pyx":737
11252  *
11253  * cpdef zstandard_read_block(fo):
11254  *     length = read_long(fo)             # <<<<<<<<<<<<<<
11255  *     data = fo.read(length)
11256  *     return MemoryIO(zstd.ZstdDecompressor().decompress(data))
11257  */
11258   __pyx_t_1 = __pyx_f_8fastavro_5_read_read_long(__pyx_v_fo); if (unlikely(__pyx_t_1 == ((__pyx_t_8fastavro_5_read_long64)-1LL) && PyErr_Occurred())) __PYX_ERR(0, 737, __pyx_L1_error)
11259   __pyx_v_length = __pyx_t_1;
11260 
11261   /* "fastavro/_read.pyx":738
11262  * cpdef zstandard_read_block(fo):
11263  *     length = read_long(fo)
11264  *     data = fo.read(length)             # <<<<<<<<<<<<<<
11265  *     return MemoryIO(zstd.ZstdDecompressor().decompress(data))
11266  *
11267  */
11268   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_fo, __pyx_n_s_read); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 738, __pyx_L1_error)
11269   __Pyx_GOTREF(__pyx_t_3);
11270   __pyx_t_4 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_length); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 738, __pyx_L1_error)
11271   __Pyx_GOTREF(__pyx_t_4);
11272   __pyx_t_5 = NULL;
11273   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11274     __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
11275     if (likely(__pyx_t_5)) {
11276       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
11277       __Pyx_INCREF(__pyx_t_5);
11278       __Pyx_INCREF(function);
11279       __Pyx_DECREF_SET(__pyx_t_3, function);
11280     }
11281   }
11282   __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
11283   __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11284   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11285   if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 738, __pyx_L1_error)
11286   __Pyx_GOTREF(__pyx_t_2);
11287   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11288   __pyx_v_data = __pyx_t_2;
11289   __pyx_t_2 = 0;
11290 
11291   /* "fastavro/_read.pyx":739
11292  *     length = read_long(fo)
11293  *     data = fo.read(length)
11294  *     return MemoryIO(zstd.ZstdDecompressor().decompress(data))             # <<<<<<<<<<<<<<
11295  *
11296  *
11297  */
11298   __Pyx_XDECREF(__pyx_r);
11299   __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_MemoryIO); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 739, __pyx_L1_error)
11300   __Pyx_GOTREF(__pyx_t_3);
11301   __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_zstd); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 739, __pyx_L1_error)
11302   __Pyx_GOTREF(__pyx_t_6);
11303   __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_ZstdDecompressor); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 739, __pyx_L1_error)
11304   __Pyx_GOTREF(__pyx_t_7);
11305   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11306   __pyx_t_6 = NULL;
11307   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
11308     __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
11309     if (likely(__pyx_t_6)) {
11310       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
11311       __Pyx_INCREF(__pyx_t_6);
11312       __Pyx_INCREF(function);
11313       __Pyx_DECREF_SET(__pyx_t_7, function);
11314     }
11315   }
11316   __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
11317   __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11318   if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 739, __pyx_L1_error)
11319   __Pyx_GOTREF(__pyx_t_5);
11320   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11321   __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_decompress); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 739, __pyx_L1_error)
11322   __Pyx_GOTREF(__pyx_t_7);
11323   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11324   __pyx_t_5 = NULL;
11325   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
11326     __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
11327     if (likely(__pyx_t_5)) {
11328       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
11329       __Pyx_INCREF(__pyx_t_5);
11330       __Pyx_INCREF(function);
11331       __Pyx_DECREF_SET(__pyx_t_7, function);
11332     }
11333   }
11334   __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_5, __pyx_v_data) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_data);
11335   __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11336   if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 739, __pyx_L1_error)
11337   __Pyx_GOTREF(__pyx_t_4);
11338   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11339   __pyx_t_7 = NULL;
11340   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
11341     __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
11342     if (likely(__pyx_t_7)) {
11343       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
11344       __Pyx_INCREF(__pyx_t_7);
11345       __Pyx_INCREF(function);
11346       __Pyx_DECREF_SET(__pyx_t_3, function);
11347     }
11348   }
11349   __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_7, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
11350   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11351   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11352   if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 739, __pyx_L1_error)
11353   __Pyx_GOTREF(__pyx_t_2);
11354   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11355   __pyx_r = __pyx_t_2;
11356   __pyx_t_2 = 0;
11357   goto __pyx_L0;
11358 
11359   /* "fastavro/_read.pyx":736
11360  *
11361  *
11362  * cpdef zstandard_read_block(fo):             # <<<<<<<<<<<<<<
11363  *     length = read_long(fo)
11364  *     data = fo.read(length)
11365  */
11366 
11367   /* function exit code */
11368   __pyx_L1_error:;
11369   __Pyx_XDECREF(__pyx_t_2);
11370   __Pyx_XDECREF(__pyx_t_3);
11371   __Pyx_XDECREF(__pyx_t_4);
11372   __Pyx_XDECREF(__pyx_t_5);
11373   __Pyx_XDECREF(__pyx_t_6);
11374   __Pyx_XDECREF(__pyx_t_7);
11375   __Pyx_AddTraceback("fastavro._read.zstandard_read_block", __pyx_clineno, __pyx_lineno, __pyx_filename);
11376   __pyx_r = 0;
11377   __pyx_L0:;
11378   __Pyx_XDECREF(__pyx_v_data);
11379   __Pyx_XGIVEREF(__pyx_r);
11380   __Pyx_RefNannyFinishContext();
11381   return __pyx_r;
11382 }
11383 
11384 /* Python wrapper */
11385 static PyObject *__pyx_pw_8fastavro_5_read_33zstandard_read_block(PyObject *__pyx_self, PyObject *__pyx_v_fo); /*proto*/
__pyx_pw_8fastavro_5_read_33zstandard_read_block(PyObject * __pyx_self,PyObject * __pyx_v_fo)11386 static PyObject *__pyx_pw_8fastavro_5_read_33zstandard_read_block(PyObject *__pyx_self, PyObject *__pyx_v_fo) {
11387   PyObject *__pyx_r = 0;
11388   __Pyx_RefNannyDeclarations
11389   __Pyx_RefNannySetupContext("zstandard_read_block (wrapper)", 0);
11390   __pyx_r = __pyx_pf_8fastavro_5_read_32zstandard_read_block(__pyx_self, ((PyObject *)__pyx_v_fo));
11391 
11392   /* function exit code */
11393   __Pyx_RefNannyFinishContext();
11394   return __pyx_r;
11395 }
11396 
__pyx_pf_8fastavro_5_read_32zstandard_read_block(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_fo)11397 static PyObject *__pyx_pf_8fastavro_5_read_32zstandard_read_block(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fo) {
11398   PyObject *__pyx_r = NULL;
11399   __Pyx_RefNannyDeclarations
11400   PyObject *__pyx_t_1 = NULL;
11401   int __pyx_lineno = 0;
11402   const char *__pyx_filename = NULL;
11403   int __pyx_clineno = 0;
11404   __Pyx_RefNannySetupContext("zstandard_read_block", 0);
11405   __Pyx_XDECREF(__pyx_r);
11406   __pyx_t_1 = __pyx_f_8fastavro_5_read_zstandard_read_block(__pyx_v_fo, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 736, __pyx_L1_error)
11407   __Pyx_GOTREF(__pyx_t_1);
11408   __pyx_r = __pyx_t_1;
11409   __pyx_t_1 = 0;
11410   goto __pyx_L0;
11411 
11412   /* function exit code */
11413   __pyx_L1_error:;
11414   __Pyx_XDECREF(__pyx_t_1);
11415   __Pyx_AddTraceback("fastavro._read.zstandard_read_block", __pyx_clineno, __pyx_lineno, __pyx_filename);
11416   __pyx_r = NULL;
11417   __pyx_L0:;
11418   __Pyx_XGIVEREF(__pyx_r);
11419   __Pyx_RefNannyFinishContext();
11420   return __pyx_r;
11421 }
11422 
11423 /* "fastavro/_read.pyx":750
11424  *
11425  *
11426  * cpdef lz4_read_block(fo):             # <<<<<<<<<<<<<<
11427  *     length = read_long(fo)
11428  *     data = fo.read(length)
11429  */
11430 
11431 static PyObject *__pyx_pw_8fastavro_5_read_35lz4_read_block(PyObject *__pyx_self, PyObject *__pyx_v_fo); /*proto*/
__pyx_f_8fastavro_5_read_lz4_read_block(PyObject * __pyx_v_fo,CYTHON_UNUSED int __pyx_skip_dispatch)11432 static PyObject *__pyx_f_8fastavro_5_read_lz4_read_block(PyObject *__pyx_v_fo, CYTHON_UNUSED int __pyx_skip_dispatch) {
11433   __pyx_t_8fastavro_5_read_long64 __pyx_v_length;
11434   PyObject *__pyx_v_data = NULL;
11435   PyObject *__pyx_r = NULL;
11436   __Pyx_RefNannyDeclarations
11437   __pyx_t_8fastavro_5_read_long64 __pyx_t_1;
11438   PyObject *__pyx_t_2 = NULL;
11439   PyObject *__pyx_t_3 = NULL;
11440   PyObject *__pyx_t_4 = NULL;
11441   PyObject *__pyx_t_5 = NULL;
11442   PyObject *__pyx_t_6 = NULL;
11443   int __pyx_lineno = 0;
11444   const char *__pyx_filename = NULL;
11445   int __pyx_clineno = 0;
11446   __Pyx_RefNannySetupContext("lz4_read_block", 0);
11447 
11448   /* "fastavro/_read.pyx":751
11449  *
11450  * cpdef lz4_read_block(fo):
11451  *     length = read_long(fo)             # <<<<<<<<<<<<<<
11452  *     data = fo.read(length)
11453  *     return MemoryIO(lz4.block.decompress(data))
11454  */
11455   __pyx_t_1 = __pyx_f_8fastavro_5_read_read_long(__pyx_v_fo); if (unlikely(__pyx_t_1 == ((__pyx_t_8fastavro_5_read_long64)-1LL) && PyErr_Occurred())) __PYX_ERR(0, 751, __pyx_L1_error)
11456   __pyx_v_length = __pyx_t_1;
11457 
11458   /* "fastavro/_read.pyx":752
11459  * cpdef lz4_read_block(fo):
11460  *     length = read_long(fo)
11461  *     data = fo.read(length)             # <<<<<<<<<<<<<<
11462  *     return MemoryIO(lz4.block.decompress(data))
11463  *
11464  */
11465   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_fo, __pyx_n_s_read); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 752, __pyx_L1_error)
11466   __Pyx_GOTREF(__pyx_t_3);
11467   __pyx_t_4 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_length); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 752, __pyx_L1_error)
11468   __Pyx_GOTREF(__pyx_t_4);
11469   __pyx_t_5 = NULL;
11470   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11471     __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
11472     if (likely(__pyx_t_5)) {
11473       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
11474       __Pyx_INCREF(__pyx_t_5);
11475       __Pyx_INCREF(function);
11476       __Pyx_DECREF_SET(__pyx_t_3, function);
11477     }
11478   }
11479   __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
11480   __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11481   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11482   if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 752, __pyx_L1_error)
11483   __Pyx_GOTREF(__pyx_t_2);
11484   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11485   __pyx_v_data = __pyx_t_2;
11486   __pyx_t_2 = 0;
11487 
11488   /* "fastavro/_read.pyx":753
11489  *     length = read_long(fo)
11490  *     data = fo.read(length)
11491  *     return MemoryIO(lz4.block.decompress(data))             # <<<<<<<<<<<<<<
11492  *
11493  *
11494  */
11495   __Pyx_XDECREF(__pyx_r);
11496   __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_MemoryIO); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 753, __pyx_L1_error)
11497   __Pyx_GOTREF(__pyx_t_3);
11498   __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_lz4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 753, __pyx_L1_error)
11499   __Pyx_GOTREF(__pyx_t_5);
11500   __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_block); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 753, __pyx_L1_error)
11501   __Pyx_GOTREF(__pyx_t_6);
11502   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11503   __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_decompress); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 753, __pyx_L1_error)
11504   __Pyx_GOTREF(__pyx_t_5);
11505   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11506   __pyx_t_6 = NULL;
11507   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
11508     __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
11509     if (likely(__pyx_t_6)) {
11510       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
11511       __Pyx_INCREF(__pyx_t_6);
11512       __Pyx_INCREF(function);
11513       __Pyx_DECREF_SET(__pyx_t_5, function);
11514     }
11515   }
11516   __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_data) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_data);
11517   __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11518   if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 753, __pyx_L1_error)
11519   __Pyx_GOTREF(__pyx_t_4);
11520   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11521   __pyx_t_5 = NULL;
11522   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
11523     __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
11524     if (likely(__pyx_t_5)) {
11525       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
11526       __Pyx_INCREF(__pyx_t_5);
11527       __Pyx_INCREF(function);
11528       __Pyx_DECREF_SET(__pyx_t_3, function);
11529     }
11530   }
11531   __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
11532   __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11533   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11534   if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 753, __pyx_L1_error)
11535   __Pyx_GOTREF(__pyx_t_2);
11536   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11537   __pyx_r = __pyx_t_2;
11538   __pyx_t_2 = 0;
11539   goto __pyx_L0;
11540 
11541   /* "fastavro/_read.pyx":750
11542  *
11543  *
11544  * cpdef lz4_read_block(fo):             # <<<<<<<<<<<<<<
11545  *     length = read_long(fo)
11546  *     data = fo.read(length)
11547  */
11548 
11549   /* function exit code */
11550   __pyx_L1_error:;
11551   __Pyx_XDECREF(__pyx_t_2);
11552   __Pyx_XDECREF(__pyx_t_3);
11553   __Pyx_XDECREF(__pyx_t_4);
11554   __Pyx_XDECREF(__pyx_t_5);
11555   __Pyx_XDECREF(__pyx_t_6);
11556   __Pyx_AddTraceback("fastavro._read.lz4_read_block", __pyx_clineno, __pyx_lineno, __pyx_filename);
11557   __pyx_r = 0;
11558   __pyx_L0:;
11559   __Pyx_XDECREF(__pyx_v_data);
11560   __Pyx_XGIVEREF(__pyx_r);
11561   __Pyx_RefNannyFinishContext();
11562   return __pyx_r;
11563 }
11564 
11565 /* Python wrapper */
11566 static PyObject *__pyx_pw_8fastavro_5_read_35lz4_read_block(PyObject *__pyx_self, PyObject *__pyx_v_fo); /*proto*/
__pyx_pw_8fastavro_5_read_35lz4_read_block(PyObject * __pyx_self,PyObject * __pyx_v_fo)11567 static PyObject *__pyx_pw_8fastavro_5_read_35lz4_read_block(PyObject *__pyx_self, PyObject *__pyx_v_fo) {
11568   PyObject *__pyx_r = 0;
11569   __Pyx_RefNannyDeclarations
11570   __Pyx_RefNannySetupContext("lz4_read_block (wrapper)", 0);
11571   __pyx_r = __pyx_pf_8fastavro_5_read_34lz4_read_block(__pyx_self, ((PyObject *)__pyx_v_fo));
11572 
11573   /* function exit code */
11574   __Pyx_RefNannyFinishContext();
11575   return __pyx_r;
11576 }
11577 
__pyx_pf_8fastavro_5_read_34lz4_read_block(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_fo)11578 static PyObject *__pyx_pf_8fastavro_5_read_34lz4_read_block(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fo) {
11579   PyObject *__pyx_r = NULL;
11580   __Pyx_RefNannyDeclarations
11581   PyObject *__pyx_t_1 = NULL;
11582   int __pyx_lineno = 0;
11583   const char *__pyx_filename = NULL;
11584   int __pyx_clineno = 0;
11585   __Pyx_RefNannySetupContext("lz4_read_block", 0);
11586   __Pyx_XDECREF(__pyx_r);
11587   __pyx_t_1 = __pyx_f_8fastavro_5_read_lz4_read_block(__pyx_v_fo, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 750, __pyx_L1_error)
11588   __Pyx_GOTREF(__pyx_t_1);
11589   __pyx_r = __pyx_t_1;
11590   __pyx_t_1 = 0;
11591   goto __pyx_L0;
11592 
11593   /* function exit code */
11594   __pyx_L1_error:;
11595   __Pyx_XDECREF(__pyx_t_1);
11596   __Pyx_AddTraceback("fastavro._read.lz4_read_block", __pyx_clineno, __pyx_lineno, __pyx_filename);
11597   __pyx_r = NULL;
11598   __pyx_L0:;
11599   __Pyx_XGIVEREF(__pyx_r);
11600   __Pyx_RefNannyFinishContext();
11601   return __pyx_r;
11602 }
11603 
11604 /* "fastavro/_read.pyx":764
11605  *
11606  *
11607  * cpdef xz_read_block(fo):             # <<<<<<<<<<<<<<
11608  *     length = read_long(fo)
11609  *     data = fo.read(length)
11610  */
11611 
11612 static PyObject *__pyx_pw_8fastavro_5_read_37xz_read_block(PyObject *__pyx_self, PyObject *__pyx_v_fo); /*proto*/
__pyx_f_8fastavro_5_read_xz_read_block(PyObject * __pyx_v_fo,CYTHON_UNUSED int __pyx_skip_dispatch)11613 static PyObject *__pyx_f_8fastavro_5_read_xz_read_block(PyObject *__pyx_v_fo, CYTHON_UNUSED int __pyx_skip_dispatch) {
11614   __pyx_t_8fastavro_5_read_long64 __pyx_v_length;
11615   PyObject *__pyx_v_data = NULL;
11616   PyObject *__pyx_r = NULL;
11617   __Pyx_RefNannyDeclarations
11618   __pyx_t_8fastavro_5_read_long64 __pyx_t_1;
11619   PyObject *__pyx_t_2 = NULL;
11620   PyObject *__pyx_t_3 = NULL;
11621   PyObject *__pyx_t_4 = NULL;
11622   PyObject *__pyx_t_5 = NULL;
11623   PyObject *__pyx_t_6 = NULL;
11624   int __pyx_lineno = 0;
11625   const char *__pyx_filename = NULL;
11626   int __pyx_clineno = 0;
11627   __Pyx_RefNannySetupContext("xz_read_block", 0);
11628 
11629   /* "fastavro/_read.pyx":765
11630  *
11631  * cpdef xz_read_block(fo):
11632  *     length = read_long(fo)             # <<<<<<<<<<<<<<
11633  *     data = fo.read(length)
11634  *     return MemoryIO(lzma.decompress(data))
11635  */
11636   __pyx_t_1 = __pyx_f_8fastavro_5_read_read_long(__pyx_v_fo); if (unlikely(__pyx_t_1 == ((__pyx_t_8fastavro_5_read_long64)-1LL) && PyErr_Occurred())) __PYX_ERR(0, 765, __pyx_L1_error)
11637   __pyx_v_length = __pyx_t_1;
11638 
11639   /* "fastavro/_read.pyx":766
11640  * cpdef xz_read_block(fo):
11641  *     length = read_long(fo)
11642  *     data = fo.read(length)             # <<<<<<<<<<<<<<
11643  *     return MemoryIO(lzma.decompress(data))
11644  *
11645  */
11646   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_fo, __pyx_n_s_read); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 766, __pyx_L1_error)
11647   __Pyx_GOTREF(__pyx_t_3);
11648   __pyx_t_4 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_length); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 766, __pyx_L1_error)
11649   __Pyx_GOTREF(__pyx_t_4);
11650   __pyx_t_5 = NULL;
11651   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11652     __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
11653     if (likely(__pyx_t_5)) {
11654       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
11655       __Pyx_INCREF(__pyx_t_5);
11656       __Pyx_INCREF(function);
11657       __Pyx_DECREF_SET(__pyx_t_3, function);
11658     }
11659   }
11660   __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
11661   __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11662   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11663   if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 766, __pyx_L1_error)
11664   __Pyx_GOTREF(__pyx_t_2);
11665   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11666   __pyx_v_data = __pyx_t_2;
11667   __pyx_t_2 = 0;
11668 
11669   /* "fastavro/_read.pyx":767
11670  *     length = read_long(fo)
11671  *     data = fo.read(length)
11672  *     return MemoryIO(lzma.decompress(data))             # <<<<<<<<<<<<<<
11673  *
11674  *
11675  */
11676   __Pyx_XDECREF(__pyx_r);
11677   __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_MemoryIO); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 767, __pyx_L1_error)
11678   __Pyx_GOTREF(__pyx_t_3);
11679   __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_lzma); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 767, __pyx_L1_error)
11680   __Pyx_GOTREF(__pyx_t_5);
11681   __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_decompress); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 767, __pyx_L1_error)
11682   __Pyx_GOTREF(__pyx_t_6);
11683   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11684   __pyx_t_5 = NULL;
11685   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
11686     __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
11687     if (likely(__pyx_t_5)) {
11688       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
11689       __Pyx_INCREF(__pyx_t_5);
11690       __Pyx_INCREF(function);
11691       __Pyx_DECREF_SET(__pyx_t_6, function);
11692     }
11693   }
11694   __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_data) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_data);
11695   __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11696   if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 767, __pyx_L1_error)
11697   __Pyx_GOTREF(__pyx_t_4);
11698   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11699   __pyx_t_6 = NULL;
11700   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
11701     __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
11702     if (likely(__pyx_t_6)) {
11703       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
11704       __Pyx_INCREF(__pyx_t_6);
11705       __Pyx_INCREF(function);
11706       __Pyx_DECREF_SET(__pyx_t_3, function);
11707     }
11708   }
11709   __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
11710   __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11711   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11712   if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 767, __pyx_L1_error)
11713   __Pyx_GOTREF(__pyx_t_2);
11714   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11715   __pyx_r = __pyx_t_2;
11716   __pyx_t_2 = 0;
11717   goto __pyx_L0;
11718 
11719   /* "fastavro/_read.pyx":764
11720  *
11721  *
11722  * cpdef xz_read_block(fo):             # <<<<<<<<<<<<<<
11723  *     length = read_long(fo)
11724  *     data = fo.read(length)
11725  */
11726 
11727   /* function exit code */
11728   __pyx_L1_error:;
11729   __Pyx_XDECREF(__pyx_t_2);
11730   __Pyx_XDECREF(__pyx_t_3);
11731   __Pyx_XDECREF(__pyx_t_4);
11732   __Pyx_XDECREF(__pyx_t_5);
11733   __Pyx_XDECREF(__pyx_t_6);
11734   __Pyx_AddTraceback("fastavro._read.xz_read_block", __pyx_clineno, __pyx_lineno, __pyx_filename);
11735   __pyx_r = 0;
11736   __pyx_L0:;
11737   __Pyx_XDECREF(__pyx_v_data);
11738   __Pyx_XGIVEREF(__pyx_r);
11739   __Pyx_RefNannyFinishContext();
11740   return __pyx_r;
11741 }
11742 
11743 /* Python wrapper */
11744 static PyObject *__pyx_pw_8fastavro_5_read_37xz_read_block(PyObject *__pyx_self, PyObject *__pyx_v_fo); /*proto*/
__pyx_pw_8fastavro_5_read_37xz_read_block(PyObject * __pyx_self,PyObject * __pyx_v_fo)11745 static PyObject *__pyx_pw_8fastavro_5_read_37xz_read_block(PyObject *__pyx_self, PyObject *__pyx_v_fo) {
11746   PyObject *__pyx_r = 0;
11747   __Pyx_RefNannyDeclarations
11748   __Pyx_RefNannySetupContext("xz_read_block (wrapper)", 0);
11749   __pyx_r = __pyx_pf_8fastavro_5_read_36xz_read_block(__pyx_self, ((PyObject *)__pyx_v_fo));
11750 
11751   /* function exit code */
11752   __Pyx_RefNannyFinishContext();
11753   return __pyx_r;
11754 }
11755 
__pyx_pf_8fastavro_5_read_36xz_read_block(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_fo)11756 static PyObject *__pyx_pf_8fastavro_5_read_36xz_read_block(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fo) {
11757   PyObject *__pyx_r = NULL;
11758   __Pyx_RefNannyDeclarations
11759   PyObject *__pyx_t_1 = NULL;
11760   int __pyx_lineno = 0;
11761   const char *__pyx_filename = NULL;
11762   int __pyx_clineno = 0;
11763   __Pyx_RefNannySetupContext("xz_read_block", 0);
11764   __Pyx_XDECREF(__pyx_r);
11765   __pyx_t_1 = __pyx_f_8fastavro_5_read_xz_read_block(__pyx_v_fo, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __pyx_L1_error)
11766   __Pyx_GOTREF(__pyx_t_1);
11767   __pyx_r = __pyx_t_1;
11768   __pyx_t_1 = 0;
11769   goto __pyx_L0;
11770 
11771   /* function exit code */
11772   __pyx_L1_error:;
11773   __Pyx_XDECREF(__pyx_t_1);
11774   __Pyx_AddTraceback("fastavro._read.xz_read_block", __pyx_clineno, __pyx_lineno, __pyx_filename);
11775   __pyx_r = NULL;
11776   __pyx_L0:;
11777   __Pyx_XGIVEREF(__pyx_r);
11778   __Pyx_RefNannyFinishContext();
11779   return __pyx_r;
11780 }
11781 static PyObject *__pyx_gb_8fastavro_5_read_40generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
11782 
11783 /* "fastavro/_read.pyx":783
11784  *
11785  *
11786  * def _iter_avro_records(             # <<<<<<<<<<<<<<
11787  *     fo,
11788  *     header,
11789  */
11790 
11791 /* Python wrapper */
11792 static PyObject *__pyx_pw_8fastavro_5_read_39_iter_avro_records(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
11793 static PyMethodDef __pyx_mdef_8fastavro_5_read_39_iter_avro_records = {"_iter_avro_records", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8fastavro_5_read_39_iter_avro_records, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_8fastavro_5_read_39_iter_avro_records(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)11794 static PyObject *__pyx_pw_8fastavro_5_read_39_iter_avro_records(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11795   PyObject *__pyx_v_fo = 0;
11796   PyObject *__pyx_v_header = 0;
11797   PyObject *__pyx_v_codec = 0;
11798   PyObject *__pyx_v_writer_schema = 0;
11799   PyObject *__pyx_v_named_schemas = 0;
11800   PyObject *__pyx_v_reader_schema = 0;
11801   PyObject *__pyx_v_return_record_name = 0;
11802   int __pyx_lineno = 0;
11803   const char *__pyx_filename = NULL;
11804   int __pyx_clineno = 0;
11805   PyObject *__pyx_r = 0;
11806   __Pyx_RefNannyDeclarations
11807   __Pyx_RefNannySetupContext("_iter_avro_records (wrapper)", 0);
11808   {
11809     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fo,&__pyx_n_s_header,&__pyx_n_s_codec,&__pyx_n_s_writer_schema,&__pyx_n_s_named_schemas,&__pyx_n_s_reader_schema,&__pyx_n_s_return_record_name,0};
11810     PyObject* values[7] = {0,0,0,0,0,0,0};
11811 
11812     /* "fastavro/_read.pyx":790
11813  *     named_schemas,
11814  *     reader_schema,
11815  *     return_record_name=False,             # <<<<<<<<<<<<<<
11816  * ):
11817  *     cdef int32 i
11818  */
11819     values[6] = ((PyObject *)Py_False);
11820     if (unlikely(__pyx_kwds)) {
11821       Py_ssize_t kw_args;
11822       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
11823       switch (pos_args) {
11824         case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
11825         CYTHON_FALLTHROUGH;
11826         case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
11827         CYTHON_FALLTHROUGH;
11828         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
11829         CYTHON_FALLTHROUGH;
11830         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
11831         CYTHON_FALLTHROUGH;
11832         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11833         CYTHON_FALLTHROUGH;
11834         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11835         CYTHON_FALLTHROUGH;
11836         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11837         CYTHON_FALLTHROUGH;
11838         case  0: break;
11839         default: goto __pyx_L5_argtuple_error;
11840       }
11841       kw_args = PyDict_Size(__pyx_kwds);
11842       switch (pos_args) {
11843         case  0:
11844         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fo)) != 0)) kw_args--;
11845         else goto __pyx_L5_argtuple_error;
11846         CYTHON_FALLTHROUGH;
11847         case  1:
11848         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_header)) != 0)) kw_args--;
11849         else {
11850           __Pyx_RaiseArgtupleInvalid("_iter_avro_records", 0, 6, 7, 1); __PYX_ERR(0, 783, __pyx_L3_error)
11851         }
11852         CYTHON_FALLTHROUGH;
11853         case  2:
11854         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_codec)) != 0)) kw_args--;
11855         else {
11856           __Pyx_RaiseArgtupleInvalid("_iter_avro_records", 0, 6, 7, 2); __PYX_ERR(0, 783, __pyx_L3_error)
11857         }
11858         CYTHON_FALLTHROUGH;
11859         case  3:
11860         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_writer_schema)) != 0)) kw_args--;
11861         else {
11862           __Pyx_RaiseArgtupleInvalid("_iter_avro_records", 0, 6, 7, 3); __PYX_ERR(0, 783, __pyx_L3_error)
11863         }
11864         CYTHON_FALLTHROUGH;
11865         case  4:
11866         if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_named_schemas)) != 0)) kw_args--;
11867         else {
11868           __Pyx_RaiseArgtupleInvalid("_iter_avro_records", 0, 6, 7, 4); __PYX_ERR(0, 783, __pyx_L3_error)
11869         }
11870         CYTHON_FALLTHROUGH;
11871         case  5:
11872         if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_reader_schema)) != 0)) kw_args--;
11873         else {
11874           __Pyx_RaiseArgtupleInvalid("_iter_avro_records", 0, 6, 7, 5); __PYX_ERR(0, 783, __pyx_L3_error)
11875         }
11876         CYTHON_FALLTHROUGH;
11877         case  6:
11878         if (kw_args > 0) {
11879           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_return_record_name);
11880           if (value) { values[6] = value; kw_args--; }
11881         }
11882       }
11883       if (unlikely(kw_args > 0)) {
11884         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_iter_avro_records") < 0)) __PYX_ERR(0, 783, __pyx_L3_error)
11885       }
11886     } else {
11887       switch (PyTuple_GET_SIZE(__pyx_args)) {
11888         case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
11889         CYTHON_FALLTHROUGH;
11890         case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
11891         values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
11892         values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
11893         values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11894         values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11895         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11896         break;
11897         default: goto __pyx_L5_argtuple_error;
11898       }
11899     }
11900     __pyx_v_fo = values[0];
11901     __pyx_v_header = values[1];
11902     __pyx_v_codec = values[2];
11903     __pyx_v_writer_schema = values[3];
11904     __pyx_v_named_schemas = values[4];
11905     __pyx_v_reader_schema = values[5];
11906     __pyx_v_return_record_name = values[6];
11907   }
11908   goto __pyx_L4_argument_unpacking_done;
11909   __pyx_L5_argtuple_error:;
11910   __Pyx_RaiseArgtupleInvalid("_iter_avro_records", 0, 6, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 783, __pyx_L3_error)
11911   __pyx_L3_error:;
11912   __Pyx_AddTraceback("fastavro._read._iter_avro_records", __pyx_clineno, __pyx_lineno, __pyx_filename);
11913   __Pyx_RefNannyFinishContext();
11914   return NULL;
11915   __pyx_L4_argument_unpacking_done:;
11916   __pyx_r = __pyx_pf_8fastavro_5_read_38_iter_avro_records(__pyx_self, __pyx_v_fo, __pyx_v_header, __pyx_v_codec, __pyx_v_writer_schema, __pyx_v_named_schemas, __pyx_v_reader_schema, __pyx_v_return_record_name);
11917 
11918   /* "fastavro/_read.pyx":783
11919  *
11920  *
11921  * def _iter_avro_records(             # <<<<<<<<<<<<<<
11922  *     fo,
11923  *     header,
11924  */
11925 
11926   /* function exit code */
11927   __Pyx_RefNannyFinishContext();
11928   return __pyx_r;
11929 }
11930 
__pyx_pf_8fastavro_5_read_38_iter_avro_records(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_fo,PyObject * __pyx_v_header,PyObject * __pyx_v_codec,PyObject * __pyx_v_writer_schema,PyObject * __pyx_v_named_schemas,PyObject * __pyx_v_reader_schema,PyObject * __pyx_v_return_record_name)11931 static PyObject *__pyx_pf_8fastavro_5_read_38_iter_avro_records(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fo, PyObject *__pyx_v_header, PyObject *__pyx_v_codec, PyObject *__pyx_v_writer_schema, PyObject *__pyx_v_named_schemas, PyObject *__pyx_v_reader_schema, PyObject *__pyx_v_return_record_name) {
11932   struct __pyx_obj_8fastavro_5_read___pyx_scope_struct___iter_avro_records *__pyx_cur_scope;
11933   PyObject *__pyx_r = NULL;
11934   __Pyx_RefNannyDeclarations
11935   int __pyx_lineno = 0;
11936   const char *__pyx_filename = NULL;
11937   int __pyx_clineno = 0;
11938   __Pyx_RefNannySetupContext("_iter_avro_records", 0);
11939   __pyx_cur_scope = (struct __pyx_obj_8fastavro_5_read___pyx_scope_struct___iter_avro_records *)__pyx_tp_new_8fastavro_5_read___pyx_scope_struct___iter_avro_records(__pyx_ptype_8fastavro_5_read___pyx_scope_struct___iter_avro_records, __pyx_empty_tuple, NULL);
11940   if (unlikely(!__pyx_cur_scope)) {
11941     __pyx_cur_scope = ((struct __pyx_obj_8fastavro_5_read___pyx_scope_struct___iter_avro_records *)Py_None);
11942     __Pyx_INCREF(Py_None);
11943     __PYX_ERR(0, 783, __pyx_L1_error)
11944   } else {
11945     __Pyx_GOTREF(__pyx_cur_scope);
11946   }
11947   __pyx_cur_scope->__pyx_v_fo = __pyx_v_fo;
11948   __Pyx_INCREF(__pyx_cur_scope->__pyx_v_fo);
11949   __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_fo);
11950   __pyx_cur_scope->__pyx_v_header = __pyx_v_header;
11951   __Pyx_INCREF(__pyx_cur_scope->__pyx_v_header);
11952   __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_header);
11953   __pyx_cur_scope->__pyx_v_codec = __pyx_v_codec;
11954   __Pyx_INCREF(__pyx_cur_scope->__pyx_v_codec);
11955   __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_codec);
11956   __pyx_cur_scope->__pyx_v_writer_schema = __pyx_v_writer_schema;
11957   __Pyx_INCREF(__pyx_cur_scope->__pyx_v_writer_schema);
11958   __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_writer_schema);
11959   __pyx_cur_scope->__pyx_v_named_schemas = __pyx_v_named_schemas;
11960   __Pyx_INCREF(__pyx_cur_scope->__pyx_v_named_schemas);
11961   __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_named_schemas);
11962   __pyx_cur_scope->__pyx_v_reader_schema = __pyx_v_reader_schema;
11963   __Pyx_INCREF(__pyx_cur_scope->__pyx_v_reader_schema);
11964   __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_reader_schema);
11965   __pyx_cur_scope->__pyx_v_return_record_name = __pyx_v_return_record_name;
11966   __Pyx_INCREF(__pyx_cur_scope->__pyx_v_return_record_name);
11967   __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_return_record_name);
11968   {
11969     __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_8fastavro_5_read_40generator, __pyx_codeobj__3, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter_avro_records, __pyx_n_s_iter_avro_records, __pyx_n_s_fastavro__read); if (unlikely(!gen)) __PYX_ERR(0, 783, __pyx_L1_error)
11970     __Pyx_DECREF(__pyx_cur_scope);
11971     __Pyx_RefNannyFinishContext();
11972     return (PyObject *) gen;
11973   }
11974 
11975   /* function exit code */
11976   __pyx_L1_error:;
11977   __Pyx_AddTraceback("fastavro._read._iter_avro_records", __pyx_clineno, __pyx_lineno, __pyx_filename);
11978   __pyx_r = NULL;
11979   __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
11980   __Pyx_XGIVEREF(__pyx_r);
11981   __Pyx_RefNannyFinishContext();
11982   return __pyx_r;
11983 }
11984 
__pyx_gb_8fastavro_5_read_40generator(__pyx_CoroutineObject * __pyx_generator,CYTHON_UNUSED PyThreadState * __pyx_tstate,PyObject * __pyx_sent_value)11985 static PyObject *__pyx_gb_8fastavro_5_read_40generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
11986 {
11987   struct __pyx_obj_8fastavro_5_read___pyx_scope_struct___iter_avro_records *__pyx_cur_scope = ((struct __pyx_obj_8fastavro_5_read___pyx_scope_struct___iter_avro_records *)__pyx_generator->closure);
11988   PyObject *__pyx_r = NULL;
11989   PyObject *__pyx_t_1 = NULL;
11990   PyObject *__pyx_t_2 = NULL;
11991   PyObject *__pyx_t_3 = NULL;
11992   int __pyx_t_4;
11993   int __pyx_t_5;
11994   __pyx_t_8fastavro_5_read_long64 __pyx_t_6;
11995   __pyx_t_8fastavro_5_read_long64 __pyx_t_7;
11996   __pyx_t_8fastavro_5_read_int32 __pyx_t_8;
11997   struct __pyx_opt_args_8fastavro_5_read__read_data __pyx_t_9;
11998   int __pyx_lineno = 0;
11999   const char *__pyx_filename = NULL;
12000   int __pyx_clineno = 0;
12001   __Pyx_RefNannyDeclarations
12002   __Pyx_RefNannySetupContext("_iter_avro_records", 0);
12003   switch (__pyx_generator->resume_label) {
12004     case 0: goto __pyx_L3_first_run;
12005     case 1: goto __pyx_L9_resume_from_yield;
12006     default: /* CPython raises the right error here */
12007     __Pyx_RefNannyFinishContext();
12008     return NULL;
12009   }
12010   __pyx_L3_first_run:;
12011   if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 783, __pyx_L1_error)
12012 
12013   /* "fastavro/_read.pyx":794
12014  *     cdef int32 i
12015  *
12016  *     sync_marker = header['sync']             # <<<<<<<<<<<<<<
12017  *
12018  *     read_block = BLOCK_READERS.get(codec)
12019  */
12020   __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_cur_scope->__pyx_v_header, __pyx_n_s_sync); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 794, __pyx_L1_error)
12021   __Pyx_GOTREF(__pyx_t_1);
12022   __Pyx_GIVEREF(__pyx_t_1);
12023   __pyx_cur_scope->__pyx_v_sync_marker = __pyx_t_1;
12024   __pyx_t_1 = 0;
12025 
12026   /* "fastavro/_read.pyx":796
12027  *     sync_marker = header['sync']
12028  *
12029  *     read_block = BLOCK_READERS.get(codec)             # <<<<<<<<<<<<<<
12030  *     if not read_block:
12031  *         raise ValueError('Unrecognized codec: %r' % codec)
12032  */
12033   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_BLOCK_READERS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 796, __pyx_L1_error)
12034   __Pyx_GOTREF(__pyx_t_2);
12035   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 796, __pyx_L1_error)
12036   __Pyx_GOTREF(__pyx_t_3);
12037   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12038   __pyx_t_2 = NULL;
12039   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
12040     __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
12041     if (likely(__pyx_t_2)) {
12042       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
12043       __Pyx_INCREF(__pyx_t_2);
12044       __Pyx_INCREF(function);
12045       __Pyx_DECREF_SET(__pyx_t_3, function);
12046     }
12047   }
12048   __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_cur_scope->__pyx_v_codec) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_cur_scope->__pyx_v_codec);
12049   __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12050   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 796, __pyx_L1_error)
12051   __Pyx_GOTREF(__pyx_t_1);
12052   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12053   __Pyx_GIVEREF(__pyx_t_1);
12054   __pyx_cur_scope->__pyx_v_read_block = __pyx_t_1;
12055   __pyx_t_1 = 0;
12056 
12057   /* "fastavro/_read.pyx":797
12058  *
12059  *     read_block = BLOCK_READERS.get(codec)
12060  *     if not read_block:             # <<<<<<<<<<<<<<
12061  *         raise ValueError('Unrecognized codec: %r' % codec)
12062  *
12063  */
12064   __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_read_block); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 797, __pyx_L1_error)
12065   __pyx_t_5 = ((!__pyx_t_4) != 0);
12066   if (unlikely(__pyx_t_5)) {
12067 
12068     /* "fastavro/_read.pyx":798
12069  *     read_block = BLOCK_READERS.get(codec)
12070  *     if not read_block:
12071  *         raise ValueError('Unrecognized codec: %r' % codec)             # <<<<<<<<<<<<<<
12072  *
12073  *     block_count = 0
12074  */
12075     __pyx_t_1 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Unrecognized_codec_r, __pyx_cur_scope->__pyx_v_codec); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 798, __pyx_L1_error)
12076     __Pyx_GOTREF(__pyx_t_1);
12077     __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 798, __pyx_L1_error)
12078     __Pyx_GOTREF(__pyx_t_3);
12079     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12080     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
12081     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12082     __PYX_ERR(0, 798, __pyx_L1_error)
12083 
12084     /* "fastavro/_read.pyx":797
12085  *
12086  *     read_block = BLOCK_READERS.get(codec)
12087  *     if not read_block:             # <<<<<<<<<<<<<<
12088  *         raise ValueError('Unrecognized codec: %r' % codec)
12089  *
12090  */
12091   }
12092 
12093   /* "fastavro/_read.pyx":800
12094  *         raise ValueError('Unrecognized codec: %r' % codec)
12095  *
12096  *     block_count = 0             # <<<<<<<<<<<<<<
12097  *     while True:
12098  *         block_count = read_long(fo)
12099  */
12100   __pyx_cur_scope->__pyx_v_block_count = 0;
12101 
12102   /* "fastavro/_read.pyx":801
12103  *
12104  *     block_count = 0
12105  *     while True:             # <<<<<<<<<<<<<<
12106  *         block_count = read_long(fo)
12107  *         block_fo = read_block(fo)
12108  */
12109   while (1) {
12110 
12111     /* "fastavro/_read.pyx":802
12112  *     block_count = 0
12113  *     while True:
12114  *         block_count = read_long(fo)             # <<<<<<<<<<<<<<
12115  *         block_fo = read_block(fo)
12116  *
12117  */
12118     __pyx_t_6 = __pyx_f_8fastavro_5_read_read_long(__pyx_cur_scope->__pyx_v_fo); if (unlikely(__pyx_t_6 == ((__pyx_t_8fastavro_5_read_long64)-1LL) && PyErr_Occurred())) __PYX_ERR(0, 802, __pyx_L1_error)
12119     __pyx_cur_scope->__pyx_v_block_count = __pyx_t_6;
12120 
12121     /* "fastavro/_read.pyx":803
12122  *     while True:
12123  *         block_count = read_long(fo)
12124  *         block_fo = read_block(fo)             # <<<<<<<<<<<<<<
12125  *
12126  *         for i in range(block_count):
12127  */
12128     __Pyx_INCREF(__pyx_cur_scope->__pyx_v_read_block);
12129     __pyx_t_1 = __pyx_cur_scope->__pyx_v_read_block; __pyx_t_2 = NULL;
12130     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
12131       __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
12132       if (likely(__pyx_t_2)) {
12133         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
12134         __Pyx_INCREF(__pyx_t_2);
12135         __Pyx_INCREF(function);
12136         __Pyx_DECREF_SET(__pyx_t_1, function);
12137       }
12138     }
12139     __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_cur_scope->__pyx_v_fo) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_cur_scope->__pyx_v_fo);
12140     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12141     if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 803, __pyx_L1_error)
12142     __Pyx_GOTREF(__pyx_t_3);
12143     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12144     __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_block_fo);
12145     __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_block_fo, __pyx_t_3);
12146     __Pyx_GIVEREF(__pyx_t_3);
12147     __pyx_t_3 = 0;
12148 
12149     /* "fastavro/_read.pyx":805
12150  *         block_fo = read_block(fo)
12151  *
12152  *         for i in range(block_count):             # <<<<<<<<<<<<<<
12153  *             yield _read_data(
12154  *                 block_fo,
12155  */
12156     __pyx_t_6 = __pyx_cur_scope->__pyx_v_block_count;
12157     __pyx_t_7 = __pyx_t_6;
12158     for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
12159       __pyx_cur_scope->__pyx_v_i = __pyx_t_8;
12160 
12161       /* "fastavro/_read.pyx":806
12162  *
12163  *         for i in range(block_count):
12164  *             yield _read_data(             # <<<<<<<<<<<<<<
12165  *                 block_fo,
12166  *                 writer_schema,
12167  */
12168       __pyx_t_9.__pyx_n = 2;
12169       __pyx_t_9.reader_schema = __pyx_cur_scope->__pyx_v_reader_schema;
12170       __pyx_t_9.return_record_name = __pyx_cur_scope->__pyx_v_return_record_name;
12171       __pyx_t_3 = __pyx_f_8fastavro_5_read__read_data(__pyx_cur_scope->__pyx_v_block_fo, __pyx_cur_scope->__pyx_v_writer_schema, __pyx_cur_scope->__pyx_v_named_schemas, 0, &__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 806, __pyx_L1_error)
12172       __Pyx_GOTREF(__pyx_t_3);
12173       __pyx_r = __pyx_t_3;
12174       __pyx_t_3 = 0;
12175       __pyx_cur_scope->__pyx_t_0 = __pyx_t_6;
12176       __pyx_cur_scope->__pyx_t_1 = __pyx_t_7;
12177       __pyx_cur_scope->__pyx_t_2 = __pyx_t_8;
12178       __Pyx_XGIVEREF(__pyx_r);
12179       __Pyx_RefNannyFinishContext();
12180       __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
12181       /* return from generator, yielding value */
12182       __pyx_generator->resume_label = 1;
12183       return __pyx_r;
12184       __pyx_L9_resume_from_yield:;
12185       __pyx_t_6 = __pyx_cur_scope->__pyx_t_0;
12186       __pyx_t_7 = __pyx_cur_scope->__pyx_t_1;
12187       __pyx_t_8 = __pyx_cur_scope->__pyx_t_2;
12188       if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 806, __pyx_L1_error)
12189     }
12190 
12191     /* "fastavro/_read.pyx":814
12192  *             )
12193  *
12194  *         skip_sync(fo, sync_marker)             # <<<<<<<<<<<<<<
12195  *
12196  *
12197  */
12198     __pyx_t_3 = __pyx_f_8fastavro_5_read_skip_sync(__pyx_cur_scope->__pyx_v_fo, __pyx_cur_scope->__pyx_v_sync_marker, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 814, __pyx_L1_error)
12199     __Pyx_GOTREF(__pyx_t_3);
12200     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12201   }
12202   CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
12203 
12204   /* "fastavro/_read.pyx":783
12205  *
12206  *
12207  * def _iter_avro_records(             # <<<<<<<<<<<<<<
12208  *     fo,
12209  *     header,
12210  */
12211 
12212   /* function exit code */
12213   PyErr_SetNone(PyExc_StopIteration);
12214   goto __pyx_L0;
12215   __pyx_L1_error:;
12216   __Pyx_XDECREF(__pyx_t_1);
12217   __Pyx_XDECREF(__pyx_t_2);
12218   __Pyx_XDECREF(__pyx_t_3);
12219   __Pyx_AddTraceback("_iter_avro_records", __pyx_clineno, __pyx_lineno, __pyx_filename);
12220   __pyx_L0:;
12221   __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
12222   #if !CYTHON_USE_EXC_INFO_STACK
12223   __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
12224   #endif
12225   __pyx_generator->resume_label = -1;
12226   __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
12227   __Pyx_RefNannyFinishContext();
12228   return __pyx_r;
12229 }
12230 static PyObject *__pyx_gb_8fastavro_5_read_43generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
12231 
12232 /* "fastavro/_read.pyx":817
12233  *
12234  *
12235  * def _iter_avro_blocks(             # <<<<<<<<<<<<<<
12236  *     fo,
12237  *     header,
12238  */
12239 
12240 /* Python wrapper */
12241 static PyObject *__pyx_pw_8fastavro_5_read_42_iter_avro_blocks(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
12242 static PyMethodDef __pyx_mdef_8fastavro_5_read_42_iter_avro_blocks = {"_iter_avro_blocks", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8fastavro_5_read_42_iter_avro_blocks, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_8fastavro_5_read_42_iter_avro_blocks(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)12243 static PyObject *__pyx_pw_8fastavro_5_read_42_iter_avro_blocks(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
12244   PyObject *__pyx_v_fo = 0;
12245   PyObject *__pyx_v_header = 0;
12246   PyObject *__pyx_v_codec = 0;
12247   PyObject *__pyx_v_writer_schema = 0;
12248   PyObject *__pyx_v_named_schemas = 0;
12249   PyObject *__pyx_v_reader_schema = 0;
12250   PyObject *__pyx_v_return_record_name = 0;
12251   int __pyx_lineno = 0;
12252   const char *__pyx_filename = NULL;
12253   int __pyx_clineno = 0;
12254   PyObject *__pyx_r = 0;
12255   __Pyx_RefNannyDeclarations
12256   __Pyx_RefNannySetupContext("_iter_avro_blocks (wrapper)", 0);
12257   {
12258     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fo,&__pyx_n_s_header,&__pyx_n_s_codec,&__pyx_n_s_writer_schema,&__pyx_n_s_named_schemas,&__pyx_n_s_reader_schema,&__pyx_n_s_return_record_name,0};
12259     PyObject* values[7] = {0,0,0,0,0,0,0};
12260 
12261     /* "fastavro/_read.pyx":824
12262  *     named_schemas,
12263  *     reader_schema,
12264  *     return_record_name=False,             # <<<<<<<<<<<<<<
12265  * ):
12266  *     sync_marker = header['sync']
12267  */
12268     values[6] = ((PyObject *)Py_False);
12269     if (unlikely(__pyx_kwds)) {
12270       Py_ssize_t kw_args;
12271       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
12272       switch (pos_args) {
12273         case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
12274         CYTHON_FALLTHROUGH;
12275         case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
12276         CYTHON_FALLTHROUGH;
12277         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
12278         CYTHON_FALLTHROUGH;
12279         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
12280         CYTHON_FALLTHROUGH;
12281         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
12282         CYTHON_FALLTHROUGH;
12283         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12284         CYTHON_FALLTHROUGH;
12285         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12286         CYTHON_FALLTHROUGH;
12287         case  0: break;
12288         default: goto __pyx_L5_argtuple_error;
12289       }
12290       kw_args = PyDict_Size(__pyx_kwds);
12291       switch (pos_args) {
12292         case  0:
12293         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fo)) != 0)) kw_args--;
12294         else goto __pyx_L5_argtuple_error;
12295         CYTHON_FALLTHROUGH;
12296         case  1:
12297         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_header)) != 0)) kw_args--;
12298         else {
12299           __Pyx_RaiseArgtupleInvalid("_iter_avro_blocks", 0, 6, 7, 1); __PYX_ERR(0, 817, __pyx_L3_error)
12300         }
12301         CYTHON_FALLTHROUGH;
12302         case  2:
12303         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_codec)) != 0)) kw_args--;
12304         else {
12305           __Pyx_RaiseArgtupleInvalid("_iter_avro_blocks", 0, 6, 7, 2); __PYX_ERR(0, 817, __pyx_L3_error)
12306         }
12307         CYTHON_FALLTHROUGH;
12308         case  3:
12309         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_writer_schema)) != 0)) kw_args--;
12310         else {
12311           __Pyx_RaiseArgtupleInvalid("_iter_avro_blocks", 0, 6, 7, 3); __PYX_ERR(0, 817, __pyx_L3_error)
12312         }
12313         CYTHON_FALLTHROUGH;
12314         case  4:
12315         if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_named_schemas)) != 0)) kw_args--;
12316         else {
12317           __Pyx_RaiseArgtupleInvalid("_iter_avro_blocks", 0, 6, 7, 4); __PYX_ERR(0, 817, __pyx_L3_error)
12318         }
12319         CYTHON_FALLTHROUGH;
12320         case  5:
12321         if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_reader_schema)) != 0)) kw_args--;
12322         else {
12323           __Pyx_RaiseArgtupleInvalid("_iter_avro_blocks", 0, 6, 7, 5); __PYX_ERR(0, 817, __pyx_L3_error)
12324         }
12325         CYTHON_FALLTHROUGH;
12326         case  6:
12327         if (kw_args > 0) {
12328           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_return_record_name);
12329           if (value) { values[6] = value; kw_args--; }
12330         }
12331       }
12332       if (unlikely(kw_args > 0)) {
12333         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_iter_avro_blocks") < 0)) __PYX_ERR(0, 817, __pyx_L3_error)
12334       }
12335     } else {
12336       switch (PyTuple_GET_SIZE(__pyx_args)) {
12337         case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
12338         CYTHON_FALLTHROUGH;
12339         case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
12340         values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
12341         values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
12342         values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
12343         values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12344         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12345         break;
12346         default: goto __pyx_L5_argtuple_error;
12347       }
12348     }
12349     __pyx_v_fo = values[0];
12350     __pyx_v_header = values[1];
12351     __pyx_v_codec = values[2];
12352     __pyx_v_writer_schema = values[3];
12353     __pyx_v_named_schemas = values[4];
12354     __pyx_v_reader_schema = values[5];
12355     __pyx_v_return_record_name = values[6];
12356   }
12357   goto __pyx_L4_argument_unpacking_done;
12358   __pyx_L5_argtuple_error:;
12359   __Pyx_RaiseArgtupleInvalid("_iter_avro_blocks", 0, 6, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 817, __pyx_L3_error)
12360   __pyx_L3_error:;
12361   __Pyx_AddTraceback("fastavro._read._iter_avro_blocks", __pyx_clineno, __pyx_lineno, __pyx_filename);
12362   __Pyx_RefNannyFinishContext();
12363   return NULL;
12364   __pyx_L4_argument_unpacking_done:;
12365   __pyx_r = __pyx_pf_8fastavro_5_read_41_iter_avro_blocks(__pyx_self, __pyx_v_fo, __pyx_v_header, __pyx_v_codec, __pyx_v_writer_schema, __pyx_v_named_schemas, __pyx_v_reader_schema, __pyx_v_return_record_name);
12366 
12367   /* "fastavro/_read.pyx":817
12368  *
12369  *
12370  * def _iter_avro_blocks(             # <<<<<<<<<<<<<<
12371  *     fo,
12372  *     header,
12373  */
12374 
12375   /* function exit code */
12376   __Pyx_RefNannyFinishContext();
12377   return __pyx_r;
12378 }
12379 
__pyx_pf_8fastavro_5_read_41_iter_avro_blocks(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_fo,PyObject * __pyx_v_header,PyObject * __pyx_v_codec,PyObject * __pyx_v_writer_schema,PyObject * __pyx_v_named_schemas,PyObject * __pyx_v_reader_schema,PyObject * __pyx_v_return_record_name)12380 static PyObject *__pyx_pf_8fastavro_5_read_41_iter_avro_blocks(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fo, PyObject *__pyx_v_header, PyObject *__pyx_v_codec, PyObject *__pyx_v_writer_schema, PyObject *__pyx_v_named_schemas, PyObject *__pyx_v_reader_schema, PyObject *__pyx_v_return_record_name) {
12381   struct __pyx_obj_8fastavro_5_read___pyx_scope_struct_1__iter_avro_blocks *__pyx_cur_scope;
12382   PyObject *__pyx_r = NULL;
12383   __Pyx_RefNannyDeclarations
12384   int __pyx_lineno = 0;
12385   const char *__pyx_filename = NULL;
12386   int __pyx_clineno = 0;
12387   __Pyx_RefNannySetupContext("_iter_avro_blocks", 0);
12388   __pyx_cur_scope = (struct __pyx_obj_8fastavro_5_read___pyx_scope_struct_1__iter_avro_blocks *)__pyx_tp_new_8fastavro_5_read___pyx_scope_struct_1__iter_avro_blocks(__pyx_ptype_8fastavro_5_read___pyx_scope_struct_1__iter_avro_blocks, __pyx_empty_tuple, NULL);
12389   if (unlikely(!__pyx_cur_scope)) {
12390     __pyx_cur_scope = ((struct __pyx_obj_8fastavro_5_read___pyx_scope_struct_1__iter_avro_blocks *)Py_None);
12391     __Pyx_INCREF(Py_None);
12392     __PYX_ERR(0, 817, __pyx_L1_error)
12393   } else {
12394     __Pyx_GOTREF(__pyx_cur_scope);
12395   }
12396   __pyx_cur_scope->__pyx_v_fo = __pyx_v_fo;
12397   __Pyx_INCREF(__pyx_cur_scope->__pyx_v_fo);
12398   __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_fo);
12399   __pyx_cur_scope->__pyx_v_header = __pyx_v_header;
12400   __Pyx_INCREF(__pyx_cur_scope->__pyx_v_header);
12401   __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_header);
12402   __pyx_cur_scope->__pyx_v_codec = __pyx_v_codec;
12403   __Pyx_INCREF(__pyx_cur_scope->__pyx_v_codec);
12404   __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_codec);
12405   __pyx_cur_scope->__pyx_v_writer_schema = __pyx_v_writer_schema;
12406   __Pyx_INCREF(__pyx_cur_scope->__pyx_v_writer_schema);
12407   __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_writer_schema);
12408   __pyx_cur_scope->__pyx_v_named_schemas = __pyx_v_named_schemas;
12409   __Pyx_INCREF(__pyx_cur_scope->__pyx_v_named_schemas);
12410   __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_named_schemas);
12411   __pyx_cur_scope->__pyx_v_reader_schema = __pyx_v_reader_schema;
12412   __Pyx_INCREF(__pyx_cur_scope->__pyx_v_reader_schema);
12413   __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_reader_schema);
12414   __pyx_cur_scope->__pyx_v_return_record_name = __pyx_v_return_record_name;
12415   __Pyx_INCREF(__pyx_cur_scope->__pyx_v_return_record_name);
12416   __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_return_record_name);
12417   {
12418     __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_8fastavro_5_read_43generator1, __pyx_codeobj__4, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter_avro_blocks, __pyx_n_s_iter_avro_blocks, __pyx_n_s_fastavro__read); if (unlikely(!gen)) __PYX_ERR(0, 817, __pyx_L1_error)
12419     __Pyx_DECREF(__pyx_cur_scope);
12420     __Pyx_RefNannyFinishContext();
12421     return (PyObject *) gen;
12422   }
12423 
12424   /* function exit code */
12425   __pyx_L1_error:;
12426   __Pyx_AddTraceback("fastavro._read._iter_avro_blocks", __pyx_clineno, __pyx_lineno, __pyx_filename);
12427   __pyx_r = NULL;
12428   __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
12429   __Pyx_XGIVEREF(__pyx_r);
12430   __Pyx_RefNannyFinishContext();
12431   return __pyx_r;
12432 }
12433 
__pyx_gb_8fastavro_5_read_43generator1(__pyx_CoroutineObject * __pyx_generator,CYTHON_UNUSED PyThreadState * __pyx_tstate,PyObject * __pyx_sent_value)12434 static PyObject *__pyx_gb_8fastavro_5_read_43generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
12435 {
12436   struct __pyx_obj_8fastavro_5_read___pyx_scope_struct_1__iter_avro_blocks *__pyx_cur_scope = ((struct __pyx_obj_8fastavro_5_read___pyx_scope_struct_1__iter_avro_blocks *)__pyx_generator->closure);
12437   PyObject *__pyx_r = NULL;
12438   PyObject *__pyx_t_1 = NULL;
12439   PyObject *__pyx_t_2 = NULL;
12440   PyObject *__pyx_t_3 = NULL;
12441   int __pyx_t_4;
12442   int __pyx_t_5;
12443   PyObject *__pyx_t_6 = NULL;
12444   PyObject *__pyx_t_7 = NULL;
12445   PyObject *__pyx_t_8 = NULL;
12446   __pyx_t_8fastavro_5_read_long64 __pyx_t_9;
12447   int __pyx_t_10;
12448   PyObject *__pyx_t_11 = NULL;
12449   PyObject *__pyx_t_12 = NULL;
12450   int __pyx_lineno = 0;
12451   const char *__pyx_filename = NULL;
12452   int __pyx_clineno = 0;
12453   __Pyx_RefNannyDeclarations
12454   __Pyx_RefNannySetupContext("_iter_avro_blocks", 0);
12455   switch (__pyx_generator->resume_label) {
12456     case 0: goto __pyx_L3_first_run;
12457     case 1: goto __pyx_L17_resume_from_yield;
12458     default: /* CPython raises the right error here */
12459     __Pyx_RefNannyFinishContext();
12460     return NULL;
12461   }
12462   __pyx_L3_first_run:;
12463   if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 817, __pyx_L1_error)
12464 
12465   /* "fastavro/_read.pyx":826
12466  *     return_record_name=False,
12467  * ):
12468  *     sync_marker = header['sync']             # <<<<<<<<<<<<<<
12469  *
12470  *     read_block = BLOCK_READERS.get(codec)
12471  */
12472   __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_cur_scope->__pyx_v_header, __pyx_n_s_sync); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 826, __pyx_L1_error)
12473   __Pyx_GOTREF(__pyx_t_1);
12474   __Pyx_GIVEREF(__pyx_t_1);
12475   __pyx_cur_scope->__pyx_v_sync_marker = __pyx_t_1;
12476   __pyx_t_1 = 0;
12477 
12478   /* "fastavro/_read.pyx":828
12479  *     sync_marker = header['sync']
12480  *
12481  *     read_block = BLOCK_READERS.get(codec)             # <<<<<<<<<<<<<<
12482  *     if not read_block:
12483  *         raise ValueError('Unrecognized codec: %r' % codec)
12484  */
12485   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_BLOCK_READERS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 828, __pyx_L1_error)
12486   __Pyx_GOTREF(__pyx_t_2);
12487   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 828, __pyx_L1_error)
12488   __Pyx_GOTREF(__pyx_t_3);
12489   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12490   __pyx_t_2 = NULL;
12491   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
12492     __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
12493     if (likely(__pyx_t_2)) {
12494       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
12495       __Pyx_INCREF(__pyx_t_2);
12496       __Pyx_INCREF(function);
12497       __Pyx_DECREF_SET(__pyx_t_3, function);
12498     }
12499   }
12500   __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_cur_scope->__pyx_v_codec) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_cur_scope->__pyx_v_codec);
12501   __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12502   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 828, __pyx_L1_error)
12503   __Pyx_GOTREF(__pyx_t_1);
12504   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12505   __Pyx_GIVEREF(__pyx_t_1);
12506   __pyx_cur_scope->__pyx_v_read_block = __pyx_t_1;
12507   __pyx_t_1 = 0;
12508 
12509   /* "fastavro/_read.pyx":829
12510  *
12511  *     read_block = BLOCK_READERS.get(codec)
12512  *     if not read_block:             # <<<<<<<<<<<<<<
12513  *         raise ValueError('Unrecognized codec: %r' % codec)
12514  *
12515  */
12516   __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_read_block); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 829, __pyx_L1_error)
12517   __pyx_t_5 = ((!__pyx_t_4) != 0);
12518   if (unlikely(__pyx_t_5)) {
12519 
12520     /* "fastavro/_read.pyx":830
12521  *     read_block = BLOCK_READERS.get(codec)
12522  *     if not read_block:
12523  *         raise ValueError('Unrecognized codec: %r' % codec)             # <<<<<<<<<<<<<<
12524  *
12525  *     while True:
12526  */
12527     __pyx_t_1 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Unrecognized_codec_r, __pyx_cur_scope->__pyx_v_codec); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 830, __pyx_L1_error)
12528     __Pyx_GOTREF(__pyx_t_1);
12529     __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 830, __pyx_L1_error)
12530     __Pyx_GOTREF(__pyx_t_3);
12531     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12532     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
12533     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12534     __PYX_ERR(0, 830, __pyx_L1_error)
12535 
12536     /* "fastavro/_read.pyx":829
12537  *
12538  *     read_block = BLOCK_READERS.get(codec)
12539  *     if not read_block:             # <<<<<<<<<<<<<<
12540  *         raise ValueError('Unrecognized codec: %r' % codec)
12541  *
12542  */
12543   }
12544 
12545   /* "fastavro/_read.pyx":832
12546  *         raise ValueError('Unrecognized codec: %r' % codec)
12547  *
12548  *     while True:             # <<<<<<<<<<<<<<
12549  *         offset = fo.tell()
12550  *         try:
12551  */
12552   while (1) {
12553 
12554     /* "fastavro/_read.pyx":833
12555  *
12556  *     while True:
12557  *         offset = fo.tell()             # <<<<<<<<<<<<<<
12558  *         try:
12559  *             num_block_records = read_long(fo)
12560  */
12561     __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_fo, __pyx_n_s_tell); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L1_error)
12562     __Pyx_GOTREF(__pyx_t_1);
12563     __pyx_t_2 = NULL;
12564     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
12565       __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
12566       if (likely(__pyx_t_2)) {
12567         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
12568         __Pyx_INCREF(__pyx_t_2);
12569         __Pyx_INCREF(function);
12570         __Pyx_DECREF_SET(__pyx_t_1, function);
12571       }
12572     }
12573     __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
12574     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12575     if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 833, __pyx_L1_error)
12576     __Pyx_GOTREF(__pyx_t_3);
12577     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12578     __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_offset);
12579     __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_offset, __pyx_t_3);
12580     __Pyx_GIVEREF(__pyx_t_3);
12581     __pyx_t_3 = 0;
12582 
12583     /* "fastavro/_read.pyx":834
12584  *     while True:
12585  *         offset = fo.tell()
12586  *         try:             # <<<<<<<<<<<<<<
12587  *             num_block_records = read_long(fo)
12588  *         except StopIteration:
12589  */
12590     {
12591       __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
12592       __Pyx_XGOTREF(__pyx_t_6);
12593       __Pyx_XGOTREF(__pyx_t_7);
12594       __Pyx_XGOTREF(__pyx_t_8);
12595       /*try:*/ {
12596 
12597         /* "fastavro/_read.pyx":835
12598  *         offset = fo.tell()
12599  *         try:
12600  *             num_block_records = read_long(fo)             # <<<<<<<<<<<<<<
12601  *         except StopIteration:
12602  *             return
12603  */
12604         __pyx_t_9 = __pyx_f_8fastavro_5_read_read_long(__pyx_cur_scope->__pyx_v_fo); if (unlikely(__pyx_t_9 == ((__pyx_t_8fastavro_5_read_long64)-1LL) && PyErr_Occurred())) __PYX_ERR(0, 835, __pyx_L7_error)
12605         __pyx_cur_scope->__pyx_v_num_block_records = __pyx_t_9;
12606 
12607         /* "fastavro/_read.pyx":834
12608  *     while True:
12609  *         offset = fo.tell()
12610  *         try:             # <<<<<<<<<<<<<<
12611  *             num_block_records = read_long(fo)
12612  *         except StopIteration:
12613  */
12614       }
12615       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12616       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12617       __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
12618       goto __pyx_L14_try_end;
12619       __pyx_L7_error:;
12620       __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12621       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12622       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12623 
12624       /* "fastavro/_read.pyx":836
12625  *         try:
12626  *             num_block_records = read_long(fo)
12627  *         except StopIteration:             # <<<<<<<<<<<<<<
12628  *             return
12629  *
12630  */
12631       __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_StopIteration);
12632       if (__pyx_t_10) {
12633         __Pyx_AddTraceback("fastavro._read._iter_avro_blocks", __pyx_clineno, __pyx_lineno, __pyx_filename);
12634         if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_2) < 0) __PYX_ERR(0, 836, __pyx_L9_except_error)
12635         __Pyx_GOTREF(__pyx_t_3);
12636         __Pyx_GOTREF(__pyx_t_1);
12637         __Pyx_GOTREF(__pyx_t_2);
12638 
12639         /* "fastavro/_read.pyx":837
12640  *             num_block_records = read_long(fo)
12641  *         except StopIteration:
12642  *             return             # <<<<<<<<<<<<<<
12643  *
12644  *         block_bytes = read_block(fo)
12645  */
12646         __Pyx_XDECREF(__pyx_r);
12647         __pyx_r = NULL;
12648         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12649         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12650         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12651         goto __pyx_L10_except_return;
12652       }
12653       goto __pyx_L9_except_error;
12654       __pyx_L9_except_error:;
12655 
12656       /* "fastavro/_read.pyx":834
12657  *     while True:
12658  *         offset = fo.tell()
12659  *         try:             # <<<<<<<<<<<<<<
12660  *             num_block_records = read_long(fo)
12661  *         except StopIteration:
12662  */
12663       __Pyx_XGIVEREF(__pyx_t_6);
12664       __Pyx_XGIVEREF(__pyx_t_7);
12665       __Pyx_XGIVEREF(__pyx_t_8);
12666       __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
12667       goto __pyx_L1_error;
12668       __pyx_L10_except_return:;
12669       __Pyx_XGIVEREF(__pyx_t_6);
12670       __Pyx_XGIVEREF(__pyx_t_7);
12671       __Pyx_XGIVEREF(__pyx_t_8);
12672       __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
12673       goto __pyx_L0;
12674       __pyx_L14_try_end:;
12675     }
12676 
12677     /* "fastavro/_read.pyx":839
12678  *             return
12679  *
12680  *         block_bytes = read_block(fo)             # <<<<<<<<<<<<<<
12681  *
12682  *         skip_sync(fo, sync_marker)
12683  */
12684     __Pyx_INCREF(__pyx_cur_scope->__pyx_v_read_block);
12685     __pyx_t_1 = __pyx_cur_scope->__pyx_v_read_block; __pyx_t_3 = NULL;
12686     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
12687       __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
12688       if (likely(__pyx_t_3)) {
12689         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
12690         __Pyx_INCREF(__pyx_t_3);
12691         __Pyx_INCREF(function);
12692         __Pyx_DECREF_SET(__pyx_t_1, function);
12693       }
12694     }
12695     __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_cur_scope->__pyx_v_fo) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_cur_scope->__pyx_v_fo);
12696     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12697     if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 839, __pyx_L1_error)
12698     __Pyx_GOTREF(__pyx_t_2);
12699     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12700     __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_block_bytes);
12701     __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_block_bytes, __pyx_t_2);
12702     __Pyx_GIVEREF(__pyx_t_2);
12703     __pyx_t_2 = 0;
12704 
12705     /* "fastavro/_read.pyx":841
12706  *         block_bytes = read_block(fo)
12707  *
12708  *         skip_sync(fo, sync_marker)             # <<<<<<<<<<<<<<
12709  *
12710  *         size = fo.tell() - offset
12711  */
12712     __pyx_t_2 = __pyx_f_8fastavro_5_read_skip_sync(__pyx_cur_scope->__pyx_v_fo, __pyx_cur_scope->__pyx_v_sync_marker, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 841, __pyx_L1_error)
12713     __Pyx_GOTREF(__pyx_t_2);
12714     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12715 
12716     /* "fastavro/_read.pyx":843
12717  *         skip_sync(fo, sync_marker)
12718  *
12719  *         size = fo.tell() - offset             # <<<<<<<<<<<<<<
12720  *
12721  *         yield Block(
12722  */
12723     __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_fo, __pyx_n_s_tell); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 843, __pyx_L1_error)
12724     __Pyx_GOTREF(__pyx_t_1);
12725     __pyx_t_3 = NULL;
12726     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
12727       __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
12728       if (likely(__pyx_t_3)) {
12729         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
12730         __Pyx_INCREF(__pyx_t_3);
12731         __Pyx_INCREF(function);
12732         __Pyx_DECREF_SET(__pyx_t_1, function);
12733       }
12734     }
12735     __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
12736     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12737     if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 843, __pyx_L1_error)
12738     __Pyx_GOTREF(__pyx_t_2);
12739     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12740     __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_cur_scope->__pyx_v_offset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 843, __pyx_L1_error)
12741     __Pyx_GOTREF(__pyx_t_1);
12742     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12743     __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_size);
12744     __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_size, __pyx_t_1);
12745     __Pyx_GIVEREF(__pyx_t_1);
12746     __pyx_t_1 = 0;
12747 
12748     /* "fastavro/_read.pyx":845
12749  *         size = fo.tell() - offset
12750  *
12751  *         yield Block(             # <<<<<<<<<<<<<<
12752  *             block_bytes, num_block_records, codec, reader_schema,
12753  *             writer_schema, named_schemas, offset, size, return_record_name
12754  */
12755     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Block); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 845, __pyx_L1_error)
12756     __Pyx_GOTREF(__pyx_t_2);
12757 
12758     /* "fastavro/_read.pyx":846
12759  *
12760  *         yield Block(
12761  *             block_bytes, num_block_records, codec, reader_schema,             # <<<<<<<<<<<<<<
12762  *             writer_schema, named_schemas, offset, size, return_record_name
12763  *         )
12764  */
12765     __pyx_t_3 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_cur_scope->__pyx_v_num_block_records); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 846, __pyx_L1_error)
12766     __Pyx_GOTREF(__pyx_t_3);
12767 
12768     /* "fastavro/_read.pyx":847
12769  *         yield Block(
12770  *             block_bytes, num_block_records, codec, reader_schema,
12771  *             writer_schema, named_schemas, offset, size, return_record_name             # <<<<<<<<<<<<<<
12772  *         )
12773  *
12774  */
12775     __pyx_t_11 = NULL;
12776     __pyx_t_10 = 0;
12777     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
12778       __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2);
12779       if (likely(__pyx_t_11)) {
12780         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
12781         __Pyx_INCREF(__pyx_t_11);
12782         __Pyx_INCREF(function);
12783         __Pyx_DECREF_SET(__pyx_t_2, function);
12784         __pyx_t_10 = 1;
12785       }
12786     }
12787     #if CYTHON_FAST_PYCALL
12788     if (PyFunction_Check(__pyx_t_2)) {
12789       PyObject *__pyx_temp[10] = {__pyx_t_11, __pyx_cur_scope->__pyx_v_block_bytes, __pyx_t_3, __pyx_cur_scope->__pyx_v_codec, __pyx_cur_scope->__pyx_v_reader_schema, __pyx_cur_scope->__pyx_v_writer_schema, __pyx_cur_scope->__pyx_v_named_schemas, __pyx_cur_scope->__pyx_v_offset, __pyx_cur_scope->__pyx_v_size, __pyx_cur_scope->__pyx_v_return_record_name};
12790       __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_10, 9+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 845, __pyx_L1_error)
12791       __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
12792       __Pyx_GOTREF(__pyx_t_1);
12793       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12794     } else
12795     #endif
12796     #if CYTHON_FAST_PYCCALL
12797     if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
12798       PyObject *__pyx_temp[10] = {__pyx_t_11, __pyx_cur_scope->__pyx_v_block_bytes, __pyx_t_3, __pyx_cur_scope->__pyx_v_codec, __pyx_cur_scope->__pyx_v_reader_schema, __pyx_cur_scope->__pyx_v_writer_schema, __pyx_cur_scope->__pyx_v_named_schemas, __pyx_cur_scope->__pyx_v_offset, __pyx_cur_scope->__pyx_v_size, __pyx_cur_scope->__pyx_v_return_record_name};
12799       __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_10, 9+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 845, __pyx_L1_error)
12800       __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
12801       __Pyx_GOTREF(__pyx_t_1);
12802       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12803     } else
12804     #endif
12805     {
12806       __pyx_t_12 = PyTuple_New(9+__pyx_t_10); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 845, __pyx_L1_error)
12807       __Pyx_GOTREF(__pyx_t_12);
12808       if (__pyx_t_11) {
12809         __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
12810       }
12811       __Pyx_INCREF(__pyx_cur_scope->__pyx_v_block_bytes);
12812       __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_block_bytes);
12813       PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_10, __pyx_cur_scope->__pyx_v_block_bytes);
12814       __Pyx_GIVEREF(__pyx_t_3);
12815       PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_10, __pyx_t_3);
12816       __Pyx_INCREF(__pyx_cur_scope->__pyx_v_codec);
12817       __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_codec);
12818       PyTuple_SET_ITEM(__pyx_t_12, 2+__pyx_t_10, __pyx_cur_scope->__pyx_v_codec);
12819       __Pyx_INCREF(__pyx_cur_scope->__pyx_v_reader_schema);
12820       __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_reader_schema);
12821       PyTuple_SET_ITEM(__pyx_t_12, 3+__pyx_t_10, __pyx_cur_scope->__pyx_v_reader_schema);
12822       __Pyx_INCREF(__pyx_cur_scope->__pyx_v_writer_schema);
12823       __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_writer_schema);
12824       PyTuple_SET_ITEM(__pyx_t_12, 4+__pyx_t_10, __pyx_cur_scope->__pyx_v_writer_schema);
12825       __Pyx_INCREF(__pyx_cur_scope->__pyx_v_named_schemas);
12826       __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_named_schemas);
12827       PyTuple_SET_ITEM(__pyx_t_12, 5+__pyx_t_10, __pyx_cur_scope->__pyx_v_named_schemas);
12828       __Pyx_INCREF(__pyx_cur_scope->__pyx_v_offset);
12829       __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_offset);
12830       PyTuple_SET_ITEM(__pyx_t_12, 6+__pyx_t_10, __pyx_cur_scope->__pyx_v_offset);
12831       __Pyx_INCREF(__pyx_cur_scope->__pyx_v_size);
12832       __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_size);
12833       PyTuple_SET_ITEM(__pyx_t_12, 7+__pyx_t_10, __pyx_cur_scope->__pyx_v_size);
12834       __Pyx_INCREF(__pyx_cur_scope->__pyx_v_return_record_name);
12835       __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_return_record_name);
12836       PyTuple_SET_ITEM(__pyx_t_12, 8+__pyx_t_10, __pyx_cur_scope->__pyx_v_return_record_name);
12837       __pyx_t_3 = 0;
12838       __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 845, __pyx_L1_error)
12839       __Pyx_GOTREF(__pyx_t_1);
12840       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
12841     }
12842     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12843     __pyx_r = __pyx_t_1;
12844     __pyx_t_1 = 0;
12845     __Pyx_XGIVEREF(__pyx_r);
12846     __Pyx_RefNannyFinishContext();
12847     __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
12848     /* return from generator, yielding value */
12849     __pyx_generator->resume_label = 1;
12850     return __pyx_r;
12851     __pyx_L17_resume_from_yield:;
12852     if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 845, __pyx_L1_error)
12853   }
12854   CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
12855 
12856   /* "fastavro/_read.pyx":817
12857  *
12858  *
12859  * def _iter_avro_blocks(             # <<<<<<<<<<<<<<
12860  *     fo,
12861  *     header,
12862  */
12863 
12864   /* function exit code */
12865   PyErr_SetNone(PyExc_StopIteration);
12866   goto __pyx_L0;
12867   __pyx_L1_error:;
12868   __Pyx_XDECREF(__pyx_t_1);
12869   __Pyx_XDECREF(__pyx_t_2);
12870   __Pyx_XDECREF(__pyx_t_3);
12871   __Pyx_XDECREF(__pyx_t_11);
12872   __Pyx_XDECREF(__pyx_t_12);
12873   __Pyx_AddTraceback("_iter_avro_blocks", __pyx_clineno, __pyx_lineno, __pyx_filename);
12874   __pyx_L0:;
12875   __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
12876   #if !CYTHON_USE_EXC_INFO_STACK
12877   __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
12878   #endif
12879   __pyx_generator->resume_label = -1;
12880   __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
12881   __Pyx_RefNannyFinishContext();
12882   return __pyx_r;
12883 }
12884 
12885 /* "fastavro/_read.pyx":852
12886  *
12887  * class Block:
12888  *     def __init__(             # <<<<<<<<<<<<<<
12889  *             self,
12890  *             bytes_,
12891  */
12892 
12893 /* Python wrapper */
12894 static PyObject *__pyx_pw_8fastavro_5_read_5Block_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
12895 static PyMethodDef __pyx_mdef_8fastavro_5_read_5Block_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8fastavro_5_read_5Block_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_8fastavro_5_read_5Block_1__init__(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)12896 static PyObject *__pyx_pw_8fastavro_5_read_5Block_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
12897   PyObject *__pyx_v_self = 0;
12898   PyObject *__pyx_v_bytes_ = 0;
12899   PyObject *__pyx_v_num_records = 0;
12900   PyObject *__pyx_v_codec = 0;
12901   PyObject *__pyx_v_reader_schema = 0;
12902   PyObject *__pyx_v_writer_schema = 0;
12903   PyObject *__pyx_v_named_schemas = 0;
12904   PyObject *__pyx_v_offset = 0;
12905   PyObject *__pyx_v_size = 0;
12906   PyObject *__pyx_v_return_record_name = 0;
12907   int __pyx_lineno = 0;
12908   const char *__pyx_filename = NULL;
12909   int __pyx_clineno = 0;
12910   PyObject *__pyx_r = 0;
12911   __Pyx_RefNannyDeclarations
12912   __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
12913   {
12914     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_bytes_2,&__pyx_n_s_num_records,&__pyx_n_s_codec,&__pyx_n_s_reader_schema,&__pyx_n_s_writer_schema,&__pyx_n_s_named_schemas,&__pyx_n_s_offset,&__pyx_n_s_size,&__pyx_n_s_return_record_name,0};
12915     PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
12916 
12917     /* "fastavro/_read.pyx":862
12918  *             offset,
12919  *             size,
12920  *             return_record_name=False):             # <<<<<<<<<<<<<<
12921  *         self.bytes_ = bytes_
12922  *         self.num_records = num_records
12923  */
12924     values[9] = ((PyObject *)((PyObject *)Py_False));
12925     if (unlikely(__pyx_kwds)) {
12926       Py_ssize_t kw_args;
12927       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
12928       switch (pos_args) {
12929         case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
12930         CYTHON_FALLTHROUGH;
12931         case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
12932         CYTHON_FALLTHROUGH;
12933         case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
12934         CYTHON_FALLTHROUGH;
12935         case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
12936         CYTHON_FALLTHROUGH;
12937         case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
12938         CYTHON_FALLTHROUGH;
12939         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
12940         CYTHON_FALLTHROUGH;
12941         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
12942         CYTHON_FALLTHROUGH;
12943         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
12944         CYTHON_FALLTHROUGH;
12945         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12946         CYTHON_FALLTHROUGH;
12947         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12948         CYTHON_FALLTHROUGH;
12949         case  0: break;
12950         default: goto __pyx_L5_argtuple_error;
12951       }
12952       kw_args = PyDict_Size(__pyx_kwds);
12953       switch (pos_args) {
12954         case  0:
12955         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
12956         else goto __pyx_L5_argtuple_error;
12957         CYTHON_FALLTHROUGH;
12958         case  1:
12959         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bytes_2)) != 0)) kw_args--;
12960         else {
12961           __Pyx_RaiseArgtupleInvalid("__init__", 0, 9, 10, 1); __PYX_ERR(0, 852, __pyx_L3_error)
12962         }
12963         CYTHON_FALLTHROUGH;
12964         case  2:
12965         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_num_records)) != 0)) kw_args--;
12966         else {
12967           __Pyx_RaiseArgtupleInvalid("__init__", 0, 9, 10, 2); __PYX_ERR(0, 852, __pyx_L3_error)
12968         }
12969         CYTHON_FALLTHROUGH;
12970         case  3:
12971         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_codec)) != 0)) kw_args--;
12972         else {
12973           __Pyx_RaiseArgtupleInvalid("__init__", 0, 9, 10, 3); __PYX_ERR(0, 852, __pyx_L3_error)
12974         }
12975         CYTHON_FALLTHROUGH;
12976         case  4:
12977         if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_reader_schema)) != 0)) kw_args--;
12978         else {
12979           __Pyx_RaiseArgtupleInvalid("__init__", 0, 9, 10, 4); __PYX_ERR(0, 852, __pyx_L3_error)
12980         }
12981         CYTHON_FALLTHROUGH;
12982         case  5:
12983         if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_writer_schema)) != 0)) kw_args--;
12984         else {
12985           __Pyx_RaiseArgtupleInvalid("__init__", 0, 9, 10, 5); __PYX_ERR(0, 852, __pyx_L3_error)
12986         }
12987         CYTHON_FALLTHROUGH;
12988         case  6:
12989         if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_named_schemas)) != 0)) kw_args--;
12990         else {
12991           __Pyx_RaiseArgtupleInvalid("__init__", 0, 9, 10, 6); __PYX_ERR(0, 852, __pyx_L3_error)
12992         }
12993         CYTHON_FALLTHROUGH;
12994         case  7:
12995         if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_offset)) != 0)) kw_args--;
12996         else {
12997           __Pyx_RaiseArgtupleInvalid("__init__", 0, 9, 10, 7); __PYX_ERR(0, 852, __pyx_L3_error)
12998         }
12999         CYTHON_FALLTHROUGH;
13000         case  8:
13001         if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
13002         else {
13003           __Pyx_RaiseArgtupleInvalid("__init__", 0, 9, 10, 8); __PYX_ERR(0, 852, __pyx_L3_error)
13004         }
13005         CYTHON_FALLTHROUGH;
13006         case  9:
13007         if (kw_args > 0) {
13008           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_return_record_name);
13009           if (value) { values[9] = value; kw_args--; }
13010         }
13011       }
13012       if (unlikely(kw_args > 0)) {
13013         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 852, __pyx_L3_error)
13014       }
13015     } else {
13016       switch (PyTuple_GET_SIZE(__pyx_args)) {
13017         case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
13018         CYTHON_FALLTHROUGH;
13019         case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
13020         values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
13021         values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
13022         values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
13023         values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
13024         values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
13025         values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
13026         values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13027         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13028         break;
13029         default: goto __pyx_L5_argtuple_error;
13030       }
13031     }
13032     __pyx_v_self = values[0];
13033     __pyx_v_bytes_ = values[1];
13034     __pyx_v_num_records = values[2];
13035     __pyx_v_codec = values[3];
13036     __pyx_v_reader_schema = values[4];
13037     __pyx_v_writer_schema = values[5];
13038     __pyx_v_named_schemas = values[6];
13039     __pyx_v_offset = values[7];
13040     __pyx_v_size = values[8];
13041     __pyx_v_return_record_name = values[9];
13042   }
13043   goto __pyx_L4_argument_unpacking_done;
13044   __pyx_L5_argtuple_error:;
13045   __Pyx_RaiseArgtupleInvalid("__init__", 0, 9, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 852, __pyx_L3_error)
13046   __pyx_L3_error:;
13047   __Pyx_AddTraceback("fastavro._read.Block.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13048   __Pyx_RefNannyFinishContext();
13049   return NULL;
13050   __pyx_L4_argument_unpacking_done:;
13051   __pyx_r = __pyx_pf_8fastavro_5_read_5Block___init__(__pyx_self, __pyx_v_self, __pyx_v_bytes_, __pyx_v_num_records, __pyx_v_codec, __pyx_v_reader_schema, __pyx_v_writer_schema, __pyx_v_named_schemas, __pyx_v_offset, __pyx_v_size, __pyx_v_return_record_name);
13052 
13053   /* "fastavro/_read.pyx":852
13054  *
13055  * class Block:
13056  *     def __init__(             # <<<<<<<<<<<<<<
13057  *             self,
13058  *             bytes_,
13059  */
13060 
13061   /* function exit code */
13062   __Pyx_RefNannyFinishContext();
13063   return __pyx_r;
13064 }
13065 
__pyx_pf_8fastavro_5_read_5Block___init__(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_self,PyObject * __pyx_v_bytes_,PyObject * __pyx_v_num_records,PyObject * __pyx_v_codec,PyObject * __pyx_v_reader_schema,PyObject * __pyx_v_writer_schema,PyObject * __pyx_v_named_schemas,PyObject * __pyx_v_offset,PyObject * __pyx_v_size,PyObject * __pyx_v_return_record_name)13066 static PyObject *__pyx_pf_8fastavro_5_read_5Block___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_bytes_, PyObject *__pyx_v_num_records, PyObject *__pyx_v_codec, PyObject *__pyx_v_reader_schema, PyObject *__pyx_v_writer_schema, PyObject *__pyx_v_named_schemas, PyObject *__pyx_v_offset, PyObject *__pyx_v_size, PyObject *__pyx_v_return_record_name) {
13067   PyObject *__pyx_r = NULL;
13068   __Pyx_RefNannyDeclarations
13069   int __pyx_lineno = 0;
13070   const char *__pyx_filename = NULL;
13071   int __pyx_clineno = 0;
13072   __Pyx_RefNannySetupContext("__init__", 0);
13073 
13074   /* "fastavro/_read.pyx":863
13075  *             size,
13076  *             return_record_name=False):
13077  *         self.bytes_ = bytes_             # <<<<<<<<<<<<<<
13078  *         self.num_records = num_records
13079  *         self.codec = codec
13080  */
13081   if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_bytes_2, __pyx_v_bytes_) < 0) __PYX_ERR(0, 863, __pyx_L1_error)
13082 
13083   /* "fastavro/_read.pyx":864
13084  *             return_record_name=False):
13085  *         self.bytes_ = bytes_
13086  *         self.num_records = num_records             # <<<<<<<<<<<<<<
13087  *         self.codec = codec
13088  *         self.reader_schema = reader_schema
13089  */
13090   if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_num_records, __pyx_v_num_records) < 0) __PYX_ERR(0, 864, __pyx_L1_error)
13091 
13092   /* "fastavro/_read.pyx":865
13093  *         self.bytes_ = bytes_
13094  *         self.num_records = num_records
13095  *         self.codec = codec             # <<<<<<<<<<<<<<
13096  *         self.reader_schema = reader_schema
13097  *         self.writer_schema = writer_schema
13098  */
13099   if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_codec, __pyx_v_codec) < 0) __PYX_ERR(0, 865, __pyx_L1_error)
13100 
13101   /* "fastavro/_read.pyx":866
13102  *         self.num_records = num_records
13103  *         self.codec = codec
13104  *         self.reader_schema = reader_schema             # <<<<<<<<<<<<<<
13105  *         self.writer_schema = writer_schema
13106  *         self._named_schemas = named_schemas
13107  */
13108   if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_reader_schema, __pyx_v_reader_schema) < 0) __PYX_ERR(0, 866, __pyx_L1_error)
13109 
13110   /* "fastavro/_read.pyx":867
13111  *         self.codec = codec
13112  *         self.reader_schema = reader_schema
13113  *         self.writer_schema = writer_schema             # <<<<<<<<<<<<<<
13114  *         self._named_schemas = named_schemas
13115  *         self.offset = offset
13116  */
13117   if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_writer_schema, __pyx_v_writer_schema) < 0) __PYX_ERR(0, 867, __pyx_L1_error)
13118 
13119   /* "fastavro/_read.pyx":868
13120  *         self.reader_schema = reader_schema
13121  *         self.writer_schema = writer_schema
13122  *         self._named_schemas = named_schemas             # <<<<<<<<<<<<<<
13123  *         self.offset = offset
13124  *         self.size = size
13125  */
13126   if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_named_schemas_2, __pyx_v_named_schemas) < 0) __PYX_ERR(0, 868, __pyx_L1_error)
13127 
13128   /* "fastavro/_read.pyx":869
13129  *         self.writer_schema = writer_schema
13130  *         self._named_schemas = named_schemas
13131  *         self.offset = offset             # <<<<<<<<<<<<<<
13132  *         self.size = size
13133  *         self.return_record_name = return_record_name
13134  */
13135   if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_offset, __pyx_v_offset) < 0) __PYX_ERR(0, 869, __pyx_L1_error)
13136 
13137   /* "fastavro/_read.pyx":870
13138  *         self._named_schemas = named_schemas
13139  *         self.offset = offset
13140  *         self.size = size             # <<<<<<<<<<<<<<
13141  *         self.return_record_name = return_record_name
13142  *
13143  */
13144   if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_size, __pyx_v_size) < 0) __PYX_ERR(0, 870, __pyx_L1_error)
13145 
13146   /* "fastavro/_read.pyx":871
13147  *         self.offset = offset
13148  *         self.size = size
13149  *         self.return_record_name = return_record_name             # <<<<<<<<<<<<<<
13150  *
13151  *     def __iter__(self):
13152  */
13153   if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_return_record_name, __pyx_v_return_record_name) < 0) __PYX_ERR(0, 871, __pyx_L1_error)
13154 
13155   /* "fastavro/_read.pyx":852
13156  *
13157  * class Block:
13158  *     def __init__(             # <<<<<<<<<<<<<<
13159  *             self,
13160  *             bytes_,
13161  */
13162 
13163   /* function exit code */
13164   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13165   goto __pyx_L0;
13166   __pyx_L1_error:;
13167   __Pyx_AddTraceback("fastavro._read.Block.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13168   __pyx_r = NULL;
13169   __pyx_L0:;
13170   __Pyx_XGIVEREF(__pyx_r);
13171   __Pyx_RefNannyFinishContext();
13172   return __pyx_r;
13173 }
13174 static PyObject *__pyx_gb_8fastavro_5_read_5Block_4generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
13175 
13176 /* "fastavro/_read.pyx":873
13177  *         self.return_record_name = return_record_name
13178  *
13179  *     def __iter__(self):             # <<<<<<<<<<<<<<
13180  *         for i in range(self.num_records):
13181  *             yield _read_data(
13182  */
13183 
13184 /* Python wrapper */
13185 static PyObject *__pyx_pw_8fastavro_5_read_5Block_3__iter__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
13186 static PyMethodDef __pyx_mdef_8fastavro_5_read_5Block_3__iter__ = {"__iter__", (PyCFunction)__pyx_pw_8fastavro_5_read_5Block_3__iter__, METH_O, 0};
__pyx_pw_8fastavro_5_read_5Block_3__iter__(PyObject * __pyx_self,PyObject * __pyx_v_self)13187 static PyObject *__pyx_pw_8fastavro_5_read_5Block_3__iter__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
13188   PyObject *__pyx_r = 0;
13189   __Pyx_RefNannyDeclarations
13190   __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
13191   __pyx_r = __pyx_pf_8fastavro_5_read_5Block_2__iter__(__pyx_self, ((PyObject *)__pyx_v_self));
13192 
13193   /* function exit code */
13194   __Pyx_RefNannyFinishContext();
13195   return __pyx_r;
13196 }
13197 
__pyx_pf_8fastavro_5_read_5Block_2__iter__(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_self)13198 static PyObject *__pyx_pf_8fastavro_5_read_5Block_2__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
13199   struct __pyx_obj_8fastavro_5_read___pyx_scope_struct_2___iter__ *__pyx_cur_scope;
13200   PyObject *__pyx_r = NULL;
13201   __Pyx_RefNannyDeclarations
13202   int __pyx_lineno = 0;
13203   const char *__pyx_filename = NULL;
13204   int __pyx_clineno = 0;
13205   __Pyx_RefNannySetupContext("__iter__", 0);
13206   __pyx_cur_scope = (struct __pyx_obj_8fastavro_5_read___pyx_scope_struct_2___iter__ *)__pyx_tp_new_8fastavro_5_read___pyx_scope_struct_2___iter__(__pyx_ptype_8fastavro_5_read___pyx_scope_struct_2___iter__, __pyx_empty_tuple, NULL);
13207   if (unlikely(!__pyx_cur_scope)) {
13208     __pyx_cur_scope = ((struct __pyx_obj_8fastavro_5_read___pyx_scope_struct_2___iter__ *)Py_None);
13209     __Pyx_INCREF(Py_None);
13210     __PYX_ERR(0, 873, __pyx_L1_error)
13211   } else {
13212     __Pyx_GOTREF(__pyx_cur_scope);
13213   }
13214   __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
13215   __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
13216   __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);
13217   {
13218     __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_8fastavro_5_read_5Block_4generator2, __pyx_codeobj__5, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_Block___iter, __pyx_n_s_fastavro__read); if (unlikely(!gen)) __PYX_ERR(0, 873, __pyx_L1_error)
13219     __Pyx_DECREF(__pyx_cur_scope);
13220     __Pyx_RefNannyFinishContext();
13221     return (PyObject *) gen;
13222   }
13223 
13224   /* function exit code */
13225   __pyx_L1_error:;
13226   __Pyx_AddTraceback("fastavro._read.Block.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13227   __pyx_r = NULL;
13228   __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
13229   __Pyx_XGIVEREF(__pyx_r);
13230   __Pyx_RefNannyFinishContext();
13231   return __pyx_r;
13232 }
13233 
__pyx_gb_8fastavro_5_read_5Block_4generator2(__pyx_CoroutineObject * __pyx_generator,CYTHON_UNUSED PyThreadState * __pyx_tstate,PyObject * __pyx_sent_value)13234 static PyObject *__pyx_gb_8fastavro_5_read_5Block_4generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
13235 {
13236   struct __pyx_obj_8fastavro_5_read___pyx_scope_struct_2___iter__ *__pyx_cur_scope = ((struct __pyx_obj_8fastavro_5_read___pyx_scope_struct_2___iter__ *)__pyx_generator->closure);
13237   PyObject *__pyx_r = NULL;
13238   PyObject *__pyx_t_1 = NULL;
13239   PyObject *__pyx_t_2 = NULL;
13240   Py_ssize_t __pyx_t_3;
13241   PyObject *(*__pyx_t_4)(PyObject *);
13242   PyObject *__pyx_t_5 = NULL;
13243   PyObject *__pyx_t_6 = NULL;
13244   PyObject *__pyx_t_7 = NULL;
13245   PyObject *__pyx_t_8 = NULL;
13246   PyObject *__pyx_t_9 = NULL;
13247   struct __pyx_opt_args_8fastavro_5_read__read_data __pyx_t_10;
13248   int __pyx_lineno = 0;
13249   const char *__pyx_filename = NULL;
13250   int __pyx_clineno = 0;
13251   __Pyx_RefNannyDeclarations
13252   __Pyx_RefNannySetupContext("__iter__", 0);
13253   switch (__pyx_generator->resume_label) {
13254     case 0: goto __pyx_L3_first_run;
13255     case 1: goto __pyx_L6_resume_from_yield;
13256     default: /* CPython raises the right error here */
13257     __Pyx_RefNannyFinishContext();
13258     return NULL;
13259   }
13260   __pyx_L3_first_run:;
13261   if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 873, __pyx_L1_error)
13262 
13263   /* "fastavro/_read.pyx":874
13264  *
13265  *     def __iter__(self):
13266  *         for i in range(self.num_records):             # <<<<<<<<<<<<<<
13267  *             yield _read_data(
13268  *                 self.bytes_,
13269  */
13270   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_num_records); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 874, __pyx_L1_error)
13271   __Pyx_GOTREF(__pyx_t_1);
13272   __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 874, __pyx_L1_error)
13273   __Pyx_GOTREF(__pyx_t_2);
13274   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13275   if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
13276     __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
13277     __pyx_t_4 = NULL;
13278   } else {
13279     __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 874, __pyx_L1_error)
13280     __Pyx_GOTREF(__pyx_t_1);
13281     __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 874, __pyx_L1_error)
13282   }
13283   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13284   for (;;) {
13285     if (likely(!__pyx_t_4)) {
13286       if (likely(PyList_CheckExact(__pyx_t_1))) {
13287         if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
13288         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13289         __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 874, __pyx_L1_error)
13290         #else
13291         __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 874, __pyx_L1_error)
13292         __Pyx_GOTREF(__pyx_t_2);
13293         #endif
13294       } else {
13295         if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
13296         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13297         __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 874, __pyx_L1_error)
13298         #else
13299         __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 874, __pyx_L1_error)
13300         __Pyx_GOTREF(__pyx_t_2);
13301         #endif
13302       }
13303     } else {
13304       __pyx_t_2 = __pyx_t_4(__pyx_t_1);
13305       if (unlikely(!__pyx_t_2)) {
13306         PyObject* exc_type = PyErr_Occurred();
13307         if (exc_type) {
13308           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
13309           else __PYX_ERR(0, 874, __pyx_L1_error)
13310         }
13311         break;
13312       }
13313       __Pyx_GOTREF(__pyx_t_2);
13314     }
13315     __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_i);
13316     __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_i, __pyx_t_2);
13317     __Pyx_GIVEREF(__pyx_t_2);
13318     __pyx_t_2 = 0;
13319 
13320     /* "fastavro/_read.pyx":876
13321  *         for i in range(self.num_records):
13322  *             yield _read_data(
13323  *                 self.bytes_,             # <<<<<<<<<<<<<<
13324  *                 self.writer_schema,
13325  *                 self._named_schemas,
13326  */
13327     __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_bytes_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 876, __pyx_L1_error)
13328     __Pyx_GOTREF(__pyx_t_2);
13329 
13330     /* "fastavro/_read.pyx":877
13331  *             yield _read_data(
13332  *                 self.bytes_,
13333  *                 self.writer_schema,             # <<<<<<<<<<<<<<
13334  *                 self._named_schemas,
13335  *                 self.reader_schema,
13336  */
13337     __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_writer_schema); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 877, __pyx_L1_error)
13338     __Pyx_GOTREF(__pyx_t_5);
13339 
13340     /* "fastavro/_read.pyx":878
13341  *                 self.bytes_,
13342  *                 self.writer_schema,
13343  *                 self._named_schemas,             # <<<<<<<<<<<<<<
13344  *                 self.reader_schema,
13345  *                 self.return_record_name,
13346  */
13347     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_named_schemas_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 878, __pyx_L1_error)
13348     __Pyx_GOTREF(__pyx_t_6);
13349 
13350     /* "fastavro/_read.pyx":879
13351  *                 self.writer_schema,
13352  *                 self._named_schemas,
13353  *                 self.reader_schema,             # <<<<<<<<<<<<<<
13354  *                 self.return_record_name,
13355  *             )
13356  */
13357     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_reader_schema); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 879, __pyx_L1_error)
13358     __Pyx_GOTREF(__pyx_t_7);
13359 
13360     /* "fastavro/_read.pyx":880
13361  *                 self._named_schemas,
13362  *                 self.reader_schema,
13363  *                 self.return_record_name,             # <<<<<<<<<<<<<<
13364  *             )
13365  *
13366  */
13367     __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_return_record_name); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 880, __pyx_L1_error)
13368     __Pyx_GOTREF(__pyx_t_8);
13369 
13370     /* "fastavro/_read.pyx":875
13371  *     def __iter__(self):
13372  *         for i in range(self.num_records):
13373  *             yield _read_data(             # <<<<<<<<<<<<<<
13374  *                 self.bytes_,
13375  *                 self.writer_schema,
13376  */
13377     __pyx_t_10.__pyx_n = 2;
13378     __pyx_t_10.reader_schema = __pyx_t_7;
13379     __pyx_t_10.return_record_name = __pyx_t_8;
13380     __pyx_t_9 = __pyx_f_8fastavro_5_read__read_data(__pyx_t_2, __pyx_t_5, __pyx_t_6, 0, &__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 875, __pyx_L1_error)
13381     __Pyx_GOTREF(__pyx_t_9);
13382     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13383     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13384     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13385     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13386     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13387     __pyx_r = __pyx_t_9;
13388     __pyx_t_9 = 0;
13389     __Pyx_XGIVEREF(__pyx_t_1);
13390     __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
13391     __pyx_cur_scope->__pyx_t_1 = __pyx_t_3;
13392     __pyx_cur_scope->__pyx_t_2 = __pyx_t_4;
13393     __Pyx_XGIVEREF(__pyx_r);
13394     __Pyx_RefNannyFinishContext();
13395     __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
13396     /* return from generator, yielding value */
13397     __pyx_generator->resume_label = 1;
13398     return __pyx_r;
13399     __pyx_L6_resume_from_yield:;
13400     __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
13401     __pyx_cur_scope->__pyx_t_0 = 0;
13402     __Pyx_XGOTREF(__pyx_t_1);
13403     __pyx_t_3 = __pyx_cur_scope->__pyx_t_1;
13404     __pyx_t_4 = __pyx_cur_scope->__pyx_t_2;
13405     if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 875, __pyx_L1_error)
13406 
13407     /* "fastavro/_read.pyx":874
13408  *
13409  *     def __iter__(self):
13410  *         for i in range(self.num_records):             # <<<<<<<<<<<<<<
13411  *             yield _read_data(
13412  *                 self.bytes_,
13413  */
13414   }
13415   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13416   CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
13417 
13418   /* "fastavro/_read.pyx":873
13419  *         self.return_record_name = return_record_name
13420  *
13421  *     def __iter__(self):             # <<<<<<<<<<<<<<
13422  *         for i in range(self.num_records):
13423  *             yield _read_data(
13424  */
13425 
13426   /* function exit code */
13427   PyErr_SetNone(PyExc_StopIteration);
13428   goto __pyx_L0;
13429   __pyx_L1_error:;
13430   __Pyx_XDECREF(__pyx_t_1);
13431   __Pyx_XDECREF(__pyx_t_2);
13432   __Pyx_XDECREF(__pyx_t_5);
13433   __Pyx_XDECREF(__pyx_t_6);
13434   __Pyx_XDECREF(__pyx_t_7);
13435   __Pyx_XDECREF(__pyx_t_8);
13436   __Pyx_XDECREF(__pyx_t_9);
13437   __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13438   __pyx_L0:;
13439   __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
13440   #if !CYTHON_USE_EXC_INFO_STACK
13441   __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
13442   #endif
13443   __pyx_generator->resume_label = -1;
13444   __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
13445   __Pyx_RefNannyFinishContext();
13446   return __pyx_r;
13447 }
13448 
13449 /* "fastavro/_read.pyx":883
13450  *             )
13451  *
13452  *     def __str__(self):             # <<<<<<<<<<<<<<
13453  *         return ("Avro block: %d bytes, %d records, codec: %s, position %d+%d"
13454  *                 % (len(self.bytes_), self.num_records, self.codec, self.offset,
13455  */
13456 
13457 /* Python wrapper */
13458 static PyObject *__pyx_pw_8fastavro_5_read_5Block_6__str__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
13459 static PyMethodDef __pyx_mdef_8fastavro_5_read_5Block_6__str__ = {"__str__", (PyCFunction)__pyx_pw_8fastavro_5_read_5Block_6__str__, METH_O, 0};
__pyx_pw_8fastavro_5_read_5Block_6__str__(PyObject * __pyx_self,PyObject * __pyx_v_self)13460 static PyObject *__pyx_pw_8fastavro_5_read_5Block_6__str__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
13461   PyObject *__pyx_r = 0;
13462   __Pyx_RefNannyDeclarations
13463   __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
13464   __pyx_r = __pyx_pf_8fastavro_5_read_5Block_5__str__(__pyx_self, ((PyObject *)__pyx_v_self));
13465 
13466   /* function exit code */
13467   __Pyx_RefNannyFinishContext();
13468   return __pyx_r;
13469 }
13470 
__pyx_pf_8fastavro_5_read_5Block_5__str__(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_self)13471 static PyObject *__pyx_pf_8fastavro_5_read_5Block_5__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
13472   PyObject *__pyx_r = NULL;
13473   __Pyx_RefNannyDeclarations
13474   PyObject *__pyx_t_1 = NULL;
13475   Py_ssize_t __pyx_t_2;
13476   PyObject *__pyx_t_3 = NULL;
13477   PyObject *__pyx_t_4 = NULL;
13478   PyObject *__pyx_t_5 = NULL;
13479   PyObject *__pyx_t_6 = NULL;
13480   PyObject *__pyx_t_7 = NULL;
13481   int __pyx_lineno = 0;
13482   const char *__pyx_filename = NULL;
13483   int __pyx_clineno = 0;
13484   __Pyx_RefNannySetupContext("__str__", 0);
13485 
13486   /* "fastavro/_read.pyx":884
13487  *
13488  *     def __str__(self):
13489  *         return ("Avro block: %d bytes, %d records, codec: %s, position %d+%d"             # <<<<<<<<<<<<<<
13490  *                 % (len(self.bytes_), self.num_records, self.codec, self.offset,
13491  *                    self.size))
13492  */
13493   __Pyx_XDECREF(__pyx_r);
13494 
13495   /* "fastavro/_read.pyx":885
13496  *     def __str__(self):
13497  *         return ("Avro block: %d bytes, %d records, codec: %s, position %d+%d"
13498  *                 % (len(self.bytes_), self.num_records, self.codec, self.offset,             # <<<<<<<<<<<<<<
13499  *                    self.size))
13500  *
13501  */
13502   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bytes_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 885, __pyx_L1_error)
13503   __Pyx_GOTREF(__pyx_t_1);
13504   __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 885, __pyx_L1_error)
13505   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13506   __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 885, __pyx_L1_error)
13507   __Pyx_GOTREF(__pyx_t_1);
13508   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_num_records); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 885, __pyx_L1_error)
13509   __Pyx_GOTREF(__pyx_t_3);
13510   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_codec); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 885, __pyx_L1_error)
13511   __Pyx_GOTREF(__pyx_t_4);
13512   __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_offset); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 885, __pyx_L1_error)
13513   __Pyx_GOTREF(__pyx_t_5);
13514 
13515   /* "fastavro/_read.pyx":886
13516  *         return ("Avro block: %d bytes, %d records, codec: %s, position %d+%d"
13517  *                 % (len(self.bytes_), self.num_records, self.codec, self.offset,
13518  *                    self.size))             # <<<<<<<<<<<<<<
13519  *
13520  *
13521  */
13522   __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 886, __pyx_L1_error)
13523   __Pyx_GOTREF(__pyx_t_6);
13524 
13525   /* "fastavro/_read.pyx":885
13526  *     def __str__(self):
13527  *         return ("Avro block: %d bytes, %d records, codec: %s, position %d+%d"
13528  *                 % (len(self.bytes_), self.num_records, self.codec, self.offset,             # <<<<<<<<<<<<<<
13529  *                    self.size))
13530  *
13531  */
13532   __pyx_t_7 = PyTuple_New(5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 885, __pyx_L1_error)
13533   __Pyx_GOTREF(__pyx_t_7);
13534   __Pyx_GIVEREF(__pyx_t_1);
13535   PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1);
13536   __Pyx_GIVEREF(__pyx_t_3);
13537   PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_3);
13538   __Pyx_GIVEREF(__pyx_t_4);
13539   PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_4);
13540   __Pyx_GIVEREF(__pyx_t_5);
13541   PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_5);
13542   __Pyx_GIVEREF(__pyx_t_6);
13543   PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_t_6);
13544   __pyx_t_1 = 0;
13545   __pyx_t_3 = 0;
13546   __pyx_t_4 = 0;
13547   __pyx_t_5 = 0;
13548   __pyx_t_6 = 0;
13549   __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Avro_block_d_bytes_d_records_cod, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 885, __pyx_L1_error)
13550   __Pyx_GOTREF(__pyx_t_6);
13551   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13552   __pyx_r = __pyx_t_6;
13553   __pyx_t_6 = 0;
13554   goto __pyx_L0;
13555 
13556   /* "fastavro/_read.pyx":883
13557  *             )
13558  *
13559  *     def __str__(self):             # <<<<<<<<<<<<<<
13560  *         return ("Avro block: %d bytes, %d records, codec: %s, position %d+%d"
13561  *                 % (len(self.bytes_), self.num_records, self.codec, self.offset,
13562  */
13563 
13564   /* function exit code */
13565   __pyx_L1_error:;
13566   __Pyx_XDECREF(__pyx_t_1);
13567   __Pyx_XDECREF(__pyx_t_3);
13568   __Pyx_XDECREF(__pyx_t_4);
13569   __Pyx_XDECREF(__pyx_t_5);
13570   __Pyx_XDECREF(__pyx_t_6);
13571   __Pyx_XDECREF(__pyx_t_7);
13572   __Pyx_AddTraceback("fastavro._read.Block.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13573   __pyx_r = NULL;
13574   __pyx_L0:;
13575   __Pyx_XGIVEREF(__pyx_r);
13576   __Pyx_RefNannyFinishContext();
13577   return __pyx_r;
13578 }
13579 
13580 /* "fastavro/_read.pyx":890
13581  *
13582  * class file_reader:
13583  *     def __init__(self, fo, reader_schema=None, return_record_name=False):             # <<<<<<<<<<<<<<
13584  *         self.fo = fo
13585  *         self.return_record_name = return_record_name
13586  */
13587 
13588 /* Python wrapper */
13589 static PyObject *__pyx_pw_8fastavro_5_read_11file_reader_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
13590 static PyMethodDef __pyx_mdef_8fastavro_5_read_11file_reader_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8fastavro_5_read_11file_reader_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_8fastavro_5_read_11file_reader_1__init__(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)13591 static PyObject *__pyx_pw_8fastavro_5_read_11file_reader_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13592   PyObject *__pyx_v_self = 0;
13593   PyObject *__pyx_v_fo = 0;
13594   PyObject *__pyx_v_reader_schema = 0;
13595   PyObject *__pyx_v_return_record_name = 0;
13596   int __pyx_lineno = 0;
13597   const char *__pyx_filename = NULL;
13598   int __pyx_clineno = 0;
13599   PyObject *__pyx_r = 0;
13600   __Pyx_RefNannyDeclarations
13601   __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
13602   {
13603     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_fo,&__pyx_n_s_reader_schema,&__pyx_n_s_return_record_name,0};
13604     PyObject* values[4] = {0,0,0,0};
13605     values[2] = ((PyObject *)((PyObject *)Py_None));
13606     values[3] = ((PyObject *)((PyObject *)Py_False));
13607     if (unlikely(__pyx_kwds)) {
13608       Py_ssize_t kw_args;
13609       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13610       switch (pos_args) {
13611         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
13612         CYTHON_FALLTHROUGH;
13613         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
13614         CYTHON_FALLTHROUGH;
13615         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13616         CYTHON_FALLTHROUGH;
13617         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13618         CYTHON_FALLTHROUGH;
13619         case  0: break;
13620         default: goto __pyx_L5_argtuple_error;
13621       }
13622       kw_args = PyDict_Size(__pyx_kwds);
13623       switch (pos_args) {
13624         case  0:
13625         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
13626         else goto __pyx_L5_argtuple_error;
13627         CYTHON_FALLTHROUGH;
13628         case  1:
13629         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fo)) != 0)) kw_args--;
13630         else {
13631           __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, 1); __PYX_ERR(0, 890, __pyx_L3_error)
13632         }
13633         CYTHON_FALLTHROUGH;
13634         case  2:
13635         if (kw_args > 0) {
13636           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_reader_schema);
13637           if (value) { values[2] = value; kw_args--; }
13638         }
13639         CYTHON_FALLTHROUGH;
13640         case  3:
13641         if (kw_args > 0) {
13642           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_return_record_name);
13643           if (value) { values[3] = value; kw_args--; }
13644         }
13645       }
13646       if (unlikely(kw_args > 0)) {
13647         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 890, __pyx_L3_error)
13648       }
13649     } else {
13650       switch (PyTuple_GET_SIZE(__pyx_args)) {
13651         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
13652         CYTHON_FALLTHROUGH;
13653         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
13654         CYTHON_FALLTHROUGH;
13655         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13656         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13657         break;
13658         default: goto __pyx_L5_argtuple_error;
13659       }
13660     }
13661     __pyx_v_self = values[0];
13662     __pyx_v_fo = values[1];
13663     __pyx_v_reader_schema = values[2];
13664     __pyx_v_return_record_name = values[3];
13665   }
13666   goto __pyx_L4_argument_unpacking_done;
13667   __pyx_L5_argtuple_error:;
13668   __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 890, __pyx_L3_error)
13669   __pyx_L3_error:;
13670   __Pyx_AddTraceback("fastavro._read.file_reader.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13671   __Pyx_RefNannyFinishContext();
13672   return NULL;
13673   __pyx_L4_argument_unpacking_done:;
13674   __pyx_r = __pyx_pf_8fastavro_5_read_11file_reader___init__(__pyx_self, __pyx_v_self, __pyx_v_fo, __pyx_v_reader_schema, __pyx_v_return_record_name);
13675 
13676   /* function exit code */
13677   __Pyx_RefNannyFinishContext();
13678   return __pyx_r;
13679 }
13680 
__pyx_pf_8fastavro_5_read_11file_reader___init__(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_self,PyObject * __pyx_v_fo,PyObject * __pyx_v_reader_schema,PyObject * __pyx_v_return_record_name)13681 static PyObject *__pyx_pf_8fastavro_5_read_11file_reader___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_fo, PyObject *__pyx_v_reader_schema, PyObject *__pyx_v_return_record_name) {
13682   PyObject *__pyx_8genexpr1__pyx_v_k = NULL;
13683   PyObject *__pyx_8genexpr1__pyx_v_v = NULL;
13684   PyObject *__pyx_r = NULL;
13685   __Pyx_RefNannyDeclarations
13686   PyObject *__pyx_t_1 = NULL;
13687   PyObject *__pyx_t_2 = NULL;
13688   PyObject *__pyx_t_3 = NULL;
13689   PyObject *__pyx_t_4 = NULL;
13690   PyObject *__pyx_t_5 = NULL;
13691   PyObject *__pyx_t_6 = NULL;
13692   PyObject *__pyx_t_7 = NULL;
13693   struct __pyx_opt_args_8fastavro_5_read__read_data __pyx_t_8;
13694   int __pyx_t_9;
13695   PyObject *__pyx_t_10 = NULL;
13696   Py_ssize_t __pyx_t_11;
13697   PyObject *(*__pyx_t_12)(PyObject *);
13698   PyObject *__pyx_t_13 = NULL;
13699   PyObject *(*__pyx_t_14)(PyObject *);
13700   int __pyx_t_15;
13701   int __pyx_lineno = 0;
13702   const char *__pyx_filename = NULL;
13703   int __pyx_clineno = 0;
13704   __Pyx_RefNannySetupContext("__init__", 0);
13705 
13706   /* "fastavro/_read.pyx":891
13707  * class file_reader:
13708  *     def __init__(self, fo, reader_schema=None, return_record_name=False):
13709  *         self.fo = fo             # <<<<<<<<<<<<<<
13710  *         self.return_record_name = return_record_name
13711  *         try:
13712  */
13713   if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_fo, __pyx_v_fo) < 0) __PYX_ERR(0, 891, __pyx_L1_error)
13714 
13715   /* "fastavro/_read.pyx":892
13716  *     def __init__(self, fo, reader_schema=None, return_record_name=False):
13717  *         self.fo = fo
13718  *         self.return_record_name = return_record_name             # <<<<<<<<<<<<<<
13719  *         try:
13720  *             self._header = _read_data(self.fo, HEADER_SCHEMA, {}, None,
13721  */
13722   if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_return_record_name, __pyx_v_return_record_name) < 0) __PYX_ERR(0, 892, __pyx_L1_error)
13723 
13724   /* "fastavro/_read.pyx":893
13725  *         self.fo = fo
13726  *         self.return_record_name = return_record_name
13727  *         try:             # <<<<<<<<<<<<<<
13728  *             self._header = _read_data(self.fo, HEADER_SCHEMA, {}, None,
13729  *                                       return_record_name)
13730  */
13731   {
13732     __Pyx_PyThreadState_declare
13733     __Pyx_PyThreadState_assign
13734     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
13735     __Pyx_XGOTREF(__pyx_t_1);
13736     __Pyx_XGOTREF(__pyx_t_2);
13737     __Pyx_XGOTREF(__pyx_t_3);
13738     /*try:*/ {
13739 
13740       /* "fastavro/_read.pyx":894
13741  *         self.return_record_name = return_record_name
13742  *         try:
13743  *             self._header = _read_data(self.fo, HEADER_SCHEMA, {}, None,             # <<<<<<<<<<<<<<
13744  *                                       return_record_name)
13745  *         except StopIteration:
13746  */
13747       __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_fo); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 894, __pyx_L3_error)
13748       __Pyx_GOTREF(__pyx_t_4);
13749       __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_HEADER_SCHEMA); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 894, __pyx_L3_error)
13750       __Pyx_GOTREF(__pyx_t_5);
13751       __pyx_t_6 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 894, __pyx_L3_error)
13752       __Pyx_GOTREF(__pyx_t_6);
13753 
13754       /* "fastavro/_read.pyx":895
13755  *         try:
13756  *             self._header = _read_data(self.fo, HEADER_SCHEMA, {}, None,
13757  *                                       return_record_name)             # <<<<<<<<<<<<<<
13758  *         except StopIteration:
13759  *             raise ValueError('cannot read header - is it an avro file?')
13760  */
13761       __pyx_t_8.__pyx_n = 2;
13762       __pyx_t_8.reader_schema = Py_None;
13763       __pyx_t_8.return_record_name = __pyx_v_return_record_name;
13764       __pyx_t_7 = __pyx_f_8fastavro_5_read__read_data(__pyx_t_4, __pyx_t_5, __pyx_t_6, 0, &__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 894, __pyx_L3_error)
13765       __Pyx_GOTREF(__pyx_t_7);
13766       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13767       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13768       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13769 
13770       /* "fastavro/_read.pyx":894
13771  *         self.return_record_name = return_record_name
13772  *         try:
13773  *             self._header = _read_data(self.fo, HEADER_SCHEMA, {}, None,             # <<<<<<<<<<<<<<
13774  *                                       return_record_name)
13775  *         except StopIteration:
13776  */
13777       if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_header_2, __pyx_t_7) < 0) __PYX_ERR(0, 894, __pyx_L3_error)
13778       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13779 
13780       /* "fastavro/_read.pyx":893
13781  *         self.fo = fo
13782  *         self.return_record_name = return_record_name
13783  *         try:             # <<<<<<<<<<<<<<
13784  *             self._header = _read_data(self.fo, HEADER_SCHEMA, {}, None,
13785  *                                       return_record_name)
13786  */
13787     }
13788     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
13789     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
13790     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13791     goto __pyx_L8_try_end;
13792     __pyx_L3_error:;
13793     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
13794     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13795     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
13796     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
13797 
13798     /* "fastavro/_read.pyx":896
13799  *             self._header = _read_data(self.fo, HEADER_SCHEMA, {}, None,
13800  *                                       return_record_name)
13801  *         except StopIteration:             # <<<<<<<<<<<<<<
13802  *             raise ValueError('cannot read header - is it an avro file?')
13803  *
13804  */
13805     __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_StopIteration);
13806     if (__pyx_t_9) {
13807       __Pyx_AddTraceback("fastavro._read.file_reader.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13808       if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(0, 896, __pyx_L5_except_error)
13809       __Pyx_GOTREF(__pyx_t_7);
13810       __Pyx_GOTREF(__pyx_t_6);
13811       __Pyx_GOTREF(__pyx_t_5);
13812 
13813       /* "fastavro/_read.pyx":897
13814  *                                       return_record_name)
13815  *         except StopIteration:
13816  *             raise ValueError('cannot read header - is it an avro file?')             # <<<<<<<<<<<<<<
13817  *
13818  *         # `meta` values are bytes. So, the actual decoding has to be external.
13819  */
13820       __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 897, __pyx_L5_except_error)
13821       __Pyx_GOTREF(__pyx_t_4);
13822       __Pyx_Raise(__pyx_t_4, 0, 0, 0);
13823       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13824       __PYX_ERR(0, 897, __pyx_L5_except_error)
13825     }
13826     goto __pyx_L5_except_error;
13827     __pyx_L5_except_error:;
13828 
13829     /* "fastavro/_read.pyx":893
13830  *         self.fo = fo
13831  *         self.return_record_name = return_record_name
13832  *         try:             # <<<<<<<<<<<<<<
13833  *             self._header = _read_data(self.fo, HEADER_SCHEMA, {}, None,
13834  *                                       return_record_name)
13835  */
13836     __Pyx_XGIVEREF(__pyx_t_1);
13837     __Pyx_XGIVEREF(__pyx_t_2);
13838     __Pyx_XGIVEREF(__pyx_t_3);
13839     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
13840     goto __pyx_L1_error;
13841     __pyx_L8_try_end:;
13842   }
13843 
13844   /* "fastavro/_read.pyx":900
13845  *
13846  *         # `meta` values are bytes. So, the actual decoding has to be external.
13847  *         self.metadata = {             # <<<<<<<<<<<<<<
13848  *             k: btou(v) for k, v in iteritems(self._header['meta'])
13849  *         }
13850  */
13851   { /* enter inner scope */
13852     __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 900, __pyx_L13_error)
13853     __Pyx_GOTREF(__pyx_t_5);
13854 
13855     /* "fastavro/_read.pyx":901
13856  *         # `meta` values are bytes. So, the actual decoding has to be external.
13857  *         self.metadata = {
13858  *             k: btou(v) for k, v in iteritems(self._header['meta'])             # <<<<<<<<<<<<<<
13859  *         }
13860  *
13861  */
13862     __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_iteritems); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 901, __pyx_L13_error)
13863     __Pyx_GOTREF(__pyx_t_7);
13864     __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_header_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 901, __pyx_L13_error)
13865     __Pyx_GOTREF(__pyx_t_4);
13866     __pyx_t_10 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_n_s_meta); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 901, __pyx_L13_error)
13867     __Pyx_GOTREF(__pyx_t_10);
13868     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13869     __pyx_t_4 = NULL;
13870     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
13871       __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
13872       if (likely(__pyx_t_4)) {
13873         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
13874         __Pyx_INCREF(__pyx_t_4);
13875         __Pyx_INCREF(function);
13876         __Pyx_DECREF_SET(__pyx_t_7, function);
13877       }
13878     }
13879     __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_4, __pyx_t_10) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_10);
13880     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
13881     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13882     if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 901, __pyx_L13_error)
13883     __Pyx_GOTREF(__pyx_t_6);
13884     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13885     if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
13886       __pyx_t_7 = __pyx_t_6; __Pyx_INCREF(__pyx_t_7); __pyx_t_11 = 0;
13887       __pyx_t_12 = NULL;
13888     } else {
13889       __pyx_t_11 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 901, __pyx_L13_error)
13890       __Pyx_GOTREF(__pyx_t_7);
13891       __pyx_t_12 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 901, __pyx_L13_error)
13892     }
13893     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13894     for (;;) {
13895       if (likely(!__pyx_t_12)) {
13896         if (likely(PyList_CheckExact(__pyx_t_7))) {
13897           if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_7)) break;
13898           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13899           __pyx_t_6 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_11); __Pyx_INCREF(__pyx_t_6); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 901, __pyx_L13_error)
13900           #else
13901           __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 901, __pyx_L13_error)
13902           __Pyx_GOTREF(__pyx_t_6);
13903           #endif
13904         } else {
13905           if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
13906           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13907           __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_11); __Pyx_INCREF(__pyx_t_6); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 901, __pyx_L13_error)
13908           #else
13909           __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 901, __pyx_L13_error)
13910           __Pyx_GOTREF(__pyx_t_6);
13911           #endif
13912         }
13913       } else {
13914         __pyx_t_6 = __pyx_t_12(__pyx_t_7);
13915         if (unlikely(!__pyx_t_6)) {
13916           PyObject* exc_type = PyErr_Occurred();
13917           if (exc_type) {
13918             if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
13919             else __PYX_ERR(0, 901, __pyx_L13_error)
13920           }
13921           break;
13922         }
13923         __Pyx_GOTREF(__pyx_t_6);
13924       }
13925       if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
13926         PyObject* sequence = __pyx_t_6;
13927         Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
13928         if (unlikely(size != 2)) {
13929           if (size > 2) __Pyx_RaiseTooManyValuesError(2);
13930           else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
13931           __PYX_ERR(0, 901, __pyx_L13_error)
13932         }
13933         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13934         if (likely(PyTuple_CheckExact(sequence))) {
13935           __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0);
13936           __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
13937         } else {
13938           __pyx_t_10 = PyList_GET_ITEM(sequence, 0);
13939           __pyx_t_4 = PyList_GET_ITEM(sequence, 1);
13940         }
13941         __Pyx_INCREF(__pyx_t_10);
13942         __Pyx_INCREF(__pyx_t_4);
13943         #else
13944         __pyx_t_10 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 901, __pyx_L13_error)
13945         __Pyx_GOTREF(__pyx_t_10);
13946         __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 901, __pyx_L13_error)
13947         __Pyx_GOTREF(__pyx_t_4);
13948         #endif
13949         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13950       } else {
13951         Py_ssize_t index = -1;
13952         __pyx_t_13 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 901, __pyx_L13_error)
13953         __Pyx_GOTREF(__pyx_t_13);
13954         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13955         __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext;
13956         index = 0; __pyx_t_10 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_10)) goto __pyx_L16_unpacking_failed;
13957         __Pyx_GOTREF(__pyx_t_10);
13958         index = 1; __pyx_t_4 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_4)) goto __pyx_L16_unpacking_failed;
13959         __Pyx_GOTREF(__pyx_t_4);
13960         if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) __PYX_ERR(0, 901, __pyx_L13_error)
13961         __pyx_t_14 = NULL;
13962         __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
13963         goto __pyx_L17_unpacking_done;
13964         __pyx_L16_unpacking_failed:;
13965         __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
13966         __pyx_t_14 = NULL;
13967         if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
13968         __PYX_ERR(0, 901, __pyx_L13_error)
13969         __pyx_L17_unpacking_done:;
13970       }
13971       __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_k, __pyx_t_10);
13972       __pyx_t_10 = 0;
13973       __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_v, __pyx_t_4);
13974       __pyx_t_4 = 0;
13975       __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_btou); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 901, __pyx_L13_error)
13976       __Pyx_GOTREF(__pyx_t_4);
13977       __pyx_t_10 = NULL;
13978       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
13979         __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_4);
13980         if (likely(__pyx_t_10)) {
13981           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
13982           __Pyx_INCREF(__pyx_t_10);
13983           __Pyx_INCREF(function);
13984           __Pyx_DECREF_SET(__pyx_t_4, function);
13985         }
13986       }
13987       __pyx_t_6 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_10, __pyx_8genexpr1__pyx_v_v) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_8genexpr1__pyx_v_v);
13988       __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
13989       if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 901, __pyx_L13_error)
13990       __Pyx_GOTREF(__pyx_t_6);
13991       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13992       if (unlikely(PyDict_SetItem(__pyx_t_5, (PyObject*)__pyx_8genexpr1__pyx_v_k, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 901, __pyx_L13_error)
13993       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13994     }
13995     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13996     __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_k); __pyx_8genexpr1__pyx_v_k = 0;
13997     __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_v); __pyx_8genexpr1__pyx_v_v = 0;
13998     goto __pyx_L18_exit_scope;
13999     __pyx_L13_error:;
14000     __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_k); __pyx_8genexpr1__pyx_v_k = 0;
14001     __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_v); __pyx_8genexpr1__pyx_v_v = 0;
14002     goto __pyx_L1_error;
14003     __pyx_L18_exit_scope:;
14004   } /* exit inner scope */
14005 
14006   /* "fastavro/_read.pyx":900
14007  *
14008  *         # `meta` values are bytes. So, the actual decoding has to be external.
14009  *         self.metadata = {             # <<<<<<<<<<<<<<
14010  *             k: btou(v) for k, v in iteritems(self._header['meta'])
14011  *         }
14012  */
14013   if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_metadata, __pyx_t_5) < 0) __PYX_ERR(0, 900, __pyx_L1_error)
14014   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14015 
14016   /* "fastavro/_read.pyx":904
14017  *         }
14018  *
14019  *         self._schema = json.loads(self.metadata['avro.schema'])             # <<<<<<<<<<<<<<
14020  *         self.codec = self.metadata.get('avro.codec', 'null')
14021  *
14022  */
14023   __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_json); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 904, __pyx_L1_error)
14024   __Pyx_GOTREF(__pyx_t_7);
14025   __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_loads); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 904, __pyx_L1_error)
14026   __Pyx_GOTREF(__pyx_t_6);
14027   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14028   __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_metadata); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 904, __pyx_L1_error)
14029   __Pyx_GOTREF(__pyx_t_7);
14030   __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_7, __pyx_kp_s_avro_schema); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 904, __pyx_L1_error)
14031   __Pyx_GOTREF(__pyx_t_4);
14032   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14033   __pyx_t_7 = NULL;
14034   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
14035     __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
14036     if (likely(__pyx_t_7)) {
14037       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
14038       __Pyx_INCREF(__pyx_t_7);
14039       __Pyx_INCREF(function);
14040       __Pyx_DECREF_SET(__pyx_t_6, function);
14041     }
14042   }
14043   __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4);
14044   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
14045   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14046   if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 904, __pyx_L1_error)
14047   __Pyx_GOTREF(__pyx_t_5);
14048   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14049   if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_schema, __pyx_t_5) < 0) __PYX_ERR(0, 904, __pyx_L1_error)
14050   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14051 
14052   /* "fastavro/_read.pyx":905
14053  *
14054  *         self._schema = json.loads(self.metadata['avro.schema'])
14055  *         self.codec = self.metadata.get('avro.codec', 'null')             # <<<<<<<<<<<<<<
14056  *
14057  *         self._named_schemas = {}
14058  */
14059   __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_metadata); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 905, __pyx_L1_error)
14060   __Pyx_GOTREF(__pyx_t_5);
14061   __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_get); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 905, __pyx_L1_error)
14062   __Pyx_GOTREF(__pyx_t_6);
14063   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14064   __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 905, __pyx_L1_error)
14065   __Pyx_GOTREF(__pyx_t_5);
14066   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14067   if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_codec, __pyx_t_5) < 0) __PYX_ERR(0, 905, __pyx_L1_error)
14068   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14069 
14070   /* "fastavro/_read.pyx":907
14071  *         self.codec = self.metadata.get('avro.codec', 'null')
14072  *
14073  *         self._named_schemas = {}             # <<<<<<<<<<<<<<
14074  *         if reader_schema:
14075  *             self.reader_schema = parse_schema(
14076  */
14077   __pyx_t_5 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 907, __pyx_L1_error)
14078   __Pyx_GOTREF(__pyx_t_5);
14079   if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_named_schemas_2, __pyx_t_5) < 0) __PYX_ERR(0, 907, __pyx_L1_error)
14080   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14081 
14082   /* "fastavro/_read.pyx":908
14083  *
14084  *         self._named_schemas = {}
14085  *         if reader_schema:             # <<<<<<<<<<<<<<
14086  *             self.reader_schema = parse_schema(
14087  *                 reader_schema,
14088  */
14089   __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_v_reader_schema); if (unlikely(__pyx_t_15 < 0)) __PYX_ERR(0, 908, __pyx_L1_error)
14090   if (__pyx_t_15) {
14091 
14092     /* "fastavro/_read.pyx":909
14093  *         self._named_schemas = {}
14094  *         if reader_schema:
14095  *             self.reader_schema = parse_schema(             # <<<<<<<<<<<<<<
14096  *                 reader_schema,
14097  *                 _write_hint=False,
14098  */
14099     __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_parse_schema); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 909, __pyx_L1_error)
14100     __Pyx_GOTREF(__pyx_t_5);
14101 
14102     /* "fastavro/_read.pyx":910
14103  *         if reader_schema:
14104  *             self.reader_schema = parse_schema(
14105  *                 reader_schema,             # <<<<<<<<<<<<<<
14106  *                 _write_hint=False,
14107  *                 _named_schemas=self._named_schemas,
14108  */
14109     __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 909, __pyx_L1_error)
14110     __Pyx_GOTREF(__pyx_t_6);
14111     __Pyx_INCREF(__pyx_v_reader_schema);
14112     __Pyx_GIVEREF(__pyx_v_reader_schema);
14113     PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_reader_schema);
14114 
14115     /* "fastavro/_read.pyx":911
14116  *             self.reader_schema = parse_schema(
14117  *                 reader_schema,
14118  *                 _write_hint=False,             # <<<<<<<<<<<<<<
14119  *                 _named_schemas=self._named_schemas,
14120  *             )
14121  */
14122     __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 911, __pyx_L1_error)
14123     __Pyx_GOTREF(__pyx_t_4);
14124     if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_write_hint, Py_False) < 0) __PYX_ERR(0, 911, __pyx_L1_error)
14125 
14126     /* "fastavro/_read.pyx":912
14127  *                 reader_schema,
14128  *                 _write_hint=False,
14129  *                 _named_schemas=self._named_schemas,             # <<<<<<<<<<<<<<
14130  *             )
14131  *         else:
14132  */
14133     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_named_schemas_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 912, __pyx_L1_error)
14134     __Pyx_GOTREF(__pyx_t_7);
14135     if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_named_schemas_2, __pyx_t_7) < 0) __PYX_ERR(0, 911, __pyx_L1_error)
14136     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14137 
14138     /* "fastavro/_read.pyx":909
14139  *         self._named_schemas = {}
14140  *         if reader_schema:
14141  *             self.reader_schema = parse_schema(             # <<<<<<<<<<<<<<
14142  *                 reader_schema,
14143  *                 _write_hint=False,
14144  */
14145     __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 909, __pyx_L1_error)
14146     __Pyx_GOTREF(__pyx_t_7);
14147     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14148     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14149     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14150     if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_reader_schema, __pyx_t_7) < 0) __PYX_ERR(0, 909, __pyx_L1_error)
14151     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14152 
14153     /* "fastavro/_read.pyx":908
14154  *
14155  *         self._named_schemas = {}
14156  *         if reader_schema:             # <<<<<<<<<<<<<<
14157  *             self.reader_schema = parse_schema(
14158  *                 reader_schema,
14159  */
14160     goto __pyx_L19;
14161   }
14162 
14163   /* "fastavro/_read.pyx":915
14164  *             )
14165  *         else:
14166  *             self.reader_schema = None             # <<<<<<<<<<<<<<
14167  *
14168  *         self.writer_schema = parse_schema(
14169  */
14170   /*else*/ {
14171     if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_reader_schema, Py_None) < 0) __PYX_ERR(0, 915, __pyx_L1_error)
14172   }
14173   __pyx_L19:;
14174 
14175   /* "fastavro/_read.pyx":917
14176  *             self.reader_schema = None
14177  *
14178  *         self.writer_schema = parse_schema(             # <<<<<<<<<<<<<<
14179  *             self._schema,
14180  *             _write_hint=False,
14181  */
14182   __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_parse_schema); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 917, __pyx_L1_error)
14183   __Pyx_GOTREF(__pyx_t_7);
14184 
14185   /* "fastavro/_read.pyx":918
14186  *
14187  *         self.writer_schema = parse_schema(
14188  *             self._schema,             # <<<<<<<<<<<<<<
14189  *             _write_hint=False,
14190  *             _force=True,
14191  */
14192   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_schema); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 918, __pyx_L1_error)
14193   __Pyx_GOTREF(__pyx_t_4);
14194 
14195   /* "fastavro/_read.pyx":917
14196  *             self.reader_schema = None
14197  *
14198  *         self.writer_schema = parse_schema(             # <<<<<<<<<<<<<<
14199  *             self._schema,
14200  *             _write_hint=False,
14201  */
14202   __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 917, __pyx_L1_error)
14203   __Pyx_GOTREF(__pyx_t_6);
14204   __Pyx_GIVEREF(__pyx_t_4);
14205   PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
14206   __pyx_t_4 = 0;
14207 
14208   /* "fastavro/_read.pyx":919
14209  *         self.writer_schema = parse_schema(
14210  *             self._schema,
14211  *             _write_hint=False,             # <<<<<<<<<<<<<<
14212  *             _force=True,
14213  *             _named_schemas=self._named_schemas,
14214  */
14215   __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 919, __pyx_L1_error)
14216   __Pyx_GOTREF(__pyx_t_4);
14217   if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_write_hint, Py_False) < 0) __PYX_ERR(0, 919, __pyx_L1_error)
14218 
14219   /* "fastavro/_read.pyx":920
14220  *             self._schema,
14221  *             _write_hint=False,
14222  *             _force=True,             # <<<<<<<<<<<<<<
14223  *             _named_schemas=self._named_schemas,
14224  *         )
14225  */
14226   if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_force, Py_True) < 0) __PYX_ERR(0, 919, __pyx_L1_error)
14227 
14228   /* "fastavro/_read.pyx":921
14229  *             _write_hint=False,
14230  *             _force=True,
14231  *             _named_schemas=self._named_schemas,             # <<<<<<<<<<<<<<
14232  *         )
14233  *
14234  */
14235   __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_named_schemas_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 921, __pyx_L1_error)
14236   __Pyx_GOTREF(__pyx_t_5);
14237   if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_named_schemas_2, __pyx_t_5) < 0) __PYX_ERR(0, 919, __pyx_L1_error)
14238   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14239 
14240   /* "fastavro/_read.pyx":917
14241  *             self.reader_schema = None
14242  *
14243  *         self.writer_schema = parse_schema(             # <<<<<<<<<<<<<<
14244  *             self._schema,
14245  *             _write_hint=False,
14246  */
14247   __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 917, __pyx_L1_error)
14248   __Pyx_GOTREF(__pyx_t_5);
14249   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14250   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14251   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14252   if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_writer_schema, __pyx_t_5) < 0) __PYX_ERR(0, 917, __pyx_L1_error)
14253   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14254 
14255   /* "fastavro/_read.pyx":924
14256  *         )
14257  *
14258  *         self._elems = None             # <<<<<<<<<<<<<<
14259  *
14260  *     @property
14261  */
14262   if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_elems, Py_None) < 0) __PYX_ERR(0, 924, __pyx_L1_error)
14263 
14264   /* "fastavro/_read.pyx":890
14265  *
14266  * class file_reader:
14267  *     def __init__(self, fo, reader_schema=None, return_record_name=False):             # <<<<<<<<<<<<<<
14268  *         self.fo = fo
14269  *         self.return_record_name = return_record_name
14270  */
14271 
14272   /* function exit code */
14273   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14274   goto __pyx_L0;
14275   __pyx_L1_error:;
14276   __Pyx_XDECREF(__pyx_t_4);
14277   __Pyx_XDECREF(__pyx_t_5);
14278   __Pyx_XDECREF(__pyx_t_6);
14279   __Pyx_XDECREF(__pyx_t_7);
14280   __Pyx_XDECREF(__pyx_t_10);
14281   __Pyx_XDECREF(__pyx_t_13);
14282   __Pyx_AddTraceback("fastavro._read.file_reader.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14283   __pyx_r = NULL;
14284   __pyx_L0:;
14285   __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_k);
14286   __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_v);
14287   __Pyx_XGIVEREF(__pyx_r);
14288   __Pyx_RefNannyFinishContext();
14289   return __pyx_r;
14290 }
14291 
14292 /* "fastavro/_read.pyx":927
14293  *
14294  *     @property
14295  *     def schema(self):             # <<<<<<<<<<<<<<
14296  *         import warnings
14297  *         warnings.warn(
14298  */
14299 
14300 /* Python wrapper */
14301 static PyObject *__pyx_pw_8fastavro_5_read_11file_reader_3schema(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
14302 static PyMethodDef __pyx_mdef_8fastavro_5_read_11file_reader_3schema = {"schema", (PyCFunction)__pyx_pw_8fastavro_5_read_11file_reader_3schema, METH_O, 0};
__pyx_pw_8fastavro_5_read_11file_reader_3schema(PyObject * __pyx_self,PyObject * __pyx_v_self)14303 static PyObject *__pyx_pw_8fastavro_5_read_11file_reader_3schema(PyObject *__pyx_self, PyObject *__pyx_v_self) {
14304   PyObject *__pyx_r = 0;
14305   __Pyx_RefNannyDeclarations
14306   __Pyx_RefNannySetupContext("schema (wrapper)", 0);
14307   __pyx_r = __pyx_pf_8fastavro_5_read_11file_reader_2schema(__pyx_self, ((PyObject *)__pyx_v_self));
14308 
14309   /* function exit code */
14310   __Pyx_RefNannyFinishContext();
14311   return __pyx_r;
14312 }
14313 
__pyx_pf_8fastavro_5_read_11file_reader_2schema(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_self)14314 static PyObject *__pyx_pf_8fastavro_5_read_11file_reader_2schema(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
14315   PyObject *__pyx_v_warnings = NULL;
14316   PyObject *__pyx_r = NULL;
14317   __Pyx_RefNannyDeclarations
14318   PyObject *__pyx_t_1 = NULL;
14319   PyObject *__pyx_t_2 = NULL;
14320   int __pyx_lineno = 0;
14321   const char *__pyx_filename = NULL;
14322   int __pyx_clineno = 0;
14323   __Pyx_RefNannySetupContext("schema", 0);
14324 
14325   /* "fastavro/_read.pyx":928
14326  *     @property
14327  *     def schema(self):
14328  *         import warnings             # <<<<<<<<<<<<<<
14329  *         warnings.warn(
14330  *             "The 'schema' attribute is deprecated. Please use 'writer_schema'",
14331  */
14332   __pyx_t_1 = __Pyx_Import(__pyx_n_s_warnings, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 928, __pyx_L1_error)
14333   __Pyx_GOTREF(__pyx_t_1);
14334   __pyx_v_warnings = __pyx_t_1;
14335   __pyx_t_1 = 0;
14336 
14337   /* "fastavro/_read.pyx":929
14338  *     def schema(self):
14339  *         import warnings
14340  *         warnings.warn(             # <<<<<<<<<<<<<<
14341  *             "The 'schema' attribute is deprecated. Please use 'writer_schema'",
14342  *             DeprecationWarning,
14343  */
14344   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_warnings, __pyx_n_s_warn); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 929, __pyx_L1_error)
14345   __Pyx_GOTREF(__pyx_t_1);
14346 
14347   /* "fastavro/_read.pyx":931
14348  *         warnings.warn(
14349  *             "The 'schema' attribute is deprecated. Please use 'writer_schema'",
14350  *             DeprecationWarning,             # <<<<<<<<<<<<<<
14351  *         )
14352  *         return self._schema
14353  */
14354   __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 929, __pyx_L1_error)
14355   __Pyx_GOTREF(__pyx_t_2);
14356   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14357   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14358 
14359   /* "fastavro/_read.pyx":933
14360  *             DeprecationWarning,
14361  *         )
14362  *         return self._schema             # <<<<<<<<<<<<<<
14363  *
14364  *     def __iter__(self):
14365  */
14366   __Pyx_XDECREF(__pyx_r);
14367   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_schema); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 933, __pyx_L1_error)
14368   __Pyx_GOTREF(__pyx_t_2);
14369   __pyx_r = __pyx_t_2;
14370   __pyx_t_2 = 0;
14371   goto __pyx_L0;
14372 
14373   /* "fastavro/_read.pyx":927
14374  *
14375  *     @property
14376  *     def schema(self):             # <<<<<<<<<<<<<<
14377  *         import warnings
14378  *         warnings.warn(
14379  */
14380 
14381   /* function exit code */
14382   __pyx_L1_error:;
14383   __Pyx_XDECREF(__pyx_t_1);
14384   __Pyx_XDECREF(__pyx_t_2);
14385   __Pyx_AddTraceback("fastavro._read.file_reader.schema", __pyx_clineno, __pyx_lineno, __pyx_filename);
14386   __pyx_r = NULL;
14387   __pyx_L0:;
14388   __Pyx_XDECREF(__pyx_v_warnings);
14389   __Pyx_XGIVEREF(__pyx_r);
14390   __Pyx_RefNannyFinishContext();
14391   return __pyx_r;
14392 }
14393 
14394 /* "fastavro/_read.pyx":935
14395  *         return self._schema
14396  *
14397  *     def __iter__(self):             # <<<<<<<<<<<<<<
14398  *         if not self._elems:
14399  *             raise NotImplementedError
14400  */
14401 
14402 /* Python wrapper */
14403 static PyObject *__pyx_pw_8fastavro_5_read_11file_reader_5__iter__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
14404 static PyMethodDef __pyx_mdef_8fastavro_5_read_11file_reader_5__iter__ = {"__iter__", (PyCFunction)__pyx_pw_8fastavro_5_read_11file_reader_5__iter__, METH_O, 0};
__pyx_pw_8fastavro_5_read_11file_reader_5__iter__(PyObject * __pyx_self,PyObject * __pyx_v_self)14405 static PyObject *__pyx_pw_8fastavro_5_read_11file_reader_5__iter__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
14406   PyObject *__pyx_r = 0;
14407   __Pyx_RefNannyDeclarations
14408   __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
14409   __pyx_r = __pyx_pf_8fastavro_5_read_11file_reader_4__iter__(__pyx_self, ((PyObject *)__pyx_v_self));
14410 
14411   /* function exit code */
14412   __Pyx_RefNannyFinishContext();
14413   return __pyx_r;
14414 }
14415 
__pyx_pf_8fastavro_5_read_11file_reader_4__iter__(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_self)14416 static PyObject *__pyx_pf_8fastavro_5_read_11file_reader_4__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
14417   PyObject *__pyx_r = NULL;
14418   __Pyx_RefNannyDeclarations
14419   PyObject *__pyx_t_1 = NULL;
14420   int __pyx_t_2;
14421   int __pyx_t_3;
14422   int __pyx_lineno = 0;
14423   const char *__pyx_filename = NULL;
14424   int __pyx_clineno = 0;
14425   __Pyx_RefNannySetupContext("__iter__", 0);
14426 
14427   /* "fastavro/_read.pyx":936
14428  *
14429  *     def __iter__(self):
14430  *         if not self._elems:             # <<<<<<<<<<<<<<
14431  *             raise NotImplementedError
14432  *         return self._elems
14433  */
14434   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_elems); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 936, __pyx_L1_error)
14435   __Pyx_GOTREF(__pyx_t_1);
14436   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 936, __pyx_L1_error)
14437   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14438   __pyx_t_3 = ((!__pyx_t_2) != 0);
14439   if (unlikely(__pyx_t_3)) {
14440 
14441     /* "fastavro/_read.pyx":937
14442  *     def __iter__(self):
14443  *         if not self._elems:
14444  *             raise NotImplementedError             # <<<<<<<<<<<<<<
14445  *         return self._elems
14446  *
14447  */
14448     __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
14449     __PYX_ERR(0, 937, __pyx_L1_error)
14450 
14451     /* "fastavro/_read.pyx":936
14452  *
14453  *     def __iter__(self):
14454  *         if not self._elems:             # <<<<<<<<<<<<<<
14455  *             raise NotImplementedError
14456  *         return self._elems
14457  */
14458   }
14459 
14460   /* "fastavro/_read.pyx":938
14461  *         if not self._elems:
14462  *             raise NotImplementedError
14463  *         return self._elems             # <<<<<<<<<<<<<<
14464  *
14465  *     def next(self):
14466  */
14467   __Pyx_XDECREF(__pyx_r);
14468   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_elems); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 938, __pyx_L1_error)
14469   __Pyx_GOTREF(__pyx_t_1);
14470   __pyx_r = __pyx_t_1;
14471   __pyx_t_1 = 0;
14472   goto __pyx_L0;
14473 
14474   /* "fastavro/_read.pyx":935
14475  *         return self._schema
14476  *
14477  *     def __iter__(self):             # <<<<<<<<<<<<<<
14478  *         if not self._elems:
14479  *             raise NotImplementedError
14480  */
14481 
14482   /* function exit code */
14483   __pyx_L1_error:;
14484   __Pyx_XDECREF(__pyx_t_1);
14485   __Pyx_AddTraceback("fastavro._read.file_reader.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14486   __pyx_r = NULL;
14487   __pyx_L0:;
14488   __Pyx_XGIVEREF(__pyx_r);
14489   __Pyx_RefNannyFinishContext();
14490   return __pyx_r;
14491 }
14492 
14493 /* "fastavro/_read.pyx":940
14494  *         return self._elems
14495  *
14496  *     def next(self):             # <<<<<<<<<<<<<<
14497  *         return next(self._elems)
14498  *
14499  */
14500 
14501 /* Python wrapper */
14502 static PyObject *__pyx_pw_8fastavro_5_read_11file_reader_7next(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
14503 static PyMethodDef __pyx_mdef_8fastavro_5_read_11file_reader_7next = {"next", (PyCFunction)__pyx_pw_8fastavro_5_read_11file_reader_7next, METH_O, 0};
__pyx_pw_8fastavro_5_read_11file_reader_7next(PyObject * __pyx_self,PyObject * __pyx_v_self)14504 static PyObject *__pyx_pw_8fastavro_5_read_11file_reader_7next(PyObject *__pyx_self, PyObject *__pyx_v_self) {
14505   PyObject *__pyx_r = 0;
14506   __Pyx_RefNannyDeclarations
14507   __Pyx_RefNannySetupContext("next (wrapper)", 0);
14508   __pyx_r = __pyx_pf_8fastavro_5_read_11file_reader_6next(__pyx_self, ((PyObject *)__pyx_v_self));
14509 
14510   /* function exit code */
14511   __Pyx_RefNannyFinishContext();
14512   return __pyx_r;
14513 }
14514 
__pyx_pf_8fastavro_5_read_11file_reader_6next(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_self)14515 static PyObject *__pyx_pf_8fastavro_5_read_11file_reader_6next(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
14516   PyObject *__pyx_r = NULL;
14517   __Pyx_RefNannyDeclarations
14518   PyObject *__pyx_t_1 = NULL;
14519   PyObject *__pyx_t_2 = NULL;
14520   int __pyx_lineno = 0;
14521   const char *__pyx_filename = NULL;
14522   int __pyx_clineno = 0;
14523   __Pyx_RefNannySetupContext("next", 0);
14524 
14525   /* "fastavro/_read.pyx":941
14526  *
14527  *     def next(self):
14528  *         return next(self._elems)             # <<<<<<<<<<<<<<
14529  *
14530  *     __next__ = next
14531  */
14532   __Pyx_XDECREF(__pyx_r);
14533   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_elems); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 941, __pyx_L1_error)
14534   __Pyx_GOTREF(__pyx_t_1);
14535   __pyx_t_2 = __Pyx_PyIter_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 941, __pyx_L1_error)
14536   __Pyx_GOTREF(__pyx_t_2);
14537   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14538   __pyx_r = __pyx_t_2;
14539   __pyx_t_2 = 0;
14540   goto __pyx_L0;
14541 
14542   /* "fastavro/_read.pyx":940
14543  *         return self._elems
14544  *
14545  *     def next(self):             # <<<<<<<<<<<<<<
14546  *         return next(self._elems)
14547  *
14548  */
14549 
14550   /* function exit code */
14551   __pyx_L1_error:;
14552   __Pyx_XDECREF(__pyx_t_1);
14553   __Pyx_XDECREF(__pyx_t_2);
14554   __Pyx_AddTraceback("fastavro._read.file_reader.next", __pyx_clineno, __pyx_lineno, __pyx_filename);
14555   __pyx_r = NULL;
14556   __pyx_L0:;
14557   __Pyx_XGIVEREF(__pyx_r);
14558   __Pyx_RefNannyFinishContext();
14559   return __pyx_r;
14560 }
14561 
14562 /* "fastavro/_read.pyx":947
14563  *
14564  * class reader(file_reader):
14565  *     def __init__(self, fo, reader_schema=None, return_record_name=False):             # <<<<<<<<<<<<<<
14566  *         file_reader.__init__(self, fo, reader_schema, return_record_name)
14567  *
14568  */
14569 
14570 /* Python wrapper */
14571 static PyObject *__pyx_pw_8fastavro_5_read_6reader_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
14572 static PyMethodDef __pyx_mdef_8fastavro_5_read_6reader_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8fastavro_5_read_6reader_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_8fastavro_5_read_6reader_1__init__(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)14573 static PyObject *__pyx_pw_8fastavro_5_read_6reader_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14574   PyObject *__pyx_v_self = 0;
14575   PyObject *__pyx_v_fo = 0;
14576   PyObject *__pyx_v_reader_schema = 0;
14577   PyObject *__pyx_v_return_record_name = 0;
14578   int __pyx_lineno = 0;
14579   const char *__pyx_filename = NULL;
14580   int __pyx_clineno = 0;
14581   PyObject *__pyx_r = 0;
14582   __Pyx_RefNannyDeclarations
14583   __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
14584   {
14585     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_fo,&__pyx_n_s_reader_schema,&__pyx_n_s_return_record_name,0};
14586     PyObject* values[4] = {0,0,0,0};
14587     values[2] = ((PyObject *)((PyObject *)Py_None));
14588     values[3] = ((PyObject *)((PyObject *)Py_False));
14589     if (unlikely(__pyx_kwds)) {
14590       Py_ssize_t kw_args;
14591       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14592       switch (pos_args) {
14593         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
14594         CYTHON_FALLTHROUGH;
14595         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
14596         CYTHON_FALLTHROUGH;
14597         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14598         CYTHON_FALLTHROUGH;
14599         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14600         CYTHON_FALLTHROUGH;
14601         case  0: break;
14602         default: goto __pyx_L5_argtuple_error;
14603       }
14604       kw_args = PyDict_Size(__pyx_kwds);
14605       switch (pos_args) {
14606         case  0:
14607         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
14608         else goto __pyx_L5_argtuple_error;
14609         CYTHON_FALLTHROUGH;
14610         case  1:
14611         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fo)) != 0)) kw_args--;
14612         else {
14613           __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, 1); __PYX_ERR(0, 947, __pyx_L3_error)
14614         }
14615         CYTHON_FALLTHROUGH;
14616         case  2:
14617         if (kw_args > 0) {
14618           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_reader_schema);
14619           if (value) { values[2] = value; kw_args--; }
14620         }
14621         CYTHON_FALLTHROUGH;
14622         case  3:
14623         if (kw_args > 0) {
14624           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_return_record_name);
14625           if (value) { values[3] = value; kw_args--; }
14626         }
14627       }
14628       if (unlikely(kw_args > 0)) {
14629         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 947, __pyx_L3_error)
14630       }
14631     } else {
14632       switch (PyTuple_GET_SIZE(__pyx_args)) {
14633         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
14634         CYTHON_FALLTHROUGH;
14635         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
14636         CYTHON_FALLTHROUGH;
14637         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14638         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14639         break;
14640         default: goto __pyx_L5_argtuple_error;
14641       }
14642     }
14643     __pyx_v_self = values[0];
14644     __pyx_v_fo = values[1];
14645     __pyx_v_reader_schema = values[2];
14646     __pyx_v_return_record_name = values[3];
14647   }
14648   goto __pyx_L4_argument_unpacking_done;
14649   __pyx_L5_argtuple_error:;
14650   __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 947, __pyx_L3_error)
14651   __pyx_L3_error:;
14652   __Pyx_AddTraceback("fastavro._read.reader.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14653   __Pyx_RefNannyFinishContext();
14654   return NULL;
14655   __pyx_L4_argument_unpacking_done:;
14656   __pyx_r = __pyx_pf_8fastavro_5_read_6reader___init__(__pyx_self, __pyx_v_self, __pyx_v_fo, __pyx_v_reader_schema, __pyx_v_return_record_name);
14657 
14658   /* function exit code */
14659   __Pyx_RefNannyFinishContext();
14660   return __pyx_r;
14661 }
14662 
__pyx_pf_8fastavro_5_read_6reader___init__(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_self,PyObject * __pyx_v_fo,PyObject * __pyx_v_reader_schema,PyObject * __pyx_v_return_record_name)14663 static PyObject *__pyx_pf_8fastavro_5_read_6reader___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_fo, PyObject *__pyx_v_reader_schema, PyObject *__pyx_v_return_record_name) {
14664   PyObject *__pyx_r = NULL;
14665   __Pyx_RefNannyDeclarations
14666   PyObject *__pyx_t_1 = NULL;
14667   PyObject *__pyx_t_2 = NULL;
14668   PyObject *__pyx_t_3 = NULL;
14669   int __pyx_t_4;
14670   PyObject *__pyx_t_5 = NULL;
14671   PyObject *__pyx_t_6 = NULL;
14672   PyObject *__pyx_t_7 = NULL;
14673   PyObject *__pyx_t_8 = NULL;
14674   PyObject *__pyx_t_9 = NULL;
14675   PyObject *__pyx_t_10 = NULL;
14676   PyObject *__pyx_t_11 = NULL;
14677   PyObject *__pyx_t_12 = NULL;
14678   int __pyx_lineno = 0;
14679   const char *__pyx_filename = NULL;
14680   int __pyx_clineno = 0;
14681   __Pyx_RefNannySetupContext("__init__", 0);
14682 
14683   /* "fastavro/_read.pyx":948
14684  * class reader(file_reader):
14685  *     def __init__(self, fo, reader_schema=None, return_record_name=False):
14686  *         file_reader.__init__(self, fo, reader_schema, return_record_name)             # <<<<<<<<<<<<<<
14687  *
14688  *         self._elems = _iter_avro_records(self.fo,
14689  */
14690   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_file_reader); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 948, __pyx_L1_error)
14691   __Pyx_GOTREF(__pyx_t_2);
14692   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 948, __pyx_L1_error)
14693   __Pyx_GOTREF(__pyx_t_3);
14694   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14695   __pyx_t_2 = NULL;
14696   __pyx_t_4 = 0;
14697   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
14698     __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
14699     if (likely(__pyx_t_2)) {
14700       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
14701       __Pyx_INCREF(__pyx_t_2);
14702       __Pyx_INCREF(function);
14703       __Pyx_DECREF_SET(__pyx_t_3, function);
14704       __pyx_t_4 = 1;
14705     }
14706   }
14707   #if CYTHON_FAST_PYCALL
14708   if (PyFunction_Check(__pyx_t_3)) {
14709     PyObject *__pyx_temp[5] = {__pyx_t_2, __pyx_v_self, __pyx_v_fo, __pyx_v_reader_schema, __pyx_v_return_record_name};
14710     __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 948, __pyx_L1_error)
14711     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
14712     __Pyx_GOTREF(__pyx_t_1);
14713   } else
14714   #endif
14715   #if CYTHON_FAST_PYCCALL
14716   if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
14717     PyObject *__pyx_temp[5] = {__pyx_t_2, __pyx_v_self, __pyx_v_fo, __pyx_v_reader_schema, __pyx_v_return_record_name};
14718     __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 948, __pyx_L1_error)
14719     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
14720     __Pyx_GOTREF(__pyx_t_1);
14721   } else
14722   #endif
14723   {
14724     __pyx_t_5 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 948, __pyx_L1_error)
14725     __Pyx_GOTREF(__pyx_t_5);
14726     if (__pyx_t_2) {
14727       __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
14728     }
14729     __Pyx_INCREF(__pyx_v_self);
14730     __Pyx_GIVEREF(__pyx_v_self);
14731     PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_self);
14732     __Pyx_INCREF(__pyx_v_fo);
14733     __Pyx_GIVEREF(__pyx_v_fo);
14734     PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_fo);
14735     __Pyx_INCREF(__pyx_v_reader_schema);
14736     __Pyx_GIVEREF(__pyx_v_reader_schema);
14737     PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_reader_schema);
14738     __Pyx_INCREF(__pyx_v_return_record_name);
14739     __Pyx_GIVEREF(__pyx_v_return_record_name);
14740     PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_return_record_name);
14741     __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 948, __pyx_L1_error)
14742     __Pyx_GOTREF(__pyx_t_1);
14743     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14744   }
14745   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14746   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14747 
14748   /* "fastavro/_read.pyx":950
14749  *         file_reader.__init__(self, fo, reader_schema, return_record_name)
14750  *
14751  *         self._elems = _iter_avro_records(self.fo,             # <<<<<<<<<<<<<<
14752  *                                          self._header,
14753  *                                          self.codec,
14754  */
14755   __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_iter_avro_records); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 950, __pyx_L1_error)
14756   __Pyx_GOTREF(__pyx_t_3);
14757   __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_fo); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 950, __pyx_L1_error)
14758   __Pyx_GOTREF(__pyx_t_5);
14759 
14760   /* "fastavro/_read.pyx":951
14761  *
14762  *         self._elems = _iter_avro_records(self.fo,
14763  *                                          self._header,             # <<<<<<<<<<<<<<
14764  *                                          self.codec,
14765  *                                          self.writer_schema,
14766  */
14767   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_header_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 951, __pyx_L1_error)
14768   __Pyx_GOTREF(__pyx_t_2);
14769 
14770   /* "fastavro/_read.pyx":952
14771  *         self._elems = _iter_avro_records(self.fo,
14772  *                                          self._header,
14773  *                                          self.codec,             # <<<<<<<<<<<<<<
14774  *                                          self.writer_schema,
14775  *                                          self._named_schemas,
14776  */
14777   __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_codec); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 952, __pyx_L1_error)
14778   __Pyx_GOTREF(__pyx_t_6);
14779 
14780   /* "fastavro/_read.pyx":953
14781  *                                          self._header,
14782  *                                          self.codec,
14783  *                                          self.writer_schema,             # <<<<<<<<<<<<<<
14784  *                                          self._named_schemas,
14785  *                                          self.reader_schema,
14786  */
14787   __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_writer_schema); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 953, __pyx_L1_error)
14788   __Pyx_GOTREF(__pyx_t_7);
14789 
14790   /* "fastavro/_read.pyx":954
14791  *                                          self.codec,
14792  *                                          self.writer_schema,
14793  *                                          self._named_schemas,             # <<<<<<<<<<<<<<
14794  *                                          self.reader_schema,
14795  *                                          self.return_record_name)
14796  */
14797   __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_named_schemas_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 954, __pyx_L1_error)
14798   __Pyx_GOTREF(__pyx_t_8);
14799 
14800   /* "fastavro/_read.pyx":955
14801  *                                          self.writer_schema,
14802  *                                          self._named_schemas,
14803  *                                          self.reader_schema,             # <<<<<<<<<<<<<<
14804  *                                          self.return_record_name)
14805  *
14806  */
14807   __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_reader_schema); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 955, __pyx_L1_error)
14808   __Pyx_GOTREF(__pyx_t_9);
14809 
14810   /* "fastavro/_read.pyx":956
14811  *                                          self._named_schemas,
14812  *                                          self.reader_schema,
14813  *                                          self.return_record_name)             # <<<<<<<<<<<<<<
14814  *
14815  *
14816  */
14817   __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_return_record_name); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 956, __pyx_L1_error)
14818   __Pyx_GOTREF(__pyx_t_10);
14819   __pyx_t_11 = NULL;
14820   __pyx_t_4 = 0;
14821   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
14822     __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_3);
14823     if (likely(__pyx_t_11)) {
14824       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
14825       __Pyx_INCREF(__pyx_t_11);
14826       __Pyx_INCREF(function);
14827       __Pyx_DECREF_SET(__pyx_t_3, function);
14828       __pyx_t_4 = 1;
14829     }
14830   }
14831   #if CYTHON_FAST_PYCALL
14832   if (PyFunction_Check(__pyx_t_3)) {
14833     PyObject *__pyx_temp[8] = {__pyx_t_11, __pyx_t_5, __pyx_t_2, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10};
14834     __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 7+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 950, __pyx_L1_error)
14835     __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
14836     __Pyx_GOTREF(__pyx_t_1);
14837     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14838     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14839     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14840     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14841     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
14842     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14843     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14844   } else
14845   #endif
14846   #if CYTHON_FAST_PYCCALL
14847   if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
14848     PyObject *__pyx_temp[8] = {__pyx_t_11, __pyx_t_5, __pyx_t_2, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10};
14849     __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 7+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 950, __pyx_L1_error)
14850     __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
14851     __Pyx_GOTREF(__pyx_t_1);
14852     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14853     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14854     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14855     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14856     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
14857     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14858     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14859   } else
14860   #endif
14861   {
14862     __pyx_t_12 = PyTuple_New(7+__pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 950, __pyx_L1_error)
14863     __Pyx_GOTREF(__pyx_t_12);
14864     if (__pyx_t_11) {
14865       __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
14866     }
14867     __Pyx_GIVEREF(__pyx_t_5);
14868     PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_4, __pyx_t_5);
14869     __Pyx_GIVEREF(__pyx_t_2);
14870     PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_4, __pyx_t_2);
14871     __Pyx_GIVEREF(__pyx_t_6);
14872     PyTuple_SET_ITEM(__pyx_t_12, 2+__pyx_t_4, __pyx_t_6);
14873     __Pyx_GIVEREF(__pyx_t_7);
14874     PyTuple_SET_ITEM(__pyx_t_12, 3+__pyx_t_4, __pyx_t_7);
14875     __Pyx_GIVEREF(__pyx_t_8);
14876     PyTuple_SET_ITEM(__pyx_t_12, 4+__pyx_t_4, __pyx_t_8);
14877     __Pyx_GIVEREF(__pyx_t_9);
14878     PyTuple_SET_ITEM(__pyx_t_12, 5+__pyx_t_4, __pyx_t_9);
14879     __Pyx_GIVEREF(__pyx_t_10);
14880     PyTuple_SET_ITEM(__pyx_t_12, 6+__pyx_t_4, __pyx_t_10);
14881     __pyx_t_5 = 0;
14882     __pyx_t_2 = 0;
14883     __pyx_t_6 = 0;
14884     __pyx_t_7 = 0;
14885     __pyx_t_8 = 0;
14886     __pyx_t_9 = 0;
14887     __pyx_t_10 = 0;
14888     __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 950, __pyx_L1_error)
14889     __Pyx_GOTREF(__pyx_t_1);
14890     __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
14891   }
14892   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14893 
14894   /* "fastavro/_read.pyx":950
14895  *         file_reader.__init__(self, fo, reader_schema, return_record_name)
14896  *
14897  *         self._elems = _iter_avro_records(self.fo,             # <<<<<<<<<<<<<<
14898  *                                          self._header,
14899  *                                          self.codec,
14900  */
14901   if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_elems, __pyx_t_1) < 0) __PYX_ERR(0, 950, __pyx_L1_error)
14902   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14903 
14904   /* "fastavro/_read.pyx":947
14905  *
14906  * class reader(file_reader):
14907  *     def __init__(self, fo, reader_schema=None, return_record_name=False):             # <<<<<<<<<<<<<<
14908  *         file_reader.__init__(self, fo, reader_schema, return_record_name)
14909  *
14910  */
14911 
14912   /* function exit code */
14913   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14914   goto __pyx_L0;
14915   __pyx_L1_error:;
14916   __Pyx_XDECREF(__pyx_t_1);
14917   __Pyx_XDECREF(__pyx_t_2);
14918   __Pyx_XDECREF(__pyx_t_3);
14919   __Pyx_XDECREF(__pyx_t_5);
14920   __Pyx_XDECREF(__pyx_t_6);
14921   __Pyx_XDECREF(__pyx_t_7);
14922   __Pyx_XDECREF(__pyx_t_8);
14923   __Pyx_XDECREF(__pyx_t_9);
14924   __Pyx_XDECREF(__pyx_t_10);
14925   __Pyx_XDECREF(__pyx_t_11);
14926   __Pyx_XDECREF(__pyx_t_12);
14927   __Pyx_AddTraceback("fastavro._read.reader.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14928   __pyx_r = NULL;
14929   __pyx_L0:;
14930   __Pyx_XGIVEREF(__pyx_r);
14931   __Pyx_RefNannyFinishContext();
14932   return __pyx_r;
14933 }
14934 
14935 /* "fastavro/_read.pyx":960
14936  *
14937  * class block_reader(file_reader):
14938  *     def __init__(self, fo, reader_schema=None, return_record_name=False):             # <<<<<<<<<<<<<<
14939  *         file_reader.__init__(self, fo, reader_schema, return_record_name)
14940  *
14941  */
14942 
14943 /* Python wrapper */
14944 static PyObject *__pyx_pw_8fastavro_5_read_12block_reader_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
14945 static PyMethodDef __pyx_mdef_8fastavro_5_read_12block_reader_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8fastavro_5_read_12block_reader_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_8fastavro_5_read_12block_reader_1__init__(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)14946 static PyObject *__pyx_pw_8fastavro_5_read_12block_reader_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14947   PyObject *__pyx_v_self = 0;
14948   PyObject *__pyx_v_fo = 0;
14949   PyObject *__pyx_v_reader_schema = 0;
14950   PyObject *__pyx_v_return_record_name = 0;
14951   int __pyx_lineno = 0;
14952   const char *__pyx_filename = NULL;
14953   int __pyx_clineno = 0;
14954   PyObject *__pyx_r = 0;
14955   __Pyx_RefNannyDeclarations
14956   __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
14957   {
14958     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_fo,&__pyx_n_s_reader_schema,&__pyx_n_s_return_record_name,0};
14959     PyObject* values[4] = {0,0,0,0};
14960     values[2] = ((PyObject *)((PyObject *)Py_None));
14961     values[3] = ((PyObject *)((PyObject *)Py_False));
14962     if (unlikely(__pyx_kwds)) {
14963       Py_ssize_t kw_args;
14964       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14965       switch (pos_args) {
14966         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
14967         CYTHON_FALLTHROUGH;
14968         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
14969         CYTHON_FALLTHROUGH;
14970         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14971         CYTHON_FALLTHROUGH;
14972         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14973         CYTHON_FALLTHROUGH;
14974         case  0: break;
14975         default: goto __pyx_L5_argtuple_error;
14976       }
14977       kw_args = PyDict_Size(__pyx_kwds);
14978       switch (pos_args) {
14979         case  0:
14980         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
14981         else goto __pyx_L5_argtuple_error;
14982         CYTHON_FALLTHROUGH;
14983         case  1:
14984         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fo)) != 0)) kw_args--;
14985         else {
14986           __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, 1); __PYX_ERR(0, 960, __pyx_L3_error)
14987         }
14988         CYTHON_FALLTHROUGH;
14989         case  2:
14990         if (kw_args > 0) {
14991           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_reader_schema);
14992           if (value) { values[2] = value; kw_args--; }
14993         }
14994         CYTHON_FALLTHROUGH;
14995         case  3:
14996         if (kw_args > 0) {
14997           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_return_record_name);
14998           if (value) { values[3] = value; kw_args--; }
14999         }
15000       }
15001       if (unlikely(kw_args > 0)) {
15002         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 960, __pyx_L3_error)
15003       }
15004     } else {
15005       switch (PyTuple_GET_SIZE(__pyx_args)) {
15006         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
15007         CYTHON_FALLTHROUGH;
15008         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15009         CYTHON_FALLTHROUGH;
15010         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15011         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15012         break;
15013         default: goto __pyx_L5_argtuple_error;
15014       }
15015     }
15016     __pyx_v_self = values[0];
15017     __pyx_v_fo = values[1];
15018     __pyx_v_reader_schema = values[2];
15019     __pyx_v_return_record_name = values[3];
15020   }
15021   goto __pyx_L4_argument_unpacking_done;
15022   __pyx_L5_argtuple_error:;
15023   __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 960, __pyx_L3_error)
15024   __pyx_L3_error:;
15025   __Pyx_AddTraceback("fastavro._read.block_reader.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15026   __Pyx_RefNannyFinishContext();
15027   return NULL;
15028   __pyx_L4_argument_unpacking_done:;
15029   __pyx_r = __pyx_pf_8fastavro_5_read_12block_reader___init__(__pyx_self, __pyx_v_self, __pyx_v_fo, __pyx_v_reader_schema, __pyx_v_return_record_name);
15030 
15031   /* function exit code */
15032   __Pyx_RefNannyFinishContext();
15033   return __pyx_r;
15034 }
15035 
__pyx_pf_8fastavro_5_read_12block_reader___init__(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_self,PyObject * __pyx_v_fo,PyObject * __pyx_v_reader_schema,PyObject * __pyx_v_return_record_name)15036 static PyObject *__pyx_pf_8fastavro_5_read_12block_reader___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_fo, PyObject *__pyx_v_reader_schema, PyObject *__pyx_v_return_record_name) {
15037   PyObject *__pyx_r = NULL;
15038   __Pyx_RefNannyDeclarations
15039   PyObject *__pyx_t_1 = NULL;
15040   PyObject *__pyx_t_2 = NULL;
15041   PyObject *__pyx_t_3 = NULL;
15042   int __pyx_t_4;
15043   PyObject *__pyx_t_5 = NULL;
15044   PyObject *__pyx_t_6 = NULL;
15045   PyObject *__pyx_t_7 = NULL;
15046   PyObject *__pyx_t_8 = NULL;
15047   PyObject *__pyx_t_9 = NULL;
15048   PyObject *__pyx_t_10 = NULL;
15049   PyObject *__pyx_t_11 = NULL;
15050   PyObject *__pyx_t_12 = NULL;
15051   int __pyx_lineno = 0;
15052   const char *__pyx_filename = NULL;
15053   int __pyx_clineno = 0;
15054   __Pyx_RefNannySetupContext("__init__", 0);
15055 
15056   /* "fastavro/_read.pyx":961
15057  * class block_reader(file_reader):
15058  *     def __init__(self, fo, reader_schema=None, return_record_name=False):
15059  *         file_reader.__init__(self, fo, reader_schema, return_record_name)             # <<<<<<<<<<<<<<
15060  *
15061  *         self._elems = _iter_avro_blocks(self.fo,
15062  */
15063   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_file_reader); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 961, __pyx_L1_error)
15064   __Pyx_GOTREF(__pyx_t_2);
15065   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 961, __pyx_L1_error)
15066   __Pyx_GOTREF(__pyx_t_3);
15067   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15068   __pyx_t_2 = NULL;
15069   __pyx_t_4 = 0;
15070   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
15071     __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
15072     if (likely(__pyx_t_2)) {
15073       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
15074       __Pyx_INCREF(__pyx_t_2);
15075       __Pyx_INCREF(function);
15076       __Pyx_DECREF_SET(__pyx_t_3, function);
15077       __pyx_t_4 = 1;
15078     }
15079   }
15080   #if CYTHON_FAST_PYCALL
15081   if (PyFunction_Check(__pyx_t_3)) {
15082     PyObject *__pyx_temp[5] = {__pyx_t_2, __pyx_v_self, __pyx_v_fo, __pyx_v_reader_schema, __pyx_v_return_record_name};
15083     __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 961, __pyx_L1_error)
15084     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
15085     __Pyx_GOTREF(__pyx_t_1);
15086   } else
15087   #endif
15088   #if CYTHON_FAST_PYCCALL
15089   if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
15090     PyObject *__pyx_temp[5] = {__pyx_t_2, __pyx_v_self, __pyx_v_fo, __pyx_v_reader_schema, __pyx_v_return_record_name};
15091     __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 4+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 961, __pyx_L1_error)
15092     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
15093     __Pyx_GOTREF(__pyx_t_1);
15094   } else
15095   #endif
15096   {
15097     __pyx_t_5 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 961, __pyx_L1_error)
15098     __Pyx_GOTREF(__pyx_t_5);
15099     if (__pyx_t_2) {
15100       __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
15101     }
15102     __Pyx_INCREF(__pyx_v_self);
15103     __Pyx_GIVEREF(__pyx_v_self);
15104     PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_self);
15105     __Pyx_INCREF(__pyx_v_fo);
15106     __Pyx_GIVEREF(__pyx_v_fo);
15107     PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_fo);
15108     __Pyx_INCREF(__pyx_v_reader_schema);
15109     __Pyx_GIVEREF(__pyx_v_reader_schema);
15110     PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_reader_schema);
15111     __Pyx_INCREF(__pyx_v_return_record_name);
15112     __Pyx_GIVEREF(__pyx_v_return_record_name);
15113     PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_return_record_name);
15114     __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 961, __pyx_L1_error)
15115     __Pyx_GOTREF(__pyx_t_1);
15116     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15117   }
15118   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15119   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15120 
15121   /* "fastavro/_read.pyx":963
15122  *         file_reader.__init__(self, fo, reader_schema, return_record_name)
15123  *
15124  *         self._elems = _iter_avro_blocks(self.fo,             # <<<<<<<<<<<<<<
15125  *                                         self._header,
15126  *                                         self.codec,
15127  */
15128   __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_iter_avro_blocks); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 963, __pyx_L1_error)
15129   __Pyx_GOTREF(__pyx_t_3);
15130   __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_fo); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 963, __pyx_L1_error)
15131   __Pyx_GOTREF(__pyx_t_5);
15132 
15133   /* "fastavro/_read.pyx":964
15134  *
15135  *         self._elems = _iter_avro_blocks(self.fo,
15136  *                                         self._header,             # <<<<<<<<<<<<<<
15137  *                                         self.codec,
15138  *                                         self.writer_schema,
15139  */
15140   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_header_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 964, __pyx_L1_error)
15141   __Pyx_GOTREF(__pyx_t_2);
15142 
15143   /* "fastavro/_read.pyx":965
15144  *         self._elems = _iter_avro_blocks(self.fo,
15145  *                                         self._header,
15146  *                                         self.codec,             # <<<<<<<<<<<<<<
15147  *                                         self.writer_schema,
15148  *                                         self._named_schemas,
15149  */
15150   __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_codec); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 965, __pyx_L1_error)
15151   __Pyx_GOTREF(__pyx_t_6);
15152 
15153   /* "fastavro/_read.pyx":966
15154  *                                         self._header,
15155  *                                         self.codec,
15156  *                                         self.writer_schema,             # <<<<<<<<<<<<<<
15157  *                                         self._named_schemas,
15158  *                                         self.reader_schema,
15159  */
15160   __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_writer_schema); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 966, __pyx_L1_error)
15161   __Pyx_GOTREF(__pyx_t_7);
15162 
15163   /* "fastavro/_read.pyx":967
15164  *                                         self.codec,
15165  *                                         self.writer_schema,
15166  *                                         self._named_schemas,             # <<<<<<<<<<<<<<
15167  *                                         self.reader_schema,
15168  *                                         self.return_record_name)
15169  */
15170   __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_named_schemas_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 967, __pyx_L1_error)
15171   __Pyx_GOTREF(__pyx_t_8);
15172 
15173   /* "fastavro/_read.pyx":968
15174  *                                         self.writer_schema,
15175  *                                         self._named_schemas,
15176  *                                         self.reader_schema,             # <<<<<<<<<<<<<<
15177  *                                         self.return_record_name)
15178  *
15179  */
15180   __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_reader_schema); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 968, __pyx_L1_error)
15181   __Pyx_GOTREF(__pyx_t_9);
15182 
15183   /* "fastavro/_read.pyx":969
15184  *                                         self._named_schemas,
15185  *                                         self.reader_schema,
15186  *                                         self.return_record_name)             # <<<<<<<<<<<<<<
15187  *
15188  *
15189  */
15190   __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_return_record_name); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 969, __pyx_L1_error)
15191   __Pyx_GOTREF(__pyx_t_10);
15192   __pyx_t_11 = NULL;
15193   __pyx_t_4 = 0;
15194   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
15195     __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_3);
15196     if (likely(__pyx_t_11)) {
15197       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
15198       __Pyx_INCREF(__pyx_t_11);
15199       __Pyx_INCREF(function);
15200       __Pyx_DECREF_SET(__pyx_t_3, function);
15201       __pyx_t_4 = 1;
15202     }
15203   }
15204   #if CYTHON_FAST_PYCALL
15205   if (PyFunction_Check(__pyx_t_3)) {
15206     PyObject *__pyx_temp[8] = {__pyx_t_11, __pyx_t_5, __pyx_t_2, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10};
15207     __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 7+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 963, __pyx_L1_error)
15208     __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
15209     __Pyx_GOTREF(__pyx_t_1);
15210     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15211     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15212     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15213     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15214     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
15215     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15216     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15217   } else
15218   #endif
15219   #if CYTHON_FAST_PYCCALL
15220   if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
15221     PyObject *__pyx_temp[8] = {__pyx_t_11, __pyx_t_5, __pyx_t_2, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10};
15222     __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 7+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 963, __pyx_L1_error)
15223     __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
15224     __Pyx_GOTREF(__pyx_t_1);
15225     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15226     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15227     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15228     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15229     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
15230     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15231     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15232   } else
15233   #endif
15234   {
15235     __pyx_t_12 = PyTuple_New(7+__pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 963, __pyx_L1_error)
15236     __Pyx_GOTREF(__pyx_t_12);
15237     if (__pyx_t_11) {
15238       __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
15239     }
15240     __Pyx_GIVEREF(__pyx_t_5);
15241     PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_4, __pyx_t_5);
15242     __Pyx_GIVEREF(__pyx_t_2);
15243     PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_4, __pyx_t_2);
15244     __Pyx_GIVEREF(__pyx_t_6);
15245     PyTuple_SET_ITEM(__pyx_t_12, 2+__pyx_t_4, __pyx_t_6);
15246     __Pyx_GIVEREF(__pyx_t_7);
15247     PyTuple_SET_ITEM(__pyx_t_12, 3+__pyx_t_4, __pyx_t_7);
15248     __Pyx_GIVEREF(__pyx_t_8);
15249     PyTuple_SET_ITEM(__pyx_t_12, 4+__pyx_t_4, __pyx_t_8);
15250     __Pyx_GIVEREF(__pyx_t_9);
15251     PyTuple_SET_ITEM(__pyx_t_12, 5+__pyx_t_4, __pyx_t_9);
15252     __Pyx_GIVEREF(__pyx_t_10);
15253     PyTuple_SET_ITEM(__pyx_t_12, 6+__pyx_t_4, __pyx_t_10);
15254     __pyx_t_5 = 0;
15255     __pyx_t_2 = 0;
15256     __pyx_t_6 = 0;
15257     __pyx_t_7 = 0;
15258     __pyx_t_8 = 0;
15259     __pyx_t_9 = 0;
15260     __pyx_t_10 = 0;
15261     __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 963, __pyx_L1_error)
15262     __Pyx_GOTREF(__pyx_t_1);
15263     __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
15264   }
15265   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15266 
15267   /* "fastavro/_read.pyx":963
15268  *         file_reader.__init__(self, fo, reader_schema, return_record_name)
15269  *
15270  *         self._elems = _iter_avro_blocks(self.fo,             # <<<<<<<<<<<<<<
15271  *                                         self._header,
15272  *                                         self.codec,
15273  */
15274   if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_elems, __pyx_t_1) < 0) __PYX_ERR(0, 963, __pyx_L1_error)
15275   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15276 
15277   /* "fastavro/_read.pyx":960
15278  *
15279  * class block_reader(file_reader):
15280  *     def __init__(self, fo, reader_schema=None, return_record_name=False):             # <<<<<<<<<<<<<<
15281  *         file_reader.__init__(self, fo, reader_schema, return_record_name)
15282  *
15283  */
15284 
15285   /* function exit code */
15286   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15287   goto __pyx_L0;
15288   __pyx_L1_error:;
15289   __Pyx_XDECREF(__pyx_t_1);
15290   __Pyx_XDECREF(__pyx_t_2);
15291   __Pyx_XDECREF(__pyx_t_3);
15292   __Pyx_XDECREF(__pyx_t_5);
15293   __Pyx_XDECREF(__pyx_t_6);
15294   __Pyx_XDECREF(__pyx_t_7);
15295   __Pyx_XDECREF(__pyx_t_8);
15296   __Pyx_XDECREF(__pyx_t_9);
15297   __Pyx_XDECREF(__pyx_t_10);
15298   __Pyx_XDECREF(__pyx_t_11);
15299   __Pyx_XDECREF(__pyx_t_12);
15300   __Pyx_AddTraceback("fastavro._read.block_reader.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15301   __pyx_r = NULL;
15302   __pyx_L0:;
15303   __Pyx_XGIVEREF(__pyx_r);
15304   __Pyx_RefNannyFinishContext();
15305   return __pyx_r;
15306 }
15307 
15308 /* "fastavro/_read.pyx":972
15309  *
15310  *
15311  * cpdef schemaless_reader(fo, writer_schema, reader_schema=None,             # <<<<<<<<<<<<<<
15312  *                         return_record_name=False):
15313  *     if writer_schema == reader_schema:
15314  */
15315 
15316 static PyObject *__pyx_pw_8fastavro_5_read_45schemaless_reader(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_f_8fastavro_5_read_schemaless_reader(PyObject * __pyx_v_fo,PyObject * __pyx_v_writer_schema,CYTHON_UNUSED int __pyx_skip_dispatch,struct __pyx_opt_args_8fastavro_5_read_schemaless_reader * __pyx_optional_args)15317 static PyObject *__pyx_f_8fastavro_5_read_schemaless_reader(PyObject *__pyx_v_fo, PyObject *__pyx_v_writer_schema, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_8fastavro_5_read_schemaless_reader *__pyx_optional_args) {
15318   PyObject *__pyx_v_reader_schema = ((PyObject *)Py_None);
15319 
15320   /* "fastavro/_read.pyx":973
15321  *
15322  * cpdef schemaless_reader(fo, writer_schema, reader_schema=None,
15323  *                         return_record_name=False):             # <<<<<<<<<<<<<<
15324  *     if writer_schema == reader_schema:
15325  *         # No need for the reader schema if they are the same
15326  */
15327   PyObject *__pyx_v_return_record_name = ((PyObject *)Py_False);
15328   PyObject *__pyx_v_named_schemas = NULL;
15329   PyObject *__pyx_r = NULL;
15330   __Pyx_RefNannyDeclarations
15331   PyObject *__pyx_t_1 = NULL;
15332   int __pyx_t_2;
15333   PyObject *__pyx_t_3 = NULL;
15334   PyObject *__pyx_t_4 = NULL;
15335   PyObject *__pyx_t_5 = NULL;
15336   struct __pyx_opt_args_8fastavro_5_read__read_data __pyx_t_6;
15337   int __pyx_lineno = 0;
15338   const char *__pyx_filename = NULL;
15339   int __pyx_clineno = 0;
15340   __Pyx_RefNannySetupContext("schemaless_reader", 0);
15341   if (__pyx_optional_args) {
15342     if (__pyx_optional_args->__pyx_n > 0) {
15343       __pyx_v_reader_schema = __pyx_optional_args->reader_schema;
15344       if (__pyx_optional_args->__pyx_n > 1) {
15345         __pyx_v_return_record_name = __pyx_optional_args->return_record_name;
15346       }
15347     }
15348   }
15349   __Pyx_INCREF(__pyx_v_writer_schema);
15350   __Pyx_INCREF(__pyx_v_reader_schema);
15351 
15352   /* "fastavro/_read.pyx":974
15353  * cpdef schemaless_reader(fo, writer_schema, reader_schema=None,
15354  *                         return_record_name=False):
15355  *     if writer_schema == reader_schema:             # <<<<<<<<<<<<<<
15356  *         # No need for the reader schema if they are the same
15357  *         reader_schema = None
15358  */
15359   __pyx_t_1 = PyObject_RichCompare(__pyx_v_writer_schema, __pyx_v_reader_schema, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 974, __pyx_L1_error)
15360   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 974, __pyx_L1_error)
15361   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15362   if (__pyx_t_2) {
15363 
15364     /* "fastavro/_read.pyx":976
15365  *     if writer_schema == reader_schema:
15366  *         # No need for the reader schema if they are the same
15367  *         reader_schema = None             # <<<<<<<<<<<<<<
15368  *
15369  *     named_schemas = {}
15370  */
15371     __Pyx_INCREF(Py_None);
15372     __Pyx_DECREF_SET(__pyx_v_reader_schema, Py_None);
15373 
15374     /* "fastavro/_read.pyx":974
15375  * cpdef schemaless_reader(fo, writer_schema, reader_schema=None,
15376  *                         return_record_name=False):
15377  *     if writer_schema == reader_schema:             # <<<<<<<<<<<<<<
15378  *         # No need for the reader schema if they are the same
15379  *         reader_schema = None
15380  */
15381   }
15382 
15383   /* "fastavro/_read.pyx":978
15384  *         reader_schema = None
15385  *
15386  *     named_schemas = {}             # <<<<<<<<<<<<<<
15387  *     writer_schema = parse_schema(writer_schema, _named_schemas=named_schemas)
15388  *
15389  */
15390   __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 978, __pyx_L1_error)
15391   __Pyx_GOTREF(__pyx_t_1);
15392   __pyx_v_named_schemas = ((PyObject*)__pyx_t_1);
15393   __pyx_t_1 = 0;
15394 
15395   /* "fastavro/_read.pyx":979
15396  *
15397  *     named_schemas = {}
15398  *     writer_schema = parse_schema(writer_schema, _named_schemas=named_schemas)             # <<<<<<<<<<<<<<
15399  *
15400  *     if reader_schema:
15401  */
15402   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_parse_schema); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 979, __pyx_L1_error)
15403   __Pyx_GOTREF(__pyx_t_1);
15404   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 979, __pyx_L1_error)
15405   __Pyx_GOTREF(__pyx_t_3);
15406   __Pyx_INCREF(__pyx_v_writer_schema);
15407   __Pyx_GIVEREF(__pyx_v_writer_schema);
15408   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_writer_schema);
15409   __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 979, __pyx_L1_error)
15410   __Pyx_GOTREF(__pyx_t_4);
15411   if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_named_schemas_2, __pyx_v_named_schemas) < 0) __PYX_ERR(0, 979, __pyx_L1_error)
15412   __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 979, __pyx_L1_error)
15413   __Pyx_GOTREF(__pyx_t_5);
15414   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15415   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15416   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15417   __Pyx_DECREF_SET(__pyx_v_writer_schema, __pyx_t_5);
15418   __pyx_t_5 = 0;
15419 
15420   /* "fastavro/_read.pyx":981
15421  *     writer_schema = parse_schema(writer_schema, _named_schemas=named_schemas)
15422  *
15423  *     if reader_schema:             # <<<<<<<<<<<<<<
15424  *         reader_schema = parse_schema(reader_schema)
15425  *
15426  */
15427   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_reader_schema); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 981, __pyx_L1_error)
15428   if (__pyx_t_2) {
15429 
15430     /* "fastavro/_read.pyx":982
15431  *
15432  *     if reader_schema:
15433  *         reader_schema = parse_schema(reader_schema)             # <<<<<<<<<<<<<<
15434  *
15435  *     return _read_data(
15436  */
15437     __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_parse_schema); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 982, __pyx_L1_error)
15438     __Pyx_GOTREF(__pyx_t_4);
15439     __pyx_t_3 = NULL;
15440     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
15441       __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
15442       if (likely(__pyx_t_3)) {
15443         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
15444         __Pyx_INCREF(__pyx_t_3);
15445         __Pyx_INCREF(function);
15446         __Pyx_DECREF_SET(__pyx_t_4, function);
15447       }
15448     }
15449     __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_v_reader_schema) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_reader_schema);
15450     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15451     if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 982, __pyx_L1_error)
15452     __Pyx_GOTREF(__pyx_t_5);
15453     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15454     __Pyx_DECREF_SET(__pyx_v_reader_schema, __pyx_t_5);
15455     __pyx_t_5 = 0;
15456 
15457     /* "fastavro/_read.pyx":981
15458  *     writer_schema = parse_schema(writer_schema, _named_schemas=named_schemas)
15459  *
15460  *     if reader_schema:             # <<<<<<<<<<<<<<
15461  *         reader_schema = parse_schema(reader_schema)
15462  *
15463  */
15464   }
15465 
15466   /* "fastavro/_read.pyx":984
15467  *         reader_schema = parse_schema(reader_schema)
15468  *
15469  *     return _read_data(             # <<<<<<<<<<<<<<
15470  *         fo,
15471  *         writer_schema,
15472  */
15473   __Pyx_XDECREF(__pyx_r);
15474 
15475   /* "fastavro/_read.pyx":989
15476  *         named_schemas,
15477  *         reader_schema,
15478  *         return_record_name,             # <<<<<<<<<<<<<<
15479  *     )
15480  *
15481  */
15482   __pyx_t_6.__pyx_n = 2;
15483   __pyx_t_6.reader_schema = __pyx_v_reader_schema;
15484   __pyx_t_6.return_record_name = __pyx_v_return_record_name;
15485   __pyx_t_5 = __pyx_f_8fastavro_5_read__read_data(__pyx_v_fo, __pyx_v_writer_schema, __pyx_v_named_schemas, 0, &__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 984, __pyx_L1_error)
15486   __Pyx_GOTREF(__pyx_t_5);
15487   __pyx_r = __pyx_t_5;
15488   __pyx_t_5 = 0;
15489   goto __pyx_L0;
15490 
15491   /* "fastavro/_read.pyx":972
15492  *
15493  *
15494  * cpdef schemaless_reader(fo, writer_schema, reader_schema=None,             # <<<<<<<<<<<<<<
15495  *                         return_record_name=False):
15496  *     if writer_schema == reader_schema:
15497  */
15498 
15499   /* function exit code */
15500   __pyx_L1_error:;
15501   __Pyx_XDECREF(__pyx_t_1);
15502   __Pyx_XDECREF(__pyx_t_3);
15503   __Pyx_XDECREF(__pyx_t_4);
15504   __Pyx_XDECREF(__pyx_t_5);
15505   __Pyx_AddTraceback("fastavro._read.schemaless_reader", __pyx_clineno, __pyx_lineno, __pyx_filename);
15506   __pyx_r = 0;
15507   __pyx_L0:;
15508   __Pyx_XDECREF(__pyx_v_named_schemas);
15509   __Pyx_XDECREF(__pyx_v_writer_schema);
15510   __Pyx_XDECREF(__pyx_v_reader_schema);
15511   __Pyx_XGIVEREF(__pyx_r);
15512   __Pyx_RefNannyFinishContext();
15513   return __pyx_r;
15514 }
15515 
15516 /* Python wrapper */
15517 static PyObject *__pyx_pw_8fastavro_5_read_45schemaless_reader(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_8fastavro_5_read_45schemaless_reader(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)15518 static PyObject *__pyx_pw_8fastavro_5_read_45schemaless_reader(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15519   PyObject *__pyx_v_fo = 0;
15520   PyObject *__pyx_v_writer_schema = 0;
15521   PyObject *__pyx_v_reader_schema = 0;
15522   PyObject *__pyx_v_return_record_name = 0;
15523   int __pyx_lineno = 0;
15524   const char *__pyx_filename = NULL;
15525   int __pyx_clineno = 0;
15526   PyObject *__pyx_r = 0;
15527   __Pyx_RefNannyDeclarations
15528   __Pyx_RefNannySetupContext("schemaless_reader (wrapper)", 0);
15529   {
15530     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fo,&__pyx_n_s_writer_schema,&__pyx_n_s_reader_schema,&__pyx_n_s_return_record_name,0};
15531     PyObject* values[4] = {0,0,0,0};
15532     values[2] = ((PyObject *)Py_None);
15533 
15534     /* "fastavro/_read.pyx":973
15535  *
15536  * cpdef schemaless_reader(fo, writer_schema, reader_schema=None,
15537  *                         return_record_name=False):             # <<<<<<<<<<<<<<
15538  *     if writer_schema == reader_schema:
15539  *         # No need for the reader schema if they are the same
15540  */
15541     values[3] = ((PyObject *)Py_False);
15542     if (unlikely(__pyx_kwds)) {
15543       Py_ssize_t kw_args;
15544       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15545       switch (pos_args) {
15546         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
15547         CYTHON_FALLTHROUGH;
15548         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15549         CYTHON_FALLTHROUGH;
15550         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15551         CYTHON_FALLTHROUGH;
15552         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15553         CYTHON_FALLTHROUGH;
15554         case  0: break;
15555         default: goto __pyx_L5_argtuple_error;
15556       }
15557       kw_args = PyDict_Size(__pyx_kwds);
15558       switch (pos_args) {
15559         case  0:
15560         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fo)) != 0)) kw_args--;
15561         else goto __pyx_L5_argtuple_error;
15562         CYTHON_FALLTHROUGH;
15563         case  1:
15564         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_writer_schema)) != 0)) kw_args--;
15565         else {
15566           __Pyx_RaiseArgtupleInvalid("schemaless_reader", 0, 2, 4, 1); __PYX_ERR(0, 972, __pyx_L3_error)
15567         }
15568         CYTHON_FALLTHROUGH;
15569         case  2:
15570         if (kw_args > 0) {
15571           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_reader_schema);
15572           if (value) { values[2] = value; kw_args--; }
15573         }
15574         CYTHON_FALLTHROUGH;
15575         case  3:
15576         if (kw_args > 0) {
15577           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_return_record_name);
15578           if (value) { values[3] = value; kw_args--; }
15579         }
15580       }
15581       if (unlikely(kw_args > 0)) {
15582         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "schemaless_reader") < 0)) __PYX_ERR(0, 972, __pyx_L3_error)
15583       }
15584     } else {
15585       switch (PyTuple_GET_SIZE(__pyx_args)) {
15586         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
15587         CYTHON_FALLTHROUGH;
15588         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15589         CYTHON_FALLTHROUGH;
15590         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15591         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15592         break;
15593         default: goto __pyx_L5_argtuple_error;
15594       }
15595     }
15596     __pyx_v_fo = values[0];
15597     __pyx_v_writer_schema = values[1];
15598     __pyx_v_reader_schema = values[2];
15599     __pyx_v_return_record_name = values[3];
15600   }
15601   goto __pyx_L4_argument_unpacking_done;
15602   __pyx_L5_argtuple_error:;
15603   __Pyx_RaiseArgtupleInvalid("schemaless_reader", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 972, __pyx_L3_error)
15604   __pyx_L3_error:;
15605   __Pyx_AddTraceback("fastavro._read.schemaless_reader", __pyx_clineno, __pyx_lineno, __pyx_filename);
15606   __Pyx_RefNannyFinishContext();
15607   return NULL;
15608   __pyx_L4_argument_unpacking_done:;
15609   __pyx_r = __pyx_pf_8fastavro_5_read_44schemaless_reader(__pyx_self, __pyx_v_fo, __pyx_v_writer_schema, __pyx_v_reader_schema, __pyx_v_return_record_name);
15610 
15611   /* "fastavro/_read.pyx":972
15612  *
15613  *
15614  * cpdef schemaless_reader(fo, writer_schema, reader_schema=None,             # <<<<<<<<<<<<<<
15615  *                         return_record_name=False):
15616  *     if writer_schema == reader_schema:
15617  */
15618 
15619   /* function exit code */
15620   __Pyx_RefNannyFinishContext();
15621   return __pyx_r;
15622 }
15623 
__pyx_pf_8fastavro_5_read_44schemaless_reader(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_fo,PyObject * __pyx_v_writer_schema,PyObject * __pyx_v_reader_schema,PyObject * __pyx_v_return_record_name)15624 static PyObject *__pyx_pf_8fastavro_5_read_44schemaless_reader(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fo, PyObject *__pyx_v_writer_schema, PyObject *__pyx_v_reader_schema, PyObject *__pyx_v_return_record_name) {
15625   PyObject *__pyx_r = NULL;
15626   __Pyx_RefNannyDeclarations
15627   PyObject *__pyx_t_1 = NULL;
15628   struct __pyx_opt_args_8fastavro_5_read_schemaless_reader __pyx_t_2;
15629   int __pyx_lineno = 0;
15630   const char *__pyx_filename = NULL;
15631   int __pyx_clineno = 0;
15632   __Pyx_RefNannySetupContext("schemaless_reader", 0);
15633   __Pyx_XDECREF(__pyx_r);
15634   __pyx_t_2.__pyx_n = 2;
15635   __pyx_t_2.reader_schema = __pyx_v_reader_schema;
15636   __pyx_t_2.return_record_name = __pyx_v_return_record_name;
15637   __pyx_t_1 = __pyx_f_8fastavro_5_read_schemaless_reader(__pyx_v_fo, __pyx_v_writer_schema, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 972, __pyx_L1_error)
15638   __Pyx_GOTREF(__pyx_t_1);
15639   __pyx_r = __pyx_t_1;
15640   __pyx_t_1 = 0;
15641   goto __pyx_L0;
15642 
15643   /* function exit code */
15644   __pyx_L1_error:;
15645   __Pyx_XDECREF(__pyx_t_1);
15646   __Pyx_AddTraceback("fastavro._read.schemaless_reader", __pyx_clineno, __pyx_lineno, __pyx_filename);
15647   __pyx_r = NULL;
15648   __pyx_L0:;
15649   __Pyx_XGIVEREF(__pyx_r);
15650   __Pyx_RefNannyFinishContext();
15651   return __pyx_r;
15652 }
15653 
15654 /* "fastavro/_read.pyx":993
15655  *
15656  *
15657  * cpdef is_avro(path_or_buffer):             # <<<<<<<<<<<<<<
15658  *     if is_str(path_or_buffer):
15659  *         fp = open(path_or_buffer, 'rb')
15660  */
15661 
15662 static PyObject *__pyx_pw_8fastavro_5_read_47is_avro(PyObject *__pyx_self, PyObject *__pyx_v_path_or_buffer); /*proto*/
__pyx_f_8fastavro_5_read_is_avro(PyObject * __pyx_v_path_or_buffer,CYTHON_UNUSED int __pyx_skip_dispatch)15663 static PyObject *__pyx_f_8fastavro_5_read_is_avro(PyObject *__pyx_v_path_or_buffer, CYTHON_UNUSED int __pyx_skip_dispatch) {
15664   PyObject *__pyx_v_fp = NULL;
15665   int __pyx_v_close;
15666   PyObject *__pyx_v_header = NULL;
15667   PyObject *__pyx_r = NULL;
15668   __Pyx_RefNannyDeclarations
15669   PyObject *__pyx_t_1 = NULL;
15670   PyObject *__pyx_t_2 = NULL;
15671   PyObject *__pyx_t_3 = NULL;
15672   int __pyx_t_4;
15673   Py_ssize_t __pyx_t_5;
15674   PyObject *__pyx_t_6 = NULL;
15675   int __pyx_t_7;
15676   int __pyx_t_8;
15677   char const *__pyx_t_9;
15678   PyObject *__pyx_t_10 = NULL;
15679   PyObject *__pyx_t_11 = NULL;
15680   PyObject *__pyx_t_12 = NULL;
15681   PyObject *__pyx_t_13 = NULL;
15682   PyObject *__pyx_t_14 = NULL;
15683   PyObject *__pyx_t_15 = NULL;
15684   int __pyx_lineno = 0;
15685   const char *__pyx_filename = NULL;
15686   int __pyx_clineno = 0;
15687   __Pyx_RefNannySetupContext("is_avro", 0);
15688 
15689   /* "fastavro/_read.pyx":994
15690  *
15691  * cpdef is_avro(path_or_buffer):
15692  *     if is_str(path_or_buffer):             # <<<<<<<<<<<<<<
15693  *         fp = open(path_or_buffer, 'rb')
15694  *         close = True
15695  */
15696   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_str); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 994, __pyx_L1_error)
15697   __Pyx_GOTREF(__pyx_t_2);
15698   __pyx_t_3 = NULL;
15699   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
15700     __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
15701     if (likely(__pyx_t_3)) {
15702       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
15703       __Pyx_INCREF(__pyx_t_3);
15704       __Pyx_INCREF(function);
15705       __Pyx_DECREF_SET(__pyx_t_2, function);
15706     }
15707   }
15708   __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_path_or_buffer) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_path_or_buffer);
15709   __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15710   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 994, __pyx_L1_error)
15711   __Pyx_GOTREF(__pyx_t_1);
15712   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15713   __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 994, __pyx_L1_error)
15714   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15715   if (__pyx_t_4) {
15716 
15717     /* "fastavro/_read.pyx":995
15718  * cpdef is_avro(path_or_buffer):
15719  *     if is_str(path_or_buffer):
15720  *         fp = open(path_or_buffer, 'rb')             # <<<<<<<<<<<<<<
15721  *         close = True
15722  *     else:
15723  */
15724     __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 995, __pyx_L1_error)
15725     __Pyx_GOTREF(__pyx_t_1);
15726     __Pyx_INCREF(__pyx_v_path_or_buffer);
15727     __Pyx_GIVEREF(__pyx_v_path_or_buffer);
15728     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_path_or_buffer);
15729     __Pyx_INCREF(__pyx_n_s_rb);
15730     __Pyx_GIVEREF(__pyx_n_s_rb);
15731     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_rb);
15732     __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 995, __pyx_L1_error)
15733     __Pyx_GOTREF(__pyx_t_2);
15734     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15735     __pyx_v_fp = __pyx_t_2;
15736     __pyx_t_2 = 0;
15737 
15738     /* "fastavro/_read.pyx":996
15739  *     if is_str(path_or_buffer):
15740  *         fp = open(path_or_buffer, 'rb')
15741  *         close = True             # <<<<<<<<<<<<<<
15742  *     else:
15743  *         fp = path_or_buffer
15744  */
15745     __pyx_v_close = 1;
15746 
15747     /* "fastavro/_read.pyx":994
15748  *
15749  * cpdef is_avro(path_or_buffer):
15750  *     if is_str(path_or_buffer):             # <<<<<<<<<<<<<<
15751  *         fp = open(path_or_buffer, 'rb')
15752  *         close = True
15753  */
15754     goto __pyx_L3;
15755   }
15756 
15757   /* "fastavro/_read.pyx":998
15758  *         close = True
15759  *     else:
15760  *         fp = path_or_buffer             # <<<<<<<<<<<<<<
15761  *         close = False
15762  *
15763  */
15764   /*else*/ {
15765     __Pyx_INCREF(__pyx_v_path_or_buffer);
15766     __pyx_v_fp = __pyx_v_path_or_buffer;
15767 
15768     /* "fastavro/_read.pyx":999
15769  *     else:
15770  *         fp = path_or_buffer
15771  *         close = False             # <<<<<<<<<<<<<<
15772  *
15773  *     try:
15774  */
15775     __pyx_v_close = 0;
15776   }
15777   __pyx_L3:;
15778 
15779   /* "fastavro/_read.pyx":1001
15780  *         close = False
15781  *
15782  *     try:             # <<<<<<<<<<<<<<
15783  *         header = fp.read(len(MAGIC))
15784  *         return header == MAGIC
15785  */
15786   /*try:*/ {
15787 
15788     /* "fastavro/_read.pyx":1002
15789  *
15790  *     try:
15791  *         header = fp.read(len(MAGIC))             # <<<<<<<<<<<<<<
15792  *         return header == MAGIC
15793  *     finally:
15794  */
15795     __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_fp, __pyx_n_s_read); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1002, __pyx_L5_error)
15796     __Pyx_GOTREF(__pyx_t_1);
15797     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_MAGIC); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1002, __pyx_L5_error)
15798     __Pyx_GOTREF(__pyx_t_3);
15799     __pyx_t_5 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1002, __pyx_L5_error)
15800     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15801     __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1002, __pyx_L5_error)
15802     __Pyx_GOTREF(__pyx_t_3);
15803     __pyx_t_6 = NULL;
15804     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
15805       __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
15806       if (likely(__pyx_t_6)) {
15807         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
15808         __Pyx_INCREF(__pyx_t_6);
15809         __Pyx_INCREF(function);
15810         __Pyx_DECREF_SET(__pyx_t_1, function);
15811       }
15812     }
15813     __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3);
15814     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
15815     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15816     if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1002, __pyx_L5_error)
15817     __Pyx_GOTREF(__pyx_t_2);
15818     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15819     __pyx_v_header = __pyx_t_2;
15820     __pyx_t_2 = 0;
15821 
15822     /* "fastavro/_read.pyx":1003
15823  *     try:
15824  *         header = fp.read(len(MAGIC))
15825  *         return header == MAGIC             # <<<<<<<<<<<<<<
15826  *     finally:
15827  *         if close:
15828  */
15829     __Pyx_XDECREF(__pyx_r);
15830     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_MAGIC); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1003, __pyx_L5_error)
15831     __Pyx_GOTREF(__pyx_t_2);
15832     __pyx_t_1 = PyObject_RichCompare(__pyx_v_header, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1003, __pyx_L5_error)
15833     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15834     __pyx_r = __pyx_t_1;
15835     __pyx_t_1 = 0;
15836     goto __pyx_L4_return;
15837   }
15838 
15839   /* "fastavro/_read.pyx":1005
15840  *         return header == MAGIC
15841  *     finally:
15842  *         if close:             # <<<<<<<<<<<<<<
15843  *             fp.close()
15844  */
15845   /*finally:*/ {
15846     __pyx_L5_error:;
15847     /*exception exit:*/{
15848       __Pyx_PyThreadState_declare
15849       __Pyx_PyThreadState_assign
15850       __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0;
15851       __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
15852       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
15853       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15854       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
15855       if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
15856       if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12) < 0)) __Pyx_ErrFetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
15857       __Pyx_XGOTREF(__pyx_t_10);
15858       __Pyx_XGOTREF(__pyx_t_11);
15859       __Pyx_XGOTREF(__pyx_t_12);
15860       __Pyx_XGOTREF(__pyx_t_13);
15861       __Pyx_XGOTREF(__pyx_t_14);
15862       __Pyx_XGOTREF(__pyx_t_15);
15863       __pyx_t_7 = __pyx_lineno; __pyx_t_8 = __pyx_clineno; __pyx_t_9 = __pyx_filename;
15864       {
15865         __pyx_t_4 = (__pyx_v_close != 0);
15866         if (__pyx_t_4) {
15867 
15868           /* "fastavro/_read.pyx":1006
15869  *     finally:
15870  *         if close:
15871  *             fp.close()             # <<<<<<<<<<<<<<
15872  */
15873           __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_fp, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1006, __pyx_L8_error)
15874           __Pyx_GOTREF(__pyx_t_2);
15875           __pyx_t_3 = NULL;
15876           if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
15877             __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
15878             if (likely(__pyx_t_3)) {
15879               PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
15880               __Pyx_INCREF(__pyx_t_3);
15881               __Pyx_INCREF(function);
15882               __Pyx_DECREF_SET(__pyx_t_2, function);
15883             }
15884           }
15885           __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
15886           __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15887           if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1006, __pyx_L8_error)
15888           __Pyx_GOTREF(__pyx_t_1);
15889           __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15890           __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15891 
15892           /* "fastavro/_read.pyx":1005
15893  *         return header == MAGIC
15894  *     finally:
15895  *         if close:             # <<<<<<<<<<<<<<
15896  *             fp.close()
15897  */
15898         }
15899       }
15900       if (PY_MAJOR_VERSION >= 3) {
15901         __Pyx_XGIVEREF(__pyx_t_13);
15902         __Pyx_XGIVEREF(__pyx_t_14);
15903         __Pyx_XGIVEREF(__pyx_t_15);
15904         __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15);
15905       }
15906       __Pyx_XGIVEREF(__pyx_t_10);
15907       __Pyx_XGIVEREF(__pyx_t_11);
15908       __Pyx_XGIVEREF(__pyx_t_12);
15909       __Pyx_ErrRestore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
15910       __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0;
15911       __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_8; __pyx_filename = __pyx_t_9;
15912       goto __pyx_L1_error;
15913       __pyx_L8_error:;
15914       if (PY_MAJOR_VERSION >= 3) {
15915         __Pyx_XGIVEREF(__pyx_t_13);
15916         __Pyx_XGIVEREF(__pyx_t_14);
15917         __Pyx_XGIVEREF(__pyx_t_15);
15918         __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15);
15919       }
15920       __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
15921       __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
15922       __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
15923       __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0;
15924       goto __pyx_L1_error;
15925     }
15926     __pyx_L4_return: {
15927       __pyx_t_15 = __pyx_r;
15928       __pyx_r = 0;
15929       __pyx_t_4 = (__pyx_v_close != 0);
15930       if (__pyx_t_4) {
15931 
15932         /* "fastavro/_read.pyx":1006
15933  *     finally:
15934  *         if close:
15935  *             fp.close()             # <<<<<<<<<<<<<<
15936  */
15937         __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_fp, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1006, __pyx_L1_error)
15938         __Pyx_GOTREF(__pyx_t_2);
15939         __pyx_t_3 = NULL;
15940         if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
15941           __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
15942           if (likely(__pyx_t_3)) {
15943             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
15944             __Pyx_INCREF(__pyx_t_3);
15945             __Pyx_INCREF(function);
15946             __Pyx_DECREF_SET(__pyx_t_2, function);
15947           }
15948         }
15949         __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
15950         __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15951         if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1006, __pyx_L1_error)
15952         __Pyx_GOTREF(__pyx_t_1);
15953         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15954         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15955 
15956         /* "fastavro/_read.pyx":1005
15957  *         return header == MAGIC
15958  *     finally:
15959  *         if close:             # <<<<<<<<<<<<<<
15960  *             fp.close()
15961  */
15962       }
15963       __pyx_r = __pyx_t_15;
15964       __pyx_t_15 = 0;
15965       goto __pyx_L0;
15966     }
15967   }
15968 
15969   /* "fastavro/_read.pyx":993
15970  *
15971  *
15972  * cpdef is_avro(path_or_buffer):             # <<<<<<<<<<<<<<
15973  *     if is_str(path_or_buffer):
15974  *         fp = open(path_or_buffer, 'rb')
15975  */
15976 
15977   /* function exit code */
15978   __pyx_L1_error:;
15979   __Pyx_XDECREF(__pyx_t_1);
15980   __Pyx_XDECREF(__pyx_t_2);
15981   __Pyx_XDECREF(__pyx_t_3);
15982   __Pyx_XDECREF(__pyx_t_6);
15983   __Pyx_AddTraceback("fastavro._read.is_avro", __pyx_clineno, __pyx_lineno, __pyx_filename);
15984   __pyx_r = 0;
15985   __pyx_L0:;
15986   __Pyx_XDECREF(__pyx_v_fp);
15987   __Pyx_XDECREF(__pyx_v_header);
15988   __Pyx_XGIVEREF(__pyx_r);
15989   __Pyx_RefNannyFinishContext();
15990   return __pyx_r;
15991 }
15992 
15993 /* Python wrapper */
15994 static PyObject *__pyx_pw_8fastavro_5_read_47is_avro(PyObject *__pyx_self, PyObject *__pyx_v_path_or_buffer); /*proto*/
__pyx_pw_8fastavro_5_read_47is_avro(PyObject * __pyx_self,PyObject * __pyx_v_path_or_buffer)15995 static PyObject *__pyx_pw_8fastavro_5_read_47is_avro(PyObject *__pyx_self, PyObject *__pyx_v_path_or_buffer) {
15996   PyObject *__pyx_r = 0;
15997   __Pyx_RefNannyDeclarations
15998   __Pyx_RefNannySetupContext("is_avro (wrapper)", 0);
15999   __pyx_r = __pyx_pf_8fastavro_5_read_46is_avro(__pyx_self, ((PyObject *)__pyx_v_path_or_buffer));
16000 
16001   /* function exit code */
16002   __Pyx_RefNannyFinishContext();
16003   return __pyx_r;
16004 }
16005 
__pyx_pf_8fastavro_5_read_46is_avro(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_path_or_buffer)16006 static PyObject *__pyx_pf_8fastavro_5_read_46is_avro(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path_or_buffer) {
16007   PyObject *__pyx_r = NULL;
16008   __Pyx_RefNannyDeclarations
16009   PyObject *__pyx_t_1 = NULL;
16010   int __pyx_lineno = 0;
16011   const char *__pyx_filename = NULL;
16012   int __pyx_clineno = 0;
16013   __Pyx_RefNannySetupContext("is_avro", 0);
16014   __Pyx_XDECREF(__pyx_r);
16015   __pyx_t_1 = __pyx_f_8fastavro_5_read_is_avro(__pyx_v_path_or_buffer, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 993, __pyx_L1_error)
16016   __Pyx_GOTREF(__pyx_t_1);
16017   __pyx_r = __pyx_t_1;
16018   __pyx_t_1 = 0;
16019   goto __pyx_L0;
16020 
16021   /* function exit code */
16022   __pyx_L1_error:;
16023   __Pyx_XDECREF(__pyx_t_1);
16024   __Pyx_AddTraceback("fastavro._read.is_avro", __pyx_clineno, __pyx_lineno, __pyx_filename);
16025   __pyx_r = NULL;
16026   __pyx_L0:;
16027   __Pyx_XGIVEREF(__pyx_r);
16028   __Pyx_RefNannyFinishContext();
16029   return __pyx_r;
16030 }
16031 
16032 static struct __pyx_obj_8fastavro_5_read___pyx_scope_struct___iter_avro_records *__pyx_freelist_8fastavro_5_read___pyx_scope_struct___iter_avro_records[8];
16033 static int __pyx_freecount_8fastavro_5_read___pyx_scope_struct___iter_avro_records = 0;
16034 
__pyx_tp_new_8fastavro_5_read___pyx_scope_struct___iter_avro_records(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)16035 static PyObject *__pyx_tp_new_8fastavro_5_read___pyx_scope_struct___iter_avro_records(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
16036   PyObject *o;
16037   if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_8fastavro_5_read___pyx_scope_struct___iter_avro_records > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_8fastavro_5_read___pyx_scope_struct___iter_avro_records)))) {
16038     o = (PyObject*)__pyx_freelist_8fastavro_5_read___pyx_scope_struct___iter_avro_records[--__pyx_freecount_8fastavro_5_read___pyx_scope_struct___iter_avro_records];
16039     memset(o, 0, sizeof(struct __pyx_obj_8fastavro_5_read___pyx_scope_struct___iter_avro_records));
16040     (void) PyObject_INIT(o, t);
16041     PyObject_GC_Track(o);
16042   } else {
16043     o = (*t->tp_alloc)(t, 0);
16044     if (unlikely(!o)) return 0;
16045   }
16046   return o;
16047 }
16048 
__pyx_tp_dealloc_8fastavro_5_read___pyx_scope_struct___iter_avro_records(PyObject * o)16049 static void __pyx_tp_dealloc_8fastavro_5_read___pyx_scope_struct___iter_avro_records(PyObject *o) {
16050   struct __pyx_obj_8fastavro_5_read___pyx_scope_struct___iter_avro_records *p = (struct __pyx_obj_8fastavro_5_read___pyx_scope_struct___iter_avro_records *)o;
16051   PyObject_GC_UnTrack(o);
16052   Py_CLEAR(p->__pyx_v_block_fo);
16053   Py_CLEAR(p->__pyx_v_codec);
16054   Py_CLEAR(p->__pyx_v_fo);
16055   Py_CLEAR(p->__pyx_v_header);
16056   Py_CLEAR(p->__pyx_v_named_schemas);
16057   Py_CLEAR(p->__pyx_v_read_block);
16058   Py_CLEAR(p->__pyx_v_reader_schema);
16059   Py_CLEAR(p->__pyx_v_return_record_name);
16060   Py_CLEAR(p->__pyx_v_sync_marker);
16061   Py_CLEAR(p->__pyx_v_writer_schema);
16062   if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_8fastavro_5_read___pyx_scope_struct___iter_avro_records < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8fastavro_5_read___pyx_scope_struct___iter_avro_records)))) {
16063     __pyx_freelist_8fastavro_5_read___pyx_scope_struct___iter_avro_records[__pyx_freecount_8fastavro_5_read___pyx_scope_struct___iter_avro_records++] = ((struct __pyx_obj_8fastavro_5_read___pyx_scope_struct___iter_avro_records *)o);
16064   } else {
16065     (*Py_TYPE(o)->tp_free)(o);
16066   }
16067 }
16068 
__pyx_tp_traverse_8fastavro_5_read___pyx_scope_struct___iter_avro_records(PyObject * o,visitproc v,void * a)16069 static int __pyx_tp_traverse_8fastavro_5_read___pyx_scope_struct___iter_avro_records(PyObject *o, visitproc v, void *a) {
16070   int e;
16071   struct __pyx_obj_8fastavro_5_read___pyx_scope_struct___iter_avro_records *p = (struct __pyx_obj_8fastavro_5_read___pyx_scope_struct___iter_avro_records *)o;
16072   if (p->__pyx_v_block_fo) {
16073     e = (*v)(p->__pyx_v_block_fo, a); if (e) return e;
16074   }
16075   if (p->__pyx_v_codec) {
16076     e = (*v)(p->__pyx_v_codec, a); if (e) return e;
16077   }
16078   if (p->__pyx_v_fo) {
16079     e = (*v)(p->__pyx_v_fo, a); if (e) return e;
16080   }
16081   if (p->__pyx_v_header) {
16082     e = (*v)(p->__pyx_v_header, a); if (e) return e;
16083   }
16084   if (p->__pyx_v_named_schemas) {
16085     e = (*v)(p->__pyx_v_named_schemas, a); if (e) return e;
16086   }
16087   if (p->__pyx_v_read_block) {
16088     e = (*v)(p->__pyx_v_read_block, a); if (e) return e;
16089   }
16090   if (p->__pyx_v_reader_schema) {
16091     e = (*v)(p->__pyx_v_reader_schema, a); if (e) return e;
16092   }
16093   if (p->__pyx_v_return_record_name) {
16094     e = (*v)(p->__pyx_v_return_record_name, a); if (e) return e;
16095   }
16096   if (p->__pyx_v_sync_marker) {
16097     e = (*v)(p->__pyx_v_sync_marker, a); if (e) return e;
16098   }
16099   if (p->__pyx_v_writer_schema) {
16100     e = (*v)(p->__pyx_v_writer_schema, a); if (e) return e;
16101   }
16102   return 0;
16103 }
16104 
16105 static PyTypeObject __pyx_type_8fastavro_5_read___pyx_scope_struct___iter_avro_records = {
16106   PyVarObject_HEAD_INIT(0, 0)
16107   "fastavro._read.__pyx_scope_struct___iter_avro_records", /*tp_name*/
16108   sizeof(struct __pyx_obj_8fastavro_5_read___pyx_scope_struct___iter_avro_records), /*tp_basicsize*/
16109   0, /*tp_itemsize*/
16110   __pyx_tp_dealloc_8fastavro_5_read___pyx_scope_struct___iter_avro_records, /*tp_dealloc*/
16111   #if PY_VERSION_HEX < 0x030800b4
16112   0, /*tp_print*/
16113   #endif
16114   #if PY_VERSION_HEX >= 0x030800b4
16115   0, /*tp_vectorcall_offset*/
16116   #endif
16117   0, /*tp_getattr*/
16118   0, /*tp_setattr*/
16119   #if PY_MAJOR_VERSION < 3
16120   0, /*tp_compare*/
16121   #endif
16122   #if PY_MAJOR_VERSION >= 3
16123   0, /*tp_as_async*/
16124   #endif
16125   0, /*tp_repr*/
16126   0, /*tp_as_number*/
16127   0, /*tp_as_sequence*/
16128   0, /*tp_as_mapping*/
16129   0, /*tp_hash*/
16130   0, /*tp_call*/
16131   0, /*tp_str*/
16132   0, /*tp_getattro*/
16133   0, /*tp_setattro*/
16134   0, /*tp_as_buffer*/
16135   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
16136   0, /*tp_doc*/
16137   __pyx_tp_traverse_8fastavro_5_read___pyx_scope_struct___iter_avro_records, /*tp_traverse*/
16138   0, /*tp_clear*/
16139   0, /*tp_richcompare*/
16140   0, /*tp_weaklistoffset*/
16141   0, /*tp_iter*/
16142   0, /*tp_iternext*/
16143   0, /*tp_methods*/
16144   0, /*tp_members*/
16145   0, /*tp_getset*/
16146   0, /*tp_base*/
16147   0, /*tp_dict*/
16148   0, /*tp_descr_get*/
16149   0, /*tp_descr_set*/
16150   0, /*tp_dictoffset*/
16151   0, /*tp_init*/
16152   0, /*tp_alloc*/
16153   __pyx_tp_new_8fastavro_5_read___pyx_scope_struct___iter_avro_records, /*tp_new*/
16154   0, /*tp_free*/
16155   0, /*tp_is_gc*/
16156   0, /*tp_bases*/
16157   0, /*tp_mro*/
16158   0, /*tp_cache*/
16159   0, /*tp_subclasses*/
16160   0, /*tp_weaklist*/
16161   0, /*tp_del*/
16162   0, /*tp_version_tag*/
16163   #if PY_VERSION_HEX >= 0x030400a1
16164   0, /*tp_finalize*/
16165   #endif
16166   #if PY_VERSION_HEX >= 0x030800b1
16167   0, /*tp_vectorcall*/
16168   #endif
16169   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
16170   0, /*tp_print*/
16171   #endif
16172 };
16173 
16174 static struct __pyx_obj_8fastavro_5_read___pyx_scope_struct_1__iter_avro_blocks *__pyx_freelist_8fastavro_5_read___pyx_scope_struct_1__iter_avro_blocks[8];
16175 static int __pyx_freecount_8fastavro_5_read___pyx_scope_struct_1__iter_avro_blocks = 0;
16176 
__pyx_tp_new_8fastavro_5_read___pyx_scope_struct_1__iter_avro_blocks(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)16177 static PyObject *__pyx_tp_new_8fastavro_5_read___pyx_scope_struct_1__iter_avro_blocks(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
16178   PyObject *o;
16179   if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_8fastavro_5_read___pyx_scope_struct_1__iter_avro_blocks > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_8fastavro_5_read___pyx_scope_struct_1__iter_avro_blocks)))) {
16180     o = (PyObject*)__pyx_freelist_8fastavro_5_read___pyx_scope_struct_1__iter_avro_blocks[--__pyx_freecount_8fastavro_5_read___pyx_scope_struct_1__iter_avro_blocks];
16181     memset(o, 0, sizeof(struct __pyx_obj_8fastavro_5_read___pyx_scope_struct_1__iter_avro_blocks));
16182     (void) PyObject_INIT(o, t);
16183     PyObject_GC_Track(o);
16184   } else {
16185     o = (*t->tp_alloc)(t, 0);
16186     if (unlikely(!o)) return 0;
16187   }
16188   return o;
16189 }
16190 
__pyx_tp_dealloc_8fastavro_5_read___pyx_scope_struct_1__iter_avro_blocks(PyObject * o)16191 static void __pyx_tp_dealloc_8fastavro_5_read___pyx_scope_struct_1__iter_avro_blocks(PyObject *o) {
16192   struct __pyx_obj_8fastavro_5_read___pyx_scope_struct_1__iter_avro_blocks *p = (struct __pyx_obj_8fastavro_5_read___pyx_scope_struct_1__iter_avro_blocks *)o;
16193   PyObject_GC_UnTrack(o);
16194   Py_CLEAR(p->__pyx_v_block_bytes);
16195   Py_CLEAR(p->__pyx_v_codec);
16196   Py_CLEAR(p->__pyx_v_fo);
16197   Py_CLEAR(p->__pyx_v_header);
16198   Py_CLEAR(p->__pyx_v_named_schemas);
16199   Py_CLEAR(p->__pyx_v_offset);
16200   Py_CLEAR(p->__pyx_v_read_block);
16201   Py_CLEAR(p->__pyx_v_reader_schema);
16202   Py_CLEAR(p->__pyx_v_return_record_name);
16203   Py_CLEAR(p->__pyx_v_size);
16204   Py_CLEAR(p->__pyx_v_sync_marker);
16205   Py_CLEAR(p->__pyx_v_writer_schema);
16206   if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_8fastavro_5_read___pyx_scope_struct_1__iter_avro_blocks < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8fastavro_5_read___pyx_scope_struct_1__iter_avro_blocks)))) {
16207     __pyx_freelist_8fastavro_5_read___pyx_scope_struct_1__iter_avro_blocks[__pyx_freecount_8fastavro_5_read___pyx_scope_struct_1__iter_avro_blocks++] = ((struct __pyx_obj_8fastavro_5_read___pyx_scope_struct_1__iter_avro_blocks *)o);
16208   } else {
16209     (*Py_TYPE(o)->tp_free)(o);
16210   }
16211 }
16212 
__pyx_tp_traverse_8fastavro_5_read___pyx_scope_struct_1__iter_avro_blocks(PyObject * o,visitproc v,void * a)16213 static int __pyx_tp_traverse_8fastavro_5_read___pyx_scope_struct_1__iter_avro_blocks(PyObject *o, visitproc v, void *a) {
16214   int e;
16215   struct __pyx_obj_8fastavro_5_read___pyx_scope_struct_1__iter_avro_blocks *p = (struct __pyx_obj_8fastavro_5_read___pyx_scope_struct_1__iter_avro_blocks *)o;
16216   if (p->__pyx_v_block_bytes) {
16217     e = (*v)(p->__pyx_v_block_bytes, a); if (e) return e;
16218   }
16219   if (p->__pyx_v_codec) {
16220     e = (*v)(p->__pyx_v_codec, a); if (e) return e;
16221   }
16222   if (p->__pyx_v_fo) {
16223     e = (*v)(p->__pyx_v_fo, a); if (e) return e;
16224   }
16225   if (p->__pyx_v_header) {
16226     e = (*v)(p->__pyx_v_header, a); if (e) return e;
16227   }
16228   if (p->__pyx_v_named_schemas) {
16229     e = (*v)(p->__pyx_v_named_schemas, a); if (e) return e;
16230   }
16231   if (p->__pyx_v_offset) {
16232     e = (*v)(p->__pyx_v_offset, a); if (e) return e;
16233   }
16234   if (p->__pyx_v_read_block) {
16235     e = (*v)(p->__pyx_v_read_block, a); if (e) return e;
16236   }
16237   if (p->__pyx_v_reader_schema) {
16238     e = (*v)(p->__pyx_v_reader_schema, a); if (e) return e;
16239   }
16240   if (p->__pyx_v_return_record_name) {
16241     e = (*v)(p->__pyx_v_return_record_name, a); if (e) return e;
16242   }
16243   if (p->__pyx_v_size) {
16244     e = (*v)(p->__pyx_v_size, a); if (e) return e;
16245   }
16246   if (p->__pyx_v_sync_marker) {
16247     e = (*v)(p->__pyx_v_sync_marker, a); if (e) return e;
16248   }
16249   if (p->__pyx_v_writer_schema) {
16250     e = (*v)(p->__pyx_v_writer_schema, a); if (e) return e;
16251   }
16252   return 0;
16253 }
16254 
16255 static PyTypeObject __pyx_type_8fastavro_5_read___pyx_scope_struct_1__iter_avro_blocks = {
16256   PyVarObject_HEAD_INIT(0, 0)
16257   "fastavro._read.__pyx_scope_struct_1__iter_avro_blocks", /*tp_name*/
16258   sizeof(struct __pyx_obj_8fastavro_5_read___pyx_scope_struct_1__iter_avro_blocks), /*tp_basicsize*/
16259   0, /*tp_itemsize*/
16260   __pyx_tp_dealloc_8fastavro_5_read___pyx_scope_struct_1__iter_avro_blocks, /*tp_dealloc*/
16261   #if PY_VERSION_HEX < 0x030800b4
16262   0, /*tp_print*/
16263   #endif
16264   #if PY_VERSION_HEX >= 0x030800b4
16265   0, /*tp_vectorcall_offset*/
16266   #endif
16267   0, /*tp_getattr*/
16268   0, /*tp_setattr*/
16269   #if PY_MAJOR_VERSION < 3
16270   0, /*tp_compare*/
16271   #endif
16272   #if PY_MAJOR_VERSION >= 3
16273   0, /*tp_as_async*/
16274   #endif
16275   0, /*tp_repr*/
16276   0, /*tp_as_number*/
16277   0, /*tp_as_sequence*/
16278   0, /*tp_as_mapping*/
16279   0, /*tp_hash*/
16280   0, /*tp_call*/
16281   0, /*tp_str*/
16282   0, /*tp_getattro*/
16283   0, /*tp_setattro*/
16284   0, /*tp_as_buffer*/
16285   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
16286   0, /*tp_doc*/
16287   __pyx_tp_traverse_8fastavro_5_read___pyx_scope_struct_1__iter_avro_blocks, /*tp_traverse*/
16288   0, /*tp_clear*/
16289   0, /*tp_richcompare*/
16290   0, /*tp_weaklistoffset*/
16291   0, /*tp_iter*/
16292   0, /*tp_iternext*/
16293   0, /*tp_methods*/
16294   0, /*tp_members*/
16295   0, /*tp_getset*/
16296   0, /*tp_base*/
16297   0, /*tp_dict*/
16298   0, /*tp_descr_get*/
16299   0, /*tp_descr_set*/
16300   0, /*tp_dictoffset*/
16301   0, /*tp_init*/
16302   0, /*tp_alloc*/
16303   __pyx_tp_new_8fastavro_5_read___pyx_scope_struct_1__iter_avro_blocks, /*tp_new*/
16304   0, /*tp_free*/
16305   0, /*tp_is_gc*/
16306   0, /*tp_bases*/
16307   0, /*tp_mro*/
16308   0, /*tp_cache*/
16309   0, /*tp_subclasses*/
16310   0, /*tp_weaklist*/
16311   0, /*tp_del*/
16312   0, /*tp_version_tag*/
16313   #if PY_VERSION_HEX >= 0x030400a1
16314   0, /*tp_finalize*/
16315   #endif
16316   #if PY_VERSION_HEX >= 0x030800b1
16317   0, /*tp_vectorcall*/
16318   #endif
16319   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
16320   0, /*tp_print*/
16321   #endif
16322 };
16323 
16324 static struct __pyx_obj_8fastavro_5_read___pyx_scope_struct_2___iter__ *__pyx_freelist_8fastavro_5_read___pyx_scope_struct_2___iter__[8];
16325 static int __pyx_freecount_8fastavro_5_read___pyx_scope_struct_2___iter__ = 0;
16326 
__pyx_tp_new_8fastavro_5_read___pyx_scope_struct_2___iter__(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)16327 static PyObject *__pyx_tp_new_8fastavro_5_read___pyx_scope_struct_2___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
16328   PyObject *o;
16329   if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_8fastavro_5_read___pyx_scope_struct_2___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_8fastavro_5_read___pyx_scope_struct_2___iter__)))) {
16330     o = (PyObject*)__pyx_freelist_8fastavro_5_read___pyx_scope_struct_2___iter__[--__pyx_freecount_8fastavro_5_read___pyx_scope_struct_2___iter__];
16331     memset(o, 0, sizeof(struct __pyx_obj_8fastavro_5_read___pyx_scope_struct_2___iter__));
16332     (void) PyObject_INIT(o, t);
16333     PyObject_GC_Track(o);
16334   } else {
16335     o = (*t->tp_alloc)(t, 0);
16336     if (unlikely(!o)) return 0;
16337   }
16338   return o;
16339 }
16340 
__pyx_tp_dealloc_8fastavro_5_read___pyx_scope_struct_2___iter__(PyObject * o)16341 static void __pyx_tp_dealloc_8fastavro_5_read___pyx_scope_struct_2___iter__(PyObject *o) {
16342   struct __pyx_obj_8fastavro_5_read___pyx_scope_struct_2___iter__ *p = (struct __pyx_obj_8fastavro_5_read___pyx_scope_struct_2___iter__ *)o;
16343   PyObject_GC_UnTrack(o);
16344   Py_CLEAR(p->__pyx_v_i);
16345   Py_CLEAR(p->__pyx_v_self);
16346   Py_CLEAR(p->__pyx_t_0);
16347   if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_8fastavro_5_read___pyx_scope_struct_2___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8fastavro_5_read___pyx_scope_struct_2___iter__)))) {
16348     __pyx_freelist_8fastavro_5_read___pyx_scope_struct_2___iter__[__pyx_freecount_8fastavro_5_read___pyx_scope_struct_2___iter__++] = ((struct __pyx_obj_8fastavro_5_read___pyx_scope_struct_2___iter__ *)o);
16349   } else {
16350     (*Py_TYPE(o)->tp_free)(o);
16351   }
16352 }
16353 
__pyx_tp_traverse_8fastavro_5_read___pyx_scope_struct_2___iter__(PyObject * o,visitproc v,void * a)16354 static int __pyx_tp_traverse_8fastavro_5_read___pyx_scope_struct_2___iter__(PyObject *o, visitproc v, void *a) {
16355   int e;
16356   struct __pyx_obj_8fastavro_5_read___pyx_scope_struct_2___iter__ *p = (struct __pyx_obj_8fastavro_5_read___pyx_scope_struct_2___iter__ *)o;
16357   if (p->__pyx_v_i) {
16358     e = (*v)(p->__pyx_v_i, a); if (e) return e;
16359   }
16360   if (p->__pyx_v_self) {
16361     e = (*v)(p->__pyx_v_self, a); if (e) return e;
16362   }
16363   if (p->__pyx_t_0) {
16364     e = (*v)(p->__pyx_t_0, a); if (e) return e;
16365   }
16366   return 0;
16367 }
16368 
16369 static PyTypeObject __pyx_type_8fastavro_5_read___pyx_scope_struct_2___iter__ = {
16370   PyVarObject_HEAD_INIT(0, 0)
16371   "fastavro._read.__pyx_scope_struct_2___iter__", /*tp_name*/
16372   sizeof(struct __pyx_obj_8fastavro_5_read___pyx_scope_struct_2___iter__), /*tp_basicsize*/
16373   0, /*tp_itemsize*/
16374   __pyx_tp_dealloc_8fastavro_5_read___pyx_scope_struct_2___iter__, /*tp_dealloc*/
16375   #if PY_VERSION_HEX < 0x030800b4
16376   0, /*tp_print*/
16377   #endif
16378   #if PY_VERSION_HEX >= 0x030800b4
16379   0, /*tp_vectorcall_offset*/
16380   #endif
16381   0, /*tp_getattr*/
16382   0, /*tp_setattr*/
16383   #if PY_MAJOR_VERSION < 3
16384   0, /*tp_compare*/
16385   #endif
16386   #if PY_MAJOR_VERSION >= 3
16387   0, /*tp_as_async*/
16388   #endif
16389   0, /*tp_repr*/
16390   0, /*tp_as_number*/
16391   0, /*tp_as_sequence*/
16392   0, /*tp_as_mapping*/
16393   0, /*tp_hash*/
16394   0, /*tp_call*/
16395   0, /*tp_str*/
16396   0, /*tp_getattro*/
16397   0, /*tp_setattro*/
16398   0, /*tp_as_buffer*/
16399   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
16400   0, /*tp_doc*/
16401   __pyx_tp_traverse_8fastavro_5_read___pyx_scope_struct_2___iter__, /*tp_traverse*/
16402   0, /*tp_clear*/
16403   0, /*tp_richcompare*/
16404   0, /*tp_weaklistoffset*/
16405   0, /*tp_iter*/
16406   0, /*tp_iternext*/
16407   0, /*tp_methods*/
16408   0, /*tp_members*/
16409   0, /*tp_getset*/
16410   0, /*tp_base*/
16411   0, /*tp_dict*/
16412   0, /*tp_descr_get*/
16413   0, /*tp_descr_set*/
16414   0, /*tp_dictoffset*/
16415   0, /*tp_init*/
16416   0, /*tp_alloc*/
16417   __pyx_tp_new_8fastavro_5_read___pyx_scope_struct_2___iter__, /*tp_new*/
16418   0, /*tp_free*/
16419   0, /*tp_is_gc*/
16420   0, /*tp_bases*/
16421   0, /*tp_mro*/
16422   0, /*tp_cache*/
16423   0, /*tp_subclasses*/
16424   0, /*tp_weaklist*/
16425   0, /*tp_del*/
16426   0, /*tp_version_tag*/
16427   #if PY_VERSION_HEX >= 0x030400a1
16428   0, /*tp_finalize*/
16429   #endif
16430   #if PY_VERSION_HEX >= 0x030800b1
16431   0, /*tp_vectorcall*/
16432   #endif
16433   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
16434   0, /*tp_print*/
16435   #endif
16436 };
16437 
16438 static PyMethodDef __pyx_methods[] = {
16439   {"match_types", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8fastavro_5_read_1match_types, METH_VARARGS|METH_KEYWORDS, 0},
16440   {"match_schemas", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8fastavro_5_read_3match_schemas, METH_VARARGS|METH_KEYWORDS, 0},
16441   {"read_timestamp_millis", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8fastavro_5_read_5read_timestamp_millis, METH_VARARGS|METH_KEYWORDS, 0},
16442   {"read_timestamp_micros", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8fastavro_5_read_7read_timestamp_micros, METH_VARARGS|METH_KEYWORDS, 0},
16443   {"read_date", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8fastavro_5_read_9read_date, METH_VARARGS|METH_KEYWORDS, 0},
16444   {"read_uuid", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8fastavro_5_read_11read_uuid, METH_VARARGS|METH_KEYWORDS, 0},
16445   {"read_time_millis", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8fastavro_5_read_13read_time_millis, METH_VARARGS|METH_KEYWORDS, 0},
16446   {"read_time_micros", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8fastavro_5_read_15read_time_micros, METH_VARARGS|METH_KEYWORDS, 0},
16447   {"read_decimal", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8fastavro_5_read_17read_decimal, METH_VARARGS|METH_KEYWORDS, 0},
16448   {"maybe_promote", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8fastavro_5_read_19maybe_promote, METH_VARARGS|METH_KEYWORDS, 0},
16449   {"_read_data", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8fastavro_5_read_21_read_data, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8fastavro_5_read_20_read_data},
16450   {"skip_sync", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8fastavro_5_read_23skip_sync, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8fastavro_5_read_22skip_sync},
16451   {"null_read_block", (PyCFunction)__pyx_pw_8fastavro_5_read_25null_read_block, METH_O, __pyx_doc_8fastavro_5_read_24null_read_block},
16452   {"deflate_read_block", (PyCFunction)__pyx_pw_8fastavro_5_read_27deflate_read_block, METH_O, __pyx_doc_8fastavro_5_read_26deflate_read_block},
16453   {"bzip2_read_block", (PyCFunction)__pyx_pw_8fastavro_5_read_29bzip2_read_block, METH_O, __pyx_doc_8fastavro_5_read_28bzip2_read_block},
16454   {"snappy_read_block", (PyCFunction)__pyx_pw_8fastavro_5_read_31snappy_read_block, METH_O, 0},
16455   {"zstandard_read_block", (PyCFunction)__pyx_pw_8fastavro_5_read_33zstandard_read_block, METH_O, 0},
16456   {"lz4_read_block", (PyCFunction)__pyx_pw_8fastavro_5_read_35lz4_read_block, METH_O, 0},
16457   {"xz_read_block", (PyCFunction)__pyx_pw_8fastavro_5_read_37xz_read_block, METH_O, 0},
16458   {"schemaless_reader", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8fastavro_5_read_45schemaless_reader, METH_VARARGS|METH_KEYWORDS, 0},
16459   {"is_avro", (PyCFunction)__pyx_pw_8fastavro_5_read_47is_avro, METH_O, 0},
16460   {0, 0, 0, 0}
16461 };
16462 
16463 #if PY_MAJOR_VERSION >= 3
16464 #if CYTHON_PEP489_MULTI_PHASE_INIT
16465 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
16466 static int __pyx_pymod_exec__read(PyObject* module); /*proto*/
16467 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
16468   {Py_mod_create, (void*)__pyx_pymod_create},
16469   {Py_mod_exec, (void*)__pyx_pymod_exec__read},
16470   {0, NULL}
16471 };
16472 #endif
16473 
16474 static struct PyModuleDef __pyx_moduledef = {
16475     PyModuleDef_HEAD_INIT,
16476     "_read",
16477     __pyx_k_Python_code_for_reading_AVRO_fil, /* m_doc */
16478   #if CYTHON_PEP489_MULTI_PHASE_INIT
16479     0, /* m_size */
16480   #else
16481     -1, /* m_size */
16482   #endif
16483     __pyx_methods /* m_methods */,
16484   #if CYTHON_PEP489_MULTI_PHASE_INIT
16485     __pyx_moduledef_slots, /* m_slots */
16486   #else
16487     NULL, /* m_reload */
16488   #endif
16489     NULL, /* m_traverse */
16490     NULL, /* m_clear */
16491     NULL /* m_free */
16492 };
16493 #endif
16494 #ifndef CYTHON_SMALL_CODE
16495 #if defined(__clang__)
16496     #define CYTHON_SMALL_CODE
16497 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
16498     #define CYTHON_SMALL_CODE __attribute__((cold))
16499 #else
16500     #define CYTHON_SMALL_CODE
16501 #endif
16502 #endif
16503 
16504 static __Pyx_StringTabEntry __pyx_string_tab[] = {
16505   {&__pyx_n_s_AVRO_TYPES, __pyx_k_AVRO_TYPES, sizeof(__pyx_k_AVRO_TYPES), 0, 0, 1, 1},
16506   {&__pyx_kp_s_Avro_block_d_bytes_d_records_cod, __pyx_k_Avro_block_d_bytes_d_records_cod, sizeof(__pyx_k_Avro_block_d_bytes_d_records_cod), 0, 0, 1, 0},
16507   {&__pyx_n_s_BLOCK_READERS, __pyx_k_BLOCK_READERS, sizeof(__pyx_k_BLOCK_READERS), 0, 0, 1, 1},
16508   {&__pyx_n_s_Block, __pyx_k_Block, sizeof(__pyx_k_Block), 0, 0, 1, 1},
16509   {&__pyx_n_s_Block___init, __pyx_k_Block___init, sizeof(__pyx_k_Block___init), 0, 0, 1, 1},
16510   {&__pyx_n_s_Block___iter, __pyx_k_Block___iter, sizeof(__pyx_k_Block___iter), 0, 0, 1, 1},
16511   {&__pyx_n_s_Block___str, __pyx_k_Block___str, sizeof(__pyx_k_Block___str), 0, 0, 1, 1},
16512   {&__pyx_n_s_CYTHON_MODULE, __pyx_k_CYTHON_MODULE, sizeof(__pyx_k_CYTHON_MODULE), 0, 0, 1, 1},
16513   {&__pyx_n_s_Context, __pyx_k_Context, sizeof(__pyx_k_Context), 0, 0, 1, 1},
16514   {&__pyx_n_s_DAYS_SHIFT, __pyx_k_DAYS_SHIFT, sizeof(__pyx_k_DAYS_SHIFT), 0, 0, 1, 1},
16515   {&__pyx_n_s_DeprecationWarning, __pyx_k_DeprecationWarning, sizeof(__pyx_k_DeprecationWarning), 0, 0, 1, 1},
16516   {&__pyx_n_s_EOFError, __pyx_k_EOFError, sizeof(__pyx_k_EOFError), 0, 0, 1, 1},
16517   {&__pyx_n_s_HEADER_SCHEMA, __pyx_k_HEADER_SCHEMA, sizeof(__pyx_k_HEADER_SCHEMA), 0, 0, 1, 1},
16518   {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
16519   {&__pyx_n_s_LOGICAL_READERS, __pyx_k_LOGICAL_READERS, sizeof(__pyx_k_LOGICAL_READERS), 0, 0, 1, 1},
16520   {&__pyx_n_s_MAGIC, __pyx_k_MAGIC, sizeof(__pyx_k_MAGIC), 0, 0, 1, 1},
16521   {&__pyx_n_s_MASK, __pyx_k_MASK, sizeof(__pyx_k_MASK), 0, 0, 1, 1},
16522   {&__pyx_n_s_MCS_PER_HOUR, __pyx_k_MCS_PER_HOUR, sizeof(__pyx_k_MCS_PER_HOUR), 0, 0, 1, 1},
16523   {&__pyx_n_s_MCS_PER_MINUTE, __pyx_k_MCS_PER_MINUTE, sizeof(__pyx_k_MCS_PER_MINUTE), 0, 0, 1, 1},
16524   {&__pyx_n_s_MCS_PER_SECOND, __pyx_k_MCS_PER_SECOND, sizeof(__pyx_k_MCS_PER_SECOND), 0, 0, 1, 1},
16525   {&__pyx_n_s_MLS_PER_HOUR, __pyx_k_MLS_PER_HOUR, sizeof(__pyx_k_MLS_PER_HOUR), 0, 0, 1, 1},
16526   {&__pyx_n_s_MLS_PER_MINUTE, __pyx_k_MLS_PER_MINUTE, sizeof(__pyx_k_MLS_PER_MINUTE), 0, 0, 1, 1},
16527   {&__pyx_n_s_MLS_PER_SECOND, __pyx_k_MLS_PER_SECOND, sizeof(__pyx_k_MLS_PER_SECOND), 0, 0, 1, 1},
16528   {&__pyx_n_s_MemoryIO, __pyx_k_MemoryIO, sizeof(__pyx_k_MemoryIO), 0, 0, 1, 1},
16529   {&__pyx_kp_s_No_default_value_for_s, __pyx_k_No_default_value_for_s, sizeof(__pyx_k_No_default_value_for_s), 0, 0, 1, 0},
16530   {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1},
16531   {&__pyx_n_s_ReadError, __pyx_k_ReadError, sizeof(__pyx_k_ReadError), 0, 0, 1, 1},
16532   {&__pyx_n_s_SYNC_SIZE, __pyx_k_SYNC_SIZE, sizeof(__pyx_k_SYNC_SIZE), 0, 0, 1, 1},
16533   {&__pyx_n_s_SchemaResolutionError, __pyx_k_SchemaResolutionError, sizeof(__pyx_k_SchemaResolutionError), 0, 0, 1, 1},
16534   {&__pyx_kp_s_Schema_mismatch_s_is_not_s, __pyx_k_Schema_mismatch_s_is_not_s, sizeof(__pyx_k_Schema_mismatch_s_is_not_s), 0, 0, 1, 0},
16535   {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1},
16536   {&__pyx_kp_s_The_schema_attribute_is_deprecat, __pyx_k_The_schema_attribute_is_deprecat, sizeof(__pyx_k_The_schema_attribute_is_deprecat), 0, 0, 1, 0},
16537   {&__pyx_n_s_UUID, __pyx_k_UUID, sizeof(__pyx_k_UUID), 0, 0, 1, 1},
16538   {&__pyx_kp_s_Unrecognized_codec_r, __pyx_k_Unrecognized_codec_r, sizeof(__pyx_k_Unrecognized_codec_r), 0, 0, 1, 0},
16539   {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
16540   {&__pyx_n_s_ZstdDecompressor, __pyx_k_ZstdDecompressor, sizeof(__pyx_k_ZstdDecompressor), 0, 0, 1, 1},
16541   {&__pyx_n_s_aliases, __pyx_k_aliases, sizeof(__pyx_k_aliases), 0, 0, 1, 1},
16542   {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
16543   {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1},
16544   {&__pyx_kp_s_avro_codec, __pyx_k_avro_codec, sizeof(__pyx_k_avro_codec), 0, 0, 1, 0},
16545   {&__pyx_kp_s_avro_schema, __pyx_k_avro_schema, sizeof(__pyx_k_avro_schema), 0, 0, 1, 0},
16546   {&__pyx_n_s_backports, __pyx_k_backports, sizeof(__pyx_k_backports), 0, 0, 1, 1},
16547   {&__pyx_kp_s_backports_lzma, __pyx_k_backports_lzma, sizeof(__pyx_k_backports_lzma), 0, 0, 1, 0},
16548   {&__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},
16549   {&__pyx_n_s_block, __pyx_k_block, sizeof(__pyx_k_block), 0, 0, 1, 1},
16550   {&__pyx_n_s_block_bytes, __pyx_k_block_bytes, sizeof(__pyx_k_block_bytes), 0, 0, 1, 1},
16551   {&__pyx_n_s_block_count, __pyx_k_block_count, sizeof(__pyx_k_block_count), 0, 0, 1, 1},
16552   {&__pyx_n_s_block_fo, __pyx_k_block_fo, sizeof(__pyx_k_block_fo), 0, 0, 1, 1},
16553   {&__pyx_n_s_block_reader, __pyx_k_block_reader, sizeof(__pyx_k_block_reader), 0, 0, 1, 1},
16554   {&__pyx_n_s_block_reader___init, __pyx_k_block_reader___init, sizeof(__pyx_k_block_reader___init), 0, 0, 1, 1},
16555   {&__pyx_n_s_boolean, __pyx_k_boolean, sizeof(__pyx_k_boolean), 0, 0, 1, 1},
16556   {&__pyx_n_s_btou, __pyx_k_btou, sizeof(__pyx_k_btou), 0, 0, 1, 1},
16557   {&__pyx_n_s_bytes, __pyx_k_bytes, sizeof(__pyx_k_bytes), 0, 0, 1, 1},
16558   {&__pyx_n_s_bytes_2, __pyx_k_bytes_2, sizeof(__pyx_k_bytes_2), 0, 0, 1, 1},
16559   {&__pyx_kp_s_bytes_decimal, __pyx_k_bytes_decimal, sizeof(__pyx_k_bytes_decimal), 0, 0, 1, 0},
16560   {&__pyx_n_s_bz2, __pyx_k_bz2, sizeof(__pyx_k_bz2), 0, 0, 1, 1},
16561   {&__pyx_n_s_bzip2, __pyx_k_bzip2, sizeof(__pyx_k_bzip2), 0, 0, 1, 1},
16562   {&__pyx_n_s_bzip2_read_block, __pyx_k_bzip2_read_block, sizeof(__pyx_k_bzip2_read_block), 0, 0, 1, 1},
16563   {&__pyx_kp_s_cannot_read_header_is_it_an_avro, __pyx_k_cannot_read_header_is_it_an_avro, sizeof(__pyx_k_cannot_read_header_is_it_an_avro), 0, 0, 1, 0},
16564   {&__pyx_kp_s_cannot_read_s_from_s, __pyx_k_cannot_read_s_from_s, sizeof(__pyx_k_cannot_read_s_from_s), 0, 0, 1, 0},
16565   {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
16566   {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
16567   {&__pyx_n_s_codec, __pyx_k_codec, sizeof(__pyx_k_codec), 0, 0, 1, 1},
16568   {&__pyx_n_s_const, __pyx_k_const, sizeof(__pyx_k_const), 0, 0, 1, 1},
16569   {&__pyx_n_s_create_decimal, __pyx_k_create_decimal, sizeof(__pyx_k_create_decimal), 0, 0, 1, 1},
16570   {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
16571   {&__pyx_n_s_date, __pyx_k_date, sizeof(__pyx_k_date), 0, 0, 1, 1},
16572   {&__pyx_n_s_datetime, __pyx_k_datetime, sizeof(__pyx_k_datetime), 0, 0, 1, 1},
16573   {&__pyx_n_s_decimal, __pyx_k_decimal, sizeof(__pyx_k_decimal), 0, 0, 1, 1},
16574   {&__pyx_n_s_decimal_context, __pyx_k_decimal_context, sizeof(__pyx_k_decimal_context), 0, 0, 1, 1},
16575   {&__pyx_n_s_decompress, __pyx_k_decompress, sizeof(__pyx_k_decompress), 0, 0, 1, 1},
16576   {&__pyx_n_s_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 1, 1},
16577   {&__pyx_n_s_deflate, __pyx_k_deflate, sizeof(__pyx_k_deflate), 0, 0, 1, 1},
16578   {&__pyx_n_s_deflate_read_block, __pyx_k_deflate_read_block, sizeof(__pyx_k_deflate_read_block), 0, 0, 1, 1},
16579   {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
16580   {&__pyx_n_s_double, __pyx_k_double, sizeof(__pyx_k_double), 0, 0, 1, 1},
16581   {&__pyx_n_s_elems, __pyx_k_elems, sizeof(__pyx_k_elems), 0, 0, 1, 1},
16582   {&__pyx_n_s_enum, __pyx_k_enum, sizeof(__pyx_k_enum), 0, 0, 1, 1},
16583   {&__pyx_n_s_epoch, __pyx_k_epoch, sizeof(__pyx_k_epoch), 0, 0, 1, 1},
16584   {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
16585   {&__pyx_n_s_error_union, __pyx_k_error_union, sizeof(__pyx_k_error_union), 0, 0, 1, 1},
16586   {&__pyx_kp_s_expected_sync_marker_not_found, __pyx_k_expected_sync_marker_not_found, sizeof(__pyx_k_expected_sync_marker_not_found), 0, 0, 1, 0},
16587   {&__pyx_n_s_extract_logical_type, __pyx_k_extract_logical_type, sizeof(__pyx_k_extract_logical_type), 0, 0, 1, 1},
16588   {&__pyx_n_s_extract_record_type, __pyx_k_extract_record_type, sizeof(__pyx_k_extract_record_type), 0, 0, 1, 1},
16589   {&__pyx_n_s_fastavro__read, __pyx_k_fastavro__read, sizeof(__pyx_k_fastavro__read), 0, 0, 1, 1},
16590   {&__pyx_kp_s_fastavro__read_pyx, __pyx_k_fastavro__read_pyx, sizeof(__pyx_k_fastavro__read_pyx), 0, 0, 1, 0},
16591   {&__pyx_n_s_fastavro_six, __pyx_k_fastavro_six, sizeof(__pyx_k_fastavro_six), 0, 0, 1, 1},
16592   {&__pyx_n_s_fields, __pyx_k_fields, sizeof(__pyx_k_fields), 0, 0, 1, 1},
16593   {&__pyx_n_s_file_reader, __pyx_k_file_reader, sizeof(__pyx_k_file_reader), 0, 0, 1, 1},
16594   {&__pyx_n_s_file_reader___init, __pyx_k_file_reader___init, sizeof(__pyx_k_file_reader___init), 0, 0, 1, 1},
16595   {&__pyx_n_s_file_reader___iter, __pyx_k_file_reader___iter, sizeof(__pyx_k_file_reader___iter), 0, 0, 1, 1},
16596   {&__pyx_n_s_file_reader_next, __pyx_k_file_reader_next, sizeof(__pyx_k_file_reader_next), 0, 0, 1, 1},
16597   {&__pyx_n_s_file_reader_schema, __pyx_k_file_reader_schema, sizeof(__pyx_k_file_reader_schema), 0, 0, 1, 1},
16598   {&__pyx_n_s_fixed, __pyx_k_fixed, sizeof(__pyx_k_fixed), 0, 0, 1, 1},
16599   {&__pyx_kp_s_fixed_decimal, __pyx_k_fixed_decimal, sizeof(__pyx_k_fixed_decimal), 0, 0, 1, 0},
16600   {&__pyx_n_s_float, __pyx_k_float, sizeof(__pyx_k_float), 0, 0, 1, 1},
16601   {&__pyx_n_s_fo, __pyx_k_fo, sizeof(__pyx_k_fo), 0, 0, 1, 1},
16602   {&__pyx_n_s_force, __pyx_k_force, sizeof(__pyx_k_force), 0, 0, 1, 1},
16603   {&__pyx_n_s_fromordinal, __pyx_k_fromordinal, sizeof(__pyx_k_fromordinal), 0, 0, 1, 1},
16604   {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
16605   {&__pyx_n_s_header, __pyx_k_header, sizeof(__pyx_k_header), 0, 0, 1, 1},
16606   {&__pyx_n_s_header_2, __pyx_k_header_2, sizeof(__pyx_k_header_2), 0, 0, 1, 1},
16607   {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
16608   {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
16609   {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
16610   {&__pyx_n_s_int, __pyx_k_int, sizeof(__pyx_k_int), 0, 0, 1, 1},
16611   {&__pyx_kp_s_int_date, __pyx_k_int_date, sizeof(__pyx_k_int_date), 0, 0, 1, 0},
16612   {&__pyx_kp_s_int_time_millis, __pyx_k_int_time_millis, sizeof(__pyx_k_int_time_millis), 0, 0, 1, 0},
16613   {&__pyx_n_s_is_str, __pyx_k_is_str, sizeof(__pyx_k_is_str), 0, 0, 1, 1},
16614   {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1},
16615   {&__pyx_n_s_iter, __pyx_k_iter, sizeof(__pyx_k_iter), 0, 0, 1, 1},
16616   {&__pyx_n_s_iter_avro_blocks, __pyx_k_iter_avro_blocks, sizeof(__pyx_k_iter_avro_blocks), 0, 0, 1, 1},
16617   {&__pyx_n_s_iter_avro_records, __pyx_k_iter_avro_records, sizeof(__pyx_k_iter_avro_records), 0, 0, 1, 1},
16618   {&__pyx_n_s_iteritems, __pyx_k_iteritems, sizeof(__pyx_k_iteritems), 0, 0, 1, 1},
16619   {&__pyx_n_s_json, __pyx_k_json, sizeof(__pyx_k_json), 0, 0, 1, 1},
16620   {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1},
16621   {&__pyx_n_s_loads, __pyx_k_loads, sizeof(__pyx_k_loads), 0, 0, 1, 1},
16622   {&__pyx_n_s_logicalType, __pyx_k_logicalType, sizeof(__pyx_k_logicalType), 0, 0, 1, 1},
16623   {&__pyx_n_s_long, __pyx_k_long, sizeof(__pyx_k_long), 0, 0, 1, 1},
16624   {&__pyx_kp_s_long_time_micros, __pyx_k_long_time_micros, sizeof(__pyx_k_long_time_micros), 0, 0, 1, 0},
16625   {&__pyx_kp_s_long_timestamp_micros, __pyx_k_long_timestamp_micros, sizeof(__pyx_k_long_timestamp_micros), 0, 0, 1, 0},
16626   {&__pyx_kp_s_long_timestamp_millis, __pyx_k_long_timestamp_millis, sizeof(__pyx_k_long_timestamp_millis), 0, 0, 1, 0},
16627   {&__pyx_n_s_lz4, __pyx_k_lz4, sizeof(__pyx_k_lz4), 0, 0, 1, 1},
16628   {&__pyx_n_s_lz4_block, __pyx_k_lz4_block, sizeof(__pyx_k_lz4_block), 0, 0, 1, 1},
16629   {&__pyx_n_s_lz4_read_block, __pyx_k_lz4_read_block, sizeof(__pyx_k_lz4_read_block), 0, 0, 1, 1},
16630   {&__pyx_n_s_lzma, __pyx_k_lzma, sizeof(__pyx_k_lzma), 0, 0, 1, 1},
16631   {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
16632   {&__pyx_n_s_map, __pyx_k_map, sizeof(__pyx_k_map), 0, 0, 1, 1},
16633   {&__pyx_n_s_meta, __pyx_k_meta, sizeof(__pyx_k_meta), 0, 0, 1, 1},
16634   {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
16635   {&__pyx_n_s_metadata, __pyx_k_metadata, sizeof(__pyx_k_metadata), 0, 0, 1, 1},
16636   {&__pyx_n_s_microseconds, __pyx_k_microseconds, sizeof(__pyx_k_microseconds), 0, 0, 1, 1},
16637   {&__pyx_n_s_missing_codec_lib, __pyx_k_missing_codec_lib, sizeof(__pyx_k_missing_codec_lib), 0, 0, 1, 1},
16638   {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
16639   {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
16640   {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
16641   {&__pyx_n_s_named_schemas, __pyx_k_named_schemas, sizeof(__pyx_k_named_schemas), 0, 0, 1, 1},
16642   {&__pyx_n_s_named_schemas_2, __pyx_k_named_schemas_2, sizeof(__pyx_k_named_schemas_2), 0, 0, 1, 1},
16643   {&__pyx_n_s_next, __pyx_k_next, sizeof(__pyx_k_next), 0, 0, 1, 1},
16644   {&__pyx_n_s_next_2, __pyx_k_next_2, sizeof(__pyx_k_next_2), 0, 0, 1, 1},
16645   {&__pyx_n_s_null, __pyx_k_null, sizeof(__pyx_k_null), 0, 0, 1, 1},
16646   {&__pyx_n_s_null_read_block, __pyx_k_null_read_block, sizeof(__pyx_k_null_read_block), 0, 0, 1, 1},
16647   {&__pyx_n_s_num_block_records, __pyx_k_num_block_records, sizeof(__pyx_k_num_block_records), 0, 0, 1, 1},
16648   {&__pyx_n_s_num_records, __pyx_k_num_records, sizeof(__pyx_k_num_records), 0, 0, 1, 1},
16649   {&__pyx_n_s_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1},
16650   {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1},
16651   {&__pyx_n_s_parse_schema, __pyx_k_parse_schema, sizeof(__pyx_k_parse_schema), 0, 0, 1, 1},
16652   {&__pyx_n_s_prec, __pyx_k_prec, sizeof(__pyx_k_prec), 0, 0, 1, 1},
16653   {&__pyx_n_s_precision, __pyx_k_precision, sizeof(__pyx_k_precision), 0, 0, 1, 1},
16654   {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
16655   {&__pyx_n_s_property, __pyx_k_property, sizeof(__pyx_k_property), 0, 0, 1, 1},
16656   {&__pyx_kp_s_python_snappy, __pyx_k_python_snappy, sizeof(__pyx_k_python_snappy), 0, 0, 1, 0},
16657   {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
16658   {&__pyx_n_s_r_schema, __pyx_k_r_schema, sizeof(__pyx_k_r_schema), 0, 0, 1, 1},
16659   {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
16660   {&__pyx_n_s_rb, __pyx_k_rb, sizeof(__pyx_k_rb), 0, 0, 1, 1},
16661   {&__pyx_n_s_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 0, 1, 1},
16662   {&__pyx_n_s_read_block, __pyx_k_read_block, sizeof(__pyx_k_read_block), 0, 0, 1, 1},
16663   {&__pyx_n_s_read_common, __pyx_k_read_common, sizeof(__pyx_k_read_common), 0, 0, 1, 1},
16664   {&__pyx_n_s_read_date, __pyx_k_read_date, sizeof(__pyx_k_read_date), 0, 0, 1, 1},
16665   {&__pyx_n_s_read_decimal, __pyx_k_read_decimal, sizeof(__pyx_k_read_decimal), 0, 0, 1, 1},
16666   {&__pyx_n_s_read_time_micros, __pyx_k_read_time_micros, sizeof(__pyx_k_read_time_micros), 0, 0, 1, 1},
16667   {&__pyx_n_s_read_time_millis, __pyx_k_read_time_millis, sizeof(__pyx_k_read_time_millis), 0, 0, 1, 1},
16668   {&__pyx_n_s_read_timestamp_micros, __pyx_k_read_timestamp_micros, sizeof(__pyx_k_read_timestamp_micros), 0, 0, 1, 1},
16669   {&__pyx_n_s_read_timestamp_millis, __pyx_k_read_timestamp_millis, sizeof(__pyx_k_read_timestamp_millis), 0, 0, 1, 1},
16670   {&__pyx_n_s_read_uuid, __pyx_k_read_uuid, sizeof(__pyx_k_read_uuid), 0, 0, 1, 1},
16671   {&__pyx_n_s_reader, __pyx_k_reader, sizeof(__pyx_k_reader), 0, 0, 1, 1},
16672   {&__pyx_n_s_reader___init, __pyx_k_reader___init, sizeof(__pyx_k_reader___init), 0, 0, 1, 1},
16673   {&__pyx_n_s_reader_schema, __pyx_k_reader_schema, sizeof(__pyx_k_reader_schema), 0, 0, 1, 1},
16674   {&__pyx_n_s_reader_type, __pyx_k_reader_type, sizeof(__pyx_k_reader_type), 0, 0, 1, 1},
16675   {&__pyx_n_s_record, __pyx_k_record, sizeof(__pyx_k_record), 0, 0, 1, 1},
16676   {&__pyx_n_s_request, __pyx_k_request, sizeof(__pyx_k_request), 0, 0, 1, 1},
16677   {&__pyx_n_s_return_record_name, __pyx_k_return_record_name, sizeof(__pyx_k_return_record_name), 0, 0, 1, 1},
16678   {&__pyx_kp_s_s_not_found_in_reader_symbol_li, __pyx_k_s_not_found_in_reader_symbol_li, sizeof(__pyx_k_s_not_found_in_reader_symbol_li), 0, 0, 1, 0},
16679   {&__pyx_n_s_scale, __pyx_k_scale, sizeof(__pyx_k_scale), 0, 0, 1, 1},
16680   {&__pyx_n_s_scaleb, __pyx_k_scaleb, sizeof(__pyx_k_scaleb), 0, 0, 1, 1},
16681   {&__pyx_n_s_schema, __pyx_k_schema, sizeof(__pyx_k_schema), 0, 0, 1, 1},
16682   {&__pyx_n_s_schema_2, __pyx_k_schema_2, sizeof(__pyx_k_schema_2), 0, 0, 1, 1},
16683   {&__pyx_kp_s_schema_mismatch_s_not_found_in_s, __pyx_k_schema_mismatch_s_not_found_in_s, sizeof(__pyx_k_schema_mismatch_s_not_found_in_s), 0, 0, 1, 0},
16684   {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
16685   {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1},
16686   {&__pyx_n_s_six, __pyx_k_six, sizeof(__pyx_k_six), 0, 0, 1, 1},
16687   {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
16688   {&__pyx_n_s_snappy, __pyx_k_snappy, sizeof(__pyx_k_snappy), 0, 0, 1, 1},
16689   {&__pyx_n_s_snappy_read_block, __pyx_k_snappy_read_block, sizeof(__pyx_k_snappy_read_block), 0, 0, 1, 1},
16690   {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1},
16691   {&__pyx_n_s_string, __pyx_k_string, sizeof(__pyx_k_string), 0, 0, 1, 1},
16692   {&__pyx_kp_s_string_uuid, __pyx_k_string_uuid, sizeof(__pyx_k_string_uuid), 0, 0, 1, 0},
16693   {&__pyx_n_s_symbols, __pyx_k_symbols, sizeof(__pyx_k_symbols), 0, 0, 1, 1},
16694   {&__pyx_n_s_sync, __pyx_k_sync, sizeof(__pyx_k_sync), 0, 0, 1, 1},
16695   {&__pyx_n_s_sync_marker, __pyx_k_sync_marker, sizeof(__pyx_k_sync_marker), 0, 0, 1, 1},
16696   {&__pyx_n_s_tell, __pyx_k_tell, sizeof(__pyx_k_tell), 0, 0, 1, 1},
16697   {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
16698   {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1},
16699   {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1},
16700   {&__pyx_n_s_timedelta, __pyx_k_timedelta, sizeof(__pyx_k_timedelta), 0, 0, 1, 1},
16701   {&__pyx_n_s_timezone, __pyx_k_timezone, sizeof(__pyx_k_timezone), 0, 0, 1, 1},
16702   {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1},
16703   {&__pyx_n_s_union, __pyx_k_union, sizeof(__pyx_k_union), 0, 0, 1, 1},
16704   {&__pyx_kp_s_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 0, 1, 0},
16705   {&__pyx_n_s_utob, __pyx_k_utob, sizeof(__pyx_k_utob), 0, 0, 1, 1},
16706   {&__pyx_n_s_uuid, __pyx_k_uuid, sizeof(__pyx_k_uuid), 0, 0, 1, 1},
16707   {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1},
16708   {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1},
16709   {&__pyx_n_s_w_schema, __pyx_k_w_schema, sizeof(__pyx_k_w_schema), 0, 0, 1, 1},
16710   {&__pyx_n_s_warn, __pyx_k_warn, sizeof(__pyx_k_warn), 0, 0, 1, 1},
16711   {&__pyx_n_s_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 0, 1, 1},
16712   {&__pyx_n_s_write_hint, __pyx_k_write_hint, sizeof(__pyx_k_write_hint), 0, 0, 1, 1},
16713   {&__pyx_n_s_writer_schema, __pyx_k_writer_schema, sizeof(__pyx_k_writer_schema), 0, 0, 1, 1},
16714   {&__pyx_n_s_writer_type, __pyx_k_writer_type, sizeof(__pyx_k_writer_type), 0, 0, 1, 1},
16715   {&__pyx_n_s_xz, __pyx_k_xz, sizeof(__pyx_k_xz), 0, 0, 1, 1},
16716   {&__pyx_n_s_xz_read_block, __pyx_k_xz_read_block, sizeof(__pyx_k_xz_read_block), 0, 0, 1, 1},
16717   {&__pyx_n_s_zlib, __pyx_k_zlib, sizeof(__pyx_k_zlib), 0, 0, 1, 1},
16718   {&__pyx_n_s_zstandard, __pyx_k_zstandard, sizeof(__pyx_k_zstandard), 0, 0, 1, 1},
16719   {&__pyx_n_s_zstandard_read_block, __pyx_k_zstandard_read_block, sizeof(__pyx_k_zstandard_read_block), 0, 0, 1, 1},
16720   {&__pyx_n_s_zstd, __pyx_k_zstd, sizeof(__pyx_k_zstd), 0, 0, 1, 1},
16721   {0, 0, 0, 0, 0, 0, 0}
16722 };
__Pyx_InitCachedBuiltins(void)16723 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
16724   __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 730, __pyx_L1_error)
16725   __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) __PYX_ERR(0, 926, __pyx_L1_error)
16726   __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(0, 202, __pyx_L1_error)
16727   __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 341, __pyx_L1_error)
16728   __pyx_builtin_EOFError = __Pyx_GetBuiltinName(__pyx_n_s_EOFError); if (!__pyx_builtin_EOFError) __PYX_ERR(0, 671, __pyx_L1_error)
16729   __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 692, __pyx_L1_error)
16730   __pyx_builtin_DeprecationWarning = __Pyx_GetBuiltinName(__pyx_n_s_DeprecationWarning); if (!__pyx_builtin_DeprecationWarning) __PYX_ERR(0, 931, __pyx_L1_error)
16731   __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 937, __pyx_L1_error)
16732   __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) __PYX_ERR(0, 995, __pyx_L1_error)
16733   return 0;
16734   __pyx_L1_error:;
16735   return -1;
16736 }
16737 
__Pyx_InitCachedConstants(void)16738 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
16739   __Pyx_RefNannyDeclarations
16740   __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
16741 
16742   /* "fastavro/_read.pyx":182
16743  *
16744  * cpdef read_decimal(data, writer_schema=None, reader_schema=None):
16745  *     scale = writer_schema.get('scale', 0)             # <<<<<<<<<<<<<<
16746  *     precision = writer_schema['precision']
16747  *
16748  */
16749   __pyx_tuple_ = PyTuple_Pack(2, __pyx_n_s_scale, __pyx_int_0); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 182, __pyx_L1_error)
16750   __Pyx_GOTREF(__pyx_tuple_);
16751   __Pyx_GIVEREF(__pyx_tuple_);
16752 
16753   /* "fastavro/_read.pyx":692
16754  *     """Skip an expected sync marker, complaining if it doesn't match"""
16755  *     if fo.read(SYNC_SIZE) != sync_marker:
16756  *         raise ValueError('expected sync marker not found')             # <<<<<<<<<<<<<<
16757  *
16758  *
16759  */
16760   __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_expected_sync_marker_not_found); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 692, __pyx_L1_error)
16761   __Pyx_GOTREF(__pyx_tuple__2);
16762   __Pyx_GIVEREF(__pyx_tuple__2);
16763 
16764   /* "fastavro/_read.pyx":897
16765  *                                       return_record_name)
16766  *         except StopIteration:
16767  *             raise ValueError('cannot read header - is it an avro file?')             # <<<<<<<<<<<<<<
16768  *
16769  *         # `meta` values are bytes. So, the actual decoding has to be external.
16770  */
16771   __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_cannot_read_header_is_it_an_avro); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 897, __pyx_L1_error)
16772   __Pyx_GOTREF(__pyx_tuple__6);
16773   __Pyx_GIVEREF(__pyx_tuple__6);
16774 
16775   /* "fastavro/_read.pyx":905
16776  *
16777  *         self._schema = json.loads(self.metadata['avro.schema'])
16778  *         self.codec = self.metadata.get('avro.codec', 'null')             # <<<<<<<<<<<<<<
16779  *
16780  *         self._named_schemas = {}
16781  */
16782   __pyx_tuple__7 = PyTuple_Pack(2, __pyx_kp_s_avro_codec, __pyx_n_s_null); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 905, __pyx_L1_error)
16783   __Pyx_GOTREF(__pyx_tuple__7);
16784   __Pyx_GIVEREF(__pyx_tuple__7);
16785 
16786   /* "fastavro/_read.pyx":929
16787  *     def schema(self):
16788  *         import warnings
16789  *         warnings.warn(             # <<<<<<<<<<<<<<
16790  *             "The 'schema' attribute is deprecated. Please use 'writer_schema'",
16791  *             DeprecationWarning,
16792  */
16793   __pyx_tuple__8 = PyTuple_Pack(2, __pyx_kp_s_The_schema_attribute_is_deprecat, __pyx_builtin_DeprecationWarning); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 929, __pyx_L1_error)
16794   __Pyx_GOTREF(__pyx_tuple__8);
16795   __Pyx_GIVEREF(__pyx_tuple__8);
16796 
16797   /* "fastavro/_read.pyx":731
16798  *     import snappy
16799  * except ImportError:
16800  *     BLOCK_READERS['snappy'] = missing_codec_lib("snappy", "python-snappy")             # <<<<<<<<<<<<<<
16801  * else:
16802  *     BLOCK_READERS['snappy'] = snappy_read_block
16803  */
16804   __pyx_tuple__9 = PyTuple_Pack(2, __pyx_n_s_snappy, __pyx_kp_s_python_snappy); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 731, __pyx_L1_error)
16805   __Pyx_GOTREF(__pyx_tuple__9);
16806   __Pyx_GIVEREF(__pyx_tuple__9);
16807 
16808   /* "fastavro/_read.pyx":745
16809  *     import zstandard as zstd
16810  * except ImportError:
16811  *     BLOCK_READERS["zstandard"] = missing_codec_lib("zstandard", "zstandard")             # <<<<<<<<<<<<<<
16812  * else:
16813  *     BLOCK_READERS["zstandard"] = zstandard_read_block
16814  */
16815   __pyx_tuple__10 = PyTuple_Pack(2, __pyx_n_s_zstandard, __pyx_n_s_zstandard); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 745, __pyx_L1_error)
16816   __Pyx_GOTREF(__pyx_tuple__10);
16817   __Pyx_GIVEREF(__pyx_tuple__10);
16818 
16819   /* "fastavro/_read.pyx":759
16820  *     import lz4.block
16821  * except ImportError:
16822  *     BLOCK_READERS["lz4"] = missing_codec_lib("lz4", "lz4")             # <<<<<<<<<<<<<<
16823  * else:
16824  *     BLOCK_READERS["lz4"] = lz4_read_block
16825  */
16826   __pyx_tuple__11 = PyTuple_Pack(2, __pyx_n_s_lz4, __pyx_n_s_lz4); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 759, __pyx_L1_error)
16827   __Pyx_GOTREF(__pyx_tuple__11);
16828   __Pyx_GIVEREF(__pyx_tuple__11);
16829 
16830   /* "fastavro/_read.pyx":776
16831  *         from backports import lzma
16832  *     except ImportError:
16833  *         BLOCK_READERS["xz"] = missing_codec_lib("xz", "backports.lzma")             # <<<<<<<<<<<<<<
16834  *     else:
16835  *         BLOCK_READERS["xz"] = xz_read_block
16836  */
16837   __pyx_tuple__12 = PyTuple_Pack(2, __pyx_n_s_xz, __pyx_kp_s_backports_lzma); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 776, __pyx_L1_error)
16838   __Pyx_GOTREF(__pyx_tuple__12);
16839   __Pyx_GIVEREF(__pyx_tuple__12);
16840 
16841   /* "fastavro/_read.pyx":783
16842  *
16843  *
16844  * def _iter_avro_records(             # <<<<<<<<<<<<<<
16845  *     fo,
16846  *     header,
16847  */
16848   __pyx_tuple__13 = PyTuple_Pack(12, __pyx_n_s_fo, __pyx_n_s_header, __pyx_n_s_codec, __pyx_n_s_writer_schema, __pyx_n_s_named_schemas, __pyx_n_s_reader_schema, __pyx_n_s_return_record_name, __pyx_n_s_i, __pyx_n_s_sync_marker, __pyx_n_s_read_block, __pyx_n_s_block_count, __pyx_n_s_block_fo); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 783, __pyx_L1_error)
16849   __Pyx_GOTREF(__pyx_tuple__13);
16850   __Pyx_GIVEREF(__pyx_tuple__13);
16851   __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(7, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastavro__read_pyx, __pyx_n_s_iter_avro_records, 783, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 783, __pyx_L1_error)
16852 
16853   /* "fastavro/_read.pyx":817
16854  *
16855  *
16856  * def _iter_avro_blocks(             # <<<<<<<<<<<<<<
16857  *     fo,
16858  *     header,
16859  */
16860   __pyx_tuple__14 = PyTuple_Pack(13, __pyx_n_s_fo, __pyx_n_s_header, __pyx_n_s_codec, __pyx_n_s_writer_schema, __pyx_n_s_named_schemas, __pyx_n_s_reader_schema, __pyx_n_s_return_record_name, __pyx_n_s_sync_marker, __pyx_n_s_read_block, __pyx_n_s_offset, __pyx_n_s_num_block_records, __pyx_n_s_block_bytes, __pyx_n_s_size); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 817, __pyx_L1_error)
16861   __Pyx_GOTREF(__pyx_tuple__14);
16862   __Pyx_GIVEREF(__pyx_tuple__14);
16863   __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(7, 0, 13, 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__read_pyx, __pyx_n_s_iter_avro_blocks, 817, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 817, __pyx_L1_error)
16864 
16865   /* "fastavro/_read.pyx":852
16866  *
16867  * class Block:
16868  *     def __init__(             # <<<<<<<<<<<<<<
16869  *             self,
16870  *             bytes_,
16871  */
16872   __pyx_tuple__15 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_bytes_2, __pyx_n_s_num_records, __pyx_n_s_codec, __pyx_n_s_reader_schema, __pyx_n_s_writer_schema, __pyx_n_s_named_schemas, __pyx_n_s_offset, __pyx_n_s_size, __pyx_n_s_return_record_name); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 852, __pyx_L1_error)
16873   __Pyx_GOTREF(__pyx_tuple__15);
16874   __Pyx_GIVEREF(__pyx_tuple__15);
16875   __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(10, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastavro__read_pyx, __pyx_n_s_init, 852, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 852, __pyx_L1_error)
16876   __pyx_tuple__17 = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 852, __pyx_L1_error)
16877   __Pyx_GOTREF(__pyx_tuple__17);
16878   __Pyx_GIVEREF(__pyx_tuple__17);
16879 
16880   /* "fastavro/_read.pyx":873
16881  *         self.return_record_name = return_record_name
16882  *
16883  *     def __iter__(self):             # <<<<<<<<<<<<<<
16884  *         for i in range(self.num_records):
16885  *             yield _read_data(
16886  */
16887   __pyx_tuple__18 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_i); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 873, __pyx_L1_error)
16888   __Pyx_GOTREF(__pyx_tuple__18);
16889   __Pyx_GIVEREF(__pyx_tuple__18);
16890   __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 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__read_pyx, __pyx_n_s_iter, 873, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 873, __pyx_L1_error)
16891 
16892   /* "fastavro/_read.pyx":883
16893  *             )
16894  *
16895  *     def __str__(self):             # <<<<<<<<<<<<<<
16896  *         return ("Avro block: %d bytes, %d records, codec: %s, position %d+%d"
16897  *                 % (len(self.bytes_), self.num_records, self.codec, self.offset,
16898  */
16899   __pyx_tuple__19 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 883, __pyx_L1_error)
16900   __Pyx_GOTREF(__pyx_tuple__19);
16901   __Pyx_GIVEREF(__pyx_tuple__19);
16902   __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastavro__read_pyx, __pyx_n_s_str, 883, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 883, __pyx_L1_error)
16903 
16904   /* "fastavro/_read.pyx":890
16905  *
16906  * class file_reader:
16907  *     def __init__(self, fo, reader_schema=None, return_record_name=False):             # <<<<<<<<<<<<<<
16908  *         self.fo = fo
16909  *         self.return_record_name = return_record_name
16910  */
16911   __pyx_tuple__21 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_fo, __pyx_n_s_reader_schema, __pyx_n_s_return_record_name, __pyx_n_s_k, __pyx_n_s_v); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 890, __pyx_L1_error)
16912   __Pyx_GOTREF(__pyx_tuple__21);
16913   __Pyx_GIVEREF(__pyx_tuple__21);
16914   __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastavro__read_pyx, __pyx_n_s_init, 890, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 890, __pyx_L1_error)
16915   __pyx_tuple__23 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 890, __pyx_L1_error)
16916   __Pyx_GOTREF(__pyx_tuple__23);
16917   __Pyx_GIVEREF(__pyx_tuple__23);
16918 
16919   /* "fastavro/_read.pyx":927
16920  *
16921  *     @property
16922  *     def schema(self):             # <<<<<<<<<<<<<<
16923  *         import warnings
16924  *         warnings.warn(
16925  */
16926   __pyx_tuple__24 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_warnings); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 927, __pyx_L1_error)
16927   __Pyx_GOTREF(__pyx_tuple__24);
16928   __Pyx_GIVEREF(__pyx_tuple__24);
16929   __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 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__read_pyx, __pyx_n_s_schema_2, 927, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 927, __pyx_L1_error)
16930 
16931   /* "fastavro/_read.pyx":935
16932  *         return self._schema
16933  *
16934  *     def __iter__(self):             # <<<<<<<<<<<<<<
16935  *         if not self._elems:
16936  *             raise NotImplementedError
16937  */
16938   __pyx_tuple__26 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 935, __pyx_L1_error)
16939   __Pyx_GOTREF(__pyx_tuple__26);
16940   __Pyx_GIVEREF(__pyx_tuple__26);
16941   __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__read_pyx, __pyx_n_s_iter, 935, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 935, __pyx_L1_error)
16942 
16943   /* "fastavro/_read.pyx":940
16944  *         return self._elems
16945  *
16946  *     def next(self):             # <<<<<<<<<<<<<<
16947  *         return next(self._elems)
16948  *
16949  */
16950   __pyx_tuple__28 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 940, __pyx_L1_error)
16951   __Pyx_GOTREF(__pyx_tuple__28);
16952   __Pyx_GIVEREF(__pyx_tuple__28);
16953   __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__read_pyx, __pyx_n_s_next, 940, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 940, __pyx_L1_error)
16954 
16955   /* "fastavro/_read.pyx":947
16956  *
16957  * class reader(file_reader):
16958  *     def __init__(self, fo, reader_schema=None, return_record_name=False):             # <<<<<<<<<<<<<<
16959  *         file_reader.__init__(self, fo, reader_schema, return_record_name)
16960  *
16961  */
16962   __pyx_tuple__30 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_fo, __pyx_n_s_reader_schema, __pyx_n_s_return_record_name); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 947, __pyx_L1_error)
16963   __Pyx_GOTREF(__pyx_tuple__30);
16964   __Pyx_GIVEREF(__pyx_tuple__30);
16965   __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 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__read_pyx, __pyx_n_s_init, 947, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 947, __pyx_L1_error)
16966   __pyx_tuple__32 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 947, __pyx_L1_error)
16967   __Pyx_GOTREF(__pyx_tuple__32);
16968   __Pyx_GIVEREF(__pyx_tuple__32);
16969 
16970   /* "fastavro/_read.pyx":960
16971  *
16972  * class block_reader(file_reader):
16973  *     def __init__(self, fo, reader_schema=None, return_record_name=False):             # <<<<<<<<<<<<<<
16974  *         file_reader.__init__(self, fo, reader_schema, return_record_name)
16975  *
16976  */
16977   __pyx_tuple__33 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_fo, __pyx_n_s_reader_schema, __pyx_n_s_return_record_name); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 960, __pyx_L1_error)
16978   __Pyx_GOTREF(__pyx_tuple__33);
16979   __Pyx_GIVEREF(__pyx_tuple__33);
16980   __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_fastavro__read_pyx, __pyx_n_s_init, 960, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 960, __pyx_L1_error)
16981   __pyx_tuple__35 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 960, __pyx_L1_error)
16982   __Pyx_GOTREF(__pyx_tuple__35);
16983   __Pyx_GIVEREF(__pyx_tuple__35);
16984   __Pyx_RefNannyFinishContext();
16985   return 0;
16986   __pyx_L1_error:;
16987   __Pyx_RefNannyFinishContext();
16988   return -1;
16989 }
16990 
__Pyx_InitGlobals(void)16991 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
16992   __pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type;
16993   if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
16994   __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
16995   __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
16996   __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error)
16997   __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) __PYX_ERR(0, 1, __pyx_L1_error)
16998   __pyx_int_60 = PyInt_FromLong(60); if (unlikely(!__pyx_int_60)) __PYX_ERR(0, 1, __pyx_L1_error)
16999   __pyx_int_255 = PyInt_FromLong(255); if (unlikely(!__pyx_int_255)) __PYX_ERR(0, 1, __pyx_L1_error)
17000   __pyx_int_1000 = PyInt_FromLong(1000); if (unlikely(!__pyx_int_1000)) __PYX_ERR(0, 1, __pyx_L1_error)
17001   __pyx_int_neg_15 = PyInt_FromLong(-15); if (unlikely(!__pyx_int_neg_15)) __PYX_ERR(0, 1, __pyx_L1_error)
17002   return 0;
17003   __pyx_L1_error:;
17004   return -1;
17005 }
17006 
17007 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
17008 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
17009 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
17010 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
17011 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
17012 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
17013 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
17014 
__Pyx_modinit_global_init_code(void)17015 static int __Pyx_modinit_global_init_code(void) {
17016   __Pyx_RefNannyDeclarations
17017   __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
17018   /*--- Global init code ---*/
17019   __Pyx_RefNannyFinishContext();
17020   return 0;
17021 }
17022 
__Pyx_modinit_variable_export_code(void)17023 static int __Pyx_modinit_variable_export_code(void) {
17024   __Pyx_RefNannyDeclarations
17025   __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
17026   /*--- Variable export code ---*/
17027   __Pyx_RefNannyFinishContext();
17028   return 0;
17029 }
17030 
__Pyx_modinit_function_export_code(void)17031 static int __Pyx_modinit_function_export_code(void) {
17032   __Pyx_RefNannyDeclarations
17033   __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
17034   /*--- Function export code ---*/
17035   __Pyx_RefNannyFinishContext();
17036   return 0;
17037 }
17038 
__Pyx_modinit_type_init_code(void)17039 static int __Pyx_modinit_type_init_code(void) {
17040   __Pyx_RefNannyDeclarations
17041   int __pyx_lineno = 0;
17042   const char *__pyx_filename = NULL;
17043   int __pyx_clineno = 0;
17044   __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
17045   /*--- Type init code ---*/
17046   if (PyType_Ready(&__pyx_type_8fastavro_5_read___pyx_scope_struct___iter_avro_records) < 0) __PYX_ERR(0, 783, __pyx_L1_error)
17047   #if PY_VERSION_HEX < 0x030800B1
17048   __pyx_type_8fastavro_5_read___pyx_scope_struct___iter_avro_records.tp_print = 0;
17049   #endif
17050   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8fastavro_5_read___pyx_scope_struct___iter_avro_records.tp_dictoffset && __pyx_type_8fastavro_5_read___pyx_scope_struct___iter_avro_records.tp_getattro == PyObject_GenericGetAttr)) {
17051     __pyx_type_8fastavro_5_read___pyx_scope_struct___iter_avro_records.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
17052   }
17053   __pyx_ptype_8fastavro_5_read___pyx_scope_struct___iter_avro_records = &__pyx_type_8fastavro_5_read___pyx_scope_struct___iter_avro_records;
17054   if (PyType_Ready(&__pyx_type_8fastavro_5_read___pyx_scope_struct_1__iter_avro_blocks) < 0) __PYX_ERR(0, 817, __pyx_L1_error)
17055   #if PY_VERSION_HEX < 0x030800B1
17056   __pyx_type_8fastavro_5_read___pyx_scope_struct_1__iter_avro_blocks.tp_print = 0;
17057   #endif
17058   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8fastavro_5_read___pyx_scope_struct_1__iter_avro_blocks.tp_dictoffset && __pyx_type_8fastavro_5_read___pyx_scope_struct_1__iter_avro_blocks.tp_getattro == PyObject_GenericGetAttr)) {
17059     __pyx_type_8fastavro_5_read___pyx_scope_struct_1__iter_avro_blocks.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
17060   }
17061   __pyx_ptype_8fastavro_5_read___pyx_scope_struct_1__iter_avro_blocks = &__pyx_type_8fastavro_5_read___pyx_scope_struct_1__iter_avro_blocks;
17062   if (PyType_Ready(&__pyx_type_8fastavro_5_read___pyx_scope_struct_2___iter__) < 0) __PYX_ERR(0, 873, __pyx_L1_error)
17063   #if PY_VERSION_HEX < 0x030800B1
17064   __pyx_type_8fastavro_5_read___pyx_scope_struct_2___iter__.tp_print = 0;
17065   #endif
17066   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8fastavro_5_read___pyx_scope_struct_2___iter__.tp_dictoffset && __pyx_type_8fastavro_5_read___pyx_scope_struct_2___iter__.tp_getattro == PyObject_GenericGetAttr)) {
17067     __pyx_type_8fastavro_5_read___pyx_scope_struct_2___iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
17068   }
17069   __pyx_ptype_8fastavro_5_read___pyx_scope_struct_2___iter__ = &__pyx_type_8fastavro_5_read___pyx_scope_struct_2___iter__;
17070   __Pyx_RefNannyFinishContext();
17071   return 0;
17072   __pyx_L1_error:;
17073   __Pyx_RefNannyFinishContext();
17074   return -1;
17075 }
17076 
__Pyx_modinit_type_import_code(void)17077 static int __Pyx_modinit_type_import_code(void) {
17078   __Pyx_RefNannyDeclarations
17079   __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
17080   /*--- Type import code ---*/
17081   __Pyx_RefNannyFinishContext();
17082   return 0;
17083 }
17084 
__Pyx_modinit_variable_import_code(void)17085 static int __Pyx_modinit_variable_import_code(void) {
17086   __Pyx_RefNannyDeclarations
17087   __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
17088   /*--- Variable import code ---*/
17089   __Pyx_RefNannyFinishContext();
17090   return 0;
17091 }
17092 
__Pyx_modinit_function_import_code(void)17093 static int __Pyx_modinit_function_import_code(void) {
17094   __Pyx_RefNannyDeclarations
17095   __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
17096   /*--- Function import code ---*/
17097   __Pyx_RefNannyFinishContext();
17098   return 0;
17099 }
17100 
17101 
17102 #ifndef CYTHON_NO_PYINIT_EXPORT
17103 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
17104 #elif PY_MAJOR_VERSION < 3
17105 #ifdef __cplusplus
17106 #define __Pyx_PyMODINIT_FUNC extern "C" void
17107 #else
17108 #define __Pyx_PyMODINIT_FUNC void
17109 #endif
17110 #else
17111 #ifdef __cplusplus
17112 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
17113 #else
17114 #define __Pyx_PyMODINIT_FUNC PyObject *
17115 #endif
17116 #endif
17117 
17118 
17119 #if PY_MAJOR_VERSION < 3
17120 __Pyx_PyMODINIT_FUNC init_read(void) CYTHON_SMALL_CODE; /*proto*/
init_read(void)17121 __Pyx_PyMODINIT_FUNC init_read(void)
17122 #else
17123 __Pyx_PyMODINIT_FUNC PyInit__read(void) CYTHON_SMALL_CODE; /*proto*/
17124 __Pyx_PyMODINIT_FUNC PyInit__read(void)
17125 #if CYTHON_PEP489_MULTI_PHASE_INIT
17126 {
17127   return PyModuleDef_Init(&__pyx_moduledef);
17128 }
17129 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
17130     #if PY_VERSION_HEX >= 0x030700A1
17131     static PY_INT64_T main_interpreter_id = -1;
17132     PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
17133     if (main_interpreter_id == -1) {
17134         main_interpreter_id = current_id;
17135         return (unlikely(current_id == -1)) ? -1 : 0;
17136     } else if (unlikely(main_interpreter_id != current_id))
17137     #else
17138     static PyInterpreterState *main_interpreter = NULL;
17139     PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
17140     if (!main_interpreter) {
17141         main_interpreter = current_interpreter;
17142     } else if (unlikely(main_interpreter != current_interpreter))
17143     #endif
17144     {
17145         PyErr_SetString(
17146             PyExc_ImportError,
17147             "Interpreter change detected - this module can only be loaded into one interpreter per process.");
17148         return -1;
17149     }
17150     return 0;
17151 }
17152 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) {
17153     PyObject *value = PyObject_GetAttrString(spec, from_name);
17154     int result = 0;
17155     if (likely(value)) {
17156         if (allow_none || value != Py_None) {
17157             result = PyDict_SetItemString(moddict, to_name, value);
17158         }
17159         Py_DECREF(value);
17160     } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
17161         PyErr_Clear();
17162     } else {
17163         result = -1;
17164     }
17165     return result;
17166 }
17167 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
17168     PyObject *module = NULL, *moddict, *modname;
17169     if (__Pyx_check_single_interpreter())
17170         return NULL;
17171     if (__pyx_m)
17172         return __Pyx_NewRef(__pyx_m);
17173     modname = PyObject_GetAttrString(spec, "name");
17174     if (unlikely(!modname)) goto bad;
17175     module = PyModule_NewObject(modname);
17176     Py_DECREF(modname);
17177     if (unlikely(!module)) goto bad;
17178     moddict = PyModule_GetDict(module);
17179     if (unlikely(!moddict)) goto bad;
17180     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
17181     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
17182     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
17183     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
17184     return module;
17185 bad:
17186     Py_XDECREF(module);
17187     return NULL;
17188 }
17189 
17190 
17191 static CYTHON_SMALL_CODE int __pyx_pymod_exec__read(PyObject *__pyx_pyinit_module)
17192 #endif
17193 #endif
17194 {
17195   PyObject *__pyx_t_1 = NULL;
17196   PyObject *__pyx_t_2 = NULL;
17197   PyObject *__pyx_t_3 = NULL;
17198   PyObject *__pyx_t_4 = NULL;
17199   PyObject *__pyx_t_5 = NULL;
17200   PyObject *__pyx_t_6 = NULL;
17201   PyObject *__pyx_t_7 = NULL;
17202   int __pyx_t_8;
17203   PyObject *__pyx_t_9 = NULL;
17204   PyObject *__pyx_t_10 = NULL;
17205   PyObject *__pyx_t_11 = NULL;
17206   PyObject *__pyx_t_12 = NULL;
17207   PyObject *__pyx_t_13 = NULL;
17208   PyObject *__pyx_t_14 = NULL;
17209   PyObject *__pyx_t_15 = NULL;
17210   int __pyx_lineno = 0;
17211   const char *__pyx_filename = NULL;
17212   int __pyx_clineno = 0;
17213   __Pyx_RefNannyDeclarations
17214   #if CYTHON_PEP489_MULTI_PHASE_INIT
17215   if (__pyx_m) {
17216     if (__pyx_m == __pyx_pyinit_module) return 0;
17217     PyErr_SetString(PyExc_RuntimeError, "Module '_read' has already been imported. Re-initialisation is not supported.");
17218     return -1;
17219   }
17220   #elif PY_MAJOR_VERSION >= 3
17221   if (__pyx_m) return __Pyx_NewRef(__pyx_m);
17222   #endif
17223   #if CYTHON_REFNANNY
17224 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
17225 if (!__Pyx_RefNanny) {
17226   PyErr_Clear();
17227   __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
17228   if (!__Pyx_RefNanny)
17229       Py_FatalError("failed to import 'refnanny' module");
17230 }
17231 #endif
17232   __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__read(void)", 0);
17233   if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
17234   #ifdef __Pxy_PyFrame_Initialize_Offsets
17235   __Pxy_PyFrame_Initialize_Offsets();
17236   #endif
17237   __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
17238   __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
17239   __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
17240   #ifdef __Pyx_CyFunction_USED
17241   if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
17242   #endif
17243   #ifdef __Pyx_FusedFunction_USED
17244   if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
17245   #endif
17246   #ifdef __Pyx_Coroutine_USED
17247   if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
17248   #endif
17249   #ifdef __Pyx_Generator_USED
17250   if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
17251   #endif
17252   #ifdef __Pyx_AsyncGen_USED
17253   if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
17254   #endif
17255   #ifdef __Pyx_StopAsyncIteration_USED
17256   if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
17257   #endif
17258   /*--- Library function declarations ---*/
17259   /*--- Threads initialization code ---*/
17260   #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
17261   #ifdef WITH_THREAD /* Python build with threading support? */
17262   PyEval_InitThreads();
17263   #endif
17264   #endif
17265   /*--- Module creation code ---*/
17266   #if CYTHON_PEP489_MULTI_PHASE_INIT
17267   __pyx_m = __pyx_pyinit_module;
17268   Py_INCREF(__pyx_m);
17269   #else
17270   #if PY_MAJOR_VERSION < 3
17271   __pyx_m = Py_InitModule4("_read", __pyx_methods, __pyx_k_Python_code_for_reading_AVRO_fil, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
17272   #else
17273   __pyx_m = PyModule_Create(&__pyx_moduledef);
17274   #endif
17275   if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
17276   #endif
17277   __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
17278   Py_INCREF(__pyx_d);
17279   __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
17280   Py_INCREF(__pyx_b);
17281   __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
17282   Py_INCREF(__pyx_cython_runtime);
17283   if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
17284   /*--- Initialize various global constants etc. ---*/
17285   if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
17286   #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
17287   if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
17288   #endif
17289   if (__pyx_module_is_main_fastavro___read) {
17290     if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
17291   }
17292   #if PY_MAJOR_VERSION >= 3
17293   {
17294     PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
17295     if (!PyDict_GetItemString(modules, "fastavro._read")) {
17296       if (unlikely(PyDict_SetItemString(modules, "fastavro._read", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
17297     }
17298   }
17299   #endif
17300   /*--- Builtin init code ---*/
17301   if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
17302   /*--- Constants init code ---*/
17303   if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
17304   /*--- Global type/function init code ---*/
17305   (void)__Pyx_modinit_global_init_code();
17306   (void)__Pyx_modinit_variable_export_code();
17307   (void)__Pyx_modinit_function_export_code();
17308   if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
17309   (void)__Pyx_modinit_type_import_code();
17310   (void)__Pyx_modinit_variable_import_code();
17311   (void)__Pyx_modinit_function_import_code();
17312   /*--- Execution code ---*/
17313   #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
17314   if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
17315   #endif
17316 
17317   /* "fastavro/_read.pyx":10
17318  * # Apache 2.0 license (http://www.apache.org/licenses/LICENSE-2.0)
17319  *
17320  * import bz2             # <<<<<<<<<<<<<<
17321  * import zlib
17322  * import datetime
17323  */
17324   __pyx_t_1 = __Pyx_Import(__pyx_n_s_bz2, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
17325   __Pyx_GOTREF(__pyx_t_1);
17326   if (PyDict_SetItem(__pyx_d, __pyx_n_s_bz2, __pyx_t_1) < 0) __PYX_ERR(0, 10, __pyx_L1_error)
17327   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17328 
17329   /* "fastavro/_read.pyx":11
17330  *
17331  * import bz2
17332  * import zlib             # <<<<<<<<<<<<<<
17333  * import datetime
17334  * from decimal import Context
17335  */
17336   __pyx_t_1 = __Pyx_Import(__pyx_n_s_zlib, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
17337   __Pyx_GOTREF(__pyx_t_1);
17338   if (PyDict_SetItem(__pyx_d, __pyx_n_s_zlib, __pyx_t_1) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
17339   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17340 
17341   /* "fastavro/_read.pyx":12
17342  * import bz2
17343  * import zlib
17344  * import datetime             # <<<<<<<<<<<<<<
17345  * from decimal import Context
17346  * from fastavro.six import MemoryIO
17347  */
17348   __pyx_t_1 = __Pyx_Import(__pyx_n_s_datetime, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
17349   __Pyx_GOTREF(__pyx_t_1);
17350   if (PyDict_SetItem(__pyx_d, __pyx_n_s_datetime, __pyx_t_1) < 0) __PYX_ERR(0, 12, __pyx_L1_error)
17351   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17352 
17353   /* "fastavro/_read.pyx":13
17354  * import zlib
17355  * import datetime
17356  * from decimal import Context             # <<<<<<<<<<<<<<
17357  * from fastavro.six import MemoryIO
17358  * from uuid import UUID
17359  */
17360   __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
17361   __Pyx_GOTREF(__pyx_t_1);
17362   __Pyx_INCREF(__pyx_n_s_Context);
17363   __Pyx_GIVEREF(__pyx_n_s_Context);
17364   PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Context);
17365   __pyx_t_2 = __Pyx_Import(__pyx_n_s_decimal, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error)
17366   __Pyx_GOTREF(__pyx_t_2);
17367   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17368   __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Context); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
17369   __Pyx_GOTREF(__pyx_t_1);
17370   if (PyDict_SetItem(__pyx_d, __pyx_n_s_Context, __pyx_t_1) < 0) __PYX_ERR(0, 13, __pyx_L1_error)
17371   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17372   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17373 
17374   /* "fastavro/_read.pyx":14
17375  * import datetime
17376  * from decimal import Context
17377  * from fastavro.six import MemoryIO             # <<<<<<<<<<<<<<
17378  * from uuid import UUID
17379  *
17380  */
17381   __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error)
17382   __Pyx_GOTREF(__pyx_t_2);
17383   __Pyx_INCREF(__pyx_n_s_MemoryIO);
17384   __Pyx_GIVEREF(__pyx_n_s_MemoryIO);
17385   PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_MemoryIO);
17386   __pyx_t_1 = __Pyx_Import(__pyx_n_s_fastavro_six, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error)
17387   __Pyx_GOTREF(__pyx_t_1);
17388   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17389   __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_MemoryIO); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error)
17390   __Pyx_GOTREF(__pyx_t_2);
17391   if (PyDict_SetItem(__pyx_d, __pyx_n_s_MemoryIO, __pyx_t_2) < 0) __PYX_ERR(0, 14, __pyx_L1_error)
17392   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17393   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17394 
17395   /* "fastavro/_read.pyx":15
17396  * from decimal import Context
17397  * from fastavro.six import MemoryIO
17398  * from uuid import UUID             # <<<<<<<<<<<<<<
17399  *
17400  * import json
17401  */
17402   __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
17403   __Pyx_GOTREF(__pyx_t_1);
17404   __Pyx_INCREF(__pyx_n_s_UUID);
17405   __Pyx_GIVEREF(__pyx_n_s_UUID);
17406   PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_UUID);
17407   __pyx_t_2 = __Pyx_Import(__pyx_n_s_uuid, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error)
17408   __Pyx_GOTREF(__pyx_t_2);
17409   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17410   __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_UUID); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
17411   __Pyx_GOTREF(__pyx_t_1);
17412   if (PyDict_SetItem(__pyx_d, __pyx_n_s_UUID, __pyx_t_1) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
17413   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17414   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17415 
17416   /* "fastavro/_read.pyx":17
17417  * from uuid import UUID
17418  *
17419  * import json             # <<<<<<<<<<<<<<
17420  *
17421  * from ._six import (
17422  */
17423   __pyx_t_2 = __Pyx_Import(__pyx_n_s_json, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error)
17424   __Pyx_GOTREF(__pyx_t_2);
17425   if (PyDict_SetItem(__pyx_d, __pyx_n_s_json, __pyx_t_2) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
17426   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17427 
17428   /* "fastavro/_read.pyx":20
17429  *
17430  * from ._six import (
17431  *     btou, utob, iteritems, is_str, long, be_signed_bytes_to_int             # <<<<<<<<<<<<<<
17432  * )
17433  * from ._schema import extract_record_type, extract_logical_type, parse_schema
17434  */
17435   __pyx_t_2 = PyList_New(6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error)
17436   __Pyx_GOTREF(__pyx_t_2);
17437   __Pyx_INCREF(__pyx_n_s_btou);
17438   __Pyx_GIVEREF(__pyx_n_s_btou);
17439   PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_btou);
17440   __Pyx_INCREF(__pyx_n_s_utob);
17441   __Pyx_GIVEREF(__pyx_n_s_utob);
17442   PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_utob);
17443   __Pyx_INCREF(__pyx_n_s_iteritems);
17444   __Pyx_GIVEREF(__pyx_n_s_iteritems);
17445   PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_iteritems);
17446   __Pyx_INCREF(__pyx_n_s_is_str);
17447   __Pyx_GIVEREF(__pyx_n_s_is_str);
17448   PyList_SET_ITEM(__pyx_t_2, 3, __pyx_n_s_is_str);
17449   __Pyx_INCREF(__pyx_n_s_long);
17450   __Pyx_GIVEREF(__pyx_n_s_long);
17451   PyList_SET_ITEM(__pyx_t_2, 4, __pyx_n_s_long);
17452   __Pyx_INCREF(__pyx_n_s_be_signed_bytes_to_int);
17453   __Pyx_GIVEREF(__pyx_n_s_be_signed_bytes_to_int);
17454   PyList_SET_ITEM(__pyx_t_2, 5, __pyx_n_s_be_signed_bytes_to_int);
17455 
17456   /* "fastavro/_read.pyx":19
17457  * import json
17458  *
17459  * from ._six import (             # <<<<<<<<<<<<<<
17460  *     btou, utob, iteritems, is_str, long, be_signed_bytes_to_int
17461  * )
17462  */
17463   __pyx_t_1 = __Pyx_Import(__pyx_n_s_six, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
17464   __Pyx_GOTREF(__pyx_t_1);
17465   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17466   __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_btou); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error)
17467   __Pyx_GOTREF(__pyx_t_2);
17468   if (PyDict_SetItem(__pyx_d, __pyx_n_s_btou, __pyx_t_2) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
17469   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17470   __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_utob); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error)
17471   __Pyx_GOTREF(__pyx_t_2);
17472   if (PyDict_SetItem(__pyx_d, __pyx_n_s_utob, __pyx_t_2) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
17473   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17474   __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_iteritems); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error)
17475   __Pyx_GOTREF(__pyx_t_2);
17476   if (PyDict_SetItem(__pyx_d, __pyx_n_s_iteritems, __pyx_t_2) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
17477   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17478   __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_is_str); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error)
17479   __Pyx_GOTREF(__pyx_t_2);
17480   if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_str, __pyx_t_2) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
17481   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17482   __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_long); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error)
17483   __Pyx_GOTREF(__pyx_t_2);
17484   if (PyDict_SetItem(__pyx_d, __pyx_n_s_long, __pyx_t_2) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
17485   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17486   __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_be_signed_bytes_to_int); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error)
17487   __Pyx_GOTREF(__pyx_t_2);
17488   if (PyDict_SetItem(__pyx_d, __pyx_n_s_be_signed_bytes_to_int, __pyx_t_2) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
17489   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17490   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17491 
17492   /* "fastavro/_read.pyx":22
17493  *     btou, utob, iteritems, is_str, long, be_signed_bytes_to_int
17494  * )
17495  * from ._schema import extract_record_type, extract_logical_type, parse_schema             # <<<<<<<<<<<<<<
17496  * from ._read_common import (
17497  *     SchemaResolutionError, MAGIC, SYNC_SIZE, HEADER_SCHEMA, missing_codec_lib
17498  */
17499   __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error)
17500   __Pyx_GOTREF(__pyx_t_1);
17501   __Pyx_INCREF(__pyx_n_s_extract_record_type);
17502   __Pyx_GIVEREF(__pyx_n_s_extract_record_type);
17503   PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_extract_record_type);
17504   __Pyx_INCREF(__pyx_n_s_extract_logical_type);
17505   __Pyx_GIVEREF(__pyx_n_s_extract_logical_type);
17506   PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_extract_logical_type);
17507   __Pyx_INCREF(__pyx_n_s_parse_schema);
17508   __Pyx_GIVEREF(__pyx_n_s_parse_schema);
17509   PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_parse_schema);
17510   __pyx_t_2 = __Pyx_Import(__pyx_n_s_schema, __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error)
17511   __Pyx_GOTREF(__pyx_t_2);
17512   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17513   __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_extract_record_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error)
17514   __Pyx_GOTREF(__pyx_t_1);
17515   if (PyDict_SetItem(__pyx_d, __pyx_n_s_extract_record_type, __pyx_t_1) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
17516   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17517   __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_extract_logical_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error)
17518   __Pyx_GOTREF(__pyx_t_1);
17519   if (PyDict_SetItem(__pyx_d, __pyx_n_s_extract_logical_type, __pyx_t_1) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
17520   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17521   __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_parse_schema); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error)
17522   __Pyx_GOTREF(__pyx_t_1);
17523   if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_schema, __pyx_t_1) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
17524   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17525   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17526 
17527   /* "fastavro/_read.pyx":24
17528  * from ._schema import extract_record_type, extract_logical_type, parse_schema
17529  * from ._read_common import (
17530  *     SchemaResolutionError, MAGIC, SYNC_SIZE, HEADER_SCHEMA, missing_codec_lib             # <<<<<<<<<<<<<<
17531  * )
17532  * from ._timezone import epoch
17533  */
17534   __pyx_t_2 = PyList_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
17535   __Pyx_GOTREF(__pyx_t_2);
17536   __Pyx_INCREF(__pyx_n_s_SchemaResolutionError);
17537   __Pyx_GIVEREF(__pyx_n_s_SchemaResolutionError);
17538   PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_SchemaResolutionError);
17539   __Pyx_INCREF(__pyx_n_s_MAGIC);
17540   __Pyx_GIVEREF(__pyx_n_s_MAGIC);
17541   PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_MAGIC);
17542   __Pyx_INCREF(__pyx_n_s_SYNC_SIZE);
17543   __Pyx_GIVEREF(__pyx_n_s_SYNC_SIZE);
17544   PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_SYNC_SIZE);
17545   __Pyx_INCREF(__pyx_n_s_HEADER_SCHEMA);
17546   __Pyx_GIVEREF(__pyx_n_s_HEADER_SCHEMA);
17547   PyList_SET_ITEM(__pyx_t_2, 3, __pyx_n_s_HEADER_SCHEMA);
17548   __Pyx_INCREF(__pyx_n_s_missing_codec_lib);
17549   __Pyx_GIVEREF(__pyx_n_s_missing_codec_lib);
17550   PyList_SET_ITEM(__pyx_t_2, 4, __pyx_n_s_missing_codec_lib);
17551 
17552   /* "fastavro/_read.pyx":23
17553  * )
17554  * from ._schema import extract_record_type, extract_logical_type, parse_schema
17555  * from ._read_common import (             # <<<<<<<<<<<<<<
17556  *     SchemaResolutionError, MAGIC, SYNC_SIZE, HEADER_SCHEMA, missing_codec_lib
17557  * )
17558  */
17559   __pyx_t_1 = __Pyx_Import(__pyx_n_s_read_common, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
17560   __Pyx_GOTREF(__pyx_t_1);
17561   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17562   __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_SchemaResolutionError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error)
17563   __Pyx_GOTREF(__pyx_t_2);
17564   if (PyDict_SetItem(__pyx_d, __pyx_n_s_SchemaResolutionError, __pyx_t_2) < 0) __PYX_ERR(0, 24, __pyx_L1_error)
17565   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17566   __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_MAGIC); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error)
17567   __Pyx_GOTREF(__pyx_t_2);
17568   if (PyDict_SetItem(__pyx_d, __pyx_n_s_MAGIC, __pyx_t_2) < 0) __PYX_ERR(0, 24, __pyx_L1_error)
17569   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17570   __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_SYNC_SIZE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error)
17571   __Pyx_GOTREF(__pyx_t_2);
17572   if (PyDict_SetItem(__pyx_d, __pyx_n_s_SYNC_SIZE, __pyx_t_2) < 0) __PYX_ERR(0, 24, __pyx_L1_error)
17573   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17574   __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_HEADER_SCHEMA); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error)
17575   __Pyx_GOTREF(__pyx_t_2);
17576   if (PyDict_SetItem(__pyx_d, __pyx_n_s_HEADER_SCHEMA, __pyx_t_2) < 0) __PYX_ERR(0, 24, __pyx_L1_error)
17577   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17578   __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_missing_codec_lib); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error)
17579   __Pyx_GOTREF(__pyx_t_2);
17580   if (PyDict_SetItem(__pyx_d, __pyx_n_s_missing_codec_lib, __pyx_t_2) < 0) __PYX_ERR(0, 24, __pyx_L1_error)
17581   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17582   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17583 
17584   /* "fastavro/_read.pyx":26
17585  *     SchemaResolutionError, MAGIC, SYNC_SIZE, HEADER_SCHEMA, missing_codec_lib
17586  * )
17587  * from ._timezone import epoch             # <<<<<<<<<<<<<<
17588  * from .const import (
17589  *     MCS_PER_HOUR, MCS_PER_MINUTE, MCS_PER_SECOND, MLS_PER_HOUR, MLS_PER_MINUTE,
17590  */
17591   __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 26, __pyx_L1_error)
17592   __Pyx_GOTREF(__pyx_t_1);
17593   __Pyx_INCREF(__pyx_n_s_epoch);
17594   __Pyx_GIVEREF(__pyx_n_s_epoch);
17595   PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_epoch);
17596   __pyx_t_2 = __Pyx_Import(__pyx_n_s_timezone, __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error)
17597   __Pyx_GOTREF(__pyx_t_2);
17598   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17599   __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_epoch); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 26, __pyx_L1_error)
17600   __Pyx_GOTREF(__pyx_t_1);
17601   if (PyDict_SetItem(__pyx_d, __pyx_n_s_epoch, __pyx_t_1) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
17602   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17603   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17604 
17605   /* "fastavro/_read.pyx":28
17606  * from ._timezone import epoch
17607  * from .const import (
17608  *     MCS_PER_HOUR, MCS_PER_MINUTE, MCS_PER_SECOND, MLS_PER_HOUR, MLS_PER_MINUTE,             # <<<<<<<<<<<<<<
17609  *     MLS_PER_SECOND, DAYS_SHIFT
17610  * )
17611  */
17612   __pyx_t_2 = PyList_New(7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
17613   __Pyx_GOTREF(__pyx_t_2);
17614   __Pyx_INCREF(__pyx_n_s_MCS_PER_HOUR);
17615   __Pyx_GIVEREF(__pyx_n_s_MCS_PER_HOUR);
17616   PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_MCS_PER_HOUR);
17617   __Pyx_INCREF(__pyx_n_s_MCS_PER_MINUTE);
17618   __Pyx_GIVEREF(__pyx_n_s_MCS_PER_MINUTE);
17619   PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_MCS_PER_MINUTE);
17620   __Pyx_INCREF(__pyx_n_s_MCS_PER_SECOND);
17621   __Pyx_GIVEREF(__pyx_n_s_MCS_PER_SECOND);
17622   PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_MCS_PER_SECOND);
17623   __Pyx_INCREF(__pyx_n_s_MLS_PER_HOUR);
17624   __Pyx_GIVEREF(__pyx_n_s_MLS_PER_HOUR);
17625   PyList_SET_ITEM(__pyx_t_2, 3, __pyx_n_s_MLS_PER_HOUR);
17626   __Pyx_INCREF(__pyx_n_s_MLS_PER_MINUTE);
17627   __Pyx_GIVEREF(__pyx_n_s_MLS_PER_MINUTE);
17628   PyList_SET_ITEM(__pyx_t_2, 4, __pyx_n_s_MLS_PER_MINUTE);
17629   __Pyx_INCREF(__pyx_n_s_MLS_PER_SECOND);
17630   __Pyx_GIVEREF(__pyx_n_s_MLS_PER_SECOND);
17631   PyList_SET_ITEM(__pyx_t_2, 5, __pyx_n_s_MLS_PER_SECOND);
17632   __Pyx_INCREF(__pyx_n_s_DAYS_SHIFT);
17633   __Pyx_GIVEREF(__pyx_n_s_DAYS_SHIFT);
17634   PyList_SET_ITEM(__pyx_t_2, 6, __pyx_n_s_DAYS_SHIFT);
17635 
17636   /* "fastavro/_read.pyx":27
17637  * )
17638  * from ._timezone import epoch
17639  * from .const import (             # <<<<<<<<<<<<<<
17640  *     MCS_PER_HOUR, MCS_PER_MINUTE, MCS_PER_SECOND, MLS_PER_HOUR, MLS_PER_MINUTE,
17641  *     MLS_PER_SECOND, DAYS_SHIFT
17642  */
17643   __pyx_t_1 = __Pyx_Import(__pyx_n_s_const, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error)
17644   __Pyx_GOTREF(__pyx_t_1);
17645   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17646   __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_MCS_PER_HOUR); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
17647   __Pyx_GOTREF(__pyx_t_2);
17648   if (PyDict_SetItem(__pyx_d, __pyx_n_s_MCS_PER_HOUR, __pyx_t_2) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
17649   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17650   __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_MCS_PER_MINUTE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
17651   __Pyx_GOTREF(__pyx_t_2);
17652   if (PyDict_SetItem(__pyx_d, __pyx_n_s_MCS_PER_MINUTE, __pyx_t_2) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
17653   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17654   __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_MCS_PER_SECOND); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
17655   __Pyx_GOTREF(__pyx_t_2);
17656   if (PyDict_SetItem(__pyx_d, __pyx_n_s_MCS_PER_SECOND, __pyx_t_2) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
17657   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17658   __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_MLS_PER_HOUR); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
17659   __Pyx_GOTREF(__pyx_t_2);
17660   if (PyDict_SetItem(__pyx_d, __pyx_n_s_MLS_PER_HOUR, __pyx_t_2) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
17661   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17662   __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_MLS_PER_MINUTE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
17663   __Pyx_GOTREF(__pyx_t_2);
17664   if (PyDict_SetItem(__pyx_d, __pyx_n_s_MLS_PER_MINUTE, __pyx_t_2) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
17665   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17666   __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_MLS_PER_SECOND); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
17667   __Pyx_GOTREF(__pyx_t_2);
17668   if (PyDict_SetItem(__pyx_d, __pyx_n_s_MLS_PER_SECOND, __pyx_t_2) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
17669   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17670   __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_DAYS_SHIFT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
17671   __Pyx_GOTREF(__pyx_t_2);
17672   if (PyDict_SetItem(__pyx_d, __pyx_n_s_DAYS_SHIFT, __pyx_t_2) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
17673   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17674   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17675 
17676   /* "fastavro/_read.pyx":32
17677  * )
17678  *
17679  * CYTHON_MODULE = 1  # Tests check this to confirm whether using the Cython code.             # <<<<<<<<<<<<<<
17680  *
17681  * MASK = 0xFF
17682  */
17683   if (PyDict_SetItem(__pyx_d, __pyx_n_s_CYTHON_MODULE, __pyx_int_1) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
17684 
17685   /* "fastavro/_read.pyx":34
17686  * CYTHON_MODULE = 1  # Tests check this to confirm whether using the Cython code.
17687  *
17688  * MASK = 0xFF             # <<<<<<<<<<<<<<
17689  * AVRO_TYPES = {
17690  *     'boolean',
17691  */
17692   if (PyDict_SetItem(__pyx_d, __pyx_n_s_MASK, __pyx_int_255) < 0) __PYX_ERR(0, 34, __pyx_L1_error)
17693 
17694   /* "fastavro/_read.pyx":36
17695  * MASK = 0xFF
17696  * AVRO_TYPES = {
17697  *     'boolean',             # <<<<<<<<<<<<<<
17698  *     'bytes',
17699  *     'double',
17700  */
17701   __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error)
17702   __Pyx_GOTREF(__pyx_t_1);
17703   if (PySet_Add(__pyx_t_1, __pyx_n_s_boolean) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
17704   if (PySet_Add(__pyx_t_1, __pyx_n_s_bytes) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
17705   if (PySet_Add(__pyx_t_1, __pyx_n_s_double) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
17706   if (PySet_Add(__pyx_t_1, __pyx_n_s_float) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
17707   if (PySet_Add(__pyx_t_1, __pyx_n_s_int) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
17708   if (PySet_Add(__pyx_t_1, __pyx_n_s_long) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
17709   if (PySet_Add(__pyx_t_1, __pyx_n_s_null) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
17710   if (PySet_Add(__pyx_t_1, __pyx_n_s_string) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
17711   if (PySet_Add(__pyx_t_1, __pyx_n_s_fixed) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
17712   if (PySet_Add(__pyx_t_1, __pyx_n_s_enum) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
17713   if (PySet_Add(__pyx_t_1, __pyx_n_s_record) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
17714   if (PySet_Add(__pyx_t_1, __pyx_n_s_error) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
17715   if (PySet_Add(__pyx_t_1, __pyx_n_s_array) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
17716   if (PySet_Add(__pyx_t_1, __pyx_n_s_map) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
17717   if (PySet_Add(__pyx_t_1, __pyx_n_s_union) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
17718   if (PySet_Add(__pyx_t_1, __pyx_n_s_request) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
17719   if (PySet_Add(__pyx_t_1, __pyx_n_s_error_union) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
17720   if (PyDict_SetItem(__pyx_d, __pyx_n_s_AVRO_TYPES, __pyx_t_1) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
17721   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17722 
17723   /* "fastavro/_read.pyx":55
17724  * }
17725  *
17726  * decimal_context = Context()             # <<<<<<<<<<<<<<
17727  *
17728  *
17729  */
17730   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Context); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error)
17731   __Pyx_GOTREF(__pyx_t_1);
17732   __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error)
17733   __Pyx_GOTREF(__pyx_t_2);
17734   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17735   if (PyDict_SetItem(__pyx_d, __pyx_n_s_decimal_context, __pyx_t_2) < 0) __PYX_ERR(0, 55, __pyx_L1_error)
17736   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17737 
17738   /* "fastavro/_read.pyx":64
17739  *
17740  *
17741  * class ReadError(Exception):             # <<<<<<<<<<<<<<
17742  *     pass
17743  *
17744  */
17745   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error)
17746   __Pyx_GOTREF(__pyx_t_2);
17747   __Pyx_INCREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
17748   __Pyx_GIVEREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
17749   PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
17750   __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error)
17751   __Pyx_GOTREF(__pyx_t_1);
17752   __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_ReadError, __pyx_n_s_ReadError, (PyObject *) NULL, __pyx_n_s_fastavro__read, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 64, __pyx_L1_error)
17753   __Pyx_GOTREF(__pyx_t_3);
17754   __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_ReadError, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 64, __pyx_L1_error)
17755   __Pyx_GOTREF(__pyx_t_4);
17756   if (PyDict_SetItem(__pyx_d, __pyx_n_s_ReadError, __pyx_t_4) < 0) __PYX_ERR(0, 64, __pyx_L1_error)
17757   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17758   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17759   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17760   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17761 
17762   /* "fastavro/_read.pyx":565
17763  *
17764  * LOGICAL_READERS = {
17765  *     'long-timestamp-millis': read_timestamp_millis,             # <<<<<<<<<<<<<<
17766  *     'long-timestamp-micros': read_timestamp_micros,
17767  *     'int-date': read_date,
17768  */
17769   __pyx_t_2 = __Pyx_PyDict_NewPresized(8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 565, __pyx_L1_error)
17770   __Pyx_GOTREF(__pyx_t_2);
17771   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_read_timestamp_millis); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 565, __pyx_L1_error)
17772   __Pyx_GOTREF(__pyx_t_1);
17773   if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_long_timestamp_millis, __pyx_t_1) < 0) __PYX_ERR(0, 565, __pyx_L1_error)
17774   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17775 
17776   /* "fastavro/_read.pyx":566
17777  * LOGICAL_READERS = {
17778  *     'long-timestamp-millis': read_timestamp_millis,
17779  *     'long-timestamp-micros': read_timestamp_micros,             # <<<<<<<<<<<<<<
17780  *     'int-date': read_date,
17781  *     'bytes-decimal': read_decimal,
17782  */
17783   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_read_timestamp_micros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 566, __pyx_L1_error)
17784   __Pyx_GOTREF(__pyx_t_1);
17785   if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_long_timestamp_micros, __pyx_t_1) < 0) __PYX_ERR(0, 565, __pyx_L1_error)
17786   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17787 
17788   /* "fastavro/_read.pyx":567
17789  *     'long-timestamp-millis': read_timestamp_millis,
17790  *     'long-timestamp-micros': read_timestamp_micros,
17791  *     'int-date': read_date,             # <<<<<<<<<<<<<<
17792  *     'bytes-decimal': read_decimal,
17793  *     'fixed-decimal': read_decimal,
17794  */
17795   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_read_date); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 567, __pyx_L1_error)
17796   __Pyx_GOTREF(__pyx_t_1);
17797   if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int_date, __pyx_t_1) < 0) __PYX_ERR(0, 565, __pyx_L1_error)
17798   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17799 
17800   /* "fastavro/_read.pyx":568
17801  *     'long-timestamp-micros': read_timestamp_micros,
17802  *     'int-date': read_date,
17803  *     'bytes-decimal': read_decimal,             # <<<<<<<<<<<<<<
17804  *     'fixed-decimal': read_decimal,
17805  *     'string-uuid': read_uuid,
17806  */
17807   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_read_decimal); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error)
17808   __Pyx_GOTREF(__pyx_t_1);
17809   if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_bytes_decimal, __pyx_t_1) < 0) __PYX_ERR(0, 565, __pyx_L1_error)
17810   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17811 
17812   /* "fastavro/_read.pyx":569
17813  *     'int-date': read_date,
17814  *     'bytes-decimal': read_decimal,
17815  *     'fixed-decimal': read_decimal,             # <<<<<<<<<<<<<<
17816  *     'string-uuid': read_uuid,
17817  *     'int-time-millis': read_time_millis,
17818  */
17819   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_read_decimal); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 569, __pyx_L1_error)
17820   __Pyx_GOTREF(__pyx_t_1);
17821   if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_fixed_decimal, __pyx_t_1) < 0) __PYX_ERR(0, 565, __pyx_L1_error)
17822   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17823 
17824   /* "fastavro/_read.pyx":570
17825  *     'bytes-decimal': read_decimal,
17826  *     'fixed-decimal': read_decimal,
17827  *     'string-uuid': read_uuid,             # <<<<<<<<<<<<<<
17828  *     'int-time-millis': read_time_millis,
17829  *     'long-time-micros': read_time_micros,
17830  */
17831   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_read_uuid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 570, __pyx_L1_error)
17832   __Pyx_GOTREF(__pyx_t_1);
17833   if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_string_uuid, __pyx_t_1) < 0) __PYX_ERR(0, 565, __pyx_L1_error)
17834   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17835 
17836   /* "fastavro/_read.pyx":571
17837  *     'fixed-decimal': read_decimal,
17838  *     'string-uuid': read_uuid,
17839  *     'int-time-millis': read_time_millis,             # <<<<<<<<<<<<<<
17840  *     'long-time-micros': read_time_micros,
17841  * }
17842  */
17843   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_read_time_millis); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 571, __pyx_L1_error)
17844   __Pyx_GOTREF(__pyx_t_1);
17845   if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_int_time_millis, __pyx_t_1) < 0) __PYX_ERR(0, 565, __pyx_L1_error)
17846   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17847 
17848   /* "fastavro/_read.pyx":572
17849  *     'string-uuid': read_uuid,
17850  *     'int-time-millis': read_time_millis,
17851  *     'long-time-micros': read_time_micros,             # <<<<<<<<<<<<<<
17852  * }
17853  *
17854  */
17855   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_read_time_micros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __pyx_L1_error)
17856   __Pyx_GOTREF(__pyx_t_1);
17857   if (PyDict_SetItem(__pyx_t_2, __pyx_kp_s_long_time_micros, __pyx_t_1) < 0) __PYX_ERR(0, 565, __pyx_L1_error)
17858   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17859   if (PyDict_SetItem(__pyx_d, __pyx_n_s_LOGICAL_READERS, __pyx_t_2) < 0) __PYX_ERR(0, 564, __pyx_L1_error)
17860   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17861 
17862   /* "fastavro/_read.pyx":715
17863  *
17864  * BLOCK_READERS = {
17865  *     'null': null_read_block,             # <<<<<<<<<<<<<<
17866  *     'deflate': deflate_read_block,
17867  *     'bzip2': bzip2_read_block,
17868  */
17869   __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 715, __pyx_L1_error)
17870   __Pyx_GOTREF(__pyx_t_2);
17871   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_null_read_block); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 715, __pyx_L1_error)
17872   __Pyx_GOTREF(__pyx_t_1);
17873   if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_null, __pyx_t_1) < 0) __PYX_ERR(0, 715, __pyx_L1_error)
17874   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17875 
17876   /* "fastavro/_read.pyx":716
17877  * BLOCK_READERS = {
17878  *     'null': null_read_block,
17879  *     'deflate': deflate_read_block,             # <<<<<<<<<<<<<<
17880  *     'bzip2': bzip2_read_block,
17881  * }
17882  */
17883   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_deflate_read_block); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 716, __pyx_L1_error)
17884   __Pyx_GOTREF(__pyx_t_1);
17885   if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_deflate, __pyx_t_1) < 0) __PYX_ERR(0, 715, __pyx_L1_error)
17886   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17887 
17888   /* "fastavro/_read.pyx":717
17889  *     'null': null_read_block,
17890  *     'deflate': deflate_read_block,
17891  *     'bzip2': bzip2_read_block,             # <<<<<<<<<<<<<<
17892  * }
17893  *
17894  */
17895   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_bzip2_read_block); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 717, __pyx_L1_error)
17896   __Pyx_GOTREF(__pyx_t_1);
17897   if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_bzip2, __pyx_t_1) < 0) __PYX_ERR(0, 715, __pyx_L1_error)
17898   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17899   if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLOCK_READERS, __pyx_t_2) < 0) __PYX_ERR(0, 714, __pyx_L1_error)
17900   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17901 
17902   /* "fastavro/_read.pyx":728
17903  *
17904  *
17905  * try:             # <<<<<<<<<<<<<<
17906  *     import snappy
17907  * except ImportError:
17908  */
17909   {
17910     __Pyx_PyThreadState_declare
17911     __Pyx_PyThreadState_assign
17912     __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
17913     __Pyx_XGOTREF(__pyx_t_5);
17914     __Pyx_XGOTREF(__pyx_t_6);
17915     __Pyx_XGOTREF(__pyx_t_7);
17916     /*try:*/ {
17917 
17918       /* "fastavro/_read.pyx":729
17919  *
17920  * try:
17921  *     import snappy             # <<<<<<<<<<<<<<
17922  * except ImportError:
17923  *     BLOCK_READERS['snappy'] = missing_codec_lib("snappy", "python-snappy")
17924  */
17925       __pyx_t_2 = __Pyx_Import(__pyx_n_s_snappy, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 729, __pyx_L2_error)
17926       __Pyx_GOTREF(__pyx_t_2);
17927       if (PyDict_SetItem(__pyx_d, __pyx_n_s_snappy, __pyx_t_2) < 0) __PYX_ERR(0, 729, __pyx_L2_error)
17928       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17929 
17930       /* "fastavro/_read.pyx":728
17931  *
17932  *
17933  * try:             # <<<<<<<<<<<<<<
17934  *     import snappy
17935  * except ImportError:
17936  */
17937     }
17938 
17939     /* "fastavro/_read.pyx":733
17940  *     BLOCK_READERS['snappy'] = missing_codec_lib("snappy", "python-snappy")
17941  * else:
17942  *     BLOCK_READERS['snappy'] = snappy_read_block             # <<<<<<<<<<<<<<
17943  *
17944  *
17945  */
17946     /*else:*/ {
17947       __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_snappy_read_block); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 733, __pyx_L4_except_error)
17948       __Pyx_GOTREF(__pyx_t_2);
17949       __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_BLOCK_READERS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 733, __pyx_L4_except_error)
17950       __Pyx_GOTREF(__pyx_t_1);
17951       if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_n_s_snappy, __pyx_t_2) < 0)) __PYX_ERR(0, 733, __pyx_L4_except_error)
17952       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17953       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17954     }
17955     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17956     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
17957     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
17958     goto __pyx_L7_try_end;
17959     __pyx_L2_error:;
17960     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
17961     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
17962     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17963     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
17964 
17965     /* "fastavro/_read.pyx":730
17966  * try:
17967  *     import snappy
17968  * except ImportError:             # <<<<<<<<<<<<<<
17969  *     BLOCK_READERS['snappy'] = missing_codec_lib("snappy", "python-snappy")
17970  * else:
17971  */
17972     __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
17973     if (__pyx_t_8) {
17974       __Pyx_AddTraceback("fastavro._read", __pyx_clineno, __pyx_lineno, __pyx_filename);
17975       if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_3) < 0) __PYX_ERR(0, 730, __pyx_L4_except_error)
17976       __Pyx_GOTREF(__pyx_t_2);
17977       __Pyx_GOTREF(__pyx_t_1);
17978       __Pyx_GOTREF(__pyx_t_3);
17979 
17980       /* "fastavro/_read.pyx":731
17981  *     import snappy
17982  * except ImportError:
17983  *     BLOCK_READERS['snappy'] = missing_codec_lib("snappy", "python-snappy")             # <<<<<<<<<<<<<<
17984  * else:
17985  *     BLOCK_READERS['snappy'] = snappy_read_block
17986  */
17987       __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_missing_codec_lib); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 731, __pyx_L4_except_error)
17988       __Pyx_GOTREF(__pyx_t_4);
17989       __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 731, __pyx_L4_except_error)
17990       __Pyx_GOTREF(__pyx_t_9);
17991       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17992       __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_BLOCK_READERS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 731, __pyx_L4_except_error)
17993       __Pyx_GOTREF(__pyx_t_4);
17994       if (unlikely(PyObject_SetItem(__pyx_t_4, __pyx_n_s_snappy, __pyx_t_9) < 0)) __PYX_ERR(0, 731, __pyx_L4_except_error)
17995       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17996       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17997       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
17998       __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
17999       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
18000       goto __pyx_L3_exception_handled;
18001     }
18002     goto __pyx_L4_except_error;
18003     __pyx_L4_except_error:;
18004 
18005     /* "fastavro/_read.pyx":728
18006  *
18007  *
18008  * try:             # <<<<<<<<<<<<<<
18009  *     import snappy
18010  * except ImportError:
18011  */
18012     __Pyx_XGIVEREF(__pyx_t_5);
18013     __Pyx_XGIVEREF(__pyx_t_6);
18014     __Pyx_XGIVEREF(__pyx_t_7);
18015     __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
18016     goto __pyx_L1_error;
18017     __pyx_L3_exception_handled:;
18018     __Pyx_XGIVEREF(__pyx_t_5);
18019     __Pyx_XGIVEREF(__pyx_t_6);
18020     __Pyx_XGIVEREF(__pyx_t_7);
18021     __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
18022     __pyx_L7_try_end:;
18023   }
18024 
18025   /* "fastavro/_read.pyx":742
18026  *
18027  *
18028  * try:             # <<<<<<<<<<<<<<
18029  *     import zstandard as zstd
18030  * except ImportError:
18031  */
18032   {
18033     __Pyx_PyThreadState_declare
18034     __Pyx_PyThreadState_assign
18035     __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5);
18036     __Pyx_XGOTREF(__pyx_t_7);
18037     __Pyx_XGOTREF(__pyx_t_6);
18038     __Pyx_XGOTREF(__pyx_t_5);
18039     /*try:*/ {
18040 
18041       /* "fastavro/_read.pyx":743
18042  *
18043  * try:
18044  *     import zstandard as zstd             # <<<<<<<<<<<<<<
18045  * except ImportError:
18046  *     BLOCK_READERS["zstandard"] = missing_codec_lib("zstandard", "zstandard")
18047  */
18048       __pyx_t_3 = __Pyx_Import(__pyx_n_s_zstandard, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 743, __pyx_L10_error)
18049       __Pyx_GOTREF(__pyx_t_3);
18050       if (PyDict_SetItem(__pyx_d, __pyx_n_s_zstd, __pyx_t_3) < 0) __PYX_ERR(0, 743, __pyx_L10_error)
18051       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18052 
18053       /* "fastavro/_read.pyx":742
18054  *
18055  *
18056  * try:             # <<<<<<<<<<<<<<
18057  *     import zstandard as zstd
18058  * except ImportError:
18059  */
18060     }
18061 
18062     /* "fastavro/_read.pyx":747
18063  *     BLOCK_READERS["zstandard"] = missing_codec_lib("zstandard", "zstandard")
18064  * else:
18065  *     BLOCK_READERS["zstandard"] = zstandard_read_block             # <<<<<<<<<<<<<<
18066  *
18067  *
18068  */
18069     /*else:*/ {
18070       __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_zstandard_read_block); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 747, __pyx_L12_except_error)
18071       __Pyx_GOTREF(__pyx_t_3);
18072       __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_BLOCK_READERS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 747, __pyx_L12_except_error)
18073       __Pyx_GOTREF(__pyx_t_1);
18074       if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_n_s_zstandard, __pyx_t_3) < 0)) __PYX_ERR(0, 747, __pyx_L12_except_error)
18075       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18076       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18077     }
18078     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
18079     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
18080     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
18081     goto __pyx_L15_try_end;
18082     __pyx_L10_error:;
18083     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
18084     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
18085     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
18086     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
18087     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
18088 
18089     /* "fastavro/_read.pyx":744
18090  * try:
18091  *     import zstandard as zstd
18092  * except ImportError:             # <<<<<<<<<<<<<<
18093  *     BLOCK_READERS["zstandard"] = missing_codec_lib("zstandard", "zstandard")
18094  * else:
18095  */
18096     __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
18097     if (__pyx_t_8) {
18098       __Pyx_AddTraceback("fastavro._read", __pyx_clineno, __pyx_lineno, __pyx_filename);
18099       if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_2) < 0) __PYX_ERR(0, 744, __pyx_L12_except_error)
18100       __Pyx_GOTREF(__pyx_t_3);
18101       __Pyx_GOTREF(__pyx_t_1);
18102       __Pyx_GOTREF(__pyx_t_2);
18103 
18104       /* "fastavro/_read.pyx":745
18105  *     import zstandard as zstd
18106  * except ImportError:
18107  *     BLOCK_READERS["zstandard"] = missing_codec_lib("zstandard", "zstandard")             # <<<<<<<<<<<<<<
18108  * else:
18109  *     BLOCK_READERS["zstandard"] = zstandard_read_block
18110  */
18111       __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_missing_codec_lib); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 745, __pyx_L12_except_error)
18112       __Pyx_GOTREF(__pyx_t_9);
18113       __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 745, __pyx_L12_except_error)
18114       __Pyx_GOTREF(__pyx_t_4);
18115       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18116       __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_BLOCK_READERS); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 745, __pyx_L12_except_error)
18117       __Pyx_GOTREF(__pyx_t_9);
18118       if (unlikely(PyObject_SetItem(__pyx_t_9, __pyx_n_s_zstandard, __pyx_t_4) < 0)) __PYX_ERR(0, 745, __pyx_L12_except_error)
18119       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18120       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18121       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
18122       __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
18123       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
18124       goto __pyx_L11_exception_handled;
18125     }
18126     goto __pyx_L12_except_error;
18127     __pyx_L12_except_error:;
18128 
18129     /* "fastavro/_read.pyx":742
18130  *
18131  *
18132  * try:             # <<<<<<<<<<<<<<
18133  *     import zstandard as zstd
18134  * except ImportError:
18135  */
18136     __Pyx_XGIVEREF(__pyx_t_7);
18137     __Pyx_XGIVEREF(__pyx_t_6);
18138     __Pyx_XGIVEREF(__pyx_t_5);
18139     __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_6, __pyx_t_5);
18140     goto __pyx_L1_error;
18141     __pyx_L11_exception_handled:;
18142     __Pyx_XGIVEREF(__pyx_t_7);
18143     __Pyx_XGIVEREF(__pyx_t_6);
18144     __Pyx_XGIVEREF(__pyx_t_5);
18145     __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_6, __pyx_t_5);
18146     __pyx_L15_try_end:;
18147   }
18148 
18149   /* "fastavro/_read.pyx":756
18150  *
18151  *
18152  * try:             # <<<<<<<<<<<<<<
18153  *     import lz4.block
18154  * except ImportError:
18155  */
18156   {
18157     __Pyx_PyThreadState_declare
18158     __Pyx_PyThreadState_assign
18159     __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
18160     __Pyx_XGOTREF(__pyx_t_5);
18161     __Pyx_XGOTREF(__pyx_t_6);
18162     __Pyx_XGOTREF(__pyx_t_7);
18163     /*try:*/ {
18164 
18165       /* "fastavro/_read.pyx":757
18166  *
18167  * try:
18168  *     import lz4.block             # <<<<<<<<<<<<<<
18169  * except ImportError:
18170  *     BLOCK_READERS["lz4"] = missing_codec_lib("lz4", "lz4")
18171  */
18172       __pyx_t_2 = __Pyx_Import(__pyx_n_s_lz4_block, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 757, __pyx_L18_error)
18173       __Pyx_GOTREF(__pyx_t_2);
18174       if (PyDict_SetItem(__pyx_d, __pyx_n_s_lz4, __pyx_t_2) < 0) __PYX_ERR(0, 757, __pyx_L18_error)
18175       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18176 
18177       /* "fastavro/_read.pyx":756
18178  *
18179  *
18180  * try:             # <<<<<<<<<<<<<<
18181  *     import lz4.block
18182  * except ImportError:
18183  */
18184     }
18185 
18186     /* "fastavro/_read.pyx":761
18187  *     BLOCK_READERS["lz4"] = missing_codec_lib("lz4", "lz4")
18188  * else:
18189  *     BLOCK_READERS["lz4"] = lz4_read_block             # <<<<<<<<<<<<<<
18190  *
18191  *
18192  */
18193     /*else:*/ {
18194       __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_lz4_read_block); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 761, __pyx_L20_except_error)
18195       __Pyx_GOTREF(__pyx_t_2);
18196       __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_BLOCK_READERS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 761, __pyx_L20_except_error)
18197       __Pyx_GOTREF(__pyx_t_1);
18198       if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_n_s_lz4, __pyx_t_2) < 0)) __PYX_ERR(0, 761, __pyx_L20_except_error)
18199       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18200       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18201     }
18202     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
18203     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
18204     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
18205     goto __pyx_L23_try_end;
18206     __pyx_L18_error:;
18207     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
18208     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
18209     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
18210     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
18211     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
18212 
18213     /* "fastavro/_read.pyx":758
18214  * try:
18215  *     import lz4.block
18216  * except ImportError:             # <<<<<<<<<<<<<<
18217  *     BLOCK_READERS["lz4"] = missing_codec_lib("lz4", "lz4")
18218  * else:
18219  */
18220     __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
18221     if (__pyx_t_8) {
18222       __Pyx_AddTraceback("fastavro._read", __pyx_clineno, __pyx_lineno, __pyx_filename);
18223       if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_3) < 0) __PYX_ERR(0, 758, __pyx_L20_except_error)
18224       __Pyx_GOTREF(__pyx_t_2);
18225       __Pyx_GOTREF(__pyx_t_1);
18226       __Pyx_GOTREF(__pyx_t_3);
18227 
18228       /* "fastavro/_read.pyx":759
18229  *     import lz4.block
18230  * except ImportError:
18231  *     BLOCK_READERS["lz4"] = missing_codec_lib("lz4", "lz4")             # <<<<<<<<<<<<<<
18232  * else:
18233  *     BLOCK_READERS["lz4"] = lz4_read_block
18234  */
18235       __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_missing_codec_lib); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 759, __pyx_L20_except_error)
18236       __Pyx_GOTREF(__pyx_t_4);
18237       __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 759, __pyx_L20_except_error)
18238       __Pyx_GOTREF(__pyx_t_9);
18239       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18240       __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_BLOCK_READERS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 759, __pyx_L20_except_error)
18241       __Pyx_GOTREF(__pyx_t_4);
18242       if (unlikely(PyObject_SetItem(__pyx_t_4, __pyx_n_s_lz4, __pyx_t_9) < 0)) __PYX_ERR(0, 759, __pyx_L20_except_error)
18243       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18244       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18245       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
18246       __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
18247       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
18248       goto __pyx_L19_exception_handled;
18249     }
18250     goto __pyx_L20_except_error;
18251     __pyx_L20_except_error:;
18252 
18253     /* "fastavro/_read.pyx":756
18254  *
18255  *
18256  * try:             # <<<<<<<<<<<<<<
18257  *     import lz4.block
18258  * except ImportError:
18259  */
18260     __Pyx_XGIVEREF(__pyx_t_5);
18261     __Pyx_XGIVEREF(__pyx_t_6);
18262     __Pyx_XGIVEREF(__pyx_t_7);
18263     __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
18264     goto __pyx_L1_error;
18265     __pyx_L19_exception_handled:;
18266     __Pyx_XGIVEREF(__pyx_t_5);
18267     __Pyx_XGIVEREF(__pyx_t_6);
18268     __Pyx_XGIVEREF(__pyx_t_7);
18269     __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
18270     __pyx_L23_try_end:;
18271   }
18272 
18273   /* "fastavro/_read.pyx":770
18274  *
18275  *
18276  * try:             # <<<<<<<<<<<<<<
18277  *     import lzma
18278  * except ImportError:
18279  */
18280   {
18281     __Pyx_PyThreadState_declare
18282     __Pyx_PyThreadState_assign
18283     __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5);
18284     __Pyx_XGOTREF(__pyx_t_7);
18285     __Pyx_XGOTREF(__pyx_t_6);
18286     __Pyx_XGOTREF(__pyx_t_5);
18287     /*try:*/ {
18288 
18289       /* "fastavro/_read.pyx":771
18290  *
18291  * try:
18292  *     import lzma             # <<<<<<<<<<<<<<
18293  * except ImportError:
18294  *     try:
18295  */
18296       __pyx_t_3 = __Pyx_Import(__pyx_n_s_lzma, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 771, __pyx_L26_error)
18297       __Pyx_GOTREF(__pyx_t_3);
18298       if (PyDict_SetItem(__pyx_d, __pyx_n_s_lzma, __pyx_t_3) < 0) __PYX_ERR(0, 771, __pyx_L26_error)
18299       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18300 
18301       /* "fastavro/_read.pyx":770
18302  *
18303  *
18304  * try:             # <<<<<<<<<<<<<<
18305  *     import lzma
18306  * except ImportError:
18307  */
18308     }
18309 
18310     /* "fastavro/_read.pyx":780
18311  *         BLOCK_READERS["xz"] = xz_read_block
18312  * else:
18313  *     BLOCK_READERS["xz"] = xz_read_block             # <<<<<<<<<<<<<<
18314  *
18315  *
18316  */
18317     /*else:*/ {
18318       __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_xz_read_block); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 780, __pyx_L28_except_error)
18319       __Pyx_GOTREF(__pyx_t_3);
18320       __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_BLOCK_READERS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 780, __pyx_L28_except_error)
18321       __Pyx_GOTREF(__pyx_t_1);
18322       if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_n_s_xz, __pyx_t_3) < 0)) __PYX_ERR(0, 780, __pyx_L28_except_error)
18323       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18324       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18325     }
18326     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
18327     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
18328     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
18329     goto __pyx_L31_try_end;
18330     __pyx_L26_error:;
18331     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
18332     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
18333     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
18334     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
18335     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
18336 
18337     /* "fastavro/_read.pyx":772
18338  * try:
18339  *     import lzma
18340  * except ImportError:             # <<<<<<<<<<<<<<
18341  *     try:
18342  *         from backports import lzma
18343  */
18344     __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
18345     if (__pyx_t_8) {
18346       __Pyx_AddTraceback("fastavro._read", __pyx_clineno, __pyx_lineno, __pyx_filename);
18347       if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_2) < 0) __PYX_ERR(0, 772, __pyx_L28_except_error)
18348       __Pyx_GOTREF(__pyx_t_3);
18349       __Pyx_GOTREF(__pyx_t_1);
18350       __Pyx_GOTREF(__pyx_t_2);
18351 
18352       /* "fastavro/_read.pyx":773
18353  *     import lzma
18354  * except ImportError:
18355  *     try:             # <<<<<<<<<<<<<<
18356  *         from backports import lzma
18357  *     except ImportError:
18358  */
18359       {
18360         __Pyx_PyThreadState_declare
18361         __Pyx_PyThreadState_assign
18362         __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
18363         __Pyx_XGOTREF(__pyx_t_10);
18364         __Pyx_XGOTREF(__pyx_t_11);
18365         __Pyx_XGOTREF(__pyx_t_12);
18366         /*try:*/ {
18367 
18368           /* "fastavro/_read.pyx":774
18369  * except ImportError:
18370  *     try:
18371  *         from backports import lzma             # <<<<<<<<<<<<<<
18372  *     except ImportError:
18373  *         BLOCK_READERS["xz"] = missing_codec_lib("xz", "backports.lzma")
18374  */
18375           __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 774, __pyx_L34_error)
18376           __Pyx_GOTREF(__pyx_t_9);
18377           __Pyx_INCREF(__pyx_n_s_lzma);
18378           __Pyx_GIVEREF(__pyx_n_s_lzma);
18379           PyList_SET_ITEM(__pyx_t_9, 0, __pyx_n_s_lzma);
18380           __pyx_t_4 = __Pyx_Import(__pyx_n_s_backports, __pyx_t_9, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 774, __pyx_L34_error)
18381           __Pyx_GOTREF(__pyx_t_4);
18382           __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18383           __pyx_t_9 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_lzma); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 774, __pyx_L34_error)
18384           __Pyx_GOTREF(__pyx_t_9);
18385           if (PyDict_SetItem(__pyx_d, __pyx_n_s_lzma, __pyx_t_9) < 0) __PYX_ERR(0, 774, __pyx_L34_error)
18386           __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18387           __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18388 
18389           /* "fastavro/_read.pyx":773
18390  *     import lzma
18391  * except ImportError:
18392  *     try:             # <<<<<<<<<<<<<<
18393  *         from backports import lzma
18394  *     except ImportError:
18395  */
18396         }
18397 
18398         /* "fastavro/_read.pyx":778
18399  *         BLOCK_READERS["xz"] = missing_codec_lib("xz", "backports.lzma")
18400  *     else:
18401  *         BLOCK_READERS["xz"] = xz_read_block             # <<<<<<<<<<<<<<
18402  * else:
18403  *     BLOCK_READERS["xz"] = xz_read_block
18404  */
18405         /*else:*/ {
18406           __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_xz_read_block); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 778, __pyx_L36_except_error)
18407           __Pyx_GOTREF(__pyx_t_4);
18408           __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_BLOCK_READERS); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 778, __pyx_L36_except_error)
18409           __Pyx_GOTREF(__pyx_t_9);
18410           if (unlikely(PyObject_SetItem(__pyx_t_9, __pyx_n_s_xz, __pyx_t_4) < 0)) __PYX_ERR(0, 778, __pyx_L36_except_error)
18411           __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18412           __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18413         }
18414         __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
18415         __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
18416         __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
18417         goto __pyx_L41_try_end;
18418         __pyx_L34_error:;
18419         __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
18420         __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
18421 
18422         /* "fastavro/_read.pyx":775
18423  *     try:
18424  *         from backports import lzma
18425  *     except ImportError:             # <<<<<<<<<<<<<<
18426  *         BLOCK_READERS["xz"] = missing_codec_lib("xz", "backports.lzma")
18427  *     else:
18428  */
18429         __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
18430         if (__pyx_t_8) {
18431           __Pyx_AddTraceback("fastavro._read", __pyx_clineno, __pyx_lineno, __pyx_filename);
18432           if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_9, &__pyx_t_13) < 0) __PYX_ERR(0, 775, __pyx_L36_except_error)
18433           __Pyx_GOTREF(__pyx_t_4);
18434           __Pyx_GOTREF(__pyx_t_9);
18435           __Pyx_GOTREF(__pyx_t_13);
18436 
18437           /* "fastavro/_read.pyx":776
18438  *         from backports import lzma
18439  *     except ImportError:
18440  *         BLOCK_READERS["xz"] = missing_codec_lib("xz", "backports.lzma")             # <<<<<<<<<<<<<<
18441  *     else:
18442  *         BLOCK_READERS["xz"] = xz_read_block
18443  */
18444           __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_missing_codec_lib); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 776, __pyx_L36_except_error)
18445           __Pyx_GOTREF(__pyx_t_14);
18446           __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 776, __pyx_L36_except_error)
18447           __Pyx_GOTREF(__pyx_t_15);
18448           __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
18449           __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_BLOCK_READERS); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 776, __pyx_L36_except_error)
18450           __Pyx_GOTREF(__pyx_t_14);
18451           if (unlikely(PyObject_SetItem(__pyx_t_14, __pyx_n_s_xz, __pyx_t_15) < 0)) __PYX_ERR(0, 776, __pyx_L36_except_error)
18452           __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
18453           __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
18454           __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
18455           __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
18456           __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
18457           goto __pyx_L35_exception_handled;
18458         }
18459         goto __pyx_L36_except_error;
18460         __pyx_L36_except_error:;
18461 
18462         /* "fastavro/_read.pyx":773
18463  *     import lzma
18464  * except ImportError:
18465  *     try:             # <<<<<<<<<<<<<<
18466  *         from backports import lzma
18467  *     except ImportError:
18468  */
18469         __Pyx_XGIVEREF(__pyx_t_10);
18470         __Pyx_XGIVEREF(__pyx_t_11);
18471         __Pyx_XGIVEREF(__pyx_t_12);
18472         __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
18473         goto __pyx_L28_except_error;
18474         __pyx_L35_exception_handled:;
18475         __Pyx_XGIVEREF(__pyx_t_10);
18476         __Pyx_XGIVEREF(__pyx_t_11);
18477         __Pyx_XGIVEREF(__pyx_t_12);
18478         __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
18479         __pyx_L41_try_end:;
18480       }
18481       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
18482       __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
18483       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
18484       goto __pyx_L27_exception_handled;
18485     }
18486     goto __pyx_L28_except_error;
18487     __pyx_L28_except_error:;
18488 
18489     /* "fastavro/_read.pyx":770
18490  *
18491  *
18492  * try:             # <<<<<<<<<<<<<<
18493  *     import lzma
18494  * except ImportError:
18495  */
18496     __Pyx_XGIVEREF(__pyx_t_7);
18497     __Pyx_XGIVEREF(__pyx_t_6);
18498     __Pyx_XGIVEREF(__pyx_t_5);
18499     __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_6, __pyx_t_5);
18500     goto __pyx_L1_error;
18501     __pyx_L27_exception_handled:;
18502     __Pyx_XGIVEREF(__pyx_t_7);
18503     __Pyx_XGIVEREF(__pyx_t_6);
18504     __Pyx_XGIVEREF(__pyx_t_5);
18505     __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_6, __pyx_t_5);
18506     __pyx_L31_try_end:;
18507   }
18508 
18509   /* "fastavro/_read.pyx":783
18510  *
18511  *
18512  * def _iter_avro_records(             # <<<<<<<<<<<<<<
18513  *     fo,
18514  *     header,
18515  */
18516   __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8fastavro_5_read_39_iter_avro_records, NULL, __pyx_n_s_fastavro__read); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 783, __pyx_L1_error)
18517   __Pyx_GOTREF(__pyx_t_2);
18518   if (PyDict_SetItem(__pyx_d, __pyx_n_s_iter_avro_records, __pyx_t_2) < 0) __PYX_ERR(0, 783, __pyx_L1_error)
18519   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18520 
18521   /* "fastavro/_read.pyx":817
18522  *
18523  *
18524  * def _iter_avro_blocks(             # <<<<<<<<<<<<<<
18525  *     fo,
18526  *     header,
18527  */
18528   __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8fastavro_5_read_42_iter_avro_blocks, NULL, __pyx_n_s_fastavro__read); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 817, __pyx_L1_error)
18529   __Pyx_GOTREF(__pyx_t_2);
18530   if (PyDict_SetItem(__pyx_d, __pyx_n_s_iter_avro_blocks, __pyx_t_2) < 0) __PYX_ERR(0, 817, __pyx_L1_error)
18531   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18532 
18533   /* "fastavro/_read.pyx":851
18534  *
18535  *
18536  * class Block:             # <<<<<<<<<<<<<<
18537  *     def __init__(
18538  *             self,
18539  */
18540   __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_Block, __pyx_n_s_Block, (PyObject *) NULL, __pyx_n_s_fastavro__read, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 851, __pyx_L1_error)
18541   __Pyx_GOTREF(__pyx_t_2);
18542 
18543   /* "fastavro/_read.pyx":852
18544  *
18545  * class Block:
18546  *     def __init__(             # <<<<<<<<<<<<<<
18547  *             self,
18548  *             bytes_,
18549  */
18550   __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_8fastavro_5_read_5Block_1__init__, 0, __pyx_n_s_Block___init, NULL, __pyx_n_s_fastavro__read, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 852, __pyx_L1_error)
18551   __Pyx_GOTREF(__pyx_t_1);
18552   __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__17);
18553   if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_1) < 0) __PYX_ERR(0, 852, __pyx_L1_error)
18554   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18555 
18556   /* "fastavro/_read.pyx":873
18557  *         self.return_record_name = return_record_name
18558  *
18559  *     def __iter__(self):             # <<<<<<<<<<<<<<
18560  *         for i in range(self.num_records):
18561  *             yield _read_data(
18562  */
18563   __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_8fastavro_5_read_5Block_3__iter__, 0, __pyx_n_s_Block___iter, NULL, __pyx_n_s_fastavro__read, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 873, __pyx_L1_error)
18564   __Pyx_GOTREF(__pyx_t_1);
18565   if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_iter, __pyx_t_1) < 0) __PYX_ERR(0, 873, __pyx_L1_error)
18566   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18567 
18568   /* "fastavro/_read.pyx":883
18569  *             )
18570  *
18571  *     def __str__(self):             # <<<<<<<<<<<<<<
18572  *         return ("Avro block: %d bytes, %d records, codec: %s, position %d+%d"
18573  *                 % (len(self.bytes_), self.num_records, self.codec, self.offset,
18574  */
18575   __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_8fastavro_5_read_5Block_6__str__, 0, __pyx_n_s_Block___str, NULL, __pyx_n_s_fastavro__read, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 883, __pyx_L1_error)
18576   __Pyx_GOTREF(__pyx_t_1);
18577   if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_str, __pyx_t_1) < 0) __PYX_ERR(0, 883, __pyx_L1_error)
18578   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18579 
18580   /* "fastavro/_read.pyx":851
18581  *
18582  *
18583  * class Block:             # <<<<<<<<<<<<<<
18584  *     def __init__(
18585  *             self,
18586  */
18587   __pyx_t_1 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_Block, __pyx_empty_tuple, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 851, __pyx_L1_error)
18588   __Pyx_GOTREF(__pyx_t_1);
18589   if (PyDict_SetItem(__pyx_d, __pyx_n_s_Block, __pyx_t_1) < 0) __PYX_ERR(0, 851, __pyx_L1_error)
18590   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18591   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18592 
18593   /* "fastavro/_read.pyx":889
18594  *
18595  *
18596  * class file_reader:             # <<<<<<<<<<<<<<
18597  *     def __init__(self, fo, reader_schema=None, return_record_name=False):
18598  *         self.fo = fo
18599  */
18600   __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_file_reader, __pyx_n_s_file_reader, (PyObject *) NULL, __pyx_n_s_fastavro__read, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 889, __pyx_L1_error)
18601   __Pyx_GOTREF(__pyx_t_2);
18602 
18603   /* "fastavro/_read.pyx":890
18604  *
18605  * class file_reader:
18606  *     def __init__(self, fo, reader_schema=None, return_record_name=False):             # <<<<<<<<<<<<<<
18607  *         self.fo = fo
18608  *         self.return_record_name = return_record_name
18609  */
18610   __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_8fastavro_5_read_11file_reader_1__init__, 0, __pyx_n_s_file_reader___init, NULL, __pyx_n_s_fastavro__read, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 890, __pyx_L1_error)
18611   __Pyx_GOTREF(__pyx_t_1);
18612   __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__23);
18613   if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_1) < 0) __PYX_ERR(0, 890, __pyx_L1_error)
18614   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18615 
18616   /* "fastavro/_read.pyx":927
18617  *
18618  *     @property
18619  *     def schema(self):             # <<<<<<<<<<<<<<
18620  *         import warnings
18621  *         warnings.warn(
18622  */
18623   __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_8fastavro_5_read_11file_reader_3schema, 0, __pyx_n_s_file_reader_schema, NULL, __pyx_n_s_fastavro__read, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 927, __pyx_L1_error)
18624   __Pyx_GOTREF(__pyx_t_1);
18625 
18626   /* "fastavro/_read.pyx":926
18627  *         self._elems = None
18628  *
18629  *     @property             # <<<<<<<<<<<<<<
18630  *     def schema(self):
18631  *         import warnings
18632  */
18633   __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 926, __pyx_L1_error)
18634   __Pyx_GOTREF(__pyx_t_3);
18635   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18636   if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_schema_2, __pyx_t_3) < 0) __PYX_ERR(0, 927, __pyx_L1_error)
18637   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18638 
18639   /* "fastavro/_read.pyx":935
18640  *         return self._schema
18641  *
18642  *     def __iter__(self):             # <<<<<<<<<<<<<<
18643  *         if not self._elems:
18644  *             raise NotImplementedError
18645  */
18646   __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_8fastavro_5_read_11file_reader_5__iter__, 0, __pyx_n_s_file_reader___iter, NULL, __pyx_n_s_fastavro__read, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 935, __pyx_L1_error)
18647   __Pyx_GOTREF(__pyx_t_3);
18648   if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_iter, __pyx_t_3) < 0) __PYX_ERR(0, 935, __pyx_L1_error)
18649   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18650 
18651   /* "fastavro/_read.pyx":940
18652  *         return self._elems
18653  *
18654  *     def next(self):             # <<<<<<<<<<<<<<
18655  *         return next(self._elems)
18656  *
18657  */
18658   __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_8fastavro_5_read_11file_reader_7next, 0, __pyx_n_s_file_reader_next, NULL, __pyx_n_s_fastavro__read, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 940, __pyx_L1_error)
18659   __Pyx_GOTREF(__pyx_t_3);
18660   if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_next, __pyx_t_3) < 0) __PYX_ERR(0, 940, __pyx_L1_error)
18661   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18662 
18663   /* "fastavro/_read.pyx":943
18664  *         return next(self._elems)
18665  *
18666  *     __next__ = next             # <<<<<<<<<<<<<<
18667  *
18668  *
18669  */
18670   __pyx_t_3 = PyObject_GetItem(__pyx_t_2, __pyx_n_s_next);
18671   if (unlikely(!__pyx_t_3)) {
18672     PyErr_Clear();
18673     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_next);
18674   }
18675   if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 943, __pyx_L1_error)
18676   __Pyx_GOTREF(__pyx_t_3);
18677   if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_next_2, __pyx_t_3) < 0) __PYX_ERR(0, 943, __pyx_L1_error)
18678   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18679 
18680   /* "fastavro/_read.pyx":889
18681  *
18682  *
18683  * class file_reader:             # <<<<<<<<<<<<<<
18684  *     def __init__(self, fo, reader_schema=None, return_record_name=False):
18685  *         self.fo = fo
18686  */
18687   __pyx_t_3 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_file_reader, __pyx_empty_tuple, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 889, __pyx_L1_error)
18688   __Pyx_GOTREF(__pyx_t_3);
18689   if (PyDict_SetItem(__pyx_d, __pyx_n_s_file_reader, __pyx_t_3) < 0) __PYX_ERR(0, 889, __pyx_L1_error)
18690   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18691   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18692 
18693   /* "fastavro/_read.pyx":946
18694  *
18695  *
18696  * class reader(file_reader):             # <<<<<<<<<<<<<<
18697  *     def __init__(self, fo, reader_schema=None, return_record_name=False):
18698  *         file_reader.__init__(self, fo, reader_schema, return_record_name)
18699  */
18700   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_file_reader); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 946, __pyx_L1_error)
18701   __Pyx_GOTREF(__pyx_t_2);
18702   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 946, __pyx_L1_error)
18703   __Pyx_GOTREF(__pyx_t_3);
18704   __Pyx_GIVEREF(__pyx_t_2);
18705   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
18706   __pyx_t_2 = 0;
18707   __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 946, __pyx_L1_error)
18708   __Pyx_GOTREF(__pyx_t_2);
18709   __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_3, __pyx_n_s_reader, __pyx_n_s_reader, (PyObject *) NULL, __pyx_n_s_fastavro__read, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 946, __pyx_L1_error)
18710   __Pyx_GOTREF(__pyx_t_1);
18711 
18712   /* "fastavro/_read.pyx":947
18713  *
18714  * class reader(file_reader):
18715  *     def __init__(self, fo, reader_schema=None, return_record_name=False):             # <<<<<<<<<<<<<<
18716  *         file_reader.__init__(self, fo, reader_schema, return_record_name)
18717  *
18718  */
18719   __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8fastavro_5_read_6reader_1__init__, 0, __pyx_n_s_reader___init, NULL, __pyx_n_s_fastavro__read, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 947, __pyx_L1_error)
18720   __Pyx_GOTREF(__pyx_t_13);
18721   __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_tuple__32);
18722   if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_init, __pyx_t_13) < 0) __PYX_ERR(0, 947, __pyx_L1_error)
18723   __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
18724 
18725   /* "fastavro/_read.pyx":946
18726  *
18727  *
18728  * class reader(file_reader):             # <<<<<<<<<<<<<<
18729  *     def __init__(self, fo, reader_schema=None, return_record_name=False):
18730  *         file_reader.__init__(self, fo, reader_schema, return_record_name)
18731  */
18732   __pyx_t_13 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_reader, __pyx_t_3, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 946, __pyx_L1_error)
18733   __Pyx_GOTREF(__pyx_t_13);
18734   if (PyDict_SetItem(__pyx_d, __pyx_n_s_reader, __pyx_t_13) < 0) __PYX_ERR(0, 946, __pyx_L1_error)
18735   __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
18736   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18737   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18738   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18739 
18740   /* "fastavro/_read.pyx":959
18741  *
18742  *
18743  * class block_reader(file_reader):             # <<<<<<<<<<<<<<
18744  *     def __init__(self, fo, reader_schema=None, return_record_name=False):
18745  *         file_reader.__init__(self, fo, reader_schema, return_record_name)
18746  */
18747   __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_file_reader); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 959, __pyx_L1_error)
18748   __Pyx_GOTREF(__pyx_t_3);
18749   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 959, __pyx_L1_error)
18750   __Pyx_GOTREF(__pyx_t_2);
18751   __Pyx_GIVEREF(__pyx_t_3);
18752   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
18753   __pyx_t_3 = 0;
18754   __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 959, __pyx_L1_error)
18755   __Pyx_GOTREF(__pyx_t_3);
18756   __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_2, __pyx_n_s_block_reader, __pyx_n_s_block_reader, (PyObject *) NULL, __pyx_n_s_fastavro__read, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 959, __pyx_L1_error)
18757   __Pyx_GOTREF(__pyx_t_1);
18758 
18759   /* "fastavro/_read.pyx":960
18760  *
18761  * class block_reader(file_reader):
18762  *     def __init__(self, fo, reader_schema=None, return_record_name=False):             # <<<<<<<<<<<<<<
18763  *         file_reader.__init__(self, fo, reader_schema, return_record_name)
18764  *
18765  */
18766   __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8fastavro_5_read_12block_reader_1__init__, 0, __pyx_n_s_block_reader___init, NULL, __pyx_n_s_fastavro__read, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 960, __pyx_L1_error)
18767   __Pyx_GOTREF(__pyx_t_13);
18768   __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_tuple__35);
18769   if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_init, __pyx_t_13) < 0) __PYX_ERR(0, 960, __pyx_L1_error)
18770   __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
18771 
18772   /* "fastavro/_read.pyx":959
18773  *
18774  *
18775  * class block_reader(file_reader):             # <<<<<<<<<<<<<<
18776  *     def __init__(self, fo, reader_schema=None, return_record_name=False):
18777  *         file_reader.__init__(self, fo, reader_schema, return_record_name)
18778  */
18779   __pyx_t_13 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_block_reader, __pyx_t_2, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 959, __pyx_L1_error)
18780   __Pyx_GOTREF(__pyx_t_13);
18781   if (PyDict_SetItem(__pyx_d, __pyx_n_s_block_reader, __pyx_t_13) < 0) __PYX_ERR(0, 959, __pyx_L1_error)
18782   __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
18783   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18784   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18785   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18786 
18787   /* "fastavro/_read.pyx":1
18788  * # cython: language_level=3str             # <<<<<<<<<<<<<<
18789  * # cython: auto_cpdef=True
18790  *
18791  */
18792   __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
18793   __Pyx_GOTREF(__pyx_t_2);
18794   if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
18795   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18796 
18797   /*--- Wrapped vars code ---*/
18798 
18799   goto __pyx_L0;
18800   __pyx_L1_error:;
18801   __Pyx_XDECREF(__pyx_t_1);
18802   __Pyx_XDECREF(__pyx_t_2);
18803   __Pyx_XDECREF(__pyx_t_3);
18804   __Pyx_XDECREF(__pyx_t_4);
18805   __Pyx_XDECREF(__pyx_t_9);
18806   __Pyx_XDECREF(__pyx_t_13);
18807   __Pyx_XDECREF(__pyx_t_14);
18808   __Pyx_XDECREF(__pyx_t_15);
18809   if (__pyx_m) {
18810     if (__pyx_d) {
18811       __Pyx_AddTraceback("init fastavro._read", __pyx_clineno, __pyx_lineno, __pyx_filename);
18812     }
18813     Py_CLEAR(__pyx_m);
18814   } else if (!PyErr_Occurred()) {
18815     PyErr_SetString(PyExc_ImportError, "init fastavro._read");
18816   }
18817   __pyx_L0:;
18818   __Pyx_RefNannyFinishContext();
18819   #if CYTHON_PEP489_MULTI_PHASE_INIT
18820   return (__pyx_m != NULL) ? 0 : -1;
18821   #elif PY_MAJOR_VERSION >= 3
18822   return __pyx_m;
18823   #else
18824   return;
18825   #endif
18826 }
18827 
18828 /* --- Runtime support code --- */
18829 /* Refnanny */
18830 #if CYTHON_REFNANNY
__Pyx_RefNannyImportAPI(const char * modname)18831 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
18832     PyObject *m = NULL, *p = NULL;
18833     void *r = NULL;
18834     m = PyImport_ImportModule(modname);
18835     if (!m) goto end;
18836     p = PyObject_GetAttrString(m, "RefNannyAPI");
18837     if (!p) goto end;
18838     r = PyLong_AsVoidPtr(p);
18839 end:
18840     Py_XDECREF(p);
18841     Py_XDECREF(m);
18842     return (__Pyx_RefNannyAPIStruct *)r;
18843 }
18844 #endif
18845 
18846 /* PyObjectGetAttrStr */
18847 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetAttrStr(PyObject * obj,PyObject * attr_name)18848 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
18849     PyTypeObject* tp = Py_TYPE(obj);
18850     if (likely(tp->tp_getattro))
18851         return tp->tp_getattro(obj, attr_name);
18852 #if PY_MAJOR_VERSION < 3
18853     if (likely(tp->tp_getattr))
18854         return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
18855 #endif
18856     return PyObject_GetAttr(obj, attr_name);
18857 }
18858 #endif
18859 
18860 /* GetBuiltinName */
__Pyx_GetBuiltinName(PyObject * name)18861 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
18862     PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
18863     if (unlikely(!result)) {
18864         PyErr_Format(PyExc_NameError,
18865 #if PY_MAJOR_VERSION >= 3
18866             "name '%U' is not defined", name);
18867 #else
18868             "name '%.200s' is not defined", PyString_AS_STRING(name));
18869 #endif
18870     }
18871     return result;
18872 }
18873 
18874 /* BytesEquals */
__Pyx_PyBytes_Equals(PyObject * s1,PyObject * s2,int equals)18875 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
18876 #if CYTHON_COMPILING_IN_PYPY
18877     return PyObject_RichCompareBool(s1, s2, equals);
18878 #else
18879     if (s1 == s2) {
18880         return (equals == Py_EQ);
18881     } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
18882         const char *ps1, *ps2;
18883         Py_ssize_t length = PyBytes_GET_SIZE(s1);
18884         if (length != PyBytes_GET_SIZE(s2))
18885             return (equals == Py_NE);
18886         ps1 = PyBytes_AS_STRING(s1);
18887         ps2 = PyBytes_AS_STRING(s2);
18888         if (ps1[0] != ps2[0]) {
18889             return (equals == Py_NE);
18890         } else if (length == 1) {
18891             return (equals == Py_EQ);
18892         } else {
18893             int result;
18894 #if CYTHON_USE_UNICODE_INTERNALS
18895             Py_hash_t hash1, hash2;
18896             hash1 = ((PyBytesObject*)s1)->ob_shash;
18897             hash2 = ((PyBytesObject*)s2)->ob_shash;
18898             if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
18899                 return (equals == Py_NE);
18900             }
18901 #endif
18902             result = memcmp(ps1, ps2, (size_t)length);
18903             return (equals == Py_EQ) ? (result == 0) : (result != 0);
18904         }
18905     } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
18906         return (equals == Py_NE);
18907     } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
18908         return (equals == Py_NE);
18909     } else {
18910         int result;
18911         PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
18912         if (!py_result)
18913             return -1;
18914         result = __Pyx_PyObject_IsTrue(py_result);
18915         Py_DECREF(py_result);
18916         return result;
18917     }
18918 #endif
18919 }
18920 
18921 /* UnicodeEquals */
__Pyx_PyUnicode_Equals(PyObject * s1,PyObject * s2,int equals)18922 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
18923 #if CYTHON_COMPILING_IN_PYPY
18924     return PyObject_RichCompareBool(s1, s2, equals);
18925 #else
18926 #if PY_MAJOR_VERSION < 3
18927     PyObject* owned_ref = NULL;
18928 #endif
18929     int s1_is_unicode, s2_is_unicode;
18930     if (s1 == s2) {
18931         goto return_eq;
18932     }
18933     s1_is_unicode = PyUnicode_CheckExact(s1);
18934     s2_is_unicode = PyUnicode_CheckExact(s2);
18935 #if PY_MAJOR_VERSION < 3
18936     if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
18937         owned_ref = PyUnicode_FromObject(s2);
18938         if (unlikely(!owned_ref))
18939             return -1;
18940         s2 = owned_ref;
18941         s2_is_unicode = 1;
18942     } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
18943         owned_ref = PyUnicode_FromObject(s1);
18944         if (unlikely(!owned_ref))
18945             return -1;
18946         s1 = owned_ref;
18947         s1_is_unicode = 1;
18948     } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
18949         return __Pyx_PyBytes_Equals(s1, s2, equals);
18950     }
18951 #endif
18952     if (s1_is_unicode & s2_is_unicode) {
18953         Py_ssize_t length;
18954         int kind;
18955         void *data1, *data2;
18956         if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
18957             return -1;
18958         length = __Pyx_PyUnicode_GET_LENGTH(s1);
18959         if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
18960             goto return_ne;
18961         }
18962 #if CYTHON_USE_UNICODE_INTERNALS
18963         {
18964             Py_hash_t hash1, hash2;
18965         #if CYTHON_PEP393_ENABLED
18966             hash1 = ((PyASCIIObject*)s1)->hash;
18967             hash2 = ((PyASCIIObject*)s2)->hash;
18968         #else
18969             hash1 = ((PyUnicodeObject*)s1)->hash;
18970             hash2 = ((PyUnicodeObject*)s2)->hash;
18971         #endif
18972             if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
18973                 goto return_ne;
18974             }
18975         }
18976 #endif
18977         kind = __Pyx_PyUnicode_KIND(s1);
18978         if (kind != __Pyx_PyUnicode_KIND(s2)) {
18979             goto return_ne;
18980         }
18981         data1 = __Pyx_PyUnicode_DATA(s1);
18982         data2 = __Pyx_PyUnicode_DATA(s2);
18983         if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
18984             goto return_ne;
18985         } else if (length == 1) {
18986             goto return_eq;
18987         } else {
18988             int result = memcmp(data1, data2, (size_t)(length * kind));
18989             #if PY_MAJOR_VERSION < 3
18990             Py_XDECREF(owned_ref);
18991             #endif
18992             return (equals == Py_EQ) ? (result == 0) : (result != 0);
18993         }
18994     } else if ((s1 == Py_None) & s2_is_unicode) {
18995         goto return_ne;
18996     } else if ((s2 == Py_None) & s1_is_unicode) {
18997         goto return_ne;
18998     } else {
18999         int result;
19000         PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
19001         #if PY_MAJOR_VERSION < 3
19002         Py_XDECREF(owned_ref);
19003         #endif
19004         if (!py_result)
19005             return -1;
19006         result = __Pyx_PyObject_IsTrue(py_result);
19007         Py_DECREF(py_result);
19008         return result;
19009     }
19010 return_eq:
19011     #if PY_MAJOR_VERSION < 3
19012     Py_XDECREF(owned_ref);
19013     #endif
19014     return (equals == Py_EQ);
19015 return_ne:
19016     #if PY_MAJOR_VERSION < 3
19017     Py_XDECREF(owned_ref);
19018     #endif
19019     return (equals == Py_NE);
19020 #endif
19021 }
19022 
19023 /* RaiseArgTupleInvalid */
__Pyx_RaiseArgtupleInvalid(const char * func_name,int exact,Py_ssize_t num_min,Py_ssize_t num_max,Py_ssize_t num_found)19024 static void __Pyx_RaiseArgtupleInvalid(
19025     const char* func_name,
19026     int exact,
19027     Py_ssize_t num_min,
19028     Py_ssize_t num_max,
19029     Py_ssize_t num_found)
19030 {
19031     Py_ssize_t num_expected;
19032     const char *more_or_less;
19033     if (num_found < num_min) {
19034         num_expected = num_min;
19035         more_or_less = "at least";
19036     } else {
19037         num_expected = num_max;
19038         more_or_less = "at most";
19039     }
19040     if (exact) {
19041         more_or_less = "exactly";
19042     }
19043     PyErr_Format(PyExc_TypeError,
19044                  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
19045                  func_name, more_or_less, num_expected,
19046                  (num_expected == 1) ? "" : "s", num_found);
19047 }
19048 
19049 /* RaiseDoubleKeywords */
__Pyx_RaiseDoubleKeywordsError(const char * func_name,PyObject * kw_name)19050 static void __Pyx_RaiseDoubleKeywordsError(
19051     const char* func_name,
19052     PyObject* kw_name)
19053 {
19054     PyErr_Format(PyExc_TypeError,
19055         #if PY_MAJOR_VERSION >= 3
19056         "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
19057         #else
19058         "%s() got multiple values for keyword argument '%s'", func_name,
19059         PyString_AsString(kw_name));
19060         #endif
19061 }
19062 
19063 /* ParseKeywords */
__Pyx_ParseOptionalKeywords(PyObject * kwds,PyObject ** argnames[],PyObject * kwds2,PyObject * values[],Py_ssize_t num_pos_args,const char * function_name)19064 static int __Pyx_ParseOptionalKeywords(
19065     PyObject *kwds,
19066     PyObject **argnames[],
19067     PyObject *kwds2,
19068     PyObject *values[],
19069     Py_ssize_t num_pos_args,
19070     const char* function_name)
19071 {
19072     PyObject *key = 0, *value = 0;
19073     Py_ssize_t pos = 0;
19074     PyObject*** name;
19075     PyObject*** first_kw_arg = argnames + num_pos_args;
19076     while (PyDict_Next(kwds, &pos, &key, &value)) {
19077         name = first_kw_arg;
19078         while (*name && (**name != key)) name++;
19079         if (*name) {
19080             values[name-argnames] = value;
19081             continue;
19082         }
19083         name = first_kw_arg;
19084         #if PY_MAJOR_VERSION < 3
19085         if (likely(PyString_Check(key))) {
19086             while (*name) {
19087                 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
19088                         && _PyString_Eq(**name, key)) {
19089                     values[name-argnames] = value;
19090                     break;
19091                 }
19092                 name++;
19093             }
19094             if (*name) continue;
19095             else {
19096                 PyObject*** argname = argnames;
19097                 while (argname != first_kw_arg) {
19098                     if ((**argname == key) || (
19099                             (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
19100                              && _PyString_Eq(**argname, key))) {
19101                         goto arg_passed_twice;
19102                     }
19103                     argname++;
19104                 }
19105             }
19106         } else
19107         #endif
19108         if (likely(PyUnicode_Check(key))) {
19109             while (*name) {
19110                 int cmp = (**name == key) ? 0 :
19111                 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
19112                     (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
19113                 #endif
19114                     PyUnicode_Compare(**name, key);
19115                 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
19116                 if (cmp == 0) {
19117                     values[name-argnames] = value;
19118                     break;
19119                 }
19120                 name++;
19121             }
19122             if (*name) continue;
19123             else {
19124                 PyObject*** argname = argnames;
19125                 while (argname != first_kw_arg) {
19126                     int cmp = (**argname == key) ? 0 :
19127                     #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
19128                         (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
19129                     #endif
19130                         PyUnicode_Compare(**argname, key);
19131                     if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
19132                     if (cmp == 0) goto arg_passed_twice;
19133                     argname++;
19134                 }
19135             }
19136         } else
19137             goto invalid_keyword_type;
19138         if (kwds2) {
19139             if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
19140         } else {
19141             goto invalid_keyword;
19142         }
19143     }
19144     return 0;
19145 arg_passed_twice:
19146     __Pyx_RaiseDoubleKeywordsError(function_name, key);
19147     goto bad;
19148 invalid_keyword_type:
19149     PyErr_Format(PyExc_TypeError,
19150         "%.200s() keywords must be strings", function_name);
19151     goto bad;
19152 invalid_keyword:
19153     PyErr_Format(PyExc_TypeError,
19154     #if PY_MAJOR_VERSION < 3
19155         "%.200s() got an unexpected keyword argument '%.200s'",
19156         function_name, PyString_AsString(key));
19157     #else
19158         "%s() got an unexpected keyword argument '%U'",
19159         function_name, key);
19160     #endif
19161 bad:
19162     return -1;
19163 }
19164 
19165 /* GetTopmostException */
19166 #if CYTHON_USE_EXC_INFO_STACK
19167 static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState * tstate)19168 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
19169 {
19170     _PyErr_StackItem *exc_info = tstate->exc_info;
19171     while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
19172            exc_info->previous_item != NULL)
19173     {
19174         exc_info = exc_info->previous_item;
19175     }
19176     return exc_info;
19177 }
19178 #endif
19179 
19180 /* SaveResetException */
19181 #if CYTHON_FAST_THREAD_STATE
__Pyx__ExceptionSave(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)19182 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
19183     #if CYTHON_USE_EXC_INFO_STACK
19184     _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
19185     *type = exc_info->exc_type;
19186     *value = exc_info->exc_value;
19187     *tb = exc_info->exc_traceback;
19188     #else
19189     *type = tstate->exc_type;
19190     *value = tstate->exc_value;
19191     *tb = tstate->exc_traceback;
19192     #endif
19193     Py_XINCREF(*type);
19194     Py_XINCREF(*value);
19195     Py_XINCREF(*tb);
19196 }
__Pyx__ExceptionReset(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)19197 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
19198     PyObject *tmp_type, *tmp_value, *tmp_tb;
19199     #if CYTHON_USE_EXC_INFO_STACK
19200     _PyErr_StackItem *exc_info = tstate->exc_info;
19201     tmp_type = exc_info->exc_type;
19202     tmp_value = exc_info->exc_value;
19203     tmp_tb = exc_info->exc_traceback;
19204     exc_info->exc_type = type;
19205     exc_info->exc_value = value;
19206     exc_info->exc_traceback = tb;
19207     #else
19208     tmp_type = tstate->exc_type;
19209     tmp_value = tstate->exc_value;
19210     tmp_tb = tstate->exc_traceback;
19211     tstate->exc_type = type;
19212     tstate->exc_value = value;
19213     tstate->exc_traceback = tb;
19214     #endif
19215     Py_XDECREF(tmp_type);
19216     Py_XDECREF(tmp_value);
19217     Py_XDECREF(tmp_tb);
19218 }
19219 #endif
19220 
19221 /* PyErrFetchRestore */
19222 #if CYTHON_FAST_THREAD_STATE
__Pyx_ErrRestoreInState(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)19223 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
19224     PyObject *tmp_type, *tmp_value, *tmp_tb;
19225     tmp_type = tstate->curexc_type;
19226     tmp_value = tstate->curexc_value;
19227     tmp_tb = tstate->curexc_traceback;
19228     tstate->curexc_type = type;
19229     tstate->curexc_value = value;
19230     tstate->curexc_traceback = tb;
19231     Py_XDECREF(tmp_type);
19232     Py_XDECREF(tmp_value);
19233     Py_XDECREF(tmp_tb);
19234 }
__Pyx_ErrFetchInState(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)19235 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
19236     *type = tstate->curexc_type;
19237     *value = tstate->curexc_value;
19238     *tb = tstate->curexc_traceback;
19239     tstate->curexc_type = 0;
19240     tstate->curexc_value = 0;
19241     tstate->curexc_traceback = 0;
19242 }
19243 #endif
19244 
19245 /* FastTypeChecks */
19246 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_InBases(PyTypeObject * a,PyTypeObject * b)19247 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
19248     while (a) {
19249         a = a->tp_base;
19250         if (a == b)
19251             return 1;
19252     }
19253     return b == &PyBaseObject_Type;
19254 }
__Pyx_IsSubtype(PyTypeObject * a,PyTypeObject * b)19255 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
19256     PyObject *mro;
19257     if (a == b) return 1;
19258     mro = a->tp_mro;
19259     if (likely(mro)) {
19260         Py_ssize_t i, n;
19261         n = PyTuple_GET_SIZE(mro);
19262         for (i = 0; i < n; i++) {
19263             if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
19264                 return 1;
19265         }
19266         return 0;
19267     }
19268     return __Pyx_InBases(a, b);
19269 }
19270 #if PY_MAJOR_VERSION == 2
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)19271 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
19272     PyObject *exception, *value, *tb;
19273     int res;
19274     __Pyx_PyThreadState_declare
19275     __Pyx_PyThreadState_assign
19276     __Pyx_ErrFetch(&exception, &value, &tb);
19277     res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
19278     if (unlikely(res == -1)) {
19279         PyErr_WriteUnraisable(err);
19280         res = 0;
19281     }
19282     if (!res) {
19283         res = PyObject_IsSubclass(err, exc_type2);
19284         if (unlikely(res == -1)) {
19285             PyErr_WriteUnraisable(err);
19286             res = 0;
19287         }
19288     }
19289     __Pyx_ErrRestore(exception, value, tb);
19290     return res;
19291 }
19292 #else
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)19293 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
19294     int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
19295     if (!res) {
19296         res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
19297     }
19298     return res;
19299 }
19300 #endif
__Pyx_PyErr_GivenExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)19301 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
19302     Py_ssize_t i, n;
19303     assert(PyExceptionClass_Check(exc_type));
19304     n = PyTuple_GET_SIZE(tuple);
19305 #if PY_MAJOR_VERSION >= 3
19306     for (i=0; i<n; i++) {
19307         if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
19308     }
19309 #endif
19310     for (i=0; i<n; i++) {
19311         PyObject *t = PyTuple_GET_ITEM(tuple, i);
19312         #if PY_MAJOR_VERSION < 3
19313         if (likely(exc_type == t)) return 1;
19314         #endif
19315         if (likely(PyExceptionClass_Check(t))) {
19316             if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
19317         } else {
19318         }
19319     }
19320     return 0;
19321 }
__Pyx_PyErr_GivenExceptionMatches(PyObject * err,PyObject * exc_type)19322 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
19323     if (likely(err == exc_type)) return 1;
19324     if (likely(PyExceptionClass_Check(err))) {
19325         if (likely(PyExceptionClass_Check(exc_type))) {
19326             return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
19327         } else if (likely(PyTuple_Check(exc_type))) {
19328             return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
19329         } else {
19330         }
19331     }
19332     return PyErr_GivenExceptionMatches(err, exc_type);
19333 }
__Pyx_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)19334 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
19335     assert(PyExceptionClass_Check(exc_type1));
19336     assert(PyExceptionClass_Check(exc_type2));
19337     if (likely(err == exc_type1 || err == exc_type2)) return 1;
19338     if (likely(PyExceptionClass_Check(err))) {
19339         return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
19340     }
19341     return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
19342 }
19343 #endif
19344 
19345 /* PyDictVersioning */
19346 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
__Pyx_get_tp_dict_version(PyObject * obj)19347 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
19348     PyObject *dict = Py_TYPE(obj)->tp_dict;
19349     return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
19350 }
__Pyx_get_object_dict_version(PyObject * obj)19351 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
19352     PyObject **dictptr = NULL;
19353     Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
19354     if (offset) {
19355 #if CYTHON_COMPILING_IN_CPYTHON
19356         dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
19357 #else
19358         dictptr = _PyObject_GetDictPtr(obj);
19359 #endif
19360     }
19361     return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
19362 }
__Pyx_object_dict_version_matches(PyObject * obj,PY_UINT64_T tp_dict_version,PY_UINT64_T obj_dict_version)19363 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
19364     PyObject *dict = Py_TYPE(obj)->tp_dict;
19365     if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
19366         return 0;
19367     return obj_dict_version == __Pyx_get_object_dict_version(obj);
19368 }
19369 #endif
19370 
19371 /* GetModuleGlobalName */
19372 #if CYTHON_USE_DICT_VERSIONS
__Pyx__GetModuleGlobalName(PyObject * name,PY_UINT64_T * dict_version,PyObject ** dict_cached_value)19373 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
19374 #else
19375 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
19376 #endif
19377 {
19378     PyObject *result;
19379 #if !CYTHON_AVOID_BORROWED_REFS
19380 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
19381     result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
19382     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
19383     if (likely(result)) {
19384         return __Pyx_NewRef(result);
19385     } else if (unlikely(PyErr_Occurred())) {
19386         return NULL;
19387     }
19388 #else
19389     result = PyDict_GetItem(__pyx_d, name);
19390     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
19391     if (likely(result)) {
19392         return __Pyx_NewRef(result);
19393     }
19394 #endif
19395 #else
19396     result = PyObject_GetItem(__pyx_d, name);
19397     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
19398     if (likely(result)) {
19399         return __Pyx_NewRef(result);
19400     }
19401     PyErr_Clear();
19402 #endif
19403     return __Pyx_GetBuiltinName(name);
19404 }
19405 
19406 /* PyCFunctionFastCall */
19407 #if CYTHON_FAST_PYCCALL
__Pyx_PyCFunction_FastCall(PyObject * func_obj,PyObject ** args,Py_ssize_t nargs)19408 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
19409     PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
19410     PyCFunction meth = PyCFunction_GET_FUNCTION(func);
19411     PyObject *self = PyCFunction_GET_SELF(func);
19412     int flags = PyCFunction_GET_FLAGS(func);
19413     assert(PyCFunction_Check(func));
19414     assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
19415     assert(nargs >= 0);
19416     assert(nargs == 0 || args != NULL);
19417     /* _PyCFunction_FastCallDict() must not be called with an exception set,
19418        because it may clear it (directly or indirectly) and so the
19419        caller loses its exception */
19420     assert(!PyErr_Occurred());
19421     if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
19422         return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
19423     } else {
19424         return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
19425     }
19426 }
19427 #endif
19428 
19429 /* PyFunctionFastCall */
19430 #if CYTHON_FAST_PYCALL
__Pyx_PyFunction_FastCallNoKw(PyCodeObject * co,PyObject ** args,Py_ssize_t na,PyObject * globals)19431 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
19432                                                PyObject *globals) {
19433     PyFrameObject *f;
19434     PyThreadState *tstate = __Pyx_PyThreadState_Current;
19435     PyObject **fastlocals;
19436     Py_ssize_t i;
19437     PyObject *result;
19438     assert(globals != NULL);
19439     /* XXX Perhaps we should create a specialized
19440        PyFrame_New() that doesn't take locals, but does
19441        take builtins without sanity checking them.
19442        */
19443     assert(tstate != NULL);
19444     f = PyFrame_New(tstate, co, globals, NULL);
19445     if (f == NULL) {
19446         return NULL;
19447     }
19448     fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
19449     for (i = 0; i < na; i++) {
19450         Py_INCREF(*args);
19451         fastlocals[i] = *args++;
19452     }
19453     result = PyEval_EvalFrameEx(f,0);
19454     ++tstate->recursion_depth;
19455     Py_DECREF(f);
19456     --tstate->recursion_depth;
19457     return result;
19458 }
19459 #if 1 || PY_VERSION_HEX < 0x030600B1
__Pyx_PyFunction_FastCallDict(PyObject * func,PyObject ** args,Py_ssize_t nargs,PyObject * kwargs)19460 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
19461     PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
19462     PyObject *globals = PyFunction_GET_GLOBALS(func);
19463     PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
19464     PyObject *closure;
19465 #if PY_MAJOR_VERSION >= 3
19466     PyObject *kwdefs;
19467 #endif
19468     PyObject *kwtuple, **k;
19469     PyObject **d;
19470     Py_ssize_t nd;
19471     Py_ssize_t nk;
19472     PyObject *result;
19473     assert(kwargs == NULL || PyDict_Check(kwargs));
19474     nk = kwargs ? PyDict_Size(kwargs) : 0;
19475     if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
19476         return NULL;
19477     }
19478     if (
19479 #if PY_MAJOR_VERSION >= 3
19480             co->co_kwonlyargcount == 0 &&
19481 #endif
19482             likely(kwargs == NULL || nk == 0) &&
19483             co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
19484         if (argdefs == NULL && co->co_argcount == nargs) {
19485             result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
19486             goto done;
19487         }
19488         else if (nargs == 0 && argdefs != NULL
19489                  && co->co_argcount == Py_SIZE(argdefs)) {
19490             /* function called with no arguments, but all parameters have
19491                a default value: use default values as arguments .*/
19492             args = &PyTuple_GET_ITEM(argdefs, 0);
19493             result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
19494             goto done;
19495         }
19496     }
19497     if (kwargs != NULL) {
19498         Py_ssize_t pos, i;
19499         kwtuple = PyTuple_New(2 * nk);
19500         if (kwtuple == NULL) {
19501             result = NULL;
19502             goto done;
19503         }
19504         k = &PyTuple_GET_ITEM(kwtuple, 0);
19505         pos = i = 0;
19506         while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
19507             Py_INCREF(k[i]);
19508             Py_INCREF(k[i+1]);
19509             i += 2;
19510         }
19511         nk = i / 2;
19512     }
19513     else {
19514         kwtuple = NULL;
19515         k = NULL;
19516     }
19517     closure = PyFunction_GET_CLOSURE(func);
19518 #if PY_MAJOR_VERSION >= 3
19519     kwdefs = PyFunction_GET_KW_DEFAULTS(func);
19520 #endif
19521     if (argdefs != NULL) {
19522         d = &PyTuple_GET_ITEM(argdefs, 0);
19523         nd = Py_SIZE(argdefs);
19524     }
19525     else {
19526         d = NULL;
19527         nd = 0;
19528     }
19529 #if PY_MAJOR_VERSION >= 3
19530     result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
19531                                args, (int)nargs,
19532                                k, (int)nk,
19533                                d, (int)nd, kwdefs, closure);
19534 #else
19535     result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
19536                                args, (int)nargs,
19537                                k, (int)nk,
19538                                d, (int)nd, closure);
19539 #endif
19540     Py_XDECREF(kwtuple);
19541 done:
19542     Py_LeaveRecursiveCall();
19543     return result;
19544 }
19545 #endif
19546 #endif
19547 
19548 /* PyObjectCall */
19549 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_Call(PyObject * func,PyObject * arg,PyObject * kw)19550 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
19551     PyObject *result;
19552     ternaryfunc call = func->ob_type->tp_call;
19553     if (unlikely(!call))
19554         return PyObject_Call(func, arg, kw);
19555     if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
19556         return NULL;
19557     result = (*call)(func, arg, kw);
19558     Py_LeaveRecursiveCall();
19559     if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
19560         PyErr_SetString(
19561             PyExc_SystemError,
19562             "NULL result without error in PyObject_Call");
19563     }
19564     return result;
19565 }
19566 #endif
19567 
19568 /* PyObjectCall2Args */
__Pyx_PyObject_Call2Args(PyObject * function,PyObject * arg1,PyObject * arg2)19569 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
19570     PyObject *args, *result = NULL;
19571     #if CYTHON_FAST_PYCALL
19572     if (PyFunction_Check(function)) {
19573         PyObject *args[2] = {arg1, arg2};
19574         return __Pyx_PyFunction_FastCall(function, args, 2);
19575     }
19576     #endif
19577     #if CYTHON_FAST_PYCCALL
19578     if (__Pyx_PyFastCFunction_Check(function)) {
19579         PyObject *args[2] = {arg1, arg2};
19580         return __Pyx_PyCFunction_FastCall(function, args, 2);
19581     }
19582     #endif
19583     args = PyTuple_New(2);
19584     if (unlikely(!args)) goto done;
19585     Py_INCREF(arg1);
19586     PyTuple_SET_ITEM(args, 0, arg1);
19587     Py_INCREF(arg2);
19588     PyTuple_SET_ITEM(args, 1, arg2);
19589     Py_INCREF(function);
19590     result = __Pyx_PyObject_Call(function, args, NULL);
19591     Py_DECREF(args);
19592     Py_DECREF(function);
19593 done:
19594     return result;
19595 }
19596 
19597 /* PyObjectCallMethO */
19598 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_CallMethO(PyObject * func,PyObject * arg)19599 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
19600     PyObject *self, *result;
19601     PyCFunction cfunc;
19602     cfunc = PyCFunction_GET_FUNCTION(func);
19603     self = PyCFunction_GET_SELF(func);
19604     if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
19605         return NULL;
19606     result = cfunc(self, arg);
19607     Py_LeaveRecursiveCall();
19608     if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
19609         PyErr_SetString(
19610             PyExc_SystemError,
19611             "NULL result without error in PyObject_Call");
19612     }
19613     return result;
19614 }
19615 #endif
19616 
19617 /* PyObjectCallOneArg */
19618 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx__PyObject_CallOneArg(PyObject * func,PyObject * arg)19619 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
19620     PyObject *result;
19621     PyObject *args = PyTuple_New(1);
19622     if (unlikely(!args)) return NULL;
19623     Py_INCREF(arg);
19624     PyTuple_SET_ITEM(args, 0, arg);
19625     result = __Pyx_PyObject_Call(func, args, NULL);
19626     Py_DECREF(args);
19627     return result;
19628 }
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)19629 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
19630 #if CYTHON_FAST_PYCALL
19631     if (PyFunction_Check(func)) {
19632         return __Pyx_PyFunction_FastCall(func, &arg, 1);
19633     }
19634 #endif
19635     if (likely(PyCFunction_Check(func))) {
19636         if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
19637             return __Pyx_PyObject_CallMethO(func, arg);
19638 #if CYTHON_FAST_PYCCALL
19639         } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
19640             return __Pyx_PyCFunction_FastCall(func, &arg, 1);
19641 #endif
19642         }
19643     }
19644     return __Pyx__PyObject_CallOneArg(func, arg);
19645 }
19646 #else
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)19647 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
19648     PyObject *result;
19649     PyObject *args = PyTuple_Pack(1, arg);
19650     if (unlikely(!args)) return NULL;
19651     result = __Pyx_PyObject_Call(func, args, NULL);
19652     Py_DECREF(args);
19653     return result;
19654 }
19655 #endif
19656 
19657 /* RaiseException */
19658 #if PY_MAJOR_VERSION < 3
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,CYTHON_UNUSED PyObject * cause)19659 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
19660                         CYTHON_UNUSED PyObject *cause) {
19661     __Pyx_PyThreadState_declare
19662     Py_XINCREF(type);
19663     if (!value || value == Py_None)
19664         value = NULL;
19665     else
19666         Py_INCREF(value);
19667     if (!tb || tb == Py_None)
19668         tb = NULL;
19669     else {
19670         Py_INCREF(tb);
19671         if (!PyTraceBack_Check(tb)) {
19672             PyErr_SetString(PyExc_TypeError,
19673                 "raise: arg 3 must be a traceback or None");
19674             goto raise_error;
19675         }
19676     }
19677     if (PyType_Check(type)) {
19678 #if CYTHON_COMPILING_IN_PYPY
19679         if (!value) {
19680             Py_INCREF(Py_None);
19681             value = Py_None;
19682         }
19683 #endif
19684         PyErr_NormalizeException(&type, &value, &tb);
19685     } else {
19686         if (value) {
19687             PyErr_SetString(PyExc_TypeError,
19688                 "instance exception may not have a separate value");
19689             goto raise_error;
19690         }
19691         value = type;
19692         type = (PyObject*) Py_TYPE(type);
19693         Py_INCREF(type);
19694         if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
19695             PyErr_SetString(PyExc_TypeError,
19696                 "raise: exception class must be a subclass of BaseException");
19697             goto raise_error;
19698         }
19699     }
19700     __Pyx_PyThreadState_assign
19701     __Pyx_ErrRestore(type, value, tb);
19702     return;
19703 raise_error:
19704     Py_XDECREF(value);
19705     Py_XDECREF(type);
19706     Py_XDECREF(tb);
19707     return;
19708 }
19709 #else
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,PyObject * cause)19710 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
19711     PyObject* owned_instance = NULL;
19712     if (tb == Py_None) {
19713         tb = 0;
19714     } else if (tb && !PyTraceBack_Check(tb)) {
19715         PyErr_SetString(PyExc_TypeError,
19716             "raise: arg 3 must be a traceback or None");
19717         goto bad;
19718     }
19719     if (value == Py_None)
19720         value = 0;
19721     if (PyExceptionInstance_Check(type)) {
19722         if (value) {
19723             PyErr_SetString(PyExc_TypeError,
19724                 "instance exception may not have a separate value");
19725             goto bad;
19726         }
19727         value = type;
19728         type = (PyObject*) Py_TYPE(value);
19729     } else if (PyExceptionClass_Check(type)) {
19730         PyObject *instance_class = NULL;
19731         if (value && PyExceptionInstance_Check(value)) {
19732             instance_class = (PyObject*) Py_TYPE(value);
19733             if (instance_class != type) {
19734                 int is_subclass = PyObject_IsSubclass(instance_class, type);
19735                 if (!is_subclass) {
19736                     instance_class = NULL;
19737                 } else if (unlikely(is_subclass == -1)) {
19738                     goto bad;
19739                 } else {
19740                     type = instance_class;
19741                 }
19742             }
19743         }
19744         if (!instance_class) {
19745             PyObject *args;
19746             if (!value)
19747                 args = PyTuple_New(0);
19748             else if (PyTuple_Check(value)) {
19749                 Py_INCREF(value);
19750                 args = value;
19751             } else
19752                 args = PyTuple_Pack(1, value);
19753             if (!args)
19754                 goto bad;
19755             owned_instance = PyObject_Call(type, args, NULL);
19756             Py_DECREF(args);
19757             if (!owned_instance)
19758                 goto bad;
19759             value = owned_instance;
19760             if (!PyExceptionInstance_Check(value)) {
19761                 PyErr_Format(PyExc_TypeError,
19762                              "calling %R should have returned an instance of "
19763                              "BaseException, not %R",
19764                              type, Py_TYPE(value));
19765                 goto bad;
19766             }
19767         }
19768     } else {
19769         PyErr_SetString(PyExc_TypeError,
19770             "raise: exception class must be a subclass of BaseException");
19771         goto bad;
19772     }
19773     if (cause) {
19774         PyObject *fixed_cause;
19775         if (cause == Py_None) {
19776             fixed_cause = NULL;
19777         } else if (PyExceptionClass_Check(cause)) {
19778             fixed_cause = PyObject_CallObject(cause, NULL);
19779             if (fixed_cause == NULL)
19780                 goto bad;
19781         } else if (PyExceptionInstance_Check(cause)) {
19782             fixed_cause = cause;
19783             Py_INCREF(fixed_cause);
19784         } else {
19785             PyErr_SetString(PyExc_TypeError,
19786                             "exception causes must derive from "
19787                             "BaseException");
19788             goto bad;
19789         }
19790         PyException_SetCause(value, fixed_cause);
19791     }
19792     PyErr_SetObject(type, value);
19793     if (tb) {
19794 #if CYTHON_COMPILING_IN_PYPY
19795         PyObject *tmp_type, *tmp_value, *tmp_tb;
19796         PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
19797         Py_INCREF(tb);
19798         PyErr_Restore(tmp_type, tmp_value, tb);
19799         Py_XDECREF(tmp_tb);
19800 #else
19801         PyThreadState *tstate = __Pyx_PyThreadState_Current;
19802         PyObject* tmp_tb = tstate->curexc_traceback;
19803         if (tb != tmp_tb) {
19804             Py_INCREF(tb);
19805             tstate->curexc_traceback = tb;
19806             Py_XDECREF(tmp_tb);
19807         }
19808 #endif
19809     }
19810 bad:
19811     Py_XDECREF(owned_instance);
19812     return;
19813 }
19814 #endif
19815 
19816 /* DictGetItem */
19817 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
__Pyx_PyDict_GetItem(PyObject * d,PyObject * key)19818 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
19819     PyObject *value;
19820     value = PyDict_GetItemWithError(d, key);
19821     if (unlikely(!value)) {
19822         if (!PyErr_Occurred()) {
19823             if (unlikely(PyTuple_Check(key))) {
19824                 PyObject* args = PyTuple_Pack(1, key);
19825                 if (likely(args)) {
19826                     PyErr_SetObject(PyExc_KeyError, args);
19827                     Py_DECREF(args);
19828                 }
19829             } else {
19830                 PyErr_SetObject(PyExc_KeyError, key);
19831             }
19832         }
19833         return NULL;
19834     }
19835     Py_INCREF(value);
19836     return value;
19837 }
19838 #endif
19839 
19840 /* bytes_index */
__Pyx_PyBytes_GetItemInt(PyObject * bytes,Py_ssize_t index,int check_bounds)19841 static CYTHON_INLINE char __Pyx_PyBytes_GetItemInt(PyObject* bytes, Py_ssize_t index, int check_bounds) {
19842     if (index < 0)
19843         index += PyBytes_GET_SIZE(bytes);
19844     if (check_bounds) {
19845         Py_ssize_t size = PyBytes_GET_SIZE(bytes);
19846         if (unlikely(!__Pyx_is_valid_index(index, size))) {
19847             PyErr_SetString(PyExc_IndexError, "string index out of range");
19848             return (char) -1;
19849         }
19850     }
19851     return PyBytes_AS_STRING(bytes)[index];
19852 }
19853 
19854 /* PyIntBinop */
19855 #if !CYTHON_COMPILING_IN_PYPY
19856 #if PY_MAJOR_VERSION < 3 || CYTHON_USE_PYLONG_INTERNALS
19857 #define __Pyx_PyInt_RemainderObjC_ZeroDivisionError(operand)\
19858     if (unlikely(zerodivision_check && ((operand) == 0))) {\
19859         PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");\
19860         return NULL;\
19861     }
19862 #endif
__Pyx_PyInt_RemainderObjC(PyObject * op1,PyObject * op2,CYTHON_UNUSED long intval,int inplace,int zerodivision_check)19863 static PyObject* __Pyx_PyInt_RemainderObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
19864     (void)inplace;
19865     (void)zerodivision_check;
19866     #if PY_MAJOR_VERSION < 3
19867     if (likely(PyInt_CheckExact(op1))) {
19868         const long b = intval;
19869         long x;
19870         long a = PyInt_AS_LONG(op1);
19871             __Pyx_PyInt_RemainderObjC_ZeroDivisionError(b)
19872             x = a % b;
19873             x += ((x != 0) & ((x ^ b) < 0)) * b;
19874             return PyInt_FromLong(x);
19875     }
19876     #endif
19877     #if CYTHON_USE_PYLONG_INTERNALS
19878     if (likely(PyLong_CheckExact(op1))) {
19879         const long b = intval;
19880         long a, x;
19881 #ifdef HAVE_LONG_LONG
19882         const PY_LONG_LONG llb = intval;
19883         PY_LONG_LONG lla, llx;
19884 #endif
19885         const digit* digits = ((PyLongObject*)op1)->ob_digit;
19886         const Py_ssize_t size = Py_SIZE(op1);
19887         if (likely(__Pyx_sst_abs(size) <= 1)) {
19888             a = likely(size) ? digits[0] : 0;
19889             if (size == -1) a = -a;
19890         } else {
19891             switch (size) {
19892                 case -2:
19893                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
19894                         a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
19895                         break;
19896 #ifdef HAVE_LONG_LONG
19897                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
19898                         lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
19899                         goto long_long;
19900 #endif
19901                     }
19902                     CYTHON_FALLTHROUGH;
19903                 case 2:
19904                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
19905                         a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
19906                         break;
19907 #ifdef HAVE_LONG_LONG
19908                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
19909                         lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
19910                         goto long_long;
19911 #endif
19912                     }
19913                     CYTHON_FALLTHROUGH;
19914                 case -3:
19915                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
19916                         a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
19917                         break;
19918 #ifdef HAVE_LONG_LONG
19919                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
19920                         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]));
19921                         goto long_long;
19922 #endif
19923                     }
19924                     CYTHON_FALLTHROUGH;
19925                 case 3:
19926                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
19927                         a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
19928                         break;
19929 #ifdef HAVE_LONG_LONG
19930                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
19931                         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]));
19932                         goto long_long;
19933 #endif
19934                     }
19935                     CYTHON_FALLTHROUGH;
19936                 case -4:
19937                     if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
19938                         a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
19939                         break;
19940 #ifdef HAVE_LONG_LONG
19941                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
19942                         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]));
19943                         goto long_long;
19944 #endif
19945                     }
19946                     CYTHON_FALLTHROUGH;
19947                 case 4:
19948                     if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
19949                         a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
19950                         break;
19951 #ifdef HAVE_LONG_LONG
19952                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
19953                         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]));
19954                         goto long_long;
19955 #endif
19956                     }
19957                     CYTHON_FALLTHROUGH;
19958                 default: return PyLong_Type.tp_as_number->nb_remainder(op1, op2);
19959             }
19960         }
19961                 __Pyx_PyInt_RemainderObjC_ZeroDivisionError(b)
19962                 x = a % b;
19963                 x += ((x != 0) & ((x ^ b) < 0)) * b;
19964             return PyLong_FromLong(x);
19965 #ifdef HAVE_LONG_LONG
19966         long_long:
19967                 llx = lla % llb;
19968                 llx += ((llx != 0) & ((llx ^ llb) < 0)) * llb;
19969             return PyLong_FromLongLong(llx);
19970 #endif
19971 
19972 
19973     }
19974     #endif
19975     return (inplace ? PyNumber_InPlaceRemainder : PyNumber_Remainder)(op1, op2);
19976 }
19977 #endif
19978 
19979 /* PyObjectSetAttrStr */
19980 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_SetAttrStr(PyObject * obj,PyObject * attr_name,PyObject * value)19981 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
19982     PyTypeObject* tp = Py_TYPE(obj);
19983     if (likely(tp->tp_setattro))
19984         return tp->tp_setattro(obj, attr_name, value);
19985 #if PY_MAJOR_VERSION < 3
19986     if (likely(tp->tp_setattr))
19987         return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
19988 #endif
19989     return PyObject_SetAttr(obj, attr_name, value);
19990 }
19991 #endif
19992 
19993 /* GetItemInt */
__Pyx_GetItemInt_Generic(PyObject * o,PyObject * j)19994 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
19995     PyObject *r;
19996     if (!j) return NULL;
19997     r = PyObject_GetItem(o, j);
19998     Py_DECREF(j);
19999     return r;
20000 }
__Pyx_GetItemInt_List_Fast(PyObject * o,Py_ssize_t i,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)20001 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
20002                                                               CYTHON_NCP_UNUSED int wraparound,
20003                                                               CYTHON_NCP_UNUSED int boundscheck) {
20004 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
20005     Py_ssize_t wrapped_i = i;
20006     if (wraparound & unlikely(i < 0)) {
20007         wrapped_i += PyList_GET_SIZE(o);
20008     }
20009     if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
20010         PyObject *r = PyList_GET_ITEM(o, wrapped_i);
20011         Py_INCREF(r);
20012         return r;
20013     }
20014     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
20015 #else
20016     return PySequence_GetItem(o, i);
20017 #endif
20018 }
__Pyx_GetItemInt_Tuple_Fast(PyObject * o,Py_ssize_t i,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)20019 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
20020                                                               CYTHON_NCP_UNUSED int wraparound,
20021                                                               CYTHON_NCP_UNUSED int boundscheck) {
20022 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
20023     Py_ssize_t wrapped_i = i;
20024     if (wraparound & unlikely(i < 0)) {
20025         wrapped_i += PyTuple_GET_SIZE(o);
20026     }
20027     if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
20028         PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
20029         Py_INCREF(r);
20030         return r;
20031     }
20032     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
20033 #else
20034     return PySequence_GetItem(o, i);
20035 #endif
20036 }
__Pyx_GetItemInt_Fast(PyObject * o,Py_ssize_t i,int is_list,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)20037 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
20038                                                      CYTHON_NCP_UNUSED int wraparound,
20039                                                      CYTHON_NCP_UNUSED int boundscheck) {
20040 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
20041     if (is_list || PyList_CheckExact(o)) {
20042         Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
20043         if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
20044             PyObject *r = PyList_GET_ITEM(o, n);
20045             Py_INCREF(r);
20046             return r;
20047         }
20048     }
20049     else if (PyTuple_CheckExact(o)) {
20050         Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
20051         if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
20052             PyObject *r = PyTuple_GET_ITEM(o, n);
20053             Py_INCREF(r);
20054             return r;
20055         }
20056     } else {
20057         PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
20058         if (likely(m && m->sq_item)) {
20059             if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
20060                 Py_ssize_t l = m->sq_length(o);
20061                 if (likely(l >= 0)) {
20062                     i += l;
20063                 } else {
20064                     if (!PyErr_ExceptionMatches(PyExc_OverflowError))
20065                         return NULL;
20066                     PyErr_Clear();
20067                 }
20068             }
20069             return m->sq_item(o, i);
20070         }
20071     }
20072 #else
20073     if (is_list || PySequence_Check(o)) {
20074         return PySequence_GetItem(o, i);
20075     }
20076 #endif
20077     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
20078 }
20079 
20080 /* ObjectGetItem */
20081 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetIndex(PyObject * obj,PyObject * index)20082 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
20083     PyObject *runerr;
20084     Py_ssize_t key_value;
20085     PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
20086     if (unlikely(!(m && m->sq_item))) {
20087         PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
20088         return NULL;
20089     }
20090     key_value = __Pyx_PyIndex_AsSsize_t(index);
20091     if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
20092         return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
20093     }
20094     if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
20095         PyErr_Clear();
20096         PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
20097     }
20098     return NULL;
20099 }
__Pyx_PyObject_GetItem(PyObject * obj,PyObject * key)20100 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
20101     PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
20102     if (likely(m && m->mp_subscript)) {
20103         return m->mp_subscript(obj, key);
20104     }
20105     return __Pyx_PyObject_GetIndex(obj, key);
20106 }
20107 #endif
20108 
20109 /* UnpackUnboundCMethod */
__Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction * target)20110 static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
20111     PyObject *method;
20112     method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
20113     if (unlikely(!method))
20114         return -1;
20115     target->method = method;
20116 #if CYTHON_COMPILING_IN_CPYTHON
20117     #if PY_MAJOR_VERSION >= 3
20118     if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
20119     #endif
20120     {
20121         PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
20122         target->func = descr->d_method->ml_meth;
20123         target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS);
20124     }
20125 #endif
20126     return 0;
20127 }
20128 
20129 /* CallUnboundCMethod1 */
20130 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction * cfunc,PyObject * self,PyObject * arg)20131 static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) {
20132     if (likely(cfunc->func)) {
20133         int flag = cfunc->flag;
20134         if (flag == METH_O) {
20135             return (*(cfunc->func))(self, arg);
20136         } else if (PY_VERSION_HEX >= 0x030600B1 && flag == METH_FASTCALL) {
20137             if (PY_VERSION_HEX >= 0x030700A0) {
20138                 return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1);
20139             } else {
20140                 return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL);
20141             }
20142         } else if (PY_VERSION_HEX >= 0x030700A0 && flag == (METH_FASTCALL | METH_KEYWORDS)) {
20143             return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL);
20144         }
20145     }
20146     return __Pyx__CallUnboundCMethod1(cfunc, self, arg);
20147 }
20148 #endif
__Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction * cfunc,PyObject * self,PyObject * arg)20149 static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){
20150     PyObject *args, *result = NULL;
20151     if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
20152 #if CYTHON_COMPILING_IN_CPYTHON
20153     if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
20154         args = PyTuple_New(1);
20155         if (unlikely(!args)) goto bad;
20156         Py_INCREF(arg);
20157         PyTuple_SET_ITEM(args, 0, arg);
20158         if (cfunc->flag & METH_KEYWORDS)
20159             result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL);
20160         else
20161             result = (*cfunc->func)(self, args);
20162     } else {
20163         args = PyTuple_New(2);
20164         if (unlikely(!args)) goto bad;
20165         Py_INCREF(self);
20166         PyTuple_SET_ITEM(args, 0, self);
20167         Py_INCREF(arg);
20168         PyTuple_SET_ITEM(args, 1, arg);
20169         result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
20170     }
20171 #else
20172     args = PyTuple_Pack(2, self, arg);
20173     if (unlikely(!args)) goto bad;
20174     result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
20175 #endif
20176 bad:
20177     Py_XDECREF(args);
20178     return result;
20179 }
20180 
20181 /* CallUnboundCMethod2 */
20182 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1
__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction * cfunc,PyObject * self,PyObject * arg1,PyObject * arg2)20183 static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) {
20184     if (likely(cfunc->func)) {
20185         PyObject *args[2] = {arg1, arg2};
20186         if (cfunc->flag == METH_FASTCALL) {
20187             #if PY_VERSION_HEX >= 0x030700A0
20188             return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, args, 2);
20189             #else
20190             return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL);
20191             #endif
20192         }
20193         #if PY_VERSION_HEX >= 0x030700A0
20194         if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
20195             return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL);
20196         #endif
20197     }
20198     return __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
20199 }
20200 #endif
__Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction * cfunc,PyObject * self,PyObject * arg1,PyObject * arg2)20201 static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){
20202     PyObject *args, *result = NULL;
20203     if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
20204 #if CYTHON_COMPILING_IN_CPYTHON
20205     if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
20206         args = PyTuple_New(2);
20207         if (unlikely(!args)) goto bad;
20208         Py_INCREF(arg1);
20209         PyTuple_SET_ITEM(args, 0, arg1);
20210         Py_INCREF(arg2);
20211         PyTuple_SET_ITEM(args, 1, arg2);
20212         if (cfunc->flag & METH_KEYWORDS)
20213             result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL);
20214         else
20215             result = (*cfunc->func)(self, args);
20216     } else {
20217         args = PyTuple_New(3);
20218         if (unlikely(!args)) goto bad;
20219         Py_INCREF(self);
20220         PyTuple_SET_ITEM(args, 0, self);
20221         Py_INCREF(arg1);
20222         PyTuple_SET_ITEM(args, 1, arg1);
20223         Py_INCREF(arg2);
20224         PyTuple_SET_ITEM(args, 2, arg2);
20225         result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
20226     }
20227 #else
20228     args = PyTuple_Pack(3, self, arg1, arg2);
20229     if (unlikely(!args)) goto bad;
20230     result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
20231 #endif
20232 bad:
20233     Py_XDECREF(args);
20234     return result;
20235 }
20236 
20237 /* dict_getitem_default */
__Pyx_PyDict_GetItemDefault(PyObject * d,PyObject * key,PyObject * default_value)20238 static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) {
20239     PyObject* value;
20240 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
20241     value = PyDict_GetItemWithError(d, key);
20242     if (unlikely(!value)) {
20243         if (unlikely(PyErr_Occurred()))
20244             return NULL;
20245         value = default_value;
20246     }
20247     Py_INCREF(value);
20248     if ((1));
20249 #else
20250     if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) {
20251         value = PyDict_GetItem(d, key);
20252         if (unlikely(!value)) {
20253             value = default_value;
20254         }
20255         Py_INCREF(value);
20256     }
20257 #endif
20258     else {
20259         if (default_value == Py_None)
20260             value = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_get, d, key);
20261         else
20262             value = __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyDict_Type_get, d, key, default_value);
20263     }
20264     return value;
20265 }
20266 
20267 /* RaiseTooManyValuesToUnpack */
__Pyx_RaiseTooManyValuesError(Py_ssize_t expected)20268 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
20269     PyErr_Format(PyExc_ValueError,
20270                  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
20271 }
20272 
20273 /* RaiseNeedMoreValuesToUnpack */
__Pyx_RaiseNeedMoreValuesError(Py_ssize_t index)20274 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
20275     PyErr_Format(PyExc_ValueError,
20276                  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
20277                  index, (index == 1) ? "" : "s");
20278 }
20279 
20280 /* IterFinish */
__Pyx_IterFinish(void)20281 static CYTHON_INLINE int __Pyx_IterFinish(void) {
20282 #if CYTHON_FAST_THREAD_STATE
20283     PyThreadState *tstate = __Pyx_PyThreadState_Current;
20284     PyObject* exc_type = tstate->curexc_type;
20285     if (unlikely(exc_type)) {
20286         if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
20287             PyObject *exc_value, *exc_tb;
20288             exc_value = tstate->curexc_value;
20289             exc_tb = tstate->curexc_traceback;
20290             tstate->curexc_type = 0;
20291             tstate->curexc_value = 0;
20292             tstate->curexc_traceback = 0;
20293             Py_DECREF(exc_type);
20294             Py_XDECREF(exc_value);
20295             Py_XDECREF(exc_tb);
20296             return 0;
20297         } else {
20298             return -1;
20299         }
20300     }
20301     return 0;
20302 #else
20303     if (unlikely(PyErr_Occurred())) {
20304         if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
20305             PyErr_Clear();
20306             return 0;
20307         } else {
20308             return -1;
20309         }
20310     }
20311     return 0;
20312 #endif
20313 }
20314 
20315 /* UnpackItemEndCheck */
__Pyx_IternextUnpackEndCheck(PyObject * retval,Py_ssize_t expected)20316 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
20317     if (unlikely(retval)) {
20318         Py_DECREF(retval);
20319         __Pyx_RaiseTooManyValuesError(expected);
20320         return -1;
20321     } else {
20322         return __Pyx_IterFinish();
20323     }
20324     return 0;
20325 }
20326 
20327 /* GetException */
20328 #if CYTHON_FAST_THREAD_STATE
__Pyx__GetException(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)20329 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
20330 #else
20331 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
20332 #endif
20333 {
20334     PyObject *local_type, *local_value, *local_tb;
20335 #if CYTHON_FAST_THREAD_STATE
20336     PyObject *tmp_type, *tmp_value, *tmp_tb;
20337     local_type = tstate->curexc_type;
20338     local_value = tstate->curexc_value;
20339     local_tb = tstate->curexc_traceback;
20340     tstate->curexc_type = 0;
20341     tstate->curexc_value = 0;
20342     tstate->curexc_traceback = 0;
20343 #else
20344     PyErr_Fetch(&local_type, &local_value, &local_tb);
20345 #endif
20346     PyErr_NormalizeException(&local_type, &local_value, &local_tb);
20347 #if CYTHON_FAST_THREAD_STATE
20348     if (unlikely(tstate->curexc_type))
20349 #else
20350     if (unlikely(PyErr_Occurred()))
20351 #endif
20352         goto bad;
20353     #if PY_MAJOR_VERSION >= 3
20354     if (local_tb) {
20355         if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
20356             goto bad;
20357     }
20358     #endif
20359     Py_XINCREF(local_tb);
20360     Py_XINCREF(local_type);
20361     Py_XINCREF(local_value);
20362     *type = local_type;
20363     *value = local_value;
20364     *tb = local_tb;
20365 #if CYTHON_FAST_THREAD_STATE
20366     #if CYTHON_USE_EXC_INFO_STACK
20367     {
20368         _PyErr_StackItem *exc_info = tstate->exc_info;
20369         tmp_type = exc_info->exc_type;
20370         tmp_value = exc_info->exc_value;
20371         tmp_tb = exc_info->exc_traceback;
20372         exc_info->exc_type = local_type;
20373         exc_info->exc_value = local_value;
20374         exc_info->exc_traceback = local_tb;
20375     }
20376     #else
20377     tmp_type = tstate->exc_type;
20378     tmp_value = tstate->exc_value;
20379     tmp_tb = tstate->exc_traceback;
20380     tstate->exc_type = local_type;
20381     tstate->exc_value = local_value;
20382     tstate->exc_traceback = local_tb;
20383     #endif
20384     Py_XDECREF(tmp_type);
20385     Py_XDECREF(tmp_value);
20386     Py_XDECREF(tmp_tb);
20387 #else
20388     PyErr_SetExcInfo(local_type, local_value, local_tb);
20389 #endif
20390     return 0;
20391 bad:
20392     *type = 0;
20393     *value = 0;
20394     *tb = 0;
20395     Py_XDECREF(local_type);
20396     Py_XDECREF(local_value);
20397     Py_XDECREF(local_tb);
20398     return -1;
20399 }
20400 
20401 /* PyIntBinop */
20402 #if !CYTHON_COMPILING_IN_PYPY
__Pyx_PyInt_SubtractObjC(PyObject * op1,PyObject * op2,CYTHON_UNUSED long intval,int inplace,int zerodivision_check)20403 static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
20404     (void)inplace;
20405     (void)zerodivision_check;
20406     #if PY_MAJOR_VERSION < 3
20407     if (likely(PyInt_CheckExact(op1))) {
20408         const long b = intval;
20409         long x;
20410         long a = PyInt_AS_LONG(op1);
20411             x = (long)((unsigned long)a - b);
20412             if (likely((x^a) >= 0 || (x^~b) >= 0))
20413                 return PyInt_FromLong(x);
20414             return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
20415     }
20416     #endif
20417     #if CYTHON_USE_PYLONG_INTERNALS
20418     if (likely(PyLong_CheckExact(op1))) {
20419         const long b = intval;
20420         long a, x;
20421 #ifdef HAVE_LONG_LONG
20422         const PY_LONG_LONG llb = intval;
20423         PY_LONG_LONG lla, llx;
20424 #endif
20425         const digit* digits = ((PyLongObject*)op1)->ob_digit;
20426         const Py_ssize_t size = Py_SIZE(op1);
20427         if (likely(__Pyx_sst_abs(size) <= 1)) {
20428             a = likely(size) ? digits[0] : 0;
20429             if (size == -1) a = -a;
20430         } else {
20431             switch (size) {
20432                 case -2:
20433                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
20434                         a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
20435                         break;
20436 #ifdef HAVE_LONG_LONG
20437                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
20438                         lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
20439                         goto long_long;
20440 #endif
20441                     }
20442                     CYTHON_FALLTHROUGH;
20443                 case 2:
20444                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
20445                         a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
20446                         break;
20447 #ifdef HAVE_LONG_LONG
20448                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
20449                         lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
20450                         goto long_long;
20451 #endif
20452                     }
20453                     CYTHON_FALLTHROUGH;
20454                 case -3:
20455                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
20456                         a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
20457                         break;
20458 #ifdef HAVE_LONG_LONG
20459                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
20460                         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]));
20461                         goto long_long;
20462 #endif
20463                     }
20464                     CYTHON_FALLTHROUGH;
20465                 case 3:
20466                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
20467                         a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
20468                         break;
20469 #ifdef HAVE_LONG_LONG
20470                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
20471                         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]));
20472                         goto long_long;
20473 #endif
20474                     }
20475                     CYTHON_FALLTHROUGH;
20476                 case -4:
20477                     if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
20478                         a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
20479                         break;
20480 #ifdef HAVE_LONG_LONG
20481                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
20482                         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]));
20483                         goto long_long;
20484 #endif
20485                     }
20486                     CYTHON_FALLTHROUGH;
20487                 case 4:
20488                     if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
20489                         a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
20490                         break;
20491 #ifdef HAVE_LONG_LONG
20492                     } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
20493                         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]));
20494                         goto long_long;
20495 #endif
20496                     }
20497                     CYTHON_FALLTHROUGH;
20498                 default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
20499             }
20500         }
20501                 x = a - b;
20502             return PyLong_FromLong(x);
20503 #ifdef HAVE_LONG_LONG
20504         long_long:
20505                 llx = lla - llb;
20506             return PyLong_FromLongLong(llx);
20507 #endif
20508 
20509 
20510     }
20511     #endif
20512     if (PyFloat_CheckExact(op1)) {
20513         const long b = intval;
20514         double a = PyFloat_AS_DOUBLE(op1);
20515             double result;
20516             PyFPE_START_PROTECT("subtract", return NULL)
20517             result = ((double)a) - (double)b;
20518             PyFPE_END_PROTECT(result)
20519             return PyFloat_FromDouble(result);
20520     }
20521     return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
20522 }
20523 #endif
20524 
20525 /* PyObjectCallNoArg */
20526 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_CallNoArg(PyObject * func)20527 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
20528 #if CYTHON_FAST_PYCALL
20529     if (PyFunction_Check(func)) {
20530         return __Pyx_PyFunction_FastCall(func, NULL, 0);
20531     }
20532 #endif
20533 #ifdef __Pyx_CyFunction_USED
20534     if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
20535 #else
20536     if (likely(PyCFunction_Check(func)))
20537 #endif
20538     {
20539         if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
20540             return __Pyx_PyObject_CallMethO(func, NULL);
20541         }
20542     }
20543     return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
20544 }
20545 #endif
20546 
20547 /* PyErrExceptionMatches */
20548 #if CYTHON_FAST_THREAD_STATE
__Pyx_PyErr_ExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)20549 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
20550     Py_ssize_t i, n;
20551     n = PyTuple_GET_SIZE(tuple);
20552 #if PY_MAJOR_VERSION >= 3
20553     for (i=0; i<n; i++) {
20554         if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
20555     }
20556 #endif
20557     for (i=0; i<n; i++) {
20558         if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
20559     }
20560     return 0;
20561 }
__Pyx_PyErr_ExceptionMatchesInState(PyThreadState * tstate,PyObject * err)20562 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
20563     PyObject *exc_type = tstate->curexc_type;
20564     if (exc_type == err) return 1;
20565     if (unlikely(!exc_type)) return 0;
20566     if (unlikely(PyTuple_Check(err)))
20567         return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
20568     return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
20569 }
20570 #endif
20571 
20572 /* Import */
__Pyx_Import(PyObject * name,PyObject * from_list,int level)20573 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
20574     PyObject *empty_list = 0;
20575     PyObject *module = 0;
20576     PyObject *global_dict = 0;
20577     PyObject *empty_dict = 0;
20578     PyObject *list;
20579     #if PY_MAJOR_VERSION < 3
20580     PyObject *py_import;
20581     py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
20582     if (!py_import)
20583         goto bad;
20584     #endif
20585     if (from_list)
20586         list = from_list;
20587     else {
20588         empty_list = PyList_New(0);
20589         if (!empty_list)
20590             goto bad;
20591         list = empty_list;
20592     }
20593     global_dict = PyModule_GetDict(__pyx_m);
20594     if (!global_dict)
20595         goto bad;
20596     empty_dict = PyDict_New();
20597     if (!empty_dict)
20598         goto bad;
20599     {
20600         #if PY_MAJOR_VERSION >= 3
20601         if (level == -1) {
20602             if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
20603                 module = PyImport_ImportModuleLevelObject(
20604                     name, global_dict, empty_dict, list, 1);
20605                 if (!module) {
20606                     if (!PyErr_ExceptionMatches(PyExc_ImportError))
20607                         goto bad;
20608                     PyErr_Clear();
20609                 }
20610             }
20611             level = 0;
20612         }
20613         #endif
20614         if (!module) {
20615             #if PY_MAJOR_VERSION < 3
20616             PyObject *py_level = PyInt_FromLong(level);
20617             if (!py_level)
20618                 goto bad;
20619             module = PyObject_CallFunctionObjArgs(py_import,
20620                 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
20621             Py_DECREF(py_level);
20622             #else
20623             module = PyImport_ImportModuleLevelObject(
20624                 name, global_dict, empty_dict, list, level);
20625             #endif
20626         }
20627     }
20628 bad:
20629     #if PY_MAJOR_VERSION < 3
20630     Py_XDECREF(py_import);
20631     #endif
20632     Py_XDECREF(empty_list);
20633     Py_XDECREF(empty_dict);
20634     return module;
20635 }
20636 
20637 /* IterNext */
__Pyx_PyIter_Next2Default(PyObject * defval)20638 static PyObject *__Pyx_PyIter_Next2Default(PyObject* defval) {
20639     PyObject* exc_type;
20640     __Pyx_PyThreadState_declare
20641     __Pyx_PyThreadState_assign
20642     exc_type = __Pyx_PyErr_Occurred();
20643     if (unlikely(exc_type)) {
20644         if (!defval || unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))
20645             return NULL;
20646         __Pyx_PyErr_Clear();
20647         Py_INCREF(defval);
20648         return defval;
20649     }
20650     if (defval) {
20651         Py_INCREF(defval);
20652         return defval;
20653     }
20654     __Pyx_PyErr_SetNone(PyExc_StopIteration);
20655     return NULL;
20656 }
__Pyx_PyIter_Next_ErrorNoIterator(PyObject * iterator)20657 static void __Pyx_PyIter_Next_ErrorNoIterator(PyObject *iterator) {
20658     PyErr_Format(PyExc_TypeError,
20659         "%.200s object is not an iterator", Py_TYPE(iterator)->tp_name);
20660 }
__Pyx_PyIter_Next2(PyObject * iterator,PyObject * defval)20661 static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject* iterator, PyObject* defval) {
20662     PyObject* next;
20663     iternextfunc iternext = Py_TYPE(iterator)->tp_iternext;
20664     if (likely(iternext)) {
20665 #if CYTHON_USE_TYPE_SLOTS
20666         next = iternext(iterator);
20667         if (likely(next))
20668             return next;
20669         #if PY_VERSION_HEX >= 0x02070000
20670         if (unlikely(iternext == &_PyObject_NextNotImplemented))
20671             return NULL;
20672         #endif
20673 #else
20674         next = PyIter_Next(iterator);
20675         if (likely(next))
20676             return next;
20677 #endif
20678     } else if (CYTHON_USE_TYPE_SLOTS || unlikely(!PyIter_Check(iterator))) {
20679         __Pyx_PyIter_Next_ErrorNoIterator(iterator);
20680         return NULL;
20681     }
20682 #if !CYTHON_USE_TYPE_SLOTS
20683     else {
20684         next = PyIter_Next(iterator);
20685         if (likely(next))
20686             return next;
20687     }
20688 #endif
20689     return __Pyx_PyIter_Next2Default(defval);
20690 }
20691 
20692 /* SwapException */
20693 #if CYTHON_FAST_THREAD_STATE
__Pyx__ExceptionSwap(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)20694 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
20695     PyObject *tmp_type, *tmp_value, *tmp_tb;
20696     #if CYTHON_USE_EXC_INFO_STACK
20697     _PyErr_StackItem *exc_info = tstate->exc_info;
20698     tmp_type = exc_info->exc_type;
20699     tmp_value = exc_info->exc_value;
20700     tmp_tb = exc_info->exc_traceback;
20701     exc_info->exc_type = *type;
20702     exc_info->exc_value = *value;
20703     exc_info->exc_traceback = *tb;
20704     #else
20705     tmp_type = tstate->exc_type;
20706     tmp_value = tstate->exc_value;
20707     tmp_tb = tstate->exc_traceback;
20708     tstate->exc_type = *type;
20709     tstate->exc_value = *value;
20710     tstate->exc_traceback = *tb;
20711     #endif
20712     *type = tmp_type;
20713     *value = tmp_value;
20714     *tb = tmp_tb;
20715 }
20716 #else
__Pyx_ExceptionSwap(PyObject ** type,PyObject ** value,PyObject ** tb)20717 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
20718     PyObject *tmp_type, *tmp_value, *tmp_tb;
20719     PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
20720     PyErr_SetExcInfo(*type, *value, *tb);
20721     *type = tmp_type;
20722     *value = tmp_value;
20723     *tb = tmp_tb;
20724 }
20725 #endif
20726 
20727 /* PyObject_GenericGetAttrNoDict */
20728 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
__Pyx_RaiseGenericGetAttributeError(PyTypeObject * tp,PyObject * attr_name)20729 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
20730     PyErr_Format(PyExc_AttributeError,
20731 #if PY_MAJOR_VERSION >= 3
20732                  "'%.50s' object has no attribute '%U'",
20733                  tp->tp_name, attr_name);
20734 #else
20735                  "'%.50s' object has no attribute '%.400s'",
20736                  tp->tp_name, PyString_AS_STRING(attr_name));
20737 #endif
20738     return NULL;
20739 }
__Pyx_PyObject_GenericGetAttrNoDict(PyObject * obj,PyObject * attr_name)20740 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
20741     PyObject *descr;
20742     PyTypeObject *tp = Py_TYPE(obj);
20743     if (unlikely(!PyString_Check(attr_name))) {
20744         return PyObject_GenericGetAttr(obj, attr_name);
20745     }
20746     assert(!tp->tp_dictoffset);
20747     descr = _PyType_Lookup(tp, attr_name);
20748     if (unlikely(!descr)) {
20749         return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
20750     }
20751     Py_INCREF(descr);
20752     #if PY_MAJOR_VERSION < 3
20753     if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
20754     #endif
20755     {
20756         descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
20757         if (unlikely(f)) {
20758             PyObject *res = f(descr, obj, (PyObject *)tp);
20759             Py_DECREF(descr);
20760             return res;
20761         }
20762     }
20763     return descr;
20764 }
20765 #endif
20766 
20767 /* ImportFrom */
__Pyx_ImportFrom(PyObject * module,PyObject * name)20768 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
20769     PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
20770     if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
20771         PyErr_Format(PyExc_ImportError,
20772         #if PY_MAJOR_VERSION < 3
20773             "cannot import name %.230s", PyString_AS_STRING(name));
20774         #else
20775             "cannot import name %S", name);
20776         #endif
20777     }
20778     return value;
20779 }
20780 
20781 /* CalculateMetaclass */
__Pyx_CalculateMetaclass(PyTypeObject * metaclass,PyObject * bases)20782 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
20783     Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
20784     for (i=0; i < nbases; i++) {
20785         PyTypeObject *tmptype;
20786         PyObject *tmp = PyTuple_GET_ITEM(bases, i);
20787         tmptype = Py_TYPE(tmp);
20788 #if PY_MAJOR_VERSION < 3
20789         if (tmptype == &PyClass_Type)
20790             continue;
20791 #endif
20792         if (!metaclass) {
20793             metaclass = tmptype;
20794             continue;
20795         }
20796         if (PyType_IsSubtype(metaclass, tmptype))
20797             continue;
20798         if (PyType_IsSubtype(tmptype, metaclass)) {
20799             metaclass = tmptype;
20800             continue;
20801         }
20802         PyErr_SetString(PyExc_TypeError,
20803                         "metaclass conflict: "
20804                         "the metaclass of a derived class "
20805                         "must be a (non-strict) subclass "
20806                         "of the metaclasses of all its bases");
20807         return NULL;
20808     }
20809     if (!metaclass) {
20810 #if PY_MAJOR_VERSION < 3
20811         metaclass = &PyClass_Type;
20812 #else
20813         metaclass = &PyType_Type;
20814 #endif
20815     }
20816     Py_INCREF((PyObject*) metaclass);
20817     return (PyObject*) metaclass;
20818 }
20819 
20820 /* Py3ClassCreate */
__Pyx_Py3MetaclassPrepare(PyObject * metaclass,PyObject * bases,PyObject * name,PyObject * qualname,PyObject * mkw,PyObject * modname,PyObject * doc)20821 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
20822                                            PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
20823     PyObject *ns;
20824     if (metaclass) {
20825         PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
20826         if (prep) {
20827             PyObject *pargs = PyTuple_Pack(2, name, bases);
20828             if (unlikely(!pargs)) {
20829                 Py_DECREF(prep);
20830                 return NULL;
20831             }
20832             ns = PyObject_Call(prep, pargs, mkw);
20833             Py_DECREF(prep);
20834             Py_DECREF(pargs);
20835         } else {
20836             if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
20837                 return NULL;
20838             PyErr_Clear();
20839             ns = PyDict_New();
20840         }
20841     } else {
20842         ns = PyDict_New();
20843     }
20844     if (unlikely(!ns))
20845         return NULL;
20846     if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
20847     if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
20848     if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
20849     return ns;
20850 bad:
20851     Py_DECREF(ns);
20852     return NULL;
20853 }
__Pyx_Py3ClassCreate(PyObject * metaclass,PyObject * name,PyObject * bases,PyObject * dict,PyObject * mkw,int calculate_metaclass,int allow_py2_metaclass)20854 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
20855                                       PyObject *dict, PyObject *mkw,
20856                                       int calculate_metaclass, int allow_py2_metaclass) {
20857     PyObject *result, *margs;
20858     PyObject *owned_metaclass = NULL;
20859     if (allow_py2_metaclass) {
20860         owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
20861         if (owned_metaclass) {
20862             metaclass = owned_metaclass;
20863         } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
20864             PyErr_Clear();
20865         } else {
20866             return NULL;
20867         }
20868     }
20869     if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
20870         metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
20871         Py_XDECREF(owned_metaclass);
20872         if (unlikely(!metaclass))
20873             return NULL;
20874         owned_metaclass = metaclass;
20875     }
20876     margs = PyTuple_Pack(3, name, bases, dict);
20877     if (unlikely(!margs)) {
20878         result = NULL;
20879     } else {
20880         result = PyObject_Call(metaclass, margs, mkw);
20881         Py_DECREF(margs);
20882     }
20883     Py_XDECREF(owned_metaclass);
20884     return result;
20885 }
20886 
20887 /* FetchCommonType */
__Pyx_FetchCommonType(PyTypeObject * type)20888 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
20889     PyObject* fake_module;
20890     PyTypeObject* cached_type = NULL;
20891     fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
20892     if (!fake_module) return NULL;
20893     Py_INCREF(fake_module);
20894     cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
20895     if (cached_type) {
20896         if (!PyType_Check((PyObject*)cached_type)) {
20897             PyErr_Format(PyExc_TypeError,
20898                 "Shared Cython type %.200s is not a type object",
20899                 type->tp_name);
20900             goto bad;
20901         }
20902         if (cached_type->tp_basicsize != type->tp_basicsize) {
20903             PyErr_Format(PyExc_TypeError,
20904                 "Shared Cython type %.200s has the wrong size, try recompiling",
20905                 type->tp_name);
20906             goto bad;
20907         }
20908     } else {
20909         if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
20910         PyErr_Clear();
20911         if (PyType_Ready(type) < 0) goto bad;
20912         if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
20913             goto bad;
20914         Py_INCREF(type);
20915         cached_type = type;
20916     }
20917 done:
20918     Py_DECREF(fake_module);
20919     return cached_type;
20920 bad:
20921     Py_XDECREF(cached_type);
20922     cached_type = NULL;
20923     goto done;
20924 }
20925 
20926 /* CythonFunctionShared */
20927 #include <structmember.h>
20928 static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject * op,CYTHON_UNUSED void * closure)20929 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
20930 {
20931     if (unlikely(op->func_doc == NULL)) {
20932         if (op->func.m_ml->ml_doc) {
20933 #if PY_MAJOR_VERSION >= 3
20934             op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
20935 #else
20936             op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
20937 #endif
20938             if (unlikely(op->func_doc == NULL))
20939                 return NULL;
20940         } else {
20941             Py_INCREF(Py_None);
20942             return Py_None;
20943         }
20944     }
20945     Py_INCREF(op->func_doc);
20946     return op->func_doc;
20947 }
20948 static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject * op,PyObject * value,CYTHON_UNUSED void * context)20949 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
20950 {
20951     PyObject *tmp = op->func_doc;
20952     if (value == NULL) {
20953         value = Py_None;
20954     }
20955     Py_INCREF(value);
20956     op->func_doc = value;
20957     Py_XDECREF(tmp);
20958     return 0;
20959 }
20960 static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject * op,CYTHON_UNUSED void * context)20961 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
20962 {
20963     if (unlikely(op->func_name == NULL)) {
20964 #if PY_MAJOR_VERSION >= 3
20965         op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
20966 #else
20967         op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
20968 #endif
20969         if (unlikely(op->func_name == NULL))
20970             return NULL;
20971     }
20972     Py_INCREF(op->func_name);
20973     return op->func_name;
20974 }
20975 static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject * op,PyObject * value,CYTHON_UNUSED void * context)20976 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
20977 {
20978     PyObject *tmp;
20979 #if PY_MAJOR_VERSION >= 3
20980     if (unlikely(value == NULL || !PyUnicode_Check(value)))
20981 #else
20982     if (unlikely(value == NULL || !PyString_Check(value)))
20983 #endif
20984     {
20985         PyErr_SetString(PyExc_TypeError,
20986                         "__name__ must be set to a string object");
20987         return -1;
20988     }
20989     tmp = op->func_name;
20990     Py_INCREF(value);
20991     op->func_name = value;
20992     Py_XDECREF(tmp);
20993     return 0;
20994 }
20995 static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject * op,CYTHON_UNUSED void * context)20996 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
20997 {
20998     Py_INCREF(op->func_qualname);
20999     return op->func_qualname;
21000 }
21001 static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject * op,PyObject * value,CYTHON_UNUSED void * context)21002 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
21003 {
21004     PyObject *tmp;
21005 #if PY_MAJOR_VERSION >= 3
21006     if (unlikely(value == NULL || !PyUnicode_Check(value)))
21007 #else
21008     if (unlikely(value == NULL || !PyString_Check(value)))
21009 #endif
21010     {
21011         PyErr_SetString(PyExc_TypeError,
21012                         "__qualname__ must be set to a string object");
21013         return -1;
21014     }
21015     tmp = op->func_qualname;
21016     Py_INCREF(value);
21017     op->func_qualname = value;
21018     Py_XDECREF(tmp);
21019     return 0;
21020 }
21021 static PyObject *
__Pyx_CyFunction_get_self(__pyx_CyFunctionObject * m,CYTHON_UNUSED void * closure)21022 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
21023 {
21024     PyObject *self;
21025     self = m->func_closure;
21026     if (self == NULL)
21027         self = Py_None;
21028     Py_INCREF(self);
21029     return self;
21030 }
21031 static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject * op,CYTHON_UNUSED void * context)21032 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
21033 {
21034     if (unlikely(op->func_dict == NULL)) {
21035         op->func_dict = PyDict_New();
21036         if (unlikely(op->func_dict == NULL))
21037             return NULL;
21038     }
21039     Py_INCREF(op->func_dict);
21040     return op->func_dict;
21041 }
21042 static int
__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject * op,PyObject * value,CYTHON_UNUSED void * context)21043 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
21044 {
21045     PyObject *tmp;
21046     if (unlikely(value == NULL)) {
21047         PyErr_SetString(PyExc_TypeError,
21048                "function's dictionary may not be deleted");
21049         return -1;
21050     }
21051     if (unlikely(!PyDict_Check(value))) {
21052         PyErr_SetString(PyExc_TypeError,
21053                "setting function's dictionary to a non-dict");
21054         return -1;
21055     }
21056     tmp = op->func_dict;
21057     Py_INCREF(value);
21058     op->func_dict = value;
21059     Py_XDECREF(tmp);
21060     return 0;
21061 }
21062 static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject * op,CYTHON_UNUSED void * context)21063 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
21064 {
21065     Py_INCREF(op->func_globals);
21066     return op->func_globals;
21067 }
21068 static PyObject *
__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject * op,CYTHON_UNUSED void * context)21069 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
21070 {
21071     Py_INCREF(Py_None);
21072     return Py_None;
21073 }
21074 static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject * op,CYTHON_UNUSED void * context)21075 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
21076 {
21077     PyObject* result = (op->func_code) ? op->func_code : Py_None;
21078     Py_INCREF(result);
21079     return result;
21080 }
21081 static int
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject * op)21082 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
21083     int result = 0;
21084     PyObject *res = op->defaults_getter((PyObject *) op);
21085     if (unlikely(!res))
21086         return -1;
21087     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
21088     op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
21089     Py_INCREF(op->defaults_tuple);
21090     op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
21091     Py_INCREF(op->defaults_kwdict);
21092     #else
21093     op->defaults_tuple = PySequence_ITEM(res, 0);
21094     if (unlikely(!op->defaults_tuple)) result = -1;
21095     else {
21096         op->defaults_kwdict = PySequence_ITEM(res, 1);
21097         if (unlikely(!op->defaults_kwdict)) result = -1;
21098     }
21099     #endif
21100     Py_DECREF(res);
21101     return result;
21102 }
21103 static int
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject * op,PyObject * value,CYTHON_UNUSED void * context)21104 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
21105     PyObject* tmp;
21106     if (!value) {
21107         value = Py_None;
21108     } else if (value != Py_None && !PyTuple_Check(value)) {
21109         PyErr_SetString(PyExc_TypeError,
21110                         "__defaults__ must be set to a tuple object");
21111         return -1;
21112     }
21113     Py_INCREF(value);
21114     tmp = op->defaults_tuple;
21115     op->defaults_tuple = value;
21116     Py_XDECREF(tmp);
21117     return 0;
21118 }
21119 static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject * op,CYTHON_UNUSED void * context)21120 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
21121     PyObject* result = op->defaults_tuple;
21122     if (unlikely(!result)) {
21123         if (op->defaults_getter) {
21124             if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
21125             result = op->defaults_tuple;
21126         } else {
21127             result = Py_None;
21128         }
21129     }
21130     Py_INCREF(result);
21131     return result;
21132 }
21133 static int
__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject * op,PyObject * value,CYTHON_UNUSED void * context)21134 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
21135     PyObject* tmp;
21136     if (!value) {
21137         value = Py_None;
21138     } else if (value != Py_None && !PyDict_Check(value)) {
21139         PyErr_SetString(PyExc_TypeError,
21140                         "__kwdefaults__ must be set to a dict object");
21141         return -1;
21142     }
21143     Py_INCREF(value);
21144     tmp = op->defaults_kwdict;
21145     op->defaults_kwdict = value;
21146     Py_XDECREF(tmp);
21147     return 0;
21148 }
21149 static PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject * op,CYTHON_UNUSED void * context)21150 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
21151     PyObject* result = op->defaults_kwdict;
21152     if (unlikely(!result)) {
21153         if (op->defaults_getter) {
21154             if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
21155             result = op->defaults_kwdict;
21156         } else {
21157             result = Py_None;
21158         }
21159     }
21160     Py_INCREF(result);
21161     return result;
21162 }
21163 static int
__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject * op,PyObject * value,CYTHON_UNUSED void * context)21164 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
21165     PyObject* tmp;
21166     if (!value || value == Py_None) {
21167         value = NULL;
21168     } else if (!PyDict_Check(value)) {
21169         PyErr_SetString(PyExc_TypeError,
21170                         "__annotations__ must be set to a dict object");
21171         return -1;
21172     }
21173     Py_XINCREF(value);
21174     tmp = op->func_annotations;
21175     op->func_annotations = value;
21176     Py_XDECREF(tmp);
21177     return 0;
21178 }
21179 static PyObject *
__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject * op,CYTHON_UNUSED void * context)21180 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
21181     PyObject* result = op->func_annotations;
21182     if (unlikely(!result)) {
21183         result = PyDict_New();
21184         if (unlikely(!result)) return NULL;
21185         op->func_annotations = result;
21186     }
21187     Py_INCREF(result);
21188     return result;
21189 }
21190 static PyGetSetDef __pyx_CyFunction_getsets[] = {
21191     {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
21192     {(char *) "__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
21193     {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
21194     {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
21195     {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
21196     {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
21197     {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
21198     {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
21199     {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
21200     {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
21201     {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
21202     {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
21203     {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
21204     {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
21205     {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
21206     {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
21207     {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
21208     {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
21209     {0, 0, 0, 0, 0}
21210 };
21211 static PyMemberDef __pyx_CyFunction_members[] = {
21212     {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
21213     {0, 0, 0,  0, 0}
21214 };
21215 static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject * m,CYTHON_UNUSED PyObject * args)21216 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
21217 {
21218 #if PY_MAJOR_VERSION >= 3
21219     return PyUnicode_FromString(m->func.m_ml->ml_name);
21220 #else
21221     return PyString_FromString(m->func.m_ml->ml_name);
21222 #endif
21223 }
21224 static PyMethodDef __pyx_CyFunction_methods[] = {
21225     {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
21226     {0, 0, 0, 0}
21227 };
21228 #if PY_VERSION_HEX < 0x030500A0
21229 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
21230 #else
21231 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
21232 #endif
__Pyx_CyFunction_Init(__pyx_CyFunctionObject * op,PyMethodDef * ml,int flags,PyObject * qualname,PyObject * closure,PyObject * module,PyObject * globals,PyObject * code)21233 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
21234                                        PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
21235     if (unlikely(op == NULL))
21236         return NULL;
21237     op->flags = flags;
21238     __Pyx_CyFunction_weakreflist(op) = NULL;
21239     op->func.m_ml = ml;
21240     op->func.m_self = (PyObject *) op;
21241     Py_XINCREF(closure);
21242     op->func_closure = closure;
21243     Py_XINCREF(module);
21244     op->func.m_module = module;
21245     op->func_dict = NULL;
21246     op->func_name = NULL;
21247     Py_INCREF(qualname);
21248     op->func_qualname = qualname;
21249     op->func_doc = NULL;
21250     op->func_classobj = NULL;
21251     op->func_globals = globals;
21252     Py_INCREF(op->func_globals);
21253     Py_XINCREF(code);
21254     op->func_code = code;
21255     op->defaults_pyobjects = 0;
21256     op->defaults_size = 0;
21257     op->defaults = NULL;
21258     op->defaults_tuple = NULL;
21259     op->defaults_kwdict = NULL;
21260     op->defaults_getter = NULL;
21261     op->func_annotations = NULL;
21262     return (PyObject *) op;
21263 }
21264 static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject * m)21265 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
21266 {
21267     Py_CLEAR(m->func_closure);
21268     Py_CLEAR(m->func.m_module);
21269     Py_CLEAR(m->func_dict);
21270     Py_CLEAR(m->func_name);
21271     Py_CLEAR(m->func_qualname);
21272     Py_CLEAR(m->func_doc);
21273     Py_CLEAR(m->func_globals);
21274     Py_CLEAR(m->func_code);
21275     Py_CLEAR(m->func_classobj);
21276     Py_CLEAR(m->defaults_tuple);
21277     Py_CLEAR(m->defaults_kwdict);
21278     Py_CLEAR(m->func_annotations);
21279     if (m->defaults) {
21280         PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
21281         int i;
21282         for (i = 0; i < m->defaults_pyobjects; i++)
21283             Py_XDECREF(pydefaults[i]);
21284         PyObject_Free(m->defaults);
21285         m->defaults = NULL;
21286     }
21287     return 0;
21288 }
__Pyx__CyFunction_dealloc(__pyx_CyFunctionObject * m)21289 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
21290 {
21291     if (__Pyx_CyFunction_weakreflist(m) != NULL)
21292         PyObject_ClearWeakRefs((PyObject *) m);
21293     __Pyx_CyFunction_clear(m);
21294     PyObject_GC_Del(m);
21295 }
__Pyx_CyFunction_dealloc(__pyx_CyFunctionObject * m)21296 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
21297 {
21298     PyObject_GC_UnTrack(m);
21299     __Pyx__CyFunction_dealloc(m);
21300 }
__Pyx_CyFunction_traverse(__pyx_CyFunctionObject * m,visitproc visit,void * arg)21301 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
21302 {
21303     Py_VISIT(m->func_closure);
21304     Py_VISIT(m->func.m_module);
21305     Py_VISIT(m->func_dict);
21306     Py_VISIT(m->func_name);
21307     Py_VISIT(m->func_qualname);
21308     Py_VISIT(m->func_doc);
21309     Py_VISIT(m->func_globals);
21310     Py_VISIT(m->func_code);
21311     Py_VISIT(m->func_classobj);
21312     Py_VISIT(m->defaults_tuple);
21313     Py_VISIT(m->defaults_kwdict);
21314     if (m->defaults) {
21315         PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
21316         int i;
21317         for (i = 0; i < m->defaults_pyobjects; i++)
21318             Py_VISIT(pydefaults[i]);
21319     }
21320     return 0;
21321 }
__Pyx_CyFunction_descr_get(PyObject * func,PyObject * obj,PyObject * type)21322 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
21323 {
21324 #if PY_MAJOR_VERSION < 3
21325     __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
21326     if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
21327         Py_INCREF(func);
21328         return func;
21329     }
21330     if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
21331         if (type == NULL)
21332             type = (PyObject *)(Py_TYPE(obj));
21333         return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
21334     }
21335     if (obj == Py_None)
21336         obj = NULL;
21337 #endif
21338     return __Pyx_PyMethod_New(func, obj, type);
21339 }
21340 static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject * op)21341 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
21342 {
21343 #if PY_MAJOR_VERSION >= 3
21344     return PyUnicode_FromFormat("<cyfunction %U at %p>",
21345                                 op->func_qualname, (void *)op);
21346 #else
21347     return PyString_FromFormat("<cyfunction %s at %p>",
21348                                PyString_AsString(op->func_qualname), (void *)op);
21349 #endif
21350 }
__Pyx_CyFunction_CallMethod(PyObject * func,PyObject * self,PyObject * arg,PyObject * kw)21351 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
21352     PyCFunctionObject* f = (PyCFunctionObject*)func;
21353     PyCFunction meth = f->m_ml->ml_meth;
21354     Py_ssize_t size;
21355     switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
21356     case METH_VARARGS:
21357         if (likely(kw == NULL || PyDict_Size(kw) == 0))
21358             return (*meth)(self, arg);
21359         break;
21360     case METH_VARARGS | METH_KEYWORDS:
21361         return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
21362     case METH_NOARGS:
21363         if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
21364             size = PyTuple_GET_SIZE(arg);
21365             if (likely(size == 0))
21366                 return (*meth)(self, NULL);
21367             PyErr_Format(PyExc_TypeError,
21368                 "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
21369                 f->m_ml->ml_name, size);
21370             return NULL;
21371         }
21372         break;
21373     case METH_O:
21374         if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
21375             size = PyTuple_GET_SIZE(arg);
21376             if (likely(size == 1)) {
21377                 PyObject *result, *arg0;
21378                 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
21379                 arg0 = PyTuple_GET_ITEM(arg, 0);
21380                 #else
21381                 arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
21382                 #endif
21383                 result = (*meth)(self, arg0);
21384                 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
21385                 Py_DECREF(arg0);
21386                 #endif
21387                 return result;
21388             }
21389             PyErr_Format(PyExc_TypeError,
21390                 "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
21391                 f->m_ml->ml_name, size);
21392             return NULL;
21393         }
21394         break;
21395     default:
21396         PyErr_SetString(PyExc_SystemError, "Bad call flags in "
21397                         "__Pyx_CyFunction_Call. METH_OLDARGS is no "
21398                         "longer supported!");
21399         return NULL;
21400     }
21401     PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
21402                  f->m_ml->ml_name);
21403     return NULL;
21404 }
__Pyx_CyFunction_Call(PyObject * func,PyObject * arg,PyObject * kw)21405 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
21406     return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
21407 }
__Pyx_CyFunction_CallAsMethod(PyObject * func,PyObject * args,PyObject * kw)21408 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
21409     PyObject *result;
21410     __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
21411     if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
21412         Py_ssize_t argc;
21413         PyObject *new_args;
21414         PyObject *self;
21415         argc = PyTuple_GET_SIZE(args);
21416         new_args = PyTuple_GetSlice(args, 1, argc);
21417         if (unlikely(!new_args))
21418             return NULL;
21419         self = PyTuple_GetItem(args, 0);
21420         if (unlikely(!self)) {
21421             Py_DECREF(new_args);
21422             return NULL;
21423         }
21424         result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
21425         Py_DECREF(new_args);
21426     } else {
21427         result = __Pyx_CyFunction_Call(func, args, kw);
21428     }
21429     return result;
21430 }
21431 static PyTypeObject __pyx_CyFunctionType_type = {
21432     PyVarObject_HEAD_INIT(0, 0)
21433     "cython_function_or_method",
21434     sizeof(__pyx_CyFunctionObject),
21435     0,
21436     (destructor) __Pyx_CyFunction_dealloc,
21437     0,
21438     0,
21439     0,
21440 #if PY_MAJOR_VERSION < 3
21441     0,
21442 #else
21443     0,
21444 #endif
21445     (reprfunc) __Pyx_CyFunction_repr,
21446     0,
21447     0,
21448     0,
21449     0,
21450     __Pyx_CyFunction_CallAsMethod,
21451     0,
21452     0,
21453     0,
21454     0,
21455     Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
21456     0,
21457     (traverseproc) __Pyx_CyFunction_traverse,
21458     (inquiry) __Pyx_CyFunction_clear,
21459     0,
21460 #if PY_VERSION_HEX < 0x030500A0
21461     offsetof(__pyx_CyFunctionObject, func_weakreflist),
21462 #else
21463     offsetof(PyCFunctionObject, m_weakreflist),
21464 #endif
21465     0,
21466     0,
21467     __pyx_CyFunction_methods,
21468     __pyx_CyFunction_members,
21469     __pyx_CyFunction_getsets,
21470     0,
21471     0,
21472     __Pyx_CyFunction_descr_get,
21473     0,
21474     offsetof(__pyx_CyFunctionObject, func_dict),
21475     0,
21476     0,
21477     0,
21478     0,
21479     0,
21480     0,
21481     0,
21482     0,
21483     0,
21484     0,
21485     0,
21486     0,
21487 #if PY_VERSION_HEX >= 0x030400a1
21488     0,
21489 #endif
21490 #if PY_VERSION_HEX >= 0x030800b1
21491     0,
21492 #endif
21493 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21494     0,
21495 #endif
21496 };
__pyx_CyFunction_init(void)21497 static int __pyx_CyFunction_init(void) {
21498     __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
21499     if (unlikely(__pyx_CyFunctionType == NULL)) {
21500         return -1;
21501     }
21502     return 0;
21503 }
__Pyx_CyFunction_InitDefaults(PyObject * func,size_t size,int pyobjects)21504 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
21505     __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
21506     m->defaults = PyObject_Malloc(size);
21507     if (unlikely(!m->defaults))
21508         return PyErr_NoMemory();
21509     memset(m->defaults, 0, size);
21510     m->defaults_pyobjects = pyobjects;
21511     m->defaults_size = size;
21512     return m->defaults;
21513 }
__Pyx_CyFunction_SetDefaultsTuple(PyObject * func,PyObject * tuple)21514 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
21515     __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
21516     m->defaults_tuple = tuple;
21517     Py_INCREF(tuple);
21518 }
__Pyx_CyFunction_SetDefaultsKwDict(PyObject * func,PyObject * dict)21519 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
21520     __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
21521     m->defaults_kwdict = dict;
21522     Py_INCREF(dict);
21523 }
__Pyx_CyFunction_SetAnnotationsDict(PyObject * func,PyObject * dict)21524 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
21525     __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
21526     m->func_annotations = dict;
21527     Py_INCREF(dict);
21528 }
21529 
21530 /* CythonFunction */
__Pyx_CyFunction_New(PyMethodDef * ml,int flags,PyObject * qualname,PyObject * closure,PyObject * module,PyObject * globals,PyObject * code)21531 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
21532                                       PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
21533     PyObject *op = __Pyx_CyFunction_Init(
21534         PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
21535         ml, flags, qualname, closure, module, globals, code
21536     );
21537     if (likely(op)) {
21538         PyObject_GC_Track(op);
21539     }
21540     return op;
21541 }
21542 
21543 /* CLineInTraceback */
21544 #ifndef CYTHON_CLINE_IN_TRACEBACK
__Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState * tstate,int c_line)21545 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
21546     PyObject *use_cline;
21547     PyObject *ptype, *pvalue, *ptraceback;
21548 #if CYTHON_COMPILING_IN_CPYTHON
21549     PyObject **cython_runtime_dict;
21550 #endif
21551     if (unlikely(!__pyx_cython_runtime)) {
21552         return c_line;
21553     }
21554     __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
21555 #if CYTHON_COMPILING_IN_CPYTHON
21556     cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
21557     if (likely(cython_runtime_dict)) {
21558         __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
21559             use_cline, *cython_runtime_dict,
21560             __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
21561     } else
21562 #endif
21563     {
21564       PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
21565       if (use_cline_obj) {
21566         use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
21567         Py_DECREF(use_cline_obj);
21568       } else {
21569         PyErr_Clear();
21570         use_cline = NULL;
21571       }
21572     }
21573     if (!use_cline) {
21574         c_line = 0;
21575         PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
21576     }
21577     else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
21578         c_line = 0;
21579     }
21580     __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
21581     return c_line;
21582 }
21583 #endif
21584 
21585 /* CodeObjectCache */
__pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry * entries,int count,int code_line)21586 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
21587     int start = 0, mid = 0, end = count - 1;
21588     if (end >= 0 && code_line > entries[end].code_line) {
21589         return count;
21590     }
21591     while (start < end) {
21592         mid = start + (end - start) / 2;
21593         if (code_line < entries[mid].code_line) {
21594             end = mid;
21595         } else if (code_line > entries[mid].code_line) {
21596              start = mid + 1;
21597         } else {
21598             return mid;
21599         }
21600     }
21601     if (code_line <= entries[mid].code_line) {
21602         return mid;
21603     } else {
21604         return mid + 1;
21605     }
21606 }
__pyx_find_code_object(int code_line)21607 static PyCodeObject *__pyx_find_code_object(int code_line) {
21608     PyCodeObject* code_object;
21609     int pos;
21610     if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
21611         return NULL;
21612     }
21613     pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
21614     if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
21615         return NULL;
21616     }
21617     code_object = __pyx_code_cache.entries[pos].code_object;
21618     Py_INCREF(code_object);
21619     return code_object;
21620 }
__pyx_insert_code_object(int code_line,PyCodeObject * code_object)21621 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
21622     int pos, i;
21623     __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
21624     if (unlikely(!code_line)) {
21625         return;
21626     }
21627     if (unlikely(!entries)) {
21628         entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
21629         if (likely(entries)) {
21630             __pyx_code_cache.entries = entries;
21631             __pyx_code_cache.max_count = 64;
21632             __pyx_code_cache.count = 1;
21633             entries[0].code_line = code_line;
21634             entries[0].code_object = code_object;
21635             Py_INCREF(code_object);
21636         }
21637         return;
21638     }
21639     pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
21640     if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
21641         PyCodeObject* tmp = entries[pos].code_object;
21642         entries[pos].code_object = code_object;
21643         Py_DECREF(tmp);
21644         return;
21645     }
21646     if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
21647         int new_max = __pyx_code_cache.max_count + 64;
21648         entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
21649             __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
21650         if (unlikely(!entries)) {
21651             return;
21652         }
21653         __pyx_code_cache.entries = entries;
21654         __pyx_code_cache.max_count = new_max;
21655     }
21656     for (i=__pyx_code_cache.count; i>pos; i--) {
21657         entries[i] = entries[i-1];
21658     }
21659     entries[pos].code_line = code_line;
21660     entries[pos].code_object = code_object;
21661     __pyx_code_cache.count++;
21662     Py_INCREF(code_object);
21663 }
21664 
21665 /* AddTraceback */
21666 #include "compile.h"
21667 #include "frameobject.h"
21668 #include "traceback.h"
__Pyx_CreateCodeObjectForTraceback(const char * funcname,int c_line,int py_line,const char * filename)21669 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
21670             const char *funcname, int c_line,
21671             int py_line, const char *filename) {
21672     PyCodeObject *py_code = 0;
21673     PyObject *py_srcfile = 0;
21674     PyObject *py_funcname = 0;
21675     #if PY_MAJOR_VERSION < 3
21676     py_srcfile = PyString_FromString(filename);
21677     #else
21678     py_srcfile = PyUnicode_FromString(filename);
21679     #endif
21680     if (!py_srcfile) goto bad;
21681     if (c_line) {
21682         #if PY_MAJOR_VERSION < 3
21683         py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
21684         #else
21685         py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
21686         #endif
21687     }
21688     else {
21689         #if PY_MAJOR_VERSION < 3
21690         py_funcname = PyString_FromString(funcname);
21691         #else
21692         py_funcname = PyUnicode_FromString(funcname);
21693         #endif
21694     }
21695     if (!py_funcname) goto bad;
21696     py_code = __Pyx_PyCode_New(
21697         0,
21698         0,
21699         0,
21700         0,
21701         0,
21702         __pyx_empty_bytes, /*PyObject *code,*/
21703         __pyx_empty_tuple, /*PyObject *consts,*/
21704         __pyx_empty_tuple, /*PyObject *names,*/
21705         __pyx_empty_tuple, /*PyObject *varnames,*/
21706         __pyx_empty_tuple, /*PyObject *freevars,*/
21707         __pyx_empty_tuple, /*PyObject *cellvars,*/
21708         py_srcfile,   /*PyObject *filename,*/
21709         py_funcname,  /*PyObject *name,*/
21710         py_line,
21711         __pyx_empty_bytes  /*PyObject *lnotab*/
21712     );
21713     Py_DECREF(py_srcfile);
21714     Py_DECREF(py_funcname);
21715     return py_code;
21716 bad:
21717     Py_XDECREF(py_srcfile);
21718     Py_XDECREF(py_funcname);
21719     return NULL;
21720 }
__Pyx_AddTraceback(const char * funcname,int c_line,int py_line,const char * filename)21721 static void __Pyx_AddTraceback(const char *funcname, int c_line,
21722                                int py_line, const char *filename) {
21723     PyCodeObject *py_code = 0;
21724     PyFrameObject *py_frame = 0;
21725     PyThreadState *tstate = __Pyx_PyThreadState_Current;
21726     if (c_line) {
21727         c_line = __Pyx_CLineForTraceback(tstate, c_line);
21728     }
21729     py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
21730     if (!py_code) {
21731         py_code = __Pyx_CreateCodeObjectForTraceback(
21732             funcname, c_line, py_line, filename);
21733         if (!py_code) goto bad;
21734         __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
21735     }
21736     py_frame = PyFrame_New(
21737         tstate,            /*PyThreadState *tstate,*/
21738         py_code,           /*PyCodeObject *code,*/
21739         __pyx_d,    /*PyObject *globals,*/
21740         0                  /*PyObject *locals*/
21741     );
21742     if (!py_frame) goto bad;
21743     __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
21744     PyTraceBack_Here(py_frame);
21745 bad:
21746     Py_XDECREF(py_code);
21747     Py_XDECREF(py_frame);
21748 }
21749 
21750 /* CIntToPy */
__Pyx_PyInt_From_long(long value)21751 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
21752     const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
21753     const int is_unsigned = neg_one > const_zero;
21754     if (is_unsigned) {
21755         if (sizeof(long) < sizeof(long)) {
21756             return PyInt_FromLong((long) value);
21757         } else if (sizeof(long) <= sizeof(unsigned long)) {
21758             return PyLong_FromUnsignedLong((unsigned long) value);
21759 #ifdef HAVE_LONG_LONG
21760         } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
21761             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
21762 #endif
21763         }
21764     } else {
21765         if (sizeof(long) <= sizeof(long)) {
21766             return PyInt_FromLong((long) value);
21767 #ifdef HAVE_LONG_LONG
21768         } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
21769             return PyLong_FromLongLong((PY_LONG_LONG) value);
21770 #endif
21771         }
21772     }
21773     {
21774         int one = 1; int little = (int)*(unsigned char *)&one;
21775         unsigned char *bytes = (unsigned char *)&value;
21776         return _PyLong_FromByteArray(bytes, sizeof(long),
21777                                      little, !is_unsigned);
21778     }
21779 }
21780 
21781 /* CIntFromPyVerify */
21782 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
21783     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
21784 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
21785     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
21786 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
21787     {\
21788         func_type value = func_value;\
21789         if (sizeof(target_type) < sizeof(func_type)) {\
21790             if (unlikely(value != (func_type) (target_type) value)) {\
21791                 func_type zero = 0;\
21792                 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
21793                     return (target_type) -1;\
21794                 if (is_unsigned && unlikely(value < zero))\
21795                     goto raise_neg_overflow;\
21796                 else\
21797                     goto raise_overflow;\
21798             }\
21799         }\
21800         return (target_type) value;\
21801     }
21802 
21803 /* CIntToPy */
__Pyx_PyInt_From_PY_LONG_LONG(PY_LONG_LONG value)21804 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PY_LONG_LONG(PY_LONG_LONG value) {
21805     const PY_LONG_LONG neg_one = (PY_LONG_LONG) ((PY_LONG_LONG) 0 - (PY_LONG_LONG) 1), const_zero = (PY_LONG_LONG) 0;
21806     const int is_unsigned = neg_one > const_zero;
21807     if (is_unsigned) {
21808         if (sizeof(PY_LONG_LONG) < sizeof(long)) {
21809             return PyInt_FromLong((long) value);
21810         } else if (sizeof(PY_LONG_LONG) <= sizeof(unsigned long)) {
21811             return PyLong_FromUnsignedLong((unsigned long) value);
21812 #ifdef HAVE_LONG_LONG
21813         } else if (sizeof(PY_LONG_LONG) <= sizeof(unsigned PY_LONG_LONG)) {
21814             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
21815 #endif
21816         }
21817     } else {
21818         if (sizeof(PY_LONG_LONG) <= sizeof(long)) {
21819             return PyInt_FromLong((long) value);
21820 #ifdef HAVE_LONG_LONG
21821         } else if (sizeof(PY_LONG_LONG) <= sizeof(PY_LONG_LONG)) {
21822             return PyLong_FromLongLong((PY_LONG_LONG) value);
21823 #endif
21824         }
21825     }
21826     {
21827         int one = 1; int little = (int)*(unsigned char *)&one;
21828         unsigned char *bytes = (unsigned char *)&value;
21829         return _PyLong_FromByteArray(bytes, sizeof(PY_LONG_LONG),
21830                                      little, !is_unsigned);
21831     }
21832 }
21833 
21834 /* CIntFromPy */
__Pyx_PyInt_As_unsigned_char(PyObject * x)21835 static CYTHON_INLINE unsigned char __Pyx_PyInt_As_unsigned_char(PyObject *x) {
21836     const unsigned char neg_one = (unsigned char) ((unsigned char) 0 - (unsigned char) 1), const_zero = (unsigned char) 0;
21837     const int is_unsigned = neg_one > const_zero;
21838 #if PY_MAJOR_VERSION < 3
21839     if (likely(PyInt_Check(x))) {
21840         if (sizeof(unsigned char) < sizeof(long)) {
21841             __PYX_VERIFY_RETURN_INT(unsigned char, long, PyInt_AS_LONG(x))
21842         } else {
21843             long val = PyInt_AS_LONG(x);
21844             if (is_unsigned && unlikely(val < 0)) {
21845                 goto raise_neg_overflow;
21846             }
21847             return (unsigned char) val;
21848         }
21849     } else
21850 #endif
21851     if (likely(PyLong_Check(x))) {
21852         if (is_unsigned) {
21853 #if CYTHON_USE_PYLONG_INTERNALS
21854             const digit* digits = ((PyLongObject*)x)->ob_digit;
21855             switch (Py_SIZE(x)) {
21856                 case  0: return (unsigned char) 0;
21857                 case  1: __PYX_VERIFY_RETURN_INT(unsigned char, digit, digits[0])
21858                 case 2:
21859                     if (8 * sizeof(unsigned char) > 1 * PyLong_SHIFT) {
21860                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
21861                             __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
21862                         } else if (8 * sizeof(unsigned char) >= 2 * PyLong_SHIFT) {
21863                             return (unsigned char) (((((unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0]));
21864                         }
21865                     }
21866                     break;
21867                 case 3:
21868                     if (8 * sizeof(unsigned char) > 2 * PyLong_SHIFT) {
21869                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
21870                             __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
21871                         } else if (8 * sizeof(unsigned char) >= 3 * PyLong_SHIFT) {
21872                             return (unsigned char) (((((((unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0]));
21873                         }
21874                     }
21875                     break;
21876                 case 4:
21877                     if (8 * sizeof(unsigned char) > 3 * PyLong_SHIFT) {
21878                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
21879                             __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
21880                         } else if (8 * sizeof(unsigned char) >= 4 * PyLong_SHIFT) {
21881                             return (unsigned char) (((((((((unsigned char)digits[3]) << PyLong_SHIFT) | (unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0]));
21882                         }
21883                     }
21884                     break;
21885             }
21886 #endif
21887 #if CYTHON_COMPILING_IN_CPYTHON
21888             if (unlikely(Py_SIZE(x) < 0)) {
21889                 goto raise_neg_overflow;
21890             }
21891 #else
21892             {
21893                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
21894                 if (unlikely(result < 0))
21895                     return (unsigned char) -1;
21896                 if (unlikely(result == 1))
21897                     goto raise_neg_overflow;
21898             }
21899 #endif
21900             if (sizeof(unsigned char) <= sizeof(unsigned long)) {
21901                 __PYX_VERIFY_RETURN_INT_EXC(unsigned char, unsigned long, PyLong_AsUnsignedLong(x))
21902 #ifdef HAVE_LONG_LONG
21903             } else if (sizeof(unsigned char) <= sizeof(unsigned PY_LONG_LONG)) {
21904                 __PYX_VERIFY_RETURN_INT_EXC(unsigned char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
21905 #endif
21906             }
21907         } else {
21908 #if CYTHON_USE_PYLONG_INTERNALS
21909             const digit* digits = ((PyLongObject*)x)->ob_digit;
21910             switch (Py_SIZE(x)) {
21911                 case  0: return (unsigned char) 0;
21912                 case -1: __PYX_VERIFY_RETURN_INT(unsigned char, sdigit, (sdigit) (-(sdigit)digits[0]))
21913                 case  1: __PYX_VERIFY_RETURN_INT(unsigned char,  digit, +digits[0])
21914                 case -2:
21915                     if (8 * sizeof(unsigned char) - 1 > 1 * PyLong_SHIFT) {
21916                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
21917                             __PYX_VERIFY_RETURN_INT(unsigned char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
21918                         } else if (8 * sizeof(unsigned char) - 1 > 2 * PyLong_SHIFT) {
21919                             return (unsigned char) (((unsigned char)-1)*(((((unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])));
21920                         }
21921                     }
21922                     break;
21923                 case 2:
21924                     if (8 * sizeof(unsigned char) > 1 * PyLong_SHIFT) {
21925                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
21926                             __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
21927                         } else if (8 * sizeof(unsigned char) - 1 > 2 * PyLong_SHIFT) {
21928                             return (unsigned char) ((((((unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])));
21929                         }
21930                     }
21931                     break;
21932                 case -3:
21933                     if (8 * sizeof(unsigned char) - 1 > 2 * PyLong_SHIFT) {
21934                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
21935                             __PYX_VERIFY_RETURN_INT(unsigned char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
21936                         } else if (8 * sizeof(unsigned char) - 1 > 3 * PyLong_SHIFT) {
21937                             return (unsigned char) (((unsigned char)-1)*(((((((unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])));
21938                         }
21939                     }
21940                     break;
21941                 case 3:
21942                     if (8 * sizeof(unsigned char) > 2 * PyLong_SHIFT) {
21943                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
21944                             __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
21945                         } else if (8 * sizeof(unsigned char) - 1 > 3 * PyLong_SHIFT) {
21946                             return (unsigned char) ((((((((unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])));
21947                         }
21948                     }
21949                     break;
21950                 case -4:
21951                     if (8 * sizeof(unsigned char) - 1 > 3 * PyLong_SHIFT) {
21952                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
21953                             __PYX_VERIFY_RETURN_INT(unsigned char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
21954                         } else if (8 * sizeof(unsigned char) - 1 > 4 * PyLong_SHIFT) {
21955                             return (unsigned char) (((unsigned char)-1)*(((((((((unsigned char)digits[3]) << PyLong_SHIFT) | (unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])));
21956                         }
21957                     }
21958                     break;
21959                 case 4:
21960                     if (8 * sizeof(unsigned char) > 3 * PyLong_SHIFT) {
21961                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
21962                             __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
21963                         } else if (8 * sizeof(unsigned char) - 1 > 4 * PyLong_SHIFT) {
21964                             return (unsigned char) ((((((((((unsigned char)digits[3]) << PyLong_SHIFT) | (unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])));
21965                         }
21966                     }
21967                     break;
21968             }
21969 #endif
21970             if (sizeof(unsigned char) <= sizeof(long)) {
21971                 __PYX_VERIFY_RETURN_INT_EXC(unsigned char, long, PyLong_AsLong(x))
21972 #ifdef HAVE_LONG_LONG
21973             } else if (sizeof(unsigned char) <= sizeof(PY_LONG_LONG)) {
21974                 __PYX_VERIFY_RETURN_INT_EXC(unsigned char, PY_LONG_LONG, PyLong_AsLongLong(x))
21975 #endif
21976             }
21977         }
21978         {
21979 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
21980             PyErr_SetString(PyExc_RuntimeError,
21981                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
21982 #else
21983             unsigned char val;
21984             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
21985  #if PY_MAJOR_VERSION < 3
21986             if (likely(v) && !PyLong_Check(v)) {
21987                 PyObject *tmp = v;
21988                 v = PyNumber_Long(tmp);
21989                 Py_DECREF(tmp);
21990             }
21991  #endif
21992             if (likely(v)) {
21993                 int one = 1; int is_little = (int)*(unsigned char *)&one;
21994                 unsigned char *bytes = (unsigned char *)&val;
21995                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
21996                                               bytes, sizeof(val),
21997                                               is_little, !is_unsigned);
21998                 Py_DECREF(v);
21999                 if (likely(!ret))
22000                     return val;
22001             }
22002 #endif
22003             return (unsigned char) -1;
22004         }
22005     } else {
22006         unsigned char val;
22007         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
22008         if (!tmp) return (unsigned char) -1;
22009         val = __Pyx_PyInt_As_unsigned_char(tmp);
22010         Py_DECREF(tmp);
22011         return val;
22012     }
22013 raise_overflow:
22014     PyErr_SetString(PyExc_OverflowError,
22015         "value too large to convert to unsigned char");
22016     return (unsigned char) -1;
22017 raise_neg_overflow:
22018     PyErr_SetString(PyExc_OverflowError,
22019         "can't convert negative value to unsigned char");
22020     return (unsigned char) -1;
22021 }
22022 
22023 /* CIntFromPy */
__Pyx_PyInt_As_PY_LONG_LONG(PyObject * x)22024 static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_As_PY_LONG_LONG(PyObject *x) {
22025     const PY_LONG_LONG neg_one = (PY_LONG_LONG) ((PY_LONG_LONG) 0 - (PY_LONG_LONG) 1), const_zero = (PY_LONG_LONG) 0;
22026     const int is_unsigned = neg_one > const_zero;
22027 #if PY_MAJOR_VERSION < 3
22028     if (likely(PyInt_Check(x))) {
22029         if (sizeof(PY_LONG_LONG) < sizeof(long)) {
22030             __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, PyInt_AS_LONG(x))
22031         } else {
22032             long val = PyInt_AS_LONG(x);
22033             if (is_unsigned && unlikely(val < 0)) {
22034                 goto raise_neg_overflow;
22035             }
22036             return (PY_LONG_LONG) val;
22037         }
22038     } else
22039 #endif
22040     if (likely(PyLong_Check(x))) {
22041         if (is_unsigned) {
22042 #if CYTHON_USE_PYLONG_INTERNALS
22043             const digit* digits = ((PyLongObject*)x)->ob_digit;
22044             switch (Py_SIZE(x)) {
22045                 case  0: return (PY_LONG_LONG) 0;
22046                 case  1: __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, digit, digits[0])
22047                 case 2:
22048                     if (8 * sizeof(PY_LONG_LONG) > 1 * PyLong_SHIFT) {
22049                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
22050                             __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
22051                         } else if (8 * sizeof(PY_LONG_LONG) >= 2 * PyLong_SHIFT) {
22052                             return (PY_LONG_LONG) (((((PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0]));
22053                         }
22054                     }
22055                     break;
22056                 case 3:
22057                     if (8 * sizeof(PY_LONG_LONG) > 2 * PyLong_SHIFT) {
22058                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
22059                             __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
22060                         } else if (8 * sizeof(PY_LONG_LONG) >= 3 * PyLong_SHIFT) {
22061                             return (PY_LONG_LONG) (((((((PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0]));
22062                         }
22063                     }
22064                     break;
22065                 case 4:
22066                     if (8 * sizeof(PY_LONG_LONG) > 3 * PyLong_SHIFT) {
22067                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
22068                             __PYX_VERIFY_RETURN_INT(PY_LONG_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])))
22069                         } else if (8 * sizeof(PY_LONG_LONG) >= 4 * PyLong_SHIFT) {
22070                             return (PY_LONG_LONG) (((((((((PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0]));
22071                         }
22072                     }
22073                     break;
22074             }
22075 #endif
22076 #if CYTHON_COMPILING_IN_CPYTHON
22077             if (unlikely(Py_SIZE(x) < 0)) {
22078                 goto raise_neg_overflow;
22079             }
22080 #else
22081             {
22082                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
22083                 if (unlikely(result < 0))
22084                     return (PY_LONG_LONG) -1;
22085                 if (unlikely(result == 1))
22086                     goto raise_neg_overflow;
22087             }
22088 #endif
22089             if (sizeof(PY_LONG_LONG) <= sizeof(unsigned long)) {
22090                 __PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, unsigned long, PyLong_AsUnsignedLong(x))
22091 #ifdef HAVE_LONG_LONG
22092             } else if (sizeof(PY_LONG_LONG) <= sizeof(unsigned PY_LONG_LONG)) {
22093                 __PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
22094 #endif
22095             }
22096         } else {
22097 #if CYTHON_USE_PYLONG_INTERNALS
22098             const digit* digits = ((PyLongObject*)x)->ob_digit;
22099             switch (Py_SIZE(x)) {
22100                 case  0: return (PY_LONG_LONG) 0;
22101                 case -1: __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, sdigit, (sdigit) (-(sdigit)digits[0]))
22102                 case  1: __PYX_VERIFY_RETURN_INT(PY_LONG_LONG,  digit, +digits[0])
22103                 case -2:
22104                     if (8 * sizeof(PY_LONG_LONG) - 1 > 1 * PyLong_SHIFT) {
22105                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
22106                             __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
22107                         } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
22108                             return (PY_LONG_LONG) (((PY_LONG_LONG)-1)*(((((PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));
22109                         }
22110                     }
22111                     break;
22112                 case 2:
22113                     if (8 * sizeof(PY_LONG_LONG) > 1 * PyLong_SHIFT) {
22114                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
22115                             __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
22116                         } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
22117                             return (PY_LONG_LONG) ((((((PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));
22118                         }
22119                     }
22120                     break;
22121                 case -3:
22122                     if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
22123                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
22124                             __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
22125                         } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
22126                             return (PY_LONG_LONG) (((PY_LONG_LONG)-1)*(((((((PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));
22127                         }
22128                     }
22129                     break;
22130                 case 3:
22131                     if (8 * sizeof(PY_LONG_LONG) > 2 * PyLong_SHIFT) {
22132                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
22133                             __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
22134                         } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
22135                             return (PY_LONG_LONG) ((((((((PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));
22136                         }
22137                     }
22138                     break;
22139                 case -4:
22140                     if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
22141                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
22142                             __PYX_VERIFY_RETURN_INT(PY_LONG_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])))
22143                         } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
22144                             return (PY_LONG_LONG) (((PY_LONG_LONG)-1)*(((((((((PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));
22145                         }
22146                     }
22147                     break;
22148                 case 4:
22149                     if (8 * sizeof(PY_LONG_LONG) > 3 * PyLong_SHIFT) {
22150                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
22151                             __PYX_VERIFY_RETURN_INT(PY_LONG_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])))
22152                         } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
22153                             return (PY_LONG_LONG) ((((((((((PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));
22154                         }
22155                     }
22156                     break;
22157             }
22158 #endif
22159             if (sizeof(PY_LONG_LONG) <= sizeof(long)) {
22160                 __PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, long, PyLong_AsLong(x))
22161 #ifdef HAVE_LONG_LONG
22162             } else if (sizeof(PY_LONG_LONG) <= sizeof(PY_LONG_LONG)) {
22163                 __PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, PY_LONG_LONG, PyLong_AsLongLong(x))
22164 #endif
22165             }
22166         }
22167         {
22168 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
22169             PyErr_SetString(PyExc_RuntimeError,
22170                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
22171 #else
22172             PY_LONG_LONG val;
22173             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
22174  #if PY_MAJOR_VERSION < 3
22175             if (likely(v) && !PyLong_Check(v)) {
22176                 PyObject *tmp = v;
22177                 v = PyNumber_Long(tmp);
22178                 Py_DECREF(tmp);
22179             }
22180  #endif
22181             if (likely(v)) {
22182                 int one = 1; int is_little = (int)*(unsigned char *)&one;
22183                 unsigned char *bytes = (unsigned char *)&val;
22184                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
22185                                               bytes, sizeof(val),
22186                                               is_little, !is_unsigned);
22187                 Py_DECREF(v);
22188                 if (likely(!ret))
22189                     return val;
22190             }
22191 #endif
22192             return (PY_LONG_LONG) -1;
22193         }
22194     } else {
22195         PY_LONG_LONG val;
22196         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
22197         if (!tmp) return (PY_LONG_LONG) -1;
22198         val = __Pyx_PyInt_As_PY_LONG_LONG(tmp);
22199         Py_DECREF(tmp);
22200         return val;
22201     }
22202 raise_overflow:
22203     PyErr_SetString(PyExc_OverflowError,
22204         "value too large to convert to PY_LONG_LONG");
22205     return (PY_LONG_LONG) -1;
22206 raise_neg_overflow:
22207     PyErr_SetString(PyExc_OverflowError,
22208         "can't convert negative value to PY_LONG_LONG");
22209     return (PY_LONG_LONG) -1;
22210 }
22211 
22212 /* CIntFromPy */
__Pyx_PyInt_As_int(PyObject * x)22213 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
22214     const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
22215     const int is_unsigned = neg_one > const_zero;
22216 #if PY_MAJOR_VERSION < 3
22217     if (likely(PyInt_Check(x))) {
22218         if (sizeof(int) < sizeof(long)) {
22219             __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
22220         } else {
22221             long val = PyInt_AS_LONG(x);
22222             if (is_unsigned && unlikely(val < 0)) {
22223                 goto raise_neg_overflow;
22224             }
22225             return (int) val;
22226         }
22227     } else
22228 #endif
22229     if (likely(PyLong_Check(x))) {
22230         if (is_unsigned) {
22231 #if CYTHON_USE_PYLONG_INTERNALS
22232             const digit* digits = ((PyLongObject*)x)->ob_digit;
22233             switch (Py_SIZE(x)) {
22234                 case  0: return (int) 0;
22235                 case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
22236                 case 2:
22237                     if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
22238                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
22239                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
22240                         } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
22241                             return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
22242                         }
22243                     }
22244                     break;
22245                 case 3:
22246                     if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
22247                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
22248                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
22249                         } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
22250                             return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
22251                         }
22252                     }
22253                     break;
22254                 case 4:
22255                     if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
22256                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
22257                             __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])))
22258                         } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
22259                             return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
22260                         }
22261                     }
22262                     break;
22263             }
22264 #endif
22265 #if CYTHON_COMPILING_IN_CPYTHON
22266             if (unlikely(Py_SIZE(x) < 0)) {
22267                 goto raise_neg_overflow;
22268             }
22269 #else
22270             {
22271                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
22272                 if (unlikely(result < 0))
22273                     return (int) -1;
22274                 if (unlikely(result == 1))
22275                     goto raise_neg_overflow;
22276             }
22277 #endif
22278             if (sizeof(int) <= sizeof(unsigned long)) {
22279                 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
22280 #ifdef HAVE_LONG_LONG
22281             } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
22282                 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
22283 #endif
22284             }
22285         } else {
22286 #if CYTHON_USE_PYLONG_INTERNALS
22287             const digit* digits = ((PyLongObject*)x)->ob_digit;
22288             switch (Py_SIZE(x)) {
22289                 case  0: return (int) 0;
22290                 case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
22291                 case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
22292                 case -2:
22293                     if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
22294                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
22295                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
22296                         } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
22297                             return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
22298                         }
22299                     }
22300                     break;
22301                 case 2:
22302                     if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
22303                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
22304                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
22305                         } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
22306                             return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
22307                         }
22308                     }
22309                     break;
22310                 case -3:
22311                     if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
22312                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
22313                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
22314                         } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
22315                             return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
22316                         }
22317                     }
22318                     break;
22319                 case 3:
22320                     if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
22321                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
22322                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
22323                         } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
22324                             return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
22325                         }
22326                     }
22327                     break;
22328                 case -4:
22329                     if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
22330                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
22331                             __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])))
22332                         } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
22333                             return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
22334                         }
22335                     }
22336                     break;
22337                 case 4:
22338                     if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
22339                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
22340                             __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])))
22341                         } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
22342                             return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
22343                         }
22344                     }
22345                     break;
22346             }
22347 #endif
22348             if (sizeof(int) <= sizeof(long)) {
22349                 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
22350 #ifdef HAVE_LONG_LONG
22351             } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
22352                 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
22353 #endif
22354             }
22355         }
22356         {
22357 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
22358             PyErr_SetString(PyExc_RuntimeError,
22359                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
22360 #else
22361             int val;
22362             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
22363  #if PY_MAJOR_VERSION < 3
22364             if (likely(v) && !PyLong_Check(v)) {
22365                 PyObject *tmp = v;
22366                 v = PyNumber_Long(tmp);
22367                 Py_DECREF(tmp);
22368             }
22369  #endif
22370             if (likely(v)) {
22371                 int one = 1; int is_little = (int)*(unsigned char *)&one;
22372                 unsigned char *bytes = (unsigned char *)&val;
22373                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
22374                                               bytes, sizeof(val),
22375                                               is_little, !is_unsigned);
22376                 Py_DECREF(v);
22377                 if (likely(!ret))
22378                     return val;
22379             }
22380 #endif
22381             return (int) -1;
22382         }
22383     } else {
22384         int val;
22385         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
22386         if (!tmp) return (int) -1;
22387         val = __Pyx_PyInt_As_int(tmp);
22388         Py_DECREF(tmp);
22389         return val;
22390     }
22391 raise_overflow:
22392     PyErr_SetString(PyExc_OverflowError,
22393         "value too large to convert to int");
22394     return (int) -1;
22395 raise_neg_overflow:
22396     PyErr_SetString(PyExc_OverflowError,
22397         "can't convert negative value to int");
22398     return (int) -1;
22399 }
22400 
22401 /* CIntFromPy */
__Pyx_PyInt_As_long(PyObject * x)22402 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
22403     const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
22404     const int is_unsigned = neg_one > const_zero;
22405 #if PY_MAJOR_VERSION < 3
22406     if (likely(PyInt_Check(x))) {
22407         if (sizeof(long) < sizeof(long)) {
22408             __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
22409         } else {
22410             long val = PyInt_AS_LONG(x);
22411             if (is_unsigned && unlikely(val < 0)) {
22412                 goto raise_neg_overflow;
22413             }
22414             return (long) val;
22415         }
22416     } else
22417 #endif
22418     if (likely(PyLong_Check(x))) {
22419         if (is_unsigned) {
22420 #if CYTHON_USE_PYLONG_INTERNALS
22421             const digit* digits = ((PyLongObject*)x)->ob_digit;
22422             switch (Py_SIZE(x)) {
22423                 case  0: return (long) 0;
22424                 case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
22425                 case 2:
22426                     if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
22427                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
22428                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
22429                         } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
22430                             return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
22431                         }
22432                     }
22433                     break;
22434                 case 3:
22435                     if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
22436                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
22437                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
22438                         } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
22439                             return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
22440                         }
22441                     }
22442                     break;
22443                 case 4:
22444                     if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
22445                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
22446                             __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])))
22447                         } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
22448                             return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
22449                         }
22450                     }
22451                     break;
22452             }
22453 #endif
22454 #if CYTHON_COMPILING_IN_CPYTHON
22455             if (unlikely(Py_SIZE(x) < 0)) {
22456                 goto raise_neg_overflow;
22457             }
22458 #else
22459             {
22460                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
22461                 if (unlikely(result < 0))
22462                     return (long) -1;
22463                 if (unlikely(result == 1))
22464                     goto raise_neg_overflow;
22465             }
22466 #endif
22467             if (sizeof(long) <= sizeof(unsigned long)) {
22468                 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
22469 #ifdef HAVE_LONG_LONG
22470             } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
22471                 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
22472 #endif
22473             }
22474         } else {
22475 #if CYTHON_USE_PYLONG_INTERNALS
22476             const digit* digits = ((PyLongObject*)x)->ob_digit;
22477             switch (Py_SIZE(x)) {
22478                 case  0: return (long) 0;
22479                 case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
22480                 case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
22481                 case -2:
22482                     if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
22483                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
22484                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
22485                         } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
22486                             return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
22487                         }
22488                     }
22489                     break;
22490                 case 2:
22491                     if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
22492                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
22493                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
22494                         } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
22495                             return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
22496                         }
22497                     }
22498                     break;
22499                 case -3:
22500                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
22501                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
22502                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
22503                         } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
22504                             return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
22505                         }
22506                     }
22507                     break;
22508                 case 3:
22509                     if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
22510                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
22511                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
22512                         } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
22513                             return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
22514                         }
22515                     }
22516                     break;
22517                 case -4:
22518                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
22519                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
22520                             __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])))
22521                         } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
22522                             return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
22523                         }
22524                     }
22525                     break;
22526                 case 4:
22527                     if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
22528                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
22529                             __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])))
22530                         } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
22531                             return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
22532                         }
22533                     }
22534                     break;
22535             }
22536 #endif
22537             if (sizeof(long) <= sizeof(long)) {
22538                 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
22539 #ifdef HAVE_LONG_LONG
22540             } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
22541                 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
22542 #endif
22543             }
22544         }
22545         {
22546 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
22547             PyErr_SetString(PyExc_RuntimeError,
22548                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
22549 #else
22550             long val;
22551             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
22552  #if PY_MAJOR_VERSION < 3
22553             if (likely(v) && !PyLong_Check(v)) {
22554                 PyObject *tmp = v;
22555                 v = PyNumber_Long(tmp);
22556                 Py_DECREF(tmp);
22557             }
22558  #endif
22559             if (likely(v)) {
22560                 int one = 1; int is_little = (int)*(unsigned char *)&one;
22561                 unsigned char *bytes = (unsigned char *)&val;
22562                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
22563                                               bytes, sizeof(val),
22564                                               is_little, !is_unsigned);
22565                 Py_DECREF(v);
22566                 if (likely(!ret))
22567                     return val;
22568             }
22569 #endif
22570             return (long) -1;
22571         }
22572     } else {
22573         long val;
22574         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
22575         if (!tmp) return (long) -1;
22576         val = __Pyx_PyInt_As_long(tmp);
22577         Py_DECREF(tmp);
22578         return val;
22579     }
22580 raise_overflow:
22581     PyErr_SetString(PyExc_OverflowError,
22582         "value too large to convert to long");
22583     return (long) -1;
22584 raise_neg_overflow:
22585     PyErr_SetString(PyExc_OverflowError,
22586         "can't convert negative value to long");
22587     return (long) -1;
22588 }
22589 
22590 /* PyObjectGetMethod */
__Pyx_PyObject_GetMethod(PyObject * obj,PyObject * name,PyObject ** method)22591 static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
22592     PyObject *attr;
22593 #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
22594     PyTypeObject *tp = Py_TYPE(obj);
22595     PyObject *descr;
22596     descrgetfunc f = NULL;
22597     PyObject **dictptr, *dict;
22598     int meth_found = 0;
22599     assert (*method == NULL);
22600     if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
22601         attr = __Pyx_PyObject_GetAttrStr(obj, name);
22602         goto try_unpack;
22603     }
22604     if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
22605         return 0;
22606     }
22607     descr = _PyType_Lookup(tp, name);
22608     if (likely(descr != NULL)) {
22609         Py_INCREF(descr);
22610 #if PY_MAJOR_VERSION >= 3
22611         #ifdef __Pyx_CyFunction_USED
22612         if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
22613         #else
22614         if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type)))
22615         #endif
22616 #else
22617         #ifdef __Pyx_CyFunction_USED
22618         if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
22619         #else
22620         if (likely(PyFunction_Check(descr)))
22621         #endif
22622 #endif
22623         {
22624             meth_found = 1;
22625         } else {
22626             f = Py_TYPE(descr)->tp_descr_get;
22627             if (f != NULL && PyDescr_IsData(descr)) {
22628                 attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
22629                 Py_DECREF(descr);
22630                 goto try_unpack;
22631             }
22632         }
22633     }
22634     dictptr = _PyObject_GetDictPtr(obj);
22635     if (dictptr != NULL && (dict = *dictptr) != NULL) {
22636         Py_INCREF(dict);
22637         attr = __Pyx_PyDict_GetItemStr(dict, name);
22638         if (attr != NULL) {
22639             Py_INCREF(attr);
22640             Py_DECREF(dict);
22641             Py_XDECREF(descr);
22642             goto try_unpack;
22643         }
22644         Py_DECREF(dict);
22645     }
22646     if (meth_found) {
22647         *method = descr;
22648         return 1;
22649     }
22650     if (f != NULL) {
22651         attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
22652         Py_DECREF(descr);
22653         goto try_unpack;
22654     }
22655     if (descr != NULL) {
22656         *method = descr;
22657         return 0;
22658     }
22659     PyErr_Format(PyExc_AttributeError,
22660 #if PY_MAJOR_VERSION >= 3
22661                  "'%.50s' object has no attribute '%U'",
22662                  tp->tp_name, name);
22663 #else
22664                  "'%.50s' object has no attribute '%.400s'",
22665                  tp->tp_name, PyString_AS_STRING(name));
22666 #endif
22667     return 0;
22668 #else
22669     attr = __Pyx_PyObject_GetAttrStr(obj, name);
22670     goto try_unpack;
22671 #endif
22672 try_unpack:
22673 #if CYTHON_UNPACK_METHODS
22674     if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
22675         PyObject *function = PyMethod_GET_FUNCTION(attr);
22676         Py_INCREF(function);
22677         Py_DECREF(attr);
22678         *method = function;
22679         return 1;
22680     }
22681 #endif
22682     *method = attr;
22683     return 0;
22684 }
22685 
22686 /* PyObjectCallMethod1 */
__Pyx__PyObject_CallMethod1(PyObject * method,PyObject * arg)22687 static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
22688     PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
22689     Py_DECREF(method);
22690     return result;
22691 }
__Pyx_PyObject_CallMethod1(PyObject * obj,PyObject * method_name,PyObject * arg)22692 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
22693     PyObject *method = NULL, *result;
22694     int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
22695     if (likely(is_method)) {
22696         result = __Pyx_PyObject_Call2Args(method, obj, arg);
22697         Py_DECREF(method);
22698         return result;
22699     }
22700     if (unlikely(!method)) return NULL;
22701     return __Pyx__PyObject_CallMethod1(method, arg);
22702 }
22703 
22704 /* CoroutineBase */
22705 #include <structmember.h>
22706 #include <frameobject.h>
22707 #define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
__Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState * __pyx_tstate,PyObject ** pvalue)22708 static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject **pvalue) {
22709     PyObject *et, *ev, *tb;
22710     PyObject *value = NULL;
22711     __Pyx_ErrFetch(&et, &ev, &tb);
22712     if (!et) {
22713         Py_XDECREF(tb);
22714         Py_XDECREF(ev);
22715         Py_INCREF(Py_None);
22716         *pvalue = Py_None;
22717         return 0;
22718     }
22719     if (likely(et == PyExc_StopIteration)) {
22720         if (!ev) {
22721             Py_INCREF(Py_None);
22722             value = Py_None;
22723         }
22724 #if PY_VERSION_HEX >= 0x030300A0
22725         else if (Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) {
22726             value = ((PyStopIterationObject *)ev)->value;
22727             Py_INCREF(value);
22728             Py_DECREF(ev);
22729         }
22730 #endif
22731         else if (unlikely(PyTuple_Check(ev))) {
22732             if (PyTuple_GET_SIZE(ev) >= 1) {
22733 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
22734                 value = PyTuple_GET_ITEM(ev, 0);
22735                 Py_INCREF(value);
22736 #else
22737                 value = PySequence_ITEM(ev, 0);
22738 #endif
22739             } else {
22740                 Py_INCREF(Py_None);
22741                 value = Py_None;
22742             }
22743             Py_DECREF(ev);
22744         }
22745         else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
22746             value = ev;
22747         }
22748         if (likely(value)) {
22749             Py_XDECREF(tb);
22750             Py_DECREF(et);
22751             *pvalue = value;
22752             return 0;
22753         }
22754     } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
22755         __Pyx_ErrRestore(et, ev, tb);
22756         return -1;
22757     }
22758     PyErr_NormalizeException(&et, &ev, &tb);
22759     if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
22760         __Pyx_ErrRestore(et, ev, tb);
22761         return -1;
22762     }
22763     Py_XDECREF(tb);
22764     Py_DECREF(et);
22765 #if PY_VERSION_HEX >= 0x030300A0
22766     value = ((PyStopIterationObject *)ev)->value;
22767     Py_INCREF(value);
22768     Py_DECREF(ev);
22769 #else
22770     {
22771         PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args);
22772         Py_DECREF(ev);
22773         if (likely(args)) {
22774             value = PySequence_GetItem(args, 0);
22775             Py_DECREF(args);
22776         }
22777         if (unlikely(!value)) {
22778             __Pyx_ErrRestore(NULL, NULL, NULL);
22779             Py_INCREF(Py_None);
22780             value = Py_None;
22781         }
22782     }
22783 #endif
22784     *pvalue = value;
22785     return 0;
22786 }
22787 static CYTHON_INLINE
__Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct * exc_state)22788 void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) {
22789     PyObject *t, *v, *tb;
22790     t = exc_state->exc_type;
22791     v = exc_state->exc_value;
22792     tb = exc_state->exc_traceback;
22793     exc_state->exc_type = NULL;
22794     exc_state->exc_value = NULL;
22795     exc_state->exc_traceback = NULL;
22796     Py_XDECREF(t);
22797     Py_XDECREF(v);
22798     Py_XDECREF(tb);
22799 }
22800 #define __Pyx_Coroutine_AlreadyRunningError(gen)  (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL)
__Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject * gen)22801 static void __Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject *gen) {
22802     const char *msg;
22803     if ((0)) {
22804     #ifdef __Pyx_Coroutine_USED
22805     } else if (__Pyx_Coroutine_Check((PyObject*)gen)) {
22806         msg = "coroutine already executing";
22807     #endif
22808     #ifdef __Pyx_AsyncGen_USED
22809     } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
22810         msg = "async generator already executing";
22811     #endif
22812     } else {
22813         msg = "generator already executing";
22814     }
22815     PyErr_SetString(PyExc_ValueError, msg);
22816 }
22817 #define __Pyx_Coroutine_NotStartedError(gen)  (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL)
__Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject * gen)22818 static void __Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject *gen) {
22819     const char *msg;
22820     if ((0)) {
22821     #ifdef __Pyx_Coroutine_USED
22822     } else if (__Pyx_Coroutine_Check(gen)) {
22823         msg = "can't send non-None value to a just-started coroutine";
22824     #endif
22825     #ifdef __Pyx_AsyncGen_USED
22826     } else if (__Pyx_AsyncGen_CheckExact(gen)) {
22827         msg = "can't send non-None value to a just-started async generator";
22828     #endif
22829     } else {
22830         msg = "can't send non-None value to a just-started generator";
22831     }
22832     PyErr_SetString(PyExc_TypeError, msg);
22833 }
22834 #define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing)  (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL)
__Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject * gen,PyObject * value,CYTHON_UNUSED int closing)22835 static void __Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject *gen, PyObject *value, CYTHON_UNUSED int closing) {
22836     #ifdef __Pyx_Coroutine_USED
22837     if (!closing && __Pyx_Coroutine_Check(gen)) {
22838         PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine");
22839     } else
22840     #endif
22841     if (value) {
22842         #ifdef __Pyx_AsyncGen_USED
22843         if (__Pyx_AsyncGen_CheckExact(gen))
22844             PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration);
22845         else
22846         #endif
22847         PyErr_SetNone(PyExc_StopIteration);
22848     }
22849 }
22850 static
__Pyx_Coroutine_SendEx(__pyx_CoroutineObject * self,PyObject * value,int closing)22851 PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) {
22852     __Pyx_PyThreadState_declare
22853     PyThreadState *tstate;
22854     __Pyx_ExcInfoStruct *exc_state;
22855     PyObject *retval;
22856     assert(!self->is_running);
22857     if (unlikely(self->resume_label == 0)) {
22858         if (unlikely(value && value != Py_None)) {
22859             return __Pyx_Coroutine_NotStartedError((PyObject*)self);
22860         }
22861     }
22862     if (unlikely(self->resume_label == -1)) {
22863         return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing);
22864     }
22865 #if CYTHON_FAST_THREAD_STATE
22866     __Pyx_PyThreadState_assign
22867     tstate = __pyx_tstate;
22868 #else
22869     tstate = __Pyx_PyThreadState_Current;
22870 #endif
22871     exc_state = &self->gi_exc_state;
22872     if (exc_state->exc_type) {
22873         #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
22874         #else
22875         if (exc_state->exc_traceback) {
22876             PyTracebackObject *tb = (PyTracebackObject *) exc_state->exc_traceback;
22877             PyFrameObject *f = tb->tb_frame;
22878             Py_XINCREF(tstate->frame);
22879             assert(f->f_back == NULL);
22880             f->f_back = tstate->frame;
22881         }
22882         #endif
22883     }
22884 #if CYTHON_USE_EXC_INFO_STACK
22885     exc_state->previous_item = tstate->exc_info;
22886     tstate->exc_info = exc_state;
22887 #else
22888     if (exc_state->exc_type) {
22889         __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
22890     } else {
22891         __Pyx_Coroutine_ExceptionClear(exc_state);
22892         __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
22893     }
22894 #endif
22895     self->is_running = 1;
22896     retval = self->body((PyObject *) self, tstate, value);
22897     self->is_running = 0;
22898 #if CYTHON_USE_EXC_INFO_STACK
22899     exc_state = &self->gi_exc_state;
22900     tstate->exc_info = exc_state->previous_item;
22901     exc_state->previous_item = NULL;
22902     __Pyx_Coroutine_ResetFrameBackpointer(exc_state);
22903 #endif
22904     return retval;
22905 }
__Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct * exc_state)22906 static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) {
22907     PyObject *exc_tb = exc_state->exc_traceback;
22908     if (likely(exc_tb)) {
22909 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
22910 #else
22911         PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
22912         PyFrameObject *f = tb->tb_frame;
22913         Py_CLEAR(f->f_back);
22914 #endif
22915     }
22916 }
22917 static CYTHON_INLINE
__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject * gen,PyObject * retval)22918 PyObject *__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject* gen, PyObject *retval) {
22919     if (unlikely(!retval)) {
22920         __Pyx_PyThreadState_declare
22921         __Pyx_PyThreadState_assign
22922         if (!__Pyx_PyErr_Occurred()) {
22923             PyObject *exc = PyExc_StopIteration;
22924             #ifdef __Pyx_AsyncGen_USED
22925             if (__Pyx_AsyncGen_CheckExact(gen))
22926                 exc = __Pyx_PyExc_StopAsyncIteration;
22927             #endif
22928             __Pyx_PyErr_SetNone(exc);
22929         }
22930     }
22931     return retval;
22932 }
22933 static CYTHON_INLINE
__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject * gen)22934 PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
22935     PyObject *ret;
22936     PyObject *val = NULL;
22937     __Pyx_Coroutine_Undelegate(gen);
22938     __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
22939     ret = __Pyx_Coroutine_SendEx(gen, val, 0);
22940     Py_XDECREF(val);
22941     return ret;
22942 }
__Pyx_Coroutine_Send(PyObject * self,PyObject * value)22943 static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
22944     PyObject *retval;
22945     __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
22946     PyObject *yf = gen->yieldfrom;
22947     if (unlikely(gen->is_running))
22948         return __Pyx_Coroutine_AlreadyRunningError(gen);
22949     if (yf) {
22950         PyObject *ret;
22951         gen->is_running = 1;
22952         #ifdef __Pyx_Generator_USED
22953         if (__Pyx_Generator_CheckExact(yf)) {
22954             ret = __Pyx_Coroutine_Send(yf, value);
22955         } else
22956         #endif
22957         #ifdef __Pyx_Coroutine_USED
22958         if (__Pyx_Coroutine_Check(yf)) {
22959             ret = __Pyx_Coroutine_Send(yf, value);
22960         } else
22961         #endif
22962         #ifdef __Pyx_AsyncGen_USED
22963         if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
22964             ret = __Pyx_async_gen_asend_send(yf, value);
22965         } else
22966         #endif
22967         #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
22968         if (PyGen_CheckExact(yf)) {
22969             ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
22970         } else
22971         #endif
22972         #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
22973         if (PyCoro_CheckExact(yf)) {
22974             ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
22975         } else
22976         #endif
22977         {
22978             if (value == Py_None)
22979                 ret = Py_TYPE(yf)->tp_iternext(yf);
22980             else
22981                 ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
22982         }
22983         gen->is_running = 0;
22984         if (likely(ret)) {
22985             return ret;
22986         }
22987         retval = __Pyx_Coroutine_FinishDelegation(gen);
22988     } else {
22989         retval = __Pyx_Coroutine_SendEx(gen, value, 0);
22990     }
22991     return __Pyx_Coroutine_MethodReturn(self, retval);
22992 }
__Pyx_Coroutine_CloseIter(__pyx_CoroutineObject * gen,PyObject * yf)22993 static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
22994     PyObject *retval = NULL;
22995     int err = 0;
22996     #ifdef __Pyx_Generator_USED
22997     if (__Pyx_Generator_CheckExact(yf)) {
22998         retval = __Pyx_Coroutine_Close(yf);
22999         if (!retval)
23000             return -1;
23001     } else
23002     #endif
23003     #ifdef __Pyx_Coroutine_USED
23004     if (__Pyx_Coroutine_Check(yf)) {
23005         retval = __Pyx_Coroutine_Close(yf);
23006         if (!retval)
23007             return -1;
23008     } else
23009     if (__Pyx_CoroutineAwait_CheckExact(yf)) {
23010         retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL);
23011         if (!retval)
23012             return -1;
23013     } else
23014     #endif
23015     #ifdef __Pyx_AsyncGen_USED
23016     if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
23017         retval = __Pyx_async_gen_asend_close(yf, NULL);
23018     } else
23019     if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
23020         retval = __Pyx_async_gen_athrow_close(yf, NULL);
23021     } else
23022     #endif
23023     {
23024         PyObject *meth;
23025         gen->is_running = 1;
23026         meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close);
23027         if (unlikely(!meth)) {
23028             if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
23029                 PyErr_WriteUnraisable(yf);
23030             }
23031             PyErr_Clear();
23032         } else {
23033             retval = PyObject_CallFunction(meth, NULL);
23034             Py_DECREF(meth);
23035             if (!retval)
23036                 err = -1;
23037         }
23038         gen->is_running = 0;
23039     }
23040     Py_XDECREF(retval);
23041     return err;
23042 }
__Pyx_Generator_Next(PyObject * self)23043 static PyObject *__Pyx_Generator_Next(PyObject *self) {
23044     __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
23045     PyObject *yf = gen->yieldfrom;
23046     if (unlikely(gen->is_running))
23047         return __Pyx_Coroutine_AlreadyRunningError(gen);
23048     if (yf) {
23049         PyObject *ret;
23050         gen->is_running = 1;
23051         #ifdef __Pyx_Generator_USED
23052         if (__Pyx_Generator_CheckExact(yf)) {
23053             ret = __Pyx_Generator_Next(yf);
23054         } else
23055         #endif
23056         #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
23057         if (PyGen_CheckExact(yf)) {
23058             ret = _PyGen_Send((PyGenObject*)yf, NULL);
23059         } else
23060         #endif
23061         #ifdef __Pyx_Coroutine_USED
23062         if (__Pyx_Coroutine_Check(yf)) {
23063             ret = __Pyx_Coroutine_Send(yf, Py_None);
23064         } else
23065         #endif
23066             ret = Py_TYPE(yf)->tp_iternext(yf);
23067         gen->is_running = 0;
23068         if (likely(ret)) {
23069             return ret;
23070         }
23071         return __Pyx_Coroutine_FinishDelegation(gen);
23072     }
23073     return __Pyx_Coroutine_SendEx(gen, Py_None, 0);
23074 }
__Pyx_Coroutine_Close_Method(PyObject * self,CYTHON_UNUSED PyObject * arg)23075 static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, CYTHON_UNUSED PyObject *arg) {
23076     return __Pyx_Coroutine_Close(self);
23077 }
__Pyx_Coroutine_Close(PyObject * self)23078 static PyObject *__Pyx_Coroutine_Close(PyObject *self) {
23079     __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
23080     PyObject *retval, *raised_exception;
23081     PyObject *yf = gen->yieldfrom;
23082     int err = 0;
23083     if (unlikely(gen->is_running))
23084         return __Pyx_Coroutine_AlreadyRunningError(gen);
23085     if (yf) {
23086         Py_INCREF(yf);
23087         err = __Pyx_Coroutine_CloseIter(gen, yf);
23088         __Pyx_Coroutine_Undelegate(gen);
23089         Py_DECREF(yf);
23090     }
23091     if (err == 0)
23092         PyErr_SetNone(PyExc_GeneratorExit);
23093     retval = __Pyx_Coroutine_SendEx(gen, NULL, 1);
23094     if (unlikely(retval)) {
23095         const char *msg;
23096         Py_DECREF(retval);
23097         if ((0)) {
23098         #ifdef __Pyx_Coroutine_USED
23099         } else if (__Pyx_Coroutine_Check(self)) {
23100             msg = "coroutine ignored GeneratorExit";
23101         #endif
23102         #ifdef __Pyx_AsyncGen_USED
23103         } else if (__Pyx_AsyncGen_CheckExact(self)) {
23104 #if PY_VERSION_HEX < 0x03060000
23105             msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)";
23106 #else
23107             msg = "async generator ignored GeneratorExit";
23108 #endif
23109         #endif
23110         } else {
23111             msg = "generator ignored GeneratorExit";
23112         }
23113         PyErr_SetString(PyExc_RuntimeError, msg);
23114         return NULL;
23115     }
23116     raised_exception = PyErr_Occurred();
23117     if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) {
23118         if (raised_exception) PyErr_Clear();
23119         Py_INCREF(Py_None);
23120         return Py_None;
23121     }
23122     return NULL;
23123 }
__Pyx__Coroutine_Throw(PyObject * self,PyObject * typ,PyObject * val,PyObject * tb,PyObject * args,int close_on_genexit)23124 static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb,
23125                                         PyObject *args, int close_on_genexit) {
23126     __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
23127     PyObject *yf = gen->yieldfrom;
23128     if (unlikely(gen->is_running))
23129         return __Pyx_Coroutine_AlreadyRunningError(gen);
23130     if (yf) {
23131         PyObject *ret;
23132         Py_INCREF(yf);
23133         if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
23134             int err = __Pyx_Coroutine_CloseIter(gen, yf);
23135             Py_DECREF(yf);
23136             __Pyx_Coroutine_Undelegate(gen);
23137             if (err < 0)
23138                 return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
23139             goto throw_here;
23140         }
23141         gen->is_running = 1;
23142         if (0
23143         #ifdef __Pyx_Generator_USED
23144             || __Pyx_Generator_CheckExact(yf)
23145         #endif
23146         #ifdef __Pyx_Coroutine_USED
23147             || __Pyx_Coroutine_Check(yf)
23148         #endif
23149             ) {
23150             ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
23151         #ifdef __Pyx_Coroutine_USED
23152         } else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
23153             ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
23154         #endif
23155         } else {
23156             PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw);
23157             if (unlikely(!meth)) {
23158                 Py_DECREF(yf);
23159                 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
23160                     gen->is_running = 0;
23161                     return NULL;
23162                 }
23163                 PyErr_Clear();
23164                 __Pyx_Coroutine_Undelegate(gen);
23165                 gen->is_running = 0;
23166                 goto throw_here;
23167             }
23168             if (likely(args)) {
23169                 ret = PyObject_CallObject(meth, args);
23170             } else {
23171                 ret = PyObject_CallFunctionObjArgs(meth, typ, val, tb, NULL);
23172             }
23173             Py_DECREF(meth);
23174         }
23175         gen->is_running = 0;
23176         Py_DECREF(yf);
23177         if (!ret) {
23178             ret = __Pyx_Coroutine_FinishDelegation(gen);
23179         }
23180         return __Pyx_Coroutine_MethodReturn(self, ret);
23181     }
23182 throw_here:
23183     __Pyx_Raise(typ, val, tb, NULL);
23184     return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
23185 }
__Pyx_Coroutine_Throw(PyObject * self,PyObject * args)23186 static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
23187     PyObject *typ;
23188     PyObject *val = NULL;
23189     PyObject *tb = NULL;
23190     if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))
23191         return NULL;
23192     return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1);
23193 }
__Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct * exc_state,visitproc visit,void * arg)23194 static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) {
23195     Py_VISIT(exc_state->exc_type);
23196     Py_VISIT(exc_state->exc_value);
23197     Py_VISIT(exc_state->exc_traceback);
23198     return 0;
23199 }
__Pyx_Coroutine_traverse(__pyx_CoroutineObject * gen,visitproc visit,void * arg)23200 static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) {
23201     Py_VISIT(gen->closure);
23202     Py_VISIT(gen->classobj);
23203     Py_VISIT(gen->yieldfrom);
23204     return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg);
23205 }
__Pyx_Coroutine_clear(PyObject * self)23206 static int __Pyx_Coroutine_clear(PyObject *self) {
23207     __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
23208     Py_CLEAR(gen->closure);
23209     Py_CLEAR(gen->classobj);
23210     Py_CLEAR(gen->yieldfrom);
23211     __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state);
23212 #ifdef __Pyx_AsyncGen_USED
23213     if (__Pyx_AsyncGen_CheckExact(self)) {
23214         Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
23215     }
23216 #endif
23217     Py_CLEAR(gen->gi_code);
23218     Py_CLEAR(gen->gi_name);
23219     Py_CLEAR(gen->gi_qualname);
23220     Py_CLEAR(gen->gi_modulename);
23221     return 0;
23222 }
__Pyx_Coroutine_dealloc(PyObject * self)23223 static void __Pyx_Coroutine_dealloc(PyObject *self) {
23224     __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
23225     PyObject_GC_UnTrack(gen);
23226     if (gen->gi_weakreflist != NULL)
23227         PyObject_ClearWeakRefs(self);
23228     if (gen->resume_label >= 0) {
23229         PyObject_GC_Track(self);
23230 #if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE
23231         if (PyObject_CallFinalizerFromDealloc(self))
23232 #else
23233         Py_TYPE(gen)->tp_del(self);
23234         if (self->ob_refcnt > 0)
23235 #endif
23236         {
23237             return;
23238         }
23239         PyObject_GC_UnTrack(self);
23240     }
23241 #ifdef __Pyx_AsyncGen_USED
23242     if (__Pyx_AsyncGen_CheckExact(self)) {
23243         /* We have to handle this case for asynchronous generators
23244            right here, because this code has to be between UNTRACK
23245            and GC_Del. */
23246         Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer);
23247     }
23248 #endif
23249     __Pyx_Coroutine_clear(self);
23250     PyObject_GC_Del(gen);
23251 }
__Pyx_Coroutine_del(PyObject * self)23252 static void __Pyx_Coroutine_del(PyObject *self) {
23253     PyObject *error_type, *error_value, *error_traceback;
23254     __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
23255     __Pyx_PyThreadState_declare
23256     if (gen->resume_label < 0) {
23257         return;
23258     }
23259 #if !CYTHON_USE_TP_FINALIZE
23260     assert(self->ob_refcnt == 0);
23261     self->ob_refcnt = 1;
23262 #endif
23263     __Pyx_PyThreadState_assign
23264     __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
23265 #ifdef __Pyx_AsyncGen_USED
23266     if (__Pyx_AsyncGen_CheckExact(self)) {
23267         __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self;
23268         PyObject *finalizer = agen->ag_finalizer;
23269         if (finalizer && !agen->ag_closed) {
23270             PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self);
23271             if (unlikely(!res)) {
23272                 PyErr_WriteUnraisable(self);
23273             } else {
23274                 Py_DECREF(res);
23275             }
23276             __Pyx_ErrRestore(error_type, error_value, error_traceback);
23277             return;
23278         }
23279     }
23280 #endif
23281     if (unlikely(gen->resume_label == 0 && !error_value)) {
23282 #ifdef __Pyx_Coroutine_USED
23283 #ifdef __Pyx_Generator_USED
23284     if (!__Pyx_Generator_CheckExact(self))
23285 #endif
23286         {
23287         PyObject_GC_UnTrack(self);
23288 #if PY_MAJOR_VERSION >= 3  || defined(PyErr_WarnFormat)
23289         if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
23290             PyErr_WriteUnraisable(self);
23291 #else
23292         {PyObject *msg;
23293         char *cmsg;
23294         #if CYTHON_COMPILING_IN_PYPY
23295         msg = NULL;
23296         cmsg = (char*) "coroutine was never awaited";
23297         #else
23298         char *cname;
23299         PyObject *qualname;
23300         qualname = gen->gi_qualname;
23301         cname = PyString_AS_STRING(qualname);
23302         msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname);
23303         if (unlikely(!msg)) {
23304             PyErr_Clear();
23305             cmsg = (char*) "coroutine was never awaited";
23306         } else {
23307             cmsg = PyString_AS_STRING(msg);
23308         }
23309         #endif
23310         if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0))
23311             PyErr_WriteUnraisable(self);
23312         Py_XDECREF(msg);}
23313 #endif
23314         PyObject_GC_Track(self);
23315         }
23316 #endif
23317     } else {
23318         PyObject *res = __Pyx_Coroutine_Close(self);
23319         if (unlikely(!res)) {
23320             if (PyErr_Occurred())
23321                 PyErr_WriteUnraisable(self);
23322         } else {
23323             Py_DECREF(res);
23324         }
23325     }
23326     __Pyx_ErrRestore(error_type, error_value, error_traceback);
23327 #if !CYTHON_USE_TP_FINALIZE
23328     assert(self->ob_refcnt > 0);
23329     if (--self->ob_refcnt == 0) {
23330         return;
23331     }
23332     {
23333         Py_ssize_t refcnt = self->ob_refcnt;
23334         _Py_NewReference(self);
23335         self->ob_refcnt = refcnt;
23336     }
23337 #if CYTHON_COMPILING_IN_CPYTHON
23338     assert(PyType_IS_GC(self->ob_type) &&
23339            _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
23340     _Py_DEC_REFTOTAL;
23341 #endif
23342 #ifdef COUNT_ALLOCS
23343     --Py_TYPE(self)->tp_frees;
23344     --Py_TYPE(self)->tp_allocs;
23345 #endif
23346 #endif
23347 }
23348 static PyObject *
__Pyx_Coroutine_get_name(__pyx_CoroutineObject * self,CYTHON_UNUSED void * context)23349 __Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
23350 {
23351     PyObject *name = self->gi_name;
23352     if (unlikely(!name)) name = Py_None;
23353     Py_INCREF(name);
23354     return name;
23355 }
23356 static int
__Pyx_Coroutine_set_name(__pyx_CoroutineObject * self,PyObject * value,CYTHON_UNUSED void * context)23357 __Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context)
23358 {
23359     PyObject *tmp;
23360 #if PY_MAJOR_VERSION >= 3
23361     if (unlikely(value == NULL || !PyUnicode_Check(value)))
23362 #else
23363     if (unlikely(value == NULL || !PyString_Check(value)))
23364 #endif
23365     {
23366         PyErr_SetString(PyExc_TypeError,
23367                         "__name__ must be set to a string object");
23368         return -1;
23369     }
23370     tmp = self->gi_name;
23371     Py_INCREF(value);
23372     self->gi_name = value;
23373     Py_XDECREF(tmp);
23374     return 0;
23375 }
23376 static PyObject *
__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject * self,CYTHON_UNUSED void * context)23377 __Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
23378 {
23379     PyObject *name = self->gi_qualname;
23380     if (unlikely(!name)) name = Py_None;
23381     Py_INCREF(name);
23382     return name;
23383 }
23384 static int
__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject * self,PyObject * value,CYTHON_UNUSED void * context)23385 __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context)
23386 {
23387     PyObject *tmp;
23388 #if PY_MAJOR_VERSION >= 3
23389     if (unlikely(value == NULL || !PyUnicode_Check(value)))
23390 #else
23391     if (unlikely(value == NULL || !PyString_Check(value)))
23392 #endif
23393     {
23394         PyErr_SetString(PyExc_TypeError,
23395                         "__qualname__ must be set to a string object");
23396         return -1;
23397     }
23398     tmp = self->gi_qualname;
23399     Py_INCREF(value);
23400     self->gi_qualname = value;
23401     Py_XDECREF(tmp);
23402     return 0;
23403 }
__Pyx__Coroutine_New(PyTypeObject * type,__pyx_coroutine_body_t body,PyObject * code,PyObject * closure,PyObject * name,PyObject * qualname,PyObject * module_name)23404 static __pyx_CoroutineObject *__Pyx__Coroutine_New(
23405             PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
23406             PyObject *name, PyObject *qualname, PyObject *module_name) {
23407     __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
23408     if (unlikely(!gen))
23409         return NULL;
23410     return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name);
23411 }
__Pyx__Coroutine_NewInit(__pyx_CoroutineObject * gen,__pyx_coroutine_body_t body,PyObject * code,PyObject * closure,PyObject * name,PyObject * qualname,PyObject * module_name)23412 static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
23413             __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
23414             PyObject *name, PyObject *qualname, PyObject *module_name) {
23415     gen->body = body;
23416     gen->closure = closure;
23417     Py_XINCREF(closure);
23418     gen->is_running = 0;
23419     gen->resume_label = 0;
23420     gen->classobj = NULL;
23421     gen->yieldfrom = NULL;
23422     gen->gi_exc_state.exc_type = NULL;
23423     gen->gi_exc_state.exc_value = NULL;
23424     gen->gi_exc_state.exc_traceback = NULL;
23425 #if CYTHON_USE_EXC_INFO_STACK
23426     gen->gi_exc_state.previous_item = NULL;
23427 #endif
23428     gen->gi_weakreflist = NULL;
23429     Py_XINCREF(qualname);
23430     gen->gi_qualname = qualname;
23431     Py_XINCREF(name);
23432     gen->gi_name = name;
23433     Py_XINCREF(module_name);
23434     gen->gi_modulename = module_name;
23435     Py_XINCREF(code);
23436     gen->gi_code = code;
23437     PyObject_GC_Track(gen);
23438     return gen;
23439 }
23440 
23441 /* PatchModuleWithCoroutine */
__Pyx_Coroutine_patch_module(PyObject * module,const char * py_code)23442 static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) {
23443 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
23444     int result;
23445     PyObject *globals, *result_obj;
23446     globals = PyDict_New();  if (unlikely(!globals)) goto ignore;
23447     result = PyDict_SetItemString(globals, "_cython_coroutine_type",
23448     #ifdef __Pyx_Coroutine_USED
23449         (PyObject*)__pyx_CoroutineType);
23450     #else
23451         Py_None);
23452     #endif
23453     if (unlikely(result < 0)) goto ignore;
23454     result = PyDict_SetItemString(globals, "_cython_generator_type",
23455     #ifdef __Pyx_Generator_USED
23456         (PyObject*)__pyx_GeneratorType);
23457     #else
23458         Py_None);
23459     #endif
23460     if (unlikely(result < 0)) goto ignore;
23461     if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore;
23462     if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore;
23463     result_obj = PyRun_String(py_code, Py_file_input, globals, globals);
23464     if (unlikely(!result_obj)) goto ignore;
23465     Py_DECREF(result_obj);
23466     Py_DECREF(globals);
23467     return module;
23468 ignore:
23469     Py_XDECREF(globals);
23470     PyErr_WriteUnraisable(module);
23471     if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) {
23472         Py_DECREF(module);
23473         module = NULL;
23474     }
23475 #else
23476     py_code++;
23477 #endif
23478     return module;
23479 }
23480 
23481 /* PatchGeneratorABC */
23482 #ifndef CYTHON_REGISTER_ABCS
23483 #define CYTHON_REGISTER_ABCS 1
23484 #endif
23485 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
23486 static PyObject* __Pyx_patch_abc_module(PyObject *module);
__Pyx_patch_abc_module(PyObject * module)23487 static PyObject* __Pyx_patch_abc_module(PyObject *module) {
23488     module = __Pyx_Coroutine_patch_module(
23489         module, ""
23490 "if _cython_generator_type is not None:\n"
23491 "    try: Generator = _module.Generator\n"
23492 "    except AttributeError: pass\n"
23493 "    else: Generator.register(_cython_generator_type)\n"
23494 "if _cython_coroutine_type is not None:\n"
23495 "    try: Coroutine = _module.Coroutine\n"
23496 "    except AttributeError: pass\n"
23497 "    else: Coroutine.register(_cython_coroutine_type)\n"
23498     );
23499     return module;
23500 }
23501 #endif
__Pyx_patch_abc(void)23502 static int __Pyx_patch_abc(void) {
23503 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
23504     static int abc_patched = 0;
23505     if (CYTHON_REGISTER_ABCS && !abc_patched) {
23506         PyObject *module;
23507         module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections");
23508         if (!module) {
23509             PyErr_WriteUnraisable(NULL);
23510             if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
23511                     ((PY_MAJOR_VERSION >= 3) ?
23512                         "Cython module failed to register with collections.abc module" :
23513                         "Cython module failed to register with collections module"), 1) < 0)) {
23514                 return -1;
23515             }
23516         } else {
23517             module = __Pyx_patch_abc_module(module);
23518             abc_patched = 1;
23519             if (unlikely(!module))
23520                 return -1;
23521             Py_DECREF(module);
23522         }
23523         module = PyImport_ImportModule("backports_abc");
23524         if (module) {
23525             module = __Pyx_patch_abc_module(module);
23526             Py_XDECREF(module);
23527         }
23528         if (!module) {
23529             PyErr_Clear();
23530         }
23531     }
23532 #else
23533     if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL);
23534 #endif
23535     return 0;
23536 }
23537 
23538 /* Generator */
23539 static PyMethodDef __pyx_Generator_methods[] = {
23540     {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
23541      (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
23542     {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
23543      (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
23544     {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS,
23545      (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")},
23546     {0, 0, 0, 0}
23547 };
23548 static PyMemberDef __pyx_Generator_memberlist[] = {
23549     {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL},
23550     {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
23551      (char*) PyDoc_STR("object being iterated by 'yield from', or None")},
23552     {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
23553     {0, 0, 0, 0, 0}
23554 };
23555 static PyGetSetDef __pyx_Generator_getsets[] = {
23556     {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
23557      (char*) PyDoc_STR("name of the generator"), 0},
23558     {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
23559      (char*) PyDoc_STR("qualified name of the generator"), 0},
23560     {0, 0, 0, 0, 0}
23561 };
23562 static PyTypeObject __pyx_GeneratorType_type = {
23563     PyVarObject_HEAD_INIT(0, 0)
23564     "generator",
23565     sizeof(__pyx_CoroutineObject),
23566     0,
23567     (destructor) __Pyx_Coroutine_dealloc,
23568     0,
23569     0,
23570     0,
23571     0,
23572     0,
23573     0,
23574     0,
23575     0,
23576     0,
23577     0,
23578     0,
23579     0,
23580     0,
23581     0,
23582     Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
23583     0,
23584     (traverseproc) __Pyx_Coroutine_traverse,
23585     0,
23586     0,
23587     offsetof(__pyx_CoroutineObject, gi_weakreflist),
23588     0,
23589     (iternextfunc) __Pyx_Generator_Next,
23590     __pyx_Generator_methods,
23591     __pyx_Generator_memberlist,
23592     __pyx_Generator_getsets,
23593     0,
23594     0,
23595     0,
23596     0,
23597     0,
23598     0,
23599     0,
23600     0,
23601     0,
23602     0,
23603     0,
23604     0,
23605     0,
23606     0,
23607     0,
23608 #if CYTHON_USE_TP_FINALIZE
23609     0,
23610 #else
23611     __Pyx_Coroutine_del,
23612 #endif
23613     0,
23614 #if CYTHON_USE_TP_FINALIZE
23615     __Pyx_Coroutine_del,
23616 #elif PY_VERSION_HEX >= 0x030400a1
23617     0,
23618 #endif
23619 #if PY_VERSION_HEX >= 0x030800b1
23620     0,
23621 #endif
23622 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
23623     0,
23624 #endif
23625 };
__pyx_Generator_init(void)23626 static int __pyx_Generator_init(void) {
23627     __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
23628     __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
23629     __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
23630     if (unlikely(!__pyx_GeneratorType)) {
23631         return -1;
23632     }
23633     return 0;
23634 }
23635 
23636 /* CheckBinaryVersion */
__Pyx_check_binary_version(void)23637 static int __Pyx_check_binary_version(void) {
23638     char ctversion[4], rtversion[4];
23639     PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
23640     PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
23641     if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
23642         char message[200];
23643         PyOS_snprintf(message, sizeof(message),
23644                       "compiletime version %s of module '%.100s' "
23645                       "does not match runtime version %s",
23646                       ctversion, __Pyx_MODULE_NAME, rtversion);
23647         return PyErr_WarnEx(NULL, message, 1);
23648     }
23649     return 0;
23650 }
23651 
23652 /* InitStrings */
__Pyx_InitStrings(__Pyx_StringTabEntry * t)23653 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
23654     while (t->p) {
23655         #if PY_MAJOR_VERSION < 3
23656         if (t->is_unicode) {
23657             *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
23658         } else if (t->intern) {
23659             *t->p = PyString_InternFromString(t->s);
23660         } else {
23661             *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
23662         }
23663         #else
23664         if (t->is_unicode | t->is_str) {
23665             if (t->intern) {
23666                 *t->p = PyUnicode_InternFromString(t->s);
23667             } else if (t->encoding) {
23668                 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
23669             } else {
23670                 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
23671             }
23672         } else {
23673             *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
23674         }
23675         #endif
23676         if (!*t->p)
23677             return -1;
23678         if (PyObject_Hash(*t->p) == -1)
23679             return -1;
23680         ++t;
23681     }
23682     return 0;
23683 }
23684 
__Pyx_PyUnicode_FromString(const char * c_str)23685 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
23686     return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
23687 }
__Pyx_PyObject_AsString(PyObject * o)23688 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
23689     Py_ssize_t ignore;
23690     return __Pyx_PyObject_AsStringAndSize(o, &ignore);
23691 }
23692 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
23693 #if !CYTHON_PEP393_ENABLED
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)23694 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
23695     char* defenc_c;
23696     PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
23697     if (!defenc) return NULL;
23698     defenc_c = PyBytes_AS_STRING(defenc);
23699 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
23700     {
23701         char* end = defenc_c + PyBytes_GET_SIZE(defenc);
23702         char* c;
23703         for (c = defenc_c; c < end; c++) {
23704             if ((unsigned char) (*c) >= 128) {
23705                 PyUnicode_AsASCIIString(o);
23706                 return NULL;
23707             }
23708         }
23709     }
23710 #endif
23711     *length = PyBytes_GET_SIZE(defenc);
23712     return defenc_c;
23713 }
23714 #else
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)23715 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
23716     if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
23717 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
23718     if (likely(PyUnicode_IS_ASCII(o))) {
23719         *length = PyUnicode_GET_LENGTH(o);
23720         return PyUnicode_AsUTF8(o);
23721     } else {
23722         PyUnicode_AsASCIIString(o);
23723         return NULL;
23724     }
23725 #else
23726     return PyUnicode_AsUTF8AndSize(o, length);
23727 #endif
23728 }
23729 #endif
23730 #endif
__Pyx_PyObject_AsStringAndSize(PyObject * o,Py_ssize_t * length)23731 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
23732 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
23733     if (
23734 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
23735             __Pyx_sys_getdefaultencoding_not_ascii &&
23736 #endif
23737             PyUnicode_Check(o)) {
23738         return __Pyx_PyUnicode_AsStringAndSize(o, length);
23739     } else
23740 #endif
23741 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
23742     if (PyByteArray_Check(o)) {
23743         *length = PyByteArray_GET_SIZE(o);
23744         return PyByteArray_AS_STRING(o);
23745     } else
23746 #endif
23747     {
23748         char* result;
23749         int r = PyBytes_AsStringAndSize(o, &result, length);
23750         if (unlikely(r < 0)) {
23751             return NULL;
23752         } else {
23753             return result;
23754         }
23755     }
23756 }
__Pyx_PyObject_IsTrue(PyObject * x)23757 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
23758    int is_true = x == Py_True;
23759    if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
23760    else return PyObject_IsTrue(x);
23761 }
__Pyx_PyObject_IsTrueAndDecref(PyObject * x)23762 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
23763     int retval;
23764     if (unlikely(!x)) return -1;
23765     retval = __Pyx_PyObject_IsTrue(x);
23766     Py_DECREF(x);
23767     return retval;
23768 }
__Pyx_PyNumber_IntOrLongWrongResultType(PyObject * result,const char * type_name)23769 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
23770 #if PY_MAJOR_VERSION >= 3
23771     if (PyLong_Check(result)) {
23772         if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
23773                 "__int__ returned non-int (type %.200s).  "
23774                 "The ability to return an instance of a strict subclass of int "
23775                 "is deprecated, and may be removed in a future version of Python.",
23776                 Py_TYPE(result)->tp_name)) {
23777             Py_DECREF(result);
23778             return NULL;
23779         }
23780         return result;
23781     }
23782 #endif
23783     PyErr_Format(PyExc_TypeError,
23784                  "__%.4s__ returned non-%.4s (type %.200s)",
23785                  type_name, type_name, Py_TYPE(result)->tp_name);
23786     Py_DECREF(result);
23787     return NULL;
23788 }
__Pyx_PyNumber_IntOrLong(PyObject * x)23789 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
23790 #if CYTHON_USE_TYPE_SLOTS
23791   PyNumberMethods *m;
23792 #endif
23793   const char *name = NULL;
23794   PyObject *res = NULL;
23795 #if PY_MAJOR_VERSION < 3
23796   if (likely(PyInt_Check(x) || PyLong_Check(x)))
23797 #else
23798   if (likely(PyLong_Check(x)))
23799 #endif
23800     return __Pyx_NewRef(x);
23801 #if CYTHON_USE_TYPE_SLOTS
23802   m = Py_TYPE(x)->tp_as_number;
23803   #if PY_MAJOR_VERSION < 3
23804   if (m && m->nb_int) {
23805     name = "int";
23806     res = m->nb_int(x);
23807   }
23808   else if (m && m->nb_long) {
23809     name = "long";
23810     res = m->nb_long(x);
23811   }
23812   #else
23813   if (likely(m && m->nb_int)) {
23814     name = "int";
23815     res = m->nb_int(x);
23816   }
23817   #endif
23818 #else
23819   if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
23820     res = PyNumber_Int(x);
23821   }
23822 #endif
23823   if (likely(res)) {
23824 #if PY_MAJOR_VERSION < 3
23825     if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
23826 #else
23827     if (unlikely(!PyLong_CheckExact(res))) {
23828 #endif
23829         return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
23830     }
23831   }
23832   else if (!PyErr_Occurred()) {
23833     PyErr_SetString(PyExc_TypeError,
23834                     "an integer is required");
23835   }
23836   return res;
23837 }
23838 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
23839   Py_ssize_t ival;
23840   PyObject *x;
23841 #if PY_MAJOR_VERSION < 3
23842   if (likely(PyInt_CheckExact(b))) {
23843     if (sizeof(Py_ssize_t) >= sizeof(long))
23844         return PyInt_AS_LONG(b);
23845     else
23846         return PyInt_AsSsize_t(b);
23847   }
23848 #endif
23849   if (likely(PyLong_CheckExact(b))) {
23850     #if CYTHON_USE_PYLONG_INTERNALS
23851     const digit* digits = ((PyLongObject*)b)->ob_digit;
23852     const Py_ssize_t size = Py_SIZE(b);
23853     if (likely(__Pyx_sst_abs(size) <= 1)) {
23854         ival = likely(size) ? digits[0] : 0;
23855         if (size == -1) ival = -ival;
23856         return ival;
23857     } else {
23858       switch (size) {
23859          case 2:
23860            if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
23861              return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
23862            }
23863            break;
23864          case -2:
23865            if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
23866              return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
23867            }
23868            break;
23869          case 3:
23870            if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
23871              return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
23872            }
23873            break;
23874          case -3:
23875            if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
23876              return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
23877            }
23878            break;
23879          case 4:
23880            if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
23881              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]));
23882            }
23883            break;
23884          case -4:
23885            if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
23886              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]));
23887            }
23888            break;
23889       }
23890     }
23891     #endif
23892     return PyLong_AsSsize_t(b);
23893   }
23894   x = PyNumber_Index(b);
23895   if (!x) return -1;
23896   ival = PyInt_AsSsize_t(x);
23897   Py_DECREF(x);
23898   return ival;
23899 }
23900 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
23901   return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
23902 }
23903 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
23904     return PyInt_FromSize_t(ival);
23905 }
23906 
23907 
23908 #endif /* Py_PYTHON_H */
23909